Commit 63392d8c authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

further align multichannel rendering

- fix a bug for the external renderer causing headrotation to not be applied for BINAURAL_ROOM due to passing the wrong EFAP handle
- enable limiter for Crend Unit Test to align
- update testcase SNR thresholds accordingly
- fix a bug in file naming for test_renderer_vs_decoder.py
parent 12081938
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@
#define FIX_ISM_DECODER_PRINTOUT                        /* Issue 229: fix ISM decoder printout */
#define FIX_REND_ROUNDING                               /* Issue 195: Align float to int16 conversion in renderer with decoder */
#define FIX_REND_MONO_DMX                               /* Issue 195: Fix mono downmix coefficients in decoder and renderer */
#define FIX_REND_ROT_MCBRIRS                            /* ISsue 195: Fix wrong EFAP handle passed to renderer, resulting in no rotation for BINAURAL_ROOM output */


/* ################## End DEVELOPMENT switches ######################### */
+8 −0
Original line number Diff line number Diff line
@@ -4119,7 +4119,11 @@ static ivas_error renderMcToBinauralRoom(
                       mcInput->customLsInput,
                       mcInput->base.ctx.pHeadRotData,
                       mcInput->rot_gains_prev,
#ifdef FIX_REND_ROT_MCBRIRS
                       mcInput->base.ctx.pEfapOutWrapper->hEfap,
#else
                       mcInput->efapInWrapper.hEfap,
#endif
                       tmpRotBuffer );

        copyBufferTo2dArray( tmpRotBuffer, tmpCrendBuffer );
@@ -4179,7 +4183,11 @@ static ivas_error renderMcCustomLsToBinauralRoom(
                       mcInput->customLsInput,
                       mcInput->base.ctx.pHeadRotData,
                       mcInput->rot_gains_prev,
#ifdef FIX_REND_ROT_MCBRIRS
                       mcInput->base.ctx.pEfapOutWrapper->hEfap,
#else
                       mcInput->efapInWrapper.hEfap,
#endif
                       tmpRotBuffer );
    }

+25 −40
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ CREND_CMD = [
    "-o",
    "/dev/null",  # 6 -> output file
    # "-lp_lfe",
    # "-limiter"
    "-limiter"
    # "-no_delay_cmp"
]

@@ -241,7 +241,9 @@ FORMAT_TO_CREND_FORMAT = {
INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"]
INPUT_FORMATS_MC = ["MONO", "STEREO", "5_1", "5_1_2", "5_1_4", "7_1", "7_1_4"]
INPUT_FORMATS_ISM = ["ISM1", "ISM2", "ISM3", "ISM4"]
INPUT_FORMATS_MASA = ["MASA2"] #["MASA1", "MASA2"] # Disable MASA1 tests until MASA1 can be implemented properly
INPUT_FORMATS_MASA = [
    "MASA2"
]  # ["MASA1", "MASA2"] # Disable MASA1 tests until MASA1 can be implemented properly

""" Non binaural / parametric output formats """
OUTPUT_FORMATS = [
@@ -381,36 +383,20 @@ pass_snr = {
    "test_ism[ISM4-HOA2]": 36,
    "test_ism[ISM4-HOA3]": 33,
    "test_ism[ISM4-STEREO]": 57,
    # TODO delay alignment of LFE in binaural output
    # Failure reason: bitexact except for delay alignment of LFE signal (Issue 59)
    "test_multichannel_binaural_headrotation[5_1-BINAURAL-full_circle_in_15s]": 7,
    "test_multichannel_binaural_headrotation[5_1-BINAURAL-rotate_yaw_pitch_roll1]": 6,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL-full_circle_in_15s]": 8,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL-rotate_yaw_pitch_roll1]": 8,
    # Failure reason: bitexact except for clicks and differences in center channel, could be due to crossfades
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-full_circle_in_15s]": 30,
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL-rotate_yaw_pitch_roll1]": 30,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-full_circle_in_15s]": 29,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 29,
    "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-full_circle_in_15s]": 30,
    "test_multichannel_binaural_headrotation[7_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 30,
    "test_multichannel_binaural_static[5_1_2-BINAURAL]": 30,
    "test_multichannel_binaural_static[5_1_4-BINAURAL]": 29,
    "test_multichannel_binaural_static[5_1-BINAURAL]": 27,
    "test_multichannel_binaural_static[7_1-BINAURAL]": 30,
    "test_multichannel_binaural_static[7_1_4-BINAURAL]": 30,
    # TODO needs debugging
    # Failure reason: headrotation may be applied differently, differences increase progressively
    "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-full_circle_in_15s]": 10,
    "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 4,
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 11,
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 12,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-full_circle_in_15s]": 10,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3,
    "test_multichannel_binaural_headrotation[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 10,
    "test_multichannel_binaural_headrotation[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 3,
    # Failure reason: differences in LFE alignment and possibly rotation
    "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-full_circle_in_15s]": 14,
    "test_multichannel_binaural_headrotation[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 12,
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 8,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 6,
    "test_multichannel_binaural_headrotation[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-full_circle_in_15s]": 11,
    "test_multichannel_binaural_headrotation[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 9,
    "test_multichannel_binaural_headrotation[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6,
    #####################################
    #
    # External vs Internal Renderer tests
