[FFmpeg-devel] [PATCH][6/8] Add VA API accelerated VC-1 decoding (take 2)

Kostya kostya.shishkov
Fri Jan 30 19:26:50 CET 2009


On Fri, Jan 30, 2009 at 03:48:46PM +0100, Gwenole Beauchesne wrote:
> Hi,
> 
> Here is a new patch minus the VC1Context additions. Also fixes 
> VAPictureParameterBufferVC1::intensity_compensation to be filled in 
> correctly.
> 
> BTW, vc1.[ch] changes now reduce to almost nothing.

Which is a good thing to me :).
 
> Regards,
> Gwenole.

> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index aefcdfd..d16a9c3 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -222,6 +222,7 @@ OBJS-$(CONFIG_ULTI_DECODER)            += ulti.o
>  OBJS-$(CONFIG_VAAPI)                   += vaapivideo.o
>  OBJS-$(CONFIG_VB_DECODER)              += vb.o
>  OBJS-$(CONFIG_VC1_DECODER)             += vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o
> +OBJS-$(CONFIG_VC1_VAAPI_DECODER)       += vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o
>  OBJS-$(CONFIG_VC1_VDPAU_DECODER)       += vdpauvideo.o vc1.o vc1data.o vc1dsp.o msmpeg4data.o h263dec.o h263.o intrax8.o intrax8dsp.o error_resilience.o mpegvideo.o

Do you see any differences here to VDPAU decoder (hint: vaapi specific code)?

[...]
> diff --git a/libavcodec/vaapivideo.c b/libavcodec/vaapivideo.c
> +/* Reconstruct bitstream PTYPE (7.1.1.4) */
> +static int vc1_get_PTYPE(VC1Context *v)
> +{
> +    MpegEncContext * const s = &v->s;
> +    if (v->profile < PROFILE_ADVANCED) {
> +        if (s->avctx->max_b_frames == 0) {
> +            switch (s->pict_type) {     // Table 33
> +            case FF_I_TYPE:     return 0;
> +            case FF_P_TYPE:     return 1;
> +            }
> +        }
> +        else {
> +            switch (s->pict_type) {     // Table 34
> +            case FF_P_TYPE:     return 0;
> +            case FF_I_TYPE:     return 1;
> +            case FF_B_TYPE:
> +            case FF_BI_TYPE:    return 2;
> +            }
> +        }
> +    }
> +    else {
> +        switch (s->pict_type) {         // Table 35
> +        case FF_I_TYPE:         return 0;
> +        case FF_P_TYPE:         return 1;
> +        case FF_B_TYPE:         return 2;
> +        case FF_BI_TYPE:        return 3;
> +        }
> +    }
> +    assert(0);
> +    return 0;
> +}

Err, BI type = s->pict_type == FF_BI_TYPE && v->bi_type
s->pict_type = FF_BI_TYPE is set only during parsing frame header

[...]

in vc1.c - why do you always try to put testing VAAPI prior to VDPAU
in conditions? It got there first, you know.

Besides that I have no objections. If the rest is okayed, someone
can apply this.




More information about the ffmpeg-devel mailing list