# HG changeset patch # User stefang # Date 1277329526 0 # Node ID bc617cceacb1d64af68bdf0f091c2f9b0b570f37 # Parent 0a36d4b2144b4aac1cb1aad6f95a5c6caa930628 avoid conditional and division in chroma MV calculation diff -r 0a36d4b2144b -r bc617cceacb1 vp8.c --- a/vp8.c Wed Jun 23 21:22:56 2010 +0000 +++ b/vp8.c Wed Jun 23 21:45:26 2010 +0000 @@ -989,8 +989,8 @@ 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;