From 01239f2a7670a8d25cfdb16c9299201344647749 Mon Sep 17 00:00:00 2001 From: Tapani Pihlajakuja Date: Thu, 7 Aug 2025 13:05:08 +0300 Subject: [PATCH] Fix issue 1362 by implementing missing path in omasa downmix. --- lib_com/options.h | 1 + lib_rend/ivas_omasa_ana.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index edd60e4680..6ccb9cf10f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -176,6 +176,7 @@ #define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */ #define NONBE_1339_FIXOSBA_EXT_LOUDNESS /* FhG: issue 1339: apply scaling with EXT output in OSBA high-BR mode */ #define NONBE_1352_HARMONIZE_OSBA_LOUDNESS /* FhG: do not scale OSBA inputs by 0.5 any more */ +#define NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING /* Nokia: Fix OMASA to MASA1 rendering in IVAS_rend */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_rend/ivas_omasa_ana.c b/lib_rend/ivas_omasa_ana.c index 95d67ee4fe..be092fe101 100644 --- a/lib_rend/ivas_omasa_ana.c +++ b/lib_rend/ivas_omasa_ana.c @@ -490,6 +490,34 @@ static void ivas_omasa_dmx( for ( i = 0; i < nchan_ism; i++ ) { +#ifdef NONBE_1362_FIX_OMASA_TO_MASA1_RENDERING + if ( nchan_transport == 1 ) + { + v_add( data_out_f[0], data_in_f[i], data_out_f[0], input_frame ); + } + else + { + azimuth = ism_azimuth[i]; + elevation = ism_elevation[i]; + + ivas_ism_get_stereo_gains( azimuth, elevation, &gains[0], &gains[1] ); + + /* Downmix using the panning gains */ + for ( j = 0; j < nchan_transport; j++ ) + { + if ( fabsf( gains[j] ) > 0.0 || fabsf( prev_gains[i][j] ) > 0.0f ) + { + for ( k = 0; k < input_frame; k++ ) + { + g1 = interpolator[k]; + g2 = 1.0f - g1; + data_out_f[j][k] += ( g1 * gains[j] + g2 * prev_gains[i][j] ) * data_in_f[i][k]; + } + } + prev_gains[i][j] = gains[j]; + } + } +#else azimuth = ism_azimuth[i]; elevation = ism_elevation[i]; @@ -509,6 +537,7 @@ static void ivas_omasa_dmx( } prev_gains[i][j] = gains[j]; } +#endif } for ( i = 0; i < nchan_transport; i++ ) -- GitLab