Commit 85de4e1c authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Float code cleanup with corresponding scaling changes

parent 5425fce1
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -588,8 +588,8 @@ static void house_qr_fx(
            }


            pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // exp: tmp_pu_e[i]
            pv_exp[s - k] = tmp_pu_e[i];
            pv_fx[s - k] = dotp_fixed( &pu_fx[k], &pa_fx[k], sub( n_rows, k ) ); // exp: tmp_pu_e[k]
            pv_exp[s - k] = tmp_pu_e[k];
            move32();
            move16();
        }
+4 −0
Original line number Diff line number Diff line
@@ -779,6 +779,10 @@ void destroy_core_enc_fx(
    ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure                  */
);

void destroy_evs_core_enc_fx(
    ENC_CORE_HANDLE hCoreCoder /* i/o: core encoder structure      */
);

ivas_error ivas_sce_dec_fx(
    Decoder_Struct *st_ivas,      /* i/o: IVAS decoder structure              */
    const Word16 sce_id,          /* i  : SCE # identifier                    */
+1 −6
Original line number Diff line number Diff line
@@ -545,9 +545,6 @@ void init_coder_ace_plus(
    init_modes_ivas_fx( st, last_total_brate );
#endif
    /* Adaptive BPF */
    set_zero( st->mem_bpf, 2 * L_FILT16k );
    set_zero( st->mem_error_bpf, 2 * L_FILT16k );

    if ( st->total_brate >= HQ_48k )
    {
        st->enablePlcWaveadjust = 1;
@@ -1009,9 +1006,7 @@ static void init_sig_buffers_ivas_fx( Encoder_State *st, const Word16 L_frame_ol
            st->mem_preemph_enc = st->buf_speech_enc[st->encoderPastSamples_enc + st->encoderLookahead_enc - 1];
            move16();
            st->exp_mem_preemph_enc = st->exp_buf_speech_enc;
            // To Be Checked
            // st->mem_wsp_enc = shr( st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1], sub( Q16, st->exp_buf_wspeech_enc ) ); // Q-1
            st->mem_wsp_enc = shr_sat( st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1], sub( Q16, st->exp_buf_wspeech_enc ) ); // Q-1
            st->mem_wsp_enc = shr( st->buf_wspeech_enc[st->L_frame + L_SUBFR - 1], sub( Q16, st->exp_buf_wspeech_enc ) ); // Q-1
            move16();
        }
        /*coming from TCXonly modes*/
+0 −5
Original line number Diff line number Diff line
@@ -207,13 +207,8 @@ void core_coder_mode_switch_ivas_fx(
        move32();

        /* Initialize Signal Buffers */
        f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM );
        f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM );
        f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM );

        /* Adaptive BPF */
        set_zero( st->mem_bpf, 2 * L_FILT16k );
        set_zero( st->mem_error_bpf, 2 * L_FILT16k );
#endif
        init_coder_ace_plus_ivas_fx( st, last_total_brate, MCT_flag );
        IF( st->hLPDmem != NULL )
+23 −16
Original line number Diff line number Diff line
@@ -169,13 +169,15 @@ ivas_error init_encoder(
#ifndef IVAS_FLOAT_FIXED
    init_gp_clip( st->clip_var );
    pitch_ol_init( &st->old_thres, &st->old_pitch, &st->delta_pit, &st->old_corr );
    set_f( st->old_wsp, 0, L_WSP_MEM );
#else
    init_gp_clip_fx( st->clip_var_fx );
    pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx );
#endif
    set_f( st->old_wsp, 0, L_WSP_MEM );
#ifdef IVAS_FLOAT_FIXED
    set16_fx( st->old_wsp_fx, 0, L_WSP_MEM );
    st->exp_old_wsp = 0;
    move16();
#endif
#ifndef IVAS_FLOAT_FIXED
    set_f( st->old_wsp2, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM );
