Commit e5ad271e authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge branch '1139-fix-param-rev-coloration-short-t60' into 'main'

[non-BE] Fixes issue 1139 to prevent sound coloration artefacts at very low reverberation times

See merge request !1787
parents 86d5aa2f 7206ede3
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -184,6 +184,8 @@
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1176_OSBA_REVERB_JBM_ASAN_ERROR       /* Ericsson: Issue 1176, fix in TDREND_firfilt for subframes shorter than the filter length */

#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */

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

/* ################## End DEVELOPMENT switches ######################### */
+26 −2
Original line number Diff line number Diff line
@@ -1219,9 +1219,33 @@ ivas_error ivas_binRenderer_open(
    {
#ifdef FIX_587_DEFAULT_REVERB
        pRoomAcoustics = ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) ? &( st_ivas->hRenderConfig->roomAcoustics ) : NULL;
        if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, pRoomAcoustics, st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ),
                                                  st_ivas->hHrtfStatistics,
                                                  hBinRenderer->conv_band,
                                                  hBinRenderer->timeSlots,
                                                  pRoomAcoustics,
                                                  st_ivas->hDecoderConfig->output_Fs,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationTimes,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                  ,
                                                  hBinRenderer->earlyPartEneCorrection
#endif
                                                  ) ) != IVAS_ERR_OK )
#else
        if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ), st_ivas->hHrtfStatistics, hBinRenderer->conv_band, hBinRenderer->timeSlots, &( st_ivas->hRenderConfig->roomAcoustics ), st_ivas->hDecoderConfig->output_Fs, st_ivas->hHrtfFastConv->fastconvReverberationTimes, st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections ) ) != IVAS_ERR_OK )
        if ( ( error = ivas_binaural_reverb_init( &( hBinRenderer->hReverb ),
                                                  st_ivas->hHrtfStatistics,
                                                  hBinRenderer->conv_band,
                                                  hBinRenderer->timeSlots,
                                                  &( st_ivas->hRenderConfig->roomAcoustics ),
                                                  st_ivas->hDecoderConfig->output_Fs,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationTimes,
                                                  st_ivas->hHrtfFastConv->fastconvReverberationEneCorrections
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                  ,
                                                  hBinRenderer->earlyPartEneCorrection
#endif
                                                  ) ) != IVAS_ERR_OK )
#endif
        {
            return error;
+26 −2
Original line number Diff line number Diff line
@@ -2877,7 +2877,19 @@ ivas_error IVAS_DEC_FeedRenderConfig(
    if ( hIvasDec->st_ivas->hDiracDecBin[0] != NULL && hIvasDec->st_ivas->hDiracDecBin[0]->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hDiracDecBin[0]->hReverb ) );
        if ( ( error = 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 ) ) != IVAS_ERR_OK )
        if ( ( error = 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
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                  ,
                                                  NULL
#endif
                                                  ) ) != IVAS_ERR_OK )
        {
            return error;
        }
@@ -2886,7 +2898,19 @@ ivas_error IVAS_DEC_FeedRenderConfig(
    if ( hIvasDec->st_ivas->hBinRenderer != NULL && hIvasDec->st_ivas->hBinRenderer->hReverb != NULL )
    {
        ivas_binaural_reverb_close( &( hIvasDec->st_ivas->hBinRenderer->hReverb ) );
        if ( ( error = 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_ERR_OK )
        if ( ( error = 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
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                  ,
                                                  NULL
#endif
                                                  ) ) != IVAS_ERR_OK )
        {
            return error;
        }
+26 −2
Original line number Diff line number Diff line
@@ -245,9 +245,33 @@ ivas_error ivas_dirac_dec_init_binaural_data(
            if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */
            {
#ifdef FIX_587_DEFAULT_REVERB
                if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, pRoomAcoustics, output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb,
                                                          st_ivas->hHrtfStatistics,
                                                          nBins,
                                                          CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES,
                                                          pRoomAcoustics,
                                                          output_Fs,
                                                          ( *phHrtfParambin )->parametricReverberationTimes,
                                                          ( *phHrtfParambin )->parametricReverberationEneCorrections
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                          ,
                                                          hDiracDecBin->earlyPartEneCorrection
#endif
                                                          ) ) != IVAS_ERR_OK )
#else
                if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb, st_ivas->hHrtfStatistics, nBins, CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES, &( st_ivas->hRenderConfig->roomAcoustics ), output_Fs, ( *phHrtfParambin )->parametricReverberationTimes, ( *phHrtfParambin )->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_binaural_reverb_init( &hDiracDecBin->hReverb,
                                                          st_ivas->hHrtfStatistics,
                                                          nBins,
                                                          CLDFB_NO_COL_MAX / MAX_PARAM_SPATIAL_SUBFRAMES,
                                                          &( st_ivas->hRenderConfig->roomAcoustics ),
                                                          output_Fs,
                                                          ( *phHrtfParambin )->parametricReverberationTimes,
                                                          ( *phHrtfParambin )->parametricReverberationEneCorrections
#ifdef FIX_1139_REV_COLORATION_SHORT_T60
                                                          ,
                                                          hDiracDecBin->earlyPartEneCorrection
#endif
                                                          ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
+4 −1
Original line number Diff line number Diff line
@@ -938,9 +938,12 @@ ivas_error ivas_binaural_reverb_init(
    const int32_t sampling_rate,                                /* i  : sampling rate                           */
    const float *defaultTimes,                                  /* i  : default reverberation times             */
    const float *defaultEne                                     /* i  : default reverberation energies          */
    #ifdef FIX_1139_REV_COLORATION_SHORT_T60
    ,
    float *earlyEne                                             /* i/o: Early part energies to be modified      */
    #endif
);


void ivas_binaural_reverb_close(
    REVERB_STRUCT_HANDLE *hReverb                               /* i/o: binaural reverb handle                  */
);
Loading