[FFmpeg-cvslog] r21283 - in trunk/libavcodec: h264.h h264_loopfilter.c

michael subversion
Mon Jan 18 14:09:53 CET 2010


Author: michael
Date: Mon Jan 18 14:09:53 2010
New Revision: 21283

Log:
Move CAVLC 8x8 DCT special case from ff_h264_filter_mb() to fill_caches
that way it is also available for ff_h264_filter_mb_fast().

Modified:
   trunk/libavcodec/h264.h
   trunk/libavcodec/h264_loopfilter.c

Modified: trunk/libavcodec/h264.h
==============================================================================
--- trunk/libavcodec/h264.h	Mon Jan 18 12:18:25 2010	(r21282)
+++ trunk/libavcodec/h264.h	Mon Jan 18 14:09:53 2010	(r21283)
@@ -992,6 +992,38 @@ static av_always_inline int fill_caches(
         }
     }
 
+    // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
+    if(for_deblock && !CABAC && h->pps.transform_8x8_mode){
+        if(IS_8x8DCT(top_type)){
+            h->non_zero_count_cache[4+8*0]=
+            h->non_zero_count_cache[5+8*0]= h->cbp_table[top_xy] & 4;
+            h->non_zero_count_cache[6+8*0]=
+            h->non_zero_count_cache[7+8*0]= h->cbp_table[top_xy] & 8;
+        }
+        if(IS_8x8DCT(left_type[0])){
+            h->non_zero_count_cache[3+8*1]=
+            h->non_zero_count_cache[3+8*2]= h->cbp_table[left_xy[0]]&2; //FIXME check MBAFF
+        }
+        if(IS_8x8DCT(left_type[1])){
+            h->non_zero_count_cache[3+8*3]=
+            h->non_zero_count_cache[3+8*4]= h->cbp_table[left_xy[1]]&8; //FIXME check MBAFF
+        }
+
+        if(IS_8x8DCT(mb_type)){
+            h->non_zero_count_cache[scan8[0   ]]= h->non_zero_count_cache[scan8[1   ]]=
+            h->non_zero_count_cache[scan8[2   ]]= h->non_zero_count_cache[scan8[3   ]]= h->cbp_table[mb_xy] & 1;
+
+            h->non_zero_count_cache[scan8[0+ 4]]= h->non_zero_count_cache[scan8[1+ 4]]=
+            h->non_zero_count_cache[scan8[2+ 4]]= h->non_zero_count_cache[scan8[3+ 4]]= h->cbp_table[mb_xy] & 2;
+
+            h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=
+            h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= h->cbp_table[mb_xy] & 4;
+
+            h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=
+            h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= h->cbp_table[mb_xy] & 8;
+        }
+    }
+
     if( CABAC && !for_deblock) {
         // top_cbp
         if(top_type) {

Modified: trunk/libavcodec/h264_loopfilter.c
==============================================================================
--- trunk/libavcodec/h264_loopfilter.c	Mon Jan 18 12:18:25 2010	(r21282)
+++ trunk/libavcodec/h264_loopfilter.c	Mon Jan 18 14:09:53 2010	(r21283)
@@ -648,43 +648,6 @@ void ff_h264_filter_mb( H264Context *h, 
     av_unused int dir;
     int list;
 
-    // CAVLC 8x8dct requires NNZ values for residual decoding that differ from what the loop filter needs
-    if(!h->pps.cabac && h->pps.transform_8x8_mode){
-        int top_type, left_type[2];
-        top_type     = s->current_picture.mb_type[h->top_mb_xy]    ;
-        left_type[0] = s->current_picture.mb_type[h->left_mb_xy[0]];
-        left_type[1] = s->current_picture.mb_type[h->left_mb_xy[1]];
-
-        if(IS_8x8DCT(top_type)){
-            h->non_zero_count_cache[4+8*0]=
-            h->non_zero_count_cache[5+8*0]= h->cbp_table[h->top_mb_xy] & 4;
-            h->non_zero_count_cache[6+8*0]=
-            h->non_zero_count_cache[7+8*0]= h->cbp_table[h->top_mb_xy] & 8;
-        }
-        if(IS_8x8DCT(left_type[0])){
-            h->non_zero_count_cache[3+8*1]=
-            h->non_zero_count_cache[3+8*2]= h->cbp_table[h->left_mb_xy[0]]&2; //FIXME check MBAFF
-        }
-        if(IS_8x8DCT(left_type[1])){
-            h->non_zero_count_cache[3+8*3]=
-            h->non_zero_count_cache[3+8*4]= h->cbp_table[h->left_mb_xy[1]]&8; //FIXME check MBAFF
-        }
-
-        if(IS_8x8DCT(mb_type)){
-            h->non_zero_count_cache[scan8[0   ]]= h->non_zero_count_cache[scan8[1   ]]=
-            h->non_zero_count_cache[scan8[2   ]]= h->non_zero_count_cache[scan8[3   ]]= h->cbp_table[mb_xy] & 1;
-
-            h->non_zero_count_cache[scan8[0+ 4]]= h->non_zero_count_cache[scan8[1+ 4]]=
-            h->non_zero_count_cache[scan8[2+ 4]]= h->non_zero_count_cache[scan8[3+ 4]]= h->cbp_table[mb_xy] & 2;
-
-            h->non_zero_count_cache[scan8[0+ 8]]= h->non_zero_count_cache[scan8[1+ 8]]=
-            h->non_zero_count_cache[scan8[2+ 8]]= h->non_zero_count_cache[scan8[3+ 8]]= h->cbp_table[mb_xy] & 4;
-
-            h->non_zero_count_cache[scan8[0+12]]= h->non_zero_count_cache[scan8[1+12]]=
-            h->non_zero_count_cache[scan8[2+12]]= h->non_zero_count_cache[scan8[3+12]]= h->cbp_table[mb_xy] & 8;
-        }
-    }
-
     if (FRAME_MBAFF
             // left mb is in picture
             && h->slice_table[mb_xy-1] != 0xFFFF



More information about the ffmpeg-cvslog mailing list