From c2b9353d886d7cc9cab563eba36886da24763175 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 9 Dec 2024 09:44:10 +0530 Subject: [PATCH] Fix for 3GPP issue 1044: ivas_merge_sba_transports() misses 1/2 normalization - Fixed point changes --- lib_com/options.h | 1 + lib_enc/ivas_osba_enc.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index c7407e532..e7fd49fc6 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -80,4 +80,5 @@ #define CR_2109_to_2112_cd0_ce0 /* This is related to the CRs include in the 26.444 package of 21-12. Concerns lead_deindexing and */ #define FIX_QMETADATA_PENALTY /* Nokia: transform penalty calculation in qmetadata into integer operations */ #define FIX_1013_CRASH_HQ_CORE_DEC /* Ittiam: Saturation added on the lines of EVS */ +#define NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* DLB: adjust prerendering and mixing gain in OSBA encoder. This is fix to float codes*/ #endif diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index c78b21d50..f018f250a 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -79,7 +79,11 @@ static void ivas_merge_sba_transports_fx( { FOR( j = 0; j < input_frame; j++ ) { +#ifdef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS + data_out_f[i][j] = L_shr( L_add( L_shr( data_in_f1[i][j], 1 ), L_shr( data_in_f2[i][j], sub( Q_f2, sub( Q_f1, 1 ) ) ) ), Q1 ); +#else data_out_f[i][j] = L_add( L_shr( data_in_f1[i][j], 1 ), L_shr( data_in_f2[i][j], sub( Q_f2, sub( Q_f1, 1 ) ) ) ); +#endif move32(); } } @@ -477,7 +481,9 @@ static void ivas_osba_render_ism_to_sba_fx( Word16 azimuth_fx, elevation_fx; Word32 gains_fx[MAX_INPUT_CHANNELS]; Word32 g1_fx, g2_fx; +#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS Word32 output_gain_fx; +#endif Word16 nchan_sba; nchan_sba = imult1616( add( sba_analysis_order, 1 ), add( sba_analysis_order, 1 ) ); @@ -518,6 +524,8 @@ static void ivas_osba_render_ism_to_sba_fx( } } *Q_data = sub( *Q_data, 2 ); + +#ifndef NONE_BE_FIX_BASOP_1044_OSBA_PRERENDER_MIX_GAINS /* Gain with loudness-matching gains */ // output_gain = 0.7499f; output_gain_fx = 1610397988; // 0.7499f in Q31 @@ -531,6 +539,7 @@ static void ivas_osba_render_ism_to_sba_fx( move32(); } } +#endif return; } -- GitLab