code.c File Reference

#include "config.h"
#include "proto.h"
#include "private.h"
#include "gsm.h"

Include dependency graph for code.c:

Go to the source code of this file.

Functions

char *memcpy P ((char *, char *, int))
void Gsm_Coder P8 ((S, s, LARc, Nc, bc, Mc, xmaxc, xMc), struct gsm_state *S, word *s, word *LARc, word *Nc, word *bc, word *Mc, word *xmaxc, word *xMc)


Function Documentation

char* memcpy P ( (char *, char *, int)   ) 

void Gsm_Coder P8 ( (S, s, LARc, Nc, bc, Mc, xmaxc, xMc)  ,
struct gsm_state S,
word *  s,
word *  LARc,
word *  Nc,
word *  bc,
word *  Mc,
word *  xmaxc,
word *  xMc 
)

Definition at line 26 of file code.c.

References gsm_state::dp0, e, and GSM_ADD().

00039                           :
00040  */
00041 
00042    word  * LARc,  /* [0..7] LAR coefficients    OUT   */
00043 
00044 /*
00045  * Procedure 4.2.11 to 4.2.18 are to be executed four times per
00046  * frame.  That means once for each sub-segment RPE-LTP analysis of
00047  * 40 samples.  These parts produce at the output of the coder:
00048  */
00049 
00050    word  * Nc, /* [0..3] LTP lag       OUT   */
00051    word  * bc, /* [0..3] coded LTP gain      OUT   */
00052    word  * Mc, /* [0..3] RPE grid selection     OUT     */
00053    word  * xmaxc,/* [0..3] Coded maximum amplitude OUT   */
00054    word  * xMc /* [13*4] normalized RPE samples OUT   */
00055 )
00056 {
00057    int   k;
00058    word  * dp  = S->dp0 + 120;   /* [ -120...-1 ] */
00059    word  * dpp = dp;    /* [ 0...39 ]   */
00060 
00061    word  e[50];
00062 
00063    word  so[160];
00064 
00065    memset(e,0,sizeof e);
00066    Gsm_Preprocess       (S, s, so);
00067    Gsm_LPC_Analysis     (S, so, LARc);
00068    Gsm_Short_Term_Analysis_Filter   (S, LARc, so);
00069 
00070    for (k = 0; k <= 3; k++, xMc += 13) {
00071 
00072       Gsm_Long_Term_Predictor ( S,
00073                 so+k*40, /* d      [0..39] IN   */
00074                 dp,    /* dp  [-120..-1] IN  */
00075                e + 5,     /* e      [0..39] OUT */
00076                dpp,    /* dpp    [0..39] OUT */
00077                 Nc++,
00078                 bc++);
00079 
00080       Gsm_RPE_Encoding  ( S,
00081                e + 5,   /* e    ][0..39][ IN/OUT */
00082                  xmaxc++, Mc++, xMc );
00083       /*
00084        * Gsm_Update_of_reconstructed_short_time_residual_signal
00085        *       ( dpp, e + 5, dp );
00086        */
00087 
00088       { register int i;
00089         for (i = 0; i <= 39; i++)
00090          dp[ i ] = GSM_ADD( e[5 + i], dpp[i] );
00091       }
00092       dp  += 40;
00093       dpp += 40;
00094 
00095    }
00096    (void)memcpy( (char *)S->dp0, (char *)(S->dp0 + 160),
00097       120 * sizeof(*S->dp0) );
00098 }
}


Generated on Thu Apr 16 06:30:13 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6