Commit 14f026d0 authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Fix for erroneous renderer modes switching in case of BINAURAL_ROOM_REVERB output configuration

parent 65dbb6f0
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -723,7 +723,11 @@ ivas_error ivas_binRenderer_open(
    }

    /* Allocate memories needed for reverb module */
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#else
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM && st_ivas->hIntSetup.output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#endif
    {
        if ( ( error = ivas_binaural_reverb_open( &( hBinRenderer->hReverb ),
                                                  hBinRenderer->conv_band,
@@ -731,7 +735,11 @@ ivas_error ivas_binRenderer_open(
                                                  &( st_ivas->hRenderConfig->roomAcoustics ),
                                                  st_ivas->hIntSetup.output_config,
                                                  st_ivas->hDecoderConfig->output_Fs,
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
                                                  RENDERER_BINAURAL_FASTCONV,
#else
                                                  RENDERER_BINAURAL_FASTCONV_ROOM,
#endif
                                                  st_ivas->hHrtfFastConv,
                                                  st_ivas->hHrtfParambin ) ) != IVAS_ERR_OK )
        {
+8 −8
Original line number Diff line number Diff line
@@ -82,7 +82,11 @@ void ivas_renderer_select(
        {
            if ( st_ivas->ism_mode == ISM_MODE_PARAM )
            {
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
                if ( output_config == AUDIO_CONFIG_BINAURAL )
#else
                if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#endif
                {
                    *renderer_type = RENDERER_BINAURAL_PARAMETRIC;
                }
@@ -135,11 +139,7 @@ void ivas_renderer_select(
        else if ( st_ivas->ivas_format == MASA_FORMAT || ( st_ivas->ivas_format == SBA_FORMAT && st_ivas->nchan_transport <= 2 ) )
        {
            *internal_config = output_config;
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
            if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#else
            if ( output_config == AUDIO_CONFIG_BINAURAL )
#endif
            {
                *renderer_type = RENDERER_BINAURAL_PARAMETRIC;
            }
@@ -191,11 +191,7 @@ void ivas_renderer_select(
            if ( st_ivas->mc_mode == MC_MODE_MCMASA )
            {
                *internal_config = output_config;
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
                if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#else
                if ( output_config == AUDIO_CONFIG_BINAURAL )
#endif
                {
                    *renderer_type = RENDERER_BINAURAL_PARAMETRIC;
                }
@@ -207,7 +203,11 @@ void ivas_renderer_select(
            else
            {
                *internal_config = transport_config;
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
                if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#else
                if ( output_config == AUDIO_CONFIG_BINAURAL )
#endif
                {
#ifdef DEBUGGING
                    if ( ( ( ( st_ivas->transport_config == AUDIO_CONFIG_5_1 || st_ivas->transport_config == AUDIO_CONFIG_7_1 ) && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) ) || ( st_ivas->hDecoderConfig->force_rend == FORCE_TD_RENDERER ) ) && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) && !( st_ivas->hDecoderConfig->force_rend == FORCE_CLDFB_RENDERER ) )
+0 −8
Original line number Diff line number Diff line
@@ -1378,11 +1378,7 @@ static void ivas_dirac_dec_binaural_process_output(
    offsetSamples = 0;
    nSlots = st_ivas->hDirAC->subframe_nbslots[subframe];

#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
#else
    if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
#endif
    {
        /* Process second / room effect part of binaural output when needed */
        ivas_binaural_reverb_processSubframe( st_ivas->hDiracDecBin->hReverb, numInChannels, nSlots, inRe, inIm, reverbRe, reverbIm );
@@ -1449,11 +1445,7 @@ static void ivas_dirac_dec_binaural_process_output(
                }
            }

#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC && st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB ) )
#else
            if ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM )
#endif
            {
                /* Combine second (reverb) part with the first (HRTF) part to obtain binaural output signal with room effect */
                v_add( outSlotRe, reverbRe[chA][slot], outSlotRe, CLDFB_NO_CHANNELS_MAX );
+8 −0
Original line number Diff line number Diff line
@@ -1813,7 +1813,11 @@ ivas_error ivas_binaural_reverb_open(
        set_f( hReverb->preDelayBufferImag[k], 0.0f, hReverb->numBins );
    }

#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV )
#else
    if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
#endif
    {
        if ( !roomAcoustics->override )
        {
@@ -1900,7 +1904,11 @@ ivas_error ivas_binaural_reverb_open(
    }
    else
    {
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
        if (renderer_type == RENDERER_BINAURAL_FASTCONV )
#else
        if ( renderer_type == RENDERER_BINAURAL_FASTCONV_ROOM )
#endif
        {
            ivas_binaural_reverb_setReverbTimes( hReverb, sampling_rate, hHrtfFastConv->fastconvReverberationTimes, hHrtfFastConv->fastconvReverberationEneCorrections );
            ivas_binaural_reverb_setPreDelay( hReverb, 10 );
+0 −4
Original line number Diff line number Diff line
@@ -2489,11 +2489,7 @@ static ivas_error initMasaDummyDecForBinauralOut(
    decDummy->mc_mode = MC_MODE_NONE;                       /* Todo Nokia: This should be also refactored in such way that it is not checked if not in MC mode */

    ivas_output_init( &( decDummy->hOutSetup ), output_config );
#ifdef FIX_571_REVERB_NOT_ACTIVATED_ISM
    if ( output_config == AUDIO_CONFIG_BINAURAL || output_config == AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
#else
    if ( output_config == AUDIO_CONFIG_BINAURAL )
#endif
    {
        decDummy->renderer_type = RENDERER_BINAURAL_PARAMETRIC;
    }