📄 g729ev_g729_ld8k.h
字号:
/* ITU-T G.729EV Optimization/Characterization Candidate *//* Version: 1.0.a *//* Revision Date: June 28, 2006 *//* ITU-T G.729EV Optimization/Characterization Candidate ANSI-C Source Code Copyright (c) 2006 France Telecom, Matsushita Electric, Mindspeed, Siemens AG, ETRI, VoiceAge Corp. All rights reserved*/#ifndef __G729EV_G729_LD8K_H__#define __G729EV_G729_LD8K_H__/*--------------------------------------------------------------* * LD8K.H * * ~~~~~~ * * Function prototypes and constants use in G.729 * * * *--------------------------------------------------------------*/#include <stdio.h>#include "stl.h"#include "G729EV_G729_defines.h"#include "G729EV_G729_CodStat.h"#include "G729EV_G729_DecStat.h"#include "G729EV_MAIN_filt.h"#include "G729EV_MAIN_defines.h"/*--------------------------------------------------------------------------* * LPC analysis and filtering * *--------------------------------------------------------------------------*/void G729EV_G729_AutocorrLPC(Word16 x[], /* (i) : input signal */ Word16 m, /* (i) : LPC order */ Word16 r_h[], /* (o) : autocorrelations (msb) */ Word16 r_l[] /* (o) : autocorrelations (lsb) */ );void G729EV_G729_Lag_window(Word16 m, /* (i) : LPC order */ Word16 r_h[], /* (i/o) : autocorrelations (msb) */ Word16 r_l[] /* (i/o) : autocorrelations (lsb) */ );void G729EV_G729_Levinson(Word16 Rh[], /* (i) : Rh[m+1] autocorrelation coefficients (msb) */ Word16 Rl[], /* (i) : Rl[m+1] autocorrelation coefficients (lsb) */ Word16 A[], /* (o) Q12 : A[m] LPC coefficients (m = 10) */ Word16 rc[], /* (o) Q15 : rc[M] Reflection coefficients. */ Word16 old_A[], Word16 old_rc[]);void G729EV_G729_Az_lsp(Word16 a[], /* (i) Q12 : predictor coefficients */ Word16 lsp[], /* (o) Q15 : line spectral pairs */ Word16 old_lsp[] /* (i) : old lsp[] (in case not found 10 roots) */ );void G729EV_G729_Lsp_Az(Word16 lsp[], /* (i) Q15 : line spectral frequencies */ Word16 a[] /* (o) Q12 : predictor coefficients (order = 10) */ );void G729EV_G729_Lsp_lsf(Word16 lsp[], /* (i) Q15 : lsp[m] (range: -1<=val<1) */ Word16 lsf[], /* (o) Q15 : lsf[m] normalized (range: 0.0<=val<=0.5) */ Word16 m /* (i) : LPC order */ );void G729EV_G729_Int_lpc(Word16 lsp_old[], /* (i) : LSP vector of past frame */ Word16 lsp_new[], /* (i) : LSP vector of present frame */ Word16 lsf_int[], /* (o) : interpolated lsf coefficients */ Word16 lsf_new[], /* (o) : new lsf coefficients */ Word16 Az[] /* (o) : interpolated Az() for the 2 subframes */ );void G729EV_G729_Int_qlpc(Word16 lsp_old[], /* (i) : LSP vector of past frame */ Word16 lsp_new[], /* (i) : LSP vector of present frame */ Word16 Az[] /* (o) : interpolated Az() for the 2 subframes */ );/*--------------------------------------------------------------------------* * PWF functions * *--------------------------------------------------------------------------*/void G729EV_G729_perc_var(Word16 * gamma1, /* bandwidth expansion parameter */ Word16 * gamma2, /* bandwidth expansion parameter */ Word16 * lsfint, /* Interpolated LSP vector : 1st subframe */ Word16 * lsfnew, /* New LSP vector : 2nd subframe */ Word16 * r_c, /* Reflection coefficients */ Word16 * smooth, Word16 LarOld[2]);void G729EV_G729_Weight_Az(Word16 a[], /* (i) Q12 : a[m+1] LPC coefficients */ Word16 gamma, /* (i) Q15 : Spectral expansion factor. */ Word16 m, /* (i) : LPC order. */ Word16 ap[] /* (o) Q12 : Spectral expanded LPC coefficients */ );void G729EV_G729_Residu(Word16 a[], /* (i) Q12 : prediction coefficients */ Word16 x[], /* (i) Q0 : speech (values x[-m..-1] are needed (m=10) */ Word16 y[], /* (o) Q0 : residual signal */ Word16 lg /* (i) : frame size */ );/* Same as G729EV_G729_Residu except the ouput is set to Q1 instead of Q0 */void G729EV_G729_Residu2(Word16 a[], /* (i) Q12 : prediction coefficients */ Word16 x[], /* (i) Q0 : speech (values x[-m..-1] are needed (m=10) */ Word16 y[], /* (o) Q1 : residual signal */ Word16 lg /* (i) : frame size */ );void G729EV_G729_Syn_filt(Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */ Word16 x[], /* (i) Q0 : input signal */ Word16 y[], /* (o) Q0 : output signal */ Word16 lg, /* (i) : size of filtering */ Word16 mem[], /* (i/o) : memory associated with this filtering. */ Word16 update /* (i) : 0=no update, 1=update of memory. */ );/* Same as G729EV_G729_Syn_filt except the input x is in Q1 instead of Q0 */void G729EV_G729_Syn_filt2(Word16 a[], /* (i) Q12 : a[m+1] prediction coefficients (m=10) */ Word16 x[], /* (i) Q1 : input signal */ Word16 y[], /* (o) Q0 : output signal */ Word16 lg, /* (i) : size of filtering */ Word16 mem[], /* (i/o) : memory associated with this filtering. */ Word16 update /* (i) : 0=no update, 1=update of memory. */ );void G729EV_G729_Convolve(Word16 x[], /* (i) : input vector */ Word16 h[], /* (i) Q12 : impulse response */ Word16 y[], /* (o) : output vector */ Word16 L /* (i) : vector size */ );/*--------------------------------------------------------------------------* * Pitch functions. * *--------------------------------------------------------------------------*/Word16 G729EV_G729_Pitch_ol( /* (o) : open loop pitch lag */ Word16 signal[], /* (i) : signal used to compute the open loop pitch */ /* signal[-pit_max] to signal[-1] should be known */ Word16 pit_min, /* (i) : minimum pitch lag */ Word16 pit_max, /* (i) : maximum pitch lag */ Word16 L_frame, /* (i) : length of frame to compute pitch */ Word16 * voicing, Word16 * pit_old);Word16 G729EV_G729_Pitch_fr3( /* (o) : pitch period. */ Word16 exc[], /* (i) : excitation buffer */ Word16 xn[], /* (i) : target vector */ Word16 h[], /* (i) Q12 : impulse response of filters. */ Word16 L_subfr,/* (i) : length of subframe */ Word16 t0_min, /* (i) : minimum value in the searched range. */ Word16 t0_max, /* (i) : maximum value in the searched range. */ Word16 i_subfr,/* (i) : indicator for first subframe. */ Word16 * pit_frac /* (o) : chosen fraction. */ );Word16 G729EV_G729_G_pitch( /* (o) Q14 : Gain of pitch lag saturated to 1.2 */ Word16 xn[], /* (i) : Pitch target. */ Word16 y1[], /* (i) : Filtered adaptive codebook. */ Word16 g_coeff[], /* (i) : Correlations need for gain quantization. */ Word16 L_subfr /* (i) : Length of subframe. */ );Word16 G729EV_G729_Enc_lag3( /* (o) : Return index of encoding */ Word16 T0, /* (i) : Pitch delay */ Word16 T0_frac, /* (i) : Fractional pitch delay */ Word16 * T0_min,/* (i/o) : Minimum search delay */ Word16 * T0_max,/* (i/o) : Maximum search delay */ Word16 pit_min, /* (i) : Minimum pitch delay */ Word16 pit_max, /* (i) : Maximum pitch delay */ Word16 pit_flag /* (i) : Flag for 1st subframe */ );void G729EV_G729_Dec_lag3( /* (o) : return integer pitch lag */ Word16 index, /* (i) : received pitch index */ Word16 pit_min, /* (i) : minimum pitch lag */ Word16 pit_max, /* (i) : maximum pitch lag */ Word16 i_subfr, /* (i) : subframe flag */ Word16 * T0, /* (o) : integer part of pitch lag */ Word16 * T0_frac /* (o) : fractional part of pitch lag */ );Word16 G729EV_G729_Interpol_3( /* (o) : interpolated value */ Word16 * x, /* (i) : input vector */ Word16 frac /* (i) : fraction */ );void G729EV_G729_Pred_lt_3(Word16 exc[], /* (i/o) : excitation buffer */ Word16 T0, /* (i) : integer pitch lag */ Word16 frac, /* (i) : fraction of lag */ Word16 L_subfr/* (i) : subframe size */ );Word16 G729EV_G729_Parity_Pitch( /* (o) : parity bit (XOR of 6 MSB bits) */ Word16 pitch_index /* (i) : index for which parity to compute */ );Word16 G729EV_G729_Check_Parity_Pitch( /* (o) : 0 = no error, 1= error */ Word16 pitch_index, /* (i) : index of parameter */ Word16 parity /* (i) : parity bit */ );/*--------------------------------------------------------------------------* * fixed codebook excitation. * *--------------------------------------------------------------------------*//*--------------------------------------------------------------------------* * FCB functions. * *--------------------------------------------------------------------------*/void G729EV_G729_Cor_h(Word16 * H, /* (i) Q12 :Impulse response of filters */ Word16 * rr /* (o) :Correlations of H[] */ );void G729EV_G729_Cor_h_X(Word16 h[], /* (i) Q12 :Impulse response of filters */ Word16 X[], /* (i) Q12 :Target vector */ Word16 D[], /* (o) :Correlations between h[] and D[] */ /* Normalized to 13 bits */ Word16 stp);void G729EV_G729_Decod_ACELP(Word16 sign, /* (i) : signs of 4 pulses. */ Word16 index, /* (i) : Positions of the 4 pulses. */ Word16 cod[] /* (o) Q13 : algebraic (fixed) codebook excitation */ );/*--------------------------------------------------------------------------* * LSP VQ functions. * *--------------------------------------------------------------------------*/void G729EV_G729_Lsf_lsp2(Word16 lsf[], /* (i) Q13 : lsf[m] (range: 0.0<=val<PI) */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -