changeset 11272:aa9317d124fc libavcodec

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
author michael
date Wed, 24 Feb 2010 16:16:08 +0000
parents bf3436efe037
children a2cb557201bb
files h264_cabac.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264_cabac.c	Wed Feb 24 13:12:09 2010 +0000
+++ b/h264_cabac.c	Wed Feb 24 16:16:08 2010 +0000
@@ -915,7 +915,7 @@
     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;