[FFmpeg-cvslog] dxva2_h264: add a workaround for old Intel GPUs

Hendrik Leppkes git at videolan.org
Tue Apr 29 01:03:56 CEST 2014


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Tue Apr 22 15:22:51 2014 +0200| [ed4b757177f9b563412cdbc8ee3405d82e10fc05] | committer: Anton Khirnov

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 at khirnov.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed4b757177f9b563412cdbc8ee3405d82e10fc05
---

 doc/APIchanges          |    3 +++
 libavcodec/dxva2.h      |    1 +
 libavcodec/dxva2_h264.c |    8 +++++++-
 libavcodec/version.h    |    2 +-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e163b56..28afc9b 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-04-xx - xxxxxxx - lavc 55.50.0 - dxva2.h
+  Add FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO for old Intel GPUs.
+
 2014-04-xx - xxxxxxx - lavu 53.13.0 - avutil.h
   Add av_get_time_base_q().
 
diff --git a/libavcodec/dxva2.h b/libavcodec/dxva2.h
index d161eb9..78939be 100644
--- a/libavcodec/dxva2.h
+++ b/libavcodec/dxva2.h
@@ -42,6 +42,7 @@
  */
 
 #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
+#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO    2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
 
 /**
  * This structure is used to provides the necessary configurations and data
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 1e4d98a..3d503e8 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++) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b04bc30..d82a068 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 49
+#define LIBAVCODEC_VERSION_MINOR 50
 #define LIBAVCODEC_VERSION_MICRO  0
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \



More information about the ffmpeg-cvslog mailing list