From patchwork Sat May 25 02:27:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 49229 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:542:0:b0:460:55fa:d5ed with SMTP id 63csp2097957vqf; Fri, 24 May 2024 19:28:58 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXI3ymrAsbxZCFlCuIunEUS95P62rIVczBKO28C2ez02Vv0JxMgcpqeC0JyKRvByV9zgSy9oizPOFWSPIQPbtWhhTmuTQsYw4sW6w== X-Google-Smtp-Source: AGHT+IHRF48/hE5CjOtjy8+9mHhgxfxxkVXF21lLMK3XzWVKQwrQJbyZtlYndID8C8m1cKxImHxn X-Received: by 2002:a2e:9aca:0:b0:2e1:bdfd:ce5f with SMTP id 38308e7fff4ca-2e95b276988mr24789591fa.44.1716604137977; Fri, 24 May 2024 19:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716604137; cv=none; d=google.com; s=arc-20160816; b=ZjpdPFsLFWrVHXC1V5AGRJR7jQCi1Voyi+awctZK69v7URUxHq7XYWVr6opGte5ShD rQpccyTg4wephuSHUPT2ZMbcGGZwFJF549ZX+7LskznLXprr7Q8vVoVPS4ZMoBo1/66J WJXqDAQyNMV2sc5HFaZn6f5uTONB5qwXqO8/umRaajQl91fG4xe1LPvUkR4K2kMKL3W4 unjT3vqOkMr8JbeGZ4ugCg6HxdAxpiDQznIOZ64OZx5tPOy/qJ03JfIIb8h843GrxDnS KJWL9dbZWBX9FPaBEsv8shK4rHtXmxW8YcGLI8rAoH91y/DQN3G8zDBUBm7Xxn+6Dm7n Gp9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to:from :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:delivered-to; bh=QQmAHsnoLLCgLCZry+Qec3AOWyLdHaVMlZrQ1YVa51k=; fh=nenT92/WZoU6unXd3J6UhGUdod4piddKfVtctNBOh6k=; b=msmfYGIRjsE302oFgDVKPWy1Txs2MZZpgmgNtvkU0HT42mBg2f/iTsDxC6bjo0M021 uCYjHhvOL3x+xOAXeHgfQ6yh/v+3+AbfJw/HO0gOeSkmlbw0Ep8hIXIiJQ+8A27E06Xv qScv9OkxKxv2AnxbMsye7ha6M4F9Lag5if1bd4VzqBHANhK1E4hwWTCLxcevIpm+ojx+ HL4GsirIPYhbOyp1Cc/VvBCyoiLQKCjH8UwF17AwiTq67vzrcv3u6iiNFLe/0ffSdQdq uDf44eZJY51hf31z966bcHpQUrk9wPcmwY+DiRZPSfJdPiaD5WRLbQUhf6E+8a6Ny2Vc rJNg==; dara=google.com 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 38308e7fff4ca-2e95bccaf9csi8032991fa.131.2024.05.24.19.28.57; Fri, 24 May 2024 19:28:57 -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; 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 0837D68D580; Sat, 25 May 2024 05:28:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vidala.lynne.ee (vidala.pars.ee [116.203.72.101]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5984C68D575 for ; Sat, 25 May 2024 05:28:17 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sat, 25 May 2024 04:27:57 +0200 Message-ID: <20240525022813.2292001-5-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 In-Reply-To: <20240525022813.2292001-1-dev@lynne.ee> References: <20240525022813.2292001-1-dev@lynne.ee> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 04/10] aacdec: expose decode_tns 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: , X-Patchwork-Original-From: Lynne via ffmpeg-devel From: Lynne Reply-To: FFmpeg development discussions and patches Cc: Lynne Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: xsr4VSscYYzi USAC has the same syntax, with one minor change we can check for. --- libavcodec/aac/aacdec.c | 6 +++--- libavcodec/aac/aacdec.h | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libavcodec/aac/aacdec.c b/libavcodec/aac/aacdec.c index 40554ff9e4..a7e5b2a369 100644 --- a/libavcodec/aac/aacdec.c +++ b/libavcodec/aac/aacdec.c @@ -1542,7 +1542,7 @@ static int decode_pulses(Pulse *pulse, GetBitContext *gb, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, +int ff_aac_decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, GetBitContext *gb, const IndividualChannelStream *ics) { int w, filt, i, coef_len, coef_res, coef_compress; @@ -1690,7 +1690,7 @@ int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce, } tns->present = get_bits1(gb); if (tns->present && !er_syntax) { - ret = decode_tns(ac, tns, gb, ics); + ret = ff_aac_decode_tns(ac, tns, gb, ics); if (ret < 0) goto fail; } @@ -1704,7 +1704,7 @@ int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce, // I see no textual basis in the spec for this occurring after SSR gain // control, but this is what both reference and real implmentations do if (tns->present && er_syntax) { - ret = decode_tns(ac, tns, gb, ics); + ret = ff_aac_decode_tns(ac, tns, gb, ics); if (ret < 0) goto fail; } diff --git a/libavcodec/aac/aacdec.h b/libavcodec/aac/aacdec.h index bea0578e92..499bd8eefc 100644 --- a/libavcodec/aac/aacdec.h +++ b/libavcodec/aac/aacdec.h @@ -351,6 +351,9 @@ int ff_aac_decode_init_fixed(AVCodecContext *avctx); int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce, GetBitContext *gb, int common_window, int scale_flag); +int ff_aac_decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, + GetBitContext *gb, const IndividualChannelStream *ics); + int ff_aac_set_default_channel_config(AACDecContext *ac, AVCodecContext *avctx, uint8_t (*layout_map)[3], int *tags,