Commit 187bdeff authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Port of float MR 1787 to float reference. To be adjusted with incoming changes for default reverb.

parent 5da31821
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -205,6 +205,7 @@
#define NONBE_FIX_981_PARAMBIN_DEFAULT_EARLY_PART             /* Nokia: Set default early part energy correction to unity for BINAURAL_ROOM_REVERB */
#define NONBE_FIX_1174_MCMASA_LBR_LOOP_ERROR            /* Nokia: Fix issue 1174 by removing the unnecessary inner loop causing problems. */
#define NONBE_FIX_1052_SBA_EXT_FIX                      /* VA: SBA external output support fix - do not overwrite "output_config" parameter */
#define FIX_1139_REV_COLORATION_SHORT_T60               /* Nokia,FhG: Fix issue 1139, prevent sound coloration artefacts at very low reverberation times */

/* #################### End BASOP porting switches ############################ */

+14 −1
Original line number Diff line number Diff line
@@ -1189,10 +1189,23 @@ ivas_error ivas_binRenderer_open(
        }
    }

    // Todo 1892
    /* Allocate memories needed for reverb module */
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
    {
        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 )
        {
            return error;
        }
+28 −2
Original line number Diff line number Diff line
@@ -2226,21 +2226,47 @@ ivas_error IVAS_DEC_FeedRenderConfig(
        }
    }

    // Todo 1892
    /* FB reverberator */
    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;
        }
    }

    // Todo 1892
    /* Fastconv CLDFB reverberator */
    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;
        }
+13 −1
Original line number Diff line number Diff line
@@ -257,7 +257,19 @@ ivas_error ivas_dirac_dec_init_binaural_data(
            if ( hDiracDecBin->hReverb == NULL && pos_idx == 0 ) /* open reverb only for the main direction */
            {
#ifdef NONBE_FIX_991_PARAMBIN_BINARY_HRTF
                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, // Todo 1892
                                                          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 )
#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, st_ivas->hHrtfParambin->parametricReverberationTimes, st_ivas->hHrtfParambin->parametricReverberationEneCorrections ) ) != IVAS_ERR_OK )
#endif
+4 −0
Original line number Diff line number Diff line
@@ -927,6 +927,10 @@ 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
);


Loading