Commit b301e223 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

scale binaural audio channels down to avoid clipping with BINAURAL_ROOM_REVERB

parent ff8ad728
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5225,6 +5225,10 @@ void ivas_binRenderer(
#endif
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX],                /* i  : LS signals                   */
    float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]                 /* i  : LS signals                   */
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
    ,
	AUDIO_CONFIG output_config                                                             /* i : output configuration */
#endif
);

void ivas_binaural_add_LFE(
+2 −0
Original line number Diff line number Diff line
@@ -191,6 +191,8 @@
#define NONBE_FIX_1000_G1_G2_SWB_TBE                          /* VA: issue 1000: avoid div by zero due to g1 + g2 being zero in SWB TBE */
#define NONBE_FIX_999_JBM_MCT_FLUSH                           /* FhG: issue #999: fix wrong flushing for MCT at a JBM rate switch */

#define DISABLE_LIMITER

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

/* ################## End DEVELOPMENT switches ######################### */
+18 −0
Original line number Diff line number Diff line
@@ -1916,6 +1916,10 @@ void ivas_binRenderer(
#endif
    float RealBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX], /* i  : LS signals       */
    float ImagBuffer[][MAX_PARAM_SPATIAL_SUBFRAMES][CLDFB_NO_CHANNELS_MAX]  /* i  : LS signals       */
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
    ,
    AUDIO_CONFIG output_config /* i : output configuration */
#endif
)
{
    int16_t chIdx, k;
@@ -2051,6 +2055,20 @@ void ivas_binRenderer(
    }
#endif

#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
    if ( output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
    {
        for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
        {
            for ( k = 0; k < numTimeSlots; k++ )
            {
                v_multc( Cldfb_RealBuffer_Binaural[chIdx][k], 0.5f, Cldfb_RealBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX );
                v_multc( Cldfb_ImagBuffer_Binaural[chIdx][k], 0.5f, Cldfb_ImagBuffer_Binaural[chIdx][k], CLDFB_NO_CHANNELS_MAX );
            }
        }
    }
#endif

    /* Obtain the binaural dmx and compute the reverb */
    if ( hBinRenderer->hReverb != NULL )
    {
+6 −1
Original line number Diff line number Diff line
@@ -2407,7 +2407,12 @@ void ivas_dirac_dec_render_sf(
#ifdef SPLIT_REND_WITH_HEAD_ROT_DEBUG
                          NULL,
#endif
                          Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
                          Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
                          ,
                          st_ivas->hDecoderConfig->output_config
#endif
        );
#ifdef SPLIT_REND_WITH_HEAD_ROT
        if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
+6 −1
Original line number Diff line number Diff line
@@ -1825,7 +1825,12 @@ void ivas_param_mc_dec_render(
#endif
                              st_ivas->hCombinedOrientationData,
                              hParamMC->subframe_nbslots[subframe_idx],
                              Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer );
                              Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, Cldfb_RealBuffer, Cldfb_ImagBuffer
#ifdef NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING
                              ,
                              st_ivas->hDecoderConfig->output_config
#endif
            );

#ifdef SPLIT_REND_WITH_HEAD_ROT
            if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
Loading