@ -16,6 +16,7 @@
# include "iLBC_define.h"
# include "iLBC_define.h"
# include "constants.h"
# include "constants.h"
# include "filter.h"
# include "filter.h"
# include "enhancer.h"
/*----------------------------------------------------------------*
/*----------------------------------------------------------------*
* Find index in array such that the array element with said
* Find index in array such that the array element with said
@ -23,7 +24,7 @@
* according to the squared - error criterion
* according to the squared - error criterion
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void NearestNeighbor (
static void NearestNeighbor (
int * index , /* (o) index of array element closest to value */
int * index , /* (o) index of array element closest to value */
float * array , /* (i) data array */
float * array , /* (i) data array */
float value , /* (i) value */
float value , /* (i) value */
@ -50,7 +51,7 @@ void NearestNeighbor(
* compute cross correlation between sequences
* compute cross correlation between sequences
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void mycorr1 (
static void mycorr1 (
float * corr , /* (o) correlation of seq1 and seq2 */
float * corr , /* (o) correlation of seq1 and seq2 */
float * seq1 , /* (i) first sequence */
float * seq1 , /* (i) first sequence */
int dim1 , /* (i) dimension first seq1 */
int dim1 , /* (i) dimension first seq1 */
@ -71,7 +72,7 @@ void mycorr1(
* upsample finite array assuming zeros outside bounds
* upsample finite array assuming zeros outside bounds
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void enh_upsample (
static void enh_upsample (
float * useq1 , /* (o) upsampled output sequence */
float * useq1 , /* (o) upsampled output sequence */
float * seq1 , /* (i) unupsampled sequence */
float * seq1 , /* (i) unupsampled sequence */
int dim1 , /* (i) dimension seq1 */
int dim1 , /* (i) dimension seq1 */
@ -153,7 +154,7 @@ void enh_upsample(
* sampling rate
* sampling rate
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void refiner (
static void refiner (
float * seg , /* (o) segment array */
float * seg , /* (o) segment array */
float * updStartPos , /* (o) updated start point */
float * updStartPos , /* (o) updated start point */
float * idata , /* (i) original data buffer */
float * idata , /* (i) original data buffer */
@ -240,7 +241,7 @@ void refiner(
* find the smoothed output data
* find the smoothed output data
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void smath (
static void smath (
float * odata , /* (o) smoothed output */
float * odata , /* (o) smoothed output */
float * sseq , /* (i) said second sequence of waveforms */
float * sseq , /* (i) said second sequence of waveforms */
int hl , /* (i) 2*hl+1 is sseq dimension */
int hl , /* (i) 2*hl+1 is sseq dimension */
@ -335,7 +336,7 @@ void smath(
* get the pitch - synchronous sample sequence
* get the pitch - synchronous sample sequence
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void getsseq (
static void getsseq (
float * sseq , /* (o) the pitch-synchronous sequence */
float * sseq , /* (o) the pitch-synchronous sequence */
float * idata , /* (i) original data */
float * idata , /* (i) original data */
int idatal , /* (i) dimension of data */
int idatal , /* (i) dimension of data */
@ -411,7 +412,7 @@ void getsseq(
* idata + centerStartPos + ENH_BLOCKL - 1
* idata + centerStartPos + ENH_BLOCKL - 1
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
void enhancer (
static void enhancer (
float * odata , /* (o) smoothed block, dimension blockl */
float * odata , /* (o) smoothed block, dimension blockl */
float * idata , /* (i) data buffer used for enhancing */
float * idata , /* (i) data buffer used for enhancing */
int idatal , /* (i) dimension idata */
int idatal , /* (i) dimension idata */