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

Merge branch 'precision_imp_bug_fixes' into 'main'

Precision improvement and few bug fixes

See merge request !1052
parents 3fd8955c 041b077d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -636,9 +636,9 @@ void computeDirectionVectors_fixed(
#ifdef NONBE_IMPROVE_DIRAC_INTENSITY_PREC
        IF( i_e_band != NULL )
        {
            e_x = sub( i_e_band[i - enc_param_start_band], norm_x );
            e_y = sub( i_e_band[i - enc_param_start_band], norm_y );
            e_z = sub( i_e_band[i - enc_param_start_band], norm_z );
            e_x = sub( Q31, add( i_e_band[i - enc_param_start_band], norm_x ) );
            e_y = sub( Q31, add( i_e_band[i - enc_param_start_band], norm_y ) );
            e_z = sub( Q31, add( i_e_band[i - enc_param_start_band], norm_z ) );
        }
        ELSE
        {
+5 −1
Original line number Diff line number Diff line
@@ -560,7 +560,11 @@ void ivas_fb_mixer_pcm_ingest_fx(
        move16();

        ivas_mdft_fx( ppOut_pcm[fb_cfg->remix_order[i]], hFbMixer->ppFilterbank_inFR_re_fx[fb_cfg->remix_order[i]], hFbMixer->ppFilterbank_inFR_im_fx[fb_cfg->remix_order[i]], shl( frame_len, 1 ), frame_len );
        hFbMixer->q_ppFilterbank_inFR[fb_cfg->remix_order[i]] = q_ppOut_pcm[fb_cfg->remix_order[i]];
        q_shift = L_norm_arr( hFbMixer->ppFilterbank_inFR_re_fx[fb_cfg->remix_order[i]], frame_len );
        q_shift = s_min( q_shift, L_norm_arr( hFbMixer->ppFilterbank_inFR_im_fx[fb_cfg->remix_order[i]], frame_len ) );
        scale_sig32( hFbMixer->ppFilterbank_inFR_re_fx[fb_cfg->remix_order[i]], frame_len, q_shift );
        scale_sig32( hFbMixer->ppFilterbank_inFR_im_fx[fb_cfg->remix_order[i]], frame_len, q_shift );
        hFbMixer->q_ppFilterbank_inFR[fb_cfg->remix_order[i]] = add( q_shift, q_ppOut_pcm[fb_cfg->remix_order[i]] );
        move16();
    }

+4 −3
Original line number Diff line number Diff line
@@ -4846,7 +4846,8 @@ void ivas_dirac_param_est_enc_fx(
    const Word16 hodirac_flag,
    const Word16 nchan_fb_in,
    Word16 *mono_frame_count,
    Word16 *dirac_mono_flag );
    Word16 *dirac_mono_flag,
    const Word16 shift );

ivas_error ivas_cldfb_dec_reconfig_fx(
    Decoder_Struct *st_ivas,           /* i/o: IVAS decoder structure                                */
@@ -5746,8 +5747,8 @@ ivas_error ivas_dirac_enc_fx(
    const Word16 input_frame,      /* i  : input frame length                      */
    const Word16 dtx_vad,          /* i  : DTX vad flag                            */
    const IVAS_FORMAT ivas_format, /* i  : ivas format                             */
    const Word16 hodirac_flag      /* i  : hodirac flag                            */
);
    const Word16 hodirac_flag,     /* i  : hodirac flag                            */
    const Word16 shift );

ivas_error ivas_spar_md_enc_init_fx(
    ivas_spar_md_enc_state_t *hMdEnc,           /* o  : MD encoder handle        */
+93 −44
Original line number Diff line number Diff line
@@ -327,8 +327,8 @@ ivas_error ivas_dirac_enc_fx(
    const Word16 input_frame,      /* i  : input frame length								Q0*/
    const Word16 dtx_vad,          /* i  : DTX vad flag										Q0*/
    const IVAS_FORMAT ivas_format, /* i  : ivas format										*/
    const Word16 hodirac_flag      /* i  : hodirac flag										Q0*/
)
    const Word16 hodirac_flag,     /* i  : hodirac flag										Q0*/
    const Word16 shift )
{
    Word16 orig_dirac_bands;
    Word32 dir_fx[3], avg_dir_fx[3];
@@ -338,18 +338,18 @@ ivas_error ivas_dirac_enc_fx(

    Word16 nchan_fb_in;

    if ( hodirac_flag )
    IF( hodirac_flag )
    {
        nchan_fb_in = HOA2_CHANNELS;
        move16();
    }
    else
    ELSE
    {
        nchan_fb_in = FOA_CHANNELS;
        move16();
    }

    ivas_dirac_param_est_enc_fx( hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f_fx, pp_fr_real_fx, pp_fr_imag_fx, pp_fr_q, input_frame, ivas_format, hodirac_flag, nchan_fb_in, &( hDirAC->mono_frame_count ), &( hQMetaData->dirac_mono_flag ) );
    ivas_dirac_param_est_enc_fx( hDirAC, hQMetaData->q_direction, hQMetaData->useLowerRes, data_f_fx, pp_fr_real_fx, pp_fr_imag_fx, pp_fr_q, input_frame, ivas_format, hodirac_flag, nchan_fb_in, &( hDirAC->mono_frame_count ), &( hQMetaData->dirac_mono_flag ), shift );

    IF( hQMetaData->q_direction->cfg.nbands > 0 )
    {
@@ -585,29 +585,33 @@ static Word16 ivas_dirac_get_mono_flag_fx(
        move16();
        move16();

        Word16 gb = find_guarded_bits_fx( sub( brange[1], brange[0] ) );

        /* Loop over the W channel bins to calculate the power in the band */
        FOR( j = brange[0]; j < brange[1]; j++ )
        {
            acc = W_mac_32_32( acc, Cldfb_RealBuffer[0][j], Cldfb_RealBuffer[0][j] ); /* exp(2 * e_Cldfb) */
            acc = W_mac_32_32( acc, Cldfb_ImagBuffer[0][j], Cldfb_ImagBuffer[0][j] ); /* exp(2 * e_Cldfb) */
            shift1 = W_norm( acc );
            W_band_power = W_extract_h( W_shl( acc, shift1 ) ); /* exp(2 * e_Cldfb - shift1) */
            W_band_power_e = sub( imult1616( (Word16) 2, e_Cldfb ), shift1 );
            acc = W_mac_32_32( acc, L_shr( Cldfb_RealBuffer[0][j], gb ), L_shr( Cldfb_RealBuffer[0][j], gb ) ); /*Q:(2*(31-e_Cldfb-gb)+1*/
            acc = W_mac_32_32( acc, L_shr( Cldfb_ImagBuffer[0][j], gb ), L_shr( Cldfb_ImagBuffer[0][j], gb ) ); /*Q:(2*(31-e_Cldfb-gb)+1*/
        }
        shift1 = W_norm( acc );
        W_band_power = W_extract_h( W_shl( acc, shift1 ) ); /*Q:(2*(31-e_Cldfb-gb)+1+shift1-32*/
        W_band_power_e = sub( shl( add( e_Cldfb, gb ), 1 ), shift1 );

        gb = find_guarded_bits_fx( imult1616( sub( brange[1], brange[0] ), sub( nchan_ana, 1 ) ) );
        /* Loop over the other channels and bins to calculate the power in the band */
        FOR( ch_idx = 1; ch_idx < nchan_ana; ch_idx++ )
        {
            /* abs()^2 */
            FOR( j = brange[0]; j < brange[1]; j++ )
            {
                acc1 = W_mac_32_32( acc1, Cldfb_RealBuffer[ch_idx][j], Cldfb_RealBuffer[ch_idx][j] ); /* exp(2 * e_Cldfb) */
                acc1 = W_mac_32_32( acc1, Cldfb_ImagBuffer[ch_idx][j], Cldfb_ImagBuffer[ch_idx][j] ); /* exp(2 * e_Cldfb) */
                shift2 = W_norm( acc1 );
                other_ch_band_power = W_extract_h( W_shl( acc1, shift2 ) ); /* exp(2 * e_Cldfb - shift2) */
                other_ch_band_power_e = sub( imult1616( (Word16) 2, e_Cldfb ), shift2 );
                acc1 = W_mac_32_32( acc1, L_shr( Cldfb_RealBuffer[ch_idx][j], gb ), L_shr( Cldfb_RealBuffer[ch_idx][j], gb ) ); /*Q:(2*(31-e_Cldfb-gb)+1*/
                acc1 = W_mac_32_32( acc1, L_shr( Cldfb_ImagBuffer[ch_idx][j], gb ), L_shr( Cldfb_ImagBuffer[ch_idx][j], gb ) ); /*Q:(2*(31-e_Cldfb-gb)+1*/
            }
        }
        shift2 = W_norm( acc1 );
        other_ch_band_power = W_extract_h( W_shl( acc1, shift2 ) ); /*Q:(2*(31-e_Cldfb-gb)+1+shift2-32*/
        other_ch_band_power_e = sub( shl( add( e_Cldfb, gb ), 1 ), shift2 );

        IF( BASOP_Util_Cmp_Mant32Exp( other_ch_band_power, other_ch_band_power_e, EPSILON_FX_M, EPSILON_FX_E ) < 0 )
        {
            if ( BASOP_Util_Cmp_Mant32Exp( W_band_power, W_band_power_e, DIRAC_MONO_THRESH_SILENCE_FX, 31 ) > 0 )
@@ -967,8 +971,8 @@ void ivas_dirac_param_est_enc_fx(
    const Word16 hodirac_flag, /* Q0 */
    const Word16 nchan_fb_in,  /* Q0 */
    Word16 *mono_frame_count,  /* Q0 */
    Word16 *dirac_mono_flag    /* Q0 */
)
    Word16 *dirac_mono_flag,   /* Q0 */
    const Word16 shift )
{
    Word16 i, j, k, d, ts, index, l_ts, num_freq_bands;
    Word16 band_m_idx, block_m_idx;
@@ -990,7 +994,7 @@ void ivas_dirac_param_est_enc_fx(
    Word32 diffuseness_vector_fx[DIRAC_MAX_NBANDS];
    Word16 diffuseness_vector_q;
    Word32 renormalization_factor_fx[DIRAC_MAX_NBANDS];
    Word16 renormalization_factor_exp;
    Word16 renormalization_factor_exp[DIRAC_MAX_NBANDS];
    Word32 renormalization_factor_diff_fx[DIRAC_MAX_NBANDS];
    Word16 renormalization_factor_diff_exp[DIRAC_MAX_NBANDS];
    Word32 norm_tmp_fx;
@@ -1072,11 +1076,20 @@ void ivas_dirac_param_est_enc_fx(
        move16();

        set32_fx( renormalization_factor_fx, EPSILON_FX, hDirAC->hConfig->nbands );
        renormalization_factor_exp = 0;
        move16();
        set16_fx( renormalization_factor_exp, 0, hDirAC->hConfig->nbands );
        set_zero_fx( hDirAC->direction_vector_m_fx[0][block_m_idx], hDirAC->hConfig->nbands );
        set_zero_fx( hDirAC->direction_vector_m_fx[1][block_m_idx], hDirAC->hConfig->nbands );
        set_zero_fx( hDirAC->direction_vector_m_fx[2][block_m_idx], hDirAC->hConfig->nbands );
        Word64 dir[DIRAC_NUM_DIMS][DIRAC_MAX_NBANDS];
        Word16 direction_vector_exp_tmp[DIRAC_NUM_DIMS][MAX_PARAM_SPATIAL_SUBFRAMES][DIRAC_MAX_NBANDS] = { 0 };
        FOR( i = 0; i < DIRAC_NUM_DIMS; i++ )
        {
            set64_fx( dir[i], 0, DIRAC_MAX_NBANDS );
            FOR( j = 0; j < MAX_PARAM_SPATIAL_SUBFRAMES; j++ )
            {
                set16_fx( direction_vector_exp_tmp[i][j], 0, DIRAC_MAX_NBANDS );
            }
        }
        hDirAC->direction_vector_m_exp[block_m_idx] = 0;
        move16();

@@ -1084,8 +1097,17 @@ void ivas_dirac_param_est_enc_fx(
        {
            IF( hDirAC->hFbMixer )
            {
                FOR( i = 0; i < nchan_fb_in; i++ )
                {
                    scale_sig32( pcm_in_fx[i], input_frame, shift );                                                                      // Q:Qx+shift
                    scale_sig32( hDirAC->hFbMixer->ppFilterbank_prior_input_fx[i], hDirAC->hFbMixer->fb_cfg->prior_input_length, shift ); // Q:Qx+shift
                }
                ivas_fb_mixer_get_windowed_fr_fx( hDirAC->hFbMixer, pcm_in_fx, p_Cldfb_RealBuffer_fx, p_Cldfb_ImagBuffer_fx, l_ts, l_ts, hDirAC->hFbMixer->fb_cfg->num_in_chans, 0 );

                FOR( i = 0; i < nchan_fb_in; i++ )
                {
                    scale_sig32( pcm_in_fx[i], input_frame, negate( shift ) );                                                                      // Q:Qx
                    scale_sig32( hDirAC->hFbMixer->ppFilterbank_prior_input_fx[i], hDirAC->hFbMixer->fb_cfg->prior_input_length, negate( shift ) ); // Q:Qx
                }
                ivas_fb_mixer_update_prior_input_fx( hDirAC->hFbMixer, pcm_in_fx, l_ts, hDirAC->hFbMixer->fb_cfg->num_in_chans );

                FOR( i = 0; i < nchan_fb_in; i++ )
@@ -1251,8 +1273,6 @@ void ivas_dirac_param_est_enc_fx(
                    ene_secs_exp );
            }

            const Word16 gbits = 4; // 4 guard bits
            move16();
            IF( hodirac_flag )
            {
                FOR( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ )
@@ -1267,18 +1287,44 @@ void ivas_dirac_param_est_enc_fx(
            }
            ELSE
            {
                norm_tmp_exp = add( reference_power_exp, 1 );

                FOR( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ )
                {
                    Word32 tmp_diff = L_shr( diffuseness_vector_fx[band_m_idx], sub( diffuseness_vector_q, 30 ) ); // diffueseness_vector_q -> Q30
                    norm_tmp_fx = Mpy_32_32( reference_power_fx[ts][band_m_idx], L_sub( ONE_IN_Q30, tmp_diff ) );

                    hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx] = L_add( hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx], L_shr( Mpy_32_32( norm_tmp_fx, direction_vector_fx[0][band_m_idx] ), gbits ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                    dir[0][band_m_idx] = W_mult_32_32( norm_tmp_fx, direction_vector_fx[0][band_m_idx] );
                    move64();
                    dir[1][band_m_idx] = W_mult_32_32( norm_tmp_fx, direction_vector_fx[1][band_m_idx] );
                    move64();
                    dir[2][band_m_idx] = W_mult_32_32( norm_tmp_fx, direction_vector_fx[2][band_m_idx] );
                    move64();
                    Word16 norm = 62;
                    move16();
                    IF( dir[0][band_m_idx] != 0 )
                    {
                        norm = W_norm( dir[0][band_m_idx] );
                    }
                    IF( dir[1][band_m_idx] != 0 )
                    {
                        norm = s_min( norm, W_norm( dir[1][band_m_idx] ) );
                    }
                    IF( dir[2][band_m_idx] != 0 )
                    {
                        norm = s_min( norm, W_norm( dir[2][band_m_idx] ) );
                    }
                    Word32 tmp = W_extract_h( W_shl( dir[0][band_m_idx], norm ) );
                    Word16 tmp_e = sub( Q31, add( sub( direction_vector_q, norm_tmp_exp ), sub( norm, 0 ) ) );
                    hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx] = BASOP_Util_Add_Mant32Exp( hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx], direction_vector_exp_tmp[0][block_m_idx][band_m_idx], tmp, tmp_e, &direction_vector_exp_tmp[0][block_m_idx][band_m_idx] );
                    move32();
                    hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx] = L_add( hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx], L_shr( Mpy_32_32( norm_tmp_fx, direction_vector_fx[1][band_m_idx] ), gbits ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                    tmp = W_extract_h( W_shl( dir[1][band_m_idx], norm ) );
                    hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx] = BASOP_Util_Add_Mant32Exp( hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx], direction_vector_exp_tmp[1][block_m_idx][band_m_idx], tmp, tmp_e, &direction_vector_exp_tmp[1][block_m_idx][band_m_idx] );
                    move32();
                    hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] = L_add( hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx], L_shr( Mpy_32_32( norm_tmp_fx, direction_vector_fx[2][band_m_idx] ), gbits ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                    tmp = W_extract_h( W_shl( dir[2][band_m_idx], norm ) );
                    hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] = BASOP_Util_Add_Mant32Exp( hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx], direction_vector_exp_tmp[2][block_m_idx][band_m_idx], tmp, tmp_e, &direction_vector_exp_tmp[2][block_m_idx][band_m_idx] );
                    move32();
                    renormalization_factor_fx[band_m_idx] = L_add( renormalization_factor_fx[band_m_idx], L_shr( norm_tmp_fx, gbits ) ); /* exp(norm_tmp_exp + gbits) */
                    renormalization_factor_fx[band_m_idx] = BASOP_Util_Add_Mant32Exp( renormalization_factor_fx[band_m_idx], renormalization_factor_exp[band_m_idx], norm_tmp_fx, norm_tmp_exp, &renormalization_factor_exp[band_m_idx] ); /* exp(norm_tmp_exp + gbits) */
                    move32();
                    hDirAC->diffuseness_m_fx[band_m_idx] = BASOP_Util_Add_Mant32Exp( hDirAC->diffuseness_m_fx[band_m_idx], hDirAC->diffuseness_m_exp[band_m_idx],
                                                                                     Mpy_32_32( reference_power_fx[ts][band_m_idx], tmp_diff ), add( reference_power_exp, 1 ), &hDirAC->diffuseness_m_exp[band_m_idx] ); /* exp(hDirAC->diffuseness_m_exp) */
@@ -1287,10 +1333,6 @@ void ivas_dirac_param_est_enc_fx(
                                                                                           reference_power_fx[ts][band_m_idx], reference_power_exp, &renormalization_factor_diff_exp[band_m_idx] ); /* exp(renormalization_factor_diff_exp) */
                    move32();
                }
                norm_tmp_exp = add( reference_power_exp, 1 );
                hDirAC->direction_vector_m_exp[block_m_idx] = add( norm_tmp_exp, add( sub( 31, direction_vector_q ), gbits ) );
                move32();
                renormalization_factor_exp = add( norm_tmp_exp, gbits );
            }
        }

@@ -1298,41 +1340,48 @@ void ivas_dirac_param_est_enc_fx(
        {
            FOR( band_m_idx = 0; band_m_idx < hDirAC->hConfig->nbands; band_m_idx++ )
            {
                renormalization_factor_fx[band_m_idx] = EPSILON_FX;
                Word16 tmp_e = shl( direction_vector_exp_tmp[0][block_m_idx][block_m_idx], 1 );

                renormalization_factor_fx[band_m_idx] = BASOP_Util_Add_Mant32Exp( renormalization_factor_fx[band_m_idx], renormalization_factor_exp[block_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx] ), tmp_e, &renormalization_factor_exp[block_m_idx] ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                move32();
                renormalization_factor_fx[band_m_idx] = L_add( renormalization_factor_fx[band_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx] ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                tmp_e = shl( direction_vector_exp_tmp[1][block_m_idx][block_m_idx], 1 );
                renormalization_factor_fx[band_m_idx] = BASOP_Util_Add_Mant32Exp( renormalization_factor_fx[band_m_idx], renormalization_factor_exp[block_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx] ), tmp_e, &renormalization_factor_exp[block_m_idx] ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                move32();
                renormalization_factor_fx[band_m_idx] = L_add( renormalization_factor_fx[band_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx] ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                tmp_e = shl( direction_vector_exp_tmp[2][block_m_idx][block_m_idx], 1 );
                renormalization_factor_fx[band_m_idx] = BASOP_Util_Add_Mant32Exp( renormalization_factor_fx[band_m_idx], renormalization_factor_exp[block_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] ), tmp_e, &renormalization_factor_exp[block_m_idx] ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                move32();
                renormalization_factor_fx[band_m_idx] = L_add( renormalization_factor_fx[band_m_idx], Mpy_32_32( hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx], hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] ) ); /* norm_tmp_exp + ( 31 - direction_vector_q ) + gbits */
                IF( renormalization_factor_fx[band_m_idx] == 0 )
                {
                    renormalization_factor_fx[band_m_idx] = EPSILON_FX;
                    move32();
                renormalization_factor_exp = shl( hDirAC->direction_vector_m_exp[block_m_idx], 1 ); // 2 * direction_vector_m_exp
                renormalization_factor_fx[band_m_idx] = Sqrt32( renormalization_factor_fx[band_m_idx], &renormalization_factor_exp );
                    renormalization_factor_exp[block_m_idx] = 0;
                    move16();
                }
                renormalization_factor_fx[band_m_idx] = Sqrt32( renormalization_factor_fx[band_m_idx], &renormalization_factor_exp[block_m_idx] );
                move32();

                IF( GT_32( renormalization_factor_fx[band_m_idx], EPSILON_FX ) )
                {
                    Word16 tmp_e;
                    Word32 tmp32;

                    tmp32 = hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx];
                    move32();
                    tmp32 = L_deposit_h( BASOP_Util_Divide3232_Scale( tmp32, renormalization_factor_fx[band_m_idx], &tmp_e ) ); /* exp(tmp_e + ( hDirAC->direction_vector_m_exp[block_m_idx] - renormalization_factor_exp)) */
                    tmp_e = add( tmp_e, sub( hDirAC->direction_vector_m_exp[block_m_idx], renormalization_factor_exp ) );
                    tmp_e = add( tmp_e, sub( direction_vector_exp_tmp[0][block_m_idx][band_m_idx], renormalization_factor_exp[band_m_idx] ) );
                    hDirAC->direction_vector_m_fx[0][block_m_idx][band_m_idx] = L_shr( tmp32, sub( 1, tmp_e ) ); // Q30
                    move32();

                    tmp32 = hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx]; // Q30
                    move32();
                    tmp32 = L_deposit_h( BASOP_Util_Divide3232_Scale( tmp32, renormalization_factor_fx[band_m_idx], &tmp_e ) ); /* exp(tmp_e + ( hDirAC->direction_vector_m_exp[block_m_idx] - renormalization_factor_exp)) */
                    tmp_e = add( tmp_e, sub( hDirAC->direction_vector_m_exp[block_m_idx], renormalization_factor_exp ) );
                    tmp_e = add( tmp_e, sub( direction_vector_exp_tmp[1][block_m_idx][band_m_idx], renormalization_factor_exp[band_m_idx] ) );
                    hDirAC->direction_vector_m_fx[1][block_m_idx][band_m_idx] = L_shr( tmp32, sub( 1, tmp_e ) ); // Q30
                    move32();

                    tmp32 = hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx]; // Q30
                    move32();
                    tmp32 = L_deposit_h( BASOP_Util_Divide3232_Scale( tmp32, renormalization_factor_fx[band_m_idx], &tmp_e ) ); /* exp(tmp_e + ( hDirAC->direction_vector_m_exp[block_m_idx] - renormalization_factor_exp)) */
                    tmp_e = add( tmp_e, sub( hDirAC->direction_vector_m_exp[block_m_idx], renormalization_factor_exp ) );
                    tmp_e = add( tmp_e, sub( direction_vector_exp_tmp[2][block_m_idx][band_m_idx], renormalization_factor_exp[band_m_idx] ) );
                    hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] = L_shr( tmp32, sub( 1, tmp_e ) ); // Q30
                    move32();
                }
@@ -1345,8 +1394,6 @@ void ivas_dirac_param_est_enc_fx(
                    hDirAC->direction_vector_m_fx[2][block_m_idx][band_m_idx] = 0;
                    move32();
                }
                hDirAC->direction_vector_m_exp[block_m_idx] = 1;
                move16();

                /* save the elevation and azimuth values to be used later by the ivas_dirac_QuantizeParameters function */
                FOR( d = 0; d < DIRAC_NUM_DIMS; d++ )
@@ -1367,6 +1414,8 @@ void ivas_dirac_param_est_enc_fx(
                    &q_direction->band_data[band_m_idx].azimuth_fx[block_m_idx],
                    &q_direction->band_data[band_m_idx].elevation_fx[block_m_idx] );
            }
            hDirAC->direction_vector_m_exp[block_m_idx] = 1;
            move16();
        }

        /* Sectors */
+28 −93

File changed.

Preview size limit exceeded, changes collapsed.

Loading