Commit 67c251cb authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Incorrect scaling fix, LTV crash fix and Float build fix

[x] Fix for Incorrect scaling in ivas_mdct_core_tns_ns_fx. Scaling occurring for wrong length in decoder_tcx_tns_fx corrected
[x] float build fix
[x] Fix for ltv crash of stream OMASA 2Dir2TC 3ISM at 48 kbps, 48kHz in,
48kHz out, MONO out. When hCPE->brate_surplus comes negative hCPE->brate_surplus / FRAMES_PER_SECOND with basops for -4800 gives -97 instead of -96 which lead to hCPE->hStereoTD->tdm_LRTD_flag sometimes differing from float workspace.
parent 980c2e79
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1460,7 +1460,7 @@ void deindex_sph_idx(

    return;
}

#ifdef IVAS_FLOAT_FIXED
void deindex_sph_idx_fx(
    const UWord16 sphIndex,              /* i  : Spherical index            */
    const SPHERICAL_GRID_DATA *gridData, /* i  : Prepared spherical grid    */
@@ -1683,7 +1683,7 @@ void deindex_sph_idx_fx(
    }
    return;
}

#endif
/*---------------------------------------------------------------
 * valid_ratio_index()
 *
+2 −1
Original line number Diff line number Diff line
@@ -1388,7 +1388,8 @@ void decoder_tcx_tns_fx(
    STnsData *tnsData,
    const Word16 bfi,       /* i  : Bad frame indicator                     */
    const Word16 frame_cnt, /* i  : frame counter in the super frame        */
    const Word16 whitenedDomain );
    const Word16 whitenedDomain,
    Word16 *length );

void ivas_mdct_core_tns_ns_fx(
    CPE_DEC_HANDLE hCPE,                                         /* i/o: CPE decoder structure                  */
+3 −3
Original line number Diff line number Diff line
@@ -3516,7 +3516,7 @@ const Word16 *const ivas_sns_cdbks_side_tcx10_fx[SNS_MSVQ_NSTAGES_SIDE] = {
/*----------------------------------------------------------------------*
 * MC ParamUpmix ROM tables
 *-----------------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
const ACPL_QUANT_TABLE_FX ivas_mc_paramupmix_alpha_quant_table_fx = {
    33, /* nquant */
    16, /* offset */
@@ -3583,7 +3583,7 @@ const ACPL_QUANT_TABLE_FX ivas_mc_paramupmix_beta_quant_table_fx[9] = {
        { 0, 15938355, 36909876, 62914560, 93952408, 130023424, 171127600, 217264944, 268435456 } /* data in Q28 */
    }
};

#endif
/* Q Factor is 31*/
const Word32 ivas_han_win_48k_fx[L_FRAME32k] = {
    5760, 22976, 51712, 91904, 143552, 206784, 281408, 367552, 465216,
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include "stat_com.h"
#include "ivas_stat_com.h"

#ifdef IVAS_FLOAT_FIXED

extern const Word16 ivas_sin_twiddle_480_fx[IVAS_480_PT_LEN >> 1];
extern const Word16 ivas_cos_twiddle_480_fx[IVAS_480_PT_LEN >> 1];
@@ -50,6 +49,7 @@ extern const Word16 ivas_sin_twiddle_160_fx[IVAS_160_PT_LEN >> 1];
extern const Word16 ivas_cos_twiddle_160_fx[IVAS_160_PT_LEN >> 1];
extern const Word16 ivas_sin_twiddle_80_fx[IVAS_80_PT_LEN >> 1];
extern const Word16 ivas_cos_twiddle_80_fx[IVAS_80_PT_LEN >> 1];
#ifdef IVAS_FLOAT_FIXED
extern const Word16 nf_tw_smoothing_coeffs_fx[N_LTP_GAIN_MEMS];
extern const Word32 dft_res_gains_q_fx[][2];
extern const Word16 dft_res_cod_alpha_fx[STEREO_DFT_BAND_MAX];
+6 −4
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ Word32 inv_table_145[N_MAX_SHIFT_CHANGE + 1] = {
Word32 tableD1_145[N_MAX_SHIFT_CHANGE + 1] = { 0, 15027, 120219, 405740, 961755, 1878428, 3245924, 5154407,
                                               7694041, 10954993, 15027425, 20001503, 25967392, 33015256, 41235259, 50717555,
                                               61552334, 73829752, 87639951, 103073111, 120219402 };
#ifdef IVAS_FLOAT_FIXED
static void interpTargetChannel_fx(
    Word32 *target_fx,
    const Word16 prevShift,
@@ -300,14 +301,14 @@ static void interpTargetChannel_fx(

    return;
}

#endif

/*---------------------------------------------------------------
 *  Function targetCh_AlignStereoDFT()
 *
 *  Align target channel in DFT stereo to correct FOR shift variations
 * ---------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
static void targetCh_AlignStereoDFT_fx(
    Word32 *target_fx,
    const Word16 prevShift,
@@ -368,14 +369,14 @@ static void targetCh_AlignStereoDFT_fx(

    return;
}

#endif

/*---------------------------------------------------------------
 * adjustTargetSignal()
 *
 * Target signal correction FOR shift variations.
 * ---------------------------------------------------------------*/

#ifdef IVAS_FLOAT_FIXED
void adjustTargetSignal_fx(
    Word32 *target_fx,
    const Word16 prevShift,
@@ -396,3 +397,4 @@ void adjustTargetSignal_fx(

    return;
}
#endif
 No newline at end of file
Loading