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.
pull/389/head
Hendrik Leppkes 2 years ago
parent 308e4ae8e3
commit 6b2ae90411
No known key found for this signature in database
GPG Key ID: 846079A4B0A7C1B5
  1. 5
      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->alternate_vertical_scan_flag = s->alternate_scan;
info->top_field_first = s->top_field_first; info->top_field_first = s->top_field_first;
for (i = 0; i < 64; ++i) { for (i = 0; i < 64; ++i) {
info->intra_quantizer_matrix[i] = s->intra_matrix[i]; int n = s->idsp.idct_permutation[i];
info->non_intra_quantizer_matrix[i] = s->inter_matrix[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); ff_vdpau_common_start_frame(pic_ctx, buffer, size);

Loading…
Cancel
Save