]> granicus.if.org Git - handbrake/commitdiff
QSV: add an option to force software decoding.
authorRodeo <tdskywalker@gmail.com>
Sat, 3 Aug 2013 11:59:24 +0000 (11:59 +0000)
committerRodeo <tdskywalker@gmail.com>
Sat, 3 Aug 2013 11:59:24 +0000 (11:59 +0000)
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

libhb/common.c
libhb/common.h
libhb/qsv_common.c
test/test.c

index 1a0fa5398dae5090b070bd4947c85f694ccb7c27..b328120a5d2163bc0dce4671fafbcd0cd20b055f 100644 (file)
@@ -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 )
index 658f00f7059a8f5e615429cbc9b03d756d661d70..2e412757fcd2db39572240d2cfd8ac3d2c688196 100644 (file)
@@ -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__
index 268eccce6e377fb5108d585466878c70879eed53..35992fc844a1ba067da85714581f731253870420 100644 (file)
@@ -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));
 }
 
index df97362e92062fcbfad7e1dd083b30d11e9b3ad9..a38258b818093894bf2917a2464a6a121cf461aa 100644 (file)
@@ -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;
@@ -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 )
             {
@@ -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"
@@ -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' },