X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fac3tab.c;h=7df3d828fbf2f5a1a77aeb3cb50894911841adf3;hb=b9e2226972737ab202ac1f5a6e005af80072bb39;hp=e7835c6748f830b7ad2ed031ed6aecd44bd2fab2;hpb=306a1204fffc6a4118895a7e90da3d66782c1db9;p=ffmpeg diff --git a/libavcodec/ac3tab.c b/libavcodec/ac3tab.c index e7835c6748f..7df3d828fbf 100644 --- a/libavcodec/ac3tab.c +++ b/libavcodec/ac3tab.c @@ -2,28 +2,29 @@ * AC-3 tables * copyright (c) 2001 Fabrice Bellard * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav 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, + * Libav 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 + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** - * @file libavcodec/ac3tab.c + * @file * tables taken directly from the AC-3 spec. */ +#include "libavutil/audioconvert.h" #include "avcodec.h" #include "ac3tab.h" @@ -73,7 +74,7 @@ const uint16_t ff_ac3_frame_size_tab[38][3] = { }; /** - * Maps audio coding mode (acmod) to number of full-bandwidth channels. + * Map audio coding mode (acmod) to number of full-bandwidth channels. * from ATSC A/52 Table 5.8 Audio Coding Mode */ const uint8_t ff_ac3_channels_tab[8] = { @@ -81,17 +82,17 @@ const uint8_t ff_ac3_channels_tab[8] = { }; /** - * Maps audio coding mode (acmod) to channel layout mask. + * Map audio coding mode (acmod) to channel layout mask. */ const uint16_t ff_ac3_channel_layout_tab[8] = { - CH_LAYOUT_STEREO, - CH_LAYOUT_MONO, - CH_LAYOUT_STEREO, - CH_LAYOUT_SURROUND, - CH_LAYOUT_2_1, - CH_LAYOUT_4POINT0, - CH_LAYOUT_2_2, - CH_LAYOUT_5POINT0 + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_SURROUND, + AV_CH_LAYOUT_2_1, + AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_2_2, + AV_CH_LAYOUT_5POINT0 }; #define COMMON_CHANNEL_MAP \ @@ -131,10 +132,23 @@ const uint16_t ff_ac3_bitrate_tab[19] = { 160, 192, 224, 256, 320, 384, 448, 512, 576, 640 }; +/** + * Table of bin locations for rematrixing bands + * reference: Section 7.5.2 Rematrixing : Frequency Band Definitions + */ +const uint8_t ff_ac3_rematrix_band_tab[5] = { 13, 25, 37, 61, 253 }; + +/** + * Table E2.16 Default Coupling Banding Structure + */ +const uint8_t ff_eac3_default_cpl_band_struct[18] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1 +}; + /* AC-3 MDCT window */ /* MDCT window */ -const int16_t ff_ac3_window[256] = { +DECLARE_ALIGNED(16, const int16_t, ff_ac3_window)[AC3_WINDOW_SIZE/2] = { 4, 7, 12, 16, 21, 28, 34, 42, 51, 61, 72, 84, 97, 111, 127, 145, 164, 184, 207, 231, 257, 285, 315, 347, @@ -198,7 +212,7 @@ const uint8_t ff_ac3_log_add_tab[260]= { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, }; -const uint16_t ff_ac3_hearing_threshold_tab[50][3]= { +const uint16_t ff_ac3_hearing_threshold_tab[AC3_CRITICAL_BANDS][3]= { { 0x04d0,0x04f0,0x0580 }, { 0x04d0,0x04f0,0x0580 }, { 0x0440,0x0460,0x04b0 }, @@ -285,11 +299,6 @@ const uint16_t ff_ac3_fast_gain_tab[8]= { 0x080, 0x100, 0x180, 0x200, 0x280, 0x300, 0x380, 0x400, }; -const uint8_t ff_ac3_critical_band_size_tab[50]={ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, - 3, 6, 6, 6, 6, 6, 6, 12, 12, 12, 12, 24, 24, 24, 24, 24 -}; /** * Default channel map for a dependent substream defined by acmod */