diff --git a/lib_com/options.h b/lib_com/options.h index 396d21f6c5d590a5d54dd45eecd6344858e022b5..48d8593c8dce8115c797c9c7d4d6d06bad3390a1 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -144,4 +144,6 @@ #define NONBE_FIX_TCX5_INTERLEAVING_FOR_FS_IN_UNEQUAL_FS_OUT /* FhG: apply correct TCX5 grouping/interleaving when input_fs != output_fs */ +#define FIX_1824 + #endif diff --git a/lib_dec/jbm_pcmdsp_similarityestimation_fx.c b/lib_dec/jbm_pcmdsp_similarityestimation_fx.c index baad5c561d91aba0ea5cd8fbd78cc560cd9ccec4..7015022ebec826fff8b4390692f5318eeeae9b7d 100644 --- a/lib_dec/jbm_pcmdsp_similarityestimation_fx.c +++ b/lib_dec/jbm_pcmdsp_similarityestimation_fx.c @@ -113,9 +113,15 @@ Word16 normalized_cross_correlation_self_fx( const Word16 *signal, sumXX = L_shl( sumXX, normX ); normY = norm_l( sumYY ); sumYY = L_shl( sumYY, normY ); +#ifdef FIX_1824 + product = L_shr( L_mult0( extract_h( sumXX ), extract_h( sumYY ) ), 1 ); + normXY = add( normX, normY ); + normXY = sub( normXY, 32 + 1 ); +#else product = L_mult0( extract_h( sumXX ), extract_h( sumYY ) ); normXY = add( normX, normY ); normXY = sub( normXY, 32 ); +#endif /* change norm to factor of 2 */ IF( s_and( normXY, 0x1 ) != 0 )