Commit 896b9372 authored by Jan Kiene's avatar Jan Kiene
Browse files

first version of decoder tests

parent 71e6fb1c
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ BITRATES_ALL = [
    384000,
    512000,
]
BITRATES_STEREO = BITRATES_ALL[:10]
BITRATES_STEREO = BITRATES_ALL[:11]
BITRATES_ISM1 = BITRATES_ALL[:9]
BITRATES_ISM2 = BITRATES_ALL[1:10]
BITRATES_ISM3 = BITRATES_ALL[2:11]
@@ -316,3 +316,5 @@ DECODER_CLEAN_CHANNEL_CHANNELBASED_AND_MASA_PARAMS = (
        product(MASA_PARAMS, OUTPUT_FORMATS_ALL, SAMPLING_RATES_ALL)
    )
)
DECODER_CLEAN_CHANNEL_OBJECTBASED = collapse_into_list_of_pairs(product(ISM_PARAMS, OUTPUT_FORMATS_ALL, SAMPLING_RATES_ALL))
DECODER_CLEAN_CHANNEL_SCENEBASED = collapse_into_list_of_pairs(product(SBA_PARAMS, OUTPUT_FORMATS_ALL, SAMPLING_RATES_ALL))
 No newline at end of file
+69 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ def run_check(
    "input_format,bitrate,input_sampling_rate,dtx,output_format,output_sampling_rate",
    DECODER_CLEAN_CHANNEL_CHANNELBASED_AND_MASA_PARAMS,
)
def test_decoder_clean_channel(
def test_decoder_clean_channel_channelbased_and_masa(
    input_format,
    bitrate,
    input_sampling_rate,
@@ -90,3 +90,71 @@ def test_decoder_clean_channel(
        dut_decoder_frontend,
        update_ref == 1,
    )


@pytest.mark.parametrize(
    "input_format,bitrate,input_sampling_rate,dtx,md_type,output_format,output_sampling_rate", DECODER_CLEAN_CHANNEL_OBJECTBASED
)
def test_decoder_clean_channel_objectbased(
        input_format,
        bitrate,
        input_sampling_rate,
        dtx,
        md_type,
        output_format,
        output_sampling_rate,
        dut_decoder_frontend,
        update_ref
):
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    suffix = "_basic_MD"
    if md_type == ISM_MD_EXTENDED:
        suffix = "_ext_MD"
    elif md_type == ISM_MD_NULL:
        suffix = "_null_MD"
    ref_bitstream = get_bitstream_path(
        REF_PATH, testv_name, input_format, bitrate, input_sampling_rate, dtx, suffix=suffix
    )
    dut_output = get_output_path(ref_bitstream, output_format, output_sampling_rate)

    run_check(
        str(ref_bitstream),
        output_format,
        output_sampling_rate,
        str(dut_output),
        dut_decoder_frontend,
        update_ref == 1,
    )


@pytest.mark.parametrize(
    "input_format,bitrate,input_sampling_rate,dtx,pca,output_format,output_sampling_rate", DECODER_CLEAN_CHANNEL_SCENEBASED
)
def test_decoder_clean_channel_scenebased(
        input_format,
        bitrate,
        input_sampling_rate,
        dtx,
        pca,
        output_format,
        output_sampling_rate,
        dut_decoder_frontend,
        update_ref
):
    testv_name = get_testv_path(input_format, input_sampling_rate).stem
    suffix = ""
    if pca == SBA_FOA_PCA_ON:
        suffix="-pca"
    ref_bitstream = get_bitstream_path(
        REF_PATH, testv_name, input_format, bitrate, input_sampling_rate, dtx, suffix=suffix
    )
    dut_output = get_output_path(ref_bitstream, output_format, output_sampling_rate)

    run_check(
        str(ref_bitstream),
        output_format,
        output_sampling_rate,
        str(dut_output),
        dut_decoder_frontend,
        update_ref == 1,
    )
+7 −4
Original line number Diff line number Diff line
@@ -134,12 +134,13 @@ def test_encoder_object_based_modes(
):
    testv = get_testv_path(input_format, sampling_rate)
    options = get_options(input_format, md_type)
    suffix = "_basic_MD"
    if md_type == ISM_MD_EXTENDED:
        input_format += "_ext_MD"
        suffix = "_ext_MD"
    elif md_type == ISM_MD_NULL:
        input_format += "_null_MD"
        suffix = "_null_MD"
    bitstream = get_bitstream_path(
        DUT_PATH, testv.stem, input_format, bitrate, sampling_rate, dtx
        DUT_PATH, testv.stem, input_format, bitrate, sampling_rate, dtx, suffix=suffix
    )
    run_check(
        bitstream,
@@ -159,10 +160,12 @@ def test_encoder_sba(
):
    testv = get_testv_path(input_format, sampling_rate)
    options = get_options(input_format)
    suffix = ""
    if pca == SBA_FOA_PCA_ON:
        options.extend(["-bypass", "2"])
        suffix="-pca"
    bitstream = get_bitstream_path(
        DUT_PATH, testv.stem, input_format, bitrate, sampling_rate, dtx, "-pca"
        DUT_PATH, testv.stem, input_format, bitrate, sampling_rate, dtx, suffix=suffix
    )
    run_check(
        bitstream,