From patchwork Mon Feb 26 01:26:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46539 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:c51b:b0:19e:cdac:8cce with SMTP id gm27csp1115630pzb; Sun, 25 Feb 2024 17:41:02 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUNiLmltDWsXENEVNi9Jp589iec1npdfYSnXZ/EOMXFCOkeoeZKUI9UsBCkU46qTjVo1H3YCsrM1nah1aO6QmqUpRjkwbzC9c12NA== X-Google-Smtp-Source: AGHT+IEglS6WZn+NRafsWz+Ualt8IbqLSdRHppEoj5jYjPAqYklcybbJCbd3vxN10kMfDrvuKoV/ X-Received: by 2002:a05:6402:556:b0:565:cbba:b7a1 with SMTP id i22-20020a056402055600b00565cbbab7a1mr1702079edx.1.1708911662746; Sun, 25 Feb 2024 17:41:02 -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 c71-20020a509fcd000000b00563f58848e3si1609552edf.125.2024.02.25.17.41.02; Sun, 25 Feb 2024 17:41:02 -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=Yd22BJu8; 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 1E45868C719; Mon, 26 Feb 2024 03:40:49 +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 16F3568C7E9 for ; Mon, 26 Feb 2024 03:40:43 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kvgWLqpNnANV+Bk8gkfL5vnEb0vs8fMTWtJifb6ynC1bEt+CptlLDaSVZj4pxiToWdyoZmi9CX4HEq3AJv710qvv6DKgKuL+zSzsnf3RLDC1hVzYWVVLOYWk3yKFQmPg4sCVeEjb2xpK3UfewQV5YMsSEDZqQieP6Oak6k+LiUHFEOTm6WmLxHm7LJpXT82azfJ5fb+WGu+mgHGqyQ6awsbxXJVv01+ckm3ax9QsTgKgWM+Sp5iz+fl/2ByD6zd7wcJIwngGGEf7c2yN/zUof8qqBLT9pQXCmBQ8qft8QlRtyg/UdsfoTpGBmoDUDVoG8bXPKQQTXfA412OTq725vQ== 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=hm25EcAbPSKNwTk0PN9THssTptIH22kuQEaPKFVw2Go=; b=fPCFASam5Rp6uAMCwBper+Vk50fe1E0/HHYn9wa6T8xuemOWJpUtO9NBt2LLRxHUEgcQ1V0b7VtBQew7jBLgIPXIrv08+yTTe6k5N1Gh7+/GELWlm594EOY1qLR2BUQ8YgVwEZ6/b3UuNy1OVg8KIEzde/vwOy+pUECeKrOWgCxO7Z6mzsjwWeI1unuZVZcdhZgyPGLvgDlmlwnziAK/izvJmwxp7ZFe2ObKiIgw/nV1AFuQscUhn0VZOiocJgSjyyzkuisL1+tYFvA/U3Wleq/wAvFZH84jujwZ6KYCWyeAvLupx5dZD/6jEh/BmT9vpNRab+CRQwg5VR/UB2cEGQ== 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=hm25EcAbPSKNwTk0PN9THssTptIH22kuQEaPKFVw2Go=; b=Yd22BJu87T4JTSYHBmRgFFzlaZbvexiKKENIQMEcEz3/oBWWg1Z78bQh5Tt8VYW6fZ2yDP7tiYcJOq8UPb0jTeGDH3UgH4cZZ7lT889vP0xYgphF6/HGB1Bu2pEm2UWLyJH6VHSyxb995Rj/lDKw071X73f4ISmTnEWdlFurO4/lO+bMuc+L6pHu7orIcI7u6WvLa5acRaPTVNGQW4d5YD8fVyBzoQhK/B3OrhqkCm4oqtZsCooRil7Bxt5LuCvRhyDy34aEP2LuoqKWMRZFB1C08KhB6Tsuw3UaTjTMFPmfAqXEYdXoITPbeDxM2bV6mcpPqAuKt6xdQUCvpipdnw== 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:04 +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:04 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 26 Feb 2024 02:26:50 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [mPXjxV3H+uGKDSpKCTY1aZ39BgqycSCqx9y6XPulBbc=] 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-1-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: fbb9b0b9-8221-4083-a63c-08dc3669c23e X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /1RhXEYQAVaKTXg75oz7xznWeACf8Reh8fQ32fbQySlu11msJ4jHhOIDS9aor1XwF7lNhQx6fN7SWpsSOYZ1gGcYXgi0EyiFn2GHgdwWd8XEDX9BPAuBKXzM/b3I8xVDes+8Uxa2iT/KNay0owATPRK/mRfXeCeAVDqBrLN0ed0IZCi6Y+G1CPX5GvlDU2iAK0fo+rRofhXr4ZtE96rxoVxise9wPBBAqVIA3IBSm1fanvdpSV7pEztFST29l3frU3hOp8T7PzCTkXihvALW9AsEFHaIKpU29vl24qn9B9qfqHcfx15+MO5JxTdNJ311v62HWXq3BC+SHD6PSdyaOkeNWHm0gTL7hvlIk5yVSiklhLc6fxjUYJfssdnyscKsPVe89fTAbj7aBFbw5HlKHlcl6l2O8MAx2M+IY6blzFKFRV5DoLa30M7+KDIigVfBbSBABUiaE0lRXwzey/h4/jShqel9YdLRqV4RRRf2v09B9ffVuc6xiGrSJBqfcDmQsVjtPn3MzPfwP9TE7JwdCc5SPK/jodcz3tBeIrGLYReBBsea/bn++nQZdmMMTL6NWEakOTk8ZQPZWRbyrGhemBQfqnBp8E/wXFkFhyER5Rv6NEZV3mU7cMS012jhiuTEcwLSD+vuGimHlJLnlgCfMwCcSnYCMo5qswMZlk6yBBBKIMRA1uLi7INxTAC120Bi65neP2Z3Trr7vnx8jQyCUg== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8jcAoDADaZMzg138NFBAhiQB8RQU1MANEjcghCWTtciQnMdlQPnC3L/tJTqiovGhc+BzKC35zXKX4fvo7VezaNL7Y/o+/SdT6oPj422qcep0n8t5Nx9dCdSPfi8ZwdodVSgklequjH66Sc+AS5Psh8qoEWnQeKopF0z54bSk5lyei3VYNSBAc6+GbonHoa+T/T3hvQN9kERjmvzm+wHUodaIHb/wh+2ANTuwOPYh2tcqB5uLJ1UhCI8R58rTDltFm050l9bCvS5LuDqGSVt8wVDKgdbHQpBM2c/u8n8MnHmj6yoOwQbxEtyvq4BzV+MpMmEAU0BkJifVeCMpXiQ7lF2bWgtq4vfVK2x8jMHSqQ9oZV713rHJFNgDADwo48JhFYmBJyjtDe7fCZljywXwpr1H2z5fHGgnKtExA9S5HT3Dysnv9PsDJif5PteSs/X5QDx/6v82EARBfQQrPFDjGUOvCchERoJjsLDVfWMSJsAv2+FtLO/XVkVkBg13uEtuZuFrT1BliIbjonfHfZyAKrwgoz3zTJ5fQLCf0tN59cd4uck9+fH8KPtXJEE/Cx+h67m2UIN4x1wG3TaMwsUiwriU5nSlDZ8bG/1j6B9/YeXveuFd2Pxr/yclpbXAQ2HslcK5fGXRA5iDLDKgsiq1OFrLryAGqLxVNidrf0+7znFckku38KYlJZduhYKt8NSag8buiciIcdJ5LIL2fYR+ihK0XoeLIjahfiYTqaDQ6Xtr968m1wMyQsyV7tIeYevSvDaJU+UAKebjjeGwgpRjDPPFHtG5EHlZU2UzjF7cgebpwRyDPqC0dpqje1+JpvSRYzoKdPtQms/+9ftpXOadoKGZvQ73V6oOrWk0PbplLZPtiQoeldNbl3tt+Ll1IuPUAd94atq3RVD/ZNKXr5rIc7vBOcvQZmz36F8EfXEHiMtgjl5AlEbBWI08vqsM3IO88j6Szq5jz5I/fgpte1pBPrf1/DdY7qkuSyaEJW1R0+klK2OszE8HW0KN8Nvj5Q6y8qtu1/wesUBcVCM9aCLmYmNK+0RdjqtaTW8Wav1eAaScNpCiw24qQQ8wo7UrBvd2UVsUHi8Y2nPE09SZyiKZ88ok9DHHOr3HjqmW/OuSpvSR/zHsysGJMglQypq6gt9/0u212uVzUKOMuYueC1A+IZA/dOSby4uBci8Mk09FVKVK8HLWJj9aFXr00AQUYPuSpJF+jr14Vw58WotMRbpsz0pfBcOZ7u7IeTG860v4c7C/fXL2NE3io8c0u5fNtYoIWdtKM3ZO/usXQY9qDE3aQQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbb9b0b9-8221-4083-a63c-08dc3669c23e 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:03.9751 (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 2/8] avocdec/aac: Move decoder-only stuff to new header aacdec.h 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: IutBmEgfPq0G AACContext is not used by the encoder at all. Signed-off-by: Andreas Rheinhardt --- libavcodec/aac.h | 143 --------------------------- libavcodec/aacdec.c | 1 + libavcodec/aacdec.h | 179 ++++++++++++++++++++++++++++++++++ libavcodec/aacdec_fixed.c | 1 + libavcodec/aacsbr_template.c | 2 + libavcodec/mips/aacdec_mips.c | 2 +- libavcodec/mips/aacdec_mips.h | 2 +- libavcodec/mips/aacsbr_mips.c | 2 +- libavcodec/mips/aacsbr_mips.h | 2 +- 9 files changed, 187 insertions(+), 147 deletions(-) create mode 100644 libavcodec/aacdec.h diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 285d3b7482..da683b0071 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -33,12 +33,7 @@ #include "aac_defines.h" #include "libavutil/channel_layout.h" -#include "libavutil/float_dsp.h" -#include "libavutil/fixed_dsp.h" #include "libavutil/mem_internal.h" -#include "libavutil/tx.h" -#include "avcodec.h" -#include "mpeg4audio.h" #include "sbr.h" #include @@ -108,25 +103,6 @@ enum CouplingPoint { AFTER_IMDCT = 3, }; -/** - * Output configuration status - */ -enum OCStatus { - OC_NONE, ///< Output unconfigured - OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE - OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header - OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked - OC_LOCKED, ///< Output configuration locked in place -}; - -typedef struct OutputConfiguration { - MPEG4AudioConfig m4ac; - uint8_t layout_map[MAX_ELEM_ID*4][3]; - int layout_map_tags; - AVChannelLayout ch_layout; - enum OCStatus status; -} OutputConfiguration; - /** * Predictor State */ @@ -203,22 +179,6 @@ typedef struct TemporalNoiseShaping { INTFLOAT coef[8][4][TNS_MAX_ORDER]; } TemporalNoiseShaping; -/** - * Dynamic Range Control - decoded from the bitstream but not processed further. - */ -typedef struct DynamicRangeControl { - int pce_instance_tag; ///< Indicates with which program the DRC info is associated. - int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative - int dyn_rng_ctl[17]; ///< DRC magnitude information - int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing. - int band_incr; ///< Number of DRC bands greater than 1 having DRC info. - int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain. - int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines. - int prog_ref_level; /**< A reference level for the long-term program audio level for all - * channels combined. - */ -} DynamicRangeControl; - typedef struct Pulse { int num_pulse; int start; @@ -285,107 +245,4 @@ typedef struct ChannelElement { SpectralBandReplication sbr; } ChannelElement; -enum AACOutputChannelOrder { - CHANNEL_ORDER_DEFAULT, - CHANNEL_ORDER_CODED, -}; - -/** - * main AAC context - */ -struct AACContext { - AVClass *class; - AVCodecContext *avctx; - AVFrame *frame; - - int is_saved; ///< Set if elements have stored overlap from previous frame. - DynamicRangeControl che_drc; - - /** - * @name Channel element related data - * @{ - */ - ChannelElement *che[4][MAX_ELEM_ID]; - ChannelElement *tag_che_map[4][MAX_ELEM_ID]; - int tags_mapped; - int warned_remapping_once; - /** @} */ - - /** - * @name temporary aligned temporary buffers - * (We do not want to have these on the stack.) - * @{ - */ - DECLARE_ALIGNED(32, INTFLOAT, buf_mdct)[1024]; - /** @} */ - - /** - * @name Computed / set up during initialization - * @{ - */ - AVTXContext *mdct120; - AVTXContext *mdct128; - AVTXContext *mdct480; - AVTXContext *mdct512; - AVTXContext *mdct960; - AVTXContext *mdct1024; - AVTXContext *mdct_ltp; - - av_tx_fn mdct120_fn; - av_tx_fn mdct128_fn; - av_tx_fn mdct480_fn; - av_tx_fn mdct512_fn; - av_tx_fn mdct960_fn; - av_tx_fn mdct1024_fn; - av_tx_fn mdct_ltp_fn; -#if USE_FIXED - AVFixedDSPContext *fdsp; -#else - AVFloatDSPContext *fdsp; -#endif /* USE_FIXED */ - int random_state; - /** @} */ - - /** - * @name Members used for output - * @{ - */ - SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement - /** @} */ - - - /** - * @name Japanese DTV specific extension - * @{ - */ - int force_dmono_mode;///< 0->not dmono, 1->use first channel, 2->use second channel - int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel - /** @} */ - - enum AACOutputChannelOrder output_channel_order; - - DECLARE_ALIGNED(32, INTFLOAT, temp)[128]; - - OutputConfiguration oc[2]; - int warned_num_aac_frames; - int warned_960_sbr; - unsigned warned_71_wide; - int warned_gain_control; - int warned_he_aac_mono; - - /* aacdec functions pointers */ - void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce); - void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce); - void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns, - IndividualChannelStream *ics, int decode); - void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out, - INTFLOAT *in, IndividualChannelStream *ics); - void (*update_ltp)(AACContext *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); - -}; - -void ff_aacdec_init_mips(AACContext *c); - #endif /* AVCODEC_AAC_H */ diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index d66ebf4a7c..962b1705c6 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -45,6 +45,7 @@ #include "sinewin.h" #include "aac.h" +#include "aacdec.h" #include "aactab.h" #include "aacdectab.h" #include "adts_header.h" diff --git a/libavcodec/aacdec.h b/libavcodec/aacdec.h new file mode 100644 index 0000000000..c4ac63e2fb --- /dev/null +++ b/libavcodec/aacdec.h @@ -0,0 +1,179 @@ +/* + * AAC decoder definitions and structures + * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) + * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * AAC decoder definitions and structures + * @author Oded Shimon ( ods15 ods15 dyndns org ) + * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) + */ + +#ifndef AVCODEC_AACDEC_H +#define AVCODEC_AACDEC_H + +#include "libavutil/float_dsp.h" +#include "libavutil/fixed_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "aac.h" +#include "mpeg4audio.h" + +/** + * Output configuration status + */ +enum OCStatus { + OC_NONE, ///< Output unconfigured + OC_TRIAL_PCE, ///< Output configuration under trial specified by an inband PCE + OC_TRIAL_FRAME, ///< Output configuration under trial specified by a frame header + OC_GLOBAL_HDR, ///< Output configuration set in a global header but not yet locked + OC_LOCKED, ///< Output configuration locked in place +}; + +enum AACOutputChannelOrder { + CHANNEL_ORDER_DEFAULT, + CHANNEL_ORDER_CODED, +}; + +typedef struct OutputConfiguration { + MPEG4AudioConfig m4ac; + uint8_t layout_map[MAX_ELEM_ID*4][3]; + int layout_map_tags; + AVChannelLayout ch_layout; + enum OCStatus status; +} OutputConfiguration; + +/** + * Dynamic Range Control - decoded from the bitstream but not processed further. + */ +typedef struct DynamicRangeControl { + int pce_instance_tag; ///< Indicates with which program the DRC info is associated. + int dyn_rng_sgn[17]; ///< DRC sign information; 0 - positive, 1 - negative + int dyn_rng_ctl[17]; ///< DRC magnitude information + int exclude_mask[MAX_CHANNELS]; ///< Channels to be excluded from DRC processing. + int band_incr; ///< Number of DRC bands greater than 1 having DRC info. + int interpolation_scheme; ///< Indicates the interpolation scheme used in the SBR QMF domain. + int band_top[17]; ///< Indicates the top of the i-th DRC band in units of 4 spectral lines. + int prog_ref_level; /**< A reference level for the long-term program audio level for all + * channels combined. + */ +} DynamicRangeControl; + +/** + * main AAC decoding context + */ +struct AACContext { + const struct AVClass *class; + struct AVCodecContext *avctx; + struct AVFrame *frame; + + int is_saved; ///< Set if elements have stored overlap from previous frame. + DynamicRangeControl che_drc; + + /** + * @name Channel element related data + * @{ + */ + ChannelElement *che[4][MAX_ELEM_ID]; + ChannelElement *tag_che_map[4][MAX_ELEM_ID]; + int tags_mapped; + int warned_remapping_once; + /** @} */ + + /** + * @name temporary aligned temporary buffers + * (We do not want to have these on the stack.) + * @{ + */ + DECLARE_ALIGNED(32, INTFLOAT, buf_mdct)[1024]; + /** @} */ + + /** + * @name Computed / set up during initialization + * @{ + */ + AVTXContext *mdct120; + AVTXContext *mdct128; + AVTXContext *mdct480; + AVTXContext *mdct512; + AVTXContext *mdct960; + AVTXContext *mdct1024; + AVTXContext *mdct_ltp; + + av_tx_fn mdct120_fn; + av_tx_fn mdct128_fn; + av_tx_fn mdct480_fn; + av_tx_fn mdct512_fn; + av_tx_fn mdct960_fn; + av_tx_fn mdct1024_fn; + av_tx_fn mdct_ltp_fn; +#if USE_FIXED + AVFixedDSPContext *fdsp; +#else + AVFloatDSPContext *fdsp; +#endif /* USE_FIXED */ + int random_state; + /** @} */ + + /** + * @name Members used for output + * @{ + */ + SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement + /** @} */ + + + /** + * @name Japanese DTV specific extension + * @{ + */ + int force_dmono_mode;///< 0->not dmono, 1->use first channel, 2->use second channel + int dmono_mode; ///< 0->not dmono, 1->use first channel, 2->use second channel + /** @} */ + + enum AACOutputChannelOrder output_channel_order; + + DECLARE_ALIGNED(32, INTFLOAT, temp)[128]; + + OutputConfiguration oc[2]; + int warned_num_aac_frames; + int warned_960_sbr; + unsigned warned_71_wide; + int warned_gain_control; + int warned_he_aac_mono; + + /* aacdec functions pointers */ + void (*imdct_and_windowing)(AACContext *ac, SingleChannelElement *sce); + void (*apply_ltp)(AACContext *ac, SingleChannelElement *sce); + void (*apply_tns)(INTFLOAT coef[1024], TemporalNoiseShaping *tns, + IndividualChannelStream *ics, int decode); + void (*windowing_and_mdct_ltp)(AACContext *ac, INTFLOAT *out, + INTFLOAT *in, IndividualChannelStream *ics); + void (*update_ltp)(AACContext *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); + +}; + +void ff_aacdec_init_mips(AACContext *c); + +#endif /* AVCODEC_AACDEC_H */ diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 2b8ac67659..19662cb7e6 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -71,6 +71,7 @@ #include "sinewin_fixed_tablegen.h" #include "aac.h" +#include "aacdec.h" #include "aactab.h" #include "aacdectab.h" #include "adts_header.h" diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index 98e9fd8fed..ba8e3495b4 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -32,7 +32,9 @@ * @author Zoran Basaric ( zoran.basaric@imgtec.com ) */ +#include "aacdec.h" #include "aacdectab.h" +#include "avcodec.h" #include "libavutil/qsort.h" static av_cold void aacsbr_tableinit(void) diff --git a/libavcodec/mips/aacdec_mips.c b/libavcodec/mips/aacdec_mips.c index cd357cedbc..f4b0767e3b 100644 --- a/libavcodec/mips/aacdec_mips.c +++ b/libavcodec/mips/aacdec_mips.c @@ -53,7 +53,7 @@ */ #include "libavutil/attributes.h" -#include "libavcodec/aac.h" +#include "libavcodec/aacdec.h" #include "aacdec_mips.h" #include "libavcodec/aactab.h" #include "libavcodec/sinewin.h" diff --git a/libavcodec/mips/aacdec_mips.h b/libavcodec/mips/aacdec_mips.h index 758266fc16..71581986dc 100644 --- a/libavcodec/mips/aacdec_mips.h +++ b/libavcodec/mips/aacdec_mips.h @@ -57,7 +57,7 @@ #ifndef AVCODEC_MIPS_AACDEC_MIPS_H #define AVCODEC_MIPS_AACDEC_MIPS_H -#include "libavcodec/aac.h" +#include "libavcodec/aacdec.h" #include "libavutil/mips/asmdefs.h" #if HAVE_INLINE_ASM && HAVE_MIPSFPU diff --git a/libavcodec/mips/aacsbr_mips.c b/libavcodec/mips/aacsbr_mips.c index 33fd9b229e..546e528895 100644 --- a/libavcodec/mips/aacsbr_mips.c +++ b/libavcodec/mips/aacsbr_mips.c @@ -51,7 +51,7 @@ * Reference: libavcodec/aacsbr.c */ -#include "libavcodec/aac.h" +#include "libavcodec/aacdec.h" #include "libavcodec/aacsbr.h" #include "libavutil/mem_internal.h" #include "libavutil/mips/asmdefs.h" diff --git a/libavcodec/mips/aacsbr_mips.h b/libavcodec/mips/aacsbr_mips.h index 4750c94024..447393164a 100644 --- a/libavcodec/mips/aacsbr_mips.h +++ b/libavcodec/mips/aacsbr_mips.h @@ -54,7 +54,7 @@ #ifndef AVCODEC_MIPS_AACSBR_MIPS_H #define AVCODEC_MIPS_AACSBR_MIPS_H -#include "libavcodec/aac.h" +#include "libavcodec/aacdec.h" #include "libavcodec/sbr.h" #include "libavutil/mips/asmdefs.h"