@@ -303,7 +313,11 @@ Word16 find_uv_fx( /* o : coding type */
...
@@ -303,7 +313,11 @@ Word16 find_uv_fx( /* o : coding type */
test();
test();
if((EQ_16(st_fx->last_coder_type_raw,UNVOICED))||/* previous frame was unvoiced */
if((EQ_16(st_fx->last_coder_type_raw,UNVOICED))||/* previous frame was unvoiced */
((LT_32(ee[0],ee0_th))&&(GT_32(hp_E[0],L_shl(E_MIN_FX,Q_new)))&&/* energy is concentrated in high frequencies provided that some energy is present in HF */
((LT_32(ee[0],ee0_th))&&(GT_32(hp_E[0],L_shl(E_MIN_FX,Q_new)))&&/* energy is concentrated in high frequencies provided that some energy is present in HF */
#ifdef ISSUE_1867_replace_overflow_libenc
(LT_16(add_sat(st_fx->voicing_fx[0],corr_shift),voi_th))))/* normalized correlation is low */
#else
(LT_16(add_o(st_fx->voicing_fx[0],corr_shift,&Overflow),voi_th))))/* normalized correlation is low */
(LT_16(add_o(st_fx->voicing_fx[0],corr_shift,&Overflow),voi_th))))/* normalized correlation is low */
#endif
{
{
tmp_offset_flag=0;
tmp_offset_flag=0;
move16();
move16();
...
@@ -379,8 +393,13 @@ Word16 find_uv_fx( /* o : coding type */
...
@@ -379,8 +393,13 @@ Word16 find_uv_fx( /* o : coding type */
test();
test();
test();
test();
test();
test();
#ifdef ISSUE_1867_replace_overflow_libenc
if(((LT_16(add_sat(mean_voi3,corr_shift),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
(LT_16(add_sat(st_fx->voicing_fx[2],corr_shift),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
#else
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
(LT_16(add_o(st_fx->voicing_fx[2],corr_shift,&Overflow),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_16(add_o(st_fx->voicing_fx[2],corr_shift,&Overflow),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
#endif
(LT_32(ee[0],640/* 10.0f in Q6 */))&&(GT_32(hp_E[0],E_min_th))&&/* energy concentrated in high frequencies provided that some energy is present in HF... */
(LT_32(ee[0],640/* 10.0f in Q6 */))&&(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 */
(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 */
(tmp_offset_flag==0)&&/* Take care of voiced offsets */
...
@@ -408,7 +427,11 @@ Word16 find_uv_fx( /* o : coding type */
...
@@ -408,7 +427,11 @@ Word16 find_uv_fx( /* o : coding type */
test();
test();
test();
test();
test();
test();
#ifdef ISSUE_1867_replace_overflow_libenc
if(((LT_16(add_sat(mean_voi3,corr_shift),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
#else
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
#endif
(LT_16(add_sat(st_fx->voicing_fx[2],corr_shift),25887/* 0.8 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_16(add_sat(st_fx->voicing_fx[2],corr_shift),25887/* 0.8 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_32(ee[0],397/* 6.2f in Q6 */))&&(GT_32(hp_E[0],E_min_th))&&/* energy concentrated in high frequencies provided that some energy is present in HF... */
(LT_32(ee[0],397/* 6.2f in Q6 */))&&(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],397/* 6.2f in Q6 */))&&(GT_32(hp_E[1],E_min_th))&&/* ... biased towards look-ahead to detect onsets */
(LT_32(ee[1],397/* 6.2f in Q6 */))&&(GT_32(hp_E[1],E_min_th))&&/* ... biased towards look-ahead to detect onsets */
...
@@ -610,9 +633,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
...
@@ -610,9 +633,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
Word16ee0_th,ee1_th,voi_th,nb_cond,flag_low_relE;
Word16ee0_th,ee1_th,voi_th,nb_cond,flag_low_relE;
NOISE_EST_HANDLEhNoiseEst=st_fx->hNoiseEst;
NOISE_EST_HANDLEhNoiseEst=st_fx->hNoiseEst;
SC_VBR_ENC_HANDLEhSC_VBR=st_fx->hSC_VBR;
SC_VBR_ENC_HANDLEhSC_VBR=st_fx->hSC_VBR;
#ifndef ISSUE_1867_replace_overflow_libenc
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
#ifdef BASOP_NOGLOB_DECLARE_LOCAL
FlagOverflow=0;
FlagOverflow=0;
move32();
move32();
#endif
#endif
#endif
Word16Last_Resort;
Word16Last_Resort;
Word16vadnoise;
Word16vadnoise;
...
@@ -714,7 +739,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
...
@@ -714,7 +739,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
IF((EQ_16(st_fx->last_coder_type_raw,UNVOICED))||/* previous frame was unvoiced */
IF((EQ_16(st_fx->last_coder_type_raw,UNVOICED))||/* previous frame was unvoiced */
((LT_32(ee[0],ee0_th))&&(GT_32(hp_E[0],E_min_th))&&/* energy is concentrated in high frequencies provided that some energy is present in HF */
((LT_32(ee[0],ee0_th))&&(GT_32(hp_E[0],E_min_th))&&/* energy is concentrated in high frequencies provided that some energy is present in HF */
(LT_16(add_o(st_fx->voicing_fx[0],corr_shift,&Overflow),voi_th))))/* normalized correlation is low */
(LT_16(add_o(st_fx->voicing_fx[0],corr_shift,&Overflow),voi_th))))/* normalized correlation is low */
#endif
{
{
tmp_offset_flag=0;
tmp_offset_flag=0;
move16();
move16();
...
@@ -897,6 +937,18 @@ Word16 find_uv_ivas_fx( /* o : coding typ
...
@@ -897,6 +937,18 @@ Word16 find_uv_ivas_fx( /* o : coding typ
test();
test();
test();
test();
test();
test();
#ifdef ISSUE_1867_replace_overflow_libenc
IF(((LT_16(add_sat(mean_voi3,corr_shift),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
(LT_16(add_sat(st_fx->voicing_fx[2],corr_shift),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_32(ee[0],640/* 10.0f in Q6 */))&&(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/* 29.0f in Q13 */))&&/* Avoid on sharp energy spikes */
(LE_32(st_fx->old_dE1_fx,237568/* 29.0f in Q13 */))&&/* + one frame hysteresis */
(st_fx->spike_hyst<0))||/* Avoid after sharp energy spikes followed by decay (e.g. castanets) */
flag_low_relE)
#else
IF(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
IF(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22282/* 0.68 in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
(LT_16(add_o(st_fx->voicing_fx[2],corr_shift,&Overflow),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_16(add_o(st_fx->voicing_fx[2],corr_shift,&Overflow),25887/* 0.79 in Q15 */))&&/* normalized correlation low on look-ahead - onset detection */
(LT_32(ee[0],640/* 10.0f in Q6 */))&&(GT_32(hp_E[0],E_min_th))&&/* energy concentrated in high frequencies provided that some energy is present in HF... */
(LT_32(ee[0],640/* 10.0f in Q6 */))&&(GT_32(hp_E[0],E_min_th))&&/* energy concentrated in high frequencies provided that some energy is present in HF... */
...
@@ -906,7 +958,9 @@ Word16 find_uv_ivas_fx( /* o : coding typ
...
@@ -906,7 +958,9 @@ Word16 find_uv_ivas_fx( /* o : coding typ
(LE_32(dE1,237568/* 29.0f in Q13 */))&&/* Avoid on sharp energy spikes */
(LE_32(dE1,237568/* 29.0f in Q13 */))&&/* Avoid on sharp energy spikes */
(LE_32(st_fx->old_dE1_fx,237568/* 29.0f in Q13 */))&&/* + one frame hysteresis */
(LE_32(st_fx->old_dE1_fx,237568/* 29.0f in Q13 */))&&/* + one frame hysteresis */
(st_fx->spike_hyst<0))||/* Avoid after sharp energy spikes followed by decay (e.g. castanets) */
(st_fx->spike_hyst<0))||/* Avoid after sharp energy spikes followed by decay (e.g. castanets) */
flag_low_relE)/* low relative frame energy (only for SC-VBR) */
flag_low_relE)
#endif
/* low relative frame energy (only for SC-VBR) */
{
{
coder_type=UNVOICED;
coder_type=UNVOICED;
move16();
move16();
...
@@ -923,7 +977,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
...
@@ -923,7 +977,11 @@ Word16 find_uv_ivas_fx( /* o : coding typ
test();
test();
test();
test();
test();
test();
#ifdef ISSUE_1867_replace_overflow_libenc
if(((LT_16(add_sat(mean_voi3,corr_shift),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
#else
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
if(((LT_16(add_o(mean_voi3,corr_shift,&Overflow),add(22774/* 0.695f in Q15 */,mean_voi3_offset)))&&/* normalized correlation low */
(LT_32(ee[0],397/* 6.2f in Q6 */))&&(GT_32(hp_E[0],E_min_th))&&/* energy concentrated in high frequencies provided that some energy is present in HF... */
(LT_32(ee[0],397/* 6.2f in Q6 */))&&(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],397/* 6.2f in Q16 */))&&(GT_32(hp_E[1],E_min_th))&&/* ... biased towards look-ahead to detect onsets */
(LT_32(ee[1],397/* 6.2f in Q16 */))&&(GT_32(hp_E[1],E_min_th))&&/* ... biased towards look-ahead to detect onsets */