Commit 50437ede authored by multrus's avatar multrus
Browse files

[cleanup] accept FIX_2344_ALIGN_PREPROC

parent ad4f0ee3
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -5827,11 +5827,7 @@ ivas_error ivas_mct_enc_fx(
    const Word16 nb_bits_metadata                               /* i  : number of metadata bits                 */
);

#ifdef FIX_2344_ALIGN_PREPROC
void ivas_compute_core_buffers_fx(
#else
ivas_error ivas_compute_core_buffers_fx(
#endif
    Encoder_State *st,                                          /* i/o: encoder state structure                  */
    Word16 **inp16k_out_fx,                                     /* o  : ptr. to inp. signal in the current frame */
    Word16 *old_inp_16k_fx,                                     /* i/o: buffer of old input signal @ 16kHz       */
@@ -5936,11 +5932,7 @@ void ivas_mct_enc_close_fx(
    MCT_ENC_HANDLE *hMCT                                        /* i/o: MCT encoder structure                   */
);

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_front_ivas_fx(
#else
ivas_error pre_proc_front_ivas_fx(
#endif
    SCE_ENC_HANDLE hSCE,                                           /* i/o: SCE encoder structure                                    */
    CPE_ENC_HANDLE hCPE,                                           /* i/o: CPE encoder structure                                    */
    const Word32 element_brate,                                    /* i  : SCE/CPE element bitrate                                  Q0*/
@@ -5996,11 +5988,7 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 *Q_new                                                  /* i/o : Q factor of speech buffers                              */
);

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_ivas_fx(
#else
ivas_error pre_proc_ivas_fx(
#endif
    Encoder_State *st,                                          /* i/o: encoder state structure                                */
    const Word16 last_element_mode,                             /* i  : last element mode                                    Q0*/
    const Word32 element_brate,                                 /* i  : element bitrate                                      Q0*/
+0 −1
Original line number Diff line number Diff line
@@ -87,7 +87,6 @@
#define FIX_2255_ISAR_RENDER_POSES                      /* VA: issue 2255: fix missing check in isar_render_poses() */
#define FIX_1904_HARM_GSC_ENC                           /* VA: #1904 Harmonization of EVS and IVAS GSC code */
#define FIX_1478_UNINIT_ON_BFI                          /* VA: Fix issue 1478 where a vector is partly un-initialized during bfi */
#define FIX_2344_ALIGN_PREPROC                          /* VA: basop issue 2344: Align pre_proc_ivas() between FLP and BASOP */
#define FIX_2334_HARM_CODER_MODIF                       /* VA: basop issue 2334 : harmonizing coder_modif_function */
#define FIX_FLOAT_1501_UNIT_VALUE_IN_OMASA              /* Nokia: Fix float issue 1501, uninitialized value in ivas_masa_combine_directions for OMASA */
#define FIX_BASOP_2323_DIRAC_ENC_WRONG_INIT             /* Nokia/FhG: basop issue 2323: Use correct init size */
+0 −25
Original line number Diff line number Diff line
@@ -232,7 +232,6 @@ ivas_error ivas_core_enc_fx(
            Scale_sig( &Aw_fx[n][i * ( M + 1 )], M + 1, sub( norm_s( Aw_fx[n][i * ( M + 1 )] ), 2 ) ); // scaling to Q12
        }

#ifdef FIX_2344_ALIGN_PREPROC
        Word32 last_element_brate_tmp = element_brate;
        move32();
        IF( EQ_32( ivas_format, SBA_FORMAT ) )
@@ -244,28 +243,6 @@ ivas_error ivas_core_enc_fx(
        pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate_tmp, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */,
                          &inp_fx[n], &ener_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], new_inp_resamp16k_fx[n], &Voicing_flag[n], old_wsp_fx[n], e_old_wsp[n], loc_harm[n],
                          vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] );
#else
        IF( EQ_32( ivas_format, SBA_FORMAT ) )
        {
            IF( NE_32( ( error = pre_proc_ivas_fx( st, last_element_mode, element_brate, last_element_brate, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */,
                                                   &inp_fx[n], &ener_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], new_inp_resamp16k_fx[n], &Voicing_flag[n], old_wsp_fx[n], e_old_wsp[n], loc_harm[n],
                                                   vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ) ),
                       IVAS_ERR_OK ) )
            {
                return error;
            }
        }
        ELSE
        {
            IF( NE_32( ( error = pre_proc_ivas_fx( st, last_element_mode, element_brate, element_brate, input_frame, old_inp_12k8_fx[n] /* i: -1, o: Q_new - 1 */, old_inp_16k_fx[n] /* i: -1, o: Q_new - 1 */,
                                                   &inp_fx[n], &ener_fx[n], A_fx[n], Aw_fx[n], epsP_fx[n], &epsP_fx_q[n], lsp_new_fx[n], lsp_mid_fx[n], new_inp_resamp16k_fx[n], &Voicing_flag[n], old_wsp_fx[n], e_old_wsp[n], loc_harm[n],
                                                   vad_flag_dtx[n], MCT_flag, vad_hover_flag[n], flag_16k_smc, enerBuffer_fx[n], enerBuffer_fx_exp[n], fft_buff_fx[n], cor_map_sum_fx[n], &Q_new[n] ) ),
                       IVAS_ERR_OK ) )
            {
                return error;
            }
        }
#endif

        test();
        IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) || EQ_16( st->element_mode, IVAS_SCE ) )
