Loading lib_enc/enc_acelp.c +4 −0 Original line number Diff line number Diff line Loading @@ -1141,7 +1141,11 @@ void E_ACELP_4tsearch(Word16 dn[], const Word16 cn[], const Word16 H[], Word16 c BASOP_SATURATE_WARNING_OFF FOR (i = 0; i < L_SUBFR; i++) { #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, H[i], H[i], &Overflow); #else L_tmp = L_mac(L_tmp, H[i], H[i]); #endif } val = extract_h(L_tmp); BASOP_SATURATE_WARNING_ON Loading lib_enc/find_tilt_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -227,7 +227,11 @@ void find_tilt_fx( IF( EQ_16(bwidth,NB)) /* For NB input, compensate for the missing bands */ { #ifdef BASOP_NOGLOB Ltmp = L_shl_o(ee[i], 3, &Overflow); #else Ltmp = L_shl(ee[i], 3); #endif IF (EQ_32(Ltmp, MAX_32)) /* if Overflow: Compute with less precision */ { Ltmp = Mult_32_16(ee[i], 24576); /* 6/8 */ Loading lib_enc/find_uv.c +17 −0 Original line number Diff line number Diff line Loading @@ -258,7 +258,11 @@ Word16 find_uv_fx( /* o : coding type { dE2_th = 21<<10; move32(); #ifdef BASOP_NOGLOB if(GE_16(add_o(mean_voi3, corr_shift, &Overflow), 22282)) /*( mean_voi3 + corr_shift ) >= 0.68f*/ #else if(GE_16(add(mean_voi3, corr_shift), 22282)) /*( mean_voi3 + corr_shift ) >= 0.68f*/ #endif { nb_cond = 0; move16(); Loading Loading @@ -412,6 +416,18 @@ Word16 find_uv_fx( /* o : coding type test(); test(); test(); #ifdef BASOP_NOGLOB if( ( ( LT_16(add_o(mean_voi3, corr_shift, &Overflow),add(22282,mean_voi3_offset)))&& /* normalized correlation low */ ( LT_16(add_o(st_fx->voicing_fx[2], corr_shift, &Overflow),25887) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32(ee[0], 640) ) && ( GT_32(hp_E[0], E_min_th) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ ( LT_32(ee[1], ee1_th) ) && ( GT_32(hp_E[1], E_min_th) ) && /* ... biased towards look-ahead to detect onsets */ ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ /*( st_fx->music_hysteresis_fx == 0 ) &&*/ /* ... and in segment after AUDIO frames */ ( LE_32(dE1, 237568) ) && /* Avoid on sharp energy spikes */ ( LE_32(st_fx->old_dE1_fx,237568) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst_fx < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ #else if( ( ( LT_16(add(mean_voi3, corr_shift),add(22282,mean_voi3_offset)))&& /* normalized correlation low */ ( LT_16(add(st_fx->voicing_fx[2], corr_shift),25887) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32(ee[0], 640) ) && ( GT_32(hp_E[0], E_min_th) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ Loading @@ -422,6 +438,7 @@ Word16 find_uv_fx( /* o : coding type ( LE_32(st_fx->old_dE1_fx,237568) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst_fx < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ #endif { coder_type = UNVOICED; move16(); Loading lib_enc/hq_lr_enc_fx.c +16 −1 Original line number Diff line number Diff line Loading @@ -493,8 +493,11 @@ void hq_lr_enc_fx( move16(); } L_tmp =Mult_32_16(Ep_vari_fx,3277);/*13+15-15=13 */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(L_tmp,tmp),sub(12,exp), &Overflow);/*Q(13+exp-15 +12-exp +4 = 14) */ #else L_tmp = L_shl(Mult_32_16(L_tmp,tmp),sub(12,exp));/*Q(13+exp-15 +12-exp +4 = 14) */ #endif tmp2 = extract_h(Ep_avrg_fx);/*Q13-16=-3 */ IF(tmp2 != 0) { Loading @@ -511,7 +514,11 @@ void hq_lr_enc_fx( move16(); } L_tmp2 =Mult_32_16(Ep_vari_fx,6554);/*13+15-15=13 */ #ifdef BASOP_NOGLOB L_tmp2 = L_shl_o(Mult_32_16(L_tmp2,tmp2),sub(13,exp), &Overflow);/*Q(13+exp-15 +13-exp +3 = 14) */ #else L_tmp2 = L_shl(Mult_32_16(L_tmp2,tmp2),sub(13,exp));/*Q(13+exp-15 +13-exp +3 = 14) */ #endif L_tmp=L_min(L_tmp,L_tmp2);/*14 */ tmp=extract_l(L_min(L_tmp,13107));/*14 */ alpha_fx =add(16384,tmp); Loading @@ -535,7 +542,11 @@ void hq_lr_enc_fx( exp = 0; move16(); } #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(Ep_avrg_fx,tmp),sub(14,exp), &Overflow);/*Q(13+exp-15 +14-exp+2 = 14) */ #else L_tmp = L_shl(Mult_32_16(Ep_avrg_fx,tmp),sub(14,exp));/*Q(13+exp-15 +14-exp+2 = 14) */ #endif L_tmp =L_max(L_tmp,16384); /*14 */ tmp=extract_l(L_min(L_tmp,beta_fx)); /*14 */ alpha_fx=shl(mult(alpha_fx,tmp),1);/*14+14-15 +1=14 */ Loading @@ -558,7 +569,11 @@ void hq_lr_enc_fx( exp = 0; move16(); } #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(Ep_tmp_fx[i],tmp2),sub(19,exp), &Overflow);/*Q(13+exp-15 +19-exp +3 = 20) */ #else L_tmp = L_shl(Mult_32_16(Ep_tmp_fx[i],tmp2),sub(19,exp));/*Q(13+exp-15 +19-exp +3 = 20) */ #endif L_tmp = Mult_32_16(L_tmp,shl(sub(bands_fx,lowband),9));/*20 +9 -15 =14 */ L_tmp =L_max(L_tmp,13926); /*14 */ tmp2 =extract_l(L_min(L_tmp,16384)); /*14 */ Loading lib_enc/stat_noise_uv_enc_fx.c +15 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,9 @@ void stat_noise_uv_enc_fx( { Word16 noisiness = 0; Word16 num,den,expn,expd; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif test(); test(); IF ( ( EQ_16(st_fx->coder_type,UNVOICED) && uc_two_stage_flag == 0) || (EQ_16(st_fx->coder_type,INACTIVE) && LE_32(st_fx->core_brate_fx,ACELP_9k60))) Loading @@ -56,12 +58,23 @@ void stat_noise_uv_enc_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub(norm_l(LepsP[0]),1); #ifdef BASOP_NOGLOB num = extract_h(L_shl_o(LepsP[0],expn, &Overflow));/*expn-16*/ #else num = extract_h(L_shl(LepsP[0],expn));/*expn-16*/ #endif expd = norm_l(LepsP[1]); #ifdef BASOP_NOGLOB den = extract_h(L_shl_o(LepsP[1],expd, &Overflow));/*expd-16*/ #else den = extract_h(L_shl(LepsP[1],expd));/*expd-16*/ #endif num = div_s(num,den);/*expn-expd+15*/ #ifdef BASOP_NOGLOB num = shr_o(num,add(sub(expn,expd),5), &Overflow);/*Q10*/ #else num = shr(num,add(sub(expn,expd),5));/*Q10*/ #endif num = sub(num,1024);/*num - 1*/ test(); Loading Loading
lib_enc/enc_acelp.c +4 −0 Original line number Diff line number Diff line Loading @@ -1141,7 +1141,11 @@ void E_ACELP_4tsearch(Word16 dn[], const Word16 cn[], const Word16 H[], Word16 c BASOP_SATURATE_WARNING_OFF FOR (i = 0; i < L_SUBFR; i++) { #ifdef BASOP_NOGLOB L_tmp = L_mac_o(L_tmp, H[i], H[i], &Overflow); #else L_tmp = L_mac(L_tmp, H[i], H[i]); #endif } val = extract_h(L_tmp); BASOP_SATURATE_WARNING_ON Loading
lib_enc/find_tilt_fx.c +4 −0 Original line number Diff line number Diff line Loading @@ -227,7 +227,11 @@ void find_tilt_fx( IF( EQ_16(bwidth,NB)) /* For NB input, compensate for the missing bands */ { #ifdef BASOP_NOGLOB Ltmp = L_shl_o(ee[i], 3, &Overflow); #else Ltmp = L_shl(ee[i], 3); #endif IF (EQ_32(Ltmp, MAX_32)) /* if Overflow: Compute with less precision */ { Ltmp = Mult_32_16(ee[i], 24576); /* 6/8 */ Loading
lib_enc/find_uv.c +17 −0 Original line number Diff line number Diff line Loading @@ -258,7 +258,11 @@ Word16 find_uv_fx( /* o : coding type { dE2_th = 21<<10; move32(); #ifdef BASOP_NOGLOB if(GE_16(add_o(mean_voi3, corr_shift, &Overflow), 22282)) /*( mean_voi3 + corr_shift ) >= 0.68f*/ #else if(GE_16(add(mean_voi3, corr_shift), 22282)) /*( mean_voi3 + corr_shift ) >= 0.68f*/ #endif { nb_cond = 0; move16(); Loading Loading @@ -412,6 +416,18 @@ Word16 find_uv_fx( /* o : coding type test(); test(); test(); #ifdef BASOP_NOGLOB if( ( ( LT_16(add_o(mean_voi3, corr_shift, &Overflow),add(22282,mean_voi3_offset)))&& /* normalized correlation low */ ( LT_16(add_o(st_fx->voicing_fx[2], corr_shift, &Overflow),25887) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32(ee[0], 640) ) && ( GT_32(hp_E[0], E_min_th) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ ( LT_32(ee[1], ee1_th) ) && ( GT_32(hp_E[1], E_min_th) ) && /* ... biased towards look-ahead to detect onsets */ ( tmp_offset_flag == 0 ) && /* Take care of voiced offsets */ /*( st_fx->music_hysteresis_fx == 0 ) &&*/ /* ... and in segment after AUDIO frames */ ( LE_32(dE1, 237568) ) && /* Avoid on sharp energy spikes */ ( LE_32(st_fx->old_dE1_fx,237568) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst_fx < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ #else if( ( ( LT_16(add(mean_voi3, corr_shift),add(22282,mean_voi3_offset)))&& /* normalized correlation low */ ( LT_16(add(st_fx->voicing_fx[2], corr_shift),25887) ) && /* normalized correlation low on look-ahead - onset detection */ ( LT_32(ee[0], 640) ) && ( GT_32(hp_E[0], E_min_th) ) && /* energy concentrated in high frequencies provided that some energy is present in HF... */ Loading @@ -422,6 +438,7 @@ Word16 find_uv_fx( /* o : coding type ( LE_32(st_fx->old_dE1_fx,237568) ) && /* + one frame hysteresis */ ( st_fx->spike_hyst_fx < 0 ) ) || /* Avoid after sharp energy spikes followed by decay (e.g. castanets) */ flag_low_relE ) /* low relative frame energy (only for SC-VBR) */ #endif { coder_type = UNVOICED; move16(); Loading
lib_enc/hq_lr_enc_fx.c +16 −1 Original line number Diff line number Diff line Loading @@ -493,8 +493,11 @@ void hq_lr_enc_fx( move16(); } L_tmp =Mult_32_16(Ep_vari_fx,3277);/*13+15-15=13 */ #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(L_tmp,tmp),sub(12,exp), &Overflow);/*Q(13+exp-15 +12-exp +4 = 14) */ #else L_tmp = L_shl(Mult_32_16(L_tmp,tmp),sub(12,exp));/*Q(13+exp-15 +12-exp +4 = 14) */ #endif tmp2 = extract_h(Ep_avrg_fx);/*Q13-16=-3 */ IF(tmp2 != 0) { Loading @@ -511,7 +514,11 @@ void hq_lr_enc_fx( move16(); } L_tmp2 =Mult_32_16(Ep_vari_fx,6554);/*13+15-15=13 */ #ifdef BASOP_NOGLOB L_tmp2 = L_shl_o(Mult_32_16(L_tmp2,tmp2),sub(13,exp), &Overflow);/*Q(13+exp-15 +13-exp +3 = 14) */ #else L_tmp2 = L_shl(Mult_32_16(L_tmp2,tmp2),sub(13,exp));/*Q(13+exp-15 +13-exp +3 = 14) */ #endif L_tmp=L_min(L_tmp,L_tmp2);/*14 */ tmp=extract_l(L_min(L_tmp,13107));/*14 */ alpha_fx =add(16384,tmp); Loading @@ -535,7 +542,11 @@ void hq_lr_enc_fx( exp = 0; move16(); } #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(Ep_avrg_fx,tmp),sub(14,exp), &Overflow);/*Q(13+exp-15 +14-exp+2 = 14) */ #else L_tmp = L_shl(Mult_32_16(Ep_avrg_fx,tmp),sub(14,exp));/*Q(13+exp-15 +14-exp+2 = 14) */ #endif L_tmp =L_max(L_tmp,16384); /*14 */ tmp=extract_l(L_min(L_tmp,beta_fx)); /*14 */ alpha_fx=shl(mult(alpha_fx,tmp),1);/*14+14-15 +1=14 */ Loading @@ -558,7 +569,11 @@ void hq_lr_enc_fx( exp = 0; move16(); } #ifdef BASOP_NOGLOB L_tmp = L_shl_o(Mult_32_16(Ep_tmp_fx[i],tmp2),sub(19,exp), &Overflow);/*Q(13+exp-15 +19-exp +3 = 20) */ #else L_tmp = L_shl(Mult_32_16(Ep_tmp_fx[i],tmp2),sub(19,exp));/*Q(13+exp-15 +19-exp +3 = 20) */ #endif L_tmp = Mult_32_16(L_tmp,shl(sub(bands_fx,lowband),9));/*20 +9 -15 =14 */ L_tmp =L_max(L_tmp,13926); /*14 */ tmp2 =extract_l(L_min(L_tmp,16384)); /*14 */ Loading
lib_enc/stat_noise_uv_enc_fx.c +15 −2 Original line number Diff line number Diff line Loading @@ -45,7 +45,9 @@ void stat_noise_uv_enc_fx( { Word16 noisiness = 0; Word16 num,den,expn,expd; #ifdef BASOP_NOGLOB Flag Overflow = 0; #endif test(); test(); IF ( ( EQ_16(st_fx->coder_type,UNVOICED) && uc_two_stage_flag == 0) || (EQ_16(st_fx->coder_type,INACTIVE) && LE_32(st_fx->core_brate_fx,ACELP_9k60))) Loading @@ -56,12 +58,23 @@ void stat_noise_uv_enc_fx( *-----------------------------------------------------------------*/ /* epsP[2] is located in LepsP[0] and epsP[16] in LepsP[1] */ expn = sub(norm_l(LepsP[0]),1); #ifdef BASOP_NOGLOB num = extract_h(L_shl_o(LepsP[0],expn, &Overflow));/*expn-16*/ #else num = extract_h(L_shl(LepsP[0],expn));/*expn-16*/ #endif expd = norm_l(LepsP[1]); #ifdef BASOP_NOGLOB den = extract_h(L_shl_o(LepsP[1],expd, &Overflow));/*expd-16*/ #else den = extract_h(L_shl(LepsP[1],expd));/*expd-16*/ #endif num = div_s(num,den);/*expn-expd+15*/ #ifdef BASOP_NOGLOB num = shr_o(num,add(sub(expn,expd),5), &Overflow);/*Q10*/ #else num = shr(num,add(sub(expn,expd),5));/*Q10*/ #endif num = sub(num,1024);/*num - 1*/ test(); Loading