]> git.videolan.org Git - x264.git/commitdiff
Fix regression in r1944
authorJason Garrett-Glaser <jason@x264.com>
Tue, 10 May 2011 08:58:21 +0000 (01:58 -0700)
committerJason Garrett-Glaser <jason@x264.com>
Tue, 10 May 2011 09:40:36 +0000 (02:40 -0700)
Broke sliced-threads + slice-max-size/slice-max-mbs.

encoder/encoder.c

index e81172d95b25a4da3527f7ede650017669dfb406..c80fac4508378bcd2f68369b64a830824e9e862c 100644 (file)
@@ -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 )
     {