From patchwork Wed Nov 15 16:21:34 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: 44675 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:92a5:b0:181:818d:5e7f with SMTP id q37csp2795799pzg; Wed, 15 Nov 2023 08:21:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IFTOPLVEJje3W1x9G9+B/PP8qFf98FgypqvtMBw/y7aiWJeQi+49S7lAx39P7IlOHvEHOt1 X-Received: by 2002:a17:907:969f:b0:9e0:eb24:dc64 with SMTP id hd31-20020a170907969f00b009e0eb24dc64mr13347048ejc.31.1700065306732; Wed, 15 Nov 2023 08:21:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700065306; cv=none; d=google.com; s=arc-20160816; b=E2FZe3s43SOjK7KVUc8B6ThKqVdSErR6lSJcCiSeFe3kOhPOx+K6AwaQL8B3Sc8h46 hivpJhSwywDYdteMxA0cz9CwY38Nr/xPyMbiVZH/6dckOS321JBHt0PySfUAJpJKXeAW 2gDqQx6QCm9TVg2g5awByFyx+2CAH3xR1bgP4eDV6MO9s6xMuD5UmyRMDdRPYgwSnZ58 ALdB447PZjn3UkylxypVCiXsRakRiwgLWk81+YFLaQ0CFpYjD75gsk7tSEyTw1fAkf9Y ZdnqNk86KYKaYrxdZqSDYG9IzJOylsZ4hIXyBCtojuhDhNX3+vfO0SAgDmO6eponsZ15 i11g== 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=3XXY4lkdNigPMZkx2flWobwIQCUPjQ6o8eCokt3SbGg=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=aVZIuDMyHfAIADyaDJbAe3jk9XQfqdmADYKF6HnijkRO9MyPIyG4c0urjo53ZTnI6q dLeEuDNAXQwvJ8akO4o4xL85V3PIKW3+uEBnHsroql3MCMa9bWLQQdFbqlXLQp7iuw27 OyFjcaFGUrbLbPgwkNodlBC3yTQyxCeTXBtxK4qLiYitptE0ZXzTWALsACp73SbQCPpv 1+qzYOIH7KNrkyb9Im/nFJc0P/j91gj646rVJOgtM7db/4pP5t94Zec7Bcf/EyQ/A3QX 5WUiQRfEJmVVj0DAiOaECCt3z67xqmwcl39iV61vRaakFCl1MDvI9Eb8GrLADsnS3OJX v9KA== 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 p24-20020a17090635d800b0099cbed6da42si5570885ejb.157.2023.11.15.08.21.45; Wed, 15 Nov 2023 08:21:46 -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 5AE0A68CCD0; Wed, 15 Nov 2023 18:21:42 +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 587F068C964 for ; Wed, 15 Nov 2023 18:21:35 +0200 (EET) Received: from basile.remlab.net (localhost [IPv6:::1]) by ursule.remlab.net (Postfix) with ESMTP id D1285C006A for ; Wed, 15 Nov 2023 18:21:34 +0200 (EET) From: =?utf-8?q?R=C3=A9mi_Denis-Courmont?= To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Nov 2023 18:21:34 +0200 Message-ID: <20231115162134.21716-1-remi@remlab.net> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] 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: 7Ro9c2NEwL9M --- tests/checkasm/flacdsp.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/checkasm/flacdsp.c b/tests/checkasm/flacdsp.c index 51a0e0060b..589a3fe834 100644 --- a/tests/checkasm/flacdsp.c +++ b/tests/checkasm/flacdsp.c @@ -54,6 +54,27 @@ 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 = (rnd() % 32) + 1; + 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 < 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]); @@ -88,4 +109,11 @@ void checkasm_check_flacdsp(void) } report("decorrelate"); + + if (check_func(h.lpc16, "flac_lpc_16")) + check_lpc(&h); + if (check_func(h.lpc32, "flac_lpc_32")) + check_lpc(&h); + + report("lpc"); }