Commit 828a5479 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch...

Merge branch 'basop-2298-port-float-mr-2468-swb-tbe-fix-constant-in-create_random_vector-to-allow-more-reliable' into 'main'

[Non-be][rend-non-be][split-non-be][allow-regression] SWB TBE: Fix constant in create_random_vector() to allow more reliable fixed point implementation

See merge request !2680
parents a9c6f8d8 00051ec1
Loading
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -6073,6 +6073,7 @@ void create_random_vector_fx(
    Word16 i, j, k;
    Word16 scale1, scale2;
    Word32 L_tmp;

    /*
      Note: the constant 2144047674 is 0.0078f in Q38 from the float reference.
      It should read 0.0078125f, which is 1/128.Since 0.0078f is nor exactly
@@ -6083,34 +6084,34 @@ void create_random_vector_fx(
#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
    if ( element_mode != EVS_MONO )
    {
        L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[0] ) ) ); /*Q23 */
        j = shr( abs_s( Random( &seed[0] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */
    }
    else
    {
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) ); /*Q23 */
        j = extract_l( L_shr( L_tmp, 23 ) );
    }
#else
    L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[0] ) ) );                                           /*Q23 */
#endif

    j = extract_l( L_shr( L_tmp, 23 ) );
#endif
    j = s_and( j, 0xff );

#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
    if ( element_mode != EVS_MONO )
    {
        L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = shr( abs_s( Random( &seed[1] ) ), 7 ); /* Random( &seed[0] * 0.0078125f ) */
    }
    else
    {
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = extract_l( L_shr( L_tmp, 23 ) );
    }

#else
    L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
    k = extract_l( L_shr( L_tmp, 23 ) );
#endif

    k = extract_l( L_shr( L_tmp, 23 ) );
    k = s_and( k, 0xff );

    WHILE( EQ_16( k, j ) )
@@ -6118,17 +6119,18 @@ void create_random_vector_fx(
#ifdef FIX_2250_LARGE_DIFFERENCES_BETWEEN_BASOP_AND_FLOAT
        if ( element_mode != EVS_MONO )
        {
            L_tmp = L_abs( Mpy_32_16_r( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
            k = shr( abs_s( Random( &seed[1] ) ), 7 );
        }
        else
        {
            L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
            k = extract_l( L_shr( L_tmp, 23 ) );
        }
#else
        L_tmp = L_abs( Mult_32_16( 2144047674, Random( &seed[1] ) ) ); /*Q23 */
        k = extract_l( L_shr( L_tmp, 23 ) );
#endif

        k = extract_l( L_shr( L_tmp, 23 ) );
        k = s_and( k, 0xff );
    }

+1 −1
Original line number Diff line number Diff line
@@ -5332,7 +5332,7 @@ static ivas_error printConfigInfo_dec(
    const bool quietModeEnabled )
{
    ivas_error error;
    Word8 config_str[50];
    Word8 config_str[200];
    AUDIO_CONFIG output_config;

    /*-----------------------------------------------------------------*