From patchwork Mon Feb 26 01:26:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46538 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51b:b0:19e:cdac:8cce with SMTP id gm27csp1115595pzb; Sun, 25 Feb 2024 17:40:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX2xwefCS+kDgU9Td0a1xgETY6crNwN1+5Gqg8d1Hr9QvXVQQnGIHSunwBCxCToDvHu1q2sQP0/m5HHQXjbLto9JkeIvxkhXuEuFQ== X-Google-Smtp-Source: AGHT+IFdfWLSEFo+mKaRFLAlH/VQhLPKnk07LOlFXxcqdMlFaGzbEZbqLYsUIDK9mhYtP5zP+gJr X-Received: by 2002:a17:906:1159:b0:a3f:3d0d:30cc with SMTP id i25-20020a170906115900b00a3f3d0d30ccmr4790815eja.1.1708911653684; Sun, 25 Feb 2024 17:40:53 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gv24-20020a170906f11800b00a3e6512224asi1626762ejb.247.2024.02.25.17.40.53; Sun, 25 Feb 2024 17:40:53 -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=@outlook.com header.s=selector1 header.b=XsRyGFVQ; arc=fail (body hash mismatch); 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=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0D54C68C7E5; Mon, 26 Feb 2024 03:40:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05olkn2077.outbound.protection.outlook.com [40.92.90.77]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B11E068C7E9 for ; Mon, 26 Feb 2024 03:40:37 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q+wK+j+fmpRtVUFnMqaCxYcEBqmAZGjB+td1b5k1aN1dNcRDt4bZZbEtiIye5ZiheK9X+tw3PUrg3zi2ufimUYpvUp7D/2CaImEewzhYkjcfS4EB3DzTVhJPKNKuUQ1i++36/5rhQbJZ/ESiV24lb66ye3KOqVSdm4qLbLcYxgwCY+G++DhM4Ioyuyr9rmEAJXq6H386ULNiEmN3KlipG2kAEVyeHBV1w0JGyZQp0ywzTRMPiGeesvWIFp5R4sUR12ZRnzIoyqIryHaBboowHZ1WNvF9GrnmItiWi2x7PRL2brBd835s6ZllNsqU9BjccEYud2dPlmId135zcxh7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CuO4Cm+UvPFONUmdnYCcI/ZltLta6SoPdEInS5zJNKU=; b=ofvBROktpph8cWmUhYShU0u5Byf77ox/g7JQckE6Hts2gYz02/JhCGXdsQphBGd5MBy+XYnQRvGijLjFujFMQUHDLnrJJ+olLp/4wHa1QSAM3O+qXTnZ3gRppqUItEy4IqJhe0am+niN26Oz1ZDUddLpDvEJWZnBMtF+TqS94PBijmndLsK+E/h2aB3CesVcmTvDL4Wlo0WQwaLbSvQjmnTH0P+ojSpP9yshbyxnRP44TQ8nOa9S3V7zyk10S7smNpFBvq+tYLJdk3iaYx4g0PiwDqAYY6XNrcWVEOZytRQ3PE1f83+tLelAWR5jowg5TaZsdGdsG4Rifdp/eHA7uA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CuO4Cm+UvPFONUmdnYCcI/ZltLta6SoPdEInS5zJNKU=; b=XsRyGFVQ+6AZRq9f97RSsU7B1pUa2YLKNX0vIJGzwrB1PBQ3PanlOb8jQrbHwQGnJesHd+CvdzJWVENf2qfnjzVXwj1fIAQQP7V1F/Y/he91P60oq+CdH0Pat0YRyvyXRCSNDOzCiocTgwo0RuyOLN8i5uH8iStu7i06ad07+r3wMTrrmU+XQxoMkCjbDakrs44wQrA5WHdSN+t6L92Gee+w/Yzds2LRXfVeP7lBAnbsssQZq3UoryFuWCvkaQW5eW5CGd/ahxBE5a5UtoAbN+pJif2l1CWqTuccrnQma9XU4C7h0j/BXl9hoc5/r3QjbNx+XVJoVCbUgvYrdR/FXg== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0288.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Mon, 26 Feb 2024 01:25:07 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7316.023; Mon, 26 Feb 2024 01:25:07 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Feb 2024 02:26:52 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [bpU7gnQgFnciO+paT1URxi/Np47FTygRi3mA+GiUnFQ=] X-ClientProxiedBy: ZR0P278CA0063.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::14) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240226012656.4055642-3-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0288:EE_ X-MS-Office365-Filtering-Correlation-Id: 3f9a9742-41da-45a8-06a9-08dc3669c487 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kTo3GMwcgKrawKYTFf3iQv6mPywAlLezcAmZmSbInpzzUxe+0CUdAvvfnw6L6JWzLkSaTeB6SwO1a20IPycFp+753uz4i8juaoOKOc4Vb32v2jfaOtBkfgp8lMz9PPVs64YRaW4+fIrZ/4uP1s6gpcDBgFCxDKo/825+qEkQYAwCyUpR+LApQL7kqF1ZRP6u8je815hW4RfaPUQ4XoGWJ4cfuBLCOM317fdNoJTc8mdkcI8tq94pYlx6SSdaDbUeHNe3ZPV6QIc+rPnR/BpJO+gkaP43ymdwT2EOlSb4Un1t5RjCD1RbMsgWL5uL3CvC7OcARXp7rqUprktfTumUrMjUJhxctNJg1HrfrPAFjUk4LgoVZogHe8D1aZa2rLLSPlvKWjxgnDt2pv1MnRzNNovi0lAOSOvKAIMnWV+0wetylu3f0uDo18gmb6/U57rrP/s14I+gcTPa9ZmkhhuuixNj6Eg3hm3413JZ3WzpuDqT1XgyJ3Vz1V4e1OY0RpSkG4+WyrnJ2crrrN8fZ5Na5cxyk4WzkeHu5LsGhDDfa+ec5IcP44al4iRVLIYge+Wlpm/QJZE6ttoEgxtM8F8qyEWUn43wTAt73Docd2EgeCB7vCLutKNHsTw//5Dq2TjhDu5/5MXZxGNuKia4GZiKllAL6uovhwigGqRD4D+NUnFOjJOIlQOQpJdZClGknLwceUJifk6RAg9UCM3+5FgrRA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1nkegd2emIHVdVt2vFbUXXTrKsfSr1TYkzn10u6MtkYIPgQBdRynVzg7aAh7Dgac3558c9akbWJOZGM14zQEUJc+ofzWMRgsrfXbXm2J6dvZ9e+5q4m9HFj3U3hn8in2gjBTsQ40g6OA8+jRhkrSx5ZbLSxuKewORCWZVBTcDMuW5osYl7va+n7xgfoPUky16cNlIV7rO2cUFGehT0wSA/unoCdbWFtrxVCHq8A0YWpMPZ0sGbcyRKasw+JCZFGxWJpcOgmYRL27vY9xIPnyhEdLwaDEkEer64VXErEqVp6NpkRN9zN5X2yTY+KYaueLIWl2ULRFseqEMThM7OlH6L+wVF5V9geZoovqcb5QbQOoHwiVTlk87g+NzO7Pf16Y1Lcd4zWwDwrlqUc/ly4GYQ8bmPLP9JUYUVs5jM97J0/Hjd1uUIAJcF4VEPjjMIfFrCUfi3+OzgjVq+gofuXb62OV3CrFdIItc1gZhAvXSVDR10xxyvKLOTcqy815xEdweaLPLV7XzrBCbCYk/XPi7Gcm33bZE3DrpVblta2umXEcJVD0P4QwxdQCi8DtEgRJzlkZBd//ApkVJlGve0HaDILc57GBG7RYVvMDE9Dn7RnXjfSuBK6DsAs3fWkyx77uxPuT7Q3+djks8k/n3OvCjJ7iNyap4AxnD4RM6SVXmZWj0zClJ+yKG4hqktzIuaXJCmsYgo/U7n38S1/BoYIHNnKrhIVzgGy/6S57n0voB/0L28Pb8pBqe6q9eiEc3FwjHGEgwF49C+XxdcJUfGChZTRAmmCyOx6zqQ6VVPCYHBIhbN4Gm84iuw1O51zfgZeqmDHfobIzB6CzG49q6cOMs58PVj/F628bfXAGD2lMNGHbnusaKSCe30hsDtjXcQZssnpMsHdZ0X6JUSbrhVa8kIxbicoaJ00sqgZTLE3wla+5A/VeBwZ4qY5X/ZkNJ4TauFRUDPRZOXj6eTOk+0uFP09Fv1jgNUYLpzOOzdRoyoGxupQbNFXYISuFnywcvo128npo4Cm2VEPybVqGug1JZHCCA+gnBf5qaLl0kRLFoupHkpT5splyvvJ9fLDxATJ70R7hfw8mbSuPZ7argnSmoQaMnc1SPuZpv+SaKwrYj5EneN92oj0Z1wmUzuRq+jOeocBBMhprgpM5KzKK0l75USbxz/poVjDcsxV1EK/M8dOZACl5apwAggqU1R+Hfj0gzl9tiEecJmRYbzaB5fn4ULaL3jlpO5fnNzOwVFyUEjmUCpxSKBA61rM60mOTAPtTm9cyJRqvdO0/ifqSKr+ZCg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f9a9742-41da-45a8-06a9-08dc3669c487 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 01:25:07.8298 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0288 Subject: [FFmpeg-devel] [PATCH 4/8] avcodec/aacdec: Rename AACContext to AACDecContext 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ezqDa5qNGwqH It is decoder-only; furthermore, there is already an AACContext in use by libfdk-aacenc. Also make aacdec.h provide the typedef for AACContext; up until now, this has been done by sbr.h. Signed-off-by: Andreas Rheinhardt --- libavcodec/aacdec.c | 10 ++-- libavcodec/aacdec.h | 15 +++-- libavcodec/aacdec_fixed.c | 6 +- libavcodec/aacdec_template.c | 105 +++++++++++++++++----------------- libavcodec/aacsbr.h | 6 +- libavcodec/aacsbr_template.c | 34 +++++------ libavcodec/mips/aacdec_mips.c | 8 +-- libavcodec/mips/aacsbr_mips.c | 2 +- libavcodec/sbr.h | 4 +- 9 files changed, 96 insertions(+), 94 deletions(-) diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 962b1705c6..b1bce7542b 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -210,7 +210,7 @@ static av_always_inline void predict(PredictorState *ps, float *coef, * * @param index index into coupling gain array */ -static void apply_dependent_coupling(AACContext *ac, +static void apply_dependent_coupling(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { @@ -246,7 +246,7 @@ static void apply_dependent_coupling(AACContext *ac, * * @param index index into coupling gain array */ -static void apply_independent_coupling(AACContext *ac, +static void apply_independent_coupling(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { @@ -263,7 +263,7 @@ static void apply_independent_coupling(AACContext *ac, #define LOAS_SYNC_WORD 0x2b7 ///< 11 bits LOAS sync word struct LATMContext { - AACContext aac_ctx; ///< containing AACContext + AACDecContext aac_ctx; ///< containing AACContext int initialized; ///< initialized after a valid extradata was seen // parser data @@ -282,7 +282,7 @@ static inline uint32_t latm_get_value(GetBitContext *b) static int latm_decode_audio_specific_config(struct LATMContext *latmctx, GetBitContext *gb, int asclen) { - AACContext *ac = &latmctx->aac_ctx; + AACDecContext *ac = &latmctx->aac_ctx; AVCodecContext *avctx = ac->avctx; MPEG4AudioConfig m4ac = { 0 }; GetBitContext gbc; @@ -556,7 +556,7 @@ const FFCodec ff_aac_decoder = { CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, - .priv_data_size = sizeof(AACContext), + .priv_data_size = sizeof(AACDecContext), .init = aac_decode_init, .close = aac_decode_close, FF_CODEC_DECODE_CB(aac_decode_frame), diff --git a/libavcodec/aacdec.h b/libavcodec/aacdec.h index c4ac63e2fb..37a318659e 100644 --- a/libavcodec/aacdec.h +++ b/libavcodec/aacdec.h @@ -81,7 +81,7 @@ typedef struct DynamicRangeControl { /** * main AAC decoding context */ -struct AACContext { +typedef struct AACDecContext { const struct AVClass *class; struct AVCodecContext *avctx; struct AVFrame *frame; @@ -162,18 +162,17 @@ struct AACContext { int warned_he_aac_mono; /* aacdec functions pointers */ - void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce); - void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce); + void (*imdct_and_windowing)(struct AACDecContext *ac, SingleChannelElement *sce); + void (*apply_ltp)(struct AACDecContext *ac, SingleChannelElement *sce); void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns, IndividualChannelStream *ics, int decode); - void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out, + void (*windowing_and_mdct_ltp)(struct AACDecContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics); - void (*update_ltp)(AACContext *ac, SingleChannelElement *sce); + void (*update_ltp)(struct AACDecContext *ac, SingleChannelElement *sce); void (*vector_pow43)(int *coefs, int len); void (*subband_scale)(int *dst, int *src, int scale, int offset, int len, void *log_context); +} AACDecContext; -}; - -void ff_aacdec_init_mips(AACContext *c); +void ff_aacdec_init_mips(AACDecContext *c); #endif /* AVCODEC_AACDEC_H */ diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 19662cb7e6..57d3fc8bab 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -355,7 +355,7 @@ static const int cce_scale_fixed[8] = { * * @param index index into coupling gain array */ -static void apply_dependent_coupling_fixed(AACContext *ac, +static void apply_dependent_coupling_fixed(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { @@ -419,7 +419,7 @@ static void apply_dependent_coupling_fixed(AACContext *ac, * * @param index index into coupling gain array */ -static void apply_independent_coupling_fixed(AACContext *ac, +static void apply_independent_coupling_fixed(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index) { @@ -457,7 +457,7 @@ const FFCodec ff_aac_fixed_decoder = { CODEC_LONG_NAME("AAC (Advanced Audio Coding)"), .p.type = AVMEDIA_TYPE_AUDIO, .p.id = AV_CODEC_ID_AAC, - .priv_data_size = sizeof(AACContext), + .priv_data_size = sizeof(AACDecContext), .init = aac_decode_init, .close = aac_decode_close, FF_CODEC_DECODE_CB(aac_decode_frame), diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index cfaa25873f..72c6e206a6 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -94,7 +94,7 @@ #include "decode.h" #include "internal.h" -static int output_configure(AACContext *ac, +static int output_configure(AACDecContext *ac, uint8_t layout_map[MAX_ELEM_ID*4][3], int tags, enum OCStatus oc_type, int get_new_frame); @@ -124,7 +124,7 @@ static int count_channels(uint8_t (*layout)[3], int tags) * * @return Returns error status. 0 - OK, !0 - error */ -static av_cold int che_configure(AACContext *ac, +static av_cold int che_configure(AACDecContext *ac, enum ChannelPosition che_pos, int type, int id, int *channels) { @@ -160,7 +160,7 @@ static av_cold int che_configure(AACContext *ac, static int frame_configure_elements(AVCodecContext *avctx) { - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; int type, id, ch, ret; /* set channel pointers to internal buffers by default */ @@ -411,7 +411,8 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags) /** * Save current output configuration if and only if it has been locked. */ -static int push_output_configuration(AACContext *ac) { +static int push_output_configuration(AACDecContext *ac) +{ int pushed = 0; if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) { @@ -426,7 +427,8 @@ static int push_output_configuration(AACContext *ac) { * Restore the previous output configuration if and only if the current * configuration is unlocked. */ -static void pop_output_configuration(AACContext *ac) { +static void pop_output_configuration(AACDecContext *ac) +{ if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) { ac->oc[1] = ac->oc[0]; ac->avctx->ch_layout = ac->oc[1].ch_layout; @@ -441,7 +443,7 @@ static void pop_output_configuration(AACContext *ac) { * * @return Returns error status. 0 - OK, !0 - error */ -static int output_configure(AACContext *ac, +static int output_configure(AACDecContext *ac, uint8_t layout_map[MAX_ELEM_ID * 4][3], int tags, enum OCStatus oc_type, int get_new_frame) { @@ -516,7 +518,7 @@ FF_ENABLE_DEPRECATION_WARNINGS static void flush(AVCodecContext *avctx) { - AACContext *ac= avctx->priv_data; + AACDecContext *ac= avctx->priv_data; int type, i, j; for (type = 3; type >= 0; type--) { @@ -537,7 +539,7 @@ static void flush(AVCodecContext *avctx) * * @return Returns error status. 0 - OK, !0 - error */ -static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx, +static int set_default_channel_config(AACDecContext *ac, AVCodecContext *avctx, uint8_t (*layout_map)[3], int *tags, int channel_config) @@ -577,7 +579,7 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx, return 0; } -static ChannelElement *get_che(AACContext *ac, int type, int elem_id) +static ChannelElement *get_che(AACDecContext *ac, int type, int elem_id) { /* For PCE based channel configurations map the channels solely based * on tags. */ @@ -830,12 +832,12 @@ static int decode_pce(AVCodecContext *avctx, MPEG4AudioConfig *m4ac, /** * Decode GA "General Audio" specific configuration; reference: table 4.1. * - * @param ac pointer to AACContext, may be null + * @param ac pointer to AACDecContext, may be null * @param avctx pointer to AVCCodecContext, used for logging * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, +static int decode_ga_specific_config(AACDecContext *ac, AVCodecContext *avctx, GetBitContext *gb, int get_bit_alignment, MPEG4AudioConfig *m4ac, @@ -916,7 +918,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, return 0; } -static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx, +static int decode_eld_specific_config(AACDecContext *ac, AVCodecContext *avctx, GetBitContext *gb, MPEG4AudioConfig *m4ac, int channel_config) @@ -976,7 +978,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx, /** * Decode audio specific configuration; reference: table 1.13. * - * @param ac pointer to AACContext, may be null + * @param ac pointer to AACDecContext, may be null * @param avctx pointer to AVCCodecContext, used for logging * @param m4ac pointer to MPEG4AudioConfig, used for parsing * @param gb buffer holding an audio specific config @@ -985,7 +987,7 @@ static int decode_eld_specific_config(AACContext *ac, AVCodecContext *avctx, * * @return Returns error status or number of consumed bits. <0 - error */ -static int decode_audio_specific_config_gb(AACContext *ac, +static int decode_audio_specific_config_gb(AACDecContext *ac, AVCodecContext *avctx, MPEG4AudioConfig *m4ac, GetBitContext *gb, @@ -1052,7 +1054,7 @@ static int decode_audio_specific_config_gb(AACContext *ac, return get_bits_count(gb); } -static int decode_audio_specific_config(AACContext *ac, +static int decode_audio_specific_config(AACDecContext *ac, AVCodecContext *avctx, MPEG4AudioConfig *m4ac, const uint8_t *data, int64_t bit_size, @@ -1121,7 +1123,7 @@ static void reset_predictor_group(PredictorState *ps, int group_num) reset_predict_state(&ps[i]); } -static void aacdec_init(AACContext *ac); +static void aacdec_init(AACDecContext *ac); static av_cold void aac_static_table_init(void) { @@ -1152,7 +1154,7 @@ static AVOnce aac_table_init = AV_ONCE_INIT; static av_cold int aac_decode_init(AVCodecContext *avctx) { float scale; - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; int ret; if (avctx->sample_rate > 96000) @@ -1250,7 +1252,7 @@ static av_cold int aac_decode_init(AVCodecContext *avctx) /** * Skip data_stream_element; reference: table 4.10. */ -static int skip_data_stream_element(AACContext *ac, GetBitContext *gb) +static int skip_data_stream_element(AACDecContext *ac, GetBitContext *gb) { int byte_align = get_bits1(gb); int count = get_bits(gb, 8); @@ -1267,7 +1269,7 @@ static int skip_data_stream_element(AACContext *ac, GetBitContext *gb) return 0; } -static int decode_prediction(AACContext *ac, IndividualChannelStream *ics, +static int decode_prediction(AACDecContext *ac, IndividualChannelStream *ics, GetBitContext *gb) { int sfb; @@ -1303,7 +1305,7 @@ static void decode_ltp(LongTermPrediction *ltp, /** * Decode Individual Channel Stream info; reference: table 4.6. */ -static int decode_ics_info(AACContext *ac, IndividualChannelStream *ics, +static int decode_ics_info(AACDecContext *ac, IndividualChannelStream *ics, GetBitContext *gb) { const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac; @@ -1429,7 +1431,7 @@ fail: * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_band_types(AACContext *ac, enum BandType band_type[120], +static int decode_band_types(AACDecContext *ac, enum BandType band_type[120], int band_type_run_end[120], GetBitContext *gb, IndividualChannelStream *ics) { @@ -1478,7 +1480,7 @@ static int decode_band_types(AACContext *ac, enum BandType band_type[120], * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_scalefactors(AACContext *ac, INTFLOAT sf[120], GetBitContext *gb, +static int decode_scalefactors(AACDecContext *ac, INTFLOAT sf[120], GetBitContext *gb, unsigned int global_gain, IndividualChannelStream *ics, enum BandType band_type[120], @@ -1580,7 +1582,7 @@ static int decode_pulses(Pulse *pulse, GetBitContext *gb, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_tns(AACContext *ac, TemporalNoiseShaping *tns, +static int decode_tns(AACDecContext *ac, TemporalNoiseShaping *tns, GetBitContext *gb, const IndividualChannelStream *ics) { int w, filt, i, coef_len, coef_res, coef_compress; @@ -1648,7 +1650,7 @@ static void decode_mid_side_stereo(ChannelElement *cpe, GetBitContext *gb, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], +static int decode_spectrum_and_dequant(AACDecContext *ac, INTFLOAT coef[1024], GetBitContext *gb, const INTFLOAT sf[120], int pulse_present, const Pulse *pulse, const IndividualChannelStream *ics, @@ -1943,7 +1945,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, INTFLOAT coef[1024], /** * Apply AAC-Main style frequency domain prediction. */ -static void apply_prediction(AACContext *ac, SingleChannelElement *sce) +static void apply_prediction(AACDecContext *ac, SingleChannelElement *sce) { int sfb, k; @@ -2006,7 +2008,7 @@ static void decode_gain_control(SingleChannelElement * sce, GetBitContext * gb) * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_ics(AACContext *ac, SingleChannelElement *sce, +static int decode_ics(AACDecContext *ac, SingleChannelElement *sce, GetBitContext *gb, int common_window, int scale_flag) { Pulse pulse; @@ -2097,7 +2099,7 @@ fail: /** * Mid/Side stereo decoding; reference: 4.6.8.1.3. */ -static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe) +static void apply_mid_side_stereo(AACDecContext *ac, ChannelElement *cpe) { const IndividualChannelStream *ics = &cpe->ch[0].ics; INTFLOAT *ch0 = cpe->ch[0].coeffs; @@ -2135,7 +2137,7 @@ static void apply_mid_side_stereo(AACContext *ac, ChannelElement *cpe) * [1] mask is decoded from bitstream; [2] mask is all 1s; * [3] reserved for scalable AAC */ -static void apply_intensity_stereo(AACContext *ac, +static void apply_intensity_stereo(AACDecContext *ac, ChannelElement *cpe, int ms_present) { const IndividualChannelStream *ics = &cpe->ch[1].ics; @@ -2185,7 +2187,7 @@ static void apply_intensity_stereo(AACContext *ac, * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_cpe(AACContext *ac, GetBitContext *gb, ChannelElement *cpe) +static int decode_cpe(AACDecContext *ac, GetBitContext *gb, ChannelElement *cpe) { int i, ret, common_window, ms_present = 0; int eld_syntax = ac->oc[1].m4ac.object_type == AOT_ER_AAC_ELD; @@ -2238,7 +2240,7 @@ static const float cce_scale[] = { * * @return Returns error status. 0 - OK, !0 - error */ -static int decode_cce(AACContext *ac, GetBitContext *gb, ChannelElement *che) +static int decode_cce(AACDecContext *ac, GetBitContext *gb, ChannelElement *che) { int num_gain = 0; int c, g, sfb, ret; @@ -2388,7 +2390,7 @@ static int decode_dynamic_range(DynamicRangeControl *che_drc, return n; } -static int decode_fill(AACContext *ac, GetBitContext *gb, int len) { +static int decode_fill(AACDecContext *ac, GetBitContext *gb, int len) { uint8_t buf[256]; int i, major, minor; @@ -2421,7 +2423,7 @@ unknown: * * @return Returns number of bytes consumed */ -static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt, +static int decode_extension_payload(AACDecContext *ac, GetBitContext *gb, int cnt, ChannelElement *che, enum RawDataBlockType elem_type) { int crc_flag = 0; @@ -2551,7 +2553,7 @@ static void apply_tns(INTFLOAT coef_param[1024], TemporalNoiseShaping *tns, * Apply windowing and MDCT to obtain the spectral * coefficient from the predicted sample by LTP. */ -static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, +static void windowing_and_mdct_ltp(AACDecContext *ac, INTFLOAT *out, INTFLOAT *in, IndividualChannelStream *ics) { const INTFLOAT *lwindow = ics->use_kb_window[0] ? AAC_RENAME2(aac_kbd_long_1024) : AAC_RENAME2(sine_1024); @@ -2577,7 +2579,7 @@ static void windowing_and_mdct_ltp(AACContext *ac, INTFLOAT *out, /** * Apply the long term prediction */ -static void apply_ltp(AACContext *ac, SingleChannelElement *sce) +static void apply_ltp(AACDecContext *ac, SingleChannelElement *sce) { const LongTermPrediction *ltp = &sce->ics.ltp; const uint16_t *offsets = sce->ics.swb_offset; @@ -2609,7 +2611,7 @@ static void apply_ltp(AACContext *ac, SingleChannelElement *sce) /** * Update the LTP buffer for next frame */ -static void update_ltp(AACContext *ac, SingleChannelElement *sce) +static void update_ltp(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; INTFLOAT *saved = sce->saved; @@ -2647,7 +2649,7 @@ static void update_ltp(AACContext *ac, SingleChannelElement *sce) /** * Conduct IMDCT and windowing. */ -static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) +static void imdct_and_windowing(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; INTFLOAT *in = sce->coeffs; @@ -2711,7 +2713,7 @@ static void imdct_and_windowing(AACContext *ac, SingleChannelElement *sce) /** * Conduct IMDCT and windowing. */ -static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) +static void imdct_and_windowing_960(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; INTFLOAT *in = sce->coeffs; @@ -2772,7 +2774,7 @@ static void imdct_and_windowing_960(AACContext *ac, SingleChannelElement *sce) memcpy( saved, buf + 480, 480 * sizeof(*saved)); } } -static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) +static void imdct_and_windowing_ld(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; INTFLOAT *in = sce->coeffs; @@ -2797,7 +2799,7 @@ static void imdct_and_windowing_ld(AACContext *ac, SingleChannelElement *sce) memcpy(saved, buf + 256, 256 * sizeof(*saved)); } -static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) +static void imdct_and_windowing_eld(AACDecContext *ac, SingleChannelElement *sce) { UINTFLOAT *in = sce->coeffs; INTFLOAT *out = sce->ret; @@ -2865,10 +2867,10 @@ static void imdct_and_windowing_eld(AACContext *ac, SingleChannelElement *sce) * * @param apply_coupling_method pointer to (in)dependent coupling function */ -static void apply_channel_coupling(AACContext *ac, ChannelElement *cc, +static void apply_channel_coupling(AACDecContext *ac, ChannelElement *cc, enum RawDataBlockType type, int elem_id, enum CouplingPoint coupling_point, - void (*apply_coupling_method)(AACContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)) + void (*apply_coupling_method)(AACDecContext *ac, SingleChannelElement *target, ChannelElement *cce, int index)) { int i, c; @@ -2898,10 +2900,10 @@ static void apply_channel_coupling(AACContext *ac, ChannelElement *cc, /** * Convert spectral data to samples, applying all supported tools as appropriate. */ -static void spectral_to_sample(AACContext *ac, int samples) +static void spectral_to_sample(AACDecContext *ac, int samples) { int i, type; - void (*imdct_and_window)(AACContext *ac, SingleChannelElement *sce); + void (*imdct_and_window)(AACDecContext *ac, SingleChannelElement *sce); switch (ac->oc[1].m4ac.object_type) { case AOT_ER_AAC_LD: imdct_and_window = imdct_and_windowing_ld; @@ -2970,7 +2972,7 @@ static void spectral_to_sample(AACContext *ac, int samples) } } -static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb) +static int parse_adts_frame_header(AACDecContext *ac, GetBitContext *gb) { int size; AACADTSHeaderInfo hdr_info; @@ -3035,7 +3037,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb) static int aac_decode_er_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, GetBitContext *gb) { - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; const MPEG4AudioConfig *const m4ac = &ac->oc[1].m4ac; ChannelElement *che; int err, i; @@ -3108,7 +3110,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, GetBitContext *gb, const AVPacket *avpkt) { - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; ChannelElement *che = NULL, *che_prev = NULL; enum RawDataBlockType elem_type, che_prev_type = TYPE_END; int err, elem_id; @@ -3317,7 +3319,7 @@ fail: static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; GetBitContext gb; @@ -3379,7 +3381,7 @@ static int aac_decode_frame(AVCodecContext *avctx, AVFrame *frame, static av_cold int aac_decode_close(AVCodecContext *avctx) { - AACContext *ac = avctx->priv_data; + AACDecContext *ac = avctx->priv_data; int i, type; for (i = 0; i < MAX_ELEM_ID; i++) { @@ -3402,7 +3404,7 @@ static av_cold int aac_decode_close(AVCodecContext *avctx) return 0; } -static void aacdec_init(AACContext *c) +static void aacdec_init(AACDecContext *c) { c->imdct_and_windowing = imdct_and_windowing; c->apply_ltp = apply_ltp; @@ -3424,9 +3426,10 @@ static void aacdec_init(AACContext *c) * AVOptions for Japanese DTV specific extensions (ADTS only) */ #define AACDEC_FLAGS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM +#define OFF(field) offsetof(AACDecContext, field) static const AVOption options[] = { {"dual_mono_mode", "Select the channel to decode for dual mono", - offsetof(AACContext, force_dmono_mode), AV_OPT_TYPE_INT, {.i64=-1}, -1, 2, + OFF(force_dmono_mode), AV_OPT_TYPE_INT, {.i64=-1}, -1, 2, AACDEC_FLAGS, .unit = "dual_mono_mode"}, {"auto", "autoselection", 0, AV_OPT_TYPE_CONST, {.i64=-1}, INT_MIN, INT_MAX, AACDEC_FLAGS, .unit = "dual_mono_mode"}, @@ -3435,7 +3438,7 @@ static const AVOption options[] = { {"both", "Select both channels", 0, AV_OPT_TYPE_CONST, {.i64= 0}, INT_MIN, INT_MAX, AACDEC_FLAGS, .unit = "dual_mono_mode"}, { "channel_order", "Order in which the channels are to be exported", - offsetof(AACContext, output_channel_order), AV_OPT_TYPE_INT, + OFF(output_channel_order), AV_OPT_TYPE_INT, { .i64 = CHANNEL_ORDER_DEFAULT }, 0, 1, AACDEC_FLAGS, .unit = "channel_order" }, { "default", "normal libavcodec channel order", 0, AV_OPT_TYPE_CONST, { .i64 = CHANNEL_ORDER_DEFAULT }, .flags = AACDEC_FLAGS, .unit = "channel_order" }, diff --git a/libavcodec/aacsbr.h b/libavcodec/aacsbr.h index 3a19fe1c7e..ad4935d734 100644 --- a/libavcodec/aacsbr.h +++ b/libavcodec/aacsbr.h @@ -69,14 +69,14 @@ enum { /** Initialize SBR. */ void AAC_RENAME(ff_aac_sbr_init)(void); /** Initialize one SBR context. */ -int AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac); +int AAC_RENAME(ff_aac_sbr_ctx_init)(struct AACDecContext *ac, SpectralBandReplication *sbr, int id_aac); /** Close one SBR context. */ void AAC_RENAME(ff_aac_sbr_ctx_close)(SpectralBandReplication *sbr); /** Decode one SBR element. */ -int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, SpectralBandReplication *sbr, +int AAC_RENAME(ff_decode_sbr_extension)(struct AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, int crc, int cnt, int id_aac); /** Apply one SBR element to one AAC element. */ -void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int id_aac, +void AAC_RENAME(ff_sbr_apply)(struct AACDecContext *ac, SpectralBandReplication *sbr, int id_aac, INTFLOAT* L, INTFLOAT *R); void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c); diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index e0725b6363..ce3834e2dc 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -64,7 +64,7 @@ static void sbr_turnoff(SpectralBandReplication *sbr) { memset(&sbr->spectrum_params, -1, sizeof(SpectrumParameters)); } -av_cold int AAC_RENAME(ff_aac_sbr_ctx_init)(AACContext *ac, SpectralBandReplication *sbr, int id_aac) +av_cold int AAC_RENAME(ff_aac_sbr_ctx_init)(AACDecContext *ac, SpectralBandReplication *sbr, int id_aac) { int ret; float scale; @@ -254,7 +254,7 @@ static int check_n_master(AVCodecContext *avctx, int n_master, int bs_xover_band } /// Master Frequency Band Table (14496-3 sp04 p194) -static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, +static int sbr_make_f_master(AACDecContext *ac, SpectralBandReplication *sbr, SpectrumParameters *spectrum) { unsigned int temp, max_qmf_subbands = 0; @@ -474,7 +474,7 @@ static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, } /// High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46) -static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr) +static int sbr_hf_calc_npatches(AACDecContext *ac, SpectralBandReplication *sbr) { int i, k, last_k = -1, last_msb = -1, sb = 0; int msb = sbr->k[0]; @@ -532,7 +532,7 @@ static int sbr_hf_calc_npatches(AACContext *ac, SpectralBandReplication *sbr) } /// Derived Frequency Band Tables (14496-3 sp04 p197) -static int sbr_make_f_derived(AACContext *ac, SpectralBandReplication *sbr) +static int sbr_make_f_derived(AACDecContext *ac, SpectralBandReplication *sbr) { int k, temp; #if USE_FIXED @@ -617,7 +617,7 @@ static const int8_t ceil_log2[] = { 0, 1, 2, 2, 3, 3, }; -static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr, +static int read_sbr_grid(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data) { int i; @@ -800,7 +800,7 @@ static void read_sbr_invf(SpectralBandReplication *sbr, GetBitContext *gb, ch_data->bs_invf_mode[0][i] = get_bits(gb, 2); } -static int read_sbr_envelope(AACContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, +static int read_sbr_envelope(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) { int bits; @@ -880,7 +880,7 @@ static int read_sbr_envelope(AACContext *ac, SpectralBandReplication *sbr, GetBi return 0; } -static int read_sbr_noise(AACContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, +static int read_sbr_noise(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) { int i, j; @@ -922,7 +922,7 @@ static int read_sbr_noise(AACContext *ac, SpectralBandReplication *sbr, GetBitCo return 0; } -static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, +static void read_sbr_extension(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, int bs_extension_id, int *num_bits_left) { @@ -949,7 +949,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, } } -static int read_sbr_single_channel_element(AACContext *ac, +static int read_sbr_single_channel_element(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb) { @@ -973,7 +973,7 @@ static int read_sbr_single_channel_element(AACContext *ac, return 0; } -static int read_sbr_channel_pair_element(AACContext *ac, +static int read_sbr_channel_pair_element(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb) { @@ -1025,7 +1025,7 @@ static int read_sbr_channel_pair_element(AACContext *ac, return 0; } -static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr, +static unsigned int read_sbr_data(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, int id_aac) { unsigned int cnt = get_bits_count(gb); @@ -1069,7 +1069,7 @@ static unsigned int read_sbr_data(AACContext *ac, SpectralBandReplication *sbr, return get_bits_count(gb) - cnt; } -static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr) +static void sbr_reset(AACDecContext *ac, SpectralBandReplication *sbr) { int err; err = sbr_make_f_master(ac, sbr, &sbr->spectrum_params); @@ -1090,7 +1090,7 @@ static void sbr_reset(AACContext *ac, SpectralBandReplication *sbr) * * @return Returns number of bytes consumed from the TYPE_FIL element. */ -int AAC_RENAME(ff_decode_sbr_extension)(AACContext *ac, SpectralBandReplication *sbr, +int AAC_RENAME(ff_decode_sbr_extension)(AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb_host, int crc, int cnt, int id_aac) { unsigned int num_sbr_bits = 0, num_align_bits; @@ -1243,7 +1243,7 @@ static void sbr_qmf_synthesis(AVTXContext *mdct, av_tx_fn mdct_fn, #endif /// Generate the subband filtered lowband -static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr, +static int sbr_lf_gen(AACDecContext *ac, SpectralBandReplication *sbr, INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2], int buf_idx) { @@ -1268,7 +1268,7 @@ static int sbr_lf_gen(AACContext *ac, SpectralBandReplication *sbr, } /// High Frequency Generator (14496-3 sp04 p215) -static int sbr_hf_gen(AACContext *ac, SpectralBandReplication *sbr, +static int sbr_hf_gen(AACDecContext *ac, SpectralBandReplication *sbr, INTFLOAT X_high[64][40][2], const INTFLOAT X_low[32][40][2], const INTFLOAT (*alpha0)[2], const INTFLOAT (*alpha1)[2], const INTFLOAT bw_array[5], const uint8_t *t_env, @@ -1342,7 +1342,7 @@ static int sbr_x_gen(SpectralBandReplication *sbr, INTFLOAT X[2][38][64], /** High Frequency Adjustment (14496-3 sp04 p217) and Mapping * (14496-3 sp04 p217) */ -static int sbr_mapping(AACContext *ac, SpectralBandReplication *sbr, +static int sbr_mapping(AACDecContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, int e_a[2]) { int e, i, m; @@ -1456,7 +1456,7 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2] } } -void AAC_RENAME(ff_sbr_apply)(AACContext *ac, SpectralBandReplication *sbr, int id_aac, +void AAC_RENAME(ff_sbr_apply)(AACDecContext *ac, SpectralBandReplication *sbr, int id_aac, INTFLOAT* L, INTFLOAT* R) { int downsampled = ac->oc[1].m4ac.ext_sample_rate < sbr->sample_rate; diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c index f4b0767e3b..456e270915 100644 --- a/libavcodec/mips/aacdec_mips.c +++ b/libavcodec/mips/aacdec_mips.c @@ -112,7 +112,7 @@ static av_always_inline int lcg_random(unsigned previous_val) return v.s; } -static void imdct_and_windowing_mips(AACContext *ac, SingleChannelElement *sce) +static void imdct_and_windowing_mips(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; float *in = sce->coeffs; @@ -224,7 +224,7 @@ static void imdct_and_windowing_mips(AACContext *ac, SingleChannelElement *sce) } } -static void apply_ltp_mips(AACContext *ac, SingleChannelElement *sce) +static void apply_ltp_mips(AACDecContext *ac, SingleChannelElement *sce) { const LongTermPrediction *ltp = &sce->ics.ltp; const uint16_t *offsets = sce->ics.swb_offset; @@ -334,7 +334,7 @@ static av_always_inline void fmul_and_reverse(float *dst, const float *src0, con } } -static void update_ltp_mips(AACContext *ac, SingleChannelElement *sce) +static void update_ltp_mips(AACDecContext *ac, SingleChannelElement *sce) { IndividualChannelStream *ics = &sce->ics; float *saved = sce->saved; @@ -431,7 +431,7 @@ static void update_ltp_mips(AACContext *ac, SingleChannelElement *sce) #endif /* HAVE_MIPSFPU */ #endif /* HAVE_INLINE_ASM */ -void ff_aacdec_init_mips(AACContext *c) +void ff_aacdec_init_mips(AACDecContext *c) { #if HAVE_INLINE_ASM #if HAVE_MIPSFPU diff --git a/libavcodec/mips/aacsbr_mips.c b/libavcodec/mips/aacsbr_mips.c index 546e528895..0dc09130b7 100644 --- a/libavcodec/mips/aacsbr_mips.c +++ b/libavcodec/mips/aacsbr_mips.c @@ -60,7 +60,7 @@ #if HAVE_INLINE_ASM #if HAVE_MIPSFPU -static int sbr_lf_gen_mips(AACContext *ac, SpectralBandReplication *sbr, +static int sbr_lf_gen_mips(AACDecContext *ac, SpectralBandReplication *sbr, float X_low[32][40][2], const float W[2][32][32][2], int buf_idx) { diff --git a/libavcodec/sbr.h b/libavcodec/sbr.h index f949465ef5..46c68615c8 100644 --- a/libavcodec/sbr.h +++ b/libavcodec/sbr.h @@ -37,7 +37,7 @@ #include "aacps.h" #include "sbrdsp.h" -typedef struct AACContext AACContext; +struct AACDecContext; /** * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header. @@ -121,7 +121,7 @@ typedef struct SpectralBandReplication SpectralBandReplication; * aacsbr functions pointers */ typedef struct AACSBRContext { - int (*sbr_lf_gen)(AACContext *ac, SpectralBandReplication *sbr, + int (*sbr_lf_gen)(struct AACDecContext *ac, SpectralBandReplication *sbr, INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2], int buf_idx); void (*sbr_hf_assemble)(INTFLOAT Y1[38][64][2],