fixed a few trivial bugs: exporting celt_strerror(), changed DB_SCALING to a
shift and removed the chec for DISABLE_STEREO in the mode creation.
This commit is contained in:
parent
234969c903
commit
328b8bd7fc
4 changed files with 4 additions and 18 deletions
|
@ -96,8 +96,7 @@ typedef celt_word32 celt_mask;
|
||||||
#define PGAIN_SCALING_1 (1.f/32768.f)
|
#define PGAIN_SCALING_1 (1.f/32768.f)
|
||||||
#define PGAIN_SHIFT 15
|
#define PGAIN_SHIFT 15
|
||||||
|
|
||||||
#define DB_SCALING 256.f
|
#define DB_SHIFT 8
|
||||||
#define DB_SCALING_1 (1.f/256.f)
|
|
||||||
|
|
||||||
#define EPSILON 1
|
#define EPSILON 1
|
||||||
#define VERY_SMALL 0
|
#define VERY_SMALL 0
|
||||||
|
@ -151,9 +150,6 @@ typedef float celt_mask;
|
||||||
#define PGAIN_SCALING 1.f
|
#define PGAIN_SCALING 1.f
|
||||||
#define PGAIN_SCALING_1 1.f
|
#define PGAIN_SCALING_1 1.f
|
||||||
|
|
||||||
#define DB_SCALING 1.f
|
|
||||||
#define DB_SCALING_1 1.f
|
|
||||||
|
|
||||||
#define EPSILON 1e-15f
|
#define EPSILON 1e-15f
|
||||||
#define VERY_SMALL 1e-15f
|
#define VERY_SMALL 1e-15f
|
||||||
#define VERY_LARGE32 1e15f
|
#define VERY_LARGE32 1e15f
|
||||||
|
|
|
@ -269,7 +269,7 @@ EXPORT int celt_decoder_ctl(CELTDecoder * st, int request, ...);
|
||||||
|
|
||||||
/* @} */
|
/* @} */
|
||||||
|
|
||||||
const char *celt_strerror(int error);
|
EXPORT const char *celt_strerror(int error);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -375,16 +375,6 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
|
||||||
|
|
||||||
#endif /* !STATIC_MODES */
|
#endif /* !STATIC_MODES */
|
||||||
|
|
||||||
#ifdef DISABLE_STEREO
|
|
||||||
if (channels > 1)
|
|
||||||
{
|
|
||||||
celt_warning("Stereo support was disable from this build");
|
|
||||||
if (error)
|
|
||||||
*error = CELT_BAD_ARG;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
mdct_init(&mode->mdct, 2*mode->mdctSize);
|
mdct_init(&mode->mdct, 2*mode->mdctSize);
|
||||||
mode->fft = pitch_state_alloc(MAX_PERIOD);
|
mode->fft = pitch_state_alloc(MAX_PERIOD);
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ unsigned quant_coarse_energy(const CELTMode *m, celt_word16 *eBands, celt_word16
|
||||||
ec_laplace_encode_start(enc, &qi, prob[2*i], prob[2*i+1]);
|
ec_laplace_encode_start(enc, &qi, prob[2*i], prob[2*i+1]);
|
||||||
error[i+c*m->nbEBands] = f - SHL16(qi,8);
|
error[i+c*m->nbEBands] = f - SHL16(qi,8);
|
||||||
}
|
}
|
||||||
q = qi*DB_SCALING;
|
q = SHL16(qi,DB_SHIFT);
|
||||||
|
|
||||||
oldEBands[i+c*m->nbEBands] = MULT16_16_Q15(coef,oldEBands[i+c*m->nbEBands])+(mean+prev[c]+q);
|
oldEBands[i+c*m->nbEBands] = MULT16_16_Q15(coef,oldEBands[i+c*m->nbEBands])+(mean+prev[c]+q);
|
||||||
prev[c] = mean+prev[c]+MULT16_16_Q15(Q15ONE-beta,q);
|
prev[c] = mean+prev[c]+MULT16_16_Q15(Q15ONE-beta,q);
|
||||||
|
@ -252,7 +252,7 @@ void unquant_coarse_energy(const CELTMode *m, celt_ener *eBands, celt_word16 *ol
|
||||||
qi = -1;
|
qi = -1;
|
||||||
else
|
else
|
||||||
qi = ec_laplace_decode_start(dec, prob[2*i], prob[2*i+1]);
|
qi = ec_laplace_decode_start(dec, prob[2*i], prob[2*i+1]);
|
||||||
q = qi*DB_SCALING;
|
q = SHL16(qi,DB_SHIFT);
|
||||||
|
|
||||||
oldEBands[i+c*m->nbEBands] = MULT16_16_Q15(coef,oldEBands[i+c*m->nbEBands])+(mean+prev[c]+q);
|
oldEBands[i+c*m->nbEBands] = MULT16_16_Q15(coef,oldEBands[i+c*m->nbEBands])+(mean+prev[c]+q);
|
||||||
prev[c] = mean+prev[c]+MULT16_16_Q15(Q15ONE-beta,q);
|
prev[c] = mean+prev[c]+MULT16_16_Q15(Q15ONE-beta,q);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue