From patchwork Wed Nov 15 18:02:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= X-Patchwork-Id: 44678 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp2862896pzg; Wed, 15 Nov 2023 10:02:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzUpUtPGaXpHo/ZRoa+rBf0xjJZ5d9TnhL77p4+bKj5wZbMJrW44CTEQVmCew7N4VrwN0W X-Received: by 2002:aa7:db4d:0:b0:543:90d4:6132 with SMTP id n13-20020aa7db4d000000b0054390d46132mr9729196edt.16.1700071365782; Wed, 15 Nov 2023 10:02:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700071365; cv=none; d=google.com; s=arc-20160816; b=Sis67zD/uenCtRvzMup1mg1t6tLQeEHEPn42wdcGThIutpscZKFB4XAShZb1iUZulq /Nz71i2xFuI4aYxzhGfP12va8CnBauwJrHuvkGWXj+gsIdXkN8i4GL392sq/gPouxTJs 6UO7wpTzudn8uX0es5XfdOE1dT7zGrbKqxFGFyP3qOfimNdJKXtq5rBfbLm/hM1EfvNp tOBm7h1wjStp3kdNtD2iTaHdq8XHQyNgkG8fXGa2MWdcGhPs1vUBpSwrrjwbGxFWngbY Lu3PgfKbee5p9rKoEmm0AZMD96PpAyPzenBVvSO15DE1647A1GOmG/fxuG/eWzvhIdAi xz/w== 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:message-id:date:to:from :delivered-to; bh=eTuIkp7khARGUall4A8H1zr4slmuGIVzN5evU97Aupk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Vd/cbZV6+SzckApNrU0G68NFBb1A0OrVUdZHkEvaA8SWH3JtavSJpjd/fdqeB3Mqvl 9yOYyD6P5x8jK40HRuI1Vbd9YuB7f+EvZ6IBvz+A2qpxrGAtr95t3umeehEqvzseirEs Tym/BGXfXCsIMKxYMbQNj6Rq4Fyz+/JYirbHrKVvW6ZNvA6lUxhLVggK7SKPC/foKDl2 hO4YNy2iY0NGygPUEIt2vQtnh3abZi+FNBRJGfyuVbh9YbtKJ5ODoeuQH0tb01ZG1/Ns P/qWoI8L3BWCABE9mEqXfzeH6FWDOTnj2WB/fnL6jWZDpT/irHAeUyFgvb/EJRCnYgAS zbbw== ARC-Authentication-Results: i=1; mx.google.com; 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 b4-20020a509f04000000b005435a29b59bsi5905853edf.598.2023.11.15.10.02.30; Wed, 15 Nov 2023 10:02:45 -0800 (PST) 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; 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 571E368CD28; Wed, 15 Nov 2023 20:02:27 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from ursule.remlab.net (vps-a2bccee9.vps.ovh.net [51.75.19.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B6ED468CA60 for ; Wed, 15 Nov 2023 20:02:20 +0200 (EET) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id 57380C006A for ; Wed, 15 Nov 2023 20:02:20 +0200 (EET) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Nov 2023 20:02:19 +0200 Message-ID: <20231115180220.47256-1-remi@remlab.net> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] checkasm/flacdsp: add LPC 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: LaS3xOkC0oxC --- tests/checkasm/flacdsp.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/checkasm/flacdsp.c b/tests/checkasm/flacdsp.c index 51a0e0060b..4d69cbe507 100644 --- a/tests/checkasm/flacdsp.c +++ b/tests/checkasm/flacdsp.c @@ -54,6 +54,28 @@ static void check_decorrelate(uint8_t **ref_dst, uint8_t **ref_src, uint8_t **ne bench_new(new_dst, (int32_t **)new_src, channels, BUF_SIZE / sizeof(int32_t), 8); } +static void check_lpc(FLACDSPContext *c, int pred_order) +{ + int qlevel = rnd() % 16; + LOCAL_ALIGNED_16(int32_t, coeffs, [32]); + LOCAL_ALIGNED_16(int32_t, dst0, [BUF_SIZE]); + LOCAL_ALIGNED_16(int32_t, dst1, [BUF_SIZE]); + + declare_func(void, int32_t *, const int[32], int, int, int); + + for (int i = 0; i < 32; i++) + coeffs[i] = rnd(); + for (int i = 0; i < BUF_SIZE; i++) + dst0[i] = rnd(); + + memcpy(dst1, dst0, BUF_SIZE * sizeof (int32_t)); + call_ref(dst0, coeffs, pred_order, qlevel, BUF_SIZE); + call_new(dst1, coeffs, pred_order, qlevel, BUF_SIZE); + if (memcmp(dst0, dst1, BUF_SIZE * sizeof (int32_t)) != 0) + fail(); + bench_new(dst1, coeffs, pred_order, qlevel, BUF_SIZE); +} + void checkasm_check_flacdsp(void) { LOCAL_ALIGNED_16(uint8_t, ref_dst, [BUF_SIZE*MAX_CHANNELS]); @@ -72,6 +94,7 @@ void checkasm_check_flacdsp(void) { AV_SAMPLE_FMT_S16, 16 }, { AV_SAMPLE_FMT_S32, 32 }, }; + static const signed char pred_orders[] = { 13, 16, 29, 32 }; FLACDSPContext h; int i, j; @@ -88,4 +111,13 @@ void checkasm_check_flacdsp(void) } report("decorrelate"); + + for (int i = 0; i < sizeof (pred_orders); i++) { + if (check_func(h.lpc16, "flac_lpc_16_%d", pred_orders[i])) + check_lpc(&h, pred_orders[i]); + if (check_func(h.lpc32, "flac_lpc_32_%d", pred_orders[i])) + check_lpc(&h, pred_orders[i]); + } + + report("lpc"); }