aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2010-02-24 16:16:08 +0000
committerMichael Niedermayer <michaelni@gmx.at>2010-02-24 16:16:08 +0000
commit6d0155c79c5a30ecea5be1edac47c1f412a7a124 (patch)
treea3b2b1ae9be6b1ae0f72d10a02d3c8867479073b
parentbc77fce6ba17cb7c87f7c19751ba22ceba713aca (diff)
downloadffmpeg-6d0155c79c5a30ecea5be1edac47c1f412a7a124.tar.gz
Replace mvd>2 + mvd>32 by MIN((mvd+28)*17>>9, 2)
same speed as far as i can meassure but it might have fewer branches on some archs. Idea from x264 / jason Originally committed as revision 22027 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/h264_cabac.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 576273c3a8..708255c6f9 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -915,7 +915,7 @@ static int decode_cabac_mb_mvd( H264Context *h, int list, int n, int l ) {
int ctxbase = (l == 0) ? 40 : 47;
int mvd;
- if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2) + (amvd>32)]))
+ if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+FFMIN(((amvd+28)*17)>>9,2)]))
return 0;
mvd= 1;