Commit 7a6bd761 authored by Michael Sturm's avatar Michael Sturm
Browse files

Unifies ProcessIGF_fx function.

parent 8e7c38a9
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3788,7 +3788,12 @@ void coder_tcx_fx(

    IF( st->igf )
    {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        Word16 q_spectrum = sub( Q31, *spectrum_e );
        ProcessIGF_fx( st, 0, spectrum, &q_spectrum, NULL, 0, powerSpec, &powerSpec_e, 1, 0, 0, 0 );
#else
        ProcessIGF_fx( st->hIGFEnc, st, spectrum, spectrum_e, powerSpec, &powerSpec_e, 1, hTcxEnc->fUseTns[0], ( st->last_core == ACELP_CORE ), 0 );
#endif
    }

    ShapeSpectrum_fx( hTcxCfg, A, gainlpc, gainlpc_e,
+9 −0
Original line number Diff line number Diff line
@@ -451,7 +451,12 @@ void core_signal_analysis_high_bitrate_fx(
            }
            IF( st->igf )
            {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                Word16 q_spectrum = sub( Q31, spectrum_e[frameno] );
                ProcessIGF_fx( st, 0, spectrum[frameno], &q_spectrum, NULL, 0, powerSpec, &powerSpec_e, transform_type[frameno] == TCX_20, frameno, 0, 0 );
#else
                ProcessIGF_fx( st->hIGFEnc, st, spectrum[frameno], &( spectrum_e[frameno] ), powerSpec, &powerSpec_e, transform_type[frameno] == TCX_20, hTcxEnc->fUseTns[frameno], ( st->last_core == ACELP_CORE ), frameno );
#endif
            }

            /* Copy memory */
@@ -1251,7 +1256,11 @@ void core_signal_analysis_high_bitrate_ivas_fx(
            IF( st->igf )
            {
                Word16 q_spectrum = sub( Q31, hTcxEnc->spectrum_e[frameno] );
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                ProcessIGF_fx( st, N_MAX + L_MDCT_OVLP_MAX, hTcxEnc->spectrum_fx[frameno], &q_spectrum, hTcxEnc->spectrum_fx[frameno], q_spectrum, powerSpec, powerSpec_e, transform_type[frameno] == TCX_20, frameno, 0, vad_hover_flag );
#else
                ProcessIGF_ivas_fx( st, N_MAX + L_MDCT_OVLP_MAX, hTcxEnc->spectrum_fx[frameno], &q_spectrum, hTcxEnc->spectrum_fx[frameno], q_spectrum, powerSpec, powerSpec_e, transform_type[frameno] == TCX_20, frameno, 0, vad_hover_flag );
#endif
            }
        }
    }
+4 −2
Original line number Diff line number Diff line
@@ -673,9 +673,11 @@ void ivas_mct_core_enc_fx(
                    {
                        q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] );
                        set16_fx( exp_powerSpec[ch], sub( Q31, q_powSpec[ch] ), N_MAX + L_MDCT_OVLP_MAX );

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                        ProcessIGF_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[ch][n], q_origSpec, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );
#else
                        ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[ch][n], q_origSpec, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );

#endif
                        st->hIGFEnc->spec_be_igf_e = sub( 31, q_origSpec );
                        st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum );
                        move16();
+8 −2
Original line number Diff line number Diff line
@@ -1107,8 +1107,11 @@ void mctStereoIGF_enc_fx(
                    q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] );

                    set16_fx( exp_powerSpec[p_ch[ch]], sub( Q31, q_powerSpec[p_ch[ch]] ), L_FRAME48k );
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                    ProcessIGF_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[p_ch[ch]][n], q_origSpec, &powerSpec_fx[p_ch[ch]][n * L_subframeTCX], &exp_powerSpec[p_ch[ch]][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );
#else
                    ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[p_ch[ch]][n], q_origSpec, &powerSpec_fx[p_ch[ch]][n * L_subframeTCX], &exp_powerSpec[p_ch[ch]][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );

#endif
                    st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum );
                    move16();
                }
