[FFmpeg-cvslog] r21432 - trunk/libavcodec/h264_cavlc.c

michael subversion
Sun Jan 24 19:42:22 CET 2010


Author: michael
Date: Sun Jan 24 19:42:22 2010
New Revision: 21432

Log:
a[b-1] -> (a-1)[b].
Helps gcc not to add seperate -1 instructions.

Modified:
   trunk/libavcodec/h264_cavlc.c

Modified: trunk/libavcodec/h264_cavlc.c
==============================================================================
--- trunk/libavcodec/h264_cavlc.c	Sun Jan 24 19:23:46 2010	(r21431)
+++ trunk/libavcodec/h264_cavlc.c	Sun Jan 24 19:42:22 2010	(r21432)
@@ -478,9 +478,9 @@ static int decode_residual(H264Context *
         zeros_left=0;
     else{
         if(n == CHROMA_DC_BLOCK_INDEX)
-            zeros_left= get_vlc2(gb, chroma_dc_total_zeros_vlc[ total_coeff-1 ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
+            zeros_left= get_vlc2(gb, (chroma_dc_total_zeros_vlc-1)[ total_coeff ].table, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, 1);
         else
-            zeros_left= get_vlc2(gb, total_zeros_vlc[ total_coeff-1 ].table, TOTAL_ZEROS_VLC_BITS, 1);
+            zeros_left= get_vlc2(gb, (total_zeros_vlc-1)[ total_coeff ].table, TOTAL_ZEROS_VLC_BITS, 1);
     }
 
     coeff_num = zeros_left + total_coeff - 1;
@@ -491,7 +491,7 @@ static int decode_residual(H264Context *
             if(zeros_left <= 0)
                 run_before = 0;
             else if(zeros_left < 7){
-                run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1);
+                run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
             }else{
                 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
             }
@@ -507,7 +507,7 @@ static int decode_residual(H264Context *
             if(zeros_left <= 0)
                 run_before = 0;
             else if(zeros_left < 7){
-                run_before= get_vlc2(gb, run_vlc[zeros_left-1].table, RUN_VLC_BITS, 1);
+                run_before= get_vlc2(gb, (run_vlc-1)[zeros_left].table, RUN_VLC_BITS, 1);
             }else{
                 run_before= get_vlc2(gb, run7_vlc.table, RUN7_VLC_BITS, 2);
             }



More information about the ffmpeg-cvslog mailing list