Commit 6325d672 authored by hsd's avatar hsd
Browse files

Merge remote-tracking branch 'origin/mmc/109-with-acoustic-front-upstream-rc'...

Merge remote-tracking branch 'origin/mmc/109-with-acoustic-front-upstream-rc' into mmc/109-with-acoustic-front-upstream-rc-tmpmerge
parents f12c7a5a 3e71a499
Loading
Loading
Loading
Loading
+54 −6
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ def test_ambisonics_binaural_headrotation_refrotequal(test_info, in_fmt, out_fmt
# This test compares rendering with:
#   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_POS)
#        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)
@@ -121,7 +121,7 @@ def test_ambisonics_binaural_headrotation_refveczero(test_info, in_fmt, out_fmt,
# This test compares rendering with:
#   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_POS)
#        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):
@@ -141,7 +141,7 @@ def test_ambisonics_binaural_headrotation_refvecequal(test_info, in_fmt, out_fmt
# This test compares rendering with:
#   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_POS)
#        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):
@@ -160,9 +160,9 @@ def test_ambisonics_binaural_headrotation_refvec_rotating(test_info, in_fmt, out
    )

# This test compares rendering with:
#   ref: a reference position trajectory with elevation and REF_POS_LEV OTR mode (OTR=REF_POS_LEV)
#   cut: a reference position trajectory without the elevation and REF_POS OTR mode (OTR=REF_POS)
# Since the only difference between REF_POS_LEV and REF_POS is that *LEV ignores
#   ref: a reference position trajectory with elevation and REF_VEC_LEV OTR mode (OTR=REF_VEC_LEV)
#   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)
@@ -221,6 +221,27 @@ def test_multichannel_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file
            trj_file=HR_TRAJECTORY_DIR.joinpath(f"{trj_file}.csv"),
        )

# This test compares rendering with:
#   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):
    compare_renderer_args(
        test_info,
        in_fmt,
        out_fmt,
        ref_kwargs={
            "name_extension": "refvec_rotating",
            "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"),
        },
        cut_kwargs={
            "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"),
            "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv")
        }
    )


""" ISM """

@@ -269,6 +290,33 @@ def test_ism_binaural_headrotation(test_info, in_fmt, out_fmt, trj_file):
            in_meta_files=in_meta_files,
        )

# This test compares rendering with:
#   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):
    try:
        in_meta_files = FORMAT_TO_METADATA_FILES[in_fmt]
    except:
        in_meta_files = None

    compare_renderer_args(
        test_info,
        in_fmt,
        out_fmt,
        ref_kwargs={
            "name_extension": "refvec_rotating",
            "trj_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s.csv"),
            "in_meta_files": in_meta_files
        },
        cut_kwargs={
            "trj_file": HR_TRAJECTORY_DIR.joinpath("const000.csv"),
            "refvec_file": HR_TRAJECTORY_DIR.joinpath("full-circle-with-up-and-down-4s-ccw-Vector3.csv"),
            "in_meta_files": in_meta_files
        }
    )

""" MASA """