Commit 35349260 authored by Jan Kiene's avatar Jan Kiene
Browse files

Merge branch '1532_basop_ISM_downmix_energies' into 'main-pc'

[non-BE]Port float MR1332 to BASOP

See merge request !1505
parents 0b83c755 4c026407
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1160,7 +1160,11 @@ void ivas_apply_non_diegetic_panning_fx(
    const Word16 output_frame              /* i  : output frame length per channel                  */
);

#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx_fx(
#else
void ivas_mono_downmix_render_passive_fx(
#endif
    Decoder_Struct *st_ivas,  /* i/o: IVAS decoder structure                                */
    Word32 *output_f_fx[],    /* i/o: synthesized core-coder transport channels/mono output */
    const Word16 output_frame /* i  : output frame length                                   */
+1 −0
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@
#define FIX_957_REMOVE_PANNING_DEAD_CODE                /* VA: Remove obsolete non-diegetic panning related code. */
#define NONBE_FIX_935_EARLY_REFLECTIONS_WRONG_ORDER     /* Qualcomm: issue 953: fix order or ER channels in LC mode*/
#define FIX_955_FASTCONV_REND_IN_ISM                    /* VA: put FastConv rendering call under DEBUGGING */
#define NONBE_FIX_967_ISM_MONO_DMX                      /* FhG: issue 967: accumulating energies in ISM mono DMX */

#define FIX_956_DECODER_COMMAND_LINE_FIX                /* VA: Output correct error message when the decoder command-line has too many mandatory arguments. */
#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*/
+12 −0
Original line number Diff line number Diff line
@@ -265,7 +265,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        test();
        IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame );
#else
            ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame );
#endif

            Scale_sig32( p_output_fx[0], L_FRAME48k, 3 );
        }
@@ -794,7 +798,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        move16();
        IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame );
#else
            ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame );
#endif

            output_q = 8;
            move16();
@@ -1082,7 +1090,11 @@ ivas_error ivas_jbm_dec_tc_fx(
        }
        ELSE IF( EQ_32( st_ivas->renderer_type, RENDERER_MONO_DOWNMIX ) && EQ_32( st_ivas->ism_mode, ISM_SBA_MODE_DISC ) )
        {
#ifdef NONBE_FIX_967_ISM_MONO_DMX
            ivas_ism_mono_dmx_fx( st_ivas, p_output_fx, output_frame );
#else
            ivas_mono_downmix_render_passive_fx( st_ivas, p_output_fx, output_frame );
#endif

            Scale_sig32( p_output_fx[0], L_FRAME48k, Q11 - Q8 ); // Q11

+24 −2
Original line number Diff line number Diff line
@@ -45,8 +45,13 @@
/*-------------------------------------------------------------------------
 * 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

/*-------------------------------------------------------------------------
 * ivas_mono_dmx_renderer_open()
@@ -102,11 +107,15 @@ void ivas_mono_dmx_renderer_close(
}

/*-------------------------------------------------------------------------
 * ivas_mono_downmix_render_passive()
 * ivas_ism_mono_dmx()
 *
 * Downmix process
 *------------------------------------------------------------------------*/
#ifdef NONBE_FIX_967_ISM_MONO_DMX
void ivas_ism_mono_dmx_fx(
#else
void ivas_mono_downmix_render_passive_fx(
#endif
    Decoder_Struct *st_ivas,  /* i/o: IVAS decoder structure                                */
    Word32 *output_f_fx[],    /* i/o: synthesized core-coder transport channels/mono output Qin = 11/ Qout = 8*/
    const Word16 output_frame /* i  : output frame length                                   */
@@ -120,6 +129,7 @@ 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;

    numInputChannels = st_ivas->nSCE;
    move16();
    if ( EQ_32( st_ivas->ivas_format, SBA_ISM_FORMAT ) )
@@ -160,11 +170,13 @@ void ivas_mono_downmix_render_passive_fx(
        v_add_32( output_shr, proto_signal_fx, proto_signal_fx, output_frame );
    }

#ifndef NONBE_FIX_967_ISM_MONO_DMX
    /* compute the input energy, proto energy after smoothing */
    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();
#endif

    proto_norm = L_norm_arr( proto_signal_fx, output_frame );

@@ -185,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 )