Libav
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
sbr.h
Go to the documentation of this file.
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 Libav.
7
*
8
* Libav 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
* Libav 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 Libav; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
29
#ifndef AVCODEC_SBR_H
30
#define AVCODEC_SBR_H
31
32
#include <stdint.h>
33
#include "
fft.h
"
34
#include "
aacps.h
"
35
#include "
sbrdsp.h
"
36
40
typedef
struct
SpectrumParameters
{
41
uint8_t
bs_start_freq
;
42
uint8_t
bs_stop_freq
;
43
uint8_t
bs_xover_band
;
44
49
uint8_t
bs_freq_scale
;
50
uint8_t
bs_alter_scale
;
51
uint8_t
bs_noise_bands
;
53
}
SpectrumParameters
;
54
55
#define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2)
56
60
typedef
struct
SBRData
{
65
unsigned
bs_frame_class
;
66
unsigned
bs_add_harmonic_flag
;
67
unsigned
bs_num_env
;
68
uint8_t
bs_freq_res
[7];
69
unsigned
bs_num_noise
;
70
uint8_t
bs_df_env
[5];
71
uint8_t
bs_df_noise
[2];
72
uint8_t
bs_invf_mode
[2][5];
73
uint8_t
bs_add_harmonic
[48];
74
unsigned
bs_amp_res
;
81
DECLARE_ALIGNED
(32,
float
,
synthesis_filterbank_samples
)[
SBR_SYNTHESIS_BUF_SIZE
];
82
DECLARE_ALIGNED
(32,
float
,
analysis_filterbank_samples
) [1312];
83
int
synthesis_filterbank_samples_offset
;
85
int
e_a
[2];
87
float
bw_array
[5];
89
float
W
[2][32][32][2];
91
int
Ypos
;
92
DECLARE_ALIGNED
(16,
float
,
Y
)[2][38][64][2];
93
DECLARE_ALIGNED
(16,
float
,
g_temp
)[42][48];
94
float
q_temp
[42][48];
95
uint8_t
s_indexmapped
[8][48];
97
float
env_facs
[6][48];
99
float
noise_facs
[3][5];
101
uint8_t
t_env
[8];
103
uint8_t
t_env_num_env_old
;
105
uint8_t
t_q
[3];
106
unsigned
f_indexnoise
;
107
unsigned
f_indexsine
;
109
}
SBRData
;
110
114
typedef
struct
SpectralBandReplication
{
115
int
sample_rate
;
116
int
start
;
117
int
reset
;
118
SpectrumParameters
spectrum_params
;
119
int
bs_amp_res_header
;
124
unsigned
bs_limiter_bands
;
125
unsigned
bs_limiter_gains
;
126
unsigned
bs_interpol_freq
;
127
unsigned
bs_smoothing_mode
;
129
unsigned
bs_coupling
;
130
unsigned
k
[5];
131
132
133
unsigned
kx
[2];
135
unsigned
m
[2];
136
unsigned
kx_and_m_pushed
;
138
unsigned
n_master
;
139
SBRData
data
[2];
140
PSContext
ps
;
142
unsigned
n
[2];
144
unsigned
n_q
;
146
unsigned
n_lim
;
148
uint16_t
f_master
[49];
150
uint16_t
f_tablelow
[25];
152
uint16_t
f_tablehigh
[49];
154
uint16_t
f_tablenoise
[6];
156
uint16_t
f_tablelim
[29];
157
unsigned
num_patches
;
158
uint8_t
patch_num_subbands
[6];
159
uint8_t
patch_start_subband
[6];
161
DECLARE_ALIGNED
(16,
float
,
X_low
)[32][40][2];
163
DECLARE_ALIGNED
(16,
float
,
X_high
)[64][40][2];
165
DECLARE_ALIGNED
(16,
float
,
X
)[2][2][38][64];
167
DECLARE_ALIGNED
(16,
float
,
alpha0
)[64][2];
169
DECLARE_ALIGNED
(16,
float
,
alpha1
)[64][2];
171
float
e_origmapped
[7][48];
173
float
q_mapped
[7][48];
175
uint8_t
s_mapped
[7][48];
177
float
e_curr
[7][48];
179
float
q_m
[7][48];
181
float
s_m
[7][48];
182
float
gain
[7][48];
183
DECLARE_ALIGNED
(32,
float
,
qmf_filter_scratch
)[5][64];
184
FFTContext
mdct_ana
;
185
FFTContext
mdct
;
186
SBRDSPContext
dsp
;
187
}
SpectralBandReplication
;
188
189
#endif
/* AVCODEC_SBR_H */
Generated on Sun Jun 1 2014 17:55:33 for Libav by
1.8.1.2