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/sb_celp.h

    r278 r628  
    4343/**Structure representing the full state of the sub-band encoder*/ 
    4444typedef struct SBEncState { 
    45    const SpeexMode *mode;            /**< Pointer to the mode (containing for vtable info) */ 
    46    void *st_low;               /**< State of the low-band (narrowband) encoder */ 
    47    int    full_frame_size;     /**< Length of full-band frames*/ 
    48    int    frame_size;          /**< Length of high-band frames*/ 
    49    int    subframeSize;        /**< Length of high-band sub-frames*/ 
    50    int    nbSubframes;         /**< Number of high-band sub-frames*/ 
    51    int    windowSize;          /**< Length of high-band LPC window*/ 
    52    int    lpcSize;             /**< Order of high-band LPC analysis */ 
    53    int    bufSize;             /**< Buffer size */ 
    54    int    first;               /**< First frame? */ 
    55    float  lag_factor;          /**< Lag-windowing control parameter */ 
    56    spx_word16_t  lpc_floor;           /**< Controls LPC analysis noise floor */ 
    57    spx_word16_t  gamma1;              /**< Perceptual weighting coef 1 */ 
    58    spx_word16_t  gamma2;              /**< Perceptual weighting coef 2 */ 
     45   const SpeexMode *mode;         /**< Pointer to the mode (containing for vtable info) */ 
     46   void *st_low;                  /**< State of the low-band (narrowband) encoder */ 
     47   int    full_frame_size;        /**< Length of full-band frames*/ 
     48   int    frame_size;             /**< Length of high-band frames*/ 
     49   int    subframeSize;           /**< Length of high-band sub-frames*/ 
     50   int    nbSubframes;            /**< Number of high-band sub-frames*/ 
     51   int    windowSize;             /**< Length of high-band LPC window*/ 
     52   int    lpcSize;                /**< Order of high-band LPC analysis */ 
     53   int    bufSize;                /**< Buffer size */ 
     54   int    first;                  /**< First frame? */ 
     55   float  lag_factor;             /**< Lag-windowing control parameter */ 
     56   spx_word16_t  lpc_floor;       /**< Controls LPC analysis noise floor */ 
     57   spx_word16_t  gamma1;          /**< Perceptual weighting coef 1 */ 
     58   spx_word16_t  gamma2;          /**< Perceptual weighting coef 2 */ 
    5959 
    60    char  *stack;               /**< Temporary allocation stack */ 
    61    spx_sig_t *x0d, *x1d; /**< QMF filter signals*/ 
    62    spx_sig_t *high;                /**< High-band signal (buffer) */ 
    63    spx_sig_t *y0, *y1;             /**< QMF synthesis signals */ 
     60   char  *stack;                  /**< Temporary allocation stack */ 
     61   spx_sig_t *x0d, *x1d;          /**< QMF filter signals*/ 
     62   spx_sig_t *high;               /**< High-band signal (buffer) */ 
     63   spx_sig_t *y0, *y1;            /**< QMF synthesis signals */ 
    6464   spx_word16_t *h0_mem, *h1_mem; 
    6565   spx_word32_t *g0_mem, *g1_mem; /**< QMF memories */ 
    6666 
    67    spx_sig_t *excBuf;              /**< High-band excitation */ 
    68    spx_sig_t *exc;                 /**< High-band excitation (for QMF only)*/ 
    69    spx_sig_t *res;                 /**< Zero-input response (ringing) */ 
    70    spx_sig_t *sw;                  /**< Perceptually weighted signal */ 
    71    spx_sig_t *target;              /**< Weighted target signal (analysis by synthesis) */ 
    72    spx_word16_t *window;              /**< LPC analysis window */ 
    73    spx_word16_t *lagWindow;           /**< Auto-correlation window */ 
    74    spx_word16_t *autocorr;            /**< Auto-correlation (for LPC analysis) */ 
    75    spx_coef_t *lpc;                 /**< LPC coefficients */ 
    76    spx_lsp_t *lsp;                 /**< LSP coefficients */ 
    77    spx_lsp_t *qlsp;                /**< Quantized LSPs */ 
    78    spx_lsp_t *old_lsp;             /**< LSPs of previous frame */ 
    79    spx_lsp_t *old_qlsp;            /**< Quantized LSPs of previous frame */ 
    80    spx_lsp_t *interp_lsp;          /**< Interpolated LSPs for current sub-frame */ 
    81    spx_lsp_t *interp_qlsp;         /**< Interpolated quantized LSPs for current sub-frame */ 
    82    spx_coef_t *interp_lpc;          /**< Interpolated LPCs for current sub-frame */ 
    83    spx_coef_t *interp_qlpc;         /**< Interpolated quantized LPCs for current sub-frame */ 
    84    spx_coef_t *bw_lpc1;             /**< Bandwidth-expanded version of LPCs (#1) */ 
    85    spx_coef_t *bw_lpc2;             /**< Bandwidth-expanded version of LPCs (#2) */ 
     67   spx_sig_t *excBuf;             /**< High-band excitation */ 
     68   spx_sig_t *exc;                /**< High-band excitation (for QMF only)*/ 
     69   spx_sig_t *res;                /**< Zero-input response (ringing) */ 
     70   spx_sig_t *sw;                 /**< Perceptually weighted signal */ 
     71   const spx_word16_t *window;    /**< LPC analysis window */ 
     72   spx_word16_t *lagWindow;       /**< Auto-correlation window */ 
     73   spx_word16_t *autocorr;        /**< Auto-correlation (for LPC analysis) */ 
     74   spx_coef_t *lpc;               /**< LPC coefficients */ 
     75   spx_lsp_t *lsp;                /**< LSP coefficients */ 
     76   spx_lsp_t *qlsp;               /**< Quantized LSPs */ 
     77   spx_lsp_t *old_lsp;            /**< LSPs of previous frame */ 
     78   spx_lsp_t *old_qlsp;           /**< Quantized LSPs of previous frame */ 
     79   spx_lsp_t *interp_lsp;         /**< Interpolated LSPs for current sub-frame */ 
     80   spx_lsp_t *interp_qlsp;        /**< Interpolated quantized LSPs for current sub-frame */ 
     81   spx_coef_t *interp_lpc;        /**< Interpolated LPCs for current sub-frame */ 
     82   spx_coef_t *interp_qlpc;       /**< Interpolated quantized LPCs for current sub-frame */ 
     83   spx_coef_t *bw_lpc1;           /**< Bandwidth-expanded version of LPCs (#1) */ 
     84   spx_coef_t *bw_lpc2;           /**< Bandwidth-expanded version of LPCs (#2) */ 
    8685 
    87    spx_mem_t *mem_sp;              /**< Synthesis signal memory */ 
     86   spx_mem_t *mem_sp;             /**< Synthesis signal memory */ 
    8887   spx_mem_t *mem_sp2; 
    89    spx_mem_t *mem_sw;              /**< Perceptual signal memory */ 
     88   spx_mem_t *mem_sw;             /**< Perceptual signal memory */ 
    9089   spx_word32_t *pi_gain; 
     90   spx_sig_t *innov_save;         /**< If non-NULL, innovation is copied here */ 
     91   spx_sig_t *low_innov;          /**< Lower-band innovation is copied here magically */ 
    9192 
    92    float  vbr_quality;         /**< Quality setting for VBR encoding */ 
    93    int    vbr_enabled;         /**< 1 for enabling VBR, 0 otherwise */ 
    94    int    abr_enabled;         /**< ABR setting (in bps), 0 if off */ 
     93   float  vbr_quality;            /**< Quality setting for VBR encoding */ 
     94   int    vbr_enabled;            /**< 1 for enabling VBR, 0 otherwise */ 
     95   spx_int32_t vbr_max;           /**< Max bit-rate allowed in VBR mode (total) */ 
     96   spx_int32_t vbr_max_high;      /**< Max bit-rate allowed in VBR mode for the high-band */ 
     97   spx_int32_t abr_enabled;       /**< ABR setting (in bps), 0 if off */ 
    9598   float  abr_drift; 
    9699   float  abr_drift2; 
    97100   float  abr_count; 
    98    int    vad_enabled;         /**< 1 for enabling VAD, 0 otherwise */ 
     101   int    vad_enabled;            /**< 1 for enabling VAD, 0 otherwise */ 
    99102   float  relative_quality; 
    100103 
     
    104107   int    submodeSelect; 
    105108   int    complexity; 
    106    int    sampling_rate; 
     109   spx_int32_t sampling_rate; 
    107110 
    108111} SBEncState; 
     
    119122   int    lpcSize; 
    120123   int    first; 
    121    int    sampling_rate; 
     124   spx_int32_t sampling_rate; 
    122125   int    lpc_enh_enabled; 
    123126 
     
    129132 
    130133   spx_sig_t *exc; 
     134   spx_sig_t *excBuf; 
    131135   spx_lsp_t *qlsp; 
    132136   spx_lsp_t *old_qlsp; 
     
    136140   spx_mem_t *mem_sp; 
    137141   spx_word32_t *pi_gain; 
     142   spx_sig_t *innov_save;      /** If non-NULL, innovation is copied here */ 
     143   spx_sig_t *low_innov;       /** Lower-band innovation is copied here magically */ 
     144    
    138145   spx_int32_t seed; 
    139146 
Note: See TracChangeset for help on using the changeset viewer.