Commit db2bacd9 authored by Manuel Jander's avatar Manuel Jander
Browse files

Resolve merge conflicts one more zillion time.

parent f74a76a3
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2730,8 +2730,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(
+18 −0
Original line number Diff line number Diff line
@@ -391,7 +391,11 @@ static void getBlockValues_fx(
    p_st[0] = sts[ch1];
    p_st[1] = sts[ch2];

#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, sub( 31, q_spec ), sub( 31, q_spec ) );
#endif

    test();
    test();
@@ -1089,6 +1093,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++ )
@@ -1103,6 +1120,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
            {
+11 −0
Original line number Diff line number Diff line
@@ -158,6 +158,12 @@ 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;
@@ -200,6 +206,7 @@ void stereo_mdct_core_enc_fx(

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

    sts = hCPE->hCoreCoder;
    hStereoMdct = hCPE->hStereoMdct;
@@ -426,6 +433,7 @@ void stereo_mdct_core_enc_fx(
#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++ )
    {
@@ -449,6 +457,8 @@ void stereo_mdct_core_enc_fx(
#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
@@ -633,6 +643,7 @@ void stereo_mdct_core_enc_fx(
        }
        exp_powSpecMsInv[ch] = exp;
        move16();
#endif
    }

    FOR( ch = 0; ch < CPE_CHANNELS; ch++ )
+31 −4
Original line number Diff line number Diff line
@@ -197,8 +197,14 @@ void stereo_coder_tcx_fx(
    Word32 *inv_mdst_spectrum_fx[CPE_CHANNELS][NB_DIV],
    /* i/o: inverse MDST spectrum           */ // Q( q_spec ) (same as spectrum buffer in hTcxEnc)
    const Word16 mct_on,                       /* i  : flag mct block (1) or stereo (0)  Q0*/
#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_mdct_spec )
#endif
{
    STEREO_MDCT_BAND_PARAMETERS *sfbConf = NULL;
    Word32 nrgRatio_fx[CPE_CHANNELS];
@@ -282,6 +288,7 @@ void stereo_coder_tcx_fx(
                /* This operation is resulting in some high MLDs in fixed point. */
                v_multc_fixed_16( sts[0]->hTcxEnc->spectrum_fx[k], extract_l( L_shr( nrgRatio_fx[k], 16 - nrgRatio_e[k] ) ), sts[0]->hTcxEnc->spectrum_fx[k], L_frameTCX ); /* exp: exp_spec */
                v_multc_fixed_16( mdst_spectrum_fx[0][k], extract_l( L_shr( nrgRatio_fx[k], 16 - nrgRatio_e[k] ) ), mdst_spectrum_fx[0][k], L_frameTCX );                   /* exp: exp_mdct_spec */
#endif
            }
        }
    }
@@ -389,8 +396,12 @@ void stereo_coder_tcx_fx(
                    const Word16 endLine = sfbConf->sfbOffset[sfb + 1]; /* Q0 */
                    move16();
                    const Word16 sfbWidth = sub( endLine, startLine );

#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                    nrgRatio_e[0] = sts[0]->hTcxEnc->spectrum_e[k];
                    nrgRatio_e[1] = sts[1]->hTcxEnc->spectrum_e[k];
#else
                    nrgRatio_e[0] = nrgRatio_e[1] = exp_spec;
#endif
                    move16();
                    move16();

@@ -404,11 +415,19 @@ void stereo_coder_tcx_fx(
                    {
                        Word32 tmp_fx;
                        Word16 tmp_e;
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                        tmp_e = mdst_spectrum_e[0][k];
#else
                        tmp_e = exp_mdct_spec;
#endif
                        move16();
                        tmp_fx = sum2_32_fx( &mdst_spectrum_fx[0][k][startLine], sfbWidth, &tmp_e );                               /* Q31-tmp_e */
                        nrgRatio_fx[0] = BASOP_Util_Add_Mant32Exp( nrgRatio_fx[0], nrgRatio_e[0], tmp_fx, tmp_e, &nrgRatio_e[0] ); /* Q31-nrgRatio_e[0] */
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                        tmp_e = mdst_spectrum_e[1][k];
#else
                        tmp_e = exp_mdct_spec;
#endif
                        move16();
                        tmp_fx = sum2_32_fx( &mdst_spectrum_fx[1][k][startLine], sfbWidth, &tmp_e );                               /* Q31-tmp_e */
                        nrgRatio_fx[1] = BASOP_Util_Add_Mant32Exp( nrgRatio_fx[1], nrgRatio_e[1], tmp_fx, tmp_e, &nrgRatio_e[1] ); /* Q31-nrgRatio_e[1] */
@@ -464,13 +483,17 @@ void stereo_coder_tcx_fx(

                        v_multc_fixed( &sts[0]->hTcxEnc->spectrum_fx[k][startLine], nrgRatio_fx[0], &sts[0]->hTcxEnc->spectrum_fx[k][startLine], sfbWidth ); /* exp: exp_spec+1 */
                        v_multc_fixed( &mdst_spectrum_fx[0][k][startLine], nrgRatio_fx[0], &mdst_spectrum_fx[0][k][startLine], sfbWidth );                   /* exp: exp_mdct_spec+1 */
#ifndef FIX_1464_NO_SINGLE_SPEC_Q
                        scale_sig32( &sts[0]->hTcxEnc->spectrum_fx[k][startLine], sfbWidth, Q1 );                                                            // exp: exp_spec
                        scale_sig32( &mdst_spectrum_fx[0][k][startLine], sfbWidth, Q1 );                                                                     // exp: exp_mdct_spec
#endif

                        v_multc_fixed( &sts[1]->hTcxEnc->spectrum_fx[k][startLine], nrgRatio_fx[1], &sts[1]->hTcxEnc->spectrum_fx[k][startLine], sfbWidth ); /* exp: exp_spec+1 */
                        v_multc_fixed( &mdst_spectrum_fx[1][k][startLine], nrgRatio_fx[1], &mdst_spectrum_fx[1][k][startLine], sfbWidth );                   /* exp: exp_mdct_spec+1 */
#ifndef FIX_1464_NO_SINGLE_SPEC_Q
                        scale_sig32( &sts[1]->hTcxEnc->spectrum_fx[k][startLine], sfbWidth, Q1 );                                                            // exp: exp_spec
                        scale_sig32( &mdst_spectrum_fx[1][k][startLine], sfbWidth, Q1 );                                                                     // exp: exp_mdct_spec
#endif
                    }
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                    ELSE
@@ -522,12 +545,16 @@ void stereo_coder_tcx_fx(

            nAvailBitsMS[k] = idiv1616( nAvailBitsMS[k], nSubframes ); /* Q0 */
            move16();

#ifdef FIX_1464_NO_SINGLE_SPEC_Q
            MsStereoDecision_fx( sfbConf, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], inv_spectrum_fx[0][k], inv_spectrum_fx[1][k],
                                 sts[0]->hTcxEnc->spectrum_e[k], sts[1]->hTcxEnc->spectrum_e[k], &inv_spectrum_e[0][k], &inv_spectrum_e[1][k], &hStereoMdct->mdct_stereo_mode[k], &ms_mask[k][0], nAvailBitsMS[k] );
#else
            MsStereoDecision_fx( sfbConf, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], inv_spectrum_fx[0][k], inv_spectrum_fx[1][k], sub( Q31, exp_spec ), &hStereoMdct->mdct_stereo_mode[k], &ms_mask[k][0], nAvailBitsMS[k] );

#endif
            IF( sts[0]->igf )
            {
                IGFEncStereoEncoder_fx( sfbConf, sts[0]->hIGFEnc, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], sub( Q31, exp_spec ), &ms_mask[k][0],
#ifdef FIX_1464_NO_SINGLE_SPEC_Q
                IGFEncStereoEncoder_fx( sfbConf, sts[0]->hIGFEnc, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], sts[0]->hTcxEnc->spectrum_e[k], sts[1]->hTcxEnc->spectrum_e[k], &ms_mask[k][0],
                                        &hStereoMdct->IGFStereoMode[k], hStereoMdct->mdct_stereo_mode[k], (Word16) EQ_16( sts[0]->core, TCX_20_CORE ), (Word16) EQ_16( sts[0]->last_core, ACELP_CORE ) );
#else
                IGFEncStereoEncoder_fx( sfbConf, sts[0]->hIGFEnc, sts[0]->hTcxEnc->spectrum_fx[k], sts[1]->hTcxEnc->spectrum_fx[k], sub( Q31, exp_spec ), &ms_mask[k][0],