Commit f6a02478 authored by vaclav's avatar vaclav
Browse files

- Merge remote-tracking branch 'remotes/origin/ivas-float-update' into 1957-ref-PortFlpMr2106

parents 2d8f321b ac2ed7d5
Loading
Loading
Loading
Loading
Loading
+0 −157
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ static
 *------------------------------------------------------------------------------------------*/


#ifdef FIX_1053_REVERB_RECONFIGURATION
typedef struct
{
    uint16_t *pID;
@@ -98,7 +97,6 @@ typedef struct
    uint16_t selected;
    uint16_t frameCounter;
} AcousticEnvironmentSequence;
#endif

typedef struct
{
@@ -130,11 +128,7 @@ typedef struct
    bool customLsOutputEnabled;
    char *customLsSetupFilename;
    int16_t orientation_tracking;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool non_diegetic_pan_enabled;
#else
    int16_t Opt_non_diegetic_pan;
#endif
    float non_diegetic_pan_gain;
    bool renderConfigEnabled;
    char *renderConfigFilename;
@@ -153,16 +147,8 @@ typedef struct
    uint16_t tsmScale;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    AcousticEnvironmentSequence aeSequence;
#else
    uint16_t acousticEnvironmentId;
#endif
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    bool dpidEnabled;
#else
    int16_t Opt_dpid_on;
#endif
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];

} DecArguments;
@@ -299,11 +285,7 @@ int main(
    if ( arg.hrtfReaderEnabled )
    {
        /* sanity check */
#ifdef NONBE_1293_SR_HRTF
        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 != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
#else
        if ( arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_IR && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#endif
        {
            arg.hrtfReaderEnabled = false;
            fprintf( stderr, "\nError: HRTF binary file cannot be used in this output configuration.\n\n" );
@@ -418,32 +400,6 @@ int main(
        }
    }

#ifndef FIX_1158_FASTCONV_REVERB_HRTF
    /*------------------------------------------------------------------------------------------*
     * Open renderer configuration reader file
     *------------------------------------------------------------------------------------------*/

    if ( arg.renderConfigEnabled )
    {
        /* sanity check */
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        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 != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false )
#else
        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 != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
             arg.Opt_non_diegetic_pan == 0 )
#endif
        {
            fprintf( stderr, "\nError: Renderer configuration file cannot be used in this output configuration.\n\n" );
            goto cleanup;
        }

        if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
            goto cleanup;
        }
    }
#endif

    /*------------------------------------------------------------------------------------------*
     * Configure the decoder
@@ -451,19 +407,9 @@ int main(

    asked_frame_size = arg.renderFramesize;

#ifdef FIX_1053_REVERB_RECONFIGURATION
    uint16_t aeID = arg.aeSequence.count > 0 ? arg.aeSequence.pID[0] : 65535;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, arg.customLsOutputEnabled, arg.hrtfReaderEnabled, arg.enableHeadRotation, arg.enableExternalOrientation, arg.orientation_tracking, arg.renderConfigEnabled, arg.non_diegetic_pan_enabled, arg.non_diegetic_pan_gain,
                                       arg.dpidEnabled, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, 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, aeID, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
#endif
#else
    if ( ( error = IVAS_DEC_Configure( hIvasDec, arg.output_Fs, arg.outputConfig, arg.tsmEnabled, arg.renderFramesize, 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 )
#endif
    {
        fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
@@ -616,15 +562,11 @@ int main(
        }
    }
#else
#ifdef FIX_VOIP_FUNCTIONS
    if ( ( error = IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nIVAS_DEC_PrintConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
        goto cleanup;
    }
#else
    IVAS_DEC_PrintConfig( hIvasDec, 1, arg.voipMode );
#endif
#endif

    /*-------------------------------------------------------------------*
@@ -636,13 +578,7 @@ int main(
        IVAS_RENDER_CONFIG_DATA renderConfig;

        /* sanity check */
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        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 != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM && arg.non_diegetic_pan_enabled == false )
#else
        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 != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED && arg.outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM &&
             arg.Opt_non_diegetic_pan == 0 )
