diff options
author | Rodeo <[email protected]> | 2013-08-22 20:33:35 +0000 |
---|---|---|
committer | Rodeo <[email protected]> | 2013-08-22 20:33:35 +0000 |
commit | d41905d539046445e1b81499ff7bd04d170c91d4 (patch) | |
tree | 3f39a09e757bca8bc461d46303a2cb1c35e8d9a6 /test | |
parent | c1a493b581f0567eba92625f2ee132de8e7f1d6d (diff) |
Big merge, QSV to trunk: part 1 (tracked files).
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5737 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'test')
-rw-r--r-- | test/module.defs | 5 | ||||
-rw-r--r-- | test/test.c | 84 |
2 files changed, 82 insertions, 7 deletions
diff --git a/test/module.defs b/test/module.defs index 66e95f2de..85c59533c 100644 --- a/test/module.defs +++ b/test/module.defs @@ -19,6 +19,11 @@ TEST.GCC.l = \ samplerate swscale theoraenc theoradec vorbis vorbisenc x264 \ bluray xml2 bz2 z +ifeq (1,$(FEATURE.qsv)) + TEST.GCC.l += mfx + TEST.GCC.D += USE_QSV HAVE_THREADS=1 +endif + ifeq (1,$(FEATURE.fdk_aac)) TEST.GCC.l += fdk-aac endif diff --git a/test/test.c b/test/test.c index e76258977..1f7fd3acf 100644 --- a/test/test.c +++ b/test/test.c @@ -26,6 +26,10 @@ #include "lang.h" #include "parsecsv.h" +#ifdef USE_QSV +#include "qsv_common.h" +#endif + #if defined( __APPLE_CC__ ) #import <CoreServices/CoreServices.h> #include <IOKit/IOKitLib.h> @@ -132,6 +136,10 @@ static int start_at_frame = 0; static int64_t stop_at_pts = 0; static int stop_at_frame = 0; static uint64_t min_title_duration = 10; +#ifdef USE_QSV +static int qsv_decode = 1; +static int qsv_async_depth = -1; +#endif /* Exit cleanly on Ctrl-C */ static volatile int die = 0; @@ -1869,6 +1877,14 @@ static int HandleEvents( hb_handle_t * h ) job->vcodec = vcodec; } +#ifdef USE_QSV + if (qsv_async_depth >= 0) + { + job->qsv_async_depth = qsv_async_depth; + } + job->qsv_decode = qsv_decode; +#endif + /* Grab audio tracks */ if( atracks ) { @@ -3073,9 +3089,22 @@ static void ShowHelp() } if( len ) fprintf( out, "%s\n", tmp ); - fprintf( out, - " -x, --encopts <string> Specify advanced encoder options in the\n" - " same style as mencoder (x264 and ffmpeg only):\n" + fprintf(out, + " -x, --encopts <string> Specify advanced encoder options in the\n"); +#ifdef USE_QSV +if (hb_qsv_available()) +{ + fprintf(out, + " same style as mencoder (x264/qsv/ffmpeg only):\n"); +} +else +#endif +{ + fprintf(out, + " same style as mencoder (x264 and ffmpeg only):\n"); +} + + fprintf(out, " option1=value1:option2=value2\n" " --h264-profile When using x264, ensures compliance with the\n" " <string> specified H.264 profile:\n" @@ -3332,7 +3361,14 @@ static void ShowHelp() "### Filters---------------------------------------------------------\n\n" " -d, --deinterlace Deinterlace video with Libav, yadif or mcdeint\n" - " <fast/slow/slower/bob> or omitted (default settings)\n" + " <fast/slow/slower/bob"); +#ifdef USE_QSV +if (hb_qsv_available()) +{ + fprintf(out, "/qsv"); +} +#endif + fprintf( out, "> or omitted (default settings)\n" " or\n" " <YM:FD:MM:QP> (default 0:-1:-1:1)\n" " -5, --decomb Selectively deinterlaces when it detects combing\n" @@ -3415,10 +3451,22 @@ static void ShowHelp() " If \"number\" is omitted, the first srt is default.\n" " \"number\" is an 1 based index into the srt-file list\n" "\n" + ); - +#ifdef USE_QSV +if (hb_qsv_available()) +{ + fprintf( out, + "### Intel Quick Sync Video------------------------------------------------------\n\n" + " --disable-qsv-decoding Force software decoding of the video track.\n" + " --qsv-async-depth Specifies how many asynchronous operations should be\n" + " performed before the result is explicitly synchronized.\n" + " Default: 4. If zero, the value is not specified.\n" + "\n" ); } +#endif +} /**************************************************************************** * ShowPresets: @@ -3560,7 +3608,9 @@ static int ParseOptions( int argc, char ** argv ) #define H264_LEVEL 286 #define NORMALIZE_MIX 287 #define AUDIO_DITHER 288 - + #define QSV_BASELINE 289 + #define QSV_ASYNC_DEPTH 290 + for( ;; ) { static struct option long_options[] = @@ -3568,7 +3618,12 @@ static int ParseOptions( int argc, char ** argv ) { "help", no_argument, NULL, 'h' }, { "update", no_argument, NULL, 'u' }, { "verbose", optional_argument, NULL, 'v' }, - { "no-dvdnav", no_argument, NULL, DVDNAV }, + { "no-dvdnav", no_argument, NULL, DVDNAV }, +#ifdef USE_QSV + { "qsv-baseline", no_argument, NULL, QSV_BASELINE }, + { "qsv-async-depth", required_argument, NULL, QSV_ASYNC_DEPTH }, + { "disable-qsv-decoding", no_argument, &qsv_decode, 0 }, +#endif { "format", required_argument, NULL, 'f' }, { "input", required_argument, NULL, 'i' }, @@ -4185,6 +4240,21 @@ static int ParseOptions( int argc, char ** argv ) case MIN_DURATION: min_title_duration = strtol( optarg, NULL, 0 ); break; +#ifdef USE_QSV + case QSV_BASELINE: + if (hb_qsv_available()) + { + /* XXX: for testing workarounds */ + hb_qsv_info->capabilities &= ~HB_QSV_CAP_MSDK_API_1_6; + hb_qsv_info->capabilities &= ~HB_QSV_CAP_OPTION2_BRC; + hb_qsv_info->capabilities &= ~HB_QSV_CAP_OPTION2_TRELLIS; + hb_qsv_info->capabilities &= ~HB_QSV_CAP_OPTION2_LOOKAHEAD; + } + break; + case QSV_ASYNC_DEPTH: + qsv_async_depth = atoi(optarg); + break; +#endif default: fprintf( stderr, "unknown option (%s)\n", argv[cur_optind] ); return -1; |