diff --git a/apps/renderer.c b/apps/renderer.c index 8e44fd6cc19cf316afea7a5563e67c357acdf3d6..27d19d7adf7fae405240fe0a40ac6bbec2259ef2 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -68,6 +68,10 @@ #define IVAS_MAX16B_FLT 32767.0f #define IVAS_MIN16B_FLT ( -32768.0f ) +#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS +#define OMASA_TDREND_MATCHING_GAIN_DB ( -2.0f ) +#endif + #if !defined( DEBUGGING ) && !defined( WMOPS ) static #endif @@ -1153,20 +1157,39 @@ int main( } } +#ifndef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Set the total number of objects */ +#endif if ( args.inConfig.numAudioObjects > 0 ) { +#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS + /* Set the total number of objects */ +#endif if ( ( error = IVAS_REND_SetTotalNumberOfObjects( hIvasRend, args.inConfig.numAudioObjects ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetTotalNumberOfObjects(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } +#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS + /* Set the metadata delay for objects */ +#endif if ( ( error = IVAS_REND_SetIsmMetadataDelay( hIvasRend, args.syncMdDelay ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_REND_SetIsmMetadataDelay(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } +#ifdef NONBE_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS + + /* For OMASA input and BINAURAL output, apply a gain to objects to match the loudness with MASA part */ + if ( args.inConfig.numMasaBuses > 0 && args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL ) + { + for ( i = 0; i < args.inConfig.numAudioObjects; ++i ) + { + args.inConfig.audioObjects[i].gain_dB += OMASA_TDREND_MATCHING_GAIN_DB; + } + } +#endif } IVAS_REND_LfePanMtx lfePanMatrix; diff --git a/lib_com/options.h b/lib_com/options.h index edd60e4680f719806fef9ec40b0e5f974fa712d7..1318a03b9331cb15358dbab9585eaaa3cda7b177 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_1359_FIX_IVASREND_OMASA_BINAURAL_LOUDNESS /* Nokia: issue 1339: Apply scaling to the object-part of OMASA for binaural rendering in IVAS_rend. */ /* ##################### End NON-BE switches ########################### */