diff options
author | jbrjake <[email protected]> | 2009-09-15 15:16:05 +0000 |
---|---|---|
committer | jbrjake <[email protected]> | 2009-09-15 15:16:05 +0000 |
commit | f633abf9870301c5dacbcb7487de1d2942fbcc1c (patch) | |
tree | 66d11ff111377cbc5ddd2610e148036c2e2a0e01 /libhb/encx264.c | |
parent | 2a28e92a6328c774307851213b6da9f18c988f2f (diff) |
Updates x264 to r1259-dd026f2, bringing with it a bunch of changes you can read about on their git log. The most prominent change is macroblock tree rate control (read about it on doom9), which is on by default, and for most content it produces smaller, better quality encodes. Due to a minor, temporary issue with fades in baseline profile encodes, for the moment I'm disabling mbtree when bframes=0, but this can be overridden through explicitly specifying mbtree=1 in the x264 options string.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2823 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx264.c')
-rw-r--r-- | libhb/encx264.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c index 249d42c5a..a68bbd4a6 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -87,6 +87,51 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) x264_param_default( ¶m ); + /* Temporarily default mbtree to off for baseline, + overridable through x264 option strings. */ + if( job->x264opts != NULL && *job->x264opts != '\0' ) + { + char *x264opts, *x264opts_start; + + x264opts = x264opts_start = strdup(job->x264opts); + + while( x264opts_start && *x264opts ) + { + char *name = x264opts; + char *value; + int ret; + + x264opts += strcspn( x264opts, ":" ); + if( *x264opts ) + { + *x264opts = 0; + x264opts++; + } + + value = strchr( name, '=' ); + if( value ) + { + *value = 0; + value++; + } + + /* + When B-frames are enabled, the max frame count increments + by 1 (regardless of the number of B-frames). If you don't + change the duration of the video track when you mux, libmp4 + barfs. So, check if the x264opts aren't using B-frames, and + when they aren't, set the boolean job->areBframes as false. + */ + if( !( strcmp( name, "bframes" ) ) ) + { + if( atoi( value ) == 0 ) + { + param.rc.b_mb_tree = 0; + } + } + } + } + /* Enable metrics */ param.analyse.b_psnr = 1; param.analyse.b_ssim = 1; |