[FFmpeg-cvslog] avcodec/vdpau_mpeg4: fix order of quant matrix coefficients

Hendrik Leppkes git at videolan.org
Mon May 15 19:48:36 EEST 2023


ffmpeg | branch: release/4.4 | Hendrik Leppkes <h.leppkes at gmail.com> | Mon May 15 13:35:42 2023 +0200| [d5fa6e3a910c7f861976b8220c6a1a4bf30698d3] | committer: Hendrik Leppkes

avcodec/vdpau_mpeg4: fix order of quant matrix coefficients

The matrix coefficients are stored permutated for the IDCT,
rather then in plain raster order, and need to be un-permutated
for the hardware.

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

 libavcodec/vdpau_mpeg4.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c
index 93b25beb1f..59cdb96378 100644
--- a/libavcodec/vdpau_mpeg4.c
+++ b/libavcodec/vdpau_mpeg4.c
@@ -74,8 +74,9 @@ static int vdpau_mpeg4_start_frame(AVCodecContext *avctx,
     info->alternate_vertical_scan_flag      = s->alternate_scan;
     info->top_field_first                   = s->top_field_first;
     for (i = 0; i < 64; ++i) {
-        info->intra_quantizer_matrix[i]     = s->intra_matrix[i];
-        info->non_intra_quantizer_matrix[i] = s->inter_matrix[i];
+        int n = s->idsp.idct_permutation[i];
+        info->intra_quantizer_matrix[i]     = s->intra_matrix[n];
+        info->non_intra_quantizer_matrix[i] = s->inter_matrix[n];
     }
 
     ff_vdpau_common_start_frame(pic_ctx, buffer, size);



More information about the ffmpeg-cvslog mailing list