aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2023-05-15 13:35:42 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2023-05-15 18:43:40 +0200
commit536cd25b99c00d4fa8232ea830a45dba4e0805f9 (patch)
treeedd219ebde7601e9f89c3dd8e2549e888b91065c /libavcodec
parent8ea65672ca2f6797de4a77a324600963e97ceca6 (diff)
downloadffmpeg-release/5.0.tar.gz
avcodec/vdpau_mpeg4: fix order of quant matrix coefficientsrelease/5.0
The matrix coefficients are stored permutated for the IDCT, rather then in plain raster order, and need to be un-permutated for the hardware.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vdpau_mpeg4.c5
1 files 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);