Commit f17a1612 authored by emerit's avatar emerit
Browse files

fix renderer test fail

parent 121d16d6
Loading
Loading
Loading
Loading
+23 −8
Original line number Diff line number Diff line
@@ -100,6 +100,8 @@ def test_ambisonics_binaural_headrotation_refrotequal(test_info, in_fmt, out_fmt
#   ref: head rotation trajectory file (OTR=NONE)
#   cut: identical head rotation trajectory file as ref but in addition a constant
#        reference vector in the looking direction of the coordinate system (OTR=REF_VEC)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
@@ -122,6 +124,8 @@ def test_ambisonics_binaural_headrotation_refveczero(test_info, in_fmt, out_fmt,
#   ref: no head rotation (OTR=NONE)
#   cut: rendering with head rotation and a ref vector which moves in the
#        looking-direction of the head rotation and therefore compensates it (OTR=REF_VEC)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_headrotation_refvecequal(test_info, in_fmt, out_fmt):
@@ -142,6 +146,8 @@ def test_ambisonics_binaural_headrotation_refvecequal(test_info, in_fmt, out_fmt
#   ref: a head rotation trajectory with elevation (OTR=NONE)
#   cut: a static head rotation and a reference position trajectory which moves
#        in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt):
@@ -165,6 +171,8 @@ def test_ambisonics_binaural_headrotation_refvec_rotating(test_info, in_fmt, out
#        in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC)
#        which also contains a fixed position offset between listener and reference position (which
#        gets compensated in the REF_VEV OTR modes)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset(test_info, in_fmt, out_fmt):
@@ -187,6 +195,8 @@ def test_ambisonics_binaural_headrotation_refvec_rotating_fixed_pos_offset(test_
#   cut: a reference position trajectory without the elevation and REF_VEC OTR mode (OTR=REF_VEC)
# Since the only difference between REF_VEC_LEV and REF_VEC is that *LEV ignores
# the height difference in positions, the output must be binary equivalent.


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_headrotation_refveclev_vs_refvec(test_info, in_fmt, out_fmt):
@@ -248,6 +258,8 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file
#   ref: a head rotation trajectory with elevation (OTR=NONE)
#   cut: a static head rotation and a reference position trajectory which moves
#        in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC)
def test_multichannel_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt):
@@ -275,7 +287,8 @@ def test_multichannel_binaural_headrotation_refvec_rotating(test_info, in_fmt, o
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:])
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism(test_info, in_fmt, out_fmt):
    run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt])
    run_renderer(in_fmt, out_fmt,
                 in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt])


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@@ -320,6 +333,8 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
#   ref: a head rotation trajectory with elevation (OTR=NONE)
#   cut: a static head rotation and a reference position trajectory which moves
#        in a way that produces the same acoustic output as the ref head rot trajectory (OTR=REF_VEC)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_ISM)
def test_ism_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt):
@@ -344,13 +359,15 @@ def test_ism_binaural_headrotation_refvec_rotating(test_info, in_fmt, out_fmt):
        }
    )


""" MASA """


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS[2:])
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MASA)
def test_masa(test_info, in_fmt, out_fmt):
    run_renderer(in_fmt, out_fmt, in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt])
    run_renderer(in_fmt, out_fmt,
                 in_meta_files=FORMAT_TO_METADATA_FILES[in_fmt])


# MASA inputs not supported yet
@@ -432,15 +449,13 @@ def test_metadata(test_info, in_fmt, out_fmt):
@pytest.mark.parametrize("in_fmt", ["MONO"])
@pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
def test_no_diegetic_pan_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
    compare_renderer_vs_crend_unit_test(
        test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
    compare_renderer_vs_decoder(
        test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
    run_renderer(
        in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)


@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["ISM1"])
@pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
def test_no_diegetic_pan_ism_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
    compare_renderer_vs_decoder(
        test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
    run_renderer(
        in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
+20 −16
Original line number Diff line number Diff line
@@ -37,13 +37,15 @@ from .utils import *
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_AMBI)
def test_ambisonics_binaural_static(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -65,7 +67,8 @@ def test_ambisonics_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS)
@pytest.mark.parametrize("in_fmt", INPUT_FORMATS_MC)
def test_multichannel(test_info, in_fmt, out_fmt):
    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("out_fmt", OUTPUT_FORMATS_BINAURAL)
@@ -74,7 +77,8 @@ def test_multichannel_binaural_static(test_info, in_fmt, out_fmt):
    if in_fmt in ["MONO", "STEREO"]:
        pytest.skip("MONO or STEREO to Binaural rendering unsupported")

    compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, is_comparetest=True)
    compare_renderer_vs_mergetarget(
        test_info, in_fmt, out_fmt, is_comparetest=True)


@pytest.mark.parametrize("trj_file", HR_TRAJECTORIES_TO_TEST)
@@ -208,17 +212,17 @@ def test_metadata(test_info, in_fmt, out_fmt):
""" no diegetic pan """


@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["MONO"])
@pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
def test_no_diegetic_pan_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
    compare_renderer_vs_decoder(
        test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
# @pytest.mark.parametrize("out_fmt", ["STEREO"])
# @pytest.mark.parametrize("in_fmt", ["MONO"])
# @pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
# def test_no_diegetic_pan_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
#     compare_renderer_vs_mergetarget(
#         test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)


@pytest.mark.parametrize("out_fmt", ["STEREO"])
@pytest.mark.parametrize("in_fmt", ["ISM1"])
@pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
def test_no_diegetic_pan_ism_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
    compare_renderer_vs_decoder(
        test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)
# @pytest.mark.parametrize("out_fmt", ["STEREO"])
# @pytest.mark.parametrize("in_fmt", ["ISM1"])
# @pytest.mark.parametrize("no_diegetic_pan", ["0", "-0.2", "0.5", "1", "-1"])
# def test_no_diegetic_pan_ism_static(test_info, in_fmt, out_fmt, no_diegetic_pan):
#     compare_renderer_vs_mergetarget(
#         test_info, in_fmt, out_fmt, no_diegetic_pan=no_diegetic_pan)