提交 07920c0a authored 作者: Michael Jerris's avatar Michael Jerris

update gsm codec based on codecs from open h323.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@171 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 342e7339
/*
* config.h
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header$*/
#ifndef CONFIG_H
#define CONFIG_H
#if 0
efine SIGHANDLER_T int /* signal handlers are void */
efine HAS_SYSV_SIGNAL 1 /* sigs not blocked/reset? */
#endif
/*efine SIGHANDLER_T int * signal handlers are void */
/*efine HAS_SYSV_SIGNAL 1 * sigs not blocked/reset? */
#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */
#if 0
efine HAS_LIMITS_H 1 /* /usr/include/limits.h */
#endif
/*efine HAS_LIMITS_H 1 * /usr/include/limits.h */
#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */
#if 0
efine HAS_ERRNO_DECL 1 /* errno.h declares errno */
#endif
/*efine HAS_ERRNO_DECL 1 * errno.h declares errno */
#define HAS_FSTAT 1 /* fstat syscall */
#define HAS_FCHMOD 1 /* fchmod syscall */
#define HAS_CHMOD 1 /* chmod syscall */
#define HAS_FCHOWN 1 /* fchown syscall */
#define HAS_CHOWN 1 /* chown syscall */
#if 0
efine HAS__FSETMODE 1 /* _fsetmode -- set file mode */
#endif
/*efine HAS__FSETMODE 1 * _fsetmode -- set file mode */
#define HAS_STRING_H 1 /* /usr/include/string.h */
#if 0
efine HAS_STRINGS_H 1 /* /usr/include/strings.h */
#endif
/*efine HAS_STRINGS_H 1 * /usr/include/strings.h */
#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */
#define HAS_UTIME 1 /* POSIX utime(path, times) */
#if 0
efine HAS_UTIMES 1 /* use utimes() syscall instead */
#endif
/*efine HAS_UTIMES 1 * use utimes() syscall instead */
#define HAS_UTIME_H 1 /* UTIME header file */
#if 0
efine HAS_UTIMBUF 1 /* struct utimbuf */
efine HAS_UTIMEUSEC 1 /* microseconds in utimbuf? */
#endif
/*efine HAS_UTIMBUF 1 * struct utimbuf */
/*efine HAS_UTIMEUSEC 1 * microseconds in utimbuf? */
#endif /* CONFIG_H */
/*
* gsm.h
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header$*/
#ifndef GSM_H
#define GSM_H
......
/*
* private.h
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header$*/
#ifndef PRIVATE_H
#define PRIVATE_H
......@@ -98,49 +99,6 @@ extern word gsm_asr P((word a, int n));
# define GSM_L_MULT(a, b) /* word a, word b */ \
(((longword)(a) * (longword)(b)) << 1)
#if defined(__GNUC__) && defined(__i386__)
static __inline__ int GSM_L_ADD(int a, int b)
{
__asm__ __volatile__(
"addl %2,%0; jno 0f; movl $0x7fffffff,%0; adcl $0,%0; 0:"
: "=r" (a)
: "0" (a), "ir" (b)
: "cc"
);
return(a);
}
static __inline__ short GSM_ADD(short a, short b)
{
__asm__ __volatile__(
"addw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:"
: "=r" (a)
: "0" (a), "ir" (b)
: "cc"
);
return(a);
}
static __inline__ short GSM_SUB(short a, short b)
{
__asm__ __volatile__(
"subw %2,%0; jno 0f; movw $0x7fff,%0; adcw $0,%0; 0:"
: "=r" (a)
: "0" (a), "ir" (b)
: "cc"
);
return(a);
}
#else
#ifdef WIN32
#define inline __inline
#define __inline__ __inline
#endif
# define GSM_L_ADD(a, b) \
( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \
: (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \
......@@ -149,21 +107,20 @@ static __inline__ short GSM_SUB(short a, short b)
: (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \
? MAX_LONGWORD : utmp))
static inline word GSM_ADD(a, b)
{
register longword ltmp;
ltmp = (longword) (a) + (longword) (b);
return (word)((ulongword) (ltmp - MIN_WORD) > MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp);
};
/*
* # define GSM_ADD(a, b) \
* ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \
* ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
*/
/* Nonportable, but faster: */
static inline word GSM_SUB(a, b)
{
register longword ltmp;
ltmp = (longword) (a) - (longword) (b);
return (word)(ltmp >= MAX_WORD ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp);
};
#define GSM_ADD(a, b) \
((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \
MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp)
#endif
# define GSM_SUB(a, b) \
((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \
? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp)
# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a))
......
/*
* proto.h
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header$*/
#ifndef PROTO_H
#define PROTO_H
......
/*
* unproto.h
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/*$Header$*/
#ifdef PROTO_H /* sic */
#undef PROTO_H
......
......@@ -156,10 +156,6 @@
RelativePath=".\src\code.c"
>
</File>
<File
RelativePath=".\src\debug.c"
>
</File>
<File
RelativePath=".\src\decode.c"
>
......@@ -181,29 +177,17 @@
>
</File>
<File
RelativePath=".\src\gsm_explode.c"
>
</File>
<File
RelativePath=".\src\gsm_implode.c"
RelativePath=".\src\gsm_lpc.c"
>
</File>
<File
RelativePath=".\src\gsm_option.c"
>
</File>
<File
RelativePath=".\src\gsm_print.c"
>
</File>
<File
RelativePath=".\src\long_term.c"
>
</File>
<File
RelativePath=".\src\lpc.c"
>
</File>
<File
RelativePath=".\src\preprocess.c"
>
......
/*
* add.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
/*
* See private.h for the more commonly used macro versions.
......@@ -23,19 +24,19 @@
word gsm_add P2((a,b), word a, word b)
{
longword sum = (longword)a + (longword)b;
return (word)saturate(sum);
return (word) saturate(sum);
}
word gsm_sub P2((a,b), word a, word b)
{
longword diff = (longword)a - (longword)b;
return (word)saturate(diff);
return (word) saturate(diff);
}
word gsm_mult P2((a,b), word a, word b)
{
if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD;
else return (word)SASR( (longword)a * (longword)b, 15 );
else return (word) SASR( (longword)a * (longword)b, 15 );
}
word gsm_mult_r P2((a,b), word a, word b)
......@@ -44,7 +45,7 @@ word gsm_mult_r P2((a,b), word a, word b)
else {
longword prod = (longword)a * (longword)b + 16384;
prod >>= 15;
return (word)(prod & 0xFFFF);
return (word) (prod & 0xFFFF);
}
}
......
/*
* code.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "config.h"
#ifdef HAS_STRING_H
#include <string.h>
#else
# include "proto.h"
#include "proto.h"
extern char * memcpy P((char *, char *, int));
#endif
......@@ -85,8 +86,9 @@ void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc),
*/
{ register int i;
register longword ltmp;
for (i = 0; i <= 39; i++)
dp[ i ] = GSM_ADD( e[5 + i], dpp[i] );
dp[ i ] = (word) GSM_ADD( e[5 + i], dpp[i] );
}
dp += 40;
dpp += 40;
......
/*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "private.h"
#ifndef NDEBUG
/* If NDEBUG _is_ defined and no debugging should be performed,
* calls to functions in this module are #defined to nothing
* in private.h.
*/
#include <stdio.h>
#include "proto.h"
void gsm_debug_words P4( (name, from, to, ptr),
char * name,
int from,
int to,
word * ptr)
{
int nprinted = 0;
fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
while (from <= to) {
fprintf(stderr, "%d ", ptr[ from ] );
from++;
if (nprinted++ >= 7) {
nprinted = 0;
if (from < to) putc('\n', stderr);
}
}
putc('\n', stderr);
}
void gsm_debug_longwords P4( (name, from, to, ptr),
char * name,
int from,
int to,
longword * ptr)
{
int nprinted = 0;
fprintf( stderr, "%s [%d .. %d]: ", name, from, to );
while (from <= to) {
fprintf(stderr, "%d ", ptr[ from ] );
from++;
if (nprinted++ >= 7) {
nprinted = 0;
if (from < to) putc('\n', stderr);
}
}
putc('\n', stderr);
}
void gsm_debug_longword P2( (name, value),
char * name,
longword value )
{
fprintf(stderr, "%s: %d\n", name, (long)value );
}
void gsm_debug_word P2( (name, value),
char * name,
word value )
{
fprintf(stderr, "%s: %d\n", name, (long)value);
}
#endif
/*
* decode.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
......@@ -22,12 +23,13 @@ static void Postprocessing P2((S,s),
{
register int k;
register word msr = S->msr;
register longword ltmp; /* for GSM_ADD */
register word tmp;
for (k = 160; k--; s++) {
tmp = (word)GSM_MULT_R( msr, 28180 );
msr = GSM_ADD(*s, tmp); /* Deemphasis */
*s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */
tmp = (word) GSM_MULT_R( msr, 28180 );
msr = (word) GSM_ADD(*s, tmp); /* Deemphasis */
*s = (word) GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */
}
S->msr = msr;
}
......
/*
* gsm_create.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
static char const ident[] = "$Header$";
#include "config.h"
......
/*
* gsm_decode.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "private.h"
......
/*
* gsm_destroy.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "gsm.h"
#include "config.h"
......
/*
* gsm_encode.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "private.h"
#include "gsm.h"
......
差异被折叠。
差异被折叠。
/*
* gsm_lpc.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include <assert.h>
......@@ -14,10 +15,6 @@
#include "gsm.h"
#include "proto.h"
#ifdef K6OPT
#include "k6opt.h"
#endif
#undef P
/*
......@@ -48,19 +45,12 @@ static void Autocorrelation P2((s, L_ACF),
/* Search for the maximum.
*/
#ifndef K6OPT
smax = 0;
for (k = 0; k <= 159; k++) {
temp = GSM_ABS( s[k] );
if (temp > smax) smax = temp;
}
#else
{
longword lmax;
lmax = k6maxmin(s,160,NULL);
smax = (lmax > MAX_WORD) ? MAX_WORD : lmax;
}
#endif
/* Computation of the scaling factor.
*/
if (smax == 0) scalauto = 0;
......@@ -73,7 +63,6 @@ static void Autocorrelation P2((s, L_ACF),
*/
if (scalauto > 0) {
# ifndef K6OPT
# ifdef USE_FLOAT_MUL
# define SCALE(n) \
......@@ -84,7 +73,7 @@ static void Autocorrelation P2((s, L_ACF),
# else
# define SCALE(n) \
case n: for (k = 0; k <= 159; k++) \
s[k] = (word)GSM_MULT_R( s[k], 16384 >> (n-1) );\
s[k] = (word) GSM_MULT_R( s[k], 16384 >> (n-1) );\
break;
# endif /* USE_FLOAT_MUL */
......@@ -95,10 +84,6 @@ static void Autocorrelation P2((s, L_ACF),
SCALE(4)
}
# undef SCALE
# else /* K6OPT */
k6vsraw(s,160,scalauto);
# endif
}
# ifdef USE_FLOAT_MUL
else for (k = 0; k <= 159; k++) float_s[k] = (float) s[k];
......@@ -106,7 +91,6 @@ static void Autocorrelation P2((s, L_ACF),
/* Compute the L_ACF[..].
*/
#ifndef K6OPT
{
# ifdef USE_FLOAT_MUL
register float * sp = float_s;
......@@ -153,24 +137,11 @@ static void Autocorrelation P2((s, L_ACF),
for (k = 9; k--; L_ACF[k] <<= 1) ;
}
#else
{
int k;
for (k=0; k<9; k++) {
L_ACF[k] = 2*k6iprod(s,s+k,160-k);
}
}
#endif
/* Rescaling of the array s[0..159]
*/
if (scalauto > 0) {
assert(scalauto <= 4);
#ifndef K6OPT
for (k = 160; k--; *s++ <<= scalauto) ;
# else /* K6OPT */
k6vsllw(s,160,scalauto);
# endif
}
}
......@@ -211,6 +182,7 @@ static void Reflection_coefficients P2( (L_ACF, r),
{
register int i, m, n;
register word temp;
register longword ltmp;
word ACF[9]; /* 0..8 */
word P[ 9]; /* 0..8 */
word K[ 9]; /* 2..8 */
......@@ -229,7 +201,7 @@ static void Reflection_coefficients P2( (L_ACF, r),
assert(temp >= 0 && temp < 32);
/* ? overflow ? */
for (i = 0; i <= 8; i++) ACF[i] = (word)SASR( L_ACF[i] << temp, 16 );
for (i = 0; i <= 8; i++) ACF[i] = (word) SASR( L_ACF[i] << temp, 16 );
/* Initialize array P[..] and K[..] for the recursion.
*/
......@@ -257,15 +229,15 @@ static void Reflection_coefficients P2( (L_ACF, r),
/* Schur recursion
*/
temp = (word)GSM_MULT_R( P[1], *r );
P[0] = GSM_ADD( P[0], temp );
temp = (word) GSM_MULT_R( P[1], *r );
P[0] = (word) GSM_ADD( P[0], temp );
for (m = 1; m <= 8 - n; m++) {
temp = (word)GSM_MULT_R( K[ m ], *r );
P[m] = GSM_ADD( P[ m+1 ], temp );
temp = (word) GSM_MULT_R( K[ m ], *r );
P[m] = (word) GSM_ADD( P[ m+1 ], temp );
temp = (word)GSM_MULT_R( P[ m+1 ], *r );
K[m] = GSM_ADD( K[ m ], temp );
temp = (word) GSM_MULT_R( P[ m+1 ], *r );
K[m] = (word) GSM_ADD( K[ m ], temp );
}
}
}
......@@ -318,6 +290,7 @@ static void Quantization_and_coding P1((LAR),
)
{
register word temp;
longword ltmp;
/* This procedure needs four tables; the following equations
......@@ -332,8 +305,8 @@ static void Quantization_and_coding P1((LAR),
# undef STEP
# define STEP( A, B, MAC, MIC ) \
temp = (word)GSM_MULT( A, *LAR ); \
temp = GSM_ADD( temp, B ); \
temp = GSM_ADD( temp, 256 ); \
temp = (word) GSM_ADD( temp, B ); \
temp = (word) GSM_ADD( temp, 256 ); \
temp = (word)SASR( temp, 9 ); \
*LAR = temp>MAC ? MAC - MIC : (temp<MIC ? 0 : temp - MIC); \
LAR++;
......
/*
* gsm_option.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include "private.h"
......
/*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include "private.h"
#include "gsm.h"
#include "proto.h"
int gsm_print P3((f, s, c), FILE * f, gsm s, gsm_byte * c)
{
word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4];
/* GSM_MAGIC = (*c >> 4) & 0xF; */
if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1;
LARc[0] = (*c++ & 0xF) << 2; /* 1 */
LARc[0] |= (*c >> 6) & 0x3;
LARc[1] = *c++ & 0x3F;
LARc[2] = (*c >> 3) & 0x1F;
LARc[3] = (*c++ & 0x7) << 2;
LARc[3] |= (*c >> 6) & 0x3;
LARc[4] = (*c >> 2) & 0xF;
LARc[5] = (*c++ & 0x3) << 2;
LARc[5] |= (*c >> 6) & 0x3;
LARc[6] = (*c >> 3) & 0x7;
LARc[7] = *c++ & 0x7;
Nc[0] = (*c >> 1) & 0x7F;
bc[0] = (*c++ & 0x1) << 1;
bc[0] |= (*c >> 7) & 0x1;
Mc[0] = (*c >> 5) & 0x3;
xmaxc[0] = (*c++ & 0x1F) << 1;
xmaxc[0] |= (*c >> 7) & 0x1;
xmc[0] = (*c >> 4) & 0x7;
xmc[1] = (*c >> 1) & 0x7;
xmc[2] = (*c++ & 0x1) << 2;
xmc[2] |= (*c >> 6) & 0x3;
xmc[3] = (*c >> 3) & 0x7;
xmc[4] = *c++ & 0x7;
xmc[5] = (*c >> 5) & 0x7;
xmc[6] = (*c >> 2) & 0x7;
xmc[7] = (*c++ & 0x3) << 1; /* 10 */
xmc[7] |= (*c >> 7) & 0x1;
xmc[8] = (*c >> 4) & 0x7;
xmc[9] = (*c >> 1) & 0x7;
xmc[10] = (*c++ & 0x1) << 2;
xmc[10] |= (*c >> 6) & 0x3;
xmc[11] = (*c >> 3) & 0x7;
xmc[12] = *c++ & 0x7;
Nc[1] = (*c >> 1) & 0x7F;
bc[1] = (*c++ & 0x1) << 1;
bc[1] |= (*c >> 7) & 0x1;
Mc[1] = (*c >> 5) & 0x3;
xmaxc[1] = (*c++ & 0x1F) << 1;
xmaxc[1] |= (*c >> 7) & 0x1;
xmc[13] = (*c >> 4) & 0x7;
xmc[14] = (*c >> 1) & 0x7;
xmc[15] = (*c++ & 0x1) << 2;
xmc[15] |= (*c >> 6) & 0x3;
xmc[16] = (*c >> 3) & 0x7;
xmc[17] = *c++ & 0x7;
xmc[18] = (*c >> 5) & 0x7;
xmc[19] = (*c >> 2) & 0x7;
xmc[20] = (*c++ & 0x3) << 1;
xmc[20] |= (*c >> 7) & 0x1;
xmc[21] = (*c >> 4) & 0x7;
xmc[22] = (*c >> 1) & 0x7;
xmc[23] = (*c++ & 0x1) << 2;
xmc[23] |= (*c >> 6) & 0x3;
xmc[24] = (*c >> 3) & 0x7;
xmc[25] = *c++ & 0x7;
Nc[2] = (*c >> 1) & 0x7F;
bc[2] = (*c++ & 0x1) << 1; /* 20 */
bc[2] |= (*c >> 7) & 0x1;
Mc[2] = (*c >> 5) & 0x3;
xmaxc[2] = (*c++ & 0x1F) << 1;
xmaxc[2] |= (*c >> 7) & 0x1;
xmc[26] = (*c >> 4) & 0x7;
xmc[27] = (*c >> 1) & 0x7;
xmc[28] = (*c++ & 0x1) << 2;
xmc[28] |= (*c >> 6) & 0x3;
xmc[29] = (*c >> 3) & 0x7;
xmc[30] = *c++ & 0x7;
xmc[31] = (*c >> 5) & 0x7;
xmc[32] = (*c >> 2) & 0x7;
xmc[33] = (*c++ & 0x3) << 1;
xmc[33] |= (*c >> 7) & 0x1;
xmc[34] = (*c >> 4) & 0x7;
xmc[35] = (*c >> 1) & 0x7;
xmc[36] = (*c++ & 0x1) << 2;
xmc[36] |= (*c >> 6) & 0x3;
xmc[37] = (*c >> 3) & 0x7;
xmc[38] = *c++ & 0x7;
Nc[3] = (*c >> 1) & 0x7F;
bc[3] = (*c++ & 0x1) << 1;
bc[3] |= (*c >> 7) & 0x1;
Mc[3] = (*c >> 5) & 0x3;
xmaxc[3] = (*c++ & 0x1F) << 1;
xmaxc[3] |= (*c >> 7) & 0x1;
xmc[39] = (*c >> 4) & 0x7;
xmc[40] = (*c >> 1) & 0x7;
xmc[41] = (*c++ & 0x1) << 2;
xmc[41] |= (*c >> 6) & 0x3;
xmc[42] = (*c >> 3) & 0x7;
xmc[43] = *c++ & 0x7; /* 30 */
xmc[44] = (*c >> 5) & 0x7;
xmc[45] = (*c >> 2) & 0x7;
xmc[46] = (*c++ & 0x3) << 1;
xmc[46] |= (*c >> 7) & 0x1;
xmc[47] = (*c >> 4) & 0x7;
xmc[48] = (*c >> 1) & 0x7;
xmc[49] = (*c++ & 0x1) << 2;
xmc[49] |= (*c >> 6) & 0x3;
xmc[50] = (*c >> 3) & 0x7;
xmc[51] = *c & 0x7; /* 33 */
fprintf(f,
"LARc:\t%2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d\n",
LARc[0],LARc[1],LARc[2],LARc[3],LARc[4],LARc[5],LARc[6],LARc[7]);
fprintf(f, "#1: Nc %4.4d bc %d Mc %d xmaxc %d\n",
Nc[0], bc[0], Mc[0], xmaxc[0]);
fprintf(f,
"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
xmc[0],xmc[1],xmc[2],xmc[3],xmc[4],xmc[5],xmc[6],
xmc[7],xmc[8],xmc[9],xmc[10],xmc[11],xmc[12] );
fprintf(f, "#2: Nc %4.4d bc %d Mc %d xmaxc %d\n",
Nc[1], bc[1], Mc[1], xmaxc[1]);
fprintf(f,
"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
xmc[13+0],xmc[13+1],xmc[13+2],xmc[13+3],xmc[13+4],xmc[13+5],
xmc[13+6], xmc[13+7],xmc[13+8],xmc[13+9],xmc[13+10],xmc[13+11],
xmc[13+12] );
fprintf(f, "#3: Nc %4.4d bc %d Mc %d xmaxc %d\n",
Nc[2], bc[2], Mc[2], xmaxc[2]);
fprintf(f,
"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
xmc[26+0],xmc[26+1],xmc[26+2],xmc[26+3],xmc[26+4],xmc[26+5],
xmc[26+6], xmc[26+7],xmc[26+8],xmc[26+9],xmc[26+10],xmc[26+11],
xmc[26+12] );
fprintf(f, "#4: Nc %4.4d bc %d Mc %d xmaxc %d\n",
Nc[3], bc[3], Mc[3], xmaxc[3]);
fprintf(f,
"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n",
xmc[39+0],xmc[39+1],xmc[39+2],xmc[39+3],xmc[39+4],xmc[39+5],
xmc[39+6], xmc[39+7],xmc[39+8],xmc[39+9],xmc[39+10],xmc[39+11],
xmc[39+12] );
return 0;
}
/* k6opt.h vector functions optimized for MMX extensions to x86
*
* Copyright (C) 1999 by Stanley J. Brooks <stabro@megsinet.net>
*
* Any use of this software is permitted provided that this notice is not
* removed and that neither the authors nor the Technische Universitaet Berlin
* are deemed to have made any representations as to the suitability of this
* software for any purpose nor are held responsible for any defects of
* this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE;
* not even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE.
*
* Chicago, 03.12.1999
* Stanley J. Brooks
*/
extern void Weighting_filter P2((e, x),
const word * e, /* signal [-5..0.39.44] IN */
word * x /* signal [0..39] OUT */
)
;
extern longword k6maxcc P3((wt,dp,Nc_out),
const word *wt,
const word *dp,
word * Nc_out /* OUT */
)
;
/*
* k6maxmin(p,n,out[])
* input p[n] is array of shorts (require n>0)
* returns (long) maximum absolute value..
* if out!=NULL, also returns out[0] the maximum and out[1] the minimum
*/
extern longword k6maxmin P3((p,n,out),
const word *p,
int n,
word *out /* out[0] is max, out[1] is min */
)
;
extern longword k6iprod P3((p,q,n),
const word *p,
const word *q,
int n
)
;
/*
* k6vsraw(p,n,bits)
* input p[n] is array of shorts (require n>0)
* shift/round each to the right by bits>=0 bits.
*/
extern void k6vsraw P3((p,n,bits),
const word *p,
int n,
int bits
)
;
/*
* k6vsllw(p,n,bits)
* input p[n] is array of shorts (require n>0)
* shift each to the left by bits>=0 bits.
*/
extern void k6vsllw P3((p,n,bits),
const word *p,
int n,
int bits
)
;
#if 1 /* there isn't any significant speed gain from mmx here: */
extern void Short_term_analysis_filteringx P4((u0,rp0,k_n,s),
register word * u0,
register word * rp0, /* [0..7] IN */
register int k_n, /* k_end - k_start */
register word * s /* [0..n-1] IN/OUT */
)
;
/*
#define Short_term_analysis_filtering Short_term_analysis_filteringx
*/
#endif
差异被折叠。
/*
* long_term.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include <assert.h>
......@@ -13,9 +14,7 @@
#include "gsm.h"
#include "proto.h"
#ifdef K6OPT
#include "k6opt.h"
#endif
/*
* 4.2.11 .. 4.2.12 LONG TERM PREDICTOR (LTP) SECTION
*/
......@@ -199,9 +198,6 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
/* Search for the maximum cross-correlation and coding of the LTP lag
*/
# ifdef K6OPT
L_max = k6maxcc(wt,dp,&Nc);
# else
L_max = 0;
Nc = 40; /* index for the maximum cross-correlation */
......@@ -239,7 +235,7 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
L_max = L_result;
}
}
# endif
*Nc_out = Nc;
L_max <<= 1;
......@@ -278,8 +274,8 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
temp = gsm_norm( L_power );
R = (word)SASR( L_max << temp, 16 );
S = (word)SASR( L_power << temp, 16 );
R = (word) SASR( L_max << temp, 16 );
S = (word) SASR( L_power << temp, 16 );
/* Coding of the LTP gain
*/
......@@ -852,12 +848,13 @@ static void Long_term_analysis_filtering P6((bc,Nc,dp,d,dpp,e),
*/
{
register int k;
register longword ltmp;
# undef STEP
# define STEP(BP) \
for (k = 0; k <= 39; k++) { \
dpp[k] = (word)GSM_MULT_R( BP, dp[k - Nc]); \
e[k] = GSM_SUB( d[k], dpp[k] ); \
dpp[k] = (word) GSM_MULT_R( BP, dp[k - Nc]); \
e[k] = (word) GSM_SUB( d[k], dpp[k] ); \
}
switch (bc) {
......@@ -920,6 +917,7 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
* table 4.3b.
*/
{
register longword ltmp; /* for ADD */
register int k;
word brp, drpp, Nr;
......@@ -939,8 +937,8 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
assert(brp != MIN_WORD);
for (k = 0; k <= 39; k++) {
drpp = (word)GSM_MULT_R( brp, drp[ k - Nr ] );
drp[k] = GSM_ADD( erp[k], drpp );
drpp = (word) GSM_MULT_R( brp, drp[ k - Nr ] );
drp[k] = (word) GSM_ADD( erp[k], drpp );
}
/*
......
/*
* preprocess.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include <assert.h>
......@@ -42,10 +43,14 @@ void Gsm_Preprocess P3((S, s, so),
word mp = S->mp;
word s1;
longword L_s2;
longword L_temp;
word msp, lsp;
word SO;
longword ltmp; /* for ADD */
ulongword utmp; /* for L_ADD */
register int k = 160;
......@@ -54,8 +59,7 @@ void Gsm_Preprocess P3((S, s, so),
/* 4.2.1 Downscaling of the input signal
*/
/* SO = SASR( *s, 3 ) << 2;*/
SO = SASR( *s, 1 ) & ~3;
SO = SASR( *s, 3 ) << 2;
s++;
assert (SO >= -0x4000); /* downscaled by */
......@@ -77,41 +81,21 @@ void Gsm_Preprocess P3((S, s, so),
assert(s1 != MIN_WORD);
/* SJB Remark: float might be faster than the mess that follows */
/* Compute the recursive part
*/
L_s2 = s1;
L_s2 <<= 15;
/* Execution of a 31 bv 16 bits multiplication
*/
{
word msp;
#ifndef __GNUC__
word lsp;
#endif
longword L_s2;
longword L_temp;
L_s2 = s1;
L_s2 <<= 15;
#ifndef __GNUC__
msp = (word)SASR( L_z2, 15 );
lsp = (word)(L_z2 & 0x7fff); /* gsm_L_sub(L_z2,(msp<<15)); */
msp = (word) SASR( L_z2, 15 );
lsp = (word) (L_z2-((longword)msp<<15)); /* gsm_L_sub(L_z2,(msp<<15)); */
L_s2 += GSM_MULT_R( lsp, 32735 );
L_temp = (longword)msp * 32735; /* GSM_L_MULT(msp,32735) >> 1;*/
L_z2 = GSM_L_ADD( L_temp, L_s2 );
/* above does L_z2 = L_z2 * 0x7fd5/0x8000 + L_s2 */
#else
L_z2 = ((long long)L_z2*32735 + 0x4000)>>15;
/* alternate (ansi) version of above line does slightly different rounding:
* L_temp = L_z2 >> 9;
* L_temp += L_temp >> 5;
* L_temp = (++L_temp) >> 1;
* L_z2 = L_z2 - L_temp;
*/
L_z2 = GSM_L_ADD(L_z2,L_s2);
#endif
/* Compute sof[k] with rounding
*/
L_temp = GSM_L_ADD( L_z2, 16384 );
......@@ -119,10 +103,9 @@ void Gsm_Preprocess P3((S, s, so),
/* 4.2.3 Preemphasis
*/
msp = (word)GSM_MULT_R( mp, -28180 );
mp = (word)SASR( L_temp, 15 );
*so++ = GSM_ADD( mp, msp );
}
msp = (word) GSM_MULT_R( mp, -28180 );
mp = (word) SASR( L_temp, 15 );
*so++ = (word) GSM_ADD( mp, msp );
}
S->z1 = z1;
......
/*
* rpe.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include <assert.h>
......@@ -18,9 +19,7 @@
*/
/* 4.2.13 */
#ifdef K6OPT
#include "k6opt.h"
#else
static void Weighting_filter P2((e, x),
register word * e, /* signal [-5..0.39.44] IN */
word * x /* signal [0..39] OUT */
......@@ -108,11 +107,10 @@ static void Weighting_filter P2((e, x),
*/
L_result = SASR( L_result, 13 );
x[k] = (word)( L_result < MIN_WORD ? MIN_WORD
: (L_result > MAX_WORD ? MAX_WORD : L_result ));
x[k] = (word) (( L_result < MIN_WORD ? MIN_WORD
: (L_result > MAX_WORD ? MAX_WORD : L_result )));
}
}
#endif /* K6OPT */
/* 4.2.14 */
......@@ -334,7 +332,7 @@ static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),
assert(temp1 >= 0 && temp1 < 16);
temp = xM[i] << temp1;
temp = (word)GSM_MULT( temp, temp2 );
temp = (word) GSM_MULT( temp, temp2 );
temp = SASR(temp, 12);
xMc[i] = temp + 4; /* see note below */
}
......@@ -362,6 +360,7 @@ static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),
{
int i;
word temp, temp1, temp2, temp3;
longword ltmp;
assert( mant >= 0 && mant <= 7 );
......@@ -378,8 +377,8 @@ static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),
assert( temp <= 7 && temp >= -7 ); /* 4 bit signed */
temp <<= 12; /* 16 bit signed */
temp = (word)GSM_MULT_R( temp1, temp );
temp = GSM_ADD( temp, temp3 );
temp = (word) GSM_MULT_R( temp1, temp );
temp = (word) GSM_ADD( temp, temp3 );
*xMp++ = gsm_asr( temp, temp2 );
}
}
......
/*
* short_term.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
#include <stdio.h>
#include <assert.h>
......@@ -13,12 +14,7 @@
#include "gsm.h"
#include "proto.h"
#ifdef K6OPT
#include "k6opt.h"
#define Short_term_analysis_filtering Short_term_analysis_filteringx
#endif
/*
* SHORT TERM ANALYSIS FILTERING SECTION
*/
......@@ -30,6 +26,7 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp),
word * LARpp) /* out: decoded .. */
{
register word temp1 /* , temp2 */;
register long ltmp; /* for GSM_ADD */
/* This procedure requires for efficient implementation
* two tables.
......@@ -56,10 +53,10 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp),
#undef STEP
#define STEP( B, MIC, INVA ) \
temp1 = GSM_ADD( *LARc++, MIC ) << 10; \
temp1 = GSM_SUB( temp1, B << 1 ); \
temp1 = (word)GSM_MULT_R( INVA, temp1 ); \
*LARpp++ = GSM_ADD( temp1, temp1 );
temp1 = (word) GSM_ADD( *LARc++, MIC ) << 10; \
temp1 = (word) GSM_SUB( temp1, B << 1 ); \
temp1 = (word) GSM_MULT_R( INVA, temp1 ); \
*LARpp++ = (word) GSM_ADD( temp1, temp1 );
STEP( 0, -32, 13107 );
STEP( 0, -32, 13107 );
......@@ -98,10 +95,11 @@ static void Coefficients_0_12 P3((LARpp_j_1, LARpp_j, LARp),
register word * LARp)
{
register int i;
register longword ltmp;
for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) {
*LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
*LARp = GSM_ADD( *LARp, SASR( *LARpp_j_1, 1));
*LARp = (word) GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
*LARp = (word) GSM_ADD( *LARp, SASR( *LARpp_j_1, 1));
}
}
......@@ -111,8 +109,9 @@ static void Coefficients_13_26 P3((LARpp_j_1, LARpp_j, LARp),
register word * LARp)
{
register int i;
register longword ltmp;
for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) {
*LARp = GSM_ADD( SASR( *LARpp_j_1, 1), SASR( *LARpp_j, 1 ));
*LARp = (word) GSM_ADD( SASR( *LARpp_j_1, 1), SASR( *LARpp_j, 1 ));
}
}
......@@ -122,10 +121,11 @@ static void Coefficients_27_39 P3((LARpp_j_1, LARpp_j, LARp),
register word * LARp)
{
register int i;
register longword ltmp;
for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) {
*LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
*LARp = GSM_ADD( *LARp, SASR( *LARpp_j, 1 ));
*LARp = (word) GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 ));
*LARp = (word) GSM_ADD( *LARp, SASR( *LARpp_j, 1 ));
}
}
......@@ -152,6 +152,7 @@ static void LARp_to_rp P1((LARp),
{
register int i;
register word temp;
register longword ltmp;
for (i = 1; i <= 8; i++, LARp++) {
......@@ -168,28 +169,21 @@ static void LARp_to_rp P1((LARp),
temp = *LARp == MIN_WORD ? MAX_WORD : -(*LARp);
*LARp = - ((temp < 11059) ? temp << 1
: ((temp < 20070) ? temp + 11059
: GSM_ADD( temp >> 2, 26112 )));
: (word) GSM_ADD( temp >> 2, 26112 )));
} else {
temp = *LARp;
*LARp = (temp < 11059) ? temp << 1
: ((temp < 20070) ? temp + 11059
: GSM_ADD( temp >> 2, 26112 ));
: (word) GSM_ADD( temp >> 2, 26112 ));
}
}
}
/* 4.2.10 */
#ifndef Short_term_analysis_filtering
/* SJB Remark:
* I tried 2 MMX versions of this function, neither is significantly
* faster than the C version which follows. MMX might be useful if
* one were processing 2 input streams in parallel.
*/
static void Short_term_analysis_filtering P4((u0,rp0,k_n,s),
register word * u0,
register word * rp0, /* [0..7] IN */
static void Short_term_analysis_filtering P4((S,rp,k_n,s),
struct gsm_state * S,
register word * rp, /* [0..7] IN */
register int k_n, /* k_end - k_start */
register word * s /* [0..n-1] IN/OUT */
)
......@@ -201,45 +195,45 @@ static void Short_term_analysis_filtering P4((u0,rp0,k_n,s),
* coefficient), it is assumed that the computation begins with index
* k_start (for arrays d[..] and s[..]) and stops with index k_end
* (k_start and k_end are defined in 4.2.9.1). This procedure also
* needs to keep the array u0[0..7] in memory for each call.
* needs to keep the array u[0..7] in memory for each call.
*/
{
register word * u_top = u0 + 8;
register word * s_top = s + k_n;
while (s < s_top) {
register word *u, *rp ;
register longword di, u_out;
di = u_out = *s;
for (rp=rp0, u=u0; u<u_top;) {
register longword ui, rpi;
ui = *u;
*u++ = (word)u_out;
rpi = *rp++;
u_out = ui + (((rpi*di)+0x4000)>>15);
di = di + (((rpi*ui)+0x4000)>>15);
/* make the common case fastest: */
if ((u_out == (word)u_out) && (di == (word)di)) continue;
/* otherwise do slower fixup (saturation) */
if (u_out>MAX_WORD) u_out=MAX_WORD;
else if (u_out<MIN_WORD) u_out=MIN_WORD;
if (di>MAX_WORD) di=MAX_WORD;
else if (di<MIN_WORD) di=MIN_WORD;
register word * u = S->u;
register int i;
register word di, zzz, ui, sav, rpi;
register longword ltmp;
for (; k_n--; s++) {
di = sav = *s;
for (i = 0; i < 8; i++) { /* YYY */
ui = u[i];
rpi = rp[i];
u[i] = sav;
zzz = (word) GSM_MULT_R(rpi, di);
sav = (word) GSM_ADD( ui, zzz);
zzz = (word) GSM_MULT_R(rpi, ui);
di = (word) GSM_ADD( di, zzz );
}
*s++ = (word)di;
*s = di;
}
}
#endif
#if defined(USE_FLOAT_MUL) && defined(FAST)
static void Fast_Short_term_analysis_filtering P4((u,rp,k_n,s),
register word * u;
static void Fast_Short_term_analysis_filtering P4((S,rp,k_n,s),
struct gsm_state * S,
register word * rp, /* [0..7] IN */
register int k_n, /* k_end - k_start */
register word * s /* [0..n-1] IN/OUT */
)
{
register word * u = S->u;
register int i;
float uf[8],
......@@ -269,15 +263,6 @@ static void Fast_Short_term_analysis_filtering P4((u,rp,k_n,s),
}
#endif /* ! (defined (USE_FLOAT_MUL) && defined (FAST)) */
/*
* SJB Remark: modified Short_term_synthesis_filtering() below
* for significant (abt 35%) speedup of decompression.
* (gcc-2.95, k6 cpu)
* Please don't change this without benchmarking decompression
* to see that you haven't harmed speed.
* This function burns most of CPU time for untoasting.
* Unfortunately, didn't see any good way to benefit from mmx.
*/
static void Short_term_synthesis_filtering P5((S,rrp,k,wt,sr),
struct gsm_state * S,
register word * rrp, /* [0..7] IN */
......@@ -288,36 +273,34 @@ static void Short_term_synthesis_filtering P5((S,rrp,k,wt,sr),
{
register word * v = S->v;
register int i;
register longword sri;
register word sri, tmp1, tmp2;
register longword ltmp; /* for GSM_ADD & GSM_SUB */
while (k--) {
sri = *wt++;
for (i = 8; i--;) {
register longword tmp1, tmp2;
/* sri = GSM_SUB( sri, gsm_mult_r( rrp[i], v[i] ) );
*/
tmp1 = rrp[i];
tmp2 = v[i];
tmp2 = (word) ( tmp1 == MIN_WORD && tmp2 == MIN_WORD
? MAX_WORD
: 0x0FFFF & (( (longword)tmp1 * (longword)tmp2
+ 16384) >> 15)) ;
sri = (word) GSM_SUB( sri, tmp2 );
tmp2 = (( tmp1 * tmp2 + 16384) >> 15) ;
/* saturation done below */
sri -= tmp2;
if (sri != (word)sri) {
sri = (sri<0)? MIN_WORD:MAX_WORD;
}
/* v[i+1] = GSM_ADD( v[i], gsm_mult_r( rrp[i], sri ) );
*/
tmp1 = (word) ( tmp1 == MIN_WORD && sri == MIN_WORD
? MAX_WORD
: 0x0FFFF & (( (longword)tmp1 * (longword)sri
+ 16384) >> 15)) ;
tmp1 = (( tmp1 * sri + 16384) >> 15) ;
/* saturation done below */
tmp1 += v[i];
if (tmp1 != (word)tmp1) {
tmp1 = (tmp1<0)? MIN_WORD:MAX_WORD;
}
v[i+1] = (word)tmp1;
v[i+1] = (word) GSM_ADD( v[i], tmp1);
}
*sr++ = v[0] = (word)sri;
*sr++ = v[0] = sri;
}
}
......@@ -388,20 +371,19 @@ void Gsm_Short_Term_Analysis_Filter P3((S,LARc,s),
Coefficients_0_12( LARpp_j_1, LARpp_j, LARp );
LARp_to_rp( LARp );
FILTER( S->u, LARp, 13, s);
FILTER( S, LARp, 13, s);
Coefficients_13_26( LARpp_j_1, LARpp_j, LARp);
LARp_to_rp( LARp );
FILTER( S->u, LARp, 14, s + 13);
FILTER( S, LARp, 14, s + 13);
Coefficients_27_39( LARpp_j_1, LARpp_j, LARp);
LARp_to_rp( LARp );
FILTER( S->u, LARp, 13, s + 27);
FILTER( S, LARp, 13, s + 27);
Coefficients_40_159( LARpp_j, LARp);
LARp_to_rp( LARp );
FILTER( S->u, LARp, 120, s + 40);
FILTER( S, LARp, 120, s + 40);
}
void Gsm_Short_Term_Synthesis_Filter P4((S, LARcr, wt, s),
......
/*
* table.c
*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
/* $Header$ */
/* Most of these tables are inlined at their point of use.
*/
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论