Commit 82cfd242 authored by vaclav's avatar vaclav
Browse files

Merge branch '20231004_acceptance_of_swiches' into 'main'

20231004 acceptance of switches

See merge request !1139
parents 6e82962a 7f0e2fba
Loading
Loading
Loading
Loading
Loading
+4 −38
Original line number Diff line number Diff line
@@ -145,10 +145,9 @@ typedef struct
#endif
#endif
    uint16_t acousticEnvironmentId;
#ifdef FIX_708_DPID_COMMAND_LINE
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

} DecArguments;


@@ -434,13 +433,8 @@ int main(
     * Configure the decoder
     *------------------------------------------------------------------------------------------*/

    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms,
                                       arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain,
#ifdef FIX_708_DPID_COMMAND_LINE
                                       arg.Opt_dpid_on,
#endif
                                       arg.acousticEnvironmentId,
                                       arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.enable5ms, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation,
                                       arg.orientation_tracking, arg.renderConfigEnabled, arg.Opt_non_diegetic_pan, arg.non_diegetic_pan_gain, arg.Opt_dpid_on, arg.acousticEnvironmentId, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -638,11 +632,7 @@ int main(

        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
#ifdef NONBE_FIX_730_DPID_NOT_SET_CORRECTLY
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
#else
            fprintf( stderr, "Failed to get directivity for objects: %d %d %d %d\n\n", arg.directivityPatternId[0], arg.directivityPatternId[1], arg.directivityPatternId[2], arg.directivityPatternId[3] );
#endif
            goto cleanup;
        }

@@ -1002,9 +992,7 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_708_DPID_COMMAND_LINE
    arg->Opt_dpid_on = 0;
#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
    arg->outputMdFilename = NULL;
@@ -1031,11 +1019,7 @@ static bool parseCmdlIVAS_dec(
    arg->acousticEnvironmentId = 65535;
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
#ifdef NONBE_FIX_730_DPID_NOT_SET_CORRECTLY
        arg->directivityPatternId[i] = 65535;
#else
        arg->directivityPatternId[i] = 0;
#endif
    }

    /*-----------------------------------------------------------------*
@@ -1424,17 +1408,13 @@ static bool parseCmdlIVAS_dec(
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
#ifdef FIX_708_DPID_COMMAND_LINE
            int16_t id;
            int16_t id, tmp;

            arg->Opt_dpid_on = 1;
#endif
            ++i;
            int16_t tmp;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
            {
#ifdef FIX_708_DPID_COMMAND_LINE
                id = (int16_t) atoi( argv[i + tmp] );

                if ( !is_digits_only( argv[i + tmp] ) || id < 0 )
@@ -1445,13 +1425,9 @@ static bool parseCmdlIVAS_dec(
                }

                arg->directivityPatternId[tmp] = id;
#else
                arg->directivityPatternId[tmp] = (int16_t) atoi( argv[i + tmp] );
#endif
                ++tmp;
            }

#ifdef FIX_708_DPID_COMMAND_LINE
            if ( tmp == 0 )
            {
                if ( argc - i <= 4 || argv[i][0] == '-' )
@@ -1468,7 +1444,6 @@ static bool parseCmdlIVAS_dec(
                    return false;
                }
            }
#endif

            i += tmp;
        }
@@ -1564,12 +1539,7 @@ static bool parseCmdlIVAS_dec(
        return false;
    }

#ifdef FIX_807_VARIABLE_SPEED_DECODING
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) && ( !arg->tsmEnabled ) )
#else
    if ( ( !arg->enableHeadRotation ) && ( !arg->enableExternalOrientation ) )
#endif

    {
        arg->enable5ms = false;
    }
@@ -1663,15 +1633,11 @@ static void usage_dec( void )
    fprintf( stdout, "-force R            : Force specific binaural rendering mode, R = (TDREND, CLDFBREND),\n" );
#endif
    fprintf( stdout, "-exof File          : External orientation File for external orientation trajectory\n" );
#ifdef FIX_708_DPID_COMMAND_LINE
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up\n" );
    fprintf( stdout, "                      to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB\n" );
    fprintf( stdout, "                      output configuration. ID1, ID2, ID3, ID4 specify the directivity pattern IDs used for\n" );
    fprintf( stdout, "                      ISMs 1,2,3 and 4 respectively. This options needs to be accompanied by a render_config file,\n" );
    fprintf( stdout, "                      otherwise a default directivity pattern is used.\n" );
#else
    fprintf( stdout, "-dpid ID            : Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration\n" );
#endif
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
    fprintf( stdout, "-level level        : Complexity level, level = (1, 2, 3), will be defined after characterisation. \n" );
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
+0 −8
Original line number Diff line number Diff line
@@ -384,11 +384,7 @@ static const CmdLnParser_Option cliOptions[] = {
        .id = CmdLnOptionId_directivityPatternId,
        .match = "ism_directivity_pattern_id",
        .matchShort = "dpid",
#ifdef FIX_708_DPID_COMMAND_LINE
        .description = "Directivity pattern ID(s) = [ID1, ID2, ID3, ID4]. Space-separated list of up to 4 numbers (unsigned integers) can be specified for BINAURAL and BINAURAL_ROOM_REVERB output configuration.\nID1, ID2, ID3, ID4 specify the directivity pattern IDs used for ISMs 1,2,3 and 4 respectively.\nThis options needs to be accompanied by a render_config file, otherwise a default directivity pattern is used.",
#else
        .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration",
#endif
    },
    {
        .id = CmdLnOptionId_acousticEnvironmentId,
@@ -2640,11 +2636,7 @@ static CmdlnArgs defaultArgs(

    for ( int32_t i = 0; i < RENDERER_MAX_ISM_INPUTS; ++i )
    {
#ifdef NONBE_FIX_730_DPID_NOT_SET_CORRECTLY
        args.directivityPatternId[i] = 65535;
#else
        args.directivityPatternId[i] = 0;
#endif
    }

    args.acousticEnvironmentId = 65535;
+0 −4
Original line number Diff line number Diff line
@@ -75,9 +75,7 @@ typedef enum
    IVAS_ERR_INVALID_OUTPUT_FORMAT,
    IVAS_ERR_HEAD_ROTATION_NOT_SUPPORTED,
    IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED,
#ifdef FIX_708_DPID_COMMAND_LINE
    IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED,
#endif
    IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED,
    IVAS_ERR_INVALID_HRTF,
    IVAS_ERR_INVALID_INPUT_FORMAT,
@@ -253,10 +251,8 @@ static inline const char *ivas_error_to_string( ivas_error error_code )
#endif
        case IVAS_ERR_EXT_ORIENTATION_NOT_SUPPORTED:
            return "External orientation not supported";
#ifdef FIX_708_DPID_COMMAND_LINE
        case IVAS_ERR_DIRECTIVITY_NOT_SUPPORTED:
            return "Directivity not supported";
#endif
        case IVAS_ERR_ACOUSTIC_ENVIRONMENT_NOT_SUPPORTED:
            return "Acoustic environment not supported";
        case IVAS_ERR_INVALID_HRTF:
+10 −50
Original line number Diff line number Diff line
@@ -727,21 +727,13 @@ void ivas_fb_mixer_process(

void ivas_fb_mixer_get_in_out_mapping(
    const IVAS_FB_CFG *fb_cfg,                                                       /* i  : FB config. handle  */
#ifndef REMOVE_UNUSED_FUNCTION
    const int16_t nchan_transport, /* i  : number of transport channels                  */
    const int16_t enc_dec_flag,    /* i  : encoder or decoder flag                       */
    const int16_t *order,          /* i  : downmix order                                 */
#endif
    int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH] /* i/o: mixing mapping     */
)
{
    int16_t i, j;

    set_s( (int16_t *) in_out_mixer_map, 0, IVAS_MAX_FB_MIXER_OUT_CH * IVAS_MAX_SPAR_FB_MIXER_IN_CH );
#ifndef REMOVE_UNUSED_FUNCTION
    if ( enc_dec_flag == ENC )
    {
#endif

    if ( fb_cfg->active_w_mixing )
    {
        for ( i = 0; i < fb_cfg->num_out_chans; i++ )
@@ -760,39 +752,7 @@ void ivas_fb_mixer_get_in_out_mapping(
            in_out_mixer_map[i][0] = 1;
        }
    }
#ifndef REMOVE_UNUSED_FUNCTION
    }
    else
    {
        in_out_mixer_map[0][0] = 1; /* W depends on only W input*/
        for ( i = 1; i < nchan_transport; i++ )
        {
            in_out_mixer_map[order[i]][0] = 1;
            in_out_mixer_map[order[i]][i] = 1;
        }
        if ( nchan_transport == 1 )
        {
            /* no cross predicitons in 1 ch dmx*/
            for ( i = nchan_transport; i < fb_cfg->num_out_chans; i++ )
            {
                in_out_mixer_map[order[i]][0] = 1;
                in_out_mixer_map[order[i]][i] = 1;
            }
        }
        else
        {
            /* handle the cross predictions and decorrelation*/
            for ( i = nchan_transport; i < fb_cfg->num_out_chans; i++ )
            {
                for ( j = 0; j < nchan_transport; j++ )
                {
                    in_out_mixer_map[order[i]][j] = 1;
                }
                in_out_mixer_map[order[i]][i] = 1;
            }
        }
    }
#endif

    return;
}

