[FFmpeg-cvslog] r22027 - trunk/libavcodec/h264_cabac.c

michael subversion
Wed Feb 24 17:16:08 CET 2010


Author: michael
Date: Wed Feb 24 17:16:08 2010
New Revision: 22027

Log:
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

Modified:
   trunk/libavcodec/h264_cabac.c

Modified: trunk/libavcodec/h264_cabac.c
==============================================================================
--- trunk/libavcodec/h264_cabac.c	Wed Feb 24 15:45:18 2010	(r22026)
+++ trunk/libavcodec/h264_cabac.c	Wed Feb 24 17:16:08 2010	(r22027)
@@ -915,7 +915,7 @@ static int decode_cabac_mb_mvd( H264Cont
     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;



More information about the ffmpeg-cvslog mailing list