FFmpeg
1.2.12
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 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
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
37
typedef
struct
AACContext
AACContext
;
38
42
typedef
struct
SpectrumParameters
{
43
uint8_t
bs_start_freq
;
44
uint8_t
bs_stop_freq
;
45
uint8_t
bs_xover_band
;
46
51
uint8_t
bs_freq_scale
;
52
uint8_t
bs_alter_scale
;
53
uint8_t
bs_noise_bands
;
55
}
SpectrumParameters
;
56
57
#define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2)
58
62
typedef
struct
SBRData
{
67
unsigned
bs_frame_class
;
68
unsigned
bs_add_harmonic_flag
;
69
unsigned
bs_num_env
;
70
uint8_t
bs_freq_res
[7];
71
unsigned
bs_num_noise
;
72
uint8_t
bs_df_env
[5];
73
uint8_t
bs_df_noise
[2];
74
uint8_t
bs_invf_mode
[2][5];
75
uint8_t
bs_add_harmonic
[48];
76
unsigned
bs_amp_res
;
83
DECLARE_ALIGNED
(32,
float
,
synthesis_filterbank_samples
)[
SBR_SYNTHESIS_BUF_SIZE
];
84
DECLARE_ALIGNED
(32,
float
,
analysis_filterbank_samples
) [1312];
85
int
synthesis_filterbank_samples_offset
;
87
int
e_a
[2];
89
float
bw_array
[5];
91
float
W
[2][32][32][2];
93
int
Ypos
;
94
DECLARE_ALIGNED
(16,
float
,
Y
)[2][38][64][2];
95
DECLARE_ALIGNED
(16,
float
,
g_temp
)[42][48];
96
float
q_temp
[42][48];
97
uint8_t
s_indexmapped
[8][48];
99
float
env_facs
[6][48];
101
float
noise_facs
[3][5];
103
uint8_t
t_env
[8];
105
uint8_t
t_env_num_env_old
;
107
uint8_t
t_q
[3];
108
unsigned
f_indexnoise
;
109
unsigned
f_indexsine
;
111
}
SBRData
;
112
113
typedef
struct
SpectralBandReplication
SpectralBandReplication
;
114
118
typedef
struct
AACSBRContext
{
119
int (*
sbr_lf_gen
)(
AACContext
*ac,
SpectralBandReplication
*sbr,
120
float
X_low[32][40][2],
const
float
W
[2][32][32][2],
121
int
buf_idx);
122
void
(*
sbr_hf_assemble
)(
float
Y1[38][64][2],
123
const
float
X_high[64][40][2],
124
SpectralBandReplication
*sbr,
SBRData
*ch_data,
125
const
int
e_a[2]);
126
int (*
sbr_x_gen
)(
SpectralBandReplication
*sbr,
float
X[2][38][64],
127
const
float
Y0[38][64][2],
const
float
Y1[38][64][2],
128
const
float
X_low[32][40][2],
int
ch);
129
void
(*
sbr_hf_inverse_filter
)(
SBRDSPContext
*dsp,
130
float (*alpha0)[2], float (*alpha1)[2],
131
const
float
X_low[32][40][2],
int
k0);
132
}
AACSBRContext
;
133
137
struct
SpectralBandReplication
{
138
int
sample_rate
;
139
int
start
;
140
int
reset
;
141
SpectrumParameters
spectrum_params
;
142
int
bs_amp_res_header
;
147
unsigned
bs_limiter_bands
;
148
unsigned
bs_limiter_gains
;
149
unsigned
bs_interpol_freq
;
150
unsigned
bs_smoothing_mode
;
152
unsigned
bs_coupling
;
153
unsigned
k
[5];
154
155
156
unsigned
kx
[2];
158
unsigned
m
[2];
159
unsigned
kx_and_m_pushed
;
161
unsigned
n_master
;
162
SBRData
data
[2];
163
PSContext
ps
;
165
unsigned
n
[2];
167
unsigned
n_q
;
169
unsigned
n_lim
;
171
uint16_t
f_master
[49];
173
uint16_t
f_tablelow
[25];
175
uint16_t
f_tablehigh
[49];
177
uint16_t
f_tablenoise
[6];
179
uint16_t
f_tablelim
[30];
180
unsigned
num_patches
;
181
uint8_t
patch_num_subbands
[6];
182
uint8_t
patch_start_subband
[6];
184
DECLARE_ALIGNED
(16,
float
,
X_low
)[32][40][2];
186
DECLARE_ALIGNED
(16,
float
,
X_high
)[64][40][2];
188
DECLARE_ALIGNED
(16,
float
,
X
)[2][2][38][64];
190
DECLARE_ALIGNED
(16,
float
,
alpha0
)[64][2];
192
DECLARE_ALIGNED
(16,
float
,
alpha1
)[64][2];
194
float
e_origmapped
[7][48];
196
float
q_mapped
[7][48];
198
uint8_t
s_mapped
[7][48];
200
float
e_curr
[7][48];
202
float
q_m
[7][48];
204
float
s_m
[7][48];
205
float
gain
[7][48];
206
DECLARE_ALIGNED
(32,
float
,
qmf_filter_scratch
)[5][64];
207
FFTContext
mdct_ana
;
208
FFTContext
mdct
;
209
SBRDSPContext
dsp
;
210
AACSBRContext
c
;
211
};
212
213
#endif
/* AVCODEC_SBR_H */
Generated on Thu Feb 12 2015 17:56:57 for FFmpeg by
1.8.1.2