Commit eb6fc88f authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fixes for memory handling, listener origin

parent 524638c3
Loading
Loading
Loading
Loading
Loading
+3226 −0

File added.

Preview size limit exceeded, changes collapsed.

+10 −5
Original line number Diff line number Diff line
@@ -3225,11 +3225,6 @@ void ivas_initialize_handles_dec(
        st_ivas->p_output_fx[i] = NULL;
    }

#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT
    /* Acoustic environments */
    st_ivas->pAcousticEnvironments = NULL;
#endif

    return;
}

@@ -3468,6 +3463,16 @@ void ivas_destroy_dec_fx(
#endif
    }

#ifdef IVAS_RTPDUMP_ACOUSTIC_ENVIRONMENT
    /* Acoustic environments */
    IF( st_ivas->pAcousticEnvironments != NULL )
    {
        free( st_ivas->pAcousticEnvironments );
        st_ivas->pAcousticEnvironments = NULL;
    }
#endif


    /* main IVAS handle */
    free( st_ivas );

+13 −0
Original line number Diff line number Diff line
@@ -2896,6 +2896,11 @@ ivas_error RenderConfigReader_getAcousticEnvironments(

        pOut->aeID = (Word16) pIn.id;
        pOut->nBands = (Word16) pIn.pFG->nrBands;
        if ( pRenderConfigReader->pAE[n].preDelay > INPUTPREDELAY_MAX ||
             pRenderConfigReader->pAE[n].preDelay < INPUTPREDELAY_MIN )
        {
            return IVAS_ERR_INVALID_RENDER_CONFIG;
        }
        pOut->inputPreDelay_fx = (Word32) ( pIn.preDelay * ONE_IN_Q27 );

        for ( m = 0; m < pOut->nBands; m++ )
@@ -2918,6 +2923,9 @@ ivas_error RenderConfigReader_getAcousticEnvironments(
            /* Use default listener origin position if non provided */
            if ( pIn.pEarlyReflections->pListenerOrigin == NULL )
            {
                pOut->ListenerOrigin.x = IVAS_ER_LIST_ORIGIN_X;
                pOut->ListenerOrigin.y = IVAS_ER_LIST_ORIGIN_Y;
                pOut->ListenerOrigin.z = IVAS_ER_LIST_HEIGHT;

                pOut->ListenerOrigin.x_fx = IVAS_ER_LIST_ORIGIN_X_FX;
                pOut->ListenerOrigin.y_fx = IVAS_ER_LIST_ORIGIN_Y_FX;
@@ -2926,6 +2934,10 @@ ivas_error RenderConfigReader_getAcousticEnvironments(
            }
            else
            {
                pOut->ListenerOrigin.x = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->x;
                pOut->ListenerOrigin.y = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->y;
                pOut->ListenerOrigin.z = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->z;

                pOut->ListenerOrigin.x_fx = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->x_fx;
                pOut->ListenerOrigin.y_fx = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->y_fx;
                pOut->ListenerOrigin.z_fx = pRenderConfigReader->pAE[n].pEarlyReflections->pListenerOrigin->z_fx;
@@ -2933,6 +2945,7 @@ ivas_error RenderConfigReader_getAcousticEnvironments(

            for ( j = 0; j < IVAS_ROOM_ABS_COEFF; j++ )
            {
                pOut->AbsCoeff[j] = (Word32) ( pIn.pEarlyReflections->pAbsCoeff[j] );
                pOut->AbsCoeff_fx[j] = (Word32) ( pIn.pEarlyReflections->pAbsCoeff[j] * ONE_IN_Q30 );
            }
        }