From dec60393efec00ac7340b106e42d8c7cabd6961e Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 8 Aug 2025 12:54:41 +0200 Subject: [PATCH] port MR --- lib_com/options.h | 1 + lib_enc/swb_tbe_enc.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 31f712963..95117a1f7 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -198,6 +198,7 @@ #define FIX_1082_INSTRUM_FAILED_LC3PLUS /* VoiceAge: issue 1082: fix ambiguous syntax in LC3Plus code leading to fails of instrumented builds */ #define NONBE_FIX_1074_NOBJ_SIGNAL_OMASA_LBR /* Nok: issue 1074 fixing number of objects signaling in OMASA low rate */ #define FIX_1222_OMASA_DEC_CHANNEL_BUFFERS /* VA: issue 1222: Reduction of the number of channel buffers in OMASA decoder */ +#define NONBE_FIX_1130_DIV_ZERO_LEV_DUR /* VA: issue 1130: avoid div by zero in L-D by thresholding R[0] to a min value of 100.0 */ /* #################### End BASOP porting switches ############################ */ diff --git a/lib_enc/swb_tbe_enc.c b/lib_enc/swb_tbe_enc.c index f748e8cdf..ff13c4cd3 100644 --- a/lib_enc/swb_tbe_enc.c +++ b/lib_enc/swb_tbe_enc.c @@ -280,6 +280,15 @@ void wb_tbe_enc( } autocorr( hb_old_speech, R, LPC_SHB_ORDER_WB + 1, ( NS2SA( INT_FS_12k8, 5000000L ) + L_SUBFR + L_FRAME ) * 5 / 16, win_lpc_hb_wb, 0, 1, 1 ); + +#ifdef NONBE_FIX_1130_DIV_ZERO_LEV_DUR + if ( st->element_mode > EVS_MONO ) + { + /* Ensure R[0] isn't zero when entering Levinson-Durbin */ + R[0] = max( R[0], 1.0e-8f ); + } +#endif + lev_dur( lpc_wb_temp, R, LPC_SHB_ORDER_WB, ervec_temp ); a2lsp( lsp_wb_temp, lpc_wb_temp, LPC_SHB_ORDER_WB ); lsp_spacing = 0.5f; -- GitLab