Commit 75e324a3 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch '1103-complexity-optimize-l_norm_arr' into 'main'

Resolve "[Complexity] Optimize L_norm_arr()"

Closes #1103

See merge request !873
parents ab8d72e2 9933c8f4
Loading
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -7262,10 +7262,23 @@ Word16 L_norm_arr( Word32 *arr, Word16 size )
    Word16 q = 31;
    move16();
    FOR( Word16 i = 0; i < size; i++ )
#ifndef FIX_1103_OPT_L_NORM_ARR
    IF( arr[i] != 0 )
    {
        q = s_min( q, norm_l( arr[i] ) );
    }
#else
    {
        Word16 q_tst;

        q_tst = norm_l( arr[i] );
        if ( arr[i] != 0 )
        {
            q = s_min( q, q_tst );
        }
    }

#endif
    return q;
}

+1 −0
Original line number Diff line number Diff line
@@ -92,4 +92,5 @@
#define FIX_1054_IF_ELSE_CMPLX                          /* VA: Fix 1054 incorrect counting of complexity when ELSE-IF sequence is encoutered in two functions */
#define FIX_1052_COPY_CMPLX_DISCREPANCY       /* VA: modify IF-ELSE statements used in Copy*() functions to avoid dependency on x[] and y[] in RAM */
#define FIX_1049_SHR_RO_COMPLEXITY              /* VA: fix for issue 1049: incorrect counting of complexity in the shr_ro() function */
#define FIX_1103_OPT_L_NORM_ARR                 /* FhG: Optimize L_norm_arr(), avoid IF */
#endif