Commit cdc073c7 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branches 'float-1342-proper-flush-in-sr' and 'main' of...

Merge branches 'float-1342-proper-flush-in-sr' and 'main' of https://forge.3gpp.org/rep/ivas-codec-pc/ivas-codec
parents b9991916 5696573d
Loading
Loading
Loading
Loading
Loading
+112 −20
Original line number Diff line number Diff line
@@ -175,11 +175,7 @@ typedef struct

static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg );
static void usage_dec( void );
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf );
#else
static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf );
#endif
static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtf, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, ObjectEditFileReader *objectEditFileReader, ISAR_SPLIT_REND_BITS_DATA *splitRendBits, IVAS_DEC_HANDLE *phIvasDec, int16_t *pcmBuf );
static ivas_error load_hrtf_from_file( IVAS_DEC_HRTF_BINARY_WRAPPER *hHrtfBinary, IVAS_DEC_HANDLE hIvasDec, const IVAS_AUDIO_CONFIG OutputConfig, const int32_t output_Fs );
#ifdef DEBUGGING
@@ -187,6 +183,9 @@ static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBs
static int16_t app_own_random( int16_t *seed );
#endif
static void do_object_editing( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );
#ifdef FIX_FMSW_DEC_EXT
static ivas_error updateOnFormatSwitching( IVAS_DEC_HANDLE hIvasDec, IVAS_DEC_BS_FORMAT *pBsFormat, const char *outputWavFilename, MasaFileWriter **ppMasaWriter, IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], int16_t *pNumOutChannels, uint16_t *pNumObj, const bool delayCompensationEnabled );
#endif


/*------------------------------------------------------------------------------------------*
@@ -781,11 +780,7 @@ int main(
    }
    else
    {
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
        error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, &hIvasDec, pcmBuf );
#else
        error = decodeG192( arg, hBsReader, &hHrtfBinary, headRotReader, externalOrientationFileReader, refRotReader, referenceVectorReader, objectEditFileReader, &splitRendBits, hIvasDec, pcmBuf );
#endif
    }

    if ( error == IVAS_ERR_OK || error == IVAS_ERR_END_OF_FILE )
@@ -814,8 +809,8 @@ int main(
    {
        fprintf( stdout, "Clipping (saturation) detected: %d samples clipped!!!\n\n", noClipping );
    }
#endif

#endif
    /*------------------------------------------------------------------------------------------*
     * Close files and deallocate resources
     *------------------------------------------------------------------------------------------*/
@@ -848,7 +843,6 @@ cleanup:
    IVAS_DEC_GetSbaDebugParams( hIvasDec, &numOutChannels, &numTransportChannels, &pca_ingest_channels );

#endif

    IVAS_DEC_Close( &hIvasDec );
    CustomLsReader_close( &hLsCustomReader );
    hrtfFileReader_close( &hrtfReader );
@@ -2232,11 +2226,7 @@ static ivas_error decodeG192(
    Vector3PairFileReader *referenceVectorReader,
    ObjectEditFileReader *objectEditFileReader,
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits,
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    IVAS_DEC_HANDLE *phIvasDec,
#else
    IVAS_DEC_HANDLE hIvasDec,
#endif
    int16_t *pcmBuf )

