Changeset fb163e84b3de0289ffff7c4ba3831c90595a1ebf

Show
Ignore:
Timestamp:
14/02/08 22:11:06 (10 months ago)
Author:
Dennis van Amerongen <trax@videolan.org>
git-committer:
Dennis van Amerongen <trax@videolan.org> 1203023466 +0000
git-parent:

[219a17b028a80e4a192a543fdcffff23892c174b]

git-author:
Dennis van Amerongen <trax@videolan.org> 1203023466 +0000
Message:

* modules/codec/x264.c: fix threads=0 (auto) which is the default setting for VLC but wasn't propogated to x264 which kept using its default threads=1 (thanks pengvado for spotting the problem). This fix gives a major performance boost on multi cpu systems when using the default settings.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/codec/x264.c

    re651381 rfb163e8  
    11661166    } 
    11671167 
     1168    /* BUILD 29 adds support for multi-threaded encoding while BUILD 49 (r543) 
     1169       also adds support for threads = 0 for automatically selecting an optimal 
     1170       value (cores * 1.5) based on detected CPUs. Default behavior for x264 is 
     1171       threads = 1, however VLC usage differs and uses threads = 0 (auto) by 
     1172       default unless ofcourse transcode threads is explicitly specified.. */ 
    11681173#if X264_BUILD >= 29 
    1169     /* As of r543 x264 will autodetect the number of cpus and will set 
    1170        the number of threads accordingly unless ofcourse the number of 
    1171        threads is explicitly specified... */ 
    1172     if( p_enc->i_threads >= 1 ) 
    1173         p_sys->param.i_threads = p_enc->i_threads; 
     1174    p_sys->param.i_threads = p_enc->i_threads; 
    11741175#endif 
    11751176 
     
    11891190    } 
    11901191 
    1191     /* We need to initialize pthreadw32 before we open the encoder, but only oncce for the whole application. Since pthreadw32 doesn't keep a refcount, do it ouurselves */ 
     1192    /* We need to initialize pthreadw32 before we open the encoder, 
     1193       but only oncce for the whole application. Since pthreadw32 
     1194       doesn't keep a refcount, do it ourselves. */ 
    11921195#ifdef PTW32_STATIC_LIB 
    11931196    vlc_value_t lock, count;