Commit 2e079b58 authored by Jan Kiene's avatar Jan Kiene
Browse files

add --enc_stats cmld arg

parent c55d4bbc
Loading
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -166,6 +166,7 @@ def test_param_file_tests(
    get_mld_lim,
    abs_tol,
    get_ssnr,
    get_enc_stats,
):
    enc_opts, dec_opts, sim_opts, eid_opts = param_file_test_dict[test_tag]

@@ -212,11 +213,11 @@ def test_param_file_tests(
            bitstream_file,
            enc_split,
            update_ref,
            encoder_only,
            get_enc_stats,
        )

        # compare binary files extracted from the encoder
        if encoder_only:
        if get_enc_stats:
            print("Comparing encoder auxiliary files")
            print("=================================\n")

@@ -546,7 +547,7 @@ def encode(
    bitstream_file,
    enc_opts_list,
    update_ref,
    encoder_only,
    get_enc_stats=False,
):
    """
    Call REF and/or DUT encoder.
@@ -558,7 +559,7 @@ def encode(
    ref_out_file = f"{ref_out_dir}/{bitstream_file}"
    dut_out_file = f"{dut_out_dir}/{bitstream_file}"

    if encoder_only:
    if get_enc_stats:
        stats_file = bitstream_file.replace(".192", ".stats")
        ref_stats_file = f"{ref_out_dir}/{stats_file}"
        dut_stats_file = f"{dut_out_dir}/{stats_file}"
@@ -566,7 +567,7 @@ def encode(
        ref_stats_file = None
        dut_stats_file = None

    if (update_ref in [1, 2] and not os.path.exists(ref_out_file)) or encoder_only:
    if update_ref in [1, 2] and not os.path.exists(ref_out_file):
        check_and_makedir(ref_out_dir)

        # call REF encoder
@@ -579,7 +580,7 @@ def encode(
            stats_file=ref_stats_file,
        )

    if update_ref in [0, 2] or encoder_only:
    if update_ref in [0, 2]:
        check_and_makedir(dut_out_dir)

        # call DUT encoder
+14 −0
Original line number Diff line number Diff line
@@ -183,6 +183,12 @@ def pytest_addoption(parser):
        help="Compute Segmental SNR (SSNR) between ref and dut output instead of just comparing for bitexactness",
    )

    parser.addoption(
        "--enc_stats",
        action="store_true",
        help="Activate logging and comparison of statistics from the encoder.",
    )

    parser.addoption(
        "--create_ref",
        action="store_true",
@@ -269,6 +275,14 @@ def get_ssnr(request):
    return request.config.option.ssnr


@pytest.fixture(scope="session", autouse=True)
def get_enc_stats(request):
    """
    Return indication to compare statistics of values logged from encoder.
    """
    return request.config.option.enc_stats


@pytest.fixture(scope="session")
def abs_tol(request) -> int:
    """