Mercurial > libavcodec.hg
changeset 11937:bc617cceacb1 libavcodec
avoid conditional and division in chroma MV calculation
author | stefang |
---|---|
date | Wed, 23 Jun 2010 21:45:26 +0000 |
parents | 0a36d4b2144b |
children | a5c32cb046eb |
files | vp8.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;