From patchwork Sun Jun 4 07:53:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Mark X-Patchwork-Id: 3830 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.10.2 with SMTP id 2csp876531vsk; Sun, 4 Jun 2017 00:59:35 -0700 (PDT) X-Received: by 10.223.171.24 with SMTP id q24mr5612334wrc.89.1496563174944; Sun, 04 Jun 2017 00:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1496563174; cv=none; d=google.com; s=arc-20160816; b=PVlTKrxIVWAdw9Cz5S4aIpqxAPTIBakftU0xYT09lw1zSqbIJX0qsH2eDPrYhY5red bjklD+tjNcOk9y126WGUXmh7ONTECThwrTMpwd8oSH0eCpFodcg3Kw/Ul2i/orgfsBDk iEmcqtgPcG3bJhc1mqSjCQLd18zlf+vWR5+YgrDqeIf9UkaZimfZ2/pspL8oi1SCSf04 TEbZReEGpIUf9CeMEd+ko73VLqvMCGJfWlaeYB9Q2zkpVAx5dcd5BBiQaBHbU90/0m2v st6qTIqfBqX+ArV/PTAwX2A3sQ29f87hlLjBKCKP2odcFlBXG6aN5vgtBAg3CG0D7NCa OADw== 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=0j4NivFeeMMxsfWjtJVxgunimanjkX0LKcs0sFUTris=; b=j/Juj1SI3DCG9yo6k2VmtZbYa0WNls++etmXdK4c723pi6C8Yq+u3uWMkIh2Hoh2V7 +s9YVQI+Vyo3SXJrk1ICiYo51HUN3xQyCrbZj1vyRX+GdbheqEvFIPHXbWvs/r7N0nh+ liRsYd3KWdQuopkkrWmeItfpyXbKxI102gnXhcskObXXH4xrLA6stgwsaneTDjtna1xX uLzT+Ajw1cuPk8FK1mLZ3+oSWhLbgpujd7WONmAcoO52Fh1UaWUzd1wdoyxheHP8KbPt 2JrswpCBoErcqaidS4BFcuImu1ZK/tNiQIPKIyEvcJ2RCIjwyf7mWTqmGRmyC5psewBZ QPwQ== 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 i201si8612354wmd.25.2017.06.04.00.59.34; Sun, 04 Jun 2017 00:59:34 -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 E5D3F689D79; Sun, 4 Jun 2017 10:59:24 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt0-f195.google.com (mail-qt0-f195.google.com [209.85.216.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9BCEF689B73 for ; Sun, 4 Jun 2017 10:59:18 +0300 (EEST) Received: by mail-qt0-f195.google.com with SMTP id x58so2542408qtc.2 for ; Sun, 04 Jun 2017 00:59:25 -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=9wMWSYex4SJmNXzw7+RIFSKtaZs5PZUnq07NjL7SS/0=; b=fwQSILGepvCXyibfn14nERVjTIXfxplxhk+aNUC/4a661xP6FKeGD1INfjfUtm6C5l Uh3s6rzBkRWHO4Vl48jZXbZBVdDwaRD54HDKM8fPkuLiGMyjez5oki4xovk3OWQ+mpUq CLIKao8cSYK/cS42xj27lAh7iSjsgAyBaSE94TD1TtRYdKyfNeQ5/RLVa4D5pyDuu1We 7yrn0YIjsF+kOfZROwwUhPHzL2KquzDHbSkfGSCKVaOe/lYwS0/vtrt5JuqeXQv9AUfh wG5XJSvC8kdS9DwkBtGQkFtGnkiiQKqapRdBmaGhbpKoXvUPqJuqSUmqNM97yKj7Gfx2 qo8g== 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=9wMWSYex4SJmNXzw7+RIFSKtaZs5PZUnq07NjL7SS/0=; b=kTF3NBxeFPNYu9gbtSSWWlrKu0M1D5CIoro+n6vLfN8XjEpxKb+ncU0RPYH13tFGHD KDCft5sW88uO+HS3bKrm9HK3RRSQq4v1ySRgCjoYZ3q79L1US/JaFK+boNylzUzV3LqU pyKiCg7CmT4ALsNXzHtFZ6tuC4l1NZApN8sPlwvRGug8wrlIqNyHOSpPSiZAmUztpqV1 s5pc7/QegzNVV5O0i3sb59ILvCz4cqJ86TwevpiReyw7lJ62j2KKzbiMMrG2wdsVATAw uesuqa2pqS/egMfiN8Q3XeD5wRuDCcqdmy5ejlSMVLjnoHB2bmwm193EMtzFdHgY5NkF /Pyg== X-Gm-Message-State: AODbwcB/PRYDtorwGBwd6CIITsyr3Q9zc7DiZcXabXVrHRKhK+p/cGMf 0YzM3NnelVoC2dE2E1M= X-Received: by 10.237.51.67 with SMTP id u61mr15595414qtd.181.1496562833683; Sun, 04 Jun 2017 00:53:53 -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 p64sm6931372qkl.27.2017.06.04.00.53.52 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 04 Jun 2017 00:53:52 -0700 (PDT) From: Kevin Mark To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Jun 2017 03:53:31 -0400 Message-Id: <20170604075331.28661-1-kmark937@gmail.com> X-Mailer: git-send-email 2.13.0 Subject: [FFmpeg-devel] [PATCH] FATE: Add test for libavfilter/scale2ref 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 new FATE test for the scale2ref filter makes use of the recently added scale2ref-specific variables to maintain the aspect ratio of a test input. Filtergraph explanation: [main] has an AR of 4:3. [ref] has an AR of 16:9. 640 / 4 = 160. So the new width for [main] is 160. 160 / ((320 / 240) * (1 / 1)) = 160 / (4 / 3) = 120. So the new height for [main] is 120. 160 / 120 = 4 / 3 so [main]'s aspect ratio has been maintained while using [ref]'s width as a reference point. [ref] is nullsink'd since it is left unchanged by scale2ref (and so shouldn't need to be tested). If we were to use "iw/4:-1" in place of "iw/4:ow/mdar": 640 / 4 = 160. So the new width for [main] would be 160. 360 / 4 = 90. So the new height for [main] would be 90. 160 / 90 = 16 / 9 so [main] now has the same aspect ratio as [ref] which is probably what you do not want. This is currently the only test for scale2ref. Signed-off-by: Kevin Mark --- tests/fate/filter-video.mak | 4 ++++ tests/filtergraphs/scale2ref_keep_aspect | 5 +++++ tests/ref/fate/filter-scale2ref_keep_aspect | 14 ++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 tests/filtergraphs/scale2ref_keep_aspect create mode 100644 tests/ref/fate/filter-scale2ref_keep_aspect diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak index 1ca29e8d32..53fc7a6528 100644 --- a/tests/fate/filter-video.mak +++ b/tests/fate/filter-video.mak @@ -413,6 +413,10 @@ fate-filter-scale200: CMD = video_filter "scale=w=200:h=200" FATE_FILTER_VSYNTH-$(CONFIG_SCALE_FILTER) += fate-filter-scale500 fate-filter-scale500: CMD = video_filter "scale=w=500:h=500" +FATE_FILTER_VSYNTH-$(CONFIG_SCALE2REF_FILTER) += fate-filter-scale2ref_keep_aspect +fate-filter-scale2ref_keep_aspect: tests/data/filtergraphs/scale2ref_keep_aspect +fate-filter-scale2ref_keep_aspect: CMD = framemd5 -frames:v 5 -filter_complex_script $(TARGET_PATH)/tests/data/filtergraphs/scale2ref_keep_aspect -map "[main]" + FATE_FILTER_VSYNTH-$(CONFIG_SCALE_FILTER) += fate-filter-scalechroma fate-filter-scalechroma: tests/data/vsynth1.yuv fate-filter-scalechroma: CMD = framecrc -flags bitexact -s 352x288 -pix_fmt yuv444p -i tests/data/vsynth1.yuv -pix_fmt yuv420p -sws_flags +bitexact -vf scale=out_v_chr_pos=33:out_h_chr_pos=151 diff --git a/tests/filtergraphs/scale2ref_keep_aspect b/tests/filtergraphs/scale2ref_keep_aspect new file mode 100644 index 0000000000..f407460ec7 --- /dev/null +++ b/tests/filtergraphs/scale2ref_keep_aspect @@ -0,0 +1,5 @@ +sws_flags=+accurate_rnd+bitexact; +testsrc=size=320x240 [main]; +testsrc=size=640x360 [ref]; +[main][ref] scale2ref=iw/4:ow/mdar [main][ref]; +[ref] nullsink diff --git a/tests/ref/fate/filter-scale2ref_keep_aspect b/tests/ref/fate/filter-scale2ref_keep_aspect new file mode 100644 index 0000000000..ca03277446 --- /dev/null +++ b/tests/ref/fate/filter-scale2ref_keep_aspect @@ -0,0 +1,14 @@ +#format: frame checksums +#version: 2 +#hash: MD5 +#tb 0: 1/25 +#media_type 0: video +#codec_id 0: rawvideo +#dimensions 0: 160x120 +#sar 0: 4/3 +#stream#, dts, pts, duration, size, hash +0, 0, 0, 1, 57600, 9a19c23dc3a557786840d0098606d5f1 +0, 1, 1, 1, 57600, e6fbdabaf1bb0d28afc648ed4d27e9f0 +0, 2, 2, 1, 57600, 52924ed0a751214c50fb2e7a626c8cc5 +0, 3, 3, 1, 57600, 67d5fd6ee71793f1cf8794d1c27afdce +0, 4, 4, 1, 57600, 85f7775f7b01afd369fc8919dc759d30