Ignore:
Timestamp:
Jul 26, 2006 5:04:54 PM (18 years ago)
Author:
bennylp
Message:
  • Bring speex codec up to date with their SVN trunk
  • Speex codec should work in FIXED_POINT mode when PJ_HAS_FLOATING_POINT is set to zero.
  • ulaw2linear will return zero if zero is given (this would make the VAD works better, and it also fixed click noise when call is established/hangup).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/speex/quant_lsp.c

    r278 r628  
    4141#endif 
    4242 
    43  
    4443#include "misc.h" 
     44 
     45#ifdef BFIN_ASM 
     46#include "quant_lsp_bfin.h" 
     47#endif 
    4548 
    4649#ifdef FIXED_POINT 
     
    9194 
    9295/* Note: x is modified*/ 
     96#ifndef OVERRIDE_LSP_QUANT 
    9397static int lsp_quant(spx_word16_t *x, const signed char *cdbk, int nbVec, int nbDim) 
    9498{ 
     
    96100   spx_word32_t dist; 
    97101   spx_word16_t tmp; 
    98    spx_word32_t best_dist=0; 
     102   spx_word32_t best_dist=VERY_LARGE32; 
    99103   int best_id=0; 
    100104   const signed char *ptr=cdbk; 
     
    106110         tmp=SUB16(x[j],SHL16((spx_word16_t)*ptr++,5)); 
    107111         dist=MAC16_16(dist,tmp,tmp); 
    108       } 
    109       if (dist<best_dist || i==0) 
     112      }  
     113      if (dist<best_dist) 
    110114      { 
    111115         best_dist=dist; 
     
    119123   return best_id; 
    120124} 
     125#endif 
    121126 
    122127/* Note: x is modified*/ 
     128#ifndef OVERRIDE_LSP_WEIGHT_QUANT 
    123129static int lsp_weight_quant(spx_word16_t *x, spx_word16_t *weight, const signed char *cdbk, int nbVec, int nbDim) 
    124130{ 
     
    126132   spx_word32_t dist; 
    127133   spx_word16_t tmp; 
    128    spx_word32_t best_dist=0; 
     134   spx_word32_t best_dist=VERY_LARGE32; 
    129135   int best_id=0; 
    130136   const signed char *ptr=cdbk; 
     
    137143         dist=MAC16_32_Q15(dist,weight[j],MULT16_16(tmp,tmp)); 
    138144      } 
    139       if (dist<best_dist || i==0) 
     145      if (dist<best_dist) 
    140146      { 
    141147         best_dist=dist; 
     
    148154   return best_id; 
    149155} 
    150  
     156#endif 
    151157 
    152158void 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.