[FFmpeg-devel] [PATCH] Implement pixdesctest filter

Stefano Sabatini stefano.sabatini-lala
Mon Jun 7 22:41:50 CEST 2010


On date Saturday 2010-02-06 00:48:47 +0100, Stefano Sabatini encoded:
> On date Tuesday 2010-02-02 12:34:04 +0100, Michael Niedermayer encoded:
> > On Tue, Feb 02, 2010 at 12:08:14AM +0100, Stefano Sabatini wrote:
> > > Hi, this filter is useful for testing/pedagogical purposes, so I'd
> > > like to commit it even if we don't still have a test for lavfi.
> > [...]
> > > +static av_cold void uninit(AVFilterContext *ctx)
> > > +{
> > > +    PixdescTestContext *priv = ctx->priv;
> > > +    av_free(priv->line);
> > 
> > please use av_freep() for everything except local variables
> > avoids double frees and access to freed memory
> > 
> > 
> > [...]
> > > +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
> > > +{
> > > +    PixdescTestContext *priv = inlink->dst->priv;
> > > +    int i, c, w = inlink->w;
> > > +
> > > +    AVFilterPicRef *inpic  = inlink->cur_pic;
> > > +    AVFilterPicRef *outpic = inlink->dst->outputs[0]->outpic;
> > > +
> > > +    /* clear destination picture */
> > > +    for (c = 0; c < priv->pix_desc->nb_components; c++) {
> > > +        int h1 = c == 1 || c == 2 ? h>>priv->pix_desc->log2_chroma_h : h;
> > > +        int y1 = c == 1 || c == 2 ? y>>priv->pix_desc->log2_chroma_h : y;
> > 
> > does that work with odd y/h ?
> 
> Tested, we have them the same problem as in the pad filter, so I'll
> suspend this review until I'll have fixed somehow the problem in lsws.
> 
> In attachment an updated patch.

The problem was fixed after Michael fix to libswscale (which we have
still to document...).

Filter and test in attachment.

Note that I have a problem with this test, the generated list of
input/output formats currently depends on the endianness of the
system, that also means that the reference file should be generated
accordingly.

I'll eventually commit the test after the filter, as we'll find a
satisfying solution to that problem.

Regards.
-- 
FFmpeg = Fascinating & Formidable Meaningful Picky Erotic God



More information about the ffmpeg-devel mailing list