From 8300d3344b73612ec449a2c2ee259c654fef9d0a Mon Sep 17 00:00:00 2001 From: Loren Merritt Date: Wed, 11 Apr 2007 22:21:15 +0000 Subject: [PATCH] remove the restriction on number of threads as a function of resolution (it was wrong anyway in the presence of B-frames), and raise the max number of threads in general (though more will have to be done before it can really scale to lots of cores). git-svn-id: svn://svn.videolan.org/x264/trunk@650 df754926-b1dd-0310-bc7b-ec298dee348c --- common/common.h | 2 +- encoder/encoder.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/common/common.h b/common/common.h index 74f8c108..fadc3664 100644 --- a/common/common.h +++ b/common/common.h @@ -125,7 +125,7 @@ } #define X264_BFRAME_MAX 16 -#define X264_THREAD_MAX 16 +#define X264_THREAD_MAX 128 #define X264_SLICE_MAX 4 #define X264_NAL_MAX (4 + X264_SLICE_MAX) #define X264_THREAD_HEIGHT 24 // number of pixels (per thread) in progress at any given time. could theoretically be as low as 22 diff --git a/encoder/encoder.c b/encoder/encoder.c index ddf843ab..181685a1 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -352,7 +352,6 @@ static int x264_validate_parameters( x264_t *h ) if( h->param.i_threads == 0 ) h->param.i_threads = x264_cpu_num_processors() * 3/2; h->param.i_threads = x264_clip3( h->param.i_threads, 1, X264_THREAD_MAX ); - h->param.i_threads = X264_MIN( h->param.i_threads, 1 + (h->param.i_height >> h->param.b_interlaced) / (X264_THREAD_HEIGHT + 16) ); // FIXME exact limit? if( h->param.i_threads > 1 ) { #ifndef HAVE_PTHREAD -- 2.47.3