]> git.sesse.net Git - ffmpeg/commitdiff
decrease ff_h264_norm_shift[] size
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Oct 2006 00:59:42 +0000 (00:59 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 9 Oct 2006 00:59:42 +0000 (00:59 +0000)
Originally committed as revision 6596 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/cabac.c
libavcodec/cabac.h

index f724dd53689ee0bfc0675bc2cbaf83d663bf6eef..52e6c50e47a09ccfb4b1f655d3116337d5f3584a 100644 (file)
@@ -72,23 +72,15 @@ const uint8_t ff_h264_lps_state[64]= {
  36,36,37,37,37,38,38,63,
 };
 
-const uint8_t ff_h264_norm_shift[256]= {
- 9,8,7,7,6,6,6,6,5,5,5,5,5,5,5,5,
- 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
- 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
+const uint8_t ff_h264_norm_shift[128]= {
+ 7,6,5,5,4,4,4,4,3,3,3,3,3,3,3,3,
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
 };
 
 /**
index 4b89223b7607eb64cb80dc7953bde79ec51e179e..ff3994db07d55500b19eddc64dfb625ec89cdde1 100644 (file)
@@ -51,7 +51,7 @@ typedef struct CABACContext{
 extern const uint8_t ff_h264_lps_range[64][4];
 extern const uint8_t ff_h264_mps_state[64];
 extern const uint8_t ff_h264_lps_state[64];
-extern const uint8_t ff_h264_norm_shift[256];
+extern const uint8_t ff_h264_norm_shift[128];
 
 
 void ff_init_cabac_encoder(CABACContext *c, uint8_t *buf, int buf_size);
@@ -270,7 +270,7 @@ static void refill2(CABACContext *c){
     int i, x;
 
     x= c->low ^ (c->low-1);
-    i= 9 - ff_h264_norm_shift[x>>(CABAC_BITS+1)];
+    i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS+1)];
 
     x= -CABAC_MASK;
 
@@ -393,7 +393,7 @@ asm(
 #endif
         renorm_cabac_decoder_once(c);
     }else{
-        bit= ff_h264_norm_shift[RangeLPS>>17];
+        bit= ff_h264_norm_shift[RangeLPS>>19];
         c->low -= c->range;
         *state= c->lps_state[s];
         c->range = RangeLPS<<bit;