@@ -192,6 +194,11 @@ ivas_error init_encoder(
    st->mem_deemp_preQ_fx = 0;
#endif
    /* AVQ pre-quantizer memory */
#ifndef IVAS_FLOAT_FIXED
    st->mem_preemp_preQ = 0.0f;
#else
    st->mem_preemp_preQ_fx = 0;
#endif
    st->last_nq_preQ = 0;
    st->last_code_preq = 0;
    st->use_acelp_preq = 0;
@@ -199,24 +206,24 @@ ivas_error init_encoder(

    /* (Decimated) Weighted Speech Memory */
#ifndef IVAS_FLOAT_FIXED
    st->mem_preemp_preQ = 0.0f;
    st->mem_wsp_enc_flt = 0.0;
    st->mem_wsp = 0.0f;

    set_f( st->mem_decim2, 0, 3 );
#endif
#else
#ifdef MSAN_FIX
    st->mem_wsp_enc = 0;
    move16();
    st->mem_wsp_fx = 0;
    move16();
    st->mem_wsp_q = Q15;
    st->mem_wsp_q = 0;
    move16();
    set16_fx( st->mem_decim2_fx, 0, 3 );
    set16_fx( st->old_wsp2_fx, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage.
    st->Q_old_wsp2 = Q15;
    move16();
#endif
#endif

#ifndef IVAS_FLOAT_FIXED
    set_f( st->Bin_E, 0, L_FFT );
@@ -1015,8 +1022,9 @@ ivas_error init_encoder(
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxEnc\n" ) );
        }
#ifdef MSAN_FIX
        set_f( st->hTcxEnc->spectrum_long, 0, N_MAX );
        // set_f( st->hTcxEnc->spectrum_long, 0, N_MAX );
        set32_fx( st->hTcxEnc->spectrum_long_fx, 0, N_MAX );
        st->hTcxEnc->spectrum_long_e = 0;
#endif // MSAN_FIX

        /* Share the memories for 2xTCX10/4xTCX5 and for TCX20 */
@@ -1028,8 +1036,8 @@ ivas_error init_encoder(
        move16();
#endif // IVAS_FLOAT_FIXED

        st->hTcxEnc->spectrum[0] = st->hTcxEnc->spectrum_long;
        st->hTcxEnc->spectrum[1] = st->hTcxEnc->spectrum_long + N_TCX10_MAX;
        // st->hTcxEnc->spectrum[0] = st->hTcxEnc->spectrum_long;
        // st->hTcxEnc->spectrum[1] = st->hTcxEnc->spectrum_long + N_TCX10_MAX;

#ifdef MSAN_FIX
        set32_fx( st->hTcxEnc->spectrum_fx[0], 0, N_TCX10_MAX );
@@ -1375,6 +1383,8 @@ ivas_error init_encoder_ivas_fx(
    init_gp_clip_fx( st->clip_var_fx );
    pitch_ol_init_fx( &st->old_thres_fx, &st->old_pitch, &st->delta_pit, &st->old_corr_fx );
    set16_fx( st->old_wsp_fx, 0, L_WSP_MEM );
    st->exp_old_wsp = 0;
    move16();
    set16_fx( st->old_wsp2_fx, 0, ( L_WSP_MEM - L_INTERPOL ) / OPL_DECIM ); // Needs to change depending on usage.
    st->Q_old_wsp2 = 0;
    move16();
@@ -1389,7 +1399,6 @@ ivas_error init_encoder_ivas_fx(
    move16();

#if 1 // TODO: Float Initializations. To be removed later
    set_f( st->old_wsp, 0, L_WSP_MEM );
    st->mem_preemph = 0.0f;
    st->mem_preemph_DFT = 0.0f;
    set_f( st->inp_12k8_mem_stereo_sw, 0, STEREO_DFT_OVL_12k8 - L_MEM_RECALC_12K8 - L_FILT );
@@ -2157,6 +2166,8 @@ ivas_error init_encoder_ivas_fx(
        {
            return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hTcxEnc\n" ) );
        }
        set32_fx( st->hTcxEnc->spectrum_long_fx, 0, N_MAX );
        st->hTcxEnc->spectrum_long_e = 0;

        /* Share the memories for 2xTCX10/4xTCX5 and for TCX20 */
        st->hTcxEnc->spectrum_fx[0] = st->hTcxEnc->spectrum_long_fx;
@@ -2165,9 +2176,9 @@ ivas_error init_encoder_ivas_fx(
        move16();
        move16();
#if 1
        set_f( st->hTcxEnc->spectrum_long, 0, N_MAX );
        st->hTcxEnc->spectrum[0] = st->hTcxEnc->spectrum_long;
        st->hTcxEnc->spectrum[1] = st->hTcxEnc->spectrum_long + N_TCX10_MAX;
        // set_f( st->hTcxEnc->spectrum_long, 0, N_MAX );
        // st->hTcxEnc->spectrum[0] = st->hTcxEnc->spectrum_long;
        // st->hTcxEnc->spectrum[1] = st->hTcxEnc->spectrum_long + N_TCX10_MAX;
        //  set_f( st->hTcxEnc->old_out, 0, L_FRAME32k );
#endif

@@ -2314,14 +2325,10 @@ ivas_error init_encoder_ivas_fx(
#endif

    /* Initialize Signal Buffers */
    f2me_buf_16( st->old_wsp, st->old_wsp_fx, &st->exp_old_wsp, L_WSP_MEM );
    f2me_buf_16( st->old_inp_12k8, st->old_inp_12k8_fx, &st->exp_old_inp_12k8, L_INP_MEM );
    f2me_buf_16( st->old_inp_16k, st->old_inp_16k_fx, &st->exp_old_inp_16k, L_INP_MEM );

    /* Initialize ACELP */
    /* Adaptive BPF */
    set_zero( st->mem_bpf, 2 * L_FILT16k );
    set_zero( st->mem_error_bpf, 2 * L_FILT16k );
#endif
    init_coder_ace_plus_ivas_fx( st, st->last_total_brate, 0 );

Loading