diff options
author | Måns Rullgård <mans@mansr.com> | 2007-07-11 21:04:53 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2007-07-11 21:04:53 +0000 |
commit | 00f0564f4439f060c7ad38760078c4e9eb879257 (patch) | |
tree | 841646ea09294e22aaeef00a024fa85b13184d3e /libavcodec/mpegvideo.h | |
parent | aa89fa07b0b23a8de9c0cf02798b4f3b28f29fdf (diff) | |
download | ffmpeg-00f0564f4439f060c7ad38760078c4e9eb879257.tar.gz |
move ff_h263_round_chroma() to mpegvideo.h as static inline
Originally committed as revision 9600 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.h')
-rw-r--r-- | libavcodec/mpegvideo.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 8e2cac5cf5..b1c2f93731 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -762,6 +762,19 @@ static inline int get_bits_diff(MpegEncContext *s){ 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_resync(MpegEncContext *s); 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); |