Commit 518ed000 authored by multrus's avatar multrus
Browse files

Merge branch 'main' into new-osba-baseline

parents ae6527c9 f4f6b60f
Loading
Loading
Loading
Loading
Loading
+73 −3
Original line number Diff line number Diff line
@@ -161,6 +161,13 @@ typedef struct
#endif
#endif

#ifdef CONTROL_METADATA_REVERB
    uint16_t acousticEnvironmentId;
#ifdef CONTROL_METADATA_DIRECTIVITY
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
#endif
#endif

} DecArguments;


@@ -606,12 +613,42 @@ int main(
            goto cleanup;
        }

#ifdef CONTROL_METADATA_REVERB
        if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
#else
        if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
            goto cleanup;
        }
#ifdef CONTROL_METADATA_DIRECTIVITY
        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, arg.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
            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] );
            goto cleanup;
        }
#endif

#ifdef CONTROL_METADATA_REVERB
        if ( arg.outputFormat == IVAS_DEC_OUTPUT_BINAURAL_ROOM_REVERB )
        {
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Invalid reverberation configuration parameters\n\n" );
                    goto cleanup;
                }
            }
            else if ( error != IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING )
            {
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
                goto cleanup;
            }
            renderConfig.room_acoustics.override = true;
        }
#endif
        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -969,7 +1006,15 @@ static bool parseCmdlIVAS_dec(
#endif
#endif


#ifdef CONTROL_METADATA_REVERB
    arg->acousticEnvironmentId = 0;
#ifdef CONTROL_METADATA_DIRECTIVITY
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        arg->directivityPatternId[i] = 0;
    }
#endif
#endif
    /*-----------------------------------------------------------------*
     * Initialization
     *-----------------------------------------------------------------*/
@@ -1330,8 +1375,27 @@ static bool parseCmdlIVAS_dec(
                fprintf( stdout, "Complexity levels 1 and 2 will be defined after characterisation - default to level 3 (full functionality).\n" );
            }
        }


#ifdef CONTROL_METADATA_REVERB
        else if ( strcmp( argv_to_upper, "-AEID" ) == 0 )
        {
            ++i;
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
        }
#ifdef CONTROL_METADATA_DIRECTIVITY
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
            ++i;
            int16_t tmp;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
            {
                arg->directivityPatternId[tmp] = (int16_t) atoi( argv[i + tmp] );
                ++tmp;
            }
            i += tmp;
        }
#endif
#endif
        /*-----------------------------------------------------------------*
         * Option not recognized
         *-----------------------------------------------------------------*/
@@ -1516,6 +1580,12 @@ static void usage_dec( void )
    fprintf( stdout, "                      Currently, all values default to level 3 (full functionality).\n" );
#endif
    fprintf( stdout, "-exof File          : External orientation file for external orientation trajectory\n" );
#ifdef CONTROL_METADATA_DIRECTIVITY
    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
#ifdef CONTROL_METADATA_REVERB
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
#ifdef DEBUG_MODE_INFO
#ifdef DEBUG_MODE_INFO_TWEAK
    fprintf( stdout, "-info <folder>      : specify subfolder name for debug output\n" );
+75 −0
Original line number Diff line number Diff line
@@ -178,6 +178,12 @@ typedef struct
#ifdef FIX_488_SYNC_DELAY
    float syncMdDelay;
#endif
#ifdef CONTROL_METADATA_DIRECTIVITY
    uint16_t directivityPatternId[RENDERER_MAX_ISM_INPUTS];
#endif
#ifdef CONTROL_METADATA_REVERB
    uint16_t acousticEnvironmentId;
#endif
} CmdlnArgs;

typedef enum
@@ -209,6 +215,12 @@ typedef enum
#ifdef FIX_488_SYNC_DELAY
    CmdLnOptionId_syncMdDelay,
#endif
#ifdef CONTROL_METADATA_DIRECTIVITY
    CmdLnOptionId_directivityPatternId,
#endif
#ifdef CONTROL_METADATA_REVERB
    CmdLnOptionId_acousticEnvironmentId
#endif
} CmdLnOptionId;

static const CmdLnParser_Option cliOptions[] = {
@@ -356,6 +368,22 @@ static const CmdLnParser_Option cliOptions[] = {
        .description = "Metadata Synchronization Delay in ms, Default is 0. Quantized by 5ms subframes for TDRenderer (13ms -> 10ms -> 2subframes)",
    },
#endif
#ifdef CONTROL_METADATA_DIRECTIVITY
    {
        .id = CmdLnOptionId_directivityPatternId,
        .match = "ism_directivity_pattern_id",
        .matchShort = "dpid",
        .description = "Directivity pattern ID(s) (space-separated list of up to 4 numbers can be specified) for binaural output configuration",
    },
#endif
#ifdef CONTROL_METADATA_REVERB
    {
        .id = CmdLnOptionId_acousticEnvironmentId,
        .match = "acoustic_environment_id",
        .matchShort = "aeid",
        .description = "Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration",
    },
#endif
};


@@ -1069,7 +1097,11 @@ int main(
            exit( -1 );
        }

#ifdef CONTROL_METADATA_REVERB
        if ( RenderConfigReader_read( renderConfigReader, args.renderConfigFilePath, &renderConfig ) != IVAS_ERR_OK )
