Commit 0512b915 authored by emerit's avatar emerit
Browse files

merge with main

parent 46a85d45
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -170,6 +170,9 @@ typedef enum
#define HEAD_ROTATION_HOA_ORDER                 3                           /* HOA 3rd order */
#define MAX_CICP_CHANNELS                       16                          /* max channels for loudspeaker layouts (16 for custom layouts)*/
#define MAX_OUTPUT_CHANNELS                     16                          /* Maximum number of output channels (HOA 3rd order) */
#ifdef NO_DIEGETIC_PAN
#define MAX_OUTPUT_CHANNELS_NI_DIEGETIC_PAN     2                          /* Maximum number of output channels with no diegetic pan */
#endif

#define BINAURAL_CHANNELS                       2                           /* number of channels for binaural output configuration */
#define CPE_CHANNELS                            2                           /* number of CPE (stereo) channels */
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ ivas_error ivas_dec(
        else /* ISM_MODE_DISC */
        {
#ifdef FIX_CRASH_EVS_BITSTREAM_WITH_OUTPUT
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ) != IVAS_ERR_OK ) )
            if ( ( error = ivas_ism_metadata_dec( ivas_total_brate, &( st_ivas->nchan_transport ), st_ivas->hIsmMetaData, st_ivas->hSCE, st_ivas->bfi, nb_bits_metadata, st_ivas->ism_mode, NULL ) ) != IVAS_ERR_OK )
            {
                return error;
            }
+2 −34
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ void ivas_renderer_select(
        }
        else
        {
#endif
            if ( st_ivas->ism_mode == ISM_MODE_PARAM )
            {
                *renderer_type = RENDERER_PARAM_ISM;
@@ -312,40 +313,7 @@ void ivas_renderer_select(
                    *renderer_type = RENDERER_DISABLE;
                }
            }
        }
#else
        if ( st_ivas->ism_mode == ISM_MODE_PARAM )
        {
            *renderer_type = RENDERER_PARAM_ISM;
            if ( output_config == AUDIO_CONFIG_MONO )
            {
                *renderer_type = RENDERER_MONO_DOWNMIX;
            }
            else if ( output_config == AUDIO_CONFIG_STEREO )
            {
                *renderer_type = RENDERER_DISABLE;
            }
            else if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 )
            {
                *renderer_type = RENDERER_SBA_LINEAR_ENC;
                *internal_config = AUDIO_CONFIG_7_1_4;
            }
        }
        else /* ISM_MODE_DISC */
        {
            *renderer_type = RENDERER_TD_PANNING;
            if ( output_config == AUDIO_CONFIG_MONO )
            {
                *renderer_type = RENDERER_MONO_DOWNMIX;
            }
            else if ( output_config == AUDIO_CONFIG_FOA || output_config == AUDIO_CONFIG_HOA2 || output_config == AUDIO_CONFIG_HOA3 )
            {
                *renderer_type = RENDERER_SBA_LINEAR_ENC;
            }
            else if ( output_config == AUDIO_CONFIG_EXTERNAL )
            {
                *renderer_type = RENDERER_DISABLE;
            }
#ifdef NO_DIEGETIC_PAN
        }
#endif
    }
