Commit 0557ff21 authored by Manuel Jander's avatar Manuel Jander
Browse files

Add one more bit headroom to product, to avoid assert failure in...

Add one more bit headroom to product, to avoid assert failure in getSqrtWord32() for values larger than 0x3FFEC004.
parent de430f5e
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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
+6 −0
Original line number Diff line number Diff line
@@ -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 )