@@ -771,10 +748,8 @@ ivas_error ivas_core_enc_fx(
#ifndef REMOVE_SCALING_SHB_SPEECH
        Word16 Q_shb_spch_16 = Q_shb_spch;
        move16();
#ifdef FIX_2344_ALIGN_PREPROC
        IF( st->tcxonly == 0 || hStereoICBWE != NULL || st->core == ACELP_CORE ) // temp. fix to keep BE until #1504 (FLP) is solved, then it will become:
                                                                                 // IF( st->tcxonly == 0 )
#endif
        {
            shift = add( getScaleFactor16( shb_speech_fx, L_FRAME16k ), Q16 );
            Copy_Scale_sig_16_32_no_sat( shb_speech_fx, shb_speech_fx32, L_FRAME16k, shift ); // Q_shb_spch
+0 −41
Original line number Diff line number Diff line
@@ -76,11 +76,7 @@ static Word16 get_zero_flag( const Word32 arr[], const Word16 len )
 * (resampling, spectral analysis, LP analysis, VAD, OL pitch calculation, classification)
 *--------------------------------------------------------------------*/

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_front_ivas_fx(
#else
ivas_error pre_proc_front_ivas_fx(
#endif
    SCE_ENC_HANDLE hSCE,                                           /* i/o: SCE encoder structure                                    */
    CPE_ENC_HANDLE hCPE,                                           /* i/o: CPE encoder structure                                    */
    const Word32 element_brate,                                    /* i  : SCE/CPE element bitrate                                  Q0*/
@@ -161,9 +157,6 @@ ivas_error pre_proc_front_ivas_fx(
    STEREO_CLASSIF_HANDLE hStereoClassif;
    Word16 old_pitch1; /* previous frame OL pitch[1] @12.8 kHz */
    Word16 LR_localVAD;
#ifndef FIX_2344_ALIGN_PREPROC
    ivas_error error;
#endif
    Word16 *signal_in_fx;
    Word32 *signal32_in_fx;
    Word16 *inp_12k8_fx, *new_inp_12k8_fx; /* pointers to current frame and new data       */
@@ -214,30 +207,15 @@ ivas_error pre_proc_front_ivas_fx(
    Word16 sf_energySum[CLDFB_NO_CHANNELS_MAX];
    Word16 Q_inp_const = -1;
    move16();
#ifdef FIX_2344_ALIGN_PREPROC
    Word16 headroom, preemp_len, inp_max;
#else
    Word16 headroom = 0, preemp_len = 0, inp_max = 0;
    move16();
    move16();
    move16();
#endif
    Word16 *preemp_start_idx = NULL;
#ifdef FIX_2344_ALIGN_PREPROC
    Word32 sig_out[STEREO_DFT_OVL_16k + L_FRAME16k /* = max( L_FRAME16k + STEREO_DFT_OVL_16k, L_FRAME16k + L_FILT16k + lMemRecalc_16k ) */], max_32;
#else
    Word32 sig_out[960], max_32;
#endif

    push_wmops( "pre_proc_front" );
    /*------------------------------------------------------------------*
     * Initialization
     *------------------------------------------------------------------*/

#ifndef FIX_2344_ALIGN_PREPROC
    error = IVAS_ERR_OK;
    move32();
#endif
    cldfbScale.lb_scale = Q31;
    cldfbScale.hb_scale = Q31;
    move16();
@@ -542,17 +520,10 @@ ivas_error pre_proc_front_ivas_fx(
     * Perform fixed preemphasis (12.8 kHz signal) through 1 - g*z^-1
     *-----------------------------------------------------------------*/

#ifndef FIX_2344_ALIGN_PREPROC
    *Q_new = 0;
    move16();
    set32_fx( sig_out, 0, 960 );
#endif
    headroom = 2;
    move16();
#ifdef FIX_2344_ALIGN_PREPROC
    preemp_len = 0;
    move16();
#endif

    st->mem_preemph_fx_q_inp = shl_sat( st->mem_preemph_fx_q_inp, sub( st->q_inp, st->mem_preemph_q ) ); /*st->q_inp*/
    move16();
@@ -1477,15 +1448,7 @@ ivas_error pre_proc_front_ivas_fx(
                move16();

                /* Compute core-coder buffers at internal sampling rate */
#ifdef FIX_2344_ALIGN_PREPROC
                ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new );
#else
                error = ivas_compute_core_buffers_fx( st, NULL, old_inp_16k_fx, NULL, input_frame, IVAS_SCE /*last_element_mode*/, INT_FS_16k /*sr_core_tmp*/, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, Q_new );
                IF( NE_32( error, IVAS_ERR_OK ) )
                {
                    return error;
                }
#endif

                *epsP_fx_q = add( Q_r[0], 1 );
                move16();
@@ -1572,11 +1535,7 @@ ivas_error pre_proc_front_ivas_fx(
    move16();

    pop_wmops();
#ifdef FIX_2344_ALIGN_PREPROC
    return;
#else
    return error;
#endif
}


+0 −171
Original line number Diff line number Diff line
@@ -46,11 +46,7 @@
 * Decision matrix, Preprocessing at other Fs, core switching decision, ...)
 *--------------------------------------------------------------------*/

#ifdef FIX_2344_ALIGN_PREPROC
void pre_proc_ivas_fx(
#else
ivas_error pre_proc_ivas_fx(
#endif
    Encoder_State *st,                           /* i/o: encoder state structure                                */
    const Word16 last_element_mode,              /* i  : last element mode                                    Q0*/
    const Word32 element_brate,                  /* i  : element bitrate                                      Q0*/
@@ -86,16 +82,9 @@ ivas_error pre_proc_ivas_fx(
    Word16 *inp_16k_fx, *new_inp_12k8_fx, *inp_12k8_fx; /* pointers to current frame and new data */
    Word16 *wsp_fx;                                     /* weighted input signal buffer           */
    Word32 sr_core_tmp, total_brate_tmp;
#ifndef FIX_2344_ALIGN_PREPROC
    ivas_error error;
#endif

    push_wmops( "pre_proc" );

#ifndef FIX_2344_ALIGN_PREPROC
    error = IVAS_ERR_OK;
    move32();
#endif
    /*----------------------------------------------------------------*
     * Initialization
     *----------------------------------------------------------------*/
@@ -173,7 +162,6 @@ ivas_error pre_proc_ivas_fx(
        move16();
    }

#ifdef FIX_2344_ALIGN_PREPROC
    IF( EQ_16( st->L_frame, L_FRAME16k ) )
    {
        total_brate_tmp = ACELP_16k40;
@@ -192,27 +180,6 @@ ivas_error pre_proc_ivas_fx(
    {
        configureFdCngEnc_ivas_fx( st->hFdCngEnc, s_max( st->input_bwidth, WB ), total_brate_tmp );
    }
#else
    test();
    test();
    test();
    Word16 flag_1 = 0;
    move16();
    IF( EQ_16( st->L_frame, L_FRAME16k ) )
    {
        flag_1 = ACELP_16k40;
        move16();
    }
    ELSE
    {
        flag_1 = ACELP_9k60;
        move16();
    }
    IF( st->hFdCngEnc != NULL && NE_16( st->element_mode, IVAS_CPE_MDCT ) && ( ( NE_16( st->hFdCngEnc->hFdCngCom->frameSize, st->L_frame ) ) || ( NE_16( st->hFdCngEnc->hFdCngCom->CngBandwidth, st->input_bwidth ) ) ) )
    {
        configureFdCngEnc_ivas_fx( st->hFdCngEnc, s_max( st->input_bwidth, WB ), flag_1 );
    }
#endif

    if ( st->ini_frame == 0 )
    {
@@ -503,16 +470,6 @@ ivas_error pre_proc_ivas_fx(
        }
    }

#ifndef FIX_2344_ALIGN_PREPROC
    /* channel-aware mode - due to lack of signaling bit, sharpFlag is 1 always in RF mode */
    test();
    test();
    if ( st->rf_mode && ( EQ_16( st->coder_type, VOICED ) || EQ_16( st->coder_type, GENERIC ) ) )
    {
        st->sharpFlag = 1;
        move16();
    }
#endif
    /* TD stereo, secondary channel - due to lack of signaling bits, sharpFlag is always 1 */
    test();
    IF( EQ_16( element_mode, IVAS_CPE_TD ) && EQ_16( st->idchan, 1 ) )
@@ -601,28 +558,14 @@ ivas_error pre_proc_ivas_fx(
    move16();
    st->exp_buf_wspeech_enc = sub( Q15, Q_old_inp_16k );
    move16();
#ifndef FIX_2344_ALIGN_PREPROC
    Word16 Q_inp_12k8 = *Q_new;
    move16();
    Word16 Q_inp_16k = *Q_new;
    move16();
#endif

    IF( !flag_16k_smc )
    {
#ifdef FIX_2344_ALIGN_PREPROC
        Word16 Q_inp_12k8 = *Q_new;
        move16();
        Word16 Q_inp_16k;

        ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx, A_fx, Aw_fx, epsP_fx, lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k );
#else
        error = ivas_compute_core_buffers_fx( st, &inp_16k_fx, old_inp_16k_fx, new_inp_resamp16k_fx, input_frame, last_element_mode, sr_core_tmp, ener_fx,
                                              A_fx, Aw_fx,
                                              epsP_fx,
                                              lsp_new_fx, lsp_mid_fx, Q_old_inp_16k, Q_r, &Q_inp_16k );

#endif

        IF( GT_16( Q_inp_16k, Q_inp_12k8 ) )
        {
@@ -636,12 +579,6 @@ ivas_error pre_proc_ivas_fx(
        }
        move16();

#ifndef FIX_2344_ALIGN_PREPROC
        IF( error != IVAS_ERR_OK )
        {
            return error;
        }
#endif
        test();
        IF( EQ_16( st->L_frame, L_FRAME16k ) && NE_16( element_mode, IVAS_CPE_MDCT ) )
        {
@@ -727,11 +664,7 @@ ivas_error pre_proc_ivas_fx(
    }

    pop_wmops();
#ifdef FIX_2344_ALIGN_PREPROC
    return;
#else
    return error;
#endif
}


@@ -741,11 +674,7 @@ ivas_error pre_proc_ivas_fx(
 * Compute core-coder buffers at internal sampling rate
 *--------------------------------------------------------------------*/

#ifdef FIX_2344_ALIGN_PREPROC
void ivas_compute_core_buffers_fx(
#else
ivas_error ivas_compute_core_buffers_fx(
#endif
    Encoder_State *st,                     /* i/o: encoder state structure                  */
    Word16 **inp16k_out_fx,                /* o  : ptr. to inp. signal in the current frame Q_new-1*/
    Word16 *old_inp_16k_fx,                /* i/o: buffer of old input signal @ 16kHz       Q_new-1*/
@@ -775,32 +704,15 @@ ivas_error ivas_compute_core_buffers_fx(
    Word16 Q_tmp, mem_decim16k_size, size_modified;
    Word16 epsP_h[M + 1];
    Word16 epsP_l[M + 1];
#ifdef FIX_2344_ALIGN_PREPROC
    Word16 i, shift, Q_min;
    Word16 preemp_len, inp_max;
#else
    Word16 headroom = 1, preemp_len = 0, inp_max = 0;
    move16();
    move16();
    move16();
#endif
    Word16 *preemp_start_idx = NULL;
#ifdef FIX_2344_ALIGN_PREPROC
#ifdef FIX_2376_FIX_USAN_PRE_PROC
    Word32 sig_out[STEREO_DFT_OVL_16k + L_FRAME16k + L_FILT16k], max_32;
#else
    Word32 sig_out[STEREO_DFT_OVL_16k + L_FRAME16k /* = max( L_FRAME16k + STEREO_DFT_OVL_16k, L_FRAME16k + L_FILT16k + lMemRecalc_16k ) */], max_32;
#endif
#else
    Word32 sig_out[960], max_32;
#endif

#ifndef FIX_2344_ALIGN_PREPROC
    set16_fx( new_inp_resamp16k_fx, 0, L_FRAME16k );
    set16_fx( epsP_h, 0, M + 1 );
    set16_fx( epsP_l, 0, M + 1 );
    set16_fx( input_buf_fx, 0, L_FRAME48k * 2 );
#endif
    Copy_Scale_sig( st->input_fx - input_frame, input_buf_fx, input_frame, sub( -1, st->q_old_inp ) );
    Copy_Scale_sig( st->input_fx, input_buf_fx + input_frame, input_frame, sub( -1, st->q_inp ) );

@@ -917,23 +829,14 @@ ivas_error ivas_compute_core_buffers_fx(
                Scale_sig( new_inp_16k_fx - lMemRecalc_16k - length_16k, size_modified, negate( Q_tmp ) );                                                                                                                    /* scaling back to Q_old_inp_16k */
            }

#ifdef FIX_2344_ALIGN_PREPROC
            size_modified = modify_Fs_ivas_fx( signal_in_fx - lMemRecalc, input_frame, input_Fs, new_inp_16k_fx - lMemRecalc_16k, sr_core, st->mem_decim16k_fx, 0, &Q_tmp, &mem_decim16k_size ); /* Q0 */
            Scale_sig( new_inp_16k_fx - lMemRecalc_16k, size_modified, negate( Q_tmp ) );                                                                                                        /* scaling back to Q_old_inp_16k */
#else
            size_modified = modify_Fs_ivas_fx( signal_in_fx - lMemRecalc, input_frame, input_Fs, new_inp_16k_fx - ( lMemRecalc * sr_core ) / st->input_Fs, sr_core, st->mem_decim16k_fx, 0, &Q_tmp, &mem_decim16k_size );                                                          /* Q0 */
            Scale_sig( new_inp_16k_fx - ( lMemRecalc * sr_core ) / st->input_Fs, size_modified, negate( Q_tmp ) );                                                                                                                                                                 /* scaling back to Q_old_inp_16k */
#endif
            Copy( st->mem_decim16k_fx, mem_decim16k_dummy_fx, 2 * L_FILT_MAX );

            IF( lMemRecalc > 0 )
            {
#ifdef FIX_2344_ALIGN_PREPROC
                size_modified = modify_Fs_ivas_fx( signal_in_fx - lMemRecalc + input_frame, lMemRecalc, input_Fs, new_inp_16k_fx + NS2SA_FX2( sr_core, FRAME_SIZE_NS ) - lMemRecalc_16k, sr_core, mem_decim16k_dummy_fx, 0, &Q_tmp, &mem_decim16k_size ); /* Q0 */
                Scale_sig( new_inp_16k_fx + NS2SA_FX2( sr_core, FRAME_SIZE_NS ) - lMemRecalc_16k, size_modified, negate( Q_tmp ) );                                                                                                                       /* scaling back to Q_old_inp_16k */
#else
                size_modified = modify_Fs_ivas_fx( signal_in_fx - lMemRecalc + input_frame, lMemRecalc, input_Fs, new_inp_16k_fx + NS2SA_FX2( sr_core, FRAME_SIZE_NS ) - ( lMemRecalc * sr_core ) / st->input_Fs, sr_core, mem_decim16k_dummy_fx, 0, &Q_tmp, &mem_decim16k_size ); /* Q0 */
#endif
            }

            set16_fx( temp1F_icatdmResampBuf_fx, 0, L_FILT_MAX );
@@ -1017,37 +920,14 @@ ivas_error ivas_compute_core_buffers_fx(
        move16();
    }

#ifdef FIX_2344_ALIGN_PREPROC
    *Q_new = 0;
    move16();
#else
    test();
    test();

    *Q_new = 0;
    move16();
    set32_fx( sig_out, 0, 960 );
    test();
    test();
    if ( ( ( st->bwidth == NB ) || ( st->max_bwidth == NB ) ) && ( GT_32( st->input_Fs, 8000 ) ) )
    {
        headroom = add( headroom, 1 );
    }

#endif

    test();
#ifdef FIX_2344_ALIGN_PREPROC
    IF( EQ_32( sr_core, INT_FS_16k ) && NE_16( element_mode, IVAS_CPE_MDCT ) )
#else
    test();
    IF( GT_32( input_Fs, 8000 ) && EQ_32( sr_core, INT_FS_16k ) && NE_16( element_mode, IVAS_CPE_MDCT ) )
#endif
    {
#ifdef FIX_2344_ALIGN_PREPROC
        preemp_len = 0;
        move16();
#endif

        IF( EQ_16( element_mode, IVAS_CPE_DFT ) )
        {
@@ -1134,12 +1014,7 @@ ivas_error ivas_compute_core_buffers_fx(
        maximum_abs_32_fx( sig_out, preemp_len, &max_32 );
        inp_max = s_max( extract_h( max_32 ), 1 );

#ifdef FIX_2344_ALIGN_PREPROC
        shift = sub( norm_s( inp_max ), 1 /* headroom */ );
#else
        Word16 shift = sub( norm_s( inp_max ), headroom );
        Word16 Q_min, i;
#endif
        shift = s_max( shift, 0 );
        shift = s_min( shift, Q_MAX );
        minimum_fx( st->Q_max_16k, L_Q_MEM, &Q_min );
@@ -1164,25 +1039,8 @@ ivas_error ivas_compute_core_buffers_fx(
        Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, add( *Q_new, 1 ) );
        Scale_sig( old_inp_16k_fx, (Word16) ( preemp_start_idx - old_inp_16k_fx ), *Q_new );
    }
#ifdef FIX_2344_ALIGN_PREPROC
    ELSE /* keep memory up-to-date in case of bitrate switching */
#else
    ELSE IF( GT_32( input_Fs, 8000 ) ) /* keep memory up-to-date in case of bitrate switching */
#endif
    {
#ifndef FIX_2344_ALIGN_PREPROC
        IF( EQ_16( element_mode, IVAS_CPE_DFT ) )
    {
            st->mem_preemph16k_fx = new_inp_16k_fx[L_frame_tmp - STEREO_DFT_OVL_16k - 1]; /* Q_new - 1 */
            move16();
        }
        ELSE IF( EQ_16( element_mode, IVAS_CPE_TD ) )
        {
            st->mem_preemph16k_fx = new_inp_16k_fx[L_frame_tmp - lMemRecalc_16k - 1]; /* Q_new - 1 */
            move16();
        }
        ELSE
#endif
        IF( EQ_16( element_mode, IVAS_CPE_MDCT ) )
        {
            st->mem_preemph16k_fx = 0;
@@ -1206,9 +1064,6 @@ ivas_error ivas_compute_core_buffers_fx(
    IF( EQ_16( st->L_frame, L_FRAME16k ) && NE_16( element_mode, IVAS_CPE_MDCT ) )
    {
        /* update signal buffers */
#ifndef FIX_2344_ALIGN_PREPROC
        Word16 shift;
#endif
        shift = negate( *Q_new );
        move16();
        IF( EQ_16( element_mode, IVAS_CPE_DFT ) )
@@ -1244,14 +1099,12 @@ ivas_error ivas_compute_core_buffers_fx(
            analy_lp_fx( inp_16k_fx, L_FRAME16k, L_look, ener_fx, A_fx, epsP_h, epsP_l, lsp_new_fx, lsp_mid_fx, st->lspold_enc_fx, st->pitch, st->voicing_fx, INT_FS_16k, element_mode, 0, -1, Q_r );
        }

#ifdef FIX_2344_ALIGN_PREPROC
        FOR( i = 0; i < M + 1; i++ )
        {
            epsP_fx[i] = L_Comp( epsP_h[i], epsP_l[i] );
            move32();
        }

#endif
        /*--------------------------------------------------------------*
         * Compute Weighted Input
         *---------------------------------------------------------------*/
@@ -1270,30 +1123,19 @@ ivas_error ivas_compute_core_buffers_fx(
    /* update old input signal @16kHz buffer */
    test();
    test();
#ifndef FIX_2344_ALIGN_PREPROC
    test();
#endif
    IF( ( EQ_16( element_mode, IVAS_CPE_TD ) && EQ_16( st->idchan, 1 ) ) || EQ_16( element_mode, IVAS_CPE_MDCT ) )
    {
        set16_fx( st->old_inp_16k_fx, 0, L_INP_MEM );
        st->exp_old_inp_16k = 0;
        move16();
    }
#ifdef FIX_2344_ALIGN_PREPROC
    ELSE IF( EQ_32( sr_core, INT_FS_16k ) )
#else
    ELSE IF( GT_32( input_Fs, 8000 ) && EQ_32( sr_core, INT_FS_16k ) )
#endif
    {
        Copy( &old_inp_16k_fx[L_frame_tmp], st->old_inp_16k_fx, L_INP_MEM );
        st->exp_old_inp_16k = sub( Q16, *Q_new ); //(*Q_new - 1)
        move16();
    }
#ifdef FIX_2344_ALIGN_PREPROC
    ELSE
#else
    ELSE IF( GT_32( input_Fs, 8000 ) )
#endif
    {
        lerp( st->old_inp_12k8_fx + L_INP_MEM - L_INP_MEM * 4 / 5, st->old_inp_16k_fx, L_INP_MEM, L_INP_MEM * 4 / 5 );
        Scale_sig( st->old_inp_16k_fx, L_INP_MEM, sub( -1 /* Q st->old_inp_16k_fx = -1 */, sub( 15, st->exp_old_inp_12k8 ) ) );
@@ -1311,18 +1153,5 @@ ivas_error ivas_compute_core_buffers_fx(
        Copy( new_inp_resamp16k_fx, new_inp_resamp16k_out_fx, L_FRAME16k );
    }

#ifndef FIX_2344_ALIGN_PREPROC
    test();
    IF( EQ_16( st->L_frame, L_FRAME16k ) && NE_16( element_mode, IVAS_CPE_MDCT ) )
    {
        FOR( Word16 i = 0; i < M + 1; i++ )
        {
            epsP_fx[i] = L_Comp( epsP_h[i], epsP_l[i] );
            move32();
        }
    }
    return IVAS_ERR_OK;
#else
    return;
#endif
}
Loading