From patchwork Fri Dec 22 12:12:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 45294 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:6623:b0:194:e134:edd4 with SMTP id n35csp1017560pzh; Fri, 22 Dec 2023 04:13:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpqv0Pe6wXfSsFxkYTJlPiGseHl9CCROfZBo//HKqoFLdRWD5O1KFpxifnolZgYA6oIRv6 X-Received: by 2002:a17:906:18e:b0:a24:457d:9b23 with SMTP id 14-20020a170906018e00b00a24457d9b23mr598359ejb.151.1703247187090; Fri, 22 Dec 2023 04:13:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703247187; cv=none; d=google.com; s=arc-20160816; b=WIkkNZWNwZKzvVjg7iGLgrNZdddlLDdaN3x6pCNkzNdzz/mKTdSjmwG2wDHKaogt0l obePNh6Z08x3wsOzqIugmFs3r+5v+GI0wyKeCxDfFMR3xkZldAksZHsAdLDVhAZuHLuL T2R4DHw7Bya9l/aM3pAvb9vMOKogt52pOcd3IMmJAUc7E4JH55iGtfyVBPnbyf3FPo2n yUzy1RxtXO1OFU2K8awBEXHJg5C0xJD+qHsFJfVf0ntyDIrauS5abm5IWvcitExI0O6G +bD+7EuBJpK0w6nvZprY002mwenwbF/TudEgiEBddGvI1qGWttSIp1UbIxw9yN1xJYJc W3yQ== 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:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=LuU042zP/Fa+fs7iF2ADPoca7qJZaFh8Ikztgw0Ndx0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=BrhcpHZ+eT5fXVj50MMdfBPrJ0puzq7hA0eUzNFruJ3crcNoGkqiaMxgMMcq/wgOaj ii+OKsntm0tkX+w7S0acdiWwDHbwm1sE8N2BL6AKUPNTJX7kQArdfhnH800UjHtR05SI EK8OQx3k+IG1HB5htJmLm2mFvsrFBzlxcF5nTkRGWpx0NV95Mo9AqdAogxAwbUpN0bB8 BFQ0mmNiYm/0bDxWnBImOy5E1jEUNAjval+m8GVuGO4E6Um1hn3U2XoPtDHzhL0jPowv ytzGUsS83krNpPAPimAgpCmxb5aw419VtxpwDXbBNI35EBGXTP1FQVbtmEkI03ApdOKi xzdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=fgFRBCuE; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c27-20020a17090603db00b00a247cdce410si1719758eja.857.2023.12.22.04.13.04; Fri, 22 Dec 2023 04:13:07 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=fgFRBCuE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 89EDC68D2F2; Fri, 22 Dec 2023 14:12:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E171768D2D8 for ; Fri, 22 Dec 2023 14:12:41 +0200 (EET) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d427518d52so1651355ad.0 for ; Fri, 22 Dec 2023 04:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703247159; x=1703851959; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JZu1YVhS6VJXOySMEc5puq7NRg7xKbuv09u4tN3gMJE=; b=fgFRBCuEV5hGhRX2Fy7D/T82lZE3Llhuy2OAuSwmD/4wt1sXfLwxuuXOuME1r2481s AoFyxvqYTAC8LHCICbWKt8riJAIdWtJqXKVDp2QkiAX0/kLvd5RVBgSDdXCKxfCjkg5r kA+nXlsW3+CaILUcwZdSJiIA3u4RxDzoh2EQ7Ge6w54xzoAxUEE6C2lciEtMyB+bw98R zVB6eYXEBjXlvWiKAv0iObbDvRPEGcfkfCgMMgOYqdQ34GIEmn9afgwtZ5uuvpSmQF97 URxHjVdep6kFEZK/7nOVs7kqy7RBm3txd/qVcEV+HmYStwGJotsmM7/gXBW5ij45DP7M xlbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703247159; x=1703851959; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JZu1YVhS6VJXOySMEc5puq7NRg7xKbuv09u4tN3gMJE=; b=U61ejHNrscGhBmFdhmZe7gX5T5FcvVXMj0Posc+L3mGDZNFLNl0tYp3V7DQxudVf0u U6o4746fU+GUTaUJDvKuoKPBSZjXVG0h9l/Dm1m00uHXSbmF02EDT3NFIrc5j5se+GjV RIBbH5OUS3qRYIAcOxRu0WAja/SLgnbBwd583ZEd0K3kb7wOtuJkR9VcYTJ8ZFUpR/Fo gKbXLM4f4vRevv/QNDBH+jkaCKWQg9gsR1IGBZQlBW6Siu6d9RFFIkdvPW18KgH6P+PU +U9e8YAY73i6DwDxfgah1bAyRwqwFdkyCXWLHZh9CB9TIOl8ZUMevXP2uCkwtXLlu/Lo jgHQ== X-Gm-Message-State: AOJu0Yymtj4jBIHoDel3iout2ca0k/y+tns2syYlcjV8lL11l8A/SZZ8 HLHdKR15qS6MeZtqGxWe0XzoJxfvqZo= X-Received: by 2002:a17:902:e544:b0:1d3:7368:663 with SMTP id n4-20020a170902e54400b001d373680663mr1474093plf.7.1703247159389; Fri, 22 Dec 2023 04:12:39 -0800 (PST) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001d09c5424d4sm3280608plx.297.2023.12.22.04.12.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 04:12:38 -0800 (PST) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Fri, 22 Dec 2023 09:12:32 -0300 Message-ID: <20231222121232.324-3-jamrial@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222121232.324-1-jamrial@gmail.com> References: <20231222121232.324-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/takdsp: fix const correctness 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: htu8wOAg+51/ Signed-off-by: James Almer --- libavcodec/riscv/takdsp_init.c | 4 ++-- libavcodec/takdsp.c | 6 +++--- libavcodec/takdsp.h | 6 +++--- libavcodec/x86/takdsp_init.c | 12 ++++++------ tests/checkasm/takdsp.c | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/libavcodec/riscv/takdsp_init.c b/libavcodec/riscv/takdsp_init.c index 0b4ec18086..2d5c974459 100644 --- a/libavcodec/riscv/takdsp_init.c +++ b/libavcodec/riscv/takdsp_init.c @@ -25,8 +25,8 @@ #include "libavutil/riscv/cpu.h" #include "libavcodec/takdsp.h" -void ff_decorrelate_ls_rvv(int32_t *p1, int32_t *p2, int length); -void ff_decorrelate_sr_rvv(int32_t *p1, int32_t *p2, int length); +void ff_decorrelate_ls_rvv(const int32_t *p1, int32_t *p2, int length); +void ff_decorrelate_sr_rvv(int32_t *p1, const int32_t *p2, int length); av_cold void ff_takdsp_init_riscv(TAKDSPContext *dsp) { diff --git a/libavcodec/takdsp.c b/libavcodec/takdsp.c index 25cac558ce..51b6658de4 100644 --- a/libavcodec/takdsp.c +++ b/libavcodec/takdsp.c @@ -23,7 +23,7 @@ #include "takdsp.h" #include "config.h" -static void decorrelate_ls(int32_t *p1, int32_t *p2, int length) +static void decorrelate_ls(const int32_t *p1, int32_t *p2, int length) { int i; @@ -34,7 +34,7 @@ static void decorrelate_ls(int32_t *p1, int32_t *p2, int length) } } -static void decorrelate_sr(int32_t *p1, int32_t *p2, int length) +static void decorrelate_sr(int32_t *p1, const int32_t *p2, int length) { int i; @@ -58,7 +58,7 @@ static void decorrelate_sm(int32_t *p1, int32_t *p2, int length) } } -static void decorrelate_sf(int32_t *p1, int32_t *p2, int length, int dshift, int dfactor) +static void decorrelate_sf(int32_t *p1, const int32_t *p2, int length, int dshift, int dfactor) { int i; diff --git a/libavcodec/takdsp.h b/libavcodec/takdsp.h index 55f1a10cd3..13b5e530b2 100644 --- a/libavcodec/takdsp.h +++ b/libavcodec/takdsp.h @@ -22,10 +22,10 @@ #include typedef struct TAKDSPContext { - void (*decorrelate_ls)(int32_t *p1, int32_t *p2, int length); - void (*decorrelate_sr)(int32_t *p1, int32_t *p2, int length); + void (*decorrelate_ls)(const int32_t *p1, int32_t *p2, int length); + void (*decorrelate_sr)(int32_t *p1, const int32_t *p2, int length); void (*decorrelate_sm)(int32_t *p1, int32_t *p2, int length); - void (*decorrelate_sf)(int32_t *p1, int32_t *p2, int length, int dshift, int dfactor); + void (*decorrelate_sf)(int32_t *p1, const int32_t *p2, int length, int dshift, int dfactor); } TAKDSPContext; void ff_takdsp_init(TAKDSPContext *c); diff --git a/libavcodec/x86/takdsp_init.c b/libavcodec/x86/takdsp_init.c index c99a057b24..9553f8442c 100644 --- a/libavcodec/x86/takdsp_init.c +++ b/libavcodec/x86/takdsp_init.c @@ -23,14 +23,14 @@ #include "libavutil/x86/cpu.h" #include "config.h" -void ff_tak_decorrelate_ls_sse2(int32_t *p1, int32_t *p2, int length); -void ff_tak_decorrelate_ls_avx2(int32_t *p1, int32_t *p2, int length); -void ff_tak_decorrelate_sr_sse2(int32_t *p1, int32_t *p2, int length); -void ff_tak_decorrelate_sr_avx2(int32_t *p1, int32_t *p2, int length); +void ff_tak_decorrelate_ls_sse2(const int32_t *p1, int32_t *p2, int length); +void ff_tak_decorrelate_ls_avx2(const int32_t *p1, int32_t *p2, int length); +void ff_tak_decorrelate_sr_sse2(int32_t *p1, const int32_t *p2, int length); +void ff_tak_decorrelate_sr_avx2(int32_t *p1, const int32_t *p2, int length); void ff_tak_decorrelate_sm_sse2(int32_t *p1, int32_t *p2, int length); void ff_tak_decorrelate_sm_avx2(int32_t *p1, int32_t *p2, int length); -void ff_tak_decorrelate_sf_sse4(int32_t *p1, int32_t *p2, int length, int dshift, int dfactor); -void ff_tak_decorrelate_sf_avx2(int32_t *p1, int32_t *p2, int length, int dshift, int dfactor); +void ff_tak_decorrelate_sf_sse4(int32_t *p1, const int32_t *p2, int length, int dshift, int dfactor); +void ff_tak_decorrelate_sf_avx2(int32_t *p1, const int32_t *p2, int length, int dshift, int dfactor); av_cold void ff_takdsp_init_x86(TAKDSPContext *c) { diff --git a/tests/checkasm/takdsp.c b/tests/checkasm/takdsp.c index 78528b1c5d..fd4122f34b 100644 --- a/tests/checkasm/takdsp.c +++ b/tests/checkasm/takdsp.c @@ -37,7 +37,7 @@ #define BUF_SIZE 1024 static void test_decorrelate_ls(TAKDSPContext *s) { - declare_func(void, int32_t *, int32_t *, int); + declare_func(void, const int32_t *, int32_t *, int); if (check_func(s->decorrelate_ls, "decorrelate_ls")) { LOCAL_ALIGNED_32(int32_t, p1, [BUF_SIZE]); @@ -62,7 +62,7 @@ static void test_decorrelate_ls(TAKDSPContext *s) { } static void test_decorrelate_sr(TAKDSPContext *s) { - declare_func(void, int32_t *, int32_t *, int); + declare_func(void, int32_t *, const int32_t *, int); if (check_func(s->decorrelate_sr, "decorrelate_sr")) { LOCAL_ALIGNED_32(int32_t, p1, [BUF_SIZE]); @@ -115,7 +115,7 @@ static void test_decorrelate_sm(TAKDSPContext *s) { } static void test_decorrelate_sf(TAKDSPContext *s) { - declare_func(void, int32_t *, int32_t *, int, int, int); + declare_func(void, int32_t *, const int32_t *, int, int, int); if (check_func(s->decorrelate_sf, "decorrelate_sf")) { LOCAL_ALIGNED_32(int32_t, p1, [BUF_SIZE]);