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 36BAD49E1F for ; Sun, 12 May 2024 20:36:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7AF8668D638; Sun, 12 May 2024 23:36:36 +0300 (EEST) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C07568D319 for ; Sun, 12 May 2024 23:36:29 +0300 (EEST) Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2b3646494a8so2899645a91.2 for ; Sun, 12 May 2024 13:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715546186; x=1716150986; 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=nMqwTcIwAwDDjHELONt5l1pO/keqOpF9r/Z0oLDpvwk=; b=Hn9oqLzpcNMZEpX4+sB6wxxt4825VA1b6GBCHy3o2LzAvi4YQeYL5lYjOzkbAhYwYk qXj6s6EdmrChifqBD5HHH6dhjBty4cqJpi2nd+5bCZInQ+maMg6PKlKKJsq4uzgKpHPO 0IEfGlrn+fvZHkTsYgEme+rI+bokK8flkEkN9RKQ+GrptPc4cvod0QMvryzlPEra3Ame sOfbhgxmXeqrLbzLGKCsEJ7NCCI1v4r3H2g97AHZl8+lhQCrUFzKyJeC7TtYEl5ykKuE BvoqTeBiOJFA8xDv8B8UvCy8FLJD50SOLSNpPOBOvcgMvkGXCntyNZMyhy/oPC+wV+/6 W23A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715546186; x=1716150986; 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=nMqwTcIwAwDDjHELONt5l1pO/keqOpF9r/Z0oLDpvwk=; b=FLDM75K69fYHv0LgEOH5l4JdzdrRcqzx0ruEU7NMVrHBsO9LeFjL1rahmWvHwGoPpe IlT6QJAl+RC0E90hp2nDUL/mYzBnjADPNwVl1nk3bcNySpJWXaHISNY6Mlo2acFcTvrP 7QXXq2HApfXpqDR0NK0Y7hDNgjhVHxXs3cTiIewl+kXPmEZLcP4v9/rYWin+hG5h1d3H LsJmdA8wFZKcwEHUX22/zQwztR285Wejf9mRs1n0+rDaWAADWkjVUTWVqD+KVNgnR1Jj ILuGzhWQnbcM9R3Wmon1Oleoyac0k1cyy+2GLqJn1uLqaBLeIdq9YUrPq38X1wV3OHkU staA== X-Gm-Message-State: AOJu0YzVvHEiks2rPLDB7j7hbujB0wrqtS2vRDOeCgTMTXCsKkIOLcli OqMe9MeY4E427PW9dN1JN16IrKLU8Q9fkdeGH1a8k1CqXqBK4IxrA4/2tw== X-Google-Smtp-Source: AGHT+IG80DeOubpSAYOT+9+I4WSyYLy99r3jCZMkvLXUPc3nr7wt1sqHUBXFmpntcxlRJjIjU9K9XA== X-Received: by 2002:a17:902:d483:b0:1ed:867:9ea0 with SMTP id d9443c01a7336-1ef4404a894mr92595035ad.57.1715546185553; Sun, 12 May 2024 13:36:25 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c136843sm65912175ad.235.2024.05.12.13.36.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 13:36:25 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Sun, 12 May 2024 17:36:10 -0300 Message-ID: <20240512203611.60371-1-jamrial@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240511194656.1576-1-jamrial@gmail.com> References: <20240511194656.1576-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 09/10] avcodec/flacdsp: split off lpc33 into a dsp function 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- libavcodec/flacdec.c | 7 +------ libavcodec/flacdsp.c | 15 +++++++++++++++ libavcodec/flacdsp.h | 2 ++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 6e6a2896b4..460d3bc01e 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -509,12 +509,7 @@ static int decode_subframe_lpc_33bps(FLACContext *s, int64_t *decoded, if ((ret = decode_residuals(s, residual, pred_order)) < 0) return ret; - for (i = pred_order; i < s->blocksize; i++, decoded++) { - int64_t sum = 0; - for (j = 0; j < pred_order; j++) - sum += (int64_t)coeffs[j] * (uint64_t)decoded[j]; - decoded[j] = residual[i] + (sum >> qlevel); - } + s->dsp.lpc33(decoded, residual, coeffs, pred_order, qlevel, s->blocksize); return 0; } diff --git a/libavcodec/flacdsp.c b/libavcodec/flacdsp.c index 27d3e923ee..f5362bf66f 100644 --- a/libavcodec/flacdsp.c +++ b/libavcodec/flacdsp.c @@ -84,6 +84,20 @@ static void flac_lpc_32_c(int32_t *decoded, const int coeffs[32], } +static void flac_lpc_33_c(int64_t *decoded, const int32_t *residual, + const int coeffs[32], int pred_order, + int qlevel, int len) +{ + int i, j; + + for (i = pred_order; i < len; i++, decoded++) { + int64_t sum = 0; + for (j = 0; j < pred_order; j++) + sum += (int64_t)coeffs[j] * (uint64_t)decoded[j]; + decoded[j] = residual[i] + (sum >> qlevel); + } +} + static void flac_wasted_32_c(int32_t *decoded, int wasted, int len) { for (int i = 0; i < len; i++) @@ -101,6 +115,7 @@ av_cold void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int cha { c->lpc16 = flac_lpc_16_c; c->lpc32 = flac_lpc_32_c; + c->lpc33 = flac_lpc_33_c; c->wasted32 = flac_wasted_32_c; c->wasted33 = flac_wasted_33_c; diff --git a/libavcodec/flacdsp.h b/libavcodec/flacdsp.h index 5a59c0c864..3b7b35a112 100644 --- a/libavcodec/flacdsp.h +++ b/libavcodec/flacdsp.h @@ -30,6 +30,8 @@ typedef struct FLACDSPContext { int qlevel, int len); void (*lpc32)(int32_t *samples, const int coeffs[32], int order, int qlevel, int len); + void (*lpc33)(int64_t *samples, const int32_t *residual, const int coeffs[32], + int pred_order, int qlevel, int len); void (*wasted32)(int32_t *decoded, int wasted, int len); void (*wasted33)(int64_t *decoded, const int32_t *residual, int wasted, int len); -- 2.45.0 _______________________________________________ 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".