Commit a6a6fafe authored by BOHMRR's avatar BOHMRR
Browse files

try cut_samples as preprocess step to avoid race condition

parent 410b7e00
Loading
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ import subprocess
import platform
from pathlib import Path

sys.path.append('scripts/ivas_pytests/tests/')
from cut_pcm import cut_samples

BIN_EXT = ".exe" if platform.system() == "Windows" else ""
HERE = Path(__file__).parent.resolve()
DEFAULT_ENCODER_DUT = str(HERE.joinpath(f"../../IVAS_cod{BIN_EXT}").resolve())
@@ -107,6 +110,24 @@ def build_dut_binaries():
    build_crend_unittest(dut_src_dir)


def create_short_testvectors():
    """
    Create short (5sec) testvectors.
    """
    print("Creating short (5sec) testvectors")
    num_channels = "4" # currently only FOA
    cut_from = "0.0"
    cut_len = "5.0"
    for fs in ['48', '32', '16']:
        in_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c.pcm"
        cut_gain = "1.0"
        cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut.pcm"
        cut_samples(in_file, cut_file, num_channels, fs + "000", cut_from, cut_len, cut_gain)
        cut_gain = "16.0"
        cut_file = f"{TEST_VECTOR_DIR}/stvFOA{fs}c_cut_{cut_gain}.pcm"
        cut_samples(in_file, cut_file, num_channels, fs + "000", cut_from, cut_len, cut_gain)


def main(argv):
    # check for python >= 3.7
    if sys.version_info[0] < 3 or sys.version_info[1] < 7:
@@ -175,6 +196,7 @@ def main(argv):
    else:
        # create references
        print(f"Creating references within the references directory {REFERENCE_DIR}")
        create_short_testvectors()
        if platform.system() == "Windows":
            base_cmd = ["pytest"]
        else: