From 9881d0fbbbae22bcf1d49738a7bdba6591cf0b53 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 13 Mar 2025 13:27:07 +0100 Subject: [PATCH 1/9] Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX --- lib_com/options.h | 3 ++- lib_dec/jbm_jb4sb.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index be86aa6f64..4a4448de24 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,6 +160,7 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ +#define ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN /* FhG: Use safety margin defined by user instead of a hard-coded value */ /* #################### End BE switches ################################## */ @@ -173,7 +174,7 @@ #define NONBE_1279_COUNTER_OVERFLOW /* VA: issue 1279: Avoid possible overflow of counter st->Nb_ACELP_frames */ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ - +#define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */ #define NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold to be aligned with BASOP*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index c1e728e103..2950443f4f 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -671,10 +671,24 @@ static void JB4_targetPlayoutDelay( *targetStartUp = ( *targetMin + *targetMax ) / 2; } +#ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX +#ifdef ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN + *targetDtx = JB4_MAX( *targetDtx, (uint32_t) h->safetyMargin ); +#else + if ( *targetDtx < 60 ) + { + *targetDtx = 60; + } +#endif +#endif +#ifdef ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN + *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin ); +#else if ( *targetStartUp < 60 ) { *targetStartUp = 60; } +#endif return; } -- GitLab From 469329b7a43dc16af5bb8fcf727d1283840e3deb Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 20 Mar 2025 13:27:59 +0100 Subject: [PATCH 2/9] Put all changes in one preprocessor switch --- lib_com/options.h | 1 - lib_dec/jbm_jb4sb.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 4a4448de24..03f3d92b2f 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -160,7 +160,6 @@ /*#define FIX_I4_OL_PITCH*/ /* fix open-loop pitch used for EVS core switching */ #define TMP_FIX_1119_SPLIT_RENDERING_VOIP /* FhG: Add error check for unsupported config: split rendering with VoIP mode */ -#define ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN /* FhG: Use safety margin defined by user instead of a hard-coded value */ /* #################### End BE switches ################################## */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index 2950443f4f..b231594dba 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -672,16 +672,7 @@ static void JB4_targetPlayoutDelay( } #ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX -#ifdef ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN *targetDtx = JB4_MAX( *targetDtx, (uint32_t) h->safetyMargin ); -#else - if ( *targetDtx < 60 ) - { - *targetDtx = 60; - } -#endif -#endif -#ifdef ISSUE_1122_JBM_DO_NOT_HARDCODE_SAFETY_MARGIN *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin ); #else if ( *targetStartUp < 60 ) -- GitLab From 8d688c8835468ab705f36c6f07f2821d427f6768 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Thu, 20 Mar 2025 13:44:14 +0100 Subject: [PATCH 3/9] Disable fix in EVS mode to keep BE --- lib_com/options.h | 1 + lib_dec/jbm_jb4sb.c | 21 ++++++++++++++++++++- lib_dec/jbm_jb4sb.h | 4 ++++ lib_dec/lib_dec.c | 6 ++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lib_com/options.h b/lib_com/options.h index 03f3d92b2f..5bc247ef50 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -174,6 +174,7 @@ #define NONBE_1244_FIX_SWB_BWE_MEMORY /* VA: issue 1244: fix to SWB BWE memory in case of switching from FB coding - pending a review by Huawei */ #define NONBE_FIX_1277_EVS_DTX_HIGH_RATE_THRESHOLD /* VA/Eri: issue 1277: Fix Mismatch in DTX high-rate threshold between EVS float and BASOP */ #define NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX /* FhG: Avoid JBM ignoring safety margin and setting playout delay to 0 during DTX */ +#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR. */ #define NONBE_1231_BASOP_819_THRESHOLD_MASA2TOTAL /* Nokia: add fix for precision limitation in comparison with masa2total energy ratio threshold to be aligned with BASOP*/ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index b231594dba..ad3ba459a6 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -199,6 +199,9 @@ struct JB4 JB4_DATAUNIT_HANDLE freeMemorySlots[MAX_JBM_SLOTS]; uint16_t nFreeMemorySlots; /*@} */ +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED + bool evsMode; +#endif }; /* JB4 */ @@ -293,6 +296,9 @@ ivas_error JB4_Create( h->freeMemorySlots[iter] = &h->memorySlots[iter]; } h->nFreeMemorySlots = MAX_JBM_SLOTS; +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED + h->evsMode = false; +#endif *ph = h; return IVAS_ERR_OK; @@ -369,6 +375,12 @@ ivas_error JB4_Init( return IVAS_ERR_OK; } +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED +void JB4_TMP_SetEvsCompatFlag( JB4_HANDLE h ) +{ + h->evsMode = true; +} +#endif /* Returns a memory slot to store a new data unit */ JB4_DATAUNIT_HANDLE JB4_AllocDataUnit( @@ -672,7 +684,14 @@ static void JB4_targetPlayoutDelay( } #ifdef NONBE_1122_JBM_FIX_PLAYOUT_DELAY_IN_DTX - *targetDtx = JB4_MAX( *targetDtx, (uint32_t) h->safetyMargin ); +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED + if ( !h->evsMode ) + { +#endif + *targetDtx = JB4_MAX( *targetDtx, (uint32_t) h->safetyMargin ); +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED + } +#endif *targetStartUp = JB4_MAX( *targetStartUp, (uint32_t) h->safetyMargin ); #else if ( *targetStartUp < 60 ) diff --git a/lib_dec/jbm_jb4sb.h b/lib_dec/jbm_jb4sb.h index 3d48723495..8155d66ae9 100644 --- a/lib_dec/jbm_jb4sb.h +++ b/lib_dec/jbm_jb4sb.h @@ -86,6 +86,10 @@ void JB4_Destroy( JB4_HANDLE *ph ); ivas_error JB4_Init( JB4_HANDLE h, const int16_t safetyMargin ); +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED +void JB4_TMP_SetEvsCompatFlag( JB4_HANDLE h ); +#endif + JB4_DATAUNIT_HANDLE JB4_AllocDataUnit( JB4_HANDLE h ); void JB4_FreeDataUnit( JB4_HANDLE h, JB4_DATAUNIT_HANDLE dataUnit ); diff --git a/lib_dec/lib_dec.c b/lib_dec/lib_dec.c index 7640228d3b..7ec454310f 100644 --- a/lib_dec/lib_dec.c +++ b/lib_dec/lib_dec.c @@ -793,6 +793,12 @@ ivas_error IVAS_DEC_EnableVoIP( { return IVAS_ERR_FAILED_ALLOC; } +#ifdef NONBE_1122_KEEP_EVS_MODE_UNCHANGED + if ( hIvasDec->mode == IVAS_DEC_MODE_EVS ) + { + JB4_TMP_SetEvsCompatFlag( hIvasDec->hVoIP->hJBM ); + } +#endif /* init flush buffer if necessary (only needed for binaural)*/ if ( hIvasDec->flushbuffer == NULL && ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ) -- GitLab From 445beba8fe6053553846137a430d1538c87ad7cf Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 21 Mar 2025 16:45:11 +0100 Subject: [PATCH 4/9] add DTX cases and keep_files support --- tests/test_be_for_jbm_neutral_dly_profile.py | 180 +++++++++++++------ 1 file changed, 125 insertions(+), 55 deletions(-) diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index 61bb168a2f..17e41c4038 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -14,69 +14,73 @@ DTX_ON = "DTX_ON" DTX_OFF = "DTX_OFF" -# TODO: Clarify if this should also be tested with DTX, see #1122 -TESTCASES = [ +# testcases where DTX is supported +TESTCASES_WITH_DTX = [ # stereo - ["stereo", 32000, "EXT", "DTX_OFF"], - ["stereo", 48000, "MONO", "DTX_OFF"], - ["stereo", 16400, "5_1", "DTX_OFF"], - ["stereo", 256000, "7_1_4", "DTX_OFF"], + ["stereo", 32000, "EXT"], + ["stereo", 48000, "MONO"], + ["stereo", 16400, "5_1"], + ["stereo", 256000, "7_1_4"], # param ISM - ["ISM4", 32000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["ISM3", 24400, "STEREO", "DTX_OFF"], - ["ISM4", 24400, "5_1_2", "DTX_OFF"], - ["ISM3", 32000, "HOA2", "DTX_OFF"], + ["ISM4", 32000, "BINAURAL_ROOM_REVERB"], + ["ISM3", 24400, "STEREO"], + ["ISM4", 24400, "5_1_2"], + ["ISM3", 32000, "HOA2"], # discrete ISM - ["ISM3", 64000, "BINAURAL", "DTX_OFF"], - ["ISM1", 32000, "BINAURAL_ROOM_IR", "DTX_OFF"], - ["ISM2", 96000, "7_1", "DTX_OFF"], - ["ISM1", 80000, "MONO", "DTX_OFF"], - ["ISM4", 128000, "FOA", "DTX_OFF"], + ["ISM3", 64000, "BINAURAL"], + ["ISM2", 96000, "7_1"], + ["ISM1", 80000, "MONO"], + ["ISM4", 128000, "FOA"], # MASA - ["MASA1TC", 24400, "BINAURAL_ROOM_IR", "DTX_OFF"], - ["MASA2TC", 80000, "stereo", "DTX_OFF"], - ["MASA1TC", 16400, "7_1_4", "DTX_OFF"], - ["MASA2TC", 256000, "HOA3", "DTX_OFF"], - ["MASA1TC", 128000, "EXT", "DTX_OFF"], + ["MASA1TC", 24400, "BINAURAL_ROOM_IR"], + ["MASA2TC", 80000, "stereo"], + ["MASA1TC", 16400, "7_1_4"], + ["MASA2TC", 256000, "HOA3"], + ["MASA1TC", 128000, "EXT"], + # SBA + ["HOA3", 64000, "BINAURAL"], + ["HOA2", 80000, "EXT"], + ["FOA", 13200, "stereo"], +] + +# testcases with no DTX support +TESTCASES_NO_DTX = [ + # SBA + ["FOA", 256000, "BINAURAL_ROOM_REVERB"], + ["HOA3", 512000, "5_1_4"], # MC # McMasa - ["MC_5_1", 16400, "BINAURAL_ROOM_IR", "DTX_OFF"], - ["MC_7_1_4", 80000, "mono", "DTX_OFF"], - ["MC_5_1_2", 24400, "EXT", "DTX_OFF"], + ["MC_5_1", 16400, "BINAURAL_ROOM_IR"], + ["MC_7_1_4", 80000, "mono"], + ["MC_5_1_2", 24400, "EXT"], # paramMC - ["MC_5_1_2", 48000, "BINAURAL", "DTX_OFF"], - ["MC_7_1", 80000, "EXT", "DTX_OFF"], - ["MC_7_1_4", 128000, "FOA", "DTX_OFF"], + ["MC_5_1_2", 48000, "BINAURAL"], + ["MC_7_1", 80000, "EXT"], + ["MC_7_1_4", 128000, "FOA"], # paramUpmix - ["MC_7_1_4", 160000, "stereo", "DTX_OFF"], + ["MC_7_1_4", 160000, "stereo"], # discrete MC - ["MC_5_1_2", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["MC_7_1", 128000, "EXT", "DTX_OFF"], - ["MC_7_1_4", 256000, "5_1", "DTX_OFF"], - # SBA - ["HOA3", 64000, "BINAURAL", "DTX_OFF"], - ["FOA", 256000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["HOA2", 80000, "EXT", "DTX_OFF"], - ["HOA3", 512000, "5_1_4", "DTX_OFF"], - ["FOA", 80000, "stereo", "DTX_OFF"], + ["MC_5_1_2", 512000, "BINAURAL_ROOM_REVERB"], + ["MC_7_1", 128000, "EXT"], + ["MC_7_1_4", 256000, "5_1"], # OMASA - ["OMASA_ISM1", 512000, "BINAURAL", "DTX_OFF"], - ["OMASA_ISM2", 24400, "MONO", "DTX_OFF"], - ["OMASA_ISM3", 80000, "7_1_4", "DTX_OFF"], - ["OMASA_ISM4", 64000, "HOA3", "DTX_OFF"], - ["OMASA_ISM2", 32000, "EXT", "DTX_OFF"], + ["OMASA_ISM1", 512000, "BINAURAL"], + ["OMASA_ISM2", 24400, "MONO"], + ["OMASA_ISM3", 80000, "7_1_4"], + ["OMASA_ISM4", 64000, "HOA3"], + ["OMASA_ISM2", 32000, "EXT"], # OSBA - ["OSBA_ISM2_HOA2", 64000, "BINAURAL_ROOM_IR", "DTX_OFF"], - ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB", "DTX_OFF"], - ["OSBA_ISM3_HOA3", 128000, "EXT", "DTX_OFF"], - ["OSBA_ISM2_HOA3", 96000, "5_1", "DTX_OFF"], - ["OSBA_ISM1_HOA2", 32000, "mono", "DTX_OFF"], + ["OSBA_ISM2_HOA2", 64000, "BINAURAL_ROOM_IR"], + ["OSBA_ISM4_FOA", 512000, "BINAURAL_ROOM_REVERB"], + ["OSBA_ISM3_HOA3", 128000, "EXT"], + ["OSBA_ISM2_HOA3", 96000, "5_1"], + ["OSBA_ISM1_HOA2", 32000, "mono"], ] DLY_PROFILE = SCRIPTS_DIR.joinpath("dly_error_profiles/dly_error_profile_0.dat") JBM_NEUTRAL_DELAY_MS = 60 -def get_options(in_format, bitrate, dtx): +def get_options(in_format, dtx): options = list() if dtx: @@ -147,19 +151,82 @@ INPUT_FILES = { "OSBA_ISM1_HOA2": "stvOSBA_1ISM_2OA48c.wav", } +OUTPUT_FOLDER_IF_KEEP_FILES = pathlib.Path(__file__).parent.joinpath("output-jbm-be") +OUTPUT_FOLDER_IF_KEEP_FILES_NO_JBM = OUTPUT_FOLDER_IF_KEEP_FILES.joinpath("no-jbm") +OUTPUT_FOLDER_IF_KEEP_FILES_NEUTRAL = OUTPUT_FOLDER_IF_KEEP_FILES.joinpath( + "neutral-profile" +) + -@pytest.mark.parametrize("in_format,bitrate,out_format,dtx", TESTCASES) -def test_be_for_jbm_neutral_dly_profile( - in_format, bitrate, out_format, dtx, dut_encoder_frontend, dut_decoder_frontend +@pytest.mark.parametrize( + "in_format,bitrate,out_format", TESTCASES_NO_DTX + TESTCASES_WITH_DTX +) +def test_be_for_jbm_neutral_dly_profile_no_dtx( + in_format, + bitrate, + out_format, + dut_encoder_frontend, + dut_decoder_frontend, + keep_files, ): + run_test( + in_format, + bitrate, + out_format, + DTX_OFF, + dut_encoder_frontend, + dut_decoder_frontend, + keep_files, + ) + + +@pytest.mark.parametrize("in_format,bitrate,out_format", TESTCASES_WITH_DTX) +def test_be_for_jbm_neutral_dly_profile_with_dtx( + in_format, + bitrate, + out_format, + dut_encoder_frontend, + dut_decoder_frontend, + keep_files, +): + run_test( + in_format, + bitrate, + out_format, + DTX_ON, + dut_encoder_frontend, + dut_decoder_frontend, + keep_files, + ) + + +def run_test( + in_format, + bitrate, + out_format, + dtx, + dut_encoder_frontend, + dut_decoder_frontend, + keep_files, +): + if keep_files: + OUTPUT_FOLDER_IF_KEEP_FILES_NEUTRAL.mkdir(exist_ok=True, parents=True) + OUTPUT_FOLDER_IF_KEEP_FILES_NO_JBM.mkdir(exist_ok=True, parents=True) + with TemporaryDirectory() as tmp_dir: tmp_dir = pathlib.Path(tmp_dir) + output_dir_no_jbm = ( + OUTPUT_FOLDER_IF_KEEP_FILES_NO_JBM if keep_files else tmp_dir + ) + output_dir_neutral = ( + OUTPUT_FOLDER_IF_KEEP_FILES_NEUTRAL if keep_files else tmp_dir + ) # run encoder bitstream_file = tmp_dir.joinpath(f"{in_format}.192").absolute() sampling_rate_khz = 48 input_file = TESTV_DIR.joinpath(INPUT_FILES[in_format]) - options = get_options(in_format, bitrate, dtx == DTX_ON) + options = get_options(in_format, dtx == DTX_ON) dut_encoder_frontend.run( bitrate, sampling_rate_khz, @@ -170,11 +237,13 @@ def test_be_for_jbm_neutral_dly_profile( ) # run decoder without network simulation - output = tmp_dir.joinpath(f"{in_format}-{bitrate}-{out_format}.wav").absolute() + output = output_dir_no_jbm.joinpath( + f"{in_format}-{bitrate}-{out_format}.wav" + ).absolute() dut_decoder_frontend.run(out_format, sampling_rate_khz, bitstream_file, output) # run decoder with network simulation - output_jbm = output.with_suffix(".jbm-0.wav") + output_jbm = output_dir_neutral.joinpath(output.with_suffix(".jbm-0.wav").name) dut_decoder_frontend.run( out_format, sampling_rate_khz, @@ -188,7 +257,6 @@ def test_be_for_jbm_neutral_dly_profile( x_jbm, _ = audiofile.readfile(output_jbm) # strip jbm delay - # TODO: this may need to be adapted to handle variable offsets based on outcome of #1122 cmp_result = audioarray.compare( x, x_jbm, @@ -197,4 +265,6 @@ def test_be_for_jbm_neutral_dly_profile( test_start_offset_ms=JBM_NEUTRAL_DELAY_MS, ) if not cmp_result["bitexact"]: - pytest.fail(f"Difference between no jbm and zero-delay jbm decoding found! Max abs diff: {cmp_result['max_abs_diff']}") + pytest.fail( + f"Difference between no jbm and zero-delay jbm decoding found! Max abs diff: {cmp_result['max_abs_diff']}" + ) -- GitLab From 2339708040a7672a6ca4606c6a16deefb3b18941 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 21 Mar 2025 17:50:05 +0100 Subject: [PATCH 5/9] add noise to end of signals to prevent ending with dtx section --- tests/test_be_for_jbm_neutral_dly_profile.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index 17e41c4038..6b059ac743 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -2,6 +2,7 @@ import pytest import pathlib import sys import re +import numpy as np from tempfile import TemporaryDirectory from .constants import TESTV_DIR, SCRIPTS_DIR @@ -226,6 +227,22 @@ def run_test( bitstream_file = tmp_dir.joinpath(f"{in_format}.192").absolute() sampling_rate_khz = 48 input_file = TESTV_DIR.joinpath(INPUT_FILES[in_format]) + + # for DTX cases append 5 frames of white noise to the file + # this should make sure that there is no DTX segment at the very end of the signal + # DTX at the end can still cause length differences which are fine to exist, but make the comparison hard to handle + # EXCEPTION (of course there is one...): MASA. We cant append to the signal without appending some MD. Luckily, this problem does not occur with the MASA testvectors + if dtx == DTX_ON and "MASA" not in in_format: + input_signal, fs = audiofile.readfile(input_file) + noise_len = fs // 50 * 5 + noise_amplitude = np.max(input_signal) + noise = ( + np.random.random((noise_len, input_signal.shape[1])) * noise_amplitude + ) + input_signal = np.concatenate([input_signal, noise]) + input_file = tmp_dir.joinpath(f"{input_file.stem}-plus-noise.wav") + audiofile.writefile(input_file, input_signal, fs) + options = get_options(in_format, dtx == DTX_ON) dut_encoder_frontend.run( bitrate, @@ -238,7 +255,7 @@ def run_test( # run decoder without network simulation output = output_dir_no_jbm.joinpath( - f"{in_format}-{bitrate}-{out_format}.wav" + f"{in_format}-{bitrate}-{out_format}-{dtx}.wav" ).absolute() dut_decoder_frontend.run(out_format, sampling_rate_khz, bitstream_file, output) -- GitLab From 5482782aa5ac436ff2215025d1cc6242aa8f66e7 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Fri, 21 Mar 2025 17:54:17 +0100 Subject: [PATCH 6/9] use scaled-down SBA files that actually trigger DTX --- tests/test_be_for_jbm_neutral_dly_profile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_be_for_jbm_neutral_dly_profile.py b/tests/test_be_for_jbm_neutral_dly_profile.py index 6b059ac743..ec67ab22a3 100644 --- a/tests/test_be_for_jbm_neutral_dly_profile.py +++ b/tests/test_be_for_jbm_neutral_dly_profile.py @@ -137,9 +137,9 @@ INPUT_FILES = { "MC_5_1_4": "stv514MC48c.wav", "MC_7_1": "stv71MC48c.wav", "MC_7_1_4": "stv714MC48c.wav", - "FOA": "stvFOA48c.wav", - "HOA2": "stv2OA48c.wav", - "HOA3": "stv3OA48c.wav", + "FOA": "stvFOA48c_cut_.004.wav", + "HOA2": "stv2OA48c_cut_.004.wav", + "HOA3": "stv3OA48c_cut_.004.wav", "OMASA_ISM1": "stvOMASA_1ISM_2MASA2TC48c.wav", "OMASA_ISM2": "stvOMASA_2ISM_2MASA2TC48c.wav", "OMASA_ISM3": "stvOMASA_3ISM_2MASA2TC48c.wav", -- GitLab From df14a46ec739d84f84dbfcdf9a4edfd5188a6c20 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Mar 2025 09:42:44 +0100 Subject: [PATCH 7/9] add testcases with DTX + neutral JBM profile --- scripts/config/self_test.prm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 5b3df2cf08..0a400d0e1f 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1578,6 +1578,25 @@ eid-xor -fer -vbr -bs g192 -ep g192 bit ../scripts/dly_error_profiles/ep_5pct.g1 ../IVAS_dec -non_diegetic_pan 80 STEREO 48 bit testv/stv1ISM48s.pcm_ISM_32000_48-48_STEREO_NON-DIEGETIC-PAN_80.tst +// stereo at 32 kbps, 48 kHz in, 32 kHz out, DTX on, JBM Prof 0 +../IVAS_cod -stereo -dtx 32000 48 testv/stvST48n.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP STEREO 32 netsimoutput testv/stvST48n.wav_stereo_32000_48-32_DTX_JBM0.tst + +// 4 ISm with metadata at 64 kbps, 48 kHz in, 48 kHz out, DTX on, EXT out, JBM Prof 0 +../IVAS_cod -dtx -ism 4 testv/stvISM1.csv testv/stvISM2.csv testv/stvISM3.csv testv/stvISM4.csv 64000 48 testv/stv4ISM48n.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput testv/stv4ISM48s.wav_64000_48-48_EXT_JBM0.tst + +// MASA 1dir 1TC at 13.2 kbps, 48kHz in, 32kHz out, DTX on, EXT out, JBM Prof 0 +../IVAS_cod -dtx -masa 1 testv/stv1MASA1TC48n.met 13200 48 testv/stv1MASA1TC48n.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec -VOIP EXT 32 netsimoutput testv/stv1MASA1TC48n.wav_sw_48-32_EXT_JBM0.tst + +// SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, JBM 0 +../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c_cut_.004.wav bit +networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 +../IVAS_dec -Tracefile tracefile_dec BINAURAL 32 netsimoutput testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_JBM0.tst // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/stvST16n.wav bit -- GitLab From bfffdff6ca4e2dd08171939752ea23aec3c7bd01 Mon Sep 17 00:00:00 2001 From: Jan Kiene Date: Tue, 25 Mar 2025 10:05:35 +0100 Subject: [PATCH 8/9] add missing -voip --- scripts/config/self_test.prm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config/self_test.prm b/scripts/config/self_test.prm index 0a400d0e1f..f996b81602 100644 --- a/scripts/config/self_test.prm +++ b/scripts/config/self_test.prm @@ -1596,7 +1596,7 @@ networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit // SBA at 24.4 kbps, 32kHz in, 32kHz out, DTX on, BINAURAL out, JBM 0 ../IVAS_cod -sba 3 -dtx 24400 32 testv/stv3OA32c_cut_.004.wav bit networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_0.dat bit netsimoutput tracefile_sim 2 0 -../IVAS_dec -Tracefile tracefile_dec BINAURAL 32 netsimoutput testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_JBM0.tst +../IVAS_dec -Tracefile tracefile_dec -VOIP BINAURAL 32 netsimoutput testv/stv3OA32c.wav_SBA_24400_32-32_DTX_Binaural_JBM0.tst // stereo at 48 kbps, 16 kHz in, 16 kHz out, DTX on, JBM Prof 5 ../IVAS_cod -stereo -dtx 48000 16 testv/stvST16n.wav bit -- GitLab From 6db5b3a2a595c3cd6fb60e8f2b64d0a3fed9e1b4 Mon Sep 17 00:00:00 2001 From: Kacper Sagnowski Date: Fri, 28 Mar 2025 11:16:35 +0100 Subject: [PATCH 9/9] Fix uint32_t underflow --- lib_dec/jbm_jb4_jmf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_dec/jbm_jb4_jmf.c b/lib_dec/jbm_jb4_jmf.c index 721a6937d0..9abb3d9732 100644 --- a/lib_dec/jbm_jb4_jmf.c +++ b/lib_dec/jbm_jb4_jmf.c @@ -208,7 +208,7 @@ int16_t JB4_JMF_PushPacket( rtpTimeDiff = (int32_t) ( rtpTimeStamp - h->lastRtpTimeStamp ); sysTimeDiff = sysTime - h->lastSysTime; - offset = sysTime - rtpTimeStamp; + offset = (int32_t) sysTime - (int32_t) rtpTimeStamp; /* get the delay (yes, signed!!!!) */ delay = sysTimeDiff - rtpTimeDiff + h->lastDelay; -- GitLab