summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbradleys <[email protected]>2014-06-22 18:11:55 +0000
committerbradleys <[email protected]>2014-06-22 18:11:55 +0000
commit0cca911567c065136889fbc137368cc58255fdeb (patch)
treee332f6079ae2656943e95d1983126a8d9e9bdeed /test
parent7fba1c6ad31aa1002624223ef34b612efa8262f4 (diff)
CLI: Improve nlmeans-tune logging and error handling.
The latter fixes a compiler issue. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6217 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r--test/test.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/test/test.c b/test/test.c
index 249f8adcf..71a4d02f0 100644
--- a/test/test.c
+++ b/test/test.c
@@ -15,6 +15,7 @@
#include <time.h>
#include <unistd.h>
#include <inttypes.h>
+#include <regex.h>
#if defined( __MINGW32__ )
#include <windows.h>
@@ -4133,7 +4134,7 @@ static int ParseOptions( int argc, char ** argv )
denoise = 1;
break;
case FILTER_NLMEANS:
- if(optarg != NULL)
+ if (optarg != NULL)
{
free(nlmeans_opt);
nlmeans_opt = strdup(optarg);
@@ -4141,20 +4142,11 @@ static int ParseOptions( int argc, char ** argv )
nlmeans = 1;
break;
case FILTER_NLMEANS_TUNE:
- if (!strcmp(optarg, "none") ||
- !strcmp(optarg, "film") ||
- !strcmp(optarg, "grain") ||
- !strcmp(optarg, "highmotion") ||
- !strcmp(optarg, "animation"))
+ if (optarg != NULL)
{
free(nlmeans_tune_opt);
nlmeans_tune_opt = strdup(optarg);
}
- else
- {
- fprintf(stderr, "invalid nlmeans tune (%s)\n", optarg);
- return -1;
- }
break;
case '9':
if( optarg != NULL )
@@ -4605,6 +4597,11 @@ static int ParseOptions( int argc, char ** argv )
strength[0] = 10; strength[1] = 8;
}
}
+ else
+ {
+ fprintf(stderr, "Unrecognized nlmeans tune (%s).\n", nlmeans_tune_opt);
+ return -1;
+ }
sprintf(opt, "%lf:%lf:%d:%d:%d:%d:%lf:%lf:%d:%d:%d:%d",
strength[0], origin_tune[0], patch_size[0], range[0], frames[0], prefilter[0],
@@ -4614,6 +4611,20 @@ static int ParseOptions( int argc, char ** argv )
nlmeans_opt = strdup(opt);
}
+ else
+ {
+ if (nlmeans_tune_opt != NULL)
+ {
+ fprintf(stdout, "Custom nlmeans parameters specified; ignoring nlmeans tune (%s).\n", nlmeans_tune_opt);
+ }
+ }
+ }
+ else if (nlmeans == 1 && nlmeans_opt == NULL)
+ {
+ if (nlmeans_tune_opt != NULL)
+ {
+ fprintf(stdout, "Default nlmeans parameters specified; ignoring nlmeans tune (%s).\n", nlmeans_tune_opt);
+ }
}
return 0;