From 85125fbf67d8ff920a7418c11508f159268e5e0c Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 30 Aug 2023 17:39:39 +0200 Subject: [PATCH 01/10] rename AUDIO_CONFIG enum and its members to to IVAS_* --- apps/decoder.c | 130 ++--- apps/renderer.c | 161 +++--- lib_com/bitstream.c | 2 +- lib_com/common_api_types.h | 54 +- lib_com/delay_comp.c | 2 +- lib_com/ivas_mc_com.c | 22 +- lib_dec/ivas_binRenderer_internal.c | 58 +- lib_dec/ivas_dec.c | 54 +- lib_dec/ivas_dirac_dec.c | 34 +- lib_dec/ivas_init_dec.c | 84 +-- lib_dec/ivas_ism_dec.c | 30 +- lib_dec/ivas_ism_param_dec.c | 36 +- lib_dec/ivas_ism_renderer.c | 2 +- lib_dec/ivas_jbm_dec.c | 60 +- lib_dec/ivas_ls_custom_dec.c | 2 +- lib_dec/ivas_masa_dec.c | 26 +- lib_dec/ivas_mc_param_dec.c | 8 +- lib_dec/ivas_mc_paramupmix_dec.c | 12 +- lib_dec/ivas_mct_dec.c | 20 +- lib_dec/ivas_objectRenderer_internal.c | 4 +- lib_dec/ivas_osba_dec.c | 8 +- lib_dec/ivas_out_setup_conversion.c | 16 +- lib_dec/ivas_output_config.c | 116 ++-- lib_dec/ivas_sba_dec.c | 4 +- lib_dec/ivas_sba_dirac_stereo_dec.c | 6 +- lib_dec/ivas_sba_rendering_internal.c | 24 +- lib_dec/ivas_sce_dec.c | 2 +- lib_dec/ivas_spar_decoder.c | 24 +- lib_dec/ivas_stereo_mdct_core_dec.c | 2 +- lib_dec/lib_dec.c | 64 +-- lib_dec/lib_dec.h | 4 +- lib_enc/lib_enc.c | 2 +- lib_rend/ivas_allrad_dec.c | 4 +- lib_rend/ivas_crend.c | 78 +-- lib_rend/ivas_dirac_dec_binaural_functions.c | 4 +- lib_rend/ivas_dirac_rend.c | 18 +- lib_rend/ivas_mcmasa_ana.c | 8 +- lib_rend/ivas_objectRenderer.c | 22 +- lib_rend/ivas_output_init.c | 108 ++-- lib_rend/ivas_reflections.c | 26 +- lib_rend/ivas_reverb.c | 28 +- lib_rend/ivas_reverb_filter_design.c | 2 +- lib_rend/ivas_reverb_utils.c | 22 +- lib_rend/ivas_rom_rend.c | 70 +-- lib_rend/ivas_stat_rend.h | 2 + lib_rend/lib_rend.c | 566 +++++++++---------- lib_rend/lib_rend.h | 6 +- 47 files changed, 1020 insertions(+), 1017 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index a63d8e9f4b..f991e3d377 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -98,7 +98,7 @@ typedef struct char *outputWavFilename; IVAS_DEC_MODE decMode; int32_t output_Fs; - AUDIO_CONFIG outputConfig; + IVAS_AUDIO_CONFIG outputConfig; bool quietModeEnabled; bool delayCompensationEnabled; bool voipMode; @@ -274,11 +274,11 @@ int main( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { fprintf( stdout, "Output metadata file: %s\n", arg.outputWavFilename ); } - else if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + else if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stdout, "Output synthesis file: %s\n", arg.outputWavFilename ); fprintf( stdout, "Output metadata file: %s\n", arg.outputMdFilename ); @@ -296,7 +296,7 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); @@ -318,9 +318,9 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -342,7 +342,7 @@ int main( if ( arg.enableReferenceRotation ) { /* sanity check */ - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -369,7 +369,7 @@ int main( if ( arg.enableReferenceVectorTracking ) { /* sanity check */ - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -422,9 +422,9 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM + && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -454,17 +454,17 @@ int main( { /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && - arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && - arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB && - arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && - arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && + arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && + arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && + arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && + arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" ); exit( -1 ); } #else - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" ); goto cleanup; @@ -488,7 +488,7 @@ int main( * Configure the decoder *------------------------------------------------------------------------------------------*/ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { arg.enableHeadRotation = true; #ifdef API_5MS_BASELINE @@ -524,7 +524,7 @@ int main( #ifdef API_5MS #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK ) { @@ -687,14 +687,14 @@ int main( /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB && - arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && + arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" ); goto cleanup; } #else - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" ); goto cleanup; @@ -719,7 +719,7 @@ int main( goto cleanup; } - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { @@ -942,10 +942,10 @@ cleanup: * Translate command-line argument to output configuration *---------------------------------------------------------------------*/ -static AUDIO_CONFIG cmdline2config( +static IVAS_AUDIO_CONFIG cmdline2config( char *argv ) { - AUDIO_CONFIG output_config; + IVAS_AUDIO_CONFIG output_config; char argv_to_upper[FILENAME_MAX]; @@ -955,73 +955,73 @@ static AUDIO_CONFIG cmdline2config( if ( strcmp( argv_to_upper, "EXT" ) == 0 ) /* external renderer */ { - output_config = AUDIO_CONFIG_EXTERNAL; + output_config = IVAS_AUDIO_CONFIG_EXTERNAL; } else if ( strcmp( argv_to_upper, "MONO" ) == 0 ) { - output_config = AUDIO_CONFIG_MONO; + output_config = IVAS_AUDIO_CONFIG_MONO; } else if ( strcmp( argv_to_upper, "STEREO" ) == 0 ) { - output_config = AUDIO_CONFIG_STEREO; + output_config = IVAS_AUDIO_CONFIG_STEREO; } else if ( strcmp( argv_to_upper, "5_1" ) == 0 ) { - output_config = AUDIO_CONFIG_5_1; + output_config = IVAS_AUDIO_CONFIG_5_1; } else if ( strcmp( argv_to_upper, "7_1" ) == 0 ) { - output_config = AUDIO_CONFIG_7_1; + output_config = IVAS_AUDIO_CONFIG_7_1; } else if ( strcmp( argv_to_upper, "5_1_2" ) == 0 ) { - output_config = AUDIO_CONFIG_5_1_2; + output_config = IVAS_AUDIO_CONFIG_5_1_2; } else if ( strcmp( argv_to_upper, "5_1_4" ) == 0 ) { - output_config = AUDIO_CONFIG_5_1_4; + output_config = IVAS_AUDIO_CONFIG_5_1_4; } else if ( strcmp( argv_to_upper, "7_1_4" ) == 0 ) { - output_config = AUDIO_CONFIG_7_1_4; + output_config = IVAS_AUDIO_CONFIG_7_1_4; } else if ( strcmp( argv_to_upper, "FOA" ) == 0 ) { - output_config = AUDIO_CONFIG_FOA; + output_config = IVAS_AUDIO_CONFIG_FOA; } else if ( strcmp( argv_to_upper, "HOA2" ) == 0 ) { - output_config = AUDIO_CONFIG_HOA2; + output_config = IVAS_AUDIO_CONFIG_HOA2; } else if ( strcmp( argv_to_upper, "HOA3" ) == 0 ) { - output_config = AUDIO_CONFIG_HOA3; + output_config = IVAS_AUDIO_CONFIG_HOA3; } else if ( strcmp( argv_to_upper, "BINAURAL" ) == 0 ) { - output_config = AUDIO_CONFIG_BINAURAL; + output_config = IVAS_AUDIO_CONFIG_BINAURAL; } #ifdef SPLIT_REND_WITH_HEAD_ROT else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 ) { - output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED; + output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 ) { - output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM; + output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; } #endif else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 ) { - output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR; + output_config = IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR; } else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_REVERB" ) == 0 ) { - output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB; + output_config = IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB; } else { - output_config = AUDIO_CONFIG_LS_CUSTOM; + output_config = IVAS_AUDIO_CONFIG_LS_CUSTOM; } return output_config; @@ -1051,7 +1051,7 @@ static bool parseCmdlIVAS_dec( #endif #endif arg->output_Fs = 48000; - arg->outputConfig = AUDIO_CONFIG_MONO; + arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; @@ -1532,13 +1532,13 @@ static bool parseCmdlIVAS_dec( if ( i < argc - 3 ) { arg->outputConfig = cmdline2config( argv[i] ); - if ( arg->outputConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { arg->customLsOutputEnabled = true; arg->customLsSetupFilename = argv[i]; } i++; - if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != AUDIO_CONFIG_STEREO ) ) + if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) ) { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); @@ -1547,11 +1547,11 @@ static bool parseCmdlIVAS_dec( } else { - arg->outputConfig = AUDIO_CONFIG_MONO; + arg->outputConfig = IVAS_AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_EVS; if ( ( arg->Opt_non_diegetic_pan ) ) { - arg->outputConfig = AUDIO_CONFIG_STEREO; + arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO; } } @@ -1772,7 +1772,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { pFullDelayNumSamples[0] = 0; } @@ -1799,7 +1799,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; @@ -1811,7 +1811,7 @@ static ivas_error initOnFirstGoodFrame( return error; } - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK ) { @@ -1829,7 +1829,7 @@ static ivas_error initOnFirstGoodFrame( } } - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { #endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ @@ -1915,7 +1915,7 @@ static ivas_error initOnFirstGoodFrame( free( zeroBuf ); /* Open other output files if EXT output config - now details about ISM or MASA are known */ - if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK ) { @@ -2372,7 +2372,7 @@ static ivas_error decodeG192( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), @@ -2468,7 +2468,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written, splitRendBits.codec, splitRendBits.pose_correction @@ -2484,7 +2484,7 @@ static ivas_error decodeG192( } else { - if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written, splitRendBits.codec, splitRendBits.pose_correction @@ -2518,7 +2518,7 @@ static ivas_error decodeG192( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { @@ -2680,7 +2680,7 @@ static ivas_error decodeG192( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { @@ -2753,7 +2753,7 @@ static ivas_error decodeG192( } /* Print output metadata file name(s) */ - if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { @@ -3070,7 +3070,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { IVAS_SPLIT_REND_BITS_DATA splitRendBits; @@ -3087,7 +3087,7 @@ static ivas_error decodeG192( } } - if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { #endif if ( delayNumSamples < nOutSamples ) @@ -3109,7 +3109,7 @@ static ivas_error decodeG192( } /* Write MASA/ISM metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM || bsFormat == IVAS_DEC_BS_SBA_ISM ) { @@ -3206,7 +3206,7 @@ static ivas_error decodeG192( } /* Print output metadata file name(s) */ - if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { @@ -3714,7 +3714,7 @@ static ivas_error decodeVoIP( } /* Write ISM metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { int16_t i; @@ -4151,7 +4151,7 @@ static ivas_error decodeVariableSpeed( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) { @@ -4327,7 +4327,7 @@ static ivas_error decodeVariableSpeed( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) { @@ -4401,7 +4401,7 @@ static ivas_error decodeVariableSpeed( } /* Print output metadata file name(s) */ - if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL ) + if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { diff --git a/apps/renderer.c b/apps/renderer.c index 858a9d4150..2c92ca2027 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -113,9 +113,10 @@ typedef struct float lfe_gain_dB; char lfe_routing_mtx[FILENAME_MAX]; } LfeRoutingConfig; + typedef struct { - AUDIO_CONFIG audioConfig; + IVAS_AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; } RendererInput; @@ -145,7 +146,7 @@ typedef struct typedef struct { - AUDIO_CONFIG audioConfig; + IVAS_AUDIO_CONFIG audioConfig; IVAS_CUSTOM_LS_DATA outSetupCustom; } OutputConfig; @@ -400,7 +401,7 @@ static const CmdLnParser_Option cliOptions[] = { static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_Option ); -static AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); +static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs ); @@ -440,7 +441,7 @@ static ivas_error parseLfePanMtxFile( const char *lfeRoutingMatrixFilePath, IVAS static void printSupportedAudioConfigs( void ); -static AUDIO_CONFIG parseAudioConfig( const char *configString ); +static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ); static void convertInputBuffer( const int16_t *intBuffer, const int16_t numIntSamplesPerChannel, const int16_t numFloatSamplesPerChannel, const int16_t numChannels, float *floatBuffer #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -641,7 +642,7 @@ static void setupWithSingleFormatInput( else if ( args.inConfig.numBinBuses != 0 ) { *hhSplitRendFileReadWrite = NULL; - if ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { ivas_error error; error = split_rend_reader_open( hhSplitRendFileReadWrite, args.inMetadataFilePaths[0] ); @@ -667,7 +668,7 @@ static float dBToLin( #ifdef SPLIT_REND_WITH_HEAD_ROT static int16_t get_cldfb_in_flag( - const AUDIO_CONFIG audioConfig, + const IVAS_AUDIO_CONFIG audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig ) { int16_t cldfb_in; @@ -678,7 +679,7 @@ static int16_t get_cldfb_in_flag( #ifdef DEBUGGING cldfb_in = 1; #endif - if ( audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { cldfb_in = 1; } @@ -694,7 +695,7 @@ static int16_t is_split_post_rend_mode( int16_t flag; flag = 0; - if ( args->inConfig.numBinBuses > 0 && ( args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( args->inConfig.numBinBuses > 0 && ( args->inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args->inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { flag = 1; } @@ -708,7 +709,7 @@ static int16_t is_split_pre_rend_mode( int16_t flag; flag = 0; - if ( args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( args->outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || args->outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { flag = 1; } @@ -805,14 +806,14 @@ int main( CmdlnArgs args = parseCmdlnArgs( argc, argv ); - if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == AUDIO_CONFIG_MONO ) || - ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == AUDIO_CONFIG_OBA && args.inConfig.numAudioObjects == 1 ) ) ) + if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_AUDIO_CONFIG_MONO ) || + ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_AUDIO_CONFIG_OBA && args.inConfig.numAudioObjects == 1 ) ) ) { fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" ); exit( -1 ); } - if ( args.nonDiegeticPan && args.outConfig.audioConfig != AUDIO_CONFIG_STEREO ) + if ( args.nonDiegeticPan && args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_STEREO ) { fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" ); exit( -1 ); @@ -906,7 +907,7 @@ int main( } /* Check that there is allowed configuration for MASA format output */ - if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { if ( args.inConfig.numMasaBuses == 0 ) { @@ -925,7 +926,7 @@ int main( #ifdef SPLIT_REND_WITH_HEAD_ROT /*if split renderer is running in post renderer mode*/ - if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) + if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath ); if ( error != IVAS_ERR_OK ) @@ -1046,13 +1047,13 @@ int main( /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) ) + if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) ) { fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split pre-rendering mode is enabled. Exiting. \n" ); exit( -1 ); } #else - if ( ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stderr, "\nExternal Renderer Config is only supported for binaural output configurations. Exiting. \n" ); exit( -1 ); @@ -1076,7 +1077,7 @@ int main( exit( -1 ); } - if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK ) { @@ -1119,7 +1120,7 @@ int main( } /* Set up output custom layout configuration */ - if ( args.outConfig.audioConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK ) { @@ -1128,7 +1129,7 @@ int main( } /* Set up MASA writer for MASA output */ - if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { MasaFileWriter_open( args.outputFilePath, true, &masaWriter ); /* No delay for audio in renderer, so calling metadata writer in delayCompensated mode, i.e., no delay applied to meta */ if ( masaWriter == NULL ) @@ -1171,7 +1172,7 @@ int main( exit( -1 ); } - if ( args.inConfig.multiChannelBuses[i].audioConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK ) { @@ -1238,7 +1239,7 @@ int main( for ( i = 0; i < args.inConfig.numAudioObjects; ++i ) { - if ( ( error = IVAS_REND_AddInput( hIvasRend, AUDIO_CONFIG_OBA, &ismIds[i] ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_AddInput( hIvasRend, IVAS_AUDIO_CONFIG_OBA, &ismIds[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1251,7 +1252,7 @@ int main( } /* With MASA output, all objects are handled at once, so add only one input having all objects in it */ - if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { break; } @@ -1338,7 +1339,7 @@ int main( IVAS_REND_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ); } - if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ); error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outputFilePath, delayNumSamples_temp, delayTimeScale_temp ); @@ -1351,7 +1352,7 @@ int main( } else { - if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { IVAS_REND_GetDelay( hIvasRend, &delayNumSamples_temp, &delayTimeScale_temp ); error = split_rend_writer_open( &hSplitRendFileReadWrite, args.outMetadataFilePath, delayNumSamples_temp, delayTimeScale_temp ); @@ -1743,7 +1744,7 @@ int main( for ( i = 0; i < args.inConfig.numAudioObjects; ++i ) { - if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { if ( i == 0 ) { @@ -1865,8 +1866,8 @@ int main( exit( -1 ); } } - else if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || - args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + else if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = IVAS_REND_GetSplitBinauralBitstream( hIvasRend, outBuffer, &bitsBuffer ) ) != IVAS_ERR_OK ) { @@ -1979,7 +1980,7 @@ int main( #endif /* Write MASA metadata for MASA outputs */ - if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_MASA2 ) { IVAS_REND_AudioConfigType inputType1; IVAS_REND_AudioConfigType inputType2; @@ -2091,7 +2092,7 @@ int main( #endif - if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / IVAS_NUM_FRAMES_PER_SEC / IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } @@ -2175,20 +2176,20 @@ int main( * Local functions *------------------------------------------------------------------------------------------*/ -static AUDIO_CONFIG ambisonicsOrderToEnum( +static IVAS_AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ) { switch ( order ) { case 1: - return AUDIO_CONFIG_FOA; + return IVAS_AUDIO_CONFIG_FOA; case 2: - return AUDIO_CONFIG_HOA2; + return IVAS_AUDIO_CONFIG_HOA2; case 3: - return AUDIO_CONFIG_HOA3; + return IVAS_AUDIO_CONFIG_HOA3; } - return AUDIO_CONFIG_INVALID; + return IVAS_AUDIO_CONFIG_INVALID; } static const CmdLnParser_Option *findOptionById( @@ -2234,46 +2235,46 @@ static bool parseInConfig( } /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ - AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); + IVAS_AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); switch ( audioConfig ) { - case AUDIO_CONFIG_MONO: - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: inConfig->numMultiChannelBuses = 1; inConfig->multiChannelBuses[0].audioConfig = audioConfig; inConfig->multiChannelBuses[0].inputChannelIndex = 0; inConfig->multiChannelBuses[0].gain_dB = 0.0f; break; - case AUDIO_CONFIG_FOA: - case AUDIO_CONFIG_HOA2: - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA3: inConfig->numAmbisonicsBuses = 1; inConfig->ambisonicsBuses[0].audioConfig = audioConfig; inConfig->ambisonicsBuses[0].inputChannelIndex = 0; inConfig->ambisonicsBuses[0].gain_dB = 0.0f; break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: inConfig->numBinBuses = 1; inConfig->binBuses[0].audioConfig = audioConfig; inConfig->binBuses[0].inputChannelIndex = 0; inConfig->binBuses[0].gain_dB = 0.0f; break; #endif - case AUDIO_CONFIG_MASA1: - case AUDIO_CONFIG_MASA2: + case IVAS_AUDIO_CONFIG_MASA1: + case IVAS_AUDIO_CONFIG_MASA2: inConfig->numMasaBuses = 1; inConfig->masaBuses[0].audioConfig = audioConfig; inConfig->masaBuses[0].inputChannelIndex = 0; inConfig->masaBuses[0].gain_dB = 0.0f; break; - case AUDIO_CONFIG_OBA: + case IVAS_AUDIO_CONFIG_OBA: /* If input format is objects, parse the characters after "ISM" to get number of objects */ { char *ptr = NULL; @@ -2297,7 +2298,7 @@ static bool parseInConfig( } } break; - case AUDIO_CONFIG_INVALID: + case IVAS_AUDIO_CONFIG_INVALID: /* This case will be reached if parsing string to AUDIO_CONFIG enum fails. * Try to use the given string as a path to a custom loudspeaker layout file. */ { @@ -2316,7 +2317,7 @@ static bool parseInConfig( return false; } inConfig->numMultiChannelBuses = 1; - inConfig->multiChannelBuses[0].audioConfig = AUDIO_CONFIG_LS_CUSTOM; + inConfig->multiChannelBuses[0].audioConfig = IVAS_AUDIO_CONFIG_LS_CUSTOM; inConfig->multiChannelBuses[0].inputChannelIndex = 0; inConfig->multiChannelBuses[0].gain_dB = 0.0f; } @@ -2343,9 +2344,9 @@ static bool parseOutConfig( outConfig->audioConfig = parseAudioConfig( outputFormatStr ); /* If the string provided is not recognized as a valid output config, * it's expected to be a path to a custom loudspeaker layout description file. */ - if ( outConfig->audioConfig == AUDIO_CONFIG_INVALID ) + if ( outConfig->audioConfig == IVAS_AUDIO_CONFIG_INVALID ) { - outConfig->audioConfig = AUDIO_CONFIG_LS_CUSTOM; + outConfig->audioConfig = IVAS_AUDIO_CONFIG_LS_CUSTOM; if ( ( error = parseCustomLayoutFile( outputFormatStr, &outConfig->outSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while parsing output format option\n" ); @@ -2422,7 +2423,7 @@ static bool parseOrientationTracking( return true; } -static AUDIO_CONFIG parseAudioConfig( +static IVAS_AUDIO_CONFIG parseAudioConfig( const char *configString ) { #ifndef SPLIT_REND_WITH_HEAD_ROT @@ -2439,43 +2440,43 @@ static AUDIO_CONFIG parseAudioConfig( if ( ( strcmp( charBuf, "MONO" ) == 0 ) || ( strcmp( charBuf, "HOA0" ) == 0 ) || ( strcmp( charBuf, "SBA0" ) == 0 ) ) { - return AUDIO_CONFIG_MONO; + return IVAS_AUDIO_CONFIG_MONO; } if ( ( strcmp( charBuf, "STEREO" ) == 0 ) || ( strcmp( charBuf, "CICP2" ) == 0 ) ) { - return AUDIO_CONFIG_STEREO; + return IVAS_AUDIO_CONFIG_STEREO; } if ( ( strcmp( charBuf, "FOA" ) == 0 ) || ( strcmp( charBuf, "SBA1" ) == 0 ) ) { - return AUDIO_CONFIG_FOA; + return IVAS_AUDIO_CONFIG_FOA; } if ( ( strcmp( charBuf, "HOA2" ) == 0 ) || ( strcmp( charBuf, "SBA2" ) == 0 ) ) { - return AUDIO_CONFIG_HOA2; + return IVAS_AUDIO_CONFIG_HOA2; } if ( ( strcmp( charBuf, "HOA3" ) == 0 ) || ( strcmp( charBuf, "SBA3" ) == 0 ) ) { - return AUDIO_CONFIG_HOA3; + return IVAS_AUDIO_CONFIG_HOA3; } if ( ( strcmp( charBuf, "5_1" ) == 0 ) || ( strcmp( charBuf, "CICP6" ) == 0 ) ) { - return AUDIO_CONFIG_5_1; + return IVAS_AUDIO_CONFIG_5_1; } if ( ( strcmp( charBuf, "7_1" ) == 0 ) || ( strcmp( charBuf, "CICP12" ) == 0 ) ) { - return AUDIO_CONFIG_7_1; + return IVAS_AUDIO_CONFIG_7_1; } if ( ( strcmp( charBuf, "5_1_2" ) == 0 ) || ( strcmp( charBuf, "CICP14" ) == 0 ) ) { - return AUDIO_CONFIG_5_1_2; + return IVAS_AUDIO_CONFIG_5_1_2; } if ( ( strcmp( charBuf, "5_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP16" ) == 0 ) ) { - return AUDIO_CONFIG_5_1_4; + return IVAS_AUDIO_CONFIG_5_1_4; } if ( ( strcmp( charBuf, "7_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP19" ) == 0 ) ) { - return AUDIO_CONFIG_7_1_4; + return IVAS_AUDIO_CONFIG_7_1_4; } if ( strncmp( charBuf, "ISM", 3 ) == 0 ) { @@ -2487,7 +2488,7 @@ static AUDIO_CONFIG parseAudioConfig( case '2': case '3': case '4': - return AUDIO_CONFIG_OBA; + return IVAS_AUDIO_CONFIG_OBA; } } if ( strncmp( charBuf, "MASA", 4 ) == 0 ) @@ -2497,36 +2498,36 @@ static AUDIO_CONFIG parseAudioConfig( case '1': fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" ); exit( EXIT_FAILURE ); - /*return AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings + /*return IVAS_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings case '2': - return AUDIO_CONFIG_MASA2; + return IVAS_AUDIO_CONFIG_MASA2; default: - return AUDIO_CONFIG_INVALID; + return IVAS_AUDIO_CONFIG_INVALID; } } if ( strcmp( charBuf, "BINAURAL" ) == 0 ) { - return AUDIO_CONFIG_BINAURAL; + return IVAS_AUDIO_CONFIG_BINAURAL; } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 ) { - return AUDIO_CONFIG_BINAURAL_SPLIT_PCM; + return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; } if ( strcmp( charBuf, "BINAURAL_SPLIT_CODED" ) == 0 ) { - return AUDIO_CONFIG_BINAURAL_SPLIT_CODED; + return IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #endif if ( strcmp( charBuf, "BINAURAL_ROOM_IR" ) == 0 ) { - return AUDIO_CONFIG_BINAURAL_ROOM_IR; + return IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR; } if ( strcmp( charBuf, "BINAURAL_ROOM_REVERB" ) == 0 ) { - return AUDIO_CONFIG_BINAURAL_ROOM_REVERB; + return IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB; } - return AUDIO_CONFIG_INVALID; + return IVAS_AUDIO_CONFIG_INVALID; } static bool parseLfePositionConfig( @@ -2616,7 +2617,7 @@ static bool checkRequiredArgs( fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort ); missingRequiredArg = true; } - if ( args.outConfig.audioConfig == AUDIO_CONFIG_INVALID ) + if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_INVALID ) { tmpOption = findOptionById( CmdLnOptionId_outputFormat ); fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort ); @@ -2647,7 +2648,7 @@ static CmdlnArgs defaultArgs( args.inConfig.numMultiChannelBuses = 0; args.inConfig.numMasaBuses = 0; - args.outConfig.audioConfig = AUDIO_CONFIG_INVALID; + args.outConfig.audioConfig = IVAS_AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; @@ -3438,9 +3439,9 @@ static void parseMc( --inConfig->multiChannelBuses[idx].inputChannelIndex; /* Convert from 1-indexing */ readNextMetadataChunk( line, "\n" ); - AUDIO_CONFIG cfg = parseAudioConfig( line ); + IVAS_AUDIO_CONFIG cfg = parseAudioConfig( line ); /* Try to use the given string as a path to a custom loudspeaker layout file. */ - if ( cfg == AUDIO_CONFIG_INVALID ) + if ( cfg == IVAS_AUDIO_CONFIG_INVALID ) { ivas_error error = parseCustomLayoutFile( line, &inConfig->inSetupCustom ); @@ -3450,7 +3451,7 @@ static void parseMc( exit( -1 ); } inConfig->numMultiChannelBuses = 1; - inConfig->multiChannelBuses[idx].audioConfig = AUDIO_CONFIG_LS_CUSTOM; + inConfig->multiChannelBuses[idx].audioConfig = IVAS_AUDIO_CONFIG_LS_CUSTOM; inConfig->multiChannelBuses[idx].inputChannelIndex = 0; inConfig->multiChannelBuses[idx].gain_dB = 0.0f; } diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 2c90b913b5..f375dcac44 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -2712,7 +2712,7 @@ ivas_error preview_indices( st_ivas->nchan_transport++; k--; } - st_ivas->transport_config = AUDIO_CONFIG_EXTERNAL + st_ivas->nchan_transport; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_EXTERNAL + st_ivas->nchan_transport; st_ivas->ism_mode = ivas_ism_mode_select( st_ivas->nchan_transport, total_brate ); st_ivas->nSCE = st_ivas->nchan_transport; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 9360ffb757..f29e000f9e 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -75,33 +75,33 @@ typedef enum _IVAS_AUDIO_CONFIG { - AUDIO_CONFIG_INVALID, - AUDIO_CONFIG_MONO, /* mono output */ - AUDIO_CONFIG_STEREO, /* stereo output */ - AUDIO_CONFIG_5_1, /* 5.1 speakers layout CICP6 */ - AUDIO_CONFIG_7_1, /* 7.1 speakers layout CICP12 */ - AUDIO_CONFIG_5_1_2, /* 5.1+2 speakers layout CICP14 */ - AUDIO_CONFIG_5_1_4, /* 5.1+4 speakers layout CICP16 */ - AUDIO_CONFIG_7_1_4, /* 7.1+4 speakers layout CICP19 */ - AUDIO_CONFIG_LS_CUSTOM, /* custom loudspeaker layout */ - AUDIO_CONFIG_FOA, /* ambisonics, order 1 */ - AUDIO_CONFIG_HOA2, /* ambisonics, order 2 */ - AUDIO_CONFIG_HOA3, /* ambisonics, order 3 */ - AUDIO_CONFIG_OBA, /* object based audio */ - AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */ - AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */ - AUDIO_CONFIG_BINAURAL_SPLIT_PCM, /* split binaural with PCM coded output */ - AUDIO_CONFIG_BINAURAL_ROOM_IR, /* binaural with BRIR */ - AUDIO_CONFIG_BINAURAL_ROOM_REVERB, /* binaural with HRIR + reverb */ - AUDIO_CONFIG_ISM1, /* ISM1 */ - AUDIO_CONFIG_ISM2, /* ISM2 */ - AUDIO_CONFIG_ISM3, /* ISM3 */ - AUDIO_CONFIG_ISM4, /* ISM4 */ - AUDIO_CONFIG_MASA1, /* MASA1 */ - AUDIO_CONFIG_MASA2, /* MASA2 */ - AUDIO_CONFIG_EXTERNAL /* external renderer */ - -} AUDIO_CONFIG; + IVAS_AUDIO_CONFIG_INVALID, + IVAS_AUDIO_CONFIG_MONO, /* mono output */ + IVAS_AUDIO_CONFIG_STEREO, /* stereo output */ + IVAS_AUDIO_CONFIG_5_1, /* 5.1 speakers layout CICP6 */ + IVAS_AUDIO_CONFIG_7_1, /* 7.1 speakers layout CICP12 */ + IVAS_AUDIO_CONFIG_5_1_2, /* 5.1+2 speakers layout CICP14 */ + IVAS_AUDIO_CONFIG_5_1_4, /* 5.1+4 speakers layout CICP16 */ + IVAS_AUDIO_CONFIG_7_1_4, /* 7.1+4 speakers layout CICP19 */ + IVAS_AUDIO_CONFIG_LS_CUSTOM, /* custom loudspeaker layout */ + IVAS_AUDIO_CONFIG_FOA, /* ambisonics, order 1 */ + IVAS_AUDIO_CONFIG_HOA2, /* ambisonics, order 2 */ + IVAS_AUDIO_CONFIG_HOA3, /* ambisonics, order 3 */ + IVAS_AUDIO_CONFIG_OBA, /* object based audio */ + IVAS_AUDIO_CONFIG_BINAURAL, /* binaural with HRIR */ + IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */ + IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, /* split binaural with PCM coded output */ + IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, /* binaural with BRIR */ + IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB, /* binaural with HRIR + reverb */ + IVAS_AUDIO_CONFIG_ISM1, /* ISM1 */ + IVAS_AUDIO_CONFIG_ISM2, /* ISM2 */ + IVAS_AUDIO_CONFIG_ISM3, /* ISM3 */ + IVAS_AUDIO_CONFIG_ISM4, /* ISM4 */ + IVAS_AUDIO_CONFIG_MASA1, /* MASA1 */ + IVAS_AUDIO_CONFIG_MASA2, /* MASA2 */ + IVAS_AUDIO_CONFIG_EXTERNAL /* external renderer */ + +} IVAS_AUDIO_CONFIG; /*----------------------------------------------------------------------------------* diff --git a/lib_com/delay_comp.c b/lib_com/delay_comp.c index 630493a60f..a8ad216a0e 100644 --- a/lib_com/delay_comp.c +++ b/lib_com/delay_comp.c @@ -102,7 +102,7 @@ int32_t get_delay( delay = IVAS_DEC_DELAY_NS; #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { #endif if ( hCldfb != NULL ) diff --git a/lib_com/ivas_mc_com.c b/lib_com/ivas_mc_com.c index 0001f39704..966fd21a57 100644 --- a/lib_com/ivas_mc_com.c +++ b/lib_com/ivas_mc_com.c @@ -177,19 +177,19 @@ MC_LS_SETUP ivas_mc_map_output_config_to_mc_ls_setup( switch ( output_config ) { - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: mc_ls_setup = MC_LS_SETUP_5_1; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: mc_ls_setup = MC_LS_SETUP_7_1; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: mc_ls_setup = MC_LS_SETUP_5_1_2; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: mc_ls_setup = MC_LS_SETUP_5_1_4; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: mc_ls_setup = MC_LS_SETUP_7_1_4; break; default: @@ -212,24 +212,24 @@ AUDIO_CONFIG ivas_mc_map_ls_setup_to_output_config( ) { AUDIO_CONFIG audio_config; - audio_config = AUDIO_CONFIG_INVALID; + audio_config = IVAS_AUDIO_CONFIG_INVALID; switch ( mc_ls_setup ) { case MC_LS_SETUP_5_1: - audio_config = AUDIO_CONFIG_5_1; + audio_config = IVAS_AUDIO_CONFIG_5_1; break; case MC_LS_SETUP_7_1: - audio_config = AUDIO_CONFIG_7_1; + audio_config = IVAS_AUDIO_CONFIG_7_1; break; case MC_LS_SETUP_5_1_2: - audio_config = AUDIO_CONFIG_5_1_2; + audio_config = IVAS_AUDIO_CONFIG_5_1_2; break; case MC_LS_SETUP_5_1_4: - audio_config = AUDIO_CONFIG_5_1_4; + audio_config = IVAS_AUDIO_CONFIG_5_1_4; break; case MC_LS_SETUP_7_1_4: - audio_config = AUDIO_CONFIG_7_1_4; + audio_config = IVAS_AUDIO_CONFIG_7_1_4; break; default: assert( 0 && "MC loudspeaker setup is not valid!\n" ); diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index cb2f7f5702..a9d8219e19 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -359,23 +359,23 @@ static ivas_error ivas_binRenderer_convModuleOpen( if ( isLoudspeaker ) { - if ( input_config == AUDIO_CONFIG_5_1 ) + if ( input_config == IVAS_AUDIO_CONFIG_5_1 ) { tmp = channelIndex_CICP6[chIdx]; } - else if ( input_config == AUDIO_CONFIG_7_1 ) + else if ( input_config == IVAS_AUDIO_CONFIG_7_1 ) { tmp = channelIndex_CICP12[chIdx]; } - else if ( input_config == AUDIO_CONFIG_5_1_2 ) + else if ( input_config == IVAS_AUDIO_CONFIG_5_1_2 ) { tmp = channelIndex_CICP14[chIdx]; } - else if ( input_config == AUDIO_CONFIG_5_1_4 ) + else if ( input_config == IVAS_AUDIO_CONFIG_5_1_4 ) { tmp = channelIndex_CICP16[chIdx]; } - else if ( input_config == AUDIO_CONFIG_7_1_4 ) + else if ( input_config == IVAS_AUDIO_CONFIG_7_1_4 ) { tmp = channelIndex_CICP19[chIdx]; } @@ -427,7 +427,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( } else { - if ( input_config == AUDIO_CONFIG_HOA3 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { /* HOA3 filter coefficients */ hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA3[bandIdx][chIdx]; @@ -435,7 +435,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA3[bandIdx][chIdx]; hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA3[bandIdx][chIdx]; } - else if ( input_config == AUDIO_CONFIG_HOA2 ) + else if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { /* HOA2 filter coefficients */ hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_HOA2[bandIdx][chIdx]; @@ -443,7 +443,7 @@ static ivas_error ivas_binRenderer_convModuleOpen( hBinRenConvModule->filterTapsRightReal[bandIdx][chIdx] = hHrtf->rightHRIRReal_HOA2[bandIdx][chIdx]; hBinRenConvModule->filterTapsRightImag[bandIdx][chIdx] = hHrtf->rightHRIRImag_HOA2[bandIdx][chIdx]; } - else if ( input_config == AUDIO_CONFIG_FOA ) + else if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { /* FOA filter coefficients */ hBinRenConvModule->filterTapsLeftReal[bandIdx][chIdx] = hHrtf->leftHRIRReal_FOA[bandIdx][chIdx]; @@ -593,7 +593,7 @@ ivas_error ivas_allocate_binaural_hrtf( const int16_t allocate_init_flag /* i : Memory allocation flag */ ) { - if ( input_config == AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA3 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA3 ) { if ( ( HrtfFastConv->leftHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA3 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA3 != NULL ) ) { @@ -620,7 +620,7 @@ ivas_error ivas_allocate_binaural_hrtf( } } - if ( input_config == AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA2 || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_HOA2 ) { if ( ( HrtfFastConv->leftHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->leftHRIRImag_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRReal_HOA2 != NULL ) && ( HrtfFastConv->rightHRIRImag_HOA2 != NULL ) ) { @@ -647,7 +647,7 @@ ivas_error ivas_allocate_binaural_hrtf( } } - if ( input_config == AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) + if ( input_config == IVAS_AUDIO_CONFIG_FOA || bin_input_config == BINAURAL_INPUT_AUDIO_CONFIG_FOA ) { if ( ( HrtfFastConv->leftHRIRReal_FOA != NULL ) && ( HrtfFastConv->leftHRIRImag_FOA != NULL ) && ( HrtfFastConv->rightHRIRReal_FOA != NULL ) && ( HrtfFastConv->rightHRIRImag_FOA != NULL ) ) { @@ -766,23 +766,23 @@ static ivas_error ivas_binaural_hrtf_open( ivas_init_binaural_hrtf( HrtfFastConv ); - if ( input_config == AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) + if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV ) { HrtfFastConv->FASTCONV_HRIR_latency_s = FASTCONV_HRIR_latency_s; } - if ( input_config == AUDIO_CONFIG_HOA2 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { HrtfFastConv->FASTCONV_HOA2_latency_s = FASTCONV_HOA2_latency_s; } - if ( input_config == AUDIO_CONFIG_HOA3 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { HrtfFastConv->FASTCONV_HOA3_latency_s = FASTCONV_HOA3_latency_s; } - if ( input_config == AUDIO_CONFIG_FOA ) + if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { HrtfFastConv->FASTCONV_FOA_latency_s = FASTCONV_FOA_latency_s; } - if ( input_config == AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) + if ( input_config == IVAS_AUDIO_CONFIG_BINAURAL || renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { HrtfFastConv->FASTCONV_BRIR_latency_s = FASTCONV_BRIR_latency_s; } @@ -815,7 +815,7 @@ static ivas_error ivas_binaural_hrtf_open( HrtfFastConv->rightBRIRImag[i][j] = rightBRIRImag[i][j]; } } - if ( input_config == AUDIO_CONFIG_HOA3 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA3 ) { for ( j = 0; j < HOA3_CHANNELS; j++ ) { @@ -825,7 +825,7 @@ static ivas_error ivas_binaural_hrtf_open( HrtfFastConv->rightHRIRImag_HOA3[i][j] = rightHRIRImag_HOA3[i][j]; } } - if ( input_config == AUDIO_CONFIG_HOA2 ) + if ( input_config == IVAS_AUDIO_CONFIG_HOA2 ) { for ( j = 0; j < HOA2_CHANNELS; j++ ) { @@ -835,7 +835,7 @@ static ivas_error ivas_binaural_hrtf_open( HrtfFastConv->rightHRIRImag_HOA2[i][j] = rightHRIRImag_HOA2[i][j]; } } - if ( input_config == AUDIO_CONFIG_FOA ) + if ( input_config == IVAS_AUDIO_CONFIG_FOA ) { for ( j = 0; j < FOA_CHANNELS; j++ ) { @@ -1030,7 +1030,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->hInputSetup->output_config = inConfig; getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); - if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG hBinRenderer->numPoses = pMultiBinPoseData->num_poses + 1; @@ -1101,7 +1101,7 @@ ivas_error ivas_binRenderer_open( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG hBinRenderer->numPoses = st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses + 1; @@ -1158,7 +1158,7 @@ ivas_error ivas_binRenderer_open( IVAS_OUTPUT_SETUP out_setup; /* Allocate memories and buffers needed for convolutional module in CICP19 */ - if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, st_ivas->renderer_type, 1, IVAS_AUDIO_CONFIG_7_1_4, st_ivas->hHrtfFastConv #ifdef SPLIT_REND_WITH_HEAD_ROT , hBinRenderer->numPoses @@ -1168,7 +1168,7 @@ ivas_error ivas_binRenderer_open( return error; } - ivas_output_init( &out_setup, AUDIO_CONFIG_7_1_4 ); + ivas_output_init( &out_setup, IVAS_AUDIO_CONFIG_7_1_4 ); if ( st_ivas->hoa_dec_mtx == NULL ) { @@ -1228,7 +1228,7 @@ ivas_error ivas_binRenderer_open( } /* Allocate memories needed for reverb module */ - if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ), hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hIntSetup.output_config, st_ivas->hDecoderConfig->output_Fs, RENDERER_BINAURAL_FASTCONV, @@ -1626,7 +1626,7 @@ void ivas_binaural_cldfb( } #ifdef SPLIT_REND_WITH_HEAD_ROT /*LFE handling for split rendering cases*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) { @@ -1664,7 +1664,7 @@ void ivas_binaural_cldfb( Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) @@ -1800,8 +1800,8 @@ void ivas_binaural_cldfb_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT /*LFE handling for split rendering cases*/ - if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) { @@ -1840,7 +1840,7 @@ void ivas_binaural_cldfb_sf( Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) diff --git a/lib_dec/ivas_dec.c b/lib_dec/ivas_dec.c index eff9a11c06..f4a84193da 100644 --- a/lib_dec/ivas_dec.c +++ b/lib_dec/ivas_dec.c @@ -135,8 +135,8 @@ ivas_error ivas_dec( } #if defined SPLIT_REND_WITH_HEAD_ROT && !defined( API_5MS ) - if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN assert( ( st_ivas->ivas_format != UNDEFINED_FORMAT && @@ -158,8 +158,8 @@ ivas_error ivas_dec( } #endif #if defined SPLIT_REND_WITH_HEAD_ROT && defined( API_5MS ) - if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { ivas_set_split_rend_ht_setup( &st_ivas->hSplitBinRend, st_ivas->hCombinedOrientationData ); } @@ -347,7 +347,7 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) { @@ -367,7 +367,7 @@ ivas_error ivas_dec( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, + if ( ( error = ivas_rend_crendProcess( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_output, output_Fs #ifdef API_5MS , @@ -654,7 +654,7 @@ ivas_error ivas_dec( } /* external output */ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* sanity check in case of bitrate switching */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) @@ -831,14 +831,14 @@ ivas_error ivas_dec( return error; } } - else if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL && !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 ) + else if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL && !st_ivas->sba_dirac_stereo_flag && nchan_out != 1 ) { if ( ( error = ivas_sba_upmixer_renderer( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) { return error; } } - else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ + else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) /*EXT output = individual objects + HOA3*/ { if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { @@ -892,7 +892,7 @@ ivas_error ivas_dec( } } - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); } @@ -901,7 +901,7 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV || st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ivas_rend_crendProcessSplitBin( st_ivas->hCrendWrapper, st_ivas->intern_config, st_ivas->hOutSetup.output_config, &st_ivas->hSplitBinRend.splitrend.multiBinPoseData, st_ivas->hDecoderConfig, st_ivas->hCombinedOrientationData, &st_ivas->hIntSetup, st_ivas->hEFAPdata, p_output, output_Fs ) ) != IVAS_ERR_OK ) @@ -944,7 +944,7 @@ ivas_error ivas_dec( else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) { @@ -990,7 +990,7 @@ ivas_error ivas_dec( } } - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, output_frame, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); } @@ -999,7 +999,7 @@ ivas_error ivas_dec( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #endif { ivas_binaural_add_LFE( st_ivas, output_frame, p_output, p_output ); @@ -1007,9 +1007,9 @@ ivas_error ivas_dec( } else if ( st_ivas->renderer_type == RENDERER_MC ) { - if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + if ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { - ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); + ivas_ls_setup_conversion( st_ivas, audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); } else { @@ -1023,7 +1023,7 @@ ivas_error ivas_dec( else if ( st_ivas->renderer_type == RENDERER_BINAURAL_OBJECTS_TD ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ObjRenderIvasFrame_splitBinaural( st_ivas, output, output_frame ) ) != IVAS_ERR_OK ) { @@ -1071,7 +1071,7 @@ ivas_error ivas_dec( } /* Rendering */ - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); } @@ -1111,13 +1111,13 @@ ivas_error ivas_dec( } /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ - if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) + if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || + output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || + output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, output, output_frame, n, LFE_CHANNEL ); } - else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) + else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { /* Delay the separated channel to sync with the DirAC rendering */ delay_signal( output[n], output_frame, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC_size ); @@ -1175,7 +1175,7 @@ ivas_error ivas_dec( { ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, output_frame, st_ivas->hOutSetup.ambisonics_order, 0.f ); } - else if ( st_ivas->intern_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 ) ) + else if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_5_1 && ( output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 ) ) { for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) { @@ -1192,8 +1192,8 @@ ivas_error ivas_dec( #if defined( SPLIT_REND_WITH_HEAD_ROT ) && !defined( API_5MS ) /*split rendering process calls*/ - if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { IVAS_DEC_SPLIT_REND_WRAPPER *hSplitBinRend; int16_t max_band; @@ -1205,7 +1205,7 @@ ivas_error ivas_dec( #endif hSplitBinRend = &st_ivas->hSplitBinRend; max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); - pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + pcm_out = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; if ( ( error = ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, st_ivas->hHeadTrackData->Quaternions, st_ivas->hRenderConfig->split_rend_config.splitRendBitRate, st_ivas->hRenderConfig->split_rend_config.codec, hSplitBinRend->hSplitRendBits, hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural, hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural, @@ -1232,7 +1232,7 @@ ivas_error ivas_dec( *----------------------------------------------------------------*/ #if defined API_5MS && defined SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { nchan_out_syn_output = BINAURAL_CHANNELS * st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses; } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 853e51631c..868de1f680 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -202,7 +202,7 @@ static ivas_error ivas_dirac_rend_config( if ( hDirACRend->hOutSetup.ambisonics_order == -1 ) { hDirACRend->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; /* Order 3 is used by default in DirAC for SHD processing */ - if ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_MONO || hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_STEREO ) + if ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_MONO || hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_STEREO ) { hDirACRend->hOutSetup.ambisonics_order = SBA_FOA_ORDER; } @@ -213,7 +213,7 @@ static ivas_error ivas_dirac_rend_config( mvr2r( ls_elevation_4d4, ls_elevation, DIRAC_HOA_RENDERING_NUM_VIRT_DECORR_LS ); } - if ( hDirACRend->hOutSetup.separateChannelEnabled && ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1 || hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_7_1 || hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1_2 || hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1_4 || hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_7_1_4 || ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hLsSetupCustom->separate_ch_found ) ) ) + if ( hDirACRend->hOutSetup.separateChannelEnabled && ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_7_1 || hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1_2 || hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1_4 || hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_7_1_4 || ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hLsSetupCustom->separate_ch_found ) ) ) { /* Remove the channel of the separated signal from the output setup of the spatial synthesis */ hDirACRend->hOutSetup.nchan_out_woLFE--; @@ -233,7 +233,7 @@ static ivas_error ivas_dirac_rend_config( hDirACRend->synthesisConf = DIRAC_SYNTHESIS_PSD_LS; hDirACRend->panningConf = DIRAC_PANNING_VBAP; } - else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_MONO ) + else if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->mc_mode == MC_MODE_MCMASA ) && hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_MONO ) { hDirACRend->synthesisConf = DIRAC_SYNTHESIS_MONO; hDirACRend->panningConf = DIRAC_PANNING_HOA3; @@ -393,7 +393,7 @@ static ivas_error ivas_dirac_rend_config( hDirACRend->num_protos_dir = 2; hDirACRend->proto_index_dir[1] = 1; } - else if ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_MONO ) + else if ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_MONO ) { /* Following the foa rendering for code compatibility */ hDirACRend->num_protos_ambi = 2; @@ -493,8 +493,8 @@ static ivas_error ivas_dirac_rend_config( } else { - initDiffuseResponses( hDirACRend->diffuse_response_function, hDirACRend->num_outputs_dir, AUDIO_CONFIG_FOA, - hDirACRend->hOutSetup, hDirACRend->hOutSetup.ambisonics_order, st_ivas->ivas_format, &hDirACRend->num_ele_spk_no_diffuse_rendering, AUDIO_CONFIG_INVALID ); + initDiffuseResponses( hDirACRend->diffuse_response_function, hDirACRend->num_outputs_dir, IVAS_AUDIO_CONFIG_FOA, + hDirACRend->hOutSetup, hDirACRend->hOutSetup.ambisonics_order, st_ivas->ivas_format, &hDirACRend->num_ele_spk_no_diffuse_rendering, IVAS_AUDIO_CONFIG_INVALID ); } if ( hDirACRend->synthesisConf == DIRAC_SYNTHESIS_PSD_SHD ) @@ -790,7 +790,7 @@ ivas_error ivas_dirac_dec_config( sparfoa_flag = 0; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA && st_ivas->ivas_format == SBA_FORMAT && !hodirac_flag ) { sparfoa_flag = 1; } @@ -2068,7 +2068,7 @@ void ivas_dirac_dec_render_sf( } /* LFE synthesis */ - if ( st_ivas->mc_mode == MC_MODE_MCMASA && !hDirACRend->hOutSetup.separateChannelEnabled && !( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM && hDirACRend->hOutSetup.num_lfe == 0 ) ) + if ( st_ivas->mc_mode == MC_MODE_MCMASA && !hDirACRend->hOutSetup.separateChannelEnabled && !( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && hDirACRend->hOutSetup.num_lfe == 0 ) ) { ivas_lfe_synth_with_cldfb( st_ivas->hMasa->hMasaLfeSynth, Cldfb_RealBuffer, Cldfb_ImagBuffer, @@ -2412,7 +2412,7 @@ void ivas_dirac_dec_render_sf( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) { @@ -2437,7 +2437,7 @@ void ivas_dirac_dec_render_sf( st_ivas->hCombinedOrientationData, subframe_idx, hSpatParamRendCom->subframe_nbslots[subframe_idx], Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) @@ -2496,17 +2496,17 @@ void ivas_dirac_dec_render_sf( idx_lfe = 0; outchannels = hDirACRend->hOutSetup.nchan_out_woLFE + hDirACRend->hOutSetup.num_lfe; - if ( hDirACRend->hOutSetup.separateChannelEnabled && ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1 || - hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_7_1 || - hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1_2 || - hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_5_1_4 || - hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_7_1_4 || - ( hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hLsSetupCustom->separate_ch_found ) ) ) + if ( hDirACRend->hOutSetup.separateChannelEnabled && ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1 || + hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_7_1 || + hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1_2 || + hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_5_1_4 || + hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_7_1_4 || + ( hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hLsSetupCustom->separate_ch_found ) ) ) { outchannels++; } - if ( hDirACRend->hOutSetup.separateChannelEnabled && hDirACRend->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( hDirACRend->hOutSetup.separateChannelEnabled && hDirACRend->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { float tmp_separated[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; float tmp_lfe[L_FRAME48k / MAX_PARAM_SPATIAL_SUBFRAMES]; diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 7c5642a5e9..f2990ac82d 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -79,7 +79,7 @@ static ivas_error ivas_dec_reconfig_split_rend( #endif hSplitRendWrapper = &st_ivas->hSplitBinRend.splitrend; - pcm_out = ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + pcm_out = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; cldfb_in = 0; if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || @@ -226,7 +226,7 @@ static ivas_error ivas_dec_init_split_rend( ivas_error error; int16_t cldfb_in, pcm_out; - pcm_out = ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + pcm_out = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; cldfb_in = 0; if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || @@ -686,7 +686,7 @@ ivas_error ivas_dec_setup( * reconfig split rendering as renderer might change after bitrate switching *-----------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ivas_dec_reconfig_split_rend( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1073,9 +1073,9 @@ ivas_error ivas_init_decoder_front( * Allocate and initialize Binaural Renderer configuration handle *--------------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -1125,11 +1125,11 @@ ivas_error ivas_init_decoder( hDecoderConfig->last_ivas_total_brate = ivas_total_brate; st_ivas->last_active_ivas_total_brate = ivas_total_brate; - if ( output_config == AUDIO_CONFIG_EXTERNAL ) + if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { - hDecoderConfig->nchan_out = audioCfg2channels( AUDIO_CONFIG_HOA3 ); + hDecoderConfig->nchan_out = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); hDecoderConfig->nchan_out += st_ivas->nchan_ism; } else if ( st_ivas->ism_mode == ISM_MASA_MODE_DISC ) @@ -1152,16 +1152,16 @@ ivas_error ivas_init_decoder( ivas_output_init( &( st_ivas->hOutSetup ), output_config ); - if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->hOutSetup.ambisonics_order = SBA_HOA3_ORDER; - st_ivas->intern_config = AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.output_config = AUDIO_CONFIG_HOA3; - st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( AUDIO_CONFIG_HOA3 ); + st_ivas->intern_config = IVAS_AUDIO_CONFIG_HOA3; + st_ivas->hOutSetup.output_config = IVAS_AUDIO_CONFIG_HOA3; + st_ivas->hOutSetup.nchan_out_woLFE = audioCfg2channels( IVAS_AUDIO_CONFIG_HOA3 ); } /* Only initialize transport setup if it is used */ - if ( st_ivas->transport_config != AUDIO_CONFIG_INVALID ) + if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID ) { ivas_output_init( &( st_ivas->hTransSetup ), st_ivas->transport_config ); } @@ -1175,7 +1175,7 @@ ivas_error ivas_init_decoder( ivas_renderer_select( st_ivas ); - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = ivas_ls_custom_output_init( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1189,7 +1189,7 @@ ivas_error ivas_init_decoder( { ivas_mcmasa_set_separate_channel_mode( &( st_ivas->hIntSetup.separateChannelEnabled ), &( st_ivas->hIntSetup.separateChannelIndex ), ivas_total_brate ); - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.separateChannelEnabled ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.separateChannelEnabled ) { st_ivas->hLsSetupCustom->separate_ch_found = 0; if ( st_ivas->hOutSetup.nchan_out_woLFE >= MCMASA_MIN_SPEAKERS_SEPARATE_CENTER ) @@ -1213,7 +1213,7 @@ ivas_error ivas_init_decoder( * Initialize binuaral split rendering *-----------------------------------------------------------------*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( ( error = ivas_dec_init_split_rend( st_ivas ) ) != IVAS_ERR_OK ) { @@ -1247,7 +1247,7 @@ ivas_error ivas_init_decoder( else if ( st_ivas->ivas_format == STEREO_FORMAT ) { st_ivas->nchan_transport = CPE_CHANNELS; - st_ivas->intern_config = AUDIO_CONFIG_STEREO; + st_ivas->intern_config = IVAS_AUDIO_CONFIG_STEREO; st_ivas->nSCE = 0; st_ivas->nCPE = 1; /* in stereo, there is always only one CPE */ @@ -1264,14 +1264,14 @@ ivas_error ivas_init_decoder( } /* init EFAP for custom LS output and set hTransSetup */ - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hOutSetup.ls_azimuth, st_ivas->hOutSetup.ls_elevation, st_ivas->hOutSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { return error; } - ivas_output_init( &( st_ivas->hTransSetup ), AUDIO_CONFIG_STEREO ); + ivas_output_init( &( st_ivas->hTransSetup ), IVAS_AUDIO_CONFIG_STEREO ); } } else if ( st_ivas->ivas_format == ISM_FORMAT ) @@ -1343,7 +1343,7 @@ ivas_error ivas_init_decoder( return error; } - if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) + if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { @@ -1494,7 +1494,7 @@ ivas_error ivas_init_decoder( return error; } - if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) + if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) { if ( ( error = ivas_dirac_dec_config( st_ivas, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { @@ -1688,7 +1688,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->mc_mode == MC_MODE_MCT ) { /* init EFAP for custom LS setup */ - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -1723,7 +1723,7 @@ ivas_error ivas_init_decoder( else if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) { /* init EFAP for custom LS setup */ - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -1763,7 +1763,7 @@ ivas_error ivas_init_decoder( else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { /* init EFAP for custom LS setup */ - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -1823,7 +1823,7 @@ ivas_error ivas_init_decoder( } } - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.separateChannelEnabled && !st_ivas->hLsSetupCustom->separate_ch_found ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.separateChannelEnabled && !st_ivas->hLsSetupCustom->separate_ch_found ) { /* If no speaker matching the separated channel, compute panning gains for the separated channel. */ if ( st_ivas->hVBAPdata == NULL ) @@ -1959,7 +1959,7 @@ ivas_error ivas_init_decoder( return error; } - if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { @@ -2132,7 +2132,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hBinRenderer->render_lfe ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #endif { /* Account for filterbank delay */ @@ -2235,7 +2235,7 @@ ivas_error ivas_init_decoder( if ( st_ivas->hJbmMetadata == NULL ) { - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( error = ivas_jbm_dec_metadata_open( st_ivas ) ) != IVAS_ERR_OK ) { @@ -2876,7 +2876,7 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbSyntheses = st_ivas->hOutSetup.nchan_out_woLFE; } - else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) + else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA ) { *numCldfbSyntheses = st_ivas->hSpar->hFbMixer->fb_cfg->num_out_chans; } @@ -2944,7 +2944,7 @@ void ivas_init_dec_get_num_cldfb_instances( { *numCldfbSyntheses = st_ivas->hOutSetup.nchan_out_woLFE; } - else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) + else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA ) { *numCldfbSyntheses = st_ivas->hSpar->hFbMixer->fb_cfg->num_out_chans; } @@ -2990,7 +2990,7 @@ void ivas_init_dec_get_num_cldfb_instances( assert( 0 && "Renderer not handled for CLDFB reservation." ); } - if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) + if ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) { if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) { @@ -3037,7 +3037,7 @@ static ivas_error doSanityChecks_IVAS( assert( st_ivas->ivas_format != MONO_FORMAT && "\n Wrong IVAS format: MONO" ); /* Verify output configuration compatible with non-diegetic panning */ - if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan && ( st_ivas->ivas_format != MONO_FORMAT ) && ( st_ivas->transport_config != AUDIO_CONFIG_ISM1 ) ) + if ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan && ( st_ivas->ivas_format != MONO_FORMAT ) && ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_ISM1 ) ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Error: Non-diegetic panning not supported in this IVAS format" ); } @@ -3045,7 +3045,7 @@ static ivas_error doSanityChecks_IVAS( /* Verify stereo output configuration */ if ( st_ivas->ivas_format == STEREO_FORMAT ) { - if ( output_config != AUDIO_CONFIG_MONO && output_config != AUDIO_CONFIG_STEREO && output_config != AUDIO_CONFIG_5_1 && output_config != AUDIO_CONFIG_7_1 && output_config != AUDIO_CONFIG_5_1_2 && output_config != AUDIO_CONFIG_5_1_4 && output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Wrong output configuration specified for Stereo!" ); } @@ -3053,7 +3053,7 @@ static ivas_error doSanityChecks_IVAS( else if ( st_ivas->ivas_format == ISM_FORMAT ) { /* Verify ISM output configuration */ - if ( output_config == AUDIO_CONFIG_INVALID ) + if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for ISM" ); } @@ -3061,14 +3061,14 @@ static ivas_error doSanityChecks_IVAS( else if ( st_ivas->ivas_format == SBA_FORMAT ) { /* Verify SBA output coniguration */ - if ( output_config == AUDIO_CONFIG_INVALID ) + if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for SBA" ); } } else if ( st_ivas->ivas_format == MASA_FORMAT ) { - if ( output_config == AUDIO_CONFIG_INVALID ) + if ( output_config == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for MASA!" ); } @@ -3076,14 +3076,14 @@ static ivas_error doSanityChecks_IVAS( else if ( st_ivas->ivas_format == MC_FORMAT ) { /* Verify MC output configuration */ - if ( output_config == AUDIO_CONFIG_INVALID || output_config == AUDIO_CONFIG_EXTERNAL ) + if ( output_config == IVAS_AUDIO_CONFIG_INVALID || output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for Multi-channel" ); } } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) + if ( ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && output_Fs != 48000 ) { return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Error: Only 48kHz output sampling rate is supported for split rendering." ); } @@ -3091,9 +3091,9 @@ static ivas_error doSanityChecks_IVAS( if ( st_ivas->hDecoderConfig->Opt_Headrotation ) { - if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) ) { @@ -3103,7 +3103,7 @@ static ivas_error doSanityChecks_IVAS( if ( st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { - if ( !( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { return IVAS_ERROR( IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED, "Wrong set-up: External orientation not supported in this configuration" ); } @@ -3111,14 +3111,14 @@ static ivas_error doSanityChecks_IVAS( if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration specified for combined MASA and ISM format" ); } } #ifdef DEBUGGING - if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != AUDIO_CONFIG_BINAURAL && output_config != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) + if ( ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) && ( ( st_ivas->ivas_format != MC_FORMAT && st_ivas->ivas_format != ISM_FORMAT ) || ( output_config != IVAS_AUDIO_CONFIG_BINAURAL && output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) || ( st_ivas->ivas_format == ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_PARAM ) || ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode != MC_MODE_MCT ) ) ) { return IVAS_ERROR( IVAS_ERR_INVALID_OUTPUT_FORMAT, "Incorrect output configuration: Time Domain object renderer not supported in this configuration" ); } diff --git a/lib_dec/ivas_ism_dec.c b/lib_dec/ivas_ism_dec.c index 1e90079203..3339b7f463 100644 --- a/lib_dec/ivas_ism_dec.c +++ b/lib_dec/ivas_ism_dec.c @@ -185,9 +185,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( /* Deallocate the ParamISM struct */ ivas_param_ism_dec_close( &( st_ivas->hDirAC ), &( st_ivas->hSpatParamRendCom ), st_ivas->hDecoderConfig->output_config ); - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -204,7 +204,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( { return error; } - if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_config, NULL, st_ivas->hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { @@ -229,7 +229,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( } } - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { /* close the parametric binaural renderer */ #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN @@ -262,9 +262,9 @@ static ivas_error ivas_ism_bitrate_switching_dec( return error; } - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -292,7 +292,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( st_ivas->hHrtfTD = NULL; } - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { ivas_reverb_close( &st_ivas->hReverb ); } @@ -309,7 +309,7 @@ static ivas_error ivas_ism_bitrate_switching_dec( } } - if ( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { /* open the parametric binaural renderer */ if ( ( error = ivas_dirac_dec_binaural_copy_hrtfs( &st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK ) @@ -474,7 +474,7 @@ ivas_error ivas_ism_dec_config( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->hDecoderConfig->nchan_out = st_ivas->nchan_ism; } @@ -504,7 +504,7 @@ ivas_error ivas_ism_dec_config( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { st_ivas->nchan_transport = MAX_PARAM_ISM_WAVE; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { st_ivas->hDecoderConfig->nchan_out = st_ivas->nchan_ism; } @@ -527,19 +527,19 @@ ivas_error ivas_ism_dec_config( switch ( st_ivas->nchan_ism ) { case 1: - st_ivas->transport_config = AUDIO_CONFIG_ISM1; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_ISM1; break; case 2: - st_ivas->transport_config = AUDIO_CONFIG_ISM2; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_ISM2; break; case 3: - st_ivas->transport_config = AUDIO_CONFIG_ISM3; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_ISM3; break; case 4: - st_ivas->transport_config = AUDIO_CONFIG_ISM4; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_ISM4; break; default: - st_ivas->transport_config = AUDIO_CONFIG_INVALID; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; break; } diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 1d76765193..4726e1bfbe 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -387,9 +387,9 @@ static ivas_error ivas_param_ism_rendering_init( } #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN - if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else - if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) #endif { /* computation of proto matrix */ @@ -516,7 +516,7 @@ ivas_error ivas_param_ism_dec_open( *-----------------------------------------------------------------*/ /* hIntSetup and hOutSetup differs only for Binaural rendering */ - if ( output_config == AUDIO_CONFIG_EXTERNAL ) + if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* nchan_out is essential for memory initialization for CLDFB Synthesis */ st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->nchan_ism; @@ -525,7 +525,7 @@ ivas_error ivas_param_ism_dec_open( hOutSetup = st_ivas->hIntSetup; - if ( !( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { /* Initialize Param ISM Rendering handle */ #ifdef API_5MS @@ -549,11 +549,11 @@ ivas_error ivas_param_ism_dec_open( } #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN - if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || - output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else - if ( !( output_config == AUDIO_CONFIG_EXTERNAL || output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || - output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_EXTERNAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || + output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) ) #endif { /* Initialize efap handle */ @@ -573,9 +573,9 @@ ivas_error ivas_param_ism_dec_open( hDirAC->spar_to_dirac_write_idx = 0; #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { if ( ( error = ivas_dirac_allocate_parameters( hSpatParamRendCom, 1 ) ) != IVAS_ERR_OK ) @@ -710,7 +710,7 @@ void ivas_param_ism_dec_close( hDirAC->hParamIsm = NULL; } - if ( !( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) ) + if ( !( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { /* Param ISM Rendering */ if ( hDirAC->hParamIsmRendering->interpolator != NULL ) @@ -748,7 +748,7 @@ void ivas_param_ism_dec_close( if ( hSpatParamRendCom_out != NULL && *hSpatParamRendCom_out != NULL ) { - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { ivas_dirac_deallocate_parameters( *hSpatParamRendCom_out, 1 ); ivas_dirac_deallocate_parameters( *hSpatParamRendCom_out, 2 ); @@ -823,7 +823,7 @@ void ivas_param_ism_dec( output_frame = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); nchan_transport = st_ivas->nchan_transport; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out = st_ivas->nchan_ism; nchan_out_woLFE = nchan_out; @@ -862,7 +862,7 @@ void ivas_param_ism_dec( } /* obtain the direct response using EFAP */ - if ( !( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) ) + if ( !( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) ) { for ( i = 0; i < st_ivas->nchan_ism; i++ ) { @@ -1107,7 +1107,7 @@ void ivas_ism_dec_digest_tc( { mvr2r( st_ivas->hIsmRendererData->gains[i], st_ivas->hIsmRendererData->prev_gains[i], MAX_OUTPUT_CHANNELS ); - if ( st_ivas->intern_config == AUDIO_CONFIG_STEREO ) + if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) { ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, @@ -1191,7 +1191,7 @@ void ivas_param_ism_dec_digest_tc( nchan_transport = st_ivas->nchan_transport; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out = st_ivas->nchan_ism; nchan_out_woLFE = nchan_out; @@ -1231,7 +1231,7 @@ void ivas_param_ism_dec_digest_tc( } /* obtain the direct response using EFAP */ - if ( !( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) ) + if ( !( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) ) { for ( i = 0; i < st_ivas->nchan_ism; i++ ) { @@ -1559,7 +1559,7 @@ void ivas_param_ism_dec_render( assert( hSpatParamRendCom ); #endif nchan_transport = st_ivas->nchan_transport; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out = st_ivas->nchan_ism; nchan_out_woLFE = nchan_out; diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index b8b7fa0a0d..55f9f6d522 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -155,7 +155,7 @@ void ivas_ism_render( for ( i = 0; i < nchan_ism; i++ ) { - if ( st_ivas->intern_config == AUDIO_CONFIG_STEREO ) + if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_STEREO ) { ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, st_ivas->hIsmMetaData[i]->elevation, diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index b0a0754c0a..aef8badfd8 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -201,7 +201,7 @@ ivas_error ivas_jbm_dec_tc( return error; } - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { ivas_jbm_dec_copy_masa_meta_to_buffer( st_ivas ); } @@ -377,7 +377,7 @@ ivas_error ivas_jbm_dec_tc( { ivas_mono_downmix_render_passive( st_ivas, output, output_frame ); } - else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* sanity check in case of bitrate switching */ if ( st_ivas->ism_mode != ISM_MASA_MODE_DISC ) @@ -430,7 +430,7 @@ ivas_error ivas_jbm_dec_tc( } } - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) >= ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) @@ -465,7 +465,7 @@ ivas_error ivas_jbm_dec_tc( /* Rendering */ if ( st_ivas->renderer_type == RENDERER_MC ) { - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { /* HP filtering */ for ( n = 0; n < st_ivas->nchan_transport; n++ ) @@ -475,7 +475,7 @@ ivas_error ivas_jbm_dec_tc( hp20( output[n], output_frame, st_ivas->mem_hp20_out[n], output_Fs ); } } - ivas_ls_setup_conversion( st_ivas, audioCfg2channels( AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); + ivas_ls_setup_conversion( st_ivas, audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ), output_frame, p_output, p_output ); } } } @@ -506,7 +506,7 @@ ivas_error ivas_jbm_dec_tc( } /* Rendering */ - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { ivas_ls_setup_conversion( st_ivas, st_ivas->nchan_transport, output_frame, p_output, p_output ); } @@ -542,13 +542,13 @@ ivas_error ivas_jbm_dec_tc( } /* Delay the separated channel to sync with CLDFB delay of the DirAC synthesis, and synthesize the LFE signal. */ - if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) + if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || + output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || + output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { ivas_lfe_synth_with_filters( st_ivas->hMasa->hMasaLfeSynth, output, output_frame, n, LFE_CHANNEL ); } - else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) + else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { /* Delay the separated channel to sync with the DirAC rendering */ delay_signal( output[n], output_frame, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC, st_ivas->hMasa->hMasaLfeSynth->delayBuffer_syncDirAC_size ); @@ -712,7 +712,7 @@ ivas_error ivas_jbm_dec_feed_tc_to_renderer( if ( st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_BUFFER ) { ivas_jbm_dec_td_renderers_adapt_subframes( st_ivas ); - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { ivas_jbm_masa_sf_to_slot_map( st_ivas, n_render_timeslots ); } @@ -936,7 +936,7 @@ ivas_error ivas_jbm_dec_render( } else if ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM ) { - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, *nSamplesRendered, output_Fs ) ) != IVAS_ERR_OK ) { return error; @@ -1017,7 +1017,7 @@ ivas_error ivas_jbm_dec_render( { int16_t crendInPlaceRotation = FALSE; *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal ); - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) < ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) { @@ -1083,7 +1083,7 @@ ivas_error ivas_jbm_dec_render( } } - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { ivas_mc2sba( st_ivas->hTransSetup, p_output, p_output, *nSamplesRendered, st_ivas->hIntSetup.ambisonics_order, GAIN_LFE ); } @@ -1093,7 +1093,7 @@ ivas_error ivas_jbm_dec_render( { #ifdef SPLIT_REND_WITH_HEAD_ROT /*handled in CLDFB domain already*/ - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #endif { ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_output, p_output ); @@ -1141,7 +1141,7 @@ ivas_error ivas_jbm_dec_render( } ivas_mc2sba( st_ivas->hIntSetup, p_output, p_output, *nSamplesRendered, st_ivas->hOutSetup.ambisonics_order, 0.f ); } - else if ( st_ivas->intern_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 ) ) + else if ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_5_1 && ( output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 ) ) { for ( n = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; n < st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe; n++ ) { @@ -1153,14 +1153,14 @@ ivas_error ivas_jbm_dec_render( /* copy discrete C and TD LFE from internal TC to output */ if ( st_ivas->hOutSetup.separateChannelEnabled ) { - if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) + if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || + output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || + output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) { mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL] + offset, output[LFE_CHANNEL], *nSamplesRendered ); mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); } - else if ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) + else if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { /* Delay the separated channel to sync with the DirAC rendering */ mvr2r( st_ivas->hTcBuffer->tc[LFE_CHANNEL - 1] + offset, output[st_ivas->hOutSetup.separateChannelIndex], *nSamplesRendered ); @@ -1325,7 +1325,7 @@ ivas_error ivas_jbm_dec_flush_renderer( set_f( st_ivas->hIsmRendererData->interpolator, 1.0f, hTcBuffer->n_samples_granularity ); ivas_ism_render_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ); - if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, + if ( ( error = ivas_rend_crendProcessSubframe( st_ivas->hCrendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, st_ivas->hDecoderConfig, NULL, NULL, NULL, st_ivas->hTcBuffer, p_output, p_output, hTcBuffer->n_samples_granularity, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK ) { return error; @@ -1728,7 +1728,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( num_tc = 1; /* Only one channel transported */ } - if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) + if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) { num_tc = CPE_CHANNELS; } @@ -1751,7 +1751,7 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } else if ( st_ivas->ivas_format == MASA_ISM_FORMAT ) { - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( st_ivas->ism_mode == ISM_MASA_MODE_MASA_ONE_OBJ || st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ ) { @@ -1765,18 +1765,18 @@ int16_t ivas_jbm_dec_get_num_tc_channels( } else if ( st_ivas->ivas_format == MC_FORMAT ) { - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { num_tc = 1; } - else if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) + else if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) { num_tc = 2; } else if ( st_ivas->mc_mode == MC_MODE_MCT ) { /* do all static dmx already in the TC decoder if less channels than transported... */ - if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == AUDIO_CONFIG_FOA || st_ivas->intern_config == AUDIO_CONFIG_HOA2 || st_ivas->intern_config == AUDIO_CONFIG_HOA3 ) ) + if ( st_ivas->transport_config != st_ivas->intern_config && ( st_ivas->intern_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->intern_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { if ( ( st_ivas->hTransSetup.nchan_out_woLFE + st_ivas->hTransSetup.num_lfe ) >= ( st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe ) ) @@ -1799,9 +1799,9 @@ int16_t ivas_jbm_dec_get_num_tc_channels( { num_tc++; } - if ( st_ivas->hOutSetup.separateChannelEnabled && ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_5_1_2 || ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) + if ( st_ivas->hOutSetup.separateChannelEnabled && ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || + output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || + output_config == IVAS_AUDIO_CONFIG_5_1_2 || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) { /* LFE is synthesized in TD with the TCs*/ num_tc++; @@ -2361,7 +2361,7 @@ TC_BUFFER_MODE ivas_jbm_dec_get_tc_buffer_mode( } break; case RENDERER_SBA_LINEAR_DEC: - if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { buffer_mode = TC_BUFFER_MODE_BUFFER; } diff --git a/lib_dec/ivas_ls_custom_dec.c b/lib_dec/ivas_ls_custom_dec.c index ef3698ab8c..71e8bd2297 100644 --- a/lib_dec/ivas_ls_custom_dec.c +++ b/lib_dec/ivas_ls_custom_dec.c @@ -82,7 +82,7 @@ void ivas_ls_custom_setup( const LSSETUP_CUSTOM_STRUCT *hLsSetupCustom /* i : Custom loudspeaker setup handle */ ) { - hOutSetup->output_config = AUDIO_CONFIG_LS_CUSTOM; + hOutSetup->output_config = IVAS_AUDIO_CONFIG_LS_CUSTOM; hOutSetup->nchan_out_woLFE = hLsSetupCustom->num_spk; hOutSetup->ls_azimuth = hLsSetupCustom->ls_azimuth; diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 37fe367ef6..9e413bded0 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -379,7 +379,7 @@ ivas_error ivas_masa_decode( hMasa->config.coherencePresent = !hQMetaData->all_coherence_zero; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { index_16bits( hQMetaData, hMasa->data.sph_grid16 ); } @@ -542,7 +542,7 @@ ivas_error ivas_masa_decode( } } - if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT ) && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { create_masa_ext_out_meta( hMasa, hQMetaData, st_ivas->nchan_transport ); } @@ -591,7 +591,7 @@ ivas_error ivas_masa_dec_open( hMasa->config.joinedSubframes = FALSE; /* Create spherical grid only for external output */ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { if ( ( hMasa->data.sph_grid16 = (SPHERICAL_GRID_DATA *) malloc( sizeof( SPHERICAL_GRID_DATA ) ) ) == NULL ) { @@ -636,7 +636,7 @@ ivas_error ivas_masa_dec_open( TC_BUFFER_MODE buffer_mode; buffer_mode = TC_BUFFER_MODE_RENDERER; - if ( st_ivas->mc_mode == MC_MODE_MCMASA && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) ) + if ( st_ivas->mc_mode == MC_MODE_MCMASA && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) ) { buffer_mode = TC_BUFFER_MODE_BUFFER; } @@ -819,7 +819,7 @@ static ivas_error ivas_masa_dec_config( } maxBand--; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { /* need to apply the sampling rate correction also for the EXT output MASA meta buffer */ masa_sample_rate_band_correction( &( hMasa->config ), hMasa->data.band_mapping, st_ivas->hQMetaData, maxBand, 0, hMasa->data.extOutMeta ); @@ -855,7 +855,7 @@ void ivas_masa_prerender( if ( st_ivas->ivas_format == MASA_FORMAT && st_ivas->nchan_transport == 2 && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE ) #endif { - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_EXTERNAL ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { mvr2r( output[0], output[1], output_frame ); /* Copy mono signal to stereo output channels */ } @@ -1020,12 +1020,12 @@ static ivas_error init_lfe_synth_data( set_zero( hMasa->hMasaLfeSynth->lfeToTotalEnergyRatio, MAX_PARAM_SPATIAL_SUBFRAMES ); hMasa->hMasaLfeSynth->lfeGainPrevIndex = 0; if ( st_ivas->hOutSetup.separateChannelEnabled && - ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_7_1 || - output_config == AUDIO_CONFIG_5_1_2 || - output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1_4 || - output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || - output_config == AUDIO_CONFIG_HOA3 || - ( output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) + ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_7_1 || + output_config == IVAS_AUDIO_CONFIG_5_1_2 || + output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || + output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || + output_config == IVAS_AUDIO_CONFIG_HOA3 || + ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe > 0 ) ) ) { int16_t bufferSize; int16_t i; @@ -1083,7 +1083,7 @@ static ivas_error init_lfe_synth_data( hMasa->hMasaLfeSynth->interpolator[i] = ( (float) ( i + 1 ) ) / ( (float) slot_size ); } } - else if ( st_ivas->hOutSetup.separateChannelEnabled && output_config == AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) + else if ( st_ivas->hOutSetup.separateChannelEnabled && output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && st_ivas->hOutSetup.num_lfe == 0 ) { int16_t bufferSize; diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index a85a35b3a5..79257115a4 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -159,19 +159,19 @@ ivas_error ivas_param_mc_dec_open( { hParamMC->synthesis_conf = PARAM_MC_SYNTH_DIRECT; } - else if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { hParamMC->synthesis_conf = PARAM_MC_SYNTH_MONO_STEREO; } else if ( st_ivas->transport_config != output_config ) { - if ( ( output_config != AUDIO_CONFIG_LS_CUSTOM && nchan_out_transport > audioCfg2channels( output_config ) ) || ( output_config == AUDIO_CONFIG_LS_CUSTOM && nchan_out_transport > st_ivas->hOutSetup.nchan_out_woLFE ) ) + if ( ( output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && nchan_out_transport > audioCfg2channels( output_config ) ) || ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM && nchan_out_transport > st_ivas->hOutSetup.nchan_out_woLFE ) ) { hParamMC->synthesis_conf = PARAM_MC_SYNTH_LS_CONV_COV; /* need to reset the intern config */ st_ivas->intern_config = output_config; ivas_output_init( &( st_ivas->hIntSetup ), st_ivas->intern_config ); - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { st_ivas->hIntSetup.nchan_out_woLFE = st_ivas->hLsSetupCustom->num_spk; st_ivas->hIntSetup.ls_azimuth = st_ivas->hLsSetupCustom->ls_azimuth; @@ -1809,7 +1809,7 @@ void ivas_param_mc_dec_render( Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 673d24018f..77c07e7e4a 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -213,7 +213,7 @@ void ivas_mc_paramupmix_dec( output_config = st_ivas->hDecoderConfig->output_config; output_frame = (int16_t) ( output_Fs / FRAMES_PER_SEC ); - if ( ( output_config == AUDIO_CONFIG_STEREO ) || ( output_config == AUDIO_CONFIG_MONO ) ) + if ( ( output_config == IVAS_AUDIO_CONFIG_STEREO ) || ( output_config == IVAS_AUDIO_CONFIG_MONO ) ) { first_empty_channel = 8; /* Don't upmix */ } @@ -314,7 +314,7 @@ void ivas_mc_paramupmix_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT /*LFE handling for split rendering cases*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) { @@ -364,7 +364,7 @@ void ivas_mc_paramupmix_dec( #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( slot_idx = 0; slot_idx < JBM_CLDFB_SLOTS_IN_SUBFRAME; slot_idx++ ) @@ -684,7 +684,7 @@ ivas_error ivas_mc_paramupmix_dec_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for interpolator\n" ) ); } - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { buffer_mode = TC_BUFFER_MODE_BUFFER; nchan_tc = st_ivas->hDecoderConfig->nchan_out; @@ -1112,7 +1112,7 @@ static void ivas_mc_paramupmix_dec_sf( #ifdef SPLIT_REND_WITH_HEAD_ROT /*LFE handling for split rendering cases*/ - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { for ( idx_lfe = 0; idx_lfe < st_ivas->hIntSetup.num_lfe; idx_lfe++ ) { @@ -1158,7 +1158,7 @@ static void ivas_mc_paramupmix_dec_sf( Cldfb_ImagBuffer_subfr ); #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t pos_idx; for ( pos_idx = 0; pos_idx < st_ivas->hBinRenderer->numPoses; pos_idx++ ) diff --git a/lib_dec/ivas_mct_dec.c b/lib_dec/ivas_mct_dec.c index 0271035526..32c1d7d46f 100644 --- a/lib_dec/ivas_mct_dec.c +++ b/lib_dec/ivas_mct_dec.c @@ -205,7 +205,7 @@ ivas_error ivas_mct_dec( ivas_ls_setup_conversion_process_mdct( st_ivas, output ); } - else if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + else if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { float *x_all[MAX_CICP_CHANNELS][NB_DIV]; @@ -1169,9 +1169,9 @@ static ivas_error ivas_mc_dec_reconfig( output_config = st_ivas->hDecoderConfig->output_config; /* binaural renderers*/ - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -1182,9 +1182,9 @@ static ivas_error ivas_mc_dec_reconfig( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) + if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend[0] != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) #else - if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) + if ( ( st_ivas->hCrendWrapper != NULL ) && ( st_ivas->hCrendWrapper->hCrend != NULL ) && ( st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV && st_ivas->renderer_type != RENDERER_BINAURAL_MIXER_CONV_ROOM && ( st_ivas->renderer_type != RENDERER_BINAURAL_OBJECTS_TD || st_ivas->hIntSetup.output_config != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) ) #endif { ivas_rend_closeCrend( &( st_ivas->hCrendWrapper ) @@ -1231,7 +1231,7 @@ static ivas_error ivas_mc_dec_reconfig( return error; } - if ( st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_rend_initCrendWrapper( &st_ivas->hCrendWrapper #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1275,19 +1275,19 @@ static ivas_error ivas_mc_dec_reconfig( } } /* mono/stereo */ - else if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { /* nothing should happen here... */ } /* LS */ - else if ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_LS_CUSTOM ) + else if ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { #ifdef DEBUGGING assert( st_ivas->renderer_type == RENDERER_MC || st_ivas->renderer_type == RENDERER_MC_PARAMMC || st_ivas->renderer_type == RENDERER_DIRAC || st_ivas->renderer_type == RENDERER_DISABLE ); #endif } #ifdef DEBUGGING - else if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) + else if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { /* FOA/HOA output */ /* Nothing to do, renderer is always RENDERER_SBA_LINEAR_ENC */ @@ -1329,7 +1329,7 @@ static ivas_error ivas_mc_dec_reconfig( tc_nchan_allocate_new = 2 * BINAURAL_CHANNELS; tc_nchan_full_new = tc_nchan_allocate_new; } - if ( st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) + if ( st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) { tc_nchan_full_new = 0; } diff --git a/lib_dec/ivas_objectRenderer_internal.c b/lib_dec/ivas_objectRenderer_internal.c index 342cb86539..f8cd69ba70 100644 --- a/lib_dec/ivas_objectRenderer_internal.c +++ b/lib_dec/ivas_objectRenderer_internal.c @@ -229,7 +229,7 @@ ivas_error ivas_td_binaural_renderer_sf( ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->Quaternions : NULL, ( st_ivas->hCombinedOrientationData != NULL ) ? st_ivas->hCombinedOrientationData->listenerPos : NULL ); - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_process( st_ivas->hReverb, st_ivas->transport_config, 0, tc_local, p_reverb_signal, 0 ) ) != IVAS_ERR_OK ) { @@ -249,7 +249,7 @@ ivas_error ivas_td_binaural_renderer_sf( return error; } - if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( st_ivas->hRenderConfig != NULL && st_ivas->hIntSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { /* add reverb to rendered signals */ v_add( reverb_signal[0], output_f_local[0], output_f_local[0], output_frame ); diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index d162ad6c63..3e37c4741c 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -164,8 +164,8 @@ ivas_error ivas_osba_dirac_td_binaural( } #ifdef OSBA_SPLIT_RENDERING - if ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && - st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && + st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #endif { for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -204,8 +204,8 @@ ivas_error ivas_osba_dirac_td_binaural( } #endif #ifdef OSBA_SPLIT_RENDERING - if ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t slot_idx, num_cldfb_bands, b, nchan_transport_orig; float Cldfb_RealBuffer[CLDFB_NO_CHANNELS_MAX]; diff --git a/lib_dec/ivas_out_setup_conversion.c b/lib_dec/ivas_out_setup_conversion.c index f03bb98e31..56ed6b8cce 100644 --- a/lib_dec/ivas_out_setup_conversion.c +++ b/lib_dec/ivas_out_setup_conversion.c @@ -238,19 +238,19 @@ static ivas_error get_ls_conversion_matrix( if ( ( input_config == ls_conversion_mapping[i].input_config ) && ( output_config == ls_conversion_mapping[i].output_config ) ) { /* Special handling for MONO and STEREO downmix */ - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { for ( ch_in = 0, k = 0; ch_in < nchan_in; ch_in++, k++ ) { /* Skip two rows in the matrix for 5.1.x formats */ - if ( ch_in == 6 && ( input_config == AUDIO_CONFIG_5_1_2 || input_config == AUDIO_CONFIG_5_1_4 ) ) + if ( ch_in == 6 && ( input_config == IVAS_AUDIO_CONFIG_5_1_2 || input_config == IVAS_AUDIO_CONFIG_5_1_4 ) ) { k += 2; } for ( ch_out = 0; ch_out < nchan_out; ch_out++ ) { - if ( output_config == AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { hLsSetUpConversion->dmxMtx[ch_in][ch_out] = ls_conversion_cicpX_mono[k][ch_out]; } @@ -314,7 +314,7 @@ ivas_error ivas_ls_setup_conversion_open( int16_t nchan_out; int16_t paramUpmixMonoStereo; - if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMUPMIX && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { paramUpmixMonoStereo = TRUE; } @@ -364,7 +364,7 @@ ivas_error ivas_ls_setup_conversion_open( { if ( paramUpmixMonoStereo == TRUE ) { - inChannels = audioCfg2channels( AUDIO_CONFIG_5_1_2 ); + inChannels = audioCfg2channels( IVAS_AUDIO_CONFIG_5_1_2 ); } else { @@ -413,17 +413,17 @@ ivas_error ivas_ls_setup_conversion_open( hLsSetUpConversion->dmxMtx[chIdx] = NULL; } - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { get_custom_ls_conversion_matrix( st_ivas->hEFAPdata, st_ivas->hTransSetup, st_ivas->hLsSetupCustom, hLsSetUpConversion ); } else { - if ( st_ivas->transport_config != AUDIO_CONFIG_INVALID ) + if ( st_ivas->transport_config != IVAS_AUDIO_CONFIG_INVALID ) { if ( paramUpmixMonoStereo == TRUE ) { - get_ls_conversion_matrix( hLsSetUpConversion, AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); + get_ls_conversion_matrix( hLsSetUpConversion, IVAS_AUDIO_CONFIG_5_1_2, st_ivas->hDecoderConfig->output_config ); } else { diff --git a/lib_dec/ivas_output_config.c b/lib_dec/ivas_output_config.c index 10491211c0..7263381bf5 100644 --- a/lib_dec/ivas_output_config.c +++ b/lib_dec/ivas_output_config.c @@ -79,9 +79,9 @@ void ivas_renderer_select( st_ivas->hCombinedOrientationData->shd_rot_max_order = -1; } - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -89,9 +89,9 @@ void ivas_renderer_select( { if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { - if ( output_config == AUDIO_CONFIG_BINAURAL + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -104,9 +104,9 @@ void ivas_renderer_select( } else /* ISM_MODE_DISC */ { - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -114,7 +114,7 @@ void ivas_renderer_select( if ( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) { *renderer_type = RENDERER_BINAURAL_FASTCONV; - *internal_config = AUDIO_CONFIG_HOA3; /* Render ISM to HOA3 before binauralization*/ + *internal_config = IVAS_AUDIO_CONFIG_HOA3; /* Render ISM to HOA3 before binauralization*/ } else { @@ -135,16 +135,16 @@ void ivas_renderer_select( *renderer_type = RENDERER_BINAURAL_FASTCONV_ROOM; } #endif - *internal_config = AUDIO_CONFIG_7_1_4; + *internal_config = IVAS_AUDIO_CONFIG_7_1_4; } } } else if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT || ( ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) && st_ivas->nchan_transport <= 2 ) ) { *internal_config = output_config; - if ( output_config == AUDIO_CONFIG_BINAURAL + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -157,10 +157,10 @@ void ivas_renderer_select( } else if ( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) { - *internal_config = AUDIO_CONFIG_HOA3; - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + *internal_config = IVAS_AUDIO_CONFIG_HOA3; + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -199,9 +199,9 @@ void ivas_renderer_select( { *internal_config = output_config; - if ( output_config == AUDIO_CONFIG_BINAURAL + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -217,15 +217,15 @@ void ivas_renderer_select( *internal_config = transport_config; #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) #else - if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL || output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { #ifdef DEBUGGING - if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) + if ( ( ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) ) #else - if ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) + if ( ( st_ivas->transport_config == IVAS_AUDIO_CONFIG_5_1 || st_ivas->transport_config == IVAS_AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) #endif { *renderer_type = RENDERER_BINAURAL_OBJECTS_TD; @@ -254,11 +254,11 @@ void ivas_renderer_select( if ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) { /* force HOA3 domain for rotation*/ - *internal_config = AUDIO_CONFIG_HOA3; + *internal_config = IVAS_AUDIO_CONFIG_HOA3; } if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( *renderer_type == RENDERER_BINAURAL_FASTCONV ) ) { - *internal_config = AUDIO_CONFIG_7_1_4; + *internal_config = IVAS_AUDIO_CONFIG_7_1_4; } } } @@ -284,7 +284,7 @@ void ivas_renderer_select( #endif if ( ( st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && ( *renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) ) { - *internal_config = AUDIO_CONFIG_5_1_2; + *internal_config = IVAS_AUDIO_CONFIG_5_1_2; } } } @@ -297,21 +297,21 @@ void ivas_renderer_select( else if ( st_ivas->ivas_format == MONO_FORMAT ) { - if ( output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } } else if ( st_ivas->ivas_format == STEREO_FORMAT ) { - if ( output_config != AUDIO_CONFIG_STEREO && output_config != AUDIO_CONFIG_MONO ) + if ( output_config != IVAS_AUDIO_CONFIG_STEREO && output_config != IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_MC; } } else if ( st_ivas->ivas_format == ISM_FORMAT ) { - if ( ( output_config == AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) + if ( ( output_config == IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->Opt_non_diegetic_pan ) ) { *renderer_type = RENDERER_NON_DIEGETIC_DOWNMIX; } @@ -320,32 +320,32 @@ void ivas_renderer_select( if ( st_ivas->ism_mode == ISM_MODE_PARAM ) { *renderer_type = RENDERER_PARAM_ISM; - if ( output_config == AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_MONO_DOWNMIX; } - else if ( output_config == AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_DISABLE; } - else if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) + else if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; - *internal_config = AUDIO_CONFIG_7_1_4; + *internal_config = IVAS_AUDIO_CONFIG_7_1_4; } } else /* ISM_MODE_DISC */ { *renderer_type = RENDERER_TD_PANNING; - if ( output_config == AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_MONO_DOWNMIX; } - else if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) + else if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; } - else if ( output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { *renderer_type = RENDERER_DISABLE; } @@ -359,60 +359,60 @@ void ivas_renderer_select( ivas_format = ( st_ivas->ivas_format == SBA_ISM_FORMAT && st_ivas->ism_mode == ISM_MODE_NONE ) ? SBA_FORMAT : st_ivas->ivas_format; /* treat ISM_SBA_MODE_NONE just like SBA_FORMAT */ if ( ivas_format == SBA_FORMAT && - ( output_config != AUDIO_CONFIG_5_1 && output_config != AUDIO_CONFIG_5_1_2 && output_config != AUDIO_CONFIG_5_1_4 && output_config != AUDIO_CONFIG_7_1 && output_config != AUDIO_CONFIG_7_1_4 && output_config != AUDIO_CONFIG_LS_CUSTOM && output_config != AUDIO_CONFIG_MONO && output_config != AUDIO_CONFIG_STEREO ) ) + ( output_config != IVAS_AUDIO_CONFIG_5_1 && output_config != IVAS_AUDIO_CONFIG_5_1_2 && output_config != IVAS_AUDIO_CONFIG_5_1_4 && output_config != IVAS_AUDIO_CONFIG_7_1 && output_config != IVAS_AUDIO_CONFIG_7_1_4 && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM && output_config != IVAS_AUDIO_CONFIG_MONO && output_config != IVAS_AUDIO_CONFIG_STEREO ) ) { - if ( output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_FOA ) + if ( output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_FOA ) { *internal_config = output_config; } - else if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { - *internal_config = AUDIO_CONFIG_FOA; + *internal_config = IVAS_AUDIO_CONFIG_FOA; } else { - *internal_config = AUDIO_CONFIG_HOA3; + *internal_config = IVAS_AUDIO_CONFIG_HOA3; } st_ivas->renderer_type = RENDERER_SBA_LINEAR_DEC; } - else if ( ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || - ( ivas_format == SBA_FORMAT && ( output_config == AUDIO_CONFIG_STEREO || output_config == AUDIO_CONFIG_MONO ) ) ) + else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) || + ( ivas_format == SBA_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_STEREO || output_config == IVAS_AUDIO_CONFIG_MONO ) ) ) { *renderer_type = RENDERER_DISABLE; } - else if ( ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) ) + else if ( ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->hDecoderConfig->ivas_total_brate < MASA_STEREO_MIN_BITRATE && st_ivas->hDecoderConfig->ivas_total_brate > IVAS_SID_5k2 ) ) { *renderer_type = RENDERER_DISABLE; } - else if ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_STEREO ) + else if ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_STEREO_PARAMETRIC; } - else if ( ivas_format == MASA_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( ivas_format == MASA_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { *renderer_type = RENDERER_DISABLE; } - else if ( ivas_format == SBA_FORMAT && output_config == AUDIO_CONFIG_MONO ) + else if ( ivas_format == SBA_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_SBA_LINEAR_DEC; } - else if ( ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_STEREO ) + else if ( ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_OSBA_STEREO; } - else if ( ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_MONO ) + else if ( ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_MONO_DOWNMIX; } - else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) ) + else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { *renderer_type = RENDERER_OSBA_AMBI; } - else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == AUDIO_CONFIG_5_1 || output_config == AUDIO_CONFIG_5_1_2 || output_config == AUDIO_CONFIG_5_1_4 || output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_7_1_4 || output_config == AUDIO_CONFIG_LS_CUSTOM ) ) + else if ( ivas_format == SBA_ISM_FORMAT && ( output_config == IVAS_AUDIO_CONFIG_5_1 || output_config == IVAS_AUDIO_CONFIG_5_1_2 || output_config == IVAS_AUDIO_CONFIG_5_1_4 || output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_7_1_4 || output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { *renderer_type = RENDERER_OSBA_LS; } - else if ( ivas_format == SBA_ISM_FORMAT && output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( ivas_format == SBA_ISM_FORMAT && output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { *renderer_type = RENDERER_SBA_LINEAR_DEC; } @@ -421,15 +421,15 @@ void ivas_renderer_select( { *renderer_type = RENDERER_DIRAC; - if ( output_config == AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { *renderer_type = RENDERER_MONO_DOWNMIX; } - else if ( output_config == AUDIO_CONFIG_STEREO ) + else if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { *renderer_type = RENDERER_STEREO_PARAMETRIC; } - else if ( output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { *renderer_type = RENDERER_DISABLE; } @@ -439,7 +439,7 @@ void ivas_renderer_select( *internal_config = transport_config; if ( st_ivas->mc_mode == MC_MODE_MCT && *internal_config != output_config ) { - if ( output_config != AUDIO_CONFIG_FOA && output_config != AUDIO_CONFIG_HOA2 && output_config != AUDIO_CONFIG_HOA3 ) + if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_MC; } @@ -453,7 +453,7 @@ void ivas_renderer_select( *internal_config = transport_config; if ( *internal_config != output_config ) { - if ( output_config != AUDIO_CONFIG_FOA && output_config != AUDIO_CONFIG_HOA2 && output_config != AUDIO_CONFIG_HOA3 ) + if ( output_config != IVAS_AUDIO_CONFIG_FOA && output_config != IVAS_AUDIO_CONFIG_HOA2 && output_config != IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_MC; } @@ -465,7 +465,7 @@ void ivas_renderer_select( } else if ( st_ivas->mc_mode == MC_MODE_PARAMMC ) { - if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) + if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; } @@ -478,13 +478,13 @@ void ivas_renderer_select( { *internal_config = output_config; /* No rendering for 1TC to Mono or Stereo and 2TC to Stereo */ - if ( output_config == AUDIO_CONFIG_MONO || output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO || output_config == IVAS_AUDIO_CONFIG_STEREO ) { if ( st_ivas->nchan_transport == 1 ) { *renderer_type = RENDERER_DISABLE; } - else if ( output_config == AUDIO_CONFIG_STEREO && st_ivas->nchan_transport == 2 && !st_ivas->hOutSetup.separateChannelEnabled ) + else if ( output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->nchan_transport == 2 && !st_ivas->hOutSetup.separateChannelEnabled ) { *renderer_type = RENDERER_DISABLE; } @@ -496,12 +496,12 @@ void ivas_renderer_select( else { *renderer_type = RENDERER_DIRAC; - if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) + if ( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) { *renderer_type = RENDERER_SBA_LINEAR_ENC; *internal_config = transport_config; } - else if ( transport_config == AUDIO_CONFIG_5_1 && ( output_config == AUDIO_CONFIG_7_1 || output_config == AUDIO_CONFIG_5_1_4 ) ) + else if ( transport_config == IVAS_AUDIO_CONFIG_5_1 && ( output_config == IVAS_AUDIO_CONFIG_7_1 || output_config == IVAS_AUDIO_CONFIG_5_1_4 ) ) { *internal_config = transport_config; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 500b95f5e8..80fd9a0be1 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -274,7 +274,7 @@ ivas_error ivas_sba_dec_reconfigure( ivas_binRenderer_close( &st_ivas->hBinRenderer ); } - if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) + if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) { DIRAC_CONFIG_FLAG flag_config; @@ -480,7 +480,7 @@ ivas_error ivas_sba_dec_reconfigure( tc_buffer_mode = TC_BUFFER_MODE_RENDERER; tc_nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); tc_nchan_to_allocate = tc_nchan_tc; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { tc_buffer_mode = TC_BUFFER_MODE_BUFFER; tc_nchan_tc = st_ivas->hDecoderConfig->nchan_out; diff --git a/lib_dec/ivas_sba_dirac_stereo_dec.c b/lib_dec/ivas_sba_dirac_stereo_dec.c index 1497c76dcb..7a9b76c10b 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec.c @@ -65,14 +65,14 @@ int16_t ivas_get_sba_dirac_stereo_flag( { if ( st_ivas->ivas_format == SBA_FORMAT ) { - if ( output_config == AUDIO_CONFIG_STEREO || ( output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) ) + if ( output_config == IVAS_AUDIO_CONFIG_STEREO || ( output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) ) { sba_dirac_stereo_flag = 1; } } else { - if ( st_ivas->nchan_transport == 1 && output_config == AUDIO_CONFIG_STEREO ) + if ( st_ivas->nchan_transport == 1 && output_config == IVAS_AUDIO_CONFIG_STEREO ) { sba_dirac_stereo_flag = 1; } @@ -80,7 +80,7 @@ int16_t ivas_get_sba_dirac_stereo_flag( } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { - if ( output_config == AUDIO_CONFIG_STEREO ) + if ( output_config == IVAS_AUDIO_CONFIG_STEREO ) { sba_dirac_stereo_flag = 1; } diff --git a/lib_dec/ivas_sba_rendering_internal.c b/lib_dec/ivas_sba_rendering_internal.c index aef59a576e..727b7f1409 100644 --- a/lib_dec/ivas_sba_rendering_internal.c +++ b/lib_dec/ivas_sba_rendering_internal.c @@ -539,7 +539,7 @@ ivas_error ivas_sba_linear_renderer( switch ( output_config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: /* If stereo DMX, MONO = W = Cardioids L + R*/ if ( nchan_in == 2 ) { @@ -550,7 +550,7 @@ ivas_error ivas_sba_linear_renderer( } /* else: do nothing, MONO = W*/ break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: assert( ( nchan_in >= 2 ) && "Number of input channels must be at least 2 (for W and Y)!\n" ); /* Compute L and R cardioids from SB format except if stereo DMX is transmitted already in this format*/ @@ -565,23 +565,23 @@ ivas_error ivas_sba_linear_renderer( } } break; - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: ivas_sba_mtx_mult( output_f, output_frame, nchan_hoa, output_setup, hoa_dec_mtx ); break; - case AUDIO_CONFIG_FOA: /* Ambisonics output, order: 1 */ - case AUDIO_CONFIG_HOA2: /* Ambisonics output, order: 2 */ - case AUDIO_CONFIG_HOA3: /* Ambisonics output, order: 3 */ + case IVAS_AUDIO_CONFIG_FOA: /* Ambisonics output, order: 1 */ + case IVAS_AUDIO_CONFIG_HOA2: /* Ambisonics output, order: 2 */ + case IVAS_AUDIO_CONFIG_HOA3: /* Ambisonics output, order: 3 */ for ( i = nchan_hoa; i < output_setup.nchan_out_woLFE; i++ ) { set_zero( output_f[i], output_frame ); } break; - case AUDIO_CONFIG_EXTERNAL: + case IVAS_AUDIO_CONFIG_EXTERNAL: for ( i = output_setup.nchan_out_woLFE - 1; i >= nchan_ism; i-- ) { mvr2r( output_f[i - nchan_ism], output_f[i], output_frame ); diff --git a/lib_dec/ivas_sce_dec.c b/lib_dec/ivas_sce_dec.c index 945a93858a..36ec1386ab 100644 --- a/lib_dec/ivas_sce_dec.c +++ b/lib_dec/ivas_sce_dec.c @@ -380,7 +380,7 @@ ivas_error create_sce_dec( return error; } - if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) ) ) + if ( st_ivas->ivas_format == SBA_FORMAT && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO && st_ivas->nchan_transport == 1 ) ) ) { if ( ( error = openCldfb( &st->cldfbSynHB, CLDFB_SYNTHESIS, st->output_Fs, CLDFB_PROTOTYPE_1_25MS ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index d38953212b..1a16c514cf 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -101,7 +101,7 @@ ivas_error ivas_spar_dec_open( } /* TD decorr. */ - if ( ( st_ivas->ivas_format == SBA_FORMAT ) && ( ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) || ( st_ivas->hDecoderConfig->ivas_total_brate >= IVAS_256k && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA ) ) ) + if ( ( st_ivas->ivas_format == SBA_FORMAT ) && ( ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) || ( st_ivas->hDecoderConfig->ivas_total_brate >= IVAS_256k && st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA ) ) ) { hSpar->hTdDecorr = NULL; } @@ -186,13 +186,13 @@ ivas_error ivas_spar_dec_open( switch ( sba_order_internal ) { case 1: - st_ivas->transport_config = AUDIO_CONFIG_FOA; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_FOA; break; case 2: - st_ivas->transport_config = AUDIO_CONFIG_HOA2; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_HOA2; break; case 3: - st_ivas->transport_config = AUDIO_CONFIG_HOA3; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_HOA3; break; } @@ -233,7 +233,7 @@ ivas_error ivas_spar_dec_open( buffer_mode = TC_BUFFER_MODE_RENDERER; nchan_tc = ivas_jbm_dec_get_num_tc_channels( st_ivas ); nchan_to_allocate = num_channels_internal; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO ) { buffer_mode = TC_BUFFER_MODE_BUFFER; nchan_tc = st_ivas->hDecoderConfig->nchan_out; @@ -1543,7 +1543,7 @@ void ivas_spar_dec_upmixer_sf( *---------------------------------------------------------------------*/ /* set-up pointers */ - if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) + if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) { /* at this point, output channels are used as intermediate procesing buffers */ for ( in_ch = 0; in_ch < MAX_OUTPUT_CHANNELS; in_ch++ ) @@ -1593,7 +1593,7 @@ void ivas_spar_dec_upmixer_sf( } } - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) + if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); } @@ -1602,7 +1602,7 @@ void ivas_spar_dec_upmixer_sf( { md_idx = hSpar->render_to_md_map[ts + slot_idx_start]; ivas_spar_get_parameters( hSpar, hDecoderConfig, md_idx, numch_out, numch_in, num_spar_bands, mixer_mat ); - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) ) ) + if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { for ( spar_band = 0; spar_band < num_spar_bands; spar_band++ ) { @@ -1691,7 +1691,7 @@ void ivas_spar_dec_upmixer_sf( } } - if ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA && hDecoderConfig->output_config != AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) + if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) { ivas_dirac_dec_render_sf( st_ivas, output, nchan_internal, cldfb_in_ts_re, cldfb_in_ts_im ); } @@ -1716,10 +1716,10 @@ void ivas_spar_dec_upmixer_sf( } else { - if ( hDecoderConfig->output_config == AUDIO_CONFIG_FOA || - !( st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA || + !( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) ) { diff --git a/lib_dec/ivas_stereo_mdct_core_dec.c b/lib_dec/ivas_stereo_mdct_core_dec.c index 74dafc3aee..697028c483 100644 --- a/lib_dec/ivas_stereo_mdct_core_dec.c +++ b/lib_dec/ivas_stereo_mdct_core_dec.c @@ -344,7 +344,7 @@ void stereo_mdct_core_dec( ivas_mdct_core_tns_ns( hCPE, fUseTns, tnsData, x, Aq, 0 ); - if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) ) + if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO ) ) { ivas_ls_setup_conversion_process_mdct_param_mc( st_ivas, x ); } diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index b0d224b9c4..179455e801 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -237,8 +237,8 @@ ivas_error IVAS_DEC_Open( st_ivas->codec_mode = 0; /* unknown before first frame */ st_ivas->element_mode_init = EVS_MONO; st_ivas->ivas_format = MONO_FORMAT; - st_ivas->transport_config = AUDIO_CONFIG_INVALID; - st_ivas->intern_config = AUDIO_CONFIG_INVALID; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; + st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->writeFECoffset = 0; return IVAS_ERR_OK; @@ -248,8 +248,8 @@ ivas_error IVAS_DEC_Open( st_ivas->codec_mode = 0; /* unknown before first frame */ st_ivas->element_mode_init = -1; st_ivas->ivas_format = UNDEFINED_FORMAT; - st_ivas->transport_config = AUDIO_CONFIG_INVALID; - st_ivas->intern_config = AUDIO_CONFIG_INVALID; + st_ivas->transport_config = IVAS_AUDIO_CONFIG_INVALID; + st_ivas->intern_config = IVAS_AUDIO_CONFIG_INVALID; st_ivas->renderer_type = RENDERER_DISABLE; st_ivas->ini_frame = 0; st_ivas->ini_active_frame = 0; @@ -282,7 +282,7 @@ static void init_decoder_config( { hDecoderConfig->Opt_AMR_WB = 0; hDecoderConfig->nchan_out = 1; - hDecoderConfig->output_config = AUDIO_CONFIG_INVALID; + hDecoderConfig->output_config = IVAS_AUDIO_CONFIG_INVALID; hDecoderConfig->Opt_LsCustom = 0; hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; @@ -430,8 +430,8 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) || - ( outputConfig == AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) ) + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputConfig == IVAS_AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) || + ( outputConfig == IVAS_AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) ) { return IVAS_ERR_WRONG_MODE; } @@ -441,7 +441,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig = st_ivas->hDecoderConfig; hDecoderConfig->output_config = outputConfig; - if ( hDecoderConfig->output_config == AUDIO_CONFIG_INVALID ) + if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERR_WRONG_PARAMS; } @@ -454,7 +454,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = 1; } - if ( outputConfig != AUDIO_CONFIG_EXTERNAL && outputConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( outputConfig != IVAS_AUDIO_CONFIG_EXTERNAL && outputConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } @@ -597,7 +597,7 @@ ivas_error IVAS_DEC_EnableVoIP( hDecoderConfig->voip_active = 1; #endif - if ( hDecoderConfig->output_config != AUDIO_CONFIG_EXTERNAL ) + if ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } @@ -1149,7 +1149,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelCacheSize = 0; } - if ( output_config != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && output_config != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { return IVAS_ERR_WRONG_PARAMS; } @@ -1215,7 +1215,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( pOutput[i] = output[i]; } max_band = (int16_t) ( ( BINAURAL_MAXBANDS * output_Fs ) / 48000 ); - pcm_out = ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; + pcm_out = ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0; td_input = st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC && st_ivas->renderer_type != RENDERER_BINAURAL_PARAMETRIC_ROOM && st_ivas->renderer_type != RENDERER_STEREO_PARAMETRIC; error = ivas_renderMultiBinToSplitBinaural( &hSplitBinRend->splitrend, @@ -2231,7 +2231,7 @@ ivas_error IVAS_DEC_FeedRenderConfig( hRenderConfig->split_rend_config.poseCorrectionMode = IVAS_SPLIT_REND_POSE_CORRECTION_MODE_NONE; } - if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasDec->st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -3347,73 +3347,73 @@ static ivas_error get_channel_config( AUDIO_CONFIG config, char *str ) { - if ( config == AUDIO_CONFIG_MONO ) + if ( config == IVAS_AUDIO_CONFIG_MONO ) { strcpy( str, "Mono" ); } - else if ( config == AUDIO_CONFIG_STEREO ) + else if ( config == IVAS_AUDIO_CONFIG_STEREO ) { strcpy( str, "Stereo" ); } - else if ( config == AUDIO_CONFIG_5_1 ) + else if ( config == IVAS_AUDIO_CONFIG_5_1 ) { strcpy( str, "Multichannel 5.1 (CICP6)" ); } - else if ( config == AUDIO_CONFIG_7_1 ) + else if ( config == IVAS_AUDIO_CONFIG_7_1 ) { strcpy( str, "Multichannel 7.1 (CICP12)" ); } - else if ( config == AUDIO_CONFIG_5_1_2 ) + else if ( config == IVAS_AUDIO_CONFIG_5_1_2 ) { strcpy( str, "Multichannel 5.1+2 (CICP14)" ); } - else if ( config == AUDIO_CONFIG_5_1_4 ) + else if ( config == IVAS_AUDIO_CONFIG_5_1_4 ) { strcpy( str, "Multichannel 5.1+4 (CICP16)" ); } - else if ( config == AUDIO_CONFIG_7_1_4 ) + else if ( config == IVAS_AUDIO_CONFIG_7_1_4 ) { strcpy( str, "Multichannel 7.1+4 (CICP19)" ); } - else if ( config == AUDIO_CONFIG_LS_CUSTOM ) + else if ( config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { strcpy( str, "Multichannel (custom loudspeaker layout)" ); } - else if ( config == AUDIO_CONFIG_FOA ) + else if ( config == IVAS_AUDIO_CONFIG_FOA ) { strcpy( str, "Ambisonics: First Order (FOA)" ); } - else if ( config == AUDIO_CONFIG_HOA2 ) + else if ( config == IVAS_AUDIO_CONFIG_HOA2 ) { strcpy( str, "Ambisonics: Second Order (HOA2)" ); } - else if ( config == AUDIO_CONFIG_HOA3 ) + else if ( config == IVAS_AUDIO_CONFIG_HOA3 ) { strcpy( str, "Ambisonics: Third Order (HOA3)" ); } - else if ( config == AUDIO_CONFIG_BINAURAL ) + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL ) { strcpy( str, "Binaural: no room" ); } - else if ( config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { strcpy( str, "Binaural: room with impulse responses" ); } - else if ( config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { strcpy( str, "Binaural: room with reverb" ); } #ifdef SPLIT_REND_WITH_HEAD_ROT - else if ( config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { strcpy( str, "BINAURAL_SPLIT_CODED" ); } - else if ( config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + else if ( config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { strcpy( str, "Binaural_Split_PCM" ); } #endif - else if ( config == AUDIO_CONFIG_EXTERNAL ) + else if ( config == IVAS_AUDIO_CONFIG_EXTERNAL ) { strcpy( str, "External renderer" ); } @@ -4333,7 +4333,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) { *audio_config = st_ivas->hSplitBinRend.hCldfbDataOut->config; - if ( st_ivas->hSplitBinRend.hCldfbDataOut->config != AUDIO_CONFIG_INVALID ) + if ( st_ivas->hSplitBinRend.hCldfbDataOut->config != IVAS_AUDIO_CONFIG_INVALID ) { num_chs = audioCfg2channels( st_ivas->hSplitBinRend.hCldfbDataOut->config ); maxBand = (int16_t) ( ( CLDFB_NO_CHANNELS_MAX * st_ivas->hDecoderConfig->output_Fs ) / 48000 ); @@ -4354,7 +4354,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( } else { - *audio_config = AUDIO_CONFIG_INVALID; + *audio_config = IVAS_AUDIO_CONFIG_INVALID; } *nOutSamples = num_samples; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index fa76331d7d..b84574223e 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -132,7 +132,7 @@ ivas_error IVAS_DEC_Open( ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ - const AUDIO_CONFIG outputConfig, /* i : audio configuration */ + const IVAS_AUDIO_CONFIG outputConfig, /* i : audio configuration */ #ifdef API_5MS const int16_t tsmEnabled, /* i : enable TSM */ const int16_t enable5ms, /* i : enable 5ms rendering path */ @@ -209,7 +209,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ float *out_real, /* o : buffer for decoded PCM real output in CLDFB domain */ float *out_imag, /* o : buffer for decoded PCM imag output in CLDFB domain */ - AUDIO_CONFIG *audio_config, /* o : audio configuration */ + IVAS_AUDIO_CONFIG *audio_config, /* o : audio configuration */ int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ ); #endif diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index c1c8b047e8..9db5df379e 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -1062,7 +1062,7 @@ ivas_error IVAS_ENC_GetDelay( } #ifdef SPLIT_REND_WITH_HEAD_ROT - *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, AUDIO_CONFIG_INVALID ) ); + *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL, IVAS_AUDIO_CONFIG_INVALID ) ); #else *delay = NS2SA( hEncoderConfig->input_Fs, get_delay( ENC, hEncoderConfig->input_Fs, hEncoderConfig->ivas_format, NULL ) ); #endif diff --git a/lib_rend/ivas_allrad_dec.c b/lib_rend/ivas_allrad_dec.c index fc840755aa..a7d915cf01 100644 --- a/lib_rend/ivas_allrad_dec.c +++ b/lib_rend/ivas_allrad_dec.c @@ -123,11 +123,11 @@ ivas_error ivas_sba_get_hoa_dec_matrix( } } - if ( hOutSetup.output_config == AUDIO_CONFIG_MONO ) + if ( hOutSetup.output_config == IVAS_AUDIO_CONFIG_MONO ) { ( *hoa_dec_mtx )[0] = 1.f; } - else if ( hOutSetup.output_config == AUDIO_CONFIG_STEREO ) + else if ( hOutSetup.output_config == IVAS_AUDIO_CONFIG_STEREO ) { ( *hoa_dec_mtx )[0] = 0.5f; ( *hoa_dec_mtx )[1] = 0.5f; diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index 6c0ca0e73a..8a0518a721 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -175,9 +175,9 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported input config in Crend" ); } - if ( outConfig != AUDIO_CONFIG_BINAURAL && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM + && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -212,7 +212,7 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz; @@ -227,7 +227,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_48kHz[j]; hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_48kHz[j]; @@ -245,7 +245,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz; @@ -260,7 +260,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_32kHz[j]; hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_32kHz[j]; @@ -278,7 +278,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz; @@ -293,7 +293,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations_diffuse[j] = CRendBin_Combined_BRIR_num_iterations_diffuse_16kHz[j]; hHrtf->pIndex_frequency_max_diffuse[j] = CRendBin_Combined_BRIR_pIndex_frequency_max_diffuse_16kHz[j]; @@ -316,23 +316,23 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( inConfig == AUDIO_CONFIG_5_1 ) + if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) { tmp = channelIndex_CICP6[i]; } - else if ( inConfig == AUDIO_CONFIG_7_1 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) { tmp = channelIndex_CICP12[i]; } - else if ( inConfig == AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) { tmp = channelIndex_CICP14[i]; } - else if ( inConfig == AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) { tmp = channelIndex_CICP16[i]; } - else if ( inConfig == AUDIO_CONFIG_7_1_4 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_7_1_4 ) { tmp = channelIndex_CICP19[i]; } @@ -343,7 +343,7 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; } @@ -354,7 +354,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_48kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_48kHz[tmp][j]; @@ -372,7 +372,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; } @@ -383,7 +383,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_32kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_32kHz[tmp][j]; @@ -401,7 +401,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; } @@ -412,7 +412,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations[i][j] = CRendBin_Combined_BRIR_num_iterations_16kHz[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = CRendBin_Combined_BRIR_pIndex_frequency_max_16kHz[tmp][j]; @@ -436,7 +436,7 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) { - if ( inConfig == AUDIO_CONFIG_HOA3 ) + if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { if ( output_Fs == 48000 ) { @@ -523,7 +523,7 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); } } - else if ( inConfig == AUDIO_CONFIG_HOA2 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) { if ( output_Fs == 48000 ) { @@ -610,7 +610,7 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INVALID_SAMPLING_RATE, "Encountered Unsupported sampling rate in Crend" ); } } - else if ( inConfig == AUDIO_CONFIG_FOA ) + else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { if ( output_Fs == 48000 ) { @@ -714,7 +714,7 @@ static ivas_error ivas_rend_initCrend( hHrtf->max_num_ir -= 1; /* subtract LFE */ hHrtf->gain_lfe = GAIN_LFE; - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_brir_combined->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_brir_combined->max_num_iterations; @@ -729,7 +729,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations_diffuse[j]; hHrtf->pIndex_frequency_max_diffuse[j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max_diffuse[j]; @@ -747,23 +747,23 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( inConfig == AUDIO_CONFIG_5_1 ) + if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) { tmp = channelIndex_CICP6[i]; } - else if ( inConfig == AUDIO_CONFIG_7_1 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) { tmp = channelIndex_CICP12[i]; } - else if ( inConfig == AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) { tmp = channelIndex_CICP14[i]; } - else if ( inConfig == AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) { tmp = channelIndex_CICP16[i]; } - else if ( inConfig == AUDIO_CONFIG_7_1_4 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_7_1_4 ) { tmp = channelIndex_CICP19[i]; } @@ -772,7 +772,7 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error: Channel configuration not specified!\n\n" ); } - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[tmp]; } @@ -783,7 +783,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->num_iterations[i][j] = hSetOfHRTF->hHRTF_brir_combined->num_iterations[tmp][j]; hHrtf->pIndex_frequency_max[i][j] = hSetOfHRTF->hHRTF_brir_combined->pIndex_frequency_max[tmp][j]; @@ -802,7 +802,7 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) { - if ( inConfig == AUDIO_CONFIG_HOA3 ) + if ( inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; @@ -828,7 +828,7 @@ static ivas_error ivas_rend_initCrend( hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa3->pOut_to_bin_diffuse_im[j]; } } - else if ( inConfig == AUDIO_CONFIG_HOA2 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_HOA2 ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; @@ -854,7 +854,7 @@ static ivas_error ivas_rend_initCrend( hHrtf->pOut_to_bin_diffuse_im[j] = hSetOfHRTF->hHRTF_hrir_hoa2->pOut_to_bin_diffuse_im[j]; } } - else if ( inConfig == AUDIO_CONFIG_FOA ) + else if ( inConfig == IVAS_AUDIO_CONFIG_FOA ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; @@ -1051,7 +1051,7 @@ static ivas_error ivas_er_init_handle( return IVAS_ERR_WRONG_PARAMS; } - reflections->audio_config = AUDIO_CONFIG_INVALID; + reflections->audio_config = IVAS_AUDIO_CONFIG_INVALID; reflections->use_er = 0; reflections->is_ready = 0; reflections->circ_len = 0; @@ -1318,7 +1318,7 @@ ivas_error ivas_rend_openCrend( hCrend->lfe_delay_line = NULL; } - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &( hCrend->hReverb ), inConfig, ( *pCrend )->hHrtfCrend, NULL, hRendCfg, output_Fs ) ) != IVAS_ERR_OK ) { @@ -1577,7 +1577,7 @@ static ivas_error ivas_rend_crendConvolver( lfe_idx_in = -1; if ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { lfe_idx_in = LFE_CHANNEL; } @@ -1807,7 +1807,7 @@ ivas_error ivas_rend_crendProcess( MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL SBA SPAR -> BINAURAL or BINAURAL_ROOM */ - if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 ) + if ( inConfig == IVAS_AUDIO_CONFIG_FOA || inConfig == IVAS_AUDIO_CONFIG_HOA2 || inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { rotateFrame_shd( hCombinedOrientationData, output, subframe_len, *hIntSetup, subframe_idx ); } @@ -1980,7 +1980,7 @@ ivas_error ivas_rend_crendProcessSubframe( MC with elevation (5_1_2 / 5_1_4 / 7_1_4) -> BINAURAL SBA SPAR -> BINAURAL or BINAURAL_ROOM */ - if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 ) + if ( inConfig == IVAS_AUDIO_CONFIG_FOA || inConfig == IVAS_AUDIO_CONFIG_HOA2 || inConfig == IVAS_AUDIO_CONFIG_HOA3 ) { rotateFrame_shd( hCombinedOrientationData, tc_local, subframe_len, *hIntSetup, 0 ); } diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 69d40c4a17..7701871fdb 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -929,7 +929,7 @@ static void ivas_dirac_dec_binaural_internal( pMultiBinPoseData = &st_ivas->hSplitBinRend.splitrend.multiBinPoseData; #ifdef FIX_658_SPLIT_REND_MASA - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else if ( pMultiBinPoseData != NULL && pMultiBinPoseData->num_poses > 1 ) #endif @@ -3265,7 +3265,7 @@ void ivas_omasa_preProcessStereoTransportsForMovedObjects( hSpatParamRendCom = st_ivas->hSpatParamRendCom; hMasaIsmData = st_ivas->hMasaIsmData; - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_FOA || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_HOA2 || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_HOA3 ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_FOA || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) { enableCentering = 0; } diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 326930e0db..facae861ac 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -950,15 +950,15 @@ void initDiffuseResponses( int16_t i, l, k, idx, num_horizontal_speakers; *num_ele_spk_no_diffuse_rendering = 0; - if ( output_config == AUDIO_CONFIG_MONO ) + if ( output_config == IVAS_AUDIO_CONFIG_MONO ) { diffuse_response_function[0] = 1.0f; diffuse_response_function[1] = inv_sqrt( 3.0f ); } - else if ( !( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 ) ) + else if ( !( output_config == IVAS_AUDIO_CONFIG_FOA || output_config == IVAS_AUDIO_CONFIG_HOA2 || output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { /* set diffuse response function */ - if ( ivas_format == MC_FORMAT && ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) && output_config == AUDIO_CONFIG_5_1_4 ) + if ( ivas_format == MC_FORMAT && ( transport_config == IVAS_AUDIO_CONFIG_5_1 || transport_config == IVAS_AUDIO_CONFIG_7_1 ) && output_config == IVAS_AUDIO_CONFIG_5_1_4 ) { num_horizontal_speakers = num_channels - NUM_ELEVATED_SPEAKERS; @@ -966,7 +966,7 @@ void initDiffuseResponses( set_zero( &diffuse_response_function[num_horizontal_speakers], NUM_ELEVATED_SPEAKERS ); *num_ele_spk_no_diffuse_rendering = NUM_ELEVATED_SPEAKERS; } - else if ( ivas_format == MC_FORMAT && ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) && output_config == AUDIO_CONFIG_7_1_4 ) + else if ( ivas_format == MC_FORMAT && ( transport_config == IVAS_AUDIO_CONFIG_5_1 || transport_config == IVAS_AUDIO_CONFIG_7_1 ) && output_config == IVAS_AUDIO_CONFIG_7_1_4 ) { num_horizontal_speakers = num_channels - NUM_ELEVATED_SPEAKERS; @@ -974,21 +974,21 @@ void initDiffuseResponses( set_zero( &diffuse_response_function[num_horizontal_speakers], NUM_ELEVATED_SPEAKERS ); *num_ele_spk_no_diffuse_rendering = NUM_ELEVATED_SPEAKERS; } - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1 && num_channels == 5 ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == IVAS_AUDIO_CONFIG_5_1 && num_channels == 5 ) { mvr2r( diffuse_response_CICP6, diffuse_response_function, num_channels ); } - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == AUDIO_CONFIG_5_1_2 && num_channels == 7 ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && output_config == IVAS_AUDIO_CONFIG_5_1_2 && num_channels == 7 ) { mvr2r( diffuse_response_CICP14, diffuse_response_function, num_channels ); } - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == IVAS_AUDIO_CONFIG_5_1_4 ) && ( num_channels == 9 ) ) { mvr2r( diffuse_response_CICP16, diffuse_response_function, num_channels ); } - else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == AUDIO_CONFIG_LS_CUSTOM ) ) + else if ( ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT || ivas_format == MC_FORMAT ) && ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { - if ( transport_config == AUDIO_CONFIG_5_1 || transport_config == AUDIO_CONFIG_7_1 ) + if ( transport_config == IVAS_AUDIO_CONFIG_5_1 || transport_config == IVAS_AUDIO_CONFIG_7_1 ) { /* Detect loudspeakers with elevation */ for ( i = 0, num_horizontal_speakers = 0; i < num_channels; i++ ) diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index 43a91b3489..671cf56893 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -106,7 +106,7 @@ ivas_error ivas_mcmasa_ana_open( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for McMasa\n" ) ); } - if ( inConfig == AUDIO_CONFIG_5_1 ) + if ( inConfig == IVAS_AUDIO_CONFIG_5_1 ) { nchan_inp = 6; mvr2r( ls_azimuth_CICP6, ls_azimuth, nchan_inp - 1 ); @@ -114,7 +114,7 @@ ivas_error ivas_mcmasa_ana_open( hMcMasa->numHorizontalChannels = 5; hMcMasa->isHorizontalSetup = 1; } - else if ( inConfig == AUDIO_CONFIG_7_1 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_7_1 ) { nchan_inp = 8; mvr2r( ls_azimuth_CICP12, ls_azimuth, nchan_inp - 1 ); @@ -122,7 +122,7 @@ ivas_error ivas_mcmasa_ana_open( hMcMasa->numHorizontalChannels = 7; hMcMasa->isHorizontalSetup = 1; } - else if ( inConfig == AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_2 ) { nchan_inp = 8; mvr2r( ls_azimuth_CICP14, ls_azimuth, nchan_inp - 1 ); @@ -130,7 +130,7 @@ ivas_error ivas_mcmasa_ana_open( hMcMasa->numHorizontalChannels = 5; hMcMasa->isHorizontalSetup = 0; } - else if ( inConfig == AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) { nchan_inp = 10; mvr2r( ls_azimuth_CICP16, ls_azimuth, nchan_inp - 1 ); diff --git a/lib_rend/ivas_objectRenderer.c b/lib_rend/ivas_objectRenderer.c index e50b625e4c..a68f8e2aa5 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -126,7 +126,7 @@ ivas_error ivas_td_binaural_open_unwrap( PosType = TDREND_POSTYPE_ABSOLUTE; /* or TDREND_POSTYPE_RELATIVE_TO_LISTENER */ nchan_rend = nchan_transport; - if ( ( ivas_format == MC_FORMAT ) && ( transport_config != AUDIO_CONFIG_LS_CUSTOM ) ) + if ( ( ivas_format == MC_FORMAT ) && ( transport_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) ) { nchan_rend--; /* Skip LFE channel -- added to the others */ } @@ -143,27 +143,27 @@ ivas_error ivas_td_binaural_open_unwrap( { switch ( transport_config ) { - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: ls_azimuth = ls_azimuth_CICP6; ls_elevation = ls_elevation_CICP6; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: ls_azimuth = ls_azimuth_CICP12; ls_elevation = ls_elevation_CICP12; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: ls_azimuth = ls_azimuth_CICP14; ls_elevation = ls_elevation_CICP14; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: ls_azimuth = ls_azimuth_CICP16; ls_elevation = ls_elevation_CICP16; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: ls_azimuth = ls_azimuth_CICP19; ls_elevation = ls_elevation_CICP19; break; - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: ls_azimuth = hTransSetup.ls_azimuth; ls_elevation = hTransSetup.ls_elevation; break; @@ -598,7 +598,7 @@ ivas_error ivas_td_binaural_open_ext( float *directivity = NULL; - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_transport ) ) != IVAS_ERR_OK ) { @@ -616,7 +616,7 @@ ivas_error ivas_td_binaural_open_ext( hTransSetup.ls_azimuth = NULL; hTransSetup.ls_elevation = NULL; - if ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { hTransSetup.ls_azimuth = customLsInput->ls_azimuth; hTransSetup.ls_elevation = customLsInput->ls_elevation; @@ -680,7 +680,7 @@ ivas_error ivas_td_binaural_renderer_ext( { ivas_format = MC_FORMAT; transport_config = inConfig; - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &num_src ) ) != IVAS_ERR_OK ) { @@ -697,7 +697,7 @@ ivas_error ivas_td_binaural_renderer_ext( { ivas_format = ISM_FORMAT; num_src = 1; - transport_config = AUDIO_CONFIG_ISM1; + transport_config = IVAS_AUDIO_CONFIG_ISM1; hIsmMetaData[0] = &hIsmMetaDataFrame; hIsmMetaData[0]->azimuth = currentPos->azimuth; hIsmMetaData[0]->elevation = currentPos->elevation; diff --git a/lib_rend/ivas_output_init.c b/lib_rend/ivas_output_init.c index 3c4bf2d2aa..7dceb4a293 100644 --- a/lib_rend/ivas_output_init.c +++ b/lib_rend/ivas_output_init.c @@ -57,58 +57,58 @@ int16_t audioCfg2channels( switch ( output_config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: nchan_out = 1; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: nchan_out = 2; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: nchan_out = 6; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: nchan_out = 8; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: nchan_out = 8; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: nchan_out = 10; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: nchan_out = 12; break; - case AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_FOA: nchan_out = 4; break; - case AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA2: nchan_out = 9; break; - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_HOA3: nchan_out = 16; break; - case AUDIO_CONFIG_OBA: + case IVAS_AUDIO_CONFIG_OBA: nchan_out = 8; break; - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: nchan_out = 2; break; - case AUDIO_CONFIG_ISM1: + case IVAS_AUDIO_CONFIG_ISM1: nchan_out = 1; break; - case AUDIO_CONFIG_ISM2: + case IVAS_AUDIO_CONFIG_ISM2: nchan_out = 2; break; - case AUDIO_CONFIG_ISM3: + case IVAS_AUDIO_CONFIG_ISM3: nchan_out = 3; break; - case AUDIO_CONFIG_ISM4: + case IVAS_AUDIO_CONFIG_ISM4: nchan_out = 4; break; default: @@ -142,7 +142,7 @@ void ivas_output_init( hOutSetup->separateChannelEnabled = 0; hOutSetup->separateChannelIndex = 0; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { hOutSetup->is_loudspeaker_setup = 1; /* set in ivas_init_decoder: */ @@ -164,24 +164,24 @@ void ivas_output_init( /* set output setup specific values */ switch ( output_config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: hOutSetup->is_loudspeaker_setup = 1; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: hOutSetup->is_loudspeaker_setup = 1; hOutSetup->ls_azimuth = ls_azimuth_CICP2; hOutSetup->ls_elevation = ls_elevation_CICP2; break; - case AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_FOA: hOutSetup->ambisonics_order = SBA_FOA_ORDER; break; - case AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA2: hOutSetup->ambisonics_order = SBA_HOA2_ORDER; break; - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_HOA3: hOutSetup->ambisonics_order = SBA_HOA3_ORDER; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: hOutSetup->num_lfe = 1; hOutSetup->index_lfe[0] = 3; hOutSetup->is_loudspeaker_setup = 1; @@ -189,7 +189,7 @@ void ivas_output_init( hOutSetup->ls_elevation = ls_elevation_CICP6; hOutSetup->is_planar_setup = 1; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: hOutSetup->num_lfe = 1; hOutSetup->index_lfe[0] = 3; hOutSetup->is_loudspeaker_setup = 1; @@ -197,7 +197,7 @@ void ivas_output_init( hOutSetup->ls_elevation = ls_elevation_CICP12; hOutSetup->is_planar_setup = 1; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: hOutSetup->num_lfe = 1; hOutSetup->index_lfe[0] = 3; hOutSetup->is_loudspeaker_setup = 1; @@ -205,7 +205,7 @@ void ivas_output_init( hOutSetup->ls_elevation = ls_elevation_CICP14; hOutSetup->is_planar_setup = 0; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: hOutSetup->num_lfe = 1; hOutSetup->index_lfe[0] = 3; hOutSetup->is_loudspeaker_setup = 1; @@ -213,7 +213,7 @@ void ivas_output_init( hOutSetup->ls_elevation = ls_elevation_CICP16; hOutSetup->is_planar_setup = 0; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: hOutSetup->num_lfe = 1; hOutSetup->index_lfe[0] = 3; hOutSetup->is_loudspeaker_setup = 1; @@ -221,19 +221,19 @@ void ivas_output_init( hOutSetup->ls_elevation = ls_elevation_CICP19; hOutSetup->is_planar_setup = 0; break; - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - case AUDIO_CONFIG_ISM1: - case AUDIO_CONFIG_ISM2: - case AUDIO_CONFIG_ISM3: - case AUDIO_CONFIG_ISM4: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_ISM1: + case IVAS_AUDIO_CONFIG_ISM2: + case IVAS_AUDIO_CONFIG_ISM3: + case IVAS_AUDIO_CONFIG_ISM4: hOutSetup->is_binaural_setup = 1; - case AUDIO_CONFIG_EXTERNAL: + case IVAS_AUDIO_CONFIG_EXTERNAL: /* Default values are used */ break; default: @@ -245,7 +245,7 @@ void ivas_output_init( } } - if ( output_config != AUDIO_CONFIG_EXTERNAL && output_config != AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL && output_config != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out = audioCfg2channels( output_config ); hOutSetup->nchan_out_woLFE = nchan_out - hOutSetup->num_lfe; @@ -285,11 +285,11 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = st_ivas->nchan_ism; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } - else if ( output_config != AUDIO_CONFIG_EXTERNAL ) + else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( audioCfg2channels( st_ivas->transport_config ), audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); @@ -299,7 +299,7 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } @@ -313,11 +313,11 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = CPE_CHANNELS; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } - else if ( output_config != AUDIO_CONFIG_EXTERNAL ) + else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); @@ -327,11 +327,11 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = st_ivas->nchan_ism + CPE_CHANNELS; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } - else if ( output_config != AUDIO_CONFIG_EXTERNAL ) + else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); @@ -346,11 +346,11 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = ( ( nchan_out_buff + 1 ) >> 1 ) << 1; /* ensure odd number of channels in MCT */ } - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } - else if ( output_config != AUDIO_CONFIG_EXTERNAL ) + else if ( output_config != IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = max( nchan_out_buff, audioCfg2channels( st_ivas->intern_config ) ); nchan_out_buff = max( nchan_out_buff, audioCfg2channels( output_config ) ); @@ -364,7 +364,7 @@ int16_t ivas_get_nchan_buffers_dec( nchan_out_buff = max( nchan_out_buff + st_ivas->nchan_ism, audioCfg2channels( output_config ) ); /* needed for iivas_spar_dec_upmixer_sf() which is based on 'nchan_out' */ } } - else if ( output_config == AUDIO_CONFIG_EXTERNAL ) + else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) { nchan_out_buff = st_ivas->hDecoderConfig->nchan_out + st_ivas->nchan_ism; /*take into account sba_ch_idx' in ivas_dec() */ } @@ -375,7 +375,7 @@ int16_t ivas_get_nchan_buffers_dec( { nchan_out_buff = st_ivas->hDecoderConfig->nchan_out; - if ( output_config == AUDIO_CONFIG_LS_CUSTOM ) + if ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hOutSetup.nchan_out_woLFE + st_ivas->hOutSetup.num_lfe ); } @@ -387,7 +387,7 @@ int16_t ivas_get_nchan_buffers_dec( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { nchan_out_buff = max( nchan_out_buff, st_ivas->hSplitBinRend.splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS ); } diff --git a/lib_rend/ivas_reflections.c b/lib_rend/ivas_reflections.c index bf3bbbb34c..eb905caa1d 100644 --- a/lib_rend/ivas_reflections.c +++ b/lib_rend/ivas_reflections.c @@ -77,7 +77,7 @@ ivas_error ivas_er_init( /* Set to defaults for shoebox */ reflections->is_ready = 0; - reflections->audio_config = AUDIO_CONFIG_INVALID; + reflections->audio_config = IVAS_AUDIO_CONFIG_INVALID; reflections->is_cartesian = 0; reflections->is_relative = 1; reflections->shoebox_data.n_ref = ER_NUM_REF; @@ -154,7 +154,7 @@ ivas_error ivas_er_set_reflections_mode( switch ( reflections->audio_config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: reflections->shoebox_data.n_sources = 1; reflections->n_LC_sources = 1; reflections->LC_mixing = LC_mixing_5_1; @@ -162,7 +162,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[1] = 0; reflections->source_positions[2] = ER_RADIUS; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: reflections->shoebox_data.n_sources = 2; reflections->n_LC_sources = 2; reflections->LC_mixing = LC_mixing_5_1; @@ -173,7 +173,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: reflections->shoebox_data.n_sources = 5; reflections->n_LC_sources = 3; reflections->LC_mixing = LC_mixing_5_1; @@ -184,7 +184,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: reflections->shoebox_data.n_sources = 7; reflections->n_LC_sources = 5; reflections->LC_mixing = LC_mixing_7_1; @@ -195,7 +195,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: reflections->shoebox_data.n_sources = 7; reflections->n_LC_sources = 5; reflections->LC_mixing = LC_mixing_5_1_2; @@ -206,7 +206,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: reflections->shoebox_data.n_sources = 9; reflections->n_LC_sources = 5; reflections->LC_mixing = LC_mixing_5_1_4; @@ -217,7 +217,7 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: reflections->shoebox_data.n_sources = 11; reflections->n_LC_sources = 5; reflections->LC_mixing = LC_mixing_7_1_4; @@ -228,17 +228,17 @@ ivas_error ivas_er_set_reflections_mode( reflections->source_positions[2 + ( 3 * ch )] = ER_RADIUS; } break; - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_HOA3: reflections->use_er = 0; break; - case AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA2: reflections->use_er = 0; break; - case AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_FOA: reflections->use_er = 0; break; default: - reflections->audio_config = AUDIO_CONFIG_INVALID; + reflections->audio_config = IVAS_AUDIO_CONFIG_INVALID; return IVAS_ERROR( IVAS_ERR_INVALID_ER_PARAM, "Unsupported reflections mode" ); } @@ -337,7 +337,7 @@ ivas_error ivas_er_compute_reflections( reflections->is_ready = 0; /* Disabled case */ - if ( reflections->audio_config == AUDIO_CONFIG_INVALID ) + if ( reflections->audio_config == IVAS_AUDIO_CONFIG_INVALID ) { return error; } diff --git a/lib_rend/ivas_reverb.c b/lib_rend/ivas_reverb.c index ee00cb30c8..eaf2cef5c7 100644 --- a/lib_rend/ivas_reverb.c +++ b/lib_rend/ivas_reverb.c @@ -1452,16 +1452,16 @@ static ivas_error downmix_input_block( switch ( input_audio_config ) { - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: - case AUDIO_CONFIG_ISM1: - case AUDIO_CONFIG_ISM2: - case AUDIO_CONFIG_ISM3: - case AUDIO_CONFIG_ISM4: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_ISM1: + case IVAS_AUDIO_CONFIG_ISM2: + case IVAS_AUDIO_CONFIG_ISM3: + case IVAS_AUDIO_CONFIG_ISM4: { nchan_transport = audioCfg2channels( input_audio_config ); for ( s = 0; s < hReverb->full_block_size; s++ ) @@ -1475,10 +1475,10 @@ static ivas_error downmix_input_block( } break; } - case AUDIO_CONFIG_MONO: /* ~'ZOA_1' */ - case AUDIO_CONFIG_FOA: - case AUDIO_CONFIG_HOA2: - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_MONO: /* ~'ZOA_1' */ + case IVAS_AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA3: { for ( s = 0; s < hReverb->full_block_size; s++ ) { diff --git a/lib_rend/ivas_reverb_filter_design.c b/lib_rend/ivas_reverb_filter_design.c index 3069d1248a..78bf588246 100644 --- a/lib_rend/ivas_reverb_filter_design.c +++ b/lib_rend/ivas_reverb_filter_design.c @@ -691,7 +691,7 @@ void ivas_reverb_get_hrtf_set_properties( float avg_pwr_right[2]; float IA_coherence[2]; - if ( input_audio_config == AUDIO_CONFIG_FOA || input_audio_config == AUDIO_CONFIG_HOA2 || input_audio_config == AUDIO_CONFIG_HOA3 ) + if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA || input_audio_config == IVAS_AUDIO_CONFIG_HOA2 || input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) { is_ambisonics = 1; used_hrtf_count = 4; /* Using only 1st order HRTFs */ diff --git a/lib_rend/ivas_reverb_utils.c b/lib_rend/ivas_reverb_utils.c index 58613f4257..c3ddb15a1a 100644 --- a/lib_rend/ivas_reverb_utils.c +++ b/lib_rend/ivas_reverb_utils.c @@ -224,7 +224,7 @@ static void get_IR_from_filter_taps( output_sample_idx = 0; /* Assign CLDFB taps */ - if ( input_audio_config == AUDIO_CONFIG_HOA3 ) + if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) { for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) { @@ -234,7 +234,7 @@ static void get_IR_from_filter_taps( convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA3[band_idx][hrtf_idx]; } } - else if ( input_audio_config == AUDIO_CONFIG_HOA2 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) { for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) { @@ -244,7 +244,7 @@ static void get_IR_from_filter_taps( convolver_state.filter_taps_right_im[band_idx] = hHrtfFastConv->rightHRIRImag_HOA2[band_idx][hrtf_idx]; } } - else if ( input_audio_config == AUDIO_CONFIG_FOA ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) { for ( band_idx = 0; band_idx < BINAURAL_CONVBANDS; band_idx++ ) { @@ -257,23 +257,23 @@ static void get_IR_from_filter_taps( else { array_idx = 0; - if ( input_audio_config == AUDIO_CONFIG_5_1 ) + if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1 ) { array_idx = channelIndex_CICP6[hrtf_idx]; } - else if ( input_audio_config == AUDIO_CONFIG_7_1 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) { array_idx = channelIndex_CICP12[hrtf_idx]; } - else if ( input_audio_config == AUDIO_CONFIG_5_1_2 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_2 ) { array_idx = channelIndex_CICP14[hrtf_idx]; } - else if ( input_audio_config == AUDIO_CONFIG_5_1_4 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_5_1_4 ) { array_idx = channelIndex_CICP16[hrtf_idx]; } - else if ( input_audio_config == AUDIO_CONFIG_7_1_4 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1_4 ) { array_idx = channelIndex_CICP19[hrtf_idx]; } @@ -390,18 +390,18 @@ static void ivas_reverb_get_cldfb_hrtf_set_properties( freq_count = 1 + half_fft_size; /* chosing between ambisonics, 5.1 and 7.1 MC audio */ - if ( ( input_audio_config == AUDIO_CONFIG_FOA ) || ( input_audio_config == AUDIO_CONFIG_HOA2 ) || ( input_audio_config == AUDIO_CONFIG_HOA3 ) ) + if ( ( input_audio_config == IVAS_AUDIO_CONFIG_FOA ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( input_audio_config == IVAS_AUDIO_CONFIG_HOA3 ) ) { hrtf_count = 1; } - else if ( input_audio_config == AUDIO_CONFIG_7_1 ) + else if ( input_audio_config == IVAS_AUDIO_CONFIG_7_1 ) { hrtf_count = 7; } else { hrtf_count = 5; - input_audio_config = AUDIO_CONFIG_5_1; + input_audio_config = IVAS_AUDIO_CONFIG_5_1; } /* Zeroing before accumalation for average value computing */ diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index db0e5b47bf..9348357561 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -838,52 +838,52 @@ const LS_CONVERSION_MATRIX ls_conversion_cicp16_cicp19[] = const LS_CONVERSION_MAPPING ls_conversion_mapping[LS_SETUP_CONVERSION_NUM_MAPPINGS] = { /* Dowmix mappings - NULL is a special case for MONO / STEREO downmix */ - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_MONO, NULL}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_MONO, NULL}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_MONO, NULL}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_MONO, NULL}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_MONO, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_MONO, NULL}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_MONO, NULL}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_MONO, NULL}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_MONO, NULL}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_MONO, NULL}, - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_STEREO, NULL}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_STEREO, NULL}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_STEREO, NULL}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_STEREO, NULL}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_STEREO, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_STEREO, NULL}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_STEREO, NULL}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_STEREO, NULL}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_STEREO, NULL}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_STEREO, NULL}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1, ls_conversion_cicp12_cicp6}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_5_1, ls_conversion_cicp12_cicp6}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_5_1, ls_conversion_cicp14_cicp6}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_7_1, ls_conversion_cicp14_cicp12}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_5_1, ls_conversion_cicp14_cicp6}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_7_1, ls_conversion_cicp14_cicp12}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_5_1, ls_conversion_cicp16_cicp6}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_7_1, ls_conversion_cicp16_cicp12}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_5_1_2, ls_conversion_cicp16_cicp14}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_5_1, ls_conversion_cicp16_cicp6}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_7_1, ls_conversion_cicp16_cicp12}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_cicp16_cicp14}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_5_1, ls_conversion_cicp19_cicp6}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_7_1, ls_conversion_cicp19_cicp12}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_5_1_2, ls_conversion_cicp19_cicp14}, - {AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_5_1_4, ls_conversion_cicp19_cicp16}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1, ls_conversion_cicp19_cicp6}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_7_1, ls_conversion_cicp19_cicp12}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_cicp19_cicp14}, + {IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_cicp19_cicp16}, /* Upmix mappings - NULL implies a 1:1 upmix */ - {AUDIO_CONFIG_STEREO, AUDIO_CONFIG_5_1, NULL}, - {AUDIO_CONFIG_STEREO, AUDIO_CONFIG_7_1, NULL}, - {AUDIO_CONFIG_STEREO, AUDIO_CONFIG_5_1_2, NULL}, - {AUDIO_CONFIG_STEREO, AUDIO_CONFIG_5_1_4, NULL}, - {AUDIO_CONFIG_STEREO, AUDIO_CONFIG_7_1_4, NULL}, + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1, NULL}, + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_7_1, NULL}, + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1_2, NULL}, + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_5_1_4, NULL}, + {IVAS_AUDIO_CONFIG_STEREO, IVAS_AUDIO_CONFIG_7_1_4, NULL}, - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_7_1, NULL}, - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_5_1_2, NULL}, - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_5_1_4, NULL}, - {AUDIO_CONFIG_5_1, AUDIO_CONFIG_7_1_4, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_7_1, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_5_1_2, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_5_1_4, NULL}, + {IVAS_AUDIO_CONFIG_5_1, IVAS_AUDIO_CONFIG_7_1_4, NULL}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1_2, ls_conversion_cicp12_cicp14}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_5_1_4, ls_conversion_cicp12_cicp16}, - {AUDIO_CONFIG_7_1, AUDIO_CONFIG_7_1_4, ls_conversion_cicp12_cicp19}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_5_1_2, ls_conversion_cicp12_cicp14}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_5_1_4, ls_conversion_cicp12_cicp16}, + {IVAS_AUDIO_CONFIG_7_1, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_cicp12_cicp19}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_5_1_4, NULL}, - {AUDIO_CONFIG_5_1_2, AUDIO_CONFIG_7_1_4, ls_conversion_cicp14_cicp19}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_5_1_4, NULL}, + {IVAS_AUDIO_CONFIG_5_1_2, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_cicp14_cicp19}, - {AUDIO_CONFIG_5_1_4, AUDIO_CONFIG_7_1_4, ls_conversion_cicp16_cicp19}, + {IVAS_AUDIO_CONFIG_5_1_4, IVAS_AUDIO_CONFIG_7_1_4, ls_conversion_cicp16_cicp19}, }; /* clang-format on */ diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 18dba0c798..86f8c71cfa 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -51,6 +51,8 @@ * Output configuration for renderer (e.g. DirAC, MASA, Binaural Renderer...) *----------------------------------------------------------------------------------*/ +typedef enum _IVAS_AUDIO_CONFIG AUDIO_CONFIG; + typedef struct ivas_output_setup_structure { AUDIO_CONFIG output_config; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 96f2d4952a..50741300cb 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -556,24 +556,24 @@ static ivas_error validateOutputAudioConfig( { switch ( outConfig ) { - case AUDIO_CONFIG_MONO: - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: - case AUDIO_CONFIG_LS_CUSTOM: - case AUDIO_CONFIG_FOA: - case AUDIO_CONFIG_HOA2: - case AUDIO_CONFIG_HOA3: - case AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_BINAURAL: +#ifdef SPLIT_REND_WITH_HEAD_ROT + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: +#endif + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: return IVAS_ERR_OK; default: break; @@ -596,33 +596,33 @@ IVAS_REND_AudioConfigType getAudioConfigType( switch ( config ) { - case AUDIO_CONFIG_MONO: - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: type = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED; break; - case AUDIO_CONFIG_FOA: - case AUDIO_CONFIG_HOA2: - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA3: type = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS; break; - case AUDIO_CONFIG_OBA: + case IVAS_AUDIO_CONFIG_OBA: type = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED; break; - case AUDIO_CONFIG_BINAURAL: - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: type = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL; break; - case AUDIO_CONFIG_MASA1: - case AUDIO_CONFIG_MASA2: + case IVAS_AUDIO_CONFIG_MASA1: + case IVAS_AUDIO_CONFIG_MASA2: type = IVAS_REND_AUDIO_CONFIG_TYPE_MASA; break; default: @@ -676,42 +676,42 @@ ivas_error getAudioConfigNumChannels( { switch ( config ) { - case AUDIO_CONFIG_MONO: - case AUDIO_CONFIG_OBA: - case AUDIO_CONFIG_MASA1: + case IVAS_AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_OBA: + case IVAS_AUDIO_CONFIG_MASA1: *numChannels = 1; break; - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - case AUDIO_CONFIG_MASA2: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_MASA2: *numChannels = 2; break; - case AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_FOA: *numChannels = 4; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: *numChannels = 6; break; - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: *numChannels = 8; break; - case AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA2: *numChannels = 9; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: *numChannels = 10; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: *numChannels = 12; break; - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_HOA3: *numChannels = 16; break; default: @@ -778,25 +778,25 @@ static ivas_error getSpeakerAzimuths( { switch ( config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: *azimuths = ls_azimuth_CICP1; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: *azimuths = ls_azimuth_CICP2; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: *azimuths = ls_azimuth_CICP6; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: *azimuths = ls_azimuth_CICP12; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: *azimuths = ls_azimuth_CICP14; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: *azimuths = ls_azimuth_CICP16; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: *azimuths = ls_azimuth_CICP19; break; default: @@ -812,25 +812,25 @@ static ivas_error getSpeakerElevations( { switch ( config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: *elevations = ls_elevation_CICP1; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: *elevations = ls_elevation_CICP2; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: *elevations = ls_elevation_CICP6; break; - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1: *elevations = ls_elevation_CICP12; break; - case AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_2: *elevations = ls_elevation_CICP14; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: *elevations = ls_elevation_CICP16; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: *elevations = ls_elevation_CICP19; break; default: @@ -846,13 +846,13 @@ static ivas_error getAmbisonicsOrder( { switch ( config ) { - case AUDIO_CONFIG_FOA: + case IVAS_AUDIO_CONFIG_FOA: *order = 1; break; - case AUDIO_CONFIG_HOA2: + case IVAS_AUDIO_CONFIG_HOA2: *order = 2; break; - case AUDIO_CONFIG_HOA3: + case IVAS_AUDIO_CONFIG_HOA3: *order = 3; break; default: @@ -867,13 +867,13 @@ static int16_t getNumLfeChannels( { switch ( inputMc->base.inConfig ) { - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: return 1; - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: return inputMc->customLsInput.num_lfe; default: break; @@ -888,23 +888,23 @@ static ivas_error getNumNonLfeChannelsInSpeakerLayout( { switch ( config ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: *numNonLfeChannels = 1; break; - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_STEREO: *numNonLfeChannels = 2; break; - case AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1: *numNonLfeChannels = 5; break; - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_7_1: *numNonLfeChannels = 7; break; - case AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_5_1_4: *numNonLfeChannels = 9; break; - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: *numNonLfeChannels = 11; break; default: @@ -932,7 +932,7 @@ static ivas_error getMcConfigValues( *is_planar = 1; switch ( inConfig ) { - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: #ifdef API_5MS *azimuth = (const float *) &pInCustomLs->ls_azimuth; *elevation = (const float *) &pInCustomLs->ls_elevation; @@ -965,20 +965,20 @@ static ivas_error getMcConfigValues( } #endif break; - case AUDIO_CONFIG_MONO: - case AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_STEREO: getSpeakerAzimuths( inConfig, azimuth ); getSpeakerElevations( inConfig, elevation ); break; - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: getSpeakerAzimuths( inConfig, azimuth ); getSpeakerElevations( inConfig, elevation ); *lfe_idx = LFE_CHANNEL; - *is_planar = ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ? 1 : 0; + *is_planar = ( inConfig == IVAS_AUDIO_CONFIG_5_1 || inConfig == IVAS_AUDIO_CONFIG_7_1 ) ? 1 : 0; break; default: assert( !"Invalid speaker config" ); @@ -998,9 +998,9 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - pEfapWrapper->speakerConfig = AUDIO_CONFIG_7_1_4; + pEfapWrapper->speakerConfig = IVAS_AUDIO_CONFIG_7_1_4; } else { @@ -1021,7 +1021,7 @@ static ivas_error initEfap( return IVAS_ERR_OK; } - if ( outConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = efap_init_data( &pEfapWrapper->hEfap, pCustomLsOut->ls_azimuth, pCustomLsOut->ls_elevation, pCustomLsOut->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK ) { @@ -1071,7 +1071,7 @@ static ivas_error getEfapGains( efap_determine_gains( efapWrapper.hEfap, tmpPanGains, azi, ele, EFAP_MODE_EFAP ); /* Now copy to buffer that includes LFE channels */ - if ( efapWrapper.speakerConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( efapWrapper.speakerConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { numChannels = efapWrapper.pCustomLsSetup->num_spk + efapWrapper.pCustomLsSetup->num_lfe; readPtr = tmpPanGains; @@ -1310,7 +1310,7 @@ static bool isIoConfigPairSupported( const AUDIO_CONFIG outConfig ) { /* Rendering mono or stereo to binaural is not supported */ - if ( ( inConfig == AUDIO_CONFIG_MONO || inConfig == AUDIO_CONFIG_STEREO ) && getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) + if ( ( inConfig == IVAS_AUDIO_CONFIG_MONO || inConfig == IVAS_AUDIO_CONFIG_STEREO ) && getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { return false; } @@ -1397,13 +1397,13 @@ static ivas_error setRendInputActiveIsm( error = IVAS_ERR_OK; #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -1430,7 +1430,7 @@ static ivas_error setRendInputActiveIsm( } #endif } - else if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) + else if ( outConfig == IVAS_AUDIO_CONFIG_MASA1 || outConfig == IVAS_AUDIO_CONFIG_MASA2 ) { if ( ( error = initIsmMasaRendering( inputIsm, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -1444,7 +1444,7 @@ static ivas_error setRendInputActiveIsm( { return error; } - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -1457,16 +1457,16 @@ static ivas_error setRendInputActiveIsm( return error; } - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, inputIsm->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } - else if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) + else if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses @@ -1494,7 +1494,7 @@ static void clearInputIsm( rendCtx = inputIsm->base.ctx; freeInputBaseBufferData( &inputIsm->base.inputBuffer.data ); - initRendInputBase( &inputIsm->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); + initRendInputBase( &inputIsm->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ @@ -1635,7 +1635,7 @@ static ivas_error initMcPanGainsWithEfap( const float *spkAzi, *spkEle; ivas_error error; - if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK ) { @@ -1679,7 +1679,7 @@ static ivas_error initMcPanGainsWithEfap( } } - if ( outConfig != AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 ) + if ( outConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 ) { inputMc->panGains[inLfeChIdx][LFE_CHANNEL] = 1; } @@ -1707,7 +1707,7 @@ static ivas_error getRendInputNumChannels( pInputBase = (const input_base *) rendInput; - if ( pInputBase->inConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( pInputBase->inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { pInputMc = (const input_mc *) rendInput; *numInChannels = pInputMc->customLsInput.num_spk + pInputMc->customLsInput.num_lfe; @@ -1739,7 +1739,7 @@ static ivas_error initMcPanGainsWithMonoOut( return error; } - if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { for ( i = 0; i < numInChannels; ++i ) { @@ -1748,7 +1748,7 @@ static ivas_error initMcPanGainsWithMonoOut( inputMc->panGains[i][0] = 1.f; } } - else if ( inputMc->base.inConfig == AUDIO_CONFIG_STEREO ) + else if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_STEREO ) { /* Special case for STEREO to MONO: Passive downmix (L+R)/2 */ inputMc->panGains[0][0] = 0.5; @@ -1759,7 +1759,7 @@ static ivas_error initMcPanGainsWithMonoOut( /* ls_conversion_cicpX_stereo contains gains for side speakers. * These should be skipped with 5.1+X inputs. */ skipSideSpeakers = false; - if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) { skipSideSpeakers = true; } @@ -1790,7 +1790,7 @@ static ivas_error initMcPanGainsWithStereoLookup( /* Special case - MONO input. * Use gains for center CICP speaker and return early. */ - if ( inputMc->base.inConfig == AUDIO_CONFIG_MONO ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) { inputMc->panGains[0][0] = ls_conversion_cicpX_stereo[2][0]; inputMc->panGains[0][1] = ls_conversion_cicpX_stereo[2][1]; @@ -1800,7 +1800,7 @@ static ivas_error initMcPanGainsWithStereoLookup( /* ls_conversion_cicpX_stereo contains gains for side speakers. * These should be skipped with 5.1+X inputs. */ skipSideSpeakers = false; - if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_AUDIO_CONFIG_5_1_4 ) { skipSideSpeakers = true; } @@ -1837,7 +1837,7 @@ static bool configsAreEqual( int16_t i; /* Both input and output are custom LS - compare structs */ - if ( configA == AUDIO_CONFIG_LS_CUSTOM && configB == AUDIO_CONFIG_LS_CUSTOM ) + if ( configA == IVAS_AUDIO_CONFIG_LS_CUSTOM && configB == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( customLsA.num_spk != customLsB.num_spk ) { @@ -1895,7 +1895,7 @@ static ivas_error updateLfePanGainsForMcOut( numLfeIn = getNumLfeChannels( inputMc ); - if ( outConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { numOutChannels = inputMc->base.ctx.pCustomLsOut->num_spk + inputMc->base.ctx.pCustomLsOut->num_lfe; } @@ -1992,11 +1992,11 @@ static ivas_error updateMcPanGainsForMcOut( { error = initMcPanGainsWithIdentMatrix( inputMc ); } - else if ( outConfig == AUDIO_CONFIG_LS_CUSTOM || - inputMc->base.inConfig == AUDIO_CONFIG_MONO || - inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) + else if ( outConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM || + inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO || + inputMc->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { - if ( ( inputMc->base.inConfig == AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) + if ( ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) { inputMc->panGains[0][0] = ( inputMc->nonDiegeticPanGain + 1.f ) * 0.5f; inputMc->panGains[0][1] = 1.f - inputMc->panGains[0][0]; @@ -2007,11 +2007,11 @@ static ivas_error updateMcPanGainsForMcOut( error = initMcPanGainsWithEfap( inputMc, outConfig ); } } - else if ( outConfig == AUDIO_CONFIG_MONO ) + else if ( outConfig == IVAS_AUDIO_CONFIG_MONO ) { error = initMcPanGainsWithMonoOut( inputMc ); } - else if ( outConfig == AUDIO_CONFIG_STEREO ) + else if ( outConfig == IVAS_AUDIO_CONFIG_STEREO ) { error = initMcPanGainsWithStereoLookup( inputMc ); } @@ -2047,7 +2047,7 @@ static ivas_error updateMcPanGainsForAmbiOut( return error; } - if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK ) { @@ -2126,16 +2126,16 @@ static ivas_error updateMcPanGains( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif break; /* Do nothing */ - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: /* Prepare rendering to intermediate format */ - error = updateMcPanGainsForMcOut( inputMc, AUDIO_CONFIG_7_1_4 ); + error = updateMcPanGainsForMcOut( inputMc, IVAS_AUDIO_CONFIG_7_1_4 ); break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -2153,7 +2153,7 @@ static ivas_error updateMcPanGains( } /* Copy LFE routing to pan gains array */ - if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { for ( i = 0; i < inputMc->customLsInput.num_lfe; ++i ) { @@ -2222,16 +2222,16 @@ static ivas_error initMcBinauralRendering( // initTDRend = false; // #ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG // if ( ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && - // ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + // ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) // #else // if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) // #endif // { - // if ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) + // if ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) // { // initTDRend = true; // } - // else if ( ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) && + // else if ( ( inConfig == IVAS_AUDIO_CONFIG_5_1 || inConfig == IVAS_AUDIO_CONFIG_7_1 ) && // ( inputMc->base.ctx.pHeadRotData->headRotEnabled ) ) // { // initTDRend = true; @@ -2247,7 +2247,7 @@ static ivas_error initMcBinauralRendering( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) @@ -2263,7 +2263,7 @@ static ivas_error initMcBinauralRendering( } #endif - if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), outConfig, NULL, inputMc->tdRendWrapper.hBinRendererTd->HrFiltSet_p->lr_energy_and_iac, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) { @@ -2273,10 +2273,10 @@ static ivas_error initMcBinauralRendering( } { - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate + if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) ? IVAS_AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , - ( ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 + ( ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 #endif ) ) != IVAS_ERR_OK ) { @@ -2285,7 +2285,7 @@ static ivas_error initMcBinauralRendering( } /* Initialise the EFAP handle for rotation on input layout */ - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled ) { if ( ( error = initEfap( &inputMc->efapInWrapper, inConfig, NULL ) ) != IVAS_ERR_OK ) { @@ -2363,14 +2363,14 @@ static lfe_routing defaultLfeRouting( switch ( inConfig ) { - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1_4: routing.numLfeChannels = 1; break; - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: routing.numLfeChannels = customLsIn.num_lfe; break; default: @@ -2379,14 +2379,14 @@ static lfe_routing defaultLfeRouting( switch ( outConfig ) { - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_7_1_4: routing.lfePanMtx[0][LFE_CHANNEL] = 1.0f; break; - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: for ( i = 0; i < routing.numLfeChannels && i < customLsOut.num_lfe; ++i ) { routing.lfePanMtx[i][customLsOut.lfe_idx[i]] = 1.0f; @@ -2464,7 +2464,7 @@ static ivas_error setRendInputActiveMc( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) #else - if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) @@ -2473,7 +2473,7 @@ static ivas_error setRendInputActiveMc( } } - if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) + if ( outConfig == IVAS_AUDIO_CONFIG_MASA1 || outConfig == IVAS_AUDIO_CONFIG_MASA2 ) { if ( ( error = initMcMasaRendering( inputMc, inConfig, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -2502,7 +2502,7 @@ static void clearInputMc( freeMcLfeDelayBuffer( &inputMc->lfeDelayBuffer ); freeInputBaseBufferData( &inputMc->bufferData ); - initRendInputBase( &inputMc->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); + initRendInputBase( &inputMc->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ if ( inputMc->efapInWrapper.hEfap != NULL ) @@ -2566,20 +2566,20 @@ static ivas_error initSbaPanGainsForMcOut( switch ( outConfig ) { - case AUDIO_CONFIG_MONO: + case IVAS_AUDIO_CONFIG_MONO: hOutSetup.ls_azimuth = ls_azimuth_CICP1; hOutSetup.ls_elevation = ls_elevation_CICP1; ivas_output_init( &hOutSetup, outConfig ); break; - case AUDIO_CONFIG_STEREO: - case AUDIO_CONFIG_5_1: - case AUDIO_CONFIG_7_1: - case AUDIO_CONFIG_5_1_2: - case AUDIO_CONFIG_5_1_4: - case AUDIO_CONFIG_7_1_4: + case IVAS_AUDIO_CONFIG_STEREO: + case IVAS_AUDIO_CONFIG_5_1: + case IVAS_AUDIO_CONFIG_7_1: + case IVAS_AUDIO_CONFIG_5_1_2: + case IVAS_AUDIO_CONFIG_5_1_4: + case IVAS_AUDIO_CONFIG_7_1_4: ivas_output_init( &hOutSetup, outConfig ); break; - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: ivas_ls_custom_setup( &hOutSetup, outSetupCustom ); break; default: @@ -2683,13 +2683,13 @@ static ivas_error updateSbaPanGains( switch ( outConfig ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: { if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { - assert( inConfig == AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); + assert( inConfig == IVAS_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); if ( ( error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; @@ -2706,7 +2706,7 @@ static ivas_error updateSbaPanGains( break; } #endif - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { @@ -2729,14 +2729,14 @@ static ivas_error updateSbaPanGains( } } break; - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - if ( ( error = initSbaPanGainsForMcOut( inputSba, AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate + if ( ( error = ivas_rend_openCrend( &inputSba->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses @@ -2888,7 +2888,7 @@ static ivas_error setRendInputActiveSba( initRotGains( inputSba->rot_gains_prev ); #endif - if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) + if ( outConfig == IVAS_AUDIO_CONFIG_MASA1 || outConfig == IVAS_AUDIO_CONFIG_MASA2 ) { if ( ( error = initSbaMasaRendering( inputSba, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -2915,7 +2915,7 @@ static void clearInputSplitRend( freeInputBaseBufferData( &inputSplitRend->bufferData ); - initRendInputBase( &inputSplitRend->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); + initRendInputBase( &inputSplitRend->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) { @@ -2946,7 +2946,7 @@ static void clearInputSba( freeInputBaseBufferData( &inputSba->bufferData ); - initRendInputBase( &inputSba->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); + initRendInputBase( &inputSba->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -2988,13 +2988,13 @@ static ivas_error initMasaDummyDecForMcOut( ivas_output_init( &( decDummy->hIntSetup ), outConfig ); decDummy->renderer_type = RENDERER_DIRAC; - if ( outConfig == AUDIO_CONFIG_STEREO ) + if ( outConfig == IVAS_AUDIO_CONFIG_STEREO ) { decDummy->renderer_type = RENDERER_STEREO_PARAMETRIC; } decDummy->ivas_format = MASA_FORMAT; - decDummy->transport_config = AUDIO_CONFIG_INVALID; + decDummy->transport_config = IVAS_AUDIO_CONFIG_INVALID; /* Todo refactor: Access to qmetadata is not required by the algorithm. */ if ( ( error = ivas_qmetadata_open( &( decDummy->hQMetaData ) ) ) != IVAS_ERR_OK ) @@ -3071,7 +3071,7 @@ static ivas_error initMasaDummyDecForSbaOut( ivas_output_init( &( decDummy->hIntSetup ), outConfig ); decDummy->renderer_type = RENDERER_DIRAC; decDummy->ivas_format = MASA_FORMAT; - decDummy->transport_config = AUDIO_CONFIG_INVALID; + decDummy->transport_config = IVAS_AUDIO_CONFIG_INVALID; /* Todo refactor: Access to qmetadata is not required by the algorithm. */ if ( ( error = ivas_qmetadata_open( &( decDummy->hQMetaData ) ) ) != IVAS_ERR_OK ) @@ -3133,9 +3133,9 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->mc_mode = MC_MODE_NONE; /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */ ivas_output_init( &( decDummy->hOutSetup ), outConfig ); - if ( outConfig == AUDIO_CONFIG_BINAURAL + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -3146,7 +3146,7 @@ static ivas_error initMasaDummyDecForBinauralOut( decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC_ROOM; } decDummy->ivas_format = MASA_FORMAT; - decDummy->transport_config = AUDIO_CONFIG_INVALID; + decDummy->transport_config = IVAS_AUDIO_CONFIG_INVALID; if ( ( error = ivas_dirac_dec_config( decDummy, DIRAC_OPEN ) ) != IVAS_ERR_OK ) { @@ -3257,7 +3257,7 @@ static DecoderDummy *initDecoderDummy( decDummy->hSplitBinRend.splitrend = *pSplitRendWrapper; #ifdef FIX_658_SPLIT_REND_MASA - if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else if ( decDummy->splitBinRend.splitrend.multiBinPoseData.num_poses > 1 ) #endif @@ -3402,7 +3402,7 @@ static ivas_error setRendInputActiveMasa( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) { inputMasa->metadataHasBeenFed = false; - if ( ( error = masaPrerendOpen( &inputMasa->hMasaPrerend, inputMasa->base.inConfig == AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) + if ( ( error = masaPrerendOpen( &inputMasa->hMasaPrerend, inputMasa->base.inConfig == IVAS_AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) { return error; } @@ -3547,7 +3547,7 @@ static void clearInputMasa( masaPrerendClose( &inputMasa->hMasaPrerend ); - initRendInputBase( &inputMasa->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); + initRendInputBase( &inputMasa->base, IVAS_AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); freeDecoderDummy( &inputMasa->decDummy ); return; @@ -3566,7 +3566,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN ivas_error error; IVAS_REND_AudioBufferConfig bufConfig; - if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) { @@ -3577,7 +3577,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData ); } - if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in, outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #ifdef API_5MS , is_5ms_frame @@ -3723,7 +3723,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsIsm[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); + initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; @@ -3743,7 +3743,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMc[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); + initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; hIvasRend->inputsMc[i].crendWrapper = NULL; @@ -3765,7 +3765,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsSba[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); + initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsSba[i].crendWrapper = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -3778,7 +3778,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMasa[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); + initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; @@ -3788,7 +3788,7 @@ ivas_error IVAS_REND_Open( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsSplitPost[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); + initRendInputBase( &hIvasRend->inputsSplitPost[i].base, IVAS_AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); ivas_init_split_post_rend_handles( &hIvasRend->inputsSplitPost[i].splitPostRendWrapper ); @@ -3876,7 +3876,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - if ( hIvasRend->outputConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { /* Specifying details of custom speaker layout only makes sense if output config is set to custom speaker layout */ return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -3912,7 +3912,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { inputMc = &hIvasRend->inputsMc[i]; - if ( inputMc->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( inputMc->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Input inactive, skip. */ continue; @@ -3931,7 +3931,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( { inputSba = &hIvasRend->inputsSba[i]; - if ( inputSba->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( inputSba->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Input inactive, skip. */ continue; @@ -3962,7 +3962,7 @@ ivas_error IVAS_REND_NumOutChannels( /* Handle special cases where additional info is needed from the renderer, otherwise use getAudioConfigNumChannels() */ switch ( hIvasRend->outputConfig ) { - case AUDIO_CONFIG_LS_CUSTOM: + case IVAS_AUDIO_CONFIG_LS_CUSTOM: *numOutChannels = hIvasRend->customLsOut.num_spk + hIvasRend->customLsOut.num_lfe; break; default: @@ -4050,7 +4050,7 @@ static ivas_error getInputById( } /* Ensure input ID matches and that input is active */ - if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID ) + if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERR_INVALID_INPUT_ID; } @@ -4124,7 +4124,7 @@ static ivas_error getConstInputById( } /* Ensure input ID matches and that input is active */ - if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID ) + if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_AUDIO_CONFIG_INVALID ) { return IVAS_ERR_INVALID_INPUT_ID; } @@ -4161,7 +4161,7 @@ static ivas_error findFreeInputSlot( { pInputBase = (const input_base *) pByte; - if ( pInputBase->inConfig == AUDIO_CONFIG_INVALID ) + if ( pInputBase->inConfig == IVAS_AUDIO_CONFIG_INVALID ) { *inputIndex = i; canAddInput = true; @@ -4192,19 +4192,19 @@ static int16_t getCldfbRendFlag( { for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { - numMasaInputs += ( hIvasRend->inputsMasa[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) ? 0 : 1; + numMasaInputs += ( hIvasRend->inputsMasa[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_MASA ) ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { - numSbaInputs += ( hIvasRend->inputsSba[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ? 0 : 1; + numSbaInputs += ( hIvasRend->inputsSba[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { - numIsmInputs += ( hIvasRend->inputsIsm[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) ? 0 : 1; + numIsmInputs += ( hIvasRend->inputsIsm[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED ) ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { - numMcInputs += ( hIvasRend->inputsMc[i].base.inConfig == AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? 0 : 1; + numMcInputs += ( hIvasRend->inputsMc[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID && new_configType != IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? 0 : 1; } if ( numIsmInputs > 0 || numMcInputs > 0 ) @@ -4269,7 +4269,7 @@ ivas_error IVAS_REND_AddInput( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( #ifdef API_5MS - ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && + ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) && #endif hIvasRend->splitRendEncBuffer.data == NULL && hIvasRend->hRendererConfig != NULL ) { @@ -4286,7 +4286,7 @@ ivas_error IVAS_REND_AddInput( &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, #endif ( cldfb_in == 0 ), - hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); #ifdef API_5MS if ( error != IVAS_ERR_OK ) { @@ -4400,7 +4400,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return error; } - if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { /* Specifying details of custom speaker layout only makes sense if input config is set to custom speaker layout */ return IVAS_ERR_INVALID_INPUT_FORMAT; @@ -4421,7 +4421,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) #else - if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { if ( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) @@ -4674,7 +4674,7 @@ ivas_error IVAS_REND_GetNumAllObjects( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - if ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_MASA2 ) { *numChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects; } @@ -4715,7 +4715,7 @@ ivas_error IVAS_REND_GetDelay( /* Compute the maximum delay across all inputs */ for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ ) { - if ( hIvasRend->inputsIsm[i].base.inConfig != AUDIO_CONFIG_INVALID ) + if ( hIvasRend->inputsIsm[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { latency_ns = max( ( hIvasRend->inputsIsm[i].crendWrapper != NULL ) ? hIvasRend->inputsIsm[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsIsm[i].tdRendWrapper.binaural_latency_ns ); @@ -4725,7 +4725,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { - if ( hIvasRend->inputsMc[i].base.inConfig != AUDIO_CONFIG_INVALID ) + if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { latency_ns = max( ( hIvasRend->inputsMc[i].crendWrapper != NULL ) ? hIvasRend->inputsMc[i].crendWrapper->binaural_latency_ns : 0, hIvasRend->inputsMc[i].tdRendWrapper.binaural_latency_ns ); @@ -4735,7 +4735,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { - if ( hIvasRend->inputsSba[i].base.inConfig != AUDIO_CONFIG_INVALID ) + if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) @@ -4768,7 +4768,7 @@ ivas_error IVAS_REND_GetDelay( #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; i++ ) { - if ( hIvasRend->inputsSplitPost[i].base.inConfig != AUDIO_CONFIG_INVALID ) + if ( hIvasRend->inputsSplitPost[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { latency_ns = 0; if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec != NULL ) @@ -4788,7 +4788,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { - if ( hIvasRend->inputsMasa[i].base.inConfig != AUDIO_CONFIG_INVALID ) + if ( hIvasRend->inputsMasa[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { latency_ns = (int32_t) ( (float) IVAS_FB_DEC_DELAY_NS + 0.5f ); max_latency_ns = max( max_latency_ns, latency_ns ); @@ -4845,8 +4845,8 @@ ivas_error IVAS_REND_FeedInputAudio( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && - hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && - hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM && + hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && + hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && ( inputAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != ( BINAURAL_RENDERING_FRAME_SIZE_MS * hIvasRend->num_subframes ) * hIvasRend->sampleRateOut ) #else if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && @@ -4865,7 +4865,7 @@ ivas_error IVAS_REND_FeedInputAudio( { return error; } - if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == AUDIO_CONFIG_OBA ) + if ( ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == IVAS_AUDIO_CONFIG_OBA ) { numInputChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects; } @@ -4916,7 +4916,7 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( return error; } - if ( inputBase->inConfig != AUDIO_CONFIG_OBA ) + if ( inputBase->inConfig != IVAS_AUDIO_CONFIG_OBA ) { /* Object metadata should only be fed for object inputs */ return IVAS_ERR_METADATA_NOT_EXPECTED; @@ -5168,7 +5168,7 @@ int16_t IVAS_REND_FeedRenderConfig( hRenderConfig->split_rend_config.codec = renderConfig.split_rend_config.codec; - if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -5186,14 +5186,14 @@ int16_t IVAS_REND_FeedRenderConfig( if ( ( error = ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, &hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, ( cldfb_in == 0 ), - hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) != IVAS_ERR_OK ) { return error; } #else ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, ( cldfb_in == 0 ), - hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); #endif if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, @@ -5311,7 +5311,7 @@ ivas_error IVAS_REND_SetHeadRotation( if ( headRot == NULL ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { hIvasRend->headRotData.headRotEnabled = 1; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) @@ -5342,10 +5342,10 @@ ivas_error IVAS_REND_SetHeadRotation( if ( headRot[i].w == -3.0f ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || - ( hIvasRend->inputsSplitPost[0].base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->inputsSplitPost[0].base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || + ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); } @@ -5804,7 +5804,7 @@ static ivas_error rotateFrameMc( num_subframes = ( hCombinedOrientationData != NULL ) ? ( *hCombinedOrientationData )->num_subframes : MAX_PARAM_SPATIAL_SUBFRAMES; #endif - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK ) { @@ -6255,7 +6255,7 @@ static ivas_error renderIsmToBinauralRoom( /* intermediate rendering to 7_1_4 */ tmpMcBuffer = ismInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( IVAS_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -6268,7 +6268,7 @@ static ivas_error renderIsmToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); - if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, AUDIO_CONFIG_7_1_4, AUDIO_CONFIG_BINAURAL_ROOM_IR, + if ( ( error = ivas_rend_crendProcess( ismInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *ismInput->base.ctx.pOutSampleRate #ifdef API_5MS , @@ -6340,7 +6340,7 @@ static ivas_error renderIsmToMc( push_wmops( "renderIsmToMc" ); /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ - if ( *ismInput->base.ctx.pOutConfig == AUDIO_CONFIG_STEREO ) + if ( *ismInput->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_STEREO ) { if ( ismInput->nonDiegeticPan ) { @@ -6625,19 +6625,19 @@ static ivas_error renderInputIsm( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: error = renderIsmToBinaural( ismInput, outAudio ); break; - case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderIsmToSplitBinaural( ismInput, outAudio ); break; #endif - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderIsmToBinauralReverb( ismInput, outAudio ); break; default: @@ -6671,7 +6671,7 @@ static ivas_error renderActiveInputsIsm( for ( i = 0, pCurrentInput = hIvasRend->inputsIsm; i < RENDERER_MAX_ISM_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( pCurrentInput->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -6715,7 +6715,7 @@ static ivas_error renderLfeToBinaural( gain = GAIN_LFE; - if ( mcInput->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) + if ( mcInput->base.inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM ) { lfe_idx = LFE_CHANNEL; } @@ -6823,7 +6823,7 @@ static ivas_error renderMcToBinaural( } } - if ( ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ) ) + if ( ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_AUDIO_CONFIG_5_1 || inConfig == IVAS_AUDIO_CONFIG_7_1 ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); @@ -6951,7 +6951,7 @@ static ivas_error renderMcToBinauralRoom( } } - if ( ( mcInput->hReverb != NULL && outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ) ) ) + if ( ( mcInput->hReverb != NULL && outConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_AUDIO_CONFIG_5_1 || inConfig == IVAS_AUDIO_CONFIG_7_1 ) ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); @@ -7108,7 +7108,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( /* intermediate conversion to 7_1_4 */ tmpMcBuffer = mcInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( IVAS_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -7125,7 +7125,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef API_5MS , @@ -7284,7 +7284,7 @@ static ivas_error renderMcToSplitBinaural( /* temporary buffer for rotation in source format for CREND */ tmpRotBuffer = mcInput->base.inputBuffer; - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_AUDIO_CONFIG_5_1 && inConfig != IVAS_AUDIO_CONFIG_7_1 ) { tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); } @@ -7311,7 +7311,7 @@ static ivas_error renderMcToSplitBinaural( QuatToRotMat( combinedOrientationDataLocal.Quaternions[i], combinedOrientationDataLocal.Rmat[i] ); } - if ( inConfig == AUDIO_CONFIG_LS_CUSTOM || inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) + if ( inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM || inConfig == IVAS_AUDIO_CONFIG_5_1 || inConfig == IVAS_AUDIO_CONFIG_7_1 ) { /* tdrend processing overview: * 1. copy from inputBuffer to tmpRendBuffer @@ -7420,7 +7420,7 @@ static ivas_error renderMcToSplitBinaural( } } - if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 ) + if ( inConfig != IVAS_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_AUDIO_CONFIG_5_1 && inConfig != IVAS_AUDIO_CONFIG_7_1 ) { /* free temporary buffer for rotation in source format for CREND */ free( tmpRotBuffer.data ); @@ -7475,12 +7475,12 @@ static ivas_error renderInputMc( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - if ( mcInput->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + if ( mcInput->base.inConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); } @@ -7490,8 +7490,8 @@ static ivas_error renderInputMc( } break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderMcToSplitBinaural( mcInput, outConfig, outAudio ); break; #endif @@ -7520,7 +7520,7 @@ static ivas_error renderActiveInputsMc( for ( i = 0, pCurrentInput = hIvasRend->inputsMc; i < RENDERER_MAX_MC_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( pCurrentInput->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -7744,7 +7744,7 @@ static ivas_error renderSplitBinauralWithPostRot( hSplitBin->multiBinPoseData.poseCorrectionMode = bits.pose_correction; /* decode audio */ - if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( splitBinInput->base.inConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { #ifdef API_5MS if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD ) @@ -7957,7 +7957,7 @@ static ivas_error renderSplitBinauralWithPostRot( } else { - if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( splitBinInput->base.inConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { int16_t ch_idx; for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) @@ -8366,7 +8366,7 @@ static ivas_error renderSbaToBinauralRoom( /* intermediate rendering to 7_1_4 */ tmpMcBuffer = sbaInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( IVAS_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -8384,7 +8384,7 @@ static ivas_error renderSbaToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, IVAS_AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate #ifdef API_5MS , @@ -8443,7 +8443,7 @@ static ivas_error renderInputSplitBin( inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); /* TODO: the output buffer is empty at this point, should be moved to a point after decoding the split bitstream */ switch ( outConfig ) { - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: error = renderSplitBinauralWithPostRot( splitBinInput, outAudio, #ifndef API_5MS hBits, @@ -8499,7 +8499,7 @@ static ivas_error renderInputSba( * cldfb2tdSampleFact #endif != outAudio.config.numSamplesPerChannel ) && - ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) #endif @@ -8526,8 +8526,8 @@ static ivas_error renderInputSba( switch ( outConfig ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, #ifdef SPLIT_REND_WITH_HEAD_ROT outConfig, @@ -8535,11 +8535,11 @@ static ivas_error renderInputSba( outAudio ); break; #endif - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); break; default: @@ -8573,7 +8573,7 @@ static ivas_error renderActiveInputsSplitBin( for ( i = 0, pCurrentInput = hIvasRend->inputsSplitPost; i < RENDERER_MAX_BIN_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( pCurrentInput->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -8604,7 +8604,7 @@ static ivas_error renderActiveInputsSba( for ( i = 0, pCurrentInput = hIvasRend->inputsSba; i < RENDERER_MAX_SBA_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( pCurrentInput->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -8922,7 +8922,7 @@ static ivas_error renderInputMasa( * cldfb2tdSampleFact #endif != outAudio.config.numSamplesPerChannel ) && - ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else if ( masaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) #endif @@ -8948,7 +8948,7 @@ static ivas_error renderInputMasa( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case AUDIO_CONFIG_BINAURAL: + case IVAS_AUDIO_CONFIG_BINAURAL: renderMasaToBinaural( masaInput, outAudio #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -8958,16 +8958,16 @@ static ivas_error renderInputMasa( break; /* ToDo */ // #ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG - // case AUDIO_CONFIG_BINAURAL_ROOM_IR: - // case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + // case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR: + // case IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: // #else // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM: // #endif // renderMasaToBinauralRoom( masaInput, outConfig, outAudio ); // break; #ifdef SPLIT_REND_WITH_HEAD_ROT_PARAMBIN - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: renderMasaToBinaural( masaInput, outAudio #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -9002,7 +9002,7 @@ static ivas_error renderActiveInputsMasa( for ( i = 0, pCurrentInput = hIvasRend->inputsMasa; i < RENDERER_MAX_MASA_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) + if ( pCurrentInput->base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -9146,7 +9146,7 @@ ivas_error IVAS_REND_MergeMasaMetadata( /* Merge metadata */ ivas_prerend_merge_masa_metadata( *hMasaExtOutMeta, *hMasaExtOutMeta, inputType1, *inEne1, inMeta2, inputType2, *inEne2 ); - ( *hMasaExtOutMeta )->descriptiveMeta.numberOfChannels = hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 ? 0u : 1u; + ( *hMasaExtOutMeta )->descriptiveMeta.numberOfChannels = hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_MASA1 ? 0u : 1u; return IVAS_ERR_OK; @@ -9259,8 +9259,8 @@ ivas_error IVAS_REND_GetSamples( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && - hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && - hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM && + hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && + hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && ( outAudio.config.numSamplesPerChannel * 1000 / cldfb2tdSampleFact ) != ( hIvasRend->num_subframes * BINAURAL_RENDERING_FRAME_SIZE_MS ) * hIvasRend->sampleRateOut ) #else if ( getAudioConfigType( hIvasRend->outputConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL && @@ -9279,21 +9279,21 @@ ivas_error IVAS_REND_GetSamples( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { - numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; + numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { - numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; + numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { - numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; + numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == IVAS_AUDIO_CONFIG_INVALID ? 0 : 1; } /* For ISM, we check only first as all ISMs are handled together via OMASA when merging to MASA. */ - numOtherInputs += hIvasRend->inputsIsm[0].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; + numOtherInputs += hIvasRend->inputsIsm[0].base.inConfig == IVAS_AUDIO_CONFIG_INVALID ? 0 : 1; if ( numMasaInputs == 0 || numOtherInputs == 0 ) { @@ -9308,7 +9308,7 @@ ivas_error IVAS_REND_GetSamples( if ( numOutChannels != outAudio.config.numChannels #ifdef SPLIT_REND_WITH_HEAD_ROT - && hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && hIvasRend->outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM + && hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && hIvasRend->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -9321,15 +9321,15 @@ ivas_error IVAS_REND_GetSamples( #ifdef SPLIT_REND_WITH_HEAD_ROT outAudioOrig = outAudio; /* Use internal buffer if outputting split rendering bitstream */ - if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t num_poses_orig; num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses; outAudio = hIvasRend->splitRendEncBuffer; #ifndef API_5MS if ( ( outAudioOrig.config.is_cldfb == 0 ) && - ( hIvasRend->inputsMasa[0].base.inConfig == AUDIO_CONFIG_INVALID ) ) + ( hIvasRend->inputsMasa[0].base.inConfig == IVAS_AUDIO_CONFIG_INVALID ) ) { outAudio.config.is_cldfb = 0; outAudio.config.numSamplesPerChannel >>= 1; @@ -9395,7 +9395,7 @@ ivas_error IVAS_REND_GetSamples( #endif /* SPLIT_REND_WITH_HEAD_ROT */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { ivas_split_rend_bits_t bits; int16_t td_input; @@ -9432,11 +9432,11 @@ ivas_error IVAS_REND_GetSamples( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, td_input, - ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); if ( error != IVAS_ERR_OK ) { return error; @@ -9447,7 +9447,7 @@ ivas_error IVAS_REND_GetSamples( /* reset to outAudioOrig in case of PCM output */ outAudio = outAudioOrig; - if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { accumulate2dArrayToBuffer( tmpBinaural_buff, &outAudio ); } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 52fbea2863..86378cc52c 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -141,7 +141,7 @@ typedef enum _IVAS_REND_COMPLEXITY_LEVEL ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ - const AUDIO_CONFIG outConfig, /* i : output audio config */ + const IVAS_AUDIO_CONFIG outConfig, /* i : output audio config */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain /* i : non-diegetic panning gain */ #ifdef API_5MS @@ -166,7 +166,7 @@ ivas_error IVAS_REND_NumOutChannels( ivas_error IVAS_REND_AddInput( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const AUDIO_CONFIG inConfig, /* i : audio config for a new input */ + const IVAS_AUDIO_CONFIG inConfig, /* i : audio config for a new input */ IVAS_REND_InputId *inputId /* o : ID of the new input */ ); @@ -242,7 +242,7 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( ivas_error IVAS_REND_InitConfig( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const AUDIO_CONFIG outAudioConfig /* i : output audioConfig */ + const IVAS_AUDIO_CONFIG outAudioConfig /* i : output audioConfig */ ); int16_t IVAS_REND_GetRenderConfig( -- GitLab From 91c9afa1fce67aa8566c0a53a03c11e748e90d8c Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 30 Aug 2023 17:45:42 +0200 Subject: [PATCH 02/10] rename enum HEAD_ORIENT_TRK_T and its members to IVAS_* --- apps/renderer.c | 12 ++++++------ lib_com/common_api_types.h | 13 +++++++------ lib_dec/ivas_stat_dec.h | 28 ++++++++++++++-------------- lib_dec/lib_dec.c | 30 +++++++++++++++--------------- lib_dec/lib_dec.h | 2 +- lib_rend/ivas_orient_trk.c | 36 ++++++++++++++++++------------------ lib_rend/ivas_prot_rend.h | 2 +- lib_rend/ivas_stat_rend.h | 2 +- lib_rend/lib_rend.c | 4 ++-- lib_rend/lib_rend.h | 2 +- 10 files changed, 66 insertions(+), 65 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 2c92ca2027..2f3b5b3a01 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2396,23 +2396,23 @@ static bool parseOrientationTracking( if ( strcmp( value, "NONE" ) == 0 ) { - *orientation_tracking = HEAD_ORIENT_TRK_NONE; + *orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; } else if ( strcmp( value, "REF" ) == 0 ) { - *orientation_tracking = HEAD_ORIENT_TRK_REF; + *orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF; } else if ( strcmp( value, "AVG" ) == 0 ) { - *orientation_tracking = HEAD_ORIENT_TRK_AVG; + *orientation_tracking = IVAS_HEAD_ORIENT_TRK_AVG; } else if ( strcmp( value, "REF_VEC" ) == 0 ) { - *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC; + *orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF_VEC; } else if ( strcmp( value, "REF_VEC_LEV" ) == 0 ) { - *orientation_tracking = HEAD_ORIENT_TRK_REF_VEC_LEV; + *orientation_tracking = IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV; } else { @@ -2669,7 +2669,7 @@ static CmdlnArgs defaultArgs( clearString( args.renderConfigFilePath ); clearString( args.externalOrientationFilePath ); - args.orientation_tracking = HEAD_ORIENT_TRK_NONE; + args.orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; args.nonDiegeticPan = 0; args.nonDiegeticPanGain = 0.f; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index f29e000f9e..a8d030ef99 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -196,12 +196,13 @@ typedef struct typedef enum { - HEAD_ORIENT_TRK_NONE, - HEAD_ORIENT_TRK_REF, - HEAD_ORIENT_TRK_AVG, - HEAD_ORIENT_TRK_REF_VEC, - HEAD_ORIENT_TRK_REF_VEC_LEV -} HEAD_ORIENT_TRK_T; + IVAS_HEAD_ORIENT_TRK_NONE, + IVAS_HEAD_ORIENT_TRK_REF, + IVAS_HEAD_ORIENT_TRK_AVG, + IVAS_HEAD_ORIENT_TRK_REF_VEC, + IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV + +} IVAS_HEAD_ORIENT_TRK_T; typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 5b799c29e1..e5e842a400 100755 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -889,20 +889,20 @@ typedef struct ivas_masa_ism_data_structure typedef struct decoder_config_structure { - int32_t ivas_total_brate; /* IVAS total bitrate in bps */ - int32_t last_ivas_total_brate; /* last IVAS total bitrate in bps */ - int32_t output_Fs; /* output signal sampling frequency in Hz */ - int16_t nchan_out; /* number of output audio channels */ - AUDIO_CONFIG output_config; /* output audio configuration */ - int16_t Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ - int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ - int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ - int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ - HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ - int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ - float non_diegetic_pan_gain; /* non diegetic panning gain*/ - int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ - int16_t Opt_ExternalOrientation; /* indiates whether external orientations are used */ + int32_t ivas_total_brate; /* IVAS total bitrate in bps */ + int32_t last_ivas_total_brate; /* last IVAS total bitrate in bps */ + int32_t output_Fs; /* output signal sampling frequency in Hz */ + int16_t nchan_out; /* number of output audio channels */ + AUDIO_CONFIG output_config; /* output audio configuration */ + int16_t Opt_LsCustom; /* indicates whether loudspeaker custom setup is used */ + int16_t Opt_HRTF_binary; /* indicates whether HRTF binary file is used */ + int16_t Opt_Headrotation; /* indicates whether head-rotation is used */ + int16_t Opt_RendConfigCustom; /* indicates whether Renderer configuration custom setup is used */ + IVAS_HEAD_ORIENT_TRK_T orientation_tracking; /* indicates orientation tracking type */ + int16_t Opt_non_diegetic_pan; /* indicates diegetic or not */ + float non_diegetic_pan_gain; /* non diegetic panning gain*/ + int16_t Opt_AMR_WB; /* flag indicating AMR-WB IO mode */ + int16_t Opt_ExternalOrientation; /* indiates whether external orientations are used */ /* temp. development parameters */ #ifdef DEBUGGING diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 179455e801..79b6973a8a 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -287,7 +287,7 @@ static void init_decoder_config( hDecoderConfig->Opt_HRTF_binary = 0; hDecoderConfig->Opt_Headrotation = 0; hDecoderConfig->Opt_RendConfigCustom = 0; - hDecoderConfig->orientation_tracking = HEAD_ORIENT_TRK_NONE; + hDecoderConfig->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; hDecoderConfig->Opt_non_diegetic_pan = 0; hDecoderConfig->non_diegetic_pan_gain = 0; #ifdef API_5MS @@ -404,15 +404,15 @@ ivas_error IVAS_DEC_Configure( const int16_t tsmEnabled, /* i : enable TSM */ const int16_t enable5ms, #endif - const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ - const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ - const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ - const int16_t enableExternalOrientation, /* i : enable external orientations */ - const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ - const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ - const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ - const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ - const int16_t delayCompensationEnabled /* i : enable delay compensation */ + const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ + const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ + const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ + const int16_t enableExternalOrientation, /* i : enable external orientations */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ + const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ + const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ + const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ + const int16_t delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -3561,20 +3561,20 @@ static ivas_error printConfigInfo_dec( fprintf( stdout, "External orientation: ON\n" ); } - if ( st_ivas->hDecoderConfig->orientation_tracking != HEAD_ORIENT_TRK_NONE ) + if ( st_ivas->hDecoderConfig->orientation_tracking != IVAS_HEAD_ORIENT_TRK_NONE ) { switch ( st_ivas->hDecoderConfig->orientation_tracking ) { - case HEAD_ORIENT_TRK_AVG: + case IVAS_HEAD_ORIENT_TRK_AVG: fprintf( stdout, "Orientation tracking: AVG\n" ); break; - case HEAD_ORIENT_TRK_REF: + case IVAS_HEAD_ORIENT_TRK_REF: fprintf( stdout, "Orientation tracking: REF\n" ); break; - case HEAD_ORIENT_TRK_REF_VEC: + case IVAS_HEAD_ORIENT_TRK_REF_VEC: fprintf( stdout, "Orientation tracking: REF_VEC\n" ); break; - case HEAD_ORIENT_TRK_REF_VEC_LEV: + case IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV: fprintf( stdout, "Orientation tracking: REF_VEC_LEV\n" ); break; default: diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index b84574223e..279e9ee7f2 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -141,7 +141,7 @@ ivas_error IVAS_DEC_Configure( const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ const int16_t enableHeadRotation, /* i : enable head rotation for binaural output */ const int16_t enableExternalOrientation, /* i : enable external orientations */ - const HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking, /* i : head orientation tracking type */ const int16_t renderConfigEnabled, /* i : enable Renderer config. file for binaural output */ const int16_t Opt_non_diegetic_pan, /* i : diegetic or not */ const float non_diegetic_pan_gain, /* i : non diegetic panning gain */ diff --git a/lib_rend/ivas_orient_trk.c b/lib_rend/ivas_orient_trk.c index 64945b5c7b..92f2b6d7b3 100644 --- a/lib_rend/ivas_orient_trk.c +++ b/lib_rend/ivas_orient_trk.c @@ -406,7 +406,7 @@ ivas_error ivas_orient_trk_Init( pOTR->refRot = identity; /* set safe default tracking mode */ - pOTR->orientation_tracking = HEAD_ORIENT_TRK_NONE; + pOTR->orientation_tracking = IVAS_HEAD_ORIENT_TRK_NONE; return IVAS_ERR_OK; } @@ -419,8 +419,8 @@ ivas_error ivas_orient_trk_Init( *-------------------------------------------------------------------*/ ivas_error ivas_orient_trk_SetTrackingType( - ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ + ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ ) { if ( pOTR == NULL ) @@ -481,15 +481,15 @@ ivas_error ivas_orient_trk_GetMainOrientation( switch ( pOTR->orientation_tracking ) { - case HEAD_ORIENT_TRK_NONE: + case IVAS_HEAD_ORIENT_TRK_NONE: *pOrientation = IdentityQuaternion(); break; - case HEAD_ORIENT_TRK_REF_VEC: - case HEAD_ORIENT_TRK_REF_VEC_LEV: - case HEAD_ORIENT_TRK_REF: + case IVAS_HEAD_ORIENT_TRK_REF_VEC: + case IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV: + case IVAS_HEAD_ORIENT_TRK_REF: *pOrientation = pOTR->refRot; break; - case HEAD_ORIENT_TRK_AVG: + case IVAS_HEAD_ORIENT_TRK_AVG: *pOrientation = pOTR->absAvgRot; break; } @@ -543,13 +543,13 @@ ivas_error ivas_orient_trk_SetReferenceVector( switch ( pOTR->orientation_tracking ) { - case HEAD_ORIENT_TRK_NONE: - case HEAD_ORIENT_TRK_REF: - case HEAD_ORIENT_TRK_AVG: - case HEAD_ORIENT_TRK_REF_VEC: + case IVAS_HEAD_ORIENT_TRK_NONE: + case IVAS_HEAD_ORIENT_TRK_REF: + case IVAS_HEAD_ORIENT_TRK_AVG: + case IVAS_HEAD_ORIENT_TRK_REF_VEC: acousticFrontVector = VectorSubtract( listenerPos, refPos ); break; - case HEAD_ORIENT_TRK_REF_VEC_LEV: + case IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV: /* ignore the height difference between listener position and reference position */ listenerPosLevel.z = refPosLevel.z = listenerPos.z; listenerPosLevel.x = listenerPos.x; @@ -609,12 +609,12 @@ ivas_error ivas_orient_trk_Process( switch ( pOTR->orientation_tracking ) { - case HEAD_ORIENT_TRK_NONE: + case IVAS_HEAD_ORIENT_TRK_NONE: pOTR->trkRot = absRot; break; - case HEAD_ORIENT_TRK_REF: - case HEAD_ORIENT_TRK_REF_VEC: - case HEAD_ORIENT_TRK_REF_VEC_LEV: + case IVAS_HEAD_ORIENT_TRK_REF: + case IVAS_HEAD_ORIENT_TRK_REF_VEC: + case IVAS_HEAD_ORIENT_TRK_REF_VEC_LEV: /* Reset average orientation */ pOTR->absAvgRot = absRot; @@ -626,7 +626,7 @@ ivas_error ivas_orient_trk_Process( QuaternionProduct( pOTR->trkRot, absRot, &pOTR->trkRot ); break; - case HEAD_ORIENT_TRK_AVG: + case IVAS_HEAD_ORIENT_TRK_AVG: /* Compute average (low-pass filtered) absolute orientation */ QuaternionSlerp( pOTR->absAvgRot, absRot, alpha, &pOTR->absAvgRot ); diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 578bac9dee..635822349e 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -1342,7 +1342,7 @@ ivas_error ivas_orient_trk_Init( ivas_error ivas_orient_trk_SetTrackingType( ivas_orient_trk_state_t *pOTR, /* i/o: orientation tracker handle */ - const HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : orientation tracking type */ ); ivas_error ivas_orient_trk_SetReferenceRotation( diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 86f8c71cfa..84ce24b765 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -604,7 +604,7 @@ typedef struct EFAP typedef struct ivas_orient_trk_state_t { - HEAD_ORIENT_TRK_T orientation_tracking; + IVAS_HEAD_ORIENT_TRK_T orientation_tracking; float centerAdaptationRate; float offCenterAdaptationRate; float adaptationAngle; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 50741300cb..2943e9a784 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -5416,8 +5416,8 @@ IVAS_REND_SetSplitRendBFI( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetOrientationTrackingMode( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ ) { return ivas_orient_trk_SetTrackingType( hIvasRend->headRotData.hOrientationTracker, orientation_tracking ); diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 86378cc52c..3e1984378c 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -300,7 +300,7 @@ ivas_error IVAS_REND_DisableHeadRotation( ivas_error IVAS_REND_SetOrientationTrackingMode( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const HEAD_ORIENT_TRK_T orientation_tracking /* i : Head orientation tracking type */ + const IVAS_HEAD_ORIENT_TRK_T orientation_tracking/*i : Head orientation tracking type */ ); ivas_error IVAS_REND_SetReferenceRotation( -- GitLab From 2a2436dcf9693842e45b62e657519b51fedc4285 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 30 Aug 2023 17:47:49 +0200 Subject: [PATCH 03/10] rename QC_ABS_COEFF to IVAS_ROOM_ABS_COEFF --- lib_com/common_api_types.h | 12 ++++++------ lib_util/render_config_reader.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index a8d030ef99..e7b051750a 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -61,7 +61,7 @@ #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 // ToDo: should it be harmonized with IVAS_MAX_PARAM_SPATIAL_SUBFRAMES? #endif -#define QC_ABS_COEFF 6 +#define IVAS_ROOM_ABS_COEFF 6 #ifdef SPLIT_REND_WITH_HEAD_ROT #define IVAS_NUM_FRAMES_PER_SEC 50 @@ -245,11 +245,11 @@ typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG float inputPreDelay; /* Offset in seconds from where DSR is computed in the RIR (0 = at source), float, range [0.001..10] */ /* early reflections */ - int16_t use_er; /* ER activation flag */ - int32_t lowComplexity; /* Low complexity ER flag */ - IVAS_VECTOR3 dimensions; /* Room dimensions [m] */ - float AbsCoeff[QC_ABS_COEFF]; /* Absorption coeffs */ - IVAS_VECTOR3 ListenerOrigin; /* Listener origin */ + int16_t use_er; /* ER activation flag */ + int32_t lowComplexity; /* Low complexity ER flag */ + IVAS_VECTOR3 dimensions; /* Room dimensions [m] */ + float AbsCoeff[IVAS_ROOM_ABS_COEFF]; /* Absorption coeffs */ + IVAS_VECTOR3 ListenerOrigin; /* Listener origin */ } IVAS_ROOM_ACOUSTICS_CONFIG_DATA; diff --git a/lib_util/render_config_reader.c b/lib_util/render_config_reader.c index bdbfe3ec2b..b3ac66a3c3 100644 --- a/lib_util/render_config_reader.c +++ b/lib_util/render_config_reader.c @@ -2804,7 +2804,7 @@ ivas_error RenderConfigReader_getAcousticEnvironment( pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->z = ER_LIST_HEIGHT; } pAcEnv->ListenerOrigin = *pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin; - for ( j = 0; j < QC_ABS_COEFF; j++ ) + for ( j = 0; j < IVAS_ROOM_ABS_COEFF; j++ ) { pAcEnv->AbsCoeff[j] = pRenderConfigReader->pAE[n].pEarlyReflections->pAbsCoeff[j]; } -- GitLab From 64d562a031fb22d8696055c475e809be2dc5c54e Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 30 Aug 2023 17:54:35 +0200 Subject: [PATCH 04/10] add notes to highlight cases when public and internal constants are the same --- lib_com/cnst.h | 6 +++--- lib_com/common_api_types.h | 8 +++----- lib_com/ivas_cnst.h | 6 +++--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index b8fcb05934..0d604896c3 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -69,7 +69,7 @@ #define PCM16_TO_FLT_FAC 32768.0f #define MDFT_NORM_SCALING ( 1.0f / PCM16_TO_FLT_FAC ) #define MAX_FRAME_COUNTER 200 -#define MAX_BITS_PER_FRAME 10240 /* Bits per frame for max. bitrate 512kbps */ +#define MAX_BITS_PER_FRAME 10240 /* Bits per frame for max. bitrate 512kbps, == IVAS_MAX_BITS_PER_FRAME */ #define ENC 0 /* Index for "encoder" */ #define DEC 1 /* Index for "decoder" */ @@ -621,8 +621,8 @@ enum #define L_HP20_MEM 4 /* HP20 filter memory length */ -#define CLDFB_NO_CHANNELS_MAX 60 /* CLDFB resampling - max number of CLDFB channels */ -#define CLDFB_NO_COL_MAX 16 /* CLDFB resampling - max number of CLDFB col. */ +#define CLDFB_NO_CHANNELS_MAX 60 /* CLDFB resampling - max number of CLDFB channels, == IVAS_CLDFB_NO_CHANNELS_MAX */ +#define CLDFB_NO_COL_MAX 16 /* CLDFB resampling - max number of CLDFB col., == IVAS_CLDFB_NO_COL_MAX */ #define CLDFB_NO_COL_MAX_SWITCH 6 /* CLDFB resampling - max number of CLDFB col. for switching */ #define CLDFB_NO_COL_MAX_SWITCH_BFI 10 /* CLDFB resampling - max number of CLDFB col. for switching, BFI */ #define CLDFB_OVRLP_MIN_SLOTS 3 /* CLDFB resampling - minimize processing to minimum required for transition frame ACELP->TCX/HQ */ diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index e7b051750a..fbe5704f63 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -47,7 +47,7 @@ #define IVAS_NUM_FRAMES_PER_SEC 50 #define IVAS_MAX_FRAME_SIZE ( 48000 / IVAS_NUM_FRAMES_PER_SEC ) -#define IVAS_MAX_BITS_PER_FRAME ( 512000 / 50 ) +#define IVAS_MAX_BITS_PER_FRAME ( 512000 / IVAS_NUM_FRAMES_PER_SEC ) #define IVAS_MAX_NUM_OBJECTS 4 #define IVAS_MAX_INPUT_CHANNELS 16 #define IVAS_MAX_OUTPUT_CHANNELS 16 @@ -63,10 +63,8 @@ #define IVAS_ROOM_ABS_COEFF 6 #ifdef SPLIT_REND_WITH_HEAD_ROT -#define IVAS_NUM_FRAMES_PER_SEC 50 - -#define MAX_SPLIT_REND_BITRATE 768000 -#define IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) +#define IVAS_MAX_SPLIT_REND_BITRATE 768000 +#define IVAS_MAX_SPLIT_REND_BITS_BUFFER_SIZE_IN_BYTES ( ( ( (int32_t) IVAS_MAX_SPLIT_REND_BITRATE / IVAS_NUM_FRAMES_PER_SEC ) + 7 ) >> 3 ) #endif /*----------------------------------------------------------------------------------* diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 29473c091c..dd8f6f1b6f 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -143,12 +143,12 @@ typedef enum * IVAS general constants *----------------------------------------------------------------------------------*/ -#define MAX_INPUT_CHANNELS 16 /* Maximum number of input channels (HOA 3rd order) */ +#define MAX_INPUT_CHANNELS 16 /* Maximum number of input channels (HOA 3rd order), == IVAS_MAX_INPUT_CHANNELS */ #define MAX_TRANSPORT_CHANNELS 12 /* Maximum number of transport channels */ #define MAX_INTERN_CHANNELS 16 /* Maximum number of intern channels (HOA 3rd order) */ #define HEAD_ROTATION_HOA_ORDER 3 /* HOA 3rd order */ #define MAX_CICP_CHANNELS 16 /* max channels for loudspeaker layouts (16 for custom layouts)*/ -#define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order) */ +#define MAX_OUTPUT_CHANNELS 16 /* Maximum number of output channels (HOA 3rd order), == IVAS_MAX_OUTPUT_CHANNELS */ #define MAX_OUTPUT_CHANNELS_IN_DIEGETIC_PAN 2 /* Maximum number of output channels with non diegetic panning */ #define BINAURAL_CHANNELS 2 /* number of channels for binaural output configuration */ @@ -157,7 +157,7 @@ typedef enum #define HOA2_CHANNELS 9 #define HOA3_CHANNELS 16 -#define MAX_NUM_OBJECTS 4 /* max. number of audio objects */ +#define MAX_NUM_OBJECTS 4 /* max. number of audio objects, == IVAS_MAX_NUM_OBJECTS */ #define MAX_SCE MAX_NUM_OBJECTS /* max. number of SCEs */ #define MAX_CPE ( MAX_TRANSPORT_CHANNELS / CPE_CHANNELS ) /* max. number of CPEs */ -- GitLab From ad09b99718a4de32a39bf65fa0333c541593fda9 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 30 Aug 2023 18:23:36 +0200 Subject: [PATCH 05/10] rename MASA_DECODER_EXT_OUT_META_HANDLE to IVAS_MASA_DECODER_EXT_OUT_META_HANDLE --- apps/decoder.c | 14 +++++++------- apps/renderer.c | 2 +- lib_com/common_api_types.h | 2 +- lib_dec/lib_dec.h | 2 +- lib_rend/ivas_stat_rend.h | 2 ++ lib_rend/lib_rend.c | 2 +- lib_rend/lib_rend.h | 14 +++++++------- lib_util/masa_file_writer.h | 4 ++-- 8 files changed, 22 insertions(+), 20 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index f991e3d377..1fc32d6e1f 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1976,7 +1976,7 @@ static ivas_error initOnFirstGoodFrame( if ( numInitialBadFrames > 0 ) { /* Duplicate good first frame metadata to fill the beginning of stream. */ - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -2547,7 +2547,7 @@ static ivas_error decodeG192( } else if ( bsFormat == IVAS_DEC_BS_MASA ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -2709,7 +2709,7 @@ static ivas_error decodeG192( } else if ( bsFormat == IVAS_DEC_BS_MASA ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -3139,7 +3139,7 @@ static ivas_error decodeG192( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -3746,7 +3746,7 @@ static ivas_error decodeVoIP( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -4181,7 +4181,7 @@ static ivas_error decodeVariableSpeed( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); @@ -4357,7 +4357,7 @@ static ivas_error decodeVariableSpeed( if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM ) { - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta; if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) ); diff --git a/apps/renderer.c b/apps/renderer.c index 2f3b5b3a01..1b104bcd0e 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -1984,7 +1984,7 @@ int main( { IVAS_REND_AudioConfigType inputType1; IVAS_REND_AudioConfigType inputType2; - MASA_DECODER_EXT_OUT_META_HANDLE hMetaOutput; + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMetaOutput; int16_t numInputFormats; inputType1 = IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN; diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index fbe5704f63..47b22db869 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -203,7 +203,7 @@ typedef enum } IVAS_HEAD_ORIENT_TRK_T; typedef struct ivas_masa_metadata_frame_struct *IVAS_MASA_METADATA_HANDLE; -typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE; +typedef struct ivas_masa_decoder_ext_out_meta_struct *IVAS_MASA_DECODER_EXT_OUT_META_HANDLE; typedef struct TDREND_HRFILT_FiltSet_struct *IVAS_DEC_HRTF_HANDLE; typedef struct ivas_hrtfs_crend_structure *IVAS_DEC_HRTF_CREND_HANDLE; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index 279e9ee7f2..e9bed58f63 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -225,7 +225,7 @@ ivas_error IVAS_DEC_GetObjectMetadata( /*! r: error code */ ivas_error IVAS_DEC_GetMasaMetadata( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ - MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to metadata from the most recently decoded frame */ + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to metadata from the most recently decoded frame */ uint8_t getFromJbmBuffer /* i : get metadata from a JBM buffer */ ); diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index 84ce24b765..73a4dfc776 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -1630,6 +1630,8 @@ typedef enum * Multichannel MASA (McMASA) analysis structure *----------------------------------------------------------------------------------*/ +typedef struct ivas_masa_decoder_ext_out_meta_struct *MASA_DECODER_EXT_OUT_META_HANDLE; + typedef struct ivas_mcmasa_ana_data_structure { int16_t nbands; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 2943e9a784..97702e7385 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -9432,7 +9432,7 @@ ivas_error IVAS_REND_GetSamples( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, td_input, diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index 3e1984378c..71afc70abb 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -357,16 +357,16 @@ ivas_error IVAS_REND_GetCombinedOrientation( ); ivas_error IVAS_REND_GetMasaMetadata( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to analyzed MASA metadata */ - IVAS_REND_AudioConfigType inputType /* i : Input type */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to analyzed MASA metadata */ + IVAS_REND_AudioConfigType inputType /* i : Input type */ ); ivas_error IVAS_REND_MergeMasaMetadata( - IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ - MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to merged metadata */ - IVAS_REND_AudioConfigType inputType1, /* i : Input type 1 */ - IVAS_REND_AudioConfigType inputType2 /* i : Input type 2 */ + IVAS_REND_HANDLE hIvasRend, /* i/o: IVAS renderer handle */ + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE *hMasaExtOutMeta, /* o : pointer to handle, which will be set to point to merged metadata */ + IVAS_REND_AudioConfigType inputType1, /* i : Input type 1 */ + IVAS_REND_AudioConfigType inputType2 /* i : Input type 2 */ ); ivas_error IVAS_REND_SetTotalNumberOfObjects( diff --git a/lib_util/masa_file_writer.h b/lib_util/masa_file_writer.h index 6b1bcbb9fb..0619ff02e7 100644 --- a/lib_util/masa_file_writer.h +++ b/lib_util/masa_file_writer.h @@ -47,8 +47,8 @@ ivas_error MasaFileWriter_open( ); ivas_error MasaFileWriter_writeFrame( - MasaFileWriter *self, /* i/o: MasaFileWriter handle */ - MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ + MasaFileWriter *self, /* i/o: MasaFileWriter handle */ + IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta /* i/o: MASA ext out meta handle to be written */ ); void MasaFileWriter_close( -- GitLab From 0416a40e410c516d61c82153c75cd8e1a4c97692 Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 31 Aug 2023 18:46:31 +0200 Subject: [PATCH 06/10] fix macro name --- lib_rend/lib_rend.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index fb04d6fa7c..e43a858481 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -58,9 +58,9 @@ /* Maximum buffer length (total) in samples. */ /* Maximum buffer length (total) in samples. */ #ifdef SPLIT_REND_WITH_HEAD_ROT -#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) -#define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) +#define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#define MAX_CLDFB_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) +#define MAX_BIN_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) #define MAX_CLDFB_BIN_BUFFER_LENGTH ( MAX_CLDFB_BUFFER_LENGTH_PER_CHANNEL * BINAURAL_CHANNELS ) #else #define MAX_BUFFER_LENGTH ( MAX_BUFFER_LENGTH_PER_CHANNEL * MAX_INPUT_CHANNELS ) @@ -931,7 +931,7 @@ static ivas_error getMcConfigValues( break; } } - break; + break; case IVAS_AUDIO_CONFIG_MONO: case IVAS_AUDIO_CONFIG_STEREO: getSpeakerAzimuths( inConfig, azimuth ); @@ -3509,7 +3509,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN ivas_renderSplitUpdateNoCorrectionPoseData( pSplit_rend_config, &pSplitRendWrapper->multiBinPoseData ); } - if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in, outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM, + if ( ( error = ivas_split_renderer_open( pSplitRendWrapper, pSplit_rend_config, outputSampleRate, cldfb_in, outConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM, is_5ms_frame ) ) != IVAS_ERR_OK ) { return error; @@ -5149,7 +5149,7 @@ ivas_error IVAS_REND_FeedSplitBinauralBitstream( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_SetHeadRotation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ const IVAS_QUATERNION headRot, /* i : head orientations for next rendering call */ const IVAS_VECTOR3 Pos /* i : listener positions for next rendering call */ #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -5353,8 +5353,8 @@ ivas_error IVAS_REND_SetReferenceVector( *---------------------------------------------------------------------*/ ivas_error IVAS_REND_SetExternalOrientation( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - IVAS_QUATERNION *orientation, /* i : external orientation data */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + IVAS_QUATERNION *orientation, /* i : external orientation data */ int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ int8_t enableRotationInterpolation, /* i : flag to interpolate rotations from current and previous frames */ @@ -5372,7 +5372,7 @@ ivas_error IVAS_REND_SetExternalOrientation( if ( orientation == NULL ) { hIvasRend->hExternalOrientationData->enableExternalOrientation[sf_idx] = 0; - } + } else { QuaternionInverse( *orientation, &hIvasRend->hExternalOrientationData->Quaternions[sf_idx] ); @@ -5381,7 +5381,7 @@ ivas_error IVAS_REND_SetExternalOrientation( hIvasRend->hExternalOrientationData->enableExternalOrientation[sf_idx] = enableExternalOrientation; hIvasRend->hExternalOrientationData->enableRotationInterpolation[sf_idx] = enableRotationInterpolation; hIvasRend->hExternalOrientationData->numFramesToTargetOrientation[sf_idx] = numFramesToTargetOrientation; - } + } return IVAS_ERR_OK; } @@ -5533,9 +5533,9 @@ static ivas_error chooseCrossfade( const IVAS_REND_HeadRotData *headRotData, con } static ivas_error rotateFrameMc( - IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - AUDIO_CONFIG inConfig, /* i : Input Audio config */ - const LSSETUP_CUSTOM_STRUCT *pInCustomLs, /* i : Input Custom LS setup */ + IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ + AUDIO_CONFIG inConfig, /* i : Input Audio config */ + const LSSETUP_CUSTOM_STRUCT *pInCustomLs, /* i : Input Custom LS setup */ const IVAS_REND_HeadRotData *headRotData, /* i : Head rotation data */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ rotation_gains gains_prev, /* i/o: Previous frame rotation gains */ @@ -5666,8 +5666,8 @@ static ivas_error rotateFrameMc( ( *readPtr ) * ( crossfade[i] * gains[ch_in][ch_out] ); readPtr++; } - } } + } /* move gains to gains_prev */ for ( i = 0; i < nchan; i++ ) @@ -8860,7 +8860,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, td_input, -- GitLab From 6850750fd8e5122ef9a55ee4778def656fe49f9f Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 31 Aug 2023 19:56:30 +0200 Subject: [PATCH 07/10] fix build --- apps/decoder.c | 4 ++-- lib_dec/ivas_sba_dec.c | 10 +++++----- lib_dec/lib_dec.c | 36 ++++++++++++++++++------------------ lib_rend/lib_rend.c | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index af8cffcedd..c90944afd1 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -2184,7 +2184,7 @@ static ivas_error decodeG192( goto cleanup; } } - } + } if ( arg.enableExternalOrientation ) { @@ -2212,7 +2212,7 @@ static ivas_error decodeG192( goto cleanup; } } - } + } /* decode and get samples */ nSamplesRendered = 0; diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index bf2af0deaa..e239ae5cdb 100755 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -298,7 +298,7 @@ ivas_error ivas_sba_dec_reconfigure( #ifndef NONBE_FIX_736_FOA_BR_SWITCH if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) ) || ( last_ivas_total_brate > IVAS_256k && ivas_total_brate <= IVAS_256k ) || ( last_ivas_total_brate <= IVAS_256k && ivas_total_brate > IVAS_256k ) ) #else - if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != AUDIO_CONFIG_MONO ) ) ) + if ( ( ( st_ivas->renderer_type != RENDERER_DISABLE ) && ( st_ivas->renderer_type != RENDERER_SBA_LINEAR_DEC ) ) || ( ( hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_FOA ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_STEREO ) && ( st_ivas->hDecoderConfig->output_config != IVAS_AUDIO_CONFIG_MONO ) ) ) #endif { DIRAC_CONFIG_FLAG flag_config; @@ -329,10 +329,10 @@ ivas_error ivas_sba_dec_reconfigure( { #endif #ifndef NONBE_FIX_736_FOA_BR_SWITCH - if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK ) - { - return error; - } + if ( ( error = ivas_dirac_sba_config( st_ivas->hQMetaData, &st_ivas->element_mode_init, ivas_total_brate, st_ivas->sba_analysis_order, ivas_get_hodirac_flag( ivas_total_brate, st_ivas->sba_analysis_order ) ? IVAS_MAX_NUM_BANDS : ( IVAS_MAX_NUM_BANDS - SPAR_DIRAC_SPLIT_START_BAND ) ) ) != IVAS_ERR_OK ) + { + return error; + } #endif #ifdef NONBE_FIX_736_FOA_BR_SWITCH int16_t band_grouping[IVAS_MAX_NUM_BANDS + 1]; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 94d2490e46..54470bb02f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -76,7 +76,7 @@ struct IVAS_DEC int16_t bitstreamformat; /* Bitstream format flag (G.192/MIME/VOIP_G192_RTP/VOIP_RTPDUMP) */ bool Opt_VOIP; /* flag indicating VOIP mode with JBM */ - int16_t tsm_scale; /* scale for TSM operation */ + int16_t tsm_scale; /* scale for TSM operation */ int16_t tsm_max_scaling; float *apaExecBuffer; /* Buffer for APA scaling */ PCMDSP_APA_HANDLE hTimeScaler; @@ -368,7 +368,7 @@ ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ const AUDIO_CONFIG outputConfig, /* i : output configuration */ - const int16_t tsmEnabled, /* i : enable TSM */ + const int16_t tsmEnabled, /* i : enable TSM */ const int16_t enable5ms, const int16_t customLsOutputEnabled, /* i : enable custom loudspeaker setup handle */ const int16_t hrtfReaderEnabled, /* i : enable HRTF binary file input */ @@ -521,7 +521,7 @@ ivas_error IVAS_DEC_Get5msFlag( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_EnableVoIP( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const int16_t jbmSafetyMargin, /* i : allowed delay reserve for JBM, in milliseconds */ const IVAS_DEC_INPUT_FORMAT inputFormat /* i : format of the input bitstream */ ) @@ -580,14 +580,14 @@ ivas_error IVAS_DEC_EnableVoIP( } /* initialize JBM */ - if ( ( error = JB4_Create( &hIvasDec->hVoIP->hJBM ) != IVAS_ERR_OK ) != IVAS_ERR_OK ) - { - return error; - } - if ( JB4_Init( hIvasDec->hVoIP->hJBM, jbmSafetyMargin ) != 0 ) - { - return IVAS_ERR_FAILED_ALLOC; - } + if ( ( error = JB4_Create( &hIvasDec->hVoIP->hJBM ) != IVAS_ERR_OK ) != IVAS_ERR_OK ) + { + return error; + } + if ( JB4_Init( hIvasDec->hVoIP->hJBM, jbmSafetyMargin ) != 0 ) + { + return IVAS_ERR_FAILED_ALLOC; + } return error; } @@ -912,7 +912,7 @@ ivas_error IVAS_DEC_GetSamples( pcmType, pcm_buffer_offset( pcmBuf, pcmType, nSamplesRendered * nOutChannels ) #else - pcmBuf + nSamplesRendered * nOutChannels + pcmBuf + nSamplesRendered * nOutChannels #endif ) ) != IVAS_ERR_OK ) @@ -1537,7 +1537,7 @@ ivas_error IVAS_DEC_GetMasaMetadata( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedHeadTrackData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION orientation, /* i : head-tracking data, listener orientation */ IVAS_VECTOR3 Pos, /* i : listener position */ const int16_t subframe_idx /*subframe index*/ @@ -1645,7 +1645,7 @@ ivas_error IVAS_DEC_FeedRefVectorData( *---------------------------------------------------------------------*/ ivas_error IVAS_DEC_FeedExternalOrientationData( - IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ + IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IVAS_QUATERNION orientation, /* i : external orientation data */ int8_t enableHeadRotation, /* i : flag to enable head rotation for this frame */ int8_t enableExternalOrientation, /* i : flag to enable external orientation for this frame */ @@ -2457,8 +2457,8 @@ ivas_error IVAS_DEC_Flush( *nSamplesFlushed = min( nSamplesPerChannel, hIvasDec->nSamplesAvailableNext ); - nSamplesToRender = (uint16_t) *nSamplesFlushed; - /* render IVAS frames */ + nSamplesToRender = (uint16_t) *nSamplesFlushed; + /* render IVAS frames */ if ( ( error = IVAS_DEC_GetRenderedSamples( hIvasDec, nSamplesToRender, &nSamplesFlushedLocal, &hIvasDec->nSamplesAvailableNext, #if defined SPLIT_REND_WITH_HEAD_ROT pcmType, @@ -3374,7 +3374,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); } - } + } else { if ( hIvasDec->st_ivas->hDecoderConfig->Opt_tsm ) @@ -3392,7 +3392,7 @@ static ivas_error IVAS_DEC_VoIP_reconfigure( set_zero( hIvasDec->apaExecBuffer, apa_buffer_size * nTransportChannels ); } /* realloc apa_exe_buffer */ - } + } hIvasDec->nTransportChannelsOld = nTransportChannels; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index e43a858481..05a3e16c88 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -8860,7 +8860,7 @@ static ivas_error getSamplesInternal( &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, - (const int16_t) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), + ( const int16_t )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, td_input, -- GitLab From 3dbc3a648bd296c169e456c6b4db110e6c799c7b Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 13 Sep 2023 18:21:08 +0200 Subject: [PATCH 08/10] clang-format --- lib_dec/lib_dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index d4aeca32b3..22e5d6d20a 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -388,7 +388,7 @@ ivas_error IVAS_DEC_Configure( #ifdef FIX_708_AEID_COMMAND_LINE const uint16_t acousticEnvironmentId, /* i : Acoustic environment ID */ #endif - const int16_t delayCompensationEnabled /* i : enable delay compensation */ + const int16_t delayCompensationEnabled /* i : enable delay compensation */ ) { Decoder_Struct *st_ivas; @@ -2885,7 +2885,7 @@ static ivas_error printConfigInfo_dec( if ( st_ivas->hDecoderConfig->Opt_dpid_on ) { fprintf( stdout, "Directivity pattern: ON\n" ); - } + } #endif #ifdef FIX_708_AEID_COMMAND_LINE -- GitLab From dce123ee672b0dd510ea75ccdebebcd183e4b2e7 Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 13 Sep 2023 18:41:53 +0200 Subject: [PATCH 09/10] fix SR build --- lib_dec/ivas_mc_param_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index 201997e0f4..f713b47b6c 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -1767,7 +1767,7 @@ void ivas_param_mc_dec_render( if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( st_ivas->hSplitBinRend.hCldfbDataOut != NULL ) { -- GitLab From 5d17449ec3dfef7e90db7ef163e747b67dd3bd5b Mon Sep 17 00:00:00 2001 From: vaclav Date: Thu, 14 Sep 2023 14:12:53 +0200 Subject: [PATCH 10/10] clang-format --- lib_rend/lib_rend.c | 48 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 723a7f90ae..d4e177167e 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -6002,10 +6002,10 @@ static ivas_error renderIsmToBinauralRoom( ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->currentPos.azimuth, ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->currentPos.elevation, #endif - currentPanGains ) ) != IVAS_ERR_OK ) - { - return error; - } + currentPanGains ) ) != IVAS_ERR_OK ) + { + return error; + } #ifdef FIX_518_ISM_BRIR_EXTREND } #endif @@ -6165,14 +6165,14 @@ static ivas_error renderIsmToMc( if ( position_changed ) { #endif - // TODO tmu review when #215 is resolved - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, - (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), - (int16_t) floorf( ismInput->currentPos.elevation + 0.5f ), - currentPanGains ) ) != IVAS_ERR_OK ) - { - return error; - } + // TODO tmu review when #215 is resolved + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, + (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), + (int16_t) floorf( ismInput->currentPos.elevation + 0.5f ), + currentPanGains ) ) != IVAS_ERR_OK ) + { + return error; + } #ifdef FIX_518_ISM_BRIR_EXTREND } @@ -6180,21 +6180,21 @@ static ivas_error renderIsmToMc( if ( !ismInput->firstFrameRendered ) { #endif - // TODO tmu review when #215 is resolved - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, - (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), - (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), + // TODO tmu review when #215 is resolved + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, + (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), + (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains #else previousPanGains #endif ) ) != IVAS_ERR_OK ) - { - return error; - } + { + return error; + } #ifdef FIX_518_ISM_BRIR_EXTREND - } + } #endif } @@ -6263,15 +6263,15 @@ static ivas_error renderIsmToSba( if ( !ismInput->firstFrameRendered ) { #endif - // TODO tmu review when #215 is resolved - ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), - (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), + // TODO tmu review when #215 is resolved + ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), + (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains, #else previousPanGains, #endif - ambiOrderOut ); + ambiOrderOut ); #ifdef FIX_518_ISM_BRIR_EXTREND } -- GitLab