Remove slice_table checks from decode_cabac_mb_cbp_luma() and set left/top_cbp so
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Feb 2010 02:08:48 +0000 (02:08 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 14 Feb 2010 02:08:48 +0000 (02:08 +0000)
these checks arent needed.

Originally committed as revision 21819 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/h264.h
libavcodec/h264_cabac.c

index 9b4a72e..f5eb17b 100644 (file)
@@ -927,17 +927,17 @@ static void fill_decode_caches(H264Context *h, int mb_type){
         if(top_type) {
             h->top_cbp = h->cbp_table[top_xy];
         } else if(IS_INTRA(mb_type)) {
         if(top_type) {
             h->top_cbp = h->cbp_table[top_xy];
         } else if(IS_INTRA(mb_type)) {
-            h->top_cbp = 0x1C0;
+            h->top_cbp = 0x1CF;
         } else {
         } else {
-            h->top_cbp = 0;
+            h->top_cbp = 0x00F;
         }
         // left_cbp
         if (left_type[0]) {
             h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0;
         } else if(IS_INTRA(mb_type)) {
         }
         // left_cbp
         if (left_type[0]) {
             h->left_cbp = h->cbp_table[left_xy[0]] & 0x1f0;
         } else if(IS_INTRA(mb_type)) {
-            h->left_cbp = 0x1C0;
+            h->left_cbp = 0x1CF;
         } else {
         } else {
-            h->left_cbp = 0;
+            h->left_cbp = 0x00F;
         }
         if (left_type[0]) {
             h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1;
         }
         if (left_type[0]) {
             h->left_cbp |= ((h->cbp_table[left_xy[0]]>>((left_block[0]&(~1))+1))&0x1) << 1;
index aba25a5..a35b3eb 100644 (file)
@@ -867,8 +867,8 @@ static int decode_cabac_mb_chroma_pre_mode( H264Context *h) {
 static int decode_cabac_mb_cbp_luma( H264Context *h) {
     int cbp_b, cbp_a, ctx, cbp = 0;
 
 static int decode_cabac_mb_cbp_luma( H264Context *h) {
     int cbp_b, cbp_a, ctx, cbp = 0;
 
-    cbp_a = h->slice_table[h->left_mb_xy[0]] == h->slice_num ? h->left_cbp : -1;
-    cbp_b = h->slice_table[h->top_mb_xy]     == h->slice_num ? h->top_cbp  : -1;
+    cbp_a = h->left_cbp;
+    cbp_b = h->top_cbp;
 
     ctx = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04);
     cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]);
 
     ctx = !(cbp_a & 0x02) + 2 * !(cbp_b & 0x04);
     cbp |= get_cabac_noinline(&h->cabac, &h->cabac_state[73 + ctx]);