Commit 5f09ea56 authored by Jean-Marc Valin's avatar Jean-Marc Valin
Browse files

celt_mask_t for masking curves

parent 8835a4df
......@@ -54,7 +54,8 @@ typedef celt_int32_t celt_word32_t;
typedef celt_word32_t celt_sig_t;
typedef celt_word16_t celt_norm_t;
typedef celt_word32_t celt_ener_t;
typedef double celt_pgain_t;
typedef float celt_pgain_t;
typedef float celt_mask_t;
#define Q15ONE 32767
......@@ -99,6 +100,7 @@ typedef float celt_sig_t;
typedef float celt_norm_t;
typedef float celt_ener_t;
typedef float celt_pgain_t;
typedef float celt_mask_t;
#define Q15ONE 1.0f
......
......@@ -210,7 +210,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_p
/* Quantisation of the residual */
void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, float *W, int total_bits, ec_enc *enc)
void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t *W, int total_bits, ec_enc *enc)
{
int i, j, B, bits;
const int *eBands = m->eBands;
......
......@@ -81,7 +81,7 @@ void pitch_quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_p
* @param total_bits Total number of bits that can be used for the frame (including the ones already spent)
* @param enc Entropy encoder
*/
void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, float *W, int total_bits, ec_enc *enc);
void quant_bands(const CELTMode *m, celt_norm_t *X, celt_norm_t *P, celt_mask_t *W, int total_bits, ec_enc *enc);
/** Decoding of the residual spectrum
* @param m Mode data
......
......@@ -52,13 +52,13 @@ void find_spectral_pitch(kiss_fftr_cfg fft, struct PsyDecay *decay, celt_sig_t *
VARDECL(celt_word32_t *yy);
VARDECL(celt_word32_t *X);
VARDECL(celt_word32_t *Y);
VARDECL(float *curve);
VARDECL(celt_mask_t *curve);
int n2 = lag/2;
ALLOC(xx, lag*C, celt_word32_t);
ALLOC(yy, lag*C, celt_word32_t);
ALLOC(X, lag*C, celt_word32_t);
ALLOC(Y, lag*C, celt_word32_t);
ALLOC(curve, n2*C, float);
ALLOC(curve, n2*C, celt_mask_t);
for (i=0;i<C*lag;i++)
xx[i] = 0;
......
......@@ -76,7 +76,7 @@ void psydecay_clear(struct PsyDecay *decay)
celt_free(decay->decayL);
}
static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len)
static void spreading_func(struct PsyDecay *d, float *psd, celt_mask_t *mask, int len)
{
int i;
float mem;
......@@ -122,7 +122,7 @@ static void spreading_func(struct PsyDecay *d, float *psd, float *mask, int len)
}
/* Compute a marking threshold from the spectrum X. */
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len)
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask, int len)
{
int i;
VARDECL(float *psd);
......@@ -137,7 +137,7 @@ void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int
}
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len)
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask, int len)
{
int i;
VARDECL(float *psd);
......
......@@ -45,9 +45,9 @@ void psydecay_init(struct PsyDecay *decay, int len, celt_int32_t Fs);
void psydecay_clear(struct PsyDecay *decay);
/** Compute the masking curve for an input (DFT) spectrum X */
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len);
void compute_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask, int len);
/** Compute the masking curve for an input (MDCT) spectrum X */
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, float *mask, int len);
void compute_mdct_masking(struct PsyDecay *decay, celt_word32_t *X, celt_mask_t *mask, int len);
#endif /* PSY_H */
......@@ -71,7 +71,7 @@ struct NBest {
float yp;
};
void alg_quant(celt_norm_t *X, float *W, int N, int K, celt_norm_t *P, float alpha, ec_enc *enc)
void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, float alpha, ec_enc *enc)
{
int L = 3;
VARDECL(float *x);
......@@ -383,7 +383,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, celt_norm_t *P, float alpha, ec_d
static const float pg[11] = {1.f, .75f, .65f, 0.6f, 0.6f, .6f, .55f, .55f, .5f, .5f, .5f};
void intra_prediction(celt_norm_t *x, float *W, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_enc *enc)
void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_enc *enc)
{
int i,j;
int best=0;
......
......@@ -51,7 +51,7 @@
* @param alpha compression factor to apply in the pitch direction (magic!)
* @param enc Entropy encoder state
*/
void alg_quant(celt_norm_t *X, float *W, int N, int K, celt_norm_t *P, float alpha, ec_enc *enc);
void alg_quant(celt_norm_t *X, celt_mask_t *W, int N, int K, celt_norm_t *P, float alpha, ec_enc *enc);
/** Algebraic pulse decoder
* @param x Decoded normalised spectrum (returned)
......@@ -75,7 +75,7 @@ void alg_unquant(celt_norm_t *X, int N, int K, celt_norm_t *P, float alpha, ec_d
* @param N0 Number of valid offsets
* @param enc Entropy encoder state
*/
void intra_prediction(celt_norm_t *x, float *W, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_enc *enc);
void intra_prediction(celt_norm_t *x, celt_mask_t *W, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_enc *enc);
void intra_unquant(celt_norm_t *x, int N, int K, celt_norm_t *Y, celt_norm_t *P, int B, int N0, ec_dec *dec);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment