diff options
Diffstat (limited to 'libspeex/vq.c')
-rw-r--r-- | libspeex/vq.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/libspeex/vq.c b/libspeex/vq.c index d40133f..609f124 100644 --- a/libspeex/vq.c +++ b/libspeex/vq.c @@ -36,7 +36,7 @@ #include "vq.h" #include "stack_alloc.h" -#include "misc.h" +#include "arch.h" #ifdef _USE_SSE #include <xmmintrin.h> @@ -70,29 +70,6 @@ int scal_quant32(spx_word32_t in, const spx_word32_t *boundary, int entries) return i; } -/*Finds the index of the entry in a codebook that best matches the input*/ -int vq_index(float *in, const float *codebook, int len, int entries) -{ - int i,j; - float min_dist=0; - int best_index=0; - for (i=0;i<entries;i++) - { - float dist=0; - for (j=0;j<len;j++) - { - float tmp = in[j]-*codebook++; - dist += tmp*tmp; - } - if (i==0 || dist<min_dist) - { - min_dist=dist; - best_index=i; - } - } - return best_index; -} - #ifndef OVERRIDE_VQ_NBEST /*Finds the indices of the n-best entries in a codebook*/ |