[vlc-commits] directx_va: add an extra buffer when decoding MPEG-2 (part 2)

Steve Lhomme git at videolan.org
Tue Oct 17 18:28:21 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Oct 17 18:17:42 2017 +0200| [591ec2c1b26c82e5ddfa707d5a83c69c94f83b7b] | committer: Jean-Baptiste Kempf

directx_va: add an extra buffer when decoding MPEG-2 (part 2)

#18731 is not fixed in some cases because the deinterlacer may keep more than
one frame for later reference. The maximum extra frame currently supported is 2
so we need to add 2 frames to the decoder as they will be held for a while.

Theoretically the problem could happen with H264 but we usually have more frames
than we need.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=591ec2c1b26c82e5ddfa707d5a83c69c94f83b7b
---

 modules/codec/avcodec/directx_va.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/directx_va.c b/modules/codec/avcodec/directx_va.c
index e35c6856e2..b499cd8e86 100644
--- a/modules/codec/avcodec/directx_va.c
+++ b/modules/codec/avcodec/directx_va.c
@@ -299,7 +299,8 @@ int directx_va_Setup(vlc_va_t *va, directx_sys_t *dx_sys, const AVCodecContext *
         /* decoding MPEG-2 requires additional alignment on some Intel GPUs,
            but it causes issues for H.264 on certain AMD GPUs..... */
         surface_alignment = 32;
-        surface_count += 2 + 1; /* 1 for extra buffer for deinterlacing */
+        surface_count += 2 + 2; /* 2 for deinterlacing which can hold up to 2
+                                 * pictures from the decoder for smoothing */
         break;
     case AV_CODEC_ID_HEVC:
         /* the HEVC DXVA2 spec asks for 128 pixel aligned surfaces to ensure



More information about the vlc-commits mailing list