[FFmpeg-devel] [PATCH] h264_cabac.c: branchless (amvd>2)+(amvd>32)

Zhou Zongyi zhouzy
Fri Feb 26 17:42:18 CET 2010


Modified patch:

Index: libavcodec/h264_cabac.c
===================================================================
--- libavcodec/h264_cabac.c (revision 22075)
+++ libavcodec/h264_cabac.c (working copy)
@@ -912,7 +912,7 @@
 static int decode_cabac_mb_mvd( H264Context *h, int ctxbase, int amvd, int *mvda) {
     int mvd;
 
-    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2)+(amvd>32)])){
+    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+((amvd-3)>>(INT_BIT-1))+((amvd-33)>>(INT_BIT-1))+2])){
         *mvda= 0;
         return 0;
     }

ZZ



More information about the ffmpeg-devel mailing list