📄 ntt_encode.h
字号:
/* Output */ double can_code_targ[ntt_POLBITS][ntt_N_CAN_MAX], double can_code_sign[ntt_POLBITS][ntt_N_CAN_MAX], int can_ind[]); void ntt_sear_pitch(/* Input */ double tc[], double lpc_spectrum[], /* LPC spectrum */ int block_size_samples, int isampf, double bandUpper, /* Output */ int *index_pit); void ntt_sear_x_p(/* Parameters */ int i_div, /* division number */ int cb_len, /* codebook length */ int pol_bits0, /* polarity bits (0 ch) */ int pol_bits1, /* polarity bits (1 ch) */ int can_ind0[], /* candidate indexes (0 ch) */ int n_can0, /* number of candidates (0 ch) */ int can_ind1[], /* candidate indexes (1 ch) */ int n_can1, /* number of candidates (1 ch) */ int numChannel, /* Output */ int index[], /* quantization index */ /* Input */ double can_code_targ0[ntt_POLBITS][ntt_N_CAN_MAX], double can_code_targ1[ntt_POLBITS][ntt_N_CAN_MAX], double can_code_sign0[ntt_POLBITS][ntt_N_CAN_MAX], double can_code_sign1[ntt_POLBITS][ntt_N_CAN_MAX], double d_wt[], /* weight subvector */ double *pcode, /* Output */ double sig_l[], /* decoded residual */ double *dist_min); /* quantization distortion */ void ntt_tf_proc_spectrum(double spectrum[], /* In/Out : spectrum */ ntt_INDEX *indexp, /* In/Out : code indices*/ double lpc_spectrum[], /* Output : LPC spectrum */ double bark_env[], /* Output : Bark-scale envelope*/ double pitch_component[], /* Output : periodic peak components */ double gain[]); /* Output : gain factor */ void ntt_wvq_pitch(double targetv[], /* Input : target vector */ double wt[], /* Input : weighting vector */ double pwt[], /* Input : perceptual controlled weight*/ double pgain[], /* Input : gain */ double *pcode, short *pleave0, short *pleave1, int numChannel, int index_pls[], /* Output : quantization indexes */ double pgainq[], /* In/Out : gain */ int index_pgain[]);/* Output : gain index */ void ntt_prcptw(/* In/Out */ double pwt[], /* perceptual weighting factor */ /* Input */ double pred[], /* interframe prediction factor */ double g1, double g2, int block_size_samples);#if 0 void ntt_prcptw_m(/* Input */ double wt[], /* LPC weighting factor */ double gain[], /* gain parameter */ /* Output */ double pwt[]); /* perceptual weighting factor */#endif void ntt_prcptw_s(double wt[], /* Input : LPC weighting factor */ double gain[], /* Input : Gain parameter */ double pwt[], /* Output : Perceptual weighting factor*/ double g1, double g2, int numChannel, int block_size_samples); void ntt_tf_perceptual_model(double lpc_spectrum[], /* Input : LPC spectrum*/ double bark_env[], /* Input : Bark-scale envelope*/ double gain[], /* Input : gain factor*/ int w_type, /* Input : block type */ double spectrum[], /* Input : spectrum */ double pitch_sequence[], /* Input : periodic peak components */ int numChannel, int block_size_samples, double bandUpper, double perceptual_weight[]); /* Output : perceptual weight */ void ntt_div_vec(int nfr, /* Param. : block length */ int nsf, /* Param. : number of sub frames */ int cb_len, /* Param. : codebook length */ int cb_len0, /* Param. */ int idiv, /* Param. */ int ndiv, /* Param. :number of interleave division */ double target[], /* Input */ double d_target[], /* Output */ double weight[], /* Input */ double d_weight[], /* Output */ double add_signal[], /* Input */ double d_add_signal[], /* Output */ double perceptual_weight[], /* Input */ double d_perceptual_weight[]); /* Output */ void ntt_tf_quantize_spectrum(double spectrum[], /* Input : spectrum */ double lpc_spectrum[], /* Input : LPC spectrum */ double bark_env[], /* Input : Bark-scale envelope */ double pitch_component[], /* Input : periodic peak components */ double gain[], /* Input : gain factor*/ double perceptual_weight[],/* Input : perceptual weight */ ntt_INDEX *indexp); /* In/Out : VQ code indices */ void ntt_vq_main_select(/* Parameters */ int cb_len, /* code book length */ int cb_len_max, /* maximum code vector length */ double *codev0, /* code book0 */ double *codev1, /* code book1 */ int n_can0, int n_can1, int can_ind0[], int can_ind1[], int can_sign0[], int can_sign1[], /* Input */ double d_target[], double d_weight[], double d_add_signal[], double d_perceptual_weight[], /* Output */ int *index_wvq0, int *index_wvq1); void ntt_vq_pn(/* Parameters */ int nfr, /* block length */ int nsf, /* number of sub frames */ int available_bits, /* available bits for VQ */ int n_can, /* number of pre-selection candidates */ double *codev0, /* code book0 */ double *codev1, /* code book1 */ int cb_len_max, /* maximum code vector length */ /* Input */ double target[], double lpc_spectrum[], /* LPC spectrum */ double bark_env[], /* Bark-scale envelope */ double add_signal[], /* added signal */ double gain[], double perceptual_weight[], /* Output */ int index_wvq[], int index_pow[]); void ntt_vq_pre_select(/* Parameters */ int cb_len, /* code book length */ int cb_len_max, /* maximum code vector length */ int pol_bits, double *codev, /* code book */ /* Input */ double d_target[], double d_weight[], double d_add_signal[], double d_perceptual_weight[], int n_can, /* Output */ int can_ind[], int can_sign[]);void ntt_scale_reenc_gain( int nfr, int nsf, int nch, int iscl, int available_bits, double *codev0, double *codev1, int cb_len_max, double target[], double lpc_spectrum[], double bark_env[], double add_signal[], double gain[], double perceptual_weight[], int index_wvq[], int index_pow[]);void ntt_reenc_gain( int nfr, int nsf, int nch, int vq_bits, double *covev0, double *codev1, int cb_len_max, double spectrum[], double lpc_spectrum[], double bark_env[], double add_signal[], double gain[], double perceptual_weight[], int index_wvq[], int index_pow[]);/* moriya informed to tsushima BUGFIX */void ntt_scalebase_enc_lpc_spectrum /* Takehiro Moriya*/ (/* Parameters */ int nfr, int nsf, int block_size_samples, int n_ch, int n_pr, double *lsp_code, double *lsp_fgcode, int *lsp_csize, int *lsp_cdim, int prev_lsp_code[], /* double prev_buf[MAX_TIME_CHANNELS][ntt_MA_NP][ntt_N_PR_MAX+1], */ int ma_np, /* Input */ double spectrum[], int w_type, int current_block, /* Output */ int index_lsp[MAX_TIME_CHANNELS][ntt_LSP_NIDX_MAX], double lpc_spectrum[], double band_lower, double band_upper, double *cos_TT );/** end tsushima **/void ntt_headerenc( int iscl, BsBitStream* stream, ntt_INDEX* ntt_index, int *used_bits, int *nr_of_sfb, TNS_INFO *tnsInfo[MAX_TIME_CHANNELS], NOK_LT_PRED_STATUS *nok_lt_status, PRED_TYPE pred_type);void ntt_select_ms( double *spectral_line_vector[MAX_TIME_CHANNELS] , ntt_INDEX *index, int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], int iscl);void ntt_tns_enc(double *spectral_line_vector[MAX_TIME_CHANNELS], ntt_INDEX *index, int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], WINDOW_SEQUENCE windowSequence, int nr_of_sfb[MAX_TIME_CHANNELS], TNS_INFO *tnsInfo[MAX_TIME_CHANNELS] ); void ntt_maxsfb( ntt_INDEX *index, int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], int iscl );int tvqScaleableFlexMuxEncodexx( double *DTimeSigBuf[MAX_TIME_CHANNELS], double *DTimeSigLookAheadBuf[MAX_TIME_CHANNELS], double *spectral_line_vector[MAX_TIME_CHANNELS], double *nok_tmp[MAX_TIME_CHANNELS], double *baselayer[MAX_TIME_CHANNELS], double *ntt_ms_buf[MAX_TIME_CHANNELS], WINDOW_SHAPE windowShape, WINDOW_SEQUENCE windowSequence, ntt_INDEX *ntt_index, ntt_INDEX *ntt_index_scl, ntt_PARAM *param_ntt, BsBitStream *fixed_stream, TNS_INFO *tvqTnsInfo[MAX_TIME_CHANNELS], int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], double *reconstructed_spectrum[MAX_TIME_CHANNELS], PRED_TYPE pred_type, int block_size_samples, int sfb_offset[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS+1], NOK_LT_PRED_STATUS nok_lt_status[MAX_TIME_CHANNELS],int bla);int tvqScaleableFlexMuxEncode( double *DTimeSigBuf[MAX_TIME_CHANNELS], double *DTimeSigLookAheadBuf[MAX_TIME_CHANNELS], double *spectral_line_vector[MAX_TIME_CHANNELS], double *nok_tmp_DTimeSigBuf[MAX_TIME_CHANNELS], double *baselayer_spectral_line_vector[MAX_TIME_CHANNELS], double *ntt_ms_buf[MAX_TIME_CHANNELS], WINDOW_SHAPE windowShape[MAX_TIME_CHANNELS], WINDOW_SEQUENCE windowSequence[MAX_TIME_CHANNELS], ntt_INDEX *index, ntt_INDEX *index_scl, ntt_PARAM *param_ntt, BsBitStream *fixed_stream, TNS_INFO *tvqTnsInfo[MAX_TIME_CHANNELS], int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], double *reconstructed_spectrum[MAX_TIME_CHANNELS], PRED_TYPE pred_type, int block_size_samples, int sfb_offset[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS+1], NOK_LT_PRED_STATUS nok_lt_status[MAX_TIME_CHANNELS]);void initTvqSys( int numChannel, /* in: num audio channels */ float sampling_rate_f, /* in: sampling frequancy [Hz] */ float bit_rate_f, /* in: bit rate [bit/sec] */ char *encPara, /* in: encoder parameter string */ int quantDebugLevel, /* in : quantDebugLevel */ int *frameNumSample, /* out: num samples per frame */ int *delayNumSample, /* out: encoder delay (num samp les) */ ENC_FRAME_DATA* frameData, ntt_INDEX* ntt_index, ntt_INDEX* ntt_index_scl, ntt_DATA* nttData);void tvqScalEnc( double *tvq_target_spectrum[MAX_TIME_CHANNELS], ntt_INDEX *index, ntt_INDEX *index_scl, ntt_PARAM *param_ntt, BsBitStream *fixed_stream, TNS_INFO *tvqTnsInfo[MAX_TIME_CHANNELS], int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], double *reconstructed_spectrum[MAX_TIME_CHANNELS], PRED_TYPE pred_type, int iscl); #ifdef __cplusplus}#endif#endif /* __ntt_encode_h__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -