Commit 7c74b7b0 authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_FLOAT_1539_G192_FORMAT_SWITCH

parent e030f079
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -159,11 +159,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 );
static void do_object_editing_fx( IVAS_EDITABLE_PARAMETERS *editableParameters, ObjectEditFileReader *objectEditFileReader );
@@ -670,11 +666,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 )
@@ -2002,11 +1994,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 )

{
@@ -2014,9 +2002,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
    AudioFileWriter *afWriter = NULL;
    MasaFileWriter *masaWriter = NULL;
    bool decodedGoodFrame = false;
@@ -2040,9 +2026,7 @@ static ivas_error decodeG192(
    int16_t isSplitRend, isSplitCoded;
    IVAS_RENDER_CONFIG_DATA renderConfig;
    RenderConfigReader *renderConfigReader = NULL;
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    bool restartNeeded;
#endif

#ifdef VARIABLE_SPEED_DECODING
    if ( arg.tsmEnabled )
@@ -2297,7 +2281,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;
@@ -2311,7 +2294,6 @@ static ivas_error decodeG192(
                        goto cleanup;
                    }
                }
#endif

                /* Placeholder for memory reallocation */
                /* ... */
+0 −1
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#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               /* VA/Nokia: reintroduce format switching for g192 bitstreams */
#define HARMONIZE_2595_reconfig_decoder_LPD             /* FhG: Harmonize reconfig_decoder_LPD with its ivas derivate */
#define HARMONIZE_2596_SetModeIndex                     /* FhG: Harmonize SetModeIndex with its ivas derivate */
#define HARMONIZE_2597_ShapeSpectrum                    /* FhG: Harmonize ShapeSpectrum with its ivas derivate */
+0 −157
Original line number Diff line number Diff line
@@ -108,9 +108,6 @@ ivas_error ivas_dec_get_format_fx(
    Word16 nchan_ism, element_mode_flag;
    Word16 sba_order, sba_planar, sba_analysis_order;
    Word32 ivas_total_brate;
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    Word16 Opt_tsm;
#endif
    UWord16 *bit_stream_orig;
    AUDIO_CONFIG signaled_config;
    ivas_error error;
@@ -122,10 +119,6 @@ ivas_error ivas_dec_get_format_fx(

    ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
    move32();
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
    Opt_tsm = st_ivas->hDecoderConfig->Opt_tsm;
    move16();
#endif
    bit_stream_orig = st_ivas->bit_stream;

    /*-------------------------------------------------------------------*
@@ -146,24 +139,10 @@ ivas_error ivas_dec_get_format_fx(
        !( EQ_32( st_ivas->ivas_format, MASA_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_ISM_FORMAT ) ) &&
        !( EQ_32( st_ivas->ivas_format, MASA_ISM_FORMAT ) && EQ_32( st_ivas->last_ivas_format, MASA_FORMAT ) ) )
    {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
        IF( Opt_tsm )
        {
#endif
            st_ivas->restartNeeded = 1;
            move16();

            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
    }

    /*-------------------------------------------------------------------*
@@ -201,24 +180,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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;
@@ -242,24 +207,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( sba_planar, st_ivas->sba_planar ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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 */
@@ -270,24 +221,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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_fx( ivas_total_brate, sba_order );
@@ -303,12 +240,7 @@ ivas_error ivas_dec_get_format_fx(
            k = extract_l( Mpy_32_32_r( ivas_total_brate, ONE_BY_FRAMES_PER_SEC_Q31 ) );
            IF( st_ivas->bit_stream[k - 1] )
            {
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( st_ivas->nchan_transport == 1 )
#else
                test();
                if ( st_ivas->nchan_transport == 1 && Opt_tsm )
#endif
                {
                    masaRestartCandidate = 1;
                    move16();
@@ -321,12 +253,7 @@ ivas_error ivas_dec_get_format_fx(
            }
            ELSE
            {
#ifdef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                if ( st_ivas->nchan_transport == 2 )
#else
                test();
                if ( st_ivas->nchan_transport == 2 && Opt_tsm )
#endif
                {
                    masaRestartCandidate = 1;
                    move16();
@@ -376,24 +303,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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;
@@ -412,24 +325,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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;
@@ -444,24 +343,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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;
@@ -489,24 +374,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( sba_order, st_ivas->sba_order ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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 );
@@ -533,24 +404,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_32( st_ivas->transport_config, signaled_config ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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_fx( ivas_mc_map_output_config_to_mc_ls_setup_fx( signaled_config ), ivas_total_brate );
@@ -649,24 +506,10 @@ ivas_error ivas_dec_get_format_fx(
            test();
            IF( st_ivas->ini_frame > 0 && NE_16( nchan_ism, st_ivas->nchan_ism ) )
            {
#ifndef FIX_FLOAT_1539_G192_FORMAT_SWITCH
                IF( Opt_tsm )
                {
#endif
                    st_ivas->restartNeeded = 1;
                    move16();

                    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;