📄 ntt_conf.h
字号:
#define ntt_PGAIN_BIT 7#define ntt_PGAIN_MU 200#define ntt_CB_NAME0 "./tables/tf_vq_tbls/cdmdct_0"#define ntt_CB_NAME1 "./tables/tf_vq_tbls/cdmdct_1"#define ntt_CB_NAME0s "./tables/tf_vq_tbls/cdmdct_2"#define ntt_CB_NAME1s "./tables/tf_vq_tbls/cdmdct_3"#define ntt_BLIM_BITS_H 2#define ntt_BLIM_BITS_L 1#define ntt_CUT_M_H 0.7#define ntt_CUT_M_L 0.0025#define ntt_CB_LEN_READ 20#define ntt_CB_LEN_READ_S 17#define ntt_N_MODE (1<<ntt_LSP_BIT0)#define ntt_NC0 (1<<ntt_LSP_BIT1)#define ntt_NC1 (1<<ntt_LSP_BIT2)#define ntt_NUM_STEP (1<<ntt_GAIN_BITS)#define ntt_STEP (ntt_AMP_MAX / (ntt_NUM_STEP - 1))#define ntt_SUB_NUM_STEP (1<<ntt_SUB_GAIN_BITS)#define ntt_SUB_STEP (ntt_SUB_AMP_MAX / (ntt_SUB_NUM_STEP - 1))#define ntt_N_CRB 42#define ntt_FW_CB_SIZE (1<<ntt_FW_N_BIT)#define ntt_FW_CB_LEN (ntt_N_CRB/ntt_FW_N_DIV)#define ntt_FW_CB_SIZE_S 0#define ntt_FW_CB_LEN_S 0#define ntt_BASF_STEP ((1<<ntt_BASF_BIT)-1)#define ntt_PIT_CB_SIZE (1<<ntt_MAXBIT_SHAPE_P)#define ntt_PGAIN_NSTEP ((1<<ntt_PGAIN_BIT) - 1)#define ntt_N_FR_P ntt_PIT_CB_LEN#define ntt_CB_LEN_P 10#define ntt_BWID_BITS (ntt_BLIM_BITS_H + ntt_BLIM_BITS_L)#define ntt_BLIM_STEP_H ((1 << ntt_BLIM_BITS_H) - 1)#define ntt_PIT_TBITperCH (ntt_PIT_N_BIT+ntt_BASF_BIT+ntt_PGAIN_BIT)#define ntt_N_DIV_PperCH (ntt_PIT_N_BIT/ntt_MAXBIT_P/2)#define ntt_TBIT_PperCH ntt_PIT_N_BIT#define LSP_TBITperCH (ntt_LSP_BIT0+ntt_LSP_BIT1+ntt_LSP_BIT2*ntt_LSP_SPLIT)#define FW_TBITperCH (ntt_FW_N_BIT*ntt_FW_N_DIV+ntt_FW_ARQ_NBIT)#define FW_TBIT_S 0#define GAIN_TBITperCH ntt_GAIN_BITS#define GAIN_TBIT_SperCH (ntt_GAIN_BITS+ntt_SUB_GAIN_BITS*ntt_N_SHRT)#define ntt_NMTOOL_BITSperCH (LSP_TBITperCH+GAIN_TBITperCH+FW_TBITperCH)#define ntt_NMTOOL_BITS_SperCH (LSP_TBITperCH+GAIN_TBIT_SperCH)#ifdef ntt_MAIN_ROUTINEint tvq_debug_level;#elseextern int tvq_debug_level;#endif/*---------------------------------------------------------------------------*//*---------------------------------------------------------------------------*//**************************** FUNCTIONS ************************************//*---------------------------------------------------------------------------*//*---------------------------------------------------------------------------*/#ifdef __cplusplusextern "C" {#endif /*--- VM socket modules ---*/ /* encoder */ void ntt_vq_coder (double *sig_init[MAX_TIME_CHANNELS], double *sig[MAX_TIME_CHANNELS], /* Input: time-domain signal array */ double *spectral_line_vector[MAX_TIME_CHANNELS], /* Input : frequency-domain signal array */ double external_pw[], /* Input : external perceptual weight */ int pw_select, /* Input : perceptual weight mode selector */ WINDOW_SEQUENCE windowSequence,/* Input : window block type */ ntt_INDEX *index, /* Output: quantization indexes */ ntt_PARAM *param_ntt, /* Input : encoder parameters */ int sfb_width_table[MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], int available_bits,/* Input : number of available bits */ double lpc_spectrum[], /* Output: LPC spectrum */ double *reconstructed_spectrum[MAX_TIME_CHANNELS]); /* Output: reconstructed spectrum */ int ntt_SclBitPack(ntt_INDEX *indexp, BsBitStream *stream, int iscl); /* decoder */ void ntt_vq_decoder (ntt_INDEX *index, double *spectral_line_vector[MAX_TIME_CHANNELS], Info **sfbInfo); void ntt_scale_vq_decoder(ntt_INDEX index_scl[], ntt_INDEX *index_base, double *spectral_line_vector[MAX_TIME_CHANNELS], int iscl, Info **sfbInfo); void ntt_tf_local_decode (/* Input */ ntt_INDEX *index, double lpc_spectrum[], double bark_env[], double pitch_sequence[], double gain[], double spectrum_gain, /* Output */ double *reconstructed_spectrum[MAX_TIME_CHANNELS]); void ntt_scale_vq_coder(double *spectral_line_vector[MAX_TIME_CHANNELS], double lpc_spectrum[], ntt_INDEX *index, ntt_INDEX *index_scl, ntt_PARAM *param_ntt, int sfb_width_table [MAX_TIME_CHANNELS][MAX_SCFAC_BANDS], int nr_of_sfb[MAX_TIME_CHANNELS], int ntt_available_bits, double *reconstructed_spectrum[MAX_TIME_CHANNELS], int iscl); int ntt_SclBitUnPack(BsBitStream *fixed_stream, ntt_INDEX index[], int available_bits, int iscl); void ntt_vec_lenp(int numchannel, int bits[], int length[]); void ntt_init(void); void ntt_fwex(int index[], int ndiv, int cv_len, double *codebook, int cv_len_max, double env[]); void ntt_movdd(int n, double xx[], double yy[]); double ntt_mulawinv(double y, double xmax, double mu); void ntt_lsp_decw(/* Parameters */ int n_pr, int nsp, double code[][ntt_N_PR_MAX], double fgcode[][ntt_MA_NP][ntt_N_PR_MAX], int *csize, int prev_lsp_code[], /* double buf_prev[ntt_MA_NP][ntt_N_PR_MAX+1], */ int ma_np, /* Input */ int index[], /* Output */ double freq[]); void ntt_lsptowt_int(int nfr, int block_size_samples, int n_pr, double lsp[], double wt[], double cos_TT[]);/* void ntt_cp_mdtbl(ntt_MODE_TABLE ltbl);*/ void ntt_cnst_chk(int calcv, int defv, char *defname); void ntt_get_code(char *fname, int nstage, int csize[], int cdim[], double code[][ntt_N_PR_MAX], double fgcode[ntt_N_MODE_MAX][ntt_MA_NP][ntt_N_PR_MAX]); void ntt_get_cdbk(char *name, double *codev_l, int cb_size, int cb_len, int cb_len_mx); void ntt_set_interleave(enum ntt_INTERLEAVE_SET_MODE set_mode); void ntt_set_isp(int nsp, int n_pr, int *ntt_isp); void ntt_redec(int n_pr, int index[], int csize1[], int nsp, double code[][ntt_N_PR_MAX], double fg_sum[ntt_N_PR_MAX], double pred_vec[ntt_N_PR_MAX], double lspq[], double out_vec[]); void ntt_dist_lsp(int n, double x[], double y[], double w[], double *dist); void ntt_check_lsp(int n, double buf[], double min_gap); void ntt_check_lsp_sort(int n, double buf[]); void ntt_zerod(int n,double xx[]); void ntt_dec_bark_env(/* Parameters */ int nfr, int nsf, int n_ch, double *codebook, int ndiv, int cv_len, int cv_len_max, int *bark_tbl, int n_crb, double alf_step, int prev_fw_code[], /* Input */ int index_fw[], int index_fw_alf[], int pf_switch, /* Output */ double bark_env[]); void ntt_dec_gain(/* Parameters */ int nsf, /* Input */ int index_pow[], int numChannel, /* Output */ double gain[]); void ntt_dec_lpc_spectrum_inv ( /* Parameters */ int nfr, int block_size_samples, int n_ch, int n_pr, int nsp, double *lsp_code, double *lsp_fgcode, int *csize, int prev_lsp_code[], /* double prev_buf[ntt_N_SUP_MAX][ntt_MA_NP][ntt_N_PR_MAX+1], */ int ma_np, /* Input */ int index_lsp[ntt_N_SUP_MAX][ntt_LSP_NIDX_MAX], /* Output */ double inv_lpc_spec[], double *cos_TT ); void ntt_denormalizer_spectrum(/* Parameters */ int nfr, int nsf, int n_ch, /* Input */ double flat_spectrum[], double gain[], /*****/ double pit_sec[], double pgain[], /*****/ double bark_env[], double inv_lpc_spec[], /**** inv */ /* Output */ double spectrum[]); void ntt_post_process(/* Parameters */ int nfr, int nsf, double band_lower, double band_upper, /* Input */ double spectrum[], /* Output */ double out_spectrum[]); void ntt_vex_pn(int *index, /* Input : VQ indices */ double *sp_cv0, /* Input : shape codebook (conj. ch. 0) */ double *sp_cv1, /* Input : shape codebook (conj. ch. 1) */ int cv_len_max, /* Input : memory length of codevectors */ int n_sf, /* Input : number of subframes in a frame */ int block_size, /* Input : total block size */ int available_bits, /* Input : available bits */ double *sig); /* Output: Reconstructed coefficients */ void ntt_tf_requantize_spectrum(/* Input */ ntt_INDEX *indexp, /* Output */ double flat_spectrum[]); void ntt_extend_pitch(/* Input */ int index_pit[], double pit_pack[], int numChannel, int block_size_samples, int isampf, double bandUpper, /* Output */ double pit_seq[]); void ntt_TfInit(float sampling_rate, float bit_rate, float t_bit_rate_scl, long num_channel, int samples, ntt_INDEX* ntt_index, ntt_INDEX* ntt_index_scl ); int ntt_BitUnPack ( BsBitStream* stream, int available_bits, WINDOW_SEQUENCE block_type, ntt_INDEX* index ); void ntt_dec_pgain(/* Input */ int index, /* Output */ double *pgain); void ntt_dec_pit_seq(/* Input */ int index_pit[], int index_pls[], int numChannel, int block_size_samples, int isampf, double bandUpper, double *codevp0, short *pleave1, /* Output */ double pit_seq[]); void ntt_dec_pitch(/* Input */ int index_pit[], int index_pls[], int index_pgain[], int numChannel, int block_size_sample, int isampf, /* Output */ double pit_seq[], double pgain[], double bandUpper, double *ptr, short *pleave); void ntt_tf_proc_spectrum_d(/* Input */ ntt_INDEX *indexp, double flat_spectrum[], /* Output */ double spectrum[]); int ntt_BitPack(ntt_INDEX *index, BsBitStream *stream); int TVQ_decode_grouping( int grouping, short region_len[] ); void ntt_headerdec(int iscl, BsBitStream* stream, ntt_INDEX* index, Info** sfbInfo , int* decoded_bits, TNS_frame_info tns_info[MAX_TIME_CHANNELS], NOK_LT_PRED_STATUS **nok_lt_status, PRED_TYPE pred_type, HANDLE_RESILIENCE hResilience, HANDLE_BUFFER hVm, HANDLE_EP_INFO hEpInfo ); int ntt_get_tns_vm( BsBitStream *fixed_stream, Info *info, TNS_frame_info *tns_frame_info, int* decoded_bits ); void ntt_weight(int npr, double costbl[], double costablv, double *wtv);#define BYTE_ALIGN YES /* T.Ishikawa 980727 */#ifdef __cplusplus}#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -