Commit 8300d334 authored by Loren Merritt's avatar Loren Merritt

remove the restriction on number of threads as a function of resolution (it...

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
parent 8ecf4b91
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
} }
#define X264_BFRAME_MAX 16 #define X264_BFRAME_MAX 16
#define X264_THREAD_MAX 16 #define X264_THREAD_MAX 128
#define X264_SLICE_MAX 4 #define X264_SLICE_MAX 4
#define X264_NAL_MAX (4 + X264_SLICE_MAX) #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 #define X264_THREAD_HEIGHT 24 // number of pixels (per thread) in progress at any given time. could theoretically be as low as 22
......
...@@ -352,7 +352,6 @@ static int x264_validate_parameters( x264_t *h ) ...@@ -352,7 +352,6 @@ static int x264_validate_parameters( x264_t *h )
if( h->param.i_threads == 0 ) if( h->param.i_threads == 0 )
h->param.i_threads = x264_cpu_num_processors() * 3/2; 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_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 ) if( h->param.i_threads > 1 )
{ {
#ifndef HAVE_PTHREAD #ifndef HAVE_PTHREAD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment