diff --git a/apps/decoder.c b/apps/decoder.c index ea8a58f8db805cb44aaed016ab1af47b45799441..5b2ae9a1decd098b2c566f5e96ace36663609eed 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -103,7 +103,7 @@ typedef struct char *outputWavFilename; IVAS_DEC_MODE decMode; int32_t output_Fs; - IVAS_DEC_AUDIO_CONFIG outputFormat; + AUDIO_CONFIG outputFormat; bool quietModeEnabled; bool delayCompensationEnabled; bool voipMode; @@ -281,7 +281,7 @@ int main( if ( arg.hrtfReaderEnabled ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { arg.hrtfReaderEnabled = false; fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" ); @@ -303,9 +303,9 @@ int main( if ( arg.enableHeadRotation ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM + && arg.outputFormat != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputFormat != AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -327,7 +327,7 @@ int main( if ( arg.enableReferenceRotation ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -354,7 +354,7 @@ int main( if ( arg.enableReferenceVectorTracking ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" ); goto cleanup; @@ -407,9 +407,9 @@ int main( if ( arg.renderConfigEnabled ) { /* sanity check */ - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED && arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM + && arg.outputFormat != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputFormat != AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -427,8 +427,9 @@ int main( /*------------------------------------------------------------------------------------------* * Configure the decoder *------------------------------------------------------------------------------------------*/ + #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED || arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) + if ( arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { arg.enableHeadRotation = true; } @@ -581,9 +582,9 @@ int main( /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR && arg.outputFormat != IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB && - arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED && - arg.outputFormat != IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) + if ( arg.outputFormat != AUDIO_CONFIG_BINAURAL && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputFormat != AUDIO_CONFIG_BINAURAL_ROOM_REVERB && + arg.outputFormat != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && + arg.outputFormat != 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 ); @@ -796,10 +797,10 @@ cleanup: * Translate command-line argument to output configuration *---------------------------------------------------------------------*/ -static IVAS_DEC_AUDIO_CONFIG cmdline2config( +static AUDIO_CONFIG cmdline2config( char *argv ) { - IVAS_DEC_AUDIO_CONFIG output_config; + AUDIO_CONFIG output_config; char argv_to_upper[FILENAME_MAX]; @@ -809,73 +810,73 @@ static IVAS_DEC_AUDIO_CONFIG cmdline2config( if ( strcmp( argv_to_upper, "EXT" ) == 0 ) /* external renderer */ { - output_config = IVAS_DEC_OUTPUT_EXT; + output_config = AUDIO_CONFIG_EXTERNAL; } else if ( strcmp( argv_to_upper, "MONO" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_MONO; + output_config = AUDIO_CONFIG_MONO; } else if ( strcmp( argv_to_upper, "STEREO" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_STEREO; + output_config = AUDIO_CONFIG_STEREO; } else if ( strcmp( argv_to_upper, "5_1" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_5_1; + output_config = AUDIO_CONFIG_5_1; } else if ( strcmp( argv_to_upper, "7_1" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_7_1; + output_config = AUDIO_CONFIG_7_1; } else if ( strcmp( argv_to_upper, "5_1_2" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_5_1_2; + output_config = AUDIO_CONFIG_5_1_2; } else if ( strcmp( argv_to_upper, "5_1_4" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_5_1_4; + output_config = AUDIO_CONFIG_5_1_4; } else if ( strcmp( argv_to_upper, "7_1_4" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_7_1_4; + output_config = AUDIO_CONFIG_7_1_4; } else if ( strcmp( argv_to_upper, "FOA" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_FOA; + output_config = AUDIO_CONFIG_FOA; } else if ( strcmp( argv_to_upper, "HOA2" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_HOA2; + output_config = AUDIO_CONFIG_HOA2; } else if ( strcmp( argv_to_upper, "HOA3" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_HOA3; + output_config = AUDIO_CONFIG_HOA3; } else if ( strcmp( argv_to_upper, "BINAURAL" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_BINAURAL; + output_config = AUDIO_CONFIG_BINAURAL; } #ifdef SPLIT_REND_WITH_HEAD_ROT else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED; + output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM; + output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM; } #endif else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR; + output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR; } else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_REVERB" ) == 0 ) { - output_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB; + output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB; } else { - output_config = IVAS_DEC_OUTPUT_LS_CUSTOM; + output_config = AUDIO_CONFIG_LS_CUSTOM; } return output_config; @@ -905,7 +906,7 @@ static bool parseCmdlIVAS_dec( #endif #endif arg->output_Fs = 48000; - arg->outputFormat = IVAS_DEC_OUTPUT_MONO; + arg->outputFormat = AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_IVAS; arg->quietModeEnabled = false; arg->delayCompensationEnabled = true; @@ -1349,13 +1350,13 @@ static bool parseCmdlIVAS_dec( if ( i < argc - 3 ) { arg->outputFormat = cmdline2config( argv[i] ); - if ( arg->outputFormat == IVAS_DEC_OUTPUT_LS_CUSTOM ) + if ( arg->outputFormat == AUDIO_CONFIG_LS_CUSTOM ) { arg->customLsOutputEnabled = true; arg->customLsSetupFilename = argv[i]; } i++; - if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != IVAS_DEC_OUTPUT_STEREO ) ) + if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputFormat != AUDIO_CONFIG_STEREO ) ) { fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" ); usage_dec(); @@ -1364,11 +1365,11 @@ static bool parseCmdlIVAS_dec( } else { - arg->outputFormat = IVAS_DEC_OUTPUT_MONO; + arg->outputFormat = AUDIO_CONFIG_MONO; arg->decMode = IVAS_DEC_MODE_EVS; if ( ( arg->Opt_non_diegetic_pan ) ) { - arg->outputFormat = IVAS_DEC_OUTPUT_STEREO; + arg->outputFormat = AUDIO_CONFIG_STEREO; } } @@ -1566,8 +1567,8 @@ static ivas_error initOnFirstGoodFrame( return error; } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) || - ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) ) + if ( ( arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || + ( arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { pFullDelayNumSamples[0] = 0; } @@ -1594,7 +1595,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) + if ( arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { int16_t delayNumSamples_temp[3]; int32_t delayTimeScale_temp; @@ -1609,7 +1610,7 @@ static ivas_error initOnFirstGoodFrame( } else { - if ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) + if ( arg.outputFormat == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { int16_t delayNumSamples_temp[3]; int32_t delayTimeScale_temp; @@ -1677,7 +1678,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.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK ) { @@ -2056,7 +2057,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) ) + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == 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 ) != IVAS_ERR_OK ) @@ -2067,7 +2068,7 @@ static ivas_error decodeG192( } else { - if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) ) + if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputFormat == 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 ) != IVAS_ERR_OK ) @@ -2096,7 +2097,7 @@ static ivas_error decodeG192( } /* Write MASA/ISM metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( decodedGoodFrame && arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { #ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) @@ -2205,7 +2206,7 @@ static ivas_error decodeG192( } /* Print output metadata file name(s) */ - if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { @@ -2690,7 +2691,7 @@ static ivas_error decodeVoIP( } /* Write ISM metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( decodedGoodFrame && arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { int16_t i; @@ -3130,7 +3131,7 @@ static ivas_error decodeVariableSpeed( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( decodedGoodFrame && arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { #ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) @@ -3318,7 +3319,7 @@ static ivas_error decodeVariableSpeed( } /* Write ISm metadata to external file(s) */ - if ( decodedGoodFrame && arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( decodedGoodFrame && arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { #ifdef MASA_AND_OBJECTS if ( bsFormat == IVAS_DEC_BS_OBJ || bsFormat == IVAS_DEC_BS_MASA_ISM ) @@ -3404,7 +3405,7 @@ static ivas_error decodeVariableSpeed( } /* Print output metadata file name(s) */ - if ( arg.outputFormat == IVAS_DEC_OUTPUT_EXT ) + if ( arg.outputFormat == AUDIO_CONFIG_EXTERNAL ) { if ( bsFormat == IVAS_DEC_BS_OBJ ) { diff --git a/apps/renderer.c b/apps/renderer.c index 817b423383bbd80a4a89b65ad75ea112fd93a22c..02b78532dd4f45a4e61340b3e6058861391fb7ea 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -106,7 +106,7 @@ typedef struct } LfeRoutingConfig; typedef struct { - IVAS_REND_AudioConfig audioConfig; + AUDIO_CONFIG audioConfig; int32_t inputChannelIndex; float gain_dB; } RendererInput; @@ -136,7 +136,7 @@ typedef struct typedef struct { - IVAS_REND_AudioConfig audioConfig; + AUDIO_CONFIG audioConfig; IVAS_CUSTOM_LS_DATA outSetupCustom; } OutputConfig; @@ -365,7 +365,7 @@ static const CmdLnParser_Option cliOptions[] = { static const int32_t numCliOptions = sizeof( cliOptions ) / sizeof( CmdLnParser_Option ); -static IVAS_REND_AudioConfig ambisonicsOrderToEnum( const int16_t order ); +static AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ); static void parseSceneDescriptionFile( char *path, char *audioFilePath, InputConfig *inConfig, IsmPositionProvider *positionProvider, MasaFileReader **masaReaders, LfeRoutingConfig **lfeRoutingConfigs ); @@ -406,7 +406,7 @@ static ivas_error parseLfePanMtxFile( const char *lfeRoutingMatrixFilePath, IVAS static void printSupportedAudioConfigs( void ); -static IVAS_REND_AudioConfig parseAudioConfig( const char *configString ); +static 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 @@ -607,7 +607,7 @@ static void setupWithSingleFormatInput( else if ( args.inConfig.numBinBuses != 0 ) { *hhSplitRendFileReadWrite = NULL; - if ( args.inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { ivas_error error; error = split_rend_reader_open( hhSplitRendFileReadWrite, args.inMetadataFilePaths[0] ); @@ -684,7 +684,7 @@ static void rend_closeCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNEL return; } -static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig ) +static int16_t get_cldfb_in_flag( AUDIO_CONFIG audioConfig, IVAS_RENDER_CONFIG_DATA *renderConfig ) { int16_t cldfb_in; cldfb_in = 0; @@ -693,7 +693,7 @@ static int16_t get_cldfb_in_flag( IVAS_REND_AudioConfig audioConfig, IVAS_RENDER #ifdef DEBUGGING cldfb_in = 1; #endif - if ( audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { cldfb_in = 1; } @@ -707,7 +707,7 @@ static int16_t is_split_post_rend_mode( CmdlnArgs *args ) int16_t flag; flag = 0; if ( ( args->inConfig.numBinBuses > 0 ) && - ( ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( args->inConfig.binBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) + ( ( args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( args->inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) ) { flag = 1; } @@ -719,8 +719,8 @@ static int16_t is_split_pre_rend_mode( CmdlnArgs *args ) { int16_t flag; flag = 0; - if ( ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( args->outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( args->outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { flag = 1; } @@ -810,14 +810,14 @@ int main( CmdlnArgs args = parseCmdlnArgs( argc, argv ); - if ( args.nonDiegeticPan && !( ( args.inConfig.numAudioObjects == 0 && args.inConfig.multiChannelBuses[0].audioConfig == IVAS_REND_AUDIO_CONFIG_MONO ) || - ( args.inConfig.numAudioObjects > 0 && args.inConfig.audioObjects[0].audioConfig == IVAS_REND_AUDIO_CONFIG_OBJECT && args.inConfig.numAudioObjects == 1 ) ) ) + 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 ) ) ) { fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires mono or ISM1 input\n" ); exit( -1 ); } - if ( args.nonDiegeticPan && args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_STEREO ) + if ( args.nonDiegeticPan && args.outConfig.audioConfig != AUDIO_CONFIG_STEREO ) { fprintf( stderr, "\ninvalid configuration - non-diegetic panning requires stereo output\n" ); exit( -1 ); @@ -916,7 +916,7 @@ int main( } /* Check that there is allowed configuration for MASA format output */ - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) { if ( args.inConfig.numMasaBuses == 0 ) { @@ -935,7 +935,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 == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) + if ( ( args.inConfig.numBinBuses > 0 ) && ( args.inConfig.binBuses[0].audioConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) { error = split_rend_reader_open( &hSplitRendFileReadWrite, args.inputFilePath ); if ( error != IVAS_ERR_OK ) @@ -1045,13 +1045,13 @@ int main( /* sanity check */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && !is_split_pre_rend_mode( &args ) ) + 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 ) ) { 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 != IVAS_REND_AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( args.outConfig.audioConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stderr, "\nExternal Renderer Config is only supported for binaural output configurations. Exiting. \n" ); exit( -1 ); @@ -1075,7 +1075,7 @@ int main( exit( -1 ); } - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { renderConfig.room_acoustics.override = TRUE; } @@ -1104,7 +1104,7 @@ int main( } /* Set up output custom layout configuration */ - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( hIvasRend, args.outConfig.outSetupCustom ) ) != IVAS_ERR_OK ) { @@ -1113,7 +1113,7 @@ int main( } /* Set up MASA writer for MASA output */ - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == 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 ) @@ -1158,7 +1158,7 @@ int main( exit( -1 ); } - if ( args.inConfig.multiChannelBuses[i].audioConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( args.inConfig.multiChannelBuses[i].audioConfig == AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = IVAS_REND_ConfigureCustomInputLoudspeakerLayout( hIvasRend, mcIds[i], args.inConfig.inSetupCustom ) ) != IVAS_ERR_OK ) { @@ -1225,7 +1225,7 @@ int main( for ( i = 0; i < args.inConfig.numAudioObjects; ++i ) { - if ( ( error = IVAS_REND_AddInput( hIvasRend, IVAS_REND_AUDIO_CONFIG_OBJECT, &ismIds[i] ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_REND_AddInput( hIvasRend, AUDIO_CONFIG_OBA, &ismIds[i] ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error: %s\n", ivas_error_to_string( error ) ); exit( -1 ); @@ -1238,7 +1238,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 == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) { break; } @@ -1325,7 +1325,7 @@ int main( rend_openCldfb( cldfbAna, cldfbSyn, totalNumInChannels, numOutChannels, args.sampleRate ); } - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( args.outConfig.audioConfig == 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 ); @@ -1338,7 +1338,7 @@ int main( } else { - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( args.outConfig.audioConfig == 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 ); @@ -1624,7 +1624,7 @@ int main( for ( i = 0; i < args.inConfig.numAudioObjects; ++i ) { - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) { if ( i == 0 ) { @@ -1816,7 +1816,7 @@ int main( /* Write MASA metadata for MASA outputs */ - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_MASA1 || args.outConfig.audioConfig == AUDIO_CONFIG_MASA2 ) { IVAS_REND_AudioConfigType inputType1; IVAS_REND_AudioConfigType inputType2; @@ -1917,7 +1917,7 @@ int main( #endif #ifdef FIX_488_SYNC_DELAY - if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + if ( args.inConfig.numAudioObjects != 0 && ( args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL || args.outConfig.audioConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) { fprintf( stdout, "\n\nMetadata delayed %d subframes\n\n", (int16_t) round( args.syncMdDelay / ( 1000 / FRAMES_PER_SEC / MAX_PARAM_SPATIAL_SUBFRAMES ) ) ); } @@ -2002,20 +2002,20 @@ int main( * Local functions *------------------------------------------------------------------------------------------*/ -static IVAS_REND_AudioConfig ambisonicsOrderToEnum( +static AUDIO_CONFIG ambisonicsOrderToEnum( const int16_t order ) { switch ( order ) { case 1: - return IVAS_REND_AUDIO_CONFIG_FOA; + return AUDIO_CONFIG_FOA; case 2: - return IVAS_REND_AUDIO_CONFIG_HOA2; + return AUDIO_CONFIG_HOA2; case 3: - return IVAS_REND_AUDIO_CONFIG_HOA3; + return AUDIO_CONFIG_HOA3; } - return IVAS_REND_AUDIO_CONFIG_UNKNOWN; + return AUDIO_CONFIG_INVALID; } static const CmdLnParser_Option *findOptionById( @@ -2060,47 +2060,47 @@ static bool parseInConfig( return true; } - /* Check for single-format inputs. The given string should map to a member of IVAS_REND_AudioConfig enum. */ - IVAS_REND_AudioConfig audioConfig = parseAudioConfig( inFormatStr ); + /* Check for single-format inputs. The given string should map to a member of AUDIO_CONFIG enum. */ + AUDIO_CONFIG audioConfig = parseAudioConfig( inFormatStr ); switch ( audioConfig ) { - case IVAS_REND_AUDIO_CONFIG_MONO: - case IVAS_REND_AUDIO_CONFIG_STEREO: - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1_4: + 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: inConfig->numMultiChannelBuses = 1; inConfig->multiChannelBuses[0].audioConfig = audioConfig; inConfig->multiChannelBuses[0].inputChannelIndex = 0; inConfig->multiChannelBuses[0].gain_dB = 0.0f; break; - case IVAS_REND_AUDIO_CONFIG_FOA: - case IVAS_REND_AUDIO_CONFIG_HOA2: - case IVAS_REND_AUDIO_CONFIG_HOA3: + case AUDIO_CONFIG_FOA: + case AUDIO_CONFIG_HOA2: + case 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 IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case 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 IVAS_REND_AUDIO_CONFIG_MASA1: - case IVAS_REND_AUDIO_CONFIG_MASA2: + case AUDIO_CONFIG_MASA1: + case 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 IVAS_REND_AUDIO_CONFIG_OBJECT: + case AUDIO_CONFIG_OBA: /* If input format is objects, parse the characters after "ISM" to get number of objects */ { char *ptr = NULL; @@ -2124,8 +2124,8 @@ static bool parseInConfig( } } break; - case IVAS_REND_AUDIO_CONFIG_UNKNOWN: - /* This case will be reached if parsing string to IVAS_REND_AudioConfig enum fails. + case 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. */ { ivas_error error = parseCustomLayoutFile( inFormatStr, &inConfig->inSetupCustom ); @@ -2143,14 +2143,14 @@ static bool parseInConfig( return false; } inConfig->numMultiChannelBuses = 1; - inConfig->multiChannelBuses[0].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM; + inConfig->multiChannelBuses[0].audioConfig = AUDIO_CONFIG_LS_CUSTOM; inConfig->multiChannelBuses[0].inputChannelIndex = 0; inConfig->multiChannelBuses[0].gain_dB = 0.0f; } break; default: { - /* Default case covers formats that are defined in the IVAS_REND_AudioConfig enum, + /* Default case covers formats that are defined in the AUDIO_CONFIG enum, * but cannot be used at input, e.g. BINAURAL */ const CmdLnParser_Option *listOption = findOptionById( CmdLnOptionId_listFormats ); fprintf( stderr, "Unsupported input format: %s. To list valid formats, use option --%s.\n", inFormatStr, listOption->match ); @@ -2170,9 +2170,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 == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( outConfig->audioConfig == AUDIO_CONFIG_INVALID ) { - outConfig->audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM; + outConfig->audioConfig = AUDIO_CONFIG_LS_CUSTOM; if ( ( error = parseCustomLayoutFile( outputFormatStr, &outConfig->outSetupCustom ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Error while parsing output format option\n" ); @@ -2249,7 +2249,7 @@ static bool parseOrientationTracking( return true; } -static IVAS_REND_AudioConfig parseAudioConfig( +static AUDIO_CONFIG parseAudioConfig( const char *configString ) { #ifndef SPLIT_REND_WITH_HEAD_ROT @@ -2266,43 +2266,43 @@ static IVAS_REND_AudioConfig parseAudioConfig( if ( ( strcmp( charBuf, "MONO" ) == 0 ) || ( strcmp( charBuf, "HOA0" ) == 0 ) || ( strcmp( charBuf, "SBA0" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_MONO; + return AUDIO_CONFIG_MONO; } if ( ( strcmp( charBuf, "STEREO" ) == 0 ) || ( strcmp( charBuf, "CICP2" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_STEREO; + return AUDIO_CONFIG_STEREO; } if ( ( strcmp( charBuf, "FOA" ) == 0 ) || ( strcmp( charBuf, "SBA1" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_FOA; + return AUDIO_CONFIG_FOA; } if ( ( strcmp( charBuf, "HOA2" ) == 0 ) || ( strcmp( charBuf, "SBA2" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_HOA2; + return AUDIO_CONFIG_HOA2; } if ( ( strcmp( charBuf, "HOA3" ) == 0 ) || ( strcmp( charBuf, "SBA3" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_HOA3; + return AUDIO_CONFIG_HOA3; } if ( ( strcmp( charBuf, "5_1" ) == 0 ) || ( strcmp( charBuf, "CICP6" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_5_1; + return AUDIO_CONFIG_5_1; } if ( ( strcmp( charBuf, "7_1" ) == 0 ) || ( strcmp( charBuf, "CICP12" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_7_1; + return AUDIO_CONFIG_7_1; } if ( ( strcmp( charBuf, "5_1_2" ) == 0 ) || ( strcmp( charBuf, "CICP14" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_5_1_2; + return AUDIO_CONFIG_5_1_2; } if ( ( strcmp( charBuf, "5_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP16" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_5_1_4; + return AUDIO_CONFIG_5_1_4; } if ( ( strcmp( charBuf, "7_1_4" ) == 0 ) || ( strcmp( charBuf, "CICP19" ) == 0 ) ) { - return IVAS_REND_AUDIO_CONFIG_7_1_4; + return AUDIO_CONFIG_7_1_4; } if ( strncmp( charBuf, "ISM", 3 ) == 0 ) { @@ -2314,7 +2314,7 @@ static IVAS_REND_AudioConfig parseAudioConfig( case '2': case '3': case '4': - return IVAS_REND_AUDIO_CONFIG_OBJECT; + return AUDIO_CONFIG_OBA; } } if ( strncmp( charBuf, "MASA", 4 ) == 0 ) @@ -2324,36 +2324,36 @@ static IVAS_REND_AudioConfig parseAudioConfig( case '1': fprintf( stderr, "1TC MASA support is not functional and is pending on DirAC renderer refactoring.\n" ); exit( EXIT_FAILURE ); - /*return IVAS_REND_AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings + /*return AUDIO_CONFIG_MASA1;*/ // ToDo: temporarily disabled to avoid compilation warnings case '2': - return IVAS_REND_AUDIO_CONFIG_MASA2; + return AUDIO_CONFIG_MASA2; default: - return IVAS_REND_AUDIO_CONFIG_UNKNOWN; + return AUDIO_CONFIG_INVALID; } } if ( strcmp( charBuf, "BINAURAL" ) == 0 ) { - return IVAS_REND_AUDIO_CONFIG_BINAURAL; + return AUDIO_CONFIG_BINAURAL; } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( strcmp( charBuf, "BINAURAL_SPLIT_PCM" ) == 0 ) { - return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; + return AUDIO_CONFIG_BINAURAL_SPLIT_PCM; } if ( strcmp( charBuf, "BINAURAL_SPLIT_CODED" ) == 0 ) { - return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; + return AUDIO_CONFIG_BINAURAL_SPLIT_CODED; } #endif if ( strcmp( charBuf, "BINAURAL_ROOM_IR" ) == 0 ) { - return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR; + return AUDIO_CONFIG_BINAURAL_ROOM_IR; } if ( strcmp( charBuf, "BINAURAL_ROOM_REVERB" ) == 0 ) { - return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB; + return AUDIO_CONFIG_BINAURAL_ROOM_REVERB; } - return IVAS_REND_AUDIO_CONFIG_UNKNOWN; + return AUDIO_CONFIG_INVALID; } static bool parseLfePositionConfig( @@ -2441,7 +2441,7 @@ static bool checkRequiredArgs( fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort ); missingRequiredArg = true; } - if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( args.outConfig.audioConfig == AUDIO_CONFIG_INVALID ) { tmpOption = findOptionById( CmdLnOptionId_outputFormat ); fprintf( stderr, "Missing required argument: %s (%s)\n", tmpOption->match, tmpOption->matchShort ); @@ -2472,7 +2472,7 @@ static CmdlnArgs defaultArgs( args.inConfig.numMultiChannelBuses = 0; args.inConfig.numMasaBuses = 0; - args.outConfig.audioConfig = IVAS_REND_AUDIO_CONFIG_UNKNOWN; + args.outConfig.audioConfig = AUDIO_CONFIG_INVALID; args.outConfig.outSetupCustom.num_spk = 0; args.outConfig.outSetupCustom.num_lfe = 0; @@ -3231,9 +3231,9 @@ static void parseMc( --inConfig->multiChannelBuses[idx].inputChannelIndex; /* Convert from 1-indexing */ readNextMetadataChunk( line, "\n" ); - IVAS_REND_AudioConfig cfg = parseAudioConfig( line ); + AUDIO_CONFIG cfg = parseAudioConfig( line ); /* Try to use the given string as a path to a custom loudspeaker layout file. */ - if ( cfg == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( cfg == AUDIO_CONFIG_INVALID ) { ivas_error error = parseCustomLayoutFile( line, &inConfig->inSetupCustom ); @@ -3243,7 +3243,7 @@ static void parseMc( exit( -1 ); } inConfig->numMultiChannelBuses = 1; - inConfig->multiChannelBuses[idx].audioConfig = IVAS_REND_AUDIO_CONFIG_LS_CUSTOM; + inConfig->multiChannelBuses[idx].audioConfig = AUDIO_CONFIG_LS_CUSTOM; inConfig->multiChannelBuses[idx].inputChannelIndex = 0; inConfig->multiChannelBuses[idx].gain_dB = 0.0f; } diff --git a/lib_com/common_api_types.h b/lib_com/common_api_types.h index 79bda1eaa684ef220e80cae84ecaa5a800239894..8a51721b9765472bbe7bd1f26ffbbf28a9590387 100644 --- a/lib_com/common_api_types.h +++ b/lib_com/common_api_types.h @@ -53,6 +53,41 @@ #define RENDERER_HEAD_POSITIONS_PER_FRAME 4 +/*----------------------------------------------------------------------------------* + * Common API enum for output audio configurations + *----------------------------------------------------------------------------------*/ + +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; + + /*----------------------------------------------------------------------------------* * Common API structures *----------------------------------------------------------------------------------*/ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 6d89e222ecc83cd3a1afe3fab60d16aa1f13a001..48011e132c2d40a900e27337560b99f2589846a7 100644 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -86,49 +86,6 @@ typedef enum #endif -/*----------------------------------------------------------------------------------* - * IVAS output audio configurations - *----------------------------------------------------------------------------------*/ - -typedef enum -{ - 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 */ -#ifdef SPLIT_REND_WITH_HEAD_ROT - AUDIO_CONFIG_BINAURAL_SPLIT_CODED, /* split binaural with CLDFB coded output */ - AUDIO_CONFIG_BINAURAL_SPLIT_PCM, /* split binaural with PCM coded output */ -#endif - 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 */ // TODO: seems not to be used - AUDIO_CONFIG_MASA2, /* MASA2 */ // TODO: seems not to be used - AUDIO_CONFIG_EXTERNAL /* external renderer */ - -} AUDIO_CONFIG; - -typedef enum -{ - RENDER_TYPE_OVERRIDE_NONE, - RENDER_TYPE_OVERRIDE_CREND, - RENDER_TYPE_OVERRIDE_FASTCONV -} ivas_renderTypeOverride; - /*----------------------------------------------------------------------------------* * IVAS rendering configurations *----------------------------------------------------------------------------------*/ @@ -165,6 +122,16 @@ typedef enum } RENDERER_TYPE; +#ifdef DEBUGGING +typedef enum +{ + RENDER_TYPE_OVERRIDE_NONE, + RENDER_TYPE_OVERRIDE_CREND, + RENDER_TYPE_OVERRIDE_FASTCONV + +} ivas_renderTypeOverride; +#endif + /*----------------------------------------------------------------------------------* * IVAS general constants *----------------------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_binRenderer_internal.c b/lib_dec/ivas_binRenderer_internal.c index 0e95aa2af47f0ca81d5f4011204a97dae15722e5..dd571e83d671b2ac871771b2d5675580ff0a471a 100644 --- a/lib_dec/ivas_binRenderer_internal.c +++ b/lib_dec/ivas_binRenderer_internal.c @@ -1040,15 +1040,14 @@ static void ivas_binaural_obtain_DMX( ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, - const IVAS_REND_AudioConfig inConfig, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { BINAURAL_RENDERER_HANDLE hBinRenderer; int16_t convBand; ivas_error error; - AUDIO_CONFIG in_config, out_config; error = IVAS_ERR_OK; @@ -1073,8 +1072,6 @@ ivas_error ivas_rend_openCldfbRend( convBand = hBinRenderer->max_band; hBinRenderer->timeSlots = MAX_PARAM_SPATIAL_SUBFRAMES; /* Corresponds to 5 msec sound to motion latency */ - in_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); - out_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); if ( convBand > BINAURAL_CONVBANDS ) { @@ -1087,7 +1084,7 @@ ivas_error ivas_rend_openCldfbRend( hBinRenderer->hInputSetup->is_loudspeaker_setup = 0; getAudioConfigNumChannels( inConfig, &hBinRenderer->hInputSetup->nchan_out_woLFE ); - if ( ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || ( out_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { #ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG hBinRenderer->numPoses = pMultiBinPoseData->num_poses + 1; @@ -1108,7 +1105,7 @@ ivas_error ivas_rend_openCldfbRend( /* Allocate memories and buffers needed for convolutional module */ - if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, in_config, + if ( ( error = ivas_binRenderer_convModuleOpen( hBinRenderer, RENDERER_BINAURAL_FASTCONV, hBinRenderer->hInputSetup->is_loudspeaker_setup, inConfig, pCldfbRend->hHrtfFastConv, hBinRenderer->numPoses ) ) != IVAS_ERR_OK ) { return error; diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index ee50dea27ec2b5d4a0878a7fb1da5a135f837c45..fa5cabf5e8a7087c71253a8f93fbe4bb9da4f854 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -293,185 +293,6 @@ void IVAS_DEC_Close( return; } -#ifdef SPLIT_REND_WITH_HEAD_ROT -/*---------------------------------------------------------------------* - * mapAudioConfig2DecAudioConfig() - * - * - *---------------------------------------------------------------------*/ - -static IVAS_DEC_AUDIO_CONFIG mapAudioConfig2DecAudioConfig( - const AUDIO_CONFIG audio_config ) -{ - IVAS_DEC_AUDIO_CONFIG dec_audio_config; - - if ( audio_config == AUDIO_CONFIG_EXTERNAL ) /* external renderer */ - { - dec_audio_config = IVAS_DEC_OUTPUT_EXT; - } - else if ( audio_config == AUDIO_CONFIG_MONO ) - { - dec_audio_config = IVAS_DEC_OUTPUT_MONO; - } - else if ( audio_config == AUDIO_CONFIG_STEREO ) - { - dec_audio_config = IVAS_DEC_OUTPUT_STEREO; - } - else if ( audio_config == AUDIO_CONFIG_5_1 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_5_1; - } - else if ( audio_config == AUDIO_CONFIG_7_1 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_7_1; - } - else if ( audio_config == AUDIO_CONFIG_5_1_2 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_5_1_2; - } - else if ( audio_config == AUDIO_CONFIG_5_1_4 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_5_1_4; - } - else if ( audio_config == AUDIO_CONFIG_7_1_4 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_7_1_4; - } - else if ( audio_config == AUDIO_CONFIG_LS_CUSTOM ) - { - dec_audio_config = IVAS_DEC_OUTPUT_LS_CUSTOM; - } - else if ( audio_config == AUDIO_CONFIG_FOA ) - { - dec_audio_config = IVAS_DEC_OUTPUT_FOA; - } - else if ( audio_config == AUDIO_CONFIG_HOA2 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_HOA2; - } - else if ( audio_config == AUDIO_CONFIG_HOA3 ) - { - dec_audio_config = IVAS_DEC_OUTPUT_HOA3; - } - else if ( audio_config == AUDIO_CONFIG_BINAURAL ) - { - dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL; - } - else if ( audio_config == AUDIO_CONFIG_BINAURAL_ROOM_IR ) - { - dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR; - } - else if ( audio_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) - { - dec_audio_config = IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB; - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - else if ( audio_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) - { - dec_audio_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED; - } - else if ( audio_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) - { - dec_audio_config = IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM; - } -#endif - else - { - dec_audio_config = IVAS_DEC_OUTPUT_UNKNOWN; - } - - return dec_audio_config; -} -#endif - -/*---------------------------------------------------------------------* - * mapOutputFormat() - * - * - *---------------------------------------------------------------------*/ - -static AUDIO_CONFIG mapOutputFormat( - const IVAS_DEC_AUDIO_CONFIG outputFormat ) -{ - AUDIO_CONFIG output_config; - - if ( outputFormat == IVAS_DEC_OUTPUT_EXT ) /* external renderer */ - { - output_config = AUDIO_CONFIG_EXTERNAL; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_MONO ) - { - output_config = AUDIO_CONFIG_MONO; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_STEREO ) - { - output_config = AUDIO_CONFIG_STEREO; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_5_1 ) - { - output_config = AUDIO_CONFIG_5_1; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_7_1 ) - { - output_config = AUDIO_CONFIG_7_1; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_5_1_2 ) - { - output_config = AUDIO_CONFIG_5_1_2; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_5_1_4 ) - { - output_config = AUDIO_CONFIG_5_1_4; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_7_1_4 ) - { - output_config = AUDIO_CONFIG_7_1_4; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_LS_CUSTOM ) - { - output_config = AUDIO_CONFIG_LS_CUSTOM; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_FOA ) - { - output_config = AUDIO_CONFIG_FOA; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_HOA2 ) - { - output_config = AUDIO_CONFIG_HOA2; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_HOA3 ) - { - output_config = AUDIO_CONFIG_HOA3; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL ) - { - output_config = AUDIO_CONFIG_BINAURAL; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR ) - { - output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB ) - { - output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB; - } -#ifdef SPLIT_REND_WITH_HEAD_ROT - else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED ) - { - output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED; - } - else if ( outputFormat == IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM ) - { - output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM; - } -#endif - else - { - output_config = AUDIO_CONFIG_INVALID; - } - - return output_config; -} /*---------------------------------------------------------------------* @@ -519,7 +340,7 @@ static IVAS_DEC_BS_FORMAT mapIvasFormat( ivas_error IVAS_DEC_Configure( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ const uint32_t sampleRate, /* i : output sampling frequency */ - const IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ + const AUDIO_CONFIG outputFormat, /* i : output format */ 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 */ @@ -546,8 +367,8 @@ ivas_error IVAS_DEC_Configure( return IVAS_ERR_WRONG_PARAMS; } - if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputFormat == IVAS_DEC_OUTPUT_MONO && Opt_non_diegetic_pan == 0 ) || - ( outputFormat == IVAS_DEC_OUTPUT_STEREO && Opt_non_diegetic_pan == 1 ) ) ) + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS && !( ( outputFormat == AUDIO_CONFIG_MONO && Opt_non_diegetic_pan == 0 ) || + ( outputFormat == AUDIO_CONFIG_STEREO && Opt_non_diegetic_pan == 1 ) ) ) { return IVAS_ERR_WRONG_MODE; } @@ -556,7 +377,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig = st_ivas->hDecoderConfig; - hDecoderConfig->output_config = mapOutputFormat( outputFormat ); + hDecoderConfig->output_config = outputFormat; if ( hDecoderConfig->output_config == AUDIO_CONFIG_INVALID ) { return IVAS_ERR_WRONG_PARAMS; @@ -570,7 +391,7 @@ ivas_error IVAS_DEC_Configure( hDecoderConfig->nchan_out = 1; } - if ( outputFormat != IVAS_DEC_OUTPUT_EXT && outputFormat != IVAS_DEC_OUTPUT_LS_CUSTOM ) + if ( outputFormat != AUDIO_CONFIG_EXTERNAL && outputFormat != AUDIO_CONFIG_LS_CUSTOM ) { hDecoderConfig->nchan_out = audioCfg2channels( hDecoderConfig->output_config ); } @@ -3374,11 +3195,11 @@ ivas_error IVAS_DEC_VoIP_reconfigure( * *---------------------------------------------------------------------*/ 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 */ - IVAS_DEC_AUDIO_CONFIG *audio_config, - int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ + 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 */ + int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ ) { Decoder_Struct *st_ivas; @@ -3396,7 +3217,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( num_samples = 0; if ( st_ivas->splitBinRend.hCldfbDataOut != NULL ) { - *audio_config = mapAudioConfig2DecAudioConfig( st_ivas->splitBinRend.hCldfbDataOut->config ); + *audio_config = st_ivas->splitBinRend.hCldfbDataOut->config; if ( st_ivas->splitBinRend.hCldfbDataOut->config != AUDIO_CONFIG_INVALID ) { num_chs = audioCfg2channels( st_ivas->splitBinRend.hCldfbDataOut->config ); @@ -3418,7 +3239,7 @@ ivas_error IVAS_DEC_GetCldfbSamples( } else { - *audio_config = IVAS_DEC_OUTPUT_UNKNOWN; + *audio_config = AUDIO_CONFIG_INVALID; } *nOutSamples = num_samples; return error; diff --git a/lib_dec/lib_dec.h b/lib_dec/lib_dec.h index ba6432bd303ba1f521407316824f3e78e4626a41..ad93e198463a3dbb62d89f0cdcc8ac66c157fe1f 100644 --- a/lib_dec/lib_dec.h +++ b/lib_dec/lib_dec.h @@ -40,31 +40,6 @@ * Decoder enums *---------------------------------------------------------------------*/ -/* output formats generated by the decoder */ -typedef enum _IVAS_DEC_OUTPUT_CONFIG -{ - IVAS_DEC_OUTPUT_MONO = 0x0001, - IVAS_DEC_OUTPUT_STEREO, - IVAS_DEC_OUTPUT_5_1, - IVAS_DEC_OUTPUT_7_1, - IVAS_DEC_OUTPUT_5_1_2, - IVAS_DEC_OUTPUT_5_1_4, - IVAS_DEC_OUTPUT_7_1_4, - IVAS_DEC_OUTPUT_LS_CUSTOM, - IVAS_DEC_OUTPUT_FOA, - IVAS_DEC_OUTPUT_HOA2, - IVAS_DEC_OUTPUT_HOA3, - IVAS_DEC_OUTPUT_BINAURAL, -#ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_DEC_OUTPUT_SPLIT_BINAURAL_CODED, - IVAS_DEC_OUTPUT_SPLIT_BINAURAL_PCM, -#endif - IVAS_DEC_OUTPUT_BINAURAL_ROOM_IR, - IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB, - IVAS_DEC_OUTPUT_EXT, - IVAS_DEC_OUTPUT_UNKNOWN = 0xffff -} IVAS_DEC_AUDIO_CONFIG; - /* mode the decoder is operating in */ typedef enum _IVAS_DEC_MODE { @@ -147,7 +122,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 IVAS_DEC_AUDIO_CONFIG outputFormat, /* i : output format */ + const AUDIO_CONFIG outputFormat, /* i : audio configuration */ 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 */ @@ -188,11 +163,11 @@ ivas_error IVAS_DEC_GetSamples( #ifdef SPLIT_REND_WITH_HEAD_ROT /*! r: decoder error code */ 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 */ - IVAS_DEC_AUDIO_CONFIG *audio_config, - int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ + 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 */ + int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ ); #endif diff --git a/lib_rend/ivas_crend.c b/lib_rend/ivas_crend.c index e33304356017dc0b89a9cbfdb1cc05dc2b83b518..e21ef9bf5227f42c097e25b499220efb96c7df61 100644 --- a/lib_rend/ivas_crend.c +++ b/lib_rend/ivas_crend.c @@ -155,8 +155,8 @@ static ivas_error ivas_hrtf_close( static ivas_error ivas_rend_initCrend( CREND_WRAPPER *pCrend, - const AUDIO_CONFIG inIvasConfig, - const AUDIO_CONFIG outIvasConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, HRTFS_CREND_HANDLE hSetOfHRTF, const int32_t output_Fs ) { @@ -165,11 +165,6 @@ static ivas_error ivas_rend_initCrend( IVAS_REND_AudioConfigType inConfigType; HRTFS_HANDLE hHrtf; ivas_error error; - IVAS_REND_AudioConfig inConfig; - IVAS_REND_AudioConfig outConfig; - - inConfig = getRendAudioConfigFromIvasAudioConfig( inIvasConfig ); - outConfig = getRendAudioConfigFromIvasAudioConfig( outIvasConfig ); inConfigType = getAudioConfigType( inConfig ); hHrtf = pCrend->hHrtfCrend; @@ -180,9 +175,9 @@ static ivas_error ivas_rend_initCrend( return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Encountered unsupported input config in Crend" ); } - if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB + if ( outConfig != AUDIO_CONFIG_BINAURAL && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB #ifdef SPLIT_REND_WITH_HEAD_ROT - && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM + && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -197,7 +192,6 @@ static ivas_error ivas_rend_initCrend( } } - if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) { return error; @@ -218,7 +212,7 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_48kHz; @@ -233,7 +227,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -251,7 +245,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_32kHz; @@ -266,7 +260,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -284,7 +278,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->latency_s = CRendBin_Combined_BRIR_latency_s; hHrtf->max_num_iterations = CRendBin_Combined_BRIR_max_num_iterations_16kHz; @@ -299,7 +293,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -322,23 +316,23 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 ) + if ( inConfig == AUDIO_CONFIG_5_1 ) { tmp = channelIndex_CICP6[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) + else if ( inConfig == AUDIO_CONFIG_7_1 ) { tmp = channelIndex_CICP12[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == AUDIO_CONFIG_5_1_2 ) { tmp = channelIndex_CICP14[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == AUDIO_CONFIG_5_1_4 ) { tmp = channelIndex_CICP16[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1_4 ) + else if ( inConfig == AUDIO_CONFIG_7_1_4 ) { tmp = channelIndex_CICP19[i]; } @@ -349,7 +343,7 @@ static ivas_error ivas_rend_initCrend( if ( output_Fs == 48000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_48kHz[tmp]; } @@ -360,7 +354,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -378,7 +372,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 32000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_32kHz[tmp]; } @@ -389,7 +383,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -407,7 +401,7 @@ static ivas_error ivas_rend_initCrend( } else if ( output_Fs == 16000 ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = CRendBin_Combined_BRIR_inv_diffuse_weight_16kHz[tmp]; } @@ -418,7 +412,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -442,7 +436,7 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) { - if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 ) + if ( inConfig == AUDIO_CONFIG_HOA3 ) { if ( output_Fs == 48000 ) { @@ -529,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 == IVAS_REND_AUDIO_CONFIG_HOA2 ) + else if ( inConfig == AUDIO_CONFIG_HOA2 ) { if ( output_Fs == 48000 ) { @@ -616,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 == IVAS_REND_AUDIO_CONFIG_FOA ) + else if ( inConfig == AUDIO_CONFIG_FOA ) { if ( output_Fs == 48000 ) { @@ -720,7 +714,7 @@ static ivas_error ivas_rend_initCrend( hHrtf->max_num_ir -= 1; /* subtract LFE */ hHrtf->gain_lfe = GAIN_LFE; - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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; @@ -735,7 +729,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -753,23 +747,23 @@ static ivas_error ivas_rend_initCrend( for ( i = 0; i < hHrtf->max_num_ir; i++ ) { - if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 ) + if ( inConfig == AUDIO_CONFIG_5_1 ) { tmp = channelIndex_CICP6[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) + else if ( inConfig == AUDIO_CONFIG_7_1 ) { tmp = channelIndex_CICP12[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == AUDIO_CONFIG_5_1_2 ) { tmp = channelIndex_CICP14[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == AUDIO_CONFIG_5_1_4 ) { tmp = channelIndex_CICP16[i]; } - else if ( inConfig == IVAS_REND_AUDIO_CONFIG_7_1_4 ) + else if ( inConfig == AUDIO_CONFIG_7_1_4 ) { tmp = channelIndex_CICP19[i]; } @@ -778,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 == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { hHrtf->inv_diffuse_weight[i] = hSetOfHRTF->hHRTF_brir_combined->inv_diffuse_weight[tmp]; } @@ -789,7 +783,7 @@ static ivas_error ivas_rend_initCrend( for ( j = 0; j < BINAURAL_CHANNELS; j++ ) { - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == 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]; @@ -808,7 +802,7 @@ static ivas_error ivas_rend_initCrend( } else if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) { - if ( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 ) + if ( inConfig == AUDIO_CONFIG_HOA3 ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa3->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa3->max_num_iterations; @@ -834,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 == IVAS_REND_AUDIO_CONFIG_HOA2 ) + else if ( inConfig == AUDIO_CONFIG_HOA2 ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_hoa2->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_hoa2->max_num_iterations; @@ -860,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 == IVAS_REND_AUDIO_CONFIG_FOA ) + else if ( inConfig == AUDIO_CONFIG_FOA ) { hHrtf->latency_s = hSetOfHRTF->hHRTF_hrir_foa->latency_s; hHrtf->max_num_iterations = hSetOfHRTF->hHRTF_hrir_foa->max_num_iterations; @@ -982,20 +976,15 @@ ivas_error ivas_rend_initCrendWrapper( ivas_error ivas_rend_openMultiBinCrend( CREND_WRAPPER_HANDLE *pCrend, - const IVAS_REND_AudioConfig inConfig, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ) { ivas_error error; error = IVAS_ERR_OK; - error = ivas_rend_openCrend( pCrend, - getIvasAudioConfigFromRendAudioConfig( inConfig ), - getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL /*hRendCfg*/, - NULL, - output_Fs + error = ivas_rend_openCrend( pCrend, inConfig, outConfig, NULL /*hRendCfg*/, NULL, output_Fs #ifdef SPLIT_REND_WITH_HEAD_ROT , pMultiBinPoseData->num_poses @@ -1270,8 +1259,8 @@ void ivas_rend_closeCrend( static ivas_error ivas_rend_crendConvolver( const CREND_WRAPPER *pCrend, - IVAS_REND_AudioConfig inConfig, - IVAS_REND_AudioConfig outConfig, + AUDIO_CONFIG inConfig, + AUDIO_CONFIG outConfig, float *pcm_in[], float *pcm_out[], const int32_t output_Fs, @@ -1315,7 +1304,7 @@ static ivas_error ivas_rend_crendConvolver( lfe_idx_in = -1; if ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) { lfe_idx_in = LFE_CHANNEL; } @@ -1461,11 +1450,8 @@ ivas_error ivas_rend_crendProcess( int16_t nchan_out; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; float *p_pcm_tmp[BINAURAL_CHANNELS]; - AUDIO_CONFIG in_config; IVAS_REND_AudioConfigType inConfigType; ivas_error error; - IVAS_REND_AudioConfig inRendConfig; - IVAS_REND_AudioConfig outRendConfig; CREND_HANDLE hCrend; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -1491,14 +1477,9 @@ ivas_error ivas_rend_crendProcess( push_wmops( "ivas_rend_crendProcess" ); - inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig ); - outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig ); - - in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig ); - - inConfigType = getAudioConfigType( inRendConfig ); + inConfigType = getAudioConfigType( inConfig ); - if ( ( error = getAudioConfigNumChannels( outRendConfig, &nchan_out ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ) != IVAS_ERR_OK ) { return error; } @@ -1521,7 +1502,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 ( in_config == AUDIO_CONFIG_FOA || in_config == AUDIO_CONFIG_HOA2 || in_config == AUDIO_CONFIG_HOA3 ) + if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 ) { rotateFrame_shd( hCombinedOrientationData, output, subframe_len, *hIntSetup, subframe_idx ); } @@ -1532,9 +1513,9 @@ ivas_error ivas_rend_crendProcess( } } - if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) + if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED || inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) { - if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, output, p_pcm_tmp, output_Fs, subframe_idx + if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, output, p_pcm_tmp, output_Fs, subframe_idx #ifdef SPLIT_REND_WITH_HEAD_ROT , pos_idx @@ -1547,9 +1528,9 @@ ivas_error ivas_rend_crendProcess( if ( hCrend->hReverb != NULL ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, in_config, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( pCrend->hCrend[pos_idx]->hReverb, inConfig, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, in_config, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, inConfig, 1, output, p_pcm_tmp, subframe_idx ) ) != IVAS_ERR_OK ) #endif { return error; @@ -1600,11 +1581,8 @@ ivas_error ivas_rend_crendProcessSubframe( float *tc_local[MAX_TRANSPORT_CHANNELS]; float pcm_tmp[BINAURAL_CHANNELS][L_FRAME48k]; float *p_pcm_tmp[BINAURAL_CHANNELS]; - AUDIO_CONFIG in_config; IVAS_REND_AudioConfigType inConfigType; ivas_error error; - IVAS_REND_AudioConfig inRendConfig; - IVAS_REND_AudioConfig outRendConfig; int8_t combinedOrientationEnabled; combinedOrientationEnabled = 0; @@ -1622,18 +1600,14 @@ ivas_error ivas_rend_crendProcessSubframe( push_wmops( "ivas_rend_crendProcessSubframe" ); - inRendConfig = getRendAudioConfigFromIvasAudioConfig( inConfig ); - outRendConfig = getRendAudioConfigFromIvasAudioConfig( outConfig ); - - in_config = getIvasAudioConfigFromRendAudioConfig( inRendConfig ); - inConfigType = getAudioConfigType( inRendConfig ); + inConfigType = getAudioConfigType( inConfig ); - if ( ( error = getAudioConfigNumChannels( outRendConfig, &nchan_out ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( outConfig, &nchan_out ) ) != IVAS_ERR_OK ) { return error; } - if ( ( error = getAudioConfigNumChannels( inRendConfig, &nchan_in ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_in ) ) != IVAS_ERR_OK ) { return error; } @@ -1673,27 +1647,23 @@ 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 ( in_config == AUDIO_CONFIG_FOA || in_config == AUDIO_CONFIG_HOA2 || in_config == AUDIO_CONFIG_HOA3 ) + if ( inConfig == AUDIO_CONFIG_FOA || inConfig == AUDIO_CONFIG_HOA2 || inConfig == AUDIO_CONFIG_HOA3 ) { - rotateFrame_shd( - hCombinedOrientationData, - tc_local, subframe_len, *hIntSetup, 0 ); + rotateFrame_shd( hCombinedOrientationData, tc_local, subframe_len, *hIntSetup, 0 ); } /* Rotation in SD for MC -> BINAURAL_ROOM */ else if ( ( hIntSetup != NULL ) && hIntSetup->is_loudspeaker_setup ) { - rotateFrame_sd( - hCombinedOrientationData, - tc_local, subframe_len, *hIntSetup, hEFAPdata, 0 ); + rotateFrame_sd( hCombinedOrientationData, tc_local, subframe_len, *hIntSetup, hEFAPdata, 0 ); } } if ( ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) || ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS ) ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, tc_local, p_pcm_tmp, output_Fs, 0, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0, 0 ) ) != IVAS_ERR_OK ) #else - if ( ( error = ivas_rend_crendConvolver( pCrend, inRendConfig, outRendConfig, tc_local, p_pcm_tmp, output_Fs, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendConvolver( pCrend, inConfig, outConfig, tc_local, p_pcm_tmp, output_Fs, 0 ) ) != IVAS_ERR_OK ) #endif { @@ -1702,7 +1672,7 @@ ivas_error ivas_rend_crendProcessSubframe( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( pCrend->hCrend[0]->hReverb != NULL ) { - if ( ( error = ivas_reverb_process( pCrend->hCrend[0]->hReverb, in_config, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( pCrend->hCrend[0]->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -1710,7 +1680,7 @@ ivas_error ivas_rend_crendProcessSubframe( #else if ( pCrend->hCrend->hReverb != NULL ) { - if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, in_config, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_process( pCrend->hCrend->hReverb, inConfig, 1, tc_local, p_pcm_tmp, 0 ) ) != IVAS_ERR_OK ) { return error; } diff --git a/lib_rend/ivas_mcmasa_ana.c b/lib_rend/ivas_mcmasa_ana.c index b90b02ed14ee5cfa2325f35ede25880b38f8b314..43a91b348977bc92aa89885d18fe416fdf829ec9 100644 --- a/lib_rend/ivas_mcmasa_ana.c +++ b/lib_rend/ivas_mcmasa_ana.c @@ -83,9 +83,9 @@ static void computeEvenLayout( const float *ls_azimuth, float *ls_azimuth_even, *--------------------------------------------------------------------------*/ ivas_error ivas_mcmasa_ana_open( - MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */ - const IVAS_REND_AudioConfig inConfig, /* i : Input config */ - int32_t input_Fs /* i : Sampling frequency */ + MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */ + const AUDIO_CONFIG inConfig, /* i : Input config */ + int32_t input_Fs /* i : Sampling frequency */ ) { int16_t i, j; @@ -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 == IVAS_REND_AUDIO_CONFIG_5_1 ) + if ( inConfig == 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 == IVAS_REND_AUDIO_CONFIG_7_1 ) + else if ( inConfig == 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 == IVAS_REND_AUDIO_CONFIG_5_1_2 ) + else if ( inConfig == 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 == IVAS_REND_AUDIO_CONFIG_5_1_4 ) + else if ( inConfig == 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 3aa9e6d80b69a8f9241a27900def39a0c8d0fc02..a6cd72f582c6c7a8e8f57fcd3126814410510847 100644 --- a/lib_rend/ivas_objectRenderer.c +++ b/lib_rend/ivas_objectRenderer.c @@ -633,7 +633,7 @@ void TDREND_Update_listener_orientation( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, - IVAS_REND_AudioConfig inConfig, + AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t outFs ) @@ -645,7 +645,7 @@ ivas_error ivas_td_binaural_open_ext( ivas_error error; float *directivity = NULL; - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan_transport ) ) != IVAS_ERR_OK ) { @@ -657,7 +657,7 @@ ivas_error ivas_td_binaural_open_ext( nchan_transport = customLsInput->num_spk; } - transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); + transport_config = inConfig; ivas_format = ( getAudioConfigType( inConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) ? MC_FORMAT : ISM_FORMAT; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -665,7 +665,7 @@ ivas_error ivas_td_binaural_open_ext( hTransSetup.ls_elevation = NULL; #endif #ifdef TD_TDREND_FIX_NULLPTR_ACCESS - if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) { hTransSetup.ls_azimuth = customLsInput->ls_azimuth; hTransSetup.ls_elevation = customLsInput->ls_elevation; @@ -694,7 +694,7 @@ ivas_error ivas_td_binaural_open_ext( ivas_error ivas_td_binaural_renderer_ext( const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ - const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */ + const AUDIO_CONFIG inConfig, /* i : Input audio configuration */ const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ @@ -738,8 +738,8 @@ ivas_error ivas_td_binaural_renderer_ext( if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED ) { ivas_format = MC_FORMAT; - transport_config = getIvasAudioConfigFromRendAudioConfig( inConfig ); - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + transport_config = inConfig; + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &num_src ) ) != IVAS_ERR_OK ) { diff --git a/lib_rend/ivas_prot_rend.h b/lib_rend/ivas_prot_rend.h index 50b363f192697fbbb2d5d216ec8053579ed19c9f..b24978484c37a53d71faa9f721543d307f291adc 100644 --- a/lib_rend/ivas_prot_rend.h +++ b/lib_rend/ivas_prot_rend.h @@ -47,20 +47,14 @@ *----------------------------------------------------------------------------------*/ IVAS_REND_AudioConfigType getAudioConfigType( - const IVAS_REND_AudioConfig config + const AUDIO_CONFIG config ); ivas_error getAudioConfigNumChannels( - const IVAS_REND_AudioConfig config, + const AUDIO_CONFIG config, int16_t *numChannels ); -AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( - IVAS_REND_AudioConfig rendConfig ); - -IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( - AUDIO_CONFIG config ); - /*----------------------------------------------------------------------------------* * output setup prototypes @@ -577,9 +571,9 @@ ivas_error ivas_td_binaural_renderer_unwrap( ivas_error ivas_td_binaural_renderer_ext( const TDREND_WRAPPER *pTDRend, /* i : TD Renderer wrapper structure */ - const IVAS_REND_AudioConfig inConfig, /* i : Input audio configuration */ + const AUDIO_CONFIG inConfig, /* i : Input audio configuration */ const LSSETUP_CUSTOM_STRUCT *customLsInput, /* i : Input custom loudspeaker layout */ - const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i : Combined head and external orientations */ + const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData,/* i : Combined head and external orientations */ const IVAS_REND_AudioObjectPosition *currentPos, /* i : Object position */ const REVERB_HANDLE hReverb, /* i : Reverberator handle */ #ifdef FIX_488_SYNC_DELAY @@ -603,7 +597,7 @@ ivas_error ivas_td_binaural_open_unwrap( ivas_error ivas_td_binaural_open_ext( TDREND_WRAPPER *pTDRend, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, RENDER_CONFIG_DATA *hRendCfg, /* i : Renderer configuration */ LSSETUP_CUSTOM_STRUCT *customLsInput, const int32_t output_Fs @@ -857,8 +851,8 @@ ivas_error ivas_rend_initCrendWrapper( #ifdef SPLIT_REND_WITH_HEAD_ROT ivas_error ivas_rend_openMultiBinCrend( CREND_WRAPPER_HANDLE *pCrend, - const IVAS_REND_AudioConfig inConfig, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ); @@ -874,13 +868,13 @@ void ivas_rend_CldfbMultiBinRendProcess( ivas_error ivas_rend_openCldfb( HANDLE_CLDFB_FILTER_BANK cldfbAna[MAX_INPUT_CHANNELS], - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const int32_t output_Fs ); ivas_error ivas_rend_openCldfbRend( CLDFB_REND_WRAPPER *pCldfbRend, - const IVAS_REND_AudioConfig inConfig, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData, const int32_t output_Fs ); @@ -1593,7 +1587,7 @@ void ivas_SplitRenderer_PostRenderer( ivas_error ivas_mcmasa_ana_open( MCMASA_ANA_HANDLE *hMcMasaPtr, /* i/o: McMASA data handle pointer */ - const IVAS_REND_AudioConfig inConfig, /* i : Input config */ + const AUDIO_CONFIG inConfig, /* i : Input config */ int32_t input_Fs /* i : Sampling frequency */ ); diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 8a023a108782e0d9103f393370c2cdb050819b85..a102e5f51bd09bb1363b86565405686bc3d0dc31 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -86,7 +86,7 @@ typedef float rotation_matrix[3][3]; typedef struct { EFAP_HANDLE hEfap; - IVAS_REND_AudioConfig speakerConfig; + AUDIO_CONFIG speakerConfig; const LSSETUP_CUSTOM_STRUCT *pCustomLsSetup; /* Pointer to main custom LS struct from renderer handle - doesn't need freeing */ } EFAP_WRAPPER; @@ -100,7 +100,7 @@ typedef struct typedef struct { const int32_t *pOutSampleRate; - const IVAS_REND_AudioConfig *pOutConfig; + const AUDIO_CONFIG *pOutConfig; const LSSETUP_CUSTOM_STRUCT *pCustomLsOut; const EFAP_WRAPPER *pEfapOutWrapper; const IVAS_REND_HeadRotData *pHeadRotData; @@ -121,7 +121,7 @@ typedef struct /* Common base for input structs */ typedef struct { - IVAS_REND_AudioConfig inConfig; + AUDIO_CONFIG inConfig; IVAS_REND_InputId id; IVAS_REND_AudioBuffer inputBuffer; float gain; /* Linear, not in dB */ @@ -252,8 +252,8 @@ struct IVAS_REND #endif /* TODO @Philips - inputConfig should not be stored here, but read from e.g. input_mc->input_base.inConfig, please remove this */ - IVAS_REND_AudioConfig inputConfig; - IVAS_REND_AudioConfig outputConfig; + AUDIO_CONFIG inputConfig; + AUDIO_CONFIG outputConfig; EFAP_WRAPPER efapOutWrapper; IVAS_LSSETUP_CUSTOM_STRUCT customLsOut; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -535,141 +535,34 @@ static int32_t limitRendererOutput( /*-------------------------------------------------------------------* - * getIvasAudioConfigFromRendAudioConfig() - * - * - *-------------------------------------------------------------------*/ - -AUDIO_CONFIG getIvasAudioConfigFromRendAudioConfig( - IVAS_REND_AudioConfig rendConfig ) -{ - switch ( rendConfig ) - { - case IVAS_REND_AUDIO_CONFIG_MONO: - return AUDIO_CONFIG_MONO; - case IVAS_REND_AUDIO_CONFIG_STEREO: - return AUDIO_CONFIG_STEREO; - case IVAS_REND_AUDIO_CONFIG_5_1: - return AUDIO_CONFIG_5_1; - case IVAS_REND_AUDIO_CONFIG_7_1: - return AUDIO_CONFIG_7_1; - case IVAS_REND_AUDIO_CONFIG_5_1_2: - return AUDIO_CONFIG_5_1_2; - case IVAS_REND_AUDIO_CONFIG_5_1_4: - return AUDIO_CONFIG_5_1_4; - case IVAS_REND_AUDIO_CONFIG_7_1_4: - return AUDIO_CONFIG_7_1_4; - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: - return AUDIO_CONFIG_LS_CUSTOM; - case IVAS_REND_AUDIO_CONFIG_FOA: - return AUDIO_CONFIG_FOA; - case IVAS_REND_AUDIO_CONFIG_HOA2: - return AUDIO_CONFIG_HOA2; - case IVAS_REND_AUDIO_CONFIG_HOA3: - return AUDIO_CONFIG_HOA3; - case IVAS_REND_AUDIO_CONFIG_OBJECT: - return AUDIO_CONFIG_OBA; - case IVAS_REND_AUDIO_CONFIG_BINAURAL: - return AUDIO_CONFIG_BINAURAL; -#ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - return AUDIO_CONFIG_BINAURAL_SPLIT_CODED; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: - return AUDIO_CONFIG_BINAURAL_SPLIT_PCM; -#endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - return AUDIO_CONFIG_BINAURAL_ROOM_IR; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - return AUDIO_CONFIG_BINAURAL_ROOM_REVERB; - case IVAS_REND_AUDIO_CONFIG_MASA1: - return AUDIO_CONFIG_MASA1; - case IVAS_REND_AUDIO_CONFIG_MASA2: - return AUDIO_CONFIG_MASA2; - default: - break; - } - - return AUDIO_CONFIG_INVALID; -} - -/*-------------------------------------------------------------------* - * getRendAudioConfigFromIvasAudioConfig() + * validateOutputAudioConfig() * * *-------------------------------------------------------------------*/ -IVAS_REND_AudioConfig getRendAudioConfigFromIvasAudioConfig( - AUDIO_CONFIG config ) +static ivas_error validateOutputAudioConfig( + const AUDIO_CONFIG outConfig ) { - switch ( config ) + switch ( outConfig ) { case AUDIO_CONFIG_MONO: - return IVAS_REND_AUDIO_CONFIG_MONO; case AUDIO_CONFIG_STEREO: - return IVAS_REND_AUDIO_CONFIG_STEREO; - case AUDIO_CONFIG_BINAURAL: - return IVAS_REND_AUDIO_CONFIG_BINAURAL; -#ifdef SPLIT_REND_WITH_HEAD_ROT - case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED; - case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: - return IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM; -#endif - case AUDIO_CONFIG_BINAURAL_ROOM_IR: - return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR; - case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - return IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB; case AUDIO_CONFIG_5_1: - return IVAS_REND_AUDIO_CONFIG_5_1; case AUDIO_CONFIG_7_1: - return IVAS_REND_AUDIO_CONFIG_7_1; case AUDIO_CONFIG_5_1_2: - return IVAS_REND_AUDIO_CONFIG_5_1_2; case AUDIO_CONFIG_5_1_4: - return IVAS_REND_AUDIO_CONFIG_5_1_4; case AUDIO_CONFIG_7_1_4: - return IVAS_REND_AUDIO_CONFIG_7_1_4; + case AUDIO_CONFIG_LS_CUSTOM: case AUDIO_CONFIG_FOA: - return IVAS_REND_AUDIO_CONFIG_FOA; case AUDIO_CONFIG_HOA2: - return IVAS_REND_AUDIO_CONFIG_HOA2; case AUDIO_CONFIG_HOA3: - return IVAS_REND_AUDIO_CONFIG_HOA3; - default: - break; - } - return IVAS_REND_AUDIO_CONFIG_UNKNOWN; -} - -/*-------------------------------------------------------------------* - * validateOutputAudioConfig() - * - * - *-------------------------------------------------------------------*/ - -static ivas_error validateOutputAudioConfig( - IVAS_REND_AudioConfig outConfig ) -{ - switch ( outConfig ) - { - case IVAS_REND_AUDIO_CONFIG_MONO: - case IVAS_REND_AUDIO_CONFIG_STEREO: - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1_4: - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: - case IVAS_REND_AUDIO_CONFIG_FOA: - case IVAS_REND_AUDIO_CONFIG_HOA2: - case IVAS_REND_AUDIO_CONFIG_HOA3: - case IVAS_REND_AUDIO_CONFIG_BINAURAL: -#ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: -#endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + 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: return IVAS_ERR_OK; default: break; @@ -686,10 +579,47 @@ static ivas_error validateOutputAudioConfig( *-------------------------------------------------------------------*/ IVAS_REND_AudioConfigType getAudioConfigType( - IVAS_REND_AudioConfig config ) + const AUDIO_CONFIG config ) { - /* By definition, config type is the second byte (from LSB) of IVAS_REND_AudioConfig enum. */ - return ( config & 0xFF00 ) >> 8; + IVAS_REND_AudioConfigType type; + + 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: + type = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED; + break; + case AUDIO_CONFIG_FOA: + case AUDIO_CONFIG_HOA2: + case AUDIO_CONFIG_HOA3: + type = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS; + break; + case 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: + type = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL; + break; + case AUDIO_CONFIG_MASA1: + case AUDIO_CONFIG_MASA2: + type = IVAS_REND_AUDIO_CONFIG_TYPE_MASA; + break; + default: + type = IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN; + break; + } + + return type; } @@ -701,7 +631,7 @@ IVAS_REND_AudioConfigType getAudioConfigType( static ivas_error validateOutputSampleRate( const int32_t sampleRate, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { if ( getAudioConfigType( outConfig ) != IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { @@ -730,47 +660,47 @@ static ivas_error validateOutputSampleRate( *-------------------------------------------------------------------*/ ivas_error getAudioConfigNumChannels( - const IVAS_REND_AudioConfig config, + const AUDIO_CONFIG config, int16_t *numChannels ) { switch ( config ) { - case IVAS_REND_AUDIO_CONFIG_MONO: - case IVAS_REND_AUDIO_CONFIG_OBJECT: - case IVAS_REND_AUDIO_CONFIG_MASA1: + case AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_OBA: + case AUDIO_CONFIG_MASA1: *numChannels = 1; break; - case IVAS_REND_AUDIO_CONFIG_STEREO: - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_STEREO: + case AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - case IVAS_REND_AUDIO_CONFIG_MASA2: + case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case AUDIO_CONFIG_MASA2: *numChannels = 2; break; - case IVAS_REND_AUDIO_CONFIG_FOA: + case AUDIO_CONFIG_FOA: *numChannels = 4; break; - case IVAS_REND_AUDIO_CONFIG_5_1: + case AUDIO_CONFIG_5_1: *numChannels = 6; break; - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: + case AUDIO_CONFIG_7_1: + case AUDIO_CONFIG_5_1_2: *numChannels = 8; break; - case IVAS_REND_AUDIO_CONFIG_HOA2: + case AUDIO_CONFIG_HOA2: *numChannels = 9; break; - case IVAS_REND_AUDIO_CONFIG_5_1_4: + case AUDIO_CONFIG_5_1_4: *numChannels = 10; break; - case IVAS_REND_AUDIO_CONFIG_7_1_4: + case AUDIO_CONFIG_7_1_4: *numChannels = 12; break; - case IVAS_REND_AUDIO_CONFIG_HOA3: + case AUDIO_CONFIG_HOA3: *numChannels = 16; break; default: @@ -832,30 +762,30 @@ static LSSETUP_CUSTOM_STRUCT defaultCustomLs( } static ivas_error getSpeakerAzimuths( - IVAS_REND_AudioConfig config, + AUDIO_CONFIG config, const float **azimuths ) { switch ( config ) { - case IVAS_REND_AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_MONO: *azimuths = ls_azimuth_CICP1; break; - case IVAS_REND_AUDIO_CONFIG_STEREO: + case AUDIO_CONFIG_STEREO: *azimuths = ls_azimuth_CICP2; break; - case IVAS_REND_AUDIO_CONFIG_5_1: + case AUDIO_CONFIG_5_1: *azimuths = ls_azimuth_CICP6; break; - case IVAS_REND_AUDIO_CONFIG_7_1: + case AUDIO_CONFIG_7_1: *azimuths = ls_azimuth_CICP12; break; - case IVAS_REND_AUDIO_CONFIG_5_1_2: + case AUDIO_CONFIG_5_1_2: *azimuths = ls_azimuth_CICP14; break; - case IVAS_REND_AUDIO_CONFIG_5_1_4: + case AUDIO_CONFIG_5_1_4: *azimuths = ls_azimuth_CICP16; break; - case IVAS_REND_AUDIO_CONFIG_7_1_4: + case AUDIO_CONFIG_7_1_4: *azimuths = ls_azimuth_CICP19; break; default: @@ -866,30 +796,30 @@ static ivas_error getSpeakerAzimuths( } static ivas_error getSpeakerElevations( - IVAS_REND_AudioConfig config, + AUDIO_CONFIG config, const float **elevations ) { switch ( config ) { - case IVAS_REND_AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_MONO: *elevations = ls_elevation_CICP1; break; - case IVAS_REND_AUDIO_CONFIG_STEREO: + case AUDIO_CONFIG_STEREO: *elevations = ls_elevation_CICP2; break; - case IVAS_REND_AUDIO_CONFIG_5_1: + case AUDIO_CONFIG_5_1: *elevations = ls_elevation_CICP6; break; - case IVAS_REND_AUDIO_CONFIG_7_1: + case AUDIO_CONFIG_7_1: *elevations = ls_elevation_CICP12; break; - case IVAS_REND_AUDIO_CONFIG_5_1_2: + case AUDIO_CONFIG_5_1_2: *elevations = ls_elevation_CICP14; break; - case IVAS_REND_AUDIO_CONFIG_5_1_4: + case AUDIO_CONFIG_5_1_4: *elevations = ls_elevation_CICP16; break; - case IVAS_REND_AUDIO_CONFIG_7_1_4: + case AUDIO_CONFIG_7_1_4: *elevations = ls_elevation_CICP19; break; default: @@ -900,18 +830,18 @@ static ivas_error getSpeakerElevations( } static ivas_error getAmbisonicsOrder( - IVAS_REND_AudioConfig config, + AUDIO_CONFIG config, int16_t *order ) { switch ( config ) { - case IVAS_REND_AUDIO_CONFIG_FOA: + case AUDIO_CONFIG_FOA: *order = 1; break; - case IVAS_REND_AUDIO_CONFIG_HOA2: + case AUDIO_CONFIG_HOA2: *order = 2; break; - case IVAS_REND_AUDIO_CONFIG_HOA3: + case AUDIO_CONFIG_HOA3: *order = 3; break; default: @@ -926,13 +856,13 @@ static int16_t getNumLfeChannels( { switch ( inputMc->base.inConfig ) { - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1_4: + 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: return 1; - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: return inputMc->customLsInput.num_lfe; default: break; @@ -942,28 +872,28 @@ static int16_t getNumLfeChannels( } static ivas_error getNumNonLfeChannelsInSpeakerLayout( - IVAS_REND_AudioConfig config, + AUDIO_CONFIG config, int16_t *numNonLfeChannels ) { switch ( config ) { - case IVAS_REND_AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_MONO: *numNonLfeChannels = 1; break; - case IVAS_REND_AUDIO_CONFIG_STEREO: + case AUDIO_CONFIG_STEREO: *numNonLfeChannels = 2; break; - case IVAS_REND_AUDIO_CONFIG_5_1: + case AUDIO_CONFIG_5_1: *numNonLfeChannels = 5; break; - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_7_1: + case AUDIO_CONFIG_5_1_2: + case AUDIO_CONFIG_7_1: *numNonLfeChannels = 7; break; - case IVAS_REND_AUDIO_CONFIG_5_1_4: + case AUDIO_CONFIG_5_1_4: *numNonLfeChannels = 9; break; - case IVAS_REND_AUDIO_CONFIG_7_1_4: + case AUDIO_CONFIG_7_1_4: *numNonLfeChannels = 11; break; default: @@ -974,7 +904,7 @@ static ivas_error getNumNonLfeChannelsInSpeakerLayout( } static ivas_error getMcConfigValues( - IVAS_REND_AudioConfig inConfig, + AUDIO_CONFIG inConfig, LSSETUP_CUSTOM_STRUCT inCustomLs, const float **azimuth, const float **elevation, @@ -987,7 +917,7 @@ static ivas_error getMcConfigValues( *is_planar = 1; switch ( inConfig ) { - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: *azimuth = (const float *) &inCustomLs.ls_azimuth; *elevation = (const float *) &inCustomLs.ls_elevation; if ( inCustomLs.num_lfe > 0 ) @@ -1003,20 +933,20 @@ static ivas_error getMcConfigValues( } } break; - case IVAS_REND_AUDIO_CONFIG_MONO: - case IVAS_REND_AUDIO_CONFIG_STEREO: + case AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_STEREO: getSpeakerAzimuths( inConfig, azimuth ); getSpeakerElevations( inConfig, elevation ); break; - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1_4: + 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: getSpeakerAzimuths( inConfig, azimuth ); getSpeakerElevations( inConfig, elevation ); *lfe_idx = LFE_CHANNEL; - *is_planar = ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ? 1 : 0; + *is_planar = ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ? 1 : 0; break; default: assert( !"Invalid speaker config" ); @@ -1028,7 +958,7 @@ static ivas_error getMcConfigValues( static ivas_error initEfap( EFAP_WRAPPER *pEfapWrapper, - IVAS_REND_AudioConfig outConfig, + AUDIO_CONFIG outConfig, const LSSETUP_CUSTOM_STRUCT *pCustomLsOut ) { ivas_error error; @@ -1036,9 +966,9 @@ static ivas_error initEfap( const float *elevations; int16_t numNonLfeChannels; - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - pEfapWrapper->speakerConfig = IVAS_REND_AUDIO_CONFIG_7_1_4; + pEfapWrapper->speakerConfig = AUDIO_CONFIG_7_1_4; } else { @@ -1059,7 +989,7 @@ static ivas_error initEfap( return IVAS_ERR_OK; } - if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( outConfig == 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 ) { @@ -1109,7 +1039,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 == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( efapWrapper.speakerConfig == AUDIO_CONFIG_LS_CUSTOM ) { numChannels = efapWrapper.pCustomLsSetup->num_spk + efapWrapper.pCustomLsSetup->num_lfe; readPtr = tmpPanGains; @@ -1238,7 +1168,7 @@ static void initRotGains( static void initRendInputBase( input_base *inputBase, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, const rendering_context rendCtx, float *dataBuf, @@ -1332,11 +1262,11 @@ static CREND_WRAPPER defaultCrendWrapper( } static bool isIoConfigPairSupported( - IVAS_REND_AudioConfig inConfig, - IVAS_REND_AudioConfig outConfig ) + AUDIO_CONFIG inConfig, + AUDIO_CONFIG outConfig ) { /* Rendering mono or stereo to binaural is not supported */ - if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_MONO || inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) && + if ( ( inConfig == AUDIO_CONFIG_MONO || inConfig == AUDIO_CONFIG_STEREO ) && getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) { return false; @@ -1375,13 +1305,13 @@ static ivas_error initIsmMasaRendering( static ivas_error setRendInputActiveIsm( void *input, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; rendering_context rendCtx; - IVAS_REND_AudioConfig outConfig; + AUDIO_CONFIG outConfig; input_ism *inputIsm; #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t i; @@ -1419,13 +1349,13 @@ static ivas_error setRendInputActiveIsm( error = IVAS_ERR_OK; #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) #endif { #ifndef SPLIT_REND_WITH_HEAD_ROT - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; @@ -1437,7 +1367,7 @@ static ivas_error setRendInputActiveIsm( } #endif } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + else if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) { if ( ( error = initIsmMasaRendering( inputIsm, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -1451,9 +1381,9 @@ static ivas_error setRendInputActiveIsm( { return error; } - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -1463,18 +1393,17 @@ static ivas_error setRendInputActiveIsm( { return error; } - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputIsm->hReverb ), outConfig, NULL, hRendCfg, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { return error; } } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) + else if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR ) { - if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, - NULL, *rendCtx.pOutSampleRate + if ( ( error = ivas_rend_openCrend( &inputIsm->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses @@ -1502,7 +1431,7 @@ static void clearInputIsm( rendCtx = inputIsm->base.ctx; freeInputBaseBufferData( &inputIsm->base.inputBuffer.data ); - initRendInputBase( &inputIsm->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + initRendInputBase( &inputIsm->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ @@ -1595,13 +1524,13 @@ static ivas_error initMcPanGainsWithIdentMatrix( static ivas_error initMcPanGainsWithConversionMapping( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { AUDIO_CONFIG ivasConfigIn, ivasConfigOut; int16_t i; - ivasConfigIn = getIvasAudioConfigFromRendAudioConfig( inputMc->base.inConfig ); - ivasConfigOut = getIvasAudioConfigFromRendAudioConfig( outConfig ); + ivasConfigIn = inputMc->base.inConfig; + ivasConfigOut = outConfig; /* Find conversion mapping for current I/O config pair. * Stay with default panning matrix if conversion_matrix is NULL */ @@ -1629,7 +1558,7 @@ static ivas_error initMcPanGainsWithConversionMapping( static ivas_error initMcPanGainsWithEfap( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { int16_t i; int16_t numNonLfeInChannels; @@ -1637,7 +1566,7 @@ static ivas_error initMcPanGainsWithEfap( const float *spkAzi, *spkEle; ivas_error error; - if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK ) { @@ -1681,7 +1610,7 @@ static ivas_error initMcPanGainsWithEfap( } } - if ( outConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 ) + if ( outConfig != AUDIO_CONFIG_LS_CUSTOM && inLfeChIdx >= 0 ) { inputMc->panGains[inLfeChIdx][LFE_CHANNEL] = 1; } @@ -1708,7 +1637,7 @@ static ivas_error getRendInputNumChannels( pInputBase = (const input_base *) rendInput; - if ( pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( pInputBase->inConfig == AUDIO_CONFIG_LS_CUSTOM ) { pInputMc = (const input_mc *) rendInput; *numInChannels = pInputMc->customLsInput.num_spk + pInputMc->customLsInput.num_lfe; @@ -1739,7 +1668,7 @@ static ivas_error initMcPanGainsWithMonoOut( return error; } - if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) { for ( i = 0; i < numInChannels; ++i ) { @@ -1748,7 +1677,7 @@ static ivas_error initMcPanGainsWithMonoOut( inputMc->panGains[i][0] = 1.f; } } - else if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) + else if ( inputMc->base.inConfig == AUDIO_CONFIG_STEREO ) { /* Special case for STEREO to MONO: Passive downmix (L+R)/2 */ inputMc->panGains[0][0] = 0.5; @@ -1759,7 +1688,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 == IVAS_REND_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 ) { skipSideSpeakers = true; } @@ -1789,7 +1718,7 @@ static ivas_error initMcPanGainsWithStereoLookup( /* Special case - MONO input. * Use gains for center CICP speaker and return early. */ - if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_MONO ) { inputMc->panGains[0][0] = ls_conversion_cicpX_stereo[2][0]; inputMc->panGains[0][1] = ls_conversion_cicpX_stereo[2][1]; @@ -1799,7 +1728,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 == IVAS_REND_AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_5_1_4 ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_5_1_2 || inputMc->base.inConfig == AUDIO_CONFIG_5_1_4 ) { skipSideSpeakers = true; } @@ -1827,15 +1756,15 @@ static ivas_error initMcPanGainsWithStereoLookup( /* Returns 1 (true) if configs A and B are equal, otherwise returns 0 (false). * If both configs are custom LS layouts, layout details are compared to determine equality. */ static bool configsAreEqual( - const IVAS_REND_AudioConfig configA, + const AUDIO_CONFIG configA, const LSSETUP_CUSTOM_STRUCT customLsA, - const IVAS_REND_AudioConfig configB, + const AUDIO_CONFIG configB, const LSSETUP_CUSTOM_STRUCT customLsB ) { int16_t i; /* Both input and output are custom LS - compare structs */ - if ( configA == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && configB == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( configA == AUDIO_CONFIG_LS_CUSTOM && configB == AUDIO_CONFIG_LS_CUSTOM ) { if ( customLsA.num_spk != customLsB.num_spk ) { @@ -1878,7 +1807,7 @@ static bool configsAreEqual( static ivas_error updateLfePanGainsForMcOut( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { int16_t i, numLfeIn, numOutChannels; ivas_error error; @@ -1892,7 +1821,7 @@ static ivas_error updateLfePanGainsForMcOut( numLfeIn = getNumLfeChannels( inputMc ); - if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( outConfig == AUDIO_CONFIG_LS_CUSTOM ) { numOutChannels = inputMc->base.ctx.pCustomLsOut->num_spk + inputMc->base.ctx.pCustomLsOut->num_lfe; } @@ -1927,7 +1856,7 @@ static ivas_error updateLfePanGainsForMcOut( static ivas_error updateLfePanGainsForAmbiOut( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { int16_t i; int16_t numLfeIn, outAmbiOrder; @@ -1967,7 +1896,7 @@ static ivas_error updateLfePanGainsForAmbiOut( static ivas_error updateMcPanGainsForMcOut( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; @@ -1987,11 +1916,11 @@ static ivas_error updateMcPanGainsForMcOut( { error = initMcPanGainsWithIdentMatrix( inputMc ); } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM || - inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO || - inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + else if ( outConfig == AUDIO_CONFIG_LS_CUSTOM || + inputMc->base.inConfig == AUDIO_CONFIG_MONO || + inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) { - if ( ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_MONO ) && ( inputMc->nonDiegeticPan ) ) + if ( ( inputMc->base.inConfig == 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]; @@ -2002,11 +1931,11 @@ static ivas_error updateMcPanGainsForMcOut( error = initMcPanGainsWithEfap( inputMc, outConfig ); } } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_MONO ) + else if ( outConfig == AUDIO_CONFIG_MONO ) { error = initMcPanGainsWithMonoOut( inputMc ); } - else if ( outConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) + else if ( outConfig == AUDIO_CONFIG_STEREO ) { error = initMcPanGainsWithStereoLookup( inputMc ); } @@ -2029,7 +1958,7 @@ static ivas_error updateMcPanGainsForMcOut( static ivas_error updateMcPanGainsForAmbiOut( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { int16_t ch_in, ch_out, lfeIdx; int16_t numNonLfeInChannels, outAmbiOrder; @@ -2041,7 +1970,7 @@ static ivas_error updateMcPanGainsForAmbiOut( return error; } - if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getNumNonLfeChannelsInSpeakerLayout( inputMc->base.inConfig, &numNonLfeInChannels ) ) != IVAS_ERR_OK ) { @@ -2099,7 +2028,7 @@ static ivas_error updateMcPanGainsForAmbiOut( static ivas_error updateMcPanGains( input_mc *inputMc, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { int16_t i; ivas_error error; @@ -2119,16 +2048,16 @@ static ivas_error updateMcPanGains( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: #endif break; /* Do nothing */ - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: /* Prepare rendering to intermediate format */ - error = updateMcPanGainsForMcOut( inputMc, IVAS_REND_AUDIO_CONFIG_7_1_4 ); + error = updateMcPanGainsForMcOut( inputMc, AUDIO_CONFIG_7_1_4 ); break; default: return IVAS_ERR_INVALID_OUTPUT_FORMAT; @@ -2146,7 +2075,7 @@ static ivas_error updateMcPanGains( } /* Copy LFE routing to pan gains array */ - if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) { for ( i = 0; i < inputMc->customLsInput.num_lfe; ++i ) { @@ -2165,8 +2094,8 @@ static ivas_error updateMcPanGains( static ivas_error initMcBinauralRendering( input_mc *inputMc, - const IVAS_REND_AudioConfig inConfig, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG inConfig, + const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; @@ -2217,16 +2146,16 @@ static ivas_error initMcBinauralRendering( // initTDRend = false; //#ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG // if ( ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) && - // ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) + // ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR ) && ( outConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) //#else // if ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM ) //#endif // { - // if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + // if ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) // { // initTDRend = true; // } - // else if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) && + // else if ( ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) && // ( inputMc->base.ctx.pHeadRotData->headRotEnabled ) ) // { // initTDRend = true; @@ -2242,7 +2171,7 @@ static ivas_error initMcBinauralRendering( } #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { /* Open TD renderer wrappers */ for ( i = 0; i < MAX_HEAD_ROT_POSES - 1; ++i ) @@ -2262,9 +2191,9 @@ static ivas_error initMcBinauralRendering( } #endif - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { - if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_reverb_open( &( inputMc->hReverb ), outConfig, NULL, hRendCfg, outSampleRate ) ) != IVAS_ERR_OK ) { return error; } @@ -2272,11 +2201,10 @@ static ivas_error initMcBinauralRendering( } { - if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : getIvasAudioConfigFromRendAudioConfig( inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), hRendCfg, - NULL, outSampleRate + if ( ( error = ivas_rend_openCrend( &inputMc->crendWrapper, ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) ? AUDIO_CONFIG_7_1_4 : inConfig, outConfig, hRendCfg, NULL, outSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , - ( ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 + ( ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) ) ? inputMc->base.ctx.pSplitRendWrapper->multiBinPoseData.num_poses : 1 #endif ) ) != IVAS_ERR_OK ) { @@ -2285,7 +2213,7 @@ static ivas_error initMcBinauralRendering( } /* Initialise the EFAP handle for rotation on input layout */ - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled ) { if ( ( error = initEfap( &inputMc->efapInWrapper, inConfig, NULL ) ) != IVAS_ERR_OK ) { @@ -2310,7 +2238,7 @@ static ivas_error initMcBinauralRendering( static ivas_error initMcMasaRendering( input_mc *inputMc, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, int32_t inSampleRate ) { ivas_error error; @@ -2341,9 +2269,9 @@ static ivas_error initMcMasaRendering( } static lfe_routing defaultLfeRouting( - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const LSSETUP_CUSTOM_STRUCT customLsIn, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const LSSETUP_CUSTOM_STRUCT customLsOut ) { int16_t i; @@ -2361,14 +2289,14 @@ static lfe_routing defaultLfeRouting( switch ( inConfig ) { - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_7_1_4: + 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: routing.numLfeChannels = 1; break; - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: routing.numLfeChannels = customLsIn.num_lfe; break; default: @@ -2377,14 +2305,14 @@ static lfe_routing defaultLfeRouting( switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_7_1_4: + 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: routing.lfePanMtx[0][LFE_CHANNEL] = 1.0f; break; - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: for ( i = 0; i < routing.numLfeChannels && i < customLsOut.num_lfe; ++i ) { routing.lfePanMtx[i][customLsOut.lfe_idx[i]] = 1.0f; @@ -2400,7 +2328,7 @@ static lfe_routing defaultLfeRouting( static ivas_error setRendInputActiveMc( void *input, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) { @@ -2409,7 +2337,7 @@ static ivas_error setRendInputActiveMc( #endif ivas_error error; rendering_context rendCtx; - IVAS_REND_AudioConfig outConfig; + AUDIO_CONFIG outConfig; input_mc *inputMc; #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; @@ -2464,7 +2392,7 @@ static ivas_error setRendInputActiveMc( if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) #else - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( outConfig == AUDIO_CONFIG_BINAURAL || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || outConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { if ( ( error = initMcBinauralRendering( inputMc, inConfig, outConfig, hRendCfg ) ) != IVAS_ERR_OK ) @@ -2473,7 +2401,7 @@ static ivas_error setRendInputActiveMc( } } - if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) { if ( ( error = initMcMasaRendering( inputMc, inConfig, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -2503,7 +2431,7 @@ static void clearInputMc( freeMcLfeDelayBuffer( &inputMc->lfeDelayBuffer ); #endif freeInputBaseBufferData( &inputMc->bufferData ); - initRendInputBase( &inputMc->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + initRendInputBase( &inputMc->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ @@ -2545,7 +2473,7 @@ static void clearInputMc( static ivas_error initSbaPanGainsForMcOut( input_sba *inputSba, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const LSSETUP_CUSTOM_STRUCT *outSetupCustom ) { int16_t ambiOrderIn; @@ -2567,20 +2495,20 @@ static ivas_error initSbaPanGainsForMcOut( switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_MONO: + case AUDIO_CONFIG_MONO: hOutSetup.ls_azimuth = ls_azimuth_CICP1; hOutSetup.ls_elevation = ls_elevation_CICP1; - ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); + ivas_output_init( &hOutSetup, outConfig ); break; - case IVAS_REND_AUDIO_CONFIG_STEREO: - case IVAS_REND_AUDIO_CONFIG_5_1: - case IVAS_REND_AUDIO_CONFIG_7_1: - case IVAS_REND_AUDIO_CONFIG_5_1_2: - case IVAS_REND_AUDIO_CONFIG_5_1_4: - case IVAS_REND_AUDIO_CONFIG_7_1_4: - ivas_output_init( &hOutSetup, getIvasAudioConfigFromRendAudioConfig( outConfig ) ); + 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: + ivas_output_init( &hOutSetup, outConfig ); break; - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: ivas_ls_custom_setup( &hOutSetup, outSetupCustom ); break; default: @@ -2615,7 +2543,7 @@ static ivas_error initSbaPanGainsForMcOut( static ivas_error initSbaPanGainsForSbaOut( input_sba *inputSba, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; error = IVAS_ERR_OK; @@ -2635,7 +2563,7 @@ static ivas_error initSbaPanGainsForSbaOut( static ivas_error updateSplitPostRendPanGains( input_split_post_rend *inputSplitPostRend, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; @@ -2663,11 +2591,11 @@ updateSplitPostRendPanGains( static ivas_error updateSbaPanGains( input_sba *inputSba, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; - IVAS_REND_AudioConfig inConfig; + AUDIO_CONFIG inConfig; rendering_context rendCtx; /* Reset to all zeros - some functions below only write non-zero elements. */ @@ -2688,13 +2616,13 @@ static ivas_error updateSbaPanGains( switch ( outConfig ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: { if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { - assert( inConfig == IVAS_REND_AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); + assert( inConfig == AUDIO_CONFIG_HOA3 && ( *rendCtx.pOutSampleRate == 48000 ) && "split binaural fast conv mode is currently supported with HOA3 input and 48k sampling rate only" ); error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ); @@ -2718,13 +2646,11 @@ static ivas_error updateSbaPanGains( break; } #endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hRendCfg->split_rend_config.rendererSelection == IVAS_SPLIT_REND_RENDERER_SELECTION_FASTCONV ) { - error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, - &rendCtx.pSplitRendWrapper->multiBinPoseData, - *rendCtx.pOutSampleRate ); + error = ivas_rend_openCldfbRend( &inputSba->cldfbRendWrapper, inConfig, outConfig, &rendCtx.pSplitRendWrapper->multiBinPoseData, *rendCtx.pOutSampleRate ); if ( error != IVAS_ERR_OK ) { return error; @@ -2733,12 +2659,7 @@ static ivas_error updateSbaPanGains( else #endif { - error = ivas_rend_openCrend( &inputSba->crendWrapper, - getIvasAudioConfigFromRendAudioConfig( inConfig ), - getIvasAudioConfigFromRendAudioConfig( outConfig ), - hRendCfg, - NULL, - *rendCtx.pOutSampleRate + error = ivas_rend_openCrend( &inputSba->crendWrapper, inConfig, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses @@ -2746,19 +2667,14 @@ static ivas_error updateSbaPanGains( ); } break; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - if ( ( error = initSbaPanGainsForMcOut( inputSba, IVAS_REND_AUDIO_CONFIG_7_1_4, NULL ) ) != IVAS_ERR_OK ) + 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 ) { return error; } - error = ivas_rend_openCrend( &inputSba->crendWrapper, - AUDIO_CONFIG_7_1_4, - getIvasAudioConfigFromRendAudioConfig( outConfig ), - hRendCfg, - NULL, - *rendCtx.pOutSampleRate + error = ivas_rend_openCrend( &inputSba->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, hRendCfg, NULL, *rendCtx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , rendCtx.pSplitRendWrapper->multiBinPoseData.num_poses @@ -2787,13 +2703,13 @@ static ivas_error updateSbaPanGains( #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error setRendInputActiveSplitPostRend( void *input, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; rendering_context rendCtx; - IVAS_REND_AudioConfig outConfig; + AUDIO_CONFIG outConfig; input_split_post_rend *inputSplitPostRend; inputSplitPostRend = (input_split_post_rend *) input; @@ -2838,13 +2754,13 @@ static ivas_error initSbaMasaRendering( static ivas_error setRendInputActiveSba( void *input, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) { ivas_error error; rendering_context rendCtx; - IVAS_REND_AudioConfig outConfig; + AUDIO_CONFIG outConfig; input_sba *inputSba; #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t pos_idx; @@ -2885,7 +2801,7 @@ static ivas_error setRendInputActiveSba( initRotGains( inputSba->rot_gains_prev ); #endif /* SPLIT_REND_WITH_HEAD_ROT */ - if ( outConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || outConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( outConfig == AUDIO_CONFIG_MASA1 || outConfig == AUDIO_CONFIG_MASA2 ) { if ( ( error = initSbaMasaRendering( inputSba, *rendCtx.pOutSampleRate ) ) != IVAS_ERR_OK ) { @@ -2910,7 +2826,7 @@ static void clearInputSplitRend( rendCtx = inputSplitRend->base.ctx; freeInputBaseBufferData( &inputSplitRend->bufferData ); - initRendInputBase( &inputSplitRend->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + initRendInputBase( &inputSplitRend->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); if ( inputSplitRend->splitPostRendWrapper.hBinHrSplitPostRend != NULL ) { @@ -2937,7 +2853,7 @@ static void clearInputSba( rendCtx = inputSba->base.ctx; freeInputBaseBufferData( &inputSba->bufferData ); - initRendInputBase( &inputSba->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + initRendInputBase( &inputSba->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); /* Free input's internal handles */ @@ -2958,29 +2874,27 @@ static void clearInputSba( static ivas_error initMasaDummyDecForMcOut( input_masa *inputMasa, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; int16_t numCldfbAnalyses; int16_t numCldfbSyntheses; int16_t i; - AUDIO_CONFIG output_config; DecoderDummy *decDummy; decDummy = inputMasa->decDummy; - output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); - decDummy->hDecoderConfig->output_config = output_config; + decDummy->hDecoderConfig->output_config = outConfig; decDummy->sba_analysis_order = 1; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ 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 ), output_config ); - ivas_output_init( &( decDummy->hIntSetup ), output_config ); + ivas_output_init( &( decDummy->hOutSetup ), outConfig ); + ivas_output_init( &( decDummy->hIntSetup ), outConfig ); decDummy->renderer_type = RENDERER_DIRAC; - if ( output_config == AUDIO_CONFIG_STEREO ) + if ( outConfig == AUDIO_CONFIG_STEREO ) { decDummy->renderer_type = RENDERER_STEREO_PARAMETRIC; } @@ -3041,27 +2955,25 @@ static ivas_error initMasaDummyDecForMcOut( static ivas_error initMasaDummyDecForSbaOut( input_masa *inputMasa, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; int16_t numCldfbAnalyses; int16_t numCldfbSyntheses; int16_t i; - AUDIO_CONFIG output_config; DecoderDummy *decDummy; decDummy = inputMasa->decDummy; - output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); - decDummy->hDecoderConfig->output_config = output_config; + decDummy->hDecoderConfig->output_config = outConfig; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ 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 */ decDummy->sba_analysis_order = 1; - ivas_output_init( &( decDummy->hOutSetup ), output_config ); - ivas_output_init( &( decDummy->hIntSetup ), output_config ); + ivas_output_init( &( decDummy->hOutSetup ), outConfig ); + ivas_output_init( &( decDummy->hIntSetup ), outConfig ); decDummy->renderer_type = RENDERER_DIRAC; decDummy->ivas_format = MASA_FORMAT; decDummy->transport_config = AUDIO_CONFIG_INVALID; @@ -3111,30 +3023,23 @@ static ivas_error initMasaDummyDecForSbaOut( static ivas_error initMasaDummyDecForBinauralOut( input_masa *inputMasa, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; - int16_t i; - AUDIO_CONFIG output_config; DecoderDummy *decDummy; decDummy = inputMasa->decDummy; - - output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); - decDummy->hDecoderConfig->output_config = output_config; - - output_config = decDummy->hDecoderConfig->output_config; - + decDummy->hDecoderConfig->output_config = outConfig; decDummy->sba_analysis_order = 1; decDummy->hDecoderConfig->ivas_total_brate = IVAS_512k; /* Todo Nokia: This is preventing initialization of 2TC as 1TC, should be fixed properly in ivas_dirac_dec_config() */ 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 ), output_config ); - if ( output_config == AUDIO_CONFIG_BINAURAL + ivas_output_init( &( decDummy->hOutSetup ), outConfig ); + if ( outConfig == AUDIO_CONFIG_BINAURAL #ifdef SPLIT_REND_WITH_HEAD_ROT - || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || output_config == AUDIO_CONFIG_BINAURAL_SPLIT_PCM + || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM #endif ) { @@ -3186,7 +3091,7 @@ static ivas_error initMasaDummyDecForBinauralOut( static ivas_error updateMasaDummyDec( input_masa *inputMasa, - const IVAS_REND_AudioConfig outConfig ) + const AUDIO_CONFIG outConfig ) { ivas_error error; @@ -3211,7 +3116,7 @@ static ivas_error updateMasaDummyDec( static DecoderDummy *initDecoderDummy( const int32_t sampleRate, const int16_t numTransChannels, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const uint8_t enableRenderConfig #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -3244,8 +3149,8 @@ static DecoderDummy *initDecoderDummy( ivas_init_split_rend_handles( &decDummy->splitBinRend.splitrend ); decDummy->splitBinRend.splitrend = *pSplitRendWrapper; #ifdef FIX_658_SPLIT_REND_MASA - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || - outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || + outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) #else if ( decDummy->splitBinRend.splitrend.multiBinPoseData.num_poses > 1 ) #endif @@ -3278,7 +3183,7 @@ static DecoderDummy *initDecoderDummy( decDummy->hHeadTrackData = NULL; decDummy->hDirAC = NULL; decDummy->hTcBuffer = NULL; - decDummy->hDecoderConfig->output_config = getIvasAudioConfigFromRendAudioConfig( outConfig ); + decDummy->hDecoderConfig->output_config = outConfig; decDummy->nchan_transport = numTransChannels; if ( getAudioConfigType( outConfig ) == IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL ) @@ -3347,13 +3252,13 @@ static DecoderDummy *initDecoderDummy( static ivas_error setRendInputActiveMasa( void *input, - const IVAS_REND_AudioConfig inConfig, + const AUDIO_CONFIG inConfig, const IVAS_REND_InputId id, RENDER_CONFIG_DATA *hRendCfg ) /* Todo: This is not used at all within MASA. Support might be better to do after refactoring. */ { ivas_error error; rendering_context rendCtx; - IVAS_REND_AudioConfig outConfig; + AUDIO_CONFIG outConfig; input_masa *inputMasa; int16_t numInChannels; @@ -3381,7 +3286,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 == IVAS_REND_AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) + if ( ( error = masaPrerendOpen( &inputMasa->hMasaPrerend, inputMasa->base.inConfig == AUDIO_CONFIG_MASA1 ? 1 : 2, *( inputMasa->base.ctx.pOutSampleRate ) ) ) != IVAS_ERR_OK ) { return error; } @@ -3513,7 +3418,7 @@ static void clearInputMasa( freeInputBaseBufferData( &inputMasa->bufferData ); masaPrerendClose( &inputMasa->hMasaPrerend ); - initRendInputBase( &inputMasa->base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, rendCtx, + initRendInputBase( &inputMasa->base, AUDIO_CONFIG_INVALID, 0, rendCtx, NULL, 0 ); freeDecoderDummy( &inputMasa->decDummy ); @@ -3521,12 +3426,12 @@ static void clearInputMasa( } #ifdef SPLIT_REND_WITH_HEAD_ROT -static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, IVAS_REND_HeadRotData headRotData, const int32_t outputSampleRate, const IVAS_REND_AudioConfig outConfig, const int16_t cldfb_in ) +static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_AudioBuffer *pSplitRendEncBuffer, const IVAS_SPLIT_REND_CONFIG_DATA *pSplit_rend_config, IVAS_REND_HeadRotData headRotData, const int32_t outputSampleRate, const AUDIO_CONFIG outConfig, const int16_t cldfb_in ) { ivas_error error; IVAS_REND_AudioBufferConfig bufConfig; - if ( outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { if ( pSplit_rend_config->poseCorrectionMode == IVAS_SPLIT_REND_POSE_CORRECTION_MODE_CLDFB ) @@ -3542,7 +3447,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN pSplit_rend_config, outputSampleRate, cldfb_in, - outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + outConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( error != IVAS_ERR_OK ) { return error; @@ -3577,7 +3482,7 @@ static ivas_error initSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REN ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, const int32_t outputSampleRate, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const int16_t nonDiegeticPan, const float nonDiegeticPanGain ) { @@ -3665,7 +3570,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsIsm[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + initRendInputBase( &hIvasRend->inputsIsm[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsIsm[i].crendWrapper = NULL; hIvasRend->inputsIsm[i].hReverb = NULL; @@ -3685,7 +3590,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMc[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + initRendInputBase( &hIvasRend->inputsMc[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsMc[i].efapInWrapper.hEfap = NULL; hIvasRend->inputsMc[i].crendWrapper = NULL; @@ -3709,7 +3614,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsSba[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + initRendInputBase( &hIvasRend->inputsSba[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsSba[i].crendWrapper = NULL; #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -3722,7 +3627,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; ++i ) { - initRendInputBase( &hIvasRend->inputsMasa[i].base, IVAS_REND_AUDIO_CONFIG_UNKNOWN, 0, getRendCtx( hIvasRend ), + initRendInputBase( &hIvasRend->inputsMasa[i].base, AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); hIvasRend->inputsMasa[i].decDummy = NULL; hIvasRend->inputsMasa[i].metadataHasBeenFed = false; @@ -3733,7 +3638,7 @@ ivas_error IVAS_REND_Open( for ( i = 0; i < RENDERER_MAX_BIN_INPUTS; ++i ) { initRendInputBase( &hIvasRend->inputsSplitPost[i].base, - IVAS_REND_AUDIO_CONFIG_UNKNOWN, + AUDIO_CONFIG_INVALID, 0, getRendCtx( hIvasRend ), NULL, 0 ); @@ -3819,7 +3724,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - if ( hIvasRend->outputConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( hIvasRend->outputConfig != 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; @@ -3855,7 +3760,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; ++i ) { inputMc = &hIvasRend->inputsMc[i]; - if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( inputMc->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Input inactive, skip. */ continue; @@ -3874,7 +3779,7 @@ ivas_error IVAS_REND_ConfigureCustomOutputLoudspeakerLayout( { inputSba = &hIvasRend->inputsSba[i]; - if ( inputSba->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( inputSba->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Input inactive, skip. */ continue; @@ -3904,7 +3809,7 @@ ivas_error IVAS_REND_NumOutChannels( /* Handle special cases where additional info is needed from the renderer, otherwise use getAudioConfigNumChannels() */ switch ( hIvasRend->outputConfig ) { - case IVAS_REND_AUDIO_CONFIG_LS_CUSTOM: + case AUDIO_CONFIG_LS_CUSTOM: *numOutChannels = hIvasRend->customLsOut.num_spk + hIvasRend->customLsOut.num_lfe; break; default: @@ -3919,7 +3824,7 @@ ivas_error IVAS_REND_NumOutChannels( } static IVAS_REND_InputId makeInputId( - IVAS_REND_AudioConfig config, + AUDIO_CONFIG config, const int32_t inputIndex ) { /* Put config type in second byte (from LSB), put index + 1 in first byte @@ -3990,7 +3895,7 @@ static ivas_error getInputById( } /* Ensure input ID matches and that input is active */ - if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID ) { return IVAS_ERR_INVALID_INPUT_ID; } @@ -4064,7 +3969,7 @@ static ivas_error getConstInputById( } /* Ensure input ID matches and that input is active */ - if ( pInputBase->id != inputId || pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pInputBase->id != inputId || pInputBase->inConfig == AUDIO_CONFIG_INVALID ) { return IVAS_ERR_INVALID_INPUT_ID; } @@ -4100,7 +4005,7 @@ static ivas_error findFreeInputSlot( { pInputBase = (const input_base *) pByte; - if ( pInputBase->inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pInputBase->inConfig == AUDIO_CONFIG_INVALID ) { *inputIndex = i; canAddInput = true; @@ -4137,16 +4042,16 @@ static void closeSplitRend( SPLIT_REND_WRAPPER *pSplitRendWrapper, IVAS_REND_Aud *-------------------------------------------------------------------*/ ivas_error IVAS_REND_AddInput( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_REND_AudioConfig inConfig, /* i : audio config for a new input */ - IVAS_REND_InputId *inputId /* o : ID of the new input */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const AUDIO_CONFIG inConfig, /* i : audio config for a new input */ + IVAS_REND_InputId *inputId /* o : ID of the new input */ ) { ivas_error error; int32_t maxNumInputsOfType; void *inputsArray; int32_t inputStructSize; - ivas_error ( *activateInput )( void *, IVAS_REND_AudioConfig, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); + ivas_error ( *activateInput )( void *, AUDIO_CONFIG, IVAS_REND_InputId, RENDER_CONFIG_DATA * ); int32_t inputIndex; /* Validate function arguments */ @@ -4168,7 +4073,7 @@ ivas_error IVAS_REND_AddInput( #ifdef FIX_658_SPLIT_REND_MASA ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, ( cldfb_in == 0 ), - hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); #endif if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, @@ -4270,7 +4175,7 @@ ivas_error IVAS_REND_ConfigureCustomInputLoudspeakerLayout( return error; } - if ( inputMc->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inputMc->base.inConfig != 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; @@ -4291,7 +4196,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 == IVAS_REND_AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) + if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_IR || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) #endif { if ( ( error = initMcBinauralRendering( inputMc, inputMc->base.inConfig, hIvasRend->outputConfig, hIvasRend->hRendererConfig ) ) != IVAS_ERR_OK ) @@ -4544,7 +4449,7 @@ ivas_error IVAS_REND_GetNumAllObjects( return IVAS_ERR_UNEXPECTED_NULL_POINTER; } - if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) + if ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 ) { *numChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects; } @@ -4585,7 +4490,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 != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( hIvasRend->inputsIsm[i].base.inConfig != 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 ); @@ -4595,7 +4500,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { - if ( hIvasRend->inputsMc[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( hIvasRend->inputsMc[i].base.inConfig != 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 ); @@ -4605,7 +4510,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { - if ( hIvasRend->inputsSba[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( hIvasRend->inputsSba[i].base.inConfig != AUDIO_CONFIG_INVALID ) { #ifdef SPLIT_REND_WITH_HEAD_ROT if ( hIvasRend->splitRendWrapper.hBinHrSplitPreRend != NULL ) @@ -4637,7 +4542,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 != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( hIvasRend->inputsSplitPost[i].base.inConfig != AUDIO_CONFIG_INVALID ) { latency_ns = 0; if ( hIvasRend->inputsSplitPost[i].splitPostRendWrapper.hLc3plusDec != NULL ) @@ -4657,7 +4562,7 @@ ivas_error IVAS_REND_GetDelay( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { - if ( hIvasRend->inputsMasa[i].base.inConfig != IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( hIvasRend->inputsMasa[i].base.inConfig != AUDIO_CONFIG_INVALID ) { latency_ns = (int32_t) ( (float) IVAS_FB_DEC_DELAY_NS + 0.5f ); max_latency_ns = max( max_latency_ns, latency_ns ); @@ -4732,7 +4637,7 @@ ivas_error IVAS_REND_FeedInputAudio( { return error; } - if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == IVAS_REND_AUDIO_CONFIG_OBJECT ) + if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 || hIvasRend->outputConfig == AUDIO_CONFIG_MASA2 ) && inputBase->inConfig == AUDIO_CONFIG_OBA ) { numInputChannels = (int16_t) hIvasRend->inputsIsm[0].total_num_objects; } @@ -4783,7 +4688,7 @@ ivas_error IVAS_REND_FeedInputObjectMetadata( return error; } - if ( inputBase->inConfig != IVAS_REND_AUDIO_CONFIG_OBJECT ) + if ( inputBase->inConfig != AUDIO_CONFIG_OBA ) { /* Object metadata should only be fed for object inputs */ return IVAS_ERR_METADATA_NOT_EXPECTED; @@ -4871,8 +4776,8 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( *-------------------------------------------------------------------*/ ivas_error IVAS_REND_InitConfig( - IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */ + IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ + const AUDIO_CONFIG outAudioConfig /* i : output audioConfig */ ) { ivas_error error; @@ -5018,7 +4923,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 == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_split_rend_validate_config( &hRenderConfig->split_rend_config, ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ) ) != IVAS_ERR_OK ) { return error; } @@ -5033,7 +4938,7 @@ int16_t IVAS_REND_FeedRenderConfig( /* TODO : Do not hard code TDin to 1 here*/ ivas_split_rend_choose_default_codec( &hIvasRend->hRendererConfig->split_rend_config.codec, 1, - hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); + hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ); if ( ( error = initSplitRend( &hIvasRend->splitRendWrapper, &hIvasRend->splitRendEncBuffer, &hIvasRend->hRendererConfig->split_rend_config, @@ -5085,8 +4990,8 @@ ivas_error IVAS_REND_SetHeadRotation( if ( headRot == NULL ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { hIvasRend->headRotData.headRotEnabled = 1; for ( i = 0; i < RENDERER_HEAD_POSITIONS_PER_FRAME; ++i ) @@ -5114,10 +5019,10 @@ ivas_error IVAS_REND_SetHeadRotation( if ( headRot[i].w == -3.0f ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) || - ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->inputsSplitPost[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + 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 ) ) { Euler2Quat( deg2rad( headRot[i].x ), deg2rad( headRot[i].y ), deg2rad( headRot[i].z ), &rotQuat ); } @@ -5460,7 +5365,7 @@ static void renderBufferChannel( static ivas_error rotateFrameMc( IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + AUDIO_CONFIG inConfig, /* i : Input Audio config */ LSSETUP_CUSTOM_STRUCT inCustomLs, /* 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 */ @@ -5486,7 +5391,7 @@ static ivas_error rotateFrameMc( push_wmops( "rotateFrameMc" ); - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM ) { if ( ( error = getAudioConfigNumChannels( inConfig, &nchan ) ) != IVAS_ERR_OK ) { @@ -5597,7 +5502,7 @@ static ivas_error rotateFrameMc( static ivas_error rotateFrameSba( IVAS_REND_AudioBuffer inAudio, /* i : Input Audio buffer */ - IVAS_REND_AudioConfig inConfig, /* i : Input Audio config */ + AUDIO_CONFIG inConfig, /* i : Input Audio config */ 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 */ @@ -5867,7 +5772,7 @@ static ivas_error renderIsmToBinauralRoom( /* intermediate rendering to 7_1_4 */ tmpMcBuffer = ismInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -5949,7 +5854,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 == IVAS_REND_AUDIO_CONFIG_STEREO ) + if ( *ismInput->base.ctx.pOutConfig == AUDIO_CONFIG_STEREO ) { if ( ismInput->nonDiegeticPan ) { @@ -6004,7 +5909,7 @@ static ivas_error renderIsmToMc( static ivas_error renderIsmToSba( const input_ism *ismInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const IVAS_REND_AudioBuffer outAudio ) { int16_t ambiOrderOut; @@ -6230,7 +6135,7 @@ static ivas_error renderIsmToMasa( static ivas_error renderInputIsm( input_ism *ismInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, const IVAS_REND_AudioBuffer outAudio ) { ivas_error error; @@ -6259,19 +6164,19 @@ static ivas_error renderInputIsm( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: error = renderIsmToBinaural( ismInput, outAudio ); break; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_IR: error = renderIsmToBinauralRoom( ismInput, outAudio ); break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderIsmToSplitBinaural( ismInput, outAudio ); break; #endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderIsmToBinauralReverb( ismInput, outAudio ); break; default: @@ -6303,7 +6208,7 @@ static ivas_error renderActiveInputsIsm( for ( i = 0, pCurrentInput = hIvasRend->inputsIsm; i < RENDERER_MAX_ISM_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -6322,7 +6227,7 @@ static ivas_error renderActiveInputsIsm( static ivas_error renderLfeToBinaural( const input_mc *mcInput, #ifdef SPLIT_REND_WITH_HEAD_ROT - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, #endif IVAS_REND_AudioBuffer outAudio ) { @@ -6352,7 +6257,7 @@ static ivas_error renderLfeToBinaural( gain = GAIN_LFE; - if ( mcInput->base.inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + if ( mcInput->base.inConfig != AUDIO_CONFIG_LS_CUSTOM ) { lfe_idx = LFE_CHANNEL; } @@ -6449,11 +6354,11 @@ static ivas_error renderLfeToBinaural( static ivas_error renderMcToBinaural( input_mc *mcInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - IVAS_REND_AudioConfig inConfig; + AUDIO_CONFIG inConfig; ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; @@ -6485,9 +6390,9 @@ static ivas_error renderMcToBinaural( } } - if ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled + if ( ( inConfig == AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled - && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) + && ( inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); @@ -6533,8 +6438,7 @@ static ivas_error renderMcToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , 0 @@ -6565,11 +6469,11 @@ static ivas_error renderMcToBinaural( static ivas_error renderMcToBinauralRoom( input_mc *mcInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; - IVAS_REND_AudioConfig inConfig; + AUDIO_CONFIG inConfig; ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; @@ -6601,7 +6505,7 @@ static ivas_error renderMcToBinauralRoom( } } - if ( ( mcInput->hReverb != NULL && outConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) && ( ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) || ( combinedOrientationEnabled && ( inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) ) ) ) + 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 ) ) ) ) { copyBufferTo2dArray( mcInput->base.inputBuffer, tmpRendBuffer ); @@ -6646,8 +6550,7 @@ static ivas_error renderMcToBinauralRoom( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , 0 @@ -6676,7 +6579,7 @@ static ivas_error renderMcToBinauralRoom( static ivas_error renderMcCustomLsToBinauralRoom( input_mc *mcInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { int16_t i; @@ -6737,7 +6640,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( /* intermediate conversion to 7_1_4 */ tmpMcBuffer = mcInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -6754,7 +6657,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), NULL, NULL, NULL, NULL, + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *mcInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -6849,7 +6752,7 @@ static ivas_error renderMcToMasa( #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderMcToSplitBinaural( input_mc *mcInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { int16_t i, j, sf, pos_idx; @@ -6860,7 +6763,7 @@ static ivas_error renderMcToSplitBinaural( float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; float *p_tmpRendBuffer[MAX_OUTPUT_CHANNELS]; float tmpSplitBinauralBuffer[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][L_FRAME48k]; - IVAS_REND_AudioConfig inConfig; + AUDIO_CONFIG inConfig; IVAS_REND_AudioBuffer tmpRotBuffer; COMBINED_ORIENTATION_DATA combinedOrientationDataLocal; COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal; @@ -6898,7 +6801,7 @@ static ivas_error renderMcToSplitBinaural( /* temporary buffer for rotation in source format for CREND */ tmpRotBuffer = mcInput->base.inputBuffer; - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 ) { tmpRotBuffer.data = malloc( tmpRotBuffer.config.numSamplesPerChannel * tmpRotBuffer.config.numChannels * sizeof( float ) ); } @@ -6920,7 +6823,7 @@ static ivas_error renderMcToSplitBinaural( QuatToRotMat( combinedOrientationDataLocal.Quaternions[i], combinedOrientationDataLocal.Rmat[i] ); } - if ( inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM || inConfig == IVAS_REND_AUDIO_CONFIG_5_1 || inConfig == IVAS_REND_AUDIO_CONFIG_7_1 ) + if ( inConfig == AUDIO_CONFIG_LS_CUSTOM || inConfig == AUDIO_CONFIG_5_1 || inConfig == AUDIO_CONFIG_7_1 ) { /* tdrend processing overview: * 1. copy from inputBuffer to tmpRendBuffer @@ -6988,16 +6891,7 @@ static ivas_error renderMcToSplitBinaural( copyBufferTo2dArray( tmpRotBuffer, tmpRendBuffer ); /* call CREND (rotation already performed) */ - if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, - getIvasAudioConfigFromRendAudioConfig( mcInput->base.inConfig ), - getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, - NULL, - NULL, - NULL, - p_tmpRendBuffer, - *mcInput->base.ctx.pOutSampleRate, - pos_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( mcInput->crendWrapper, mcInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpRendBuffer, *mcInput->base.ctx.pOutSampleRate, pos_idx ) ) != IVAS_ERR_OK ) { return error; } @@ -7015,7 +6909,7 @@ static ivas_error renderMcToSplitBinaural( } } - if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inConfig != IVAS_REND_AUDIO_CONFIG_5_1 && inConfig != IVAS_REND_AUDIO_CONFIG_7_1 ) + if ( inConfig != AUDIO_CONFIG_LS_CUSTOM && inConfig != AUDIO_CONFIG_5_1 && inConfig != AUDIO_CONFIG_7_1 ) { /* free temporary buffer for rotation in source format for CREND */ free( tmpRotBuffer.data ); @@ -7036,7 +6930,7 @@ static ivas_error renderMcToSplitBinaural( static ivas_error renderInputMc( input_mc *mcInput, - IVAS_REND_AudioConfig outConfig, + AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { ivas_error error; @@ -7070,12 +6964,12 @@ static ivas_error renderInputMc( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: error = renderMcToBinaural( mcInput, outConfig, outAudio ); break; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: - if ( mcInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + if ( mcInput->base.inConfig == AUDIO_CONFIG_LS_CUSTOM ) { error = renderMcCustomLsToBinauralRoom( mcInput, outConfig, outAudio ); } @@ -7085,8 +6979,8 @@ static ivas_error renderInputMc( } break; #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderMcToSplitBinaural( mcInput, outConfig, outAudio ); break; #endif @@ -7114,7 +7008,7 @@ static ivas_error renderActiveInputsMc( for ( i = 0, pCurrentInput = hIvasRend->inputsMc; i < RENDERER_MAX_MC_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -7297,7 +7191,7 @@ static ivas_error renderSplitBinauralWithPostRot( hSplitBin->multiBinPoseData.poseCorrectionMode = bits.pose_correction; /* decode audio */ - if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { if ( bits.codec == IVAS_SPLIT_REND_CODEC_LCLD ) { @@ -7361,7 +7255,7 @@ static ivas_error renderSplitBinauralWithPostRot( } else { - if ( splitBinInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) + if ( splitBinInput->base.inConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) { int16_t ch_idx; for ( ch_idx = 0; ch_idx < BINAURAL_CHANNELS; ch_idx++ ) @@ -7386,7 +7280,7 @@ static ivas_error renderSplitBinauralWithPostRot( static ivas_error renderSbaToMultiBinaural( input_sba *sbaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, float out[][L_FRAME48k] ) { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7395,11 +7289,10 @@ static ivas_error renderSbaToMultiBinaural( int16_t sf, i, j, pos_idx; COMBINED_ORIENTATION_DATA combinedOrientationDataLocal; COMBINED_ORIENTATION_HANDLE pCombinedOrientationDataLocal; - - ivas_error error; IVAS_REND_AudioBuffer tmpRotBuffer; const MULTI_BIN_REND_POSE_DATA *pMultiBinPoseData; + for ( i = 0; i < MAX_OUTPUT_CHANNELS; i++ ) { p_tmpCrendBuffer[i] = tmpCrendBuffer[i]; @@ -7460,11 +7353,7 @@ static ivas_error renderSbaToMultiBinaural( assert( sbaInput->crendWrapper->hCrend[0]->hReverb == NULL ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, - p_tmpCrendBuffer, - *sbaInput->base.ctx.pOutSampleRate, - pos_idx ) ) != IVAS_ERR_OK ) + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate, pos_idx ) ) != IVAS_ERR_OK ) { return error; } @@ -7488,10 +7377,11 @@ static ivas_error renderSbaToMultiBinaural( return IVAS_ERR_OK; } -static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput, - float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], - const int16_t low_res_pre_rend_rot ) +static ivas_error renderSbaToMultiBinauralCldfb( + input_sba *sbaInput, + float Cldfb_Out_Real[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + float Cldfb_Out_Imag[][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], + const int16_t low_res_pre_rend_rot ) { float Cldfb_RealBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; float Cldfb_ImagBuffer[MAX_OUTPUT_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX]; @@ -7512,7 +7402,7 @@ static ivas_error renderSbaToMultiBinauralCldfb( input_sba *sbaInput, static ivas_error renderSbaToSplitBinaural( input_sba *sbaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7552,7 +7442,7 @@ static ivas_error renderSbaToSplitBinaural( static ivas_error renderSbaToBinaural( input_sba *sbaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { float tmpCrendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; @@ -7632,8 +7522,7 @@ static ivas_error renderSbaToBinaural( } /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, getIvasAudioConfigFromRendAudioConfig( sbaInput->base.inConfig ), getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, sbaInput->base.inConfig, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , 0 @@ -7653,7 +7542,7 @@ static ivas_error renderSbaToBinaural( static ivas_error renderSbaToBinauralRoom( input_sba *sbaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { int16_t i; @@ -7716,7 +7605,7 @@ static ivas_error renderSbaToBinauralRoom( /* intermediate rendering to 7_1_4 */ tmpMcBuffer = sbaInput->base.inputBuffer; - if ( ( error = getAudioConfigNumChannels( IVAS_REND_AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) + if ( ( error = getAudioConfigNumChannels( AUDIO_CONFIG_7_1_4, &tmp ) ) != IVAS_ERR_OK ) { return error; } @@ -7734,8 +7623,7 @@ static ivas_error renderSbaToBinauralRoom( copyBufferTo2dArray( tmpMcBuffer, tmpCrendBuffer ); /* call CREND */ - if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, getIvasAudioConfigFromRendAudioConfig( outConfig ), - NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate + if ( ( error = ivas_rend_crendProcess( sbaInput->crendWrapper, AUDIO_CONFIG_7_1_4, outConfig, NULL, NULL, NULL, NULL, p_tmpCrendBuffer, *sbaInput->base.ctx.pOutSampleRate #ifdef SPLIT_REND_WITH_HEAD_ROT , 0 @@ -7761,7 +7649,7 @@ static ivas_error renderSbaToBinauralRoom( #ifdef SPLIT_REND_WITH_HEAD_ROT static ivas_error renderInputSplitBin( input_split_post_rend *splitBinInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio, IVAS_REND_BitstreamBuffer *hBits, const int16_t SplitRendBFI ) @@ -7785,7 +7673,7 @@ static ivas_error renderInputSplitBin( inAudio.config.numSamplesPerChannel * inAudio.config.numChannels ); switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: error = renderSplitBinauralWithPostRot( splitBinInput, outAudio, hBits, SplitRendBFI ); @@ -7817,7 +7705,7 @@ static ivas_error renderSbaToMasa( static ivas_error renderInputSba( input_sba *sbaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { ivas_error error; @@ -7829,7 +7717,7 @@ static ivas_error renderInputSba( #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) && - ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else if ( sbaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) #endif @@ -7857,8 +7745,8 @@ static ivas_error renderInputSba( switch ( outConfig ) { #ifdef SPLIT_REND_WITH_HEAD_ROT - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: error = renderSbaToSplitBinaural( sbaInput, #ifdef SPLIT_REND_WITH_HEAD_ROT outConfig, @@ -7866,11 +7754,11 @@ static ivas_error renderInputSba( outAudio ); break; #endif - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: error = renderSbaToBinaural( sbaInput, outConfig, outAudio ); break; - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + case AUDIO_CONFIG_BINAURAL_ROOM_IR: + case AUDIO_CONFIG_BINAURAL_ROOM_REVERB: error = renderSbaToBinauralRoom( sbaInput, outConfig, outAudio ); break; default: @@ -7899,7 +7787,7 @@ static ivas_error renderActiveInputsSplitBin( for ( i = 0, pCurrentInput = hIvasRend->inputsSplitPost; i < RENDERER_MAX_BIN_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -7926,7 +7814,7 @@ static ivas_error renderActiveInputsSba( for ( i = 0, pCurrentInput = hIvasRend->inputsSba; i < RENDERER_MAX_SBA_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -8184,7 +8072,7 @@ static void renderMasaToMasa( static ivas_error renderInputMasa( input_masa *masaInput, - const IVAS_REND_AudioConfig outConfig, + const AUDIO_CONFIG outConfig, IVAS_REND_AudioBuffer outAudio ) { IVAS_REND_AudioBuffer inAudio; @@ -8197,7 +8085,7 @@ static ivas_error renderInputMasa( inAudio = masaInput->base.inputBuffer; #ifdef SPLIT_REND_WITH_HEAD_ROT if ( ( masaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) && - ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) && ( outConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) #else if ( masaInput->base.numNewSamplesPerChannel != outAudio.config.numSamplesPerChannel ) #endif @@ -8224,7 +8112,7 @@ static ivas_error renderInputMasa( case IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL: switch ( outConfig ) { - case IVAS_REND_AUDIO_CONFIG_BINAURAL: + case AUDIO_CONFIG_BINAURAL: renderMasaToBinaural( masaInput, outAudio #ifdef SPLIT_REND_WITH_HEAD_ROT , @@ -8234,16 +8122,16 @@ static ivas_error renderInputMasa( break; /* ToDo */ //#ifdef FIX_196_REFACTOR_RENDERER_OUTPUT_CONFIG - // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR: - // case IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB: + // case AUDIO_CONFIG_BINAURAL_ROOM_IR: + // case 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 IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED: - case IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM: + case AUDIO_CONFIG_BINAURAL_SPLIT_CODED: + case AUDIO_CONFIG_BINAURAL_SPLIT_PCM: /* TODO: implement */ renderMasaToBinaural( masaInput, outAudio #ifdef SPLIT_REND_WITH_HEAD_ROT @@ -8278,7 +8166,7 @@ static ivas_error renderActiveInputsMasa( for ( i = 0, pCurrentInput = hIvasRend->inputsMasa; i < RENDERER_MAX_MASA_INPUTS; ++i, ++pCurrentInput ) { - if ( pCurrentInput->base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) + if ( pCurrentInput->base.inConfig == AUDIO_CONFIG_INVALID ) { /* Skip inactive inputs */ continue; @@ -8418,7 +8306,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 == IVAS_REND_AUDIO_CONFIG_MASA1 ? 0u : 1u; + ( *hMasaExtOutMeta )->descriptiveMeta.numberOfChannels = hIvasRend->outputConfig == AUDIO_CONFIG_MASA1 ? 0u : 1u; return IVAS_ERR_OK; @@ -8541,21 +8429,21 @@ ivas_error IVAS_REND_GetSamples( for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { - numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1; + numMasaInputs += hIvasRend->inputsMasa[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { - numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1; + numOtherInputs += hIvasRend->inputsMc[i].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { - numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1; + numOtherInputs += hIvasRend->inputsSba[i].base.inConfig == 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 == IVAS_REND_AUDIO_CONFIG_UNKNOWN ? 0 : 1; + numOtherInputs += hIvasRend->inputsIsm[0].base.inConfig == AUDIO_CONFIG_INVALID ? 0 : 1; if ( numMasaInputs == 0 || numOtherInputs == 0 ) { @@ -8580,14 +8468,14 @@ ivas_error IVAS_REND_GetSamples( #ifdef SPLIT_REND_WITH_HEAD_ROT outAudioOrig = outAudio; /* Use internal buffer if outputting split rendering bitstream */ - if ( ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || - ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) + if ( ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || + ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ) { int16_t num_poses_orig; num_poses_orig = hIvasRend->splitRendWrapper.multiBinPoseData.num_poses; outAudio = hIvasRend->splitRendEncBuffer; if ( ( outAudioOrig.config.is_cldfb == 0 ) && - ( hIvasRend->inputsMasa[0].base.inConfig == IVAS_REND_AUDIO_CONFIG_UNKNOWN ) ) + ( hIvasRend->inputsMasa[0].base.inConfig == AUDIO_CONFIG_INVALID ) ) { outAudio.config.is_cldfb = 0; outAudio.config.numSamplesPerChannel >>= 1; @@ -8643,7 +8531,7 @@ ivas_error IVAS_REND_GetSamples( #endif /* SPLIT_REND_WITH_HEAD_ROT */ #ifdef SPLIT_REND_WITH_HEAD_ROT - if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { ivas_split_rend_bits_t bits; int16_t td_input; @@ -8675,14 +8563,14 @@ ivas_error IVAS_REND_GetSamples( tmpBinaural, 1, td_input, - ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); + ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0 ); if ( error != IVAS_ERR_OK ) { return error; } convertInternalBitsBuffToBitsBuffer( hBits, bits ); outAudio = outAudioOrig; - if ( hIvasRend->outputConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) + if ( hIvasRend->outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) { accumulate2dArrayToBuffer( tmpBinaural, &outAudio ); } diff --git a/lib_rend/lib_rend.h b/lib_rend/lib_rend.h index c86b8bcbf2590d3167be4fbae00ad3922bd19440..8300893aed17786a16242bd32f275f72106c0994 100644 --- a/lib_rend/lib_rend.h +++ b/lib_rend/lib_rend.h @@ -98,56 +98,6 @@ typedef enum IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN, } IVAS_REND_AudioConfigType; -/* TODO(sgi): Harmonize with AUDIO_CONFIG */ -/* - Note: numerical values carry specific information here. - - MSB LSB - -------------------------------------------------------------------------------- - ... unused (assumed all 0) ... | config type (1 byte) | config variant (1 byte) | - -------------------------------------------------------------------------------- - - Where "config type" is the general type from the following list: - - unknown - - channel-based - - ambisonics - - object-based - - binaural - - MASA - - Config variants are concrete configs of each type. - */ -typedef enum -{ - IVAS_REND_AUDIO_CONFIG_MONO = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 0, - IVAS_REND_AUDIO_CONFIG_STEREO = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 1, - IVAS_REND_AUDIO_CONFIG_5_1 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 2, - IVAS_REND_AUDIO_CONFIG_7_1 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 3, - IVAS_REND_AUDIO_CONFIG_5_1_2 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 4, - IVAS_REND_AUDIO_CONFIG_5_1_4 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 5, - IVAS_REND_AUDIO_CONFIG_7_1_4 = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 6, - IVAS_REND_AUDIO_CONFIG_LS_CUSTOM = IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED << 8 | 255, - - IVAS_REND_AUDIO_CONFIG_FOA = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 0, - IVAS_REND_AUDIO_CONFIG_HOA2 = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 1, - IVAS_REND_AUDIO_CONFIG_HOA3 = IVAS_REND_AUDIO_CONFIG_TYPE_AMBISONICS << 8 | 2, - - IVAS_REND_AUDIO_CONFIG_OBJECT = IVAS_REND_AUDIO_CONFIG_TYPE_OBJECT_BASED << 8 | 0, - - IVAS_REND_AUDIO_CONFIG_BINAURAL = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 0, - IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_IR = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 1, - IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 2, -#ifdef SPLIT_REND_WITH_HEAD_ROT - IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_PCM = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 3, - IVAS_REND_AUDIO_CONFIG_BINAURAL_SPLIT_CODED = IVAS_REND_AUDIO_CONFIG_TYPE_BINAURAL << 8 | 4, -#endif - - IVAS_REND_AUDIO_CONFIG_MASA1 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 0, - IVAS_REND_AUDIO_CONFIG_MASA2 = IVAS_REND_AUDIO_CONFIG_TYPE_MASA << 8 | 1, - - IVAS_REND_AUDIO_CONFIG_UNKNOWN = IVAS_REND_AUDIO_CONFIG_TYPE_UNKNOWN << 8 | 0, -} IVAS_REND_AudioConfig; - typedef uint16_t IVAS_REND_InputId; @@ -161,7 +111,7 @@ typedef uint16_t IVAS_REND_InputId; ivas_error IVAS_REND_Open( IVAS_REND_HANDLE *phIvasRend, /* i/o: Pointer to renderer handle */ const int32_t outputSampleRate, /* i : output sampling rate */ - const IVAS_REND_AudioConfig outConfig, /* i : output audio config */ + const AUDIO_CONFIG outConfig, /* i : output audio config */ const int16_t nonDiegeticPan, /* i : non-diegetic object flag */ const float nonDiegeticPanGain /* i : non-diegetic panning gain */ ); @@ -182,7 +132,7 @@ ivas_error IVAS_REND_NumOutChannels( ivas_error IVAS_REND_AddInput( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_REND_AudioConfig inConfig, /* i : audio config for a new input */ + const AUDIO_CONFIG inConfig, /* i : audio config for a new input */ IVAS_REND_InputId *inputId /* o : ID of the new input */ ); @@ -258,7 +208,7 @@ ivas_error IVAS_REND_FeedInputMasaMetadata( ivas_error IVAS_REND_InitConfig( IVAS_REND_HANDLE hIvasRend, /* i/o: Renderer handle */ - const IVAS_REND_AudioConfig outAudioConfig /* i : output audioConfig */ + const AUDIO_CONFIG outAudioConfig /* i : output audioConfig */ ); int16_t IVAS_REND_GetRenderConfig( @@ -366,7 +316,7 @@ ivas_error IVAS_REND_GetSamples( IVAS_REND_AudioBuffer outAudio /* i/o: buffer for output audio */ #ifdef SPLIT_REND_WITH_HEAD_ROT , - IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ + IVAS_REND_BitstreamBuffer *hBits /*i/o: buffer for input/output bitstream. Needed in split rendering mode*/ #endif );