Loading apps/renderer.c +47 −12 Original line number Diff line number Diff line Loading @@ -1101,6 +1101,53 @@ int main( fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { /* Set reverb room size if specified or select based automatically based on default per input formats */ IVAS_ROOM_SIZE_T selectedReverbRoomSize = args.reverbRoomSize; if ( selectedReverbRoomSize == IVAS_ROOM_SIZE_AUTO ) { bool combinedFormat = false; selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; /* ISM present with MASA/SBA inputs; treat as combined format */ if ( args.inConfig.numAudioObjects > 0 && ( args.inConfig.numMasaBuses > 0 || args.inConfig.numAmbisonicsBuses > 0 ) ) { combinedFormat = true; } if ( combinedFormat ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; } else { /* Only set large if ISM is present alone, MASA and Ambisonic have been checked above */ if ( args.inConfig.numAudioObjects > 0 && args.inConfig.numMultiChannelBuses == 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_LARGE; } /* if only MC is present, set medium; Will not be overridden by the subsequent block */ else if ( args.inConfig.numMultiChannelBuses > 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; } else if ( args.inConfig.numMasaBuses > 0 || args.inConfig.numAmbisonicsBuses > 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_SMALL; } } } if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, selectedReverbRoomSize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError setting reverb room size\n" ); goto cleanup; } } #endif if ( args.renderConfigFilePath[0] != '\0' ) { Loading Loading @@ -1176,18 +1223,6 @@ int main( fprintf( stderr, "\nError in IVAS_REND_SetOrientationTrackingMode(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* Set reverb room size if specified */ if ( args.reverbRoomSize != IVAS_ROOM_SIZE_AUTO ) { if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, args.reverbRoomSize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError setting reverb room size\n" ); goto cleanup; } } #endif /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) Loading lib_rend/lib_rend.c +1 −93 Original line number Diff line number Diff line Loading @@ -3809,85 +3809,6 @@ static ivas_error isar_pre_rend_init( return IVAS_ERR_OK; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE static IVAS_ROOM_SIZE_T getDefaultReverbSize( input_ism *ismInputs, input_masa *masaInputs, input_mc *mcInputs, input_sba *sbaInputs ) { bool combinedFormat; int16_t i; int16_t nActiveInputsIsm, nActiveInputsMasa, nActiveInputsSba, nActiveInputsMc; IVAS_ROOM_SIZE_T selectedReverb; selectedReverb = IVAS_ROOM_SIZE_MEDIUM; combinedFormat = false; nActiveInputsIsm = 0; nActiveInputsMasa = 0; nActiveInputsMc = 0; nActiveInputsSba = 0; for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ ) { if ( ismInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsIsm++; } } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { if ( masaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsMasa++; } } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { if ( mcInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsMc++; } } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { if ( sbaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsSba++; } } /* ISM present with MASA/SBA inputs; treat as combined format */ if ( nActiveInputsIsm && ( nActiveInputsMasa || nActiveInputsSba ) ) { combinedFormat = true; } if ( combinedFormat ) { selectedReverb = IVAS_ROOM_SIZE_MEDIUM; } else { /* Only set large if ISM is present alone */ if ( nActiveInputsIsm && !nActiveInputsMc ) { selectedReverb = IVAS_ROOM_SIZE_LARGE; } /* if only MC is present, set medium; Will not be overridden by the subsequent block */ else if ( nActiveInputsMc ) { selectedReverb = IVAS_ROOM_SIZE_MEDIUM; } else if ( nActiveInputsMasa || nActiveInputsSba ) { selectedReverb = IVAS_ROOM_SIZE_SMALL; } } return selectedReverb; } #endif /*-------------------------------------------------------------------* Loading Loading @@ -3987,18 +3908,6 @@ ivas_error IVAS_REND_AddInput( /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); #ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* select default reverb size after adding an input */ if ( hIvasRend->selectedRoomReverbSize == DEFAULT_REVERB_UNSET ) { IVAS_REND_SetReverbRoomSize( hIvasRend, getDefaultReverbSize( hIvasRend->inputsIsm, hIvasRend->inputsMasa, hIvasRend->inputsMc, hIvasRend->inputsSba ) ); } #endif return IVAS_ERR_OK; } Loading Loading @@ -5289,8 +5198,7 @@ ivas_error IVAS_REND_SetReverbRoomSize( break; case IVAS_ROOM_SIZE_AUTO: default: hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_UNSET; break; /* will be setup in IVAS_REND_AddInput() */ assert( 0 && "Room size is not set"); } if ( hIvasRend->hRendererConfig != NULL ) Loading Loading
apps/renderer.c +47 −12 Original line number Diff line number Diff line Loading @@ -1101,6 +1101,53 @@ int main( fprintf( stderr, "\nError in Renderer Config Init: %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) { /* Set reverb room size if specified or select based automatically based on default per input formats */ IVAS_ROOM_SIZE_T selectedReverbRoomSize = args.reverbRoomSize; if ( selectedReverbRoomSize == IVAS_ROOM_SIZE_AUTO ) { bool combinedFormat = false; selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; /* ISM present with MASA/SBA inputs; treat as combined format */ if ( args.inConfig.numAudioObjects > 0 && ( args.inConfig.numMasaBuses > 0 || args.inConfig.numAmbisonicsBuses > 0 ) ) { combinedFormat = true; } if ( combinedFormat ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; } else { /* Only set large if ISM is present alone, MASA and Ambisonic have been checked above */ if ( args.inConfig.numAudioObjects > 0 && args.inConfig.numMultiChannelBuses == 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_LARGE; } /* if only MC is present, set medium; Will not be overridden by the subsequent block */ else if ( args.inConfig.numMultiChannelBuses > 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_MEDIUM; } else if ( args.inConfig.numMasaBuses > 0 || args.inConfig.numAmbisonicsBuses > 0 ) { selectedReverbRoomSize = IVAS_ROOM_SIZE_SMALL; } } } if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, selectedReverbRoomSize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError setting reverb room size\n" ); goto cleanup; } } #endif if ( args.renderConfigFilePath[0] != '\0' ) { Loading Loading @@ -1176,18 +1223,6 @@ int main( fprintf( stderr, "\nError in IVAS_REND_SetOrientationTrackingMode(): %s\n", ivas_error_to_string( error ) ); goto cleanup; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* Set reverb room size if specified */ if ( args.reverbRoomSize != IVAS_ROOM_SIZE_AUTO ) { if ( ( IVAS_REND_SetReverbRoomSize( hIvasRend, args.reverbRoomSize ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError setting reverb room size\n" ); goto cleanup; } } #endif /* Set up output custom layout configuration */ if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM ) Loading
lib_rend/lib_rend.c +1 −93 Original line number Diff line number Diff line Loading @@ -3809,85 +3809,6 @@ static ivas_error isar_pre_rend_init( return IVAS_ERR_OK; } #ifdef FIX_1318_ROOM_SIZE_CMD_LINE static IVAS_ROOM_SIZE_T getDefaultReverbSize( input_ism *ismInputs, input_masa *masaInputs, input_mc *mcInputs, input_sba *sbaInputs ) { bool combinedFormat; int16_t i; int16_t nActiveInputsIsm, nActiveInputsMasa, nActiveInputsSba, nActiveInputsMc; IVAS_ROOM_SIZE_T selectedReverb; selectedReverb = IVAS_ROOM_SIZE_MEDIUM; combinedFormat = false; nActiveInputsIsm = 0; nActiveInputsMasa = 0; nActiveInputsMc = 0; nActiveInputsSba = 0; for ( i = 0; i < RENDERER_MAX_ISM_INPUTS; i++ ) { if ( ismInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsIsm++; } } for ( i = 0; i < RENDERER_MAX_MASA_INPUTS; i++ ) { if ( masaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsMasa++; } } for ( i = 0; i < RENDERER_MAX_MC_INPUTS; i++ ) { if ( mcInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsMc++; } } for ( i = 0; i < RENDERER_MAX_SBA_INPUTS; i++ ) { if ( sbaInputs[i].base.inConfig != IVAS_AUDIO_CONFIG_INVALID ) { nActiveInputsSba++; } } /* ISM present with MASA/SBA inputs; treat as combined format */ if ( nActiveInputsIsm && ( nActiveInputsMasa || nActiveInputsSba ) ) { combinedFormat = true; } if ( combinedFormat ) { selectedReverb = IVAS_ROOM_SIZE_MEDIUM; } else { /* Only set large if ISM is present alone */ if ( nActiveInputsIsm && !nActiveInputsMc ) { selectedReverb = IVAS_ROOM_SIZE_LARGE; } /* if only MC is present, set medium; Will not be overridden by the subsequent block */ else if ( nActiveInputsMc ) { selectedReverb = IVAS_ROOM_SIZE_MEDIUM; } else if ( nActiveInputsMasa || nActiveInputsSba ) { selectedReverb = IVAS_ROOM_SIZE_SMALL; } } return selectedReverb; } #endif /*-------------------------------------------------------------------* Loading Loading @@ -3987,18 +3908,6 @@ ivas_error IVAS_REND_AddInput( /* set global maximum delay after adding an input */ setMaxGlobalDelayNs( hIvasRend ); #ifdef FIX_1318_ROOM_SIZE_CMD_LINE /* select default reverb size after adding an input */ if ( hIvasRend->selectedRoomReverbSize == DEFAULT_REVERB_UNSET ) { IVAS_REND_SetReverbRoomSize( hIvasRend, getDefaultReverbSize( hIvasRend->inputsIsm, hIvasRend->inputsMasa, hIvasRend->inputsMc, hIvasRend->inputsSba ) ); } #endif return IVAS_ERR_OK; } Loading Loading @@ -5289,8 +5198,7 @@ ivas_error IVAS_REND_SetReverbRoomSize( break; case IVAS_ROOM_SIZE_AUTO: default: hIvasRend->selectedRoomReverbSize = DEFAULT_REVERB_UNSET; break; /* will be setup in IVAS_REND_AddInput() */ assert( 0 && "Room size is not set"); } if ( hIvasRend->hRendererConfig != NULL ) Loading