Commit 96d8c66f authored by multrus's avatar multrus
Browse files

[cleanup] accept NONBE_FIX_967_ISM_MONO_DMX

parent 92370ac2
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -5472,11 +5472,7 @@ void ivas_mono_dmx_renderer_close(
    MONO_DOWNMIX_RENDERER_HANDLE *hMonoDmxRenderer              /* i/ i/o: Mono downmix structure                       */
);

#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx(
#else
void ivas_mono_downmix_render_passive(
#endif
    Decoder_Struct *st_ivas,                                    /* i/o: IVAS decoder structure                                */
    float *output_f[],                                          /* i/o: synthesized core-coder transport channels/mono output */
    const int16_t output_frame                                  /* i  : output frame length                                   */
+0 −1
Original line number Diff line number Diff line
@@ -161,7 +161,6 @@
/* all switches in this category should start with "NONBE_" */

#define NONBE_FIX_922_PRECOMPUTED_HRTF_PROPERTIES             /* Philips: Use pre-computed HRTF average L/R energies and IAC in all renderers */
#define NONBE_FIX_967_ISM_MONO_DMX                            /* FhG: issue 967: accumulating energies in ISM mono DMX */
#define NONBE_FIX_968_ISM_BRIR_WITH_HEADROTATION_5MS_FIX      /* FhG : issue #968: differences between 5ms and 20ms rendering for discrete ISM with BRIR and head rotation*/
#define NONBE_FIX_977_OSBA_GAIN_MISMATCH                      /* Dlb : issue 977 : Output gain mismatch for different bit rates in OSBA */
#define NONBE_FIX_973_HODIRAC_BAND_GROUPING                   /* FhG: issue 973: empty parameter band in DirAC */
+0 −12
Original line number Diff line number Diff line
@@ -196,11 +196,7 @@ ivas_error ivas_jbm_dec_tc(

        if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx( st_ivas, p_output, output_frame );
#else
            ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );
#endif
        }
        else if ( st_ivas->ism_mode == ISM_MODE_PARAM && ( st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC || st_ivas->renderer_type == RENDERER_BINAURAL_PARAMETRIC_ROOM || st_ivas->renderer_type == RENDERER_STEREO_PARAMETRIC ) )
        {
@@ -392,11 +388,7 @@ ivas_error ivas_jbm_dec_tc(

        if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx( st_ivas, p_output, output_frame );
#else
            ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );
#endif
        }
        else if ( output_config == IVAS_AUDIO_CONFIG_EXTERNAL )
        {
@@ -520,11 +512,7 @@ ivas_error ivas_jbm_dec_tc(
        }
        else if ( st_ivas->renderer_type == RENDERER_MONO_DOWNMIX && st_ivas->ism_mode == ISM_SBA_MODE_DISC )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx( st_ivas, p_output, output_frame );
#else
            ivas_mono_downmix_render_passive( st_ivas, p_output, output_frame );
#endif

            /* add W */
            for ( n = 0; n < nchan_out; n++ )
+0 −28
Original line number Diff line number Diff line
@@ -48,9 +48,6 @@

#define DOWNMIX_ALPHA    0.95f /* Smoothing coefficient */
#define DOWNMIX_MAX_GAIN 4.0f  /* Maximum allowed gain  */
#ifndef NONBE_FIX_967_ISM_MONO_DMX
#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4 // FhG esr: this seems to be obsolete; not related to issue 967
#endif


/*-------------------------------------------------------------------------
@@ -106,11 +103,7 @@ void ivas_mono_dmx_renderer_close(
 * Downmix process
 *------------------------------------------------------------------------*/

#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx(
#else
void ivas_mono_downmix_render_passive(
#endif
    Decoder_Struct *st_ivas,   /* i/o: IVAS decoder structure                                */
    float *output_f[],         /* i/o: synthesized core-coder transport channels/mono output */
    const int16_t output_frame /* i  : output frame length                                   */
@@ -118,9 +111,7 @@ void ivas_mono_downmix_render_passive(
{
    int16_t i, j, numInputChannels;
    float proto_signal[L_FRAME48k], eq;
#ifdef NONBE_FIX_967_ISM_MONO_DMX
    float inputEnergy_local, protoEnergy_local;
#endif
    MONO_DOWNMIX_RENDERER_HANDLE hDownmix;

    numInputChannels = st_ivas->nSCE;
@@ -143,10 +134,8 @@ void ivas_mono_downmix_render_passive(

    hDownmix = st_ivas->hMonoDmxRenderer;
    set_zero( proto_signal, output_frame );
#ifdef NONBE_FIX_967_ISM_MONO_DMX
    inputEnergy_local = 0;
    protoEnergy_local = 0;
#endif

    /* Compute the Proto Signal */
    for ( i = 0; i < numInputChannels; i++ )
@@ -154,7 +143,6 @@ void ivas_mono_downmix_render_passive(
        v_add( output_f[i], proto_signal, proto_signal, output_frame );
    }

#ifdef NONBE_FIX_967_ISM_MONO_DMX
    /* compute the input energy, proto energy */
    for ( i = 0; i < output_frame; i++ )
    {
@@ -165,26 +153,10 @@ void ivas_mono_downmix_render_passive(
            inputEnergy_local += ( output_f[j][i] * output_f[j][i] );
        }
    }
#else
    /* compute the input energy, proto energy after smoothing */
    hDownmix->inputEnergy *= DOWNMIX_ALPHA;
    hDownmix->protoEnergy *= DOWNMIX_ALPHA;
    for ( i = 0; i < output_frame; i++ )
    {
        hDownmix->protoEnergy += proto_signal[i] * proto_signal[i];

        for ( j = 0; j < numInputChannels; j++ )
        {
            hDownmix->inputEnergy += ( output_f[j][i] * output_f[j][i] );
        }
    }
#endif
#ifdef NONBE_FIX_967_ISM_MONO_DMX
    hDownmix->inputEnergy *= DOWNMIX_ALPHA;
    hDownmix->protoEnergy *= DOWNMIX_ALPHA;
    hDownmix->inputEnergy += ( 1.0f - DOWNMIX_ALPHA ) * inputEnergy_local;
    hDownmix->protoEnergy += ( 1.0f - DOWNMIX_ALPHA ) * protoEnergy_local;
#endif

    /* compute the eq factor */
    eq = min( DOWNMIX_MAX_GAIN, sqrtf( hDownmix->inputEnergy / ( EPSILON + hDownmix->protoEnergy ) ) );