diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2014-04-22 15:22:51 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2014-04-28 20:21:59 +0200 |
commit | ed4b757177f9b563412cdbc8ee3405d82e10fc05 (patch) | |
tree | b6a6cec91ba2837a7f1faa90565087305e510f51 /libavcodec/dxva2_h264.c | |
parent | 2fcef90bee98bffeff1d95b7197738f50c450d86 (diff) | |
download | ffmpeg-ed4b757177f9b563412cdbc8ee3405d82e10fc05.tar.gz |
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: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/dxva2_h264.c')
-rw-r--r-- | libavcodec/dxva2_h264.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index 1e4d98ac3c..3d503e8243 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -116,6 +116,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++; @@ -239,7 +241,11 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, if (list < h->list_count && i < h->ref_count[list]) { const H264Picture *r = &h->ref_list[list][i]; unsigned plane; - unsigned index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, &r->f)); + unsigned index; + if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO) + index = ff_dxva2_get_surface_index(ctx, &r->f); + else + index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, &r->f)); fill_picture_entry(&slice->RefPicList[list][i], index, r->reference == PICT_BOTTOM_FIELD); for (plane = 0; plane < 3; plane++) { |