/src/ffmpeg/libavcodec/aac.h
Line | Count | Source |
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 | 20.0M | #define MAX_CHANNELS 64 |
34 | 2.25G | #define MAX_ELEM_ID 64 |
35 | | |
36 | 0 | #define TNS_MAX_ORDER 20 |
37 | | #define MAX_LTP_LONG_SFB 40 |
38 | | |
39 | | enum RawDataBlockType { |
40 | | TYPE_SCE, |
41 | | TYPE_CPE, |
42 | | TYPE_CCE, |
43 | | TYPE_LFE, |
44 | | TYPE_DSE, |
45 | | TYPE_PCE, |
46 | | TYPE_FIL, |
47 | | TYPE_END, |
48 | | }; |
49 | | |
50 | | enum ExtensionPayloadID { |
51 | | EXT_FILL, |
52 | | EXT_FILL_DATA, |
53 | | EXT_DATA_ELEMENT, |
54 | | EXT_DYNAMIC_RANGE = 0xb, |
55 | | EXT_SBR_DATA = 0xd, |
56 | | EXT_SBR_DATA_CRC = 0xe, |
57 | | }; |
58 | | |
59 | | enum WindowSequence { |
60 | | ONLY_LONG_SEQUENCE, |
61 | | LONG_START_SEQUENCE, |
62 | | EIGHT_SHORT_SEQUENCE, |
63 | | LONG_STOP_SEQUENCE, |
64 | | }; |
65 | | |
66 | | enum BandType { |
67 | | ZERO_BT = 0, ///< Scalefactors and spectral data are all zero. |
68 | | FIRST_PAIR_BT = 5, ///< This and later band types encode two values (rather than four) with one code word. |
69 | | ESC_BT = 11, ///< Spectral data are coded with an escape sequence. |
70 | | RESERVED_BT = 12, ///< Band types following are encoded differently from others. |
71 | | NOISE_BT = 13, ///< Spectral data are scaled white noise not coded in the bitstream. |
72 | | INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions (out of phase). |
73 | | INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions (in phase). |
74 | | }; |
75 | | |
76 | | enum ChannelPosition { |
77 | | AAC_CHANNEL_OFF = 0, |
78 | | AAC_CHANNEL_FRONT = 1, |
79 | | AAC_CHANNEL_SIDE = 2, |
80 | | AAC_CHANNEL_BACK = 3, |
81 | | AAC_CHANNEL_LFE = 4, |
82 | | AAC_CHANNEL_CC = 5, |
83 | | }; |
84 | | |
85 | 53.1M | #define MAX_PREDICTORS 672 |
86 | | |
87 | 0 | #define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times |
88 | 0 | #define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0 |
89 | 0 | #define SCALE_MAX_POS 255 ///< scalefactor index maximum value |
90 | 0 | #define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard |
91 | 8.64M | #define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference |
92 | | |
93 | 4.00M | #define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0); |
94 | | |
95 | 204k | #define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band |
96 | 204k | #define NOISE_PRE_BITS 9 ///< length of preamble |
97 | 1.41M | #define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble |
98 | | |
99 | | typedef struct Pulse { |
100 | | int num_pulse; |
101 | | int start; |
102 | | int pos[4]; |
103 | | int amp[4]; |
104 | | } Pulse; |
105 | | |
106 | | static inline int ff_aac_sample_rate_idx(int rate) |
107 | 18.8k | { |
108 | 18.8k | if (92017 <= rate) return 0; |
109 | 17.7k | else if (75132 <= rate) return 1; |
110 | 17.6k | else if (55426 <= rate) return 2; |
111 | 17.2k | else if (46009 <= rate) return 3; |
112 | 16.5k | else if (37566 <= rate) return 4; |
113 | 16.5k | else if (27713 <= rate) return 5; |
114 | 15.6k | else if (23004 <= rate) return 6; |
115 | 15.2k | else if (18783 <= rate) return 7; |
116 | 15.2k | else if (13856 <= rate) return 8; |
117 | 14.9k | else if (11502 <= rate) return 9; |
118 | 14.6k | else if (9391 <= rate) return 10; |
119 | 14.2k | else return 11; |
120 | 18.8k | } Unexecuted instantiation: aacenc.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacenctab.c:ff_aac_sample_rate_idx Unexecuted instantiation: aaccoder.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacenc_is.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacenc_tns.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacpsy.c:ff_aac_sample_rate_idx aacdec.c:ff_aac_sample_rate_idx Line | Count | Source | 107 | 15.2k | { | 108 | 15.2k | if (92017 <= rate) return 0; | 109 | 15.2k | else if (75132 <= rate) return 1; | 110 | 15.2k | else if (55426 <= rate) return 2; | 111 | 14.8k | else if (46009 <= rate) return 3; | 112 | 14.7k | else if (37566 <= rate) return 4; | 113 | 14.7k | else if (27713 <= rate) return 5; | 114 | 14.6k | else if (23004 <= rate) return 6; | 115 | 14.6k | else if (18783 <= rate) return 7; | 116 | 14.5k | else if (13856 <= rate) return 8; | 117 | 14.3k | else if (11502 <= rate) return 9; | 118 | 14.2k | else if (9391 <= rate) return 10; | 119 | 14.2k | else return 11; | 120 | 15.2k | } |
Unexecuted instantiation: aacdec_fixed.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacdec_float.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacdec_tab.c:ff_aac_sample_rate_idx aacdec_usac.c:ff_aac_sample_rate_idx Line | Count | Source | 107 | 3.55k | { | 108 | 3.55k | if (92017 <= rate) return 0; | 109 | 2.49k | else if (75132 <= rate) return 1; | 110 | 2.43k | else if (55426 <= rate) return 2; | 111 | 2.42k | else if (46009 <= rate) return 3; | 112 | 1.80k | else if (37566 <= rate) return 4; | 113 | 1.78k | else if (27713 <= rate) return 5; | 114 | 948 | else if (23004 <= rate) return 6; | 115 | 674 | else if (18783 <= rate) return 7; | 116 | 662 | else if (13856 <= rate) return 8; | 117 | 521 | else if (11502 <= rate) return 9; | 118 | 457 | else if (9391 <= rate) return 10; | 119 | 47 | else return 11; | 120 | 3.55k | } |
Unexecuted instantiation: aacsbr.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacsbr_fixed.c:ff_aac_sample_rate_idx Unexecuted instantiation: sbrdsp.c:ff_aac_sample_rate_idx Unexecuted instantiation: sbrdsp_fixed.c:ff_aac_sample_rate_idx Unexecuted instantiation: aacdec_lpd.c:ff_aac_sample_rate_idx |
121 | | |
122 | | #endif /* AVCODEC_AAC_H */ |