1 /*
2 * Spectral Band Replication definitions and structures
3 * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
4 * Copyright (c) 2010 Alex Converse <alex.converse@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 * Spectral Band Replication definitions and structures
26 * @author Robert Swain ( rob opendot cl )
27 */
28
29 #ifndef AVCODEC_SBR_H
30 #define AVCODEC_SBR_H
31
32 #include <stdint.h>
33
35
39
41
42 /**
43 * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header.
44 */
49
50 /**
51 * @name Variables associated with bs_header_extra_1
52 * @{
53 */
57 /** @} */
59
60 #define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2)
61
62 /**
63 * Spectral Band Replication per channel data
64 */
66 /**
67 * @name Main bitstream data variables
68 * @{
69 */
80 /** @} */
81
82 /**
83 * @name State variables
84 * @{
85 */
89 ///l_APrev and l_A
91 ///Chirp factors
93 ///QMF values of the original signal
95 ///QMF output of the HF adjustor
101 ///Envelope scalefactors
104 ///Noise scalefactors
107 ///Envelope time borders
109 ///Envelope time border of the last envelope of the previous frame
111 ///Noise time borders
115 /** @} */
117
119
120 /**
121 * aacsbr functions pointers
122 */
126 int buf_idx);
130 const int e_a[2]);
133 const INTFLOAT X_low[32][40][2],
int ch);
136 const INTFLOAT X_low[32][40][2],
int k0);
138
139 /**
140 * Spectral Band Replication
141 */
150 /**
151 * @name Variables associated with bs_header_extra_2
152 * @{
153 */
158 /** @} */
161 ///kx', and kx respectively, kx is the first QMF subband where SBR is used.
162 ///kx' is its value from the previous frame
164 ///M' and M respectively, M is the number of QMF subbands that use SBR.
167 ///The number of frequency bands in f_master
171 ///N_Low and N_High respectively, the number of frequency bands for low and high resolution
173 ///Number of noise floor bands
175 ///Number of limiter bands
177 ///The master QMF frequency grouping
179 ///Frequency borders for low resolution SBR
181 ///Frequency borders for high resolution SBR
183 ///Frequency borders for noise floors
185 ///Frequency borders for the limiter
190 ///QMF low frequency input to the HF generator
192 ///QMF output of the HF generator
194 ///QMF values of the reconstructed signal
196 ///Zeroth coefficient used to filter the subband signals
198 ///First coefficient used to filter the subband signals
200 ///Dequantized envelope scalefactors, remapped
202 ///Dequantized noise scalefactors, remapped
204 ///Sinusoidal presence, remapped
206 ///Estimated envelope
208 ///Amplitude adjusted noise scalefactors
210 ///Sinusoidal levels
218 };
219
220 #endif /* AVCODEC_SBR_H */