From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 42/61] avcodec/aacdectab: Deduplicate common decoder tables Date: Wed, 27 Sep 2023 00:17:13 +0200 Message-ID: <GV1P250MB07372881F89CD7A7727A0F138FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <GV1P250MB073754E215A199E7219CC13A8FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/Makefile | 6 +- libavcodec/aacdec.c | 8 +-- libavcodec/aacdec_common.c | 119 +++++++++++++++++++++++++++++++++++ libavcodec/aacdec_fixed.c | 4 +- libavcodec/aacdec_template.c | 36 +++++------ libavcodec/aacdectab.h | 95 +++------------------------- 6 files changed, 154 insertions(+), 114 deletions(-) create mode 100644 libavcodec/aacdec_common.c diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 9e96892365..d4c21474ec 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -180,10 +180,12 @@ OBJS-$(CONFIG_WMV2DSP) += wmv2dsp.o OBJS-$(CONFIG_ZERO12V_DECODER) += 012v.o OBJS-$(CONFIG_A64MULTI_ENCODER) += a64multienc.o elbg.o OBJS-$(CONFIG_A64MULTI5_ENCODER) += a64multienc.o elbg.o -OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aactab.o aacsbr.o aacps_common.o aacps_float.o \ +OBJS-$(CONFIG_AAC_DECODER) += aacdec.o aacdec_common.o aactab.o \ + aacsbr.o aacps_common.o aacps_float.o \ kbdwin.o \ sbrdsp.o aacpsdsp_float.o cbrt_data.o -OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aactab.o aacsbr_fixed.o aacps_common.o aacps_fixed.o \ +OBJS-$(CONFIG_AAC_FIXED_DECODER) += aacdec_fixed.o aacdec_common.o aactab.o \ + aacsbr_fixed.o aacps_common.o aacps_fixed.o \ kbdwin.o \ sbrdsp_fixed.o aacpsdsp_fixed.o cbrt_data_fixed.o OBJS-$(CONFIG_AAC_ENCODER) += aacenc.o aaccoder.o aacenctab.o \ diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index ca31540d3c..d66ebf4a7c 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -564,8 +564,8 @@ const FFCodec ff_aac_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) - .p.ch_layouts = aac_ch_layout, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) + .p.ch_layouts = ff_aac_ch_layout, .flush = flush, .p.priv_class = &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), @@ -590,8 +590,8 @@ const FFCodec ff_aac_latm_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) - .p.ch_layouts = aac_ch_layout, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) + .p.ch_layouts = ff_aac_ch_layout, .flush = flush, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), }; diff --git a/libavcodec/aacdec_common.c b/libavcodec/aacdec_common.c new file mode 100644 index 0000000000..c75c6fadc6 --- /dev/null +++ b/libavcodec/aacdec_common.c @@ -0,0 +1,119 @@ +/* + * Common code and tables of the AAC fixed- and floating-point decoders + * 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 + * Common code and tables of the AAC fixed- and floating-point decoders + */ + +#include "aac.h" +#include "aacdectab.h" + +const int8_t ff_tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 5, 5, 16, 5, 0 }; + +const uint8_t ff_aac_channel_layout_map[16][16][3] = { + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, }, + { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, + { { 0, } }, + { { 0, } }, + { { 0, } }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, + { + { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC, + { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc, + { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR, + { TYPE_CPE, 2, AAC_CHANNEL_BACK }, // CPE3 = SiL and SiR, + { TYPE_CPE, 3, AAC_CHANNEL_BACK }, // CPE4 = BL and BR, + { TYPE_SCE, 1, AAC_CHANNEL_BACK }, // SCE2 = BC, + { TYPE_LFE, 0, AAC_CHANNEL_LFE }, // LFE1 = LFE1, + { TYPE_LFE, 1, AAC_CHANNEL_LFE }, // LFE2 = LFE2, + { TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC, + { TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR, + { TYPE_CPE, 5, AAC_CHANNEL_SIDE }, // CPE6 = TpSiL and TpSiR, + { TYPE_SCE, 3, AAC_CHANNEL_SIDE }, // SCE4 = TpC, + { TYPE_CPE, 6, AAC_CHANNEL_BACK }, // CPE7 = TpBL and TpBR, + { TYPE_SCE, 4, AAC_CHANNEL_BACK }, // SCE5 = TpBC, + { TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC, + { TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR + }, + { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, { TYPE_CPE, 2, AAC_CHANNEL_FRONT }, }, + { { 0, } }, +}; + +const int16_t ff_aac_channel_map[3][4][6] = { + { + { AV_CHAN_FRONT_CENTER, AV_CHAN_FRONT_LEFT_OF_CENTER, AV_CHAN_FRONT_RIGHT_OF_CENTER, AV_CHAN_FRONT_LEFT, AV_CHAN_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_SIDE_LEFT, AV_CHAN_SIDE_RIGHT, AV_CHAN_BACK_LEFT, AV_CHAN_BACK_RIGHT, AV_CHAN_BACK_CENTER }, + { AV_CHAN_LOW_FREQUENCY, AV_CHAN_LOW_FREQUENCY_2, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + }, + { + { AV_CHAN_TOP_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_FRONT_LEFT, AV_CHAN_TOP_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_UNUSED, AV_CHAN_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_RIGHT, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_CENTER}, + { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_BACK_LEFT, AV_CHAN_TOP_BACK_RIGHT, AV_CHAN_TOP_BACK_CENTER}, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE}, + }, + { + { AV_CHAN_BOTTOM_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_RIGHT, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, + }, +}; + +#if FF_API_OLD_CHANNEL_LAYOUT +const uint64_t ff_aac_channel_layout[] = { + AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_SURROUND, + AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_5POINT0_BACK, + AV_CH_LAYOUT_5POINT1_BACK, + AV_CH_LAYOUT_7POINT1_WIDE_BACK, + AV_CH_LAYOUT_6POINT1_BACK, + AV_CH_LAYOUT_7POINT1, + AV_CH_LAYOUT_22POINT2, + AV_CH_LAYOUT_7POINT1_TOP_BACK, + 0, +}; +#endif + +const AVChannelLayout ff_aac_ch_layout[] = { + AV_CHANNEL_LAYOUT_MONO, + AV_CHANNEL_LAYOUT_STEREO, + AV_CHANNEL_LAYOUT_SURROUND, + AV_CHANNEL_LAYOUT_4POINT0, + AV_CHANNEL_LAYOUT_5POINT0_BACK, + AV_CHANNEL_LAYOUT_5POINT1_BACK, + AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, + AV_CHANNEL_LAYOUT_6POINT1_BACK, + AV_CHANNEL_LAYOUT_7POINT1, + AV_CHANNEL_LAYOUT_22POINT2, + AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK, + { 0 }, +}; diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c index 46f0ebf91b..2b8ac67659 100644 --- a/libavcodec/aacdec_fixed.c +++ b/libavcodec/aacdec_fixed.c @@ -465,8 +465,8 @@ const FFCodec ff_aac_fixed_decoder = { }, .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, - CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(aac_channel_layout) - .p.ch_layouts = aac_ch_layout, + CODEC_OLD_CHANNEL_LAYOUTS_ARRAY(ff_aac_channel_layout) + .p.ch_layouts = ff_aac_ch_layout, .p.priv_class = &aac_decoder_class, .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), .flush = flush, diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 51a4cb2b66..3fb9a01da5 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -283,10 +283,10 @@ static int assign_channels(struct elem_to_channel e2c_vec[MAX_ELEM_ID], uint8_t if (pos == AAC_CHANNEL_LFE) { while (nb_channels) { - if (aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE) + if (ff_aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE) return -1; e2c_vec[i] = (struct elem_to_channel) { - .av_position = 1ULL << aac_channel_map[layer][pos - 1][j], + .av_position = 1ULL << ff_aac_channel_map[layer][pos - 1][j], .syn_ele = layout_map[i][0], .elem_id = layout_map[i][1], .aac_position = pos @@ -302,12 +302,12 @@ static int assign_channels(struct elem_to_channel e2c_vec[MAX_ELEM_ID], uint8_t } while (nb_channels & 1) { - if (aac_channel_map[layer][pos - 1][0] == AV_CHAN_NONE) + if (ff_aac_channel_map[layer][pos - 1][0] == AV_CHAN_NONE) return -1; - if (aac_channel_map[layer][pos - 1][0] == AV_CHAN_UNUSED) + if (ff_aac_channel_map[layer][pos - 1][0] == AV_CHAN_UNUSED) break; e2c_vec[i] = (struct elem_to_channel) { - .av_position = 1ULL << aac_channel_map[layer][pos - 1][0], + .av_position = 1ULL << ff_aac_channel_map[layer][pos - 1][0], .syn_ele = layout_map[i][0], .elem_id = layout_map[i][1], .aac_position = pos @@ -319,21 +319,21 @@ static int assign_channels(struct elem_to_channel e2c_vec[MAX_ELEM_ID], uint8_t j = (pos != AAC_CHANNEL_SIDE) && nb_channels <= 3 ? 3 : 1; while (nb_channels >= 2) { - if (aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE || - aac_channel_map[layer][pos - 1][j+1] == AV_CHAN_NONE) + if (ff_aac_channel_map[layer][pos - 1][j] == AV_CHAN_NONE || + ff_aac_channel_map[layer][pos - 1][j+1] == AV_CHAN_NONE) return -1; i += assign_pair(e2c_vec, layout_map, i, - 1ULL << aac_channel_map[layer][pos - 1][j], - 1ULL << aac_channel_map[layer][pos - 1][j+1], + 1ULL << ff_aac_channel_map[layer][pos - 1][j], + 1ULL << ff_aac_channel_map[layer][pos - 1][j+1], pos, layout); j += 2; nb_channels -= 2; } while (nb_channels & 1) { - if (aac_channel_map[layer][pos - 1][5] == AV_CHAN_NONE) + if (ff_aac_channel_map[layer][pos - 1][5] == AV_CHAN_NONE) return -1; e2c_vec[i] = (struct elem_to_channel) { - .av_position = 1ULL << aac_channel_map[layer][pos - 1][5], + .av_position = 1ULL << ff_aac_channel_map[layer][pos - 1][5], .syn_ele = layout_map[i][0], .elem_id = layout_map[i][1], .aac_position = pos @@ -552,8 +552,8 @@ static int set_default_channel_config(AACContext *ac, AVCodecContext *avctx, channel_config); return AVERROR_INVALIDDATA; } - *tags = tags_per_config[channel_config]; - memcpy(layout_map, aac_channel_layout_map[channel_config - 1], + *tags = ff_tags_per_config[channel_config]; + memcpy(layout_map, ff_aac_channel_layout_map[channel_config - 1], *tags * sizeof(*layout_map)); /* @@ -661,7 +661,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) * SCE[0] CPE[0] CPE[1] LFE[0]. * If we seem to have encountered such a stream, transfer * the LFE[0] element to the SCE[1]'s mapping */ - if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { + if (ac->tags_mapped == ff_tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { if (!ac->warned_remapping_once && (type != TYPE_LFE || elem_id != 0)) { av_log(ac->avctx, AV_LOG_WARNING, "This stream seems to incorrectly report its last channel as %s[%d], mapping to LFE[0]\n", @@ -683,7 +683,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) * SCE[0] CPE[0] SCE[1]. * If we seem to have encountered such a stream, transfer * the SCE[1] element to the LFE[0]'s mapping */ - if (ac->tags_mapped == tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { + if (ac->tags_mapped == ff_tags_per_config[ac->oc[1].m4ac.chan_config] - 1 && (type == TYPE_LFE || type == TYPE_SCE)) { if (!ac->warned_remapping_once && (type != TYPE_SCE || elem_id != 1)) { av_log(ac->avctx, AV_LOG_WARNING, "This stream seems to incorrectly report its last channel as %s[%d], mapping to SCE[1]\n", @@ -3091,9 +3091,9 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data, chan_config); return AVERROR_INVALIDDATA; } - for (i = 0; i < tags_per_config[chan_config]; i++) { - const int elem_type = aac_channel_layout_map[chan_config-1][i][0]; - const int elem_id = aac_channel_layout_map[chan_config-1][i][1]; + for (i = 0; i < ff_tags_per_config[chan_config]; i++) { + const int elem_type = ff_aac_channel_layout_map[chan_config-1][i][0]; + const int elem_id = ff_aac_channel_layout_map[chan_config-1][i][1]; if (!(che=get_che(ac, elem_type, elem_id))) { av_log(ac->avctx, AV_LOG_ERROR, "channel element %d.%d is not allocated\n", diff --git a/libavcodec/aacdectab.h b/libavcodec/aacdectab.h index 41f1db781d..db6fd0a04f 100644 --- a/libavcodec/aacdectab.h +++ b/libavcodec/aacdectab.h @@ -1,7 +1,5 @@ /* * AAC decoder data - * 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. * @@ -30,99 +28,20 @@ #ifndef AVCODEC_AACDECTAB_H #define AVCODEC_AACDECTAB_H -#include "libavutil/channel_layout.h" -#include "aac.h" - #include <stdint.h> -static const int8_t tags_per_config[16] = { 0, 1, 1, 2, 3, 3, 4, 5, 0, 0, 0, 5, 5, 16, 5, 0 }; +#include "libavutil/channel_layout.h" + +extern const int8_t ff_tags_per_config[16]; -static const uint8_t aac_channel_layout_map[16][16][3] = { - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, }, - { { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, - { { 0, } }, - { { 0, } }, - { { 0, } }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_SCE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_CPE, 2, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, }, - { - { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, // SCE1 = FC, - { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, // CPE1 = FLc and FRc, - { TYPE_CPE, 1, AAC_CHANNEL_FRONT }, // CPE2 = FL and FR, - { TYPE_CPE, 2, AAC_CHANNEL_BACK }, // CPE3 = SiL and SiR, - { TYPE_CPE, 3, AAC_CHANNEL_BACK }, // CPE4 = BL and BR, - { TYPE_SCE, 1, AAC_CHANNEL_BACK }, // SCE2 = BC, - { TYPE_LFE, 0, AAC_CHANNEL_LFE }, // LFE1 = LFE1, - { TYPE_LFE, 1, AAC_CHANNEL_LFE }, // LFE2 = LFE2, - { TYPE_SCE, 2, AAC_CHANNEL_FRONT }, // SCE3 = TpFC, - { TYPE_CPE, 4, AAC_CHANNEL_FRONT }, // CPE5 = TpFL and TpFR, - { TYPE_CPE, 5, AAC_CHANNEL_SIDE }, // CPE6 = TpSiL and TpSiR, - { TYPE_SCE, 3, AAC_CHANNEL_SIDE }, // SCE4 = TpC, - { TYPE_CPE, 6, AAC_CHANNEL_BACK }, // CPE7 = TpBL and TpBR, - { TYPE_SCE, 4, AAC_CHANNEL_BACK }, // SCE5 = TpBC, - { TYPE_SCE, 5, AAC_CHANNEL_FRONT }, // SCE6 = BtFC, - { TYPE_CPE, 7, AAC_CHANNEL_FRONT }, // CPE8 = BtFL and BtFR - }, - { { TYPE_SCE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 0, AAC_CHANNEL_FRONT }, { TYPE_CPE, 1, AAC_CHANNEL_BACK }, { TYPE_LFE, 0, AAC_CHANNEL_LFE }, { TYPE_CPE, 2, AAC_CHANNEL_FRONT }, }, - { { 0, } }, -}; +extern const uint8_t ff_aac_channel_layout_map[16][16][3]; -static const int16_t aac_channel_map[3][4][6] = { - { - { AV_CHAN_FRONT_CENTER, AV_CHAN_FRONT_LEFT_OF_CENTER, AV_CHAN_FRONT_RIGHT_OF_CENTER, AV_CHAN_FRONT_LEFT, AV_CHAN_FRONT_RIGHT, AV_CHAN_NONE }, - { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, - { AV_CHAN_UNUSED, AV_CHAN_SIDE_LEFT, AV_CHAN_SIDE_RIGHT, AV_CHAN_BACK_LEFT, AV_CHAN_BACK_RIGHT, AV_CHAN_BACK_CENTER }, - { AV_CHAN_LOW_FREQUENCY, AV_CHAN_LOW_FREQUENCY_2, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, - }, - { - { AV_CHAN_TOP_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_FRONT_LEFT, AV_CHAN_TOP_FRONT_RIGHT, AV_CHAN_NONE }, - { AV_CHAN_UNUSED, AV_CHAN_TOP_SIDE_LEFT, AV_CHAN_TOP_SIDE_RIGHT, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_CENTER}, - { AV_CHAN_UNUSED, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_TOP_BACK_LEFT, AV_CHAN_TOP_BACK_RIGHT, AV_CHAN_TOP_BACK_CENTER}, - { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE}, - }, - { - { AV_CHAN_BOTTOM_FRONT_CENTER, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_RIGHT, AV_CHAN_NONE }, - { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, - { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, - { AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE, AV_CHAN_NONE }, - }, -}; +extern const int16_t ff_aac_channel_map[3][4][6]; #if FF_API_OLD_CHANNEL_LAYOUT -static const uint64_t aac_channel_layout[] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_4POINT0, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_7POINT1_WIDE_BACK, - AV_CH_LAYOUT_6POINT1_BACK, - AV_CH_LAYOUT_7POINT1, - AV_CH_LAYOUT_22POINT2, - AV_CH_LAYOUT_7POINT1_TOP_BACK, - 0, -}; +extern const uint64_t ff_aac_channel_layout[]; #endif -static const AVChannelLayout aac_ch_layout[] = { - AV_CHANNEL_LAYOUT_MONO, - AV_CHANNEL_LAYOUT_STEREO, - AV_CHANNEL_LAYOUT_SURROUND, - AV_CHANNEL_LAYOUT_4POINT0, - AV_CHANNEL_LAYOUT_5POINT0_BACK, - AV_CHANNEL_LAYOUT_5POINT1_BACK, - AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, - AV_CHANNEL_LAYOUT_6POINT1_BACK, - AV_CHANNEL_LAYOUT_7POINT1, - AV_CHANNEL_LAYOUT_22POINT2, - AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK, - { 0 }, -}; +extern const AVChannelLayout ff_aac_ch_layout[]; #endif /* AVCODEC_AACDECTAB_H */ -- 2.34.1 _______________________________________________ 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".
next prev parent reply other threads:[~2023-09-26 22:22 UTC|newest] Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-09-26 22:12 [FFmpeg-devel] [PATCH 01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 02/61] avcodec/vp3: Make VLC tables static where possible Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 03/61] avcodec/vp3: Increase some VLC tables Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 04/61] avcodec/h264_cavlc: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 05/61] avcodec/h264_cavlc: Avoid indirection for coefficient table VLCs Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 06/61] avcodec/h264_cavlc: Remove code duplication Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 07/61] avcodec/asvdec: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 08/61] avcodec/faxcompr: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 09/61] avcodec/h261dec: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 10/61] avcodec/ituh263dec: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 11/61] avcodec/msmpeg4_vc1_data: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 12/61] avcodec/svq1dec: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 13/61] avcodec/svq1dec: Increase size of VLC Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 14/61] avcodec/rv40: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 15/61] avcodec/mpc7: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 16/61] avcodec/intrax8: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 17/61] avcodec/clearvideo: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 18/61] avcodec/atrac9dec: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 19/61] avcodec/imc: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 20/61] avcodec/refstruct: Add simple API for refcounted objects Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 21/61] avcodec/vp3: Share coefficient VLCs between threads Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 22/61] avcodec/vp3: Avoid complete VLC struct, only use VLCElem* Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 23/61] avcodec/vp3: Reindent after the previous commits Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 24/61] avcodec/rv34: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 25/61] avcodec/rv34: Constify pointer to static object Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 26/61] avcodec/wnv1: Avoid unnecessary VLC structure Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 27/61] avcodec/mv30: " Andreas Rheinhardt 2023-09-26 22:16 ` [FFmpeg-devel] [PATCH 28/61] avcodec/vqcdec: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 29/61] avcodec/mobiclip: " Andreas Rheinhardt 2023-09-27 23:20 ` Michael Niedermayer 2023-09-27 23:44 ` Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 30/61] avcodec/mimic: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 31/61] avcodec/imm4: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 32/61] avcodec/lagarith: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 33/61] avcodec/speedhqdec: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 34/61] avcodec/vc1: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 35/61] avcodec/4xm: Avoid unnecessary " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 36/61] avcodec/indeo2: Avoid unnecessary VLC structure Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 37/61] avcodec/mss4: Partially inline max_depth and nb_bits of VLC Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 38/61] avcodec/mpeg4videodec: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 39/61] avcodec/msmpeg4dec: " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 40/61] avcodec/aacps: Remove unused AVCodecContext* parameter from ff_ps_apply Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 41/61] avcodec/aacps: Pass logctx as void* instead of AVCodecContext* Andreas Rheinhardt 2023-09-26 22:17 ` Andreas Rheinhardt [this message] 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 43/61] avcodec/aacdec_template: Deduplicate VLCs Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 44/61] avcodec/aacdec_template: Don't init unused table for fixed-point decoder Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 45/61] avcodec/aactab: Improve included headers Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 46/61] avcodec/aacdec_common: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 47/61] avcodec/aacsbr_template: Deduplicate VLCs Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 48/61] avcodec/aacdec_common: Avoid superfluous VLC structures for SBR VLCs Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 49/61] avcodec/aacdec_common: Switch to ff_vlc_init_tables_from_lengths() Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 50/61] avcodec/aacdec_common: Combine huffman tabs Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 51/61] avcodec/aacdec_common: Apply offset for SBR VLCs during init Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 52/61] avcodec/aacps: Move initializing common stuff to aacdec_common.c Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 53/61] avcodec/aacps_common: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 54/61] avcodec/aacps_common: Switch to ff_vlc_init_tables_from_lengths() Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 55/61] avcodec/aacps_common: Combine huffman tabels Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 56/61] avcodec/aacps_common: Apply offset for VLCs during init Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 57/61] avcodec/mpegaudiodec_common: Avoid superfluous VLC structures Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 58/61] avcodec/mpeg12: Avoid unnecessary " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 59/61] avcodec/wmaprodec: Avoid superfluous " Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 60/61] avcodec/wmavoice: Avoid unnecessary VLC structure Andreas Rheinhardt 2023-09-26 22:17 ` [FFmpeg-devel] [PATCH 61/61] avcodec/vlc: Remove unused macros Andreas Rheinhardt 2023-10-30 23:08 ` [FFmpeg-devel] [PATCH 01/61] avcodec/vlc: Add functions to init static VLCElem[] without VLC Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=GV1P250MB07372881F89CD7A7727A0F138FC3A@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git