| SKP_Silk_SDK_API.h | | SKP_Silk_SDK_API.h | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 81 | |
| /* Read control structure from encoder */ | | /* Read control structure from encoder */ | |
| /***************************************/ | | /***************************************/ | |
| SKP_int SKP_Silk_SDK_QueryEncoder( /* O: Returns err
or code */ | | SKP_int SKP_Silk_SDK_QueryEncoder( /* O: Returns err
or code */ | |
| const void *encState, /* I: State
*/ | | const void *encState, /* I: State
*/ | |
| SKP_SILK_SDK_EncControlStruct *encStatus /* O: Encoder Sta
tus */ | | SKP_SILK_SDK_EncControlStruct *encStatus /* O: Encoder Sta
tus */ | |
| ); | | ); | |
| | | | |
| /**************************/ | | /**************************/ | |
| /* Encode frame with Silk */ | | /* Encode frame with Silk */ | |
| /**************************/ | | /**************************/ | |
|
| | | /* Note: if prefillFlag is set, the input must contain 10 ms of audio, irre | |
| | | spective of what */ | |
| | | /* encControl->payloadSize_ms is set to | |
| | | | |
| | | */ | |
| SKP_int SKP_Silk_SDK_Encode( /* O: Returns err
or code */ | | SKP_int SKP_Silk_SDK_Encode( /* O: Returns err
or code */ | |
| void *encState, /* I/O: State
*/ | | void *encState, /* I/O: State
*/ | |
| SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control sta
tus */ | | SKP_SILK_SDK_EncControlStruct *encControl, /* I: Control sta
tus */ | |
| const SKP_int16 *samplesIn, /* I: Speech samp
le input vector */ | | const SKP_int16 *samplesIn, /* I: Speech samp
le input vector */ | |
| SKP_int nSamplesIn, /* I: Number of s
amples in input vector */ | | SKP_int nSamplesIn, /* I: Number of s
amples in input vector */ | |
| ec_enc *psRangeEnc, /* I/O Compressor
data structure */ | | ec_enc *psRangeEnc, /* I/O Compressor
data structure */ | |
|
| SKP_int32 *nBytesOut /* I/O: Number of b | | SKP_int32 *nBytesOut, /* I/O: Number of b | |
| ytes in payload (input: Max bytes) */ | | ytes in payload (input: Max bytes) */ | |
| | | const SKP_int prefillFlag /* I: Flag to ind | |
| | | icate prefilling buffers no coding */ | |
| ); | | ); | |
| | | | |
| /****************************************/ | | /****************************************/ | |
| /* Decoder functions */ | | /* Decoder functions */ | |
| /****************************************/ | | /****************************************/ | |
| | | | |
| /***********************************************/ | | /***********************************************/ | |
| /* Get size in bytes of the Silk decoder state */ | | /* Get size in bytes of the Silk decoder state */ | |
| /***********************************************/ | | /***********************************************/ | |
| SKP_int SKP_Silk_SDK_Get_Decoder_Size( /* O: Returns err
or code */ | | SKP_int SKP_Silk_SDK_Get_Decoder_Size( /* O: Returns err
or code */ | |
| SKP_int32 *decSizeBytes /* O: Number of b
ytes in SILK decoder state */ | | SKP_int32 *decSizeBytes /* O: Number of b
ytes in SILK decoder state */ | |
| ); | | ); | |
| | | | |
| /*************************/ | | /*************************/ | |
| /* Init or Reset decoder */ | | /* Init or Reset decoder */ | |
| /*************************/ | | /*************************/ | |
| SKP_int SKP_Silk_SDK_InitDecoder( /* O: Returns err
or code */ | | SKP_int SKP_Silk_SDK_InitDecoder( /* O: Returns err
or code */ | |
| void *decState /* I/O: State
*/ | | void *decState /* I/O: State
*/ | |
| ); | | ); | |
| | | | |
|
| | | /************************************************************************** | |
| | | **********************/ | |
| | | /* Prefill LPC synthesis buffer, HP filter and upsampler. Input must be exa | |
| | | ctly 10 ms of audio. */ | |
| | | /************************************************************************** | |
| | | **********************/ | |
| | | SKP_int SKP_Silk_SDK_Decoder_prefill_buffers( /* O: Returns err | |
| | | or code */ | |
| | | void* decState, /* I/O: State | |
| | | */ | |
| | | SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control Str | |
| | | ucture */ | |
| | | const SKP_int16 *samplesIn, /* I: Speech samp | |
| | | le input vector (10 ms) */ | |
| | | SKP_int nSamplesIn /* I: Number of s | |
| | | amples in input vector */ | |
| | | ); | |
| | | | |
| /******************/ | | /******************/ | |
| /* Decode a frame */ | | /* Decode a frame */ | |
| /******************/ | | /******************/ | |
| SKP_int SKP_Silk_SDK_Decode( /* O: Returns err
or code */ | | SKP_int SKP_Silk_SDK_Decode( /* O: Returns err
or code */ | |
| void* decState, /* I/O: State
*/ | | void* decState, /* I/O: State
*/ | |
| SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control Str
ucture */ | | SKP_SILK_SDK_DecControlStruct* decControl, /* I/O: Control Str
ucture */ | |
| SKP_int lostFlag, /* I: 0: no loss,
1 loss, 2 decode fec */ | | SKP_int lostFlag, /* I: 0: no loss,
1 loss, 2 decode fec */ | |
| SKP_int newPacketFlag, /* I: Indicates f
irst decoder call for this packet */ | | SKP_int newPacketFlag, /* I: Indicates f
irst decoder call for this packet */ | |
| ec_dec *psRangeDec, /* I/O Compressor
data structure */ | | ec_dec *psRangeDec, /* I/O Compressor
data structure */ | |
| const SKP_int nBytesIn, /* I: Number of i
nput bytes */ | | const SKP_int nBytesIn, /* I: Number of i
nput bytes */ | |
| | | | |
End of changes. 3 change blocks. |
| 2 lines changed or deleted | | 27 lines changed or added | |
|
| SKP_Silk_SigProc_FIX.h | | SKP_Silk_SigProc_FIX.h | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 55 | |
| # include "SKP_Silk_macros.h" | | # include "SKP_Silk_macros.h" | |
| | | | |
| /********************************************************************/ | | /********************************************************************/ | |
| /* SIGNAL PROCESSING FUNCTIONS */ | | /* SIGNAL PROCESSING FUNCTIONS */ | |
| /********************************************************************/ | | /********************************************************************/ | |
| | | | |
| /*! | | /*! | |
| * Initialize/reset the resampler state for a given pair of input/output sa
mpling rates | | * Initialize/reset the resampler state for a given pair of input/output sa
mpling rates | |
| */ | | */ | |
| SKP_int SKP_Silk_resampler_init( | | SKP_int SKP_Silk_resampler_init( | |
|
| SKP_Silk_resampler_state_struct *S, /* I/O: Resa
mpler state */ | | SKP_Silk_resampler_state_struct *S, /* I/O: Resampler st
ate */ | |
| SKP_int32 Fs_H
z_in, /* I: Input sampling rate (Hz) */ | | SKP_int32 Fs_H
z_in, /* I: Input sampling rate (Hz) */ | |
| SKP_int32 Fs_H
z_out /* I: Output sampling rate (Hz) */ | | SKP_int32 Fs_H
z_out /* I: Output sampling rate (Hz) */ | |
| ); | | ); | |
| | | | |
| /*! | | /*! | |
| * Clear the states of all resampling filters, without resetting sampling r
ate ratio | | * Clear the states of all resampling filters, without resetting sampling r
ate ratio | |
| */ | | */ | |
| SKP_int SKP_Silk_resampler_clear( | | SKP_int SKP_Silk_resampler_clear( | |
|
| SKP_Silk_resampler_state_struct *S /* I/O: Resa
mpler state */ | | SKP_Silk_resampler_state_struct *S /* I/O: Resampler st
ate */ | |
| ); | | ); | |
| | | | |
| /*! | | /*! | |
| * Resampler: convert from one sampling rate to another | | * Resampler: convert from one sampling rate to another | |
| */ | | */ | |
| SKP_int SKP_Silk_resampler( | | SKP_int SKP_Silk_resampler( | |
|
| SKP_Silk_resampler_state_struct *S, /* I/O: Resa
mpler state */ | | SKP_Silk_resampler_state_struct *S, /* I/O: Resampler st
ate */ | |
| SKP_int16 out[
], /* O: Output signal */ | | SKP_int16 out[
], /* O: Output signal */ | |
| const SKP_int16 in[],
/* I: Input signal */ | | const SKP_int16 in[],
/* I: Input signal */ | |
| SKP_int32 inLe
n /* I: Number of input samples */ | | SKP_int32 inLe
n /* I: Number of input samples */ | |
| ); | | ); | |
| | | | |
| /*! | | /*! | |
| Upsample 2x, low quality | | Upsample 2x, low quality | |
| */ | | */ | |
| void SKP_Silk_resampler_up2( | | void SKP_Silk_resampler_up2( | |
| SKP_int32 *S, /* I/O: State vector [
2 ] */ | | SKP_int32 *S, /* I/O: State vector [
2 ] */ | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 118 | |
| * Downsample by a factor 3, low quality | | * Downsample by a factor 3, low quality | |
| */ | | */ | |
| void SKP_Silk_resampler_down3( | | void SKP_Silk_resampler_down3( | |
| SKP_int32 *S, /* I/O: State vector [
8 ] */ | | SKP_int32 *S, /* I/O: State vector [
8 ] */ | |
| SKP_int16 *out, /* O: Output signal [
floor(inLen/3) ] */ | | SKP_int16 *out, /* O: Output signal [
floor(inLen/3) ] */ | |
| const SKP_int16 *in, /* I: Input signal [
inLen ] */ | | const SKP_int16 *in, /* I: Input signal [
inLen ] */ | |
| SKP_int32 inLen /* I: Number of input
samples */ | | SKP_int32 inLen /* I: Number of input
samples */ | |
| ); | | ); | |
| | | | |
| /*! | | /*! | |
|
| * First order low-pass filter, with input as SKP_int16, running at 48 kHz | | | |
| */ | | | |
| void SKP_Silk_lowpass_short( | | | |
| const SKP_int16 *in, /* I: Q15 48 kHz signal; [len] | | | |
| */ | | | |
| SKP_int32 *S, /* I/O: Q25 state; length = 1 | | | |
| */ | | | |
| SKP_int32 *out, /* O: Q25 48 kHz signal; [len] | | | |
| */ | | | |
| const SKP_int32 len /* O: Signal length | | | |
| */ | | | |
| ); | | | |
| | | | |
| /*! | | | |
| * First order low-pass filter, with input as SKP_int32, running at 48 kHz | | | |
| */ | | | |
| void SKP_Silk_lowpass_int( | | | |
| const SKP_int32 *in, /* I: Q25 48 kHz signal; length = | | | |
| len */ | | | |
| SKP_int32 *S, /* I/O: Q25 state; length = 1 | | | |
| */ | | | |
| SKP_int32 *out, /* O: Q25 48 kHz signal; length = | | | |
| len */ | | | |
| const SKP_int32 len /* I: Number of samples | | | |
| */ | | | |
| ); | | | |
| | | | |
| /*! | | | |
| * First-order allpass filter | | | |
| */ | | | |
| void SKP_Silk_allpass_int( | | | |
| const SKP_int32 *in, /* I: Q25 input signal [len] | | | |
| */ | | | |
| SKP_int32 *S, /* I/O: Q25 state [1] | | | |
| */ | | | |
| SKP_int A, /* I: Q15 coefficient (0 <= A < | | | |
| 32768) */ | | | |
| SKP_int32 *out, /* O: Q25 output signal [len] | | | |
| */ | | | |
| const SKP_int32 len /* I: Number of samples | | | |
| */ | | | |
| ); | | | |
| | | | |
| /*! | | | |
| * second order ARMA filter; | | * second order ARMA filter; | |
| * slower than biquad() but uses more precise coefficients | | * slower than biquad() but uses more precise coefficients | |
| * can handle (slowly) varying coefficients | | * can handle (slowly) varying coefficients | |
| */ | | */ | |
| void SKP_Silk_biquad_alt( | | void SKP_Silk_biquad_alt( | |
| const SKP_int16 *in, /* I: input signal
*/ | | const SKP_int16 *in, /* I: input signal
*/ | |
| const SKP_int32 *B_Q28, /* I: MA coefficients [3]
*/ | | const SKP_int32 *B_Q28, /* I: MA coefficients [3]
*/ | |
| const SKP_int32 *A_Q28, /* I: AR coefficients [2]
*/ | | const SKP_int32 *A_Q28, /* I: AR coefficients [2]
*/ | |
| SKP_int32 *S, /* I/O: state vector [2]
*/ | | SKP_int32 *S, /* I/O: state vector [2]
*/ | |
| SKP_int16 *out, /* O: output signal
*/ | | SKP_int16 *out, /* O: output signal
*/ | |
| | | | |
| skipping to change at line 241 | | skipping to change at line 210 | |
| const SKP_int32 *A_Q24, /* I: Prediction coefficients, Q2
4 [order] */ | | const SKP_int32 *A_Q24, /* I: Prediction coefficients, Q2
4 [order] */ | |
| const SKP_int order /* I: Prediction order
*/ | | const SKP_int order /* I: Prediction order
*/ | |
| ); | | ); | |
| | | | |
| /* split signal in two decimated bands using first-order allpass filters */ | | /* split signal in two decimated bands using first-order allpass filters */ | |
| void SKP_Silk_ana_filt_bank_1( | | void SKP_Silk_ana_filt_bank_1( | |
| const SKP_int16 *in, /* I: Input signal [N] */ | | const SKP_int16 *in, /* I: Input signal [N] */ | |
| SKP_int32 *S, /* I/O: State vector [2] */ | | SKP_int32 *S, /* I/O: State vector [2] */ | |
| SKP_int16 *outL, /* O: Low band [N/2] */ | | SKP_int16 *outL, /* O: Low band [N/2] */ | |
| SKP_int16 *outH, /* O: High band [N/2] */ | | SKP_int16 *outH, /* O: High band [N/2] */ | |
|
| SKP_int32 *scratch, /* I: Scratch memory [3*N/2] */ | | | |
| const SKP_int32 N /* I: Number of input samples */ | | const SKP_int32 N /* I: Number of input samples */ | |
| ); | | ); | |
| | | | |
| /********************************************************************/ | | /********************************************************************/ | |
| /* SCALAR FUNCTIONS */ | | /* SCALAR FUNCTIONS */ | |
| /********************************************************************/ | | /********************************************************************/ | |
| | | | |
| /* approximation of 128 * log2() (exact inverse of approx 2^() below) */ | | /* approximation of 128 * log2() (exact inverse of approx 2^() below) */ | |
| /* convert input to a log scale */ | | /* convert input to a log scale */ | |
| SKP_int32 SKP_Silk_lin2log(const SKP_int32 inLin); /* I: input in li
near scale */ | | SKP_int32 SKP_Silk_lin2log(const SKP_int32 inLin); /* I: input in li
near scale */ | |
| | | | |
| skipping to change at line 372 | | skipping to change at line 340 | |
| void SKP_Silk_LPC_fit( | | void SKP_Silk_LPC_fit( | |
| SKP_int16 *a_QQ, /* O stabilized LPC vector, Q(2
4-rshift) [L] */ | | SKP_int16 *a_QQ, /* O stabilized LPC vector, Q(2
4-rshift) [L] */ | |
| SKP_int32 *a_Q24, /* I LPC vector [L]
*/ | | SKP_int32 *a_Q24, /* I LPC vector [L]
*/ | |
| const SKP_int QQ, /* I Q domain of output LPC vec
tor */ | | const SKP_int QQ, /* I Q domain of output LPC vec
tor */ | |
| const SKP_int L /* I Number of LPC parameters i
n the input vector */ | | const SKP_int L /* I Number of LPC parameters i
n the input vector */ | |
| ); | | ); | |
| | | | |
| /* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filt
er coefficients */ | | /* Compute Normalized Line Spectral Frequencies (NLSFs) from whitening filt
er coefficients */ | |
| /* If not all roots are found, the a_Q16 coefficients are bandwidth expande
d until convergence. */ | | /* If not all roots are found, the a_Q16 coefficients are bandwidth expande
d until convergence. */ | |
| void SKP_Silk_A2NLSF( | | void SKP_Silk_A2NLSF( | |
|
| SKP_int *NLSF, /* O Normalized Line Spectral F
requencies, Q15 (0 - (2^15-1)), [d] */ | | SKP_int16 *NLSF, /* O Normalized Line Spectral F
requencies, Q15 (0 - (2^15-1)), [d] */ | |
| SKP_int32 *a_Q16, /* I/O Monic whitening filter coe
fficients in Q16 [d] */ | | SKP_int32 *a_Q16, /* I/O Monic whitening filter coe
fficients in Q16 [d] */ | |
| const SKP_int d /* I Filter order (must be even
) */ | | const SKP_int d /* I Filter order (must be even
) */ | |
| ); | | ); | |
| | | | |
| /* compute whitening filter coefficients from normalized line spectral freq
uencies */ | | /* compute whitening filter coefficients from normalized line spectral freq
uencies */ | |
| void SKP_Silk_NLSF2A( | | void SKP_Silk_NLSF2A( | |
| SKP_int16 *a, /* o monic whitening filter coe
fficients in Q12, [d] */ | | SKP_int16 *a, /* o monic whitening filter coe
fficients in Q12, [d] */ | |
|
| const SKP_int *NLSF, /* i normalized line spectral f
requencies in Q15, [d] */ | | const SKP_int16 *NLSF, /* i normalized line spectral f
requencies in Q15, [d] */ | |
| const SKP_int d /* i filter order (should be ev
en) */ | | const SKP_int d /* i filter order (should be ev
en) */ | |
| ); | | ); | |
| | | | |
| void SKP_Silk_insertion_sort_increasing( | | void SKP_Silk_insertion_sort_increasing( | |
| SKP_int32 *a, /* I/O Unsorted / Sorted vector
*/ | | SKP_int32 *a, /* I/O Unsorted / Sorted vector
*/ | |
| SKP_int *index, /* O: Index vector for the sorte
d elements */ | | SKP_int *index, /* O: Index vector for the sorte
d elements */ | |
| const SKP_int L, /* I: Vector length
*/ | | const SKP_int L, /* I: Vector length
*/ | |
| const SKP_int K /* I: Number of correctly sorted
positions */ | | const SKP_int K /* I: Number of correctly sorted
positions */ | |
| ); | | ); | |
| | | | |
|
| void SKP_Silk_insertion_sort_decreasing( | | | |
| SKP_int *a, /* I/O: Unsorted / Sorted vector | | | |
| */ | | | |
| SKP_int *index, /* O: Index vector for the sorte | | | |
| d elements */ | | | |
| const SKP_int L, /* I: Vector length | | | |
| */ | | | |
| const SKP_int K /* I: Number of correctly sorted | | | |
| positions */ | | | |
| ); | | | |
| | | | |
| void SKP_Silk_insertion_sort_decreasing_int16( | | void SKP_Silk_insertion_sort_decreasing_int16( | |
| SKP_int16 *a, /* I/O: Unsorted / Sorted vector
*/ | | SKP_int16 *a, /* I/O: Unsorted / Sorted vector
*/ | |
| SKP_int *index, /* O: Index vector for the sorte
d elements */ | | SKP_int *index, /* O: Index vector for the sorte
d elements */ | |
| const SKP_int L, /* I: Vector length
*/ | | const SKP_int L, /* I: Vector length
*/ | |
| const SKP_int K /* I: Number of correctly sorted
positions */ | | const SKP_int K /* I: Number of correctly sorted
positions */ | |
| ); | | ); | |
| | | | |
|
| void SKP_Silk_insertion_sort_increasing_all_values( | | void SKP_Silk_insertion_sort_increasing_all_values_int16( | |
| SKP_int *a, /* I/O: Unsorted / Sorted vector | | SKP_int16 *a, /* I/O: Unsorted / Sorted vector | |
| */ | | */ | |
| const SKP_int L /* I: Vector length
*/ | | const SKP_int L /* I: Vector length
*/ | |
| ); | | ); | |
| | | | |
| /* NLSF stabilizer, for a single input data vector */ | | /* NLSF stabilizer, for a single input data vector */ | |
| void SKP_Silk_NLSF_stabilize( | | void SKP_Silk_NLSF_stabilize( | |
|
| SKP_int *NLSF_Q15, /* I/O: Unstable/stabilized norma | | SKP_int16 *NLSF_Q15, /* I/O: Unstable/stabilized norma | |
| lized LSF vector in Q15 [L] */ | | lized LSF vector in Q15 [L] */ | |
| const SKP_int *NDeltaMin_Q15, /* I: Normalized delta min vect | | const SKP_int16 *NDeltaMin_Q15, /* I: Normalized delta min vect | |
| or in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */ | | or in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */ | |
| const SKP_int L /* I: Number of NLSF parameters
in the input vector */ | | const SKP_int L /* I: Number of NLSF parameters
in the input vector */ | |
| ); | | ); | |
| | | | |
|
| /* NLSF stabilizer, over multiple input column data vectors */ | | | |
| void SKP_Silk_NLSF_stabilize_multi( | | | |
| SKP_int *NLSF_Q15, /* I/O: Unstable/stabilized norma | | | |
| lized LSF vectors in Q15 [LxN] */ | | | |
| const SKP_int *NDeltaMin_Q15, /* I: Normalized delta min vect | | | |
| or in Q15, NDeltaMin_Q15[L] must be >= 1 [L+1] */ | | | |
| const SKP_int N, /* I: Number of input vectors t | | | |
| o be stabilized */ | | | |
| const SKP_int L /* I: NLSF vector dimension | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Laroia low complexity NLSF weights */ | | /* Laroia low complexity NLSF weights */ | |
| void SKP_Silk_NLSF_VQ_weights_laroia( | | void SKP_Silk_NLSF_VQ_weights_laroia( | |
|
| SKP_int *pNLSFW_Q6, /* O: Pointer to input vector w | | SKP_int16 *pNLSFW_Q5, /* O: Pointer to input vector w | |
| eights [D x 1] */ | | eights [D x 1] */ | |
| const SKP_int *pNLSF_Q15, /* I: Pointer to input vector | | const SKP_int16 *pNLSF_Q15, /* I: Pointer to input vector | |
| [D x 1] */ | | [D x 1] */ | |
| const SKP_int D /* I: Input vector dimension (e
ven) */ | | const SKP_int D /* I: Input vector dimension (e
ven) */ | |
| ); | | ); | |
| | | | |
| /* Compute reflection coefficients from input signal */ | | /* Compute reflection coefficients from input signal */ | |
| void SKP_Silk_burg_modified( | | void SKP_Silk_burg_modified( | |
| SKP_int32 *res_nrg, /* O residual energy
*/ | | SKP_int32 *res_nrg, /* O residual energy
*/ | |
| SKP_int *res_nrgQ, /* O residual energy Q value
*/ | | SKP_int *res_nrgQ, /* O residual energy Q value
*/ | |
| SKP_int32 A_Q16[], /* O prediction coefficients
(length order) */ | | SKP_int32 A_Q16[], /* O prediction coefficients
(length order) */ | |
| const SKP_int16 x[], /* I input signal, length: n
b_subfr * ( D + subfr_length ) */ | | const SKP_int16 x[], /* I input signal, length: n
b_subfr * ( D + subfr_length ) */ | |
| const SKP_int subfr_length, /* I input signal subframe l
ength (including D preceeding samples) */ | | const SKP_int subfr_length, /* I input signal subframe l
ength (including D preceeding samples) */ | |
| | | | |
| skipping to change at line 573 | | skipping to change at line 526 | |
| // multiply-accumulate macros that allow overflow in the addition (ie, no a
sserts in debug mode) | | // multiply-accumulate macros that allow overflow in the addition (ie, no a
sserts in debug mode) | |
| #define SKP_MLA_ovflw(a32, b32, c32) SKP_MLA(a32, b32, c32) | | #define SKP_MLA_ovflw(a32, b32, c32) SKP_MLA(a32, b32, c32) | |
| #ifndef SKP_SMLABB_ovflw | | #ifndef SKP_SMLABB_ovflw | |
| # define SKP_SMLABB_ovflw(a32, b32, c32) SKP_SMLABB(a32, b32, c32) | | # define SKP_SMLABB_ovflw(a32, b32, c32) SKP_SMLABB(a32, b32, c32) | |
| #endif | | #endif | |
| #define SKP_SMLABT_ovflw(a32, b32, c32) SKP_SMLABT(a32, b32, c32) | | #define SKP_SMLABT_ovflw(a32, b32, c32) SKP_SMLABT(a32, b32, c32) | |
| #define SKP_SMLATT_ovflw(a32, b32, c32) SKP_SMLATT(a32, b32, c32) | | #define SKP_SMLATT_ovflw(a32, b32, c32) SKP_SMLATT(a32, b32, c32) | |
| #define SKP_SMLAWB_ovflw(a32, b32, c32) SKP_SMLAWB(a32, b32, c32) | | #define SKP_SMLAWB_ovflw(a32, b32, c32) SKP_SMLAWB(a32, b32, c32) | |
| #define SKP_SMLAWT_ovflw(a32, b32, c32) SKP_SMLAWT(a32, b32, c32) | | #define SKP_SMLAWT_ovflw(a32, b32, c32) SKP_SMLAWT(a32, b32, c32) | |
| | | | |
|
| #define SKP_DIV64_32(a64, b32) ((a64)/(b32)) /* TODO: re | | | |
| write it as a set of SKP_DIV32.*/ | | | |
| | | | |
| #define SKP_DIV32_16(a32, b16) ((SKP_int32)((a32) / (b16))) | | #define SKP_DIV32_16(a32, b16) ((SKP_int32)((a32) / (b16))) | |
| #define SKP_DIV32(a32, b32) ((SKP_int32)((a32) / (b32))) | | #define SKP_DIV32(a32, b32) ((SKP_int32)((a32) / (b32))) | |
| | | | |
| // These macros enables checking for overflow in SKP_Silk_API_Debug.h | | // These macros enables checking for overflow in SKP_Silk_API_Debug.h | |
| #define SKP_ADD16(a, b) ((a) + (b)) | | #define SKP_ADD16(a, b) ((a) + (b)) | |
| #define SKP_ADD32(a, b) ((a) + (b)) | | #define SKP_ADD32(a, b) ((a) + (b)) | |
| #define SKP_ADD64(a, b) ((a) + (b)) | | #define SKP_ADD64(a, b) ((a) + (b)) | |
| | | | |
| #define SKP_SUB16(a, b) ((a) - (b)) | | #define SKP_SUB16(a, b) ((a) - (b)) | |
| #define SKP_SUB32(a, b) ((a) - (b)) | | #define SKP_SUB32(a, b) ((a) - (b)) | |
| | | | |
End of changes. 13 change blocks. |
| 87 lines changed or deleted | | 16 lines changed or added | |
|
| SKP_Silk_SigProc_FLP.h | | SKP_Silk_SigProc_FLP.h | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 109 | |
| const SKP_float search_thres1, /* I first stage threshold for lag
candidates 0 - 1 */ | | const SKP_float search_thres1, /* I first stage threshold for lag
candidates 0 - 1 */ | |
| const SKP_float search_thres2, /* I final threshold for lag candid
ates 0 - 1 */ | | const SKP_float search_thres2, /* I final threshold for lag candid
ates 0 - 1 */ | |
| const SKP_int Fs_kHz, /* I sample frequency (kHz)
*/ | | const SKP_int Fs_kHz, /* I sample frequency (kHz)
*/ | |
| const SKP_int complexity, /* I Complexity setting, 0-2, where
2 is highest */ | | const SKP_int complexity, /* I Complexity setting, 0-2, where
2 is highest */ | |
| const SKP_int nb_subfr /* I number of 5 ms subframes
*/ | | const SKP_int nb_subfr /* I number of 5 ms subframes
*/ | |
| ); | | ); | |
| | | | |
| #define PI (3.1415926536f) | | #define PI (3.1415926536f) | |
| | | | |
| void SKP_Silk_insertion_sort_decreasing_FLP( | | void SKP_Silk_insertion_sort_decreasing_FLP( | |
|
| SKP_float *a, /* I/O: Unsorted / Sorted vector | | SKP_float *a, /* I/O: Unsorted / Sorted vector | |
| */ | | */ | |
| SKP_int *index, /* O: Index vector for the sorted | | SKP_int *index, /* O: Index vector for the sorte | |
| elements */ | | d elements */ | |
| const SKP_int L, /* I: Vector length | | const SKP_int L, /* I: Vector length | |
| */ | | */ | |
| const SKP_int K /* I: Number of correctly sorted p | | const SKP_int K /* I: Number of correctly sorted | |
| ositions */ | | positions */ | |
| ); | | ); | |
| | | | |
| void SKP_Silk_insertion_sort_increasing_FLP( | | void SKP_Silk_insertion_sort_increasing_FLP( | |
|
| SKP_float *a, /* I/O: Unsorted / Sorted vector | | SKP_float *a, /* I/O: Unsorted / Sorted vector | |
| */ | | */ | |
| SKP_int *index, /* O: Index vector for the sorted | | SKP_int *index, /* O: Index vector for the sorte | |
| elements */ | | d elements */ | |
| const SKP_int L, /* I: Vector length | | const SKP_int L, /* I: Vector length | |
| */ | | */ | |
| const SKP_int K /* I: Number of correctly sorted p | | const SKP_int K /* I: Number of correctly sorted | |
| ositions */ | | positions */ | |
| ); | | | |
| | | | |
| /* Laroia low complexity NLSF weights */ | | | |
| void SKP_Silk_NLSF_VQ_weights_laroia_FLP( | | | |
| SKP_float *pXW, /* 0: Pointer to input vector weig | | | |
| hts [D x 1] */ | | | |
| const SKP_float *pX, /* I: Pointer to input vector | | | |
| [D x 1] */ | | | |
| const SKP_int D /* I: Input vector dimension | | | |
| */ | | | |
| ); | | ); | |
| | | | |
| /* Compute reflection coefficients from input signal */ | | /* Compute reflection coefficients from input signal */ | |
| SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy
*/ | | SKP_float SKP_Silk_burg_modified_FLP( /* O returns residual energy
*/ | |
| SKP_float A[], /* O prediction coefficients
(length order) */ | | SKP_float A[], /* O prediction coefficients
(length order) */ | |
| const SKP_float x[], /* I input signal, length: n
b_subfr*(D+L_sub) */ | | const SKP_float x[], /* I input signal, length: n
b_subfr*(D+L_sub) */ | |
| const SKP_int subfr_length, /* I input signal subframe l
ength (including D preceeding samples) */ | | const SKP_int subfr_length, /* I input signal subframe l
ength (including D preceeding samples) */ | |
| const SKP_int nb_subfr, /* I number of subframes sta
cked in x */ | | const SKP_int nb_subfr, /* I number of subframes sta
cked in x */ | |
| const SKP_float WhiteNoiseFrac, /* I fraction added to zero-
lag autocorrelation */ | | const SKP_float WhiteNoiseFrac, /* I fraction added to zero-
lag autocorrelation */ | |
| const SKP_int D /* I order
*/ | | const SKP_int D /* I order
*/ | |
| | | | |
End of changes. 2 change blocks. |
| 26 lines changed or deleted | | 16 lines changed or added | |
|
| SKP_Silk_define.h | | SKP_Silk_define.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| | | | |
| #define MAX_FRAMES_PER_PACKET 3 | | #define MAX_FRAMES_PER_PACKET 3 | |
| | | | |
| #ifndef FIXED_POINT | | #ifndef FIXED_POINT | |
| # define FIXED_POINT 0 | | # define FIXED_POINT 0 | |
| #endif | | #endif | |
| | | | |
| /* Limits on bitrate */ | | /* Limits on bitrate */ | |
| #define MIN_TARGET_RATE_BPS 5000 | | #define MIN_TARGET_RATE_BPS 5000 | |
| #define MAX_TARGET_RATE_BPS 80000 | | #define MAX_TARGET_RATE_BPS 80000 | |
|
| | | | |
| /* Compensation in bitrate calculations for 10 ms modes */ | | | |
| #define REDUCE_BITRATE_10_MS_BPS 2200 | | | |
| | | | |
| /* Transition bitrates between modes */ | | | |
| #define WB2MB_BITRATE_BPS 12000 | | | |
| #define MB2WB_BITRATE_BPS 16000 | | | |
| #define MB2NB_BITRATE_BPS 9000 | | | |
| #define NB2MB_BITRATE_BPS 12000 | | | |
| | | | |
| /* Integration/hysteresis threshold for lowering internal sample frequency | | | |
| */ | | | |
| /* 30000000 -> 6 sec if bitrate is 5000 bps below limit; 3 sec if bitrate i | | | |
| s 10000 bps below limit */ | | | |
| #define ACCUM_BITS_DIFF_THRESHOLD 30000000 | | | |
| #define TARGET_RATE_TAB_SZ 8 | | #define TARGET_RATE_TAB_SZ 8 | |
| | | | |
|
| /* DTX settings */ | | | |
| #define NO_SPEECH_FRAMES_BEFORE_DTX 5 /* eq 100 ms */ | | | |
| #define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */ | | | |
| | | | |
| /* LBRR thresholds */ | | /* LBRR thresholds */ | |
| #define LBRR_NB_MIN_RATE_BPS 9000 | | #define LBRR_NB_MIN_RATE_BPS 9000 | |
| #define LBRR_MB_MIN_RATE_BPS 12000 | | #define LBRR_MB_MIN_RATE_BPS 12000 | |
| #define LBRR_WB_MIN_RATE_BPS 15000 | | #define LBRR_WB_MIN_RATE_BPS 15000 | |
| | | | |
|
| | | /* DTX settings */ | |
| | | #define NO_SPEECH_FRAMES_BEFORE_DTX 5 /* eq 100 ms */ | |
| | | #define MAX_CONSECUTIVE_DTX 20 /* eq 400 ms */ | |
| | | | |
| /* Activate bandwidth transition filtering for mode switching */ | | /* Activate bandwidth transition filtering for mode switching */ | |
| #define SWITCH_TRANSITION_FILTERING 1 | | #define SWITCH_TRANSITION_FILTERING 1 | |
| | | | |
| /* Decoder Parameters */ | | /* Decoder Parameters */ | |
| #define DEC_HP_ORDER 2 | | #define DEC_HP_ORDER 2 | |
| | | | |
| /* Maximum sampling frequency, should be 16 for embedded */ | | /* Maximum sampling frequency, should be 16 for embedded */ | |
| #define MAX_FS_KHZ 16 | | #define MAX_FS_KHZ 16 | |
| #define MAX_API_FS_KHZ 48 | | #define MAX_API_FS_KHZ 48 | |
| | | | |
| | | | |
| skipping to change at line 137 | | skipping to change at line 124 | |
| #define MAX_DELTA_GAIN_QUANT 36 | | #define MAX_DELTA_GAIN_QUANT 36 | |
| /* Max decrease in gain quantization index */ | | /* Max decrease in gain quantization index */ | |
| #define MIN_DELTA_GAIN_QUANT -4 | | #define MIN_DELTA_GAIN_QUANT -4 | |
| | | | |
| /* Quantization offsets (multiples of 4) */ | | /* Quantization offsets (multiples of 4) */ | |
| #define OFFSET_VL_Q10 32 | | #define OFFSET_VL_Q10 32 | |
| #define OFFSET_VH_Q10 100 | | #define OFFSET_VH_Q10 100 | |
| #define OFFSET_UVL_Q10 100 | | #define OFFSET_UVL_Q10 100 | |
| #define OFFSET_UVH_Q10 240 | | #define OFFSET_UVH_Q10 240 | |
| | | | |
|
| | | #define QUANT_LEVEL_ADJUST_Q10 80 | |
| | | | |
| /* Maximum numbers of iterations used to stabilize a LPC vector */ | | /* Maximum numbers of iterations used to stabilize a LPC vector */ | |
| #define MAX_LPC_STABILIZE_ITERATIONS 20 | | #define MAX_LPC_STABILIZE_ITERATIONS 20 | |
| | | | |
| #define MAX_LPC_ORDER 16 | | #define MAX_LPC_ORDER 16 | |
| #define MIN_LPC_ORDER 10 | | #define MIN_LPC_ORDER 10 | |
| | | | |
| /* Find Pred Coef defines */ | | /* Find Pred Coef defines */ | |
| #define LTP_ORDER 5 | | #define LTP_ORDER 5 | |
| | | | |
| /* LTP quantization settings */ | | /* LTP quantization settings */ | |
| | | | |
| skipping to change at line 211 | | skipping to change at line 200 | |
| /* Sigmoid settings */ | | /* Sigmoid settings */ | |
| #define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at
-128 */ | | #define VAD_NEGATIVE_OFFSET_Q5 128 /* sigmoid is 0 at
-128 */ | |
| #define VAD_SNR_FACTOR_Q16 45000 | | #define VAD_SNR_FACTOR_Q16 45000 | |
| | | | |
| /* smoothing for SNR measurement */ | | /* smoothing for SNR measurement */ | |
| #define VAD_SNR_SMOOTH_COEF_Q18 4096 | | #define VAD_SNR_SMOOTH_COEF_Q18 4096 | |
| | | | |
| /******************/ | | /******************/ | |
| /* NLSF quantizer */ | | /* NLSF quantizer */ | |
| /******************/ | | /******************/ | |
|
| #define NLSF_MSVQ_MAX_CB_STAGES 10 /* Update manually | | #define NLSF_VQ_MAX_VECTORS 32 | |
| when changing codebooks */ | | #define NLSF_VQ_MAX_SURVIVORS 16 | |
| #define NLSF_MSVQ_MAX_VECTORS_IN_STAGE 64 /* Update manually | | #define NLSF_QUANT_MAX_AMPLITUDE 4 | |
| when changing codebooks */ | | #define NLSF_QUANT_MAX_AMPLITUDE_EXT 10 | |
| #define NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END 16 /* Update manually | | #define NLSF_QUANT_LEVEL_ADJ 0.1 | |
| when changing codebooks */ | | #define NLSF_QUANT_DEL_DEC_STATES_LOG2 2 | |
| | | #define NLSF_QUANT_DEL_DEC_STATES ( 1 << NLSF_QUANT_DEL_DEC_S | |
| #define NLSF_MSVQ_FLUCTUATION_REDUCTION 1 | | TATES_LOG2 ) | |
| #define MAX_NLSF_MSVQ_SURVIVORS 16 | | | |
| | | | |
| /* Based on above defines, calculate how much memory is necessary to alloca | | | |
| te */ | | | |
| #if( NLSF_MSVQ_MAX_VECTORS_IN_STAGE > ( MAX_NLSF_MSVQ_SURVIVORS_LC_MODE * N | | | |
| LSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END ) ) | | | |
| # define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE NLSF_MSVQ_M | | | |
| AX_VECTORS_IN_STAGE | | | |
| #else | | | |
| # define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED_LC_MODE MAX_NLSF_MS | | | |
| VQ_SURVIVORS_LC_MODE * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END | | | |
| #endif | | | |
| | | | |
| #if( NLSF_MSVQ_MAX_VECTORS_IN_STAGE > ( MAX_NLSF_MSVQ_SURVIVORS * NLSF_MSVQ | | | |
| _MAX_VECTORS_IN_STAGE_TWO_TO_END ) ) | | | |
| # define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED NLSF_MSVQ_MAX_VECTO | | | |
| RS_IN_STAGE | | | |
| #else | | | |
| # define NLSF_MSVQ_TREE_SEARCH_MAX_VECTORS_EVALUATED MAX_NLSF_MSVQ_SURVI | | | |
| VORS * NLSF_MSVQ_MAX_VECTORS_IN_STAGE_TWO_TO_END | | | |
| #endif | | | |
| | | | |
| #define NLSF_MSVQ_SURV_MAX_REL_RD 0.1f /* Must be < 0.5 | | | |
| */ | | | |
| | | | |
| /* Transition filtering for mode switching */ | | /* Transition filtering for mode switching */ | |
| #if SWITCH_TRANSITION_FILTERING | | #if SWITCH_TRANSITION_FILTERING | |
|
| # define TRANSITION_TIME_UP_MS 5120 // 5120 = 64 * FRAME_L | | # define TRANSITION_TIME_MS 5120 // 5120 = 64 * FRAME_L | |
| ENGTH_MS * ( TRANSITION_INT_NUM - 1 ) = 64*(20*4) | | ENGTH_MS * ( TRANSITION_INT_NUM - 1 ) = 64*(20*4) | |
| # define TRANSITION_TIME_DOWN_MS 2560 // 2560 = 32 * FRAME_L | | | |
| ENGTH_MS * ( TRANSITION_INT_NUM - 1 ) = 32*(20*4) | | | |
| # define TRANSITION_NB 3 /* Hardcoded in tables */ | | # define TRANSITION_NB 3 /* Hardcoded in tables */ | |
| # define TRANSITION_NA 2 /* Hardcoded in tables */ | | # define TRANSITION_NA 2 /* Hardcoded in tables */ | |
| # define TRANSITION_INT_NUM 5 /* Hardcoded in tables */ | | # define TRANSITION_INT_NUM 5 /* Hardcoded in tables */ | |
|
| # define TRANSITION_FRAMES_UP ( TRANSITION_TIME_UP_MS / | | # define TRANSITION_FRAMES ( TRANSITION_TIME_MS / MAX_ | |
| MAX_FRAME_LENGTH_MS ) // NB! needs to be made flexible for 10 ms frames | | FRAME_LENGTH_MS ) // todo: needs to be made flexible for 10 ms frames | |
| # define TRANSITION_FRAMES_DOWN ( TRANSITION_TIME_DOWN_MS / | | # define TRANSITION_INT_STEPS ( TRANSITION_FRAMES / ( TR | |
| MAX_FRAME_LENGTH_MS ) // NB! needs to be made flexible for 10 ms frames | | ANSITION_INT_NUM - 1 ) ) | |
| # define TRANSITION_INT_STEPS_UP ( TRANSITION_FRAMES_UP / | | #else | |
| ( TRANSITION_INT_NUM - 1 ) ) | | # define TRANSITION_FRAMES 0 | |
| # define TRANSITION_INT_STEPS_DOWN ( TRANSITION_FRAMES_DOWN / | | | |
| ( TRANSITION_INT_NUM - 1 ) ) | | | |
| #endif | | #endif | |
| | | | |
| /* BWE factors to apply after packet loss */ | | /* BWE factors to apply after packet loss */ | |
| #define BWE_AFTER_LOSS_Q16 63570 | | #define BWE_AFTER_LOSS_Q16 63570 | |
| | | | |
| /* Defines for CN generation */ | | /* Defines for CN generation */ | |
| #define CNG_BUF_MASK_MAX 255 /* 2^floor(
log2(MAX_FRAME_LENGTH))-1 */ | | #define CNG_BUF_MASK_MAX 255 /* 2^floor(
log2(MAX_FRAME_LENGTH))-1 */ | |
| #define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/
4) */ | | #define CNG_GAIN_SMTH_Q16 4634 /* 0.25^(1/
4) */ | |
| #define CNG_NLSF_SMTH_Q16 16348 /* 0.25
*/ | | #define CNG_NLSF_SMTH_Q16 16348 /* 0.25
*/ | |
| | | | |
| | | | |
End of changes. 7 change blocks. |
| 63 lines changed or deleted | | 22 lines changed or added | |
|
| SKP_Silk_main.h | | SKP_Silk_main.h | |
| | | | |
| skipping to change at line 123 | | skipping to change at line 123 | |
| SKP_int32 gain_Q16[ MAX_NB_SUBFR ], /* O qua
ntized gains */ | | SKP_int32 gain_Q16[ MAX_NB_SUBFR ], /* O qua
ntized gains */ | |
| const SKP_int8 ind[ MAX_NB_SUBFR ], /* I gai
n indices */ | | const SKP_int8 ind[ MAX_NB_SUBFR ], /* I gai
n indices */ | |
| SKP_int8 *prev_ind, /* I/O las
t index in previous frame */ | | SKP_int8 *prev_ind, /* I/O las
t index in previous frame */ | |
| const SKP_int conditional, /* I fir
st gain is delta coded if 1 */ | | const SKP_int conditional, /* I fir
st gain is delta coded if 1 */ | |
| const SKP_int nb_subfr /* I num
ber of subframes */ | | const SKP_int nb_subfr /* I num
ber of subframes */ | |
| ); | | ); | |
| | | | |
| /* Convert NLSF parameters to stable AR prediction filter coefficients */ | | /* Convert NLSF parameters to stable AR prediction filter coefficients */ | |
| void SKP_Silk_NLSF2A_stable( | | void SKP_Silk_NLSF2A_stable( | |
| SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabili
zed AR coefs [LPC_order] */ | | SKP_int16 pAR_Q12[ MAX_LPC_ORDER ], /* O Stabili
zed AR coefs [LPC_order] */ | |
|
| const SKP_int pNLSF[ MAX_LPC_ORDER ], /* I NLSF ve
ctor [LPC_order] */ | | const SKP_int16 pNLSF[ MAX_LPC_ORDER ], /* I NLSF ve
ctor [LPC_order] */ | |
| const SKP_int LPC_order /* I LPC/LSF
order */ | | const SKP_int LPC_order /* I LPC/LSF
order */ | |
| ); | | ); | |
| | | | |
| /* Interpolate two vectors */ | | /* Interpolate two vectors */ | |
| void SKP_Silk_interpolate( | | void SKP_Silk_interpolate( | |
|
| SKP_int xi[ MAX_LPC_ORDER ], /* O interpolate | | SKP_int16 xi[ MAX_LPC_ORDER ], /* O interpo | |
| d vector */ | | lated vector */ | |
| const SKP_int x0[ MAX_LPC_ORDER ], /* I first vecto | | const SKP_int16 x0[ MAX_LPC_ORDER ], /* I first v | |
| r */ | | ector */ | |
| const SKP_int x1[ MAX_LPC_ORDER ], /* I second vect | | const SKP_int16 x1[ MAX_LPC_ORDER ], /* I second | |
| or */ | | vector */ | |
| const SKP_int ifact_Q2, /* I interp. fac | | const SKP_int ifact_Q2, /* I interp. | |
| tor, weight on 2nd vector */ | | factor, weight on 2nd vector */ | |
| const SKP_int d /* I number of p | | const SKP_int d /* I number | |
| arameters */ | | of parameters */ | |
| ); | | ); | |
| | | | |
| /* LTP tap quantizer */ | | /* LTP tap quantizer */ | |
| void SKP_Silk_quant_LTP_gains( | | void SKP_Silk_quant_LTP_gains( | |
| SKP_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /*
I/O (un)quantized LTP gains */ | | SKP_int16 B_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /*
I/O (un)quantized LTP gains */ | |
| SKP_int8 cbk_index[ MAX_NB_SUBFR ], /*
O Codebook Index */ | | SKP_int8 cbk_index[ MAX_NB_SUBFR ], /*
O Codebook Index */ | |
| SKP_int8 *periodicity_index, /*
O Periodicity Index */ | | SKP_int8 *periodicity_index, /*
O Periodicity Index */ | |
| const SKP_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /*
I Error Weights in Q18 */ | | const SKP_int32 W_Q18[ MAX_NB_SUBFR*LTP_ORDER*LTP_ORDER ], /*
I Error Weights in Q18 */ | |
| SKP_int mu_Q9, /*
I Mu value (R/D tradeoff) */ | | SKP_int mu_Q9, /*
I Mu value (R/D tradeoff) */ | |
| SKP_int lowComplexity, /*
I Flag for low complexity */ | | SKP_int lowComplexity, /*
I Flag for low complexity */ | |
| | | | |
| skipping to change at line 214 | | skipping to change at line 214 | |
| SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk
VAD state */ | | SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk
VAD state */ | |
| ); | | ); | |
| | | | |
| /* Silk VAD noise level estimation */ | | /* Silk VAD noise level estimation */ | |
| void SKP_Silk_VAD_GetNoiseLevels( | | void SKP_Silk_VAD_GetNoiseLevels( | |
| const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energie
s */ | | const SKP_int32 pX[ VAD_N_BANDS ], /* I subband energie
s */ | |
| SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk
VAD state */ | | SKP_Silk_VAD_state *psSilk_VAD /* I/O Pointer to Silk
VAD state */ | |
| ); | | ); | |
| | | | |
| /* Get speech activity level in Q8 */ | | /* Get speech activity level in Q8 */ | |
|
| SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Ret | | SKP_int SKP_Silk_VAD_GetSA_Q8( /* O Return value, 0 | |
| urn value, 0 if success */ | | if success */ | |
| SKP_Silk_VAD_state *psSilk_VAD, /* I/O Sil | | SKP_Silk_encoder_state *psEncC, /* I/O Encoder state | |
| k VAD state */ | | */ | |
| SKP_int *pSA_Q8, /* O Spe | | const SKP_int16 pIn[] /* I PCM input | |
| ech activity level in Q8 */ | | */ | |
| SKP_int *pSNR_dB_Q7, /* O SNR | | ); | |
| for current frame in Q7 */ | | | |
| SKP_int pQuality_Q15[ VAD_N_BANDS ], /* O Smo | | /* High-pass filter with cutoff frequency adaptation based on pitch lag sta | |
| othed SNR for each band */ | | tistics */ | |
| SKP_int *pTilt_Q15, /* O cur | | void SKP_Silk_HP_variable_cutoff( | |
| rent frame's frequency tilt */ | | SKP_Silk_encoder_state *psEncC, /* I/O Encoder state | |
| const SKP_int16 pIn[], /* I PCM | | */ | |
| input [framelength] */ | | SKP_int16 *out, /* O high-pass filte | |
| const SKP_int framelength, /* I Inp | | red output signal */ | |
| ut frame length */ | | const SKP_int16 *in, /* I input signal | |
| const SKP_int fs_kHz /* I Inp | | */ | |
| ut frame sample frequency */ | | const SKP_int frame_length /* I length of input | |
| | | */ | |
| ); | | ); | |
| | | | |
| #if SWITCH_TRANSITION_FILTERING | | #if SWITCH_TRANSITION_FILTERING | |
| /* Low-pass filter with variable cutoff frequency based on */ | | /* Low-pass filter with variable cutoff frequency based on */ | |
| /* piece-wise linear interpolation between elliptic filters */ | | /* piece-wise linear interpolation between elliptic filters */ | |
| /* Start by setting transition_frame_no = 1; */ | | /* Start by setting transition_frame_no = 1; */ | |
| void SKP_Silk_LP_variable_cutoff( | | void SKP_Silk_LP_variable_cutoff( | |
| SKP_Silk_LP_state *psLP, /* I/O LP filter state
*/ | | SKP_Silk_LP_state *psLP, /* I/O LP filter state
*/ | |
|
| SKP_int16 *signal, /* I/O Low-pass filter
ed output signal */ | | SKP_int16 *signal, /* I/O Low-pass filter
ed output signal */ | |
| const SKP_int frame_length /* I Frame length
*/ | | const SKP_int frame_length /* I Frame length
*/ | |
| ); | | ); | |
| #endif | | #endif | |
| | | | |
| /* Encode LBRR side info and excitation */ | | /* Encode LBRR side info and excitation */ | |
| void SKP_Silk_LBRR_embed( | | void SKP_Silk_LBRR_embed( | |
| SKP_Silk_encoder_state *psEncC, /* I/O Encoder state
*/ | | SKP_Silk_encoder_state *psEncC, /* I/O Encoder state
*/ | |
| ec_enc *psRangeEnc /* I/O Compressor data
structure */ | | ec_enc *psRangeEnc /* I/O Compressor data
structure */ | |
| ); | | ); | |
| | | | |
|
| | | /******************/ | |
| | | /* NLSF Quantizer */ | |
| | | /******************/ | |
| | | /* Limit, stabilize, convert and quantize NLSFs */ | |
| | | void SKP_Silk_process_NLSFs( | |
| | | SKP_Silk_encoder_state *psEncC, | |
| | | /* I/O Encoder state */ | |
| | | SKP_int16 PredCoef_Q12[ 2 ][ MAX_LPC_ORDER ], | |
| | | /* O Prediction coefficients */ | |
| | | SKP_int16 pNLSF_Q15[ MAX_LPC_ORDER ], | |
| | | /* I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ | |
| | | const SKP_int16 prev_NLSFq_Q15[ MAX_LPC_ORDER ] | |
| | | /* I Previous Normalized LSFs (0 - (2^15-1)) */ | |
| | | ); | |
| | | | |
| | | SKP_int32 SKP_Silk_NLSF_encode( /* O Returns | |
| | | RD value in Q25 */ | |
| | | SKP_int8 *NLSFIndices, /* I Codeboo | |
| | | k path vector [ LPC_ORDER + 1 ] */ | |
| | | SKP_int16 *pNLSF_Q15, /* I/O Quantiz | |
| | | ed NLSF vector [ LPC_ORDER ] */ | |
| | | const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codeboo | |
| | | k object */ | |
| | | const SKP_int16 *pW_Q5, /* I NLSF we | |
| | | ight vector [ LPC_ORDER ] */ | |
| | | const SKP_int NLSF_mu_Q20, /* I Rate we | |
| | | ight for the RD optimization */ | |
| | | const SKP_int nSurvivors, /* I Max sur | |
| | | vivors after first stage */ | |
| | | const SKP_int signalType /* I Signal | |
| | | type: 0/1/2 */ | |
| | | ); | |
| | | | |
| | | /* Compute quantization errors for an LPC_order element input vector for a | |
| | | VQ codebook */ | |
| | | void SKP_Silk_NLSF_VQ( | |
| | | SKP_int32 err_Q26[], /* O Quantizatio | |
| | | n errors [K] */ | |
| | | const SKP_int16 in_Q15[], /* I Input vecto | |
| | | rs to be quantized [LPC_order] */ | |
| | | const SKP_uint8 pCB_Q8[], /* I Codebook ve | |
| | | ctors [K*LPC_order] */ | |
| | | const SKP_int K, /* I Number of c | |
| | | odebook vectors */ | |
| | | const SKP_int LPC_order /* I Number of L | |
| | | PCs */ | |
| | | ); | |
| | | | |
| | | /* Delayed-decision quantizer for NLSF residuals */ | |
| | | SKP_int32 SKP_Silk_NLSF_del_dec_quant( /* O Returns RD | |
| | | value in Q25 */ | |
| | | SKP_int8 indices[], /* O Quantizatio | |
| | | n indices [ order ] */ | |
| | | const SKP_int16 x_Q10[], /* I Input [ ord | |
| | | er ] */ | |
| | | const SKP_int16 w_Q5[], /* I Weights [ o | |
| | | rder ] */ | |
| | | const SKP_uint8 pred_coef_Q8[], /* I Backward pr | |
| | | edictor coefs [ order ] */ | |
| | | const SKP_int16 ec_ix[], /* I Indices to | |
| | | entropy coding tables [ order ] */ | |
| | | const SKP_uint8 ec_rates_Q5[], /* I Rates [] | |
| | | */ | |
| | | const SKP_int quant_step_size_Q16, /* I Quantizatio | |
| | | n step size */ | |
| | | const SKP_int16 inv_quant_step_size_Q6, /* I Inverse qua | |
| | | ntization step size */ | |
| | | const SKP_int32 mu_Q20, /* I R/D tradeof | |
| | | f */ | |
| | | const SKP_int16 order /* I Number of i | |
| | | nput values */ | |
| | | ); | |
| | | | |
| | | /* Unpack predictor values and indices for entropy coding tables */ | |
| | | void SKP_Silk_NLSF_unpack( | |
| | | SKP_int16 ec_ix[], /* O Indices | |
| | | to entropy tales [ LPC_ORDER ] */ | |
| | | SKP_uint8 pred_Q8[], /* O LSF pre | |
| | | dictor [ LPC_ORDER ] */ | |
| | | const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codeboo | |
| | | k object */ | |
| | | const SKP_int CB1_index /* I Index o | |
| | | f vector in first LSF codebook */ | |
| | | ); | |
| | | | |
| | | /***********************/ | |
| | | /* NLSF vector decoder */ | |
| | | /***********************/ | |
| | | void SKP_Silk_NLSF_decode( | |
| | | SKP_int16 *pNLSF_Q15, /* O Quantiz | |
| | | ed NLSF vector [ LPC_ORDER ] */ | |
| | | SKP_int8 *NLSFIndices, /* I Codeboo | |
| | | k path vector [ LPC_ORDER + 1 ] */ | |
| | | const SKP_Silk_NLSF_CB_struct *psNLSF_CB /* I Codeboo | |
| | | k object */ | |
| | | ); | |
| | | | |
| /****************************************************/ | | /****************************************************/ | |
| /* Decoder Functions */ | | /* Decoder Functions */ | |
| /****************************************************/ | | /****************************************************/ | |
| SKP_int SKP_Silk_create_decoder( | | SKP_int SKP_Silk_create_decoder( | |
|
| SKP_Silk_decoder_state **ppsDec /* I/O Decoder state p
ointer pointer */ | | SKP_Silk_decoder_state **ppsDec /* I/O Decoder sta
te pointer pointer */ | |
| ); | | ); | |
| | | | |
| SKP_int SKP_Silk_free_decoder( | | SKP_int SKP_Silk_free_decoder( | |
|
| SKP_Silk_decoder_state *psDec /* I/O Decoder state p
ointer */ | | SKP_Silk_decoder_state *psDec /* I/O Decoder sta
te pointer */ | |
| ); | | ); | |
| | | | |
| SKP_int SKP_Silk_init_decoder( | | SKP_int SKP_Silk_init_decoder( | |
|
| SKP_Silk_decoder_state *psDec /* I/O Decoder state p
ointer */ | | SKP_Silk_decoder_state *psDec /* I/O Decoder sta
te pointer */ | |
| ); | | ); | |
| | | | |
| /* Set decoder sampling rate */ | | /* Set decoder sampling rate */ | |
| void SKP_Silk_decoder_set_fs( | | void SKP_Silk_decoder_set_fs( | |
| SKP_Silk_decoder_state *psDec, /* I/O Decoder sta
te pointer */ | | SKP_Silk_decoder_state *psDec, /* I/O Decoder sta
te pointer */ | |
| SKP_int fs_kHz /* I Sampling fr
equency (kHz) */ | | SKP_int fs_kHz /* I Sampling fr
equency (kHz) */ | |
| ); | | ); | |
| | | | |
| /****************/ | | /****************/ | |
| /* Decode frame */ | | /* Decode frame */ | |
| /****************/ | | /****************/ | |
| SKP_int SKP_Silk_decode_frame( | | SKP_int SKP_Silk_decode_frame( | |
| SKP_Silk_decoder_state *psDec, /* I/O Pointer to Silk
decoder state */ | | SKP_Silk_decoder_state *psDec, /* I/O Pointer to Silk
decoder state */ | |
| ec_dec *psRangeDec, /* I/O Compressor data
structure */ | | ec_dec *psRangeDec, /* I/O Compressor data
structure */ | |
| SKP_int16 pOut[], /* O Pointer to outp
ut speech frame */ | | SKP_int16 pOut[], /* O Pointer to outp
ut speech frame */ | |
| SKP_int32 *pN, /* O Pointer to size
of output frame */ | | SKP_int32 *pN, /* O Pointer to size
of output frame */ | |
| const SKP_int nBytes, /* I Payload length
*/ | | const SKP_int nBytes, /* I Payload length
*/ | |
| SKP_int lostFlag /* I 0: no loss, 1 l
oss, 2 decode fec */ | | SKP_int lostFlag /* I 0: no loss, 1 l
oss, 2 decode fec */ | |
| ); | | ); | |
| | | | |
|
| /* Decode LBRR side info and excitation */ | | /* Decode LBRR side info and excitation */ | |
| void SKP_Silk_LBRR_extract( | | void SKP_Silk_LBRR_extract( | |
| SKP_Silk_decoder_state *psDec, /* I/O State
*/ | | SKP_Silk_decoder_state *psDec, /* I/O State
*/ | |
| ec_dec *psRangeDec /* I/O Compressor data
structure */ | | ec_dec *psRangeDec /* I/O Compressor data
structure */ | |
| ); | | ); | |
| | | | |
| /* Decode indices from payload v4 Bitstream */ | | /* Decode indices from payload v4 Bitstream */ | |
| void SKP_Silk_decode_indices( | | void SKP_Silk_decode_indices( | |
| SKP_Silk_decoder_state *psDec, /* I/O State
*/ | | SKP_Silk_decoder_state *psDec, /* I/O State
*/ | |
| ec_dec *psRangeDec, /* I/O Compressor data
structure */ | | ec_dec *psRangeDec, /* I/O Compressor data
structure */ | |
| SKP_int FrameIndex, /* I Frame number
*/ | | SKP_int FrameIndex, /* I Frame number
*/ | |
| SKP_int decode_LBRR /* I Flag indicating
LBRR data is being decoded */ | | SKP_int decode_LBRR /* I Flag indicating
LBRR data is being decoded */ | |
| ); | | ); | |
| | | | |
|
| /* Decode parameters from payload v4 Bitstream */ | | /* Decode parameters from payload */ | |
| void SKP_Silk_decode_parameters( | | void SKP_Silk_decode_parameters( | |
| SKP_Silk_decoder_state *psDec, /* I/O
State */ | | SKP_Silk_decoder_state *psDec, /* I/O
State */ | |
| SKP_Silk_decoder_control *psDecCtrl /* I/O
Decoder control */ | | SKP_Silk_decoder_control *psDecCtrl /* I/O
Decoder control */ | |
| ); | | ); | |
| | | | |
| /* Core decoder. Performs inverse NSQ operation LTP + LPC */ | | /* Core decoder. Performs inverse NSQ operation LTP + LPC */ | |
| void SKP_Silk_decode_core( | | void SKP_Silk_decode_core( | |
| SKP_Silk_decoder_state *psDec, /* I/O
Decoder state */ | | SKP_Silk_decoder_state *psDec, /* I/O
Decoder state */ | |
| SKP_Silk_decoder_control *psDecCtrl, /* I
Decoder control */ | | SKP_Silk_decoder_control *psDecCtrl, /* I
Decoder control */ | |
| SKP_int16 xq[], /* O
Decoded speech */ | | SKP_int16 xq[], /* O
Decoded speech */ | |
| const SKP_int pulses[ MAX_FRAME_LENGTH ] /* I
Pulse signal */ | | const SKP_int pulses[ MAX_FRAME_LENGTH ] /* I
Pulse signal */ | |
| ); | | ); | |
| | | | |
|
| /* NLSF vector decoder */ | | | |
| void SKP_Silk_NLSF_MSVQ_decode( | | | |
| SKP_int *pNLSF_Q15, /* O Pointer to deco | | | |
| ded output [LPC_ORDER x 1] */ | | | |
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Pointer to NLSF | | | |
| codebook struct */ | | | |
| const SKP_int8 *NLSFIndices, /* I Pointer to NLSF | | | |
| indices [nStages x 1] */ | | | |
| const SKP_int LPC_order /* I LPC order | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Decode quantization indices of excitation (Shell coding) */ | | /* Decode quantization indices of excitation (Shell coding) */ | |
| void SKP_Silk_decode_pulses( | | void SKP_Silk_decode_pulses( | |
| ec_dec *psRangeDec, /* I/O Compressor
data structure */ | | ec_dec *psRangeDec, /* I/O Compressor
data structure */ | |
| SKP_int pulses[], /* O Excitation
signal */ | | SKP_int pulses[], /* O Excitation
signal */ | |
| const SKP_int signalType, /* I Sigtype
*/ | | const SKP_int signalType, /* I Sigtype
*/ | |
| const SKP_int quantOffsetType, /* I quantOffset
Type */ | | const SKP_int quantOffsetType, /* I quantOffset
Type */ | |
| const SKP_int frame_length /* I Frame lengt
h */ | | const SKP_int frame_length /* I Frame lengt
h */ | |
| ); | | ); | |
| | | | |
| /******************/ | | /******************/ | |
| /* CNG */ | | /* CNG */ | |
| /******************/ | | /******************/ | |
| | | | |
| /* Reset CNG */ | | /* Reset CNG */ | |
| void SKP_Silk_CNG_Reset( | | void SKP_Silk_CNG_Reset( | |
| SKP_Silk_decoder_state *psDec /* I/O Decoder state
*/ | | SKP_Silk_decoder_state *psDec /* I/O Decoder state
*/ | |
| ); | | ); | |
| | | | |
|
| /* Updates CNG estimate, and applies the CNG when packet was lost */ | | /* Updates CNG estimate, and applies the CNG when packet was lost */ | |
| void SKP_Silk_CNG( | | void SKP_Silk_CNG( | |
| SKP_Silk_decoder_state *psDec, /* I/O Decoder state
*/ | | SKP_Silk_decoder_state *psDec, /* I/O Decoder state
*/ | |
| SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control
*/ | | SKP_Silk_decoder_control *psDecCtrl, /* I/O Decoder control
*/ | |
| SKP_int16 signal[], /* I/O Signal
*/ | | SKP_int16 signal[], /* I/O Signal
*/ | |
| SKP_int length /* I Length of resid
ual */ | | SKP_int length /* I Length of resid
ual */ | |
| ); | | ); | |
| | | | |
| /* Encoding of various parameters */ | | /* Encoding of various parameters */ | |
| void SKP_Silk_encode_indices( | | void SKP_Silk_encode_indices( | |
| SKP_Silk_encoder_state *psEncC, /* I/O Encoder state
*/ | | SKP_Silk_encoder_state *psEncC, /* I/O Encoder state
*/ | |
| | | | |
End of changes. 12 change blocks. |
| 48 lines changed or deleted | | 134 lines changed or added | |
|
| SKP_Silk_main_FIX.h | | SKP_Silk_main_FIX.h | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 49 | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| /*********************/ | | /*********************/ | |
| /* Encoder Functions */ | | /* Encoder Functions */ | |
| /*********************/ | | /*********************/ | |
| | | | |
|
| /* High-pass filter with cutoff frequency adaptation based on pitch lag sta | | | |
| tistics */ | | | |
| void SKP_Silk_HP_variable_cutoff_FIX( | | | |
| SKP_Silk_encoder_state_FIX *psEnc, /* I/O Encoder state | | | |
| */ | | | |
| SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O Encoder control | | | |
| */ | | | |
| SKP_int16 *out, /* O high-pass filte | | | |
| red output signal */ | | | |
| const SKP_int16 *in /* I input signal | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Encoder main function */ | | /* Encoder main function */ | |
| SKP_int SKP_Silk_encode_frame_FIX( | | SKP_int SKP_Silk_encode_frame_FIX( | |
| SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to
Silk FIX encoder state */ | | SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to
Silk FIX encoder state */ | |
| SKP_int32 *pnBytesOut, /* O Pointer to
number of payload bytes; */ | | SKP_int32 *pnBytesOut, /* O Pointer to
number of payload bytes; */ | |
| ec_enc *psRangeEnc /* I/O compressor
data structure */ | | ec_enc *psRangeEnc /* I/O compressor
data structure */ | |
| ); | | ); | |
| | | | |
| /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode
with lower bitrate */ | | /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode
with lower bitrate */ | |
| void SKP_Silk_LBRR_encode_FIX( | | void SKP_Silk_LBRR_encode_FIX( | |
| SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk
FIX encoder state */ | | SKP_Silk_encoder_state_FIX *psEnc, /* I/O Pointer to Silk
FIX encoder state */ | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 135 | |
| /* Find LPC and LTP coefficients */ | | /* Find LPC and LTP coefficients */ | |
| void SKP_Silk_find_pred_coefs_FIX( | | void SKP_Silk_find_pred_coefs_FIX( | |
| SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state
*/ | | SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state
*/ | |
| SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control
*/ | | SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control
*/ | |
| const SKP_int16 res_pitch[], /* I Residual from p
itch analysis */ | | const SKP_int16 res_pitch[], /* I Residual from p
itch analysis */ | |
| const SKP_int16 x[] /* I Speech signal
*/ | | const SKP_int16 x[] /* I Speech signal
*/ | |
| ); | | ); | |
| | | | |
| /* LPC analysis */ | | /* LPC analysis */ | |
| void SKP_Silk_find_LPC_FIX( | | void SKP_Silk_find_LPC_FIX( | |
|
| SKP_int NLSF_Q15[], /* O NLSFs | | SKP_int16 NLSF_Q15[], /* O NLSFs | |
| */ | | */ | |
| SKP_int8 *interpIndex, /* O NLSF interpolat | | SKP_int8 *interpIndex, /* O NLSF in | |
| ion index, only used for NLSF interpolation */ | | terpolation index, only used for NLSF interpolation */ | |
| const SKP_int prev_NLSFq_Q15[], /* I previous NLSFs, | | const SKP_int16 prev_NLSFq_Q15[], /* I previou | |
| only used for NLSF interpolation */ | | s NLSFs, only used for NLSF interpolation */ | |
| const SKP_int useInterpolatedNLSFs, /* I Flag | | const SKP_int useInterpNLSFs, /* I Flag | |
| */ | | */ | |
| const SKP_int LPC_order, /* I LPC order | | const SKP_int firstFrameAfterReset, /* I Flag | |
| */ | | */ | |
| const SKP_int16 x[], /* I Input signal | | const SKP_int LPC_order, /* I LPC ord | |
| */ | | er */ | |
| const SKP_int subfr_length, /* I Input signal su | | const SKP_int16 x[], /* I Input s | |
| bframe length including preceeding samples */ | | ignal */ | |
| const SKP_int nb_subfr /* I: Number of subfr | | const SKP_int subfr_length, /* I Input s | |
| ames */ | | ignal subframe length including preceeding samples */ | |
| | | const SKP_int nb_subfr /* I: Number | |
| | | of subframes */ | |
| ); | | ); | |
| | | | |
| /* LTP analysis */ | | /* LTP analysis */ | |
| void SKP_Silk_find_LTP_FIX( | | void SKP_Silk_find_LTP_FIX( | |
| SKP_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /*
O LTP coefs */ | | SKP_int16 b_Q14[ MAX_NB_SUBFR * LTP_ORDER ], /*
O LTP coefs */ | |
| SKP_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /*
O Weight for LTP quantization */ | | SKP_int32 WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /*
O Weight for LTP quantization */ | |
| SKP_int *LTPredCodGain_Q7, /*
O LTP coding gain */ | | SKP_int *LTPredCodGain_Q7, /*
O LTP coding gain */ | |
| const SKP_int16 r_lpc[], /*
I residual signal after LPC signal + state for first 10 ms */ | | const SKP_int16 r_lpc[], /*
I residual signal after LPC signal + state for first 10 ms */ | |
| const SKP_int lag[ MAX_NB_SUBFR ], /*
I LTP lags */ | | const SKP_int lag[ MAX_NB_SUBFR ], /*
I LTP lags */ | |
| const SKP_int32 Wght_Q15[ MAX_NB_SUBFR ], /*
I weights */ | | const SKP_int32 Wght_Q15[ MAX_NB_SUBFR ], /*
I weights */ | |
| | | | |
| skipping to change at line 191 | | skipping to change at line 184 | |
| SKP_int32 nrgs[ MAX_NB_SUBFR ], /* O Residual energy
per subframe */ | | SKP_int32 nrgs[ MAX_NB_SUBFR ], /* O Residual energy
per subframe */ | |
| SKP_int nrgsQ[ MAX_NB_SUBFR ], /* O Q value per sub
frame */ | | SKP_int nrgsQ[ MAX_NB_SUBFR ], /* O Q value per sub
frame */ | |
| const SKP_int16 x[], /* I Input signal
*/ | | const SKP_int16 x[], /* I Input signal
*/ | |
| const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for ea
ch frame half */ | | const SKP_int16 a_Q12[ 2 ][ MAX_LPC_ORDER ], /* I AR coefs for ea
ch frame half */ | |
| const SKP_int32 gains[ MAX_NB_SUBFR ], /* I Quantization ga
ins */ | | const SKP_int32 gains[ MAX_NB_SUBFR ], /* I Quantization ga
ins */ | |
| const SKP_int subfr_length, /* I Subframe length
*/ | | const SKP_int subfr_length, /* I Subframe length
*/ | |
| const SKP_int nb_subfr, /* I Number of subfr
ames */ | | const SKP_int nb_subfr, /* I Number of subfr
ames */ | |
| const SKP_int LPC_order /* I LPC order
*/ | | const SKP_int LPC_order /* I LPC order
*/ | |
| ); | | ); | |
| | | | |
|
| /******************/ | | | |
| /* NLSF Quantizer */ | | | |
| /******************/ | | | |
| /* Limit, stabilize, convert and quantize NLSFs. */ | | | |
| void SKP_Silk_process_NLSFs_FIX( | | | |
| SKP_Silk_encoder_state_FIX *psEnc, /* I/O encoder state | | | |
| */ | | | |
| SKP_Silk_encoder_control_FIX *psEncCtrl, /* I/O encoder control | | | |
| */ | | | |
| SKP_int *pNLSF_Q15 /* I/O Normalized LSFs (qu | | | |
| ant out) (0 - (2^15-1)) */ | | | |
| ); | | | |
| | | | |
| /* NLSF vector encoder */ | | | |
| void SKP_Silk_NLSF_MSVQ_encode_FIX( | | | |
| SKP_int8 *NLSFIndices, /* O Codeboo | | | |
| k path vector [ CB_STAGES ] */ | | | |
| SKP_int *pNLSF_Q15, /* I/O Quantiz | | | |
| ed NLSF vector [ LPC_ORDER ] */ | | | |
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codeboo | | | |
| k object */ | | | |
| const SKP_int *pNLSF_q_Q15_prev, /* I Prev. q | | | |
| uantized NLSF vector [LPC_ORDER] */ | | | |
| const SKP_int *pW_Q6, /* I NLSF we | | | |
| ight vector [ LPC_ORDER ] */ | | | |
| const SKP_int NLSF_mu_Q15, /* I Rate we | | | |
| ight for the RD optimization */ | | | |
| const SKP_int NLSF_mu_fluc_red_Q16, /* I Fluctua | | | |
| tion reduction error weight */ | | | |
| const SKP_int NLSF_MSVQ_Survivors, /* I Max sur | | | |
| vivors from each stage */ | | | |
| const SKP_int LPC_order, /* I LPC ord | | | |
| er */ | | | |
| const SKP_int deactivate_fluc_red /* I Deactiv | | | |
| ate fluctuation reduction */ | | | |
| ); | | | |
| | | | |
| /* Rate-Distortion calculations for multiple input data vectors */ | | | |
| void SKP_Silk_NLSF_VQ_rate_distortion_FIX( | | | |
| SKP_int32 *pRD_Q20, /* O Rate-distor | | | |
| tion values [psNLSF_CBS->nVectors*N] */ | | | |
| const SKP_Silk_NLSF_CBS *psNLSF_CBS, /* I NLSF codebo | | | |
| ok stage struct */ | | | |
| const SKP_int16 *in_Q15, /* I Input vecto | | | |
| rs to be quantized */ | | | |
| const SKP_int *w_Q6, /* I Weight vect | | | |
| or */ | | | |
| const SKP_int32 *rate_acc_Q5, /* I Accumulated | | | |
| rates from previous stage */ | | | |
| const SKP_int mu_Q15, /* I Weight betw | | | |
| een weighted error and rate */ | | | |
| const SKP_int N, /* I Number of i | | | |
| nput vectors to be quantized */ | | | |
| const SKP_int LPC_order /* I LPC order | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Compute weighted quantization errors for an LPC_order element input vect | | | |
| or, over one codebook stage */ | | | |
| void SKP_Silk_NLSF_VQ_sum_error_FIX( | | | |
| SKP_int32 *err_Q20, /* O Weighted qu | | | |
| antization errors [N*K] */ | | | |
| const SKP_int16 *in_Q15, /* I Input vecto | | | |
| rs to be quantized [N*LPC_order] */ | | | |
| const SKP_int *w_Q6, /* I Weighting v | | | |
| ectors [N*LPC_order] */ | | | |
| const SKP_int8 *pCB_Q9, /* I Codebook ve | | | |
| ctors [K*LPC_order] */ | | | |
| const SKP_int N, /* I Number of i | | | |
| nput vectors */ | | | |
| const SKP_int K, /* I Number of c | | | |
| odebook vectors */ | | | |
| const SKP_int LPC_order /* I Number of L | | | |
| PCs */ | | | |
| ); | | | |
| | | | |
| /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ | | /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ | |
| SKP_int32 SKP_Silk_residual_energy16_covar_FIX( | | SKP_int32 SKP_Silk_residual_energy16_covar_FIX( | |
| const SKP_int16 *c, /* I Prediction
vector */ | | const SKP_int16 *c, /* I Prediction
vector */ | |
| const SKP_int32 *wXX, /* I Correlation
matrix */ | | const SKP_int32 *wXX, /* I Correlation
matrix */ | |
| const SKP_int32 *wXx, /* I Correlation
vector */ | | const SKP_int32 *wXx, /* I Correlation
vector */ | |
| SKP_int32 wxx, /* I Signal ener
gy */ | | SKP_int32 wxx, /* I Signal ener
gy */ | |
| SKP_int D, /* I Dimension
*/ | | SKP_int D, /* I Dimension
*/ | |
| SKP_int cQ /* I Q value for
c vector 0 - 15 */ | | SKP_int cQ /* I Q value for
c vector 0 - 15 */ | |
| ); | | ); | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 105 lines changed or deleted | | 18 lines changed or added | |
|
| SKP_Silk_main_FLP.h | | SKP_Silk_main_FLP.h | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" | | extern "C" | |
| { | | { | |
| #endif | | #endif | |
| | | | |
| /*********************/ | | /*********************/ | |
| /* Encoder Functions */ | | /* Encoder Functions */ | |
| /*********************/ | | /*********************/ | |
| | | | |
|
| /* High-pass filter with cutoff frequency adaptation based on pitch lag sta | | | |
| tistics */ | | | |
| void SKP_Silk_HP_variable_cutoff_FLP( | | | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta | | | |
| te FLP */ | | | |
| SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder con | | | |
| trol FLP */ | | | |
| SKP_int16 *out, /* O High-pass f | | | |
| iltered output signal */ | | | |
| const SKP_int16 *in /* I Input signa | | | |
| l */ | | | |
| ); | | | |
| | | | |
| /* Encoder main function */ | | /* Encoder main function */ | |
| SKP_int SKP_Silk_encode_frame_FLP( | | SKP_int SKP_Silk_encode_frame_FLP( | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | | SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | |
| SKP_int32 *pnBytesOut, /* O Number of p
ayload bytes; */ | | SKP_int32 *pnBytesOut, /* O Number of p
ayload bytes; */ | |
| ec_enc *psRangeEnc /* I/O compressor
data structure */ | | ec_enc *psRangeEnc /* I/O compressor
data structure */ | |
| ); | | ); | |
| | | | |
| /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode
with lower bitrate */ | | /* Low Bitrate Redundancy (LBRR) encoding. Reuse all parameters but encode
with lower bitrate */ | |
| void SKP_Silk_LBRR_encode_FLP( | | void SKP_Silk_LBRR_encode_FLP( | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | | SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 136 | |
| /* Find LPC and LTP coefficients */ | | /* Find LPC and LTP coefficients */ | |
| void SKP_Silk_find_pred_coefs_FLP( | | void SKP_Silk_find_pred_coefs_FLP( | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | | SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta
te FLP */ | |
| SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder con
trol FLP */ | | SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder con
trol FLP */ | |
| const SKP_float res_pitch[], /* I Residual fr
om pitch analysis */ | | const SKP_float res_pitch[], /* I Residual fr
om pitch analysis */ | |
| const SKP_float x[] /* I Speech sign
al */ | | const SKP_float x[] /* I Speech sign
al */ | |
| ); | | ); | |
| | | | |
| /* LPC analysis */ | | /* LPC analysis */ | |
| void SKP_Silk_find_LPC_FLP( | | void SKP_Silk_find_LPC_FLP( | |
|
| SKP_float NLSF[], /* O NLSFs | | SKP_int16 NLSF_Q15[], /* O NLSFs | |
| */ | | */ | |
| SKP_int8 *interpIndex, /* O NLSF interp | | SKP_int8 *interpIndex, /* O NLSF in | |
| . index for NLSF interp. */ | | terp. index for NLSF interp. */ | |
| const SKP_float prev_NLSFq[], /* I Previous NL | | const SKP_int16 prev_NLSFq_Q15[], /* I Previou | |
| SFs, for NLSF interpolation */ | | s NLSFs, for NLSF interpolation */ | |
| const SKP_int useInterpNLSFs, /* I Flag | | const SKP_int useInterpNLSFs, /* I Flag | |
| */ | | */ | |
| const SKP_int LPC_order, /* I LPC order | | const SKP_int firstFrameAfterReset, /* I Flag | |
| */ | | */ | |
| const SKP_float x[], /* I Input signa | | const SKP_int LPC_order, /* I LPC ord | |
| l */ | | er */ | |
| const SKP_int subfr_length, /* I Subframe le | | const SKP_float x[], /* I Input s | |
| ngth incl preceeding samples */ | | ignal */ | |
| const SKP_int nb_subfr /* I: Number of s | | const SKP_int subfr_length, /* I Subfram | |
| ubframes */ | | e length incl preceeding samples */ | |
| | | const SKP_int nb_subfr /* I: Number | |
| | | of subframes */ | |
| ); | | ); | |
| | | | |
| /* LTP analysis */ | | /* LTP analysis */ | |
| void SKP_Silk_find_LTP_FLP( | | void SKP_Silk_find_LTP_FLP( | |
| SKP_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coe
fs */ | | SKP_float b[ MAX_NB_SUBFR * LTP_ORDER ], /* O LTP coe
fs */ | |
| SKP_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O W
eight for LTP quantization */ | | SKP_float WLTP[ MAX_NB_SUBFR * LTP_ORDER * LTP_ORDER ], /* O W
eight for LTP quantization */ | |
| SKP_float *LTPredCodGain, /* O LTP cod
ing gain */ | | SKP_float *LTPredCodGain, /* O LTP cod
ing gain */ | |
| const SKP_float r_lpc[], /* I LPC res
idual */ | | const SKP_float r_lpc[], /* I LPC res
idual */ | |
| const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lag
s */ | | const SKP_int lag[ MAX_NB_SUBFR ], /* I LTP lag
s */ | |
| const SKP_float Wght[ MAX_NB_SUBFR ], /* I Weights
*/ | | const SKP_float Wght[ MAX_NB_SUBFR ], /* I Weights
*/ | |
| | | | |
| skipping to change at line 215 | | skipping to change at line 208 | |
| const SKP_int mu_Q10, /* I Mu
value (R/D tradeoff) */ | | const SKP_int mu_Q10, /* I Mu
value (R/D tradeoff) */ | |
| const SKP_int lowComplexity, /* I Fla
g for low complexity */ | | const SKP_int lowComplexity, /* I Fla
g for low complexity */ | |
| const SKP_int nb_subfr /* I num
ber of subframes */ | | const SKP_int nb_subfr /* I num
ber of subframes */ | |
| ); | | ); | |
| | | | |
| /******************/ | | /******************/ | |
| /* NLSF Quantizer */ | | /* NLSF Quantizer */ | |
| /******************/ | | /******************/ | |
| /* Limit, stabilize, and quantize NLSFs */ | | /* Limit, stabilize, and quantize NLSFs */ | |
| void SKP_Silk_process_NLSFs_FLP( | | void SKP_Silk_process_NLSFs_FLP( | |
|
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta | | SKP_Silk_encoder_state *psEncC, /* | |
| te FLP */ | | I/O Encoder state */ | |
| SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder con | | SKP_float PredCoef[ 2 ][ MAX_LPC_ORDER ], /* | |
| trol FLP */ | | O Prediction coefficients */ | |
| SKP_float *pNLSF /* I/O NLSFs (quan | | SKP_int16 NLSF_Q15[ MAX_LPC_ORDER ], /* | |
| tized output) */ | | I/O Normalized LSFs (quant out) (0 - (2^15-1)) */ | |
| ); | | const SKP_int16 prev_NLSF_Q15[ MAX_LPC_ORDER ] /* | |
| | | I Previous Normalized LSFs (0 - (2^15-1)) */ | |
| /* NLSF vector encoder */ | | | |
| void SKP_Silk_NLSF_MSVQ_encode_FLP( | | | |
| SKP_int8 *NLSFIndices, /* O Codebook pa | | | |
| th vector [ CB_STAGES ] */ | | | |
| SKP_float *pNLSF, /* I/O Quantized N | | | |
| LSF vector [ LPC_ORDER ] */ | | | |
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I Codebook ob | | | |
| ject */ | | | |
| const SKP_float *pNLSF_q_prev, /* I Prev. quant | | | |
| ized NLSF vector [LPC_ORDER] */ | | | |
| const SKP_float *pW, /* I NLSF weight | | | |
| vector [ LPC_ORDER ] */ | | | |
| const SKP_float NLSF_mu, /* I Rate weight | | | |
| for the RD optimization */ | | | |
| const SKP_float NLSF_mu_fluc_red, /* I Fluctuation | | | |
| reduction error weight */ | | | |
| const SKP_int NLSF_MSVQ_Survivors,/* I Max survivo | | | |
| rs from each stage */ | | | |
| const SKP_int LPC_order, /* I LPC order | | | |
| */ | | | |
| const SKP_int deactivate_fluc_red /* I Deactivate | | | |
| fluctuation reduction */ | | | |
| ); | | | |
| | | | |
| /* Rate-Distortion calculations for multiple input data vectors */ | | | |
| void SKP_Silk_NLSF_VQ_rate_distortion_FLP( | | | |
| SKP_float *pRD, /* O Rate-distortion | | | |
| values [psNLSF_CBS_FLP->nVectors*N] */ | | | |
| const SKP_Silk_NLSF_CBS *psNLSF_CBS, /* I NLSF codebook st | | | |
| age struct */ | | | |
| const SKP_float *in, /* I Input vectors to | | | |
| be quantized */ | | | |
| const SKP_float *w, /* I Weight vector | | | |
| */ | | | |
| const SKP_float *rate_acc, /* I Accumulated rate | | | |
| s from previous stage */ | | | |
| const SKP_float mu, /* I Weight between w | | | |
| eighted error and rate */ | | | |
| const SKP_int N, /* I Number of input | | | |
| vectors to be quantized */ | | | |
| const SKP_int LPC_order /* I LPC order | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Compute weighted quantization errors for an LPC_order element input vect | | | |
| or, over one codebook stage */ | | | |
| void SKP_Silk_NLSF_VQ_sum_error_FLP( | | | |
| SKP_float *err, /* O Weighted qu | | | |
| antization errors [ N * K ] */ | | | |
| const SKP_float *in, /* I Input vecto | | | |
| rs [ N * LPC_order ] */ | | | |
| const SKP_float *w, /* I Weighting v | | | |
| ectors [ N * LPC_order ] */ | | | |
| const SKP_int8 *pCB_NLSF_Q8, /* I Codebook ve | | | |
| ctors [ K * LPC_order ] */ | | | |
| const SKP_int N, /* I Number of i | | | |
| nput vectors */ | | | |
| const SKP_int K, /* I Number of c | | | |
| odebook vectors */ | | | |
| const SKP_int LPC_order /* I LPC order | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* NLSF vector decoder */ | | | |
| void SKP_Silk_NLSF_MSVQ_decode_FLP( | | | |
| SKP_float *pNLSF, /* O Decoded out | | | |
| put vector [ LPC_ORDER ] */ | | | |
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB, /* I NLSF codebo | | | |
| ok struct */ | | | |
| const SKP_int8 *NLSFIndices, /* I NLSF indice | | | |
| s [ nStages ] */ | | | |
| const SKP_int LPC_order /* I LPC order u | | | |
| sed */ | | | |
| ); | | ); | |
| | | | |
| /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ | | /* Residual energy: nrg = wxx - 2 * wXx * c + c' * wXX * c */ | |
| SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted re
sidual energy */ | | SKP_float SKP_Silk_residual_energy_covar_FLP( /* O Weighted re
sidual energy */ | |
| const SKP_float *c, /* I Filter coef
ficients */ | | const SKP_float *c, /* I Filter coef
ficients */ | |
| SKP_float *wXX, /* I/O Weighted co
rrelation matrix, reg. out */ | | SKP_float *wXX, /* I/O Weighted co
rrelation matrix, reg. out */ | |
| const SKP_float *wXx, /* I Weighted co
rrelation vector */ | | const SKP_float *wXx, /* I Weighted co
rrelation vector */ | |
| const SKP_float wxx, /* I Weighted co
rrelation value */ | | const SKP_float wxx, /* I Weighted co
rrelation value */ | |
| const SKP_int D /* I Dimension
*/ | | const SKP_int D /* I Dimension
*/ | |
| ); | | ); | |
| | | | |
| skipping to change at line 343 | | skipping to change at line 292 | |
| SKP_float px_win[], /* O Pointer to
windowed signal */ | | SKP_float px_win[], /* O Pointer to
windowed signal */ | |
| const SKP_float px[], /* I Pointer to
input signal */ | | const SKP_float px[], /* I Pointer to
input signal */ | |
| const SKP_int win_type, /* I Selects a w
indow type */ | | const SKP_int win_type, /* I Selects a w
indow type */ | |
| const SKP_int length /* I Window leng
th, multiple of 4 */ | | const SKP_int length /* I Window leng
th, multiple of 4 */ | |
| ); | | ); | |
| | | | |
| /* Wrappers. Calls flp / fix code */ | | /* Wrappers. Calls flp / fix code */ | |
| | | | |
| /* Convert AR filter coefficients to NLSF parameters */ | | /* Convert AR filter coefficients to NLSF parameters */ | |
| void SKP_Silk_A2NLSF_FLP( | | void SKP_Silk_A2NLSF_FLP( | |
|
| SKP_float *pNLSF, /* O NLSF vector
[ LPC_order ] */ | | SKP_int16 *NLSF_Q15, /* O NLSF vector
[ LPC_order ] */ | |
| const SKP_float *pAR, /* I LPC coeffic
ients [ LPC_order ] */ | | const SKP_float *pAR, /* I LPC coeffic
ients [ LPC_order ] */ | |
| const SKP_int LPC_order /* I LPC order
*/ | | const SKP_int LPC_order /* I LPC order
*/ | |
| ); | | ); | |
| | | | |
| /* Convert NLSF parameters to AR prediction filter coefficients */ | | /* Convert NLSF parameters to AR prediction filter coefficients */ | |
| void SKP_Silk_NLSF2A_stable_FLP( | | void SKP_Silk_NLSF2A_stable_FLP( | |
| SKP_float *pAR, /* O LPC coeffic
ients [ LPC_order ] */ | | SKP_float *pAR, /* O LPC coeffic
ients [ LPC_order ] */ | |
|
| const SKP_float *pNLSF, /* I NLSF vector
[ LPC_order ] */ | | const SKP_int16 *NLSF_Q15, /* I NLSF vector
[ LPC_order ] */ | |
| const SKP_int LPC_order /* I LPC order
*/ | | const SKP_int LPC_order /* I LPC order
*/ | |
| ); | | ); | |
| | | | |
|
| /* NLSF stabilizer, for a single input data vector */ | | | |
| void SKP_Silk_NLSF_stabilize_FLP( | | | |
| SKP_float *pNLSF, /* I/O (Un)stable N | | | |
| LSF vector [ LPC_order ] */ | | | |
| const SKP_int *pNDelta_min_Q15, /* I Normalized | | | |
| delta min vector[LPC_order+1]*/ | | | |
| const SKP_int LPC_order /* I LPC order | | | |
| */ | | | |
| ); | | | |
| | | | |
| /* Interpolation function with fixed point rounding */ | | | |
| void SKP_Silk_interpolate_wrapper_FLP( | | | |
| SKP_float xi[], /* O Interpolate | | | |
| d vector */ | | | |
| const SKP_float x0[], /* I First vecto | | | |
| r */ | | | |
| const SKP_float x1[], /* I Second vect | | | |
| or */ | | | |
| const SKP_float ifact, /* I Interp. fac | | | |
| tor, weight on second vector */ | | | |
| const SKP_int d /* I Number of p | | | |
| arameters */ | | | |
| ); | | | |
| | | | |
| /****************************************/ | | | |
| /* Floating-point Silk VAD wrapper */ | | | |
| /****************************************/ | | | |
| SKP_int SKP_Silk_VAD_FLP( | | | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder sta | | | |
| te FLP */ | | | |
| SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder con | | | |
| trol FLP */ | | | |
| const SKP_int16 *pIn /* I Input signa | | | |
| l */ | | | |
| ); | | | |
| | | | |
| /****************************************/ | | /****************************************/ | |
| /* Floating-point Silk NSQ wrapper */ | | /* Floating-point Silk NSQ wrapper */ | |
| /****************************************/ | | /****************************************/ | |
| void SKP_Silk_NSQ_wrapper_FLP( | | void SKP_Silk_NSQ_wrapper_FLP( | |
| SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state F
LP */ | | SKP_Silk_encoder_state_FLP *psEnc, /* I/O Encoder state F
LP */ | |
| SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control
FLP */ | | SKP_Silk_encoder_control_FLP *psEncCtrl, /* I/O Encoder control
FLP */ | |
| SideInfoIndices *psIndices, /* I/O Quantization in
dices */ | | SideInfoIndices *psIndices, /* I/O Quantization in
dices */ | |
| SKP_Silk_nsq_state *psNSQ, /* I/O Noise Shaping Q
uantzation state */ | | SKP_Silk_nsq_state *psNSQ, /* I/O Noise Shaping Q
uantzation state */ | |
| SKP_int8 pulses[], /* O Quantized pulse
signal */ | | SKP_int8 pulses[], /* O Quantized pulse
signal */ | |
| const SKP_float x[] /* I Prefiltered inp
ut signal */ | | const SKP_float x[] /* I Prefiltered inp
ut signal */ | |
| | | | |
End of changes. 6 change blocks. |
| 148 lines changed or deleted | | 28 lines changed or added | |
|
| SKP_Silk_structs.h | | SKP_Silk_structs.h | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 75 | |
| SKP_int32 AnaState2[ 2 ]; /* Analysis filterbank stat
e: 0-2 kHz */ | | SKP_int32 AnaState2[ 2 ]; /* Analysis filterbank stat
e: 0-2 kHz */ | |
| SKP_int32 XnrgSubfr[ VAD_N_BANDS ]; /* Subframe energies
*/ | | SKP_int32 XnrgSubfr[ VAD_N_BANDS ]; /* Subframe energies
*/ | |
| SKP_int32 NrgRatioSmth_Q8[ VAD_N_BANDS ]; /* Smoothed energy level in
each band */ | | SKP_int32 NrgRatioSmth_Q8[ VAD_N_BANDS ]; /* Smoothed energy level in
each band */ | |
| SKP_int16 HPstate; /* State of differentiator
in the lowest band */ | | SKP_int16 HPstate; /* State of differentiator
in the lowest band */ | |
| SKP_int32 NL[ VAD_N_BANDS ]; /* Noise energy level in ea
ch band */ | | SKP_int32 NL[ VAD_N_BANDS ]; /* Noise energy level in ea
ch band */ | |
| SKP_int32 inv_NL[ VAD_N_BANDS ]; /* Inverse noise energy lev
el in each band */ | | SKP_int32 inv_NL[ VAD_N_BANDS ]; /* Inverse noise energy lev
el in each band */ | |
| SKP_int32 NoiseLevelBias[ VAD_N_BANDS ]; /* Noise level estimator bi
as/offset */ | | SKP_int32 NoiseLevelBias[ VAD_N_BANDS ]; /* Noise level estimator bi
as/offset */ | |
| SKP_int32 counter; /* Frame counter used in th
e initial phase */ | | SKP_int32 counter; /* Frame counter used in th
e initial phase */ | |
| } SKP_Silk_VAD_state; | | } SKP_Silk_VAD_state; | |
| | | | |
|
| #if SWITCH_TRANSITION_FILTERING | | | |
| /* Variable cut-off low-pass filter state */ | | /* Variable cut-off low-pass filter state */ | |
| typedef struct { | | typedef struct { | |
| SKP_int32 In_LP_State[ 2 ]; /* Low pass fil
ter state */ | | SKP_int32 In_LP_State[ 2 ]; /* Low pass fil
ter state */ | |
| SKP_int32 transition_frame_no; /* Counter whic
h is mapped to a cut-off frequency */ | | SKP_int32 transition_frame_no; /* Counter whic
h is mapped to a cut-off frequency */ | |
|
| SKP_int mode; /* Operating mo
de, 0: switch down, 1: switch up */ | | SKP_int mode; /* Operating mo
de, <0: switch down, >0: switch up; 0: do nothing */ | |
| } SKP_Silk_LP_state; | | } SKP_Silk_LP_state; | |
|
| #endif | | | |
| | | | |
|
| /* Structure for one stage of MSVQ */ | | /* Structure containing NLSF codebook */ | |
| typedef struct { | | typedef struct { | |
|
| const SKP_int32 nVectors; | | const SKP_int16 nVectors; | |
| const SKP_int8 *CB_NLSF_Q8; | | const SKP_int16 order; | |
| const SKP_uint8 *Rates_Q4; | | const SKP_int16 quantStepSize_Q16; | |
| } SKP_Silk_NLSF_CBS; | | const SKP_int16 invQuantStepSize_Q6; | |
| | | const SKP_uint8 *CB1_NLSF_Q8; | |
| /* Structure containing NLSF MSVQ codebook */ | | const SKP_uint8 *CB1_iCDF; | |
| typedef struct { | | const SKP_uint8 *pred_Q8; | |
| const SKP_int32 nStages; | | const SKP_uint8 *ec_sel; | |
| | | const SKP_uint8 *ec_iCDF; | |
| /* Fields for (de)quantizing */ | | const SKP_uint8 *ec_Rates_Q5; | |
| const SKP_Silk_NLSF_CBS *CBStages; | | const SKP_int16 *deltaMin_Q15; | |
| const SKP_int *NDeltaMin_Q15; | | | |
| | | | |
| /* Fields for range (de)coding */ | | | |
| const SKP_uint8 * const *StartPtr; | | | |
| } SKP_Silk_NLSF_CB_struct; | | } SKP_Silk_NLSF_CB_struct; | |
| | | | |
| typedef struct { | | typedef struct { | |
| SKP_int8 GainsIndices[ MAX_NB_SUBFR ]; | | SKP_int8 GainsIndices[ MAX_NB_SUBFR ]; | |
| SKP_int8 LTPIndex[ MAX_NB_SUBFR ]; | | SKP_int8 LTPIndex[ MAX_NB_SUBFR ]; | |
|
| SKP_int8 NLSFIndices[ NLSF_MSVQ_MAX_CB_STAGES ]; | | SKP_int8 NLSFIndices[ MAX_LPC_ORDER + 1 ]; | |
| SKP_int16 lagIndex; | | SKP_int16 lagIndex; | |
| SKP_int8 contourIndex; | | SKP_int8 contourIndex; | |
| SKP_int8 signalType; | | SKP_int8 signalType; | |
| SKP_int8 quantOffsetType; | | SKP_int8 quantOffsetType; | |
| SKP_int8 NLSFInterpCoef_Q2; | | SKP_int8 NLSFInterpCoef_Q2; | |
| SKP_int8 PERIndex; | | SKP_int8 PERIndex; | |
| SKP_int8 LTP_scaleIndex; | | SKP_int8 LTP_scaleIndex; | |
| SKP_int8 Seed; | | SKP_int8 Seed; | |
| } SideInfoIndices; | | } SideInfoIndices; | |
| | | | |
| /********************************/ | | /********************************/ | |
| /* Encoder state */ | | /* Encoder state */ | |
| /********************************/ | | /********************************/ | |
| typedef struct { | | typedef struct { | |
|
| #if HIGH_PASS_INPUT | | | |
| SKP_int32 In_HP_State[ 2 ]; /* High
pass filter state */ | | SKP_int32 In_HP_State[ 2 ]; /* High
pass filter state */ | |
|
| #endif | | SKP_int32 variable_HP_smth1_Q15; /* Stat | |
| #if SWITCH_TRANSITION_FILTERING | | e of first smoother */ | |
| | | SKP_int32 variable_HP_smth2_Q15; /* Stat | |
| | | e of second smoother */ | |
| SKP_Silk_LP_state sLP; /* Low
pass filter state */ | | SKP_Silk_LP_state sLP; /* Low
pass filter state */ | |
|
| #endif | | | |
| SKP_Silk_VAD_state sVAD; /* Voic
e activity detector state */ | | SKP_Silk_VAD_state sVAD; /* Voic
e activity detector state */ | |
| SKP_Silk_nsq_state sNSQ; /* Nois
e Shape Quantizer State */ | | SKP_Silk_nsq_state sNSQ; /* Nois
e Shape Quantizer State */ | |
|
| | | SKP_int16 prev_NLSFq_Q15[ MAX_LPC_ORDER ];/* Prev | |
| | | iously quantized NLSF vector */ | |
| | | SKP_int speech_activity_Q8; /* Spee | |
| | | ch activity */ | |
| SKP_int8 LBRRprevLastGainIndex; | | SKP_int8 LBRRprevLastGainIndex; | |
| SKP_int8 prevSignalType; | | SKP_int8 prevSignalType; | |
| SKP_int prevLag; | | SKP_int prevLag; | |
|
| | | SKP_int pitch_LPC_win_length; | |
| | | SKP_int max_pitch_lag; /* High | |
| | | est possible pitch lag (samples) */ | |
| SKP_int32 API_fs_Hz; /* API
sampling frequency (Hz) */ | | SKP_int32 API_fs_Hz; /* API
sampling frequency (Hz) */ | |
| SKP_int32 prev_API_fs_Hz; /* Prev
ious API sampling frequency (Hz) */ | | SKP_int32 prev_API_fs_Hz; /* Prev
ious API sampling frequency (Hz) */ | |
| SKP_int maxInternal_fs_kHz; /* Maxi
mum internal sampling frequency (kHz) */ | | SKP_int maxInternal_fs_kHz; /* Maxi
mum internal sampling frequency (kHz) */ | |
| SKP_int minInternal_fs_kHz; /* Mini
mum internal sampling frequency (kHz) */ | | SKP_int minInternal_fs_kHz; /* Mini
mum internal sampling frequency (kHz) */ | |
| SKP_int fs_kHz; /* Inte
rnal sampling frequency (kHz) */ | | SKP_int fs_kHz; /* Inte
rnal sampling frequency (kHz) */ | |
| SKP_int nb_subfr; /* Numb
er of 5 ms subframes in a frame */ | | SKP_int nb_subfr; /* Numb
er of 5 ms subframes in a frame */ | |
| SKP_int frame_length; /* Fram
e length (samples) */ | | SKP_int frame_length; /* Fram
e length (samples) */ | |
| SKP_int subfr_length; /* Subf
rame length (samples) */ | | SKP_int subfr_length; /* Subf
rame length (samples) */ | |
| SKP_int ltp_mem_length; /* Leng
th of LTP memory */ | | SKP_int ltp_mem_length; /* Leng
th of LTP memory */ | |
| SKP_int la_pitch; /* Look
-ahead for pitch analysis (samples) */ | | SKP_int la_pitch; /* Look
-ahead for pitch analysis (samples) */ | |
| | | | |
| skipping to change at line 164 | | skipping to change at line 160 | |
| SKP_int pitchEstimationLPCOrder; /* Whit
ening filter order for pitch estimator */ | | SKP_int pitchEstimationLPCOrder; /* Whit
ening filter order for pitch estimator */ | |
| SKP_int32 pitchEstimationThreshold_Q16; /* Thre
shold for pitch estimator */ | | SKP_int32 pitchEstimationThreshold_Q16; /* Thre
shold for pitch estimator */ | |
| SKP_int LTPQuantLowComplexity; /* Flag
for low complexity LTP quantization */ | | SKP_int LTPQuantLowComplexity; /* Flag
for low complexity LTP quantization */ | |
| SKP_int mu_LTP_Q9; /* Rate
-distortion tradeoff in LTP quantization */ | | SKP_int mu_LTP_Q9; /* Rate
-distortion tradeoff in LTP quantization */ | |
| SKP_int NLSF_MSVQ_Survivors; /* Numb
er of survivors in NLSF MSVQ */ | | SKP_int NLSF_MSVQ_Survivors; /* Numb
er of survivors in NLSF MSVQ */ | |
| SKP_int first_frame_after_reset; /* Flag
for deactivating NLSF interp. and fluc. reduction after resets */ | | SKP_int first_frame_after_reset; /* Flag
for deactivating NLSF interp. and fluc. reduction after resets */ | |
| SKP_int controlled_since_last_payload; /* Flag
for ensuring codec_control only runs once per packet */ | | SKP_int controlled_since_last_payload; /* Flag
for ensuring codec_control only runs once per packet */ | |
| SKP_int warping_Q16; /* W
arping parameter for warped noise shaping */ | | SKP_int warping_Q16; /* W
arping parameter for warped noise shaping */ | |
| SKP_int useCBR; /* Flag
to enable constant bitrate */ | | SKP_int useCBR; /* Flag
to enable constant bitrate */ | |
| SKP_int prev_nBits; /* Use
to track bits used by each frame in packet */ | | SKP_int prev_nBits; /* Use
to track bits used by each frame in packet */ | |
|
| | | SKP_int prefillFlag; /* Flag
to indicate that only buffers are prefilled, no coding */ | |
| const SKP_uint8 *pitch_lag_low_bits_iCDF; /* Poin
ter to iCDF table for low bits of pitch lag index */ | | const SKP_uint8 *pitch_lag_low_bits_iCDF; /* Poin
ter to iCDF table for low bits of pitch lag index */ | |
| const SKP_uint8 *pitch_contour_iCDF; /* Poin
ter to iCDF table for pitch contour index */ | | const SKP_uint8 *pitch_contour_iCDF; /* Poin
ter to iCDF table for pitch contour index */ | |
|
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB[ 2 ]; /* Poin | | const SKP_Silk_NLSF_CB_struct *psNLSF_CB; /* Poin | |
| ters to voiced/unvoiced NLSF codebooks */ | | ter to NLSF codebook */ | |
| | | SKP_int input_quality_bands_Q15[ VAD_N_BANDS ]; | |
| | | SKP_int input_tilt_Q15; | |
| | | | |
| SKP_int8 VAD_flags[ MAX_FRAMES_PER_PACKET ]; | | SKP_int8 VAD_flags[ MAX_FRAMES_PER_PACKET ]; | |
| SKP_int8 LBRR_flag; | | SKP_int8 LBRR_flag; | |
| SKP_int LBRR_flags[ MAX_FRAMES_PER_PACKET ]; | | SKP_int LBRR_flags[ MAX_FRAMES_PER_PACKET ]; | |
| | | | |
| SideInfoIndices indices; | | SideInfoIndices indices; | |
| SKP_int8 pulses[ MAX_FRAME_LENGTH ]; | | SKP_int8 pulses[ MAX_FRAME_LENGTH ]; | |
| | | | |
| /* Input/output buffering */ | | /* Input/output buffering */ | |
| SKP_int16 inputBuf[ MAX_FRAME_LENGTH ]; /* buff
er containing input signal */ | | SKP_int16 inputBuf[ MAX_FRAME_LENGTH ]; /* buff
er containing input signal */ | |
| | | | |
| skipping to change at line 188 | | skipping to change at line 187 | |
| SKP_int nFramesPerPacket; | | SKP_int nFramesPerPacket; | |
| SKP_int nFramesAnalyzed; /* Numb
er of frames analyzed in current packet */ | | SKP_int nFramesAnalyzed; /* Numb
er of frames analyzed in current packet */ | |
| | | | |
| /* Parameters For LTP scaling Control */ | | /* Parameters For LTP scaling Control */ | |
| SKP_int frames_since_onset; | | SKP_int frames_since_onset; | |
| | | | |
| /* Specifically for entropy coding */ | | /* Specifically for entropy coding */ | |
| SKP_int ec_prevSignalType; | | SKP_int ec_prevSignalType; | |
| SKP_int16 ec_prevLagIndex; | | SKP_int16 ec_prevLagIndex; | |
| | | | |
|
| /* Bitrate control */ | | | |
| SKP_int32 bitrateDiff; /* Accu | | | |
| mulated diff. between the target bitrate and the switch bitrates */ | | | |
| SKP_int32 bitrate_threshold_up; /* Thre | | | |
| shold for switching to a higher internal sample frequency */ | | | |
| SKP_int32 bitrate_threshold_down; /* Thre | | | |
| shold for switching to a lower internal sample frequency */ | | | |
| | | | |
| SKP_Silk_resampler_state_struct resampler_state; | | SKP_Silk_resampler_state_struct resampler_state; | |
| | | | |
| /* DTX */ | | /* DTX */ | |
| SKP_int useDTX; /* Flag
to enable DTX */ | | SKP_int useDTX; /* Flag
to enable DTX */ | |
| SKP_int inDTX; /* Flag
to signal DTX period */ | | SKP_int inDTX; /* Flag
to signal DTX period */ | |
| SKP_int noSpeechCounter; /* Coun
ts concecutive nonactive frames, used by DTX */ | | SKP_int noSpeechCounter; /* Coun
ts concecutive nonactive frames, used by DTX */ | |
| | | | |
| /* Inband Low Bitrate Redundancy (LBRR) data */ | | /* Inband Low Bitrate Redundancy (LBRR) data */ | |
| SKP_int useInBandFEC; /* Save
s the API setting for query */ | | SKP_int useInBandFEC; /* Save
s the API setting for query */ | |
| SKP_int LBRR_enabled; /* Depe
nds on useInBandFRC, bitrate and packet loss rate */ | | SKP_int LBRR_enabled; /* Depe
nds on useInBandFRC, bitrate and packet loss rate */ | |
| | | | |
| skipping to change at line 226 | | skipping to change at line 220 | |
| SKP_int32 conc_energy; | | SKP_int32 conc_energy; | |
| SKP_int conc_energy_shift; | | SKP_int conc_energy_shift; | |
| SKP_int16 prevLTP_scale_Q14; | | SKP_int16 prevLTP_scale_Q14; | |
| SKP_int32 prevGain_Q16[ MAX_NB_SUBFR ]; | | SKP_int32 prevGain_Q16[ MAX_NB_SUBFR ]; | |
| SKP_int fs_kHz; | | SKP_int fs_kHz; | |
| } SKP_Silk_PLC_struct; | | } SKP_Silk_PLC_struct; | |
| | | | |
| /* Struct for CNG */ | | /* Struct for CNG */ | |
| typedef struct { | | typedef struct { | |
| SKP_int32 CNG_exc_buf_Q10[ MAX_FRAME_LENGTH ]; | | SKP_int32 CNG_exc_buf_Q10[ MAX_FRAME_LENGTH ]; | |
|
| SKP_int CNG_smth_NLSF_Q15[ MAX_LPC_ORDER ]; | | SKP_int16 CNG_smth_NLSF_Q15[ MAX_LPC_ORDER ]; | |
| SKP_int32 CNG_synth_state[ MAX_LPC_ORDER ]; | | SKP_int32 CNG_synth_state[ MAX_LPC_ORDER ]; | |
| SKP_int32 CNG_smth_Gain_Q16; | | SKP_int32 CNG_smth_Gain_Q16; | |
| SKP_int32 rand_seed; | | SKP_int32 rand_seed; | |
| SKP_int fs_kHz; | | SKP_int fs_kHz; | |
| } SKP_Silk_CNG_struct; | | } SKP_Silk_CNG_struct; | |
| | | | |
| /********************************/ | | /********************************/ | |
| /* Decoder state */ | | /* Decoder state */ | |
| /********************************/ | | /********************************/ | |
| typedef struct { | | typedef struct { | |
| | | | |
| skipping to change at line 254 | | skipping to change at line 248 | |
| SKP_int32 HPState[ DEC_HP_ORDER ]; /* HP filte
r state */ | | SKP_int32 HPState[ DEC_HP_ORDER ]; /* HP filte
r state */ | |
| const SKP_int32 *HP_A; /* HP filte
r AR coefficients */ | | const SKP_int32 *HP_A; /* HP filte
r AR coefficients */ | |
| const SKP_int32 *HP_B; /* HP filte
r MA coefficients */ | | const SKP_int32 *HP_B; /* HP filte
r MA coefficients */ | |
| SKP_int fs_kHz; /* Sampling
frequency in kHz */ | | SKP_int fs_kHz; /* Sampling
frequency in kHz */ | |
| SKP_int32 prev_API_sampleRate; /* Previous
API sample frequency (Hz) */ | | SKP_int32 prev_API_sampleRate; /* Previous
API sample frequency (Hz) */ | |
| SKP_int nb_subfr; /* Number o
f 5 ms subframes in a frame */ | | SKP_int nb_subfr; /* Number o
f 5 ms subframes in a frame */ | |
| SKP_int frame_length; /* Frame le
ngth (samples) */ | | SKP_int frame_length; /* Frame le
ngth (samples) */ | |
| SKP_int subfr_length; /* Subframe
length (samples) */ | | SKP_int subfr_length; /* Subframe
length (samples) */ | |
| SKP_int ltp_mem_length; /* Length o
f LTP memory */ | | SKP_int ltp_mem_length; /* Length o
f LTP memory */ | |
| SKP_int LPC_order; /* LPC orde
r */ | | SKP_int LPC_order; /* LPC orde
r */ | |
|
| SKP_int prevNLSF_Q15[ MAX_LPC_ORDER ]; /* Used to
interpolate LSFs */ | | SKP_int16 prevNLSF_Q15[ MAX_LPC_ORDER ]; /* Used to
interpolate LSFs */ | |
| SKP_int first_frame_after_reset; /* Flag for
deactivating NLSF interp. and fluc. reduction after resets */ | | SKP_int first_frame_after_reset; /* Flag for
deactivating NLSF interp. and fluc. reduction after resets */ | |
| const SKP_uint8 *pitch_lag_low_bits_iCDF; /* Pointer
to iCDF table for low bits of pitch lag index */ | | const SKP_uint8 *pitch_lag_low_bits_iCDF; /* Pointer
to iCDF table for low bits of pitch lag index */ | |
| const SKP_uint8 *pitch_contour_iCDF; /* Pointer
to iCDF table for pitch contour index */ | | const SKP_uint8 *pitch_contour_iCDF; /* Pointer
to iCDF table for pitch contour index */ | |
| | | | |
| /* For buffering payload in case of more frames per packet */ | | /* For buffering payload in case of more frames per packet */ | |
| SKP_int nFramesDecoded; | | SKP_int nFramesDecoded; | |
| SKP_int nFramesPerPacket; | | SKP_int nFramesPerPacket; | |
| | | | |
| /* Specifically for entropy coding */ | | /* Specifically for entropy coding */ | |
| SKP_int ec_prevSignalType; | | SKP_int ec_prevSignalType; | |
| SKP_int16 ec_prevLagIndex; | | SKP_int16 ec_prevLagIndex; | |
| | | | |
| SKP_int VAD_flags[ MAX_FRAMES_PER_PACKET ]; | | SKP_int VAD_flags[ MAX_FRAMES_PER_PACKET ]; | |
| SKP_int LBRR_flag; | | SKP_int LBRR_flag; | |
| SKP_int LBRR_flags[ MAX_FRAMES_PER_PACKET ]; | | SKP_int LBRR_flags[ MAX_FRAMES_PER_PACKET ]; | |
| | | | |
| SKP_Silk_resampler_state_struct resampler_state; | | SKP_Silk_resampler_state_struct resampler_state; | |
| | | | |
|
| const SKP_Silk_NLSF_CB_struct *psNLSF_CB[ 2 ]; /* Pointers to voic
ed/unvoiced NLSF codebooks */ | | const SKP_Silk_NLSF_CB_struct *psNLSF_CB; /* Pointer
to NLSF codebook */ | |
| | | | |
| /* Quantization indices */ | | /* Quantization indices */ | |
| SideInfoIndices indices; | | SideInfoIndices indices; | |
| | | | |
| /* CNG state */ | | /* CNG state */ | |
| SKP_Silk_CNG_struct sCNG; | | SKP_Silk_CNG_struct sCNG; | |
| | | | |
| /* Stuff used for PLC */ | | /* Stuff used for PLC */ | |
| SKP_int lossCnt; | | SKP_int lossCnt; | |
| SKP_int prevSignalType; | | SKP_int prevSignalType; | |
| | | | |
End of changes. 17 change blocks. |
| 37 lines changed or deleted | | 33 lines changed or added | |
|
| SKP_Silk_structs_FIX.h | | SKP_Silk_structs_FIX.h | |
| | | | |
| skipping to change at line 64 | | skipping to change at line 64 | |
| SKP_int16 sLTP_shp[ LTP_BUF_LENGTH ]; | | SKP_int16 sLTP_shp[ LTP_BUF_LENGTH ]; | |
| SKP_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; | | SKP_int32 sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; | |
| SKP_int sLTP_shp_buf_idx; | | SKP_int sLTP_shp_buf_idx; | |
| SKP_int32 sLF_AR_shp_Q12; | | SKP_int32 sLF_AR_shp_Q12; | |
| SKP_int32 sLF_MA_shp_Q12; | | SKP_int32 sLF_MA_shp_Q12; | |
| SKP_int sHarmHP; | | SKP_int sHarmHP; | |
| SKP_int32 rand_seed; | | SKP_int32 rand_seed; | |
| SKP_int lagPrev; | | SKP_int lagPrev; | |
| } SKP_Silk_prefilter_state_FIX; | | } SKP_Silk_prefilter_state_FIX; | |
| | | | |
|
| /*****************************/ | | | |
| /* Prediction analysis state */ | | | |
| /*****************************/ | | | |
| typedef struct { | | | |
| SKP_int pitch_LPC_win_length; | | | |
| SKP_int min_pitch_lag; /* Lowe | | | |
| st possible pitch lag (samples) */ | | | |
| SKP_int max_pitch_lag; /* High | | | |
| est possible pitch lag (samples) */ | | | |
| SKP_int prev_NLSFq_Q15[ MAX_LPC_ORDER ]; /* Prev | | | |
| iously quantized NLSF vector */ | | | |
| } SKP_Silk_predict_state_FIX; | | | |
| | | | |
| /********************************/ | | /********************************/ | |
| /* Encoder state FIX */ | | /* Encoder state FIX */ | |
| /********************************/ | | /********************************/ | |
| typedef struct { | | typedef struct { | |
| SKP_Silk_encoder_state sCmn; /* Comm
on struct, shared with floating-point code */ | | SKP_Silk_encoder_state sCmn; /* Comm
on struct, shared with floating-point code */ | |
|
| | | | |
| #if HIGH_PASS_INPUT | | | |
| SKP_int32 variable_HP_smth1_Q15; /* Stat | | | |
| e of first smoother */ | | | |
| SKP_int32 variable_HP_smth2_Q15; /* Stat | | | |
| e of second smoother */ | | | |
| #endif | | | |
| SKP_Silk_shape_state_FIX sShape; /* Shap
e state */ | | SKP_Silk_shape_state_FIX sShape; /* Shap
e state */ | |
| SKP_Silk_prefilter_state_FIX sPrefilt; /* Pref
ilter State */ | | SKP_Silk_prefilter_state_FIX sPrefilt; /* Pref
ilter State */ | |
|
| SKP_Silk_predict_state_FIX sPred; /* Pred
iction state */ | | | |
| | | | |
| /* Buffer for find pitch and noise shape analysis */ | | /* Buffer for find pitch and noise shape analysis */ | |
| SKP_DWORD_ALIGN SKP_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ]; | | SKP_DWORD_ALIGN SKP_int16 x_buf[ 2 * MAX_FRAME_LENGTH + LA_SHAPE_MAX ]; | |
| SKP_int LTPCorr_Q15; /* Norm
alized correlation from pitch lag estimator */ | | SKP_int LTPCorr_Q15; /* Norm
alized correlation from pitch lag estimator */ | |
| SKP_int32 SNR_dB_Q7; /* Qual
ity setting */ | | SKP_int32 SNR_dB_Q7; /* Qual
ity setting */ | |
| SKP_int BufferedInChannel_ms; /* Simu
lated number of ms buffer because of exceeded TargetRate_bps */ | | SKP_int BufferedInChannel_ms; /* Simu
lated number of ms buffer because of exceeded TargetRate_bps */ | |
|
| SKP_int speech_activity_Q8; /* Spee
ch activity in Q8 */ | | | |
| | | | |
| /* Parameters For LTP scaling Control */ | | /* Parameters For LTP scaling Control */ | |
| SKP_int prevLTPredCodGain_Q7; | | SKP_int prevLTPredCodGain_Q7; | |
| SKP_int HPLTPredCodGain_Q7; | | SKP_int HPLTPredCodGain_Q7; | |
| | | | |
| SKP_int32 inBandFEC_SNR_comp_Q7; /* Comp
ensation to SNR_dB when using inband FEC Voiced */ | | SKP_int32 inBandFEC_SNR_comp_Q7; /* Comp
ensation to SNR_dB when using inband FEC Voiced */ | |
| | | | |
| } SKP_Silk_encoder_state_FIX; | | } SKP_Silk_encoder_state_FIX; | |
| | | | |
| /************************/ | | /************************/ | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 109 | |
| SKP_DWORD_ALIGN SKP_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]
; | | SKP_DWORD_ALIGN SKP_int16 AR1_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]
; | |
| SKP_DWORD_ALIGN SKP_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]
; | | SKP_DWORD_ALIGN SKP_int16 AR2_Q13[ MAX_NB_SUBFR * MAX_SHAPE_LPC_ORDER ]
; | |
| SKP_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two in
t16 coefficients per int32 value */ | | SKP_int32 LF_shp_Q14[ MAX_NB_SUBFR ]; /* Packs two in
t16 coefficients per int32 value */ | |
| SKP_int GainsPre_Q14[ MAX_NB_SUBFR ]; | | SKP_int GainsPre_Q14[ MAX_NB_SUBFR ]; | |
| SKP_int HarmBoost_Q14[ MAX_NB_SUBFR ]; | | SKP_int HarmBoost_Q14[ MAX_NB_SUBFR ]; | |
| SKP_int Tilt_Q14[ MAX_NB_SUBFR ]; | | SKP_int Tilt_Q14[ MAX_NB_SUBFR ]; | |
| SKP_int HarmShapeGain_Q14[ MAX_NB_SUBFR ]; | | SKP_int HarmShapeGain_Q14[ MAX_NB_SUBFR ]; | |
| SKP_int Lambda_Q10; | | SKP_int Lambda_Q10; | |
| SKP_int input_quality_Q14; | | SKP_int input_quality_Q14; | |
| SKP_int coding_quality_Q14; | | SKP_int coding_quality_Q14; | |
|
| SKP_int32 pitch_freq_low_Hz; | | | |
| SKP_int current_SNR_dB_Q7; | | SKP_int current_SNR_dB_Q7; | |
| | | | |
| /* measures */ | | /* measures */ | |
| SKP_int sparseness_Q8; | | SKP_int sparseness_Q8; | |
| SKP_int32 predGain_Q16; | | SKP_int32 predGain_Q16; | |
| SKP_int LTPredCodGain_Q7; | | SKP_int LTPredCodGain_Q7; | |
|
| SKP_int input_quality_bands_Q15[ VAD_N_BANDS ]; | | | |
| SKP_int input_tilt_Q15; | | | |
| SKP_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per
subframe */ | | SKP_int32 ResNrg[ MAX_NB_SUBFR ]; /* Residual energy per
subframe */ | |
| SKP_int ResNrgQ[ MAX_NB_SUBFR ]; /* Q domain for the res
idual energy > 0 */ | | SKP_int ResNrgQ[ MAX_NB_SUBFR ]; /* Q domain for the res
idual energy > 0 */ | |
| | | | |
| } SKP_Silk_encoder_control_FIX; | | } SKP_Silk_encoder_control_FIX; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 25 lines changed or deleted | | 0 lines changed or added | |
|
| SKP_Silk_structs_FLP.h | | SKP_Silk_structs_FLP.h | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| SKP_float sLTP_shp[ LTP_BUF_LENGTH ]; | | SKP_float sLTP_shp[ LTP_BUF_LENGTH ]; | |
| SKP_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; | | SKP_float sAR_shp[ MAX_SHAPE_LPC_ORDER + 1 ]; | |
| SKP_int sLTP_shp_buf_idx; | | SKP_int sLTP_shp_buf_idx; | |
| SKP_float sLF_AR_shp; | | SKP_float sLF_AR_shp; | |
| SKP_float sLF_MA_shp; | | SKP_float sLF_MA_shp; | |
| SKP_float sHarmHP; | | SKP_float sHarmHP; | |
| SKP_int32 rand_seed; | | SKP_int32 rand_seed; | |
| SKP_int lagPrev; | | SKP_int lagPrev; | |
| } SKP_Silk_prefilter_state_FLP; | | } SKP_Silk_prefilter_state_FLP; | |
| | | | |
|
| /*****************************/ | | | |
| /* Prediction analysis state */ | | | |
| /*****************************/ | | | |
| typedef struct { | | | |
| SKP_int pitch_LPC_win_length; | | | |
| SKP_int min_pitch_lag; /* Lowest possible pitc | | | |
| h lag (samples) */ | | | |
| SKP_int max_pitch_lag; /* Highest possible pit | | | |
| ch lag (samples) */ | | | |
| SKP_float prev_NLSFq[ MAX_LPC_ORDER ]; /* Previously quantized | | | |
| NLSF vector */ | | | |
| } SKP_Silk_predict_state_FLP; | | | |
| | | | |
| /********************************/ | | /********************************/ | |
| /* Encoder state FLP */ | | /* Encoder state FLP */ | |
| /********************************/ | | /********************************/ | |
| typedef struct { | | typedef struct { | |
| SKP_Silk_encoder_state sCmn; /* Comm
on struct, shared with fixed-point code */ | | SKP_Silk_encoder_state sCmn; /* Comm
on struct, shared with fixed-point code */ | |
|
| | | | |
| SKP_float variable_HP_smth1; /* Stat | | | |
| e of first smoother */ | | | |
| SKP_float variable_HP_smth2; /* Stat | | | |
| e of second smoother */ | | | |
| | | | |
| SKP_Silk_shape_state_FLP sShape; /* Nois
e shaping state */ | | SKP_Silk_shape_state_FLP sShape; /* Nois
e shaping state */ | |
| SKP_Silk_prefilter_state_FLP sPrefilt; /* Pref
ilter State */ | | SKP_Silk_prefilter_state_FLP sPrefilt; /* Pref
ilter State */ | |
|
| SKP_Silk_predict_state_FLP sPred; /* Pred
iction State */ | | | |
| | | | |
| /* Buffer for find pitch and noise shape analysis */ | | /* Buffer for find pitch and noise shape analysis */ | |
| SKP_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SH
APE_MAX ];/* Buffer for find pitch and noise shape analysis */ | | SKP_float x_buf[ 2 * MAX_FRAME_LENGTH + LA_SH
APE_MAX ];/* Buffer for find pitch and noise shape analysis */ | |
| SKP_float LTPCorr; /* Norm
alized correlation from pitch lag estimator */ | | SKP_float LTPCorr; /* Norm
alized correlation from pitch lag estimator */ | |
| SKP_float SNR_dB; /* Qual
ity setting */ | | SKP_float SNR_dB; /* Qual
ity setting */ | |
| SKP_float BufferedInChannel_ms; /* Simu
lated number of ms buffer in channel because of exceeded TargetRate_bps */ | | SKP_float BufferedInChannel_ms; /* Simu
lated number of ms buffer in channel because of exceeded TargetRate_bps */ | |
|
| SKP_float speech_activity; /* Spee
ch activity */ | | | |
| | | | |
| /* Parameters for LTP scaling control */ | | /* Parameters for LTP scaling control */ | |
| SKP_float prevLTPredCodGain; | | SKP_float prevLTPredCodGain; | |
| SKP_float HPLTPredCodGain; | | SKP_float HPLTPredCodGain; | |
| | | | |
| SKP_float inBandFEC_SNR_comp; /* Comp
ensation to SNR_DB when using inband FEC Voiced */ | | SKP_float inBandFEC_SNR_comp; /* Comp
ensation to SNR_DB when using inband FEC Voiced */ | |
| } SKP_Silk_encoder_state_FLP; | | } SKP_Silk_encoder_state_FLP; | |
| | | | |
| /************************/ | | /************************/ | |
| /* Encoder control FLP */ | | /* Encoder control FLP */ | |
| | | | |
| skipping to change at line 123 | | skipping to change at line 107 | |
| SKP_float AR2[ MAX_NB_SUBFR *
MAX_SHAPE_LPC_ORDER ]; | | SKP_float AR2[ MAX_NB_SUBFR *
MAX_SHAPE_LPC_ORDER ]; | |
| SKP_float LF_MA_shp[ MAX_N
B_SUBFR ]; | | SKP_float LF_MA_shp[ MAX_N
B_SUBFR ]; | |
| SKP_float LF_AR_shp[ MAX_N
B_SUBFR ]; | | SKP_float LF_AR_shp[ MAX_N
B_SUBFR ]; | |
| SKP_float GainsPre[ MAX_N
B_SUBFR ]; | | SKP_float GainsPre[ MAX_N
B_SUBFR ]; | |
| SKP_float HarmBoost[ MAX_N
B_SUBFR ]; | | SKP_float HarmBoost[ MAX_N
B_SUBFR ]; | |
| SKP_float Tilt[ MAX_N
B_SUBFR ]; | | SKP_float Tilt[ MAX_N
B_SUBFR ]; | |
| SKP_float HarmShapeGain[ MAX_N
B_SUBFR ]; | | SKP_float HarmShapeGain[ MAX_N
B_SUBFR ]; | |
| SKP_float Lambda; | | SKP_float Lambda; | |
| SKP_float input_quality; | | SKP_float input_quality; | |
| SKP_float coding_quality; | | SKP_float coding_quality; | |
|
| SKP_float pitch_freq_low_Hz; | | | |
| SKP_float current_SNR_dB; | | SKP_float current_SNR_dB; | |
| | | | |
| /* Measures */ | | /* Measures */ | |
| SKP_float sparseness; | | SKP_float sparseness; | |
| SKP_float predGain; | | SKP_float predGain; | |
| SKP_float LTPredCodGain; | | SKP_float LTPredCodGain; | |
|
| SKP_float input_quality_bands[ | | | |
| VAD_N_BANDS ]; | | | |
| SKP_float input_tilt; | | | |
| SKP_float ResNrg[ MAX_NB_SUBFR
]; /* Residual energy per subframe */ | | SKP_float ResNrg[ MAX_NB_SUBFR
]; /* Residual energy per subframe */ | |
| } SKP_Silk_encoder_control_FLP; | | } SKP_Silk_encoder_control_FLP; | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 25 lines changed or deleted | | 0 lines changed or added | |
|
| SKP_Silk_tables.h | | SKP_Silk_tables.h | |
| | | | |
| skipping to change at line 71 | | skipping to change at line 71 | |
| extern const SKP_uint8 SKP_Silk_shell_code_table0[ 44 ];
/* 44 */ | | extern const SKP_uint8 SKP_Silk_shell_code_table0[ 44 ];
/* 44 */ | |
| extern const SKP_uint8 SKP_Silk_shell_code_table1[ 65 ];
/* 65 */ | | extern const SKP_uint8 SKP_Silk_shell_code_table1[ 65 ];
/* 65 */ | |
| extern const SKP_uint8 SKP_Silk_shell_code_table2[ 90 ];
/* 90 */ | | extern const SKP_uint8 SKP_Silk_shell_code_table2[ 90 ];
/* 90 */ | |
| extern const SKP_uint8 SKP_Silk_shell_code_table3[ 152 ];
/* 152 */ | | extern const SKP_uint8 SKP_Silk_shell_code_table3[ 152 ];
/* 152 */ | |
| extern const SKP_uint8 SKP_Silk_shell_code_table_offsets[ MAX_PULSES + 1 ]
; /* 17 */ | | extern const SKP_uint8 SKP_Silk_shell_code_table_offsets[ MAX_PULSES + 1 ]
; /* 17 */ | |
| | | | |
| extern const SKP_uint8 SKP_Silk_lsb_iCDF[ 2 ];
/* 2 */ | | extern const SKP_uint8 SKP_Silk_lsb_iCDF[ 2 ];
/* 2 */ | |
| | | | |
| extern const SKP_uint8 SKP_Silk_sign_iCDF[ 36 ];
/* 36 */ | | extern const SKP_uint8 SKP_Silk_sign_iCDF[ 36 ];
/* 36 */ | |
| | | | |
|
| | | extern const SKP_uint8 SKP_Silk_uniform2_iCDF[ 2 ];
/* 2 */ | |
| extern const SKP_uint8 SKP_Silk_uniform4_iCDF[ 4 ];
/* 4 */ | | extern const SKP_uint8 SKP_Silk_uniform4_iCDF[ 4 ];
/* 4 */ | |
| extern const SKP_uint8 SKP_Silk_uniform6_iCDF[ 6 ];
/* 6 */ | | extern const SKP_uint8 SKP_Silk_uniform6_iCDF[ 6 ];
/* 6 */ | |
| extern const SKP_uint8 SKP_Silk_uniform8_iCDF[ 8 ];
/* 8 */ | | extern const SKP_uint8 SKP_Silk_uniform8_iCDF[ 8 ];
/* 8 */ | |
| | | | |
|
| | | extern const SKP_uint8 SKP_Silk_NLSF_EXT_iCDF[ 7 ]; | |
| | | /* 7 */ | |
| | | | |
| extern const SKP_uint8 SKP_Silk_LTP_per_index_iCDF[ 3 ];
/* 3 */ | | extern const SKP_uint8 SKP_Silk_LTP_per_index_iCDF[ 3 ];
/* 3 */ | |
| extern const SKP_uint8 * const SKP_Silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ];
/* 3 */ | | extern const SKP_uint8 * const SKP_Silk_LTP_gain_iCDF_ptrs[ NB_LTP_CBKS ];
/* 3 */ | |
| extern const SKP_uint8 * const SKP_Silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS
]; /* 3 */ | | extern const SKP_uint8 * const SKP_Silk_LTP_gain_BITS_Q5_ptrs[ NB_LTP_CBKS
]; /* 3 */ | |
| extern const SKP_int16 SKP_Silk_LTP_gain_middle_avg_RD_Q14; | | extern const SKP_int16 SKP_Silk_LTP_gain_middle_avg_RD_Q14; | |
| extern const SKP_int8 * const SKP_Silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ];
/* 168 */ | | extern const SKP_int8 * const SKP_Silk_LTP_vq_ptrs_Q7[ NB_LTP_CBKS ];
/* 168 */ | |
| extern const SKP_int8 SKP_Silk_LTP_vq_sizes[ NB_LTP_CBKS ];
/* 3 */ | | extern const SKP_int8 SKP_Silk_LTP_vq_sizes[ NB_LTP_CBKS ];
/* 3 */ | |
| | | | |
| extern const SKP_uint8 SKP_Silk_LTPscale_iCDF[ 3 ];
/* 4 */ | | extern const SKP_uint8 SKP_Silk_LTPscale_iCDF[ 3 ];
/* 4 */ | |
| extern const SKP_int16 SKP_Silk_LTPScales_table_Q14[ 3 ]; | | extern const SKP_int16 SKP_Silk_LTPScales_table_Q14[ 3 ]; | |
| | | | |
| extern const SKP_uint8 SKP_Silk_type_offset_VAD_iCDF[4];
/* 4 */ | | extern const SKP_uint8 SKP_Silk_type_offset_VAD_iCDF[4];
/* 4 */ | |
| extern const SKP_uint8 SKP_Silk_type_offset_no_VAD_iCDF[2];
/* 2 */ | | extern const SKP_uint8 SKP_Silk_type_offset_no_VAD_iCDF[2];
/* 2 */ | |
| | | | |
| extern const SKP_uint8 * const SKP_Silk_LBRR_flags_iCDF_ptr[2];
/* 10 */ | | extern const SKP_uint8 * const SKP_Silk_LBRR_flags_iCDF_ptr[2];
/* 10 */ | |
| | | | |
| extern const SKP_uint8 SKP_Silk_NLSF_interpolation_factor_iCDF[ 5 ];
/* 5 */ | | extern const SKP_uint8 SKP_Silk_NLSF_interpolation_factor_iCDF[ 5 ];
/* 5 */ | |
| | | | |
|
| /* NLSF codebooks */ | | extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB_WB; | |
| extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_16, SKP_Silk_NLSF_CB | | extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB_NB_MB; | |
| 1_16; | | | |
| extern const SKP_Silk_NLSF_CB_struct SKP_Silk_NLSF_CB0_10, SKP_Silk_NLSF_CB | | | |
| 1_10; | | | |
| | | | |
| /* Piece-wise linear mapping from bitrate in kbps to coding quality in dB S
NR */ | | /* Piece-wise linear mapping from bitrate in kbps to coding quality in dB S
NR */ | |
| extern const SKP_int32 TargetRate_table_NB[ TARGET_RATE_TAB_SZ ]; | | extern const SKP_int32 TargetRate_table_NB[ TARGET_RATE_TAB_SZ ]; | |
| extern const SKP_int32 TargetRate_table_MB[ TARGET_RATE_TAB_SZ ]; | | extern const SKP_int32 TargetRate_table_MB[ TARGET_RATE_TAB_SZ ]; | |
| extern const SKP_int32 TargetRate_table_WB[ TARGET_RATE_TAB_SZ ]; | | extern const SKP_int32 TargetRate_table_WB[ TARGET_RATE_TAB_SZ ]; | |
| extern const SKP_int16 SNR_table_Q1[ TARGET_RATE_TAB_SZ ]; | | extern const SKP_int16 SNR_table_Q1[ TARGET_RATE_TAB_SZ ]; | |
| | | | |
| /* Decoder high-pass filter coefficients */ | | /* Decoder high-pass filter coefficients */ | |
| extern const SKP_int32 SKP_Silk_Dec_A_HP_16[ DEC_HP_ORDER ];
/* 2 */ | | extern const SKP_int32 SKP_Silk_Dec_A_HP_16[ DEC_HP_ORDER ];
/* 2 */ | |
| extern const SKP_int32 SKP_Silk_Dec_B_HP_16[ DEC_HP_ORDER + 1 ];
/* 3 */ | | extern const SKP_int32 SKP_Silk_Dec_B_HP_16[ DEC_HP_ORDER + 1 ];
/* 3 */ | |
| | | | |
End of changes. 3 change blocks. |
| 5 lines changed or deleted | | 6 lines changed or added | |
|
| opus.h | | opus.h | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| #define EXPORT __attribute__ ((visibility ("default"))) | | #define EXPORT __attribute__ ((visibility ("default"))) | |
| #elif defined(WIN32) | | #elif defined(WIN32) | |
| #define EXPORT __declspec(dllexport) | | #define EXPORT __declspec(dllexport) | |
| #else | | #else | |
| #define EXPORT | | #define EXPORT | |
| #endif | | #endif | |
| | | | |
| #define __check_int(x) (((void)((x) == (int)0)), (int)(x)) | | #define __check_int(x) (((void)((x) == (int)0)), (int)(x)) | |
| #define __check_int_ptr(ptr) ((ptr) + ((ptr) - (int*)(ptr))) | | #define __check_int_ptr(ptr) ((ptr) + ((ptr) - (int*)(ptr))) | |
| | | | |
|
| | | /* Error codes */ | |
| | | /** No error */ | |
| | | #define OPUS_OK 0 | |
| | | /** An (or more) invalid argument (e.g. out of range) */ | |
| | | #define OPUS_BAD_ARG -1 | |
| | | /** The mode struct passed is invalid */ | |
| | | #define OPUS_INVALID_MODE -2 | |
| | | /** An internal error was detected */ | |
| | | #define OPUS_INTERNAL_ERROR -3 | |
| | | /** The data passed (e.g. compressed data to decoder) is corrupted */ | |
| | | #define OPUS_CORRUPTED_DATA -4 | |
| | | /** Invalid/unsupported request number */ | |
| | | #define OPUS_UNIMPLEMENTED -5 | |
| | | /** An encoder or decoder structure is invalid or already freed */ | |
| | | #define OPUS_INVALID_STATE -6 | |
| | | /** Memory allocation has failed */ | |
| | | #define OPUS_ALLOC_FAIL -7 | |
| | | | |
| #define OPUS_TEST_RANGE_CODER_STATE 1 | | #define OPUS_TEST_RANGE_CODER_STATE 1 | |
| | | | |
|
| | | #define OPUS_MODE_AUTO 2000 | |
| | | #define OPUS_MODE_VOICE 2001 | |
| | | #define OPUS_MODE_AUDIO 2002 | |
| | | | |
| #define MODE_SILK_ONLY 1000 | | #define MODE_SILK_ONLY 1000 | |
| #define MODE_HYBRID 1001 | | #define MODE_HYBRID 1001 | |
| #define MODE_CELT_ONLY 1002 | | #define MODE_CELT_ONLY 1002 | |
| | | | |
|
| #define BANDWIDTH_NARROWBAND 1100 | | #define BANDWIDTH_AUTO 1100 | |
| #define BANDWIDTH_MEDIUMBAND 1101 | | #define BANDWIDTH_NARROWBAND 1101 | |
| #define BANDWIDTH_WIDEBAND 1102 | | #define BANDWIDTH_MEDIUMBAND 1102 | |
| #define BANDWIDTH_SUPERWIDEBAND 1103 | | #define BANDWIDTH_WIDEBAND 1103 | |
| #define BANDWIDTH_FULLBAND 1104 | | #define BANDWIDTH_SUPERWIDEBAND 1104 | |
| | | #define BANDWIDTH_FULLBAND 1105 | |
| | | | |
| #define OPUS_SET_MODE_REQUEST 0 | | #define OPUS_SET_MODE_REQUEST 0 | |
| #define OPUS_SET_MODE(x) OPUS_SET_MODE_REQUEST, __check_int(x) | | #define OPUS_SET_MODE(x) OPUS_SET_MODE_REQUEST, __check_int(x) | |
| #define OPUS_GET_MODE_REQUEST 1 | | #define OPUS_GET_MODE_REQUEST 1 | |
| #define OPUS_GET_MODE(x) OPUS_GET_MODE_REQUEST, __check_int_ptr(x) | | #define OPUS_GET_MODE(x) OPUS_GET_MODE_REQUEST, __check_int_ptr(x) | |
| | | | |
| #define OPUS_SET_BITRATE_REQUEST 2 | | #define OPUS_SET_BITRATE_REQUEST 2 | |
| #define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __check_int(x) | | #define OPUS_SET_BITRATE(x) OPUS_SET_BITRATE_REQUEST, __check_int(x) | |
| #define OPUS_GET_BITRATE_REQUEST 3 | | #define OPUS_GET_BITRATE_REQUEST 3 | |
| #define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __check_int_ptr(x) | | #define OPUS_GET_BITRATE(x) OPUS_GET_BITRATE_REQUEST, __check_int_ptr(x) | |
| | | | |
| skipping to change at line 98 | | skipping to change at line 121 | |
| #define OPUS_SET_PACKET_LOSS_PERC_REQUEST 14 | | #define OPUS_SET_PACKET_LOSS_PERC_REQUEST 14 | |
| #define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __c
heck_int(x) | | #define OPUS_SET_PACKET_LOSS_PERC(x) OPUS_SET_PACKET_LOSS_PERC_REQUEST, __c
heck_int(x) | |
| #define OPUS_GET_PACKET_LOSS_PERC_REQUEST 15 | | #define OPUS_GET_PACKET_LOSS_PERC_REQUEST 15 | |
| #define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __c
heck_int_ptr(x) | | #define OPUS_GET_PACKET_LOSS_PERC(x) OPUS_GET_PACKET_LOSS_PERC_REQUEST, __c
heck_int_ptr(x) | |
| | | | |
| #define OPUS_SET_DTX_FLAG_REQUEST 16 | | #define OPUS_SET_DTX_FLAG_REQUEST 16 | |
| #define OPUS_SET_DTX_FLAG(x) OPUS_SET_DTX_FLAG_REQUEST, __check_int(x) | | #define OPUS_SET_DTX_FLAG(x) OPUS_SET_DTX_FLAG_REQUEST, __check_int(x) | |
| #define OPUS_GET_DTX_FLAG_REQUEST 17 | | #define OPUS_GET_DTX_FLAG_REQUEST 17 | |
| #define OPUS_GET_DTX_FLAG(x) OPUS_GET_DTX_FLAG_REQUEST, __check_int_ptr(x) | | #define OPUS_GET_DTX_FLAG(x) OPUS_GET_DTX_FLAG_REQUEST, __check_int_ptr(x) | |
| | | | |
|
| | | #define OPUS_SET_VOICE_RATIO_REQUEST 18 | |
| | | #define OPUS_SET_VOICE_RATIO(x) OPUS_SET_VOICE_RATIO_REQUEST, __check_int(x | |
| | | ) | |
| | | #define OPUS_GET_VOICE_RATIO_REQUEST 19 | |
| | | #define OPUS_GET_VOICE_RATIO(x) OPUS_GET_VOICE_RATIO_REQUEST, __check_int_p | |
| | | tr(x) | |
| | | | |
| typedef struct OpusEncoder OpusEncoder; | | typedef struct OpusEncoder OpusEncoder; | |
| typedef struct OpusDecoder OpusDecoder; | | typedef struct OpusDecoder OpusDecoder; | |
| | | | |
| OpusEncoder *opus_encoder_create(int Fs, int channels); | | OpusEncoder *opus_encoder_create(int Fs, int channels); | |
| | | | |
| /* returns length of data payload (in bytes) */ | | /* returns length of data payload (in bytes) */ | |
| int opus_encode(OpusEncoder *st, const short *pcm, int frame_size, | | int opus_encode(OpusEncoder *st, const short *pcm, int frame_size, | |
| unsigned char *data, int max_data_bytes); | | unsigned char *data, int max_data_bytes); | |
| | | | |
| void opus_encoder_destroy(OpusEncoder *st); | | void opus_encoder_destroy(OpusEncoder *st); | |
| | | | |
|
| void opus_encoder_ctl(OpusEncoder *st, int request, ...); | | int opus_encoder_ctl(OpusEncoder *st, int request, ...); | |
| | | | |
| OpusDecoder *opus_decoder_create(int Fs, int channels); | | OpusDecoder *opus_decoder_create(int Fs, int channels); | |
| | | | |
| /* returns (CELT) error code */ | | /* returns (CELT) error code */ | |
| int opus_decode(OpusDecoder *st, const unsigned char *data, int len, | | int opus_decode(OpusDecoder *st, const unsigned char *data, int len, | |
| short *pcm, int frame_size, int decode_fec); | | short *pcm, int frame_size, int decode_fec); | |
| | | | |
|
| void opus_decoder_ctl(OpusDecoder *st, int request, ...); | | int opus_decoder_ctl(OpusDecoder *st, int request, ...); | |
| | | | |
| void opus_decoder_destroy(OpusDecoder *st); | | void opus_decoder_destroy(OpusDecoder *st); | |
| | | | |
| #if OPUS_TEST_RANGE_CODER_STATE | | #if OPUS_TEST_RANGE_CODER_STATE | |
| int opus_encoder_get_final_range(OpusEncoder *st); | | int opus_encoder_get_final_range(OpusEncoder *st); | |
| int opus_decoder_get_final_range(OpusDecoder *st); | | int opus_decoder_get_final_range(OpusDecoder *st); | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
End of changes. 6 change blocks. |
| 7 lines changed or deleted | | 37 lines changed or added | |
|