Unverified Commit c74a66ef authored by janssontoftg's avatar janssontoftg
Browse files

Use LT_16 for if statement

Add missing BASOP for transition_length
Unify comment on exponent
Remove unnecessary move16()
parent 5bc4034f
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -550,18 +550,16 @@ ivas_error TDREND_GetMix_fx(
                                                               Src_p );
#ifdef NONBE_1300_TDREND_LARGE_ITD
            /* For large ITD values at lower sampling rate, check if the transition can be done */
            IF( i_mult( Src_p->previtd, Src_p->itd ) < 0 )
            IF( LT_16( i_mult( Src_p->previtd, Src_p->itd ), 0 ) )
            {
                currShift = abs_s( Src_p->itd ); // Q0
                prevShift = abs_s( Src_p->previtd );
                transition_len = subframe_length - max( 0, SFX_SPAT_BIN_SINC_M - currShift );
                transition_len = sub( subframe_length, s_max( 0, sub(SFX_SPAT_BIN_SINC_M, currShift) ) );
                tmp1 = imult1616( transition_len, prevShift );                        // Q0
                tmp2 = add( prevShift, currShift );                                   // Q0
                tmp3 = BASOP_Util_Divide1616_Scale( tmp1, tmp2, &tmp_e );             // exp(tmp_e)
                tmp_e2 = BASOP_Util_Add_MantExp( tmp3, tmp_e, ONE_IN_Q14, 0, &tmp4 ); // exp(tmp4)
                tmp4 = shr( tmp4, sub( 15, tmp_e2 ) );                                // Q0
                tlen1 = tmp4;                                                         // Q0
                move16();
                tmp_e2 = BASOP_Util_Add_MantExp( tmp3, tmp_e, ONE_IN_Q14, 0, &tmp4 ); // exp(tmp_e2)
                tlen1 = shr( tmp4, sub( 15, tmp_e2 ) );                               // Q0
                tlen2 = sub( transition_len, tlen1 ); // Q0
                length_in2 = sub( tlen2, currShift ); // Q0