Mercurial > libavcodec.hg
comparison mpegvideo.h @ 5288:8c0bbf712d76 libavcodec
simplify ff_h263_round_chroma()
author | michael |
---|---|
date | Wed, 11 Jul 2007 22:05:25 +0000 |
parents | 4393e09e32ec |
children | 5581a40c673a |
comparison
equal
deleted
inserted
replaced
5287:6c3f73f20538 | 5288:8c0bbf712d76 |
---|---|
763 } | 763 } |
764 | 764 |
765 static inline int ff_h263_round_chroma(int x){ | 765 static inline int ff_h263_round_chroma(int x){ |
766 static const uint8_t h263_chroma_roundtab[16] = { | 766 static const uint8_t h263_chroma_roundtab[16] = { |
767 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 767 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
768 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, | 768 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, |
769 }; | 769 }; |
770 if (x >= 0) | 770 return h263_chroma_roundtab[x & 0xf] + (x >> 3); |
771 return (h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1)); | |
772 else { | |
773 x = -x; | |
774 return -(h263_chroma_roundtab[x & 0xf] + ((x >> 3) & ~1)); | |
775 } | |
776 } | 771 } |
777 | 772 |
778 /* motion_est.c */ | 773 /* motion_est.c */ |
779 void ff_estimate_p_frame_motion(MpegEncContext * s, | 774 void ff_estimate_p_frame_motion(MpegEncContext * s, |
780 int mb_x, int mb_y); | 775 int mb_x, int mb_y); |