]> git.sesse.net Git - ffmpeg/commitdiff
dxva2_h264: add a workaround for old Intel GPUs
authorHendrik Leppkes <h.leppkes@gmail.com>
Tue, 22 Apr 2014 13:22:51 +0000 (15:22 +0200)
committerAnton Khirnov <anton@khirnov.net>
Mon, 28 Apr 2014 18:21:59 +0000 (20:21 +0200)
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>
doc/APIchanges
libavcodec/dxva2.h
libavcodec/dxva2_h264.c
libavcodec/version.h

index e163b56f3b12f40d94e2e09ae36cfb306cad2ee4..28afc9bd7e2ab006e4c493b50e6e32ad1001c081 100644 (file)
@@ -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().
 
index d161eb9f5ea76b60dd83607263366b872449e384..78939be961adb10e1b2ef86a4aed6b14e9f6c5a2 100644 (file)
@@ -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
index 1e4d98ac3cc57a837562a60b73332f67061ffcbe..3d503e82433c7a80a70f3b03208ba6ee9f3d7f37 100644 (file)
@@ -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++) {
index b04bc306d1a539e08183e709f9f4614afef2236d..d82a06802abd69b21a5948fd74e265baa9ea0751 100644 (file)
@@ -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, \