Loading tests/codec_be_on_mr_nonselection/test_param_file.py +7 −6 Original line number Diff line number Diff line Loading @@ -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] Loading Loading @@ -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") Loading Loading @@ -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. Loading @@ -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}" Loading @@ -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 Loading @@ -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 Loading tests/conftest.py +14 −0 Original line number Diff line number Diff line Loading @@ -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", Loading Loading @@ -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: """ Loading Loading
tests/codec_be_on_mr_nonselection/test_param_file.py +7 −6 Original line number Diff line number Diff line Loading @@ -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] Loading Loading @@ -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") Loading Loading @@ -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. Loading @@ -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}" Loading @@ -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 Loading @@ -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 Loading
tests/conftest.py +14 −0 Original line number Diff line number Diff line Loading @@ -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", Loading Loading @@ -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: """ Loading