[FFmpeg-devel] [PATCH][VAAPI][3/6] Add MPEG-2 bitstream decoding (take 2)

Aurelien Jacobs aurel
Wed Mar 4 22:39:25 CET 2009


Gwenole Beauchesne wrote:

> Hi,
> 
> On Thu, 26 Feb 2009, Michael Niedermayer wrote:
> 
> >> This patch adds MPEG-2 bitstream decoding through VA API. As you can see,
> >> provided common code is in place, implementation of a codec is rather
> >> trivial, i.e. it's "enough" to fill in the right data structures.
> >>
> >> Regards,
> >> Gwenole.
> >
> >> commit 3477d95ef12228713e16ccf0c1f4f29f7c7ab05e
> >> Author: Gwenole Beauchesne <gbeauchesne at splitted-desktop.com>
> >> Date:   Wed Feb 25 15:30:51 2009 +0000
> >>
> >>     Add MPEG-2 bitstream decoding.
> >
> > may i suggest that each vaapi decoder is placed in its own file
> > with common vaapi.c/h for the common code?
> 
> New patch attached.
> 
> [...]
> 
> --- /dev/null
> +++ b/libavcodec/vaapi_mpeg2.c
> @@ -0,0 +1,198 @@
> + [...]
> +
> +/* ====================================================================== */
> +/* === MPEG-2                                                         === */
> +/* ====================================================================== */

What is this comment supposed to be good for ?
This file is named vaapi_mpeg2.c and is only related to mpeg2 anyway...

> + [...]
> +
> +#if CONFIG_MPEG2_VAAPI_HWACCEL
> +AVHWAccel mpeg2_vaapi_hwaccel = {
> +    .name           = "mpeg2_vaapi",
> +    .type           = CODEC_TYPE_VIDEO,
> +    .id             = CODEC_ID_MPEG2VIDEO,
> +    .pix_fmt        = PIX_FMT_VAAPI_VLD,
> +    .capabilities   = 0,
> +    .start_frame    = vaapi_mpeg2_start_frame,
> +    .end_frame      = ff_vaapi_common_end_frame,
> +    .decode_slice   = vaapi_mpeg2_decode_slice,
> +    .priv_data_size = sizeof(struct vaapi_render_state_private),
> +    .close          = ff_vaapi_destroy_picture,
> +};
> +#endif

This file won't ever be compiled without CONFIG_MPEG2_VAAPI_HWACCEL
so the #if is useless.

I guess those remarks also apply to every codec specific vaapi_*.c files.

Aurel




More information about the ffmpeg-devel mailing list