From ddbd4ee3f7086f4dc3b9b87a975304f114e98978 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Sun, 18 Feb 2024 10:54:41 +0530 Subject: [PATCH] Replaces hFdCngDec_fx with hFdCngDec handle A redundant copy of FdCngDec handle has been replaced to avoid confusion for different handles used in EVS fixed path and IVAS path. --- lib_dec/acelp_core_dec_fx.c | 34 +++++++++++++++--------------- lib_dec/acelp_core_switch_dec_fx.c | 2 +- lib_dec/amr_wb_dec_fx.c | 22 +++++++++---------- lib_dec/core_switching_dec_fx.c | 20 +++++++++--------- lib_dec/dec_acelp_tcx_main_fx.c | 18 ++++++++-------- lib_dec/dec_tcx_fx.c | 2 +- lib_dec/evs_dec_fx.c | 22 +++++++++---------- lib_dec/fd_cng_dec_fx.c | 8 +++---- lib_dec/init_dec_fx.c | 7 +++--- lib_dec/stat_dec.h | 1 - lib_dec/updt_dec_fx.c | 4 ++-- 11 files changed, 70 insertions(+), 70 deletions(-) diff --git a/lib_dec/acelp_core_dec_fx.c b/lib_dec/acelp_core_dec_fx.c index 5fa9a1baf..a83151265 100644 --- a/lib_dec/acelp_core_dec_fx.c +++ b/lib_dec/acelp_core_dec_fx.c @@ -623,7 +623,7 @@ ivas_error acelp_core_dec_fx( { IF( EQ_32(st_fx->core_brate,SID_2k40) && NE_16(st_fx->element_mode, IVAS_CPE_MDCT) ) { - FdCng_decodeSID(st_fx->hFdCngDec_fx->hFdCngCom, st_fx); + FdCng_decodeSID(st_fx->hFdCngDec->hFdCngCom, st_fx); *sid_bw=0; move16(); } @@ -655,7 +655,7 @@ ivas_error acelp_core_dec_fx( #endif generate_comfort_noise_dec( NULL, NULL, NULL, st_fx, &(st_fx->Q_exc), 2, -1 ); - FdCng_exc(st_fx->hFdCngDec_fx->hFdCngCom, &st_fx->CNG_mode, st_fx->L_frame, st_fx->lsp_old_fx, st_fx->first_CNG, st_fx->lspCNG_fx, Aq_fx, lsp_new_fx, lsf_new_fx, exc_fx, exc2_fx, bwe_exc_fx); + FdCng_exc(st_fx->hFdCngDec->hFdCngCom, &st_fx->CNG_mode, st_fx->L_frame, st_fx->lsp_old_fx, st_fx->first_CNG, st_fx->lspCNG_fx, Aq_fx, lsp_new_fx, lsf_new_fx, exc_fx, exc2_fx, bwe_exc_fx); Copy( exc2_fx, exc3_fx, st_fx->L_frame ); } @@ -1402,7 +1402,7 @@ ivas_error acelp_core_dec_fx( test(); test(); test(); - IF((st_fx->hFdCngDec_fx != NULL || EQ_16(st_fx->idchan, 1)) && NE_16(st_fx->element_mode, IVAS_CPE_MDCT)) + IF((st_fx->hFdCngDec != NULL || EQ_16(st_fx->idchan, 1)) && NE_16(st_fx->element_mode, IVAS_CPE_MDCT)) { IF(EQ_16(st_fx->element_mode, IVAS_CPE_TD) || st_fx->flag_cna || (EQ_16(st_fx->cng_type, FD_CNG) && LE_32(st_fx->total_brate, ACELP_32k)) || (EQ_16(st_fx->cng_type, LP_CNG) && LE_32(st_fx->total_brate, SID_2k40))) { @@ -1414,18 +1414,18 @@ ivas_error acelp_core_dec_fx( (EQ_16(st_fx->cng_type, LP_CNG) && LE_32(st_fx->total_brate, SID_2k40)))) { /*Noisy speech detector*/ - noisy_speech_detection(st_fx->hFdCngDec_fx, st_fx->VAD, syn_fx, st_fx->Q_syn); + noisy_speech_detection(st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn); - st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech = mult_r(st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech, 32440/*0.99 Q15*/); - IF(st_fx->hFdCngDec_fx->hFdCngCom->flag_noisy_speech != 0) + st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r(st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440/*0.99 Q15*/); + IF(st_fx->hFdCngDec->hFdCngCom->flag_noisy_speech != 0) { - st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech = add(st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech, 328/*0.01 Q15*/); + st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add(st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 328/*0.01 Q15*/); move16(); } } IF(st_fx->idchan == 0) { - st_fx->lp_noise = st_fx->hFdCngDec_fx->lp_noise; + st_fx->lp_noise = st_fx->hFdCngDec->lp_noise; move32(); } /*Noise estimate*/ @@ -1541,13 +1541,13 @@ ivas_error acelp_core_dec_fx( #else IF(st_fx->flag_cna && NE_16(st_fx->coder_type_fx, AUDIO)) { - generate_masking_noise(syn_fx, st_fx->Q_syn, st_fx->hFdCngDec_fx->hFdCngCom, st_fx->hFdCngDec_fx->hFdCngCom->frameSize, 0); + generate_masking_noise(syn_fx, st_fx->Q_syn, st_fx->hFdCngDec->hFdCngCom, st_fx->hFdCngDec->hFdCngCom->frameSize, 0); } ELSE IF(st_fx->flag_cna && st_fx->coder_type_fx == AUDIO && st_fx->last_core == ACELP_CORE && st_fx->last_coder_type_fx != AUDIO) { - FOR(i = 0; i < st_fx->hFdCngDec_fx->hFdCngCom->frameSize / 2; i++) + FOR(i = 0; i < st_fx->hFdCngDec->hFdCngCom->frameSize / 2; i++) { - syn_fx[i] = add(syn_fx[i], shr_r(mult_r(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->hFdCngDec_fx->hFdCngCom->frameSize / 4], st_fx->hFdCngDec_fx->hFdCngCom->fftlenFac), -st_fx->Q_syn)); + syn_fx[i] = add(syn_fx[i], shr_r(mult_r(st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->hFdCngDec->hFdCngCom->frameSize / 4], st_fx->hFdCngDec->hFdCngCom->fftlenFac), -st_fx->Q_syn)); move16(); } } @@ -1557,7 +1557,7 @@ ivas_error acelp_core_dec_fx( { FOR(i = 0; i < st_fx->L_frame / 2; i++) { - syn_fx[i] = add(syn_fx[i], shr_r(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->L_frame / 4], -st_fx->Q_syn)); + syn_fx[i] = add(syn_fx[i], shr_r(st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i + 5 * st_fx->L_frame / 4], -st_fx->Q_syn)); move16(); } } @@ -1565,7 +1565,7 @@ ivas_error acelp_core_dec_fx( test(); IF(st_fx->flag_cna == 0 || EQ_16(st_fx->coder_type_fx, AUDIO)) { - set16_fx(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, 0, st_fx->hFdCngDec_fx->hFdCngCom->fftlen); + set16_fx(st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, st_fx->hFdCngDec->hFdCngCom->fftlen); } #endif } @@ -1664,15 +1664,15 @@ ivas_error acelp_core_dec_fx( test(); IF(!st_fx->cng_sba_flag || EQ_16(st_fx->element_mode, IVAS_CPE_MDCT)) { - IF((EQ_32(st_fx->core_brate, FRAME_NO_DATA) || EQ_32(st_fx->core_brate, SID_2k40)) && (EQ_16(st_fx->cng_type, FD_CNG)) && (LT_16(st_fx->hFdCngDec_fx->hFdCngCom->numCoreBands, st_fx->cldfbSyn_fx->no_channels))) + IF((EQ_32(st_fx->core_brate, FRAME_NO_DATA) || EQ_32(st_fx->core_brate, SID_2k40)) && (EQ_16(st_fx->cng_type, FD_CNG)) && (LT_16(st_fx->hFdCngDec->hFdCngCom->numCoreBands, st_fx->cldfbSyn_fx->no_channels))) { generate_comfort_noise_dec_hf(realBuffer, imagBuffer, &scaleFactor.hb_scale, st_fx); st_fx->cldfbSyn_fx->bandsToZero = 0; move16(); - if (LT_16(st_fx->hFdCngDec_fx->hFdCngCom->regularStopBand, st_fx->cldfbSyn_fx->no_channels)) + if (LT_16(st_fx->hFdCngDec->hFdCngCom->regularStopBand, st_fx->cldfbSyn_fx->no_channels)) { - st_fx->cldfbSyn_fx->bandsToZero = sub(st_fx->cldfbSyn_fx->no_channels, st_fx->hFdCngDec_fx->hFdCngCom->regularStopBand); + st_fx->cldfbSyn_fx->bandsToZero = sub(st_fx->cldfbSyn_fx->no_channels, st_fx->hFdCngDec->hFdCngCom->regularStopBand); } st_fx->cldfbSyn_fx->lsb = st_fx->cldfbAna_fx->no_channels; move16(); @@ -1807,7 +1807,7 @@ ivas_error acelp_core_dec_fx( updt_dec_fx( st_fx, old_exc_fx, pitch_buf_fx, Es_pred_fx, Aq_fx, lsf_new_fx, lsp_new_fx, voice_factors, old_bwe_exc_fx, gain_buf ); - IF( GT_32(st_fx->core_brate,SID_2k40) && st_fx->hTdCngDec != NULL && st_fx->hFdCngDec_fx != NULL) + IF( GT_32(st_fx->core_brate,SID_2k40) && st_fx->hTdCngDec != NULL && st_fx->hFdCngDec != NULL) { /* update CNG parameters in active frames */ cng_params_upd_fx( lsp_new_fx, exc_fx, st_fx->L_frame, &st_fx->hTdCngDec->ho_circ_ptr_fx, st_fx->hTdCngDec->ho_ener_circ_fx, &st_fx->hTdCngDec->ho_circ_size_fx, st_fx->hTdCngDec->ho_lsp_circ_fx, diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index cda82ed5c..c2d6db0f4 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -182,7 +182,7 @@ ivas_error acelp_core_switch_dec_fx( IF ( st_fx->flag_cna != 0 ) { - generate_masking_noise( synth_intFreq, st_fx->Q_syn, st_fx->hFdCngDec_fx->hFdCngCom, 2*L_SUBFR, 0); + generate_masking_noise( synth_intFreq, st_fx->Q_syn, st_fx->hFdCngDec->hFdCngCom, 2*L_SUBFR, 0); } /*----------------------------------------------------------------* diff --git a/lib_dec/amr_wb_dec_fx.c b/lib_dec/amr_wb_dec_fx.c index 137e7b8aa..aa1565efd 100644 --- a/lib_dec/amr_wb_dec_fx.c +++ b/lib_dec/amr_wb_dec_fx.c @@ -786,18 +786,18 @@ ivas_error amr_wb_dec_fx( #else ApplyFdCng( syn_fx, st_fx->Q_syn, NULL, NULL, NULL, st_fx, 0, 0 ); #endif - st_fx->hFdCngDec_fx->hFdCngCom->frame_type_previous = st_fx->m_frame_type; + st_fx->hFdCngDec->hFdCngCom->frame_type_previous = st_fx->m_frame_type; /*Noisy speech detector*/ - noisy_speech_detection(st_fx->hFdCngDec_fx, st_fx->VAD, syn_fx, st_fx->Q_syn); + noisy_speech_detection(st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn); - st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech = mult_r(st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech, 32440/*0.99 Q15*/); - IF ( st_fx->hFdCngDec_fx->hFdCngCom->flag_noisy_speech != 0 ) + st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r(st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440/*0.99 Q15*/); + IF ( st_fx->hFdCngDec->hFdCngCom->flag_noisy_speech != 0 ) { - st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech = add(st_fx->hFdCngDec_fx->hFdCngCom->likelihood_noisy_speech, 328/*0.01 Q15*/); + st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = add(st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 328/*0.01 Q15*/); move16(); } - st_fx->lp_noise = st_fx->hFdCngDec_fx->lp_noise; + st_fx->lp_noise = st_fx->hFdCngDec->lp_noise; move16(); test(); @@ -805,18 +805,18 @@ ivas_error amr_wb_dec_fx( { flag_cna = 1; move16(); - generate_masking_noise( syn_fx, st_fx->Q_syn, st_fx->hFdCngDec_fx->hFdCngCom, st_fx->hFdCngDec_fx->hFdCngCom->frameSize, AMR_WB_CORE ); + generate_masking_noise( syn_fx, st_fx->Q_syn, st_fx->hFdCngDec->hFdCngCom, st_fx->hFdCngDec->hFdCngCom->frameSize, AMR_WB_CORE ); } ELSE IF ( st_fx->flag_cna ) { - generate_masking_noise_update_seed( st_fx->hFdCngDec_fx->hFdCngCom ); + generate_masking_noise_update_seed( st_fx->hFdCngDec->hFdCngCom ); } /*Copy(syn+L_FRAME-M-1, st_fx->syn, M+1);*/ } ELSE IF ( st_fx->flag_cna ) { - generate_masking_noise_update_seed( st_fx->hFdCngDec_fx->hFdCngCom ); + generate_masking_noise_update_seed( st_fx->hFdCngDec->hFdCngCom ); } @@ -829,11 +829,11 @@ ivas_error amr_wb_dec_fx( { FOR (i=0; i < L_FRAME/2; i++) { - syn_fx[i] = add( syn_fx[i], shr_r( st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2[i+5*L_FRAME/4], -st_fx->Q_syn ) ); + syn_fx[i] = add( syn_fx[i], shr_r( st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i+5*L_FRAME/4], -st_fx->Q_syn ) ); move16(); } } - set16_fx( st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, 0, shl(L_FRAME,1) ); + set16_fx( st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, shl(L_FRAME,1) ); } /*----------------------------------------------------------------* diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 6a22da663..341b07e5f 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1018,8 +1018,8 @@ ivas_error core_switching_pre_dec_fx( test(); test(); test(); - IF( st_fx->hFdCngDec_fx && ((NE_16(st_fx->last_L_frame,st_fx->L_frame))|| - (NE_16(st_fx->hFdCngDec_fx->hFdCngCom->frameSize,st_fx->L_frame)) || + IF( st_fx->hFdCngDec && ((NE_16(st_fx->last_L_frame,st_fx->L_frame))|| + (NE_16(st_fx->hFdCngDec->hFdCngCom->frameSize,st_fx->L_frame)) || st_fx->ini_frame == 0 || NE_16(st_fx->bwidth, st_fx->last_bwidth) )) { @@ -1035,15 +1035,15 @@ ivas_error core_switching_pre_dec_fx( tmp = ACELP_9k60; move32(); } - configureFdCngDec(st_fx->hFdCngDec_fx, st_fx->bwidth, tmp, st_fx->L_frame, st_fx->last_L_frame, st_fx->element_mode ); + configureFdCngDec(st_fx->hFdCngDec, st_fx->bwidth, tmp, st_fx->L_frame, st_fx->last_L_frame, st_fx->element_mode ); } ELSE { - configureFdCngDec(st_fx->hFdCngDec_fx, 1, ACELP_8k00, st_fx->L_frame, st_fx->last_L_frame, st_fx->element_mode); + configureFdCngDec(st_fx->hFdCngDec, 1, ACELP_8k00, st_fx->L_frame, st_fx->last_L_frame, st_fx->element_mode); if( st_fx->VAD ) { - st_fx->hFdCngDec_fx->hFdCngCom->CngBitrate = st_fx->total_brate; + st_fx->hFdCngDec->hFdCngCom->CngBitrate = st_fx->total_brate; move32(); } } @@ -1056,26 +1056,26 @@ ivas_error core_switching_pre_dec_fx( #ifdef IVAS_CODE_SWITCHING IF (EQ_16(st_fx->element_mode, IVAS_CPE_DFT) || EQ_16(st_fx->element_mode, IVAS_CPE_TD)) { - lerp(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferAna + st_fx->last_L_frame, st_fx->hFdCngDec_fx->hFdCngCom->olapBufferAna + st_fx->L_frame, st_fx->L_frame, st_fx->last_L_frame); + lerp(st_fx->hFdCngDec->hFdCngCom->olapBufferAna + st_fx->last_L_frame, st_fx->hFdCngDec->hFdCngCom->olapBufferAna + st_fx->L_frame, st_fx->L_frame, st_fx->last_L_frame); } #endif - lerp(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, st_fx->L_frame * 2, st_fx->last_L_frame * 2); + lerp(st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2, st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2, st_fx->L_frame * 2, st_fx->last_L_frame * 2); test(); IF( LE_32(st_fx->total_brate,SID_2k40)&&LE_32(st_fx->last_total_brate,SID_2k40)) { - lerp( st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth, st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth, st_fx->L_frame*2, st_fx->last_L_frame*2 ); + lerp( st_fx->hFdCngDec->hFdCngCom->olapBufferSynth, st_fx->hFdCngDec->hFdCngCom->olapBufferSynth, st_fx->L_frame*2, st_fx->last_L_frame*2 ); IF( EQ_16(st_fx->L_frame, L_FRAME)) { FOR( i=0; i < st_fx->L_frame*2; i++ ) { - st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth[i] = mult_r( st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth[i], 20480 ); + st_fx->hFdCngDec->hFdCngCom->olapBufferSynth[i] = mult_r( st_fx->hFdCngDec->hFdCngCom->olapBufferSynth[i], 20480 ); } } ELSE { FOR( i=0; i < st_fx->L_frame*2; i++ ) { - st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth[i] = mult_r( shl(st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth[i],1), 26214 ); + st_fx->hFdCngDec->hFdCngCom->olapBufferSynth[i] = mult_r( shl(st_fx->hFdCngDec->hFdCngCom->olapBufferSynth[i],1), 26214 ); } } } diff --git a/lib_dec/dec_acelp_tcx_main_fx.c b/lib_dec/dec_acelp_tcx_main_fx.c index 4120f7c5c..2ccef40cc 100644 --- a/lib_dec/dec_acelp_tcx_main_fx.c +++ b/lib_dec/dec_acelp_tcx_main_fx.c @@ -238,16 +238,16 @@ void decode_frame_type(Decoder_State *st L_tmp = ACELP_9k60; move32(); } - configureFdCngDec( st->hFdCngDec_fx, st->bwidth, L_tmp, st->L_frame, st->last_L_frame, st->element_mode); + configureFdCngDec( st->hFdCngDec, st->bwidth, L_tmp, st->L_frame, st->last_L_frame, st->element_mode); test(); test(); IF ( (NE_16(st->last_L_frame,st->L_frame))&&(LE_16(st->L_frame, L_FRAME16k))&&(LE_16(st->last_L_frame, L_FRAME16k))) { - lerp( st->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, st->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, st->L_frame*2, st->last_L_frame*2 ); + lerp( st->hFdCngDec->hFdCngCom->olapBufferSynth2, st->hFdCngDec->hFdCngCom->olapBufferSynth2, st->L_frame*2, st->last_L_frame*2 ); test(); - IF ( EQ_16(st->m_frame_type, SID_FRAME)&&NE_16(st->hFdCngDec_fx->hFdCngCom->frame_type_previous,ACTIVE_FRAME)) + IF ( EQ_16(st->m_frame_type, SID_FRAME)&&NE_16(st->hFdCngDec->hFdCngCom->frame_type_previous,ACTIVE_FRAME)) { - lerp( st->hFdCngDec_fx->hFdCngCom->olapBufferSynth, st->hFdCngDec_fx->hFdCngCom->olapBufferSynth, st->L_frame*2, st->last_L_frame*2 ); + lerp( st->hFdCngDec->hFdCngCom->olapBufferSynth, st->hFdCngDec->hFdCngCom->olapBufferSynth, st->L_frame*2, st->last_L_frame*2 ); #ifdef IVAS_CODE_CNG lerp(hStereoCng->olapBufferSynth22, hStereoCng->olapBufferSynth22, st->L_frame * 2, st->last_L_frame * 2); #endif @@ -255,22 +255,22 @@ void decode_frame_type(Decoder_State *st { FOR( n=0; n < st->L_frame*2; n++ ) { - st->hFdCngDec_fx->hFdCngCom->olapBufferSynth[n] = mult_r( st->hFdCngDec_fx->hFdCngCom->olapBufferSynth[n], 20480 ); + st->hFdCngDec->hFdCngCom->olapBufferSynth[n] = mult_r( st->hFdCngDec->hFdCngCom->olapBufferSynth[n], 20480 ); } } ELSE { FOR( n=0; n < st->L_frame*2; n++ ) { - st->hFdCngDec_fx->hFdCngCom->olapBufferSynth[n] = mult_r( shl(st->hFdCngDec_fx->hFdCngCom->olapBufferSynth[n],1), 26214 ); + st->hFdCngDec->hFdCngCom->olapBufferSynth[n] = mult_r( shl(st->hFdCngDec->hFdCngCom->olapBufferSynth[n],1), 26214 ); } } } } IF ( NE_16(st->bwidth,st->last_bwidth)) { - st->hFdCngDec_fx->hFdCngCom->msFrCnt_init_counter = 0; - st->hFdCngDec_fx->hFdCngCom->init_old = 32767; + st->hFdCngDec->hFdCngCom->msFrCnt_init_counter = 0; + st->hFdCngDec->hFdCngCom->init_old = 32767; } /* Reconf BPF */ @@ -516,7 +516,7 @@ Word16 dec_acelp_tcx_frame( IF ( EQ_16(st->m_frame_type,SID_FRAME)) { - FdCng_decodeSID(st->hFdCngDec_fx->hFdCngCom, st); + FdCng_decodeSID(st->hFdCngDec->hFdCngCom, st); } /* updates */ diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 2b06e10f3..0ed1b1cb3 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -1268,7 +1268,7 @@ void decoder_tcx( /* Generate additional comfort noise to mask potential coding artefacts */ IF ( st->flag_cna != 0 ) { - generate_masking_noise_mdct (x, &x_e, st->hFdCngDec_fx->hFdCngCom, s_max(s_max(L_frame,L_frameTCX), L_spec) ); + generate_masking_noise_mdct (x, &x_e, st->hFdCngDec->hFdCngCom, s_max(s_max(L_frame,L_frameTCX), L_spec) ); } IMDCT(x, x_e, hTcxDec->syn_OverlFB, hTcxDec->syn_Overl_TDACFB, xn_bufFB, hTcxCfg->tcx_aldo_window_1_FB, hTcxCfg->tcx_aldo_window_1_FB_trunc, hTcxCfg->tcx_aldo_window_2_FB, diff --git a/lib_dec/evs_dec_fx.c b/lib_dec/evs_dec_fx.c index d71eb2db7..5f178a044 100644 --- a/lib_dec/evs_dec_fx.c +++ b/lib_dec/evs_dec_fx.c @@ -974,16 +974,16 @@ ivas_error evs_dec_fx( test(); test(); test(); - IF ( st_fx->hFdCngDec_fx != NULL && (EQ_32(st_fx->sr_core,8000)||EQ_32(st_fx->sr_core, INT_FS_12k8)||EQ_32(st_fx->sr_core, INT_FS_16k))&&LE_32(st_fx->total_brate,ACELP_32k)) + IF ( st_fx->hFdCngDec != NULL && (EQ_32(st_fx->sr_core,8000)||EQ_32(st_fx->sr_core, INT_FS_12k8)||EQ_32(st_fx->sr_core, INT_FS_16k))&&LE_32(st_fx->total_brate,ACELP_32k)) { /*************************************** In CLDFB domain: - perform noise estimation during active frames - do CNG during inactive frames ****************************************/ - HANDLE_FD_CNG_DEC hFdCngDec = st_fx->hFdCngDec_fx; + HANDLE_FD_CNG_DEC hFdCngDec = st_fx->hFdCngDec; move16(); - noisy_speech_detection(st_fx->hFdCngDec_fx, st_fx->VAD && st_fx->m_frame_type == ACTIVE_FRAME, output_sp, 0); + noisy_speech_detection(st_fx->hFdCngDec, st_fx->VAD && st_fx->m_frame_type == ACTIVE_FRAME, output_sp, 0); hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r(hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440/*0.99 Q15*/); IF ( hFdCngDec->hFdCngCom->flag_noisy_speech != 0 ) @@ -1018,7 +1018,7 @@ ivas_error evs_dec_fx( { FOR (i=0; i < st_fx->L_frame/2; i++) { - output_sp[i] = add( output_sp[i], st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2[i+5*st_fx->L_frame/4] ); + output_sp[i] = add( output_sp[i], st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i+5*st_fx->L_frame/4] ); move16(); } } @@ -1041,20 +1041,20 @@ ivas_error evs_dec_fx( Word16 timeDomainBuffer[L_FRAME16k]; Word16 A[M+1]; - Copy( st_fx->hFdCngDec_fx->hFdCngCom->timeDomainBuffer, timeDomainBuffer, st_fx->L_frame ); - Copy( st_fx->hFdCngDec_fx->hFdCngCom->A_cng, A, M+1 ); + Copy( st_fx->hFdCngDec->hFdCngCom->timeDomainBuffer, timeDomainBuffer, st_fx->L_frame ); + Copy( st_fx->hFdCngDec->hFdCngCom->A_cng, A, M+1 ); update_decoder_LPD_cng( st_fx, st_fx->coder_type_fx, timeDomainBuffer, A, st_fx->p_bpf_noise_buf ); /* Generate additional comfort noise to mask potential coding artefacts */ IF( st_fx->flag_cna ) { - generate_masking_noise( timeDomainBuffer, 0, st_fx->hFdCngDec_fx->hFdCngCom, st_fx->hFdCngDec_fx->hFdCngCom->frameSize, 0 ); + generate_masking_noise( timeDomainBuffer, 0, st_fx->hFdCngDec->hFdCngCom, st_fx->hFdCngDec->hFdCngCom->frameSize, 0 ); } ELSE IF( EQ_16(st_fx->L_frame,L_FRAME16k)&&EQ_16(st_fx->last_flag_cna,1)&&((EQ_16(st_fx->last_core,ACELP_CORE)&&NE_16(st_fx->last_coder_type_fx,AUDIO))||EQ_16(st_fx->last_core,TCX_20_CORE)||EQ_16(st_fx->last_core,AMR_WB_CORE))) { FOR( i=0; i < st_fx->L_frame/2; i++ ) { - timeDomainBuffer[i] = add( timeDomainBuffer[i], st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2[i+5*st_fx->L_frame/4] ); + timeDomainBuffer[i] = add( timeDomainBuffer[i], st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2[i+5*st_fx->L_frame/4] ); move16(); } } @@ -1074,9 +1074,9 @@ ivas_error evs_dec_fx( { st_fx->cldfbSyn_fx->bandsToZero = sub( st_fx->cldfbSyn_fx->no_channels, 10 ); } - ELSE IF ( st_fx->hFdCngDec_fx->hFdCngCom->regularStopBand < st_fx->cldfbSyn_fx->no_channels ) + ELSE IF ( st_fx->hFdCngDec->hFdCngCom->regularStopBand < st_fx->cldfbSyn_fx->no_channels ) { - st_fx->cldfbSyn_fx->bandsToZero = st_fx->cldfbSyn_fx->no_channels - st_fx->hFdCngDec_fx->hFdCngCom->regularStopBand; + st_fx->cldfbSyn_fx->bandsToZero = st_fx->cldfbSyn_fx->no_channels - st_fx->hFdCngDec->hFdCngCom->regularStopBand; } timeIn_e = 2; @@ -1093,7 +1093,7 @@ ivas_error evs_dec_fx( if( st_fx->flag_cna == 0 ) { - set16_fx( st_fx->hFdCngDec_fx->hFdCngCom->olapBufferSynth2, 0, st_fx->hFdCngDec_fx->hFdCngCom->fftlen ); + set16_fx( st_fx->hFdCngDec->hFdCngCom->olapBufferSynth2, 0, st_fx->hFdCngDec->hFdCngCom->fftlen ); } IF( st_fx->p_bpf_noise_buf ) diff --git a/lib_dec/fd_cng_dec_fx.c b/lib_dec/fd_cng_dec_fx.c index 1ce509844..84d73d664 100644 --- a/lib_dec/fd_cng_dec_fx.c +++ b/lib_dec/fd_cng_dec_fx.c @@ -64,7 +64,7 @@ void initFdCngDec( /* Initialize common */ HANDLE_FD_CNG_DEC hFdCngDec; - hFdCngDec = st->hFdCngDec_fx; + hFdCngDec = st->hFdCngDec; initFdCngCom( hFdCngDec->hFdCngCom, scale ); set16_fx( hFdCngDec->olapBufferAna, 0, 320 ); @@ -478,7 +478,7 @@ Word16 ApplyFdCng ( sr_core = min(st->sr_core, INT_FS_16k); #endif - hFdCngDec = st->hFdCngDec_fx; + hFdCngDec = st->hFdCngDec; hFdCngCom = hFdCngDec->hFdCngCom; @@ -1789,7 +1789,7 @@ generate_comfort_noise_dec ( Word32 *fftBuffer; Word16 old_syn_pe_tmp[16]; Word16 tcx_transition = 0; - HANDLE_FD_CNG_DEC hFdCngDec = st->hFdCngDec_fx; + HANDLE_FD_CNG_DEC hFdCngDec = st->hFdCngDec; HANDLE_FD_CNG_COM hFdCngCom = hFdCngDec->hFdCngCom; TCX_DEC_HANDLE hTcxDec; @@ -2185,7 +2185,7 @@ generate_comfort_noise_dec_hf ( Word16 *seed; Word32 *cngNoiseLevel; Word32 *ptr_level; - HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec_fx->hFdCngCom; + HANDLE_FD_CNG_COM hFdCngCom = st->hFdCngDec->hFdCngCom; cngNoiseLevel = hFdCngCom->cngNoiseLevel+hFdCngCom->stopFFTbin-hFdCngCom->startBand; cngNoiseLevelExp = hFdCngCom->cngNoiseLevelExp; diff --git a/lib_dec/init_dec_fx.c b/lib_dec/init_dec_fx.c index 5cc8c315d..2b9f8ab9d 100644 --- a/lib_dec/init_dec_fx.c +++ b/lib_dec/init_dec_fx.c @@ -9,6 +9,7 @@ #include "rom_com.h" /* Static table prototypes */ #include "stl.h" /* required for wmc_tool */ #include "basop_util.h" +#include "prot.h" /*----------------------------------------------------------------------* * init_decoder() @@ -759,7 +760,7 @@ ivas_error init_decoder_fx( { /* Create FD_CNG instance */ - if ((error = createFdCngDec(&st_fx->hFdCngDec_fx)) != IVAS_ERR_OK ) + if ((error = createFdCngDec(&st_fx->hFdCngDec)) != IVAS_ERR_OK ) { return error; } @@ -769,7 +770,7 @@ ivas_error init_decoder_fx( } ELSE { - st_fx->hFdCngDec_fx = NULL; + st_fx->hFdCngDec = NULL; } st_fx->lp_noise = -167772160l/*-20.f Q23*/; @@ -876,7 +877,7 @@ void destroy_cldfb_decoder( /* delete synthesis for output SR */ deleteCldfb(&st_fx->cldfbSyn_fx); - deleteFdCngDec( &st_fx->hFdCngDec_fx ); + deleteFdCngDec( &st_fx->hFdCngDec ); return; } diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 5a9f0b7df..1ef29c382 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -2548,7 +2548,6 @@ typedef struct Decoder_State *----------------------------------------------------------------------------------*/ HANDLE_FD_CNG_DEC hFdCngDec; - HANDLE_FD_CNG_DEC hFdCngDec_fx; /*----------------------------------------------------------------------------------* * IGF diff --git a/lib_dec/updt_dec_fx.c b/lib_dec/updt_dec_fx.c index 6f8599288..28baf9243 100644 --- a/lib_dec/updt_dec_fx.c +++ b/lib_dec/updt_dec_fx.c @@ -674,9 +674,9 @@ void updt_dec_common_fx( test(); test(); st_fx->last_flag_cna = st_fx->flag_cna; move16(); - if (st_fx->hFdCngDec_fx != NULL) + if (st_fx->hFdCngDec != NULL) { - st_fx->hFdCngDec_fx->hFdCngCom->frame_type_previous = st_fx->m_frame_type; + st_fx->hFdCngDec->hFdCngCom->frame_type_previous = st_fx->m_frame_type; move16(); } -- GitLab