Loading .gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -1357,6 +1357,7 @@ ivas-conformance: - 123 script: - *print-common-info-windows - *copy-ltv-files-to-testv-dir - python .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - cp -force IVAS_cod.exe IVAS_cod_ref.exe Loading tests/codec_be_on_mr_nonselection/test_sba_ext.py 0 → 100644 +159 −0 Original line number Diff line number Diff line __copyright__ = """ (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other contributors to this repository. All Rights Reserved. This software is protected by copyright law and by international treaties. The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other contributors to this repository retain full ownership rights in their respective contributions in the software. This notice grants no license of any kind, including but not limited to patent license, nor is any license granted by implication, estoppel or otherwise. Contributors are required to enter into the IVAS codec Public Collaboration agreement before making contributions. This software is provided "AS IS", without any express or implied warranties. The software is in the development stage. It is intended exclusively for experts who have experience with such software and solely for the purpose of inspection. All implied warranties of non-infringement, merchantability and fitness for a particular purpose are hereby disclaimed and excluded. Any dispute, controversy or claim arising under or in relation to providing this software shall be submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and the United Nations Convention on Contracts on the International Sales of Goods. """ __doc__ = """ Test decoding SBA bitstreams for external output. Bitstreams """ import os import pytest from tests.conftest import DecoderFrontend, EncoderFrontend from cut_bs import cut_from_start from tests.cmp_pcm import cmp_pcm # params # test vector file names are of the format ltv48_<FOA|HOA2|HOA3>.wav sba_orders = ["FOA", "HOA2", "HOA3"] bitrate_list = [13200, 16400, 24400, 32000, 48000, 64000,80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000] AbsTol = "0" def check_and_makedir(dir_path): if not os.path.exists(dir_path): try: os.makedirs(dir_path) except OSError as e: if e.errno != errno.EEXIST: raise # raises the error again @pytest.mark.create_ref @pytest.mark.parametrize("sba_order", sba_orders) @pytest.mark.parametrize("bitrate", bitrate_list) def test_sba_ext_ctx( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): core_sba_ext_test_func(ref_encoder_frontend, ref_decoder_frontend, dut_decoder_frontend, sba_order, bitrate, False, False, test_vector_path, reference_path, dut_base_path,update_ref, keep_files) @pytest.mark.create_ref @pytest.mark.parametrize("sba_order", sba_orders) @pytest.mark.parametrize("sid_first", [True, False]) @pytest.mark.parametrize("bitrate", [r for r in bitrate_list if r < 96000]) # dtx is not supported above 80kbps def test_sba_ext_dtx( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, sid_first, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): core_sba_ext_test_func(ref_encoder_frontend, ref_decoder_frontend, dut_decoder_frontend, sba_order, bitrate, True, sid_first, test_vector_path, reference_path, dut_base_path,update_ref, keep_files) def core_sba_ext_test_func( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, dtx, sid_first, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): dec_in_dir = f"{reference_path}/sba_ext/pkt" check_and_makedir(dec_in_dir) ref_wav_dir = dec_in_dir.replace("pkt", "raw") check_and_makedir(ref_wav_dir) dut_wav_dir = ref_wav_dir.replace(reference_path, dut_base_path) check_and_makedir(dut_wav_dir) fn_core = f"ltv48_{sba_order}_{bitrate}" if dtx: fn_core += "_dtx" if sid_first: fn_core += "_sidfirst_cut" dec_in_path = f"{dec_in_dir}/{fn_core}.g192" dut_wav_path = dec_in_path.replace(dec_in_dir, dut_wav_dir).replace(".g192", ".wav") ref_wav_path = dut_wav_path.replace(dut_wav_dir, ref_wav_dir) print(ref_wav_path) out_config = "" enc_sba_order = "" match sba_order: case "FOA": enc_sba_order = "+1" out_config = "FOA" case "HOA2": enc_sba_order = "+2" out_config = "HOA2" case "HOA3": enc_sba_order = "+3" out_config = "HOA3" case _: print(f"Unsupported SBA order: {sba_order}") assert(False) if update_ref == 1: input_path = f"{test_vector_path}/ltv48_{sba_order}.wav" enc_out_path = dec_in_path.replace('_cut', '') ref_encoder_frontend.run(bitrate, 48, input_path, enc_out_path, enc_sba_order, dtx_mode=dtx) if sid_first: with open(enc_out_path, "rb") as fp_in: with open(dec_in_path, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) assert fr_cnt > cut_cnt if keep_files == 0: os.remove(enc_out_path) ref_decoder_frontend.run(out_config, 48, dec_in_path, ref_wav_path) else: dut_decoder_frontend.run("EXT", 48, dec_in_path, dut_wav_path) cmp_result, reason = cmp_pcm(ref_wav_path, dut_wav_path, out_config, 48000, abs_tol=AbsTol) assert(cmp_result == 0) assert(True) if keep_files == 0: os.remove(dut_wav_path) Loading
.gitlab-ci.yml +1 −0 Original line number Diff line number Diff line Loading @@ -1357,6 +1357,7 @@ ivas-conformance: - 123 script: - *print-common-info-windows - *copy-ltv-files-to-testv-dir - python .\scripts\strip_split_rendering.py - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug - cp -force IVAS_cod.exe IVAS_cod_ref.exe Loading
tests/codec_be_on_mr_nonselection/test_sba_ext.py 0 → 100644 +159 −0 Original line number Diff line number Diff line __copyright__ = """ (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other contributors to this repository. All Rights Reserved. This software is protected by copyright law and by international treaties. The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other contributors to this repository retain full ownership rights in their respective contributions in the software. This notice grants no license of any kind, including but not limited to patent license, nor is any license granted by implication, estoppel or otherwise. Contributors are required to enter into the IVAS codec Public Collaboration agreement before making contributions. This software is provided "AS IS", without any express or implied warranties. The software is in the development stage. It is intended exclusively for experts who have experience with such software and solely for the purpose of inspection. All implied warranties of non-infringement, merchantability and fitness for a particular purpose are hereby disclaimed and excluded. Any dispute, controversy or claim arising under or in relation to providing this software shall be submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and the United Nations Convention on Contracts on the International Sales of Goods. """ __doc__ = """ Test decoding SBA bitstreams for external output. Bitstreams """ import os import pytest from tests.conftest import DecoderFrontend, EncoderFrontend from cut_bs import cut_from_start from tests.cmp_pcm import cmp_pcm # params # test vector file names are of the format ltv48_<FOA|HOA2|HOA3>.wav sba_orders = ["FOA", "HOA2", "HOA3"] bitrate_list = [13200, 16400, 24400, 32000, 48000, 64000,80000, 96000, 128000, 160000, 192000, 256000, 384000, 512000] AbsTol = "0" def check_and_makedir(dir_path): if not os.path.exists(dir_path): try: os.makedirs(dir_path) except OSError as e: if e.errno != errno.EEXIST: raise # raises the error again @pytest.mark.create_ref @pytest.mark.parametrize("sba_order", sba_orders) @pytest.mark.parametrize("bitrate", bitrate_list) def test_sba_ext_ctx( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): core_sba_ext_test_func(ref_encoder_frontend, ref_decoder_frontend, dut_decoder_frontend, sba_order, bitrate, False, False, test_vector_path, reference_path, dut_base_path,update_ref, keep_files) @pytest.mark.create_ref @pytest.mark.parametrize("sba_order", sba_orders) @pytest.mark.parametrize("sid_first", [True, False]) @pytest.mark.parametrize("bitrate", [r for r in bitrate_list if r < 96000]) # dtx is not supported above 80kbps def test_sba_ext_dtx( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, sid_first, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): core_sba_ext_test_func(ref_encoder_frontend, ref_decoder_frontend, dut_decoder_frontend, sba_order, bitrate, True, sid_first, test_vector_path, reference_path, dut_base_path,update_ref, keep_files) def core_sba_ext_test_func( ref_encoder_frontend: EncoderFrontend, ref_decoder_frontend: DecoderFrontend, dut_decoder_frontend: DecoderFrontend, sba_order, bitrate, dtx, sid_first, test_vector_path, reference_path, dut_base_path, update_ref, keep_files ): dec_in_dir = f"{reference_path}/sba_ext/pkt" check_and_makedir(dec_in_dir) ref_wav_dir = dec_in_dir.replace("pkt", "raw") check_and_makedir(ref_wav_dir) dut_wav_dir = ref_wav_dir.replace(reference_path, dut_base_path) check_and_makedir(dut_wav_dir) fn_core = f"ltv48_{sba_order}_{bitrate}" if dtx: fn_core += "_dtx" if sid_first: fn_core += "_sidfirst_cut" dec_in_path = f"{dec_in_dir}/{fn_core}.g192" dut_wav_path = dec_in_path.replace(dec_in_dir, dut_wav_dir).replace(".g192", ".wav") ref_wav_path = dut_wav_path.replace(dut_wav_dir, ref_wav_dir) print(ref_wav_path) out_config = "" enc_sba_order = "" match sba_order: case "FOA": enc_sba_order = "+1" out_config = "FOA" case "HOA2": enc_sba_order = "+2" out_config = "HOA2" case "HOA3": enc_sba_order = "+3" out_config = "HOA3" case _: print(f"Unsupported SBA order: {sba_order}") assert(False) if update_ref == 1: input_path = f"{test_vector_path}/ltv48_{sba_order}.wav" enc_out_path = dec_in_path.replace('_cut', '') ref_encoder_frontend.run(bitrate, 48, input_path, enc_out_path, enc_sba_order, dtx_mode=dtx) if sid_first: with open(enc_out_path, "rb") as fp_in: with open(dec_in_path, "wb") as fp_out: fr_cnt, cut_cnt = cut_from_start(fp_in, fp_out, 0, True) assert fr_cnt > cut_cnt if keep_files == 0: os.remove(enc_out_path) ref_decoder_frontend.run(out_config, 48, dec_in_path, ref_wav_path) else: dut_decoder_frontend.run("EXT", 48, dec_in_path, dut_wav_path) cmp_result, reason = cmp_pcm(ref_wav_path, dut_wav_path, out_config, 48000, abs_tol=AbsTol) assert(cmp_result == 0) assert(True) if keep_files == 0: os.remove(dut_wav_path)