+1 −14
Original line number Diff line number Diff line
@@ -110,12 +110,7 @@ ivas_error mct_enc_reconfigure(
ivas_error ivas_sba_enc_reconfigure(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
#ifndef REMOVE_UNUSED_FUNCTION
/*! r: maximum SBA metadata bit-budget */
int16_t ivas_sba_get_max_md_bits(
    Encoder_Struct *st_ivas                                     /* i/o: IVAS encoder structure                  */
);
#endif

void destroy_sce_enc(
    SCE_ENC_HANDLE hSCE                                         /* i/o: SCE encoder structure                   */
);
@@ -4164,9 +4159,6 @@ ivas_error ivas_sba_linear_renderer(
	const int16_t nchan_ism,
    const AUDIO_CONFIG output_config,                           /* i  : output audio configuration                              */
    const IVAS_OUTPUT_SETUP output_setup                        /* i  : output format setup                                     */
#ifndef REMOVE_UNUSED_FUNCTION
    ,const float hoa_dec_mtx[]                                   /* i  : HOA decoding mtx                                        */
#endif
);

void ivas_sba_mix_matrix_determiner(
@@ -6036,11 +6028,6 @@ void ivas_fb_mixer_process(

void ivas_fb_mixer_get_in_out_mapping(
    const IVAS_FB_CFG *fb_cfg,                                  /* i  : FB config. handle                           */
#ifndef REMOVE_UNUSED_FUNCTION
    const int16_t nchan_transport,                              /* i  : number of transport channels                */
    const int16_t enc_dec_flag,                                 /* i  : encoder or decoder flag                     */
    const int16_t *order,                                       /* i  : downmix order                               */
#endif
    int16_t in_out_mixer_map[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]   /* i/o: mixing mapping       */
);

Loading