www.pudn.com > CryptoPhone-src-031122.zip > interp.c
/* Copyright 2001,2002,2003 NAH6 * All Rights Reserved * * Parts Copyright DoD, Parts Copyright Starium * */ #include "main.h" #include "interp.h" #includestatic void InterpolateSubFrame( float cur_lsf[ORDER], float prev_lsf[ORDER], float lsfint[NUM_SF][ORDER], int sf); static void AnalCheckForMonotonicity( float cur_lsfint[NUM_SF][ORDER], float prev_lsfint[ORDER], int sf, int frame_num); static void SynthCheckForMonotonicity( float cur_lsf[ORDER], float prev_lsf[ORDER]); /************************************************************************** * * * ROUTINE * Interpolate * * FUNCTION * Interpolation of LSFs * SYNOPSIS * Interpolate(lsf, lsfint, where, frame_num) * * formal * * data I/O * name type type function * ------------------------------------------------------------------- * lsf float i Frame of LSFs * lsfint float o Frame of interpolated LSFs * where int i analysis/synthesis flag * frame_num int i Current frame number * ************************************************************************** * * CALLED BY * * Analysis Synthesis * **************************************************************************/ void Interpolate( float lsf[ORDER], float lsfint[NUM_SF][ORDER], int where, int frame_num) { int i; static float prev_ana_sf_lsf[ORDER]; static float prev_ana_ff_lsf[ORDER]= { 0.03, 0.05, 0.09, 0.13, 0.19, 0.23, 0.29, 0.33, 0.39, 0.44 }; static float prev_syn_lsf[ORDER]= { 0.03, 0.05, 0.09, 0.13, 0.19, 0.23, 0.29, 0.33, 0.39, 0.44 }; /* Perform interpolation depending on whether this is analysis or synthesis */ switch(where) { /* Analysis interpolation */ /*-----------------------------------------------------------------------*/ case ANALYSIS: for(i=0;i