Commit 42af1165 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

Merge branch 'main' into b_20230817_jbm-for-osba

parents bb8276e5 32aa5004
Loading
Loading
Loading
Loading
+65 −64
Original line number Original line Diff line number Diff line
@@ -96,7 +96,7 @@ typedef struct
    char *outputWavFilename;
    char *outputWavFilename;
    IVAS_DEC_MODE decMode;
    IVAS_DEC_MODE decMode;
    int32_t output_Fs;
    int32_t output_Fs;
    AUDIO_CONFIG outputConfig;
    IVAS_AUDIO_CONFIG outputConfig;
    bool quietModeEnabled;
    bool quietModeEnabled;
    bool delayCompensationEnabled;
    bool delayCompensationEnabled;
    bool voipMode;
    bool voipMode;
@@ -268,11 +268,11 @@ int main(
    }
    }


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    {
    {
        fprintf( stdout, "Output metadata file:   %s\n", arg.outputWavFilename );
        fprintf( stdout, "Output metadata file:   %s\n", arg.outputWavFilename );
    }
    }
    else if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    else if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
    {
        fprintf( stdout, "Output synthesis file:  %s\n", arg.outputWavFilename );
        fprintf( stdout, "Output synthesis file:  %s\n", arg.outputWavFilename );
        fprintf( stdout, "Output metadata file:   %s\n", arg.outputMdFilename );
        fprintf( stdout, "Output metadata file:   %s\n", arg.outputMdFilename );
@@ -290,7 +290,7 @@ int main(
    if ( arg.hrtfReaderEnabled )
    if ( arg.hrtfReaderEnabled )
    {
    {
        /* sanity check */
        /* sanity check */
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            arg.hrtfReaderEnabled = false;
            arg.hrtfReaderEnabled = false;
            fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" );
            fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" );
@@ -312,9 +312,9 @@ int main(
    if ( arg.enableHeadRotation )
    if ( arg.enableHeadRotation )
    {
    {
        /* sanity check */
        /* sanity check */
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
             && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM
             && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
#endif
        )
        )
        {
        {
@@ -336,7 +336,7 @@ int main(
    if ( arg.enableReferenceRotation )
    if ( arg.enableReferenceRotation )
    {
    {
        /* sanity check */
        /* sanity check */
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" );
            fprintf( stderr, "\nError: Reference rotation file cannot be used in this output configuration.\n\n" );
            goto cleanup;
            goto cleanup;
@@ -363,7 +363,7 @@ int main(
    if ( arg.enableReferenceVectorTracking )
    if ( arg.enableReferenceVectorTracking )
    {
    {
        /* sanity check */
        /* sanity check */
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" );
            fprintf( stderr, "\nError: Reference vector trajectory file cannot be used in this output configuration.\n\n" );
            goto cleanup;
            goto cleanup;
@@ -416,9 +416,9 @@ int main(
    if ( arg.renderConfigEnabled )
    if ( arg.renderConfigEnabled )
    {
    {
        /* sanity check */
        /* sanity check */
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
             && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM
             && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM
#endif
#endif
        )
        )
        {
        {
@@ -447,17 +447,17 @@ int main(
    {
    {
        /* sanity check */
        /* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL &&
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR &&
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED &&
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            exit( -1 );
            exit( -1 );
        }
        }
#else
#else
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
            fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
            goto cleanup;
            goto cleanup;
@@ -477,7 +477,7 @@ int main(
     *------------------------------------------------------------------------------------------*/
     *------------------------------------------------------------------------------------------*/


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
    {
        arg.enableHeadRotation = true;
        arg.enableHeadRotation = true;
        if ( arg.enable5ms &&
        if ( arg.enable5ms &&
@@ -514,7 +514,7 @@ int main(
     *------------------------------------------------------------------------------------------*/
     *------------------------------------------------------------------------------------------*/


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
    {
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
        {
@@ -652,14 +652,14 @@ int main(


        /* sanity check */
        /* sanity check */
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB &&
             arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
             arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            fprintf( stderr, "\nExternal Renderer Config is supported only when binaural output configurations is used as output OR when Split rendering mode is enabled. Exiting. \n" );
            goto cleanup;
            goto cleanup;
        }
        }
#else
#else
        if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
            fprintf( stderr, "\nExternal Renderer Config is supported only for binaural output configurations. Exiting. \n\n" );
            goto cleanup;
            goto cleanup;
@@ -688,9 +688,9 @@ int main(
            goto cleanup;
            goto cleanup;
        }
        }


        if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
        {
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.room_acoustics ) ) == IVAS_ERR_OK )
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
            {
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
                {
@@ -707,7 +707,7 @@ int main(
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
                goto cleanup;
                goto cleanup;
            }
            }
            renderConfig.room_acoustics.override = true;
            renderConfig.roomAcoustics.override = true;
        }
        }


        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
@@ -716,6 +716,7 @@ int main(
            goto cleanup;
            goto cleanup;
        }
        }
    }
    }

    /*------------------------------------------------------------------------------------------*
    /*------------------------------------------------------------------------------------------*
     * Load custom loudspeaker layout data
     * Load custom loudspeaker layout data
     *------------------------------------------------------------------------------------------*/
     *------------------------------------------------------------------------------------------*/
@@ -907,10 +908,10 @@ cleanup:
 * Translate command-line argument to output configuration
 * Translate command-line argument to output configuration
 *---------------------------------------------------------------------*/
 *---------------------------------------------------------------------*/


static AUDIO_CONFIG cmdline2config(
static IVAS_AUDIO_CONFIG cmdline2config(
    char *argv )
    char *argv )
{
{
    AUDIO_CONFIG output_config;
    IVAS_AUDIO_CONFIG output_config;


    char argv_to_upper[FILENAME_MAX];
    char argv_to_upper[FILENAME_MAX];


@@ -920,73 +921,73 @@ static AUDIO_CONFIG cmdline2config(


    if ( strcmp( argv_to_upper, "EXT" ) == 0 ) /* external renderer */
    if ( strcmp( argv_to_upper, "EXT" ) == 0 ) /* external renderer */
    {
    {
        output_config = AUDIO_CONFIG_EXTERNAL;
        output_config = IVAS_AUDIO_CONFIG_EXTERNAL;
    }
    }
    else if ( strcmp( argv_to_upper, "MONO" ) == 0 )
    else if ( strcmp( argv_to_upper, "MONO" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_MONO;
        output_config = IVAS_AUDIO_CONFIG_MONO;
    }
    }
    else if ( strcmp( argv_to_upper, "STEREO" ) == 0 )
    else if ( strcmp( argv_to_upper, "STEREO" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_STEREO;
        output_config = IVAS_AUDIO_CONFIG_STEREO;
    }
    }
    else if ( strcmp( argv_to_upper, "5_1" ) == 0 )
    else if ( strcmp( argv_to_upper, "5_1" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_5_1;
        output_config = IVAS_AUDIO_CONFIG_5_1;
    }
    }
    else if ( strcmp( argv_to_upper, "7_1" ) == 0 )
    else if ( strcmp( argv_to_upper, "7_1" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_7_1;
        output_config = IVAS_AUDIO_CONFIG_7_1;
    }
    }
    else if ( strcmp( argv_to_upper, "5_1_2" ) == 0 )
    else if ( strcmp( argv_to_upper, "5_1_2" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_5_1_2;
        output_config = IVAS_AUDIO_CONFIG_5_1_2;
    }
    }
    else if ( strcmp( argv_to_upper, "5_1_4" ) == 0 )
    else if ( strcmp( argv_to_upper, "5_1_4" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_5_1_4;
        output_config = IVAS_AUDIO_CONFIG_5_1_4;
    }
    }
    else if ( strcmp( argv_to_upper, "7_1_4" ) == 0 )
    else if ( strcmp( argv_to_upper, "7_1_4" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_7_1_4;
        output_config = IVAS_AUDIO_CONFIG_7_1_4;
    }
    }
    else if ( strcmp( argv_to_upper, "FOA" ) == 0 )
    else if ( strcmp( argv_to_upper, "FOA" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_FOA;
        output_config = IVAS_AUDIO_CONFIG_FOA;
    }
    }
    else if ( strcmp( argv_to_upper, "HOA2" ) == 0 )
    else if ( strcmp( argv_to_upper, "HOA2" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_HOA2;
        output_config = IVAS_AUDIO_CONFIG_HOA2;
    }
    }
    else if ( strcmp( argv_to_upper, "HOA3" ) == 0 )
    else if ( strcmp( argv_to_upper, "HOA3" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_HOA3;
        output_config = IVAS_AUDIO_CONFIG_HOA3;
    }
    }
    else if ( strcmp( argv_to_upper, "BINAURAL" ) == 0 )
    else if ( strcmp( argv_to_upper, "BINAURAL" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_BINAURAL;
        output_config = IVAS_AUDIO_CONFIG_BINAURAL;
    }
    }
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 )
    else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_CODED" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
        output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED;
    }
    }
    else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 )
    else if ( strcmp( argv_to_upper, "BINAURAL_SPLIT_PCM" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
        output_config = IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM;
    }
    }
#endif
#endif
    else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 )
    else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_IR" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_BINAURAL_ROOM_IR;
        output_config = IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR;
    }
    }
    else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_REVERB" ) == 0 )
    else if ( strcmp( argv_to_upper, "BINAURAL_ROOM_REVERB" ) == 0 )
    {
    {
        output_config = AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
        output_config = IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB;
    }
    }
    else
    else
    {
    {
        output_config = AUDIO_CONFIG_LS_CUSTOM;
        output_config = IVAS_AUDIO_CONFIG_LS_CUSTOM;
    }
    }


    return output_config;
    return output_config;
@@ -1016,7 +1017,7 @@ static bool parseCmdlIVAS_dec(
#endif
#endif
#endif
#endif
    arg->output_Fs = 48000;
    arg->output_Fs = 48000;
    arg->outputConfig = AUDIO_CONFIG_MONO;
    arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
    arg->decMode = IVAS_DEC_MODE_IVAS;
    arg->decMode = IVAS_DEC_MODE_IVAS;
    arg->quietModeEnabled = false;
    arg->quietModeEnabled = false;
    arg->delayCompensationEnabled = true;
    arg->delayCompensationEnabled = true;
@@ -1546,13 +1547,13 @@ static bool parseCmdlIVAS_dec(
    if ( i < argc - 3 )
    if ( i < argc - 3 )
    {
    {
        arg->outputConfig = cmdline2config( argv[i] );
        arg->outputConfig = cmdline2config( argv[i] );
        if ( arg->outputConfig == AUDIO_CONFIG_LS_CUSTOM )
        if ( arg->outputConfig == IVAS_AUDIO_CONFIG_LS_CUSTOM )
        {
        {
            arg->customLsOutputEnabled = true;
            arg->customLsOutputEnabled = true;
            arg->customLsSetupFilename = argv[i];
            arg->customLsSetupFilename = argv[i];
        }
        }
        i++;
        i++;
        if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != AUDIO_CONFIG_STEREO ) )
        if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) )
        {
        {
            fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
            fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
            usage_dec();
            usage_dec();
@@ -1561,11 +1562,11 @@ static bool parseCmdlIVAS_dec(
    }
    }
    else
    else
    {
    {
        arg->outputConfig = AUDIO_CONFIG_MONO;
        arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
        arg->decMode = IVAS_DEC_MODE_EVS;
        arg->decMode = IVAS_DEC_MODE_EVS;
        if ( ( arg->Opt_non_diegetic_pan ) )
        if ( ( arg->Opt_non_diegetic_pan ) )
        {
        {
            arg->outputConfig = AUDIO_CONFIG_STEREO;
            arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO;
        }
        }
    }
    }


@@ -1796,7 +1797,7 @@ static ivas_error initOnFirstGoodFrame(
    }
    }


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
    {
        pFullDelayNumSamples[0] = 0;
        pFullDelayNumSamples[0] = 0;
    }
    }
@@ -1823,7 +1824,7 @@ static ivas_error initOnFirstGoodFrame(
    }
    }


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
    {
        /* Open split rendering metadata writer */
        /* Open split rendering metadata writer */
        int16_t delayNumSamples_temp[3];
        int16_t delayNumSamples_temp[3];
@@ -1835,7 +1836,7 @@ static ivas_error initOnFirstGoodFrame(
            return error;
            return error;
        }
        }


        if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
        {
        {
            if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            if ( ( error = split_rend_writer_open( hSplitRendFileReadWrite, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp ) ) != IVAS_ERR_OK )
            {
            {
@@ -1853,7 +1854,7 @@ static ivas_error initOnFirstGoodFrame(
        }
        }
    }
    }


    if ( arg.outputConfig != AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED )
    {
    {
#endif
#endif
        /* Open audio writer and write all previously skipped bad frames now that frame size is known */
        /* Open audio writer and write all previously skipped bad frames now that frame size is known */
@@ -1933,7 +1934,7 @@ static ivas_error initOnFirstGoodFrame(
    free( zeroBuf );
    free( zeroBuf );


    /* Open other output files if EXT output config - now details about ISM or MASA are known */
    /* Open other output files if EXT output config - now details about ISM or MASA are known */
    if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
    {
        if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK )
        {
        {
@@ -1994,7 +1995,7 @@ static ivas_error initOnFirstGoodFrame(
            if ( numInitialBadFrames > 0 )
            if ( numInitialBadFrames > 0 )
            {
            {
                /* Duplicate good first frame metadata to fill the beginning of stream. */
                /* Duplicate good first frame metadata to fill the beginning of stream. */
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL;
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta = NULL;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2360,7 +2361,7 @@ static ivas_error decodeG192(
            }
            }


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
            if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
            {
            {
                error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec,
                error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec,
                                                            (void *) ( pcmBuf + nOutChannels * nSamplesRendered ),
                                                            (void *) ( pcmBuf + nOutChannels * nSamplesRendered ),
@@ -2456,7 +2457,7 @@ static ivas_error decodeG192(
        if ( decodedGoodFrame )
        if ( decodedGoodFrame )
        {
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
            if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) )
            {
            {
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                         splitRendBits.codec, splitRendBits.pose_correction,
                                                         splitRendBits.codec, splitRendBits.pose_correction,
@@ -2468,7 +2469,7 @@ static ivas_error decodeG192(
            }
            }
            else
            else
            {
            {
                if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
                if ( ( hSplitRendFileReadWrite != NULL ) && ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
                {
                {
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                    if ( split_rend_write_bitstream_to_file( hSplitRendFileReadWrite, splitRendBits.bits_buf, &splitRendBits.bits_read, &splitRendBits.bits_written,
                                                             splitRendBits.codec, splitRendBits.pose_correction,
                                                             splitRendBits.codec, splitRendBits.pose_correction,
@@ -2498,7 +2499,7 @@ static ivas_error decodeG192(
        }
        }


        /* Write ISm metadata to external file(s) */
        /* Write ISm metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            {
            {
@@ -2527,7 +2528,7 @@ static ivas_error decodeG192(
            }
            }
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2664,7 +2665,7 @@ static ivas_error decodeG192(
        }
        }


        /* Write ISm metadata to external file(s) */
        /* Write ISm metadata to external file(s) */
        if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
        if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
        {
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            if ( bsFormat == IVAS_DEC_BS_OBJ )
            {
            {
@@ -2693,7 +2694,7 @@ static ivas_error decodeG192(
            }
            }
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            else if ( bsFormat == IVAS_DEC_BS_MASA )
            {
            {
                MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
@@ -2737,7 +2738,7 @@ static ivas_error decodeG192(
    }
    }


    /* Print output metadata file name(s) */
    /* Print output metadata file name(s) */
    if ( arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
    {
    {
        if ( bsFormat == IVAS_DEC_BS_OBJ )
        if ( bsFormat == IVAS_DEC_BS_OBJ )
        {
        {
@@ -3240,7 +3241,7 @@ static ivas_error decodeVoIP(
            }
            }


            /* Write ISM metadata to external file(s) */
            /* Write ISM metadata to external file(s) */
            if ( decodedGoodFrame && arg.outputConfig == AUDIO_CONFIG_EXTERNAL )
            if ( decodedGoodFrame && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
            {
            {
                int16_t i;
                int16_t i;


@@ -3272,7 +3273,7 @@ static ivas_error decodeVoIP(


                if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
                if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
                {
                {
                    MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                    IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    {
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
Loading