summaryrefslogtreecommitdiffstats
path: root/libhb
diff options
context:
space:
mode:
authorRodeo <[email protected]>2013-10-12 00:30:02 +0000
committerRodeo <[email protected]>2013-10-12 00:30:02 +0000
commitb450b844c8cf8399c129fadb08f9eaa05acedcb1 (patch)
treed9337699251341316b595f21e756fa97619387e2 /libhb
parent66009cb19c3ba6b6a27fc4bcbf1373cb90307a80 (diff)
QSV: improve CopyFrame bug workaround a bit.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5834 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb')
-rw-r--r--libhb/qsv_common.c9
-rw-r--r--libhb/qsv_common.h4
-rw-r--r--libhb/work.c22
3 files changed, 21 insertions, 14 deletions
diff --git a/libhb/qsv_common.c b/libhb/qsv_common.c
index 704a6e86a..542f03374 100644
--- a/libhb/qsv_common.c
+++ b/libhb/qsv_common.c
@@ -95,7 +95,9 @@ int hb_qsv_info_init()
}
if (HB_CHECK_MFX_VERSION(qsv_hardware_version, 1, 7))
{
- hb_qsv_info->capabilities |= HB_QSV_CAP_COPYFRAME;
+ // we should really check the driver version, but since that's not
+ // available here, checking the API version is the best we can do :-(
+ hb_qsv_info->capabilities |= HB_QSV_CAP_CORE_COPYFRAME;
}
if (hb_get_cpu_platform() == HB_CPU_PLATFORM_INTEL_HSW)
{
@@ -118,10 +120,7 @@ int hb_qsv_info_init()
hb_qsv_info->capabilities |= HB_QSV_CAP_MSDK_API_1_6;
hb_qsv_info->capabilities |= HB_QSV_CAP_H264_BPYRAMID;
}
- if (HB_CHECK_MFX_VERSION(qsv_software_version, 1, 7))
- {
- hb_qsv_info->capabilities |= HB_QSV_CAP_COPYFRAME;
- }
+ hb_qsv_info->capabilities |= HB_QSV_CAP_CORE_COPYFRAME;
}
// note: we pass a pointer to MFXInit but it never gets modified
diff --git a/libhb/qsv_common.h b/libhb/qsv_common.h
index ab9ca9024..8b94fd0b4 100644
--- a/libhb/qsv_common.h
+++ b/libhb/qsv_common.h
@@ -36,7 +36,9 @@ typedef struct hb_qsv_info_s
#define HB_QSV_CAP_OPTION2_MBBRC (1 << 3) // mfxExtCodingOption2: MBBRC
#define HB_QSV_CAP_OPTION2_LOOKAHEAD (1 << 4) // mfxExtCodingOption2: LookAhead
#define HB_QSV_CAP_OPTION2_TRELLIS (1 << 5) // mfxExtCodingOption2: Trellis
-#define HB_QSV_CAP_COPYFRAME (1 << 6) // mfxCoreInterface: CopyFrame
+// mfxCoreInterface: CopyFrame has a bug which prevents us from using it, but
+// the bug is fixed in newer drivers, we can use this cap to determine usability
+#define HB_QSV_CAP_CORE_COPYFRAME (1 << 6)
// TODO: add available decoders, filters, encoders,
// maximum decode and encode resolution, etc.
diff --git a/libhb/work.c b/libhb/work.c
index 24f05282b..6ed374a3c 100644
--- a/libhb/work.c
+++ b/libhb/work.c
@@ -697,13 +697,12 @@ static void do_job(hb_job_t *job)
* the list and we can't use CopyFrame, disable QSV decoding until a
* better solution is implemented.
*/
- if (!(hb_qsv_info->capabilities & HB_QSV_CAP_COPYFRAME))
+ if (!(hb_qsv_info->capabilities & HB_QSV_CAP_CORE_COPYFRAME))
{
if (job->list_filter != NULL)
{
- for (i = 0;
- i < hb_list_count(job->list_filter) && hb_qsv_decode_is_enabled(job);
- i++)
+ int encode_only = 0;
+ for (i = 0; i < hb_list_count(job->list_filter) && !encode_only; i++)
{
hb_filter_object_t *filter = hb_list_item(job->list_filter, i);
switch (filter->id)
@@ -711,8 +710,7 @@ static void do_job(hb_job_t *job)
// validated, CPU-based filters
case HB_FILTER_ROTATE:
case HB_FILTER_RENDER_SUB:
- hb_log("do_job: QSV: CopyFrame unavailable, using encode-only path");
- job->qsv.decode = 0;
+ encode_only = 1;
break;
// CPU-based deinterlace (validated)
@@ -720,8 +718,7 @@ static void do_job(hb_job_t *job)
if (filter->settings != NULL &&
strcasecmp(filter->settings, "qsv") != 0)
{
- hb_log("do_job: QSV: CopyFrame unavailable, using encode-only path");
- job->qsv.decode = 0;
+ encode_only = 1;
}
break;
@@ -730,6 +727,15 @@ static void do_job(hb_job_t *job)
break;
}
}
+ if (encode_only)
+ {
+ hb_log("do_job: QSV: possible CopyFrame bug, using encode-only path");
+ if (hb_get_cpu_platform() >= HB_CPU_PLATFORM_INTEL_IVB)
+ {
+ hb_log("do_job: QSV: please update your Intel graphics driver to version 9.18.10.3257 or later");
+ }
+ job->qsv.decode = 0;
+ }
}
}