Commit e1e8bfe7 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Cleanup of stat_com float structure elements

parent e9585128
Loading
Loading
Loading
Loading
Loading
+110 −78

File changed.

Preview size limit exceeded, changes collapsed.

+12 −12
Original line number Diff line number Diff line
@@ -36764,42 +36764,42 @@ const Word16 qGains[2][1 << kTcxHmNumGainBits] =
const struct TnsParameters tnsParametersIGF32kHz_LowBR[1] =
{
    {  600, 3, 1.85f, 0.075f, 4.4f, 237/*1.85f Q7*/,   2458/*0.075f Q15*/,563 /*4.4f Q7*/ }
    {  600, 3, /*1.85f, 0.075f, 4.4f,*/ 237/*1.85f Q7*/,   2458/*0.075f Q15*/,563 /*4.4f Q7*/ }
};
const struct TnsParameters tnsParameters32kHz[2] =
{
    { 4500, 3, 1.35f, 0.0300f, 1.0f ,173/*1.35f Q7*/,    983/*0.0300f Q15*/, 128/*1.0f Q7*/},
    {  600, 1, 1.75f, 0.0625f, 4.4f ,224/*1.75f Q7*/,   2048/*0.0625f Q15*/, 563 /*4.4f Q7*/ }
    { 4500, 3, /*1.35f, 0.0300f, 1.0f ,*/ 173/*1.35f Q7*/,    983/*0.0300f Q15*/, 128/*1.0f Q7*/},
    {  600, 1, /*1.75f, 0.0625f, 4.4f ,*/ 224/*1.75f Q7*/,   2048/*0.0625f Q15*/, 563 /*4.4f Q7*/ }
};
const struct TnsParameters tnsParameters32kHz_grouped[2] =
{
    { 8400, 3, 1.375f, 0.03125f, 1.0f , 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/ },
    {  800, 3, 1.375f, 0.03125f, 1.0f , 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/}
    { 8400, 3, /*1.375f, 0.03125f, 1.0f ,*/ 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/ },
    {  800, 3, /*1.375f, 0.03125f, 1.0f ,*/ 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/}
};
const struct TnsParameters tnsParameters16kHz[1] =
{
    {  600, 3, 1.5f, 0.05f, 4.4f, 192/*1.5f Q7*/,   1638/*0.05f Q15*/ ,563 /*4.4f Q7*/ }
    {  600, 3, /*1.5f, 0.05f, 4.4f,*/ 192/*1.5f Q7*/,   1638/*0.05f Q15*/ ,563 /*4.4f Q7*/ }
};
const struct TnsParameters tnsParameters16kHz_grouped[2] =
{
    { 4400, 3, 1.5f, 0.05f, 1.0f, 192/*1.5f Q7*/,   1638/*0.05f Q15*/ , 128/*1.0f Q7*/},
    {  800, 3, 1.5f, 0.05f, 1.0f, 192/*1.5f Q7*/,   1638/*0.05f Q15*/ , 128/*1.0f Q7*/}
    { 4400, 3, /*1.5f, 0.05f, 1.0f,*/ 192/*1.5f Q7*/,   1638/*0.05f Q15*/ , 128/*1.0f Q7*/},
    {  800, 3, /*1.5f, 0.05f, 1.0f,*/ 192/*1.5f Q7*/,   1638/*0.05f Q15*/ , 128/*1.0f Q7*/}
};
const struct TnsParameters tnsParameters48kHz_grouped[2] =
{
    { 10400, 3, 1.375f, 0.03125f, 1.0f, 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/},
    {   800, 3, 1.375f, 0.03125f, 1.0f, 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/ }
    { 10400, 3, /*1.375f, 0.03125f, 1.0f,*/ 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/},
    {   800, 3, /*1.375f, 0.03125f, 1.0f,*/ 176/*1.375f Q7*/,   1024/*0.03125f Q15*/ , 128/*1.0f Q7*/ }
};
const struct TnsParameters tnsParameters32kHz_Stereo[2]=
{
     { 4500, 3, 1.35f, 0.0300f, 1.0f ,173/*1.35f Q7*/,    983/*0.0300f Q15*/ , 128/*1.0f Q7*/},
     {  600, 3, 1.75f, 0.0625f, 4.4f ,224/*1.75f Q7*/,   2048/*0.0625f Q15*/ ,563 /*4.4f Q7*/  }
     { 4500, 3, /*1.35f, 0.0300f, 1.0f ,*/ 173/*1.35f Q7*/,    983/*0.0300f Q15*/ , 128/*1.0f Q7*/},
     {  600, 3, /*1.75f, 0.0625f, 4.4f ,*/ 224/*1.75f Q7*/,   2048/*0.0625f Q15*/ ,563 /*4.4f Q7*/  }
};
const float tnsAcfWindow[TNS_MAX_FILTER_ORDER] =
+26 −23
Original line number Diff line number Diff line
@@ -662,11 +662,13 @@ typedef struct ParamsBitMap
struct TnsParameters
{
    /* Parameters for each TNS filter */
    int16_t startLineFrequency;  /* Starting lower frequency of the TNS filter [20..16000] */
    int16_t nSubdivisions;       /* Number of spectrum subdivisions in which the filter operates [1..8) */
    Word16 startLineFrequency; /* Starting lower frequency of the TNS filter [20..16000] */
    Word16 nSubdivisions;      /* Number of spectrum subdivisions in which the filter operates [1..8) */
#ifndef IVAS_FLOAT_FIXED
    float minPredictionGain_flt; /* Minimum prediction gain required to turn on the TNS filter */
    float minAvgSqrCoef_flt;     /* Minimum average square of coefficients required to turn on the TNS filter */
    float minEnergyChange_flt;   /* Minimum energy change required to turn on the TNS filter */
#endif
    Word16 minPredictionGain; /* Minimum prediction gain required to turn on the TNS filter. Exponent = PRED_GAIN_E */
    Word16 minAvgSqrCoef;     /* Minimum average square of coefficients required to turn on the TNS filter. Exponent = 0 */
    Word16 minEnergyChange;   /* Minimum energy change required to turn on the TNS filter. Exponent = 8 */
@@ -713,31 +715,32 @@ typedef struct

typedef struct cldfb_filter_bank_struct
{
    int16_t no_channels;
    int16_t no_col;
    int16_t p_filter_length;
    Word16 no_channels;
    Word16 no_col;
    Word16 p_filter_length;
    Word16 lsb;    /*!< Top of low subbands */
    Word16 usb;    /*!< Top of high subbands */
    Word16 zeros;  /*!< number of zeros in filter coefficients */
    UWord16 flags; /*!< flags */

    CLDFB_TYPE type;
    int16_t ds; /* delay synthesis */
    int16_t da; /* delay analysis */
    Word16 ds; /* delay synthesis */
    Word16 da; /* delay analysis */
    CLDFB_PROTOTYPE prototype;

#ifndef IVAS_FLOAT_FIXED
    const float *p_filter_flt;
#endif
    const Word16 *p_filter; /*!< Pointer to filter coefficients */
    Word16 p_filter_sf;


    /* rotation vectors */
#ifndef IVAS_FLOAT_FIXED
    const float *rot_vec_ana_re;
    const float *rot_vec_ana_im;
    const float *rot_vec_syn_re;
    const float *rot_vec_syn_im;

#ifdef IVAS_FLOAT_FIXED
#else
    const Word32 *rot_vec_syn_re_fx;
    const Word32 *rot_vec_syn_im_fx;

@@ -745,12 +748,12 @@ typedef struct cldfb_filter_bank_struct
    const Word32 *rot_vec_syn_delay_im_fx;
#endif
    /* rotation vectors for delay */
#ifndef IVAS_FLOAT_FIXED
    const float *rot_vec_ana_delay_re;
    const float *rot_vec_ana_delay_im;
    const float *rot_vec_syn_delay_re;
    const float *rot_vec_syn_delay_im;

#ifdef IVAS_FLOAT_FIXED
#else
    const Word32 *rot_vec_ana_re_fx;
    const Word32 *rot_vec_ana_im_fx;

@@ -774,20 +777,20 @@ typedef struct cldfb_filter_bank_struct


    /* memory helper states */
#ifndef IVAS_FLOAT_FIXED
    float *memory_flt;
#endif
    Word16 *memory;
#ifdef IVAS_FLOAT_FIXED
    Word32 *memory32; /*because cldfb_state_fx is word32 which is used to assign values*/
#endif                // IVAS_FLOAT_FIXED
#if 0
    //Can be deleted
#endif
    uint16_t memory_length;

    UWord16 memory_length;

    /* main filter state */
#ifndef IVAS_FLOAT_FIXED
    float *cldfb_state;

#ifdef IVAS_FLOAT_FIXED
#else
    Word32 *cldfb_state_fx;
    Word16 cldfb_state_length;
    Word16 cldfb_size;
@@ -795,8 +798,8 @@ typedef struct cldfb_filter_bank_struct
#endif

    /* other parameters */
    int16_t bandsToZero; /* bands not synthesized */
    int16_t nab;         /* number of active bands */
    Word16 bandsToZero; /* bands not synthesized */
    Word16 nab;         /* number of active bands */
    Word16 filtermode;

    float scale_flt;                                /* scaling of frequency domain */
+2 −2
Original line number Diff line number Diff line
@@ -878,7 +878,7 @@ static void ivas_mc_paramupmix_dec_sf(
            scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q5 - Q11 ); // Q11 -> Q5
            st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5;
            move16();
            cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), L_mult0( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q5
            cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), imult1616( maxBand, st_ivas->hTcBuffer->subframe_nbslots[subframeIdx] ), st_ivas->cldfbSynDec[ch] ); // output_fx returned in Q5
            scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, Q11 - Q5 );                                                                          // Q5 -> Q11
            st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11;
            move16();
