aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2023-05-15 13:35:13 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2023-05-15 18:43:40 +0200
commit8ea65672ca2f6797de4a77a324600963e97ceca6 (patch)
treec38175c045153d5a6076d54ef3838c4836c1f734
parenta2c62be31d3ec7cbe813b573be6b5a0e8b973a9b (diff)
downloadffmpeg-8ea65672ca2f6797de4a77a324600963e97ceca6.tar.gz
avcodec/vdpau_mpeg12: 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.
-rw-r--r--libavcodec/vdpau_mpeg12.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
index 72220ffb4e..0860af815e 100644
--- a/libavcodec/vdpau_mpeg12.c
+++ b/libavcodec/vdpau_mpeg12.c
@@ -73,8 +73,9 @@ static int vdpau_mpeg_start_frame(AVCodecContext *avctx,
info->f_code[1][0] = s->mpeg_f_code[1][0];
info->f_code[1][1] = s->mpeg_f_code[1][1];
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];
}
return ff_vdpau_common_start_frame(pic_ctx, buffer, size);