Commit 46da7b09 authored by vaillancour's avatar vaillancour
Browse files

fix different initialisations problems and a rounding difference, all related to the encoder

parent 833d665b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -103,6 +103,14 @@ void initFdCngCom(HANDLE_FD_CNG_COM hFdCngCom, Word16 scale)
    move16();
    hFdCngCom->fftlen = 0;
    move16();
    hFdCngCom->seed = 0;
    move16();
    //hFdCngCom->seed2 = 1;
    move16();
    //hFdCngCom->seed3 = 2;
    move16();
    hFdCngCom->CngBitrate = -1;
    move16();

    /* Initialize noise estimation algorithm */
    set32_fx( hFdCngCom->periodog, 0, PERIODOGLEN );
+0 −1
Original line number Diff line number Diff line
@@ -49,7 +49,6 @@
#define MOD_BIT_ALLOC_ROM_TABLE   // Just to highlight modification in bit allocation table and to ensure these modifications doesn't affect EVS modes*/
#define SIMPLIFY_CODE_BE   // Simplify synthesis loop

//#define AFFECT_TEST_VECTOR_BE_1     /* This concerns the reset of infoTotalBitsPerFrameWritten */
//#define AFFECT_TEST_VECTOR_BE_dec  /* This is related to the CR concerning lead_deindexing, it is just that my test vectors are not updated accordingly */


+1 −10
Original line number Diff line number Diff line
@@ -723,22 +723,13 @@ void CNG_enc_fx(
        tmp1 = add(16384,tmp1);
        att = div_s(16374,tmp1); /* Q15 */

#if 0
        IF ( LT_16(att,ftmp_fx))
        {
            att = ftmp_fx;
            move16();
        }
        att = s_max(att, ftmp_fx);
        FOR( i = 0; i < st_fx->L_frame_fx; i++ )
        {
            /*res1[i] *= att;*/
            res1[i] = mult(res1[i],att);
            move16();/* Q_new */
        }
#else
        att = s_max(att, ftmp_fx);
        v_multc_att(res1, att, res1, st_fx->L_frame_fx);
#endif
        att = shr(att,7);/* Q8 */
    }

+4 −3
Original line number Diff line number Diff line
@@ -151,10 +151,11 @@ void init_coder_ace_plus(
    ELSE IF (st->hIGFEnc != NULL)
    {
        st->hIGFEnc->infoTotalBitsWritten = 0;
#ifdef AFFECT_TEST_VECTOR_BE_1
        if (EQ_16(MCT_flag, -10))
        {
            st->hIGFEnc->infoTotalBitsPerFrameWritten = 0;
        }
        /* the line above is needed for some transition, but when going from low rate to high rate, ex 7k2 to 96k, EVS fix point doesn't do the reset (or it does somewhere else */
#endif
    }

    /* Initialize TCX */
+1 −1
Original line number Diff line number Diff line
@@ -610,7 +610,7 @@ void core_encode_openloop(
            IF( NE_16(hRF->rf_frame_type,RF_NO_DATA))
            {
                /* coder_acelp_rf does the partial copy encoding based on the rf frame type chosen for the RF encoding */
                coder_acelp_rf(&(st->acelp_cfg_rf), coder_type, Aw, Aq_rf,  st->speech_enc_pe, st->voicing_fx, st->pitch_fx,
                coder_acelp_rf(&(hRF->acelp_cfg_rf), coder_type, Aw, Aq_rf,  st->speech_enc_pe, st->voicing_fx, st->pitch_fx,
                               stab_fac_rf, st, hRF->rf_target_bits, hRF->rf_frame_type, exc_rf, syn_rf, Q_new, shift);
            }
        }
Loading