[FFmpeg-devel] [PATCH] Fix vf_cropdetect returning negative rectangles

Michael Niedermayer michaelni at gmx.at
Thu Sep 4 22:08:37 CEST 2014


On Tue, Sep 02, 2014 at 02:20:40PM -0700, hjiodjf 97xgw46 wrote:
> The cropdetect filter is prone to reporting negative-sized rectangles,
> particularly for dark images. This patch adjusts the limits of the
> filter loops, preventing the left/right and top/bottom offsets from
> crossing each other, so that such a zero-sized rectangle is reported
> instead of a negative one. This improves the reliability of using
> cropdetect to find a maximum bounding rectangle.

why would this improve the reliability of using the values ?

i think its mostly a question if when no rectangle is found
negative w/h is returned or 0,0 with a random x/y
i dont know which is better but this patch also reduces the amount
of computations in that case so i tend toward applying it


>  vf_cropdetect.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 07877d20186041d6ad44359d10c2c079ba954d06  0001-Prevent-vf_cropdetect-from-returning-negative-rectan.patch
> From 971e0ec056e6200064598dbca49c18b8653e08d4 Mon Sep 17 00:00:00 2001
> From: tue46wsdgxfjrt <jfbvxt at gmail.com>
> Date: Tue, 2 Sep 2014 13:57:45 -0700
> Subject: [PATCH] Prevent vf_cropdetect from returning negative rectangle
>  sizes.

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- 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/20140904/cece7a5c/attachment.asc>


More information about the ffmpeg-devel mailing list