Commit 26efe45b authored by Marek Szczerba's avatar Marek Szczerba
Browse files

Initial version supporting runtime reverb reconfiguration

parent 2f979d61
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@

#define FIX_1033_MEMORY_LEAK_OMASA                      /* Nokia / Orange: issue #1033: Memory leak in OMASA to BINAURAL with HRTF with bitrate switching */
#define FIX_1043_JBM_MD_BUFFER                          /* VA: issue 1043: JBM MD handle allocation is avoided in non-JBM EXT operations */

#define FIX_1053_REVERB_RECONFIGURATION                 /* Philips: issue 1053: fix for dynamic switching of acoustic environment */

/* #################### End BE switches ################################## */

+6 −0
Original line number Diff line number Diff line
@@ -1104,7 +1104,11 @@ ivas_error ivas_binRenderer_open(
)
{
    BINAURAL_RENDERER_HANDLE hBinRenderer;
#ifdef FIX_1053_REVERB_RECONFIGURATION
    int16_t convBand, k;
#else
    int16_t convBand, chIdx, k;
#endif
    ivas_error error;

    error = IVAS_ERR_OK;
@@ -1260,6 +1264,7 @@ ivas_error ivas_binRenderer_open(
            return error;
        }

#ifndef FIX_1053_REVERB_RECONFIGURATION
        /* initialize the dmx matrix */
        for ( chIdx = 0; chIdx < BINAURAL_CHANNELS; chIdx++ )
        {
@@ -1268,6 +1273,7 @@ ivas_error ivas_binRenderer_open(
                hBinRenderer->hReverb->dmxmtx[chIdx][k] = dmxmtx_table[chIdx][k];
            }
        }
#endif
    }
    else
    {
+11 −0
Original line number Diff line number Diff line
@@ -2002,10 +2002,21 @@ ivas_error ivas_init_decoder(
        }
        if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
        {
#ifdef FIX_1053_REVERB_RECONFIGURATION
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
            {
                return error;
            }
            if ( ( error = ivas_reverb_init( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#else
            if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
            {
                return error;
            }
#endif
        }

        granularity = NS2SA( st_ivas->hDecoderConfig->output_Fs, FRAME_SIZE_NS / MAX_PARAM_SPATIAL_SUBFRAMES );
+12 −0
Original line number Diff line number Diff line
@@ -201,10 +201,22 @@ static ivas_error ivas_ism_bitrate_switching_dec(
                }
                if ( st_ivas->hOutSetup.output_config == IVAS_AUDIO_CONFIG_BINAURAL_ROOM_REVERB )
                {
#ifdef FIX_1053_REVERB_RECONFIGURATION
                    if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
                    {
                        return error;
                    }

                    if ( ( error = ivas_reverb_init( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
                    {
                        return error;
                    }
#else
                    if ( ( error = ivas_reverb_open( &st_ivas->hReverb, st_ivas->hHrtfStatistics, st_ivas->hRenderConfig, st_ivas->hDecoderConfig->output_Fs ) ) != IVAS_ERR_OK )
                    {
                        return error;
                    }
#endif
                }
            }
        }
+2 −1
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ const float dirac_dithering_ele_scale[DIRAC_DIFFUSE_LEVELS] =
    6.716062e-01f, 1.011804e+00f, 1.796875e+00f, 2.804382e+00f, 4.623130e+00f, 7.802667e+00f, 1.045446e+01f, 1.379538e+01f
};

#ifndef FIX_1053_REVERB_RECONFIGURATION
/*----------------------------------------------------------------------------------*
 * FASTCONV and PARAMETRIC binaural renderer ROM tables
 *----------------------------------------------------------------------------------*/
@@ -399,7 +400,7 @@ const float dmxmtx_table[BINAURAL_CHANNELS][11] =
    { 1.0f, 0.0f, 0.70709997f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f },
    { 0.0f, 1.0f, 0.70709997f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f },
};

#endif

#ifdef SPLIT_REND_WITH_HEAD_ROT
/*----------------------------------------------------------------------*
Loading