Commit 362851f9 authored by Fabian Bauer's avatar Fabian Bauer
Browse files

cleanup a bit

parent 761ed0bf
Loading
Loading
Loading
Loading
+14 −21
Original line number Diff line number Diff line
@@ -1946,22 +1946,21 @@ void FdCng_encodeSID_fx(
)
{
    Word16 i, index, N;
    Word32 temp, gain_fx, e_fx;
    HANDLE_FD_CNG_ENC hFdCngEnc = corest->hFdCngEnc;
    HANDLE_FD_CNG_COM hFdCngCom = hFdCngEnc->hFdCngCom;
    Word16 preemph_fac = corest->preemph_fac; // Q15
    move16();
    BSTR_ENC_HANDLE hBstr = corest->hBstr;
    Word16 normFacGain, normShiftGain, normFacN, normShiftN, E_Exp;
    Word16 indices[32];
    Word32 temp, gain_fx, e_fx, E_ExpLd64;
    Word32 v_fx[32];
    Word32 *E_fx;
    Word16 v_e, E_Exp;
    Word16 normFacN, normShiftN;
    Word16 normFacGain, normShiftGain;
    Word32 E_ExpLd64;
    Word16 element_mode = corest->element_mode;
    move16();
    Word16 preemph_fac = corest->preemph_fac; // Q15
    move16();

    BSTR_ENC_HANDLE hBstr = corest->hBstr;
    HANDLE_FD_CNG_ENC hFdCngEnc = corest->hFdCngEnc;
    HANDLE_FD_CNG_COM hFdCngCom = hFdCngEnc->hFdCngCom;

    IF( element_mode > 0 )
    if( element_mode > 0 )
    {
        (void) normFacN;
        (void) normShiftN;
@@ -1969,10 +1968,6 @@ void FdCng_encodeSID_fx(
        (void) normShiftGain;
        (void) E_ExpLd64;
    }
    ELSE
    {
        (void) v_e;
    }

    /* Init */

@@ -2060,9 +2055,6 @@ void FdCng_encodeSID_fx(
            v_fx[i] = L_sub( v_fx[i], gain_fx ); // Q20
            move32();
        }

        v_e = 11; // Q20
        move16();
    }

    /*MSVQ*/
@@ -2093,6 +2085,7 @@ void FdCng_encodeSID_fx(
        Word32 dct_target_fx[FDCNG_VQ_DCT_MAXTRUNC];
        Word32 tot_sig_ext_fx[FDCNG_VQ_MAX_LEN];


        /* DCT domain compressed/truncated indices used for first stage  */
        /*  quantization with stage1 stored in DCT24 domain,   stages 2 through 6 directly dearched
           in FDCNG band domain
@@ -2115,11 +2108,9 @@ void FdCng_encodeSID_fx(

        create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, sizeof( tmpRAM_fx ) / ( sizeof( Word32 ) ) ); // Q31

        msvq_enc_ivas_fx( ivas_cdk_37bits_fx, Q7, NULL, NULL, v_fx, v_e, levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, w_fx, N, FD_CNG_maxN_37bits, 1, invTrfMatrix_fx, indices );
        msvq_enc_ivas_fx( ivas_cdk_37bits_fx, Q7, NULL, NULL, v_fx, 11 /*Q20*/, levels_37bits, FD_CNG_maxC_37bits, FD_CNG_stages_37bits, w_fx, N, FD_CNG_maxN_37bits, 1, invTrfMatrix_fx, indices );

        msvq_dec_fx( ivas_cdk_37bits_fx, NULL, NULL, FD_CNG_stages_37bits, N, FD_CNG_maxN_37bits, indices, 1, invTrfMatrix_fx, v_fx, NULL, 7 );

        v_e = sub( 31, sub( 20, find_guarded_bits_fx( N ) ) );
    }

    /* Compute gain */
@@ -2140,6 +2131,7 @@ void FdCng_encodeSID_fx(
    }
    ELSE
    {
        Word16 v_e = sub( 31, sub( 20, find_guarded_bits_fx( N ) ) );
        gain_fx = 0;
        move32();
        FOR( i = 0; i < N; i++ )
@@ -2226,6 +2218,7 @@ void FdCng_encodeSID_fx(
    }
    ELSE
    {
        Word16 v_e = sub( 31, sub( 20, find_guarded_bits_fx( N ) ) );
        gain_fx = L_shl( L_mult0( sub( index, GAIN_Q_OFFSET_IVAS_FX_Q0 ), 21845 /*1.5 in Q15*/ ), sub( 16, v_e ) ); // Q = 31-v_e

        Word16 exp[32];