Commit fbccb1e5 authored by multrus's avatar multrus
Browse files

[cleanup] accept HARM_FD_BWE

parent 38280593
Loading
Loading
Loading
Loading
+0 −14
Original line number Diff line number Diff line
@@ -1839,20 +1839,6 @@ void stereoFdCngCoherence_fx(
    Word16 fft_exp 
);

#ifndef HARM_FD_BWE
/* o : Q_syn_hb*/
Word16 ivas_wb_bwe_dec_fx(
    Decoder_State *st_fx,                                       /* i/o: decoder state structure                 */
    Word32 output_fx32[],                                       /* o  : synthesis @internal Fs               Q11*/
    Word16 *synth_fx,                                           /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
    Word16 *hb_synth_fx,                                        /* o  : SHB synthesis/final synthesis          Q_syn_hb */
    const Word16 use_cldfb_for_dft,                             /* i  : flag to use of CLDFB for DFT Stereo     */
    const Word16 output_frame,                                  /* i  : frame length                            */
    Word16 *voice_factors_fx,                                   /* i  : voicing factors                     Q15 */
    const Word16 pitch_buf_fx[],                                /* i  : pitch buffer                         Q6 */
    Word16 *Qpost 
);
#endif
void ivas_param_ism_config_fx(
    PARAM_ISM_CONFIG_HANDLE hParamIsm,                          /* i/o: IVAS Param ISM Config Structure         */
    const Word16 nchan_obj                                      /* i  : number of ISM channels                  */
+0 −1
Original line number Diff line number Diff line
@@ -83,7 +83,6 @@
#define FIX_1990_SANITIZER_IN_REVERB_LOAD               /* Nokia: Fix issue part of issue 1990 by introducing missing free of structure - keep until #2059 is addressed */
#define TMP_1342_WORKAROUND_DEC_FLUSH_BROKEN_IN_SR      /* FhG: Temporary workaround for incorrect implementation of decoder flush with split rendering */
#define NONBE_1122_KEEP_EVS_MODE_UNCHANGED              /* FhG: Disables fix for issue 1122 in EVS mode to keep BE tests green. This switch should be removed once the 1122 fix is added to EVS via a CR.  */
#define HARM_FD_BWE                                     /* VA: harmonize core-coder FD BWE function duplications */
#define FIX_2429_POST_DECODER
#define FIX_FLOAT_1526_DIRAC_MEM_LEAK                   /* FhG: float issue 1526: potential memory leak in DirAC handles in case of format switching */
#define FIX_2437_HARMONIZE_ENCODERINDEX                 /* FhG: basop issue 2437 EncoderIndex_ivas_fx() and EncoderIndex_fx()*/
+0 −28
Original line number Diff line number Diff line
@@ -368,9 +368,7 @@ void SWB_BWE_decoding_fx(
);

void time_envelop_shaping_fx(
#ifdef HARM_FD_BWE
    const Word16 element_mode, /* i  : element mode                   */
#endif
    Word16 werr[],     /* i/o: SHB synthesis           Q_synth*/
    Word32 SWB_tenv[], /* i/o: frequency envelope          Q15*/
    const Word16 L,    /* i  : frame length                   */
@@ -2594,22 +2592,6 @@ Word16 E_UTIL_f_preemph3_ivas_fx(
    Word16 bits      /* Q0 */
);

#ifndef HARM_FD_BWE
void time_envelop_shaping_fx(
    Word16 werr[],     /* i/o: SHB synthesis           Q_synth*/
    Word32 SWB_tenv[], /* i/o: frequency envelope          Q15*/
    const Word16 L,    /* i  : frame length                   */
    Word16 *Q_synth );

void time_envelop_shaping_ivas_fx(
#ifdef HARM_FD_BWE
    const Word16 element_mode, /* i  : element mode                   */
#endif
    Word16 werr[],     /* i/o: SHB synthesis           Q_synth*/
    Word32 SWB_tenv[], /* i/o: frequency envelope          Q15*/
    const Word16 L,    /* i  : frame length                   */
    Word16 *Q_synth );
#endif
void find_td_envelope_fx(
    const Word16 inp[], /* i  : input signal                            Qx */
    const Word16 len,   /* i  : length of the input signal                 */
@@ -6955,15 +6937,6 @@ Word16 WB_BWE_gain_deq_fx(

/* o : Q_syn_hb*/
Word16 wb_bwe_dec_fx(
#ifndef HARM_FD_BWE
    Word16 *synth_fx,            /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
    Word16 *hb_synth_fx,         /* o  : SHB synthesis/final synthesis          Q_syn_hb */
    const Word16 output_frame,   /* i  : frame length                            */
    Word16 *voice_factors_fx,    /* i  : voicing factors                 Q15        */
    const Word16 pitch_buf_fx[], /* i  : pitch buffer                      Q6      */
    Decoder_State *st_fx,        /* i/o: decoder state structure                 */
    Word16 *Qpost );
#else
    Decoder_State *st_fx,           /* i/o: decoder state structure                 */
    Word32 output_fx32[],           /* o  : synthesis @internal Fs               Q11*/
    Word16 *synth_fx,               /* i/o: ACELP core synthesis/final synthesis   Q0/Qpost */
@@ -6973,7 +6946,6 @@ Word16 wb_bwe_dec_fx(
    Word16 *voice_factors_fx,       /* i  : voicing factors                     Q15 */
    const Word16 pitch_buf_fx[],    /* i  : pitch buffer                         Q6 */
    Word16 *Qpost );
#endif

/* o  : BWE class */
Word16 swb_bwe_gain_deq_fx(
+0 −84
Original line number Diff line number Diff line
@@ -1945,89 +1945,7 @@ return;
/*--------------------------------------------------------------------------*/

void time_envelop_shaping_fx(
#ifndef HARM_FD_BWE
    Word16 werr[],     /* i/o: SHB synthesis           Q_synth*/
    Word32 SWB_tenv[], /* i/o: frequency envelope          Q15*/
    const Word16 L,    /* i  : frame length                   */
    Word16 *Q_synth )
{
    Word16 *pit;
    Word32 Energy;
    Word16 i, j;
    Word16 tmp_ener, Energy_16;
    Word16 exp_L, exp, frac, tmp, inv_L;
    Word32 L_tmp;

    pit = werr;
    exp_L = norm_s( L );
    inv_L = div_s( shl( 1, sub( 14, exp_L ) ), L ); /*Q(29-exp_L) */
    FOR( i = 0; i < SWB_TENV; i++ )
    {
        Energy = L_deposit_l( 0 );
        FOR( j = 0; j < L / 4; j++ )
        {
            Energy = L_mac0_sat( Energy, *pit, *pit ); /*(2*Q_synth) */
            pit++;
        }
        Energy = Mult_32_16( Energy, inv_L ); /*Q(29-exp_L-15) -> Q(-exp_L+14+2*Q_synth) */
        Energy_16 = 0;
        move16();
        /*exp = 31-(-exp_L+14 +(2*(*Q_synth))); */
        exp = sub( 17, sub( shl( ( *Q_synth ), 1 ), exp_L ) );

        IF( Energy != 0 )
        {
            exp = norm_l( Energy );
            frac = extract_h( L_shl( Energy, exp ) );
            /*exp = sub(exp, 30-(-exp_L+14-2+(2*(*Q_synth))));  */
            exp = sub( exp, sub( 30, add( sub( shl( ( *Q_synth ), 1 ), exp_L ), 14 - 2 ) ) );

            tmp = div_s( 16384, frac );
            L_tmp = L_deposit_h( tmp );
            Energy = Isqrt_lc( L_tmp, &exp );                        /*Q(31-exp) */
            Energy_16 = round_fx( L_shl( Energy, sub( exp, 15 ) ) ); /*Q0 */
        }

        test();
        IF( LT_32( SWB_tenv[i], 65536 /* 2 in Q15 */ ) && LT_32( Energy, L_shl_sat( SWB_tenv[i], sub( 16, exp ) ) ) )
        {
            *Q_synth = add( *Q_synth, 3 );
            move16();
        }
        ELSE
        {
            pit -= shr( L, 2 );
            move16();
            tmp_ener = 0;
            move16();
            exp = 0;
            move16();

            IF( Energy_16 != 0 )
            {
                exp = norm_s( Energy_16 );
                tmp_ener = div_s( shl( 1, sub( 14, exp ) ), Energy_16 ); /*Q(29-exp) */
            }

            L_tmp = Mult_32_16( SWB_tenv[i], tmp_ener ); /*Q(29-exp) */
            tmp = round_fx( L_tmp );                     /*Q(13-exp) */

            FOR( j = 0; j < L / 4; j++ )
            {
                *pit = round_fx_sat( L_shl_sat( L_mult( tmp, *pit ), sub( exp, 1 ) ) ); /*Q(13-exp+1)->Q(14-exp)->Qsyn-3 */
                move16();
                pit++;
            }
        }
    }

    return;
}

void time_envelop_shaping_ivas_fx(
#else
    const Word16 element_mode, /* i  : element mode                   */
#endif
    Word16 werr[],     /* i/o: SHB synthesis           Q_synth*/
    Word32 SWB_tenv[], /* i/o: frequency envelope          Q15*/
    const Word16 L,    /* i  : frame length                   */
@@ -2047,7 +1965,6 @@ void time_envelop_shaping_ivas_fx(

    FOR( i = 0; i < SWB_TENV; i++ )
    {
#ifdef HARM_FD_BWE
        IF( element_mode == EVS_MONO )
        {
            Energy = L_deposit_l( 0 );
@@ -2059,7 +1976,6 @@ void time_envelop_shaping_ivas_fx(
            Energy_Q = shl( ( *Q_synth ), 1 );
        }
        ELSE
#endif
        {
            Energy_64 = L_deposit_l( 0 );
            FOR( j = 0; j < L / 4; j++ )
+0 −4
Original line number Diff line number Diff line
@@ -381,11 +381,7 @@ ivas_error evs_dec_fx(
        ELSE IF( EQ_16( st_fx->extl, WB_BWE ) && st_fx->bws_cnt == 0 )
        {
            /* WB BWE decoder */
#ifdef HARM_FD_BWE
            hb_synth_fx_exp = wb_bwe_dec_fx( st_fx, NULL, synth_fx, hb_synth_fx, 0, output_frame, voice_factors_fx, pitch_buf_fx, &Qpostd ); /*Q0*/
#else
            hb_synth_fx_exp = wb_bwe_dec_fx( synth_fx, hb_synth_fx, output_frame, voice_factors_fx, pitch_buf_fx, st_fx, &Qpostd ); /*Q0*/
#endif
        }

        /*---------------------------------------------------------------------*
Loading