xref: /third_party/ffmpeg/libavcodec/ac3tab.h (revision cabdff1a)
1cabdff1aSopenharmony_ci/*
2cabdff1aSopenharmony_ci * AC-3 tables
3cabdff1aSopenharmony_ci * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
4cabdff1aSopenharmony_ci *
5cabdff1aSopenharmony_ci * This file is part of FFmpeg.
6cabdff1aSopenharmony_ci *
7cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or
8cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public
9cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either
10cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version.
11cabdff1aSopenharmony_ci *
12cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful,
13cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of
14cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15cabdff1aSopenharmony_ci * Lesser General Public License for more details.
16cabdff1aSopenharmony_ci *
17cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public
18cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software
19cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20cabdff1aSopenharmony_ci */
21cabdff1aSopenharmony_ci
22cabdff1aSopenharmony_ci#ifndef AVCODEC_AC3TAB_H
23cabdff1aSopenharmony_ci#define AVCODEC_AC3TAB_H
24cabdff1aSopenharmony_ci
25cabdff1aSopenharmony_ci#include <stdint.h>
26cabdff1aSopenharmony_ci
27cabdff1aSopenharmony_ci#include "ac3defs.h"
28cabdff1aSopenharmony_ci
29cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_frame_size_tab[38][3];
30cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_channels_tab[8];
31cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_channel_layout_tab[8];
32cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_dec_channel_map[8][2][6];
33cabdff1aSopenharmony_ciextern const int      ff_ac3_sample_rate_tab[];
34cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_bitrate_tab[19];
35cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_rematrix_band_tab[5];
36cabdff1aSopenharmony_ciextern const uint8_t  ff_eac3_default_cpl_band_struct[18];
37cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_bap_tab[64];
38cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_slow_decay_tab[4];
39cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_fast_decay_tab[4];
40cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_slow_gain_tab[4];
41cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_db_per_bit_tab[4];
42cabdff1aSopenharmony_ciextern const int16_t  ff_ac3_floor_tab[8];
43cabdff1aSopenharmony_ciextern const uint16_t ff_ac3_fast_gain_tab[8];
44cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_band_start_tab[AC3_CRITICAL_BANDS+1];
45cabdff1aSopenharmony_ciextern const uint8_t  ff_ac3_bin_to_band_tab[253];
46cabdff1aSopenharmony_ciextern const uint64_t ff_eac3_custom_channel_map_locations[16][2];
47cabdff1aSopenharmony_ci
48cabdff1aSopenharmony_ci
49cabdff1aSopenharmony_ci/** Custom channel map locations bitmask
50cabdff1aSopenharmony_ci *  Other channels described in documentation:
51cabdff1aSopenharmony_ci *      Lc/Rc pair, Lrs/Rrs pair, Ts, Lsd/Rsd pair,
52cabdff1aSopenharmony_ci *      Lw/Rw pair, Lvh/Rvh pair, Cvh, Reserved, LFE2
53cabdff1aSopenharmony_ci */
54cabdff1aSopenharmony_cienum CustomChannelMapLocation{
55cabdff1aSopenharmony_ci    AC3_CHMAP_L=        1<<(15-0),
56cabdff1aSopenharmony_ci    AC3_CHMAP_C=        1<<(15-1),
57cabdff1aSopenharmony_ci    AC3_CHMAP_R=        1<<(15-2),
58cabdff1aSopenharmony_ci    AC3_CHMAP_L_SUR=    1<<(15-3),
59cabdff1aSopenharmony_ci    AC3_CHMAP_R_SUR =   1<<(15-4),
60cabdff1aSopenharmony_ci    AC3_CHMAP_C_SUR=    1<<(15-7),
61cabdff1aSopenharmony_ci    AC3_CHMAP_LFE =     1<<(15-15)
62cabdff1aSopenharmony_ci};
63cabdff1aSopenharmony_ci
64cabdff1aSopenharmony_ci#define COMMON_CHANNEL_MAP \
65cabdff1aSopenharmony_ci    { { 0, 1,          }, { 0, 1, 2,         } },\
66cabdff1aSopenharmony_ci    { { 0,             }, { 0, 1,            } },\
67cabdff1aSopenharmony_ci    { { 0, 1,          }, { 0, 1, 2,         } },\
68cabdff1aSopenharmony_ci    { { 0, 2, 1,       }, { 0, 2, 1, 3,      } },\
69cabdff1aSopenharmony_ci    { { 0, 1, 2,       }, { 0, 1, 3, 2,      } },\
70cabdff1aSopenharmony_ci    { { 0, 2, 1, 3,    }, { 0, 2, 1, 4, 3,   } },
71cabdff1aSopenharmony_ci
72cabdff1aSopenharmony_ci#endif /* AVCODEC_AC3TAB_H */
73