mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
[g3dvl] split quant matrix out of picture info
This commit is contained in:
parent
c4a168819d
commit
b4fa7db656
4 changed files with 26 additions and 15 deletions
|
|
@ -330,6 +330,18 @@ vl_mpeg12_buffer_begin_frame(struct pipe_video_decode_buffer *buffer)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
vl_mpeg12_buffer_set_quant_matrix(struct pipe_video_decode_buffer *buffer,
|
||||
uint8_t intra_matrix[64],
|
||||
uint8_t non_intra_matrix[64])
|
||||
{
|
||||
struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < VL_MAX_PLANES; ++i)
|
||||
vl_zscan_upload_quant(&buf->zscan[i], intra_matrix, non_intra_matrix);
|
||||
}
|
||||
|
||||
static struct pipe_ycbcr_block *
|
||||
vl_mpeg12_buffer_get_ycbcr_stream(struct pipe_video_decode_buffer *buffer, int component)
|
||||
{
|
||||
|
|
@ -378,7 +390,6 @@ vl_mpeg12_buffer_decode_bitstream(struct pipe_video_decode_buffer *buffer,
|
|||
unsigned num_ycbcr_blocks[3])
|
||||
{
|
||||
struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer;
|
||||
uint8_t intra_quantizer_matrix[64];
|
||||
struct vl_mpeg12_decoder *dec;
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -387,13 +398,8 @@ vl_mpeg12_buffer_decode_bitstream(struct pipe_video_decode_buffer *buffer,
|
|||
dec = (struct vl_mpeg12_decoder *)buf->base.decoder;
|
||||
assert(dec);
|
||||
|
||||
memcpy(intra_quantizer_matrix, picture->intra_quantizer_matrix, sizeof(intra_quantizer_matrix));
|
||||
intra_quantizer_matrix[0] = 1 << (7 - picture->intra_dc_precision);
|
||||
|
||||
for (i = 0; i < VL_MAX_PLANES; ++i) {
|
||||
for (i = 0; i < VL_MAX_PLANES; ++i)
|
||||
vl_zscan_set_layout(&buf->zscan[i], picture->alternate_scan ? dec->zscan_alternate : dec->zscan_normal);
|
||||
vl_zscan_upload_quant(&buf->zscan[i], intra_quantizer_matrix, picture->non_intra_quantizer_matrix);
|
||||
}
|
||||
|
||||
vl_mpg12_bs_decode(&buf->bs, num_bytes, data, picture, num_ycbcr_blocks);
|
||||
}
|
||||
|
|
@ -473,6 +479,7 @@ vl_mpeg12_create_buffer(struct pipe_video_decoder *decoder)
|
|||
buffer->base.decoder = decoder;
|
||||
buffer->base.destroy = vl_mpeg12_buffer_destroy;
|
||||
buffer->base.begin_frame = vl_mpeg12_buffer_begin_frame;
|
||||
buffer->base.set_quant_matrix = vl_mpeg12_buffer_set_quant_matrix;
|
||||
buffer->base.get_ycbcr_stream = vl_mpeg12_buffer_get_ycbcr_stream;
|
||||
buffer->base.get_ycbcr_buffer = vl_mpeg12_buffer_get_ycbcr_buffer;
|
||||
buffer->base.get_mv_stream_stride = vl_mpeg12_buffer_get_mv_stream_stride;
|
||||
|
|
|
|||
|
|
@ -179,6 +179,13 @@ struct pipe_video_decode_buffer
|
|||
*/
|
||||
void (*begin_frame)(struct pipe_video_decode_buffer *decbuf);
|
||||
|
||||
/**
|
||||
* set the quantification matrixes
|
||||
*/
|
||||
void (*set_quant_matrix)(struct pipe_video_decode_buffer *decbuf,
|
||||
uint8_t intra_matrix[64],
|
||||
uint8_t non_intra_matrix[64]);
|
||||
|
||||
/**
|
||||
* get the pointer where to put the ycbcr blocks of a component
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -113,13 +113,9 @@ struct pipe_mpeg12_picture_desc
|
|||
unsigned frame_pred_frame_dct;
|
||||
unsigned q_scale_type;
|
||||
unsigned alternate_scan;
|
||||
unsigned intra_dc_precision;
|
||||
unsigned intra_vlc_format;
|
||||
unsigned concealment_motion_vectors;
|
||||
unsigned f_code[2][2];
|
||||
|
||||
uint8_t *intra_quantizer_matrix;
|
||||
uint8_t *non_intra_quantizer_matrix;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
|||
|
|
@ -160,6 +160,7 @@ vlVdpDecoderRenderMpeg2(struct pipe_video_decoder *decoder,
|
|||
{
|
||||
struct pipe_mpeg12_picture_desc picture;
|
||||
struct pipe_video_buffer *ref_frames[2];
|
||||
uint8_t intra_quantizer_matrix[64];
|
||||
unsigned num_ycbcr_blocks[3] = { 0, 0, 0 };
|
||||
unsigned i;
|
||||
|
||||
|
|
@ -189,7 +190,6 @@ vlVdpDecoderRenderMpeg2(struct pipe_video_decoder *decoder,
|
|||
picture.frame_pred_frame_dct = picture_info->frame_pred_frame_dct;
|
||||
picture.q_scale_type = picture_info->q_scale_type;
|
||||
picture.alternate_scan = picture_info->alternate_scan;
|
||||
picture.intra_dc_precision = picture_info->intra_dc_precision;
|
||||
picture.intra_vlc_format = picture_info->intra_vlc_format;
|
||||
picture.concealment_motion_vectors = picture_info->concealment_motion_vectors;
|
||||
picture.f_code[0][0] = picture_info->f_code[0][0] - 1;
|
||||
|
|
@ -197,11 +197,12 @@ vlVdpDecoderRenderMpeg2(struct pipe_video_decoder *decoder,
|
|||
picture.f_code[1][0] = picture_info->f_code[1][0] - 1;
|
||||
picture.f_code[1][1] = picture_info->f_code[1][1] - 1;
|
||||
|
||||
picture.intra_quantizer_matrix = picture_info->intra_quantizer_matrix;
|
||||
picture.non_intra_quantizer_matrix = picture_info->non_intra_quantizer_matrix;
|
||||
|
||||
buffer->begin_frame(buffer);
|
||||
|
||||
memcpy(intra_quantizer_matrix, picture_info->intra_quantizer_matrix, sizeof(intra_quantizer_matrix));
|
||||
intra_quantizer_matrix[0] = 1 << (7 - picture_info->intra_dc_precision);
|
||||
buffer->set_quant_matrix(buffer, intra_quantizer_matrix, picture_info->non_intra_quantizer_matrix);
|
||||
|
||||
for (i = 0; i < bitstream_buffer_count; ++i)
|
||||
buffer->decode_bitstream(buffer, bitstream_buffers[i].bitstream_bytes,
|
||||
bitstream_buffers[i].bitstream, &picture, num_ycbcr_blocks);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue