From patchwork Thu May 18 14:21:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 41715 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:ba91:b0:105:feb:71f2 with SMTP id fb17csp541516pzb; Thu, 18 May 2023 07:21:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Dw7SQkRNEZxqncxz32qVBlM4qRvMGMGMS5sDBrTcaNMf4CulpMj1jh41blh2BxsGBwT+G X-Received: by 2002:a17:907:96ac:b0:948:a1ae:b2c4 with SMTP id hd44-20020a17090796ac00b00948a1aeb2c4mr48696053ejc.6.1684419700783; Thu, 18 May 2023 07:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684419700; cv=none; d=google.com; s=arc-20160816; b=z+cFjSgcleSIVIK0UHaGTixZSScdT9PzICYLbk9/ENnjEEsJPO/2Oe/U8qyJuRtM0J vqm5oyYlczGMHy64NWzTiXlVyWdozeF4NYkrLzeE3n4abMpexuBJ+ZuOHTNzGJw9Prgw OautM9PPJn9wjaL6JoP8PKvb4AcUWnTe8Wmj7eJgSLt1P61Yv6jQmEmyQmUuWLiUN+uA nQ1/tQzO60xT4SBMCT7AvvgNpwdtQcRKwpKsVZYMcb6ZjxMSYd1OzO1OhVog2krrOHbh oi1SDgd9TNbeWS2Lfvvz+a8MZ7kNW3jGzu81h4/3Ts6Cz/k/QgyzV4lM9B+jdr2XQenr s7tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:to:from:date:dkim-signature:delivered-to; bh=jyxoRSf83S2h7CmO4FHP2fB8RQO4curQNBen06GW89E=; b=TpVuPtHd3hJZ3ECikhrdZopZA6sfJ3XBhSLkYEquNwtvMnRQpW3VLjY7SroInQxrLL EAgnaVrhbiDAX8703StTFqhKscRFCu158sXdE9cNaLiBSC68qBff1b4RDX5JbCOTtzqJ YNkl6e3qJzzmwjXdu6952cDXFiZOS1MHSSGsld6XmfgRXOKMxTwPnydt65ccrgGgDGS/ QIc4RxPnQiYegFyqKiorCZsVBe+eEDzv1EUrHT/kuan8OEIlrZJW4fveCSg/aLaKBv0k lTJWDVXJ5bU6a12ngLOqetqN2m6kHrawENR8chBwmUahFh7HiB4wMfqJdx7MeUjA78b5 GWeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@lynne.ee header.s=s1 header.b=HT7VB0Dk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l24-20020a1709066b9800b00966543a7db6si1348941ejr.1004.2023.05.18.07.21.39; Thu, 18 May 2023 07:21:40 -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=@lynne.ee header.s=s1 header.b=HT7VB0Dk; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lynne.ee Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 308D868C174; Thu, 18 May 2023 17:21:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 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" X-TUID: 0Z26Sp6Z29jA Checks all variants of put_h264_chroma and avg_h264_chroma. Patch attached. 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