[FFmpeg-devel] [PATCH] CrystalHD decoder support v3

Benoit Fouet benoit.fouet
Tue Feb 1 11:51:34 CET 2011


Hi,

On Mon, 31 Jan 2011 23:17:31 +0100 Diego Biurrun wrote:
> On Sun, Jan 30, 2011 at 06:53:08PM -0800, Philip Langdale wrote:
> > --- /dev/null
> > +++ b/libavcodec/crystalhd.c
> > @@ -0,0 +1,903 @@
> > +static av_cold int init(AVCodecContext *avctx)
> > +{
> > +    CHDContext* priv;
> > +    BC_INPUT_FORMAT format;
> > +    BC_STATUS ret;
> > +
> > +    memset(&format, 0, sizeof(BC_INPUT_FORMAT));
> > +    format.FGTEnable = FALSE;
> > +    format.Progressive = TRUE;
> > +    format.OptFlags = 0x80000000 | vdecFrameRate59_94 | 0x40;
> > +    format.width = avctx->width;
> > +    format.height = avctx->height;
> 
> BC_INPUT_FORMAT format = { 0 };
> 
> instead of the memset seems nicer.
> 

Even nicer, IMO, would be to initialize when declaring:
    BC_INPUT_FORMAT format = {
        .FGTEnable   = FALSE,
        .Progressive = TRUE,
        .OptFlags    = 0x80000000 | vdecFrameRate59_94 | 0x40,
        .width       = avctx->width,
        .height      = avctx->height,
    };

> > +static inline CopyRet receive_frame(AVCodecContext *avctx,
> > +                                    void *data, int *data_size,
> > +                                    uint8_t second_field)
> > +{
> > +    BC_STATUS ret;
> > +    BC_DTS_PROC_OUT output;
> > +    CHDContext *priv = avctx->priv_data;
> > +    HANDLE dev = priv->dev;
> > +
> > +    memset(&output, 0, sizeof(BC_DTS_PROC_OUT));
> > +    output.PicInfo.width = avctx->width;
> > +    output.PicInfo.height = avctx->height;
> 
> ditto
> 

ditto

-- 
Ben



More information about the ffmpeg-devel mailing list