From b56cb86feed3d0981e422c47ff8ec75a9b66445b Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Tue, 10 May 2011 01:58:21 -0700 Subject: [PATCH] Fix regression in r1944 Broke sliced-threads + slice-max-size/slice-max-mbs. --- encoder/encoder.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/encoder/encoder.c b/encoder/encoder.c index e81172d9..c80fac45 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<param.b_interlaced)-1))/(16<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<param.b_interlaced)-1))/(16<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 ) { -- 2.47.3