webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
bands.h
Go to the documentation of this file.
1 /* Copyright (c) 2007-2008 CSIRO
2  Copyright (c) 2007-2009 Xiph.Org Foundation
3  Copyright (c) 2008-2009 Gregory Maxwell
4  Written by Jean-Marc Valin and Gregory Maxwell */
5 /*
6  Redistribution and use in source and binary forms, with or without
7  modification, are permitted provided that the following conditions
8  are met:
9 
10  - Redistributions of source code must retain the above copyright
11  notice, this list of conditions and the following disclaimer.
12 
13  - Redistributions in binary form must reproduce the above copyright
14  notice, this list of conditions and the following disclaimer in the
15  documentation and/or other materials provided with the distribution.
16 
17  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */
29 
30 #ifndef BANDS_H
31 #define BANDS_H
32 
33 #include "arch.h"
34 #include "modes.h"
35 #include "entenc.h"
36 #include "entdec.h"
37 #include "rate.h"
38 
44 void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM);
45 
46 /*void compute_noise_energies(const CELTMode *m, const celt_sig *X, const opus_val16 *tonality, celt_ener *bandE);*/
47 
54 void normalise_bands(const CELTMode *m, const celt_sig * OPUS_RESTRICT freq, celt_norm * OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M);
55 
61 void denormalise_bands(const CELTMode *m, const celt_norm * OPUS_RESTRICT X,
62  celt_sig * OPUS_RESTRICT freq, const opus_val16 *bandE, int start,
63  int end, int M, int downsample, int silence);
64 
65 #define SPREAD_NONE (0)
66 #define SPREAD_LIGHT (1)
67 #define SPREAD_NORMAL (2)
68 #define SPREAD_AGGRESSIVE (3)
69 
70 int spreading_decision(const CELTMode *m, const celt_norm *X, int *average,
71  int last_decision, int *hf_average, int *tapset_decision, int update_hf,
72  int end, int C, int M);
73 
74 #ifdef MEASURE_NORM_MSE
75 void measure_norm_mse(const CELTMode *m, float *X, float *X0, float *bandE, float *bandE0, int M, int N, int C);
76 #endif
77 
78 void haar1(celt_norm *X, int N0, int stride);
79 
103 void quant_all_bands(int encode, const CELTMode *m, int start, int end,
104  celt_norm * X, celt_norm * Y, unsigned char *collapse_masks,
105  const celt_ener *bandE, int *pulses, int shortBlocks, int spread,
106  int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits,
107  opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed,
108  int arch);
109 
110 void anti_collapse(const CELTMode *m, celt_norm *X_,
111  unsigned char *collapse_masks, int LM, int C, int size, int start,
112  int end, const opus_val16 *logE, const opus_val16 *prev1logE,
113  const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed,
114  int arch);
115 
117 
118 int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev);
119 
120 #endif /* BANDS_H */
void denormalise_bands(const CELTMode *m, const celt_norm *OPUS_RESTRICT X, celt_sig *OPUS_RESTRICT freq, const opus_val16 *bandE, int start, int end, int M, int downsample, int silence)
Definition: bands.c:195
short encode(IlbcEncoder *iLBCenc_inst, int16_t *encoded_data, int16_t *data)
Definition: iLBC_testprogram.c:42
EGLStreamKHR EGLint EGLint EGLint size
Definition: eglext.h:984
float celt_sig
Definition: arch.h:151
GLuint GLuint end
Definition: gl2ext.h:323
long seed
Definition: float-mm.c:84
void anti_collapse(const CELTMode *m, celt_norm *X_, unsigned char *collapse_masks, int LM, int C, int size, int start, int end, const opus_val16 *logE, const opus_val16 *prev1logE, const opus_val16 *prev2logE, const int *pulses, opus_uint32 seed, int arch)
Definition: bands.c:267
const GLfloat * m
Definition: gl2ext.h:850
#define CELTMode
Definition: celt.h:51
int spreading_decision(const CELTMode *m, const celt_norm *X, int *average, int last_decision, int *hf_average, int *tapset_decision, int update_hf, int end, int C, int M)
Definition: bands.c:454
void normalise_bands(const CELTMode *m, const celt_sig *OPUS_RESTRICT freq, celt_norm *OPUS_RESTRICT X, const celt_ener *bandE, int end, int C, int M)
Definition: bands.c:176
void compute_band_energies(const CELTMode *m, const celt_sig *X, celt_ener *bandE, int end, int C, int LM)
Definition: bands.c:158
float opus_val16
Definition: arch.h:148
GLuint start
Definition: gl2ext.h:323
int opus_int32
Definition: opus_types.h:146
float celt_norm
Definition: arch.h:152
#define X(sym)
Definition: alsasymboltable_linux.h:139
Definition: entcode.h:62
void quant_all_bands(int encode, const CELTMode *m, int start, int end, celt_norm *X, celt_norm *Y, unsigned char *collapse_masks, const celt_ener *bandE, int *pulses, int shortBlocks, int spread, int dual_stereo, int intensity, int *tf_res, opus_int32 total_bits, opus_int32 balance, ec_ctx *ec, int M, int codedBands, opus_uint32 *seed, int arch)
Definition: bands.c:1363
#define N
Definition: gcc-loops.cpp:14
string arch
Definition: runtests.py:65
unsigned char average(unsigned char a, unsigned char b)
Definition: mathutil.h:526
M
Definition: parse_delay_file.m:61
unsigned int opus_uint32
Definition: opus_types.h:147
Definition: type_traits_unittest.cc:77
Various architecture definitions for CELT.
Definition: interfaces.idl:174
EGLImageKHR EGLint EGLint EGLint * stride
Definition: eglext.h:851
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301
int hysteresis_decision(opus_val16 val, const opus_val16 *thresholds, const opus_val16 *hysteresis, int N, int prev)
Definition: bands.c:46
void haar1(celt_norm *X, int N0, int stride)
Definition: bands.c:607
opus_uint32 celt_lcg_rand(opus_uint32 seed)
Definition: bands.c:61
float celt_ener
Definition: arch.h:153