{
@@ -2244,9 +2234,7 @@ static ivas_error decodeG192(
    uint16_t bit_stream[IVAS_MAX_BITS_PER_FRAME + 4 * 8];
    int16_t i, num_bits;
    int16_t bfi = 0;
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    IVAS_DEC_HANDLE hIvasDec = *phIvasDec;
#endif
#ifdef DEBUGGING
    int16_t fec_seed = 12558; /* FEC_SEED */
#endif
@@ -2277,7 +2265,9 @@ static ivas_error decodeG192(
    int16_t vec_pos_update, vec_pos_len;
    SplitFileReadWrite *splitRendWriter = NULL;
    int16_t isSplitRend, isSplitCoded;
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
#ifdef FIX_FMSW_DEC_EXT
    bool restartNeeded = false;
#else
    bool restartNeeded;
#endif

@@ -2412,9 +2402,9 @@ static ivas_error decodeG192(
            goto cleanup;
        }
    }

#endif
#endif

    /*------------------------------------------------------------------------------------------*
     * Loop for every packet (frame) of bitstream data
     * - Read the bitstream packet
@@ -2609,7 +2599,6 @@ static ivas_error decodeG192(
                    return error;
                }

#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( ( error = IVAS_DEC_isRestartNeeded( hIvasDec, &restartNeeded ) ) != IVAS_ERR_OK )
                {
                    return error;
@@ -2623,7 +2612,6 @@ static ivas_error decodeG192(
                        goto cleanup;
                    }
                }
#endif

                /* Placeholder for memory reallocation */
                /* ... */
@@ -2749,6 +2737,18 @@ static ivas_error decodeG192(
            }
        }

#ifdef FIX_FMSW_DEC_EXT
        /* Output writing update in case of format switching and EXTERNAL output */
        if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( ( error = updateOnFormatSwitching( hIvasDec, &bsFormat, arg.outputWavFilename, &masaWriter, ismWriters, &nOutChannels, &numObj, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in updateOnFormatSwitching(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }
#endif

        /* Write current frame */
        if ( decodedGoodFrame )
        {
@@ -3261,7 +3261,11 @@ static ivas_error decodeVoIP(
    int16_t i;
    IVAS_DEC_HANDLE hIvasDec = *phIvasDec;

#ifdef FIX_FMSW_DEC_EXT
    bool restartNeeded = false;
#else
    bool restartNeeded;
#endif
    IVAS_RTP ivasRtp = { 0 };
    IVAS_RTP srRtp = { 0 };
    IVAS_RTP_SR_INFO srInfo = { true, false, 0, 20, IVAS_SR_TRANSPORT_LCLD };
@@ -3751,6 +3755,18 @@ static ivas_error decodeVoIP(
            }
        }

#ifdef FIX_FMSW_DEC_EXT
        /* Output writing update in case of format switching and EXTERNAL output */
        if ( restartNeeded && arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
            if ( ( error = updateOnFormatSwitching( hIvasDec, &bsFormat, arg.outputWavFilename, &masaWriter, ismWriters, &nOutChannels, &numObj, arg.delayCompensationEnabled ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Error in updateOnFormatSwitching(): %s\n", IVAS_DEC_GetErrorMessage( error ) );
                goto cleanup;
            }
        }
#endif

        /* Write current frame */
        if ( !srRtp.hPack && decodedGoodFrame )
        {
@@ -4390,4 +4406,80 @@ static ivas_error load_hrtf_from_file(
    return IVAS_ERR_OK;
}

#ifdef FIX_FMSW_DEC_EXT

/*---------------------------------------------------------------------*
 * updateOnFormatSwitching()
 *
 * In case of IVAS format switching and EXTERNAL output,
 * update decoder wrt. output writing
 *---------------------------------------------------------------------*/

static ivas_error updateOnFormatSwitching(
    IVAS_DEC_HANDLE hIvasDec,                        /* i/o: IVAS decoder handle                             */
    IVAS_DEC_BS_FORMAT *pBsFormat,                   /* o  : format of currently decoded bitstream           */
    const char *outputWavFilename,                   /* i  : name of the output audio file                   */
    MasaFileWriter **ppMasaWriter,                   /* o  : MasaFileWriter handle                           */
    IsmFileWriter *ismWriters[IVAS_MAX_NUM_OBJECTS], /* o  : 1-4 ismWriters handles                          */
    int16_t *pNumOutChannels,                        /* o  : number of output channels                       */
    uint16_t *pNumObj,                               /* o  : number of ISM objects                           */
    const bool delayCompensationEnabled              /* i  : is delay compensation enabled                   */
)
{
    ivas_error error;

    /* in case of EXT output, the number of output audio channels can change */
    if ( ( error = IVAS_DEC_GetNumOutputChannels( hIvasDec, pNumOutChannels ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_GetNumOutputChannels, code: %d\n", error );
        return error;
    }

    /* Get the format of currently decoded bitstream */
    if ( ( error = IVAS_DEC_GetFormat( hIvasDec, pBsFormat ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError in IVAS_DEC_GetFormat, code: %d\n", error );
        return error;
    }

    *pNumObj = 0;
    if ( *pBsFormat == IVAS_DEC_BS_OBJ || *pBsFormat == IVAS_DEC_BS_MASA_ISM || *pBsFormat == IVAS_DEC_BS_SBA_ISM )
    {
        if ( ( error = IVAS_DEC_GetNumObjects( hIvasDec, pNumObj ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nError in IVAS_DEC_GetNumObjects: %s\n", IVAS_DEC_GetErrorMessage( error ) );
            return error;
        }

        /* If outputting ISM/OMASA/OSBA, ensure the output metadata files are opened */
        for ( int16_t i = 0; i < *pNumObj; ++i )
        {
            if ( ismWriters[i] == NULL )
            {
                if ( ( error = IsmFileWriter_open( outputWavFilename, i, &ismWriters[i] ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nError: Error opening ISM decoded metadata file %s\n", IsmFileWriter_getFilePath( ismWriters[i] ) );
                    return error;
                }
            }
        }
    }

    /* If outputting MASA, ensure the output file metadata is opened */
    if ( *pBsFormat == IVAS_DEC_BS_MASA || *pBsFormat == IVAS_DEC_BS_MASA_ISM )
    {
        if ( ppMasaWriter != NULL )
        {
            if ( ( error = MasaFileWriter_open( outputWavFilename, delayCompensationEnabled, ppMasaWriter ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nError: Error opening MASA decoded metadata file %s\n", MasaFileWriter_getFilePath( *ppMasaWriter ) );
                return error;
            }
        }
    }

    return IVAS_ERR_OK;
}
#endif

#undef WMC_TOOL_SKIP
+0 −8
Original line number Diff line number Diff line
@@ -1022,21 +1022,13 @@ static Word16 Find_bit_alloc_IVAS(
            sum_bit = L_add( sum_bit, L_sub( bits_per_bands[i], Q18_112 ) );
            /* bits_per_bands[i] = 112; */
            bits_per_bands[i] = Q18_112;
#ifndef FIX_2585_BIT_ALLOCATION_DIFF
            j = add( j, add( i, 1 ) );
#else
            j = add( i, 1 );
#endif
        }
        /* safety check for overage bit reallocation */
        /* else if (bits_per_bands[i] + sum_bit / 3 > 112) */
        else if ( L_add( bits_per_bands[i], Mpy_32_16_1( sum_bit, Q15_0_33 ) ) > Q18_112 )
        {
#ifndef FIX_2585_BIT_ALLOCATION_DIFF
            j = add( j, add( i, 1 ) );
#else
            j = add( i, 1 );
#endif
        }
    }

+3 −2
Original line number Diff line number Diff line
@@ -164,7 +164,6 @@
/*#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR*/      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering; disabled, superseded by FIX_1342_PROPER_FLUSH_IN_SR */
#define FIX_1342_PROPER_FLUSH_IN_SR                  /* FhG: Proper implementation of decoder flush with split rendering, using isar_render_poses + isar_generate_metadata_and_bitstream */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define FIX_FLOAT_1539_G192_FORMAT_SWITCH               /* Nokia: reintroduce format switching for g192 bitstreams */

/* #################### End BE switches ################################## */

@@ -172,7 +171,9 @@
/* any switch which is non-be wrt. TS 26.258 V3.0 */

#define FIX_1576_LCLD_CRASH_DIFFERENT_CODEC_ISAR_FRAME_SIZE  /* Dolby: float issue 1576: fix for crash in LCLD mode when codec frame size is less than isar frame size */
#define FIX_2585_BIT_ALLOCATION_DIFF                    /* VA : issue 2585, bit allocation different behaviors between float and fixed-point for corner cases */
#define FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI         /* Nokia: BASOP issue 2442: Aligns float with identical diffuse gain limitation to minimize diff */
#define FIX_FMSW_DEC_EXT                                /* float issue 1566: fix EXT output in format switching */
#define FIX_BASOP_2612_RESET_DECIM_MEM                  /* FhG: BASOP #2612: reset (zero) the 16k resampler memory of the secondary channel on DFT->TD stereo switch (otherwise -> fx overshoot) */

/* ##################### End NON-BE switches ########################### */

+20 −174
Original line number Diff line number Diff line
@@ -106,9 +106,6 @@ ivas_error ivas_dec_get_format(
    int16_t nchan_ism, element_mode_flag;
    int16_t sba_order, sba_planar, sba_analysis_order;
    int32_t ivas_total_brate;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    int16_t Opt_tsm;
#endif
    uint16_t *bit_stream_orig;
    AUDIO_CONFIG signaled_config;
    ivas_error error;
@@ -117,9 +114,6 @@ ivas_error ivas_dec_get_format(
    element_mode_flag = 0;

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    Opt_tsm = st_ivas->hDecoderConfig->Opt_tsm;
#endif
    bit_stream_orig = st_ivas->bit_stream;

    /*-------------------------------------------------------------------*
@@ -135,23 +129,9 @@ ivas_error ivas_dec_get_format(
         !( st_ivas->ivas_format == MASA_FORMAT && st_ivas->last_ivas_format == MASA_ISM_FORMAT ) &&
         !( st_ivas->ivas_format == MASA_ISM_FORMAT && st_ivas->last_ivas_format == MASA_FORMAT ) )
    {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
        if ( Opt_tsm )
        {
#endif
        st_ivas->restartNeeded = 1;

        return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
        }
        else
        {
#ifdef DEBUGGING
            fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
            return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
        }
#endif
    }

    /*-------------------------------------------------------------------*
@@ -185,23 +165,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
                }
#endif
            }

            st_ivas->nchan_ism = nchan_ism;
@@ -221,23 +187,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && sba_planar != st_ivas->sba_planar )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA planar/3D layout is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA planar flag signalled!" );
                }
#endif
            }

            /* read Ambisonic (SBA) order */
@@ -246,23 +198,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
                }
#endif
            }

            sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, sba_order );
@@ -275,11 +213,7 @@ ivas_error ivas_dec_get_format(
            /* read number of MASA transport channels */
            if ( st_ivas->bit_stream[( ivas_total_brate / FRAMES_PER_SEC ) - 1] )
            {
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( st_ivas->nchan_transport == 1 )
#else
                if ( st_ivas->nchan_transport == 1 && Opt_tsm )
#endif
                {
                    masaRestartCandidate = 1;
                }
@@ -289,11 +223,7 @@ ivas_error ivas_dec_get_format(
            }
            else
            {
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( st_ivas->nchan_transport == 2 )
#else
                if ( st_ivas->nchan_transport == 2 && Opt_tsm )
#endif
                {
                    masaRestartCandidate = 1;
                }
@@ -334,23 +264,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
                }
#endif
            }

            st_ivas->nchan_ism = nchan_ism;
@@ -365,23 +281,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
                }
#endif
            }

            st_ivas->nchan_ism = nchan_ism;
@@ -393,23 +295,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
                }
#endif
            }

            st_ivas->nchan_ism = nchan_ism;
@@ -433,23 +321,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && sba_order != st_ivas->sba_order )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the SBA order is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong SBA order signalled!" );
                }
#endif
            }

            st_ivas->ism_mode = ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->nchan_ism );
@@ -474,23 +348,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && st_ivas->transport_config != signaled_config )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Switching of MC configurations is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "wrong MC configuration signalled!" );
                }
#endif
            }

            st_ivas->mc_mode = ivas_mc_mode_select( ivas_mc_map_output_config_to_mc_ls_setup( signaled_config ), ivas_total_brate );
@@ -572,23 +432,9 @@ ivas_error ivas_dec_get_format(

            if ( st_ivas->ini_frame > 0 && nchan_ism != st_ivas->nchan_ism )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( Opt_tsm )
                {
#endif
                st_ivas->restartNeeded = 1;

                return IVAS_ERR_OK;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                }
                else
                {
#ifdef DEBUGGING
                    fprintf( stderr, "\nError: Changing the number of ISMs is not supported!\n" );
#endif
                    return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong number of objects signalled!" );
                }
#endif
            }

            st_ivas->nchan_ism = nchan_ism;
+3 −0
Original line number Diff line number Diff line
@@ -755,6 +755,9 @@ void stereo_switching_enc(

        /* no secondary channel in the previous frame -> memory resets */
        set_zero( sts[1]->old_inp_12k8, L_INP_MEM );
#ifdef FIX_BASOP_2612_RESET_DECIM_MEM
        set_zero( sts[1]->mem_decim16k, 2 * L_FILT_MAX );
#endif
        set_zero( sts[1]->mem_decim, 2 * L_FILT_MAX );
        sts[1]->mem_preemph = 0;

Loading