ref: b2df9275bddc1c491bd493127ef7be787307b277
parent: 2d1f388b58b0e7a3fa0744d5e2dae00e537a909f
author: rrt <rrt>
date: Wed Dec 6 12:29:36 EST 2006
Remove unused code. For now, leave in the integer code (indeed, it might be better only to use that as it should perform reasonably on all machines), but remove "fast" floating point and unused "LTP_CUT" code. Ignore NDEBUG, verbose switch is always available (it doesn't add any overhead that I can see).
--- a/src/libgsm/Makefile.in
+++ b/src/libgsm/Makefile.in
@@ -26,11 +26,6 @@
######### Define this if your host multiplies floats faster than integers,
######### e.g. on a SPARCstation.
-#FAST = -DFAST
-FAST =
-######### Define together with USE_FLOAT_MUL to enable the GSM library's
-######### approximation option for incorrect, but good-enough results.
-
# LTP_CUT = -DLTP_CUT
LTP_CUT =
######### Define to enable the GSM library's long-term correlation
@@ -38,17 +33,9 @@
######### both integer and floating point multiplications.
######### This flag is still in the experimental stage.
-WAV49 = -DWAV49
-#WAV49 =
-######### Define to enable the GSM library's option to pack GSM frames
-######### in the style used by the WAV #49 format. If you want to write
-######### a tool that produces .WAV files which contain GSM-encoded data,
-######### define this, and read about the GSM_OPT_WAV49 option in the
-######### manual page on gsm_option(3).
-
# Build macros.
-CFLAGS = @CFLAGS@ @DEFS@ $(SASR) $(MULHAC) $(FAST) $(LTP_CUT) $(WAV49) -I$(top_srcdir)/gsm
+CFLAGS = @CFLAGS@ @DEFS@ $(SASR) $(MULHAC) $(FAST) $(LTP_CUT) -I$(top_srcdir)/gsm
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
--- a/src/libgsm/gsm.h
+++ b/src/libgsm/gsm.h
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/*$Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm.h,v 1.2 2006/12/06 17:10:51 rrt Exp $*/
+/*$Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm.h,v 1.3 2006/12/06 17:29:36 rrt Exp $*/
#ifndef GSM_H
#define GSM_H
@@ -26,8 +26,6 @@
#define GSM_MAJOR 1
#define GSM_OPT_VERBOSE 1
-#define GSM_OPT_FAST 2
-#define GSM_OPT_LTP_CUT 3
#define GSM_OPT_WAV49 4
#define GSM_OPT_FRAME_INDEX 5
#define GSM_OPT_FRAME_CHAIN 6
--- a/src/libgsm/gsm_decode.c
+++ b/src/libgsm/gsm_decode.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_decode.c,v 1.1 2006/08/27 23:04:56 cbagwell Exp $ */
+/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_decode.c,v 1.2 2006/12/06 17:29:36 rrt Exp $ */
#include "private.h"
@@ -14,7 +14,6 @@
{
word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4];
-#ifdef WAV49
if (s->wav_fmt) {
uword sr = 0;
@@ -247,7 +246,6 @@
}
}
else
-#endif
{
/* GSM_MAGIC = (*c >> 4) & 0xF; */
--- a/src/libgsm/gsm_encode.c
+++ b/src/libgsm/gsm_encode.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_encode.c,v 1.1 2006/08/27 23:04:56 cbagwell Exp $ */
+/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_encode.c,v 1.2 2006/12/06 17:29:36 rrt Exp $ */
#include "private.h"
#include "gsm.h"
@@ -102,8 +102,6 @@
xmc[51] 3
*/
-#ifdef WAV49
-
if (s->wav_fmt) {
s->frame_index = !s->frame_index;
if (s->frame_index) {
@@ -342,7 +340,6 @@
else
-#endif /* WAV49 */
{
*c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */
--- a/src/libgsm/gsm_option.3
+++ b/src/libgsm/gsm_option.3
@@ -48,32 +48,6 @@
.in-5
.sp
.PP
-.I GSM_OPT_FAST
-Faster compression algorithm.
-.br
-.in+5
-This implementation offers a not strictly standard-compliant, but
-faster compression algorithm that is compatible with the regular
-method and does not noticably degrade audio quality.
-.br
-The value passed to
-.br
-.nf
- gsm_option(handle, GSM_OPT_FAST, & value)
-.fi
-.br
-functions as a boolean flag; if it is zero, the regular algorithm
-will be used, if not, the faster version will be used.
-.br
-The availability of this option depends on the hardware used;
-if it is not available, gsm_option will return -1 on an attempt
-to set or query it.
-.br
-This option can be set any time during encoding or decoding.
-.in-5
-.ne 5
-.sp
-.PP
.I GSM_OPT_LTP_CUT
Enable, disable, or query the LTP cut-off optimization.
.br
--- a/src/libgsm/gsm_option.c
+++ b/src/libgsm/gsm_option.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_option.c,v 1.1 2006/08/27 23:04:56 cbagwell Exp $ */
+/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/gsm_option.c,v 1.2 2006/12/06 17:29:36 rrt Exp $ */
#include "private.h"
@@ -15,50 +15,24 @@
int result = -1;
switch (opt) {
- case GSM_OPT_LTP_CUT:
-#ifdef LTP_CUT
- result = r->ltp_cut;
- if (val) r->ltp_cut = *val;
-#endif
- break;
-
case GSM_OPT_VERBOSE:
-#ifndef NDEBUG
result = r->verbose;
if (val) r->verbose = *val;
-#endif
break;
- case GSM_OPT_FAST:
-
-#if defined(FAST) && defined(USE_FLOAT_MUL)
- result = r->fast;
- if (val) r->fast = !!*val;
-#endif
- break;
-
case GSM_OPT_FRAME_CHAIN:
-
-#ifdef WAV49
result = r->frame_chain;
if (val) r->frame_chain = *val;
-#endif
break;
case GSM_OPT_FRAME_INDEX:
-
-#ifdef WAV49
result = r->frame_index;
if (val) r->frame_index = *val;
-#endif
break;
case GSM_OPT_WAV49:
-
-#ifdef WAV49
result = r->wav_fmt;
if (val) r->wav_fmt = !!*val;
-#endif
break;
default:
--- a/src/libgsm/long_term.c
+++ b/src/libgsm/long_term.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/long_term.c,v 1.1 2006/08/27 23:04:56 cbagwell Exp $ */
+/* $Header: /cvsroot/sox/sox/src/libgsm/Attic/long_term.c,v 1.2 2006/12/06 17:29:36 rrt Exp $ */
#include <stdio.h>
#include <assert.h>
@@ -30,128 +30,13 @@
* performed to avoid overflow.
*/
- /* The next procedure exists in six versions. First two integer
- * version (if USE_FLOAT_MUL is not defined); then four floating
- * point versions, twice with proper scaling (USE_FLOAT_MUL defined),
- * once without (USE_FLOAT_MUL and FAST defined, and fast run-time
- * option used). Every pair has first a Cut version (see the -C
- * option to toast or the LTP_CUT option to gsm_option()), then the
- * uncut one. (For a detailed explanation of why this is altogether
- * a bad idea, see Henry Spencer and Geoff Collyer, ``#ifdef Considered
- * Harmful''.)
+ /* The next procedure exists in two versions: an integer
+ * version (if USE_FLOAT_MUL is not defined), then a floating
+ * point version.
*/
#ifndef USE_FLOAT_MUL
-#ifdef LTP_CUT
-
-static void Cut_Calculation_of_the_LTP_parameters (
-
- struct gsm_state * st,
-
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
- word wt[40];
-
- longword L_result;
- longword L_max, L_power;
- word R, S, dmax, scal, best_k;
- word ltp_cut;
-
- register word temp, wt_k;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) {
- dmax = temp;
- best_k = k;
- }
- }
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- assert(dmax > 0);
- temp = gsm_norm( (longword)dmax << 16 );
- }
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
- assert(scal >= 0);
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
- wt_k = SASR(d[best_k], scal);
-
- for (lambda = 40; lambda <= 120; lambda++) {
- L_result = (longword)wt_k * dp[best_k - lambda];
- if (L_result > L_max) {
- Nc = lambda;
- L_max = L_result;
- }
- }
- *Nc_out = Nc;
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
- assert(scal <= 100 && scal >= -100);
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- assert( Nc <= 120 && Nc >= 40);
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
static void Calculation_of_the_LTP_parameters (
register word * d, /* [0..39] IN */
register word * dp, /* [-120..-1] IN */
@@ -287,186 +172,6 @@
#else /* USE_FLOAT_MUL */
-#ifdef LTP_CUT
-
-static void Cut_Calculation_of_the_LTP_parameters (
- struct gsm_state * st, /* IN */
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
- word ltp_cut;
-
- float wt_float[40];
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- longword L_max, L_power;
- word R, S, dmax, scal;
- register word temp;
-
- /* Search of the optimum scaling of d[0..39].
- */
- dmax = 0;
-
- for (k = 0; k <= 39; k++) {
- temp = d[k];
- temp = GSM_ABS( temp );
- if (temp > dmax) dmax = temp;
- }
-
- temp = 0;
- if (dmax == 0) scal = 0;
- else {
- assert(dmax > 0);
- temp = gsm_norm( (longword)dmax << 16 );
- }
-
- if (temp > 6) scal = 0;
- else scal = 6 - temp;
-
- assert(scal >= 0);
- ltp_cut = (longword)SASR(dmax, scal) * st->ltp_cut / 100;
-
-
- /* Initialization of a working array wt
- */
-
- for (k = 0; k < 40; k++) {
- register word w = SASR( d[k], scal );
- if (w < 0 ? w > -ltp_cut : w < ltp_cut) {
- wt_float[k] = 0.0;
- }
- else {
- wt_float[k] = w;
- }
- }
- for (k = -120; k < 0; k++) dp_float[k] = dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda += 9) {
-
- /* Calculate L_result for l = lambda .. lambda + 9.
- */
- register float *lp = dp_float - lambda;
-
- register float W;
- register float a = lp[-8], b = lp[-7], c = lp[-6],
- d = lp[-5], e = lp[-4], f = lp[-3],
- g = lp[-2], h = lp[-1];
- register float E;
- register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0,
- S5 = 0, S6 = 0, S7 = 0, S8 = 0;
-
-# undef STEP
-# define STEP(K, a, b, c, d, e, f, g, h) \
- if ((W = wt_float[K]) != 0.0) { \
- E = W * a; S8 += E; \
- E = W * b; S7 += E; \
- E = W * c; S6 += E; \
- E = W * d; S5 += E; \
- E = W * e; S4 += E; \
- E = W * f; S3 += E; \
- E = W * g; S2 += E; \
- E = W * h; S1 += E; \
- a = lp[K]; \
- E = W * a; S0 += E; } else (a = lp[K])
-
-# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h)
-# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a)
-# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b)
-# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c)
-# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d)
-# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e)
-# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f)
-# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g)
-
- STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3);
- STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7);
-
- STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11);
- STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15);
-
- STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19);
- STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23);
-
- STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27);
- STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31);
-
- STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35);
- STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39);
-
- if (S0 > L_max) { L_max = S0; Nc = lambda; }
- if (S1 > L_max) { L_max = S1; Nc = lambda + 1; }
- if (S2 > L_max) { L_max = S2; Nc = lambda + 2; }
- if (S3 > L_max) { L_max = S3; Nc = lambda + 3; }
- if (S4 > L_max) { L_max = S4; Nc = lambda + 4; }
- if (S5 > L_max) { L_max = S5; Nc = lambda + 5; }
- if (S6 > L_max) { L_max = S6; Nc = lambda + 6; }
- if (S7 > L_max) { L_max = S7; Nc = lambda + 7; }
- if (S8 > L_max) { L_max = S8; Nc = lambda + 8; }
-
- }
- *Nc_out = Nc;
-
- L_max <<= 1;
-
- /* Rescaling of L_max
- */
- assert(scal <= 100 && scal >= -100);
- L_max = L_max >> (6 - scal); /* sub(6, scal) */
-
- assert( Nc <= 120 && Nc >= 40);
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- L_power = 0;
- for (k = 0; k <= 39; k++) {
-
- register longword L_temp;
-
- L_temp = SASR( dp[k - Nc], 3 );
- L_power += L_temp * L_temp;
- }
- L_power <<= 1; /* from L_MULT */
-
- /* Normalization of L_max and L_power
- */
-
- if (L_max <= 0) {
- *bc_out = 0;
- return;
- }
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- temp = gsm_norm( L_power );
-
- R = SASR( L_max << temp, 16 );
- S = SASR( L_power << temp, 16 );
-
- /* Coding of the LTP gain
- */
-
- /* Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
static void Calculation_of_the_LTP_parameters (
register word * d, /* [0..39] IN */
register word * dp, /* [-120..-1] IN */
@@ -630,200 +335,6 @@
*bc_out = bc;
}
-#ifdef FAST
-#ifdef LTP_CUT
-
-static void Cut_Fast_Calculation_of_the_LTP_parameters (
- struct gsm_state * st, /* IN */
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- register float wt_float;
- word Nc, bc;
- word wt_max, best_k, ltp_cut;
-
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- register float L_result, L_max, L_power;
-
- wt_max = 0;
-
- for (k = 0; k < 40; ++k) {
- if ( d[k] > wt_max) wt_max = d[best_k = k];
- else if (-d[k] > wt_max) wt_max = -d[best_k = k];
- }
-
- assert(wt_max >= 0);
- wt_float = (float)wt_max;
-
- for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda++) {
- L_result = wt_float * dp_float[best_k - lambda];
- if (L_result > L_max) {
- Nc = lambda;
- L_max = L_result;
- }
- }
-
- *Nc_out = Nc;
- if (L_max <= 0.) {
- *bc_out = 0;
- return;
- }
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- dp_float -= Nc;
- L_power = 0;
- for (k = 0; k < 40; ++k) {
- register float f = dp_float[k];
- L_power += f * f;
- }
-
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- /* Coding of the LTP gain
- * Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- lambda = L_max / L_power * 32768.;
- for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break;
- *bc_out = bc;
-}
-
-#endif /* LTP_CUT */
-
-static void Fast_Calculation_of_the_LTP_parameters (
- register word * d, /* [0..39] IN */
- register word * dp, /* [-120..-1] IN */
- word * bc_out, /* OUT */
- word * Nc_out /* OUT */
-)
-{
- register int k, lambda;
- word Nc, bc;
-
- float wt_float[40];
- float dp_float_base[120], * dp_float = dp_float_base + 120;
-
- register float L_max, L_power;
-
- for (k = 0; k < 40; ++k) wt_float[k] = (float)d[k];
- for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k];
-
- /* Search for the maximum cross-correlation and coding of the LTP lag
- */
- L_max = 0;
- Nc = 40; /* index for the maximum cross-correlation */
-
- for (lambda = 40; lambda <= 120; lambda += 9) {
-
- /* Calculate L_result for l = lambda .. lambda + 9.
- */
- register float *lp = dp_float - lambda;
-
- register float W;
- register float a = lp[-8], b = lp[-7], c = lp[-6],
- d = lp[-5], e = lp[-4], f = lp[-3],
- g = lp[-2], h = lp[-1];
- register float E;
- register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0,
- S5 = 0, S6 = 0, S7 = 0, S8 = 0;
-
-# undef STEP
-# define STEP(K, a, b, c, d, e, f, g, h) \
- W = wt_float[K]; \
- E = W * a; S8 += E; \
- E = W * b; S7 += E; \
- E = W * c; S6 += E; \
- E = W * d; S5 += E; \
- E = W * e; S4 += E; \
- E = W * f; S3 += E; \
- E = W * g; S2 += E; \
- E = W * h; S1 += E; \
- a = lp[K]; \
- E = W * a; S0 += E
-
-# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h)
-# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a)
-# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b)
-# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c)
-# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d)
-# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e)
-# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f)
-# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g)
-
- STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3);
- STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7);
-
- STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11);
- STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15);
-
- STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19);
- STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23);
-
- STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27);
- STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31);
-
- STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35);
- STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39);
-
- if (S0 > L_max) { L_max = S0; Nc = lambda; }
- if (S1 > L_max) { L_max = S1; Nc = lambda + 1; }
- if (S2 > L_max) { L_max = S2; Nc = lambda + 2; }
- if (S3 > L_max) { L_max = S3; Nc = lambda + 3; }
- if (S4 > L_max) { L_max = S4; Nc = lambda + 4; }
- if (S5 > L_max) { L_max = S5; Nc = lambda + 5; }
- if (S6 > L_max) { L_max = S6; Nc = lambda + 6; }
- if (S7 > L_max) { L_max = S7; Nc = lambda + 7; }
- if (S8 > L_max) { L_max = S8; Nc = lambda + 8; }
- }
- *Nc_out = Nc;
-
- if (L_max <= 0.) {
- *bc_out = 0;
- return;
- }
-
- /* Compute the power of the reconstructed short term residual
- * signal dp[..]
- */
- dp_float -= Nc;
- L_power = 0;
- for (k = 0; k < 40; ++k) {
- register float f = dp_float[k];
- L_power += f * f;
- }
-
- if (L_max >= L_power) {
- *bc_out = 3;
- return;
- }
-
- /* Coding of the LTP gain
- * Table 4.3a must be used to obtain the level DLB[i] for the
- * quantization of the LTP gain b to get the coded version bc.
- */
- lambda = L_max / L_power * 32768.;
- for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break;
- *bc_out = bc;
-}
-
-#endif /* FAST */
#endif /* USE_FLOAT_MUL */
@@ -878,23 +389,7 @@
assert( d ); assert( dp ); assert( e );
assert( dpp); assert( Nc ); assert( bc );
-#if defined(FAST) && defined(USE_FLOAT_MUL)
- if (S->fast)
-#if defined (LTP_CUT)
- if (S->ltp_cut)
- Cut_Fast_Calculation_of_the_LTP_parameters(S,
- d, dp, bc, Nc);
- else
-#endif /* LTP_CUT */
- Fast_Calculation_of_the_LTP_parameters(d, dp, bc, Nc );
- else
-#endif /* FAST & USE_FLOAT_MUL */
-#ifdef LTP_CUT
- if (S->ltp_cut)
- Cut_Calculation_of_the_LTP_parameters(S, d, dp, bc, Nc);
- else
-#endif
- Calculation_of_the_LTP_parameters(d, dp, bc, Nc);
+ Calculation_of_the_LTP_parameters(d, dp, bc, Nc);
Long_term_analysis_filtering( *bc, *Nc, dp, d, dpp, e );
}
--- a/src/libgsm/private.h
+++ b/src/libgsm/private.h
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/*$Header: /cvsroot/sox/sox/src/libgsm/Attic/private.h,v 1.1 2006/08/27 23:04:56 cbagwell Exp $*/
+/*$Header: /cvsroot/sox/sox/src/libgsm/Attic/private.h,v 1.2 2006/12/06 17:29:36 rrt Exp $*/
#ifndef PRIVATE_H
#define PRIVATE_H
@@ -33,7 +33,6 @@
word msr; /* decoder.c, Postprocessing */
char verbose; /* only used if !NDEBUG */
- char fast; /* only used if FAST */
char wav_fmt; /* only used if WAV49 defined */
unsigned char frame_index; /* odd/even chaining */