Loading lib_com/ari_hm.c +17 −0 Original line number Diff line number Diff line Loading @@ -272,7 +272,12 @@ void tcx_hm_modify_envelope( const int16_t L_frame /* i : number of spectral lines */ ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int16_t h, x; int32_t k; #else int16_t k, h, x; #endif Word16 inv_shape[2 * kTcxHmParabolaHalfWidth + 1]; /* Q15 */ if ( gain == 0 ) Loading @@ -290,13 +295,25 @@ void tcx_hm_modify_envelope( while ( k <= L_frame + kTcxHmParabolaHalfWidth - 1 ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int32_t tmp; #endif #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI for ( x = (int16_t) max( 0, k - kTcxHmParabolaHalfWidth ); x <= (int16_t) min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #else for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #endif { env[x] = Mpy_32_16( env[x], inv_shape[x - k + kTcxHmParabolaHalfWidth] ); } ++h; #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI tmp = ( h * lag ); k = tmp >> fract_res; #else k = ( h * lag ) >> fract_res; #endif } return; Loading lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ /* #################### End BE switches ################################## */ Loading Loading
lib_com/ari_hm.c +17 −0 Original line number Diff line number Diff line Loading @@ -272,7 +272,12 @@ void tcx_hm_modify_envelope( const int16_t L_frame /* i : number of spectral lines */ ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int16_t h, x; int32_t k; #else int16_t k, h, x; #endif Word16 inv_shape[2 * kTcxHmParabolaHalfWidth + 1]; /* Q15 */ if ( gain == 0 ) Loading @@ -290,13 +295,25 @@ void tcx_hm_modify_envelope( while ( k <= L_frame + kTcxHmParabolaHalfWidth - 1 ) { #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI int32_t tmp; #endif #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI for ( x = (int16_t) max( 0, k - kTcxHmParabolaHalfWidth ); x <= (int16_t) min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #else for ( x = max( 0, k - kTcxHmParabolaHalfWidth ); x <= min( k + kTcxHmParabolaHalfWidth, L_frame - 1 ); ++x ) #endif { env[x] = Mpy_32_16( env[x], inv_shape[x - k + kTcxHmParabolaHalfWidth] ); } ++h; #ifdef FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI tmp = ( h * lag ); k = tmp >> fract_res; #else k = ( h * lag ) >> fract_res; #endif } return; Loading
lib_com/options.h +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define FIX_966_VAR_OVERFLOW_IN_HARM_MODEL_ARI /* FhG: fix and undef behaviour bug in the harmonic TCX model arithmetic coder */ #define FIX_983_DISC_ISM_DIGEST_NUM_OBJS /* FhG: issue #983: the discrete ISM digest function uses the wrong number of objects */ /* #################### End BE switches ################################## */ Loading