From f1889790d04157935ad7be6e571d94012c96ab4b Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 4 Dec 2025 11:57:41 +0100 Subject: [PATCH 1/3] generate mono short vectors in _cut format --- tests/create_short_testvectors.py | 2 +- tests/rtp/test_format_switching.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index 184386bc27..c43d20865e 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -39,7 +39,7 @@ import sys import logging from pathlib import Path -from cut_pcm import cut_samples +from .cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() diff --git a/tests/rtp/test_format_switching.py b/tests/rtp/test_format_switching.py index 43daaa3da7..6722f8a3d8 100644 --- a/tests/rtp/test_format_switching.py +++ b/tests/rtp/test_format_switching.py @@ -117,7 +117,7 @@ def test_format_switching_new_encoder ( cut_suffix = "_cut.wav" test_file = Path( str(FORMAT_TO_FILE_COMPARETEST["MONO"]).replace(".wav", cut_suffix) ) if not test_file.exists(): - create_short_testvectors(1.0, False, None) + create_short_testvectors(1.0, False, None, all=True) with TemporaryDirectory() as tmp_dir: -- GitLab From 532284b08ddc582c92832de5eaec16c75e7b68f3 Mon Sep 17 00:00:00 2001 From: Vladimir Malenovsky Date: Thu, 4 Dec 2025 14:34:05 +0100 Subject: [PATCH 2/3] fix Python reference --- tests/create_short_testvectors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index c43d20865e..e0d344eef7 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -39,7 +39,7 @@ import sys import logging from pathlib import Path -from .cut_pcm import cut_samples +from tests.cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() -- GitLab From bc29359c6662402700498484985f3f4a37511820 Mon Sep 17 00:00:00 2001 From: Lauros Pajunen Date: Fri, 5 Dec 2025 09:57:55 +0200 Subject: [PATCH 3/3] Remove 1s file generation from format switch test script, clean up --- tests/create_short_testvectors.py | 2 +- tests/rtp/test_format_switching.py | 16 +--------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/tests/create_short_testvectors.py b/tests/create_short_testvectors.py index e0d344eef7..184386bc27 100755 --- a/tests/create_short_testvectors.py +++ b/tests/create_short_testvectors.py @@ -39,7 +39,7 @@ import sys import logging from pathlib import Path -from tests.cut_pcm import cut_samples +from cut_pcm import cut_samples HERE = Path(__file__).parent.resolve() TEST_VECTOR_DIR = HERE.joinpath("../scripts/testv").resolve() diff --git a/tests/rtp/test_format_switching.py b/tests/rtp/test_format_switching.py index 6722f8a3d8..4bbc4fa6db 100644 --- a/tests/rtp/test_format_switching.py +++ b/tests/rtp/test_format_switching.py @@ -34,27 +34,19 @@ __doc__ = """ To configure test modules. """ -import pytest -import csv import os import sys -import random - from tempfile import TemporaryDirectory from pathlib import Path -import soundfile as sf -import numpy as np ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) sys.path.append(ROOT_DIR) from tests.conftest import EncoderFrontend, DecoderFrontend -from tests.create_short_testvectors import create_short_testvectors from tests.renderer.constants import ( FORMAT_TO_FILE_COMPARETEST, FORMAT_TO_METADATA_FILES, ) -from ivasrtp import * import platform BIN_EXT = ".exe" if platform.system() == "Windows" else "" @@ -104,8 +96,8 @@ def test_format_switching_new_encoder ( ): bitrate = 48000 fs = 48 - bandwidth = "FB" outMode = "" + cut_suffix = "_cut.wav" dut_encoder_path = Path(ROOT_DIR).joinpath(f"IVAS_cod{BIN_EXT}") dut_encoder_fmtsw_path = Path(ROOT_DIR).joinpath(f"IVAS_cod_fmtsw{BIN_EXT}") @@ -113,12 +105,6 @@ def test_format_switching_new_encoder ( dut_encoder_fmtsw_path, "DUT", record_property ) - # Create 1s test files - cut_suffix = "_cut.wav" - test_file = Path( str(FORMAT_TO_FILE_COMPARETEST["MONO"]).replace(".wav", cut_suffix) ) - if not test_file.exists(): - create_short_testvectors(1.0, False, None, all=True) - with TemporaryDirectory() as tmp_dir: # Create file for encoding commands -- GitLab