Commit 94db466c authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fixes to align with the split-rendering solution

parent 1c303ad8
Loading
Loading
Loading
Loading
Loading
+28 −7
Original line number Diff line number Diff line
@@ -2142,6 +2142,8 @@ ivas_error IVAS_DEC_FeedRenderConfig(

#ifdef FIX_1053_REVERB_RECONFIGURATION
    /* Re-initialize reverb instance if already available */

#ifdef SPLIT_REND_WITH_HEAD_ROT
    /* TD renderer Jot reverberator */
    if ( hIvasDec->st_ivas->hReverb != NULL )
    {
@@ -2149,23 +2151,42 @@ ivas_error IVAS_DEC_FeedRenderConfig(
    }

    /* CREND Jot reverberator */
    if ( hIvasDec->st_ivas->hCrendWrapper != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend != NULL && ( hIvasDec->st_ivas->hCrendWrapper->hCrend )->hReverb != NULL )
    if ( hIvasDec->st_ivas->hCrendWrapper != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend[0]->hReverb != NULL )
    {
        ivas_reverb_init( &( hIvasDec->st_ivas->hCrendWrapper->hCrend )->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs );
        ivas_reverb_init( &hIvasDec->st_ivas->hCrendWrapper->hCrend[0]->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs );
    }

    /* DirAC CLDFB reverberator */
    if ( hIvasDec->st_ivas->hDiracDecBin != NULL && hIvasDec->st_ivas->hDiracDecBin->hReverb != NULL )
    if ( hIvasDec->st_ivas->hDiracDecBin != NULL && hIvasDec->st_ivas->hDiracDecBin[0]->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ) );
        ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL );
    }
#else
    /* TD renderer Jot reverberator */
    if ( hIvasDec->st_ivas->hReverb != NULL )
    {
        ivas_reverb_init( &hIvasDec->st_ivas->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs );
    }

    /* CREND Jot reverberator */
    if ( hIvasDec->st_ivas->hCrendWrapper != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend != NULL && hIvasDec->st_ivas->hCrendWrapper->hCrend->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hDiracDecBin )->hReverb );
        ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin )->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL );
        ivas_reverb_init( &hIvasDec->st_ivas->hCrendWrapper->hCrend->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hRenderConfig, hIvasDec->st_ivas->hDecoderConfig->output_Fs );
    }

    /* DirAC CLDFB reverberator */
    if ( hIvasDec->st_ivas->hDiracDecBin != NULL && hIvasDec->st_ivas->hDiracDecBin->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hDiracDecBin->hReverb ) );
        ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hDiracDecBin->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL );
    }
#endif
    /* Fastconv CLDFB reverberator */
    if ( hIvasDec->st_ivas->hBinRenderer != NULL && hIvasDec->st_ivas->hBinRenderer->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hBinRenderer )->hReverb );
        ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hBinRenderer )->hReverb, hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL );
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hBinRenderer->hReverb ) );
        ivas_binaural_reverb_init( &( hIvasDec->st_ivas->hBinRenderer->hReverb ), hIvasDec->st_ivas->hHrtfStatistics, hIvasDec->st_ivas->hBinRenderer->conv_band, hIvasDec->st_ivas->hBinRenderer->timeSlots, &( hRenderConfig->roomAcoustics ), hIvasDec->st_ivas->hDecoderConfig->output_Fs, NULL, NULL );
    }
#endif

+26 −0
Original line number Diff line number Diff line
@@ -4708,7 +4708,11 @@ int16_t IVAS_REND_FeedRenderConfig(
        }
        if ( pIsmInput->crendWrapper != NULL && pIsmInput->crendWrapper->hCrend != NULL )
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
            ivas_reverb_init( &pIsmInput->crendWrapper->hCrend[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pIsmInput->base.ctx.pOutSampleRate );
#else
            ivas_reverb_init( &pIsmInput->crendWrapper->hCrend->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pIsmInput->base.ctx.pOutSampleRate );
#endif
        }
    }

@@ -4723,11 +4727,19 @@ int16_t IVAS_REND_FeedRenderConfig(

        if ( pMasaInput->hMasaExtRend != NULL )
        {
#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( pMasaInput->hMasaExtRend->hDiracDecBin != NULL && pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb != NULL )
            {
                ivas_binaural_reverb_close( &pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb );
                ivas_binaural_reverb_init( &pMasaInput->hMasaExtRend->hDiracDecBin[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL );
            }
#else
            if ( pMasaInput->hMasaExtRend->hDiracDecBin != NULL && pMasaInput->hMasaExtRend->hDiracDecBin->hReverb != NULL )
            {
                ivas_binaural_reverb_close( &pMasaInput->hMasaExtRend->hDiracDecBin->hReverb );
                ivas_binaural_reverb_init( &pMasaInput->hMasaExtRend->hDiracDecBin->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, pMasaInput->hMasaExtRend->hSpatParamRendCom->num_freq_bands, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( hRenderConfig->roomAcoustics ), *pMasaInput->base.ctx.pOutSampleRate, NULL, NULL );
            }
#endif
            if ( pMasaInput->hMasaExtRend->hReverb != NULL )
            {
                ivas_binaural_reverb_close( &pMasaInput->hMasaExtRend->hReverb );
@@ -4749,10 +4761,17 @@ int16_t IVAS_REND_FeedRenderConfig(
        {
            ivas_reverb_init( &pMcInput->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pMcInput->base.ctx.pOutSampleRate );
        }
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( pMcInput->crendWrapper != NULL && pMcInput->crendWrapper->hCrend && pMcInput->crendWrapper->hCrend[0]->hReverb != NULL )
        {
            ivas_reverb_init( &pMcInput->crendWrapper->hCrend[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pMcInput->base.ctx.pOutSampleRate );
        }
#else
        if ( pMcInput->crendWrapper != NULL && pMcInput->crendWrapper->hCrend && pMcInput->crendWrapper->hCrend->hReverb != NULL )
        {
            ivas_reverb_init( &pMcInput->crendWrapper->hCrend->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pMcInput->base.ctx.pOutSampleRate );
        }
#endif
    }

    /* SBA inputs */
@@ -4764,10 +4783,17 @@ int16_t IVAS_REND_FeedRenderConfig(
            continue;
        }

#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( pSbaInput->crendWrapper != NULL && pSbaInput->crendWrapper->hCrend != NULL && pSbaInput->crendWrapper->hCrend[0]->hReverb != NULL )
        {
            ivas_reverb_init( &pSbaInput->crendWrapper->hCrend[0]->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pSbaInput->base.ctx.pOutSampleRate );
        }
#else
        if ( pSbaInput->crendWrapper != NULL && pSbaInput->crendWrapper->hCrend != NULL && pSbaInput->crendWrapper->hCrend->hReverb != NULL )
        {
            ivas_reverb_init( &pSbaInput->crendWrapper->hCrend->hReverb, hIvasRend->hHrtfs.hHrtfStatistics, hRenderConfig, *pSbaInput->base.ctx.pOutSampleRate );
        }
#endif
    }
#endif