📄 phi_xits.h
字号:
/*====================================================================*/
/* MPEG-4 Audio (ISO/IEC 14496-3) Copyright Header */
/*====================================================================*/
/*
This software module was originally developed by Rakesh Taori and Andy
Gerrits (Philips Research Laboratories, Eindhoven, The Netherlands) in
the course of development of the MPEG-4 Audio (ISO/IEC 14496-3). This
software module is an implementation of a part of one or more MPEG-4
Audio (ISO/IEC 14496-3) tools as specified by the MPEG-4 Audio
(ISO/IEC 14496-3). ISO/IEC gives users of the MPEG-4 Audio (ISO/IEC
14496-3) free license to this software module or modifications thereof
for use in hardware or software products claiming conformance to the
MPEG-4 Audio (ISO/IEC 14496-3). Those intending to use this software
module in hardware or software products are advised that its use may
infringe existing patents. The original developer of this software
module and his/her company, the subsequent editors and their
companies, and ISO/IEC have no liability for use of this software
module or modifications thereof in an implementation. Copyright is not
released for non MPEG-4 Audio (ISO/IEC 14496-3) conforming products.
CN1 retains full right to use the code for his/her own purpose, assign
or donate the code to a third party and to inhibit third parties from
using the code for non MPEG-4 Audio (ISO/IEC 14496-3) conforming
products. This copyright notice must be included in all copies or
derivative works. Copyright 1996.
*/
/*====================================================================*/
/*======================================================================*/
/* */
/* INCLUDE_FILE: PHI_XITS.H */
/* PACKAGE: WDBxx */
/* COMPONENT: Subroutines for Excitation Modules */
/* */
/*======================================================================*/
#ifndef _phi_xits_h_
#define _phi_xits_h_
#ifdef __cplusplus
extern "C" {
#endif
/*======================================================================*/
/* Function Prototype: perceptual_weighting */
/*======================================================================*/
void
PHI_perceptual_weighting
(
long nos, /* In: Number of samples to be processed */
float *vi, /* In: Array of input samps to be processe */
float *vo, /* Out: Perceptually Weighted Output Speech */
long order, /* In: LPC-Order of the weighting filter */
float *a_gamma, /* In: Array of the Weighting filter coeffs */
float *vp1 /* In/Out: The delay line states */
);
/*
------------------------------------------------------------------------
zero input response
------------------------------------------------------------------------
*/
void
PHI_calc_zero_input_response
(
long nos, /* In: Number of samples to be processed */
float *vo, /* Out: The zero-input response */
long order, /* In: Order of the Weighting filter */
float *a_gamma, /* In: Coefficients of the weighting filter*/
float *vp /* In: Filter states */
);
/*
----------------------------------------------------------------------------
weighted target signal
----------------------------------------------------------------------------
*/
void
PHI_calc_weighted_target
(
long nos, /* In: Number of samples to be processed */
float *v1, /* In: Array of Perceptually weighted speech*/
float *v2, /* In: The zero-input response */
float *vd /* Out: Real Target signal for current frame */
);
/*
----------------------------------------------------------------------------
impulse response
----------------------------------------------------------------------------
*/
void
PHI_calc_impulse_response
(
long nos, /* In: Number of samples to be processed */
float *h, /* Out: Impulse response of the filter */
long order, /* In: Order of the filter */
float *a_gamma /* In: Array of the filter coefficients */
);
/*
------------------------------------------------------------------------
backward filtering
------------------------------------------------------------------------
*/
void
PHI_backward_filtering
(
long nos, /* In: Number of samples to be processed */
float *vi, /* In: Array of samples to be filtered */
float *vo, /* Out: Array of filtered samples */
float *h /* In: The filter coefficients */
);
/*
----------------------------------------------------------------------------
adaptive codebook search
----------------------------------------------------------------------------
*/
void
PHI_cba_search
(
long nos, /* In: Number of samples to be processed */
long max_lag, /* In: Maximum Permitted Adapt cbk Lag */
long min_lag, /* In: Minimum Permitted Adapt cbk Lag */
float *cb, /* In: Segment of Adaptive Codebook */
long *pi, /* In: Array of preselected-lag indices */
long n_lags, /* In: Number of lag candidates to be tried */
float *h, /* In: Impulse response of synthesis filter */
float *t, /* In: The real target signal */
float *g, /* Out: Adapt-cbk gain(Quantised but uncoded)*/
long *vid, /* Out: The final adaptive cbk lag index */
long *gid /* Out: The gain index */
);
/*
----------------------------------------------------------------------------
computes residual signal after adaptive codebook
----------------------------------------------------------------------------
*/
void
PHI_calc_cba_residual
(
long nos, /* In: Number of samples to be processed */
float *vi, /* In: Succesful excitation candidate */
float gain, /* In: Gain of the adaptive codebook */
float *h, /* In: Impulse response of synthesis filt */
float *t, /* In: The real target signal */
float *e /* Out: Adapt-cbk residual: Target for f-cbk */
);
/*
----------------------------------------------------------------------------
determines phase of the local rpe codebook vectors
----------------------------------------------------------------------------
*/
void
PHI_calc_cbf_phase
(
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long nos, /* In: Number of samples to be processed */
float *tf, /* In: Backward filtered target signal */
long *p /* Out: Phase of the local RPE codebook vector*/
);
/*
----------------------------------------------------------------------------
computes rpe pulse amplitude (Version 2:only computes amplitude)
----------------------------------------------------------------------------
*/
void
PHI_CompAmpArray
(
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
float *tf, /* In: Backward filtered target signal */
long p, /* In: Phase of the RPE codebook */
long *amp /* Out: Pulse amplitudes +/- 1 */
);
/*
----------------------------------------------------------------------------
computes pos array {extension to Vienna code which only fixed 1 amp
----------------------------------------------------------------------------
*/
void
PHI_CompPosArray
(
long num_of_pulses, /* In: Number of pulses in the sequence */
long pulse_spacing, /* In: Regular Spacing Between Pulses */
long num_fxd_amps, /* IN: Number of fixed amplitudes */
float *tf, /* In: Backward filtered target signal */
long p, /* In: Phase of the RPE codebook */
long *pos /* Out: Pulse amplitudes +/- 1 */
);
/*
----------------------------------------------------------------------------
generates local fixed codebook
----------------------------------------------------------------------------
*/
void
PHI_generate_cbf
(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -