FFmpeg
ac3dec_data.c
Go to the documentation of this file.
1 /*
2  * AC-3 and E-AC-3 decoder tables
3  * Copyright (c) 2007 Bartlomiej Wolowiec <bartek.wolowiec@gmail.com>
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * Tables taken directly from the AC-3 spec.
25  */
26 
27 #include "ac3dec_data.h"
28 
29 /**
30  * Table used to ungroup 3 values stored in 5 bits.
31  * Used by bap=1 mantissas and GAQ.
32  * ff_ac3_ungroup_3_in_5_bits_tab[i] = { i/9, (i%9)/3, (i%9)%3 }
33  */
34 const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3] = {
35  { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 2 }, { 0, 1, 0 },
36  { 0, 1, 1 }, { 0, 1, 2 }, { 0, 2, 0 }, { 0, 2, 1 },
37  { 0, 2, 2 }, { 1, 0, 0 }, { 1, 0, 1 }, { 1, 0, 2 },
38  { 1, 1, 0 }, { 1, 1, 1 }, { 1, 1, 2 }, { 1, 2, 0 },
39  { 1, 2, 1 }, { 1, 2, 2 }, { 2, 0, 0 }, { 2, 0, 1 },
40  { 2, 0, 2 }, { 2, 1, 0 }, { 2, 1, 1 }, { 2, 1, 2 },
41  { 2, 2, 0 }, { 2, 2, 1 }, { 2, 2, 2 }, { 3, 0, 0 },
42  { 3, 0, 1 }, { 3, 0, 2 }, { 3, 1, 0 }, { 3, 1, 1 }
43 };
44 
45 const uint8_t ff_eac3_hebap_tab[64] = {
46  0, 1, 2, 3, 4, 5, 6, 7, 8, 8,
47  8, 8, 9, 9, 9, 10, 10, 10, 10, 11,
48  11, 11, 11, 12, 12, 12, 12, 13, 13, 13,
49  13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
50  16, 16, 16, 17, 17, 17, 17, 18, 18, 18,
51  18, 18, 18, 18, 18, 19, 19, 19, 19, 19,
52  19, 19, 19, 19,
53 };
54 
55 /**
56  * Table E2.15 Default Spectral Extension Banding Structure
57  */
59 { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 };
ac3dec_data.h
ff_ac3_ungroup_3_in_5_bits_tab
const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3]
Table used to ungroup 3 values stored in 5 bits.
Definition: ac3dec_data.c:34
ff_eac3_hebap_tab
const uint8_t ff_eac3_hebap_tab[64]
Definition: ac3dec_data.c:45
ff_eac3_default_spx_band_struct
const uint8_t ff_eac3_default_spx_band_struct[17]
Table E2.15 Default Spectral Extension Banding Structure.
Definition: ac3dec_data.c:58