Commit 04ff9d8b authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Add changes to maintain EVS BE.

parent 4d598116
Loading
Loading
Loading
Loading
Loading
+28 −4
Original line number Diff line number Diff line
@@ -2720,7 +2720,12 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
                               const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned   */
                               Word16 bufY16_exp,    /* i: exponent of buffer bufY16           */
                               Word16 len,           /* i: buffer len to process               */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                               Word16 *exp,           /* o: result exponent                     */
                               const Word16 is_ivas ) /* i: flag indicating IVAS to maintain EVS BE */
#else
                               Word16 *exp ) /* o: result exponent                     */
#endif
{
    Word32 L_sum;
    Word16 shift, shift1, i;
@@ -2728,7 +2733,14 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un

    shift = getScaleFactor32( bufX32, len ); /* current available headroom */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    IF( EQ_16( is_ivas, 1 ) )
    {
        shift = sub( shift, sub( 15, norm_s( len ) ) ); /* reduced required headroom  */
    }
    ELSE
    {
        shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom  */
    }
#else
    shift = sub( shift, sub( 14, norm_s( len ) ) ); /* reduced required headroom  */
#endif
@@ -2737,7 +2749,14 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
    FOR( i = 0; i < len; i++ )
    {
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
        IF( EQ_16( is_ivas, 1 ) )
        {
            L_sum = L_add( L_sum, Mpy_32_16_1( L_shl( bufX32[i], shift ), bufY16[i] ) );
        }
        ELSE
        {
            L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] );
        }
#else
        L_sum = L_mac0( L_sum, round_fx( L_shl( bufX32[i], shift ) ), bufY16[i] );
#endif
@@ -2746,7 +2765,12 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
    L_sum = L_shl( L_sum, shift1 ); /* return value */

    shift = sub( add( bufX32_exp, bufY16_exp ), add( shift, shift1 ) );
#ifndef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    IF( EQ_16( is_ivas, 0 ) )
    {
        shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */
    }
#else
    shift = add( shift, 1 ); /* compensate for factor of 2 introduced by L_mac0 */
#endif
    /* In case of NULL result, we want to have a 0 exponent too */
+6 −1
Original line number Diff line number Diff line
@@ -864,7 +864,12 @@ Word32 dotWord32_16_Mant32Exp( const Word32 *bufX32, /* i: 32-bit buffer with un
                               const Word16 *bufY16, /* i: 16-bit buffer quite right-aligned   */
                               Word16 bufY16_exp,    /* i: exponent of buffer bufY16           */
                               Word16 len,           /* i: buffer len to process               */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                               Word16 *exp,            /* o: result exponent                     */
                               const Word16 is_ivas ); /* i: flag indicating IVAS to maintain EVS BE */
#else
                               Word16 *exp ); /* o: result exponent                     */
#endif

/*!**********************************************************************
   \brief   Converts linear factor or energy to Decibel
+5 −0
Original line number Diff line number Diff line
@@ -6448,7 +6448,12 @@ void noisy_speech_detection_fx(
    HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure            */
    const Word16 vad,            /* i  : VAD flag                    */
    const Word16 *syn,           /* i  : i   time-domain frame       */
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
    const Word16 Q,
    const Word16 is_ivas );
#else
    const Word16 Q );
#endif

void generate_comfort_noise_dec_fx(
    Word32 **bufferReal, /* o   : matrix to real part of i   bands */
+4 −0
Original line number Diff line number Diff line
@@ -1549,7 +1549,11 @@ ivas_error acelp_core_dec_fx(
            IF( st->idchan == 0 && ( st->flag_cna || ( EQ_16( st->cng_type, FD_CNG ) && LE_32( st->total_brate, ACELP_32k ) ) || ( st->cng_type == LP_CNG && LE_32( st->core_brate, SID_2k40 ) ) ) )
            {
                /*Noisy speech detector*/
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
                noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn, 1 );
#else
                noisy_speech_detection_fx( st->hFdCngDec, st->VAD, psyn_fx, st->Q_syn );
#endif

                st->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( st->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ );
                move16();
+4 −0
Original line number Diff line number Diff line
@@ -798,7 +798,11 @@ ivas_error amr_wb_dec_fx(
        move16();

        /*Noisy speech detector*/
#ifdef FIX_BASOP_1765_MASA1TC_CNG_MISMATCH
        noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn, 0 );
#else
        noisy_speech_detection_fx( st_fx->hFdCngDec, st_fx->VAD, syn_fx, st_fx->Q_syn );
#endif

        st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech = mult_r( st_fx->hFdCngDec->hFdCngCom->likelihood_noisy_speech, 32440 /*0.99 Q15*/ );
        IF( st_fx->hFdCngDec->hFdCngCom->flag_noisy_speech != 0 )
Loading