Commit 6451192b authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files
Merge branch 'main' of ssh://forge.3gpp.org:29419/ivas-codec-pc/ivas-codec into float-1521-sba-stereo-loudness
parents 84c8ede2 01809a5c
Loading
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
@@ -621,6 +621,14 @@ int main(
            goto cleanup;
        }

#ifdef FIX_2500_RENDCONF_REFACTOR
        if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Invalid renderer configuration parameters\n\n" );
            goto cleanup;
        }
#endif

        aeCount = RenderConfigReader_getAcousticEnvironmentCount( renderConfigReader );
        if ( aeCount > 0 )
        {
@@ -700,6 +708,13 @@ int main(

        if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_2500_RENDCONF_REFACTOR
            if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
                goto cleanup;
            }
#else
            if ( ( error = IVAS_DEC_GetAcousticEnvironment( hIvasDec, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
@@ -713,6 +728,7 @@ int main(
                fprintf( stderr, "Failed to get acoustic environment with ID: %d\n\n", aeID );
                goto cleanup;
            }
#endif
        }

        /* ISAR frame size is set from command line, not renderer config file.
@@ -2350,6 +2366,14 @@ static ivas_error decodeG192(
            fprintf( stderr, "Failed to read renderer configuration from file %s\n\n", arg.renderConfigFilename );
            goto cleanup;
        }

#ifdef FIX_2500_RENDCONF_REFACTOR
        if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Invalid renderer configuration parameters\n\n" );
            goto cleanup;
        }
#endif
    }

    for ( i = 0; i < IVAS_MAX_NUM_OBJECTS; ++i )
@@ -2549,6 +2573,13 @@ static ivas_error decodeG192(
                            arg.aeSequence.selected = 0;
                        }
                        arg.aeSequence.frameCounter = 0;
#ifdef FIX_2500_RENDCONF_REFACTOR
                        if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK )
                        {
                            fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] );
                            goto cleanup;
                        }
#else
                        if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, arg.aeSequence.pID[arg.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
                        {
                            if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
@@ -2562,6 +2593,7 @@ static ivas_error decodeG192(
                            fprintf( stderr, "Failed to get acoustic environment with ID %d\n\n", arg.aeSequence.pID[arg.aeSequence.selected] );
                            goto cleanup;
                        }
#endif
                        if ( ( error = IVAS_DEC_FeedRenderConfig( hIvasDec, renderConfig ) ) != IVAS_ERR_OK )
                        {
                            fprintf( stderr, "\nIVAS_DEC_FeedRenderConfig failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
+24 −0
Original line number Diff line number Diff line
@@ -1173,6 +1173,14 @@ int main(
            goto cleanup;
        }

#ifdef FIX_2500_RENDCONF_REFACTOR
        if ( RenderConfigReader_checkValues( renderConfigReader ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Invalid renderer configuration parameters\n\n" );
            goto cleanup;
        }
#endif

        if ( ( error = RenderConfigReader_getDirectivity( renderConfigReader, args.directivityPatternId, renderConfig.directivity ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "Failed to get directivity patterns for one or more of IDs: %d %d %d %d\n\n", args.directivityPatternId[0], args.directivityPatternId[1], args.directivityPatternId[2], args.directivityPatternId[3] );
@@ -1188,6 +1196,13 @@ int main(
        if ( args.outConfig.audioConfig == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
            aeID = args.aeSequence.count > 0 ? args.aeSequence.pID[0] : IVAS_DEFAULT_AEID;
#ifdef FIX_2500_RENDCONF_REFACTOR
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK )
            {
                fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID );
                goto cleanup;
            }
#else
            if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, aeID, &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
            {
                if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
@@ -1201,6 +1216,7 @@ int main(
                fprintf( stderr, "\nFailed to get acoustic environment with ID: %d\n\n", aeID );
                goto cleanup;
            }
#endif
        }

        /* ISAR frame size is set from command line, not renderer config file.
@@ -1607,6 +1623,13 @@ int main(
                    args.aeSequence.selected = 0;
                }
                args.aeSequence.frameCounter = 0;
#ifdef FIX_2500_RENDCONF_REFACTOR
                if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.aeSequence.pID[args.aeSequence.selected], &renderConfig.roomAcoustics ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nFailed to get acoustic environment with ID %d\n\n", args.aeSequence.pID[args.aeSequence.selected] );
                    goto cleanup;
                }
#else
                if ( ( error = RenderConfigReader_getAcousticEnvironment( renderConfigReader, args.aeSequence.pID[args.aeSequence.selected], &renderConfig.roomAcoustics ) ) == IVAS_ERR_OK )
                {
                    if ( RenderConfigReader_checkValues( &renderConfig ) != IVAS_ERR_OK )
@@ -1620,6 +1643,7 @@ int main(
                    fprintf( stderr, "\nFailed to get acoustic environment with ID %d\n\n", args.aeSequence.pID[args.aeSequence.selected] );
                    goto cleanup;
                }
#endif
                if ( ( error = IVAS_REND_FeedRenderConfig( hIvasRend, renderConfig ) ) != IVAS_ERR_OK )
                {
                    fprintf( stderr, "\nIVAS_REND_FeedRenderConfig failed: %s\n\n", ivas_error_to_string( error ) );
+3 −0
Original line number Diff line number Diff line
@@ -165,6 +165,8 @@
#define FIX_FLOAT_1560_SVD_NO_OPT_MAX_W_SIGN            /* FhG: float issue 1560: Avoid optimizing the division on the result of maxWithSign() with -funsafe-math-optimizations */
#define FIX_2095_REMOVE_UNUSED_ISAR_TABLES              /* Dolby: remove unused ISAR */
#define FIX_FLOAT_1582_STEREO_DFT_QUANTIZE_ITD          /* FhG: float issue 1582: Remove unncessary statement from stereo_dft_quantize_itd() */
#define FIX_1585_ASAN_FORMAT_SW_ALT                     /* VA: float issue 1585: alternative fix memory leaks with format switching */


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

@@ -174,6 +176,7 @@
#define USE_RTPDUMP                                     /* FhG: RTPDUMP format (rtptools standard) instead of custom format */
#define FIX_1521_SBA_LOUDNESS_STEREO                    /* FhG: issue 1521: Fix loudness for SBA to stereo rendering */
#define FIX_1540_EXPOSE_PT_IN_RTP_HEADER_API            /* Expose Payload Type setting in RTP Header */
#define FIX_2500_RENDCONF_REFACTOR                      /* Eri: Basop issue #2500: Renderer configuration range check before conversion to fixed point. Harmonize between BASOP/float */
#define FIX_BASOP_2023_TDREND_DISTATT_PRECISION         /* Eri: Basop issue 2023: Distance attenuation scaling, synch with BASOP updates and adding clamping of distance att input and listener position  */
#define FIX_1574_EFAP_CODE_LINT                         /* FhG: issue 1574: Code quality fixes in ivas_efap.c */
#define FIX_FLOAT_1569_REND_RENDER_CONFIG_CHECKS        /* Nokia: float issue 1569: fix render config checks in renderer */
+24 −0
Original line number Diff line number Diff line
@@ -381,7 +381,9 @@ ivas_error ivas_hp20_dec_reconfig(
)
{
    int16_t i, nchan_hp20;
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    float **old_mem_hp20_out;
#endif
    ivas_error error;

    error = IVAS_ERR_OK;
@@ -394,6 +396,18 @@ ivas_error ivas_hp20_dec_reconfig(

    if ( nchan_hp20 > nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* create additional hp20 memories */
        for ( i = nchan_hp20_old; i < nchan_hp20; i++ )
        {
            if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for HP20 filter memory\n" ) );
            }

            set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;
@@ -421,9 +435,18 @@ ivas_error ivas_hp20_dec_reconfig(

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }
    else if ( nchan_hp20 < nchan_hp20_old )
    {
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
        /* remove superfluous hp20 memories */
        for ( i = nchan_hp20; i < nchan_hp20_old; i++ )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
#else
        /* save old mem_hp_20 pointer */
        old_mem_hp20_out = st_ivas->mem_hp20_out;
        st_ivas->mem_hp20_out = NULL;
@@ -447,6 +470,7 @@ ivas_error ivas_hp20_dec_reconfig(

        free( old_mem_hp20_out );
        old_mem_hp20_out = NULL;
#endif
    }

    return error;
+22 −1
Original line number Diff line number Diff line
@@ -2304,6 +2304,7 @@ ivas_error ivas_init_decoder(
    /* set number of output channels used for synthesis/decoding */
    n = getNumChanSynthesis( st_ivas );

#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    if ( n > 0 )
    {
        if ( ( st_ivas->mem_hp20_out = (float **) malloc( n * sizeof( float * ) ) ) == NULL )
@@ -2315,7 +2316,7 @@ ivas_error ivas_init_decoder(
    {
        st_ivas->mem_hp20_out = NULL;
    }

#endif
    for ( i = 0; i < n; i++ )
    {
        if ( ( st_ivas->mem_hp20_out[i] = (float *) malloc( L_HP20_MEM * sizeof( float ) ) ) == NULL )
@@ -2326,6 +2327,13 @@ ivas_error ivas_init_decoder(
        set_f( st_ivas->mem_hp20_out[i], 0.0f, L_HP20_MEM );
    }

#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    for ( ; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        st_ivas->mem_hp20_out[i] = NULL;
    }
#endif

    /*-------------------------------------------------------------------*
     * Allocate and initialize rendering handles
     *--------------------------------------------------------------------*/
@@ -2822,7 +2830,9 @@ void ivas_initialize_handles_dec(
#ifdef FIX_FMSW_DEC
    }
#endif
#ifndef FIX_1585_ASAN_FORMAT_SW_ALT
    st_ivas->mem_hp20_out = NULL;
#endif
    st_ivas->hLimiter = NULL;

    /* ISM metadata handles */
@@ -2964,6 +2974,16 @@ void ivas_destroy_dec(
    }

    /* HP20 filter handles */
#ifdef FIX_1585_ASAN_FORMAT_SW_ALT
    for ( i = 0; i < MAX_OUTPUT_CHANNELS + MAX_NUM_OBJECTS; i++ )
    {
        if ( st_ivas->mem_hp20_out[i] != NULL )
        {
            free( st_ivas->mem_hp20_out[i] );
            st_ivas->mem_hp20_out[i] = NULL;
        }
    }
#else
    if ( st_ivas->mem_hp20_out != NULL )
    {
        for ( i = 0; i < getNumChanSynthesis( st_ivas ); i++ )
@@ -2974,6 +2994,7 @@ void ivas_destroy_dec(
        free( st_ivas->mem_hp20_out );
        st_ivas->mem_hp20_out = NULL;
    }
#endif

    /* ISM metadata handles */
    ivas_ism_metadata_close( st_ivas->hIsmMetaData, 0 );
Loading