From patchwork Sun May 19 16:54:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lynne X-Patchwork-Id: 49033 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3a48:b0:1af:fc2d:ff5a with SMTP id zu8csp4001523pzb; Sun, 19 May 2024 09:55:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUPZ1bOgYIY4UDCnJlxqQDMfLy3Pt1aQGFizyY9pdOIio0jZLkpb5hVhM6ZEg+iY4/bm9YiMeoAbWUo6cmUekeO/1HCnlkKEVJY5g== X-Google-Smtp-Source: AGHT+IHy4isQ0iaOXyJeRAYAAHqQPYvhDtZxW2YJQL+DLtaJxFQa+py/SUlvFd2zBi0mPf9ke3Ix X-Received: by 2002:a2e:b013:0:b0:2e5:67a7:ddb0 with SMTP id 38308e7fff4ca-2e567a7df97mr150795601fa.3.1716137742126; Sun, 19 May 2024 09:55:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716137742; cv=none; d=google.com; s=arc-20160816; b=WvtloXYaoe0YSU2LWh6E4QTwuNdyOaonTMOMOzPtx+jm37xQclkGfc1i4nD2Wn4ZOh o8U2dFUlczqsjLI8AzQ8wp76LbFqsS0pvVsk+n3bPWmR1ZQamnq8lkyE5761wDgtIBvv gRoraRoMDHjxf+ys0gs46PaC+4j4m2fl9CgdhLuIO0SfGIyD7PoiBt1CQblbtwmH6TQI BCZ/Vh3xjZNyQ+3dHlSg5/kjAoZLp1/fC5V7GCXuvC3Pv2kPm0ChJm3ZWAx5GIGj2uqk ri2VsH9jbDtW9Fd7cEkup8MIbOaxWd6gz13NGsdWggMUzSkPA4UY1UCB3lJ1/+srWtjr a8Og== 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=NfGGllg3DBxIt8tneTYf7lHjv3hHZkehd+TqgmCDvUIU6N30kfY7xrm8eJeOpp7uNt pEz9AsCgRiw2wV1h9agegnxI4PyN21SCI6WWTdPfXzzAwO6EXiZN4h52sKMXxEJKc8Ll HqwoB62Ui5WYVNYe0OykILV/W4IX9sdyAMXIkiOtnVoCh4HwpiMXNehKRjXOASCwvZ0K 45xjMvLplZDSs4fv0y5UvXKf+2Go9ef5MZHSMUgp6ubqD4fa41eUw/V7MEs68rP/G+vI FXPjpafXC+fMLyQeoahXBM0JebuBzPNcqnhfijUDLUU4BbwDR9D6skwgwkj4VeSudnkr fIQg==; 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 4fb4d7f45d1cf-5733c32c40esi12390998a12.431.2024.05.19.09.55.41; Sun, 19 May 2024 09:55:42 -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 C872068BEB5; Sun, 19 May 2024 19:55:19 +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 A529968CEED for ; Sun, 19 May 2024 19:55:12 +0300 (EEST) To: ffmpeg-devel@ffmpeg.org Date: Sun, 19 May 2024 18:54:39 +0200 Message-ID: <20240519165444.829271-4-dev@lynne.ee> X-Mailer: git-send-email 2.43.0.381.gb435a96ce8 In-Reply-To: <20240519165444.829271-1-dev@lynne.ee> References: <20240519165444.829271-1-dev@lynne.ee> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 3/8] 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: OwT5y4x2NJEA 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,