Skip to content

Commit

Permalink
QSV: add an option to force software decoding.
Browse files Browse the repository at this point in the history
Example use cases:

- convenient for testing during development

- using filters which haven't been validated (framerate shaping, decomb, etc.)

- improving memcpy speed when using old Intel drivers



git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/qsv@5684 b64f7644-9d1e-0410-96f1-a4d463321fa5
  • Loading branch information
twalker314 committed Aug 3, 2013
1 parent e1b160e commit c19e6d1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions libhb/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2829,6 +2829,10 @@ static void job_setup( hb_job_t * job, hb_title_t * title )

job->list_attachment = hb_attachment_list_copy( title->list_attachment );
job->metadata = hb_metadata_copy( title->metadata );

#ifdef USE_QSV
job->qsv_decode = title->qsv_decode_support;
#endif
}

static void job_clean( hb_job_t * job )
Expand Down
1 change: 1 addition & 0 deletions libhb/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ struct hb_job_s
// to non-I frames).
#ifdef USE_QSV
av_qsv_context *qsv;
int qsv_decode;
#endif

#ifdef __LIBHB__
Expand Down
2 changes: 1 addition & 1 deletion libhb/qsv_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ const char* hb_qsv_decode_get_codec_name(enum AVCodecID codec_id)

int hb_qsv_decode_is_enabled(hb_job_t *job)
{
return ((job != NULL && job->title->qsv_decode_support) &&
return ((job != NULL && job->title->qsv_decode_support && job->qsv_decode) &&
(job->vcodec & HB_VCODEC_QSV_MASK));
}

Expand Down
13 changes: 12 additions & 1 deletion test/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ 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;
#endif

/* Exit cleanly on Ctrl-C */
static volatile int die = 0;
Expand Down Expand Up @@ -1873,6 +1876,10 @@ static int HandleEvents( hb_handle_t * h )
job->vcodec = vcodec;
}

#ifdef USE_QSV
job->qsv_decode = qsv_decode;
#endif

/* Grab audio tracks */
if( atracks )
{
Expand Down Expand Up @@ -3448,7 +3455,10 @@ if (hb_qsv_available())
if (hb_qsv_available())
{
fprintf( out,
"### QSV Options, via --encopts=\"option1=value1:option2=value2\" -----------\n\n"
"### Intel Quick Sync Video------------------------------------------------------\n\n"
" --disable-qsv-decoding Force software decoding of the video track.\n"
"\n"
" Advanced encoding options, via --encopts=\"option1=value1:option2=value2\":\n"
" - target-usage A range of numbers that indicate trade-offs between\n"
" <number> quality and speed, from 1 to 7 inclusive.\n"
" Default is 2\n"
Expand Down Expand Up @@ -3647,6 +3657,7 @@ static int ParseOptions( int argc, char ** argv )
{ "no-dvdnav", no_argument, NULL, DVDNAV },
#ifdef USE_QSV
{ "qsv-baseline", no_argument, NULL, QSV_BASELINE },
{ "disable-qsv-decoding", no_argument, &qsv_decode, 0 },
#endif

{ "format", required_argument, NULL, 'f' },
Expand Down

0 comments on commit c19e6d1

Please sign in to comment.