From 3bfd4954856c6dbc34a60db6585df86b0b2c57f3 Mon Sep 17 00:00:00 2001 From: Rodeo Date: Sat, 17 Aug 2013 23:21:45 +0000 Subject: 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 --- libhb/encx264.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 ) -- cgit v1.2.3