From patchwork Mon Jun 12 05:59:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Mark X-Patchwork-Id: 3920 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.195 with SMTP id 186csp745363vsk; Sun, 11 Jun 2017 23:00:37 -0700 (PDT) X-Received: by 10.28.46.23 with SMTP id u23mr6425184wmu.102.1497247237124; Sun, 11 Jun 2017 23:00:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497247237; cv=none; d=google.com; s=arc-20160816; b=g2JPaTbszRjzgDfp/UCy36tumdGGEdZnM6ynQdscgoquQpNliZVTZQLz+GBfS8Xx7N UBTJpUVDb++PRQq6Gq2KxjMW3lVZEaenSSgm5G+EW236DZJqnWMq4mayiRm/0RqXMsAG /Bb0IRGeDIXRSmWlmQMz+lyHS4Mw0T3RPQAcLrgc1sntVW1HkSY3Wb41SO3DKfVNELnN 9VbyFrC2Fn/e1wHMPs9rtLFjo6ZMAXF6q0mGOXDF2bq4ZVrflWw93BIYzOJ+3EGOIQB/ jtZ/hxLIazJhgrrfj8sUMIsFFpLygGdYrWtqoRDaX3sW47bgdwjI6VehIY+KnSEMJvmu 0BBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=CFcvOi4B6DdQ0QxaG9EafsN/mDmavCoLGzBrVyn2v3o=; b=kYqBfSUTkdWMr/QqacRLzttkrHiMFyayOh2M/ChQbPbljJ+w4uCsE5UN4Ut4iUb/TS Hqxk8qcYhJIarLwegcFCyurM1QmKh/YSz1ny4xHny/RTKRtKKeKoBreIhQdfg8Yk+N6j 0D/Y8fO4bhn6Bzk8WE4hQX6/QlAehamayE9cSgjk+EGFuc8nr4GEYVD0wFUpkPsxDyEG ujtth8bMZUT67fcNuZN7qj2gXCrqZXIggruP3BHMRL9YyDKiLU0c36tWWB0r+7UNRqb7 or9iNZ7o5aASyMIQPgoq6SXBoYD3kM92JZV5N3UP5ABphjERnqGp2+PhLzqA2dsG1BhR Yp+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p184si6862575wme.20.2017.06.11.23.00.36; Sun, 11 Jun 2017 23:00:37 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5AE6F689E34; Mon, 12 Jun 2017 09:00:32 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f194.google.com (mail-qt0-f194.google.com [209.85.216.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A4B28689E1C for ; Mon, 12 Jun 2017 09:00:25 +0300 (EEST) Received: by mail-qt0-f194.google.com with SMTP id s33so24485727qtg.3 for ; Sun, 11 Jun 2017 23:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bE5D4AorzQPV/fw65yYH0FXO7xSrxHkKhqHVTfIJF1o=; b=OHJ45xfiVlC3TOwhfzYq1H5ka32R9Xx+gZWNkadv8diBsu4MgCOJpiG/mHsgv6tVK3 mn14azkCPHg5rNg+80olQtVGtQwHMgv8wXSvCvA7Fq3n5H5i85OQCkZEFTnI7GfEQsA6 EIG5lDCLRzelxb5i1KJjUg2U6uYqo035guIHjUFghhBav6LLl7VqPJhNjz0RgztTn6ZI BQ0InVPJlq9HiMA14P9JiKVbppeqpOkTh0PeGAY27QEz2q5z1vVZ4Muuwqe91f0FWKvg DO6n6QhoKO76V3YpohygCMwK3dk96o+FszjnZpfl20J682ClvK1tUWeWQ6p0AHyK4UTz bk8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bE5D4AorzQPV/fw65yYH0FXO7xSrxHkKhqHVTfIJF1o=; b=n8BiHnGWsGGZEwEv+29F80k78+2hSJBU1ILWMCdHJe/CyA4s6M5ylriPA6EdNYKx+l TSNGGwu3cIqRK6NIOsLK7DuyTc+Jr5ORsbmLOJIU8FwwjBPazWKEbBOy1GNNnJrIB/yA fw0UnrTHY36xH7Qsd6P2A6mCDKHxUpWnKN8BMCHiYGyT3SNY0tUtcvKXVAPK0IX7dNti NHBXenB2G3zmuZGw1pmIc2ZDiEtq1+2rHQbsSYu6q3+ouvr0PD8K22LJyZazGNmXpaJd RVAf2T9orqmK13LcopLJKC1eRsr2aQ78CQXnhEeJQnYJXMjgmcMCg81Y33zz4iZ7B8DZ 0vXQ== X-Gm-Message-State: AKS2vOy5OrjK0xXwfxBqH74FGPw/KwvOBvfTvqMTTjf1pguhGYuf7IWR S4JOx+Mg0Acj68emayE= X-Received: by 10.237.48.80 with SMTP id 74mr9249909qte.10.1497247226194; Sun, 11 Jun 2017 23:00:26 -0700 (PDT) Received: from Klingon.fios-router.home (pool-173-69-140-247.bltmmd.fios.verizon.net. [173.69.140.247]) by smtp.gmail.com with ESMTPSA id 63sm2149643qkb.60.2017.06.11.23.00.25 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 11 Jun 2017 23:00:25 -0700 (PDT) From: Kevin Mark To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Jun 2017 01:59:05 -0400 Message-Id: <20170612055905.42973-1-kmark937@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH] doc/filters: Correct scale doc regarding w/h <= 0 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Kevin Mark MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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 --- doc/filters.texi | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) 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.