]> git.videolan.org Git - x264.git/commitdiff
Fix 10L in r1612
authorJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 26 May 2010 19:40:31 +0000 (12:40 -0700)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Wed, 26 May 2010 19:40:31 +0000 (12:40 -0700)
Stats need to be calculated before deblock strength, not after.
Broke ref stats in x264cli (no affect on actual output).

encoder/encoder.c

index ea14cefcca9625b04c0606b5243655bda6a4faa8..52017ff0eb492514c6a306ccf5a454e3b4a0e73c 100644 (file)
@@ -1893,19 +1893,6 @@ static int x264_slice_write( x264_t *h )
         /* save cache */
         x264_macroblock_cache_save( h );
 
-        /* calculate deblock strength values (actual deblocking is done per-row along with hpel) */
-        if( b_deblock )
-        {
-            int mvy_limit = 4 >> h->sh.b_mbaff;
-            uint8_t (*bs)[4][4] = h->deblock_strength[h->mb.i_mb_y&h->sh.b_mbaff][h->mb.i_mb_x];
-            x264_macroblock_cache_load_deblock( h );
-            if( IS_INTRA( h->mb.type[h->mb.i_mb_xy] ) )
-                memset( bs, 3, 2*4*4*sizeof(uint8_t) );
-            else
-                h->loopf.deblock_strength( h->mb.cache.non_zero_count, h->mb.cache.ref, h->mb.cache.mv,
-                                           bs, mvy_limit, h->sh.i_type == SLICE_TYPE_B );
-        }
-
         /* accumulate mb stats */
         h->stat.frame.i_mb_count[h->mb.i_type]++;
 
@@ -1959,6 +1946,19 @@ static int x264_slice_write( x264_t *h )
             }
         }
 
+        /* calculate deblock strength values (actual deblocking is done per-row along with hpel) */
+        if( b_deblock )
+        {
+            int mvy_limit = 4 >> h->sh.b_mbaff;
+            uint8_t (*bs)[4][4] = h->deblock_strength[h->mb.i_mb_y&h->sh.b_mbaff][h->mb.i_mb_x];
+            x264_macroblock_cache_load_deblock( h );
+            if( IS_INTRA( h->mb.type[h->mb.i_mb_xy] ) )
+                memset( bs, 3, 2*4*4*sizeof(uint8_t) );
+            else
+                h->loopf.deblock_strength( h->mb.cache.non_zero_count, h->mb.cache.ref, h->mb.cache.mv,
+                                           bs, mvy_limit, h->sh.i_type == SLICE_TYPE_B );
+        }
+
         x264_ratecontrol_mb( h, mb_size );
 
         if( h->sh.b_mbaff )