[x264-devel] commit: Fix case in which MB-tree didn't propagate all data correctly ( Anton Mitrofanov )

git version control git at videolan.org
Fri Oct 30 03:13:34 CET 2009


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Wed Oct 28 12:57:11 2009 -0700| [5c7133b0607b220a02e37cf72612c97484384cd8] | committer: Jason Garrett-Glaser 

Fix case in which MB-tree didn't propagate all data correctly
Should improve quality in all cases.
Also some minor cosmetic improvements.

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

 encoder/slicetype.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 2468a43..67a2861 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -506,7 +506,7 @@ static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
         i--;
     last_nonb = i;
 
-    if( last_nonb < 0 )
+    if( last_nonb < idx )
         return;
 
     memset( frames[last_nonb]->i_propagate_cost, 0, h->mb.i_mb_count * sizeof(uint16_t) );
@@ -519,14 +519,14 @@ static void x264_macroblock_tree( x264_t *h, x264_mb_analysis_t *a, x264_frame_t
             break;
         x264_slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, last_nonb, 0 );
         memset( frames[cur_nonb]->i_propagate_cost, 0, h->mb.i_mb_count * sizeof(uint16_t) );
-        x264_macroblock_tree_propagate( h, frames, cur_nonb, last_nonb, last_nonb );
-        while( frames[i]->i_type == X264_TYPE_B && i > 0 )
+        while( i > cur_nonb )
         {
             x264_slicetype_frame_cost( h, a, frames, cur_nonb, last_nonb, i, 0 );
             memset( frames[i]->i_propagate_cost, 0, h->mb.i_mb_count * sizeof(uint16_t) );
             x264_macroblock_tree_propagate( h, frames, cur_nonb, last_nonb, i );
             i--;
         }
+        x264_macroblock_tree_propagate( h, frames, cur_nonb, last_nonb, last_nonb );
         last_nonb = cur_nonb;
     }
 



More information about the x264-devel mailing list