- Timestamp:
- Jul 26, 2006 5:04:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex/quant_lsp.c
r278 r628 41 41 #endif 42 42 43 44 43 #include "misc.h" 44 45 #ifdef BFIN_ASM 46 #include "quant_lsp_bfin.h" 47 #endif 45 48 46 49 #ifdef FIXED_POINT … … 91 94 92 95 /* Note: x is modified*/ 96 #ifndef OVERRIDE_LSP_QUANT 93 97 static int lsp_quant(spx_word16_t *x, const signed char *cdbk, int nbVec, int nbDim) 94 98 { … … 96 100 spx_word32_t dist; 97 101 spx_word16_t tmp; 98 spx_word32_t best_dist= 0;102 spx_word32_t best_dist=VERY_LARGE32; 99 103 int best_id=0; 100 104 const signed char *ptr=cdbk; … … 106 110 tmp=SUB16(x[j],SHL16((spx_word16_t)*ptr++,5)); 107 111 dist=MAC16_16(dist,tmp,tmp); 108 } 109 if (dist<best_dist || i==0)112 } 113 if (dist<best_dist) 110 114 { 111 115 best_dist=dist; … … 119 123 return best_id; 120 124 } 125 #endif 121 126 122 127 /* Note: x is modified*/ 128 #ifndef OVERRIDE_LSP_WEIGHT_QUANT 123 129 static int lsp_weight_quant(spx_word16_t *x, spx_word16_t *weight, const signed char *cdbk, int nbVec, int nbDim) 124 130 { … … 126 132 spx_word32_t dist; 127 133 spx_word16_t tmp; 128 spx_word32_t best_dist= 0;134 spx_word32_t best_dist=VERY_LARGE32; 129 135 int best_id=0; 130 136 const signed char *ptr=cdbk; … … 137 143 dist=MAC16_32_Q15(dist,weight[j],MULT16_16(tmp,tmp)); 138 144 } 139 if (dist<best_dist || i==0)145 if (dist<best_dist) 140 146 { 141 147 best_dist=dist; … … 148 154 return best_id; 149 155 } 150 156 #endif 151 157 152 158 void lsp_quant_nb(spx_lsp_t *lsp, spx_lsp_t *qlsp, int order, SpeexBits *bits)
Note: See TracChangeset
for help on using the changeset viewer.