1 /*
2 * AAC definitions and structures
3 * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
4 * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * AAC definitions and structures
26 * @author Oded Shimon ( ods15 ods15 dyndns org )
27 * @author Maxim Gavrilov ( maxim.gavrilov gmail com )
28 */
29
30 #ifndef AVCODEC_AAC_H
31 #define AVCODEC_AAC_H
32
33
35
36 #define MAX_CHANNELS 64
37 #define MAX_ELEM_ID 16
38
39 #define TNS_MAX_ORDER 20
40 #define MAX_LTP_LONG_SFB 40
41
51 };
52
60 };
61
67 };
68
70 ZERO_BT = 0,
///< Scalefactors and spectral data are all zero.
71 FIRST_PAIR_BT = 5,
///< This and later band types encode two values (rather than four) with one code word.
72 ESC_BT = 11,
///< Spectral data are coded with an escape sequence.
73 RESERVED_BT = 12,
///< Band types following are encoded differently from others.
74 NOISE_BT = 13,
///< Spectral data are scaled white noise not coded in the bitstream.
75 INTENSITY_BT2 = 14,
///< Scalefactor data are intensity stereo positions (out of phase).
76 INTENSITY_BT = 15,
///< Scalefactor data are intensity stereo positions (in phase).
77 };
78
86 };
87
88 /**
89 * Predictor State
90 */
101
102 #define MAX_PREDICTORS 672
103
104 #define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times
105 #define SCALE_ONE_POS 140
///< scalefactor index that corresponds to scale=1.0
106 #define SCALE_MAX_POS 255
///< scalefactor index maximum value
107 #define SCALE_MAX_DIFF 60
///< maximum scalefactor difference allowed by standard
108 #define SCALE_DIFF_ZERO 60
///< codebook index corresponding to zero scalefactor indices difference
109
110 #define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0);
111
112 #define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band
113 #define NOISE_PRE_BITS 9
///< length of preamble
114 #define NOISE_OFFSET 90
///< subtracted from global gain, used as offset for the preamble
115
122
123 #endif /* AVCODEC_AAC_H */