summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodeo <[email protected]>2014-01-12 23:30:19 +0000
committerRodeo <[email protected]>2014-01-12 23:30:19 +0000
commit17917becc0cbf9ed402e9071935ae32b1d78fef7 (patch)
tree8a3ea65a7c681c4e62c6356f6e19a5b824b706d8
parentd4fdf932d85c988bae5a9046730a98f71c2364a5 (diff)
QSV: add an option to select the preferred implementation at runtime.
This is intended for developers only; having to rebuild just to compare software to hardware is annoying as hell. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5964 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--libhb/qsv_common.c5
-rw-r--r--libhb/qsv_common.h1
-rw-r--r--test/test.c42
3 files changed, 48 insertions, 0 deletions
diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c
index 195845200..322fabde3 100644
--- a/libhb/qsv_common.c
+++ b/libhb/qsv_common.c
@@ -1015,6 +1015,11 @@ uint8_t hb_qsv_frametype_xlat(uint16_t qsv_frametype, uint16_t *out_flags)
return frametype;
}
+void hb_qsv_impl_set_preferred(int impl)
+{
+ preferred_implementation = impl;
+}
+
mfxIMPL hb_qsv_impl_get_preferred()
{
return preferred_implementation;
diff --git a/libhb/qsv_common.h b/libhb/qsv_common.h
index c79cd2aa1..8803c06ba 100644
--- a/libhb/qsv_common.h
+++ b/libhb/qsv_common.h
@@ -131,6 +131,7 @@ int hb_qsv_param_parse (hb_qsv_param_t *param, const char *key, const ch
const char* hb_qsv_frametype_name(uint16_t qsv_frametype);
uint8_t hb_qsv_frametype_xlat(uint16_t qsv_frametype, uint16_t *out_flags);
+void hb_qsv_impl_set_preferred(int impl);
mfxIMPL hb_qsv_impl_get_preferred();
const char* hb_qsv_impl_get_name(int impl);
diff --git a/test/test.c b/test/test.c
index 6fcc2e404..282788abe 100644
--- a/test/test.c
+++ b/test/test.c
@@ -3765,6 +3765,7 @@ static int ParseOptions( int argc, char ** argv )
#define QSV_BASELINE 290
#define QSV_ASYNC_DEPTH 291
#define QSV_PRESET 292
+ #define QSV_IMPLEMENTATION 293
for( ;; )
{
@@ -3780,6 +3781,7 @@ static int ParseOptions( int argc, char ** argv )
{ "qsv-preset", required_argument, NULL, QSV_PRESET, },
{ "qsv-baseline", no_argument, NULL, QSV_BASELINE, },
{ "qsv-async-depth", required_argument, NULL, QSV_ASYNC_DEPTH, },
+ { "qsv-implementation", required_argument, NULL, QSV_IMPLEMENTATION, },
{ "disable-qsv-decoding", no_argument, &qsv_decode, 0, },
#endif
@@ -4427,6 +4429,46 @@ static int ParseOptions( int argc, char ** argv )
case QSV_PRESET:
qsv_preset = strdup(optarg);
break;
+ case QSV_IMPLEMENTATION:
+ if( optarg != NULL )
+ {
+ if (!strcasecmp(optarg, "auto"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_AUTO_ANY|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "auto1"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_AUTO|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "software"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_SOFTWARE);
+ }
+ else if (!strcasecmp(optarg, "hardware"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_HARDWARE_ANY|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "hardware1"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_HARDWARE|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "hardware2"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_HARDWARE2|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "hardware3"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_HARDWARE3|MFX_IMPL_VIA_ANY);
+ }
+ else if (!strcasecmp(optarg, "hardware4"))
+ {
+ hb_qsv_impl_set_preferred(MFX_IMPL_HARDWARE4|MFX_IMPL_VIA_ANY);
+ }
+ else
+ {
+ hb_qsv_impl_set_preferred(atoi(optarg));
+ }
+ } break;
#endif
default:
fprintf( stderr, "unknown option (%s)\n", argv[cur_optind] );