[FFmpeg-devel] [PATCH] Implement pixdesctest filter

Michael Niedermayer michaelni
Tue Jun 22 02:22:51 CEST 2010


On Mon, Jun 21, 2010 at 11:25:29PM +0200, Stefano Sabatini wrote:
[...]
> +static int config_props(AVFilterLink *inlink)
> +{
> +    PixdescTestContext *priv = inlink->dst->priv;
> +
> +    priv->pix_desc = &av_pix_fmt_descriptors[inlink->format];
> +
> +    if (!(priv->line = av_malloc(sizeof(*priv->line) * inlink->w)))
> +        return AVERROR(ENOMEM);
> +
> +    return 0;
> +}
> +
> +static void start_frame(AVFilterLink *inlink, AVFilterPicRef *picref)
> +{
> +    PixdescTestContext *priv = inlink->dst->priv;
> +    AVFilterLink *outlink    = inlink->dst->outputs[0];
> +    AVFilterPicRef *outpicref;
> +    int i;
> +
> +    outlink->outpic = avfilter_get_video_buffer(outlink, AV_PERM_WRITE,
> +                                                outlink->w, outlink->h);
> +    outpicref = outlink->outpic;

> +    outpicref->pts             = picref->pts;
> +    outpicref->pos             = picref->pos;
> +    outpicref->pixel_aspect    = picref->pixel_aspect;
> +    outpicref->interlaced      = picref->interlaced;
> +    outpicref->top_field_first = picref->top_field_first;

this code should be factored into its own function it likely is duplicated
over a few filters


> +
> +    for (i = 0; i < 4; i++) {
> +        int h = outlink->h;
> +        h = i == 1 || i == 2 ? h>>priv->pix_desc->log2_chroma_h : h;
> +        if (outpicref->data[i])
> +            memset(outpicref->data[i], 0, outpicref->linesize[i] * h);
> +    }

can linesize be <0 here?


[...]
> diff --git a/tests/lavfi-regression.sh b/tests/lavfi-regression.sh
> index ebbc0f3..42fba34 100755
> --- a/tests/lavfi-regression.sh
> +++ b/tests/lavfi-regression.sh
> @@ -86,6 +86,19 @@ if [ -n "$do_lavfi_pix_fmts" ]; then
>      done
>  fi
>  
> +if [ -n "$do_lavfi_pixdesc" ]; then
> +    pix_fmts="$($ffmpeg -pix_fmts list 2>/dev/null | sed -ne '9,$p' | grep '^IO' | cut -d' ' -f2)"
> +
> +    ref_file=tests/ref/lavfi/lavfi_pixdesc
> +    rm -f $ref_file
> +
> +    for pix_fmt in $pix_fmts; do
> +        cat $ref_file-$pix_fmt >> $ref_file
> +        do_video_encoding "lavfi_pixdesc-${pix_fmt}.nut" "" \
> +            "-vf slicify=random,format=$pix_fmt,pixdesctest -vcodec rawvideo -pix_fmt $pix_fmt"

shouldnt it be converted back and compared by tiny_psnr too?

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- 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/20100622/70c9ebfe/attachment.pgp>



More information about the ffmpeg-devel mailing list