[FFmpeg-devel] VA API updates

Diego Biurrun diego
Tue Jan 6 18:49:31 CET 2009


On Tue, Jan 06, 2009 at 06:09:05PM +0100, Gwenole Beauchesne wrote:
>
> I have attached an updated patch for VA API support.
>
> --- libavcodec/vaapi.h	(revision 0)
> +++ libavcodec/vaapi.h	(revision 0)
> @@ -0,0 +1,114 @@
> +
> +#include <va.h>
> +#include "avcodec.h"

You should add stdint.h there, you are using intXX_t types etc.

> +/**
> + * \brief This structure is used as a callback between the FFmpeg
> + * decoder (vd_) and the MPlayer presentation (vo_) module.
> + * This is defined by the client application prior to calling the
> + * FFmpeg decode functions.

I don't see how these MPlayer-related comments belong here..

> +    union {
> +        VAPictureParameterBufferMPEG2 mpeg2;
> +        VAPictureParameterBufferMPEG4 mpeg4;
> +        VAPictureParameterBufferH264 h264;

This could be aligned.

> +    void *slice_params;                 ///< Pointer to VASliceParameterBuffers
> +    uint32_t slice_count;               ///< Number of slices currently filled in
> +    uint32_t slice_count_max;           ///< Maximum number of slices that were pre-allocated (server-wise or FFmpeg-side)
> +    uint8_t *slice_data;                ///< Pointer to slice data (buffer mapped from server or memory allocated by FFmpeg)
> +    uint32_t slice_data_size;           ///< Current size of slice data
> +    uint32_t slice_data_size_max;       ///< Maximum size of allocated slice data

ditto

> --- libavcodec/h264.c	(revision 16453)
> +++ libavcodec/h264.c	(working copy)
> @@ -2216,7 +2219,9 @@
>  
>      if(MPV_frame_start(s, s->avctx) < 0)
>          return -1;
> +
>      ff_er_frame_start(s);
> +

cosmetics

> @@ -7148,6 +7157,7 @@
>                 ((const char*[]){"Gray","420","422","444"})[sps->chroma_format_idc]
>                 );
>      }
> +
>      av_free(h->sps_buffers[sps_id]);
>      h->sps_buffers[sps_id]= sps;
>      return 0;

again

> --- libavcodec/vaapivideo.c	(revision 0)
> +++ libavcodec/vaapivideo.c	(revision 0)
> @@ -0,0 +1,1233 @@
> +
> +#define DEBUG 0
> +
> +#if DEBUG
> +#define D(x) x
> +#define bug(...) av_log(NULL, AV_LOG_INFO, __VA_ARGS__)
> +#else
> +#define D(x)
> +#endif

dprintf?

> +#if 1

Looks like debug leftovers..

> --- libavcodec/allcodecs.c	(revision 16453)
> +++ libavcodec/allcodecs.c	(working copy)
> @@ -173,6 +173,11 @@
>      REGISTER_DECODER (XSUB, xsub);
>      REGISTER_ENCDEC  (ZLIB, zlib);
>      REGISTER_ENCDEC  (ZMBV, zmbv);
> +#ifdef CONFIG_VAAPI
> +    REGISTER_DECODER (MPEG2_VAAPI, mpeg2_vaapi);
> +    REGISTER_DECODER (MPEG4_VAAPI, mpeg4_vaapi);
> +    REGISTER_DECODER (H264_VAAPI, h264_vaapi);
> +#endif

Read the macro definition at the top of the file again, the #ifdef is
useless.  Also, this is not in alphabetical order.

Diego




More information about the ffmpeg-devel mailing list