diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index c09adab6c853ce43023646db9eaeb772962d67ea..1757d1b8e2140f8ecbaec017dda39dc9cb8e3ef7 100644 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -4653,6 +4653,15 @@ void ivas_ism_render( const int16_t output_frame /* i : output frame length per channel */ ); +#ifdef FIX_REND_ISM_STEREO_PANNING +void ivas_ism_get_stereo_gains( + const float azimuth, /* i : object azimuth */ + const float elevation, /* i : object elevation */ + float *left_gain, /* o : left channel gain */ + float *right_gain /* o : right channel gain */ +); + +#endif void ivas_mc2sba( IVAS_OUTPUT_SETUP hIntSetup, /* i : Format of decoder output */ float buffer_td[][L_FRAME48k], /* i/o: MC signals (on input) and the HOA3 (on output) */ diff --git a/lib_com/options.h b/lib_com/options.h index 3446d2e182db3c23affbf9fa1448a8d430371729..2011fb56b4ca1966da30353ef1154d8c7fdc87fe 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -150,6 +150,9 @@ #define FIX_ITD /* Contribution 16: TD renderer ITD improvement and code cleanup */ #define BRATE_SWITCHING_RENDERING /* Bitrate switching changes related to the renderers */ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ +#define FIX_REND_ISM_XFADE /* Issue 193: Crossfade inconsistencies in ISM between decoder and external renderer */ +#define FIX_REND_ISM_POS_ROUNDING /* Issue 193: (Temporary solution until fix for #215) Align rounding of ISM position data in external renderer */ +#define FIX_REND_ISM_STEREO_PANNING /* Issue 193: Use tangent panning for ISM to stereo in external renderer */ #define FIX_REND_ROUNDING /* Issue 195: Align float to int16 conversion in renderer with decoder */ #define FIX_REND_MONO_DMX /* Issue 195: Fix mono downmix coefficients in decoder and renderer */ #define FIX_REND_ROT_MC_BIN /* Issue 195: Fix wrong EFAP handle passed to renderer, resulting in no rotation for BINAURAL_ROOM output */ @@ -158,6 +161,8 @@ #define FIX_ISM_INACTIVE_BITS /* Issue 230: fix bitbudget distribution in inactive frames in ISM format */ #define IMPROVE_CMDLINE_ROBUSTNESS /* Issue 233: Improve robustness of command-line parameters */ +#define FIX_ITD_CNG /* Eri: Fix for CNG ITD */ + /* ################## End DEVELOPMENT switches ######################### */ /* clang-format on */ diff --git a/lib_dec/ivas_ism_renderer.c b/lib_dec/ivas_ism_renderer.c index f27d49b11104ba9b5cadd1874c08717f43099768..ca71e4035dcda40bd824a4eff1d02ef5335505b0 100644 --- a/lib_dec/ivas_ism_renderer.c +++ b/lib_dec/ivas_ism_renderer.c @@ -82,7 +82,11 @@ ivas_error ivas_ism_renderer_open( interpolator_length = (uint16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); for ( i = 0; i < interpolator_length; i++ ) { +#ifdef FIX_REND_ISM_XFADE + st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length - 1 ); +#else st_ivas->hIsmRendererData->interpolator[i] = (float) i / ( (float) interpolator_length ); +#endif } return error; @@ -140,6 +144,12 @@ void ivas_ism_render( { if ( st_ivas->intern_config == AUDIO_CONFIG_STEREO ) { +#ifdef FIX_REND_ISM_STEREO_PANNING + ivas_ism_get_stereo_gains( st_ivas->hIsmMetaData[i]->azimuth, + st_ivas->hIsmMetaData[i]->elevation, + &gains[i][0], + &gains[i][1] ); +#else float aziRad, eleRad; float y, mappedX, aziRadMapped, A, A2, A3; const float LsAngleRad = 30.0f * PI_OVER_180; @@ -170,6 +180,7 @@ void ivas_ism_render( gains[i][0] = sqrtf( A3 ); gains[i][1] = sqrtf( 1.0f - A3 ); } +#endif } else { @@ -180,8 +191,14 @@ void ivas_ism_render( } else { +#ifdef FIX_REND_ISM_POS_ROUNDING + // TODO tmu review when #215 is resolved + azimuth = (int16_t) floorf( st_ivas->hIsmMetaData[i]->azimuth + 0.5f ); + elevation = (int16_t) floorf( st_ivas->hIsmMetaData[i]->elevation + 0.5f ); +#else azimuth = (int16_t) ( st_ivas->hIsmMetaData[i]->azimuth + 0.5f ); elevation = (int16_t) ( st_ivas->hIsmMetaData[i]->elevation + 0.5f ); +#endif if ( st_ivas->hIntSetup.is_planar_setup ) { @@ -222,3 +239,44 @@ void ivas_ism_render( } return; } + +#ifdef FIX_REND_ISM_STEREO_PANNING +void ivas_ism_get_stereo_gains( + const float azimuth, /* i : object azimuth */ + const float elevation, /* i : object elevation */ + float *left_gain, /* o : left channel gain */ + float *right_gain /* o : right channel gain */ +) +{ + float aziRad, eleRad; + float y, mappedX, aziRadMapped, A, A2, A3; + const float LsAngleRad = 30.0f * PI_OVER_180; + + /* Convert azi and ele to an azi value of the cone of confusion */ + aziRad = azimuth * PI_OVER_180; + eleRad = elevation * PI_OVER_180; + y = ( sinf( aziRad ) * cosf( eleRad ) ); + mappedX = sqrtf( max( 0.0f, 1.0f - ( y * y ) ) ); + aziRadMapped = atan2f( y, mappedX ); + + /* Determine the amplitude panning gains */ + if ( aziRadMapped >= LsAngleRad ) + { /* Left side */ + *left_gain = 1.0f; + *right_gain = 0.0f; + } + else if ( aziRadMapped <= -LsAngleRad ) + { /* Right side */ + *left_gain = 0.0f; + *right_gain = 1.0f; + } + else /* Tangent panning law */ + { + A = tanf( aziRadMapped ) / tanf( LsAngleRad ); + A2 = ( A - 1.0f ) / max( 0.001f, A + 1.0f ); + A3 = 1.0f / ( A2 * A2 + 1.0f ); + *left_gain = sqrtf( A3 ); + *right_gain = sqrtf( 1.0f - A3 ); + } +} +#endif diff --git a/lib_rend/ivas_sba_rendering.c b/lib_rend/ivas_sba_rendering.c index dc41fc1805715aa26194e71e0a774101651877ff..0c28a3d4324e2862cbf3be85def952d6950ecfd9 100755 --- a/lib_rend/ivas_sba_rendering.c +++ b/lib_rend/ivas_sba_rendering.c @@ -305,20 +305,35 @@ void ivas_ism2sba( for ( i = 0; i < num_objects; i++ ) { +#ifdef FIX_REND_ISM_POS_ROUNDING + // TODO tmu review when #215 is resolved + azimuth = (int16_t) floorf( hIsmMetaData[i]->azimuth + 0.5f ); + elevation = (int16_t) floorf( hIsmMetaData[i]->elevation + 0.5f ); +#else azimuth = (int16_t) ( hIsmMetaData[i]->azimuth + 0.5f ); elevation = (int16_t) ( hIsmMetaData[i]->elevation + 0.5f ); +#endif /*get HOA gets for direction (ACN/SN3D)*/ ivas_dirac_dec_get_response( azimuth, elevation, gains, sba_order ); for ( j = 0; j < sba_num_chans; j++ ) { +#ifdef FIX_REND_ISM_XFADE + g1 = 1.f; +#endif g2 = 0.f; for ( k = 0; k < output_frame; k++ ) { +#ifdef FIX_REND_ISM_XFADE + buffer_tmp[j][k] += ( g2 * gains[j] + g1 * hIsmRendererData->prev_gains[i][j] ) * buffer_td[i][k]; + g2 += 1.f / ( output_frame - 1 ); + g1 = 1.0f - g2; +#else g2 += 1.f / output_frame; g1 = 1.0f - g2; buffer_tmp[j][k] += ( g2 * gains[j] + g1 * hIsmRendererData->prev_gains[i][j] ) * buffer_td[i][k]; +#endif } hIsmRendererData->prev_gains[i][j] = gains[j]; } diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 80988d734697a827a02c222189cb7240b1c7772e..3764f1139cb46b288c5c2a7b7b70b1457d13abfc 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -3818,16 +3818,50 @@ static ivas_error renderIsmToMc( wmops_sub_start( "renderIsmToMc" ); - /* TODO(sgi): Possible optimization: less processing needed if position didn't change */ - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ismInput->currentPos.azimuth, ismInput->currentPos.elevation, currentPanGains ) ) != IVAS_ERR_OK ) - { - return error; +/* TODO(sgi): Possible optimization: less processing needed if position didn't change */ +#ifdef FIX_REND_ISM_STEREO_PANNING + if ( *ismInput->base.ctx.pOutConfig == IVAS_REND_AUDIO_CONFIG_STEREO ) + { + set_zero( currentPanGains, 16 ); + ivas_ism_get_stereo_gains( ismInput->currentPos.azimuth, + ismInput->currentPos.elevation, + ¤tPanGains[0], + ¤tPanGains[1] ); + + set_zero( previousPanGains, 16 ); + ivas_ism_get_stereo_gains( ismInput->previousPos.azimuth, + ismInput->previousPos.elevation, + &previousPanGains[0], + &previousPanGains[1] ); } - if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ismInput->previousPos.azimuth, ismInput->previousPos.elevation, previousPanGains ) ) != IVAS_ERR_OK ) + else +#endif { - return error; +#ifdef FIX_REND_ISM_POS_ROUNDING + // TODO tmu review when #215 is resolved + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, + (int16_t) floorf( ismInput->currentPos.azimuth + 0.5f ), + (int16_t) floorf( ismInput->currentPos.elevation + 0.5f ), + currentPanGains ) ) != IVAS_ERR_OK ) +#else + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ismInput->currentPos.azimuth, ismInput->currentPos.elevation, currentPanGains ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } +#ifdef FIX_REND_ISM_POS_ROUNDING + // 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 ), + previousPanGains ) ) != IVAS_ERR_OK ) +#else + if ( ( error = getEfapGains( *ismInput->base.ctx.pEfapOutWrapper, ismInput->previousPos.azimuth, ismInput->previousPos.elevation, previousPanGains ) ) != IVAS_ERR_OK ) +#endif + { + return error; + } } - /* Assume num channels in audio buffer to be 1. * This should have been validated in IVAS_REND_FeedInputAudio() */ renderBufferChannelLerp( ismInput->base.inputBuffer, 0, currentPanGains, previousPanGains, outAudio ); @@ -3860,7 +3894,15 @@ static ivas_error renderIsmToSba( return error; } +#ifdef FIX_REND_ISM_POS_ROUNDING + // 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 ), + previousPanGains, + ambiOrderOut ); +#else ivas_dirac_dec_get_response( (int16_t) ismInput->previousPos.azimuth, (int16_t) ismInput->previousPos.elevation, previousPanGains, ambiOrderOut ); +#endif if ( ( ismInput->currentPos.azimuth == ismInput->previousPos.azimuth ) && ( ismInput->currentPos.elevation == ismInput->previousPos.elevation ) ) @@ -3869,7 +3911,15 @@ static ivas_error renderIsmToSba( } else { +#ifdef FIX_REND_ISM_POS_ROUNDING + // 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 ), + currentPanGains, + ambiOrderOut ); +#else ivas_dirac_dec_get_response( (int16_t) ismInput->currentPos.azimuth, (int16_t) ismInput->currentPos.elevation, currentPanGains, ambiOrderOut ); +#endif } /* Assume num channels in audio buffer to be 1. diff --git a/scripts/pyaudio3dtools/hoadecoder.py b/scripts/pyaudio3dtools/hoadecoder.py index b774c0a9ecec39cde988cb0da93675c6137b9bbb..9879980259651bc2190ae4b2e9c77d493483637c 100644 --- a/scripts/pyaudio3dtools/hoadecoder.py +++ b/scripts/pyaudio3dtools/hoadecoder.py @@ -65,10 +65,9 @@ def get_hoa_mtx( mtx_hoa_dec[1, 0] = 0.5 mtx_hoa_dec[1, 1] = -0.5 elif spkrlayout.isloudspeaker: - # TODO getRSH in IVAS casts to int16_t , decide on final behaviour for scripts Y_td = getRSH( - T_DESIGN_11_AZI.astype(np.int16), - T_DESIGN_11_ELE.astype(np.int16), + T_DESIGN_11_AZI, + T_DESIGN_11_ELE, ambi_order, norm="ortho", ) diff --git a/scripts/pyaudio3dtools/rotation.py b/scripts/pyaudio3dtools/rotation.py index 09f90a9ccf49d6d76440df4bc585a18e6233f95d..5fd9707167b402e718314e280bf9622101228d71 100644 --- a/scripts/pyaudio3dtools/rotation.py +++ b/scripts/pyaudio3dtools/rotation.py @@ -331,9 +331,7 @@ def rotateMC(x: np.ndarray, trajectory: str, layout: spatialaudioformat) -> np.n rotateAziEle(a, e, Quat2RotMat(q)) for a, e in zip(layout.ls_azi, layout.ls_ele) ] - ).astype( - np.int16 - ) # TODO tmu for alignment with IVAS + ) R = panner.pan(rotated_pos[:, 0], rotated_pos[:, 1]) R[:, layout.lfe_index] = np.zeros([layout.nchannels, 1]) R[layout.lfe_index, layout.lfe_index] = 1 diff --git a/scripts/pyaudio3dtools/spatialaudioconvert.py b/scripts/pyaudio3dtools/spatialaudioconvert.py index 1ed144943f8bf90ce47f31ec6fd14f2131476757..5163c7c524f3d37a3eeeac6f0487ec7758cf8621 100644 --- a/scripts/pyaudio3dtools/spatialaudioconvert.py +++ b/scripts/pyaudio3dtools/spatialaudioconvert.py @@ -372,8 +372,7 @@ def convert_mc( # SH response for loudspeaker positions MC2HOA = np.hstack( [ - # TODO getRSH in IVAS casts to int16_t , decide on final behaviour for scripts - hoadecoder.getRSH([int(a)], [int(e)], out_spfmt.ambi_order) + hoadecoder.getRSH([a], [e], out_spfmt.ambi_order) for a, e in zip(in_spfmt.ls_azi, in_spfmt.ls_ele) ] ).T @@ -442,10 +441,7 @@ def convert_ism( gains = gains[:, np.newaxis] # ISM -> HOA elif out_spfmt.ambi_order > 0: - # TODO getRSH in IVAS casts to int16_t , decide on final behaviour for scripts - gains = hoadecoder.getRSH( - [int(pos[0])], [int(pos[1])], out_spfmt.ambi_order - ) + gains = hoadecoder.getRSH([pos[0]], [pos[1]], out_spfmt.ambi_order) else: raise NotImplementedError( f"{in_spfmt.name} -> {out_spfmt.name}: format conversion not implemented" diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index b31557680628d5a95428458e4ac4c7e94bb92f0f..adb600768f3c10f2ebfc8b5fa3541084e23dcdab 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -285,6 +285,22 @@ pass_snr = { # External Renderer vs Standalone and pyaudio3dtools renderers tests # #################################################################### + # Failure reason: Renderer uses getRSH() with int16_t vs float in python + "test_ambisonics[FOA-5_1]": 39, + "test_ambisonics[FOA-5_1_2]": 40, + "test_ambisonics[FOA-5_1_4]": 41, + "test_ambisonics[FOA-7_1]": 39, + "test_ambisonics[FOA-7_1_4]": 41, + "test_ambisonics[HOA2-5_1]": 26, + "test_ambisonics[HOA2-5_1_2]": 29, + "test_ambisonics[HOA2-5_1_4]": 31, + "test_ambisonics[HOA2-7_1]": 27, + "test_ambisonics[HOA2-7_1_4]": 32, + "test_ambisonics[HOA3-5_1]": 25, + "test_ambisonics[HOA3-5_1_2]": 27, + "test_ambisonics[HOA3-5_1_4]": 29, + "test_ambisonics[HOA3-7_1]": 25, + "test_ambisonics[HOA3-7_1_4]": 30, # TODO needs debugging "test_ambisonics_binaural_headrotation[HOA2-BINAURAL-full_circle_in_15s]": 18, "test_ambisonics_binaural_headrotation[HOA3-BINAURAL-full_circle_in_15s]": 15, @@ -301,88 +317,104 @@ pass_snr = { "test_ambisonics_binaural_static[FOA-BINAURAL_ROOM]": 0, "test_ambisonics_binaural_static[HOA2-BINAURAL_ROOM]": 0, "test_ambisonics_binaural_static[HOA3-BINAURAL_ROOM]": 0, + # Failure reason: Renderer uses getRSH() with int16_t vs float in python + "test_custom_ls_input[t_design_4-FOA]": 43, + "test_custom_ls_input[t_design_4-HOA2]": 39, + "test_custom_ls_input[t_design_4-HOA3]": 36, + "test_custom_ls_output[FOA-16ch_8+4+4]": 40, + "test_custom_ls_output[FOA-4d4]": 40, + "test_custom_ls_output[FOA-itu_4+5+1]": 41, + "test_custom_ls_output[FOA-t_design_4]": 40, + "test_custom_ls_output[HOA2-16ch_8+4+4]": 32, + "test_custom_ls_output[HOA2-4d4]": 31, + "test_custom_ls_output[HOA2-itu_4+5+1]": 31, + "test_custom_ls_output[HOA2-t_design_4]": 34, + "test_custom_ls_output[HOA3-16ch_8+4+4]": 30, + "test_custom_ls_output[HOA3-4d4]": 29, + "test_custom_ls_output[HOA3-itu_4+5+1]": 30, + "test_custom_ls_output[HOA3-t_design_4]": 32, # Failure reason: TD Object Renderer standalone does not support custom LS input # Comparison with pyaudio3dtools results in bad SNR - "test_custom_ls_input_binaural[16ch_8+4+4-BINAURAL]": 0, + "test_custom_ls_input_binaural[16ch_8+4+4-BINAURAL]": 8, "test_custom_ls_input_binaural[16ch_8+4+4-BINAURAL_ROOM]": 0, - "test_custom_ls_input_binaural[4d4-BINAURAL]": 0, + "test_custom_ls_input_binaural[4d4-BINAURAL]": 6, "test_custom_ls_input_binaural[4d4-BINAURAL_ROOM]": 0, - "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL-full_circle_in_15s]": 0, + "test_custom_ls_input_binaural[itu_4+5+1-BINAURAL]": 1, + "test_custom_ls_input_binaural[itu_4+5+1-BINAURAL_ROOM]": 3, + "test_custom_ls_input_binaural[t_design_4-BINAURAL]": 5, + "test_custom_ls_input_binaural[t_design_4-BINAURAL_ROOM]": 0, + "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL-full_circle_in_15s]": 7, + "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL-rotate_yaw_pitch_roll1]": 6, "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL_ROOM-full_circle_in_15s]": 0, "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[16ch_8+4+4-BINAURAL-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL-full_circle_in_15s]": 0, + "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL-full_circle_in_15s]": 7, + "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL-rotate_yaw_pitch_roll1]": 5, "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL_ROOM-full_circle_in_15s]": 0, "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[4d4-BINAURAL-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL-full_circle_in_15s]": 0, + "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL-full_circle_in_15s]": 1, + "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL-rotate_yaw_pitch_roll1]": 1, "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL_ROOM-full_circle_in_15s]": 3, "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, - "test_custom_ls_input_binaural_headrotation[itu_4+5+1-BINAURAL-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL-full_circle_in_15s]": 0, + "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL-full_circle_in_15s]": 4, + "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL-rotate_yaw_pitch_roll1]": 4, "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL_ROOM-full_circle_in_15s]": 0, "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural_headrotation[t_design_4-BINAURAL-rotate_yaw_pitch_roll1]": 0, - "test_custom_ls_input_binaural[itu_4+5+1-BINAURAL]": 0, - "test_custom_ls_input_binaural[itu_4+5+1-BINAURAL_ROOM]": 3, - "test_custom_ls_input_binaural[t_design_4-BINAURAL]": 0, - "test_custom_ls_input_binaural[t_design_4-BINAURAL_ROOM]": 0, - # TODO need to verify 5ms rendering in external renderer - # Crend unit test does not support intermediate conversion to 7_1_4 - # Comparison with pyaudio3dtools results in bad SNR - "test_ism_binaural_headrotation[ISM1-BINAURAL_ROOM-full_circle_in_15s]": 9, + # TODO needs debugging + "test_ism_binaural_headrotation[ISM2-BINAURAL-rotate_yaw_pitch_roll1]": 34, + "test_ism_binaural_headrotation[ISM3-BINAURAL-rotate_yaw_pitch_roll1]": 34, + "test_ism_binaural_headrotation[ISM4-BINAURAL-rotate_yaw_pitch_roll1]": 33, + # Failure reason: Crend unit test does not support intermediate conversion to 7_1_4 + "test_ism_binaural_headrotation[ISM1-BINAURAL_ROOM-full_circle_in_15s]": 10, "test_ism_binaural_headrotation[ISM1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 4, "test_ism_binaural_headrotation[ISM2-BINAURAL_ROOM-full_circle_in_15s]": 10, "test_ism_binaural_headrotation[ISM2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, - "test_ism_binaural_headrotation[ISM2-BINAURAL-rotate_yaw_pitch_roll1]": 24, "test_ism_binaural_headrotation[ISM3-BINAURAL_ROOM-full_circle_in_15s]": 10, "test_ism_binaural_headrotation[ISM3-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 4, - "test_ism_binaural_headrotation[ISM3-BINAURAL-rotate_yaw_pitch_roll1]": 24, "test_ism_binaural_headrotation[ISM4-BINAURAL_ROOM-full_circle_in_15s]": 10, "test_ism_binaural_headrotation[ISM4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 4, - "test_ism_binaural_headrotation[ISM4-BINAURAL-rotate_yaw_pitch_roll1]": 24, "test_ism_binaural_static[ISM1-BINAURAL_ROOM]": 23, "test_ism_binaural_static[ISM2-BINAURAL_ROOM]": 21, "test_ism_binaural_static[ISM3-BINAURAL_ROOM]": 21, "test_ism_binaural_static[ISM4-BINAURAL_ROOM]": 21, - # TODO needs debugging - # Failure reason: minor differences could be due to crossfades or metadata position rounding - "test_ism[ISM1-5_1_2]": 48, - "test_ism[ISM1-5_1_4]": 48, - "test_ism[ISM1-5_1]": 48, - "test_ism[ISM1-7_1_4]": 46, - "test_ism[ISM1-7_1]": 45, - "test_ism[ISM1-FOA]": 44, - "test_ism[ISM1-HOA2]": 40, - "test_ism[ISM1-HOA3]": 37, - "test_ism[ISM1-STEREO]": 54, - "test_ism[ISM2-5_1_2]": 46, - "test_ism[ISM2-5_1_4]": 45, + # Failure Reason: Tangent law panning missing in python scripts + "test_ism[ISM1-STEREO]": 8, + "test_ism[ISM2-STEREO]": 13, + "test_ism[ISM3-STEREO]": 13, + "test_ism[ISM4-STEREO]": 13, + # Failure Reason: Casting of positions in renderer to int16_t vs. float in python + "test_ism[ISM1-5_1]": 43, + "test_ism[ISM1-5_1_2]": 43, + "test_ism[ISM1-5_1_4]": 43, + "test_ism[ISM1-7_1]": 40, + "test_ism[ISM1-7_1_4]": 41, + "test_ism[ISM1-FOA]": 49, + "test_ism[ISM1-HOA2]": 45, + "test_ism[ISM1-HOA3]": 42, "test_ism[ISM2-5_1]": 47, - "test_ism[ISM2-7_1_4]": 43, - "test_ism[ISM2-7_1]": 45, - "test_ism[ISM2-FOA]": 41, - "test_ism[ISM2-HOA2]": 37, - "test_ism[ISM2-HOA3]": 34, - "test_ism[ISM2-STEREO]": 55, - "test_ism[ISM3-5_1_2]": 44, - "test_ism[ISM3-5_1_4]": 43, + "test_ism[ISM2-5_1_2]": 44, + "test_ism[ISM2-5_1_4]": 43, + "test_ism[ISM2-7_1]": 44, + "test_ism[ISM2-7_1_4]": 41, + "test_ism[ISM2-FOA]": 47, + "test_ism[ISM2-HOA2]": 43, + "test_ism[ISM2-HOA3]": 40, "test_ism[ISM3-5_1]": 45, - "test_ism[ISM3-7_1_4]": 42, - "test_ism[ISM3-7_1]": 44, - "test_ism[ISM3-FOA]": 39, - "test_ism[ISM3-HOA2]": 36, - "test_ism[ISM3-HOA3]": 33, - "test_ism[ISM3-STEREO]": 54, - "test_ism[ISM4-5_1_2]": 44, - "test_ism[ISM4-5_1_4]": 44, + "test_ism[ISM3-5_1_2]": 43, + "test_ism[ISM3-5_1_4]": 42, + "test_ism[ISM3-7_1]": 43, + "test_ism[ISM3-7_1_4]": 41, + "test_ism[ISM3-FOA]": 47, + "test_ism[ISM3-HOA2]": 43, + "test_ism[ISM3-HOA3]": 40, "test_ism[ISM4-5_1]": 46, - "test_ism[ISM4-7_1_4]": 43, - "test_ism[ISM4-7_1]": 44, - "test_ism[ISM4-FOA]": 40, - "test_ism[ISM4-HOA2]": 36, - "test_ism[ISM4-HOA3]": 33, - "test_ism[ISM4-STEREO]": 57, + "test_ism[ISM4-5_1_2]": 43, + "test_ism[ISM4-5_1_4]": 43, + "test_ism[ISM4-7_1]": 45, + "test_ism[ISM4-7_1_4]": 41, + "test_ism[ISM4-FOA]": 47, + "test_ism[ISM4-HOA2]": 43, + "test_ism[ISM4-HOA3]": 40, + # TODO delay alignment of LFE in binaural output # Failure reason: bitexact except for delay alignment of LFE signal (Issue 59) "test_multichannel_binaural_headrotation[5_1-BINAURAL-full_circle_in_15s]": 7, "test_multichannel_binaural_headrotation[5_1-BINAURAL-rotate_yaw_pitch_roll1]": 6, @@ -403,6 +435,12 @@ pass_snr = { "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-full_circle_in_15s]": 11, "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 9, "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6, + # Failure reason: mixed format, see above + "test_metadata[mixed_scene-5_1]": 47, + "test_metadata[mixed_scene-5_1_2]": 47, + "test_metadata[mixed_scene-7_1]": 48, + "test_metadata[mixed_scene-7_1_4]": 47, + "test_metadata[mixed_scene-5_1_4]": 47, ##################################### # # External vs Internal Renderer tests @@ -417,58 +455,65 @@ pass_snr = { # Failure reason: conversion to 7_1_4 could be implemented differently w.r.t decoder "test_ism_binaural_headrotation_vs_decoder[ISM1-BINAURAL_ROOM-full_circle_in_15s]": 15, "test_ism_binaural_headrotation_vs_decoder[ISM1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 15, + "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL-rotate_yaw_pitch_roll1]": 55, "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL_ROOM-full_circle_in_15s]": 12, "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13, + "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL-full_circle_in_15s]": 72, + "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL-rotate_yaw_pitch_roll1]": 73, "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL_ROOM-full_circle_in_15s]": 12, "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13, + "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL-full_circle_in_15s]": 71, + "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL-rotate_yaw_pitch_roll1]": 61, "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL_ROOM-full_circle_in_15s]": 12, "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13, + # TODO needs investigation "test_ism_binaural_static_vs_decoder[ISM1-BINAURAL_ROOM]": 15, "test_ism_binaural_static_vs_decoder[ISM2-BINAURAL_ROOM]": 12, "test_ism_binaural_static_vs_decoder[ISM3-BINAURAL_ROOM]": 12, "test_ism_binaural_static_vs_decoder[ISM4-BINAURAL_ROOM]": 12, - # TODO harmonize panning to stereo - # Failure reason ISM to stereo panning is done via EFAP in the renderer and tangent law in decoder, harmonize - "test_ism_vs_decoder[ISM1-STEREO]": 8, - "test_ism_vs_decoder[ISM2-STEREO]": 17, - "test_ism_vs_decoder[ISM3-STEREO]": 14, - "test_ism_vs_decoder[ISM4-STEREO]": 14, - # TODO needs investigation - # Failure reason: likely differences between metadata position rounding (decoder uses ceil()) and crossfades - "test_ism_vs_decoder[ISM1-5_1_2]": 26, - "test_ism_vs_decoder[ISM1-5_1]": 26, - "test_ism_vs_decoder[ISM1-5_1_4]": 26, - "test_ism_vs_decoder[ISM1-7_1]": 26, - "test_ism_vs_decoder[ISM1-7_1_4]": 26, - "test_ism_vs_decoder[ISM1-FOA]": 26, - "test_ism_vs_decoder[ISM1-HOA2]": 26, - "test_ism_vs_decoder[ISM1-HOA3]": 26, - "test_ism_vs_decoder[ISM2-5_1_2]": 31, - "test_ism_vs_decoder[ISM2-5_1_4]": 31, + "test_ism_binaural_static_vs_decoder[ISM3-BINAURAL]": 72, + "test_ism_binaural_static_vs_decoder[ISM4-BINAURAL]": 71, + # Failure reason: Decoder sets elevation for non-planar output layouts to 0 + "test_ism_vs_decoder[ISM1-5_1]": 27, + "test_ism_vs_decoder[ISM1-7_1]": 27, "test_ism_vs_decoder[ISM2-5_1]": 6, - "test_ism_vs_decoder[ISM2-7_1_4]": 31, "test_ism_vs_decoder[ISM2-7_1]": 5, - "test_ism_vs_decoder[ISM2-FOA]": 31, - "test_ism_vs_decoder[ISM2-HOA2]": 30, - "test_ism_vs_decoder[ISM2-HOA3]": 29, - "test_ism_vs_decoder[ISM3-5_1_2]": 32, - "test_ism_vs_decoder[ISM3-5_1_4]": 32, + "test_ism_vs_decoder[ISM3-MONO]": 73, "test_ism_vs_decoder[ISM3-5_1]": 8, - "test_ism_vs_decoder[ISM3-7_1_4]": 31, "test_ism_vs_decoder[ISM3-7_1]": 7, - "test_ism_vs_decoder[ISM3-FOA]": 32, - "test_ism_vs_decoder[ISM3-HOA2]": 31, - "test_ism_vs_decoder[ISM3-HOA3]": 29, - "test_ism_vs_decoder[ISM3-MONO]": 77, - "test_ism_vs_decoder[ISM4-5_1_2]": 31, - "test_ism_vs_decoder[ISM4-5_1_4]": 30, + "test_ism_vs_decoder[ISM4-MONO]": 72, "test_ism_vs_decoder[ISM4-5_1]": 8, - "test_ism_vs_decoder[ISM4-7_1_4]": 30, "test_ism_vs_decoder[ISM4-7_1]": 7, + # Failure reason: Bit-exact except for first frame; renderer fades in from defaultObjectPosition(), decoder fades in from 0 + "test_ism_vs_decoder[ISM1-5_1_2]": 27, + "test_ism_vs_decoder[ISM1-5_1_4]": 27, + "test_ism_vs_decoder[ISM1-7_1_4]": 27, + "test_ism_vs_decoder[ISM1-FOA]": 27, + "test_ism_vs_decoder[ISM1-HOA2]": 27, + "test_ism_vs_decoder[ISM1-HOA3]": 27, + "test_ism_vs_decoder[ISM1-STEREO]": 27, + "test_ism_vs_decoder[ISM2-5_1_2]": 32, + "test_ism_vs_decoder[ISM2-5_1_4]": 32, + "test_ism_vs_decoder[ISM2-7_1_4]": 32, + "test_ism_vs_decoder[ISM2-FOA]": 32, + "test_ism_vs_decoder[ISM2-HOA2]": 32, + "test_ism_vs_decoder[ISM2-HOA3]": 32, + "test_ism_vs_decoder[ISM2-STEREO]": 32, + "test_ism_vs_decoder[ISM3-5_1_2]": 33, + "test_ism_vs_decoder[ISM3-5_1_4]": 33, + "test_ism_vs_decoder[ISM3-7_1_4]": 33, + "test_ism_vs_decoder[ISM3-FOA]": 33, + "test_ism_vs_decoder[ISM3-HOA2]": 33, + "test_ism_vs_decoder[ISM3-HOA3]": 33, + "test_ism_vs_decoder[ISM3-STEREO]": 33, + "test_ism_vs_decoder[ISM4-5_1_2]": 31, + "test_ism_vs_decoder[ISM4-5_1_4]": 31, + "test_ism_vs_decoder[ISM4-7_1_4]": 31, "test_ism_vs_decoder[ISM4-FOA]": 31, "test_ism_vs_decoder[ISM4-HOA2]": 30, "test_ism_vs_decoder[ISM4-HOA3]": 29, "test_ism_vs_decoder[ISM4-MONO]": 77, + "test_ism_vs_decoder[ISM4-STEREO]": 31, # TODO needs investigation # Failure reason: headrotation and crossfade could have differences "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL-full_circle_in_15s]": 4, @@ -489,11 +534,13 @@ pass_snr = { "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 16, "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 16, # Failure reason: Differences seem to be purely in late reverb part + "test_multichannel_binaural_static_vs_decoder[5_1-BINAURAL_ROOM]": 18, "test_multichannel_binaural_static_vs_decoder[5_1_2-BINAURAL_ROOM]": 18, + "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL]": 74, "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL_ROOM]": 18, - "test_multichannel_binaural_static_vs_decoder[5_1-BINAURAL_ROOM]": 18, - "test_multichannel_binaural_static_vs_decoder[7_1_4-BINAURAL_ROOM]": 18, + "test_multichannel_binaural_static_vs_decoder[7_1-BINAURAL]": 74, "test_multichannel_binaural_static_vs_decoder[7_1-BINAURAL_ROOM]": 19, + "test_multichannel_binaural_static_vs_decoder[7_1_4-BINAURAL_ROOM]": 18, # Failure reason: R channel in MONO output is delayed "test_multichannel_vs_decoder[5_1_2-MONO]": 1, "test_multichannel_vs_decoder[5_1_4-MONO]": 1, @@ -521,7 +568,7 @@ pass_snr = { "test_multichannel_vs_decoder[5_1-7_1]": 62, "test_multichannel_vs_decoder[7_1_4-5_1_2]": 63, "test_multichannel_vs_decoder[7_1_4-5_1_4]": 63, - "test_multichannel_vs_decoder[7_1_4-5_1]": 63, + "test_multichannel_vs_decoder[7_1_4-5_1]": 62, "test_multichannel_vs_decoder[7_1_4-7_1]": 62, "test_multichannel_vs_decoder[7_1-5_1_2]": 63, "test_multichannel_vs_decoder[7_1-5_1_4]": 63, diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index b22cdc9f6978ad23cc0752d00a0ed48943fde570..6030440f074ed8757a61d215a6713045df0a004e 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -443,7 +443,7 @@ def compare_renderer_vs_decoder(test_info, in_fmt, out_fmt, **kwargs): if in_fmt in FORMAT_TO_METADATA_FILES.keys(): tmp_fmt = "EXT" in_meta_files = [ - str(tmp_dir.joinpath(f"{in_fmt}_to_EXT.wav.{n}.csv")) + str(tmp_dir.joinpath(f"{in_fmt}_to_EXT{trj_name}.wav.{n}.csv")) for n in range(int(in_fmt[-1])) ] else: