Loading tests/cmp_pcm.py +10 −1 Original line number Diff line number Diff line Loading @@ -5,15 +5,24 @@ THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) import pyaudio3dtools import pyivastest def cmp_pcm(file1, file2, nchannels, fs) -> (int, str): def cmp_pcm(file1, file2, oc, fs) -> (int, str): """ Compare 2 PCM files for bitexactness """ print("Cmp PCM Report") print("=====================") oc = "MONO" if oc == "" else oc if oc.upper() not in pyivastest.constants.OC_TO_NCHANNELS: oc_in_file_names = os.path.splitext(os.path.basename(oc))[0] nchannels = pyivastest.IvasScriptsCommon.IvasScript.get_n_channels_from_ls_layout(oc) else: oc_in_file_names = oc nchannels = pyivastest.constants.OC_TO_NCHANNELS[oc.upper()] s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs) Loading tests/test_param_file.py +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ from subprocess import run import pytest from cmp_pcm import cmp_pcm from conftest import EncoderFrontend, DecoderFrontend from testconfig import PARAM_FILE, OC_TO_NCHANNELS from testconfig import PARAM_FILE VALID_DEC_OUTPUT_CONF = [ Loading Loading @@ -275,7 +275,7 @@ def test_param_file_tests( dut_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_file, ref_file, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_file, ref_file, output_config, fs) assert cmp_result == 0, reason # remove DUT output files when test result is OK (to save disk space) Loading tests/test_sba_bs_dec_plc.py +1 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import pytest from cmp_pcm import cmp_pcm from conftest import DecoderFrontend from testconfig import OC_TO_NCHANNELS # params tag_list = ['stvFOA'] Loading Loading @@ -177,7 +176,7 @@ def sba_dec_plc( # -------------- compare cmd -------------- fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs) # report compare result assert cmp_result == 0, reason Loading tests/test_sba_bs_enc.py +1 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import pytest from cmp_pcm import cmp_pcm from cut_pcm import cut_samples from conftest import EncoderFrontend, DecoderFrontend from testconfig import OC_TO_NCHANNELS # params tag_list = ['stvFOA'] Loading Loading @@ -595,7 +594,7 @@ def sba_dec( ) fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs) # report compare result assert cmp_result == 0, reason Loading tests/testconfig.py +0 −21 Original line number Diff line number Diff line Loading @@ -35,24 +35,3 @@ To configure test modules. """ PARAM_FILE = "scripts/config/self_test.prm" OC_TO_NCHANNELS = { "MONO": 1, "STEREO": 2, "BINAURAL": 2, "BINAURAL_ROOM": 2, "5_1": 6, "7_1": 8, "5_1_2": 8, "5_1_4": 10, "7_1_4": 12, "FOA": 4, "HOA2": 9, "HOA3": 16, "EXT": 1, "ISM1": 1, "ISM2": 2, "ISM3": 3, "ISM4": 4, "MASA1TC": 1, "MASA2TC": 2, } Loading
tests/cmp_pcm.py +10 −1 Original line number Diff line number Diff line Loading @@ -5,15 +5,24 @@ THIS_PATH = os.path.join(os.getcwd(), __file__) sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) import pyaudio3dtools import pyivastest def cmp_pcm(file1, file2, nchannels, fs) -> (int, str): def cmp_pcm(file1, file2, oc, fs) -> (int, str): """ Compare 2 PCM files for bitexactness """ print("Cmp PCM Report") print("=====================") oc = "MONO" if oc == "" else oc if oc.upper() not in pyivastest.constants.OC_TO_NCHANNELS: oc_in_file_names = os.path.splitext(os.path.basename(oc))[0] nchannels = pyivastest.IvasScriptsCommon.IvasScript.get_n_channels_from_ls_layout(oc) else: oc_in_file_names = oc nchannels = pyivastest.constants.OC_TO_NCHANNELS[oc.upper()] s1, _ = pyaudio3dtools.audiofile.readfile(file1, nchannels, fs) s2, _ = pyaudio3dtools.audiofile.readfile(file2, nchannels, fs) Loading
tests/test_param_file.py +2 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ from subprocess import run import pytest from cmp_pcm import cmp_pcm from conftest import EncoderFrontend, DecoderFrontend from testconfig import PARAM_FILE, OC_TO_NCHANNELS from testconfig import PARAM_FILE VALID_DEC_OUTPUT_CONF = [ Loading Loading @@ -275,7 +275,7 @@ def test_param_file_tests( dut_file = f"{dut_base_path}/param_file/dec/{output_file}" ref_file = f"{reference_path}/param_file/dec/{output_file}" fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_file, ref_file, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_file, ref_file, output_config, fs) assert cmp_result == 0, reason # remove DUT output files when test result is OK (to save disk space) Loading
tests/test_sba_bs_dec_plc.py +1 −2 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ import pytest from cmp_pcm import cmp_pcm from conftest import DecoderFrontend from testconfig import OC_TO_NCHANNELS # params tag_list = ['stvFOA'] Loading Loading @@ -177,7 +176,7 @@ def sba_dec_plc( # -------------- compare cmd -------------- fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs) # report compare result assert cmp_result == 0, reason Loading
tests/test_sba_bs_enc.py +1 −2 Original line number Diff line number Diff line Loading @@ -42,7 +42,6 @@ import pytest from cmp_pcm import cmp_pcm from cut_pcm import cut_samples from conftest import EncoderFrontend, DecoderFrontend from testconfig import OC_TO_NCHANNELS # params tag_list = ['stvFOA'] Loading Loading @@ -595,7 +594,7 @@ def sba_dec( ) fs = int(sampling_rate) * 1000 cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, OC_TO_NCHANNELS[output_config], fs) cmp_result, reason = cmp_pcm(dut_out_raw, ref_out_raw, output_config, fs) # report compare result assert cmp_result == 0, reason Loading
tests/testconfig.py +0 −21 Original line number Diff line number Diff line Loading @@ -35,24 +35,3 @@ To configure test modules. """ PARAM_FILE = "scripts/config/self_test.prm" OC_TO_NCHANNELS = { "MONO": 1, "STEREO": 2, "BINAURAL": 2, "BINAURAL_ROOM": 2, "5_1": 6, "7_1": 8, "5_1_2": 8, "5_1_4": 10, "7_1_4": 12, "FOA": 4, "HOA2": 9, "HOA3": 16, "EXT": 1, "ISM1": 1, "ISM2": 2, "ISM3": 3, "ISM4": 4, "MASA1TC": 1, "MASA2TC": 2, }