From 163b4da8745e02257fff7ad506bc830c55dab7e7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Christian=20K=C3=B6nig?= Date: Tue, 30 Apr 2013 19:38:24 +0200 Subject: [PATCH] radeon/uvd: fix quant scan order for mpeg2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- src/gallium/drivers/radeon/radeon_uvd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c index 5a7eab683bd..bcd282e6e88 100644 --- a/src/gallium/drivers/radeon/radeon_uvd.c +++ b/src/gallium/drivers/radeon/radeon_uvd.c @@ -514,6 +514,7 @@ static uint32_t get_ref_pic_idx(struct ruvd_decoder *dec, struct pipe_video_buff static struct ruvd_mpeg2 get_mpeg2_msg(struct ruvd_decoder *dec, struct pipe_mpeg12_picture_desc *pic) { + const int *zscan = pic->alternate_scan ? vl_zscan_alternate : vl_zscan_normal; struct ruvd_mpeg2 result; unsigned i; @@ -524,8 +525,11 @@ static struct ruvd_mpeg2 get_mpeg2_msg(struct ruvd_decoder *dec, result.load_intra_quantiser_matrix = 1; result.load_nonintra_quantiser_matrix = 1; - memcpy(&result.intra_quantiser_matrix, pic->intra_matrix, 64); - memcpy(&result.nonintra_quantiser_matrix, pic->non_intra_matrix, 64); + + for (i = 0; i < 64; ++i) { + result.intra_quantiser_matrix[i] = pic->intra_matrix[zscan[i]]; + result.nonintra_quantiser_matrix[i] = pic->non_intra_matrix[zscan[i]]; + } result.profile_and_level_indication = 0; result.chroma_format = 0x1; -- 2.30.2