Submit all bitstreams at once to decode_bitstream.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Maarten Lankhorst <m.b.lankhorst@gmail.com>
}
void
-vl_mpg12_bs_decode(struct vl_mpg12_bs *bs, unsigned num_bytes, const uint8_t *buffer)
+vl_mpg12_bs_decode(struct vl_mpg12_bs *bs, unsigned num_buffers,
+ const void * const *buffers, const unsigned *sizes)
{
assert(bs);
- vl_vlc_init(&bs->vlc, 1, (const void * const *)&buffer, &num_bytes);
+ vl_vlc_init(&bs->vlc, num_buffers, buffers, sizes);
while (vl_vlc_bits_left(&bs->vlc) > 32) {
uint32_t code = vl_vlc_peekbits(&bs->vlc, 32);
vl_mpg12_bs_set_picture_desc(struct vl_mpg12_bs *bs, struct pipe_mpeg12_picture_desc *picture);
void
-vl_mpg12_bs_decode(struct vl_mpg12_bs *bs, unsigned num_bytes, const uint8_t *buffer);
+vl_mpg12_bs_decode(struct vl_mpg12_bs *bs, unsigned num_buffers,
+ const void * const *buffers, const unsigned *sizes);
#endif /* vl_mpeg12_bitstream_h */
static void
vl_mpeg12_decode_bitstream(struct pipe_video_decoder *decoder,
- unsigned num_bytes, const void *data)
+ unsigned num_buffers,
+ const void * const *buffers,
+ const unsigned *sizes)
{
struct vl_mpeg12_decoder *dec = (struct vl_mpeg12_decoder *)decoder;
struct vl_mpeg12_buffer *buf;
vl_zscan_set_layout(&buf->zscan[i], dec->picture_desc.alternate_scan ?
dec->zscan_alternate : dec->zscan_normal);
- vl_mpg12_bs_decode(&buf->bs, num_bytes, data);
+ vl_mpg12_bs_decode(&buf->bs, num_buffers, buffers, sizes);
}
static void
* decode a bitstream
*/
void (*decode_bitstream)(struct pipe_video_decoder *decoder,
- unsigned num_bytes, const void *data);
+ unsigned num_buffers,
+ const void * const *buffers,
+ const unsigned *sizes);
/**
* end decoding of the current frame
{
struct pipe_vc1_picture_desc picture;
struct pipe_video_buffer *ref_frames[2] = {};
- unsigned i;
VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding VC-1\n");
uint32_t bitstream_buffer_count,
VdpBitstreamBuffer const *bitstream_buffers)
{
+ const void * buffers[bitstream_buffer_count];
+ unsigned sizes[bitstream_buffer_count];
vlVdpDecoder *vldecoder;
vlVdpSurface *vlsurf;
VdpStatus ret;
return ret;
dec->begin_frame(dec);
- for (i = 0; i < bitstream_buffer_count; ++i)
- dec->decode_bitstream(dec, bitstream_buffers[i].bitstream_bytes,
- bitstream_buffers[i].bitstream);
+ for (i = 0; i < bitstream_buffer_count; ++i) {
+ buffers[i] = bitstream_buffers[i].bitstream;
+ sizes[i] = bitstream_buffers[i].bitstream_bytes;
+ }
+ dec->decode_bitstream(dec, bitstream_buffer_count, buffers, sizes);
dec->end_frame(dec);
return ret;
}