Commit 0a4485a8 authored by multrus's avatar multrus
Browse files

some minor editoral edits

parent 6400d88b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6649,7 +6649,7 @@ void perform_noise_estimation_dec_ivas_fx(
/* Decode the CLDFB-CNG bitstream */
#ifdef HARMONIZE_2494_FdCng_decodeSID_fx
void FdCng_decodeSID_fx(
    Decoder_State *corest ); /* i/o: decoder state structure */
    Decoder_State *st ); /* i/o: decoder state structure */
#else
void FdCng_decodeSID_fx(
    HANDLE_FD_CNG_COM st,    /* i/o: FD_CNG structure containing all buffers and variables */
+17 −26
Original line number Diff line number Diff line
@@ -2297,22 +2297,22 @@ void FdCng_decodeSID_fx( HANDLE_FD_CNG_COM st, Decoder_State *corest )
    Returns:
    void
*/
void FdCng_decodeSID_fx( Decoder_State *corest )
void FdCng_decodeSID_fx( Decoder_State *st )
{
    Word16 N;
    Word32 *sidNoiseEst;
    Word16 sidNoiseEst_Exp = 0;
    move16();
    Word16 i, index;
    HANDLE_FD_CNG_COM hFdCngCom = ( corest->hFdCngDec )->hFdCngCom;
    HANDLE_FD_CNG_COM hFdCngCom = ( st->hFdCngDec )->hFdCngCom;
    Word16 indices[32];
    Word32 v[32], gain;
    Word32 *invTrfMatrix_fx;
    Word32 tmpRAM_fx[FDCNG_VQ_MAX_LEN][FDCNG_VQ_DCT_MAXTRUNC];

    Word32 gain_q_offset = GAIN_Q_OFFSET_IVAS_FX_Q0;
    move16();
    move32();

    if ( EQ_16( corest->element_mode, EVS_MONO ) )
    if ( EQ_16( st->element_mode, EVS_MONO ) )
    {
        gain_q_offset = GAIN_Q_OFFSET_EVS_FX_Q0; /*60 Q0*/
        move32();
@@ -2332,15 +2332,15 @@ void FdCng_decodeSID_fx( Decoder_State *corest )
    /* Read bitstream */
    FOR( i = 0; i < stages_37bits; i++ )
    {
        indices[i] = get_next_indice_fx( corest, bits_37bits[i] ); /*Q0*/
        indices[i] = get_next_indice_fx( st, bits_37bits[i] ); /*Q0*/
        move16();
    }

    index = get_next_indice_fx( corest, 7 ); /*Q0*/
    index = get_next_indice_fx( st, 7 ); /*Q0*/

    /* MSVQ decoder */

    IF( NE_16( corest->element_mode, EVS_MONO ) )
    IF( NE_16( st->element_mode, EVS_MONO ) )
    {
        create_IDCT_N_Matrix_fx( invTrfMatrix_fx, FDCNG_VQ_MAX_LEN, FDCNG_VQ_DCT_MAXTRUNC, FDCNG_VQ_MAX_LEN * FDCNG_VQ_DCT_MAXTRUNC );
        msvq_dec_fx( ivas_cdk_37bits_fx, NULL, NULL, stages_37bits, N, maxN_37bits, indices, 1, invTrfMatrix_fx, v, NULL, 7 );
@@ -2348,13 +2348,7 @@ void FdCng_decodeSID_fx( Decoder_State *corest )
    ELSE
    {
        Word16 v16[32];
        msvq_decoder(
            cdk_37bits,
            stages_37bits,
            N,
            maxN_37bits,
            indices,
            v16 );
        msvq_decoder( cdk_37bits, stages_37bits, N, maxN_37bits, indices, v16 );

        FOR( i = 0; i < N; i++ )
        {
@@ -2366,16 +2360,13 @@ void FdCng_decodeSID_fx( Decoder_State *corest )

    /* Decode gain */
    // gain = ((float)index - gain_q_offset) / 1.5f;
    {
    /* format gain: Q9.23 */
    gain = L_shl( L_deposit_l( index ), WORD32_BITS - 1 - 8 );
    gain = L_sub( gain, L_shl( gain_q_offset, 23 ) /*60.0 Q23*/ ); /*Q23*/
    gain = Mpy_32_16_1( gain, 21845 /*2.0f/3.0f Q15*/ );           /*Q23*/
    }


    /* Apply gain and undo log */
    IF( corest->element_mode == EVS_MONO )
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        /* format gain: Q9.23 */
        /* calculate worst case for scaling */
@@ -2432,7 +2423,7 @@ void FdCng_decodeSID_fx( Decoder_State *corest )

    /* NB last band energy compensation */

    IF( hFdCngCom->CngBandwidth == NB )
    IF( EQ_16( hFdCngCom->CngBandwidth, NB ) )
    {
        sidNoiseEst[( N - 1 )] = Mpy_32_16_1( sidNoiseEst[( N - 1 )], NB_LAST_BAND_SCALE );
        move32();
@@ -2446,7 +2437,7 @@ void FdCng_decodeSID_fx( Decoder_State *corest )
    }

    scalebands( sidNoiseEst, hFdCngCom->part, hFdCngCom->npart, hFdCngCom->midband, hFdCngCom->nFFTpart, sub( hFdCngCom->stopBand, hFdCngCom->startBand ), hFdCngCom->cngNoiseLevel, 1 );
    IF( EQ_16( corest->element_mode, EVS_MONO ) )
    IF( EQ_16( st->element_mode, EVS_MONO ) )
    {
        hFdCngCom->cngNoiseLevelExp = hFdCngCom->sidNoiseEstExp;
        move16();
@@ -2465,7 +2456,7 @@ void FdCng_decodeSID_fx( Decoder_State *corest )
    }
    move16();

    lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, corest->preemph_fac );
    lpc_from_spectrum( hFdCngCom, hFdCngCom->startBand, hFdCngCom->stopFFTbin, st->preemph_fac );
}
#endif