Loading lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ #define FIX_708_DPID_COMMAND_LINE /* issue 708: sanity checks for '-dpid' command-line */ #define FIX_730_DPID_NOT_SET_CORRECTLY /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */ #define FIX_513_REND_MC_ALLOC /* FhG: issue 513, optimise external renderer allocation for multichannel */ #define FIX_518_ISM_BRIR_EXTREND /* FhG: fix issue #518, cleanup ISM to BINAURAL_ROOM_IR rendering in the external renderer */ #define FIX_764_HARM_CODE /* VA: issue 764: introduce new function for the same code block at four different places */ #define FIX_747_ISM_TODOS /* VA: issue 747 - address ISM ToDos */ #define FIX_ISMRENDERER_HANDLE_DEALLOC /* VA: issue 781: harmonize Deallocation of handle 'hIsmRendererData' */ Loading lib_rend/lib_rend.c +0 −129 Original line number Diff line number Diff line Loading @@ -131,10 +131,8 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; #ifdef FIX_518_ISM_BRIR_EXTREND pan_vector prev_pan_gains; int8_t firstFrameRendered; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ #endif Loading Loading @@ -1233,7 +1231,6 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition( } #ifdef FIX_518_ISM_BRIR_EXTREND static int8_t checkObjectPositionChanged( IVAS_REND_AudioObjectPosition *currentPos, IVAS_REND_AudioObjectPosition *previousPos ) Loading @@ -1241,7 +1238,6 @@ static int8_t checkObjectPositionChanged( return !( fabs( currentPos->azimuth - previousPos->azimuth ) < EPSILON && fabs( currentPos->elevation - previousPos->elevation ) < EPSILON ); } #endif static rendering_context getRendCtx( Loading Loading @@ -1375,9 +1371,7 @@ static ivas_error setRendInputActiveIsm( } initRendInputBase( &inputIsm->base, inConfig, id, rendCtx, inputIsm->bufferData, MAX_BUFFER_LENGTH ); #ifdef FIX_518_ISM_BRIR_EXTREND inputIsm->firstFrameRendered = FALSE; #endif inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); Loading @@ -1385,9 +1379,7 @@ static ivas_error setRendInputActiveIsm( inputIsm->hReverb = NULL; inputIsm->tdRendWrapper = defaultTdRendWrapper(); initRotMatrix( inputIsm->rot_mat_prev ); #ifdef FIX_518_ISM_BRIR_EXTREND set_zero( inputIsm->prev_pan_gains, MAX_OUTPUT_CHANNELS ); #endif #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) Loading Loading @@ -6002,9 +5994,7 @@ static ivas_error renderIsmToBinauralRoom( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int16_t position_changed; #endif int16_t i, j; int16_t azi_rot, ele_rot; int16_t subframe_idx; Loading @@ -6013,13 +6003,8 @@ static ivas_error renderIsmToBinauralRoom( float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif IVAS_REND_AudioBuffer tmpMcBuffer; #ifdef FIX_518_ISM_BRIR_EXTREND IVAS_REND_AudioObjectPosition rotatedPosPrev; #endif IVAS_REND_AudioObjectPosition rotatedPos; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; Loading @@ -6032,9 +6017,7 @@ static ivas_error renderIsmToBinauralRoom( push_wmops( "renderIsmToBinauralRoom" ); #ifdef FIX_518_ISM_BRIR_EXTREND rotatedPosPrev = defaultObjectPosition(); #endif rotatedPos = defaultObjectPosition(); hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData; Loading Loading @@ -6075,26 +6058,6 @@ static ivas_error renderIsmToBinauralRoom( } } #ifndef FIX_518_ISM_BRIR_EXTREND /* TODO tmu : see issue #518 */ /* Possible optimization: less processing needed if position didn't change * needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ /* previous position gains */ if ( combinedOrientationEnabled ) { rotateAziEle( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &azi_rot, &ele_rot, ismInput->rot_mat_prev, 0 ); rotatedPos.azimuth = (float) azi_rot; rotatedPos.elevation = (float) ele_rot; } if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->previousPos.azimuth, ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->previousPos.elevation, previousPanGains ) ) != IVAS_ERR_OK ) { return error; } #else /* get previous position */ if ( combinedOrientationEnabled ) { Loading @@ -6107,7 +6070,6 @@ static ivas_error renderIsmToBinauralRoom( rotatedPosPrev.azimuth = ismInput->previousPos.azimuth; rotatedPosPrev.elevation = ismInput->previousPos.elevation; } #endif /* get current position */ if ( combinedOrientationEnabled ) Loading @@ -6116,7 +6078,6 @@ static ivas_error renderIsmToBinauralRoom( rotatedPos.azimuth = (float) azi_rot; rotatedPos.elevation = (float) ele_rot; } #ifdef FIX_518_ISM_BRIR_EXTREND else { rotatedPos.azimuth = ismInput->currentPos.azimuth; Loading @@ -6134,22 +6095,14 @@ static ivas_error renderIsmToBinauralRoom( /* compute gains only if position changed */ if ( position_changed ) { #endif if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, #ifdef FIX_518_ISM_BRIR_EXTREND rotatedPos.azimuth, rotatedPos.elevation, #else ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->currentPos.azimuth, ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->currentPos.elevation, #endif currentPanGains ) ) != IVAS_ERR_OK ) { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } #endif /* intermediate rendering to 7_1_4 */ tmpMcBuffer = ismInput->base.inputBuffer; Loading @@ -6164,13 +6117,8 @@ static ivas_error renderIsmToBinauralRoom( set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif tmpMcBuffer ); copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); Loading @@ -6181,13 +6129,11 @@ static ivas_error renderIsmToBinauralRoom( mvr2r( Rmat[i], ismInput->rot_mat_prev[i], 3 ); } #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif /* render 7_1_4 with BRIRs */ #ifdef SPLIT_REND_WITH_HEAD_ROT Loading Loading @@ -6241,40 +6187,22 @@ static ivas_error renderIsmToBinauralReverb( static ivas_error renderIsmToMc( #ifndef FIX_518_ISM_BRIR_EXTREND const #endif input_ism *ismInput, const IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int8_t position_changed; #endif pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif ivas_error error; push_wmops( "renderIsmToMc" ); #ifdef FIX_518_ISM_BRIR_EXTREND position_changed = !ismInput->firstFrameRendered || checkObjectPositionChanged( &ismInput->currentPos, &ismInput->previousPos ); #else /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ #endif if ( *ismInput->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_STEREO ) { if ( ismInput->nonDiegeticPan ) { #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; ismInput->prev_pan_gains[1] = currentPanGains[1] = 1.f - currentPanGains[0]; #else previousPanGains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; previousPanGains[1] = currentPanGains[1] = 1.f - currentPanGains[0]; error = IVAS_ERR_OK; #endif } else { Loading @@ -6282,24 +6210,16 @@ static ivas_error renderIsmToMc( ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, ¤tPanGains[0], ¤tPanGains[1] ); #ifdef FIX_518_ISM_BRIR_EXTREND set_zero( ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &ismInput->prev_pan_gains[0], &ismInput->prev_pan_gains[1] ); #else set_zero( previousPanGains, MAX_OUTPUT_CHANNELS ); ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &previousPanGains[0], &previousPanGains[1] ); #endif } } else { #ifdef FIX_518_ISM_BRIR_EXTREND /* compute gains only if position changed */ if ( position_changed ) { #endif // TODO tmu review when #215 is resolved if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), Loading @@ -6308,49 +6228,34 @@ static ivas_error renderIsmToMc( { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } /* set previous gains if this is the first frame */ if ( !ismInput->firstFrameRendered ) { #endif // TODO tmu review when #215 is resolved if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains #else previousPanGains #endif ) ) != IVAS_ERR_OK ) { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } #endif } /* Assume num channels in audio buffer to be 1. * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif outAudio ); #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif pop_wmops(); Loading @@ -6359,22 +6264,14 @@ static ivas_error renderIsmToMc( static ivas_error renderIsmToSba( #ifndef FIX_518_ISM_BRIR_EXTREND const #endif input_ism *ismInput, const AUDIO_CONFIG outConfig, const IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int8_t position_changed; #endif int16_t ambiOrderOut; int16_t numOutChannels; pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -6390,38 +6287,21 @@ static ivas_error renderIsmToSba( return error; } #ifdef FIX_518_ISM_BRIR_EXTREND position_changed = !ismInput->firstFrameRendered || checkObjectPositionChanged( &ismInput->currentPos, &ismInput->previousPos ); /* set previous gains if this is the first frame */ if ( !ismInput->firstFrameRendered ) { #endif // TODO tmu review when #215 is resolved ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains, #else previousPanGains, #endif ambiOrderOut ); #ifdef FIX_518_ISM_BRIR_EXTREND } /* compute gains only if position changed */ if ( position_changed ) { #else if ( ( ismInput->currentPos.azimuth == ismInput->previousPos.azimuth ) && ( ismInput->currentPos.elevation == ismInput->previousPos.elevation ) ) { mvr2r( previousPanGains, currentPanGains, MAX_OUTPUT_CHANNELS ); } else { #endif // TODO tmu review when #215 is resolved ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->currentPos.elevation + 0.5f ), Loading @@ -6432,21 +6312,14 @@ static ivas_error renderIsmToSba( /* Assume num channels in audio buffer to be 1. * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif outAudio ); #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif pop_wmops(); return error; Loading Loading @@ -6639,9 +6512,7 @@ static ivas_error renderInputIsm( return error; } #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->firstFrameRendered = TRUE; #endif return error; } Loading Loading
lib_com/options.h +0 −1 Original line number Diff line number Diff line Loading @@ -163,7 +163,6 @@ #define FIX_708_DPID_COMMAND_LINE /* issue 708: sanity checks for '-dpid' command-line */ #define FIX_730_DPID_NOT_SET_CORRECTLY /* Eri: issue 730: write dpid read from file in correct index, print informative error message when DPID specified is not found. */ #define FIX_513_REND_MC_ALLOC /* FhG: issue 513, optimise external renderer allocation for multichannel */ #define FIX_518_ISM_BRIR_EXTREND /* FhG: fix issue #518, cleanup ISM to BINAURAL_ROOM_IR rendering in the external renderer */ #define FIX_764_HARM_CODE /* VA: issue 764: introduce new function for the same code block at four different places */ #define FIX_747_ISM_TODOS /* VA: issue 747 - address ISM ToDos */ #define FIX_ISMRENDERER_HANDLE_DEALLOC /* VA: issue 781: harmonize Deallocation of handle 'hIsmRendererData' */ Loading
lib_rend/lib_rend.c +0 −129 Original line number Diff line number Diff line Loading @@ -131,10 +131,8 @@ typedef struct CREND_WRAPPER_HANDLE crendWrapper; REVERB_HANDLE hReverb; rotation_matrix rot_mat_prev; #ifdef FIX_518_ISM_BRIR_EXTREND pan_vector prev_pan_gains; int8_t firstFrameRendered; #endif #ifdef SPLIT_REND_WITH_HEAD_ROT TDREND_WRAPPER splitTdRendWrappers[MAX_HEAD_ROT_POSES - 1]; /* Additional TD Rend instances used for split rendering */ #endif Loading Loading @@ -1233,7 +1231,6 @@ static IVAS_REND_AudioObjectPosition defaultObjectPosition( } #ifdef FIX_518_ISM_BRIR_EXTREND static int8_t checkObjectPositionChanged( IVAS_REND_AudioObjectPosition *currentPos, IVAS_REND_AudioObjectPosition *previousPos ) Loading @@ -1241,7 +1238,6 @@ static int8_t checkObjectPositionChanged( return !( fabs( currentPos->azimuth - previousPos->azimuth ) < EPSILON && fabs( currentPos->elevation - previousPos->elevation ) < EPSILON ); } #endif static rendering_context getRendCtx( Loading Loading @@ -1375,9 +1371,7 @@ static ivas_error setRendInputActiveIsm( } initRendInputBase( &inputIsm->base, inConfig, id, rendCtx, inputIsm->bufferData, MAX_BUFFER_LENGTH ); #ifdef FIX_518_ISM_BRIR_EXTREND inputIsm->firstFrameRendered = FALSE; #endif inputIsm->currentPos = defaultObjectPosition(); inputIsm->previousPos = defaultObjectPosition(); Loading @@ -1385,9 +1379,7 @@ static ivas_error setRendInputActiveIsm( inputIsm->hReverb = NULL; inputIsm->tdRendWrapper = defaultTdRendWrapper(); initRotMatrix( inputIsm->rot_mat_prev ); #ifdef FIX_518_ISM_BRIR_EXTREND set_zero( inputIsm->prev_pan_gains, MAX_OUTPUT_CHANNELS ); #endif #ifdef SPLIT_REND_WITH_HEAD_ROT for ( i = 0; i < (int16_t) ( sizeof( inputIsm->splitTdRendWrappers ) / sizeof( *inputIsm->splitTdRendWrappers ) ); ++i ) Loading Loading @@ -6002,9 +5994,7 @@ static ivas_error renderIsmToBinauralRoom( input_ism *ismInput, IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int16_t position_changed; #endif int16_t i, j; int16_t azi_rot, ele_rot; int16_t subframe_idx; Loading @@ -6013,13 +6003,8 @@ static ivas_error renderIsmToBinauralRoom( float tmpRendBuffer[MAX_OUTPUT_CHANNELS][L_FRAME48k]; ivas_error error; pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif IVAS_REND_AudioBuffer tmpMcBuffer; #ifdef FIX_518_ISM_BRIR_EXTREND IVAS_REND_AudioObjectPosition rotatedPosPrev; #endif IVAS_REND_AudioObjectPosition rotatedPos; const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData; int8_t combinedOrientationEnabled; Loading @@ -6032,9 +6017,7 @@ static ivas_error renderIsmToBinauralRoom( push_wmops( "renderIsmToBinauralRoom" ); #ifdef FIX_518_ISM_BRIR_EXTREND rotatedPosPrev = defaultObjectPosition(); #endif rotatedPos = defaultObjectPosition(); hCombinedOrientationData = ismInput->base.ctx.pCombinedOrientationData; Loading Loading @@ -6075,26 +6058,6 @@ static ivas_error renderIsmToBinauralRoom( } } #ifndef FIX_518_ISM_BRIR_EXTREND /* TODO tmu : see issue #518 */ /* Possible optimization: less processing needed if position didn't change * needs a lot of cleanup, we could also add rot_gains_prev to ismInput and use that */ /* previous position gains */ if ( combinedOrientationEnabled ) { rotateAziEle( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &azi_rot, &ele_rot, ismInput->rot_mat_prev, 0 ); rotatedPos.azimuth = (float) azi_rot; rotatedPos.elevation = (float) ele_rot; } if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->previousPos.azimuth, ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->previousPos.elevation, previousPanGains ) ) != IVAS_ERR_OK ) { return error; } #else /* get previous position */ if ( combinedOrientationEnabled ) { Loading @@ -6107,7 +6070,6 @@ static ivas_error renderIsmToBinauralRoom( rotatedPosPrev.azimuth = ismInput->previousPos.azimuth; rotatedPosPrev.elevation = ismInput->previousPos.elevation; } #endif /* get current position */ if ( combinedOrientationEnabled ) Loading @@ -6116,7 +6078,6 @@ static ivas_error renderIsmToBinauralRoom( rotatedPos.azimuth = (float) azi_rot; rotatedPos.elevation = (float) ele_rot; } #ifdef FIX_518_ISM_BRIR_EXTREND else { rotatedPos.azimuth = ismInput->currentPos.azimuth; Loading @@ -6134,22 +6095,14 @@ static ivas_error renderIsmToBinauralRoom( /* compute gains only if position changed */ if ( position_changed ) { #endif if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, #ifdef FIX_518_ISM_BRIR_EXTREND rotatedPos.azimuth, rotatedPos.elevation, #else ( combinedOrientationEnabled ) ? rotatedPos.azimuth : ismInput->currentPos.azimuth, ( combinedOrientationEnabled ) ? rotatedPos.elevation : ismInput->currentPos.elevation, #endif currentPanGains ) ) != IVAS_ERR_OK ) { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } #endif /* intermediate rendering to 7_1_4 */ tmpMcBuffer = ismInput->base.inputBuffer; Loading @@ -6164,13 +6117,8 @@ static ivas_error renderIsmToBinauralRoom( set_zero( tmpMcBuffer.data, tmpMcBuffer.config.numSamplesPerChannel * tmpMcBuffer.config.numChannels ); renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif tmpMcBuffer ); copyBufferTo2dArray( tmpMcBuffer, tmpRendBuffer ); Loading @@ -6181,13 +6129,11 @@ static ivas_error renderIsmToBinauralRoom( mvr2r( Rmat[i], ismInput->rot_mat_prev[i], 3 ); } #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif /* render 7_1_4 with BRIRs */ #ifdef SPLIT_REND_WITH_HEAD_ROT Loading Loading @@ -6241,40 +6187,22 @@ static ivas_error renderIsmToBinauralReverb( static ivas_error renderIsmToMc( #ifndef FIX_518_ISM_BRIR_EXTREND const #endif input_ism *ismInput, const IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int8_t position_changed; #endif pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif ivas_error error; push_wmops( "renderIsmToMc" ); #ifdef FIX_518_ISM_BRIR_EXTREND position_changed = !ismInput->firstFrameRendered || checkObjectPositionChanged( &ismInput->currentPos, &ismInput->previousPos ); #else /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ #endif if ( *ismInput->base.ctx.pOutConfig == IVAS_AUDIO_CONFIG_STEREO ) { if ( ismInput->nonDiegeticPan ) { #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; ismInput->prev_pan_gains[1] = currentPanGains[1] = 1.f - currentPanGains[0]; #else previousPanGains[0] = currentPanGains[0] = ( ismInput->nonDiegeticPanGain + 1.f ) * 0.5f; previousPanGains[1] = currentPanGains[1] = 1.f - currentPanGains[0]; error = IVAS_ERR_OK; #endif } else { Loading @@ -6282,24 +6210,16 @@ static ivas_error renderIsmToMc( ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth, ismInput->currentPos.elevation, ¤tPanGains[0], ¤tPanGains[1] ); #ifdef FIX_518_ISM_BRIR_EXTREND set_zero( ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &ismInput->prev_pan_gains[0], &ismInput->prev_pan_gains[1] ); #else set_zero( previousPanGains, MAX_OUTPUT_CHANNELS ); ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, ismInput->previousPos.elevation, &previousPanGains[0], &previousPanGains[1] ); #endif } } else { #ifdef FIX_518_ISM_BRIR_EXTREND /* compute gains only if position changed */ if ( position_changed ) { #endif // TODO tmu review when #215 is resolved if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), Loading @@ -6308,49 +6228,34 @@ static ivas_error renderIsmToMc( { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } /* set previous gains if this is the first frame */ if ( !ismInput->firstFrameRendered ) { #endif // TODO tmu review when #215 is resolved if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains #else previousPanGains #endif ) ) != IVAS_ERR_OK ) { return error; } #ifdef FIX_518_ISM_BRIR_EXTREND } #endif } /* Assume num channels in audio buffer to be 1. * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif outAudio ); #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif pop_wmops(); Loading @@ -6359,22 +6264,14 @@ static ivas_error renderIsmToMc( static ivas_error renderIsmToSba( #ifndef FIX_518_ISM_BRIR_EXTREND const #endif input_ism *ismInput, const AUDIO_CONFIG outConfig, const IVAS_REND_AudioBuffer outAudio ) { #ifdef FIX_518_ISM_BRIR_EXTREND int8_t position_changed; #endif int16_t ambiOrderOut; int16_t numOutChannels; pan_vector currentPanGains; #ifndef FIX_518_ISM_BRIR_EXTREND pan_vector previousPanGains; #endif ivas_error error; error = IVAS_ERR_OK; Loading @@ -6390,38 +6287,21 @@ static ivas_error renderIsmToSba( return error; } #ifdef FIX_518_ISM_BRIR_EXTREND position_changed = !ismInput->firstFrameRendered || checkObjectPositionChanged( &ismInput->currentPos, &ismInput->previousPos ); /* set previous gains if this is the first frame */ if ( !ismInput->firstFrameRendered ) { #endif // TODO tmu review when #215 is resolved ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->previousPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->previousPos.elevation + 0.5f ), #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->prev_pan_gains, #else previousPanGains, #endif ambiOrderOut ); #ifdef FIX_518_ISM_BRIR_EXTREND } /* compute gains only if position changed */ if ( position_changed ) { #else if ( ( ismInput->currentPos.azimuth == ismInput->previousPos.azimuth ) && ( ismInput->currentPos.elevation == ismInput->previousPos.elevation ) ) { mvr2r( previousPanGains, currentPanGains, MAX_OUTPUT_CHANNELS ); } else { #endif // TODO tmu review when #215 is resolved ivas_dirac_dec_get_response( (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), (int16_t) floorf( ismInput->currentPos.elevation + 0.5f ), Loading @@ -6432,21 +6312,14 @@ static ivas_error renderIsmToSba( /* Assume num channels in audio buffer to be 1. * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, #ifdef FIX_518_ISM_BRIR_EXTREND position_changed ? currentPanGains : ismInput->prev_pan_gains, position_changed ? ismInput->prev_pan_gains : NULL, #else currentPanGains, previousPanGains, #endif outAudio ); #ifdef FIX_518_ISM_BRIR_EXTREND if ( position_changed ) { mvr2r( currentPanGains, ismInput->prev_pan_gains, MAX_OUTPUT_CHANNELS ); } #endif pop_wmops(); return error; Loading Loading @@ -6639,9 +6512,7 @@ static ivas_error renderInputIsm( return error; } #ifdef FIX_518_ISM_BRIR_EXTREND ismInput->firstFrameRendered = TRUE; #endif return error; } Loading