Commit 9da96385 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch 'ci/split-output-files-b4-comparison' into kiene/tmp-branch-for-ltv-split-testing

parents 30765278 6dc93d57
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -648,6 +648,9 @@ def run_test(
        if split_comparison and not sim_opts:
            split_idx = get_split_idx(str(Path(testv_file).stem), int(sampling_rate))

        # this extra if takes care of cases where no splits are found, e.g. the "NOOP" case in the self_test_ltv prm file
        # if this would not be there, then the comparison of the whole file would run twice
        if len(split_idx) > 0:
            output_differs_splits, reason_splits = cmp_pcm(
                ref_file,
                dut_output_file,
+4 −0
Original line number Diff line number Diff line
@@ -1357,6 +1357,9 @@ def sba_dec(
            input_file = f"{test_vector_path}/{tag}.wav"
            split_idx = get_split_idx(str(Path(input_file).stem), int(sampling_rate))

        # this extra if takes care of cases where no splits are found, e.g. the "NOOP" case in the self_test_ltv prm file
        # if this would not be there, then the comparison of the whole file would run twice
        if len(split_idx) > 0:
            output_differs_splits, reason_splits = cmp_pcm(
                ref_out_file,
                dut_out_file,
@@ -1378,6 +1381,7 @@ def sba_dec(
            output_differs_parts += output_differs_splits
            reason_parts += reason_splits

        if split_comparison:
            prop_suffix = ["_whole"] + [
                f"_split{i:03d}" for i in range(1, len(split_idx) + 1)
            ]
+3 −6
Original line number Diff line number Diff line
@@ -1278,13 +1278,10 @@ def get_split_idx(input_file: str, sampling_rate_khz: int) -> Optional[np.ndarra
            format = "osba_hoa"
    else:
        format = input_file.split("_")[-1].lower()
    idx = SPLIT_IDX.get(format)

    if idx is None:
        pytest.fail(
            f"Could not get split indices for file {input_file} with infered format {format}."
        )
    idx = SPLIT_IDX.get(format, np.empty(0))

    # copy is important because we modify the array below for fs != 16
    # without copy, the constant would be modified and future split values would be wrong
    idx = idx.copy()

    if len(idx) > 0 and sampling_rate_khz != 16:
+4 −0
Original line number Diff line number Diff line
@@ -413,6 +413,9 @@ def run_renderer(
        if split_comparison:
            split_idx = get_split_idx(str(Path(in_file).stem), ref_fs // 1000)

        # this extra if takes care of cases where no splits are found, e.g. the "NOOP" case in the self_test_ltv prm file
        # if this would not be there, then the comparison of the whole file would run twice
        if len(split_idx) > 0:
            output_differs_splits, reason_splits = cmp_pcm(
                out_file_ref,
                out_file,
@@ -433,6 +436,7 @@ def run_renderer(
            output_differs_parts += output_differs_splits
            reason_parts += reason_splits

        if split_comparison:
            prop_suffix = ["_whole"] + [
                f"_split{i:03d}" for i in range(1, len(split_idx) + 1)
            ]