History

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.

Hendrik Leppkes committed 12 years ago

Commit 8b2a1301 parent 276839b2 files · +8 −1Browse files

Unified · Split

2 files
  1. libavcodec/dxva2.h +1 −0
  2. libavcodec/dxva2_h264.c +7 −1
libavcodec/dxva2.h+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 */
5050
5151 #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
52+#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
5253
5354 /**
5455 * This structure is used to provides the necessary configurations and data
libavcodec/dxva2_h264.c+7−1
@@ -115,6 +115,8 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context · 114 unmodified lines
115115 pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;
116116 if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
117117 pp->Reserved16Bits = 0;
118+ else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
119+ pp->Reserved16Bits = 0x34c;
118120 else
119121 pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */
120122 pp->StatusReportFeedbackNumber = 1 + ctx->report_id++;
@@ -238,7 +240,11 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, · 117 unmodified lines
238240 if (list < h->list_count && i < h->ref_count[list]) {
239241 const Picture *r = &h->ref_list[list][i];
240242 unsigned plane;
241− unsigned index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));
243+ unsigned index;
244+ if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
245+ index = ff_dxva2_get_surface_index(ctx, r);
246+ else
247+ index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, r));
242248 fill_picture_entry(&slice->RefPicList[list][i], index,
243249 r->reference == PICT_BOTTOM_FIELD);
244250 for (plane = 0; plane < 3; plane++) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t