From 8bc970c9b4fafe5621a6fb2a26663d87dfaadcc3 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 30 Jan 2025 08:58:26 +0100 Subject: [PATCH 01/17] Add back old channel-wise PEAQ comparison --- tests/cmp_pcm.py | 13 ++++- .../test_param_file.py | 6 ++- tests/codec_be_on_mr_nonselection/test_sba.py | 16 ++++++- tests/conftest.py | 21 ++++++++- tests/constants.py | 2 + tests/renderer/test_renderer.py | 47 +++++++++++++++++++ 6 files changed, 101 insertions(+), 4 deletions(-) diff --git a/tests/cmp_pcm.py b/tests/cmp_pcm.py index 8bb4dd92f4..45cd4271d0 100755 --- a/tests/cmp_pcm.py +++ b/tests/cmp_pcm.py @@ -34,6 +34,7 @@ def cmp_pcm( abs_tol=0, get_ssnr=False, get_odg=False, + get_odg_bin=False, odg_input=None, odg_test=None, odg_ref=None, @@ -133,6 +134,16 @@ def cmp_pcm( reason += msg + " - " if get_odg: + for n in range(nchannels): + pqeval_output = pqevalaudio_wrapper(s1[:, n], s2[:, n], fs) + + match_odg = re.search(ODG_PATTERN_PQEVALAUDIO, pqeval_output) + odg = float(match_odg.groups()[0]) + msg = f"Channel {n} ODG: {odg}" + reason += " - " + msg + print(msg) + + if get_odg_bin: odg_files = {} for f in [odg_input, odg_test, odg_ref]: # Load PEAQ test files and ensure 48 kHz sampling rate @@ -165,7 +176,7 @@ def cmp_pcm( odg = odg_test - odg_ref # Todo: store both rather than difference? - msg = f"ODG: {odg}" + msg = f"Delta-ODG: {odg}" reason += " - " + msg print(msg, file=output_target) diff --git a/tests/codec_be_on_mr_nonselection/test_param_file.py b/tests/codec_be_on_mr_nonselection/test_param_file.py index 98c54b7cdb..e760edd470 100644 --- a/tests/codec_be_on_mr_nonselection/test_param_file.py +++ b/tests/codec_be_on_mr_nonselection/test_param_file.py @@ -217,6 +217,7 @@ def test_param_file_tests( get_ssnr, get_enc_stats, get_odg, + get_odg_bin, compare_to_input, compare_enc_dmx, ): @@ -248,6 +249,7 @@ def test_param_file_tests( get_ssnr, get_enc_stats, get_odg, + get_odg_bin, compare_to_input, compare_enc_dmx, ) @@ -279,6 +281,7 @@ def run_test( get_ssnr, get_enc_stats, get_odg, + get_odg_bin, compare_to_input, compare_enc_dmx, ): @@ -526,7 +529,7 @@ def run_test( odg_input = None odg_test = None odg_ref = None - if get_odg: + if get_odg_bin: # Find input format in_fmt = [(a, b) for (a, b) in INPUT_FMT if re.search(a, enc_opts)][0][1] @@ -595,6 +598,7 @@ def run_test( allow_differing_lengths=allow_differing_lengths, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, odg_input=odg_input, odg_test=odg_test, odg_ref=odg_ref, diff --git a/tests/codec_be_on_mr_nonselection/test_sba.py b/tests/codec_be_on_mr_nonselection/test_sba.py index a0c72b64f0..55c7dcf3fe 100644 --- a/tests/codec_be_on_mr_nonselection/test_sba.py +++ b/tests/codec_be_on_mr_nonselection/test_sba.py @@ -112,6 +112,7 @@ def test_pca_enc( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -195,6 +196,7 @@ def test_pca_enc( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -231,6 +233,7 @@ def test_sba_enc_system( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -372,6 +375,7 @@ def test_sba_enc_system( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -400,6 +404,7 @@ def test_spar_hoa2_enc_system( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -516,6 +521,7 @@ def test_spar_hoa2_enc_system( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -544,6 +550,7 @@ def test_spar_hoa3_enc_system( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -654,6 +661,7 @@ def test_spar_hoa3_enc_system( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -686,6 +694,7 @@ def test_sba_enc_BWforce_system( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -812,6 +821,7 @@ def test_sba_enc_BWforce_system( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -848,6 +858,7 @@ def test_sba_plc_system( abs_tol, get_ssnr, get_odg, + get_odg_bin, get_enc_stats, compare_to_input, compare_enc_dmx, @@ -951,6 +962,7 @@ def test_sba_plc_system( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, compare_to_input=compare_to_input, ) @@ -1126,6 +1138,7 @@ def sba_dec( abs_tol=0, get_ssnr=False, get_odg=False, + get_odg_bin=False, compare_to_input=False, ): dut_pkt_dir = f"{dut_base_path}/sba_bs/pkt" @@ -1198,7 +1211,7 @@ def sba_dec( odg_input = None odg_test = None odg_ref = None - if get_odg: + if get_odg_bin: enc_opts = "" dec_opts = "" input_file = f"{test_vector_path}/{tag}.wav" @@ -1249,6 +1262,7 @@ def sba_dec( allow_differing_lengths=allow_differing_lengths, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, odg_input=odg_input, odg_test=odg_test, odg_ref=odg_ref, diff --git a/tests/conftest.py b/tests/conftest.py index 853412cb18..f4c5744ca9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -59,10 +59,12 @@ from .constants import ( SSNR_PATTERN, ENC_AUX_FILES, ODG_PATTERN, + DELTA_ODG_PATTERN, MLD, MAX_ABS_DIFF, SSNR, ODG, + DELTA_ODG, MAX_ENC_DIFF, MAX_ENC_DIFF_PATTERN, ENC_CORE_OVL, @@ -222,6 +224,12 @@ def pytest_addoption(parser): help="Get Objective Difference Grade for both conditions during comparison and report difference", ) + parser.addoption( + "--odg_bin", + action="store_true", + help="Get Objective Difference Grade for both conditions during comparison and report Delta ODG for binauralized signals", + ) + parser.addoption( "--create_ref", action="store_true", @@ -350,6 +358,13 @@ def get_odg(request): """ return request.config.option.odg +@pytest.fixture(scope="session", autouse=True) +def get_odg_bin(request): + """ + Return indication to compute Delta PEAQ ODG during ref/dut comparison. Uses binauralization of input and output signals. + """ + return request.config.option.odg_bin + @pytest.fixture(scope="session") def abs_tol(request) -> int: @@ -1110,7 +1125,7 @@ def pytest_configure(config): @pytest.fixture(scope="session") def props_to_record( - request, get_mld, get_ssnr, get_odg, get_enc_stats, encoder_only + request, get_mld, get_ssnr, get_odg, get_odg_bin, get_enc_stats, encoder_only ) -> str: props = [] @@ -1170,6 +1185,10 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: max_enc_diff_param_name, _, max_enc_diff_ratio = search_result.groups(0) props[MAX_ENC_DIFF] = float(max_enc_diff_ratio) props[MAX_ENC_DIFF_PARAM_NAME] = max_enc_diff_param_name + elif prop == DELTA_ODG: + delta_odg = re.search(DELTA_ODG_PATTERN, text_to_parse) + if delta_odg: + props["DELTA_ODG"] = delta_odg.groups(0) return props diff --git a/tests/constants.py b/tests/constants.py index 865a7061a7..fbbfc30ecd 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -11,6 +11,7 @@ MLD = "MLD" MAX_ABS_DIFF = "MAXIMUM ABS DIFF" SSNR = "SSNR" ODG = "ODG" +DELTA_ODG = "Delta-ODG" MAX_ENC_DIFF = "MAXIMUM ENC DIFF" MAX_ENC_DIFF_PARAM_NAME = "MAXIMUM ENC DIFF PARAM" ENC_CORE_OVL = "ENC_CORE_OVL" @@ -25,6 +26,7 @@ MLD_PATTERN = r"MLD: ([\d\.]*)" MAX_DIFF_PATTERN = r"MAXIMUM ABS DIFF: (\d*)" ODG_PATTERN_PQEVALAUDIO = r"Objective Difference Grade: (-*\d*\.\d*)" ODG_PATTERN = r"ODG: (-*\d*\.\d*)" +DELTA_ODG_PATTERN = r"Delta-ODG: (-*\d*\.\d*)" SSNR_PATTERN = r"Channel \d* SSNR: (nan|[+-]*inf|[-*\d\.]*)" MAX_ENC_DIFF_PATTERN = r"MAXIMUM ENC DIFF: ([^ ]*) (\d+) \((\d+\.\d+)%\)" ENC_CORE_OVL_PATTERN = r"Core input overload detected: (\d+)" diff --git a/tests/renderer/test_renderer.py b/tests/renderer/test_renderer.py index bb999ba639..f1cb847a69 100644 --- a/tests/renderer/test_renderer.py +++ b/tests/renderer/test_renderer.py @@ -77,6 +77,7 @@ def test_ambisonics( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -90,6 +91,7 @@ def test_ambisonics( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -108,6 +110,7 @@ def test_ambisonics_binaural_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -121,6 +124,7 @@ def test_ambisonics_binaural_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -141,6 +145,7 @@ def test_ambisonics_binaural_headrotation( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -155,6 +160,7 @@ def test_ambisonics_binaural_headrotation( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -174,6 +180,8 @@ def test_dynamic_acoustic_environment( get_mld, get_mld_lim, get_ssnr, + get_odg, + get_odg_bin, aeid, ): rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") @@ -191,6 +199,7 @@ def test_dynamic_acoustic_environment( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, config_file=rend_config_path, aeid=aeid, ) @@ -212,6 +221,7 @@ def test_dynamic_acoustic_environment_file( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): rend_config_path = TEST_VECTOR_DIR.joinpath(f"rend_config_combined.cfg") rend_config_path.with_stem(f"rend_config") @@ -230,6 +240,7 @@ def test_dynamic_acoustic_environment_file( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, config_file=rend_config_path, aeid=aeid, ) @@ -253,6 +264,7 @@ def test_multichannel( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -266,6 +278,7 @@ def test_multichannel( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -284,6 +297,7 @@ def test_multichannel_binaural_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -300,6 +314,7 @@ def test_multichannel_binaural_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -320,6 +335,7 @@ def test_multichannel_binaural_headrotation( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): if in_fmt in ["MONO", "STEREO"]: pytest.skip("MONO or STEREO to Binaural rendering unsupported") @@ -337,6 +353,7 @@ def test_multichannel_binaural_headrotation( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -358,6 +375,7 @@ def test_ism( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -372,6 +390,7 @@ def test_ism( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -390,6 +409,7 @@ def test_ism_binaural_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] @@ -409,6 +429,7 @@ def test_ism_binaural_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -429,6 +450,7 @@ def test_ism_binaural_headrotation( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): try: in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt] @@ -449,6 +471,7 @@ def test_ism_binaural_headrotation( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -470,6 +493,7 @@ def test_masa( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -484,6 +508,7 @@ def test_masa( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -502,6 +527,7 @@ def test_masa_binaural_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -519,6 +545,7 @@ def test_masa_binaural_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -539,6 +566,7 @@ def test_masa_binaural_headrotation( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): if out_fmt in ["BINAURAL_ROOM_IR", "BINAURAL_ROOM_REVERB"]: pytest.skip("Skipping binaural room outputs for MASA as unimplemented.") @@ -557,6 +585,7 @@ def test_masa_binaural_headrotation( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -571,6 +600,7 @@ def test_masa_prerend( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -584,6 +614,7 @@ def test_masa_prerend( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -605,6 +636,7 @@ def test_custom_ls_input( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -618,6 +650,7 @@ def test_custom_ls_input( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -634,6 +667,7 @@ def test_custom_ls_output( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -646,6 +680,7 @@ def test_custom_ls_output( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -662,6 +697,7 @@ def test_custom_ls_input_output( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -674,6 +710,7 @@ def test_custom_ls_input_output( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -692,6 +729,7 @@ def test_custom_ls_input_binaural( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -705,6 +743,7 @@ def test_custom_ls_input_binaural( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -725,6 +764,7 @@ def test_custom_ls_input_binaural_headrotation( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -739,6 +779,7 @@ def test_custom_ls_input_binaural_headrotation( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -760,6 +801,7 @@ def test_metadata( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -774,6 +816,7 @@ def test_metadata( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -795,6 +838,7 @@ def test_non_diegetic_pan_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -808,6 +852,7 @@ def test_non_diegetic_pan_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) @@ -826,6 +871,7 @@ def test_non_diegetic_pan_ism_static( get_mld_lim, get_ssnr, get_odg, + get_odg_bin, ): run_renderer( record_property, @@ -839,6 +885,7 @@ def test_non_diegetic_pan_ism_static( mld_lim=get_mld_lim, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, ) -- GitLab From 95c14db4ef37e55b5ecce75749294a7ae2a75cd7 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 30 Jan 2025 09:43:03 +0100 Subject: [PATCH 02/17] Fixes for logging of Delta-ODG --- scripts/parse_xml_report.py | 7 +++++++ tests/conftest.py | 4 +++- tests/constants.py | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/parse_xml_report.py b/scripts/parse_xml_report.py index d68637c649..1f2157ca8f 100644 --- a/scripts/parse_xml_report.py +++ b/scripts/parse_xml_report.py @@ -72,6 +72,11 @@ if __name__ == "__main__": action="store_true", help="Extract clipping information. Available if encoder has been run with DEBUGGING active.", ) + parser.add_argument( + "--delta_odg", + action="store_true", + help="Extract Delta ODG information.", + ) parser.add_argument( "--skip_formats", action="store_true", @@ -90,6 +95,8 @@ if __name__ == "__main__": CATEGORIES = IVAS_CATEGORIES if args.clipping: PROPERTIES += ["ENC_CORE_OVL","MAX_OVL","MIN_OVL"] + if args.delta_odg: + PROPERTIES += ["DELTA_ODG"] if args.skip_formats: FORMATS = NO_FORMATS CATEGORIES = NO_CATEGORIES diff --git a/tests/conftest.py b/tests/conftest.py index f4c5744ca9..16cf765de1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1140,6 +1140,8 @@ def props_to_record( props.append(SSNR) if get_odg: props.append(ODG) + if get_odg_bin: + props.append(DELTA_ODG) return props @@ -1188,7 +1190,7 @@ def parse_properties(text_to_parse: str, output_differs: bool, props_to_record: elif prop == DELTA_ODG: delta_odg = re.search(DELTA_ODG_PATTERN, text_to_parse) if delta_odg: - props["DELTA_ODG"] = delta_odg.groups(0) + props["DELTA_ODG"] = delta_odg.groups(1)[0] return props diff --git a/tests/constants.py b/tests/constants.py index fbbfc30ecd..9990db37cc 100644 --- a/tests/constants.py +++ b/tests/constants.py @@ -25,8 +25,8 @@ DMX_SSNR = "DMX_SSNR" MLD_PATTERN = r"MLD: ([\d\.]*)" MAX_DIFF_PATTERN = r"MAXIMUM ABS DIFF: (\d*)" ODG_PATTERN_PQEVALAUDIO = r"Objective Difference Grade: (-*\d*\.\d*)" -ODG_PATTERN = r"ODG: (-*\d*\.\d*)" -DELTA_ODG_PATTERN = r"Delta-ODG: (-*\d*\.\d*)" +ODG_PATTERN = r"(? Date: Thu, 30 Jan 2025 09:52:40 +0100 Subject: [PATCH 03/17] Fix test_enc_passthrough.py --- tests/test_enc_passthrough.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_enc_passthrough.py b/tests/test_enc_passthrough.py index 509f5e3c3e..128b680d8b 100644 --- a/tests/test_enc_passthrough.py +++ b/tests/test_enc_passthrough.py @@ -194,7 +194,9 @@ def test_enc( get_ssnr, get_enc_stats, get_odg, + get_odg_bin, compare_to_input, + compare_enc_dmx, ): enc_opts, dec_opts, sim_opts, eid_opts = test_dict[test_tag] @@ -225,7 +227,9 @@ def test_enc( get_ssnr, get_enc_stats, get_odg, + get_odg_bin, compare_to_input, + compare_enc_dmx, ) \ No newline at end of file -- GitLab From 845c28b1ed0e9da2825f68bedfe398aabd7d3bd9 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 30 Jan 2025 12:04:11 +0100 Subject: [PATCH 04/17] Fix summary creation script wrt DELTA_ODG --- ci/basop-pages/create_summary_page.py | 2 +- scripts/create_histogram_summary.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/basop-pages/create_summary_page.py b/ci/basop-pages/create_summary_page.py index 1f146c4cbb..f8ddb00ae8 100644 --- a/ci/basop-pages/create_summary_page.py +++ b/ci/basop-pages/create_summary_page.py @@ -2,7 +2,7 @@ import argparse from create_report_pages import SUBPAGE_TMPL_CSS, FORMATS -MEASURES = ["MLD","DIFF","SSNR","ODG"] +MEASURES = ["MLD","DIFF","SSNR","ODG","DELTA_ODG"] SUMMARY_PAGE_TMPL_HTML = """ diff --git a/scripts/create_histogram_summary.py b/scripts/create_histogram_summary.py index 0b10b76b8d..af9a11de2a 100644 --- a/scripts/create_histogram_summary.py +++ b/scripts/create_histogram_summary.py @@ -75,6 +75,7 @@ if __name__ == "__main__": "DIFF": ("MAXIMUM ABS DIFF", None), "SSNR": ("MIN_SSNR", None), "ODG": ("MIN_ODG", None), + "DELTA_ODG": ("DELTA_ODG", None), } else: limits_per_measure = { @@ -82,6 +83,7 @@ if __name__ == "__main__": "DIFF": ("MAXIMUM ABS DIFF", [0, 16, 256, 1024, 2048, 4096, 8192, 16384, 32769]), "SSNR": ("MIN_SSNR", [-math.inf, 0, 10, 20, 30, 40, 40, 50, 60, 100]), "ODG": ("MIN_ODG", [-5, -2, -1, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.5]), + "DELTA_ODG": ("DELTA_ODG", [-5, -2, -1, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.5]), } (measure_label, limits) = limits_per_measure[measure] -- GitLab From 898b878ba4c66525507406b4a84e68413c8b8b98 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 30 Jan 2025 15:13:01 +0100 Subject: [PATCH 05/17] Fix in renderer/utils.py for get_odg_bin --- tests/renderer/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 13e449bc1c..466b7c346a 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -168,6 +168,7 @@ def run_renderer( abs_tol=0, get_ssnr=False, get_odg=False, + get_odg_bin=False, aeid: Optional[Union[Path, int]] = None, in_file=None, out_file=None, @@ -319,7 +320,7 @@ def run_renderer( odg_input = None odg_test = None odg_ref = None - if get_odg: + if get_odg_bin: odg_input = out_file_ref[0:-4] + ".INPUT.BINAURAL.wav" odg_test = str(out_file)[0:-4] + ".BINAURAL.wav" odg_ref = out_file_ref[0:-4] + ".BINAURAL.wav" @@ -383,6 +384,7 @@ def run_renderer( abs_tol=abs_tol, get_ssnr=get_ssnr, get_odg=get_odg, + get_odg_bin=get_odg_bin, odg_input=odg_input, odg_test=odg_test, odg_ref=odg_ref, -- GitLab From 3076b699549ed8689e7eaf4944005a1b6dac2ff0 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Thu, 30 Jan 2025 16:05:49 +0100 Subject: [PATCH 06/17] Add object editing to unsupported test cases --- ci/remove_unsupported_testcases.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci/remove_unsupported_testcases.py b/ci/remove_unsupported_testcases.py index b316a417e5..7eb13492dc 100644 --- a/ci/remove_unsupported_testcases.py +++ b/ci/remove_unsupported_testcases.py @@ -66,6 +66,23 @@ TESTCASES = [ "MASA 1TC at 256kbps, 48kHz in, 48 kHz out, BINAURAL_ROOM_REVERB out custom configuration", "MASA 1TC at 256 kbps, 48kHz in, 48kHz out, BINAURAL_ROOM_REVERB out, HR custom configuration", "OMASA 2TC 4ISM at br sw techs 13.2 to 512 kbps start 80 kbps, 48kHz in, 48kHz out, EXT out", + "OMASA 2Dir2TC 4ISM at 80 kbps, 48kHz in, 48kHz out, BINAURAL out, default object editing, 1SEP-PARAM", + "OMASA 2Dir2TC 4ISM at 256 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing, JBM Prof 5, DISC", + "OMASA 2Dir2TC 2ISM at 96 kbps, 48kHz in, 48kHz out, FOA out, object editing, JBM Prof 5, DISC", + "OMASA 2Dir2TC 2ISM br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing", + "OSBA 3OA 4ISM at 256 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing, DISC", + "OSBA 2OA 3ISM at 128 kbps, 48kHz in, 48kHz out, FOA out, object editing, JBM Prof 5, DISC", + "OSBA 2OA 3ISM at bitrate switching 13.2 to 512 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing", + "4 ISM with metadata at 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, object editing, PARAM_ISM", + "4 ISM with metadata at 128 kbps, 48 kHz in, 48 kHz out, BINAURAL out, object editing, DISC", + "3 ISM with metadata at 24.4 kbps, 48 kHz in, 48 kHz out, FOA out, object editing, JBM Prof 5, PARAM_ISM", + "3 ISM with metadata at 384 kbps, 48 kHz in, 48 kHz out, FOA out, object editing, JBM Prof 5, DISC", + "4 ISM with metadata bitrate switching from 32 kbps to 48 kbps, 48 kHz in, 48 kHz out, BINAURAL_ROOM_IR out, object editing", + "4 ISM with metadata bitrate switching from 48 kbps to 32 kbps, 48 kHz in, 48 kHz out, BINAURAL out, object editing, JBM Prof 5", + "OMASA 2TC 4ISM at 80 kbps, 48kHz in, 48kHz out, BINAURAL out, default object editing, 1SEP-PARAM", + "OMASA 2TC 4ISM at 256 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing, JBM Prof 5, DISC", + "OMASA 2TC 2ISM at 96 kbps, 48kHz in, 48kHz out, FOA out, object editing, JBM Prof 5, DISC", + "OMASA 2TC 2ISM br sw techs 13.2 to 512 kbps start 48 kbps, 48kHz in, 48kHz out, BINAURAL out, object editing", ] -- GitLab From 173ffbdf23753f47f49c0b9668d47c48d2540f56 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Fri, 31 Jan 2025 13:34:12 +0100 Subject: [PATCH 07/17] support enforcement of TCX10 and TCX20 modes --- scripts/create_mode_force.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create_mode_force.py b/scripts/create_mode_force.py index fe87f7fdce..e607c1a8f3 100644 --- a/scripts/create_mode_force.py +++ b/scripts/create_mode_force.py @@ -35,8 +35,8 @@ import struct MODES = { 0: "1 ACELP\n", - 1: "1 TCX\n", - 2: "1 TCX\n", # Current -force option does not distinguish between TCX10 and TCX20 + 1: "1 TCX10\n", + 2: "1 TCX20\n", 3: "1 HQ\n", } SR = [16, 32, 48] -- GitLab From eb96c3a48be9a34284316f91b42db7e452bf333d Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 3 Feb 2025 14:21:41 +0100 Subject: [PATCH 08/17] Add check for run errors in renderer tests --- tests/conftest.py | 8 ++++++-- tests/renderer/utils.py | 15 +++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 1fd5486417..3a0244adf6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -409,9 +409,13 @@ def dut_encoder_path(request) -> str: # fixture returns test information, enabling per-testcase SNR -@pytest.fixture +@pytest.fixture(scope="function") def test_info(request): - return request + yield request + + # Check for errors during teardown to report error instead of failure + if hasattr(request, "error"): + pytest.fail(request.error) class EncoderFrontend: diff --git a/tests/renderer/utils.py b/tests/renderer/utils.py index 13e449bc1c..c65ef85c05 100644 --- a/tests/renderer/utils.py +++ b/tests/renderer/utils.py @@ -64,14 +64,13 @@ from ..cmp_pcm import cmp_pcm from ..conftest import parse_properties -def run_cmd(cmd, env=None): +def run_cmd(cmd, test_info, env=None): logging.info(f"\nRunning command\n{' '.join(cmd)}\n") try: sp.run(cmd, check=True, capture_output=True, text=True, env=env) except sp.CalledProcessError as e: - raise SystemError( - f"Command returned non-zero exit status ({e.returncode}): {' '.join(e.cmd)}\n{e.stderr}\n{e.stdout}" - ) + test_info.error = f"Command returned non-zero exit status ({e.returncode}): {' '.join(e.cmd)}\n{e.stderr}\n{e.stdout}" + raise SystemError(test_info.error) def run_isar_ext_rend_cmd(cmd, env=None): @@ -309,7 +308,7 @@ def run_renderer( ) # run the renderer - run_cmd(cmd, env) + run_cmd(cmd, test_info, env) if test_info.config.option.create_cut and not render_for_peaq: # CUT creation mode will run a comparison with REF @@ -349,12 +348,12 @@ def run_renderer( cmd2[0] += binary_suffix if "MASA" in str(out_fmt): cmd2.extend(["-im", out_file + ".met"]) - run_cmd(cmd2, env) + run_cmd(cmd2, test_info, env) # Render ref to BINAURAL with same settings as test cmd2[2] = str(out_file_ref) # in_file cmd2[6] = odg_ref # out_file - run_cmd(cmd2, env) + run_cmd(cmd2, test_info, env) out_fmt_bin = new_fmt else: out_fmt_bin = out_fmt @@ -367,7 +366,7 @@ def run_renderer( cmd[0] += binary_suffix cmd[6] = odg_input # out_file cmd[8] = out_fmt_bin # out_fmt - run_cmd(cmd, env) + run_cmd(cmd, test_info, env) else: odg_input = in_file -- GitLab From 436a28dcb2aba6524aafe4cc00eaefa51ef1a69f Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 3 Feb 2025 14:34:50 +0100 Subject: [PATCH 09/17] Fix calls to run_cmd --- tests/hrtf_binary_loading/utils.py | 6 ++++-- tests/split_rendering/utils.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 4e74a32f7f..9346422c13 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -46,6 +46,7 @@ import pyaudio3dtools def run_encoder( + test_info, bitrate: int, sampling_rate: int, input_file: str, @@ -88,10 +89,11 @@ def run_encoder( str(output_file), ] - run_cmd(cmd) + run_cmd(cmd, test_info) def run_decoder( + test_info, output_config: str, output_sampling_rate: int, input_bitstream_path: Path, @@ -125,7 +127,7 @@ def run_decoder( str(output_path), ] - run_cmd(cmd) + run_cmd(cmd, test_info) def get_option_list_str(option_list): diff --git a/tests/split_rendering/utils.py b/tests/split_rendering/utils.py index bb826752ad..504929b29a 100644 --- a/tests/split_rendering/utils.py +++ b/tests/split_rendering/utils.py @@ -39,7 +39,7 @@ from typing import Tuple import numpy as np import pytest -from tests.renderer.utils import check_BE, run_cmd, run_ivas_isar_enc_cmd, run_ivas_isar_dec_cmd, run_isar_post_rend_cmd, run_isar_ext_rend_cmd +from tests.renderer.utils import check_BE, run_ivas_isar_enc_cmd, run_ivas_isar_dec_cmd, run_isar_post_rend_cmd, run_isar_ext_rend_cmd from tests.split_rendering.constants import * sys.path.append(SCRIPTS_DIR) -- GitLab From a1094ee8a5f7f640923c4602a3628632e21d2c71 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 3 Feb 2025 14:49:03 +0100 Subject: [PATCH 10/17] Fix for run_encoder related to renderer error reporting --- tests/hrtf_binary_loading/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 9346422c13..c85c94d163 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -306,7 +306,7 @@ def compare_rom_vs_binary( input_path = TESTV_DIR.joinpath(in_file).with_suffix(".wav") bitstream_path = BITSTREAM_DIR.joinpath(in_file + file_ext) run_encoder( - bitrate, in_fs, input_path, bitstream_path, add_option_list=option_list_enc + test_info, bitrate, in_fs, input_path, bitstream_path, add_option_list=option_list_enc ) if trj_file is not None: -- GitLab From 6f4f7ee2277c6767b2087db9b5ce3915e47c4d90 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 3 Feb 2025 16:22:40 +0100 Subject: [PATCH 11/17] Fix in tests/hrtf_binary_loading/utils.py for renderer error reporting --- tests/hrtf_binary_loading/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index c85c94d163..8738377a90 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -316,7 +316,7 @@ def compare_rom_vs_binary( option_list_dec = None out_rom_path = DEC_ROM_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( - out_fmt, out_fs, bitstream_path, out_rom_path, add_option_list=option_list_dec + test_info, out_fmt, out_fs, bitstream_path, out_rom_path, add_option_list=option_list_dec ) out_rom, out_rom_fs = pyaudio3dtools.audiofile.readfile(out_rom_path) -- GitLab From 1cf479e793e396e3dcaea9b7bffe26898ae467b7 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 3 Feb 2025 21:23:06 +0100 Subject: [PATCH 12/17] Another fix for renderer error report --- tests/hrtf_binary_loading/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hrtf_binary_loading/utils.py b/tests/hrtf_binary_loading/utils.py index 8738377a90..0e9c5e5820 100644 --- a/tests/hrtf_binary_loading/utils.py +++ b/tests/hrtf_binary_loading/utils.py @@ -328,7 +328,7 @@ def compare_rom_vs_binary( out_bin_path = DEC_BINARY_DIR.joinpath(in_file + file_ext).with_suffix(".wav") run_decoder( - out_fmt, out_fs, bitstream_path, out_bin_path, add_option_list=option_list_dec + test_info, out_fmt, out_fs, bitstream_path, out_bin_path, add_option_list=option_list_dec ) out_bin, out_bin_fs = pyaudio3dtools.audiofile.readfile(out_bin_path) -- GitLab From e68639e25ae1abeb41e77fa2606cf1e618a5ac70 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 3 Feb 2025 22:22:48 +0100 Subject: [PATCH 13/17] [cleanup] accept NONBE_1215_FIX_JBM_MAX_SCALING --- lib_com/options.h | 1 - lib_dec/jbm_jb4sb.c | 8 -------- 2 files changed, 9 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 754937c540..7f09dc9be2 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -170,7 +170,6 @@ /* all switches in this category should start with "NONBE_" */ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ -#define NONBE_1215_FIX_JBM_MAX_SCALING /* FhG: issue 1215: Fix assert hit in a specific VoIP decoder config. Caused by integer overflow in max scaling calculation. */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ #define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ #define NONBE_FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ diff --git a/lib_dec/jbm_jb4sb.c b/lib_dec/jbm_jb4sb.c index 8b8f467d38..0c85220ad5 100644 --- a/lib_dec/jbm_jb4sb.c +++ b/lib_dec/jbm_jb4sb.c @@ -811,15 +811,11 @@ static void JB4_adaptActivePlayout( ( dropRateMax - dropRateMin ) / dropGapMax + dropRateMin; *scale = ( 1000 - rate ) / 10; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( currPlayoutDelay - targetMax, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = currPlayoutDelay - targetMax; -#endif } } } @@ -835,15 +831,11 @@ static void JB4_adaptActivePlayout( currPlayoutDelay < targetMaxStretch && currPlayoutDelay < (uint32_t) ( 110 + h->rfDelay / 4 ) ) { *scale = 120; -#ifdef NONBE_1215_FIX_JBM_MAX_SCALING /* Limit max scaling to the duration of one frame. APA will not exceed this limit * anyway due to the 50% limitation of APA_MIN_SCALE and APA_MAX_SCALE. Limiting * the value to a sensible range here avoids integer overflows at later stages when * converting maxScaling from milliseconds to samples. */ *maxScaling = JB4_MIN( targetMaxStretch - currPlayoutDelay, 1000 / IVAS_NUM_FRAMES_PER_SEC ); -#else - *maxScaling = targetMaxStretch - currPlayoutDelay; -#endif } } -- GitLab From dea809b955383646f56aa99150c97be5f2e1e79d Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 3 Feb 2025 22:24:12 +0100 Subject: [PATCH 14/17] [cleanup] accept NONBE_FIX_1189_GSC_IVAS_OMASA --- lib_com/options.h | 1 - lib_dec/acelp_core_dec.c | 4 ---- 2 files changed, 5 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index 7f09dc9be2..b826ffce40 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,6 @@ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ #define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ -#define NONBE_FIX_1189_GSC_IVAS_OMASA /* VA: Fix for issue 1189: Bitstream desynchornization due to reading/writing of the GSC_IVAS_mode parameter */ #define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ diff --git a/lib_dec/acelp_core_dec.c b/lib_dec/acelp_core_dec.c index 0bba174b7c..b83c105064 100644 --- a/lib_dec/acelp_core_dec.c +++ b/lib_dec/acelp_core_dec.c @@ -483,11 +483,7 @@ ivas_error acelp_core_dec( if ( st->element_mode > EVS_MONO && st->idchan == 0 && !( st->core_brate == FRAME_NO_DATA || st->core_brate == SID_2k40 ) && !tdm_low_rate_mode ) { -#ifdef NONBE_FIX_1189_GSC_IVAS_OMASA if ( st->coder_type == AUDIO || ( st->coder_type == INACTIVE && st->inactive_coder_type_flag ) ) -#else - if ( st->coder_type == AUDIO || ( st->coder_type == INACTIVE && st->total_brate <= MAX_GSC_INACTIVE_BRATE ) ) -#endif { st->GSC_IVAS_mode = get_next_indice( st, 2 ); } -- GitLab From 7a214523a7a5e7e2912cf36b96f4d4595be487d8 Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 3 Feb 2025 22:25:01 +0100 Subject: [PATCH 15/17] [cleanup] accept NONBE_1214_PLC_LSF_MEMORY --- lib_com/options.h | 1 - lib_dec/core_switching_dec.c | 5 ----- lib_enc/core_switching_enc.c | 4 ---- 3 files changed, 10 deletions(-) diff --git a/lib_com/options.h b/lib_com/options.h index b826ffce40..8c96b33c9a 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,6 @@ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ #define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ -#define NONBE_1214_PLC_LSF_MEMORY /* VA: issue 1224: reset ACELP PLC FEC memory in case of switching from MDCT stereo to TD/DFT stereo */ #define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ /* ##################### End NON-BE switches ########################### */ diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index 686e5926db..dba82a0dcb 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -263,14 +263,9 @@ ivas_error core_switching_pre_dec( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && nchan_out == 2 && - st->core_brate != SID_2k40 && st->core_brate != FRAME_NO_DATA && ( last_core_brate_st0 == FRAME_NO_DATA || last_core_brate_st0 == SID_2k40 ) ) ) -#endif { if ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD ) { diff --git a/lib_enc/core_switching_enc.c b/lib_enc/core_switching_enc.c index c4a8f8bd52..c588173d3f 100644 --- a/lib_enc/core_switching_enc.c +++ b/lib_enc/core_switching_enc.c @@ -171,13 +171,9 @@ void core_switching_pre_enc( st->uv_count = 0; } -#ifdef NONBE_1214_PLC_LSF_MEMORY if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) /* EVS and HQ -> ACELP */ || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) || ( st->core == ACELP_CORE && st->last_L_frame > L_FRAME16k ) /* TCX @ 25.6/32 kHz -> ACELP */ ) -#else - if ( ( ( st->core == ACELP_CORE || st->core == AMR_WB_CORE ) && st->last_core == HQ_CORE ) || ( ( st->element_mode == IVAS_CPE_DFT || st->element_mode == IVAS_CPE_TD || ( st->element_mode == IVAS_CPE_MDCT && last_element_mode == IVAS_CPE_DFT ) ) && active_cnt == 1 ) ) -#endif { /* Reset the ACELP core in case of HQ->ACELP core switching */ -- GitLab From 10b2039e6b28364019d076986e8a4b00a3e70ccc Mon Sep 17 00:00:00 2001 From: Markus Multrus Date: Mon, 3 Feb 2025 22:26:03 +0100 Subject: [PATCH 16/17] [cleanup] accept NONBE_FIX_1261_MASA_EXT_META_JBM --- apps/decoder.c | 7 ------- lib_com/options.h | 1 - 2 files changed, 8 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index ce04fa923e..9f657b5a8c 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -1999,7 +1999,6 @@ static ivas_error initOnFirstGoodFrame( if ( numInitialBadFrames > 0 ) { /* Duplicate good first frame metadata to fill the beginning of stream. */ -#ifdef NONBE_FIX_1261_MASA_EXT_META_JBM int16_t fullDelayNumSamplesLocal[3]; int32_t delayTimeScaleLocal; float delayMs; @@ -2012,9 +2011,6 @@ static ivas_error initOnFirstGoodFrame( fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) ); } delayMs = (float) ( fullDelayNumSamplesLocal[0] ) / (float) ( delayTimeScaleLocal ); -#else - IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL; -#endif if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK ) { @@ -2024,9 +2020,6 @@ static ivas_error initOnFirstGoodFrame( for ( int16_t j = 0; j < numInitialBadFrames; ++j ) { -#ifndef NONBE_FIX_1261_MASA_EXT_META_JBM - float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale ); -#endif if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) ); diff --git a/lib_com/options.h b/lib_com/options.h index 8c96b33c9a..959eecf6ab 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -172,7 +172,6 @@ #define NONBE_1217_OBJ_EDIT_FOA /* VA/Nokia: isse 1217: fix crash in object editing to FOA output in ParamISM */ #define NONBE_FIX_1255_OBJ_EDIT_JBM /* VA: issue 1255: restore object editing in JBM */ #define NONBE_FIX_1262_OSBA_STEREO /* FhG: issue 1262: Fix missing scaling factor for OSBA stereo output */ -#define NONBE_FIX_1261_MASA_EXT_META_JBM /* Nokia: issue #1261: MASA metadata EXT output delay buffer init in JBM */ /* ##################### End NON-BE switches ########################### */ -- GitLab From 1d027f9fcc2644d1b81e1c363511b1112efe013c Mon Sep 17 00:00:00 2001 From: norvell Date: Tue, 4 Feb 2025 10:15:03 +0000 Subject: [PATCH 17/17] Correct mapping of TCX10/TCX20 in create_mode_force.py --- scripts/create_mode_force.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/create_mode_force.py b/scripts/create_mode_force.py index e607c1a8f3..6a0a6f76e3 100644 --- a/scripts/create_mode_force.py +++ b/scripts/create_mode_force.py @@ -35,8 +35,8 @@ import struct MODES = { 0: "1 ACELP\n", - 1: "1 TCX10\n", - 2: "1 TCX20\n", + 1: "1 TCX20\n", + 2: "1 TCX10\n", 3: "1 HQ\n", } SR = [16, 32, 48] -- GitLab