Commit 6e9c92a0 authored by BOHMRR's avatar BOHMRR
Browse files

combined agc test with non-agc test

parent 27ec4e3b
Loading
Loading
Loading
Loading
Loading
+4 −36
Original line number Diff line number Diff line
@@ -46,8 +46,7 @@ plc_patterns = ['PLperc12mblen5', 'PLperc40mblen50', 'PLperc42mblen2']
dtx_set = ['0', '1']
ivas_br_list = ['32000', '64000', '96000', '256000']
sampling_rate_list = ['48', '32', '16']

agc_tag_list = ['stvFOA']
agc_list = [0, 1]

ch_count_foa = 4
AbsTol = '3'
@@ -74,6 +73,7 @@ def check_and_makedir(dir_path):
@pytest.mark.parametrize("tag", tag_list)
@pytest.mark.parametrize("plc_pattern", plc_patterns)
@pytest.mark.parametrize("fs", sampling_rate_list)
@pytest.mark.parametrize("agc", agc_list)
def test_spar_foa_plc_system(
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
@@ -85,42 +85,10 @@ def test_spar_foa_plc_system(
    dtx,
    tag,
    plc_pattern,
    fs
):
    tag = tag + fs + 'c'
    agc = 0

    #dec
    spar_foa_dec_plc(dut_decoder_frontend, data_system_tests_path, reference_path, dut_base_path, ref_decoder_path, tag, ch_count_foa, fs, ivas_br, dtx, plc_pattern, update_ref, agc)


# assumption:
# - the needed reference bitstreams are created by test_spar_foa_enc_agc_system
# -> reference bitstreams are not any longer created as part of this test
# -> the parameters of this test (except additional parameter plc_pattern) need to be a subset of the parameters in test_spar_foa_enc_agc_system
# -> the reference generation for this test (reference decoder output) needs to be done after completion of test_spar_foa_enc_agc_system
#    -> therefore the marker create_ref_part2
@pytest.mark.create_ref_part2
@pytest.mark.parametrize("ivas_br", ivas_br_list)
@pytest.mark.parametrize("dtx", dtx_set)
@pytest.mark.parametrize("tag", agc_tag_list)
@pytest.mark.parametrize("plc_pattern", plc_patterns)
@pytest.mark.parametrize("fs", sampling_rate_list)
def test_spar_foa_agc_plc_system(
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
    reference_path,
    dut_base_path,
    ref_decoder_path,
    update_ref,
    ivas_br,
    dtx,
    tag,
    plc_pattern,
    fs
    fs,
    agc
):
    tag = tag + fs + 'c'
    agc = 1

    #dec
    spar_foa_dec_plc(dut_decoder_frontend, data_system_tests_path, reference_path, dut_base_path, ref_decoder_path, tag, ch_count_foa, fs, ivas_br, dtx, plc_pattern, update_ref, agc)
+9 −85
Original line number Diff line number Diff line
@@ -62,8 +62,7 @@ ivas_br_HOA3 = ['256000', '384000', '512000']

sample_rate_list = ['48', '32', '16']
bypass_list = [1, 2]

agc_tag_list = ['stvFOA']
agc_list = [0, 1]

sample_rate_bw_idx_list = [('48', 'SWB'), ('48', 'WB'), ('32', 'WB')]

@@ -150,7 +149,7 @@ def test_bypass_enc(
@pytest.mark.parametrize("dtx", dtx_set)
@pytest.mark.parametrize("tag", tag_list)
@pytest.mark.parametrize("fs", sample_rate_list)
#@pytest.mark.parametrize("agc", agc_list)
@pytest.mark.parametrize("agc", agc_list)
def test_spar_foa_enc_system(
    dut_encoder_frontend: EncoderFrontend,
    dut_decoder_frontend: DecoderFrontend,
@@ -164,14 +163,17 @@ def test_spar_foa_enc_system(
    dtx,
    tag,
    fs,
#    agc
    agc
):
    tag = tag + fs + 'c'
    max_bw = "FB"
    bypass = -1
    agc = 0
    sba_order = "+1"
    output_config = "FOA"
    if agc == 1:
        cut_gain = "16.0"
    else:
        cut_gain = "1.0"

    # enc
    spar_foa_enc(
@@ -188,7 +190,8 @@ def test_spar_foa_enc_system(
        bypass,
        agc,
        sba_order,
        update_ref
        update_ref,
        cut_gain=cut_gain
    )

    # dec
@@ -397,70 +400,6 @@ def test_spar_foa_enc_BWforce_system(
    )


@pytest.mark.create_ref
@pytest.mark.parametrize("ivas_br", ivas_br_FOA)
@pytest.mark.parametrize("dtx", dtx_set)
@pytest.mark.parametrize("tag", agc_tag_list)
@pytest.mark.parametrize("fs", sample_rate_list)
def test_spar_foa_enc_agc_system(
    dut_encoder_frontend: EncoderFrontend,
    dut_decoder_frontend: DecoderFrontend,
    data_system_tests_path,
    reference_path,
    dut_base_path,
    ref_encoder_path,
    ref_decoder_path,
    update_ref,
    ivas_br,
    dtx,
    tag,
    fs
):
    tag = tag + fs + 'c'
    max_bw = "FB"
    bypass = -1
    agc = 1
    sba_order = "+1"
    output_config = "FOA"

    # enc
    spar_foa_enc(
        dut_encoder_frontend,
        data_system_tests_path,
        ref_encoder_path,
        reference_path,
        dut_base_path,
        tag,
        fs,
        ivas_br,
        dtx,
        max_bw,
        bypass,
        agc,
        sba_order,
        update_ref,
        cut_gain="16.0"
    )

    # dec
    spar_foa_dec(
        dut_decoder_frontend,
        ref_decoder_path,
        reference_path,
        dut_base_path,
        tag,
        ch_count_foa,
        fs,
        ivas_br,
        dtx,
        max_bw,
        bypass,
        agc,
        output_config,
        update_ref
    )


#########################################################
############ test function ##############################
def spar_foa_enc(
@@ -656,18 +595,3 @@ def spar_foa_dec(

        ##report failure
        assert not test_fail

    if ref_decoder_path:
        # Unclear whether this clean-up is still needed
        # TODO: check temp file generation

        ##File removal##
        for count in range(ch_count, 25):
            ch_id = str(count + 1)
            temp_raw_file = f"{ref_out_dir}/out{ch_id}ch.raw"
            if os.path.isfile(temp_raw_file):
                os.remove(temp_raw_file)

        temp_md_file = f"{ref_out_dir}/MD_OUT_DUMMY.BIN"
        if os.path.isfile(temp_md_file):
            os.remove(temp_md_file)