From patchwork Tue May 17 11:54:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Dekker" X-Patchwork-Id: 35804 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a885:b0:7f:4be2:bd17 with SMTP id ca5csp1996042pzb; Tue, 17 May 2022 04:54:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCJwjX8O0PvrghZNeU6mhNaJuiBpKdL7+J9fhizvy2Bj/ZhOUSlMwA7E5nK3v67VsviLhh X-Received: by 2002:a17:907:6daa:b0:6f4:4822:549d with SMTP id sb42-20020a1709076daa00b006f44822549dmr19693406ejc.322.1652788481429; Tue, 17 May 2022 04:54:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652788481; cv=none; d=google.com; s=arc-20160816; b=qeU25WlC6l0UGZf9Dldr7cs1RBD3oc5LUSewxVpcTRC3pnMzGq/uThmgnG0TsD55XG YZ5icDZsSQtcksSdcviYi53wI9YwmQIn+JVIdJsO+pw1neigZSECXSlJUJb3AVsFtMO4 ACeLclTLsr/tO3GiCrVlRW33yzfHgGZcBp2YgrQpijEDFfMUOtPhKvOvOrCmavpe1Tlt c4gzA1W8Z7bsr7LYNVPOcFF4mc5N3lVcVJNwJmzpyTwMy6NXJya08qiwMC9F484hlS1Y PSwtnW7/b4V32XgMooTqDskWn4hUh5CftAwIfZ9cqH9zKuqxv9pWVpVigwdo3egPxFBK Jsxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:feedback-id:dkim-signature:dkim-signature:delivered-to; bh=r30f2KrTTYBzRvgMr3D8JrJhPZlwBlSaAxnEyk8zRlI=; b=xPKr1UHlv06QB67twjBQ8IJ/for00CO7nZYhN+d45W0yFa+NzDaRFGwjf4Qr0/Duwk R2sbrI0Ftv6NZW19RRXF6RNa0dqUTjWk5y2bxDBOGjDrW/JYJQNdiRT6oCRzIVFPjAu5 a3p7kJwFf4A7owlPimbFDPpWtLQm0mE7yoa12S62iQLNytLNgjBh2/FouXYeXHQu0qqd hd2qGVeFB/D9ClFZ3yXtwUg/e+/gFuYh+3dqZdNwW4RU95dAMR90CxkR0zW8GDnwE1lI VEX5iYb4ddOgNbj6S8A+uDFFjvRGRSD+Z+qpexu2tvT3F2P19ONEnIvGZum35KSPe+R8 kz2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@itanimul.li header.s=fm2 header.b=oen51ysl; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=bFRA+SlN; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hg5-20020a1709072cc500b006f38f0034absi2523767ejc.539.2022.05.17.04.54.41; Tue, 17 May 2022 04:54:41 -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=@itanimul.li header.s=fm2 header.b=oen51ysl; dkim=neutral (body hash did not verify) header.i=@messagingengine.com header.s=fm1 header.b=bFRA+SlN; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 15E5E68B3E3; Tue, 17 May 2022 14:54:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7823268B2DC for ; Tue, 17 May 2022 14:54:33 +0300 (EEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 9A6855C019E for ; Tue, 17 May 2022 07:54:32 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 17 May 2022 07:54:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=itanimul.li; h= cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1652788472; x=1652874872; bh=Eg +9EPIht8E+hHywpzBYVAUs5zBh7BxSoKuHfgLxeVc=; b=oen51yslucDkoQvV+d cDKVWpVM4k6y2sAKz5FF5JRtTEtJbbizZoPUhWAdyEDK6jWYkqs/RLmLXSVhXBEg rd0aXhSZgfRosS/jpoxGm80hfmPjnvJ5gu6leRb7CTnsCREU6Rd2SlTw/nl/oqWg xUBJlT85aGe2iW/Lfw/wXQ65mRhZuOuPsuLFF2zRWq3VPlj9I8XgoYloS33uBMv/ 7+jVPt+gAY1K1j6kHGkR+DMAwNF1hWnv2inkbss2IGt//XqfP3kW1dOfg84IC6Wr jzpg2Ky21NRKGDDN7aL/CLXkHWNTDAv+Ibw5xiwrJz1Do8YIFoQ5bSoq7r6hS6Yo W9VQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1652788472; x=1652874872; bh=Eg+9EPIht8E+h HywpzBYVAUs5zBh7BxSoKuHfgLxeVc=; b=bFRA+SlNWrBqWyfqbNkD+yu6fconv oEoTZbthXbXm01WGPPj90Gbz0CcXfSOKyrUIvsP88LOURI41+pzwdilnul0T/JNJ bJMisIXALPHFsUKi16rydTk+GZlKVdoI6IWKfU8/XPVy56UvrNAf41koJOiTUdVg nj0alE7jxxeGqBz/NuPhywptMbCBg2Oz7ueTtXhTjhfpvYwCy3Iym6VD+GliiS7E 8aOWzNMFHEqqIDzSOYFEi07zEyRQoqv7/8V6h26I1Qx2whT2G3gOK/Bx0v2qhhSI cR919fw8zNneuH2groePibtwz60sPHum3KT0CzpwVwjZVRdE95KpLYGGQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrheejgdegfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpedflfdrucffvghkkhgvrhdfuceojhguvghksehithgrnhhimhhu lhdrlhhiqeenucggtffrrghtthgvrhhnpeegvdfhffduudegheevieekieeffefgveffke dtheekieefhfevueetueefhfetteenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehjuggvkhesihhtrghnihhmuhhlrdhlih X-ME-Proxy: Feedback-ID: i84994747:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 17 May 2022 07:54:32 -0400 (EDT) From: "J. Dekker" To: ffmpeg-devel@ffmpeg.org Date: Tue, 17 May 2022 13:54:29 +0200 Message-Id: <20220517115429.2020-1-jdek@itanimul.li> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <5625a69f-a280-df32-7e1d-304511bd055@martin.st> References: <5625a69f-a280-df32-7e1d-304511bd055@martin.st> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] checkasm: improve hevc_sao test X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: U1h+ffssl07M The HEVC decoder can call these functions with smaller widths than the functions themselves are designed to operate on so we should only check the relevant output Signed-off-by: J. Dekker --- tests/checkasm/hevc_sao.c | 51 ++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/tests/checkasm/hevc_sao.c b/tests/checkasm/hevc_sao.c index 6b750758e2..72cdb87dd1 100644 --- a/tests/checkasm/hevc_sao.c +++ b/tests/checkasm/hevc_sao.c @@ -78,20 +78,26 @@ static void check_sao_band(HEVCDSPContext h, int bit_depth) for (i = 0; i <= 4; i++) { int block_size = sao_size[i]; + int prev_size = i > 0 ? sao_size[i - 1] : 0; ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t dst_stride, ptrdiff_t src_stride, int16_t *sao_offset_val, int sao_left_class, int width, int height); - randomize_buffers(src0, src1, BUF_SIZE); - randomize_buffers2(offset_val, OFFSET_LENGTH); - memset(dst0, 0, BUF_SIZE); - memset(dst1, 0, BUF_SIZE); - - if (check_func(h.sao_band_filter[i], "hevc_sao_band_%dx%d_%d", block_size, block_size, bit_depth)) { - call_ref(dst0, src0, stride, stride, offset_val, left_class, block_size, block_size); - call_new(dst1, src1, stride, stride, offset_val, left_class, block_size, block_size); - if (memcmp(dst0, dst1, BUF_SIZE)) - fail(); + if (check_func(h.sao_band_filter[i], "hevc_sao_band_%d_%d", block_size, bit_depth)) { + + for (int w = prev_size + 4; w <= block_size; w += 4) { + randomize_buffers(src0, src1, BUF_SIZE); + randomize_buffers2(offset_val, OFFSET_LENGTH); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + call_ref(dst0, src0, stride, stride, offset_val, left_class, w, block_size); + call_new(dst1, src1, stride, stride, offset_val, left_class, w, block_size); + for (int j = 0; j < block_size; j++) { + if (memcmp(dst0 + j*MAX_PB_SIZE*2, dst1 + j*MAX_PB_SIZE*2, w)) + fail(); + } + } bench_new(dst1, src1, stride, stride, offset_val, left_class, block_size, block_size); } } @@ -109,21 +115,26 @@ static void check_sao_edge(HEVCDSPContext h, int bit_depth) for (i = 0; i <= 4; i++) { int block_size = sao_size[i]; + int prev_size = i > 0 ? sao_size[i - 1] : 0; ptrdiff_t stride = PIXEL_STRIDE*SIZEOF_PIXEL; int offset = (AV_INPUT_BUFFER_PADDING_SIZE + PIXEL_STRIDE)*SIZEOF_PIXEL; declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, int16_t *sao_offset_val, int eo, int width, int height); - randomize_buffers(src0, src1, BUF_SIZE); - randomize_buffers2(offset_val, OFFSET_LENGTH); - memset(dst0, 0, BUF_SIZE); - memset(dst1, 0, BUF_SIZE); - - if (check_func(h.sao_edge_filter[i], "hevc_sao_edge_%dx%d_%d", block_size, block_size, bit_depth)) { - call_ref(dst0, src0 + offset, stride, offset_val, eo, block_size, block_size); - call_new(dst1, src1 + offset, stride, offset_val, eo, block_size, block_size); - if (memcmp(dst0, dst1, BUF_SIZE)) - fail(); + for (int w = prev_size + 4; w <= block_size; w += 4) { + randomize_buffers(src0, src1, BUF_SIZE); + randomize_buffers2(offset_val, OFFSET_LENGTH); + memset(dst0, 0, BUF_SIZE); + memset(dst1, 0, BUF_SIZE); + + if (check_func(h.sao_edge_filter[i], "hevc_sao_edge_%d_%d", block_size, bit_depth)) { + call_ref(dst0, src0 + offset, stride, offset_val, eo, w, block_size); + call_new(dst1, src1 + offset, stride, offset_val, eo, w, block_size); + for (int j = 0; j < block_size; j++) { + if (memcmp(dst0 + j*MAX_PB_SIZE*2, dst1 + j*MAX_PB_SIZE*2, w)) + fail(); + } + } bench_new(dst1, src1 + offset, stride, offset_val, eo, block_size, block_size); } }