[FFmpeg-devel] [PATCH]VDPAU patch for VC1 decoding, round 6

Michael Niedermayer michaelni
Wed Jan 14 00:18:04 CET 2009


On Tue, Jan 13, 2009 at 10:59:14PM +0100, Carl Eugen Hoyos wrote:
> Hi!
>
> Attached is a version of the VDPAU-VC1/WMV3 decoder patch that does not add 
> a CODEC_ID.
>
> Please comment, Carl Eugen

[...]

> Index: libavutil/avutil.h
> ===================================================================
> --- libavutil/avutil.h	(revision 16579)
> +++ libavutil/avutil.h	(working copy)
> @@ -122,6 +122,8 @@
>      PIX_FMT_YUVJ440P,  ///< Planar YUV 4:4:0 full scale (jpeg)
>      PIX_FMT_YUVA420P,  ///< Planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
>      PIX_FMT_VDPAU_H264,///< H264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
> +    PIX_FMT_VDPAU_VC1_MAIN,///< VC1 main profile HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
> +    PIX_FMT_VDPAU_VC1_ADVANCED,///< VC1 advanced profile HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
>      PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
>  };

Iam against pix formats per profile


[...]
> +void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
> +                                 int buf_size)
> +{
> +    VC1Context *v = s->avctx->priv_data;
> +    struct vdpau_render_state * render,* last, * next;
> +
> +    render = (struct vdpau_render_state*)s->current_picture.data[0];
> +    assert(render);
> +
> +    /*  fill LvPictureInfoVC1 struct */
> +    render->info.vc1.frame_coding_mode  = v->fcm;
> +    render->info.vc1.postprocflag       = v->postprocflag;
> +    render->info.vc1.pulldown           = v->broadcast;
> +    render->info.vc1.interlace          = v->interlace;
> +    render->info.vc1.tfcntrflag         = v->tfcntrflag;
> +    render->info.vc1.finterpflag        = v->finterpflag;
> +    render->info.vc1.psf                = v->psf;
> +    render->info.vc1.dquant             = v->dquant;
> +    render->info.vc1.panscan_flag       = v->panscanflag;
> +    render->info.vc1.refdist_flag       = v->refdist_flag;
> +    render->info.vc1.quantizer          = v->quantizer_mode;
> +    render->info.vc1.extended_mv        = v->extended_mv;
> +    render->info.vc1.extended_dmv       = v->extended_dmv;
> +    render->info.vc1.overlap            = v->overlap;
> +    render->info.vc1.vstransform        = v->vstransform;
> +    render->info.vc1.loopfilter         = v->s.loop_filter;
> +    render->info.vc1.fastuvmc           = v->fastuvmc;
> +    render->info.vc1.range_mapy_flag    = v->range_mapy_flag;
> +    render->info.vc1.range_mapy         = v->range_mapy;
> +    render->info.vc1.range_mapuv_flag   = v->range_mapuv_flag;
> +    render->info.vc1.range_mapuv        = v->range_mapuv;
> +    /* Specific to simple/main profile only */
> +    render->info.vc1.multires           = v->multires;
> +    render->info.vc1.syncmarker         = v->s.resync_marker;
> +    render->info.vc1.rangered           = v->rangered;
> +    render->info.vc1.maxbframes         = v->s.max_b_frames;
> +    /* Presently, making these as 0 */
> +    render->info.vc1.deblockEnable      = 0;
> +    render->info.vc1.pquant             = 0;
> +
> +    render->info.vc1.forward_reference  = VDP_INVALID_HANDLE;
> +    render->info.vc1.backward_reference = VDP_INVALID_HANDLE;
> +
> +    switch(s->pict_type){
> +    case  FF_I_TYPE:
> +        render->info.vc1.picture_type     = 0;
> +        break;
> +    case  FF_B_TYPE:

> +        if (v->bi_type)
> +            render->info.vc1.picture_type = 4;
> +        else
> +            render->info.vc1.picture_type = 3;
> +        break;
[...]
> +    case  FF_BI_TYPE:
> +        render->info.vc1.picture_type     = 4;
> +        break;
> +    }

This looks redundant
and actually, the FF_BI_TYPE looks just like a poor hack
whichever is the correct pict_type it should not be changed
that is if bi_type is used to identify them then FF_BI_TYPE should
be removed from libavcodec, otherwise bi_type should be removed

and the code above is just
if(v->bi_type) render->info.vc1.picture_type= 4
else           render->info.vc1.picture_type= table[s->pict_type];


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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu
-------------- 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/20090114/1dbf8696/attachment.pgp>



More information about the ffmpeg-devel mailing list