[x264-devel] commit: Fix bug with various bizarre commandline combinations and mbtree ( Jason Garrett-Glaser )

git version control git at videolan.org
Wed Sep 23 11:01:52 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Fri Sep 18 14:28:31 2009 -0700| [ca95d6198f5c21ff6904a842b52b893d0fee6aab] | committer: Jason Garrett-Glaser 

Fix bug with various bizarre commandline combinations and mbtree
Second pass would have mbtree on even though the first pass didn't (and thus encoding would immediately fail).

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

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

diff --git a/encoder/encoder.c b/encoder/encoder.c
index 68d019e..207e724 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -513,12 +513,11 @@ static int x264_validate_parameters( x264_t *h )
         h->param.rc.i_lookahead = X264_MIN( h->param.rc.i_lookahead, X264_MAX( h->param.i_keyint_max, bufsize*fps ) );
     }
 
+    h->param.rc.f_qcompress = x264_clip3f( h->param.rc.f_qcompress, 0.0, 1.0 );
+    if( !h->param.rc.i_lookahead || h->param.i_keyint_max == 1 || h->param.rc.f_qcompress == 1 )
+        h->param.rc.b_mb_tree = 0;
     if( h->param.rc.b_stat_read )
         h->param.rc.i_lookahead = 0;
-    else if( !h->param.rc.i_lookahead || h->param.i_keyint_max == 1 )
-        h->param.rc.b_mb_tree = 0;
-    if( h->param.rc.f_qcompress == 1 )
-        h->param.rc.b_mb_tree = 0;
 #ifdef HAVE_PTHREAD
     if( h->param.i_sync_lookahead )
         h->param.i_sync_lookahead = x264_clip3( h->param.i_sync_lookahead, h->param.i_threads + h->param.i_bframe, X264_LOOKAHEAD_MAX );



More information about the x264-devel mailing list