+1 −1
Original line number Diff line number Diff line
@@ -2134,7 +2134,7 @@ static ivas_error evs_dec_main(
{
    DEC_CORE_HANDLE *hCoreCoder;
#ifdef NO_DIEGETIC_PAN
    float output[MAX_OUTPUT_CHANNELS][L_FRAME48k];
    float output[MAX_OUTPUT_CHANNELS_NI_DIEGETIC_PAN][L_FRAME48k];
#else
    float output[L_FRAME48k];
#endif
+0 −220
Original line number Diff line number Diff line
@@ -61,40 +61,6 @@ RENDERER_CMD = [
    "-q",
]

""" TD Object Renderer commandline template """
TDRENDERER_CMD = [
    str(
        SCRIPTS_DIR.joinpath("td_object_renderer")
        .joinpath("object_renderer_standalone")
        .joinpath("renderer_standalone")
    ),
    "48",
    "",  # 4 -> input file
    "",  # 5 -> output file
]

""" CREND commandline template """
CREND_CMD = [
    str(
        SCRIPTS_DIR.joinpath(
            "ivas_pytests/tests/unit_tests/crend/IVAS_crend_unit_test")
    ),
    "-test",
    "1",
    "-sr",
    "48",
    "-ifmt",
    "",  # 4 -> input format
    "-ofmt",
    "",  # 8 -> output format
    "-i",
    "",  # 2 -> input file
    "-o",
    "/dev/null",  # 6 -> output file
    # "-lp_lfe",
    "-limiter"
    # "-no_delay_cmp"
]

""" Format to file mappings """
NCHAN_TO_FILE = {
@@ -189,62 +155,10 @@ FORMAT_TO_METADATA_FILES = {
        str(TESTV_DIR.joinpath("stvISM3.csv")),
        str(TESTV_DIR.joinpath("stvISM4.csv")),
    ],
    "MASA1": [str(TESTV_DIR.joinpath("stv_IVASMASA_1dir1TC.met"))],
    "MASA2": [str(TESTV_DIR.joinpath("stv_IVASMASA_2dir2TC.met"))],
    "MASA1": [str(TESTV_DIR.joinpath("stv1MASA1TC48c.met"))],
    "MASA2": [str(TESTV_DIR.joinpath("stv2MASA2TC48c.met"))],
}

FORMAT_TO_IVAS = {
    "MONO": ["", ""],
    "STEREO": ["-stereo", ""],
    "FOA": ["-sba", "1"],
    "HOA2": ["-sba", "2"],
    "HOA3": ["-sba", "3"],
    "5_1": ["-mc", "5_1"],
    "7_1": ["-mc", "7_1"],
    "5_1_2": ["-mc", "5_1_2"],
    "5_1_4": ["-mc", "5_1_4"],
    "7_1_4": ["-mc", "7_1_4"],
    "ISM1": ["-ism", "1"],
    "ISM2": ["-ism", "2"],
    "ISM3": ["-ism", "3"],
    "ISM4": ["-ism", "4"],
    "NDP_ISM4": ["-ism", "4"],
}

FORMAT_TO_IVAS_BR = {
    "MONO": "128000",
    "STEREO": "256000",
    "FOA": "512000",
    "HOA2": "512000",
    "HOA3": "512000",
    "5_1": "512000",
    "7_1": "512000",
    "5_1_2": "512000",
    "5_1_4": "512000",
    "7_1_4": "512000",
    "ISM1": "256000",
    "ISM2": "256000",
    "ISM3": "256000",
    "ISM4": "256000",
    "NDP_ISM4": "256000",
}

FORMAT_TO_CREND_FORMAT = {
    "MONO": "0",
    "STEREO": "1",
    "BINAURAL": "2",
    "BINAURAL_ROOM": "2",
    "FOA": "3",
    "5_1": "4",
    "7_1": "5",
    "5_1_2": "6",
    "5_1_4": "7",
    "7_1_4": "8",
    "HOA2": "9",
    "HOA3": "10",
}

""" Input formats """
INPUT_FORMATS_AMBI = ["FOA", "HOA2", "HOA3"]
@@ -450,138 +364,4 @@ _pass_snr = {
    "test_metadata[mixed_scene-7_1]": 48,
    "test_metadata[mixed_scene-7_1_4]": 47,
    "test_metadata[mixed_scene-5_1_4]": 47,
    #####################################
    #
    # External vs Internal Renderer tests
    #
    #####################################
    # Failure reason: only fails for this trajectory with very high SNR, possible minor diff. in crossfade
    # or due to usage of multiple TD Object Renderer instances
    "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL-rotate_yaw_pitch_roll1]": 84,
    "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL-rotate_yaw_pitch_roll1]": 78,
    "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL-rotate_yaw_pitch_roll1]": 85,
    # TODO needs investigation
    # Failure reason: conversion to 7_1_4 could be implemented differently w.r.t decoder
    "test_ism_binaural_headrotation_vs_decoder[ISM1-BINAURAL_ROOM-full_circle_in_15s]": 15,
    "test_ism_binaural_headrotation_vs_decoder[ISM1-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 15,
    "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL-rotate_yaw_pitch_roll1]": 55,
    "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL_ROOM-full_circle_in_15s]": 12,
    "test_ism_binaural_headrotation_vs_decoder[ISM2-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13,
    "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL-full_circle_in_15s]": 72,
    "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL-rotate_yaw_pitch_roll1]": 73,
    "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL_ROOM-full_circle_in_15s]": 12,
    "test_ism_binaural_headrotation_vs_decoder[ISM3-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13,
    "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL-full_circle_in_15s]": 71,
    "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL-rotate_yaw_pitch_roll1]": 61,
    "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL_ROOM-full_circle_in_15s]": 12,
    "test_ism_binaural_headrotation_vs_decoder[ISM4-BINAURAL_ROOM-rotate_yaw_pitch_roll1]": 13,
    # TODO needs investigation
    "test_ism_binaural_static_vs_decoder[ISM1-BINAURAL_ROOM]": 15,
    "test_ism_binaural_static_vs_decoder[ISM2-BINAURAL_ROOM]": 12,
    "test_ism_binaural_static_vs_decoder[ISM3-BINAURAL_ROOM]": 12,
    "test_ism_binaural_static_vs_decoder[ISM4-BINAURAL_ROOM]": 12,
    "test_ism_binaural_static_vs_decoder[ISM3-BINAURAL]": 72,
    "test_ism_binaural_static_vs_decoder[ISM4-BINAURAL]": 71,
    "test_no_diegetic_pan_ism_binaural_static[NDP_ISM4-BINAURAL]": 72,
    "test_no_diegetic_pan_ism_binaural_static[NDP_ISM4-BINAURAL_ROOM]": 71,
    # Failure reason: Decoder sets elevation for non-planar output layouts to 0
    "test_ism_vs_decoder[ISM1-5_1]": 27,
    "test_ism_vs_decoder[ISM1-7_1]": 27,
    "test_ism_vs_decoder[ISM2-5_1]": 6,
    "test_ism_vs_decoder[ISM2-7_1]": 5,
    "test_ism_vs_decoder[ISM3-MONO]": 73,
    "test_ism_vs_decoder[ISM3-5_1]": 8,
    "test_ism_vs_decoder[ISM3-7_1]": 7,
    "test_ism_vs_decoder[ISM4-MONO]": 72,
    "test_ism_vs_decoder[ISM4-5_1]": 8,
    "test_ism_vs_decoder[ISM4-7_1]": 7,
    # Failure reason: Bit-exact except for first frame; renderer fades in from defaultObjectPosition(), decoder fades in from 0
    "test_ism_vs_decoder[ISM1-5_1_2]": 27,
    "test_ism_vs_decoder[ISM1-5_1_4]": 27,
    "test_ism_vs_decoder[ISM1-7_1_4]": 27,
    "test_ism_vs_decoder[ISM1-FOA]": 27,
    "test_ism_vs_decoder[ISM1-HOA2]": 27,
    "test_ism_vs_decoder[ISM1-HOA3]": 27,
    "test_ism_vs_decoder[ISM1-STEREO]": 27,
    "test_ism_vs_decoder[ISM2-5_1_2]": 32,
    "test_ism_vs_decoder[ISM2-5_1_4]": 32,
    "test_ism_vs_decoder[ISM2-7_1_4]": 32,
    "test_ism_vs_decoder[ISM2-FOA]": 32,
    "test_ism_vs_decoder[ISM2-HOA2]": 32,
    "test_ism_vs_decoder[ISM2-HOA3]": 32,
    "test_ism_vs_decoder[ISM2-STEREO]": 32,
    "test_ism_vs_decoder[ISM3-5_1_2]": 33,
    "test_ism_vs_decoder[ISM3-5_1_4]": 33,
    "test_ism_vs_decoder[ISM3-7_1_4]": 33,
    "test_ism_vs_decoder[ISM3-FOA]": 33,
    "test_ism_vs_decoder[ISM3-HOA2]": 33,
    "test_ism_vs_decoder[ISM3-HOA3]": 33,
    "test_ism_vs_decoder[ISM3-STEREO]": 33,
    "test_ism_vs_decoder[ISM4-5_1_2]": 31,
    "test_ism_vs_decoder[ISM4-5_1_4]": 31,
    "test_ism_vs_decoder[ISM4-7_1_4]": 31,
    "test_ism_vs_decoder[ISM4-FOA]": 31,
    "test_ism_vs_decoder[ISM4-HOA2]": 30,
    "test_ism_vs_decoder[ISM4-HOA3]": 29,
    "test_ism_vs_decoder[ISM4-MONO]": 77,
    "test_ism_vs_decoder[ISM4-STEREO]": 31,
    # TODO needs investigation
    # Failure reason: headrotation and crossfade could have differences
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL-full_circle_in_15s]": 4,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_2-BINAURAL-rotate_yaw_pitch_roll1]": 0,
    "test_multichannel_binaural_headrotation_vs_decoder[5_1_4-BINAURAL-full_circle_in_15s]": 4,
    "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]": 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-BINAURAL_ROOM]": 18,
    "test_multichannel_binaural_static_vs_decoder[5_1_2-BINAURAL_ROOM]": 18,
    "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL]": 74,
    "test_multichannel_binaural_static_vs_decoder[5_1_4-BINAURAL_ROOM]": 18,
    "test_multichannel_binaural_static_vs_decoder[7_1-BINAURAL]": 74,
    "test_multichannel_binaural_static_vs_decoder[7_1-BINAURAL_ROOM]": 19,
    "test_multichannel_binaural_static_vs_decoder[7_1_4-BINAURAL_ROOM]": 18,
    # Failure reason: Active dmx (decoder) vs Passive dmx (renderer)
    "test_multichannel_vs_decoder[5_1-5_1_2]": 62,
    "test_multichannel_vs_decoder[5_1-5_1_4]": 62,
    "test_multichannel_vs_decoder[5_1-7_1]": 62,
    "test_multichannel_vs_decoder[5_1-7_1_4]": 62,
    "test_multichannel_vs_decoder[5_1-MONO]": 43,
    "test_multichannel_vs_decoder[5_1-STEREO]": 48,
    "test_multichannel_vs_decoder[5_1_2-5_1]": 63,
    "test_multichannel_vs_decoder[5_1_2-5_1_4]": 63,
    "test_multichannel_vs_decoder[5_1_2-7_1]": 63,
    "test_multichannel_vs_decoder[5_1_2-7_1_4]": 63,
    "test_multichannel_vs_decoder[5_1_2-MONO]": 38,
    "test_multichannel_vs_decoder[5_1_2-STEREO]": 44,
    "test_multichannel_vs_decoder[5_1_4-5_1]": 62,
    "test_multichannel_vs_decoder[5_1_4-5_1_2]": 63,
    "test_multichannel_vs_decoder[5_1_4-7_1]": 62,
    "test_multichannel_vs_decoder[5_1_4-7_1_4]": 61,
    "test_multichannel_vs_decoder[5_1_4-MONO]": 42,
    "test_multichannel_vs_decoder[5_1_4-STEREO]": 48,
    "test_multichannel_vs_decoder[7_1-5_1]": 63,
    "test_multichannel_vs_decoder[7_1-5_1_2]": 63,
    "test_multichannel_vs_decoder[7_1-5_1_4]": 63,
    "test_multichannel_vs_decoder[7_1-7_1_4]": 63,
    "test_multichannel_vs_decoder[7_1-MONO]": 38,
    "test_multichannel_vs_decoder[7_1-STEREO]": 44,
    "test_multichannel_vs_decoder[7_1_4-5_1]": 62,
    "test_multichannel_vs_decoder[7_1_4-5_1_2]": 63,
    "test_multichannel_vs_decoder[7_1_4-5_1_4]": 63,
    "test_multichannel_vs_decoder[7_1_4-7_1]": 62,
    "test_multichannel_vs_decoder[7_1_4-MONO]": 41,
    "test_multichannel_vs_decoder[7_1_4-STEREO]": 46,
    "test_multichannel_vs_decoder[STEREO-MONO]": 17,
}
Loading