From patchwork Mon Jun 5 10:55:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Mark X-Patchwork-Id: 3840 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp1299596vsk; Mon, 5 Jun 2017 03:55:45 -0700 (PDT) X-Received: by 10.28.158.134 with SMTP id h128mr6750300wme.99.1496660145871; Mon, 05 Jun 2017 03:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496660145; cv=none; d=google.com; s=arc-20160816; b=nD5W4oYsrP8TjwPO28RwyxWnXJ8VivQiqOtuvrICC7fS6UNiZ081kkeGLfBekT/O6H PhEowUUrpkFlTSWPV4Vdusfb3cJUReFp2LeATF+m4qQCD+mG24fGrwOExiN/5grZ/RUy bPbrt8NhF8X4p856DMLPyjaFj+XtDIMxWEA/WjCsCScOTJEKcQ+9M+W5fAIwOVXQBtl7 GthcShcF/KYbY9SApJitolIoMYWIg3o1+KtadZqCBWN4tA4R6oXuqey25uhIf3R6W0uF ckRl1fpkxNZUB/wg5weo1hnqRtdw7dTSqH2UoxN24gazzPb+dIJtB+ASR1U5ny3iXxg5 ErFA== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=SI7MnyhensWd+zowu31XFg8EpJOcweUqcB6kfo3blFk=; b=XBTtY+eCn7n6Qdm/XBQ/P/rZo4zgKjD92pFOET2+iEbGuvVo27kC5kCNMoCUzL2+9t OJudaPRCTh+lNQRkP/r2E/I5uspGNJBVRGGB7rQH+NVZ6dKck5I0FznhyhqtAUfdx/qY xRPxrOQgmyei44xULXwHE75FsQfjGtD4UjzpFw0qjrojFqPFLn5s6kMtmfDJ56N7x6Gb 15QglDAbc575+3WANHPLMgsIhLbI2s+1r0PFPk/SVTA9S4vQ2ZVZD+tA6czd6oMm7KFt xwq0VKLOxH9LYHN4Y4B8fJmIN19b7IRCVOBWPv0OJvTLlW6ooiHoI65g6cuPikB/nqQS zl2w== 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 b126si11683071wmc.104.2017.06.05.03.55.45; Mon, 05 Jun 2017 03:55:45 -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 20680680178; Mon, 5 Jun 2017 13:55:35 +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 8541C6808CC for ; Mon, 5 Jun 2017 13:55:28 +0300 (EEST) Received: by mail-qt0-f194.google.com with SMTP id x58so7362224qtc.2 for ; Mon, 05 Jun 2017 03:55:35 -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; bh=mboXQzMrq4Lcf/wlk9ibbUJNeCh+ptL2iSNWmLhfj+4=; b=KufKf4yITGQpUVabyMRD2/rlKeO8Pr8fcLeJAiXq+wrqkkM6hkG/rZYxHdezsF3I71 jCatrxHAT4N7X6/umP3ZwYRDnC8YcdTJSK9S+XRIoxvUCuR2Tmcxz8Z5Gd8Q9cg3rJQU YTnZ77YZm0t+y3YCMGc+woNU4822Xe2fECAH8JhAE8hKIiV7K0Ot3FJiG1T84s2rg18y Hp9tlwUaol/MgtyM3dSUyfGhcqf9RAjeW9YjqZbEv4gRQQ2/5fuEiEKXihECwU88mstq C+ytM68BKTWlrufROH4DjlG5N2KqsDb0vKu/4OavZn6odwh8jKlpgvUXCcIOg8H/HAcN la4Q== 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; bh=mboXQzMrq4Lcf/wlk9ibbUJNeCh+ptL2iSNWmLhfj+4=; b=WLe162RlAuKHux69GdAVkPphEuUORtzYtUPBYNILg7oqb+PXhgfchEaY8f9/WpL9Oc Y07o7YtC4kbqq5bqKmy3z9nUZpmBjdXNkwD3tKeJkxebcSqs0Iib4W8VFJZTfYvCLOGY OtZdE5Fd7g1ikg49IdKM8RFD1gP3oe/sl1xhJGx9W8awl0iYLF8SfB7IAAeazA8evlD6 SUnUW0taGRWKh84PCC1esenNDfgpT1/OQPV2NpP+oiAhS6Tno99etBoW1xfG7//aLlip j3qhu6bmSZkp/R3TtRaoT8r0rsXLNzkLl8+3zO6VucHU7xGVPyLPEfOQPX19AI8O/SEI ZrGg== X-Gm-Message-State: AKS2vOyN1hSzuGqQDCtS9GGWyW03JeLBjojowkwdGlP0W3g4I2UO+x03 qrKptuDjRL+bnLlonXs= X-Received: by 10.55.77.141 with SMTP id a135mr6243090qkb.251.1496660133629; Mon, 05 Jun 2017 03:55:33 -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 p52sm21514795qta.49.2017.06.05.03.55.31 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 05 Jun 2017 03:55:31 -0700 (PDT) From: Kevin Mark To: ffmpeg-devel@ffmpeg.org Date: Mon, 5 Jun 2017 06:55:20 -0400 Message-Id: <20170605105521.45420-1-kmark937@gmail.com> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH 1/2] libavfilter/scale: More descriptive in/ref/out logging 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" This change makes it more clear when using the scale and scale2ref filters what is actually happening. The old format did not differentiate between scale and scale2ref which would make it seem that, when using scale2ref, the ref was what was truly being scaled. Old format for both scale and scale2ref: w:640 h:360 fmt:rgb24 sar:1/1 -> w:160 h:120 fmt:rgb24 sar:4/3 flags:0x2 The left side is the input and the right side is the output. While this is sufficiently clear for scale, for scale2ref it appears to conflate the main input with the reference input. To be fair that is exactly what the code is doing (and on purpose) but that's not a very intuitive implementation detail to expose to the user. Now that the main input's constants are exposed in scale2ref it makes even more sense to correct this. New format for scale: in w:320 h:240 fmt:rgb24 sar:1/1 out w:80 h:60 fmt:rgb24 sar:1/1 flags:0xc0000 New format for scale2ref: in w:320 h:240 fmt:rgb24 sar:1/1 ref w:640 h:360 fmt:rgb24 sar:1/1 out w:160 h:120 fmt:rgb24 sar:4/3 flags:0x2 The increase in clarity is self-evident. Signed-off-by: Kevin Mark --- libavfilter/vf_scale.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index c59ac6b0ea..9232bc4439 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -342,9 +342,18 @@ static int config_props(AVFilterLink *outlink) } else outlink->sample_aspect_ratio = inlink->sample_aspect_ratio; - av_log(ctx, AV_LOG_VERBOSE, "w:%d h:%d fmt:%s sar:%d/%d -> w:%d h:%d fmt:%s sar:%d/%d flags:0x%0x\n", - inlink ->w, inlink ->h, av_get_pix_fmt_name( inlink->format), - inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den, + if (ctx->filter == &ff_vf_scale2ref) { + av_log(ctx, AV_LOG_VERBOSE, "in w:%d h:%d fmt:%s sar:%d/%d\n", + inlink0->w, inlink0->h, av_get_pix_fmt_name(inlink0->format), + inlink0->sample_aspect_ratio.num, inlink0->sample_aspect_ratio.den); + } + + av_log(ctx, AV_LOG_VERBOSE, "%s w:%d h:%d fmt:%s sar:%d/%d\n", + ctx->filter == &ff_vf_scale2ref ? "ref" : "in ", + inlink->w, inlink->h, av_get_pix_fmt_name(inlink->format), + inlink->sample_aspect_ratio.num, inlink->sample_aspect_ratio.den); + + av_log(ctx, AV_LOG_VERBOSE, "out w:%d h:%d fmt:%s sar:%d/%d flags:0x%0x\n", outlink->w, outlink->h, av_get_pix_fmt_name(outlink->format), outlink->sample_aspect_ratio.num, outlink->sample_aspect_ratio.den, scale->flags);