diff options
author | Christian König <[email protected]> | 2011-05-04 18:56:32 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2011-05-04 18:58:55 +0200 |
commit | c888fe027c338f337123de4da2de1ac73b0f7587 (patch) | |
tree | 7eb25f918ae1ae3c233242c866b81bbdf3388719 /src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | |
parent | f20608b951dd629ecc1fceb111a876c1c70c57a9 (diff) |
[g3dvl] Implement MPEG2 VLD
Based uppon xine's slice_xvmc.c.
This gets VDPAU up and running.
Diffstat (limited to 'src/gallium/auxiliary/vl/vl_mpeg12_decoder.c')
-rw-r--r-- | src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c index 74ec4b1db7b..b78844b9cfd 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c @@ -346,6 +346,19 @@ vl_mpeg12_buffer_map(struct pipe_video_decode_buffer *buffer) buf->texels[i] = dec->pipe->transfer_map(dec->pipe, buf->tex_transfer[i]); } + + if (dec->base.entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) { + struct pipe_ycbcr_block *ycbcr_stream[VL_MAX_PLANES]; + struct pipe_motionvector *mv_stream[VL_MAX_REF_FRAMES]; + + for (i = 0; i < VL_MAX_PLANES; ++i) + ycbcr_stream[i] = vl_vb_get_ycbcr_stream(&buf->vertex_stream, i); + + for (i = 0; i < VL_MAX_REF_FRAMES; ++i) + mv_stream[i] = vl_vb_get_mv_stream(&buf->vertex_stream, i); + + vl_mpg12_bs_set_buffers(&buf->bs, ycbcr_stream, buf->texels, mv_stream); + } } static struct pipe_ycbcr_block * @@ -390,6 +403,17 @@ vl_mpeg12_buffer_get_mv_stream(struct pipe_video_decode_buffer *buffer, int ref_ } static void +vl_mpeg12_buffer_decode_bitstream(struct pipe_video_decode_buffer *buffer, + unsigned num_bytes, const void *data, + struct pipe_mpeg12_picture_desc *picture, + unsigned num_ycbcr_blocks[3]) +{ + struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer; + + vl_mpg12_bs_decode(&buf->bs, num_bytes, data, picture, num_ycbcr_blocks); +} + +static void vl_mpeg12_buffer_unmap(struct pipe_video_decode_buffer *buffer) { struct vl_mpeg12_buffer *buf = (struct vl_mpeg12_buffer*)buffer; @@ -462,6 +486,7 @@ vl_mpeg12_create_buffer(struct pipe_video_decoder *decoder) buffer->base.get_ycbcr_buffer = vl_mpeg12_buffer_get_ycbcr_buffer; buffer->base.get_mv_stream_stride = vl_mpeg12_buffer_get_mv_stream_stride; buffer->base.get_mv_stream = vl_mpeg12_buffer_get_mv_stream; + buffer->base.decode_bitstream = vl_mpeg12_buffer_decode_bitstream; buffer->base.unmap = vl_mpeg12_buffer_unmap; if (!vl_vb_init(&buffer->vertex_stream, dec->pipe, @@ -479,6 +504,9 @@ vl_mpeg12_create_buffer(struct pipe_video_decoder *decoder) if (!init_zscan_buffer(buffer)) goto error_zscan; + if (dec->base.entrypoint == PIPE_VIDEO_ENTRYPOINT_BITSTREAM) + vl_mpg12_bs_init(&buffer->bs, dec->base.width, dec->base.height); + return &buffer->base; error_zscan: |