Commit b5b72fcf authored by Sumeyra Demir Kanik's avatar Sumeyra Demir Kanik
Browse files

Add External Renderer CommanLine Option -sync_mc_delay / -smd

parent 0a80080c
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -157,6 +157,9 @@ typedef struct
    float lfeConfigElevation;
    bool lfeCustomRoutingEnabled;
    char inLfePanningMatrixFile[RENDERER_MAX_CLI_ARG_LENGTH];
#ifdef FIX_488_SYNC_DELAY
    int16_t syncMdDelay;
#endif
} CmdlnArgs;

typedef enum
@@ -181,6 +184,9 @@ typedef enum
    CmdLnOptionId_inputGain,
    CmdLnOptionId_referenceVectorFile,
    CmdLnOptionId_exteriorOrientationFile,
#ifdef FIX_488_SYNC_DELAY
    CmdLnOptionId_syncMdDelay,
#endif
} CmdLnOptionId;

static const CmdLnParser_Option cliOptions[] = {
@@ -302,6 +308,14 @@ static const CmdLnParser_Option cliOptions[] = {
        .matchShort = "exof",
        .description = "External orientation trajectory file for simulation of external orientations",
    },
#ifdef FIX_488_SYNC_DELAY
    {
        .id = CmdLnOptionId_syncMdDelay,
        .match = "sync_md_delay",
        .matchShort = "smd",
        .description = "Metadata Synchronization Delay in ms",
    },
#endif
};


@@ -1236,7 +1250,11 @@ int main(
            }
        }

#ifdef FIX_488_SYNC_DELAY
        if ( IVAS_REND_GetSamples( hIvasRend, args.syncMdDelay, outBuffer ) != IVAS_ERR_OK )
#else
        if ( IVAS_REND_GetSamples( hIvasRend, outBuffer ) != IVAS_ERR_OK )
#endif
        {
            fprintf( stderr, "Error in getting samples\n" );
            exit( -1 );
@@ -1900,6 +1918,10 @@ static CmdlnArgs defaultArgs(

    args.lfeCustomRoutingEnabled = false;
    clearString( args.inLfePanningMatrixFile );

#ifdef FIX_488_SYNC_DELAY
    args.syncMdDelay = 0;
#endif
    return args;
}

@@ -2029,6 +2051,12 @@ static void parseOption(
                exit( -1 );
            }
            break;
#ifdef FIX_488_SYNC_DELAY
        case CmdLnOptionId_syncMdDelay:
            assert( numOptionValues == 1 );
            args->syncMdDelay = (int16_t) floor( strtof( optionValues[0], NULL ) / 5 );
            break;
#endif
        default:
            assert( 0 && "This should be unreachable - all command line options should be explicitly handled." );
            break;
+1 −1
Original line number Diff line number Diff line
@@ -159,7 +159,7 @@
#define FIX_TCX_LOWRATE_LIMITATION                      /* VA: issue 577: TCX bitrate limitation only when DEBUGGING is active */
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/


#define FIX_488_SYNC_DELAY                             /* Eri: Issue 488: Waveform and MD desynchronized in external renderer */
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */

+10 −2
Original line number Diff line number Diff line
@@ -615,6 +615,9 @@ ivas_error ivas_td_binaural_renderer_ext(
    const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i  : Combined head and external orientations */
    const IVAS_REND_AudioObjectPosition *currentPos,             /* i  : Object position                   */
    const REVERB_HANDLE hReverb,                                 /* i  : Reverberator handle               */
#ifdef FIX_488_SYNC_DELAY
    const ism_md_subframe_update_ext,
#endif
    const int16_t output_frame, /* i  : output frame length               */
    float output[][L_FRAME48k]  /* i/o: SCE channels / Binaural synthesis */
)
@@ -627,7 +630,9 @@ ivas_error ivas_td_binaural_renderer_ext(
    IVAS_REND_AudioConfigType inConfigType;
    AUDIO_CONFIG transport_config;
    ivas_error error;
#ifndef FIX_488_SYNC_DELAY
    int16_t ism_md_subframe_update_ext;
#endif
    float *p_output[MAX_OUTPUT_CHANNELS];
    int16_t ch;

@@ -641,7 +646,10 @@ ivas_error ivas_td_binaural_renderer_ext(
    inConfigType = getAudioConfigType( inConfig );
    lfe_idx = LFE_CHANNEL;
    hIsmMetaData[0] = NULL;

#ifndef FIX_488_SYNC_DELAY
    ism_md_subframe_update_ext = 0;
#endif

    if ( inConfigType == IVAS_REND_AUDIO_CONFIG_TYPE_CHANNEL_BASED )
    {
+3 −0
Original line number Diff line number Diff line
@@ -252,6 +252,9 @@ ivas_error ivas_td_binaural_renderer_ext(
    const COMBINED_ORIENTATION_HANDLE *hCombinedOrientationData, /* i  : Combined head and external orientations */
    const IVAS_REND_AudioObjectPosition *currentPos,            /* i  : Object position                         */
    const REVERB_HANDLE hReverb,                                /* i  : Reverberator handle                     */
#ifdef FIX_488_SYNC_DELAY
    const int16_t ism_md_subframe_update_ext,
#endif
    const int16_t output_frame,                                 /* i  : output frame length                     */
    float output[][L_FRAME48k]                                  /* i/o: SCE channels / Binaural synthesis       */
);
+0 −1
Original line number Diff line number Diff line
@@ -342,7 +342,6 @@ typedef struct ivas_render_config_t
#endif
    ivas_roomAcoustics_t roomAcoustics;
    float directivity[3];

} RENDER_CONFIG_DATA, *RENDER_CONFIG_HANDLE;

typedef struct ivas_rev_delay_line_t
Loading