@@ -485,18 +471,18 @@ pass_snr = {
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL-full_circle_in_15s]": 4,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL-rotate_yaw_pitch_roll1]": 0,
    # TODO needs investigation
    "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-full_circle_in_15s]": 5,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 6,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 7,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-full_circle_in_15s]": 5,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 5,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 0,
    # TODO needs investigation
    # # TODO needs investigation
    "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-full_circle_in_15s]": 7,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 6,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-full_circle_in_15s]": 3,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 2,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-full_circle_in_15s]": 2,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 2,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-full_circle_in_15s]": 7,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 5,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-full_circle_in_15s]": 16,
    "test_multichannel_binaural_headrotation_vs_decoder[7_1_4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 16,
    # Failure reason: Differences seem to be purely in late reverb part
    "test_multichannel_binaural_static_vs_decoder[5_1_2-BINAURAL_ROOM]": 18,
    "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL_ROOM]": 18,
    "test_multichannel_binaural_static_vs_decoder[5_1-BINAURAL_ROOM]": 18,
@@ -515,7 +501,6 @@ pass_snr = {
    "test_multichannel_vs_decoder[5_1-STEREO]": 48,
    "test_multichannel_vs_decoder[7_1_4-STEREO]": 46,
    "test_multichannel_vs_decoder[7_1-STEREO]": 44,
    # TODO needs investigation
    "test_multichannel_vs_decoder[5_1_2-5_1_4]": 63,
    "test_multichannel_vs_decoder[5_1_2-5_1]": 63,
    "test_multichannel_vs_decoder[5_1_2-7_1_4]": 63,
+14 −5
Original line number Diff line number Diff line
@@ -177,7 +177,6 @@ def run_renderer(

    out_file = str(output_path_base.joinpath(f"{in_name}_to_{out_name}{trj_name}.wav"))


    cmd = RENDERER_CMD[:]
    cmd[2] = str(in_file)
    cmd[4] = str(in_fmt)
@@ -389,7 +388,11 @@ def run_pyscripts(

def compare_renderer_vs_mergetarget(test_info, in_fmt, out_fmt, **kwargs):
    ref, ref_fs = run_renderer(
        in_fmt, out_fmt, binary_suffix=BIN_SUFFIX_MERGETARGET, output_path_base=OUTPUT_PATH_REF, **kwargs
        in_fmt,
        out_fmt,
        binary_suffix=BIN_SUFFIX_MERGETARGET,
        output_path_base=OUTPUT_PATH_REF,
        **kwargs,
    )
    cut, cut_fs = run_renderer(in_fmt, out_fmt, **kwargs)
    check_BE(test_info, ref, ref_fs, cut, cut_fs)
@@ -414,12 +417,18 @@ def compare_renderer_vs_td_standalone(test_info, in_fmt, out_fmt, **kwargs):


def compare_renderer_vs_decoder(test_info, in_fmt, out_fmt, **kwargs):
    if "trj_file" in kwargs:
        trj_name = f"_{kwargs['trj_file'].stem}"
    else:
        trj_name = ""
    with TemporaryDirectory() as tmp_dir:
        tmp_dir = Path(tmp_dir)

        in_meta_files = None
        bit_file = str(tmp_dir.joinpath(f"{in_fmt}_to_{out_fmt}.192"))
        out_file_decoder = str(OUTPUT_PATH_REF.joinpath(f"{in_fmt}_to_{out_fmt}.wav"))
        bit_file = str(tmp_dir.joinpath(f"{in_fmt}_to_{out_fmt}{trj_name}.192"))
        out_file_decoder = str(
            OUTPUT_PATH_REF.joinpath(f"{in_fmt}_to_{out_fmt}{trj_name}.wav")
        )

        # Ref: cod -> dec (out_fmt)
        if in_fmt in FORMAT_TO_METADATA_FILES.keys():
@@ -440,7 +449,7 @@ def compare_renderer_vs_decoder(test_info, in_fmt, out_fmt, **kwargs):
        else:
            tmp_fmt = in_fmt

        out_file_ext = str(tmp_dir.joinpath(f"{in_fmt}_to_{tmp_fmt}.wav"))
        out_file_ext = str(tmp_dir.joinpath(f"{in_fmt}_to_{tmp_fmt}{trj_name}.wav"))

        # passthrough decoder
        run_dec(bit_file, out_file_ext, tmp_fmt, **kwargs)