+9 −4
Original line number Diff line number Diff line
@@ -915,13 +915,12 @@ ivas_error ivas_core_enc(
#ifdef IVAS_FLOAT_FIXED_CONVERSIONS
            Word32 realBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
            Word32 imagBuffer_fx[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
            // Word16 new_swb_speech_16_fx[L_FRAME48k] = { 0 };
            Word16 use_shb32 = 0;
            Word16 q_realImagBuffer = Q_factor_arrL( (float *) &realBuffer[n][0][0], CLDFB_NO_COL_MAX * CLDFB_NO_CHANNELS_MAX );
            q_realImagBuffer = s_min( q_realImagBuffer, Q_factor_arrL( (float *) &imagBuffer[n][0][0], CLDFB_NO_COL_MAX * CLDFB_NO_CHANNELS_MAX ) );
            q_realImagBuffer = s_min( q_realImagBuffer, st->cldfbSynTd->Q_cldfb_state );
            floatToFixed_arrL32( (float *) &realBuffer[n][0][0], (Word32 *) &realBuffer_fx[0][0], q_realImagBuffer, CLDFB_NO_COL_MAX * CLDFB_NO_CHANNELS_MAX );
            floatToFixed_arrL32( (float *) &imagBuffer[n][0][0], (Word32 *) &imagBuffer_fx[0][0], q_realImagBuffer, CLDFB_NO_COL_MAX * CLDFB_NO_CHANNELS_MAX );
            floatToFixed_arrL32( (float *) &st->cldfbSynTd->cldfb_state[0], (Word32 *) &st->cldfbSynTd->cldfb_state_fx[0], q_realImagBuffer, st->cldfbSynTd->p_filter_length );

#if 0
            floatToFixed_arr( &st->hSignalBuf->input_buff_flt[0], &st->hSignalBuf->input_buff[0], 0, L_FRAME48k + L_FRAME48k + NS2SA( 48000, DELAY_FIR_RESAMPL_NS ) );
@@ -962,7 +961,15 @@ ivas_error ivas_core_enc(
            }
#endif
#endif

            /* Scaling cldfb_state_fx */
            scale_sig32( st->cldfbSynTd->cldfb_state_fx, st->cldfbSynTd->p_filter_length, sub( q_realImagBuffer, st->cldfbSynTd->Q_cldfb_state ) );

            swb_pre_proc_ivas_fx( st, new_swb_speech_fx_16, new_swb_speech_fx, shb_speech_fx, shb_speech_fx_32, &use_shb32, realBuffer_fx, imagBuffer_fx, q_realImagBuffer, hCPE );

            /* Re-scaling cldfb_state_fx */
            scale_sig32( st->cldfbSynTd->cldfb_state_fx, st->cldfbSynTd->p_filter_length, negate( sub( q_realImagBuffer, st->cldfbSynTd->Q_cldfb_state ) ) );

#ifdef IVAS_FLOAT_FIXED_CONVERSIONS
            fixedToFloat_arr( (Word16 *) &st->hBWE_TD->old_speech_shb_fx[0], (float *) &st->hBWE_TD->old_speech_shb[0], 0, L_LOOK_16k + L_SUBFR16k );
            fixedToFloat_arr( (Word16 *) &st->hBWE_FD->old_fdbwe_speech_fx[0], (float *) &st->hBWE_FD->old_fdbwe_speech[0], 0, L_FRAME48k );
@@ -971,7 +978,6 @@ ivas_error ivas_core_enc(
            {
                st->hBWE_FD->old_input[ii] = (Word16) st->hBWE_FD->old_input_fx[ii];
            }
            fixedToFloat_arrL32( (Word32 *) &st->cldfbSynTd->cldfb_state_fx[0], (float *) &st->cldfbSynTd->cldfb_state[0], q_realImagBuffer, st->cldfbSynTd->p_filter_length );
            fixedToFloat_arr( new_swb_speech_fx_16, new_swb_speech, 0, L_FRAME48k );
            if ( use_shb32 == 0 )
            {
@@ -1302,7 +1308,6 @@ ivas_error ivas_core_enc(
            Copy_Scale_sig_16_32( voice_factors_fx[0], voice_factors_fx32[0], NB_SUBFR16k, 16 );                                                                              // Q31
            f2me_buf_16( hCPE->hStereoICBWE->mem_shb_speech_nonref, hCPE->hStereoICBWE->mem_shb_speech_nonref_fx, &hCPE->hStereoICBWE->mem_shb_speech_nonref_e, L_LOOK_16k ); // shb_speech_ref_e
            f2me_buf_16( hCPE->hStereoICBWE->mem_shb_speech_ref, hCPE->hStereoICBWE->mem_shb_speech_ref_fx, &hCPE->hStereoICBWE->mem_shb_speech_ref_e, L_LOOK_16k );          // shb_speech_ref_e
            f2me_buf_16( hCPE->hStereoICBWE->shbSynthRef, hCPE->hStereoICBWE->shbSynthRef_fx, &hCPE->hStereoICBWE->shbSynthRef_e, L_LOOK_16k );                               // shb_speech_ref_e

            f2me( hCPE->hStereoICBWE->icbweRefEner, &hCPE->hStereoICBWE->icbweRefEner_fx, &hCPE->hStereoICBWE->icbweRefEner_e );
            scale_factor = s_min( scale_factor, Q_factor_arrL( hCPE->hStereoICBWE->mem_lpc_shbsynth_nonref, LPC_SHB_ORDER ) );
Loading