#endif
        {
            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;
@@ -654,13 +590,11 @@ int main(
            goto cleanup;
        }

#ifdef FIX_1158_FASTCONV_REVERB_HRTF
        if ( ( error = RenderConfigReader_open( arg.renderConfigFilename, &renderConfigReader ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError: Can't open Renderer configuration file %s \n\n", arg.renderConfigFilename );
            goto cleanup;
        }
#endif

        if ( RenderConfigReader_read( renderConfigReader, arg.renderConfigFilename, &renderConfig ) != IVAS_ERR_OK )
        {
@@ -674,13 +608,11 @@ int main(
            goto cleanup;
        }

#ifdef CONF_DISTATT
        if ( ( error = RenderConfigReader_getDistanceAttenuation( renderConfigReader, renderConfig.distAtt ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get Distance Attenuation \n\n" );
            goto cleanup;
        }
#endif

        if ( ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
@@ -709,11 +641,7 @@ int main(

        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.acousticEnvironmentId, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
#endif
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
                {
@@ -723,16 +651,9 @@ int main(
            }
            else
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
#else
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", arg.acousticEnvironmentId );
#endif
                goto cleanup;
            }
#ifndef FIX_587_DEFAULT_REVERB
            renderConfig.roomAcoustics.override = true;
#endif
        }

        /* ISAR frame size is set from command line, not renderer config file.
@@ -937,13 +858,11 @@ cleanup:

    free( pcmBuf );

#ifdef FIX_1053_REVERB_RECONFIGURATION
    if ( arg.aeSequence.count > 0 )
    {
        free( arg.aeSequence.pID );
        free( arg.aeSequence.pValidity );
    }
#endif

#ifdef DEBUG_SBA_AUDIO_DUMP
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );
@@ -1144,20 +1063,12 @@ static bool parseCmdlIVAS_dec(

    arg->renderConfigEnabled = false;
    arg->renderConfigFilename = NULL;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->dpidEnabled = false;
#else
    arg->Opt_dpid_on = 0;
#endif

    arg->outputMdFilename = NULL;

    arg->inputFormat = IVAS_DEC_INPUT_FORMAT_G192;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
    arg->non_diegetic_pan_enabled = false;
#else
    arg->Opt_non_diegetic_pan = 0;
#endif
    arg->non_diegetic_pan_gain = 0.f;
    arg->tsmEnabled = false;
    arg->renderFramesize = IVAS_RENDER_FRAMESIZE_20MS;
@@ -1168,15 +1079,11 @@ static bool parseCmdlIVAS_dec(
    arg->tsmScaleFileName = NULL;
#endif
#endif
#ifdef FIX_1053_REVERB_RECONFIGURATION
    arg->aeSequence.count = 0;
    arg->aeSequence.pID = NULL;
    arg->aeSequence.pValidity = NULL;
    arg->aeSequence.selected = 0;
    arg->aeSequence.frameCounter = 0;
#else
    arg->acousticEnvironmentId = 65535;
#endif
    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
        arg->directivityPatternId[i] = 65535;
@@ -1500,11 +1407,7 @@ static bool parseCmdlIVAS_dec(
        else if ( strcmp( argv_to_upper, "-NON_DIEGETIC_PAN" ) == 0 )
        {
            i++;
#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->non_diegetic_pan_enabled = true;
#else
            arg->Opt_non_diegetic_pan = 1;
#endif
            strncpy( argv_to_upper, argv[i], sizeof( argv_to_upper ) - 1 );
            argv_to_upper[sizeof( argv_to_upper ) - 1] = '\0';
            to_upper( argv_to_upper );
@@ -1562,7 +1465,6 @@ static bool parseCmdlIVAS_dec(

            if ( !is_digits_only( argv[i] ) )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                uint16_t k;
                char *s = argv[i];
                char *token = argv[i];
@@ -1622,14 +1524,8 @@ static bool parseCmdlIVAS_dec(
                    usage_dec();
                    return false;
                }
#else
                fprintf( stdout, "Error: Invalid acoustic environment ID specified: %s\n\n", argv[i] );
                usage_dec();
                return false;
#endif
            }

#ifdef FIX_1053_REVERB_RECONFIGURATION
            else
            {
                /* A single acoustic environment */
@@ -1644,19 +1540,12 @@ static bool parseCmdlIVAS_dec(
                arg->aeSequence.pID[0] = (int16_t) atoi( argv[i++] );
                arg->aeSequence.pValidity[0] = 0;
            }
#else
            arg->acousticEnvironmentId = (int16_t) atoi( argv[i++] );
#endif
        }
        else if ( strcmp( argv_to_upper, "-DPID" ) == 0 )
        {
            int16_t id, tmp;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
            arg->dpidEnabled = true;
#else
            arg->Opt_dpid_on = 1;
#endif
            ++i;
            tmp = 0;
            while ( is_number( argv[i + tmp] ) && tmp < IVAS_MAX_NUM_OBJECTS )
@@ -1737,11 +1626,7 @@ static bool parseCmdlIVAS_dec(
        }
        i++;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled && arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO )
#else
        if ( ( arg->Opt_non_diegetic_pan ) && ( arg->outputConfig != IVAS_AUDIO_CONFIG_STEREO ) )
#endif
        {
            fprintf( stderr, "Error: non-diegetic panning is supported in stereo only\n\n" );
            usage_dec();
@@ -1759,11 +1644,7 @@ static bool parseCmdlIVAS_dec(
        arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
        arg->decMode = IVAS_DEC_MODE_EVS;

#ifdef FIX_745_FIX_DATA_TYPE_CONVERSION
        if ( arg->non_diegetic_pan_enabled )
#else
        if ( ( arg->Opt_non_diegetic_pan ) )
#endif
        {
            arg->outputConfig = IVAS_AUDIO_CONFIG_STEREO;
        }
@@ -1898,15 +1779,11 @@ static void usage_dec( void )
    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" );
#ifdef FIX_1053_REVERB_RECONFIGURATION
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number > 0) or\n" );
    fprintf( stdout, "                      a sequence thereof in the format [ID1:duration1,ID2:duration2...]\n" );
    fprintf( stdout, "                      without braces and spaces, with ':' character separating ID from duration and ',' separating\n" );
    fprintf( stdout, "                      ID and duration pairs, where duration is specified in frames\n" );
    fprintf( stdout, "                      for BINAURAL_ROOM_REVERB output configuration.\n" );
#else
    fprintf( stdout, "-aeid ID            : Acoustic environment ID (number >= 0) for BINAURAL_ROOM_REVERB output configuration\n" );
#endif
    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" );
    fprintf( stdout, "-q                  : Quiet mode, no frame counter\n" );
@@ -2179,12 +2056,8 @@ static ivas_error initOnFirstGoodFrame(

                for ( int16_t j = 0; j < numInitialBadFrames; ++j )
                {
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    float delayMs = (float) ( pFullDelayNumSamples[0] ) / (float) ( *delayTimeScale );
                    if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = MasaFileWriter_writeFrame( *ppMasaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
                        return error;
@@ -2269,7 +2142,6 @@ static ivas_error decodeG192(
    int16_t vec_pos_update, vec_pos_len;
    SplitFileReadWrite *splitRendWriter = NULL;
    int16_t isSplitRend, isSplitCoded;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;

@@ -2305,7 +2177,6 @@ static ivas_error decodeG192(
            goto cleanup;
        }
    }
#endif

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
    {
@@ -2507,7 +2378,6 @@ static ivas_error decodeG192(
        {
            if ( needNewFrame )
            {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB && renderConfigReader != NULL &&
                     arg.aeSequence.count > 0 && arg.aeSequence.pValidity[arg.aeSequence.selected] != 0 )
                {
@@ -2538,7 +2408,6 @@ static ivas_error decodeG192(
                        }
                    }
                }
#endif
#ifdef DEBUGGING
#ifdef VARIABLE_SPEED_DECODING
                if ( arg.tsmScaleFileEnabled )
@@ -2720,7 +2589,6 @@ static ivas_error decodeG192(
            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

@@ -2729,7 +2597,6 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif

                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
@@ -2737,12 +2604,8 @@ static ivas_error decodeG192(
                    goto cleanup;
                }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
@@ -2869,7 +2732,6 @@ static ivas_error decodeG192(
            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

@@ -2877,18 +2739,13 @@ static ivas_error decodeG192(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
@@ -2964,9 +2821,7 @@ static ivas_error decodeG192(

cleanup:

#ifdef FIX_1053_REVERB_RECONFIGURATION
    RenderConfigReader_close( &renderConfigReader );
#endif
    split_rend_reader_writer_close( &splitRendWriter );
    AudioFileWriter_close( &afWriter );
    MasaFileWriter_close( &masaWriter );
@@ -3539,7 +3394,6 @@ static ivas_error decodeVoIP(
                if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
                {
                    IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    int16_t fullDelayNumSamples[3];
                    float delayMs;

@@ -3548,18 +3402,13 @@ static ivas_error decodeVoIP(
                    {
                        fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                    }
#endif
                    if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 1 ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                    delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                    if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                    if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                    {
                        fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                        goto cleanup;
@@ -3636,7 +3485,6 @@ static ivas_error decodeVoIP(
            if ( bsFormat == IVAS_DEC_BS_MASA || bsFormat == IVAS_DEC_BS_MASA_ISM )
            {
                IVAS_MASA_DECODER_EXT_OUT_META_HANDLE hMasaExtOutMeta;
#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                int16_t fullDelayNumSamples[3];
                float delayMs;

@@ -3645,19 +3493,14 @@ static ivas_error decodeVoIP(
                {
                    fprintf( stderr, "\nUnable to get delay of decoder: %s\n", ivas_error_to_string( error ) );
                }
#endif
                if ( ( error = IVAS_DEC_GetMasaMetadata( hIvasDec, &hMasaExtOutMeta, 0 ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError in IVAS_DEC_GetMasaMetadata: %s\n", IVAS_DEC_GetErrorMessage( error ) );
                    goto cleanup;
                }

#ifdef NONBE_FIX_984_OMASA_EXT_OUTPUT
                delayMs = (float) ( fullDelayNumSamples[0] ) / (float) ( delayTimeScale );
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta, &delayMs ) ) != IVAS_ERR_OK )
#else
                if ( ( error = MasaFileWriter_writeFrame( masaWriter, hMasaExtOutMeta ) ) != IVAS_ERR_OK )
#endif
                {
                    fprintf( stderr, "\nError writing MASA metadata to file: %s\n", MasaFileWriter_getFilePath( masaWriter ) );
                    goto cleanup;
+0 −62

File changed.

Preview size limit exceeded, changes collapsed.

+3 −10
Original line number Diff line number Diff line
@@ -552,9 +552,6 @@ ivas_error config_acelp1(
    const int16_t tdm_lp_reuse_flag,        /* i  : LPC reuse flag (can be 1 only with secondary channel */
    const int16_t tdm_low_rate_mode,        /* i  : secondary channel low rate mode flag */
    const int16_t idchan,                   /* i  : stereo channel ID               */
#ifndef NONBE_1325_TD_STEREO_QUANT_LSF_SEC
    const int16_t active_cnt, /* i  : Active frame counter            */
#endif
    const int16_t tdm_Pitch_reuse_flag,     /* i  : primary channel pitch reuse flag*/
    const int16_t tdm_LRTD_flag,            /* i  : LRTD stereo mode flag           */
    const int16_t GSC_IVAS_mode             /* i  : GSC IVAS mode                   */
@@ -772,11 +769,7 @@ ivas_error config_acelp1(

            bits -= acelp_cfg->mid_lsf_bits;
        }
#ifdef NONBE_1325_TD_STEREO_QUANT_LSF_SEC
        else if ( tdm_lp_reuse_flag == 1 && idchan == 1 )
#else
        else if ( tdm_lp_reuse_flag == 1 && idchan == 1 && active_cnt != 1 )
#endif
        {
            bits -= TDM_IC_LSF_PRED_BITS;
        }
+0 −8
Original line number Diff line number Diff line
@@ -4549,11 +4549,6 @@ ivas_error preview_indices(
            case SID_ISM:
                st_ivas->ivas_format = ISM_FORMAT;
                break;
#ifndef FIX_1209_SID_SIGNALING
            case SID_MULTICHANNEL:
                st_ivas->ivas_format = MC_FORMAT;
                break;
#endif
            case SID_SBA_1TC:
                st_ivas->ivas_format = SBA_FORMAT;
                st_ivas->element_mode_init = IVAS_SCE;
@@ -4578,9 +4573,6 @@ ivas_error preview_indices(
                }
                break;
            default:
#ifndef FIX_1209_SID_SIGNALING
                /* This should actually be impossible, since only 3 bits are read, so if this happens something is broken */
#endif
                return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Invalid value %c found in SID format field.", st_ivas->sid_format );
        }
    }
+0 −5
Original line number Diff line number Diff line
@@ -300,9 +300,6 @@ typedef enum

typedef struct _IVAS_ROOM_ACOUSTICS_CONFIG
{
#ifndef FIX_587_DEFAULT_REVERB
    int16_t override;
#endif
    int16_t nBands;                                   /* Number of frequency bands for which reverb properties are provided, integer, range [2..256]        */
    float pFc_input[IVAS_CLDFB_NO_CHANNELS_MAX];      /* Center frequencies for which following values are provided:                                        */
    float pAcoustic_rt60[IVAS_CLDFB_NO_CHANNELS_MAX]; /*  - The room's T60 per center frequency                                                             */
@@ -327,9 +324,7 @@ typedef struct _IVAS_RENDER_CONFIG
    IVAS_ROOM_ACOUSTICS_CONFIG_DATA roomAcoustics;
    ISAR_SPLIT_REND_CONFIG_DATA split_rend_config;
    float directivity[IVAS_MAX_NUM_OBJECTS * 3];
#ifdef CONF_DISTATT
    float distAtt[3];
#endif
} IVAS_RENDER_CONFIG_DATA, *IVAS_RENDER_CONFIG_HANDLE;

typedef struct
Loading