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 EC9DC4AE61 for ; Wed, 22 May 2024 02:03:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C6AEB68D3C0; Wed, 22 May 2024 05:03:14 +0300 (EEST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D815F68D222 for ; Wed, 22 May 2024 05:03:07 +0300 (EEST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6f693fb0ab6so1401068b3a.1 for ; Tue, 21 May 2024 19:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716343385; x=1716948185; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=WTQOtQibrs7XlPRr3jxl6EKMcRcYu9YNsfNObEJ6mio=; b=dyHbA6aoJ6OTfhcKOcKwOko4zV5CqWxA4kJDFzKbTBhZbXaQVFR1R+9VO3D95nN8kE whUpGMaHTgC3S9mEyerILCxGXB20VshcZUHITxu8cXPg/8eyPRl8X3nQbFNZUbHQyO3V QiFdS0SwYMEb1kE4y0qyk4xJDO6osvd/PIPiNWNfvzwfXxWDXZHwSUpRbON3w//YpHh4 m+rQ3IwevTytznbmp3JvlBebb+3bfOv6wTsbX+5xaWp0In/Z4bdQG6Dkyh7HQqdvOJGG v54N06yH/PnKNyovJIqFs0WBMojWnD5BTCJL+NEW+39Kw+vw4zdd0FALlzuNles+WpTL vjRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716343385; x=1716948185; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WTQOtQibrs7XlPRr3jxl6EKMcRcYu9YNsfNObEJ6mio=; b=LVSorrosz+JOBuF2izXwLlNF7EejnDjsG/lhiX+P1DyX3hqKGZhdj7Mk9neU9YsL/J dRaUuDw5U67bOwhdOp+xURMqYkWfKT232Lr9giX5zmN3a8y/Ov4X0CAslwivEivvygEM EdEyreEwVtjDfouc8yW2vfqqBJRJpaqNU4BHekadwCQR+V6iY5VXmPIJDbBhQXt01kVB zL720hBRrHoZkmaD5YvXI86G11dCpsMmlOuZYu1FDMbRdNMrs4PhbBCHw1zVpxYUmPle wSc7Yt8xjbY6PPNsh5PP4wxwh1LoknZSUzqP1khZ9tqCNq4y/d+G2VYeVkU4D/tGESY3 9UmA== X-Gm-Message-State: AOJu0YwzFmwafQBmIQo51oZEe9MAzcQSGlgAs1TfcS3XWG9NYVd2bkZE 0fLoZqSQ2uu5qDiMrTAGPVixoExDO0f5HTnAFvFhisc47JTEhMkyOyktMQ== X-Google-Smtp-Source: AGHT+IHjNFsAmiNV+k7f0IxxPn5tNtpbLxfL2WFOYxJBAQSsycgVFaCr2RGAcCUTNUhcOjjSU8tzPg== X-Received: by 2002:aa7:8888:0:b0:6f0:be31:8577 with SMTP id d2e1a72fcca58-6f6d61e3f8dmr593724b3a.22.1716343384673; Tue, 21 May 2024 19:03:04 -0700 (PDT) Received: from [192.168.0.10] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2b2fe07sm21381698b3a.216.2024.05.21.19.03.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 19:03:04 -0700 (PDT) Message-ID: <93dd185b-6a92-4be8-814c-2dd85037350a@gmail.com> Date: Tue, 21 May 2024 23:03:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: <20240522000039.34913-2-chen.stonechen@gmail.com> <20240522000039.34913-4-chen.stonechen@gmail.com> Content-Language: en-US From: James Almer In-Reply-To: <20240522000039.34913-4-chen.stonechen@gmail.com> Subject: Re: [FFmpeg-devel] [PATCH v5 2/2][GSoC 2024] tests/checkasm: Add check_vvc_sad to vvc_mc.c 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/21/2024 9:00 PM, Stone Chen wrote: > Adds checkasm for DMVR SAD AVX2 implementation. > > Benchmarks ( AMD 7940HS ) > vvc_sad_8x8_c: 50.3 > vvc_sad_8x8_avx2: 0.3 > vvc_sad_16x16_c: 250.3 > vvc_sad_16x16_avx2: 10.3 > vvc_sad_32x32_c: 1020.3 > vvc_sad_32x32_avx2: 60.3 > vvc_sad_64x64_c: 3850.3 > vvc_sad_64x64_avx2: 220.3 > vvc_sad_128x128_c: 14100.3 > vvc_sad_128x128_avx2: 840.3 > --- > tests/checkasm/vvc_mc.c | 38 ++++++++++++++++++++++++++++++++++++++ > 1 file changed, 38 insertions(+) > > diff --git a/tests/checkasm/vvc_mc.c b/tests/checkasm/vvc_mc.c > index 97f57cb401..f2d7a6d561 100644 > --- a/tests/checkasm/vvc_mc.c > +++ b/tests/checkasm/vvc_mc.c > @@ -322,8 +322,46 @@ static void check_avg(void) > report("avg"); > } > > +static void check_vvc_sad(void) > +{ > + const int bit_depth = 10; > + VVCDSPContext c; > + LOCAL_ALIGNED_32(uint16_t, src0, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]); > + LOCAL_ALIGNED_32(uint16_t, src1, [MAX_CTU_SIZE * MAX_CTU_SIZE * 4]); > + declare_func(int, const int16_t *src0, const int16_t *src1, intptr_t dx, intptr_t dy, int block_w, int block_h); Not related to this patch, but dsp.h should mention alignment requirements for all the parameters in dsp functions. > + > + ff_vvc_dsp_init(&c, bit_depth); > + memset(src0, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4); > + memset(src1, 0, MAX_CTU_SIZE * MAX_CTU_SIZE * 4); MAX_CTU_SIZE * MAX_CTU_SIZE * 4 * sizeof(uint16_t) > + > + randomize_pixels(src0, src1, MAX_CTU_SIZE * MAX_CTU_SIZE * 2); Seeing randomize_buffers() is written for uint8_t buffers, it should be updated for this, like so: #define randomize_buffers(buf0, buf1, size, mask) \ do { \ int k; \ for (k = 0; k < size; k += 4 / sizeof(*buf0)) { \ uint32_t r = rnd() & mask; \ AV_WN32A(buf0 + k, r); \ AV_WN32A(buf1 + k, r); \ } \ } while (0) And the argument changed to "MAX_CTU_SIZE * MAX_CTU_SIZE * 4". Otherwise the loop will write 4 bytes and leave the next 4 untouched. > + for (int h = 8; h <= MAX_CTU_SIZE; h *= 2) { There's an extra whitespace of indentation here. > + for (int w = 8; w <= MAX_CTU_SIZE; w *= 2) { > + for(int offy = 0; offy <= 4; offy++) { > + for(int offx = 0; offx <= 4; offx++) { > + if(check_func(c.inter.sad, "vvc_sad_%dx%d", w, h)) { "sad_%dx%d" > + int result0; > + int result1; > + > + result0 = call_ref(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); > + result1 = call_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); > + > + if (result1 != result0) > + fail(); > + if(w == h && offx == 0 && offy == 0) > + bench_new(src0 + PIXEL_STRIDE * 2 + 2, src1 + PIXEL_STRIDE * 2 + 2, offx, offy, w, h); > + } > + } > + } > + } > + } > + > + report("check_vvc_sad"); report("sad"); > +} > + > void checkasm_check_vvc_mc(void) > { > + check_vvc_sad(); > check_put_vvc_luma(); > check_put_vvc_luma_uni(); > check_put_vvc_chroma(); _______________________________________________ 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".