[FFmpeg-devel] [PATCH][7/8] Add VA API accelerated H.264 decoding (take 4)

Michael Niedermayer michaelni
Fri Feb 6 19:43:52 CET 2009


On Fri, Feb 06, 2009 at 04:35:02PM +0100, Gwenole Beauchesne wrote:
> Hi,

Hi

Please factorize the code somehow.
I dont want to have all codecs salted with 2 dozen video acceleration APIs

I can see 2 obvious ways
A. each decoder could output through a common API that then outside and
after the codec is converted to VAAPI/VDPAU structs
B. a AVHWAccel struct is added similar to AVCodec and that codecs are
only allowed to call its members like start_frame() start_slice() end_frame()
and such

Iam too tired ATM to say which of the 2 is better or if there is a 3rd that is
better than both but both look better than what all this is heading toward ...


[...]


[...]
> +/* Reconstruct bitstream slice_type */
> +static int h264_get_slice_type(H264Context *h)

doxygen


> +{
> +    int slice_type = -1;
> +    switch (h->slice_type) {
> +    case FF_P_TYPE:  slice_type = 0; break;
> +    case FF_B_TYPE:  slice_type = 1; break;
> +    case FF_I_TYPE:  slice_type = 2; break;
> +    case FF_SP_TYPE: slice_type = 3; break;
> +    case FF_SI_TYPE: slice_type = 4; break;
> +    }
> +    assert(slice_type != -1);

> +#if 0

remove all dead code please


[...]

> +/* Fill in a VAPictureH264 from an FFmpeg Picture */
> +static int vaapi_h264_fill_picture(VAPictureH264 *va_pic, Picture *pic, int pic_structure)
> +{
> +    struct vaapi_render_state *rds;
> +    int poc;
> +
> +    assert(va_pic != NULL);
> +    if (va_pic == NULL)
> +        return -1;
> +    assert(pic != NULL);
> +    if (pic == NULL)
> +        return -1;

!= NULL being redundant x== NULL being !x
and please decide if the condition is allowed or not and then remove either 
the assert or the if()

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- 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/20090206/8d366845/attachment.pgp>



More information about the ffmpeg-devel mailing list