[FFmpeg-devel] [PATCH] avfilter/vf_cropdetect: adjust Default threshold based on bit depth

Michael Niedermayer michaelni at gmx.at
Wed Dec 31 00:24:45 CET 2014


On Tue, Dec 30, 2014 at 11:14:29PM +0100, Reimar Döffinger wrote:
> On Tue, Dec 30, 2014 at 09:12:13PM +0100, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavfilter/vf_cropdetect.c |    9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
> > index dd237ef..d49101c 100644
> > --- a/libavfilter/vf_cropdetect.c
> > +++ b/libavfilter/vf_cropdetect.c
> > @@ -137,9 +137,12 @@ static int config_input(AVFilterLink *inlink)
> >  {
> >      AVFilterContext *ctx = inlink->dst;
> >      CropDetectContext *s = ctx->priv;
> > +    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> >  
> > -    av_image_fill_max_pixsteps(s->max_pixsteps, NULL,
> > -                               av_pix_fmt_desc_get(inlink->format));
> > +    av_image_fill_max_pixsteps(s->max_pixsteps, NULL, desc);
> > +
> > +    if (s->limit < 0)
> > +        s->limit = 24 << (desc->comp[0].depth_minus1 - 7);
> 
> I'd feel better if you added an assert that depth_minus1 is at least 7.

> Also, it would be nice if it was possible to specify a limit in a way
> that doesn't depend on bit depth (which you might not know when typing
> the command), e.g. as a float value?

ok, changed to make that possible

applied

thx

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- 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/20141231/932591de/attachment.asc>


More information about the ffmpeg-devel mailing list