Commit a939067b authored by multrus's avatar multrus
Browse files

complete implementation

parent 309c4c34
Loading
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -45,7 +45,10 @@
/*-------------------------------------------------------------------------
 * Local constants
 *------------------------------------------------------------------------*/
#define DOWNMIX_ALPHA_FX                      31130 /* Smoothing coefficient */
#define DOWNMIX_ALPHA_FX 31130 /* Smoothing coefficient alpha */
#ifdef NONBE_FIX_967_ISM_MONO_DMX
#define DOWNMIX_ONE_MINUS_ALPHA_FX 1638 /* Smoothing coefficient (1 - alpha) */
#endif
#ifndef NONBE_FIX_967_ISM_MONO_DMX
#define MONO_DOWNMIX_RENDERER_MAX_INPUT_CHANS 4
#endif
@@ -126,12 +129,6 @@ void ivas_mono_downmix_render_passive_fx(
    Word16 Q_shift, proto_shift, input_shift, norm_protoEner, norm_inputEner, proto_norm;
    Word16 diff_shift, div, div_sqrt;
    Word32 protoEner_pre, inputEner_pre;
#ifdef NONBE_FIX_967_ISM_MONO_DMX
    Word32 inputEnergy_local_fx;
    Word16 Q_inputEner_local;
    Word32 protoEnergy_local_fx;
    Word16 Q_protoEner_local;
#endif

    numInputChannels = st_ivas->nSCE;
    move16();
@@ -200,6 +197,16 @@ void ivas_mono_downmix_render_passive_fx(
        }
    }

#ifdef NONBE_FIX_967_ISM_MONO_DMX
    hDownmix->inputEnergy_fx = Mpy_32_16_1( hDownmix->inputEnergy_fx, DOWNMIX_ALPHA_FX );
    move32();
    hDownmix->protoEnergy_fx = Mpy_32_16_1( hDownmix->protoEnergy_fx, DOWNMIX_ALPHA_FX );
    move32();

    protoEner_pre = Mpy_32_16_1( protoEner_pre, DOWNMIX_ONE_MINUS_ALPHA_FX );
    inputEner_pre = Mpy_32_16_1( inputEner_pre, DOWNMIX_ONE_MINUS_ALPHA_FX );
#endif

    /* compute the eq factor */

    IF( hDownmix->protoEnergy_fx == 0 )