diff options
author | Rodeo <[email protected]> | 2013-08-17 23:21:45 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2013-08-17 23:21:45 +0000 |
commit | 3bfd4954856c6dbc34a60db6585df86b0b2c57f3 (patch) | |
tree | c6b8916696c99f07009b33092d51a00cd002e2f7 /libhb/encx264.c | |
parent | 9639f31e716ad638dee133cae0c0cbc2dfb52392 (diff) |
encx264: auto-enable metrics when the relevant tune is requested.
Thanks to s55 for the suggestion.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5710 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/encx264.c')
-rw-r--r-- | libhb/encx264.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libhb/encx264.c b/libhb/encx264.c index 3396ea3c5..6f91c8b2b 100644 --- a/libhb/encx264.c +++ b/libhb/encx264.c @@ -90,6 +90,28 @@ int encx264Init( hb_work_object_t * w, hb_job_t * job ) return 1; } + /* If the PSNR or SSIM tunes are in use, enable the relevant metric */ + if (job->x264_tune != NULL && job->x264_tune[0] != '\0') + { + char *tmp = strdup(job->x264_tune); + char *tok = strtok(tmp, ",./-+"); + do + { + if (!strncasecmp(tok, "psnr", 4)) + { + param.analyse.b_psnr = 1; + break; + } + if (!strncasecmp(tok, "ssim", 4)) + { + param.analyse.b_ssim = 1; + break; + } + } + while ((tok = strtok(NULL, ",./-+")) != NULL); + free(tmp); + } + /* Some HandBrake-specific defaults; users can override them * using the advanced_opts string. */ if( job->pass == 2 && job->cfr != 1 ) |