📄 phi_xits.h
字号:
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long num_fcbk_vecs, /* In: #Vectors in the fixed code book */
long nos, /* In: Number of samples to be processed */
long **cb, /* Out: Generated Local Fixed Codebook */
long p, /* In: Phase of the codebook vector */
long *amp, /* In: Pulse Amplitudes */
long *pos /* In: Index to non-zero codevector */
);
/*
----------------------------------------------------------------------------
preselection of fixed codebook indices (Reduction from 16 to 5 WDBxx)
----------------------------------------------------------------------------
*/
void
PHI_cbf_preselection
(
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long num_fcbk_cands, /* In: #Preselected candidates for fixed cbk */
long num_fcbk_vecs, /* In: #Vectors in the fixed code book */
long nos, /* In: Number of samples to be processed */
long **cb, /* In: Local fixed codebook,(Nf-1) by (nos-1)*/
long p, /* In: Phase of the RPE codebook */
float *tf, /* In: Backward-filtered target signal */
float a, /* In: LPC coeffs of the preselection filter */
long *pi /* Out: Result: Preselected Codebook Indices */
);
/*
----------------------------------------------------------------------------
fixed codebook search
----------------------------------------------------------------------------
*/
void
PHI_cbf_search(
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long num_fcbk_cands, /* In: #Preselected candidates for fixed cbk */
long nos, /* In: Number of samples to be processed */
long **cb, /* In: Local fixed codebook */
long p, /* In: Phase of the fixed codebook, 0 to D-1 */
long *pi, /* In: Preselected codebook indices, p[0..Pf-1]*/
float *h, /* In: Synthesis filter impulse response, */
float *e, /* In: Target residual signal, e[0..nos-1] */
float *gain, /* Out: Selected Fixed Codebook gain (Uncoded) */
long *gid, /* Out: Selected Fixed Codebook gain index */
long *amp, /* Out: S rpe pulse amplitudes, amp[0..Np-1] */
long n /* In: Subframe index, 0 to n_subframes-1 */
);
/*
----------------------------------------------------------------------------
encodes rpe pulse amplitudes and phase into one index
----------------------------------------------------------------------------
*/
void
PHI_code_cbf_amplitude_phase
(
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long *amp, /* In: Array of Pulse Amplitudes, amp[0..Np-1]*/
long phase, /* In: The Phase of the RPE sequence */
long *index /* Out: Coded Index: Fixed Codebook index */
);
/*
----------------------------------------------------------------------------
Decodes the RPE amplitudes and phase from the cbk-index
----------------------------------------------------------------------------
*/
void
PHI_decode_cbf_amplitude_phase
(
const long num_of_pulses, /* In: Number of pulses in the sequence */
const long pulse_spacing, /* In: Regular Spacing Between Pulses */
long * const amp, /* Out: The Array of pulse amplitudes */
long * const phase, /* Out: The phase of the RPE sequence */
const long index /* In: Coded Fixed codebook index */
);
/*
----------------------------------------------------------------------------
Decodes the Adaptive-Codebook Gain
----------------------------------------------------------------------------
*/
void
PHI_DecodeAcbkGain
(
long acbk_gain_index,
float *gain
);
/*
----------------------------------------------------------------------------
Decodes the Fixed-Codebook Gain
----------------------------------------------------------------------------
*/
void
PHI_DecodeFcbkGain
(
long fcbk_gain_index,
long ctr,
float prev_gain,
float *gain
);
/*
----------------------------------------------------------------------------
computes excitation of the adaptive codebook
----------------------------------------------------------------------------
*/
void
PHI_calc_cba_excitation
(
long nos, /* In: Number of samples to be updated */
long max_lag, /* In: Maximum Permitted Adapt cbk Lag */
long min_lag, /* In: Minimum Permitted Adapt cbk Lag */
float *cb, /* In: The current Adaptive codebook content*/
long idx, /* In: The chosen lag candidate */
float *v /* Out: The Adaptive Codebook contribution */
);
/*
----------------------------------------------------------------------------
computes excitation of the fixed codebook
----------------------------------------------------------------------------
*/
void
PHI_calc_cbf_excitation
(
long nos, /* In: Number of samples to be updated */
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long *amp, /* In: Aray of RPE pulse amplitudes */
long p, /* In: Phase of the RPE sequence */
float *v /* Out: The fixed codebook contribution */
);
/*
----------------------------------------------------------------------------
compute the sum of the excitations
----------------------------------------------------------------------------
*/
void
PHI_sum_excitations
(
long nos, /* In: Number of samples to be updated */
float again, /* In: Adaptive Codebook gain */
float *asig, /* In: Adaptive Codebook Contribution */
float fgain, /* In: Fixed Codebook gain */
float *fsig, /* In: Fixed Codebook Contribution */
float *sum_sig /* Out: The Excitation sequence */
);
/*
----------------------------------------------------------------------------
update adaptive codebook with the total excitation computed
----------------------------------------------------------------------------
*/
void
PHI_update_cba_memory
(
long nos, /* In: Number of samples to be updated */
long max_lag, /* In: Maximum Adaptive Codebook Lag */
float *cb, /* In/Out: Adaptive Codebook */
float *vi /* In: Sum of adaptive and fixed excitaion */
);
/*
---------------------------------------------------------------------------
update synthesis filter states
----------------------------------------------------------------------------
*/
void
PHI_update_filter_states
(
long nos, /* In: Number of samples */
long order, /* In: Order of the LPC */
float *vi, /* In: Total Codebook contribution */
float *vp, /* In/Out: Filter States, vp[0..order-1] */
float *a /* In: Lpc Coefficients, a[0..order-1] */
);
#ifdef __cplusplus
}
#endif
#endif /* #ifndef _phi_xits_h_ */
/*======================================================================*/
/* H I S T O R Y */
/*======================================================================*/
/* 17-04-96 R. Taori Initial Version */
/* 13-08-96 R. Taori Added 2 subroutines CompAmpArray CompPosArray */
/* Modified generate_cbf to reflect the above */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -