From 1564567c3e8a9e8f83a182832b3c29bf11f945a4 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Fri, 17 Dec 2021 22:24:57 +0900 Subject: [PATCH] d3d11av1dec: Fix for Cdef param av1parser will increase the sec_strength values by 1 if parsed values were equal to 3 as defined in spec. But DXVA wants unmodified ones. Part-of: --- .../gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp index e8bd7c8493..fab874392e 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp @@ -999,15 +999,21 @@ gst_d3d11_av1_dec_start_picture (GstAV1Decoder * decoder, pic_params->cdef.bits = frame_hdr->cdef_params.cdef_bits; for (i = 0; i < GST_AV1_CDEF_MAX; i++) { + guint8 secondary; + pic_params->cdef.y_strengths[i].primary = frame_hdr->cdef_params.cdef_y_pri_strength[i]; - pic_params->cdef.y_strengths[i].secondary = - frame_hdr->cdef_params.cdef_y_sec_strength[i]; + secondary = frame_hdr->cdef_params.cdef_y_sec_strength[i]; + if (secondary == 4) + secondary--; + pic_params->cdef.y_strengths[i].secondary = secondary; pic_params->cdef.uv_strengths[i].primary = frame_hdr->cdef_params.cdef_uv_pri_strength[i]; - pic_params->cdef.uv_strengths[i].secondary = - frame_hdr->cdef_params.cdef_uv_sec_strength[i]; + secondary = frame_hdr->cdef_params.cdef_uv_sec_strength[i]; + if (secondary == 4) + secondary--; + pic_params->cdef.uv_strengths[i].secondary = secondary; } pic_params->interp_filter = frame_hdr->interpolation_filter; -- 2.34.1