summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-08-12 13:29:00 +0200
committerChristian König <[email protected]>2011-08-26 12:10:34 +0200
commit2e62b30826679e9d5e1a783dc19baabec4fc8dfa (patch)
treeacb12f684ea4e1f95937c4c35f5cde4ca4e3f4db /src/gallium/auxiliary
parent835ea8480f656ba4076e30813eb8c85965017266 (diff)
g3dvl: Rework the decoder interface part 5/5
Make setting the quant matrixes a generic interface. Also removes setting the quant matrix from the XvMC interface Signed-off-by: Christian König <[email protected]> Reviewed-by: Younes Manton <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/vl/vl_mpeg12_decoder.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
index 805a2215133..8100f80665a 100644
--- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
+++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
@@ -513,15 +513,16 @@ vl_mpeg12_set_picture_parameters(struct pipe_video_decoder *decoder,
static void
vl_mpeg12_set_quant_matrix(struct pipe_video_decoder *decoder,
- const uint8_t intra_matrix[64],
- const uint8_t non_intra_matrix[64])
+ const struct pipe_quant_matrix *matrix)
{
struct vl_mpeg12_decoder *dec = (struct vl_mpeg12_decoder *)decoder;
+ const struct pipe_mpeg12_quant_matrix *m = (const struct pipe_mpeg12_quant_matrix *)matrix;
assert(dec);
+ assert(matrix->codec == PIPE_VIDEO_CODEC_MPEG12);
- memcpy(dec->intra_matrix, intra_matrix, 64);
- memcpy(dec->non_intra_matrix, non_intra_matrix, 64);
+ memcpy(dec->intra_matrix, m->intra_matrix, 64);
+ memcpy(dec->non_intra_matrix, m->non_intra_matrix, 64);
}
static void
@@ -576,6 +577,9 @@ vl_mpeg12_begin_frame(struct pipe_video_decoder *decoder)
buf = dec->current_buffer;
assert(buf);
+ if (dec->base.entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM)
+ dec->intra_matrix[0] = 1 << (7 - dec->picture_desc.intra_dc_precision);
+
for (i = 0; i < VL_MAX_PLANES; ++i) {
vl_zscan_upload_quant(&buf->zscan[i], dec->intra_matrix, true);
vl_zscan_upload_quant(&buf->zscan[i], dec->non_intra_matrix, false);
@@ -1152,6 +1156,9 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
if (!init_pipe_state(dec))
goto error_pipe_state;
+ memset(dec->intra_matrix, 0x10, 64);
+ memset(dec->non_intra_matrix, 0x10, 64);
+
return &dec->base;
error_pipe_state: