[FFmpeg-devel] [PATCH] avfilter: add signalstats filter

Michael Niedermayer michaelni at gmx.at
Mon Jun 9 19:48:01 CEST 2014


On Mon, Jun 09, 2014 at 01:40:28PM +0200, Clément Bœsch wrote:
> Signed-off-by: Mark Heath <silicontrip at gmail.com>
> Signed-off-by: Dave Rice <dericed at yahoo.com>
> Signed-off-by: Clément Bœsch <u at pkh.me>
> ---
> - Includes Dave's changes
> - fixed Mark's mail in signed-off (got a delivery error last time)
> - remove libavcodec dependency (using hypot) to fix link errors
> 
> TODO: lavfi minor bump
[...]
> +static int filter_brng(SignalstatsContext *s, const AVFrame *in, AVFrame *out, int y, int w, int h)
> +{
> +    int x, score = 0;
> +    const int yc = y >> s->vsub;
> +    const uint8_t *pluma    = &in->data[0][y  * in->linesize[0]];
> +    const uint8_t *pchromau = &in->data[1][yc * in->linesize[1]];
> +    const uint8_t *pchromav = &in->data[2][yc * in->linesize[2]];
> +
> +    for (x = 0; x < w; x++) {
> +        const int xc = x >> s->hsub;
> +        const int luma    = pluma[x];
> +        const int chromau = pchromau[xc];
> +        const int chromav = pchromav[xc];
> +        const int filt = luma    < 16 || luma    > 235 ||
> +                         chromau < 16 || chromau > 240 ||
> +                         chromav < 16 || chromav > 240;

checks like:
luma - 16U > 235 - 16

might be faster


[...]
> +    lowp   = s->fs  * 10 / 100;
> +    highp  = s->fs  * 90 / 100;
> +    clowp  = s->cfs * 10 / 100;
> +    chighp = s->cfs * 90 / 100;

is the rounding toward 0 instead of nearest intentional ?

no more comments from me, rest LGTM

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140609/9774a1f1/attachment.asc>


More information about the ffmpeg-devel mailing list