#else
        if ( RenderConfigReader_read( renderConfigReader, &renderConfig ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "Failed to read renderer configuration from file %s\n", args.renderConfigFilePath );
            exit( -1 );
@@ -1077,6 +1109,21 @@ int main(

        if ( args.outConfig.audioConfig == IVAS_REND_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef CONTROL_METADATA_REVERB
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "Invalid room acoustics configuration parameters\n\n" );
                    exit( -1 );
                }
            }
            else
            {
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", args.acousticEnvironmentId );
                exit( -1 );
            }
#endif
            renderConfig.room_acoustics.override = TRUE;
        }

@@ -2513,6 +2560,17 @@ static CmdlnArgs defaultArgs(
#ifdef FIX_488_SYNC_DELAY
    args.syncMdDelay = 0;
#endif

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

#ifdef CONTROL_METADATA_REVERB
    args.acousticEnvironmentId = 0;
#endif
    return args;
}

@@ -2652,6 +2710,23 @@ static void parseOption(
                exit( -1 );
            }
            break;

#ifdef CONTROL_METADATA_DIRECTIVITY
        case CmdLnOptionId_directivityPatternId:
            assert( numOptionValues <= RENDERER_MAX_ISM_INPUTS );
            for ( int16_t i = 0; i < numOptionValues; ++i )
            {
                args->directivityPatternId[i] = (int16_t) strtol( optionValues[i], NULL, 10 );
            }
            break;
#endif

#ifdef CONTROL_METADATA_REVERB
        case CmdLnOptionId_acousticEnvironmentId:
            assert( numOptionValues == 1 );
            args->acousticEnvironmentId = (int16_t) strtol( optionValues[0], NULL, 10 );
            break;
#endif
#ifdef FIX_488_SYNC_DELAY
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
+4 −0
Original line number Diff line number Diff line
@@ -215,7 +215,11 @@ typedef struct _IVAS_RENDER_CONFIG
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_SPLIT_REND_CONFIG_DATA split_rend_config;
#endif
#ifdef CONTROL_METADATA_DIRECTIVITY
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
#else
    float directivity[3];
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

typedef struct _IVAS_LS_CUSTOM_LAYOUT
+7 −0
Original line number Diff line number Diff line
@@ -135,6 +135,13 @@ typedef enum
    IVAS_ERR_INVALID_INPUT_ID,
    IVAS_ERR_WRONG_NUM_CHANNELS,
    IVAS_ERR_INVALID_BUFFER_SIZE,
#ifdef CONTROL_METADATA_REVERB
    IVAS_ERR_INVALID_RENDER_CONFIG,
    IVAS_ERR_ACOUSTIC_ENVIRONMENT_MISSING,
#ifdef CONTROL_METADATA_DIRECTIVITY
    IVAS_ERR_DIRECTIVITY_PATTERN_ID_MISSING,
#endif
#endif
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IVAS_ERR_LC3PLUS_INVALID_BITRATE,
    IVAS_ERR_INVALID_SPLIT_REND_CONFIG,
+7 −1
Original line number Diff line number Diff line
@@ -150,7 +150,11 @@
/* only BE switches wrt operation points tested in selection */

/*#define FIX_I4_OL_PITCH*/                             /* fix open-loop pitch used for EVS core switching */

#define CONTROL_METADATA_REVERB                         /* Philips: reverb configuration change to binary format */
#ifdef CONTROL_METADATA_REVERB
#define EARLY_REFLECTIONS                               /* Philips/Qualcomm: early reflections extension to reverb configuration */
#define CONTROL_METADATA_DIRECTIVITY                    /* Ericsson: Directivity renderer configuration */ 
#endif
#define VLBR_20MS_MD                                    /* Dlb: SBA VLBR 20ms Optimization*/
#define SBA_MODE_CLEANUP_2                              /* Dlb : changes part of fix issue #523 for unused signaling bit in SBA SID*/
#define FIX_137_SID_MD_BITS                             /* Dlb: Fix issue #137 , SID bitrate mismatch correction */
@@ -215,6 +219,7 @@
#define FIX_618_STEREO_SW_DIV_BY_ZERO                   /* VA: fix issue 618 - UBSAN: division-by-zero in stereo bitrate switching */
#define FIX_625_IDX_OOB                                 /* FhG: Fix index out-of-bounds UBSAN error (issue 625) */
#define FIX_613_DIRAC_NULL_PTR_USAN                     /* Nokia: Issue #613: USAN in DirAC decoder setup */
#define FIX_647_SILENT_W_PARAMBIN                       /* Nokia: Issue #647: Fix silent W SH inputs in parametric binauralizer */

#define MASA_AND_OBJECTS                                /* Nokia: Combination of MASA and objects */

@@ -226,6 +231,7 @@

#define FIX_653_BUG_IN_SKIP_MATRIX                      /* Dlb: fix for issue #653, bug in the ivas_spar_get_skip_mat function*/
#define FIX_663_PARAM_ISM_EXT                           /* FhG: Issue 663: ParamISM EXT output improvement */
#define FIX_673_OMASA_OBJ_MD_SYNC                       /* Nokia: Fix issue 673 by updating metadata in the third subframe to account for audio delay. */


/* ################## End BE DEVELOPMENT switches ######################### */
Loading