@@ -1148,8 +1151,11 @@ void mctStereoIGF_enc_fx(
                    q_spectrum = sub( 31, st->hTcxEnc->spectrum_e[n] );

                    set16_fx( exp_powerSpec[ch], sub( Q31, q_powerSpec[ch] ), L_FRAME48k );
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                    ProcessIGF_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[ch][n], q_origSpec, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );
#else
                    ProcessIGF_ivas_fx( st, L_FRAME48k, st->hTcxEnc->spectrum_fx[n], &q_spectrum, orig_spectrum_fx[ch][n], q_origSpec, &powerSpec_fx[ch][n * L_subframeTCX], &exp_powerSpec[ch][n * L_subframeTCX], st->core == TCX_20_CORE, n, sp_aud_decision0[ch], 0 );

#endif
                    st->hTcxEnc->spectrum_e[n] = sub( 31, q_spectrum );
                    move16();
                }
+19 −6
Original line number Diff line number Diff line
@@ -1041,6 +1041,7 @@ void AVQ_cod_lpc_fx(
    Word16 Nsv     /* i  :  number of subvectors (lg=Nsv*8) */
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void ProcessIGF_ivas_fx(
    Encoder_State *st,              /* i  : Encoder state                                           */
    Word16 powerSpec_len,           /* i  : length of pPowerSpectrum buffer                         */
@@ -1055,7 +1056,22 @@ void ProcessIGF_ivas_fx(
    const Word16 sp_aud_decision0,  /* i  : first stage switching decision                          */
    const Word16 vad_hover_flag     /* i  : VAD hangover flag                                       */
);

#else
void ProcessIGF_fx(
    Encoder_State *st,              /* i  : Encoder state                                           */
    Word16 powerSpec_len,           /* i  : length of pPowerSpectrum buffer                         */
    Word32 *pMDCTSpectrum,          /* i  : MDCT spectrum                                           */
    Word16 *q_spectrum,             /* i/o: Q of spectrum                                           */
    const Word32 *pITFMDCTSpectrum, /* i  : MDCT spectrum fir ITF                                   */
    const Word16 q_ITFMDCTSpectrum, /* i  : Q of MDCT spectrum fir ITF                              */
    Word32 *pPowerSpectrum,         /* i  : MDCT^2 + MDST^2 spectrum, or estimate                   */
    Word16 *q_powerSpec,            /* i/o: Q of power spectrum                                     */
    const Word16 isTCX20,           /* i  : flag indicating if the input is TCX20 or TCX10/2xTCX5   */
    const Word16 frameno,           /* i  : flag indicating index of current subframe               */
    const Word16 sp_aud_decision0,  /* i  : first stage switching decision                          */
    const Word16 vad_hover_flag     /* i  : VAD hangover flag                                       */
);
#endif
void ProcessIGF_ivas_fx_64(
    Encoder_State *st,              /* i/o: Encoder state                                         */
    const Word16 powerSpec_len,     /* i  : length of pPowerSpectrum buffer                       */
@@ -1068,6 +1084,7 @@ void ProcessIGF_ivas_fx_64(
    const Word16 sp_aud_decision0   /* i  : first stage switching decision                        */
);

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
void ProcessIGF_fx(
    IGF_ENC_INSTANCE_HANDLE const hInstance, /**< in: instance handle of IGF Encoder */
    Encoder_State *st,                       /**< in: Encoder state */
@@ -1076,15 +1093,11 @@ void ProcessIGF_fx(
    Word32 pPowerSpectrum[], /**< in: MDCT^2 + MDST^2 spectrum, or estimate */
    Word16 *pPowerSpectrum_e,
    Word16 isTCX20, /**< in: flag indicating if the i   is TCX20 or TCX10/2xTCX5 */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    Word8 isTNSActive, /**< in: flag indicating if the TNS is active */
#else
    Word16 isTNSActive, /**< in: flag indicating if the TNS is active */
#endif
    Word16 isTransition, /**< in: flag indicating if the i   is the transition from from ACELP to TCX20/TCX10 */
    Word16 frameno       /**< in: flag indicating index of current subframe */
);

#endif
void AnalyzePowerSpectrum_fx(
    Encoder_State *st,           /* i/o: encoder states                                */
    Word16 L_frame,              /* i  : frame length                                  */
Loading