[FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

arwa arif arwaarif1994 at gmail.com
Tue Dec 23 18:21:09 CET 2014


>
>
> > From 05dc64b0048547221f63824b4158701f8257e15c Mon Sep 17 00:00:00 2001
> > From: Arwa Arif <arwaarif1994 at gmail.com>
> > Date: Sun, 14 Dec 2014 12:03:31 +0530
> > Subject: [PATCH] lavfi: port mp=fspp to a native libavfilter filter
> [...]
> > diff --git a/libavfilter/version.h b/libavfilter/version.h
> > index 4bd18f3..a405591 100644
> > --- a/libavfilter/version.h
> > +++ b/libavfilter/version.h
> > @@ -30,8 +30,8 @@
> >  #include "libavutil/version.h"
> >
>
> >  #define LIBAVFILTER_VERSION_MAJOR  5
> > -#define LIBAVFILTER_VERSION_MINOR  2
> > -#define LIBAVFILTER_VERSION_MICRO 104
> > +#define LIBAVFILTER_VERSION_MINOR  5
> > +#define LIBAVFILTER_VERSION_MICRO 99
> What's this? Please skip this hunk altogether or update against latest
> master.
>
>
I tried to update against the latest master, but everything messed up. Can
you guide me how to do that?


> [...]
> > +static void mul_thrmat_c(FSPPContext *p, int q)
> > +{
> > +    int a;
> > +    for (a = 0; a < 64; a++)
> > +        ((int8_t *)p->threshold_mtx)[a] = q * ((int8_t
> *)p->threshold_mtx_noq)[a];//ints faster in C
> > +}
>
> As pointed out by Michael I was badly sleepy when I suggested to
> change short -> int8_t.
>
> Lesson: don't trust me, and don't take reviewer's suggestions
> acritically :-)
>

I am very sorry for my carelessness :/


>
> [...]
> > +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> > +{
> > +    AVFilterContext *ctx = inlink->dst;
> > +    FSPPContext *fspp = ctx->priv;
> > +    AVFilterLink *outlink = ctx->outputs[0];
> > +    AVFrame *out = in;
> > +
> > +    int qp_stride = 0;
> > +    uint8_t *qp_table = NULL;
> > +    int i, bias;
> > +    int custom_threshold_m[64];
> > +
> > +    bias = (1 << 4) + fspp->strength;
> > +
> > +    for (i = 0; i < 64; i++) //FIXME: tune custom_threshold[] and
> remove this !
> > +        custom_threshold_m[i] = (uint64_t)(custom_threshold[i] * (bias
> / 71.0) + 0.5);
>
> In the original code:
>
>     for(i=0;i<64;i++) //FIXME: tune custom_threshold[] and remove this !
>         custom_threshold_m[i]=(int)(custom_threshold[i]*(bias/71.)+ 0.5);
>
> The cast to uint64_t may create differences (not sure in this case
> though). In general I think it's better to keep the same type as the
> original, and eventually change them later (possibly after we have a
> test).
>
> [...]
>
> Test with a fixed qp value for comparison, as the mp=fspp is broken
> with regards to qp passing. Also it should generate the same
> output as with -cpuflags 0, but only in case the original filter
> did. Report in any case.
>

mp=fspp and fspp filter are giving same output. But, fspp with -cpuflags 0
is giving different output (visually, it
looks same, but its not bitexact).


> --
> FFmpeg = Friendly Fabulous Meaningless Power Elitarian Gargoyle
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lavfi-port-mp-fspp-to-a-native-libavfilter-filter.patch
Type: text/x-patch
Size: 93061 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20141223/79a3f3d9/attachment.bin>


More information about the ffmpeg-devel mailing list