www.pudn.com > 200411301125332697.rar > pred_lt3.c


/* 
   ITU-T G.729 Speech Coder ANSI-C Source Code 
   Version 3.3    Last modified: December 26, 1995 
 
   Copyright (c) 1996, 
   AT&T, France Telecom, NTT, Universite de Sherbrooke, Lucent Technologies 
   All rights reserved. 
*/ 
 
/*-------------------------------------------------------------------* 
 * Function  Pred_lt_3()                                             * 
 *           ~~~~~~~~~~~                                             * 
 *-------------------------------------------------------------------* 
 * Compute the result of long term prediction with fractional        * 
 * interpolation of resolution 1/3.                                  * 
 *                                                                   * 
 * On return exc[0..L_subfr-1] contains the interpolated signal      * 
 *   (adaptive codebook excitation)                                  * 
 *-------------------------------------------------------------------*/ 
 
#include "typedef.h" 
#include "basic_op.h" 
#include "ld8k.h" 
#include "tab_ld8k.h" 
 
void Pred_lt_3( 
  Word16   exc[],       /* in/out: excitation buffer */ 
  Word16   T0,          /* input : integer pitch lag */ 
  Word16   frac,        /* input : fraction of lag   */ 
  Word16   L_subfr      /* input : subframe size     */ 
) 
{ 
  Word16   i, j, k; 
  Word16   *x0, *x1, *x2, *c1, *c2; 
  Word32  s; 
 
  x0 = &exc[-T0]; 
 
  frac = negate(frac); 
  if (frac < 0) 
  { 
    frac = add(frac, UP_SAMP); 
    x0--; 
  } 
 
  for (j=0; j