Commit 056351c7 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

merge main to branch

parents 290d1016 62b9e9f5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
variables:
  # note: GitLab cannot reference variables defined by users in the include ref:, we need to use a YAML anchor for this
  # see https://docs.gitlab.com/ci/yaml/includes/#use-variables-with-include for more information
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 44cb5638949b874ce0f5c3bf4359f9db860d88bc
  IVAS_CODEC_CI_REF: &IVAS_CODEC_CI_REF 41186736915f5c0a857ac92e8ab438c434e5247d

include:
  - local: .gitlab-ci/variables.yml
+4 −0
Original line number Diff line number Diff line
@@ -1409,7 +1409,11 @@ Word32 BASOP_Util_Divide3232_Scale_newton( Word32 x, Word32 y, Word16 *s )
        *s = 0;
        return ( (Word32) 0 );
    }
#ifdef FIX_USAN_BASOP_UTIL_DIVIDE3232
    IF( EQ_32( y, (Word32) 0x80000000 ) )
#else
    IF( EQ_32( y, 0x80000000 ) )
#endif
    {
        /* Division by -1.0: same as negation of numerator */
        /* Return normalized negated numerator */
+18 −19
Original line number Diff line number Diff line
@@ -782,7 +782,6 @@ void computeDirectionVectors_fx(
 *
 *
 *------------------------------------------------------------------------*/

void computeDiffuseness_fixed(
    Word32 *buffer_intensity[DIRAC_NUM_DIMS][DIRAC_NO_COL_AVG_DIFF], // i: Q(q_factor_intensity)
    const Word32 *buffer_energy,                                     // i: Q(q_factor_energy)
@@ -795,10 +794,10 @@ void computeDiffuseness_fixed(
{
    Word32 intensity_slow[DIRAC_NUM_DIMS * CLDFB_NO_CHANNELS_MAX];
    Word32 intensity_slow_abs[CLDFB_NO_CHANNELS_MAX];
    Word64 tmp_intensity_slow_abs[CLDFB_NO_CHANNELS_MAX];
    Word16 intensity_slow_abs_exp[CLDFB_NO_CHANNELS_MAX];
    Word64 intensity_slow_abs_64[CLDFB_NO_CHANNELS_MAX];
    Word16 intensity_slow_abs_q[CLDFB_NO_CHANNELS_MAX];
    Word32 energy_slow[CLDFB_NO_CHANNELS_MAX];
    Word16 i, j, k, tmp16;
    Word16 i, j, k;
    Word32 tmp = 0;
    move32();
    Word32 *p_tmp;
@@ -808,10 +807,8 @@ void computeDiffuseness_fixed(

    /* Compute Intensity slow and energy slow buffer_intensity and buffer_energy */

    set_zero_fx( intensity_slow, DIRAC_NUM_DIMS * CLDFB_NO_CHANNELS_MAX );
    set_zero_fx( intensity_slow, i_mult( DIRAC_NUM_DIMS, CLDFB_NO_CHANNELS_MAX ) );
    set_zero_fx( intensity_slow_abs, CLDFB_NO_CHANNELS_MAX );
    set16_fx( intensity_slow_abs_exp, 0, CLDFB_NO_CHANNELS_MAX );
    set64_fx( tmp_intensity_slow_abs, 0, CLDFB_NO_CHANNELS_MAX );
    set_zero_fx( energy_slow, CLDFB_NO_CHANNELS_MAX );

    /* Calculate max possible shift for the buffer buffer_energy and buffer_intensity */
@@ -895,27 +892,31 @@ void computeDiffuseness_fixed(
        q_intensity = s_min( q_intensity, q_tmp );
    }

    scale_sig32( intensity_slow, i_mult( DIRAC_NUM_DIMS, num_freq_bands ), -2 );
    q_intensity = sub( q_intensity, 2 );
    min_q_shift1 = getScaleFactor32( intensity_slow, i_mult( DIRAC_NUM_DIMS, num_freq_bands ) );
    min_q_shift1 = sub( min_q_shift1, idiv1616( add( find_guarded_bits_fx( DIRAC_NUM_DIMS ), 1 ), 2 ) );
    scale_sig32( intensity_slow, i_mult( DIRAC_NUM_DIMS, num_freq_bands ), min_q_shift1 );
    q_intensity = add( q_intensity, min_q_shift1 );
    FOR( k = 0; k < num_freq_bands; k++ )
    {
        intensity_slow_abs_64[k] = 0;
        move64();
    }

    /* intensity_slow.^2 + intensity_slow_abs*/
    FOR( j = 0; j < DIRAC_NUM_DIMS; ++j )
    {
        p_tmp = intensity_slow + j * num_freq_bands;

        FOR( k = 0; k < num_freq_bands; k++ )
        {
            tmp_intensity_slow_abs[k] = W_mac_32_32( tmp_intensity_slow_abs[k], p_tmp[k], p_tmp[k] );
            move64();
            intensity_slow_abs_64[k] = W_add( intensity_slow_abs_64[k], W_mult_32_32( p_tmp[k], p_tmp[k] ) ); // 2*q_intensity+1
        }
    }

    FOR( k = 0; k < num_freq_bands; k++ )
    {
        tmp16 = W_norm( tmp_intensity_slow_abs[k] );
        intensity_slow_abs[k] = W_extract_h( W_shl( tmp_intensity_slow_abs[k], tmp16 ) );
        Word16 shift = W_norm( intensity_slow_abs_64[k] );
        intensity_slow_abs[k] = W_extract_h( W_shl( intensity_slow_abs_64[k], shift ) );
        move32();
        intensity_slow_abs_exp[k] = sub( 31, sub( add( add( shl( q_intensity, 1 ), 1 ), tmp16 ), 32 ) );
        intensity_slow_abs_q[k] = sub( add( add( q_intensity, q_intensity ), shift ), 31 );
        move16();
    }

@@ -925,8 +926,7 @@ void computeDiffuseness_fixed(
    move16();
    FOR( i = 0; i < num_freq_bands; ++i )
    {
        exp1 = intensity_slow_abs_exp[i];
        move16();
        exp1 = sub( 31, intensity_slow_abs_q[i] );
        tmp = Sqrt32( p_tmp[i], &exp1 );

        tmp = BASOP_Util_Divide3232_Scale_newton( tmp, L_add( energy_slow[i], EPSILLON_FX ), &exp2 );
@@ -965,7 +965,6 @@ void computeDiffuseness_fixed(
    return;
}


Word32 deindex_azimuth_fx(                             /* o  : output Q22                              */
                           Word16 id_phi,              /* i  : index                                   */
                           const Word16 no_bits,       /* i  : number of bits for the spherical grid   */
+4 −0
Original line number Diff line number Diff line
@@ -101,9 +101,13 @@
#define VEC_ARITH_OPT_v1
#define FIX_1486_IND_SHB_RES                   /* VA: Fix for issue 1486: align the usage of IND_SHB_RES_GS indices with float code */
#define FIX_1511_POC_RENORM                    /* NTT: Fix for issue 1511: Renorm for POC. */

#define TEST_HR
#define REMOVE_EVS_DUPLICATES                   /* remove core-coder duplicated functions, ACELP low-band decoder */

#define FIX_1713_EXP                            /* VA: proposed correction to exp in ic-BWE*/
#define FIX_USAN_BASOP_UTIL_DIVIDE3232          /* Eri: Fix USAN error in BASOP_Util_Divide3232_Scale_newton by adding explicit type cast for -1 in hex */

#define FIX_1733_CLDFB_BUG
#define FIX_1740_MISING_POP_WMOPS               /* VA: fix issue 1740: missing pop_wmops() */

+15 −2
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ ivas_error ivas_dirac_ana_open_fx(
            {
                return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for OMASA data\n" ) );
            }
            set16_fx( hDirAC->direction_vector_e[i][j], 31, MASA_FREQUENCY_BANDS );
        }
    }

@@ -257,6 +258,7 @@ void ivas_dirac_ana_fx(
    /* Estimate MASA parameters from the SBA signals */
    ivas_dirac_param_est_ana_fx( hDirAC, data_fx, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, input_frame );
    /* Create MASA metadata buffer from the estimated values */

    ivas_create_masa_out_meta_fx( hDirAC->hMasaOut, hDirAC->sph_grid16, nchan_transport, elevation_m_values, azimuth_m_values, energyRatio, spreadCoherence, surroundingCoherence, Q31, Q31, Q31 );

    /* Downmix */
@@ -334,13 +336,22 @@ static void ivas_dirac_param_est_ana_fx(
            move32();
            hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] = 0;
            move32();

            hDirAC->direction_vector_e[0][block_m_idx][band_m_idx] = 0;
            move16();
            hDirAC->direction_vector_e[1][block_m_idx][band_m_idx] = 0;
            move16();
            hDirAC->direction_vector_e[2][block_m_idx][band_m_idx] = 0;
            move16();
        }

        /* Need to initialize renormalization_factors, and variables to be normalized */
        set32_fx( renormalization_factor_diff_fx, 0, hDirAC->nbands );
        set16_fx( renormalization_factor_diff_e, 31, hDirAC->nbands );
        set32_fx( diffuseness_m_fx, 0, hDirAC->nbands );
        set16_fx( diffuseness_e, 0, hDirAC->nbands );
        set32_fx( hDirAC->energy_fx[block_m_idx], 0, MASA_FREQUENCY_BANDS );
        set32_fx( hDirAC->energy_fx[block_m_idx], 0, MASA_FREQUENCY_BANDS );
        set16_fx( hDirAC->energy_e[block_m_idx], 0, MASA_FREQUENCY_BANDS );

        FOR( ts = mrange[0]; ts < mrange[1]; ts++ )
        {
@@ -351,7 +362,9 @@ static void ivas_dirac_param_est_ana_fx(
            move16();
            FOR( i = 0; i < numAnalysisChannels; i++ )
            {
                cldfbAnalysis_ts_fx_fixed_q( &( data_fx[i][( l_ts * ts )] ), Foa_RealBuffer_fx[i], Foa_ImagBuffer_fx[i], l_ts, hDirAC->cldfbAnaEnc[i], &inp_q );
                inp_q = Q7;
                move16();
                cldfbAnalysis_ts_fx_var_q( &( data_fx[i][l_ts * ts] ), Foa_RealBuffer_fx[i], Foa_ImagBuffer_fx[i], l_ts, hDirAC->cldfbAnaEnc[i], &inp_q );
                cr_q = s_min( cr_q, getScaleFactor32( Foa_RealBuffer_fx[i], CLDFB_NO_CHANNELS_MAX ) );
                ci_q = s_min( ci_q, getScaleFactor32( Foa_ImagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX ) );
            }
Loading