summaryrefslogtreecommitdiff
path: root/libavcodec/dxva2_h264.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2014-03-04 08:28:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-03-07 00:33:34 +0100
commit8b2a130d3fe61e348092714dffa425b63c4d796c (patch)
tree0e20426485c8808f7fafa22150b457ac4be68129 /libavcodec/dxva2_h264.c
parent276839b8de7ff836a529bbd6221f615a343b23e1 (diff)
dxva2_h264: add a workaround for old intel GPUs
Old Intel GPUs expect the reference frame index to the actual surface, instead of the index into RefFrameList as specified by the spec. This workaround should be set when using one of the "ClearVideo" decoder devices. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/dxva2_h264.c')
-rw-r--r--libavcodec/dxva2_h264.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 2484486a11..d7bad26424 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -115,6 +115,8 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context
pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;
if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
pp->Reserved16Bits = 0;
+ else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
+ pp->Reserved16Bits = 0x34c;
else
pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */
pp->StatusReportFeedbackNumber = 1 + ctx->report_id++;
@@ -238,7 +240,11 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice,
if (list < h->list_count && i < h->ref_count[list]) {
const Picture *r = &h->ref_list[list][i];
unsigned plane;
- unsigned index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));
+ unsigned index;
+ if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
+ index = ff_dxva2_get_surface_index(ctx, r);
+ else
+ index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));
fill_picture_entry(&slice->RefPicList[list][i], index,
r->reference == PICT_BOTTOM_FIELD);
for (plane = 0; plane < 3; plane++) {