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 ed4b7571 parent 2fcef904 files · +12 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/dxva2.h +1 −0
  3. libavcodec/dxva2_h264.c +7 −1
  4. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2013-12-xx · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2014-04-xx - xxxxxxx - lavc 55.50.0 - dxva2.h
17+ Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.
18+
1619 2014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
1720 Add av_get_time_base_q().
1821
libavcodec/dxva2.h+1−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 */
4343
4444 #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
45+#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
4546
4647 /**
4748 * This structure is used to provides the necessary configurations and data
libavcodec/dxva2_h264.c+7−1
@@ -116,6 +116,8 @@ static void fill_picture_parameters(struct dxva_context *ctx, const H264Context · 115 unmodified lines
116116 pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;
117117 if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
118118 pp->Reserved16Bits = 0;
119+ else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
120+ pp->Reserved16Bits = 0x34c;
119121 else
120122 pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */
121123 pp->StatusReportFeedbackNumber = 1 + ctx->report_id++;
@@ -239,7 +241,11 @@ static void fill_slice_long(AVCodecContext *avctx, DXVA_Slice_H264_Long *slice, · 117 unmodified lines
239241 if (list < h->list_count && i < h->ref_count[list]) {
240242 const H264Picture *r = &h->ref_list[list][i];
241243 unsigned plane;
242− unsigned index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, &r->f));
244+ unsigned index;
245+ if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
246+ index = ff_dxva2_get_surface_index(ctx, &r->f);
247+ else
248+ index = get_refpic_index(pp, ff_dxva2_get_surface_index(ctx, &r->f));
243249 fill_picture_entry(&slice->RefPicList[list][i], index,
244250 r->reference == PICT_BOTTOM_FIELD);
245251 for (plane = 0; plane < 3; plane++) {
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/version.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
32−#define LIBAVCODEC_VERSION_MINOR 49
32+#define LIBAVCODEC_VERSION_MINOR 50
3333 #define LIBAVCODEC_VERSION_MICRO 0
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

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