Commit c6a01fe5 authored by multrus's avatar multrus
Browse files

remove more diffs between IVAS and EVS modes, align closer to float

parent ba4df84c
Loading
Loading
Loading
Loading
Loading
+9 −44
Original line number Diff line number Diff line
@@ -1008,11 +1008,7 @@ void init_coder_ace_plus_ivas_fx(
    {
        hTcxEnc->L_frameTCX = extract_l( Mult_32_16( st->input_Fs, INV_FRAME_PER_SEC_Q15 ) );
        move16();
#ifdef HARMONIZE_2567_init_functions
        IF( ( st->ini_frame == 0 ) && GT_16( st->element_mode, EVS_MONO ) )
#else
        IF( st->ini_frame == 0 )
#endif
        {
            set16_fx( hTcxEnc->Txnq, 0, L_FRAME32k / 2 + 64 );
            hTcxEnc->acelp_zir = hTcxEnc->Txnq + L_FRAME / 2;
@@ -1028,11 +1024,7 @@ void init_coder_ace_plus_ivas_fx(
    test();
    test();
    test();
#ifdef HARMONIZE_2567_init_functions
    IF( ( ( st->element_mode == EVS_MONO ) && EQ_32( st->L_frame, L_FRAME16k ) && LE_32( st->total_brate, ACELP_32k ) ) || ( GT_16( st->element_mode, EVS_MONO ) && EQ_32( st->L_frame, L_FRAME16k ) && LE_32( st->total_brate, MAX_ACELP_BRATE ) ) )
#else
    IF( ( EQ_16( st->element_mode, EVS_MONO ) && EQ_32( st->L_frame, L_FRAME16k ) && LE_32( st->total_brate, ACELP_32k ) ) || ( GT_16( st->element_mode, EVS_MONO ) && EQ_32( st->L_frame, L_FRAME16k ) && LE_32( st->total_brate, MAX_ACELP_BRATE ) ) )
#endif
    {
        st->nb_subfr = NB_SUBFR16k;
        move16();
@@ -1093,8 +1085,9 @@ void init_coder_ace_plus_ivas_fx(
        move16();
    }
#endif
    test();

    /* Initialize LPC analysis/quantization */
    test();
    IF( LE_32( st->sr_core, INT_FS_16k ) && st->tcxonly == 0 )
    {
        st->lpcQuantization = 1;
@@ -1133,6 +1126,7 @@ void init_coder_ace_plus_ivas_fx(
        st->hIGFEnc->infoTotalBitsWritten = 0;
        move16();
#ifdef HARMONIZE_2567_init_functions
        /* TODO mul: check, why in BASOP we can't reset st->hIGFEnc->infoTotalBitsPerFrameWritten w/o affecting bit-exactness */
        if ( GT_16( st->element_mode, EVS_MONO ) )
        {
#endif
@@ -1187,13 +1181,15 @@ void init_coder_ace_plus_ivas_fx(
#ifdef HARMONIZE_2567_init_functions
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        init_acelp_fx( st, L_frame_old, shift, 0 );
        init_acelp_fx( st, L_frame_old, shift, last_total_brate );
    }
    ELSE
    {
#endif
        init_acelp_fx( st, L_frame_old, 0, last_total_brate );
    }
#else
    init_acelp_ivas_fx( st, L_frame_old, last_total_brate );
#endif

    if ( st->ini_frame == 0 )
    {
@@ -1206,18 +1202,6 @@ void init_coder_ace_plus_ivas_fx(
        resetTecEnc_Fx( st->hTECEnc, st->tec_tfa );
    }

#ifdef HARMONIZE_2567_init_functions
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        if ( st->hTECEnc == NULL )
        {
            resetTecEnc_Fx( st->hTECEnc, 0 );
        }
        st->tec_tfa = 0;
        move16();
    }
#endif

    test();
    test();
    test();
@@ -1240,13 +1224,7 @@ void init_coder_ace_plus_ivas_fx(
    test();
    test();
    test();
#ifdef HARMONIZE_2567_init_functions
    test();
    if ( EQ_16( st->element_mode, EVS_MONO ) && ( EQ_32( st->total_brate, ACELP_9k60 ) || EQ_32( st->total_brate, ACELP_16k40 ) ||
                                                  EQ_32( st->total_brate, ACELP_24k40 ) || EQ_32( st->total_brate, ACELP_32k ) ) )
#else
    IF( ( EQ_32( st->total_brate, ACELP_9k60 ) || EQ_32( st->total_brate, ACELP_16k40 ) || EQ_32( st->total_brate, ACELP_24k40 ) ) && st->element_mode == EVS_MONO )
#endif
    {
        st->glr = 1;
        move16();
@@ -1958,20 +1936,7 @@ static void init_acelp_ivas_fx( Encoder_State *st, Word16 L_frame_old, const Wor
            test();
            test();
            test();
#ifdef HARMONIZE_2567_init_functions
            Word16 condition;
            IF( EQ_16( st->element_mode, EVS_MONO ) )
            {
                condition = !( ( EQ_32( st->total_brate, ACELP_16k40 ) || EQ_32( st->total_brate, ACELP_24k40 ) ) && ( EQ_32( st->total_brate, st->last_total_brate ) ) && ( EQ_16( st->last_bwidth, st->bwidth ) ) );
            }
            ELSE
            {
                condition = !( ( GE_32( st->total_brate, ACELP_16k40 ) && LE_32( st->total_brate, ACELP_24k40 ) ) && ( EQ_32( st->total_brate, last_total_brate ) ) && ( EQ_16( st->last_bwidth, st->bwidth ) ) );
            }
            IF( condition )
#else
            IF( !( ( GE_32( st->total_brate, ACELP_16k40 ) && LE_32( st->total_brate, ACELP_24k40 ) ) && ( EQ_32( st->total_brate, last_total_brate ) ) && ( EQ_16( st->last_bwidth, st->bwidth ) ) ) )
#endif
            {
                Copy( st->lsp_old1_fx, st->lspold_enc_fx, M ); /*lsp old @12.8kHz*/
                IF( EQ_16( st->L_frame, L_FRAME16k ) )