From bdd0c6559f1e7283c5f508131eed4bc31a3a66b9 Mon Sep 17 00:00:00 2001 From: naghibza Date: Thu, 5 Mar 2026 14:45:35 +0100 Subject: [PATCH 1/2] Attempt to preserve olapBufferSynth exponent in core_switching_dec_fx.c --- lib_dec/core_switching_dec_fx.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 2eab8f473..09246048a 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1975,18 +1975,33 @@ ivas_error core_switching_pre_dec_fx( } ELSE { +#ifdef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING + Word16 hdrm = Q16; + move16(); +#endif FOR( i = 0; i < shl( st->L_frame, 1 ); i++ ) { #ifdef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING st->hFdCngDec->hFdCngCom->olapBufferSynth[i] = mult_r( st->hFdCngDec->hFdCngCom->olapBufferSynth[i], 26214 /* Q14*/ ); /* (Q15 - olapBufferSynth_exp) + 1 */ - move16(); + move16(); + if ( st->hFdCngDec->hFdCngCom->olapBufferSynth[i] != 0 ) + { + hdrm = s_min( hdrm, norm_s( st->hFdCngDec->hFdCngCom->olapBufferSynth[i] ) ); + } #else st->hFdCngDec->hFdCngCom->olapBufferSynth_fx[i] = Mult_32_16( L_shl( st->hFdCngDec->hFdCngCom->olapBufferSynth_fx[i], 1 ), (Word16) 26214 /* 1.6f in Q14 */ ); move32(); #endif } #ifdef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING - st->hFdCngDec->hFdCngCom->olapBufferSynth_exp = add( st->hFdCngDec->hFdCngCom->olapBufferSynth_exp, 1 ); + IF( NE_16( hdrm, 0 ) ) + { + scale_sig( st->hFdCngDec->hFdCngCom->olapBufferSynth, shl( st->L_frame, 1 ), Q1 ); + } + ELSE + { + st->hFdCngDec->hFdCngCom->olapBufferSynth_exp = add( st->hFdCngDec->hFdCngCom->olapBufferSynth_exp, 1 ); + } #endif } } -- GitLab From 6478862aeedf255f562dc05f63f2002d7749f0f8 Mon Sep 17 00:00:00 2001 From: naghibza Date: Thu, 5 Mar 2026 14:56:17 +0100 Subject: [PATCH 2/2] Apply Clang-format patch. --- lib_dec/core_switching_dec_fx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index 09246048a..db9c3b661 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1983,7 +1983,7 @@ ivas_error core_switching_pre_dec_fx( { #ifdef FIX_BASOP_2262_OLAP_BUFFER_SYNTH_SWITCHING st->hFdCngDec->hFdCngCom->olapBufferSynth[i] = mult_r( st->hFdCngDec->hFdCngCom->olapBufferSynth[i], 26214 /* Q14*/ ); /* (Q15 - olapBufferSynth_exp) + 1 */ - move16(); + move16(); if ( st->hFdCngDec->hFdCngCom->olapBufferSynth[i] != 0 ) { hdrm = s_min( hdrm, norm_s( st->hFdCngDec->hFdCngCom->olapBufferSynth[i] ) ); -- GitLab