]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cabac.c
Replace "signed short" typecast with "int16_t" as suggested by
[ffmpeg] / libavcodec / cabac.c
index 91db6c33eaa8122a7a12b1a6f264c2e4688ae71d..7eb60b0ad236fa33047403c9580a4da2a7462a10 100644 (file)
@@ -17,7 +17,6 @@
  * You should have received a copy of the GNU Lesser General Public
  * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
  */
 
 /**
@@ -51,7 +50,7 @@ static const uint8_t lps_range[64][4]= {
 };
 
 uint8_t ff_h264_mlps_state[4*64];
-uint8_t ff_h264_lps_range[4][2*64];
+uint8_t ff_h264_lps_range[4*2*64];
 uint8_t ff_h264_lps_state[2*64];
 uint8_t ff_h264_mps_state[2*64];
 
@@ -152,8 +151,8 @@ void ff_init_cabac_states(CABACContext *c){
 
     for(i=0; i<64; i++){
         for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
-            ff_h264_lps_range[j][2*i+0]=
-            ff_h264_lps_range[j][2*i+1]= lps_range[i][j];
+            ff_h264_lps_range[j*2*64+2*i+0]=
+            ff_h264_lps_range[j*2*64+2*i+1]= lps_range[i][j];
         }
 
         ff_h264_mlps_state[128+2*i+0]=
@@ -180,6 +179,7 @@ void ff_init_cabac_states(CABACContext *c){
 }
 
 #if 0 //selftest
+#undef random
 #define SIZE 10240
 
 #include "avcodec.h"