From 9036f393c1d6f35291bd51ec2ab9558bb7fcd575 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 1 Dec 2022 18:27:06 +0100 Subject: [PATCH 1/4] - add FIX_REND_ROUNDING to round like mvr2s() instead of using roundf - add FIX_REND_MONO_DMX with updated downmix coefficients for mono output --- apps/renderer.c | 17 ++++++++++ lib_com/options.h | 2 ++ lib_rend/ivas_rom_rend.c | 15 +++++++++ lib_rend/lib_rend.c | 51 +++++++++++++++++++++++++---- scripts/pyaudio3dtools/constants.py | 16 ++++----- tests/renderer/constants.py | 5 ++- 6 files changed, 88 insertions(+), 18 deletions(-) diff --git a/apps/renderer.c b/apps/renderer.c index 9fb5337ed8..e8e3f29d6b 100644 --- a/apps/renderer.c +++ b/apps/renderer.c @@ -2461,6 +2461,9 @@ static void convertOutputBuffer( int16_t *intBuffer ) { int16_t chnl, smpl, i; +#ifdef FIX_REND_ROUNDING + float temp; +#endif i = 0; @@ -2468,7 +2471,21 @@ static void convertOutputBuffer( { for ( chnl = 0; chnl < numChannels; ++chnl ) { +#ifdef FIX_REND_ROUNDING + temp = floatBuffer[chnl * numSamplesPerChannel + smpl]; + temp = (float) floor( temp + 0.5f ); + if ( temp > MAX16B_FLT ) + { + temp = MAX16B_FLT; + } + else if ( temp < MIN16B_FLT ) + { + temp = MIN16B_FLT; + } + intBuffer[i] = (int16_t) temp; +#else intBuffer[i] = (int16_t) roundf( floatBuffer[chnl * numSamplesPerChannel + smpl] ); +#endif ++i; } diff --git a/lib_com/options.h b/lib_com/options.h index 388f61bd95..50aca177db 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -175,6 +175,8 @@ #define FIX_GET_DELAY_RETURN /* Issue 223: change return data type in function get_delay() */ #define NTT_REDUC_COMP_POC /* NTT Contribution 10: Complexity reduction of phase spectrum in stereo downmix*/ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ +#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 */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/ivas_rom_rend.c b/lib_rend/ivas_rom_rend.c index 100dded459..9d3876ca90 100644 --- a/lib_rend/ivas_rom_rend.c +++ b/lib_rend/ivas_rom_rend.c @@ -362,6 +362,20 @@ const uint32_t ls_LFE_last_idx_CICP19[12] = { 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, const float ls_conversion_cicpX_mono[12][1] = { #ifdef EXT_RENDERER +#ifdef FIX_REND_MONO_DMX + {1.00000000f}, + {1.00000000f}, + {1.00000000f}, + {1.00000000f}, + {0.79999995f}, + {0.79999995f}, + {0.79999995f}, + {0.79999995f}, + {0.849999964f}, + {0.849999964f}, + {0.849999964f}, + {0.849999964f} +#else /* FIX_REND_MONO_DMX */ {1.00000000f}, {1.00000000f}, {1.00000000f}, @@ -374,6 +388,7 @@ const float ls_conversion_cicpX_mono[12][1] = {1.00000000f}, {1.00000000f}, {1.00000000f}, +#endif /* FIX_REND_MONO_DMX */ #else {1.00000000f}, {1.00000000f}, diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index d766334988..ada392cf32 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1203,6 +1203,11 @@ static ivas_error initMcPanGainsWithMonoOut( { int16_t i; int16_t numInChannels; +#ifdef FIX_REND_MONO_DMX + int16_t readIdx; + int16_t writeIdx; + bool skipSideSpeakers; +#endif ivas_error error; if ( ( error = getRendInputNumChannels( inputMc, &numInChannels ) ) != IVAS_ERR_OK ) @@ -1210,12 +1215,44 @@ static ivas_error initMcPanGainsWithMonoOut( return error; } +#ifdef FIX_REND_MONO_DMX + if ( inputMc->base.inConfig == IVAS_REND_AUDIO_CONFIG_LS_CUSTOM ) + { + for ( i = 0; i < numInChannels; ++i ) + { + /* It's OK to also set gain 1 for LFE input channels here. + * Correct LFE handling will be applied within updateMcPanGains() */ + inputMc->panGains[i][0] = 1.f; + } + } + else + { + /* 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 ) + { + skipSideSpeakers = true; + } + for ( readIdx = 0, writeIdx = 0; writeIdx < numInChannels; ++readIdx, ++writeIdx ) + { + if ( skipSideSpeakers && readIdx == 4 ) + { + /* Skip gains for side speakers in lookup table */ + readIdx += 2; + } + + inputMc->panGains[writeIdx][0] = ls_conversion_cicpX_mono[readIdx][0]; + } + } +#else for ( i = 0; i < numInChannels; ++i ) { /* It's OK to also set gain 1 for LFE input channels here. * Correct LFE handling will be applied within updateMcPanGains() */ inputMc->panGains[i][0] = 1.f; } +#endif return IVAS_ERR_OK; } @@ -1323,13 +1360,13 @@ static ivas_error updateMcPanGainsForMcOut( /* "if" conditions below realize the following mapping: If in == out, use identity matrix, otherwise follow the table: - +-----------+----------+---------------+-----------+--------------------+ - | in\out | MONO | STEREO | custom LS | other | - +-----------+----------+---------------+-----------+--------------------+ - | MONO | mono out | EFAP | EFAP | EFAP | - | custom LS | mono out | EFAP | EFAP | EFAP | - | other | mono out | stereo lookup | EFAP | conversion mapping | - +-----------+----------+---------------+-----------+--------------------+ + +-----------+-------------+---------------+-----------+--------------------+ + | in\out | MONO | STEREO | custom LS | other | + +-----------+-------------+---------------+-----------+--------------------+ + | MONO | mono out | EFAP | EFAP | EFAP | + | custom LS | mono out | EFAP | EFAP | EFAP | + | other | mono lookup | stereo lookup | EFAP | conversion mapping | + +-----------+-------------+---------------+-----------+--------------------+ */ if ( configsAreEqual( inputMc->base.inConfig, inputMc->customLsInput, outConfig, *inputMc->base.ctx.pCustomLsOut ) ) diff --git a/scripts/pyaudio3dtools/constants.py b/scripts/pyaudio3dtools/constants.py index b9523fc4ae..92fd5a709e 100644 --- a/scripts/pyaudio3dtools/constants.py +++ b/scripts/pyaudio3dtools/constants.py @@ -37,14 +37,14 @@ IVAS_CICPX_TO_MONO = np.array( 1, 1, 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, + 0.79999995, + 0.79999995, + 0.79999995, + 0.79999995, + 0.849999964, + 0.849999964, + 0.849999964, + 0.849999964, ] ] ).T diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index da7302bdc2..e6ed242619 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -502,21 +502,20 @@ pass_snr = { "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_ROOM]": 19, - # Failure reason: Mono downmix significantly different, needs a fix + # 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, "test_multichannel_vs_decoder[5_1-MONO]": 1, "test_multichannel_vs_decoder[7_1_4-MONO]": 1, "test_multichannel_vs_decoder[7_1-MONO]": 1, "test_multichannel_vs_decoder[STEREO-MONO]": 17, - # Failure reason: Stereo downmix differs slightly, needs a fix + # Failure reason: Active dmx (decoder) vs Passive dmx (renderer) "test_multichannel_vs_decoder[5_1_2-STEREO]": 44, "test_multichannel_vs_decoder[5_1_4-STEREO]": 48, "test_multichannel_vs_decoder[5_1-STEREO]": 48, "test_multichannel_vs_decoder[7_1_4-STEREO]": 46, "test_multichannel_vs_decoder[7_1-STEREO]": 44, # TODO needs investigation - # Failure reason: possibly due to minor differences in crossfades "test_multichannel_vs_decoder[5_1_2-5_1_4]": 63, "test_multichannel_vs_decoder[5_1_2-5_1]": 63, "test_multichannel_vs_decoder[5_1_2-7_1_4]": 63, -- GitLab From 63392d8cda4a3bac83531903799581646a6a3eba Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 2 Dec 2022 15:54:16 +0100 Subject: [PATCH 2/4] further align multichannel rendering - fix a bug for the external renderer causing headrotation to not be applied for BINAURAL_ROOM due to passing the wrong EFAP handle - enable limiter for Crend Unit Test to align - update testcase SNR thresholds accordingly - fix a bug in file naming for test_renderer_vs_decoder.py --- lib_com/options.h | 1 + lib_rend/lib_rend.c | 8 +++++ tests/renderer/constants.py | 65 ++++++++++++++----------------------- tests/renderer/utils.py | 19 ++++++++--- 4 files changed, 48 insertions(+), 45 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 50aca177db..90de40b919 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,6 +177,7 @@ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ #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_MCBRIRS /* ISsue 195: Fix wrong EFAP handle passed to renderer, resulting in no rotation for BINAURAL_ROOM output */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index ada392cf32..7ef176cfbf 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -4119,7 +4119,11 @@ static ivas_error renderMcToBinauralRoom( mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->rot_gains_prev, +#ifdef FIX_REND_ROT_MCBRIRS + mcInput->base.ctx.pEfapOutWrapper->hEfap, +#else mcInput->efapInWrapper.hEfap, +#endif tmpRotBuffer ); copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); @@ -4179,7 +4183,11 @@ static ivas_error renderMcCustomLsToBinauralRoom( mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->rot_gains_prev, +#ifdef FIX_REND_ROT_MCBRIRS + mcInput->base.ctx.pEfapOutWrapper->hEfap, +#else mcInput->efapInWrapper.hEfap, +#endif tmpRotBuffer ); } diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index e6ed242619..12736af984 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -111,7 +111,7 @@ CREND_CMD = [ "-o", "/dev/null", # 6 -> output file # "-lp_lfe", - # "-limiter" + "-limiter" # "-no_delay_cmp" ] @@ -241,7 +241,9 @@ FORMAT_TO_CREND_FORMAT = { INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"] INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"] INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"] -INPUT_FORMATS_MASA = ["MASA2"] #["MASA1", "MASA2"] # Disable MASA1 tests until MASA1 can be implemented properly +INPUT_FORMATS_MASA = [ + "MASA2" +] # ["MASA1", "MASA2"] # Disable MASA1 tests until MASA1 can be implemented properly """ Non binaural / parametric output formats """ OUTPUT_FORMATS = [ @@ -381,36 +383,20 @@ pass_snr = { "test_ism[ISM4-HOA2]": 36, "test_ism[ISM4-HOA3]": 33, "test_ism[ISM4-STEREO]": 57, - # 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, "test_multichannel_binaural_headrotation[7_1-BINAURAL-full_circle_in_15s]": 8, "test_multichannel_binaural_headrotation[7_1-BINAURAL-rotate_yaw_pitch_roll1]": 8, - # Failure reason: bitexact except for clicks and differences in center channel, could be due to crossfades - "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-full_circle_in_15s]": 30, - "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-rotate_yaw_pitch_roll1]": 30, - "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-full_circle_in_15s]": 29, - "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 29, - "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-full_circle_in_15s]": 30, - "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 30, - "test_multichannel_binaural_static[5_1_2-BINAURAL]": 30, - "test_multichannel_binaural_static[5_1_4-BINAURAL]": 29, - "test_multichannel_binaural_static[5_1-BINAURAL]": 27, - "test_multichannel_binaural_static[7_1-BINAURAL]": 30, - "test_multichannel_binaural_static[7_1_4-BINAURAL]": 30, - # TODO needs debugging - # Failure reason: headrotation may be applied differently, differences increase progressively - "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-full_circle_in_15s]": 10, - "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 4, - "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 11, - "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, - "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 12, - "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, - "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-full_circle_in_15s]": 10, - "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, - "test_multichannel_binaural_headrotation[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 10, - "test_multichannel_binaural_headrotation[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3, + # Failure reason: differences in LFE alignment and possibly rotation + "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-full_circle_in_15s]": 14, + "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 12, + "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 8, + "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 6, + "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6, + "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, ##################################### # # External vs Internal Renderer tests @@ -485,18 +471,18 @@ pass_snr = { "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 0, "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL-full_circle_in_15s]": 4, "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 0, - # TODO needs investigation - "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-full_circle_in_15s]": 5, - "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 6, - "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 7, - "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-full_circle_in_15s]": 5, - "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 5, - "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0, - # TODO needs investigation + # # TODO needs investigation + "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-full_circle_in_15s]": 7, + "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6, + "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 3, + "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 2, + "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 2, + "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 2, + "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-full_circle_in_15s]": 7, + "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 5, + "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_2-BINAURAL_ROOM]": 18, "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL_ROOM]": 18, "test_multichannel_binaural_static_vs_decoder[5_1-BINAURAL_ROOM]": 18, @@ -515,7 +501,6 @@ pass_snr = { "test_multichannel_vs_decoder[5_1-STEREO]": 48, "test_multichannel_vs_decoder[7_1_4-STEREO]": 46, "test_multichannel_vs_decoder[7_1-STEREO]": 44, - # TODO needs investigation "test_multichannel_vs_decoder[5_1_2-5_1_4]": 63, "test_multichannel_vs_decoder[5_1_2-5_1]": 63, "test_multichannel_vs_decoder[5_1_2-7_1_4]": 63, diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 8a4ecf739b..b22cdc9f69 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -177,7 +177,6 @@ def run_renderer( out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}.wav")) - cmd = RENDERER_CMD[:] cmd[2] = str(in_file) cmd[4] = str(in_fmt) @@ -389,7 +388,11 @@ def run_pyscripts( def compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, **kwargs): ref, ref_fs = run_renderer( - in_fmt, out_fmt, binary_suffix=BIN_SUFFIX_MERGETARGET, output_path_base=OUTPUT_PATH_REF, **kwargs + in_fmt, + out_fmt, + binary_suffix=BIN_SUFFIX_MERGETARGET, + output_path_base=OUTPUT_PATH_REF, + **kwargs, ) cut, cut_fs = run_renderer(in_fmt, out_fmt, **kwargs) check_BE(test_info, ref, ref_fs, cut, cut_fs) @@ -414,12 +417,18 @@ def compare_renderer_vs_td_standalone(test_info, in_fmt, out_fmt, **kwargs): def compare_renderer_vs_decoder(test_info, in_fmt, out_fmt, **kwargs): + if "trj_file" in kwargs: + trj_name = f"_{kwargs['trj_file'].stem}" + else: + trj_name = "" with TemporaryDirectory() as tmp_dir: tmp_dir = Path(tmp_dir) in_meta_files = None - bit_file = str(tmp_dir.joinpath(f"{in_fmt}_to_{out_fmt}.192")) - out_file_decoder = str(OUTPUT_PATH_REF.joinpath(f"{in_fmt}_to_{out_fmt}.wav")) + bit_file = str(tmp_dir.joinpath(f"{in_fmt}_to_{out_fmt}{trj_name}.192")) + out_file_decoder = str( + OUTPUT_PATH_REF.joinpath(f"{in_fmt}_to_{out_fmt}{trj_name}.wav") + ) # Ref: cod -> dec (out_fmt) if in_fmt in FORMAT_TO_METADATA_FILES.keys(): @@ -440,7 +449,7 @@ def compare_renderer_vs_decoder(test_info, in_fmt, out_fmt, **kwargs): else: tmp_fmt = in_fmt - out_file_ext = str(tmp_dir.joinpath(f"{in_fmt}_to_{tmp_fmt}.wav")) + out_file_ext = str(tmp_dir.joinpath(f"{in_fmt}_to_{tmp_fmt}{trj_name}.wav")) # passthrough decoder run_dec(bit_file, out_file_ext, tmp_fmt, **kwargs) -- GitLab From c5dc9bfb884812914aeac5ba8dedbe2ff0b4c573 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Fri, 2 Dec 2022 17:52:36 +0100 Subject: [PATCH 3/4] rename and update FIX_REND_ROT_MCBRIRS to FIX_REND_ROT_MC_BIN since the issue was also present for binaural output + resolve asan error --- lib_com/options.h | 2 +- lib_rend/lib_rend.c | 22 ++++++++++++++-------- tests/renderer/constants.py | 1 + 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 90de40b919..d31450fef2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -177,7 +177,7 @@ #define FIX_ISM_DECODER_PRINTOUT /* Issue 229: fix ISM decoder printout */ #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_MCBRIRS /* ISsue 195: Fix wrong EFAP handle passed to renderer, resulting in no rotation for BINAURAL_ROOM output */ +#define FIX_REND_ROT_MC_BIN /* Issue 195: Fix wrong EFAP handle passed to renderer, resulting in no rotation for BINAURAL_ROOM output */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 7ef176cfbf..a4ca68bf99 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -1556,6 +1556,12 @@ static ivas_error initMcBinauralRendering( { ivas_rend_closeCrend( &inputMc->crendWrapper ); } +#ifdef FIX_REND_ROT_MC_BIN + if ( inputMc->efapInWrapper.hEfap != NULL ) + { + efap_free_data( &inputMc->efapInWrapper.hEfap ); + } +#endif outSampleRate = *inputMc->base.ctx.pOutSampleRate; @@ -1599,6 +1605,14 @@ static ivas_error initMcBinauralRendering( } } +#ifdef FIX_REND_ROT_MC_BIN + /* Initialise the EFAP handle for rotation on input layout */ + if ( inConfig != IVAS_REND_AUDIO_CONFIG_LS_CUSTOM && inputMc->base.ctx.pHeadRotData->headRotEnabled ) + { + initEfap( &inputMc->efapInWrapper, inConfig, NULL ); + } +#endif + return error; } @@ -4119,11 +4133,7 @@ static ivas_error renderMcToBinauralRoom( mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->rot_gains_prev, -#ifdef FIX_REND_ROT_MCBRIRS - mcInput->base.ctx.pEfapOutWrapper->hEfap, -#else mcInput->efapInWrapper.hEfap, -#endif tmpRotBuffer ); copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer ); @@ -4183,11 +4193,7 @@ static ivas_error renderMcCustomLsToBinauralRoom( mcInput->customLsInput, mcInput->base.ctx.pHeadRotData, mcInput->rot_gains_prev, -#ifdef FIX_REND_ROT_MCBRIRS - mcInput->base.ctx.pEfapOutWrapper->hEfap, -#else mcInput->efapInWrapper.hEfap, -#endif tmpRotBuffer ); } diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 12736af984..829c0437bf 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -386,6 +386,7 @@ pass_snr = { # 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, + "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 1, "test_multichannel_binaural_headrotation[7_1-BINAURAL-full_circle_in_15s]": 8, "test_multichannel_binaural_headrotation[7_1-BINAURAL-rotate_yaw_pitch_roll1]": 8, # Failure reason: differences in LFE alignment and possibly rotation -- GitLab From aa6facd31671d129f1ad2b60ca75dfb79167b329 Mon Sep 17 00:00:00 2001 From: Archit Tamarapu Date: Thu, 8 Dec 2022 15:01:21 +0100 Subject: [PATCH 4/4] update testcase thresholds --- tests/renderer/constants.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/renderer/constants.py b/tests/renderer/constants.py index 829c0437bf..b315576806 100644 --- a/tests/renderer/constants.py +++ b/tests/renderer/constants.py @@ -386,9 +386,14 @@ pass_snr = { # 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, + "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-full_circle_in_15s]": 9, + "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-rotate_yaw_pitch_roll1]": 1, + "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-full_circle_in_15s]": 10, "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 1, "test_multichannel_binaural_headrotation[7_1-BINAURAL-full_circle_in_15s]": 8, "test_multichannel_binaural_headrotation[7_1-BINAURAL-rotate_yaw_pitch_roll1]": 8, + "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-full_circle_in_15s]": 8, + "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 1, # Failure reason: differences in LFE alignment and possibly rotation "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-full_circle_in_15s]": 14, "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 12, -- GitLab