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 3438546448 for ; Thu, 18 May 2023 14:21:37 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0177468C173; Thu, 18 May 2023 17:21:35 +0300 (EEST) Received: from w4.tutanota.de (w4.tutanota.de [81.3.6.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 44F1568BEDD for ; Thu, 18 May 2023 17:21:28 +0300 (EEST) Received: from tutadb.w10.tutanota.de (unknown [192.168.1.10]) by w4.tutanota.de (Postfix) with ESMTP id F27FC1060171 for ; Thu, 18 May 2023 14:21:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1684419687; s=s1; d=lynne.ee; h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Date:Date:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:Sender; bh=V/cLsN5trXtXos732SvQBPoKlPgC9g56/c4flSIcF4M=; b=HT7VB0DkLo1xcG+bIJS8xyf3FpJpVn/bRSCtR2dEydsipnXjP1fE/zpCxzLOufY8 A9yrmkr8VLobCMae0MJJavfR24+945jCYdE+GSQc4X9A177wY+7Ie6L/1P+fWMDr159 mUTwmv+pMPDz1LiyIqI7lrhF+xau7B7HpYNBtf5yzJnyVS3yhKkDy1cmo9InZqn/8tV DFAe99GBq/yjlc8bYyZbPPdkTSYVVTzTqp/E4aBAStoq7ypV0xo4UvWLRpbDp1Mt6Hm bw2uFofTk0EoRp9GGerNfSSKlefJJoejPRPh40cfKUV1pnEFJBrfYV4t7Kna5X50lNK kMa4j3hIUA== Date: Thu, 18 May 2023 16:21:27 +0200 (CEST) From: Lynne To: Ffmpeg Devel Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2360045_1746213155.1684419687804" Subject: [FFmpeg-devel] [PATCH] checkasm/h264dsp: add chroma_mc checkasm 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" Archived-At: List-Archive: List-Post: ------=_Part_2360045_1746213155.1684419687804 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Checks all variants of put_h264_chroma and avg_h264_chroma. Patch attached. ------=_Part_2360045_1746213155.1684419687804 Content-Type: text/x-diff; charset=us-ascii; name=0001-checkasm-h264dsp-add-chroma_mc-checkasm-test.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-checkasm-h264dsp-add-chroma_mc-checkasm-test.patch >From 001abdaa534ccb601aa8ee1431c04e33913401a2 Mon Sep 17 00:00:00 2001 From: Lynne Date: Thu, 18 May 2023 16:18:16 +0200 Subject: [PATCH] checkasm/h264dsp: add chroma_mc checkasm test Checks all variants of put_h264_chroma and avg_h264_chroma. --- tests/checkasm/h264dsp.c | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tests/checkasm/h264dsp.c b/tests/checkasm/h264dsp.c index 3c95f9d74d..e1f8e21ca2 100644 --- a/tests/checkasm/h264dsp.c +++ b/tests/checkasm/h264dsp.c @@ -22,6 +22,7 @@ #include "checkasm.h" #include "libavcodec/avcodec.h" #include "libavcodec/h264dsp.h" +#include "libavcodec/h264chroma.h" #include "libavcodec/h264data.h" #include "libavcodec/h264_parse.h" #include "libavutil/common.h" @@ -440,6 +441,47 @@ static void check_loop_filter_intra(void) } } +static void check_chroma_mc(void) +{ + H264ChromaContext h; + LOCAL_ALIGNED_32(uint8_t, src, [16 * 18 * 2]); + LOCAL_ALIGNED_32(uint8_t, dst0, [16 * 18 * 2]); + LOCAL_ALIGNED_32(uint8_t, dst1, [16 * 18 * 2]); + + declare_func_emms(AV_CPU_FLAG_MMX, void, uint8_t *dst, const uint8_t *src, + ptrdiff_t stride, int h, int x, int y); + + memset(src, 3, 16*18*2); + + for (int bit_depth = 8; bit_depth <= 10; bit_depth++) { + ff_h264chroma_init(&h, bit_depth); + for (int size = 0; size < 4; size++) { + +#define CHECK_CHROMA_MC(name) \ + do { \ + if (check_func(h.name## _pixels_tab[size], #name "_mc%d_%d", 1 << size, bit_depth)) { \ + for (int x = 0; x < 2; x++) { \ + for (int y = 0; y < 2; y++) { \ + memcpy(dst0, src, 16 * 16 * SIZEOF_PIXEL); \ + memcpy(dst1, src, 16 * 16 * SIZEOF_PIXEL); \ + call_ref(dst0, src, 16 * SIZEOF_PIXEL, 16, x, y); \ + call_new(dst1, src, 16 * SIZEOF_PIXEL, 16, x, y); \ + if (memcmp(dst0, dst1, 16 * 16 * SIZEOF_PIXEL)) { \ + fprintf(stderr, #name ": x:%i, y:%i\n", x, y); \ + fail(); \ + } \ + bench_new(dst1, src, 16 * SIZEOF_PIXEL, 16, x, y); \ + } \ + } \ + } \ + } while (0) + + CHECK_CHROMA_MC(put_h264_chroma); + CHECK_CHROMA_MC(avg_h264_chroma); + } + } +} + void checkasm_check_h264dsp(void) { check_idct(); @@ -451,4 +493,7 @@ void checkasm_check_h264dsp(void) check_loop_filter_intra(); report("loop_filter_intra"); + + check_chroma_mc(); + report("chroma_mc"); } -- 2.40.0 ------=_Part_2360045_1746213155.1684419687804 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". ------=_Part_2360045_1746213155.1684419687804--