Loading apps/renderer.c +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ #include "rotation_file_reader.h" #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "basop32.h" #define WMC_TOOL_SKIP Loading lib_com/basop32.c +5 −0 Original line number Diff line number Diff line Loading @@ -1647,7 +1647,11 @@ Word32 L_add_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) return ( L_var_out ); } #ifdef BASOP_WATCH_L_add Word32 L_add_watch( Word32 L_var1, Word32 L_var2 , const char *fname, int linenumber) #else Word32 L_add( Word32 L_var1, Word32 L_var2 ) #endif /* BASOP_WATCH_L_add */ { Word32 L_var_out; Loading @@ -1658,6 +1662,7 @@ Word32 L_add( Word32 L_var1, Word32 L_var2 ) if ( ( L_var_out ^ L_var1 ) & MIN_32 ) { L_var_out = ( L_var1 < 0 ) ? MIN_32 : MAX_32; fprintf(stderr,"BASOP_WATCH L_add(0x%08X,0x%08X), %s:%d\n", L_var1, L_var2, fname, linenumber); assert( 0 ); } } Loading lib_com/basop32.h +6 −0 Original line number Diff line number Diff line Loading @@ -143,7 +143,13 @@ Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ); /* Msu without sat, 1 */ #define BASOP_WATCH_L_add #ifdef BASOP_WATCH_L_add #define L_add(a,b) L_add_watch(a,b, __FILE__, __LINE__) Word32 L_add_watch( Word32 L_var1, Word32 L_var2 , const char *fname, int linenumber); /* Long add, 1 */ #else Word32 L_add( Word32 L_var1, Word32 L_var2 ); /* Long add, 1 */ #endif /* BASOP_WATCH_L_add */ Word32 L_sub( Word32 L_var1, Word32 L_var2 ); /* Long sub, 1 */ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ); /* Long add with c, 2 */ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ); /* Long sub with c, 2 */ Loading lib_dec/fd_cng_dec_fx.c +19 −17 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ #include "debug.h" #endif #define FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW #define CNA_ACT_DN_LARGE_PARTITION 50 /* index of the first larger partition */ #define ST_PERIODOG_FACT_Q15 29491 /* 0.9 in Q15, short-term filter factor for periodogram */ Loading Loading @@ -586,17 +588,17 @@ Word16 ApplyFdCng_fx( Word16 facTab[NPART]; Word16 facTabExp[NPART]; Word16 tmp_loop; #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW Word32 L_c; #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ Word16 lsp_cng[M]; HANDLE_FD_CNG_DEC hFdCngDec; HANDLE_FD_CNG_COM hFdCngCom; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW Flag Carry = 0; #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ move16(); move16(); #endif Loading Loading @@ -808,7 +810,7 @@ Word16 ApplyFdCng_fx( { tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -841,7 +843,7 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); L_tmp_exp = add( L_tmp_exp, 1 ); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -860,7 +862,7 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); L_tmp_exp = add( L_tmp_exp, 1 ); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; move16(); } Loading @@ -868,7 +870,7 @@ Word16 ApplyFdCng_fx( { tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -899,7 +901,7 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -917,14 +919,14 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ move16(); st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; move16(); } tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -956,14 +958,14 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) { W_tmp = W_add( W_tmp, *( cngNoiseLevel + j ) ); /*Q31 - L_tmp_exp*/ } #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = w_norm_llQ31( W_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ #else L_tmp = w_norm_llQ31_inl( W_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ Loading @@ -979,7 +981,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->cngTDLevel_e = L_tmp_exp; move16(); } Loading Loading @@ -1098,7 +1100,7 @@ Word16 ApplyFdCng_fx( /*st->cngTDLevel = (float)sqrt( (sumFLOAT(cngNoiseLevel, hFdCngCom->stopFFTbin - hFdCngCom->startBand) / 2 * hFdCngCom->fftlen) / st->Mode2_L_frame);*/ tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -1130,7 +1132,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ move16(); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -1148,7 +1150,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->cngTDLevel_e = L_tmp_exp; move16(); BREAK; Loading Loading
apps/renderer.c +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ #include "rotation_file_reader.h" #include "vector3_pair_file_reader.h" #include "wmc_auto.h" #include "basop32.h" #define WMC_TOOL_SKIP Loading
lib_com/basop32.c +5 −0 Original line number Diff line number Diff line Loading @@ -1647,7 +1647,11 @@ Word32 L_add_o( Word32 L_var1, Word32 L_var2, Flag *Overflow ) return ( L_var_out ); } #ifdef BASOP_WATCH_L_add Word32 L_add_watch( Word32 L_var1, Word32 L_var2 , const char *fname, int linenumber) #else Word32 L_add( Word32 L_var1, Word32 L_var2 ) #endif /* BASOP_WATCH_L_add */ { Word32 L_var_out; Loading @@ -1658,6 +1662,7 @@ Word32 L_add( Word32 L_var1, Word32 L_var2 ) if ( ( L_var_out ^ L_var1 ) & MIN_32 ) { L_var_out = ( L_var1 < 0 ) ? MIN_32 : MAX_32; fprintf(stderr,"BASOP_WATCH L_add(0x%08X,0x%08X), %s:%d\n", L_var1, L_var2, fname, linenumber); assert( 0 ); } } Loading
lib_com/basop32.h +6 −0 Original line number Diff line number Diff line Loading @@ -143,7 +143,13 @@ Word32 L_sub_c( Word32 L_var1, Word32 L_var2 ); /* Long sub with c, 2 */ Word32 DEPR_L_msuNs( Word32 L_var3, Word16 var1, Word16 var2, Flag *Carry ); /* Msu without sat, 1 */ #define BASOP_WATCH_L_add #ifdef BASOP_WATCH_L_add #define L_add(a,b) L_add_watch(a,b, __FILE__, __LINE__) Word32 L_add_watch( Word32 L_var1, Word32 L_var2 , const char *fname, int linenumber); /* Long add, 1 */ #else Word32 L_add( Word32 L_var1, Word32 L_var2 ); /* Long add, 1 */ #endif /* BASOP_WATCH_L_add */ Word32 L_sub( Word32 L_var1, Word32 L_var2 ); /* Long sub, 1 */ Word32 L_add_c( Word32 L_var1, Word32 L_var2, Flag *Carry ); /* Long add with c, 2 */ Word32 DEPR_L_sub_c( Word32 L_var1, Word32 L_var2, Flag *Carry ); /* Long sub with c, 2 */ Loading
lib_dec/fd_cng_dec_fx.c +19 −17 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ #include "debug.h" #endif #define FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW #define CNA_ACT_DN_LARGE_PARTITION 50 /* index of the first larger partition */ #define ST_PERIODOG_FACT_Q15 29491 /* 0.9 in Q15, short-term filter factor for periodogram */ Loading Loading @@ -586,17 +588,17 @@ Word16 ApplyFdCng_fx( Word16 facTab[NPART]; Word16 facTabExp[NPART]; Word16 tmp_loop; #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW Word32 L_c; #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ Word16 lsp_cng[M]; HANDLE_FD_CNG_DEC hFdCngDec; HANDLE_FD_CNG_COM hFdCngCom; #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW Flag Carry = 0; #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ move16(); move16(); #endif Loading Loading @@ -808,7 +810,7 @@ Word16 ApplyFdCng_fx( { tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -841,7 +843,7 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); L_tmp_exp = add( L_tmp_exp, 1 ); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -860,7 +862,7 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); L_tmp_exp = add( L_tmp_exp, 1 ); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; move16(); } Loading @@ -868,7 +870,7 @@ Word16 ApplyFdCng_fx( { tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -899,7 +901,7 @@ Word16 ApplyFdCng_fx( L_tmp_exp = add( L_tmp_exp, 31 - 16 ); /*->Q31, L_tmp_exp*/ st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -917,14 +919,14 @@ Word16 ApplyFdCng_fx( st->hTcxDec->conCngLevelBackgroundTrace = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ move16(); st->hTcxDec->conCngLevelBackgroundTrace_e = L_tmp_exp; move16(); } tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -956,14 +958,14 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) { W_tmp = W_add( W_tmp, *( cngNoiseLevel + j ) ); /*Q31 - L_tmp_exp*/ } #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = w_norm_llQ31( W_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ #else L_tmp = w_norm_llQ31_inl( W_tmp, &L_tmp_exp ); /*Q31 - L_tmp_exp*/ Loading @@ -979,7 +981,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_sat( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->cngTDLevel_e = L_tmp_exp; move16(); } Loading Loading @@ -1098,7 +1100,7 @@ Word16 ApplyFdCng_fx( /*st->cngTDLevel = (float)sqrt( (sumFLOAT(cngNoiseLevel, hFdCngCom->stopFFTbin - hFdCngCom->startBand) / 2 * hFdCngCom->fftlen) / st->Mode2_L_frame);*/ tmp_loop = sub( hFdCngCom->stopFFTbin, hFdCngCom->startBand ); #if 0 #ifndef FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW L_tmp = L_deposit_h( 0 ); L_c = L_deposit_h( 0 ); FOR( j = 0; j < tmp_loop; j++ ) Loading Loading @@ -1130,7 +1132,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx_o( Sqrt32( L_tmp, &L_tmp_exp ), &Overflow ); /*Q15 - L_tmp_exp*/ move16(); #else #else /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ { Word64 W_tmp = 0; FOR( j = 0; j < tmp_loop; j++ ) Loading @@ -1148,7 +1150,7 @@ Word16 ApplyFdCng_fx( st->cngTDLevel = round_fx( Sqrt32( L_tmp, &L_tmp_exp ) ); /*Q15 - L_tmp_exp*/ move16(); #endif #endif /* FIX_ISSUE_1817_REPLACE_CARRY_OVERFLOW */ st->cngTDLevel_e = L_tmp_exp; move16(); BREAK; Loading