Commit b5cf1ca8 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for bitexactness failure

parent 6fe28e40
Loading
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -359,7 +359,8 @@ void SWB_BWE_decoding_fx(
	Word16 *prev_weight,      /* i/o: excitation weight value of last frame */
	const Word16 extl,             /* i  : extension layer                       */
	Word16 Q_syn
	, const Word16 last_extl          /* i  : extension layer of last frame         */
	, const Word16 last_extl,          /* i  : extension layer of last frame         */
  Word16 element_mode       /* i  : element mode  */
);

void time_envelop_shaping_fx(
@@ -2519,7 +2520,8 @@ void SWB_BWE_decoding_fx(
  Word16 *prev_weight,      /* i/o: excitation weight value of last frame */
  const Word16 extl,             /* i  : extension layer                       */
  Word16 Q_syn
  , const Word16 last_extl          /* i  : extension layer of last frame         */
  , const Word16 last_extl,          /* i  : extension layer of last frame         */
  Word16 element_mode       /* i  : element mode  */
);

void time_envelop_shaping_fx(
@@ -7677,7 +7679,8 @@ void generate_comfort_noise_dec_hf_ivas_fx(
   Word16 *bfi_pitch,                 /* i/o: update of the estimated pitch for FEC      */
   Word16 *bfi_pitch_frame,           /* o  : frame length when pitch was updated        */
   Word16 *upd_cnt                    /* i/o: update counter                             */
   , const Word16 coder_type                  /* i  : coder_type                                 */
   , const Word16 coder_type,                  /* i  : coder_type                                 */
   Word16 element_mode                      /* i  : element mode                                  */                                                       
 );

 //FEC_scale_sync_fx.c
+16 −4
Original line number Diff line number Diff line
@@ -1359,7 +1359,8 @@ void SWB_BWE_decoding_fx(
	Word16 *prev_weight,        /* i/o: excitation weight value of last frame */
	const Word16 extl,          /* i  : extension layer                       */
	Word16 Q_syn
	, const Word16 last_extl     /* i  : extension layer of last frame         */
	, const Word16 last_extl,   /* i  : extension layer of last frame         */
  Word16 element_mode         /* i  : element mode                          */                
)
{
	Word16 n_freq, n_band, L, L_swb_norm;
@@ -1559,11 +1560,22 @@ void SWB_BWE_decoding_fx(
		exp = norm_s(SWB_FENV);
		tmp = div_s(shl(1,sub(14,exp)),SWB_FENV); /*Q(29-exp) */
		L_tmp = Mult_32_16(L_energy,tmp); /*Q(1+29-exp+1)->Q(15-exp) */
    IF(EQ_16(element_mode, EVS_MONO))
    {
#ifdef BASOP_NOGLOB
       Energy_16 = round_fx_sat(L_shl_sat(L_tmp, add(exp, 4)));
#else
      EnergyL_16 = round_fx( L_shl( L_tmp, add( exp, 4 ) ) );
#endif
    }
    ELSE
    {
#ifdef BASOP_NOGLOB
		  EnergyL_16 = round_fx_sat(L_shl_sat(L_tmp, add(exp, 4))); /* Q3 */
#else
		  Energy_16 = round_fx(L_shl(L_tmp,add(exp,4))); /*Q3 */
#endif
    }

		IF(NE_16(last_extl, SWB_BWE) && NE_16(last_extl,FB_BWE))
		{
+3 −2
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ void FEC_pitch_estim_fx(
    Word16 *bfi_pitch,                 /* i/o: update of the estimated pitch for FEC      */
    Word16 *bfi_pitch_frame,           /* o  : frame length when pitch was updated        */
    Word16 *upd_cnt                    /* i/o: update counter                             */
    ,const Word16 coder_type                  /* i  : coder_type                                 */
    ,const Word16 coder_type,                /* i  : coder_type                                 */
    Word16 element_mode                      /* i  : element mode                                  */
)
{
    Word16 tmp,tmp1,tmp2,tmp3;
@@ -65,7 +66,7 @@ void FEC_pitch_estim_fx(
#endif

    test(); test();
    IF (EQ_16(last_core, HQ_CORE) || EQ_16(last_core, TCX_20_CORE)  || EQ_16(last_core, TCX_10_CORE))
    IF ((EQ_16(element_mode, EVS_MONO) && EQ_16(last_core, HQ_CORE)) || (NE_16(element_mode, EVS_MONO) && (EQ_16(last_core, HQ_CORE) || EQ_16(last_core, TCX_20_CORE)  || EQ_16(last_core, TCX_10_CORE))))
    {
        *bfi_pitch = pitch_buf[shr(L_frame,6)-1];
        move16();
+1 −1
Original line number Diff line number Diff line
@@ -1117,7 +1117,7 @@ ivas_error acelp_core_dec_fx(
             *------------------------------------------------------------*/

            FEC_pitch_estim_fx( st_fx->Opt_AMR_WB, st_fx->last_core, st_fx->L_frame, st_fx->clas_dec, st_fx->last_good, pitch_buf_fx, st_fx->old_pitch_buf_fx,
                    &st_fx->bfi_pitch_fx, &st_fx->bfi_pitch_frame, &st_fx->upd_cnt, st_fx->coder_type );
                    &st_fx->bfi_pitch_fx, &st_fx->bfi_pitch_frame, &st_fx->upd_cnt, st_fx->coder_type, st_fx->element_mode );

            /*------------------------------------------------------------*
             * FEC - Smooth the speech energy evolution when recovering after a BAD frame
+1 −1
Original line number Diff line number Diff line
@@ -1268,7 +1268,7 @@ ivas_error acelp_core_dec_ivas_fx(

            //FEC_pitch_estim( st->Opt_AMR_WB, st->last_core, st->L_frame, st->clas_dec, st->last_good, pitch_buf, st->old_pitch_buf, &st->bfi_pitch, &st->bfi_pitch_frame, &st->upd_cnt, st->coder_type );
            FEC_pitch_estim_fx(st->Opt_AMR_WB, st->last_core, st->L_frame, st->clas_dec, st->last_good, pitch_buf_fx, st->old_pitch_buf_fx,
                &st->bfi_pitch_fx, &st->bfi_pitch_frame, &st->upd_cnt, st->coder_type);
                &st->bfi_pitch_fx, &st->bfi_pitch_frame, &st->upd_cnt, st->coder_type, st->element_mode);

            /*------------------------------------------------------------*
             * FEC - Smooth the speech energy evolution when recovering after a BAD frame
Loading