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 
39 typedef struct {
40  uint8_t bs_start_freq;
41  uint8_t bs_stop_freq;
42  uint8_t bs_xover_band;
43 
48  uint8_t bs_freq_scale;
49  uint8_t bs_alter_scale;
50  uint8_t bs_noise_bands;
53 
54 #define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2)
55 
59 typedef struct {
64  unsigned bs_frame_class;
66  unsigned bs_num_env;
67  uint8_t bs_freq_res[7];
68  unsigned bs_num_noise;
69  uint8_t bs_df_env[5];
70  uint8_t bs_df_noise[2];
71  uint8_t bs_invf_mode[2][5];
72  uint8_t bs_add_harmonic[48];
73  unsigned bs_amp_res;
80  DECLARE_ALIGNED(16, float, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE];
81  DECLARE_ALIGNED(16, float, analysis_filterbank_samples) [1312];
84  int e_a[2];
86  float bw_array[5];
88  float W[2][32][32][2];
90  float Y[2][38][64][2];
91  float g_temp[42][48];
92  float q_temp[42][48];
93  uint8_t s_indexmapped[8][48];
95  float env_facs[6][48];
97  float noise_facs[3][5];
99  uint8_t t_env[8];
103  uint8_t t_q[3];
104  unsigned f_indexnoise;
105  unsigned f_indexsine;
107 } SBRData;
108 
112 typedef struct {
114  int start;
115  int reset;
127  unsigned bs_coupling;
128  unsigned k[5];
129  unsigned kx[2];
133  unsigned m[2];
135  unsigned n_master;
139  unsigned n[2];
141  unsigned n_q;
143  unsigned n_lim;
145  uint16_t f_master[49];
147  uint16_t f_tablelow[25];
149  uint16_t f_tablehigh[49];
151  uint16_t f_tablenoise[6];
153  uint16_t f_tablelim[29];
154  unsigned num_patches;
155  uint8_t patch_num_subbands[6];
156  uint8_t patch_start_subband[6];
158  float X_low[32][40][2];
160  float X_high[64][40][2];
162  DECLARE_ALIGNED(16, float, X)[2][2][38][64];
164  float alpha0[64][2];
166  float alpha1[64][2];
168  float e_origmapped[7][48];
170  float q_mapped[7][48];
172  uint8_t s_mapped[7][48];
174  float e_curr[7][48];
176  float q_m[7][48];
178  float s_m[7][48];
179  float gain[7][48];
180  DECLARE_ALIGNED(16, float, qmf_filter_scratch)[5][64];
184 
185 #endif /* AVCODEC_SBR_H */
unsigned bs_add_harmonic_flag
Definition: sbr.h:65
unsigned bs_smoothing_mode
Definition: sbr.h:125
#define DECLARE_ALIGNED(n, t, v)
Definition: mem.h:55
unsigned n_lim
Number of limiter bands.
Definition: sbr.h:143
FFTContext mdct
Definition: sbr.h:182
uint8_t bs_xover_band
Definition: sbr.h:42
SpectrumParameters spectrum_params
Definition: sbr.h:116
Definition: vf_drawbox.c:32
const char data[16]
Definition: mxf.c:60
Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the pr...
Definition: sbr.h:39
unsigned num_patches
Definition: sbr.h:154
unsigned n_master
The number of frequency bands in f_master.
Definition: sbr.h:135
unsigned bs_interpol_freq
Definition: sbr.h:124
FFTContext mdct_ana
Definition: sbr.h:181
unsigned f_indexnoise
Definition: sbr.h:104
uint8_t t_env_num_env_old
Envelope time border of the last envelope of the previous frame.
Definition: sbr.h:101
Definition: fft.h:62
unsigned bs_amp_res
Definition: sbr.h:73
uint8_t bs_freq_scale
Definition: sbr.h:48
unsigned bs_limiter_gains
Definition: sbr.h:123
#define SBR_SYNTHESIS_BUF_SIZE
Definition: sbr.h:54
#define W(a, i, v)
Definition: jpegls.h:109
int synthesis_filterbank_samples_offset
Definition: sbr.h:82
uint8_t bs_noise_bands
Definition: sbr.h:50
uint8_t bs_stop_freq
Definition: sbr.h:41
unsigned f_indexsine
Definition: sbr.h:105
Spectral Band Replication per channel data.
Definition: sbr.h:59
unsigned bs_limiter_bands
Definition: sbr.h:122
uint8_t bs_alter_scale
Definition: sbr.h:49
unsigned bs_frame_class
Definition: sbr.h:64
unsigned bs_num_noise
Definition: sbr.h:68
unsigned n_q
Number of noise floor bands.
Definition: sbr.h:141
unsigned bs_coupling
Definition: sbr.h:127
Spectral Band Replication.
Definition: sbr.h:112
unsigned bs_num_env
Definition: sbr.h:66
PSContext ps
Definition: sbr.h:137
uint8_t bs_start_freq
Definition: sbr.h:40