[FFmpeg-devel] doc/filters: Correct scale doc regarding w/h <= 0

Submitted by Kevin Mark on June 12, 2017, 5:59 a.m.

Details

Message ID 20170612055905.42973-1-kmark937@gmail.com
State Accepted
Commit 5aea18cbd8828da885d76d528fcbf5b2fd6834ca
Headers show

Commit Message

Kevin Mark June 12, 2017, 5:59 a.m.
According to libavfilter/scale.c, if the width and height are both
less than or equal to 0 then the input size is used for both
dimensions. It does not need to be -1. -1:-1 is the same as 0:0 which
is the same as -10:-42, etc.

if (w < 0 && h < 0)
    eval_w = eval_h = 0;

The documentation for the zscale filter has also been updated since the
behavior is identical.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
---
 doc/filters.texi | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

Comments

Moritz Barsnick June 13, 2017, 11:42 a.m.
On Mon, Jun 12, 2017 at 01:59:05 -0400, Kevin Mark wrote:
> Signed-off-by: Kevin Mark <kmark937@gmail.com>
> ---
>  doc/filters.texi | 39 ++++++++++++++++++++-------------------
>  1 file changed, 20 insertions(+), 19 deletions(-)

Yes, this text looks much more sane and easy to understand.

Moritz
Ronald S. Bultje June 19, 2017, 6:26 p.m.
Hi,

On Tue, Jun 13, 2017 at 7:42 AM, Moritz Barsnick <barsnick@gmx.net> wrote:

> On Mon, Jun 12, 2017 at 01:59:05 -0400, Kevin Mark wrote:
> > Signed-off-by: Kevin Mark <kmark937@gmail.com>
> > ---
> >  doc/filters.texi | 39 ++++++++++++++++++++-------------------
> >  1 file changed, 20 insertions(+), 19 deletions(-)
>
> Yes, this text looks much more sane and easy to understand.


Pushed.

Ronald

Patch hide | download patch | download mbox

diff --git a/doc/filters.texi b/doc/filters.texi
index 65eef89d07..6f2cc89b1f 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -12125,17 +12125,18 @@  the complete list of scaler options.
 Set the output video dimension expression. Default value is the input
 dimension.
 
-If the value is 0, the input width is used for the output.
+If the @var{width} or @var{w} value is 0, the input width is used for
+the output. If the @var{height} or @var{h} value is 0, the input height
+is used for the output.
 
-If one of the values is -1, the scale filter will use a value that
-maintains the aspect ratio of the input image, calculated from the
-other specified dimension. If both of them are -1, the input size is
-used
+If one and only one of the values is -n with n >= 1, the scale filter
+will use a value that maintains the aspect ratio of the input image,
+calculated from the other specified dimension. After that it will,
+however, make sure that the calculated dimension is divisible by n and
+adjust the value if necessary.
 
-If one of the values is -n with n > 1, the scale filter will also use a value
-that maintains the aspect ratio of the input image, calculated from the other
-specified dimension. After that it will, however, make sure that the calculated
-dimension is divisible by n and adjust the value if necessary.
+If both values are -n with n >= 1, the behavior will be identical to
+both values being set to 0 as previously detailed.
 
 See below for the list of accepted constants for use in the dimension
 expression.
@@ -15268,18 +15269,18 @@  The filter accepts the following options.
 Set the output video dimension expression. Default value is the input
 dimension.
 
-If the @var{width} or @var{w} is 0, the input width is used for the output.
-If the @var{height} or @var{h} is 0, the input height is used for the output.
+If the @var{width} or @var{w} value is 0, the input width is used for
+the output. If the @var{height} or @var{h} value is 0, the input height
+is used for the output.
 
-If one of the values is -1, the zscale filter will use a value that
-maintains the aspect ratio of the input image, calculated from the
-other specified dimension. If both of them are -1, the input size is
-used
+If one and only one of the values is -n with n >= 1, the zscale filter
+will use a value that maintains the aspect ratio of the input image,
+calculated from the other specified dimension. After that it will,
+however, make sure that the calculated dimension is divisible by n and
+adjust the value if necessary.
 
-If one of the values is -n with n > 1, the zscale filter will also use a value
-that maintains the aspect ratio of the input image, calculated from the other
-specified dimension. After that it will, however, make sure that the calculated
-dimension is divisible by n and adjust the value if necessary.
+If both values are -n with n >= 1, the behavior will be identical to
+both values being set to 0 as previously detailed.
 
 See below for the list of accepted constants for use in the dimension
 expression.