[x264-devel] commit: Fix 10L in r1612 (Jason Garrett-Glaser )

git at videolan.org git at videolan.org
Wed May 26 21:47:52 CEST 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Wed May 26 12:40:31 2010 -0700| [81e75e91cad61079ce9579d133316b1faf78f357] | committer: Jason Garrett-Glaser 

Fix 10L in r1612
Stats need to be calculated before deblock strength, not after.
Broke ref stats in x264cli (no affect on actual output).

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=81e75e91cad61079ce9579d133316b1faf78f357
---

 encoder/encoder.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/encoder/encoder.c b/encoder/encoder.c
index ea14cef..52017ff 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -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 )



More information about the x264-devel mailing list