Loading lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,8 @@ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ /* #################### End BASOP porting switches ############################ */ /* clang-format on */ Loading lib_com/prot.h +4 −0 Original line number Diff line number Diff line Loading @@ -2638,6 +2638,10 @@ void non_linearity( const int16_t coder_type, /* i : Coder Type */ const float *voice_factors, /* i : Voice Factors */ const int16_t L_frame /* i : ACELP frame length */ #ifdef NONBE_1328_FIX_NON_LINEARITY , const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ #endif ); void interp_code_5over2( Loading lib_com/swb_tbe_com.c +27 −3 Original line number Diff line number Diff line Loading @@ -1353,6 +1353,10 @@ void non_linearity( const int16_t coder_type, /* i : Coder Type */ const float *voice_factors, /* i : Voice Factors */ const int16_t L_frame /* i : ACELP frame length */ #ifdef NONBE_1328_FIX_NON_LINEARITY , const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ #endif ) { int16_t i, j; Loading @@ -1365,7 +1369,9 @@ void non_linearity( int16_t en_abs = 0; float v_fac = 0, ths; int16_t nframes; #ifdef NONBE_1328_FIX_NON_LINEARITY float sc_factor; #endif if ( L_frame == L_FRAME16k ) { nframes = 5; Loading Loading @@ -1410,8 +1416,17 @@ void non_linearity( scale = 0.67f; } #ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 13 - norm_s( j + 1 ), 0 ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = max( sc_factor, 2.0f ); } if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) #else if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) #endif { scale_step = 1.0; *prev_scale = scale; Loading Loading @@ -1468,8 +1483,17 @@ void non_linearity( scale = 0.67f; } #ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 12 - norm_s( j - length / 2 + 1 ), 0 ) ); /* allowed intra frame jump is smaller */ sc_factor = max( sc_factor, 2.0f ); } if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) #else if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) #endif { scale_step = 1.0; *prev_scale = scale; Loading lib_dec/acelp_core_dec.c +6 −1 Original line number Diff line number Diff line Loading @@ -1442,7 +1442,12 @@ ivas_error acelp_core_dec( if ( !st->ppp_mode_dec && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame ); non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame #ifdef NONBE_1328_FIX_NON_LINEARITY , st->element_mode #endif ); } if ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) Loading lib_dec/dec_acelp_tcx_main.c +6 −1 Original line number Diff line number Diff line Loading @@ -425,7 +425,12 @@ void dec_acelp_tcx_frame( if ( st->core == ACELP_CORE && st->igf && st->con_tcx == 0 ) { non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame ); non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame #ifdef NONBE_1328_FIX_NON_LINEARITY , st->element_mode #endif ); /* update the old BWE exe memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); Loading Loading
lib_com/options.h +2 −0 Original line number Diff line number Diff line Loading @@ -222,6 +222,8 @@ #define NONBE_1118_EVS_LR_HQ_BITERROR /* VA: issue 1118: fix EVS decoder crash in LR-HQ in case of bit errors */ #define FIX_1139_REV_COLORATION_SHORT_T60 /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */ #define NONBE_1328_FIX_NON_LINEARITY /* VA: Fix possible issue when computing bwe_exc_extended and previous frame were almost 0 */ /* #################### End BASOP porting switches ############################ */ /* clang-format on */ Loading
lib_com/prot.h +4 −0 Original line number Diff line number Diff line Loading @@ -2638,6 +2638,10 @@ void non_linearity( const int16_t coder_type, /* i : Coder Type */ const float *voice_factors, /* i : Voice Factors */ const int16_t L_frame /* i : ACELP frame length */ #ifdef NONBE_1328_FIX_NON_LINEARITY , const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ #endif ); void interp_code_5over2( Loading
lib_com/swb_tbe_com.c +27 −3 Original line number Diff line number Diff line Loading @@ -1353,6 +1353,10 @@ void non_linearity( const int16_t coder_type, /* i : Coder Type */ const float *voice_factors, /* i : Voice Factors */ const int16_t L_frame /* i : ACELP frame length */ #ifdef NONBE_1328_FIX_NON_LINEARITY , const int16_t element_mode /* i : element_mode to differentiate EVS and IVAS */ #endif ) { int16_t i, j; Loading @@ -1365,7 +1369,9 @@ void non_linearity( int16_t en_abs = 0; float v_fac = 0, ths; int16_t nframes; #ifdef NONBE_1328_FIX_NON_LINEARITY float sc_factor; #endif if ( L_frame == L_FRAME16k ) { nframes = 5; Loading Loading @@ -1410,8 +1416,17 @@ void non_linearity( scale = 0.67f; } #ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 13 - norm_s( j + 1 ), 0 ) ); /* Adapt the scaling factor allowed depending of max position */ sc_factor = max( sc_factor, 2.0f ); } if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) #else if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) #endif { scale_step = 1.0; *prev_scale = scale; Loading Loading @@ -1468,8 +1483,17 @@ void non_linearity( scale = 0.67f; } #ifdef NONBE_1328_FIX_NON_LINEARITY sc_factor = 1024.0f; if ( element_mode > EVS_MONO ) { sc_factor = (float) ( 1 << max( 12 - norm_s( j - length / 2 + 1 ), 0 ) ); /* allowed intra frame jump is smaller */ sc_factor = max( sc_factor, 2.0f ); } if ( *prev_scale <= 0.0 || *prev_scale > sc_factor * scale ) #else if ( *prev_scale <= 0.0 || *prev_scale > 1024.0f * scale ) #endif { scale_step = 1.0; *prev_scale = scale; Loading
lib_dec/acelp_core_dec.c +6 −1 Original line number Diff line number Diff line Loading @@ -1442,7 +1442,12 @@ ivas_error acelp_core_dec( if ( !st->ppp_mode_dec && ( st->idchan == 0 || st->element_mode != IVAS_CPE_TD || ( st->idchan == 1 && st->element_mode == IVAS_CPE_TD && st->tdm_LRTD_flag ) ) ) { non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame ); non_linearity( bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame #ifdef NONBE_1328_FIX_NON_LINEARITY , st->element_mode #endif ); } if ( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) Loading
lib_dec/dec_acelp_tcx_main.c +6 −1 Original line number Diff line number Diff line Loading @@ -425,7 +425,12 @@ void dec_acelp_tcx_frame( if ( st->core == ACELP_CORE && st->igf && st->con_tcx == 0 ) { non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame ); non_linearity( ptr_bwe_exc, bwe_exc_extended, st->hBWE_TD->old_bwe_exc_extended, L_FRAME32k, &st->hBWE_TD->bwe_non_lin_prev_scale, st->coder_type, voice_factors, st->L_frame #ifdef NONBE_1328_FIX_NON_LINEARITY , st->element_mode #endif ); /* update the old BWE exe memory */ mvr2r( &old_bwe_exc[L_FRAME32k], st->hBWE_TD->old_bwe_exc, PIT16k_MAX * 2 ); Loading