Mercurial > libavcodec.hg
diff mpegvideo.h @ 5286:4393e09e32ec libavcodec
move ff_h263_round_chroma() to mpegvideo.h as static inline
author | mru |
---|---|
date | Wed, 11 Jul 2007 21:04:53 +0000 |
parents | 101f20612a94 |
children | 8c0bbf712d76 |
line wrap: on
line diff
--- a/mpegvideo.h Wed Jul 11 15:21:24 2007 +0000 +++ b/mpegvideo.h Wed Jul 11 21:04:53 2007 +0000 @@ -762,6 +762,19 @@ return bits - last; } +static inline int ff_h263_round_chroma(int x){ + static const uint8_t h263_chroma_roundtab[16] = { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + }; + if (x >= 0) + return (h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1)); + else { + x = -x; + return -(h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1)); + } +} + /* motion_est.c */ void ff_estimate_p_frame_motion(MpegEncContext * s, int mb_x, int mb_y); @@ -871,7 +884,6 @@ int ff_h263_get_gob_height(MpegEncContext *s); void ff_mpeg4_init_direct_mv(MpegEncContext *s); int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); -inline int ff_h263_round_chroma(int x); void ff_h263_encode_motion(MpegEncContext * s, int val, int f_code);