From 2e62b30826679e9d5e1a783dc19baabec4fc8dfa Mon Sep 17 00:00:00 2001 From: Christian König Date: Fri, 12 Aug 2011 13:29:00 +0200 Subject: g3dvl: Rework the decoder interface part 5/5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make setting the quant matrixes a generic interface. Also removes setting the quant matrix from the XvMC interface Signed-off-by: Christian König Reviewed-by: Younes Manton --- src/gallium/state_trackers/vdpau/decode.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gallium/state_trackers/vdpau/decode.c') diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c index 5ca40f71efe..50d63ea3f73 100644 --- a/src/gallium/state_trackers/vdpau/decode.c +++ b/src/gallium/state_trackers/vdpau/decode.c @@ -182,8 +182,8 @@ vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder, VdpBitstreamBuffer const *bitstream_buffers) { struct pipe_mpeg12_picture_desc picture; + struct pipe_mpeg12_quant_matrix quant; struct pipe_video_buffer *ref_frames[2]; - uint8_t intra_quantizer_matrix[64]; unsigned i; VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding MPEG2\n"); @@ -216,6 +216,7 @@ vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder, picture.alternate_scan = picture_info->alternate_scan; picture.intra_vlc_format = picture_info->intra_vlc_format; picture.concealment_motion_vectors = picture_info->concealment_motion_vectors; + picture.intra_dc_precision = picture_info->intra_dc_precision; picture.f_code[0][0] = picture_info->f_code[0][0] - 1; picture.f_code[0][1] = picture_info->f_code[0][1] - 1; picture.f_code[1][0] = picture_info->f_code[1][0] - 1; @@ -223,9 +224,12 @@ vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder, decoder->set_picture_parameters(decoder, &picture.base); - memcpy(intra_quantizer_matrix, picture_info->intra_quantizer_matrix, sizeof(intra_quantizer_matrix)); - intra_quantizer_matrix[0] = 1 << (7 - picture_info->intra_dc_precision); - decoder->set_quant_matrix(decoder, intra_quantizer_matrix, picture_info->non_intra_quantizer_matrix); + memset(&quant, 0, sizeof(quant)); + quant.base.codec = PIPE_VIDEO_CODEC_MPEG12; + quant.intra_matrix = picture_info->intra_quantizer_matrix; + quant.non_intra_matrix = picture_info->non_intra_quantizer_matrix; + + decoder->set_quant_matrix(decoder, &quant.base); decoder->begin_frame(decoder); -- cgit v1.2.3