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
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162014-04-xx - xxxxxxx - lavc 55.50.0 - dxva2.h
17 Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.
18
162014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h192014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
17 Add av_get_time_base_q().20 Add av_get_time_base_q().
18 21
libavcodec/dxva2.h+1−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
42 */42 */
43 43
44#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards44#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
45 46
46/**47/**
47 * This structure is used to provides the necessary configurations and data48 * 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
116 pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;116 pp->bit_depth_chroma_minus8 = h->sps.bit_depth_chroma - 8;
117 if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)117 if (ctx->workaround & FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG)
118 pp->Reserved16Bits = 0;118 pp->Reserved16Bits = 0;
119 else if (ctx->workaround & FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO)
120 pp->Reserved16Bits = 0x34c;
119 else121 else
120 pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */122 pp->Reserved16Bits = 3; /* FIXME is there a way to detect the right mode ? */
121 pp->StatusReportFeedbackNumber = 1 + ctx->report_id++;123 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
239 if (list < h->list_count && i < h->ref_count[list]) {241 if (list < h->list_count && i < h->ref_count[list]) {
240 const H264Picture *r = &h->ref_list[list][i];242 const H264Picture *r = &h->ref_list[list][i];
241 unsigned plane;243 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));
243 fill_picture_entry(&slice->RefPicList[list][i], index,249 fill_picture_entry(&slice->RefPicList[list][i], index,
244 r->reference == PICT_BOTTOM_FIELD);250 r->reference == PICT_BOTTOM_FIELD);
245 for (plane = 0; plane < 3; plane++) {251 for (plane = 0; plane < 3; plane++) {
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/version.h"29#include "libavutil/version.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5531#define LIBAVCODEC_VERSION_MAJOR 55
32#define LIBAVCODEC_VERSION_MINOR 4932#define LIBAVCODEC_VERSION_MINOR 50
33#define LIBAVCODEC_VERSION_MICRO 033#define LIBAVCODEC_VERSION_MICRO 0
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#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