Commit 76303f92 authored by Manuel Jander's avatar Manuel Jander
Browse files

Resolve merge conflicts.

parent 0118d30c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2711,8 +2711,14 @@ void stereo_coder_tcx_fx(
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV],      /* i/o: inverse spectrum                */
    Word32 *inv_mdst_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i/o: inverse MDST spectrum           */
    const Word16 mct_on,                                /* i  : flag mct block (1) or stereo (0)  */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 mdst_spectrum_e[CPE_CHANNELS][NB_DIV],
    Word16 inv_spectrum_e[CPE_CHANNELS][NB_DIV],
    Word16 inv_mdst_spectrum_e[CPE_CHANNELS][NB_DIV] );
#else
    Word16 exp_spec,
    Word16 exp_mdst_spec );
#endif

// bw_detect_fx.c
Word16 set_bw_mct_fx(
+19 −1
Original line number Diff line number Diff line
@@ -385,7 +385,11 @@ static void getBlockValues_fx(
    p_st[0] = sts[ch1];
    p_st[1] = sts[ch2];

    stereo_coder_tcx_fx( hBlock->hStereoMdct, p_st, hBlock->mask, p_mdst_spectrum, p_inv_spectrum, p_inv_mdst_spectrum, 1, sub( 31, q_spec ), sub( 31, q_spec ) );
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    stereo_coder_tcx_fx( hBlock->hStereoMdct, p_st, hBlock->mask, p_mdst_spectrum, p_inv_spectrum, p_inv_mdst_spectrum, 1, mdst_spectrum_e, inv_spectrum_e, inv_mdst_spectrum_e );
#else
    stereo_coder_tcx_fx( hBlock->hStereoMdct, p_st, hBlock->mask, p_mdst_spectrum, p_inv_spectrum, p_inv_mdst_spectrum, 1, q_spec );
#endif

    test();
    test();
@@ -1072,6 +1076,19 @@ void mctStereoIGF_enc_fx(
            IF( NE_16( hMCT->hBlockData[b]->hStereoMdct->mdct_stereo_mode[n], hMCT->hBlockData[b]->hStereoMdct->IGFStereoMode[n] ) ||
                EQ_16( hMCT->hBlockData[b]->hStereoMdct->mdct_stereo_mode[n], SMDCT_BW_MS ) )
            {
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                Word16 exp_SI_ch[CPE_CHANNELS], exp_pS_ch[CPE_CHANNELS], exp_pSI_ch[CPE_CHANNELS];
                exp_SI_ch[0] = sub( 31, q_inv_spectrum[ch1][n] );
                exp_SI_ch[1] = sub( 31, q_inv_spectrum[ch2][n] );
                exp_pSI_ch[0] = sub( 31, q_pSI_ch[0] );
                exp_pSI_ch[1] = sub( 31, q_pSI_ch[1] );
                exp_pS_ch[0] = sub( 31, q_pS_ch[0] );
                exp_pS_ch[1] = sub( 31, q_pS_ch[1] );

                ProcessStereoIGF_fx( hMCT->hBlockData[b]->hStereoMdct, p_st, hMCT->hBlockData[b]->mask,
                                     p_orig_spectrum_fx, q_origSpec, q_origSpec,
                                     p_powerSpec_fx, exp_pS_ch, p_powerSpecMsInv_fx, exp_pSI_ch, p_inv_spectrum_fx, exp_SI_ch, n, sp_aud_decision0[ch1], p_st[0]->total_brate, 1 );
#else
                Word16 exp_powerSpec_fx[CPE_CHANNELS], exp_powerSpecMsInv_fx[CPE_CHANNELS], exp_inv_spectrum_fx[CPE_CHANNELS];

                FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
@@ -1086,6 +1103,7 @@ void mctStereoIGF_enc_fx(

                ProcessStereoIGF_fx( hMCT->hBlockData[b]->hStereoMdct, p_st, hMCT->hBlockData[b]->mask, p_orig_spectrum_fx, q_origSpec, q_origSpec, p_powerSpec_fx, exp_powerSpec_fx,
                                     p_powerSpecMsInv_fx, exp_powerSpecMsInv_fx, p_inv_spectrum_fx, exp_inv_spectrum_fx, n, sp_aud_decision0[ch1], p_st[0]->total_brate, 1 );
#endif
            }
            ELSE
            {
+196 −4
Original line number Diff line number Diff line
@@ -135,15 +135,21 @@ void stereo_mdct_core_enc_fx(
{
    Word32 orig_spectrum_long_fx[CPE_CHANNELS][N_MAX]; /* MDCT output (L/R). */
    Word32 *orig_spectrum_fx[CPE_CHANNELS][NB_DIV];    /* Pointers to MDCT output for a short block (L/R) */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    Word32 powerSpec_fx[CPE_CHANNELS][N_MAX];
    Word32 powerSpec_fx_tmp[CPE_CHANNELS][N_MAX]; /* This 32 bit buffer is created to preserve the precision for original separate Q calculation of powerSpec_fx buffer ( Related to 3gpp issue #1192 ) */
    Word32 *p_powerSpec_fx[CPE_CHANNELS];
#else
    Word64 powerSpec64[CPE_CHANNELS][N_MAX];
    Word16 exp_powerSpec64[CPE_CHANNELS][NB_DIV];
#endif
    Word32 powerSpecMsInv_long_fx[CPE_CHANNELS][N_MAX]; /* MS inv power spectrum, also inverse MDST spectrum */
    Word32 *powerSpecMsInv_fx[CPE_CHANNELS][NB_DIV];
    Word32 quantized_spectrum_long_fx[CPE_CHANNELS][N_MAX]; /* quantized MDCT spectrum, inv ms mask mdst spectrum, scratch for MS spectra in the MS decision */
    Word32 *quantized_spectrum_fx[CPE_CHANNELS][NB_DIV];
    Word32 *inv_mdst_spectrum_fx[CPE_CHANNELS][NB_DIV];
    Word16 inv_mdst_spectrum_e[CPE_CHANNELS][NB_DIV];
    Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV];
    Word16 exp_inv_spectrum[CPE_CHANNELS];
    Word16 i, ch, nSubframes, L_subframeTCX;
    Word16 n, nAvailBits;
    Word16 tnsSize[CPE_CHANNELS][NB_DIV];          /* number of tns parameters put into prm */
@@ -152,9 +158,16 @@ void stereo_mdct_core_enc_fx(
    Word32 *p_mdst_spectrum_long_fx[CPE_CHANNELS];
    Word32 mdst_spectrum_long_fx[CPE_CHANNELS][N_MAX];
    Word32 *mdst_spectrum_fx[CPE_CHANNELS][NB_DIV];
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
    /* ToDo: exchange dimensions of 3 arrays below for more efficiency */
    Word16 pwrMdstMdct_e[CPE_CHANNELS][NB_DIV];
    Word16 pwrMdstMdctInv_e[CPE_CHANNELS][NB_DIV];
    Word16 inv_spectrum_e[CPE_CHANNELS][NB_DIV];
#else
    Word16 exp_powSpecMsInv[MCT_MAX_CHANNELS];
    Word16 tmp_q_powSpecInv[N_MAX], *exp_powSpecInv[2];
    Word64 W_tmp;
#endif
    Encoder_State *st, **sts;
    STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct;
    BSTR_ENC_HANDLE hBstr;
@@ -183,13 +196,17 @@ void stereo_mdct_core_enc_fx(
        p_orig_spectrum_long_fx[ch] = orig_spectrum_long_fx[ch];
        orig_spectrum_fx[ch][0] = orig_spectrum_long_fx[ch];
        orig_spectrum_fx[ch][1] = orig_spectrum_long_fx[ch] + N_TCX10_MAX;
#ifndef FIX_1464_NO_SINGLE_SPEC_Q
        set16_fx( exp_powerSpec64[ch], 0, NB_DIV );
#endif
    }

#ifndef FIX_1464_NO_SINGLE_SPEC_Q
    set16_fx( tmp_q_powSpecInv, 63, N_MAX );

    exp_powSpecInv[0] = tmp_q_powSpecInv;
    exp_powSpecInv[1] = &tmp_q_powSpecInv[N_TCX10_MAX];
#endif

    sts = hCPE->hCoreCoder;
    hStereoMdct = hCPE->hStereoMdct;
@@ -260,7 +277,13 @@ void stereo_mdct_core_enc_fx(
        inv_spectrum_fx[ch][1] = quantized_spectrum_fx[ch][1];
        mdst_spectrum_fx[ch][0] = mdst_spectrum_long_fx[ch];
        mdst_spectrum_fx[ch][1] = mdst_spectrum_long_fx[ch] + N_TCX10_MAX;
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
        inv_spectrum_e[ch][0] = 0;
        inv_spectrum_e[ch][1] = 0;
        set32_fx( powerSpec_fx[ch], 0, N_MAX );
#else
        set64_fx( powerSpec64[ch], 0, N_MAX );
#endif
        set32_fx( powerSpecMsInv_long_fx[ch], 0, N_MAX );
        set32_fx( quantized_spectrum_long_fx[ch], 0, N_MAX );
        set32_fx( mdst_spectrum_long_fx[ch], 0, N_MAX );
@@ -270,8 +293,8 @@ void stereo_mdct_core_enc_fx(
        sts[ch]->hTcxEnc->tns_ms_flag[1] = 0;
        move16();

        scale_sig( sts[ch]->input_fx, add( extract_l( Mpy_32_32( sts[ch]->input_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) ), sub( q_com, sts[ch]->q_inp ) ); /* q_com */
        scale_sig( sts[ch]->old_input_signal_fx, extract_l( Mpy_32_32( sts[ch]->input_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), sub( q_com, sts[ch]->q_old_inp ) );                               /* q_com */
        Scale_sig( sts[ch]->input_fx, add( extract_l( Mpy_32_32( sts[ch]->input_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) ), sub( q_com, sts[ch]->q_inp ) ); /* Q0 */
        Scale_sig( sts[ch]->old_input_signal_fx, extract_l( Mpy_32_32( sts[ch]->input_Fs, ONE_BY_FRAMES_PER_SEC_Q31 ) ), sub( q_com, sts[ch]->q_old_inp ) );                               /* Q0 */
        sts[ch]->q_old_inp = q_com;
        move16();
        sts[ch]->q_inp = q_com;
@@ -342,6 +365,7 @@ void stereo_mdct_core_enc_fx(
    test();
    IF( !hStereoMdct->isSBAStereoMode )
    {
#ifndef FIX_1464_NO_SINGLE_SPEC_Q
        /* Common q for mdst_spectrum and spectrum */
        Word16 exp1, exp2;
        Word16 length;
@@ -398,13 +422,18 @@ void stereo_mdct_core_enc_fx(
        exp_inv_spectrum[0] = exp_inv_spectrum[1] = sts[0]->hTcxEnc->spectrum_e[0];
        move16();
        move16();
#else
        stereo_coder_tcx_fx( hStereoMdct, sts, ms_mask, mdst_spectrum_fx, inv_spectrum_fx, inv_mdst_spectrum_fx, 0, mdst_spectrum_e, inv_spectrum_e, inv_mdst_spectrum_e );
#endif
    }

    /*--------------------------------------------------------------*
     * Power spectrum calculation
     *---------------------------------------------------------------*/
#ifndef FIX_1464_NO_SINGLE_SPEC_Q
    Word16 length, exp, shift1, shift2, norm;
    Word32 mdct, mdst, imdct, imdst;
#endif

    FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
    {
@@ -425,6 +454,87 @@ void stereo_mdct_core_enc_fx(
            L_subframeTCX = add( L_subframeTCX, shr( L_subframeTCX, 2 ) ); /* Q0 */
        }

#ifdef FIX_1464_NO_SINGLE_SPEC_Q
        FOR( n = 0; n < nSubframes; n++ )
        {
            Word16 shift0, shift1, shift0i, shift1i;

            IF( sts[ch]->hTcxEnc->tns_ms_flag[n] )
            {
#if 0
                pwrMdstMdct_e[ch][n] = add( shl( s_max( mdst_spectrum_e[ch][n], sts[ch]->hTcxEnc->spectrum_e[n] ), 1 ), 1 );
                shift0 = add( shl( s_max( 0, sub( sts[ch]->hTcxEnc->spectrum_e[n], mdst_spectrum_e[ch][n] ) ), 1 ), 1 );
                shift1 = add( shl( s_max( 0, sub( mdst_spectrum_e[ch][n], sts[ch]->hTcxEnc->spectrum_e[n] ) ), 1 ), 1 );
                pwrMdstMdctInv_e[ch][n] = add( shl( s_max( inv_mdst_spectrum_e[ch][n], inv_spectrum_e[ch][n] ), 1 ), 1 );
                shift0i = add( shl( s_max( 0, sub( inv_spectrum_e[ch][n], inv_mdst_spectrum_e[ch][n] ) ), 1 ), 1 );
                shift1i = add( shl( s_max( 0, sub( inv_mdst_spectrum_e[ch][n], inv_spectrum_e[ch][n] ) ), 1 ), 1 );
#else
                pwrMdstMdct_e[ch][n] = shl( s_max( mdst_spectrum_e[ch][n], sts[ch]->hTcxEnc->spectrum_e[n] ), 1 );
                shift0 = shl( s_max( 0, sub( sts[ch]->hTcxEnc->spectrum_e[n], mdst_spectrum_e[ch][n] ) ), 1 );
                shift1 = shl( s_max( 0, sub( mdst_spectrum_e[ch][n], sts[ch]->hTcxEnc->spectrum_e[n] ) ), 1 );
                pwrMdstMdctInv_e[ch][n] = shl( s_max( inv_mdst_spectrum_e[ch][n], inv_spectrum_e[ch][n] ), 1 );
                shift0i = shl( s_max( 0, sub( inv_spectrum_e[ch][n], inv_mdst_spectrum_e[ch][n] ) ), 1 );
                shift1i = shl( s_max( 0, sub( inv_mdst_spectrum_e[ch][n], inv_spectrum_e[ch][n] ) ), 1 );
#endif
                /* power spectrum: MDCT^2 + MDST^2 */
                FOR( i = 0; i < L_subframeTCX; i++ )
                {
                    Word32 L_tmp;
                    L_tmp = L_add( L_shr( Mpy_32_32( mdst_spectrum_fx[ch][n][i], mdst_spectrum_fx[ch][n][i] ), shift0 ), L_shr( Mpy_32_32( sts[ch]->hTcxEnc->spectrum_fx[n][i], sts[ch]->hTcxEnc->spectrum_fx[n][i] ), shift1 ) );
                    powerSpec_fx[ch][( i + ( n * L_subframeTCX ) )] = L_tmp; /* 2 * max( mdst_spectrum_e[ch][n], sts[ch]->hTcxEnc->spectrum_e[n] ) */
                    move32();

                    L_tmp = L_add( L_shr( Mpy_32_32( inv_mdst_spectrum_fx[ch][n][i], inv_mdst_spectrum_fx[ch][n][i] ), shift0i ), L_shr( Mpy_32_32( inv_spectrum_fx[ch][n][i], inv_spectrum_fx[ch][n][i] ), shift1i ) );
                    powerSpecMsInv_fx[ch][n][i] = L_tmp; /* 2 * max( inv_mdst_spectrum_e[ch][n], inv_spectrum_e[ch][n] ) */
                    move32();
                }
            }
            ELSE
            {
                pwrMdstMdct_e[ch][n] = shl( sts[ch]->hTcxEnc->spectrum_e[n], 1 );
                pwrMdstMdctInv_e[ch][n] = shl( inv_spectrum_e[ch][n], 1 );
                IF( NE_16( hStereoMdct->mdct_stereo_mode[n], SMDCT_DUAL_MONO ) )
                {
                    /* power spectrum: MDCT^2 + MDST^2 */
                    Word32 L_tmp;
                    L_tmp = Mpy_32_32( inv_spectrum_fx[ch][n][0], inv_spectrum_fx[ch][n][0] );
                    powerSpecMsInv_fx[ch][n][0] = L_tmp;
                    move32();

                    FOR( i = 1; i < L_subframeTCX - 1; i++ )
                    {
                        Word32 mdst_fx = L_sub( inv_spectrum_fx[ch][n][i + 1], inv_spectrum_fx[ch][n][i - 1] ); /* An MDST estimate q_spec*/

                        L_tmp = L_add( Mpy_32_32( mdst_fx, mdst_fx ), Mpy_32_32( inv_spectrum_fx[ch][n][i], inv_spectrum_fx[ch][n][i] ) );
                        powerSpecMsInv_fx[ch][n][i] = L_tmp;
                        move32();
                    }

                    L_tmp = Mpy_32_32( inv_spectrum_fx[ch][n][L_subframeTCX - 1], inv_spectrum_fx[ch][n][L_subframeTCX - 1] );
                    powerSpecMsInv_fx[ch][n][L_subframeTCX - 1] = L_tmp;
                    move32();
                }

                /* power spectrum: MDCT^2 + MDST^2 */
                L_tmp = Mpy_32_32( sts[ch]->hTcxEnc->spectrum_fx[n][0], sts[ch]->hTcxEnc->spectrum_fx[n][0] );
                powerSpec_fx[ch][n * L_subframeTCX] = L_tmp;
                move32();

                FOR( i = 1; i < L_subframeTCX - 1; i++ )
                {
                    Word32 mdst_fx = L_sub( sts[ch]->hTcxEnc->spectrum_fx[n][i + 1], sts[ch]->hTcxEnc->spectrum_fx[n][i - 1] ); /* An MDST estimate q_spec*/

                    L_tmp = L_add( Mpy_32_32( mdst_fx, mdst_fx ), Mpy_32_32( sts[ch]->hTcxEnc->spectrum_fx[n][i], sts[ch]->hTcxEnc->spectrum_fx[n][i] ) );
                    powerSpec_fx[ch][( i + ( n * L_subframeTCX ) )] = L_tmp;
                    move32();
                }

                L_tmp = Mpy_32_32( sts[ch]->hTcxEnc->spectrum_fx[n][L_subframeTCX - 1], sts[ch]->hTcxEnc->spectrum_fx[n][L_subframeTCX - 1] );
                powerSpec_fx[ch][( ( L_subframeTCX - 1 ) + ( n * L_subframeTCX ) )] = L_tmp;
                move32();
            }
        }
#else
        FOR( n = 0; n < nSubframes; n++ )
        {
            IF( sts[ch]->hTcxEnc->tns_ms_flag[n] )
@@ -533,6 +643,7 @@ void stereo_mdct_core_enc_fx(
        }
        exp_powSpecMsInv[ch] = exp;
        move16();
#endif
    }

    FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
@@ -564,9 +675,15 @@ void stereo_mdct_core_enc_fx(
             * and quantization (0: tonal, 1: noise-like).               *
             * Detect low pass if present.                               *
             *-----------------------------------------------------------*/
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
            ComputeSpectrumNoiseMeasure_fx( powerSpec_fx_tmp[ch], L_subframeTCX, i_mult( st->hTcxEnc->nmStartLine, idiv1616( L_subframeTCX, st->hTcxEnc->L_frameTCX ) ),
                                            NE_32( imult3216( st->last_sr_core, st->L_frame ), imult3216( st->sr_core, st->L_frame_past ) ) || NE_16( st->last_core, TCX_20_CORE ), st->hTcxEnc->memQuantZeros, L_subframeTCX );

#else
            ComputeSpectrumNoiseMeasure_ivas_fx( powerSpec64[ch], L_subframeTCX, i_mult( st->hTcxEnc->nmStartLine, idiv1616( L_subframeTCX, st->hTcxEnc->L_frameTCX ) ),
                                                 NE_32( imult3216( st->last_sr_core, st->L_frame ), imult3216( st->sr_core, st->L_frame_past ) ) || NE_16( st->last_core, TCX_20_CORE ),
                                                 st->hTcxEnc->memQuantZeros, L_subframeTCX );
#endif
        }

        st->hTcxEnc->measuredBwRatio = ONE_IN_Q14; /* No bandwidth limit for the noise filling Q14*/
@@ -599,10 +716,36 @@ void stereo_mdct_core_enc_fx(
                IF( ( NE_16( hStereoMdct->mdct_stereo_mode[n], hStereoMdct->IGFStereoMode[n] ) || EQ_16( hStereoMdct->mdct_stereo_mode[n], SMDCT_BW_MS ) ) && !hStereoMdct->isSBAStereoMode )
                {
                    IGF_ENC_INSTANCE_HANDLE hIGFEnc[CPE_CHANNELS];
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                    p_powerSpec_fx[0] = powerSpec_fx[0];
                    p_powerSpec_fx[1] = powerSpec_fx[1];
                    Word16 exp_SI_ch[CPE_CHANNELS], exp_pS_ch[CPE_CHANNELS], exp_pSI_ch[CPE_CHANNELS];
                    exp_SI_ch[0] = inv_spectrum_e[0][n];
                    exp_SI_ch[1] = inv_spectrum_e[1][n];
                    move16();
                    move16();
                    exp_pS_ch[0] = pwrMdstMdct_e[0][n];
                    exp_pS_ch[1] = pwrMdstMdct_e[1][n];
                    move16();
                    move16();
                    exp_pSI_ch[0] = pwrMdstMdctInv_e[0][n];
                    exp_pSI_ch[1] = pwrMdstMdctInv_e[1][n];
                    move16();
                    move16();
                    hIGFEnc[0] = sts[0]->hIGFEnc;
                    hIGFEnc[1] = sts[1]->hIGFEnc;
                    hIGFEnc[0]->spec_be_igf_e = p_orig_spectrum_e[0];
                    move16();
                    hIGFEnc[1]->spec_be_igf_e = p_orig_spectrum_e[1];
                    move16();
                    ProcessStereoIGF_fx( hStereoMdct, sts, ms_mask,
                                         orig_spectrum_fx, sub( Q31, p_orig_spectrum_e[0] ), sub( Q31, p_orig_spectrum_e[1] ),
                                         p_powerSpec_fx, exp_pS_ch, powerSpecMsInv_fx, exp_pSI_ch, inv_spectrum_fx, exp_SI_ch, n, hCPE->hCoreCoder[0]->sp_aud_decision0, hCPE->hCoreCoder[0]->element_brate, 0 );
#else
                    Word32 powerSpec_fx[CPE_CHANNELS][N_MAX], *p_powerSpec_fx[CPE_CHANNELS];
                    Word16 exp_powSpec[CPE_CHANNELS];
                    p_powerSpec_fx[0] = powerSpec_fx[0];
                    p_powerSpec_fx[1] = powerSpec_fx[1];
                    Word16 exp_powSpec[CPE_CHANNELS];
                    {
                        /* Copy powerSpec values from 64 bit buffer to 32 bit buffer */
                        FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
@@ -652,9 +795,25 @@ void stereo_mdct_core_enc_fx(
                    ProcessStereoIGF_fx( hStereoMdct, sts, ms_mask, orig_spectrum_fx, sub( Q31, p_orig_spectrum_e[0] ), sub( Q31, p_orig_spectrum_e[1] ),
                                         p_powerSpec_fx, exp_powSpec, powerSpecMsInv_fx, exp_powSpecMsInv, inv_spectrum_fx, exp_inv_spectrum,
                                         n, hCPE->hCoreCoder[0]->sp_aud_decision0, hCPE->hCoreCoder[0]->element_brate, 0 );
#endif
                }
                ELSE
                {
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                    FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
                    {
                        st = sts[ch];
                        /* update the pointer to the buffer of indices of the second channel */
                        if ( EQ_16( ch, 1 ) )
                        {
                            st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot;
                        }
                        L_subframeTCX = idiv1616( st->hTcxEnc->L_frameTCX, nSubframes ); /* Q0 */

                        // ProcessIGF_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], orig_spectrum_fx[ch][n], &st->hIGFEnc->spec_be_igf_e, &powerSpec_fx[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 );
                        ProcessIGF_ivas_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], st->hTcxEnc->spectrum_e, orig_spectrum_fx[ch][n], st->hIGFEnc->spec_be_igf_e, &powerSpec_fx[ch][n * L_subframeTCX], pwrMdstMdct_e[ch], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 );
                    }
#else
                    Word32 powerSpec_fx[CPE_CHANNELS][N_MAX]; // each value has a different exponent
                    Word16 exp_powerSpec[CPE_CHANNELS][N_MAX + L_MDCT_OVLP_MAX];
                    {
@@ -712,11 +871,43 @@ void stereo_mdct_core_enc_fx(
                        Scale_sig32( orig_spectrum_fx[ch][n], st->hIGFEnc->infoStopLine, sub( q_spectrum, sub( Q31, p_orig_spectrum_e[ch] ) ) ); /* q_spectrum */
                        ProcessIGF_ivas_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[ch][n], q_spectrum, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 );
                    }
#endif
                }
            }
        }
        ELSE
        {
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
            FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
            {
                st = sts[ch];

                /* update the pointer to the buffer of indices of the second channel */
                if ( EQ_16( ch, 1 ) )
                {
                    st->hBstr->ind_list = sts[0]->hBstr->ind_list + sts[0]->hBstr->nb_ind_tot;
                }

                nSubframes = NB_DIV;
                move16();

                if ( EQ_16( st->hTcxEnc->tcxMode, TCX_20 ) )
                {
                    nSubframes = 1;
                    move16();
                }
                IF( st->igf )
                {
                    FOR( n = 0; n < nSubframes; n++ )
                    {
                        L_subframeTCX = idiv1616( st->hTcxEnc->L_frameTCX, nSubframes ); /* Q0 */

                        ProcessIGF_ivas_fx( st, N_MAX, st->hTcxEnc->spectrum_fx[n], st->hTcxEnc->spectrum_e, orig_spectrum_fx[ch][n], st->hIGFEnc->spec_be_igf_e, &powerSpec_fx[ch][n * L_subframeTCX], &pwrMdstMdct_e[ch][n], st->core == TCX_20_CORE, n, hCPE->hCoreCoder[0]->sp_aud_decision0, 0 );
                    }
                }
            }

#else
            Word32 powerSpec_fx[CPE_CHANNELS][N_MAX]; // each value has a different exponent
            Word16 exp_powerSpec[CPE_CHANNELS][N_MAX + L_MDCT_OVLP_MAX];
            {
@@ -791,6 +982,7 @@ void stereo_mdct_core_enc_fx(
                    }
                }
            }
#endif
        }

        /*write IGF data to bitstream*/
+33 −4

File changed.

Preview size limit exceeded, changes collapsed.