From patchwork Wed Feb 17 16:41:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 25712 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id D017D44B7A8 for ; Wed, 17 Feb 2021 21:28:59 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A62C968A0F1; Wed, 17 Feb 2021 21:28:59 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com [209.85.217.51]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 79C30688140 for ; Wed, 17 Feb 2021 21:28:53 +0200 (EET) Received: by mail-vs1-f51.google.com with SMTP id y24so5257730vsq.3 for ; Wed, 17 Feb 2021 11:28:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=A1HS/85ZWVikipWz+6xfeAaEQhvCWRC//pmNGMfPLyY=; b=qVlE9seyO3CXP7rHuWrRiZzpS7RTtFeBjVldb/Rt+VQrbPitzNivzRAM5vpUO4LdAH TMk4E1uSX1QA8QyrwX6otujIzzyz2ajQuGJgHsXESiaZRdiW6JSClJleT9wJJoDTOsz5 Vs+tgPLt9k3HHPpRS/VZY1fbUwRnHDLhMDA5gR09Gb+DHCLbpGn3tkfZ/jX0kHoEi3LH Rm7PkJxPECZqenaAvk8cd4lOEJp3A25s8y5PFoB1Co08Eq1yWX5D/722DDtBMB5WMJWl PG7m53bGPPNyaMtZNnH/kH1NTHtVQA0g0FW/RGSqaoJJOz8PuslBBhRtSCtt6dRZ3ox3 YB8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=A1HS/85ZWVikipWz+6xfeAaEQhvCWRC//pmNGMfPLyY=; b=re0shwJki+m3YB5VYF/As0gPorruFK8cuI6svS0epV/v/OzvkZg3yMh7axXRHpe6Wn REFaTUewhKH8d0SmgHEM7on6Vn+9fJxhHAcKYkyIcoPb7hSdGi5roY8e5bYcXi5vAlXv UiibxjzLugK1SLtlFx/X4iaU0RtJ2zB+sYU3bMBu6GgA48PIvm0Sjet+WzcJDWNDZnK7 McaHBwK/uiC3GdKLId/yyVUXCpWiBVdNYWr5n86pdF07tgx/+32/Xw7siST3JX3vCS2S p79kjOjRNhTLeoZyS8Xf+ksKQuYtJHZzrc2dIPIfIE6e7dt1T3yHgmrHn9Iu0VcZE4tU 4G6A== X-Gm-Message-State: AOAM532LG2qV7fft9scOo4dqbi3mhVpZupDGIce30tYrRuXcjgjXwjr5 XOZ08y4sTIr/PmGbtikJrGEXeNUITvY= X-Google-Smtp-Source: ABdhPJyV4xwbbIuW3hSGYKbqdM+RwLFqcnE9CwtxalcJyrM10nzpatZ++L6CNLg5c1y2qWoP4UIqew== X-Received: by 2002:a05:6214:208:: with SMTP id i8mr25728615qvt.31.1613580084821; Wed, 17 Feb 2021 08:41:24 -0800 (PST) Received: from localhost.localdomain ([181.23.76.251]) by smtp.gmail.com with ESMTPSA id f12sm1944390qkl.2.2021.02.17.08.41.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Feb 2021 08:41:24 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Wed, 17 Feb 2021 13:41:05 -0300 Message-Id: <20210217164106.6370-2-jamrial@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210217164106.6370-1-jamrial@gmail.com> References: <20210217164106.6370-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] checkasm/vf_gblur: split off the horiz_slice test into its own function 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Will come in handy for the following commit. Signed-off-by: James Almer --- tests/checkasm/vf_gblur.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/tests/checkasm/vf_gblur.c b/tests/checkasm/vf_gblur.c index 1d63fc22a0..8ff47a338f 100644 --- a/tests/checkasm/vf_gblur.c +++ b/tests/checkasm/vf_gblur.c @@ -33,18 +33,26 @@ tmp_buf[j] = (float)(rnd() & 0xFF); \ } while (0) -void checkasm_check_vf_gblur(void) +static void check_horiz_slice(float *dst_ref, float *dst_new) { - float *dst_ref = av_malloc(BUF_SIZE); - float *dst_new = av_malloc(BUF_SIZE); - int w = WIDTH; - int h = HEIGHT; int steps = 2; float nu = 0.101f; float bscale = 1.112f; - GBlurContext s; declare_func(void, float *dst, int w, int h, int steps, float nu, float bscale); + call_ref(dst_ref, WIDTH, HEIGHT, steps, nu, bscale); + call_new(dst_new, WIDTH, HEIGHT, steps, nu, bscale); + if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) { + fail(); + } + bench_new(dst_new, WIDTH, HEIGHT, 1, nu, bscale); +} + +void checkasm_check_vf_gblur(void) +{ + float *dst_ref = av_malloc(BUF_SIZE); + float *dst_new = av_malloc(BUF_SIZE); + GBlurContext s; randomize_buffers(dst_ref, PIXELS); memcpy(dst_new, dst_ref, BUF_SIZE); @@ -52,13 +60,7 @@ void checkasm_check_vf_gblur(void) ff_gblur_init(&s); if (check_func(s.horiz_slice, "horiz_slice")) { - call_ref(dst_ref, w, h, steps, nu, bscale); - call_new(dst_new, w, h, steps, nu, bscale); - - if (!float_near_abs_eps_array(dst_ref, dst_new, 0.01f, PIXELS)) { - fail(); - } - bench_new(dst_new, w, h, 1, nu, bscale); + check_horiz_slice(dst_ref, dst_new); } report("horiz_slice"); av_freep(&dst_ref);