Commit f4afe182 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Merge branch 'ivas_efap_fxd_updates' into 'main'

efap_determine_gains_fixed integration and converting efap buffers to fixed.

See merge request !66
parents 0df37ccf 9416408b
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1155,14 +1155,14 @@ static Word32 wrap_azi_fixed(
    Word32 azi = azi_deg;

    /* Wrap azimuth value */
    WHILE( azi > ANGLE_180_DEG_Q22 )
    WHILE( GT_32( azi, ANGLE_180_DEG_Q22 ) )
    {
        azi -= ANGLE_360_DEG_Q22;
        azi = L_sub( azi, ANGLE_360_DEG_Q22 );
    }

    WHILE( azi <= -ANGLE_180_DEG_Q22 )
    WHILE( LE_32( azi, -ANGLE_180_DEG_Q22 ) )
    {
        azi += ANGLE_360_DEG_Q22;
        azi = L_add( azi, ANGLE_360_DEG_Q22 );
    }

    return azi;
+1 −1
Original line number Diff line number Diff line
@@ -5071,7 +5071,7 @@ void lsf_dec_fx(
Word16 maximum_l(
    const Word32 *vec, /* i  : input vector                                   */
    const Word16 lvec, /* i  : length of input vector                         */
    Word32 *max        /* o  : maximum value in the input vector              */
    Word32 *max_val    /* o  : maximum value in the input vector              */
);

/*! r: index of the minimum value in the input vector */
+12 −12
Original line number Diff line number Diff line
@@ -568,7 +568,7 @@ int16_t maximum_s(
Word16 maximum_l(
    const Word32 *vec, /* i  : input vector                                   */
    const Word16 lvec, /* i  : length of input vector                         */
    Word32 *max        /* o  : maximum value in the input vector              */
    Word32 *max_val    /* o  : maximum value in the input vector              */
)
{
    Word16 i, ind;
@@ -579,16 +579,16 @@ Word16 maximum_l(

    FOR ( i = 1; i < lvec; i++ )
    {
        IF ( vec[i] > tmp )
        IF( GT_32( vec[i], tmp ) )
        {
            ind = i;
            tmp = vec[i];
        }
    }

    IF ( max != NULL )
    IF( max_val != NULL )
    {
        *max = tmp;
        *max_val = tmp;
    }

    return ind;
@@ -722,7 +722,7 @@ Word16 minimum_l(

    for ( i = 1; i < lvec; i++ )
    {
        if ( vec[i] < tmp )
        if ( LT_32( vec[i], tmp ) )
        {
            ind = i;
            tmp = vec[i];
@@ -836,7 +836,7 @@ Word32 dotp_fixed(

    FOR ( i = 1; i < n; i++ )
    {
        suma += Mpy_32_32( x[i], y[i] );
        suma = L_add( suma, Mpy_32_32( x[i], y[i] ) );
    }

    return suma;
@@ -1006,7 +1006,7 @@ void v_sub_fixed(

    FOR ( i = 0; i < N; i++ )
    {
        y[i] = L_sub( ( x1[i] >> hdrm ), ( x2[i] >> hdrm ) );
        y[i] = L_sub( L_shr( x1[i], hdrm ), L_shr( x2[i], hdrm ) );
    }

    return;
@@ -1840,11 +1840,11 @@ double anint(
 *-------------------------------------------------------------------*/
Word32 anint_fixed( Word32 x, Word16 exp )
{
    IF ( x == 0 )
    IF( EQ_32( x, 0 ) )
    {
        return 0;
    }
    return ( x ) >= 0 ? L_add( x, ( 1 << ( exp - 1 ) ) ) : L_sub( x, ( 1 << ( exp - 1 ) ) );
    return GE_32( x, 0 ) ? L_add( x, L_shl( 1, exp - 1 ) ) : L_sub( x, L_shl( 1, exp - 1 ) );
}

/*-------------------------------------------------------------------*
@@ -1854,12 +1854,12 @@ Word32 anint_fixed( Word32 x, Word16 exp )
 *-------------------------------------------------------------------*/
Word32 ceil_fixed(Word32 x, Word16 exp) {
    Word32 step;
    step = x / ( 1 << exp );
    IF ( x % ( 1 << exp ) > 0 )
    step = x / L_shl( 1, exp );
    IF( GT_32( x % L_shl( 1, exp ), 0 ) )
    {
        step++;
    }
    return (step << exp);
    return L_shl( step, exp );
}

/*-------------------------------------------------------------------*
+0 −4
Original line number Diff line number Diff line
@@ -1064,11 +1064,7 @@ ivas_error ivas_binRenderer_open(
        }
        ELSE IF ( st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) )
        {
#ifndef IVAS_FLOAT_FIXED
            IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
            IF( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
+0 −20
Original line number Diff line number Diff line
@@ -989,11 +989,7 @@ ivas_error ivas_init_decoder(
        /* init EFAP for custom LS output and set hTransSetup */
        IF ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
        {
#ifndef IVAS_FLOAT_FIXED
            IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hOutSetup.ls_azimuth, st_ivas->hOutSetup.ls_elevation, st_ivas->hOutSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
            IF( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hOutSetup.ls_azimuth, st_ivas->hOutSetup.ls_elevation, st_ivas->hOutSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
@@ -1423,11 +1419,7 @@ ivas_error ivas_init_decoder(
            /* init EFAP for custom LS setup */
            IF ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
            {
#ifndef IVAS_FLOAT_FIXED
                IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
                IF( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -1462,11 +1454,7 @@ ivas_error ivas_init_decoder(
            /* init EFAP for custom LS setup */
            IF ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
            {
#ifndef IVAS_FLOAT_FIXED
                IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
                IF( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -1506,11 +1494,7 @@ ivas_error ivas_init_decoder(
            /* init EFAP for custom LS setup */
            IF ( output_config == IVAS_AUDIO_CONFIG_LS_CUSTOM )
            {
#ifndef IVAS_FLOAT_FIXED
                IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
                IF ( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hLsSetupCustom->ls_azimuth, st_ivas->hLsSetupCustom->ls_elevation, st_ivas->hLsSetupCustom->num_spk, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
                {
                    return error;
                }
@@ -1734,11 +1718,7 @@ ivas_error ivas_init_decoder(
    {
        IF ( st_ivas->renderer_type == RENDERER_BINAURAL_MIXER_CONV_ROOM && st_ivas->ivas_format == MC_FORMAT && ( st_ivas->hDecoderConfig->Opt_Headrotation || st_ivas->hDecoderConfig->Opt_ExternalOrientation ) )
        {
#ifndef IVAS_FLOAT_FIXED
            IF ( ( error = efap_init_data( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#else
            IF ( ( error = efap_init_data_fixed( &( st_ivas->hEFAPdata ), st_ivas->hIntSetup.ls_azimuth, st_ivas->hIntSetup.ls_elevation, st_ivas->hIntSetup.nchan_out_woLFE, EFAP_MODE_EFAP ) ) != IVAS_ERR_OK )
#endif
            {
                return error;
            }
Loading