FFmpeg
Loading...
Searching...
No Matches
aacenctab.h
Go to the documentation of this file.
1/*
2 * AAC encoder data
3 * Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker 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 * AAC encoder data
25 * @author Rostislav Pehlivanov ( atomnuker gmail com )
26 */
27
28#ifndef AVCODEC_AACENCTAB_H
29#define AVCODEC_AACENCTAB_H
30
32#include "aac.h"
33#include "defs.h"
34
35/** Total number of usable codebooks **/
36#define CB_TOT 12
37
38/** Total number of codebooks, including special ones **/
39#define CB_TOT_ALL 15
40
41#define AAC_MAX_CHANNELS 16
42
43extern const uint8_t *const ff_aac_swb_size_1024[];
44extern const uint8_t *const ff_aac_swb_size_128[];
45
46/* Supported layouts without using a PCE */
48 { 0 },
55 { 0 }, // AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK, disabled in favor or PCE configuration
56 { 0 },
57 { 0 },
58 { 0 },
61 { 0 },
63};
64
65/** default channel configurations */
66static const uint8_t aac_chan_configs[14][6] = {
67 {1, TYPE_SCE}, // 1 channel - single channel element
68 {1, TYPE_CPE}, // 2 channels - channel pair
69 {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo
70 {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center
71 {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo
72 {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE
73 {0},
74 {0},
75 {0},
76 {0},
77 {5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_SCE, TYPE_LFE}, // 7 channels - front center + front stereo + back stereo + back center + LFE
78 {5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 8 channels - front center + front stereo + side stereo + back stereo + LFE
79 {0},
80 {5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE, TYPE_CPE}, // 8 channels - front center + front stereo + back stereo + LFE + top front stereo
81};
82
83/**
84 * Table to remap channels from libavcodec's default order to AAC order.
85 */
86static const uint8_t aac_chan_maps[14][AAC_MAX_CHANNELS] = {
87 { 0 },
88 { 0, 1 },
89 { 2, 0, 1 },
90 { 2, 0, 1, 3 },
91 { 2, 0, 1, 3, 4 },
92 { 2, 0, 1, 4, 5, 3 },
93 { 0 },
94 { 0 },
95 { 0 },
96 { 0 },
97 { 2, 0, 1, 4, 5, 6, 3, },
98 { 2, 0, 1, 6, 7, 4, 5, 3 },
99 { 0 },
100 { 2, 0, 1, 4, 5, 3, 6, 7 },
101};
102
103/** bits needed to code codebook run value for long windows */
104static const uint8_t run_value_bits_long[64] = {
105 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
106 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
107 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
108 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15
109};
110
111/** bits needed to code codebook run value for short windows */
112static const uint8_t run_value_bits_short[16] = {
113 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9
114};
115
116/* TNS starting SFBs for long and short windows */
117static const uint8_t tns_min_sfb_short[16] = {
118 2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12, 12, 12, 12, 12
119};
120
121static const uint8_t tns_min_sfb_long[16] = {
122 12, 13, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31, 31, 31, 31, 31
123};
124
125static const uint8_t * const tns_min_sfb[2] = {
127};
128
129static const uint8_t * const run_value_bits[2] = {
131};
132
133/** Map to convert values from BandCodingPath index to a codebook index **/
134static const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15};
135/** Inverse map to convert from codebooks to BandCodingPath indices **/
136static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14};
137
138static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17};
139static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16};
140
141static const unsigned char aac_maxval_cb[] = {
142 0, 1, 3, 5, 5, 7, 7, 7, 9, 9, 9, 9, 9, 11
143};
144
145static const int aacenc_profiles[] = {
148};
149
150#endif /* AVCODEC_AACENCTAB_H */
AAC definitions and structures.
@ TYPE_CPE
Definition aac.h:45
@ TYPE_SCE
Definition aac.h:44
@ TYPE_LFE
Definition aac.h:47
const uint8_t *const ff_aac_swb_size_1024[]
Definition aacenctab.c:97
const uint8_t *const ff_aac_swb_size_128[]
Definition aacenctab.c:89
static const uint8_t aac_cb_maxval[12]
Definition aacenctab.h:139
static const uint8_t aac_cb_out_map[CB_TOT_ALL]
Map to convert values from BandCodingPath index to a codebook index.
Definition aacenctab.h:134
#define AAC_MAX_CHANNELS
Definition aacenctab.h:41
static const uint8_t aac_chan_maps[14][AAC_MAX_CHANNELS]
Table to remap channels from libavcodec's default order to AAC order.
Definition aacenctab.h:86
static const uint8_t tns_min_sfb_long[16]
Definition aacenctab.h:121
static const uint8_t *const run_value_bits[2]
Definition aacenctab.h:129
static const AVChannelLayout aac_normal_chan_layouts[15]
Definition aacenctab.h:47
static const uint8_t run_value_bits_long[64]
bits needed to code codebook run value for long windows
Definition aacenctab.h:104
static const uint8_t *const tns_min_sfb[2]
Definition aacenctab.h:125
static const uint8_t aac_cb_range[12]
Definition aacenctab.h:138
static const uint8_t aac_chan_configs[14][6]
default channel configurations
Definition aacenctab.h:66
static const uint8_t run_value_bits_short[16]
bits needed to code codebook run value for short windows
Definition aacenctab.h:112
#define CB_TOT_ALL
Total number of codebooks, including special ones.
Definition aacenctab.h:39
static const int aacenc_profiles[]
Definition aacenctab.h:145
static const uint8_t tns_min_sfb_short[16]
Definition aacenctab.h:117
static const uint8_t aac_cb_in_map[CB_TOT_ALL+1]
Inverse map to convert from codebooks to BandCodingPath indices.
Definition aacenctab.h:136
static const unsigned char aac_maxval_cb[]
Definition aacenctab.h:141
Public libavutil channel layout APIs header.
Misc types and constants that do not belong anywhere else.
#define AV_PROFILE_MPEG2_AAC_LOW
Definition defs.h:77
#define AV_PROFILE_AAC_LOW
Definition defs.h:69
#define AV_CHANNEL_LAYOUT_4POINT0
#define AV_CHANNEL_LAYOUT_5POINT1_BACK
#define AV_CHANNEL_LAYOUT_STEREO
#define AV_CHANNEL_LAYOUT_6POINT1_BACK
#define AV_CHANNEL_LAYOUT_5POINT0_BACK
#define AV_CHANNEL_LAYOUT_MONO
#define AV_CHANNEL_LAYOUT_SURROUND
#define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK
#define AV_CHANNEL_LAYOUT_7POINT1
An AVChannelLayout holds information about the channel layout of audio data.