changeset 11207:22ca00416118 libavcodec

Get rid of a local variable, 10 cpu cycles faster.
author michael
date Fri, 19 Feb 2010 02:37:11 +0000
parents cb29d50bf6d4
children 2e77618615eb
files h264_cabac.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/h264_cabac.c	Thu Feb 18 23:37:48 2010 +0000
+++ b/h264_cabac.c	Fri Feb 19 02:37:11 2010 +0000
@@ -914,17 +914,16 @@
                h->mvd_cache[list][scan8[n] - 8][l];
     int ctxbase = (l == 0) ? 40 : 47;
     int mvd;
-    int ctx = (amvd>2) + (amvd>32);
 
-    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+ctx]))
+    if(!get_cabac(&h->cabac, &h->cabac_state[ctxbase+(amvd>2) + (amvd>32)]))
         return 0;
 
     mvd= 1;
-    ctx= 3;
-    while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase+ctx] ) ) {
+    ctxbase+= 3;
+    while( mvd < 9 && get_cabac( &h->cabac, &h->cabac_state[ctxbase] ) ) {
+        if( mvd < 4 )
+            ctxbase++;
         mvd++;
-        if( ctx < 6 )
-            ctx++;
     }
 
     if( mvd >= 9 ) {