diff options
author | Stefan Gehrer <stefan.gehrer@gmx.de> | 2010-06-23 21:45:26 +0000 |
---|---|---|
committer | Stefan Gehrer <stefan.gehrer@gmx.de> | 2010-06-23 21:45:26 +0000 |
commit | 8f910a5621bbde066bf62fe2b06f11d742ec0756 (patch) | |
tree | 43199822bbb32322177114e776c25d7731f3d5e4 | |
parent | 79aec7579252c74834e0c1aae91ff835b7a2abe8 (diff) | |
download | ffmpeg-8f910a5621bbde066bf62fe2b06f11d742ec0756.tar.gz |
avoid conditional and division in chroma MV calculation
Originally committed as revision 23745 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vp8.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index b1c40e8492..3d735e5c13 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -989,8 +989,8 @@ static void inter_predict(VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, mb->bmv[ 2*y * 4 + 2*x+1].y + mb->bmv[(2*y+1) * 4 + 2*x ].y + mb->bmv[(2*y+1) * 4 + 2*x+1].y; - uvmv.x = (uvmv.x + (uvmv.x < 0 ? -2 : 2)) / 4; - uvmv.y = (uvmv.y + (uvmv.y < 0 ? -2 : 2)) / 4; + uvmv.x = (uvmv.x + 2 + (uvmv.x >> (INT_BIT-1))) >> 2; + uvmv.y = (uvmv.y + 2 + (uvmv.y >> (INT_BIT-1))) >> 2; if (s->profile == 3) { uvmv.x &= ~7; uvmv.y &= ~7; |