[x264-devel] Fix regression in r1944

Jason Garrett-Glaser git at videolan.org
Thu May 12 08:38:55 CEST 2011


x264 | branch: master | Jason Garrett-Glaser <jason at x264.com> | Tue May 10 01:58:21 2011 -0700| [b56cb86feed3d0981e422c47ff8ec75a9b66445b] | committer: Jason Garrett-Glaser

Fix regression in r1944
Broke sliced-threads + slice-max-size/slice-max-mbs.

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

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

diff --git a/encoder/encoder.c b/encoder/encoder.c
index e81172d..c80fac4 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -570,22 +570,6 @@ static int x264_validate_parameters( x264_t *h, int b_open )
         h->param.rc.i_vbv_max_bitrate = 0;
     }
 
-    h->param.b_interlaced = !!h->param.b_interlaced;
-    int max_slices = (h->param.i_height+((16<<h->param.b_interlaced)-1))/(16<<h->param.b_interlaced);
-    if( h->param.b_sliced_threads )
-    {
-        h->param.i_slice_count = x264_clip3( h->param.i_threads, 0, max_slices );
-        h->param.i_slice_max_size = 0;
-        h->param.i_slice_max_mbs = 0;
-    }
-    else
-    {
-        h->param.i_slice_count = x264_clip3( h->param.i_slice_count, 0, max_slices );
-        h->param.i_slice_max_size = X264_MAX( h->param.i_slice_max_size, 0 );
-        h->param.i_slice_max_mbs = X264_MAX( h->param.i_slice_max_mbs, 0 );
-        if( h->param.i_slice_max_mbs || h->param.i_slice_max_size )
-            h->param.i_slice_count = 0;
-    }
     if( h->param.b_interlaced && h->param.i_slice_max_size )
     {
         x264_log( h, X264_LOG_WARNING, "interlaced + slice-max-size is not implemented\n" );
@@ -596,6 +580,19 @@ static int x264_validate_parameters( x264_t *h, int b_open )
         x264_log( h, X264_LOG_WARNING, "interlaced + slice-max-mbs is not implemented\n" );
         h->param.i_slice_max_mbs = 0;
     }
+    h->param.i_slice_max_size = X264_MAX( h->param.i_slice_max_size, 0 );
+    h->param.i_slice_max_mbs = X264_MAX( h->param.i_slice_max_mbs, 0 );
+
+    h->param.b_interlaced = !!h->param.b_interlaced;
+    int max_slices = (h->param.i_height+((16<<h->param.b_interlaced)-1))/(16<<h->param.b_interlaced);
+    if( h->param.b_sliced_threads )
+        h->param.i_slice_count = x264_clip3( h->param.i_threads, 0, max_slices );
+    else
+    {
+        h->param.i_slice_count = x264_clip3( h->param.i_slice_count, 0, max_slices );
+        if( h->param.i_slice_max_mbs || h->param.i_slice_max_size )
+            h->param.i_slice_count = 0;
+    }
 
     if( h->param.b_bluray_compat )
     {



More information about the x264-devel mailing list