[FFmpeg-devel] [PATCH]VDPAU patch for MPEG1/2 decoding, round 3

Michael Niedermayer michaelni
Thu Jan 8 02:48:13 CET 2009


On Thu, Jan 08, 2009 at 03:23:22AM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached is an updated version of the VDPAU patch to allow hardware 
> decoding of MPEG1/2 streams.
>
> Please comment, Carl Eugen


[...]
> +void ff_vdpau_mpeg_picture_complete(MpegEncContext *s, const uint8_t *buf,
> +                                    int buf_size, int slice_count)
> +{
> +    struct vdpau_render_state * render;
> +
> +    render = (struct vdpau_render_state*)s->current_picture_ptr->data[0];
> +    assert(render);
> +
> +    render->bitstream_buffers= av_fast_realloc(
> +        render->bitstream_buffers,
> +        &render->bitstream_buffers_allocated,
> +        sizeof(*render->bitstream_buffers)*(render->bitstream_buffers_used + 1)
> +    );
> +
> +    render->bitstream_buffers[0].struct_version  = VDP_BITSTREAM_BUFFER_VERSION;
> +    render->bitstream_buffers[0].bitstream_bytes = buf_size;
> +    render->bitstream_buffers[0].bitstream       = buf;
> +    render->bitstream_buffers_used               = 1;
> +
> +    render->info.mpeg.slice_count                = slice_count;
> +
> +    if (slice_count > 0) {
> +        ff_draw_horiz_band(s, 0, s->avctx->height);
> +    }
> +    render->bitstream_buffers_used = 0;
> +}
> +

this looks similar to ff_vdpau_h264_add_data_chunk()
maybe it can be merged?


[...]
> Index: libavcodec/imgconvert.c
> ===================================================================
> --- libavcodec/imgconvert.c	(revision 16489)
> +++ libavcodec/imgconvert.c	(working copy)
> @@ -267,6 +267,12 @@
>      [PIX_FMT_XVMC_MPEG2_IDCT] = {
>          .name = "xvmcidct",
>      },
> +    [PIX_FMT_VDPAU_MPEG1] = {
> +        .name = "vdpau_mpeg1",
> +    },
> +    [PIX_FMT_VDPAU_MPEG2] = {
> +        .name = "vdpau_mpeg2",
> +    },
>      [PIX_FMT_VDPAU_H264] = {
>          .name = "vdpau_h264",
>      },

also see sws_format_name()
iam not sure if theres much point in updating it but if the one in 
imgconvert.c is updated so should the sws one

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Frequently ignored awnser#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090108/df8d4f9c/attachment.pgp>



More information about the ffmpeg-devel mailing list