Commit 2cea4508 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Add fix to decorrelator prototype scaling in proto2 path. Improves rate switching conditions.

parent 26af9e0f
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2863,7 +2863,11 @@ void protoSignalComputation2_fx(

    IF( GT_16( min_q_shift[0], min_q_shift[1] ) )
    {
#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
        FOR( l = 0; l < i_mult( 3, num_freq_bands ); l += num_freq_bands ) /* Note: There are always 3 decorrelator prototypes in this function */
#else
        FOR( l = 0; l < i_mult( num_proto, num_freq_bands ); l += num_freq_bands )
#endif
        {
            Scale_sig32( proto_frame_f_fx + shl( l, 1 ), shl( s_min( CLDFB_NO_CHANNELS_HALF, num_freq_bands ), 1 ), sub( min_q_shift[1], min_q_shift[0] ) );
        }
@@ -2872,7 +2876,11 @@ void protoSignalComputation2_fx(
    }
    ELSE
    {
#ifdef FIX_BASOP_2442_MASA2TC_TO_MONO_AND_AMBI
        FOR( l = 0; l < i_mult( 3, num_freq_bands ); l += num_freq_bands ) /* Note: There are always 3 decorrelator prototypes in this function */
#else
        FOR( l = 0; l < i_mult( num_proto, num_freq_bands ); l += num_freq_bands )
#endif
        {
            Scale_sig32( proto_frame_f_fx + shl( add( l, CLDFB_NO_CHANNELS_HALF ), 1 ), shl( s_max( 0, sub( num_freq_bands, CLDFB_NO_CHANNELS_HALF ) ), 1 ), sub( min_q_shift[0], min_q_shift[1] ) );
        }