Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/celt-0.7.0.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2009-10-20 03:07:38 +0400
committerJean-Marc Valin <jean-marc.valin@usherbrooke.ca>2009-10-20 03:07:38 +0400
commit328b8bd7fcfc63240f78a590c7349cf58c9936f0 (patch)
tree4828f5f96739429f1ef76ddbd122775a39613cd2
parent234969c9034f8c90148266b2e08999828d8368e2 (diff)
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.
-rw-r--r--libcelt/arch.h6
-rw-r--r--libcelt/celt.h2
-rw-r--r--libcelt/modes.c10
-rw-r--r--libcelt/quant_bands.c4
4 files changed, 4 insertions, 18 deletions
diff --git a/libcelt/arch.h b/libcelt/arch.h
index 084b298..ec43c7b 100644
--- a/libcelt/arch.h
+++ b/libcelt/arch.h
@@ -96,8 +96,7 @@ typedef celt_word32 celt_mask;
#define PGAIN_SCALING_1 (1.f/32768.f)
#define PGAIN_SHIFT 15
-#define DB_SCALING 256.f
-#define DB_SCALING_1 (1.f/256.f)
+#define DB_SHIFT 8
#define EPSILON 1
#define VERY_SMALL 0
@@ -151,9 +150,6 @@ typedef float celt_mask;
#define PGAIN_SCALING 1.f
#define PGAIN_SCALING_1 1.f
-#define DB_SCALING 1.f
-#define DB_SCALING_1 1.f
-
#define EPSILON 1e-15f
#define VERY_SMALL 1e-15f
#define VERY_LARGE32 1e15f
diff --git a/libcelt/celt.h b/libcelt/celt.h
index 37aee27..fbf47e3 100644
--- a/libcelt/celt.h
+++ b/libcelt/celt.h
@@ -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
diff --git a/libcelt/modes.c b/libcelt/modes.c
index 4411d6d..3faae9c 100644
--- a/libcelt/modes.c
+++ b/libcelt/modes.c
@@ -375,16 +375,6 @@ CELTMode *celt_mode_create(celt_int32 Fs, int frame_size, int *error)
#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);
mode->fft = pitch_state_alloc(MAX_PERIOD);
diff --git a/libcelt/quant_bands.c b/libcelt/quant_bands.c
index 9191c2f..753c01d 100644
--- a/libcelt/quant_bands.c
+++ b/libcelt/quant_bands.c
@@ -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]);
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);
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;
else
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);
prev[c] = mean+prev[c]+MULT16_16_Q15(Q15ONE-beta,q);