From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9B96648368 for ; Mon, 29 Apr 2024 15:38:27 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C7C4368D4D7; Mon, 29 Apr 2024 18:38:24 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 44D9768D499 for ; Mon, 29 Apr 2024 18:38:18 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id C46C1106034F for ; Mon, 29 Apr 2024 15:38:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1714405097; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender; bh=750iBmS4MUmDiPsOhtnEdr1c8fT+P4k22LiIRshVX5w=; b=a4Wou4UgSDb8ZRJFeelhgxvusc2hMmKE/nKYkm+fsgGpl6CRPg4KiK4vBVlhs0gL ql+ttt7npoEesCaOfJ++uR9/hSMZFtPVsiySeoVTWsknU6nkTOiHpNVT6h4CKkdSjIs CpmNL3/PTTESkr1y/zn04aPjKqxXhJ0CcUN+G90gAld8HduS3rswwk8unWvB+XWnnHk C2VsBzfqZN4oRYXnUMcslka4gS0yIJLVjA5Eeqaxc4L5w5Kifry5BJzyWTZIsEewsMI JJiNKHioWW5y/dNkj4X14fE5YJPjLTYTBMW6xZ9iz/ptL3sV0ZrCi8bi5+c8Pxxo3Nv d+Tbnd7WXg== Date: Mon, 29 Apr 2024 17:38:17 +0200 (CEST) From: Lynne To: FFmpeg development discussions and patches Message-ID: In-Reply-To: References: <20240429152445.1461-1-toqsxw@outlook.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 2/4] tests/checkasm: add checkasm_check_vvc_alf and check_alf_filter 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Apr 29, 2024, 17:25 by toqsxw@outlook.com: > From: Wu Jianhua > > Signed-off-by: Wu Jianhua > --- > tests/checkasm/Makefile | 2 +- > tests/checkasm/checkasm.c | 3 +- > tests/checkasm/checkasm.h | 1 + > tests/checkasm/vvc_alf.c | 133 ++++++++++++++++++++++++++++++++++++++ > 4 files changed, 137 insertions(+), 2 deletions(-) > create mode 100644 tests/checkasm/vvc_alf.c > > diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile > index 2673e1d098..5a3e3985c4 100644 > --- a/tests/checkasm/Makefile > +++ b/tests/checkasm/Makefile > @@ -41,7 +41,7 @@ AVCODECOBJS-$(CONFIG_V210_DECODER) += v210dec.o > AVCODECOBJS-$(CONFIG_V210_ENCODER) += v210enc.o > AVCODECOBJS-$(CONFIG_VORBIS_DECODER) += vorbisdsp.o > AVCODECOBJS-$(CONFIG_VP9_DECODER) += vp9dsp.o > -AVCODECOBJS-$(CONFIG_VVC_DECODER) += vvc_mc.o > +AVCODECOBJS-$(CONFIG_VVC_DECODER) += vvc_alf.o vvc_mc.o > > CHECKASMOBJS-$(CONFIG_AVCODEC) += $(AVCODECOBJS-yes) > > diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c > index 8be6cb0f55..8b2bf2827b 100644 > --- a/tests/checkasm/checkasm.c > +++ b/tests/checkasm/checkasm.c > @@ -198,7 +198,8 @@ static const struct { > { "vorbisdsp", checkasm_check_vorbisdsp }, > #endif > #if CONFIG_VVC_DECODER > - { "vvc_mc", checkasm_check_vvc_mc }, > + { "vvc_alf", checkasm_check_vvc_alf }, > + { "vvc_mc", checkasm_check_vvc_mc }, > #endif > #endif > #if CONFIG_AVFILTER > diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h > index f90920dee7..c6a5cf42dd 100644 > --- a/tests/checkasm/checkasm.h > +++ b/tests/checkasm/checkasm.h > @@ -132,6 +132,7 @@ void checkasm_check_vp8dsp(void); > void checkasm_check_vp9dsp(void); > void checkasm_check_videodsp(void); > void checkasm_check_vorbisdsp(void); > +void checkasm_check_vvc_alf(void); > void checkasm_check_vvc_mc(void); > > struct CheckasmPerf; > diff --git a/tests/checkasm/vvc_alf.c b/tests/checkasm/vvc_alf.c > new file mode 100644 > index 0000000000..10469e1528 > --- /dev/null > +++ b/tests/checkasm/vvc_alf.c > @@ -0,0 +1,133 @@ > +/* > + * Copyright (c) 2023-2024 Nuo Mi > + * Copyright (c) 2023-2024 Wu Jianhua > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License as published by > + * the Free Software Foundation; either version 2 of the License, or > + * (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License along > + * with FFmpeg; if not, write to the Free Software Foundation, Inc., > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > + */ > + > +#include > + > +#include "checkasm.h" > +#include "libavcodec/vvc/ctu.h" > +#include "libavcodec/vvc/data.h" > +#include "libavcodec/vvc/dsp.h" > + > +#include "libavutil/common.h" > +#include "libavutil/intreadwrite.h" > +#include "libavutil/mem_internal.h" > + > +static const uint32_t pixel_mask[3] = { 0xffffffff, 0x03ff03ff, 0x0fff0fff }; > + > +#define SIZEOF_PIXEL ((bit_depth + 7) / 8) > +#define SRC_PIXEL_STRIDE (MAX_CTU_SIZE + 2 * ALF_PADDING_SIZE) > +#define DST_PIXEL_STRIDE (SRC_PIXEL_STRIDE + 4) > +#define SRC_BUF_SIZE (SRC_PIXEL_STRIDE * (MAX_CTU_SIZE + 3 * 2) * 2) //+3 * 2 for top and bottom row, *2 for high bit depth > +#define DST_BUF_SIZE (DST_PIXEL_STRIDE * (MAX_CTU_SIZE + 3 * 2) * 2) > +#define LUMA_PARAMS_SIZE (MAX_CTU_SIZE * MAX_CTU_SIZE / ALF_BLOCK_SIZE / ALF_BLOCK_SIZE * ALF_NUM_COEFF_LUMA) > + > +#define randomize_buffers(buf0, buf1, size) \ > + do { \ > + uint32_t mask = pixel_mask[(bit_depth - 8) >> 1]; \ > + int k; \ > + for (k = 0; k < size; k += 4) { \ > + uint32_t r = rnd() & mask; \ > + AV_WN32A(buf0 + k, r); \ > + AV_WN32A(buf1 + k, r); \ > + } \ > + } while (0) > + > +#define randomize_buffers2(buf, size, filter) \ > + do { \ > + int k; \ > + if (filter) { \ > + for (k = 0; k < size; k++) { \ > + int8_t r = rnd(); \ > + buf[k] = r; \ > + } \ > + } else { \ > + for (k = 0; k < size; k++) { \ > + int r = rnd() % FF_ARRAY_ELEMS(clip_set); \ > + buf[k] = clip_set[r]; \ > + } \ > + } \ > + } while (0) > + > +static void check_alf_filter(VVCDSPContext *c, const int bit_depth) > +{ > + LOCAL_ALIGNED_32(uint8_t, dst0, [DST_BUF_SIZE]); > + LOCAL_ALIGNED_32(uint8_t, dst1, [DST_BUF_SIZE]); > + LOCAL_ALIGNED_32(uint8_t, src0, [SRC_BUF_SIZE]); > + LOCAL_ALIGNED_32(uint8_t, src1, [SRC_BUF_SIZE]); > + int16_t filter[LUMA_PARAMS_SIZE]; > + int16_t clip[LUMA_PARAMS_SIZE]; > + > + const int16_t clip_set[] = { > + 1 << bit_depth, 1 << (bit_depth - 3), 1 << (bit_depth - 5), 1 << (bit_depth - 7) > + }; > + > + ptrdiff_t src_stride = SRC_PIXEL_STRIDE * SIZEOF_PIXEL; > + ptrdiff_t dst_stride = DST_PIXEL_STRIDE * SIZEOF_PIXEL; > + int offset = (3 * SRC_PIXEL_STRIDE + 3) * SIZEOF_PIXEL; > + > + declare_func_emms(AV_CPU_FLAG_AVX2, void, uint8_t *dst, ptrdiff_t dst_stride, const uint8_t *src, ptrdiff_t src_stride, > + int width, int height, const int16_t *filter, const int16_t *clip, const int vb_pos); > + > + randomize_buffers(src0, src1, SRC_BUF_SIZE); > + randomize_buffers2(filter, LUMA_PARAMS_SIZE, 1); > + randomize_buffers2(clip, LUMA_PARAMS_SIZE, 0); > + > + for (int h = 4; h <= MAX_CTU_SIZE; h += 4) { > + for (int w = 4; w <= MAX_CTU_SIZE; w += 4) { > That's an excessive amount of tests, isn't it? _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".