diff --git a/lib_com/cldfb.c b/lib_com/cldfb.c index 10a30424705a4801e10c3e3f805731ed1a3cbdc8..63a4dd34fcbf5ea7df5a995a110a7ca5cb39ef9a 100644 --- a/lib_com/cldfb.c +++ b/lib_com/cldfb.c @@ -731,6 +731,8 @@ void cldfbAnalysis_ts_fx( Copy32( timeIn_fx, timeBuffer_fx + offset, frameSize ); } + h_cldfb->Q_cldfb_state = *q_cldfb; + /* only process needed cols */ if ( samplesToProcess > -1 ) { @@ -968,6 +970,7 @@ void cldfbAnalysis_ts_fx_fixed_q( /* prepare input buffer */ timeBuffer_fx = buffer_fx; Copy32( h_cldfb->cldfb_state_fx, timeBuffer_fx, offset ); + h_cldfb->Q_cldfb_state = *q_cldfb; if ( samplesToProcess > -1 ) { @@ -1659,7 +1662,7 @@ ivas_error openCldfb_ivas( hs->cldfb_state_length = buf_len;//Temporarily added to store the length of buffer hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/ set32_fx(hs->cldfb_state_fx, 0, buf_len); - hs->Q_cldfb_state = Q31; + hs->Q_cldfb_state = Q11; #endif // IVAS_FLOAT_FIXED @@ -1756,7 +1759,7 @@ ivas_error openCldfb_ivas_fx( hs->cldfb_state_length = buf_len; // Temporarily added to store the length of buffer hs->cldfb_size = buf_len; /*for having original size at intermediatery conversion, will be removed on removing conversion*/ set32_fx(hs->cldfb_state_fx, 0, buf_len); - + hs->Q_cldfb_state = Q11; /* TODO: remove the floating point dependency */ IF ( ( hs->cldfb_state = (float *) malloc( buf_len * sizeof( float ) ) ) == NULL ) @@ -2609,6 +2612,7 @@ void cldfb_reset_memory_fx( hs->cldfb_state_length = memory_length; /* save the memory */ set32_fx(hs->cldfb_state_fx, 0, memory_length); + hs->Q_cldfb_state = Q11; return; } diff --git a/lib_com/ivas_fb_mixer.c b/lib_com/ivas_fb_mixer.c index 78b6afcbc4592abccf3d0751e3320dd4a535ce80..d7b77a29dbf44907c393c4080088a8257b4c842e 100644 --- a/lib_com/ivas_fb_mixer.c +++ b/lib_com/ivas_fb_mixer.c @@ -38,6 +38,9 @@ #include "ivas_rom_com.h" #include #include "wmc_auto.h" +#include "ivas_prot_fx.h" +#include "prot_fx1.h" +#include "prot_fx2.h" /*------------------------------------------------------------------------------------------* @@ -46,7 +49,13 @@ static void ivas_get_active_bins( const int16_t **pActive_bins, const int16_t **pActive_bins_abs, const int16_t **pStart_offset, const int16_t **pStart_offset_ab, const int32_t sampling_rate ); static void ivas_get_ld_fb_resp( float **ppIdeal_FRs_re, float **ppIdeal_FRs_im, float **ppNew_FRs_re, float **ppNew_FRs_im, const int16_t *pActive_bins, const int16_t *pStart_offset, const int16_t num_bands, const int16_t delay, const int32_t sampling_rate ); +#ifdef IVAS_FLOAT_FIXED +static void ivas_get_ld_fb_resp_fx( Word32 **ppIdeal_FRs_re_fx, Word32 **ppIdeal_FRs_im_fx, Word32 **ppNew_FRs_re_fx, Word32 **ppNew_FRs_im_fx, const Word16 *pActive_bins, const Word16 *pStart_offset, const Word16 num_bands, const Word16 delay, const Word32 sampling_rate ); +#endif static ivas_error ivas_filterbank_setup( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate ); +#ifdef IVAS_FLOAT_FIXED +static ivas_error ivas_filterbank_setup_fx( IVAS_FB_MIXER_HANDLE hFbMixer, const int32_t sampling_rate, Word16 *index ); +#endif static ivas_error ivas_fb_mixer_get_window( const int16_t fade_len, const int32_t sampling_rate, const float **pWindow ); #ifdef IVAS_FLOAT_FIXED static ivas_error ivas_fb_mixer_get_window_fx( const Word16 fade_len, const Word32 sampling_rate, const Word16 **pWindow ); @@ -60,6 +69,19 @@ static ivas_error ivas_fb_mixer_get_window_fx( const Word16 fade_len, const Word *-----------------------------------------------------------------------------------------*/ /*! r: number of spectral bands */ +#ifdef IVAS_FLOAT_FIXED +Word16 ivas_get_num_bands_from_bw_idx( + const Word16 bwidth /* i : audio bandwidth */ +) +{ + Word16 num_active_bands; + + assert( bwidth > 0 ); /*NB BW is not supported*/ + num_active_bands = ivas_num_active_bands[bwidth - 1]; + + return num_active_bands; +} +#else int16_t ivas_get_num_bands_from_bw_idx( const int16_t bwidth /* i : audio bandwidth */ ) @@ -71,7 +93,7 @@ int16_t ivas_get_num_bands_from_bw_idx( return num_active_bands; } - +#endif /*-----------------------------------------------------------------------------------------* * Function ivas_get_num_bands() @@ -79,6 +101,16 @@ int16_t ivas_get_num_bands_from_bw_idx( * Get number of bands depending on the sampling rates *-----------------------------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +static Word16 ivas_get_num_bands( + const Word32 sampling_rate ) +{ + Word16 bwidth = ivas_get_bw_idx_from_sample_rate( sampling_rate ); + Word16 num_active_bands = ivas_get_num_bands_from_bw_idx( bwidth ); + + return num_active_bands; +} +#else static int16_t ivas_get_num_bands( const int32_t sampling_rate ) { @@ -87,6 +119,7 @@ static int16_t ivas_get_num_bands( return num_active_bands; } +#endif /*---------------------------------------------------------------------* @@ -95,6 +128,64 @@ static int16_t ivas_get_num_bands( * Set default configs for FB mixer *---------------------------------------------------------------------*/ +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_fb_set_cfg( + IVAS_FB_CFG **pFb_cfg_out, /* o : FB config. handle */ + const Word16 ivas_format, /* i : IVAS format */ + const Word16 num_in_chans, /* i : number of FB input channels */ + const Word16 num_out_chans, /* i : number of FB output channels */ + const Word16 active_w_mixing, /* i : active_w_mixing flag */ + const Word32 sampling_rate, /* i : sampling rate */ + const Word16 nchan_fb_in /* i : number of dirAC analysis channels*/ +) +{ + IVAS_FB_CFG *pFb_cfg; + + IF ( ( pFb_cfg = (IVAS_FB_CFG *) malloc( sizeof( IVAS_FB_CFG ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer config" ); + } + + pFb_cfg->num_in_chans = num_in_chans; + pFb_cfg->num_out_chans = num_out_chans; + pFb_cfg->nchan_fb_in = nchan_fb_in; + + pFb_cfg->pcm_offset = 0; /* note: in SPAR decoder, this parameter is overwritten later */ + pFb_cfg->active_w_mixing = active_w_mixing; + pFb_cfg->windowed_fr_offset = 0; + + IF ( ivas_format == ISM_FORMAT ) + { + pFb_cfg->fb_latency = NS2SA( sampling_rate, DELAY_FB_4_NS ); + pFb_cfg->fade_len = NS2SA( sampling_rate, DELAY_FB_4_NS ); + pFb_cfg->prior_input_length = NS2SA( sampling_rate, DELAY_DIRAC_ENC_CMP_NS_PARAM_ISM ) + NS2SA( sampling_rate, DIRAC_SLOT_ENC_NS ); + } + ELSE IF ( ivas_format == SBA_FORMAT ) + { + pFb_cfg->fb_latency = NS2SA( sampling_rate, DELAY_FB_1_NS ); + + pFb_cfg->fade_len = NS2SA( sampling_rate, DELAY_FB_4_NS ); + pFb_cfg->prior_input_length = NS2SA( sampling_rate, FRAME_SIZE_NS ); + pFb_cfg->windowed_fr_offset = (Word16) ( (float) ( sampling_rate / FRAMES_PER_SEC ) * 3.0f / 4.0f ) - NS2SA( sampling_rate, DELAY_DIRAC_SPAR_ENC_CMP_NS ); + } + ELSE IF ( ivas_format == MASA_FORMAT ) + { + pFb_cfg->fb_latency = NS2SA( sampling_rate, DELAY_FB_1_NS ); + pFb_cfg->fade_len = NS2SA( sampling_rate, DELAY_FB_1_NS ); + pFb_cfg->prior_input_length = NS2SA( sampling_rate, DELAY_DIRAC_ENC_CMP_NS ) + NS2SA( sampling_rate, DIRAC_SLOT_ENC_NS ); + } + ELSE IF ( ivas_format == MC_FORMAT ) + { + pFb_cfg->fb_latency = NS2SA( sampling_rate, DELAY_FB_1_NS ); + pFb_cfg->fade_len = NS2SA( sampling_rate, DELAY_FB_1_NS ); + pFb_cfg->prior_input_length = NS2SA( sampling_rate, DELAY_DIRAC_ENC_CMP_NS ) + NS2SA( sampling_rate, PARAM_MC_SLOT_ENC_NS ); + } + + *pFb_cfg_out = pFb_cfg; + + return IVAS_ERR_OK; +} +#else ivas_error ivas_fb_set_cfg( IVAS_FB_CFG **pFb_cfg_out, /* o : FB config. handle */ const int16_t ivas_format, /* i : IVAS format */ @@ -151,6 +242,7 @@ ivas_error ivas_fb_set_cfg( return IVAS_ERR_OK; } +#endif /*------------------------------------------------------------------------- @@ -316,6 +408,17 @@ ivas_error ivas_FB_mixer_open( { return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); } +#ifdef IVAS_FLOAT_FIXED + IF( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j] = (Word32 *) malloc( sizeof( Word32 ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + + IF( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j] = (Word32 *) malloc( sizeof( Word32 ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } +#endif } } } @@ -343,6 +446,416 @@ ivas_error ivas_FB_mixer_open( return error; } +#ifdef IVAS_FLOAT_FIXED +ivas_error ivas_FB_mixer_open_fx( + IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ + const Word32 sampling_rate, /* i : sampling rate */ + IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ + const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ +) +{ + IVAS_FB_MIXER_HANDLE hFbMixer; + int16_t i, j, frame_len, num_bands; + int16_t num_chs_alloc; + ivas_error error; + + error = IVAS_ERR_OK; + + frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); + + hFbMixer = *hFbMixer_out; + + IF( !spar_reconfig_flag ) + { + IF( ( hFbMixer = (IVAS_FB_MIXER_HANDLE) malloc( sizeof( IVAS_FB_MIXER_DATA ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + + IF( fb_cfg->num_out_chans > 0 ) + { + IF( ( hFbMixer->pFb = (ivas_filterbank_t *) malloc( sizeof( ivas_filterbank_t ) ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + } + ELSE + { + hFbMixer->pFb = NULL; + } + } + + IF( fb_cfg->active_w_mixing == -1 ) + { + num_chs_alloc = 0; + move16(); + } + ELSE IF( fb_cfg->active_w_mixing ) + { + num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); + } + ELSE + { + num_chs_alloc = 1; /* only W channel processed for predicting YZX */ + } + +#ifndef IVAS_FLOAT_FIXED /////////////////////////////// FLOAT /////////////////////////////////////////////// + for (i = 0; i < num_chs_alloc; i++) + { + if (fb_cfg->num_out_chans == 0) + { + hFbMixer->ppFilterbank_inFR_re[i] = NULL; + hFbMixer->ppFilterbank_inFR_im[i] = NULL; + } + else + { + j = fb_cfg->remix_order[i]; + + if ((hFbMixer->ppFilterbank_inFR_re[j] = (float *)malloc(sizeof(float) * frame_len)) == NULL) + { + return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder"); + } + + if ((hFbMixer->ppFilterbank_inFR_im[j] = (float *)malloc(sizeof(float) * frame_len)) == NULL) + { + return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder"); + } + } + } +#else + for ( i = 0; i < num_chs_alloc; i++ ) + { + if ( fb_cfg->num_out_chans == 0 ) + { + hFbMixer->ppFilterbank_inFR_re[i] = NULL; + hFbMixer->ppFilterbank_inFR_im[i] = NULL; + } + else + { + j = fb_cfg->remix_order[i]; + + if ( ( hFbMixer->ppFilterbank_inFR_re_fx[j] = (Word32 *) malloc( sizeof( Word32 ) * frame_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + + if ( ( hFbMixer->ppFilterbank_inFR_im_fx[j] = (Word32 *) malloc( sizeof( Word32 ) * frame_len ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + } + } +#endif + + IF( fb_cfg->active_w_mixing == -1 ) + { + num_chs_alloc = 0; + move16(); + } + ELSE + { + num_chs_alloc = max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ); + } + +#ifndef IVAS_FLOAT_FIXED //////////////////////////// Float ////////////////////////////////////// + for (i = 0; i < num_chs_alloc; i++) + { + if ((hFbMixer->ppFilterbank_prior_input[i] = (float *)malloc(sizeof(float) * fb_cfg->prior_input_length)) == NULL) + { + return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder"); + } + set_f(hFbMixer->ppFilterbank_prior_input[i], 0, fb_cfg->prior_input_length); + } +#else + FOR ( i = 0; i < num_chs_alloc; i++ ) + { + IF ( ( hFbMixer->ppFilterbank_prior_input_fx[i] = (Word32 *) malloc( sizeof( Word32 ) * fb_cfg->prior_input_length ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + set32_fx( hFbMixer->ppFilterbank_prior_input_fx[i], 0, fb_cfg->prior_input_length ); + } +#endif + + IF( ( fb_cfg->active_w_mixing != -1 ) && ( fb_cfg->num_out_chans > 0 ) ) + { +#ifndef IVAS_FLOAT_FIXED ////////////////////////////////////////// FLOAT ////////////////////////////////////////////////////// + float *pTemp_mem; + if ( ( pTemp_mem = (float *) malloc( sizeof( float ) * fb_cfg->num_out_chans * max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ) * IVAS_MAX_NUM_BANDS ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer" ); + } + for ( i = 0; i < fb_cfg->num_out_chans; i++ ) + { + for ( j = 0; j < fb_cfg->num_in_chans; j++ ) + { + hFbMixer->prior_mixer[i][j] = pTemp_mem; + pTemp_mem += IVAS_MAX_NUM_BANDS; + set_f( hFbMixer->prior_mixer[i][j], 0, IVAS_MAX_NUM_BANDS ); + } + } +#else + Word32 *pTemp_mem_fx; + IF ( ( pTemp_mem_fx = (Word32 *) malloc( sizeof( Word32 ) * fb_cfg->num_out_chans * max( fb_cfg->num_in_chans, fb_cfg->nchan_fb_in ) * IVAS_MAX_NUM_BANDS ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer" ); + } + FOR ( i = 0; i < fb_cfg->num_out_chans; i++ ) + { + FOR ( j = 0; j < fb_cfg->num_in_chans; j++ ) + { + hFbMixer->prior_mixer_fx[i][j] = pTemp_mem_fx; + pTemp_mem_fx += IVAS_MAX_NUM_BANDS; + set32_fx( hFbMixer->prior_mixer_fx[i][j], 0, IVAS_MAX_NUM_BANDS ); + } + } +#endif + } + + IF( !spar_reconfig_flag ) + { + IF( fb_cfg->num_out_chans > 0 ) + { + const int16_t *pActive_bins_per_band, *pActive_bins_per_band_abs, *pStart_offset, *pStart_offset_abs; + + num_bands = ivas_get_num_bands( sampling_rate ); + + ivas_get_active_bins( &pActive_bins_per_band, &pActive_bins_per_band_abs, &pStart_offset, &pStart_offset_abs, sampling_rate ); + + IF( fb_cfg->active_w_mixing != -1 ) + { + FOR( i = 0; i < num_bands; i++ ) + { +#if 0 ///////////////// FLOAT //////////////////////////////////////// + if ((hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[i] = (float *)malloc(sizeof(float) * pActive_bins_per_band_abs[i])) == NULL) + { + return IVAS_ERROR(IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder"); + } +#endif + IF( ( hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band_fx[i] = (Word32 *) malloc( sizeof( Word32 ) * pActive_bins_per_band_abs[i] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder fixed" ); + } + } + } + + IF( sampling_rate != 48000 ) + { + int16_t num_diff_bands, start_diff_band_non48k; + + num_diff_bands = MAX_NUM_BANDS_DIFF_NON48K; + start_diff_band_non48k = num_bands - num_diff_bands; + + hFbMixer->num_diff_bands = num_diff_bands; + + for ( j = start_diff_band_non48k; j < num_bands; j++ ) + { +#if 1 ////////////////////////////////// FLOAT //////////////////////// + if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j] = (float *) malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + + if ( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j] = (float *) malloc( sizeof( float ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } +#endif + IF( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j] = (Word32 *) malloc( sizeof( Word32 ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + + IF( ( hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j] = (Word32 *) malloc( sizeof( Word32 ) * pActive_bins_per_band[j] ) ) == NULL ) + { + return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for FB mixer encoder" ); + } + } + } + } + ELSE + { + /* ignore all the deeper filter bank stuff for now */ + hFbMixer->num_diff_bands = 0; + move16(); + } + } + + hFbMixer->fb_cfg = fb_cfg; + set_s( hFbMixer->first_frame, 1, hFbMixer->fb_cfg->num_out_chans ); + set_s( hFbMixer->first_frame + hFbMixer->fb_cfg->num_out_chans, 0, IVAS_SPAR_MAX_CH - hFbMixer->fb_cfg->num_out_chans ); + + if ( !spar_reconfig_flag ) + { +#ifdef IVAS_FLOAT_FIXED +#if 1 /*********************Intermediate Conversion that needs to remove *****************************/ + //const Word16 *pAll_bins_per_band_48k = NULL; + + //const float *pAll_fb_fr[2]; + + //IF( hFbMixer->fb_cfg->num_out_chans > 0 ) + //{ + // IF( hFbMixer->fb_cfg->fb_latency == NS2SA( sampling_rate, DELAY_FB_1_NS ) ) + // { + // pAll_fb_fr[0] = ivas_fb_fr_12band_1ms_re; + // pAll_fb_fr[1] = ivas_fb_fr_12band_1ms_im; + // } + // pAll_bins_per_band_48k = ivas_fb_bins_per_band_12band_1ms[0]; + //} + + /************************************* Float table is gettin assigned here **************************************/ + // if ((error = ivas_fb_mixer_get_window(hFbMixer->fb_cfg->fb_latency, sampling_rate, &(hFbMixer->pAna_window))) != IVAS_ERR_OK) + //{ + // return error; + // } + + /************************************* Float table is gettin assigned here **************************************/ + if ( ( error = ivas_fb_mixer_get_window( hFbMixer->fb_cfg->fade_len, sampling_rate, &( hFbMixer->pFilterbank_cross_fade ) ) ) != IVAS_ERR_OK ) + { + return error; + } + +#if 0 + IF(hFbMixer->fb_cfg->num_out_chans > 0) + { + Word16 offset = 0; + + IF(sampling_rate == 48000) + { + FOR(j = 0; j < hFbMixer->pFb->filterbank_num_bands; j++) + { + hFbMixer->pFb->fb_consts.ppFilterbank_FRs[0][j] = &pAll_fb_fr[0][offset]; + hFbMixer->pFb->fb_consts.ppFilterbank_FRs[1][j] = &pAll_fb_fr[1][offset]; + + offset += hFbMixer->pFb->fb_consts.pFilterbank_bins_per_band[j]; + } + } + ELSE + { + Word16 active_bins_temp[MAX_NUM_BANDS_DIFF_NON48K]; + Word16 start_offset_temp[MAX_NUM_BANDS_DIFF_NON48K]; + Word16 num_diff_bands, start_diff_band_non48k; + + num_diff_bands = MAX_NUM_BANDS_DIFF_NON48K; + start_diff_band_non48k = hFbMixer->pFb->filterbank_num_bands - num_diff_bands; + + FOR(j = 0; j < hFbMixer->pFb->filterbank_num_bands; j++) + { + Word16 num_active_bins = hFbMixer->pFb->fb_consts.pFilterbank_bins_per_band[j]; + + IF(j < start_diff_band_non48k) + { + hFbMixer->pFb->fb_consts.ppFilterbank_FRs[0][j] = &pAll_fb_fr[0][offset]; + hFbMixer->pFb->fb_consts.ppFilterbank_FRs[1][j] = &pAll_fb_fr[1][offset]; + } + ELSE + { + mvr2r(&pAll_fb_fr[0][offset], hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j], num_active_bins); + mvr2r(&pAll_fb_fr[1][offset], hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j], num_active_bins); + } + + offset += pAll_bins_per_band_48k[j]; + } + + } + } +#endif + + Word16 index[IVAS_MAX_NUM_FB_BANDS]; + + set16_fx( index, 0, IVAS_MAX_NUM_FB_BANDS ); +#endif /*********************Intermediate Conversion that needs to remove *****************************/ + IF( ( error = ivas_filterbank_setup_fx( hFbMixer, sampling_rate, index ) ) != IVAS_ERR_OK ) + { + return error; + } + +#if 0 /*********************Intermediate Conversion that needs to remove *****************************/ + IF(hFbMixer->fb_cfg->num_out_chans > 0) + { + IF(sampling_rate != 48000) + { + const Word16 *pAll_bins_start_offset = NULL; + const Word16 *pAll_bins_per_band = NULL; + const Word16 *pAll_bins_start_offset_abs = NULL; + const Word16 *pAll_bins_per_band_abs = NULL; + + ivas_get_active_bins(&pAll_bins_per_band, &pAll_bins_per_band_abs, &pAll_bins_start_offset, &pAll_bins_start_offset_abs, sampling_rate); + + Word16 num_diff_bands, start_diff_band_non48k; + + num_diff_bands = MAX_NUM_BANDS_DIFF_NON48K; + start_diff_band_non48k = hFbMixer->pFb->filterbank_num_bands - num_diff_bands; + + FOR(j = start_diff_band_non48k; j < hFbMixer->pFb->filterbank_num_bands; j++) + { + fixedToFloat_arrL(hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j], hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[0][j], Q30, pAll_bins_per_band[j]); + fixedToFloat_arrL(hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j], hFbMixer->pFb->fb_consts.ppFilterbank_FRs_non48k[1][j], Q30, pAll_bins_per_band[j]); + + } + } + } +#endif +#if 0 + fixedToFloat_arrL(hFbMixer->pFb->fb_bin_to_band.p_short_stride_bin_to_band_fx, hFbMixer->pFb->fb_bin_to_band.p_short_stride_bin_to_band, Q22, 2 * MDFT_FB_BANDS_240); + + Word16 x, y; + + FOR(x = 0; x < IVAS_MAX_NUM_FB_BANDS; x++) + { + IF(hFbMixer->pFb->fb_bin_to_band.pp_short_stride_bin_to_band_fx[x] != NULL) + { + hFbMixer->pFb->fb_bin_to_band.pp_short_stride_bin_to_band[x] = &hFbMixer->pFb->fb_bin_to_band.p_short_stride_bin_to_band[index[x]]; + } + } + Word16 bands = hFbMixer->pFb->filterbank_num_bands; + + FOR(x = 0; x < bands; x++) + { + Word16 start_offset = hFbMixer->pFb->fb_consts.pFilterbank_bins_start_offset[x]; + Word16 num_bins = hFbMixer->pFb->fb_consts.pFilterbank_bins_per_band[x]; + Word16 idx = 0; + Word16 abs_active_bins = hFbMixer->pFb->fb_bin_to_band.pFb_active_bins_per_band[x]; + Word16 abs_start_offset = hFbMixer->pFb->fb_bin_to_band.pFb_start_bin_per_band[x]; + + FOR(y = start_offset; y < num_bins + start_offset; y++) + { + IF(y < (abs_active_bins + abs_start_offset) && y >= abs_start_offset && hFbMixer->fb_cfg->active_w_mixing != -1) + { + hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[x][idx] = fix_to_float(hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band_fx[x][idx], Q22); + idx = add(idx, 1); + + } + } + } + + IF(hFbMixer->fb_cfg->active_w_mixing != -1) + { + FOR(y = 0; y < bands; y++) + { + Word16 abs_active_bins = hFbMixer->pFb->fb_bin_to_band.pFb_active_bins_per_band[y]; + + FOR(x = 0; x < abs_active_bins; x++) + { + hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band[y][x] = me2f(hFbMixer->pFb->fb_bin_to_band.pFb_bin_to_band_fx[y][x], Q22); + } + } + + } +#endif /*********************Intermediate Conversion that needs to remove *****************************/ +#else + if ( ( error = ivas_filterbank_setup( hFbMixer, sampling_rate ) ) != IVAS_ERR_OK ) + { + return error; + } +#endif + } + + *hFbMixer_out = hFbMixer; + + return error; +} +#endif /*------------------------------------------------------------------------- * ivas_FB_mixer_close() @@ -639,6 +1152,51 @@ void ivas_fb_mixer_cross_fading( return; } +#ifdef IVAS_FLOAT_FIXED +void ivas_fb_mixer_cross_fading_fx( + IVAS_FB_MIXER_HANDLE hFbMixer, + Word32 **ppOut_pcm_fx, + Word32 *pMdft_out_old_fx, + Word32 *pMdft_out_new_fx, + const Word16 ch, + const Word16 frame_len, + const Word16 cf_offset) +{ + Word16 k, fade_start_offset, fade_end_offset; + + if (hFbMixer->first_frame[ch] == 0) + { + fade_start_offset = hFbMixer->cross_fade_start_offset; + fade_end_offset = hFbMixer->cross_fade_end_offset; + + for (k = 0; k < fade_start_offset; k++) + { + ppOut_pcm_fx[ch][k] = pMdft_out_old_fx[k + cf_offset]; + } + + for (k = fade_start_offset; k < fade_end_offset; k++) + { + ppOut_pcm_fx[ch][k] = L_add(Mpy_32_16_1(pMdft_out_new_fx[k + cf_offset], hFbMixer->pFilterbank_cross_fade_fx[k - fade_start_offset]), Mpy_32_16_1(pMdft_out_old_fx[k + cf_offset], (ONE_IN_Q15 - hFbMixer->pFilterbank_cross_fade_fx[k - fade_start_offset]))); + } + + for (k = fade_end_offset; k < frame_len; k++) + { + ppOut_pcm_fx[ch][k] = pMdft_out_new_fx[k + cf_offset]; + } + } + else + { + hFbMixer->first_frame[ch] = 0; + + for (k = 0; k < frame_len; k++) + { + ppOut_pcm_fx[ch][k] = pMdft_out_new_fx[k + cf_offset]; + } + } + + return; +} +#endif /*-----------------------------------------------------------------------------------------* * Function ivas_fb_mixer_process() @@ -952,64 +1510,376 @@ static int16_t ivas_calculate_abs_fr( { float temp = 0; - IVAS_CALCULATE_ABS( *pFilterbank_bin_to_band_re, *pFilterbank_bin_to_band_im, temp ); + IVAS_CALCULATE_ABS( *pFilterbank_bin_to_band_re, *pFilterbank_bin_to_band_im, temp ); + + pFilterbank_bin_to_band_re++; + pFilterbank_bin_to_band_im++; + + temp -= 0.3f; + + if ( temp < 0.0f ) + { + temp = 0; + } + + if ( j < ( abs_active_bins + abs_start_offset ) && j >= abs_start_offset && alloc_fb_resp != -1 ) + { +#ifdef IVAS_FLOAT_FIXED + pFb->fb_bin_to_band.pFb_bin_to_band[i][idx] = temp; + pFb->fb_bin_to_band.pFb_bin_to_band_fx[i][idx] = (Word32) ( temp * ONE_IN_Q22 ); + idx = add( idx, 1 ); +#else + pFb->fb_bin_to_band.pFb_bin_to_band[i][idx++] = temp; +#endif + } + + ppFilterbank_FRs_s[j] += temp; +#ifdef IVAS_FLOAT_FIXED + ppFilterbank_FRs_s_fx[j] = L_add( ppFilterbank_FRs_s_fx[j], (Word32) ( temp * ONE_IN_Q22 ) ); +#endif + } + } + + for ( i = 0; i < frame_len; i++ ) + { + if ( ppFilterbank_FRs_s[i] < 0.1f ) + { + ppFilterbank_FRs_s[i] = 0.1f; +#ifdef IVAS_FLOAT_FIXED + ppFilterbank_FRs_s_fx[i] = (Word32) ( 0.1f * ONE_IN_Q22 ); +#endif + } + } + + if ( alloc_fb_resp != -1 ) + { + for ( j = 0; j < bands; j++ ) + { + int16_t abs_active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; + int16_t abs_start_offset = pFb->fb_bin_to_band.pFb_start_bin_per_band[j]; +#ifdef IVAS_FLOAT_FIXED + Word16 exp_diff = 0, tmp; +#endif + + for ( i = 0; i < abs_active_bins; i++ ) + { + pFb->fb_bin_to_band.pFb_bin_to_band[j][i] /= ppFilterbank_FRs_s[i + abs_start_offset]; +#ifdef IVAS_FLOAT_FIXED + tmp = BASOP_Util_Divide3232_Scale( pFb->fb_bin_to_band.pFb_bin_to_band_fx[j][i], ppFilterbank_FRs_s_fx[i + abs_start_offset], &exp_diff ); + pFb->fb_bin_to_band.pFb_bin_to_band_fx[j][i] = L_shl( L_deposit_l( tmp ), add( Q7, exp_diff ) ); // Q22 +#endif + /*if(pFb->fb_bin_to_band.pFb_bin_to_band[j][i] > 0.5f) + { + num_active_bands = j + 1; + break; + }*/ + } + } + } + + return num_active_bands; +} + +#ifdef IVAS_FLOAT_FIXED +static Word16 ivas_calculate_abs_fr_fx( + ivas_filterbank_t *pFb, + const Word32 sampling_rate, + const Word16 alloc_fb_resp, + Word16 *index ) +{ + Word16 frame_len; + Word32 ppFilterbank_FRs_s_fx[L_FRAME48k]; + Word16 bands = pFb->filterbank_num_bands; + Word16 i, j, num_active_bands = 0; + move16(); + Word16 idx_short_stride_bin_to_band = 0; + move16(); + + + FOR( i = 0; i < bands; i++ ) + { + const Word32 *long_mdft_ptr_re_fx = pFb->fb_consts.ppFilterbank_FRs_fx[0][i]; + const Word32 *long_mdft_ptr_im_fx = pFb->fb_consts.ppFilterbank_FRs_fx[1][i]; + + Word16 start_offset = pFb->fb_consts.pFilterbank_bins_start_offset[i]; + move16(); + Word16 num_bins = pFb->fb_consts.pFilterbank_bins_per_band[i]; + move16(); + Word16 short_mdft_start_bin = -1; + move16(); + + Word32 short_stride_pow_spec_fx[MDFT_FB_BANDS_240]; + Word32 short_stride_nrg_fx = 0; + move16(); + Word16 exp_diff = 0, tmp; + move16(); + + Word32 cldfb_nrg_fx = 0; + Word16 cldfb_nrg_e = 0; + move16(); + Word16 short_stride = pFb->fb_bin_to_band.short_stride; + move16(); + const Word16 num_bins_per_short_stride_bin = ( const Word16 )( ( sampling_rate / FRAMES_PER_SEC ) / short_stride ); + const Word16 num_bins_per_cldfb_band = ( const Word16 )( ( sampling_rate / FRAMES_PER_SEC ) / pFb->fb_bin_to_band.num_cldfb_bands ); + + Word32 short_stride_max_per_spar_band_fx = 1; + move32(); + + /*loop over all stored Filter Bank Response MDFT coefficients*/ + + set_l( short_stride_pow_spec_fx, 0, MDFT_FB_BANDS_240 ); + + FOR( j = start_offset; j < num_bins + start_offset; j++ ) + { + + Word32 sq_abs_fx; + Word16 sq_abs_e; + + //Word32 real = L_shr( *long_mdft_ptr_re_fx, 3 ); // Q27 + Word32 real = *long_mdft_ptr_re_fx; // Q31 + move32(); + //Word32 imag = L_shr( *long_mdft_ptr_im_fx, 3 ); // Q27 + Word32 imag = *long_mdft_ptr_im_fx; // Q31 + + Word16 real_exp, imag_exp; + move32(); + + Word32 real_sq, imag_sq; + + real_sq = Mpy_32_32( real, real ); + real_exp = 2; + move32(); + imag_sq = Mpy_32_32( imag, imag ); + imag_exp = 2; + move32(); + + sq_abs_fx = BASOP_Util_Add_Mant32Exp(real_sq, real_exp, imag_sq, imag_exp, &sq_abs_e);// Q22 + move32(); + + long_mdft_ptr_re_fx++; + long_mdft_ptr_im_fx++; + + /* accumulate bin energies within a short stride bin */ + + short_stride_nrg_fx = L_add( short_stride_nrg_fx, L_shl( sq_abs_fx, Q22 - ( Q31 - sq_abs_e ) ) ); + move32(); + + IF( !( ( j + 1 ) % num_bins_per_short_stride_bin ) ) + { + /* new short stride bin */ + short_stride_pow_spec_fx[j / num_bins_per_short_stride_bin] = short_stride_nrg_fx; /* energy rather than magnitude works better for covariance weighting*/ + move32(); + short_stride_max_per_spar_band_fx = L_max( short_stride_nrg_fx, short_stride_max_per_spar_band_fx ); /*compute highest magnitude per band*/ + move32(); + short_stride_nrg_fx = 0; + move32(); + } + + /* accumulate bin energies within a CLDFB band */ + cldfb_nrg_fx = BASOP_Util_Add_Mant32Exp(cldfb_nrg_fx,cldfb_nrg_e,sq_abs_fx,sq_abs_e,&cldfb_nrg_e); + move32(); + + IF( !( ( j + 1 ) % num_bins_per_cldfb_band ) ) + { + Word32 temp = Sqrt32( cldfb_nrg_fx, &cldfb_nrg_e ); + move32(); + temp = L_shl( temp, sub(cldfb_nrg_e, Q9 ) ); // Q22 + move32(); + pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j / num_bins_per_cldfb_band][i] = temp; + cldfb_nrg_fx = 0; + cldfb_nrg_e = 0; + move16(); + } + } + + /*loop over the short MDFT bins*/ + FOR( j = 0; j < short_stride; j++ ) + { + tmp = BASOP_Util_Divide3232_Scale( short_stride_pow_spec_fx[j], short_stride_max_per_spar_band_fx, &exp_diff ); + move16(); + short_stride_pow_spec_fx[j] = L_shl( L_deposit_l( tmp ), add( Q7, exp_diff ) ); // Q22 + move32(); + short_stride_pow_spec_fx[j] = L_max( L_sub( short_stride_pow_spec_fx[j], (Word32) ( 0.3f * ONE_IN_Q22 ) ), 0 ); + move32(); + tmp = BASOP_Util_Divide3232_Scale( short_stride_pow_spec_fx[j], (Word32) ( 0.7f * ONE_IN_Q22 ), &exp_diff ); + move16(); + short_stride_pow_spec_fx[j] = L_shl( L_deposit_l( tmp ), add( Q7, exp_diff ) ); // Q22 + move32(); + + IF( GT_32( short_stride_pow_spec_fx[j], 0 ) ) + { + assert( idx_short_stride_bin_to_band < 2 * MDFT_FB_BANDS_240 ); /* array size of p_short_stride_bin_to_band */ + IF( short_mdft_start_bin == -1 ) + { + short_mdft_start_bin = j; + move16(); + pFb->fb_bin_to_band.p_short_stride_start_bin_per_band[i] = j; + move16(); + + pFb->fb_bin_to_band.pp_short_stride_bin_to_band_fx[i] = &pFb->fb_bin_to_band.p_short_stride_bin_to_band_fx[idx_short_stride_bin_to_band]; + index[i] = idx_short_stride_bin_to_band; + } + + pFb->fb_bin_to_band.p_short_stride_bin_to_band_fx[idx_short_stride_bin_to_band] = short_stride_pow_spec_fx[j]; + move32(); + idx_short_stride_bin_to_band++; + + pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[i]++; + } + } + } + + /*loop over CLDFB bands*/ + FOR( j = 0; j < pFb->fb_bin_to_band.num_cldfb_bands; j++ ) + { + Word32 sum_over_spar_bands_fx = 0; + move32(); + Word32 max_spar_band_contribution_fx = 0; + move32(); + + Word16 spar_start = 0; + move16(); + Word16 any_non_zero = 0; + move16(); + + FOR( i = 0; i < bands; i++ ) + { + sum_over_spar_bands_fx = L_add( sum_over_spar_bands_fx, pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] ); + move32(); + + IF( pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] > max_spar_band_contribution_fx ) + { + max_spar_band_contribution_fx = pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i]; + move32(); + pFb->fb_bin_to_band.p_cldfb_map_to_spar_band[j] = i; + move16(); + } + } + + sum_over_spar_bands_fx = max( sum_over_spar_bands_fx, EPSILON_FX ); + move32(); + + FOR( i = 0; i < bands; i++ ) + { + IF( pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] == 0 && !any_non_zero ) + { + spar_start++; + } + ELSE + { + any_non_zero = 1; + move16(); + } + + Word16 exp_diff = 0; + move16(); + Word16 tmp = BASOP_Util_Divide3232_Scale( pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i], sum_over_spar_bands_fx, &exp_diff ); + move16(); + pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[j][i] = L_shl( L_deposit_l( tmp ), add( Q7, exp_diff ) ); // Q22 + move32(); + } + pFb->fb_bin_to_band.p_spar_start_bands[j] = spar_start; + move16(); + } + + frame_len = (int16_t) ( sampling_rate / FRAMES_PER_SEC ); + + set_l( ppFilterbank_FRs_s_fx, 0, frame_len ); + + /*Commented logic is for calculating number of active bands, can be removed if not needed */ + FOR( i = 0; i < bands; i++ ) + { + const Word32 *pFilterbank_bin_to_band_re_fx = pFb->fb_consts.ppFilterbank_FRs_fx[0][i]; + move32(); + const Word32 *pFilterbank_bin_to_band_im_fx = pFb->fb_consts.ppFilterbank_FRs_fx[1][i]; + move32(); + + Word16 start_offset = pFb->fb_consts.pFilterbank_bins_start_offset[i]; + move16(); + Word16 num_bins = pFb->fb_consts.pFilterbank_bins_per_band[i]; + move16(); + Word16 idx = 0; + move16(); + Word16 abs_active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[i]; + move16(); + Word16 abs_start_offset = pFb->fb_bin_to_band.pFb_start_bin_per_band[i]; + move16(); + + FOR( j = start_offset; j < num_bins + start_offset; j++ ) + { + Word32 temp_fx = 0; + move32(); + + Word16 exp_diff = 0; + move16(); + Word32 real = L_shr( *pFilterbank_bin_to_band_re_fx, 3 ); // Q27 + move32(); + Word32 imag = L_shr( *pFilterbank_bin_to_band_im_fx, 3 ); + move32(); + + Word32 real_sq, imag_sq; + real_sq = Mpy_32_32( real, real ); + move32(); + imag_sq = Mpy_32_32( imag, imag ); + move32(); + + temp_fx = L_add( L_shr( real_sq, 1 ), L_shr( imag_sq, 1 ) ); // Q22 + move32(); - pFilterbank_bin_to_band_re++; - pFilterbank_bin_to_band_im++; + exp_diff = 9; + move16(); + temp_fx = Sqrt32( temp_fx, &exp_diff ); + move32(); + temp_fx = L_shl( temp_fx, sub( exp_diff, Q9 ) ); // Q22 + move32(); - temp -= 0.3f; - if ( temp < 0.0f ) + pFilterbank_bin_to_band_re_fx++; + pFilterbank_bin_to_band_im_fx++; + + temp_fx = L_sub( temp_fx, 1258291 ); + move32(); + + IF( temp_fx < 0 ) { - temp = 0; + temp_fx = 0; + move32(); } - if ( j < ( abs_active_bins + abs_start_offset ) && j >= abs_start_offset && alloc_fb_resp != -1 ) + IF( j < ( abs_active_bins + abs_start_offset ) && j >= abs_start_offset && alloc_fb_resp != -1 ) { -#ifdef IVAS_FLOAT_FIXED - pFb->fb_bin_to_band.pFb_bin_to_band[i][idx] = temp; - pFb->fb_bin_to_band.pFb_bin_to_band_fx[i][idx] = (Word32) ( temp * ONE_IN_Q22 ); + pFb->fb_bin_to_band.pFb_bin_to_band_fx[i][idx] = temp_fx; + move32(); idx = add( idx, 1 ); -#else - pFb->fb_bin_to_band.pFb_bin_to_band[i][idx++] = temp; -#endif } - ppFilterbank_FRs_s[j] += temp; -#ifdef IVAS_FLOAT_FIXED - ppFilterbank_FRs_s_fx[j] = L_add( ppFilterbank_FRs_s_fx[j], (Word32) ( temp * ONE_IN_Q22 ) ); -#endif + + ppFilterbank_FRs_s_fx[j] = L_add( ppFilterbank_FRs_s_fx[j], temp_fx ); + move32(); } } - for ( i = 0; i < frame_len; i++ ) + FOR( i = 0; i < frame_len; i++ ) { - if ( ppFilterbank_FRs_s[i] < 0.1f ) + IF( ppFilterbank_FRs_s_fx[i] < 0 ) { - ppFilterbank_FRs_s[i] = 0.1f; -#ifdef IVAS_FLOAT_FIXED - ppFilterbank_FRs_s_fx[i] = (Word32) ( 0.1f * ONE_IN_Q22 ); -#endif + ppFilterbank_FRs_s_fx[i] = 419430; } } - if ( alloc_fb_resp != -1 ) + IF( alloc_fb_resp != -1 ) { - for ( j = 0; j < bands; j++ ) + FOR( j = 0; j < bands; j++ ) { - int16_t abs_active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; - int16_t abs_start_offset = pFb->fb_bin_to_band.pFb_start_bin_per_band[j]; -#ifdef IVAS_FLOAT_FIXED + Word16 abs_active_bins = pFb->fb_bin_to_band.pFb_active_bins_per_band[j]; + Word16 abs_start_offset = pFb->fb_bin_to_band.pFb_start_bin_per_band[j]; Word16 exp_diff = 0, tmp; -#endif - for ( i = 0; i < abs_active_bins; i++ ) + FOR( i = 0; i < abs_active_bins; i++ ) { - pFb->fb_bin_to_band.pFb_bin_to_band[j][i] /= ppFilterbank_FRs_s[i + abs_start_offset]; -#ifdef IVAS_FLOAT_FIXED tmp = BASOP_Util_Divide3232_Scale( pFb->fb_bin_to_band.pFb_bin_to_band_fx[j][i], ppFilterbank_FRs_s_fx[i + abs_start_offset], &exp_diff ); pFb->fb_bin_to_band.pFb_bin_to_band_fx[j][i] = L_shl( L_deposit_l( tmp ), add( Q7, exp_diff ) ); // Q22 -#endif + move32(); /*if(pFb->fb_bin_to_band.pFb_bin_to_band[j][i] > 0.5f) { num_active_bands = j + 1; @@ -1021,7 +1891,7 @@ static int16_t ivas_calculate_abs_fr( return num_active_bands; } - +#endif /*-----------------------------------------------------------------------------------------* * Function ivas_get_active_bins() @@ -1222,6 +2092,195 @@ static ivas_error ivas_filterbank_setup( return error; } +#ifdef IVAS_FLOAT_FIXED +static ivas_error ivas_filterbank_setup_fx( + IVAS_FB_MIXER_HANDLE hFbMixer, + const int32_t sampling_rate, + Word16 *index ) +{ + Word16 i, j; + const Word32 *pAll_fb_fr_fx[2]; + const Word16 *pAll_bins_start_offset = NULL; + const Word16 *pAll_bins_per_band = NULL; + const Word16 *pAll_bins_start_offset_abs = NULL; + const Word16 *pAll_bins_per_band_abs = NULL; + const Word16 *pAll_bins_per_band_48k = NULL; + ivas_error error; + IVAS_FB_CFG *pCfg = hFbMixer->fb_cfg; + + error = IVAS_ERR_OK; + + IF( pCfg->num_out_chans > 0 ) + { + hFbMixer->pFb->filterbank_num_bands = ivas_get_num_bands( sampling_rate ); + + ivas_get_active_bins( &pAll_bins_per_band, &pAll_bins_per_band_abs, &pAll_bins_start_offset, &pAll_bins_start_offset_abs, sampling_rate ); + + IF( pCfg->fb_latency == NS2SA( sampling_rate, DELAY_FB_1_NS ) ) + { + pAll_fb_fr_fx[0] = ivas_fb_fr_12band_1ms_re_fx; // Q30 + move32(); + pAll_fb_fr_fx[1] = ivas_fb_fr_12band_1ms_im_fx; // Q30 + move32(); + + pAll_bins_per_band_48k = ivas_fb_bins_per_band_12band_1ms[0]; + move16(); + } + ELSE + { + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Wrong FB in ivas_filterbank_setup()!" ); + } + } + + hFbMixer->cross_fade_end_offset = pCfg->fade_len + pCfg->pcm_offset; + move16(); + hFbMixer->cross_fade_start_offset = hFbMixer->cross_fade_end_offset - pCfg->fade_len; + move16(); + hFbMixer->ana_window_offset = pCfg->fb_latency + pCfg->pcm_offset; + move16(); + + IF( ( error = ivas_fb_mixer_get_window_fx( pCfg->fb_latency, sampling_rate, &( hFbMixer->pAna_window_fx ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + IF( ( error = ivas_fb_mixer_get_window_fx( pCfg->fade_len, sampling_rate, &( hFbMixer->pFilterbank_cross_fade_fx ) ) ) != IVAS_ERR_OK ) + { + return error; + } + + IF( pCfg->num_out_chans > 0 ) + { + ivas_filterbank_t *pFb = hFbMixer->pFb; + Word16 offset = 0; + + pFb->fb_consts.pFilterbank_bins_per_band = pAll_bins_per_band; + pFb->fb_consts.pFilterbank_bins_start_offset = pAll_bins_start_offset; + pFb->fb_bin_to_band.pFb_active_bins_per_band = pAll_bins_per_band_abs; + pFb->fb_bin_to_band.pFb_start_bin_per_band = pAll_bins_start_offset_abs; + + /* Initialization for short stride Parameter calculation and SPAR CLDFB reconstruction */ + SWITCH( sampling_rate ) + { + case 48000: + pFb->fb_bin_to_band.num_cldfb_bands = 60; /* sampling_rate * 1.0f / 800.0f */ + move16(); + break; + case 32000: + pFb->fb_bin_to_band.num_cldfb_bands = 40; + move16(); + break; + case 16000: + pFb->fb_bin_to_band.num_cldfb_bands = 20; + move16(); + break; + } + + /*pFb->fb_bin_to_band.cldfb_stride = ( int16_t )( ( sampling_rate / FRAMES_PER_SEC ) / CLDFB_NO_COL_MAX );*/ /* equals num_cldfb_bands*/ + pFb->fb_bin_to_band.short_stride = extract_l( ( sampling_rate / FRAMES_PER_SEC ) / 4 ); + + set_l( pFb->fb_bin_to_band.p_short_stride_bin_to_band_fx, 0, 2 * MDFT_FB_BANDS_240 ); + + set_s( pFb->fb_bin_to_band.p_cldfb_map_to_spar_band, 0, CLDFB_NO_CHANNELS_MAX ); + set_s( pFb->fb_bin_to_band.p_spar_start_bands, 0, CLDFB_NO_CHANNELS_MAX ); + + FOR( j = 0; j < IVAS_MAX_NUM_FB_BANDS; j++ ) + { + pFb->fb_bin_to_band.p_short_stride_num_bins_per_band[j] = 0; /* aka num_active_bins per SPAR band */ + move16(); + pFb->fb_bin_to_band.p_short_stride_start_bin_per_band[j] = 0; /* first considered bin index per SPAR band */ + move16(); + + pFb->fb_bin_to_band.pp_short_stride_bin_to_band_fx[j] = NULL; + + FOR( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) + { + + pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[i][j] = 0; + move32(); + } + } + IF( sampling_rate == 48000 ) + { + FOR( j = 0; j < pFb->filterbank_num_bands; j++ ) + { + + pFb->fb_consts.ppFilterbank_FRs_fx[0][j] = &pAll_fb_fr_fx[0][offset]; + pFb->fb_consts.ppFilterbank_FRs_fx[1][j] = &pAll_fb_fr_fx[1][offset]; + + offset = add( offset, pFb->fb_consts.pFilterbank_bins_per_band[j] ); + } + + /****************************************Calculate abs fr ***************************/ + + ivas_calculate_abs_fr_fx( pFb, sampling_rate, pCfg->active_w_mixing, index ); + } + ELSE + { + + Word32 *ppFilterbank_FRs_re_temp_fx[MAX_NUM_BANDS_DIFF_NON48K]; + Word32 *ppFilterbank_FRs_im_temp_fx[MAX_NUM_BANDS_DIFF_NON48K]; + Word16 active_bins_temp[MAX_NUM_BANDS_DIFF_NON48K]; + Word16 start_offset_temp[MAX_NUM_BANDS_DIFF_NON48K]; + Word16 num_diff_bands, start_diff_band_non48k; + + num_diff_bands = MAX_NUM_BANDS_DIFF_NON48K; + start_diff_band_non48k = sub( pFb->filterbank_num_bands, num_diff_bands ); + move16(); + + pFb->fb_consts.pFilterbank_bins_per_band = pAll_bins_per_band; + pFb->fb_consts.pFilterbank_bins_start_offset = pAll_bins_start_offset; + + FOR( j = 0; j < pFb->filterbank_num_bands; j++ ) + { + Word16 num_active_bins = pFb->fb_consts.pFilterbank_bins_per_band[j]; + move16(); + + IF( j < start_diff_band_non48k ) + { + + pFb->fb_consts.ppFilterbank_FRs_fx[0][j] = &pAll_fb_fr_fx[0][offset]; + pFb->fb_consts.ppFilterbank_FRs_fx[1][j] = &pAll_fb_fr_fx[1][offset]; + } + ELSE + { + Copy32( &pAll_fb_fr_fx[0][offset], pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j], num_active_bins ); + Copy32( &pAll_fb_fr_fx[1][offset], pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j], num_active_bins ); + } + + offset = add( offset, pAll_bins_per_band_48k[j] ); + } + + FOR( j = start_diff_band_non48k; j < pFb->filterbank_num_bands; j++ ) + { + + ppFilterbank_FRs_re_temp_fx[j - start_diff_band_non48k] = pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j]; + ppFilterbank_FRs_im_temp_fx[j - start_diff_band_non48k] = pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j]; + + active_bins_temp[j - start_diff_band_non48k] = pFb->fb_consts.pFilterbank_bins_per_band[j]; + start_offset_temp[j - start_diff_band_non48k] = pFb->fb_consts.pFilterbank_bins_start_offset[j]; + } + + ivas_get_ld_fb_resp_fx( ppFilterbank_FRs_re_temp_fx, ppFilterbank_FRs_im_temp_fx, ppFilterbank_FRs_re_temp_fx, ppFilterbank_FRs_im_temp_fx, + active_bins_temp, start_offset_temp, num_diff_bands, pCfg->fb_latency, sampling_rate ); + + + FOR( j = start_diff_band_non48k; j < pFb->filterbank_num_bands; j++ ) + { + + pFb->fb_consts.ppFilterbank_FRs_fx[0][j] = (const Word32 *) pFb->fb_consts.ppFilterbank_FRs_non48k_fx[0][j]; + pFb->fb_consts.ppFilterbank_FRs_fx[1][j] = (const Word32 *) pFb->fb_consts.ppFilterbank_FRs_non48k_fx[1][j]; + } + + /******************************************** Calculate abs fr ****************************************************/ + + ivas_calculate_abs_fr_fx( pFb, sampling_rate, pCfg->active_w_mixing, index ); + } + } + + return error; +} +#endif /*-----------------------------------------------------------------------------------------* * Function ivas_fb_mixer_get_window() @@ -1356,6 +2415,28 @@ static const float *ivas_get_cheby_ramp( return pCheby; } +#ifdef IVAS_FLOAT_FIXED +static const Word32 *ivas_get_cheby_ramp_fx( + const Word16 delay ) +{ + const Word32 *pCheby_fx = NULL; + + SWITCH( delay ) + { + case IVAS_FB_1MS_32K_SAMP: + pCheby_fx = ivas_fb_resp_cheby_ramp_32del_fx; + break; + case IVAS_FB_1MS_16K_SAMP: + pCheby_fx = ivas_fb_resp_cheby_ramp_16del_fx; + break; + default: + assert( !"Unsupported cheby ramp length!" ); + } + + return pCheby_fx; +} +#endif + /*get first half of the hanning window*/ static void ivas_get_hanning_win( @@ -1488,3 +2569,174 @@ static void ivas_get_ld_fb_resp( return; } + +#ifdef IVAS_FLOAT_FIXED +static void ivas_get_ld_fb_resp_fx( + Word32 **ppIdeal_FRs_re_fx, + Word32 **ppIdeal_FRs_im_fx, + Word32 **ppNew_FRs_re_fx, + Word32 **ppNew_FRs_im_fx, + const Word16 *pActive_bins, + const Word16 *pStart_offset, + const Word16 num_bands, + const Word16 delay, + const Word32 sampling_rate ) +{ + Word16 b, s, frame_len; + const Word32 *pCheby_fx; + frame_len = 0; + /*common scratch buffers for computing impulse/frequency responses, + pre-ring, post-ring and circular shifted outputs to optimize stack*/ + Word32 scratch1_fx[L_FRAME32k * 2]; + Word32 scratch2_fx[L_FRAME32k * 2]; + + set32_fx(scratch1_fx,0,L_FRAME32k*2); + set32_fx(scratch2_fx,0,L_FRAME32k*2); + + const Word32 *han_win_fx = NULL; + + SWITCH( sampling_rate ) + { + case 48000: + frame_len = 960; + han_win_fx = ivas_han_win_48k_fx; // Q31 + break; + case 32000: + frame_len = 640; + han_win_fx = ivas_han_win_32k_fx; // Q31 + break; + case 16000: + frame_len = 320; + han_win_fx = ivas_han_win_16k_fx; // Q31 + break; + } + + pCheby_fx = ivas_get_cheby_ramp_fx( delay ); // Q31 + + b = 0; + s = 0; + + assert( sampling_rate == 32000 || sampling_rate == 16000 ); + + FOR( b = 0; b < num_bands; b++ ) + { + + set32_fx( scratch2_fx, 0, shl( frame_len, 1 ) ); + Copy32( ppIdeal_FRs_re_fx[b], &scratch2_fx[pStart_offset[b]], pActive_bins[b] ); + Copy32( ppIdeal_FRs_im_fx[b], &scratch2_fx[frame_len + pStart_offset[b]], pActive_bins[b] ); // Q30 + + Word16 guard_bits = L_norm_arr( scratch2_fx, shl( L_FRAME32k, 1 ) ) - find_guarded_bits_fx( shl( frame_len, 1 ) ); + Scale_sig32( scratch2_fx, shl( L_FRAME32k, 1 ), guard_bits ); + + ivas_imdft_fx( scratch2_fx, &scratch2_fx[frame_len], scratch1_fx, frame_len ); + + FOR( Word16 x = 0; x < shl( L_FRAME32k, 1 ); x++ ) + { + scratch2_fx[x] = L_shr( scratch2_fx[x], guard_bits ); + scratch1_fx[x] = L_shr( scratch1_fx[x], guard_bits ); + } + + /*apply circular shift and hanning window*/ + + FOR( s = delay; s < frame_len + delay; s++ ) + { + + scratch2_fx[sub( s, delay )] = Mpy_32_32( scratch1_fx[s], L_sub( ONE_IN_Q31, han_win_fx[sub( s, delay )] ) ); // Q(30 + 31 - 31) == Q30 + } + + FOR( ; s < 2 * frame_len; s++ ) + { + + scratch2_fx[sub( s, delay )] = Mpy_32_32( scratch1_fx[s], han_win_fx[sub( s, add( frame_len, delay ) )] ); // Q30 + } + + FOR( s = 0; s < delay; s++ ) + { + + scratch2_fx[add( sub( shl( frame_len, 1 ), delay ), s )] = L_negate( Mpy_32_32( scratch1_fx[s], han_win_fx[add( sub( frame_len, delay ), s )] ) ); // Q30 + } + + /*apply heavy/cheby ramp window and compute pre ring*/ + + FOR( s = 0; s < delay + 1; s++ ) + { + scratch1_fx[s] = Mpy_32_32( scratch2_fx[s], pCheby_fx[sub( delay, s )] ); // Q30 + } + + FOR( ; s < frame_len; s++ ) + { + scratch1_fx[s] = 0; + move32(); + } + + FOR( ; s < 2 * frame_len - delay; s++ ) + { + scratch1_fx[s] = scratch2_fx[s]; + } + + FOR( ; s < 2 * frame_len; s++ ) + { + scratch1_fx[s] = Mpy_32_32( scratch2_fx[s], L_sub( ONE_IN_Q31, pCheby_fx[sub( s, sub( shl( frame_len, 1 ), delay ) )] ) ); // Q30 + } + + /*IR - pre ring + post ring*/ + FOR( s = 1; s < 2 * frame_len; s++ ) + { + scratch2_fx[s] = L_sub( L_sub( scratch2_fx[s] /*pre ring*/, scratch1_fx[s] /*post ring*/ ), scratch1_fx[sub( shl( frame_len, 1 ), s )] ); + } + + FOR( s = 0; s < 2 * frame_len - delay; s++ ) + { + scratch1_fx[add( s, delay )] = scratch2_fx[s]; + } + + FOR( ; s < 2 * frame_len; s++ ) + { + scratch1_fx[sub( s, sub( shl( frame_len, 1 ), delay ) )] = L_negate( scratch2_fx[s] ); + } + + /* apply final window*/ + const Word32 *sine_till_delay = ivas_sine_delay_32_fx; + Word16 offset = 1; + Word16 delay_16 = 0; + + IF( delay == IVAS_FB_1MS_16K_SAMP ) + { + delay_16 = 1; + } + + FOR( s = 0; s < delay; s++ ) + { + scratch1_fx[s] = Mpy_32_32( scratch1_fx[s], sine_till_delay[s + ( offset * delay_16 )] ); + offset = add( offset, 1 ); + scratch1_fx[s] = L_shl( scratch1_fx[s], 1 ); // Q30 + } + + const Word32 *sine_till_frame_len = ivas_sine_frame_len_640_fx; // Q30 + offset = 1; + Word16 iterator = 0; + FOR( s = 2 * delay; s < frame_len + 1; s++ ) + { + scratch1_fx[s] = Mpy_32_32( scratch1_fx[s], sine_till_frame_len[iterator + ( offset * delay_16 )] ); + offset = add( offset, 1 ); + iterator = add( iterator, 1 ); + scratch1_fx[s] = L_shl( scratch1_fx[s], 1 ); // Q30 + + // assert(fabs(scratch1[s]) - fabs(fix_to_float(scratc h1_fx[s], 30)) < 0.00001); + } + + FOR( ; s < 2 * frame_len; s++ ) + { + scratch1_fx[s] = 0; + } + + /*compute frequency response*/ + ivas_mdft_fx( scratch1_fx, scratch2_fx, &scratch2_fx[frame_len], shl( frame_len, 1 ), frame_len ); + + Copy32( &scratch2_fx[pStart_offset[b]], ppNew_FRs_re_fx[b], pActive_bins[b] ); + Copy32( &scratch2_fx[add( frame_len, pStart_offset[b] )], ppNew_FRs_im_fx[b], pActive_bins[b] ); + } + + return; +} +#endif diff --git a/lib_com/ivas_prot_fx.h b/lib_com/ivas_prot_fx.h index 0066805b9f56788bea9d1867b1a3af375505b714..77ac23f556a067457077923684088a7806bce73c 100644 --- a/lib_com/ivas_prot_fx.h +++ b/lib_com/ivas_prot_fx.h @@ -2225,4 +2225,21 @@ void ivas_lfe_window_init_fx( Word16 param_mc_get_num_cldfb_syntheses_fx( Decoder_Struct *st_ivas /* i : Parametric MC handle */ ); + +ivas_error ivas_FB_mixer_open_fx( + IVAS_FB_MIXER_HANDLE *hFbMixer_out, /* i/o: FB mixer handle */ + const Word32 sampling_rate, /* i : sampling rate */ + IVAS_FB_CFG *fb_cfg, /* i : FB config. handle */ + const Word16 spar_reconfig_flag /* i : SPAR reconfiguration flag */ +); + +void ivas_fb_mixer_cross_fading_fx( + IVAS_FB_MIXER_HANDLE hFbMixer, + Word32 **ppOut_pcm_fx, + Word32 *pMdft_out_old_fx, + Word32 *pMdft_out_new_fx, + const int16_t ch, + const int16_t frame_len, + const int16_t cf_offset ); + #endif diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c index 9fb0c9c6e219f7cd598f119d5ac5b65f68cf5b50..f8db53655c953bbb2f5937d27dd507d967538f12 100644 --- a/lib_com/ivas_rom_com.c +++ b/lib_com/ivas_rom_com.c @@ -7621,6 +7621,22 @@ const float ivas_fb_resp_cheby_ramp_16del[IVAS_FB_1MS_16K_SAMP + 1] = 0.500000000000000f }; +#ifdef IVAS_FLOAT_FIXED +/* Q Factor is 31*/ +const Word32 ivas_fb_resp_cheby_ramp_32del_fx[IVAS_FB_1MS_32K_SAMP + 1] = { + 21970992, 16097417, 21859084, 28772960, 36989692, 46636088, 57839904, 70755400, 85490472, + 102165872, 120908192, 141807584, 164922576, 190321136, 218072144, 248214064, 280795872, + 315834176, 353276992, 393021664, 435109696, 479474528, 525959424, 574472512, 624859584, + 676981248, 730657728, 785668096, 841854208, 899002688, 956860544, 1015180800, 1073741824, +}; + +/* Q Factor is 31*/ +const Word32 ivas_fb_resp_cheby_ramp_16del_fx[IVAS_FB_1MS_16K_SAMP + 1] = { + 23460896, 29872362, 47814248, 71691184, 102337872, 140498880, 186843680, 241748256, 305433120, + 377921280, 458893152, 547769792, 643727232, 745668672, 852315136, 962208832, 1073741824, +}; +#endif + const int16_t ivas_num_active_bands[FB - WB + 1] = { IVAS_16K_12BANDS_ACTIVE_BANDS, IVAS_FB_BANDS_12, IVAS_FB_BANDS_12 @@ -9156,3 +9172,1360 @@ const Word32 one_by_q_level[64] = 35204648, 34636832, 34087044 }; /* clang-format on */ + +#ifdef IVAS_FLOAT_FIXED + +/* Q Factor is 31*/ +const Word32 ivas_han_win_48k_fx[L_FRAME32k] = { + 5760, 22976, 51712, 91904, 143552, 206784, 281408, 367552, 465216, + 574272, 694912, 826944, 970496, 1125504, 1292032, 1470016, 1659456, + 1860352, 2072704, 2296576, 2531904, 2778624, 3036864, 3306560, 3587648, + 3880256, 4184256, 4499712, 4826624, 5164992, 5514752, 5875968, 6248576, + 6632640, 7028096, 7434944, 7853248, 8282880, 8723968, 9176448, 9640320, + 10115584, 10602176, 11100224, 11609536, 12130304, 12662400, 13205824, 13760576, + 14326720, 14904192, 15492928, 16093056, 16704512, 17327232, 17961216, 18606592, + 19263168, 19931072, 20610240, 21300672, 22002368, 22715328, 23439488, 24174912, + 24921600, 25679424, 26448512, 27228800, 28020288, 28822976, 29636864, 30461888, + 31298048, 32145344, 33003840, 33873472, 34754176, 35646016, 36548992, 37463040, + 38388224, 39324416, 40271680, 41230016, 42199424, 43179840, 44171264, 45173696, + 46187200, 47211648, 48247104, 49293504, 50350848, 51419200, 52498432, 53588608, + 54689664, 55801664, 56924544, 58058304, 59202944, 60358400, 61524736, 62701888, + 63889856, 65088640, 66298176, 67518528, 68749632, 69991488, 71244096, 72507392, + 73781440, 75066176, 76361536, 77667648, 78984384, 80311744, 81649728, 82998400, + 84357568, 85727424, 87107776, 88498688, 89900160, 91312128, 92734656, 94167680, + 95611136, 97065088, 98529472, 100004288, 101489536, 102985152, 104491200, 106007552, + 107534336, 109071424, 110618816, 112176512, 113744512, 115322816, 116911296, 118510080, + 120119040, 121738240, 123367552, 125007104, 126656768, 128316608, 129986496, 131666496, + 133356608, 135056768, 136766976, 138487232, 140217408, 141957632, 143707840, 145467968, + 147238016, 149017984, 150807872, 152607616, 154417216, 156236672, 158065920, 159904960, + 161753728, 163612352, 165480640, 167358720, 169246464, 171143808, 173050880, 174967552, + 176893888, 178829760, 180775296, 182730304, 184694848, 186668928, 188652480, 190645504, + 192648000, 194659904, 196681216, 198711936, 200752000, 202801344, 204860032, 206928064, + 209005376, 211091904, 213187648, 215292672, 217406784, 219530048, 221662528, 223804096, + 225954752, 228114496, 230283264, 232461056, 234647872, 236843584, 239048320, 241262016, + 243484544, 245716032, 247956288, 250205440, 252463424, 254730112, 257005632, 259289856, + 261582784, 263884416, 266194688, 268513664, 270841216, 273177344, 275522048, 277875264, + 280237056, 282607296, 284986048, 287373184, 289768768, 292172672, 294584960, 297005632, + 299434560, 301871808, 304317312, 306771072, 309233024, 311703040, 314181312, 316667712, + 319162240, 321664832, 324175424, 326694080, 329220672, 331755200, 334297728, 336848192, + 339406528, 341972672, 344546688, 347128448, 349718080, 352315328, 354920384, 357533120, + 360153536, 362781568, 365417152, 368060352, 370711168, 373369408, 376035200, 378708416, + 381389120, 384077120, 386772608, 389475456, 392185536, 394902976, 397627648, 400359552, + 403098624, 405844928, 408598400, 411358976, 414126592, 416901312, 419683008, 422471680, + 425267392, 428070016, 430879552, 433695936, 436519232, 439349312, 442186112, 445029696, + 447880064, 450737088, 453600832, 456471168, 459348160, 462231616, 465121600, 468018176, + 470921280, 473830784, 476746688, 479668928, 482597632, 485532608, 488473856, 491421376, + 494375168, 497335168, 500301184, 503273472, 506251840, 509236288, 512226752, 515223296, + 518225728, 521234048, 524248320, 527268608, 530294592, 533326528, 536364096, 539407552, + 542456576, 545511296, 548571712, 551637888, 554709440, 557786624, 560869376, 563957504, + 567051264, 570150272, 573254656, 576364544, 579479616, 582600064, 585725696, 588856704, + 591992704, 595134080, 598280256, 601431680, 604588160, 607749632, 610916224, 614087680, + 617264128, 620445312, 623631488, 626822336, 630017984, 633218496, 636423616, 639633408, + 642847872, 646067008, 649290624, 652518784, 655751552, 658988672, 662230400, 665476352, + 668726784, 671981504, 675240576, 678503808, 681771264, 685042944, 688318784, 691598848, + 694882880, 698171072, 701463168, 704759296, 708059392, 711363328, 714671296, 717982976, + 721298560, 724617728, 727940864, 731267392, 734597760, 737931776, 741269376, 744610624, + 747955200, 751303488, 754655040, 758009984, 761368512, 764730240, 768095360, 771463616, + 774835200, 778209792, 781587840, 784968832, 788352896, 791740160, 795130304, 798523584, + 801919616, 805318784, 808720640, 812125312, 815532928, 818943168, 822356288, 825771840, + 829190272, 832611200, 836034816, 839460928, 842889472, 846320640, 849754112, 853190080, + 856628352, 860068992, 863511808, 866957056, 870404352, 873853696, 877305408, 880759104, + 884215040, 887672832, 891132736, 894594496, 898058112, 901523840, 904991232, 908460544, + 911931456, 915404288, 918878528, 922354560, 925832384, 929311616, 932792512, 936274816, + 939758720, 943243904, 946730624, 950218560, 953707840, 957198528, 960690368, 964183488, + 967677568, 971172992, 974669440, 978166912, 981665536, 985164992, 988665600, 992166912, + 995669248, 999172288, 1002676288, 1006180864, 1009686208, 1013192384, 1016698880, 1020206336, + 1023714176, 1027222656, 1030731584, 1034241024, 1037750784, 1041260928, 1044771584, 1048282368, + 1051793600, 1055304896, 1058816512, 1062328192, 1065839872, 1069351872, 1072863808, 1076375808, + 1079887744, 1083399680, 1086911488, 1090423168, 1093934592, 1097445760, 1100956928, 1104467584, + 1107977984, 1111488000, 1114997504, 1118506624, 1122015232, 1125523456, 1129031040, 1132538112, + 1136044544, 1139550336, 1143055360, 1146559616, 1150063104, 1153565696, 1157067648, 1160568576, + 1164068480, 1167567488, 1171065600, 1174562560, 1178058496, 1181553408, 1185046912, 1188539520, + 1192030720, 1195520768, 1199009408, 1202496768, 1205982720, 1209467008, 1212950144, 1216431744, + 1219911936, 1223390336, 1226867328, 1230342528, 1233816192, 1237288064, 1240758144, 1244226560, + 1247693056, 1251157760, 1254620416, 1258081152, 1261539968, 1264996864, 1268451712, 1271904384, + 1275355008, 1278803456, 1282249728, 1285693696, 1289135488, 1292574848, 1296011904, 1299446784, + 1302878976, 1306308736, 1309736064, 1313160960, 1316583296, 1320002944, 1323420032, 1326834304, + 1330246144, 1333655040, 1337061120, 1340464512, 1343865088, 1347262592, 1350657152, 1354048768, + 1357437440, 1360823168, 1364205824, 1367585280, 1370961664, 1374334720, 1377704704, 1381071360, + 1384434816, 1387794944, 1391151616, 1394504960, 1397854976, 1401201152, 1404544000, 1407883520, + 1411219328, 1414551552, 1417880064, 1421204992, 1424526080, 1427843456, 1431157120, 1434466944, + 1437772928, 1441074944, 1444373120, 1447667072, 1450957312, 1454243328, 1457525248, 1460803328, + 1464077056, 1467346688, 1470612096, 1473873408, 1477130240, 1480382848, 1483630976, 1486874752, + 1490114048, 1493348992, 1496579584, 1499805440, 1503026944, 1506243584, 1509455744, 1512663296, + 1515866112, 1519064192, 1522257536, 1525446144, 1528629760, 1531808512, 1534982272, 1538151296, + 1541315328, 1544474368, 1547628288, 1550777216, 1553921024, 1557059840, 1560193152, 1563321472, + 1566444672, 1569562240, 1572674816, 1575782016, 1578883584, 1581980032, 1585070848, 1588156416, + 1591236352, 1594310912, 1597379584, 1600442880, 1603500544, 1606552576, 1609598592 +}; + +/* Q Factor is 31*/ +const Word32 ivas_han_win_32k_fx[L_FRAME32k] = { + 12928, 51648, 116224, 206656, 322880, 464960, 632832, 826496, 1046016, + 1291328, 1562496, 1859392, 2182080, 2530560, 2904832, 3304832, 3730560, + 4182080, 4659328, 5162304, 5690944, 6245312, 6825344, 7431104, 8062464, + 8719488, 9402112, 10110336, 10844160, 11603520, 12388480, 13198976, 14034944, + 14896448, 15783424, 16695808, 17633664, 18596928, 19585536, 20599552, 21638912, + 22703552, 23793472, 24908672, 26049088, 27214720, 28405504, 29621504, 30862592, + 32128704, 33419968, 34736192, 36077440, 37443712, 38834816, 40250880, 41691776, + 43157504, 44648064, 46163328, 47703360, 49268032, 50857408, 52471296, 54109824, + 55772928, 57460416, 59172416, 60908800, 62669568, 64454656, 66264064, 68097664, + 69955456, 71837440, 73743488, 75673600, 77627712, 79605824, 81607808, 83633664, + 85683392, 87756864, 89854080, 91974912, 94119360, 96287424, 98478976, 100694016, + 102932416, 105194240, 107479296, 109787648, 112119232, 114473856, 116851584, 119252352, + 121676096, 124122688, 126592192, 129084480, 131599488, 134137088, 136697408, 139280192, + 141885440, 144513152, 147163264, 149835584, 152530176, 155246848, 157985728, 160746560, + 163529408, 166334144, 169160704, 172009024, 174879040, 177770752, 180683904, 183618624, + 186574720, 189552128, 192550848, 195570752, 198611840, 201673920, 204756992, 207860992, + 210985792, 214131392, 217297600, 220484480, 223691840, 226919680, 230167936, 233436416, + 236725120, 240033984, 243362880, 246711744, 250080512, 253469120, 256877440, 260305472, + 263753024, 267220096, 270706496, 274212288, 277737280, 281281408, 284844672, 288426880, + 292027904, 295647808, 299286464, 302943744, 306619456, 310313728, 314026368, 317757248, + 321506304, 325273472, 329058688, 332861760, 336682688, 340521408, 344377664, 348251520, + 352142784, 356051456, 359977344, 363920448, 367880640, 371857792, 375851840, 379862656, + 383890112, 387934272, 391994880, 396071936, 400165248, 404274816, 408400384, 412542016, + 416699584, 420872960, 425062016, 429266688, 433486912, 437722368, 441973248, 446239360, + 450520576, 454816704, 459127808, 463453696, 467794112, 472149248, 476518784, 480902784, + 485300992, 489713344, 494139840, 498580032, 503034304, 507502208, 511983808, 516478848, + 520987392, 525509120, 530044032, 534592000, 539153088, 543726912, 548313600, 552912832, + 557524608, 562148736, 566785408, 571434048, 576094784, 580767616, 585452224, 590148608, + 594856576, 599576192, 604307072, 609049344, 613802752, 618567296, 623342592, 628128896, + 632925888, 637733504, 642551552, 647380096, 652218752, 657067648, 661926400, 666795264, + 671673856, 676562176, 681459968, 686367232, 691283648, 696209536, 701144320, 706088192, + 711040768, 716002176, 720972224, 725950656, 730937472, 735932480, 740935808, 745947008, + 750966144, 755992960, 761027456, 766069504, 771118976, 776175680, 781239680, 786310528, + 791388416, 796472896, 801564288, 806662080, 811766400, 816876928, 821993792, 827116544, + 832245248, 837379776, 842520064, 847665856, 852817152, 857973696, 863135424, 868302208, + 873474048, 878650560, 883831808, 889017728, 894207936, 899402624, 904601216, 909804160, + 915010944, 920221696, 925435904, 930653952, 935875200, 941099776, 946327616, 951558592, + 956792384, 962029120, 967268416, 972510272, 977754624, 983001344, 988250112, 993501120, + 998753856, 1004008576, 1009264704, 1014522624, 1019781888, 1025042560, 1030304256, 1035566976, + 1040830784, 1046095232, 1051360384, 1056626048, 1061892224, 1067158592, 1072425280, 1077691776, + 1082958208, 1088224512, 1093490560, 1098755968, 1104020736, 1109284864, 1114548224, 1119810432, + 1125071616, 1130331520, 1135590272, 1140847232, 1146102912, 1151356544, 1156608512, 1161858304, + 1167106048, 1172351616, 1177594624, 1182835200, 1188073344, 1193308544, 1198541056, 1203770368, + 1208996736, 1214219648, 1219439232, 1224655488, 1229867904, 1235076736, 1240281472, 1245482240, + 1250679040, 1255871360, 1261059456, 1266243072, 1271421952, 1276596224, 1281765504, 1286929920, + 1292089088, 1297243008, 1302391552, 1307534592, 1312672000, 1317803520, 1322929280, 1328049152, + 1333162752, 1338270336, 1343371264, 1348465920, 1353553920, 1358635264, 1363709568, 1368776960, + 1373837312, 1378890496, 1383936256, 1388974336, 1394004992, 1399028224, 1404043264, 1409050496, + 1414049792, 1419040640, 1424023424, 1428997632, 1433963392, 1438920448, 1443868672, 1448808064, + 1453738496, 1458659328, 1463571328, 1468473856, 1473366912, 1478250240, 1483124096, 1487987968, + 1492841856, 1497685632, 1502519296, 1507342592, 1512155392, 1516957696, 1521749504, 1526530176, + 1531299968, 1536059008, 1540806912, 1545543424, 1550268672, 1554982528, 1559684864, 1564375168, + 1569053952, 1573720832, 1578375680, 1583018240, 1587648640, 1592266496, 1596872192, 1601464960, + 1606045312, 1610612736, 1615167488, 1619708672, 1624237184, 1628752384, 1633254272, 1637742464, + 1642217216, 1646678400, 1651125504, 1655558784, 1659978240, 1664383616, 1668774784, 1673151488, + 1677513856, 1681861760, 1686194816, 1690513408, 1694817024, 1699105792, 1703379200, 1707637760, + 1711880960, 1716108800, 1720321152, 1724518144, 1728699392, 1732865024, 1737014400, 1741148160, + 1745265792, 1749367296, 1753452288, 1757521152, 1761573632, 1765609344, 1769628416, 1773630976, + 1777616640, 1781585408, 1785536768, 1789471488, 1793388800, 1797288832, 1801171328, 1805036544, + 1808883968, 1812713728, 1816525824, 1820320000, 1824096000, 1827854208, 1831594112, 1835315968, + 1839019520, 1842704384, 1846370944, 1850018944, 1853648256, 1857258624, 1860850432, 1864423168, + 1867976960, 1871511296, 1875026688, 1878522880, 1881999616, 1885456896, 1888894720, 1892312832, + 1895711488, 1899089920, 1902448896, 1905787904, 1909106688, 1912405504, 1915684096, 1918942592, + 1922180480, 1925398016, 1928595200, 1931771904, 1934927616, 1938062848, 1941177344, 1944270848, + 1947343360, 1950395136, 1953425664, 1956434944, 1959422976, 1962389632, 1965335040, 1968259072, + 1971161344, 1974042368, 1976901504, 1979739008, 1982554624, 1985348352, 1988120320, 1990870272, + 1993597952, 1996303616, 1998987264, 2001648384, 2004287104, 2006903552, 2009497728, 2012069376, + 2014618112, 2017144576, 2019648256, 2022129024, 2024587136, 2027022336, 2029434624, 2031823872, + 2034190080, 2036533120, 2038853120, 2041149696, 2043423232, 2045673344, 2047900160, 2050103296, + 2052283136, 2054439552, 2056572160, 2058681216, 2060766464, 2062828160, 2064865920, 2066879744, + 2068869888, 2070835968, 2072778240, 2074696192, 2076590336, 2078460160, 2080305792, 2082127360, + 2083924608, 2085697536, 2087446016, 2089170304, 2090870144, 2092545280, 2094196096, 2095822336, + 2097424128, 2099001088, 2100553472, 2102081024, 2103584000, 2105062144, 2106515456, 2107943936, + 2109347584, 2110726272, 2112080000, 2113408768, 2114712448, 2115991168, 2117244672, 2118473216, + 2119676672, 2120854912, 2122007936, 2123135744, 2124238336, 2125315584, 2126367616, 2127394304, + 2128395520, 2129371648, 2130322048, 2131247232, 2132146944, 2133021184, 2133869824, 2134693120, + 2135490816, 2136263040, 2137009664, 2137730688, 2138426112, 2139095936, 2139740160, 2140358656, + 2140951552, 2141518720, 2142060288, 2142576128, 2143066112, 2143530496, 2143969152, 2144382080, + 2144769280, 2145130496, 2145466112, 2145775872, 2146060032, 2146318208, 2146550528, 2146757120, + 2146937984, 2147092992, 2147222016, 2147325440, 2147403008, 2147454592, 2147480448 +}; + +/* Q Factor is 31*/ +const Word32 ivas_han_win_16k_fx[L_FRAME32k] = { + 51584, 206336, 464192, 825216, 1289344, 1856512, 2526592, 3299648, 4175552, + 5154240, 6235584, 7419520, 8705856, 10094592, 11585472, 13178432, 14873280, + 16669824, 18568000, 20567552, 22668288, 24869952, 27172480, 29575488, 32078848, + 34682304, 37385600, 40188480, 43090624, 46091840, 49191808, 52390144, 55686656, + 59081024, 62572800, 66161792, 69847552, 73629824, 77508160, 81482176, 85551552, + 89715904, 93974784, 98327808, 102774528, 107314560, 111947456, 116672768, 121490048, + 126398720, 131398528, 136488832, 141669184, 146939136, 152298048, 157745600, 163281088, + 168904064, 174614016, 180410304, 186292480, 192259904, 198312000, 204448256, 210667968, + 216970688, 223355584, 229822336, 236370112, 242998400, 249706432, 256493632, 263359424, + 270303040, 277323904, 284421184, 291594368, 298842688, 306165440, 313562048, 321031552, + 328573440, 336186944, 343871360, 351625792, 359449600, 367342144, 375302528, 383329984, + 391423744, 399583168, 407807232, 416095424, 424446720, 432860480, 441335680, 449871744, + 458467776, 467122752, 475836160, 484606976, 493434496, 502317568, 511255744, 520247936, + 529293184, 538390784, 547539840, 556739456, 565988800, 575286848, 584632832, 594025792, + 603464960, 612949248, 622477568, 632049536, 641663872, 651319808, 661016192, 670752128, + 680527040, 690339584, 700189056, 710074240, 719994624, 729948800, 739936128, 749955328, + 760005760, 770086400, 780196224, 790334336, 800499328, 810690816, 820907648, 831148608, + 841412992, 851699584, 862007680, 872335936, 882683648, 893049664, 903433024, 913832832, + 924248064, 934677504, 945120256, 955575552, 966042176, 976519040, 987005248, 997499904, + 1008001792, 1018510080, 1029023552, 1039541440, 1050062528, 1060585984, 1071110720, 1081635456, + 1092159616, 1102681984, 1113201664, 1123717504, 1134228480, 1144733696, 1155232256, 1165722752, + 1176204288, 1186676224, 1197137280, 1207586432, 1218022656, 1228445184, 1238852864, 1249244416, + 1259619328, 1269976192, 1280314368, 1290632832, 1300930304, 1311205888, 1321458432, 1331687552, + 1341891840, 1352070400, 1362221952, 1372346112, 1382441472, 1392506880, 1402541952, 1412545280, + 1422516224, 1432453632, 1442356608, 1452224000, 1462054912, 1471848832, 1481604480, 1491320832, + 1500997120, 1510632320, 1520225536, 1529775744, 1539282176, 1548744192, 1558160256, 1567529728, + 1576852096, 1586125824, 1595350272, 1604524800, 1613648128, 1622719872, 1631738624, 1640703744, + 1649614592, 1658469888, 1667269376, 1676011520, 1684695808, 1693321472, 1701887616, 1710393344, + 1718837760, 1727220480, 1735540352, 1743796480, 1751988480, 1760115200, 1768175616, 1776169856, + 1784096256, 1791954688, 1799744000, 1807463424, 1815112576, 1822690048, 1830195968, 1837629184, + 1844988928, 1852274688, 1859485440, 1866620672, 1873679872, 1880662016, 1887566976, 1894393600, + 1901141248, 1907809536, 1914397696, 1920904960, 1927330816, 1933674624, 1939936000, 1946114048, + 1952208256, 1958218240, 1964142848, 1969982336, 1975735552, 1981401984, 1986981376, 1992472832, + 1997876224, 2003190656, 2008415744, 2013551360, 2018596352, 2023550720, 2028413824, 2033185152, + 2037864192, 2042450688, 2046944256, 2051344128, 2055650048, 2059861888, 2063978752, 2068000512, + 2071926784, 2075757056, 2079491072, 2083128576, 2086668928, 2090112128, 2093457408, 2096705024, + 2099854080, 2102904832, 2105856512, 2108709120, 2111462144, 2114115584, 2116668928, 2119122176, + 2121475072, 2123727104, 2125878528, 2127928576, 2129877504, 2131724800, 2133470464, 2135114496, + 2136656384, 2138096128, 2139433728, 2140668928, 2141801472, 2142831616, 2143758848, 2144583424, + 2145304960, 2145923584, 2146439168, 2146851840, 2147161344, 2147367680, 2147470848, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0 +}; + +/* Q Factor is 30 */ +const Word32 ivas_sine_delay_32_fx[32] = { + 52686016, 105245104, 157550640, 209476640, 260898000, 311690784, 361732736, 410903232, 459083776, + 506158400, 552013632, 596539008, 639627264, 681174656, 721080960, 759250112, 795590272, + 830013632, 862437504, 892783744, 920979136, 946955776, 970651136, 992008064, 1010975232, + 1027506880, 1041563136, 1053110208, 1062120192, 1068571456, 1072448448, 1073741824 +}; + +/* Q Factor is 30 */ +const Word32 ivas_sine_frame_len_640_fx[577] = { + 1073737856, + 1073725888, 1073705984, 1073678144, 1073642368, 1073598592, 1073546880, 1073487168, 1073419584, + 1073343936, 1073260416, 1073168896, 1073069440, 1072962048, 1072846720, 1072723392, 1072592128, + 1072452928, 1072305792, 1072150656, 1071987648, 1071816640, 1071637696, 1071450816, 1071256000, + 1071053248, 1070842560, 1070623936, 1070397312, 1070162880, 1069920448, 1069670080, 1069411776, + 1069145536, 1068871424, 1068589376, 1068299392, 1068001472, 1067695680, 1067381952, 1067060288, + 1066730752, 1066393344, 1066047936, 1065694720, 1065333568, 1064964544, 1064587584, 1064202752, + 1063810048, 1063409472, 1063000960, 1062584576, 1062160384, 1061728256, 1061288320, 1060840448, + 1060384768, 1059921216, 1059449792, 1058970496, 1058483392, 1057988416, 1057485632, 1056974976, + 1056456512, 1055930240, 1055396096, 1054854144, 1054304384, 1053746816, 1053181440, 1052608256, + 1052027200, 1051438400, 1050841856, 1050237504, 1049625280, 1049005376, 1048377664, 1047742144, + 1047098944, 1046447936, 1045789184, 1045122624, 1044448384, 1043766400, 1043076672, 1042379200, + 1041674048, 1040961088, 1040240512, 1039512192, 1038776128, 1038032384, 1037280960, 1036521856, + 1035755008, 1034980544, 1034198464, 1033408640, 1032611200, 1031806016, 1030993280, 1030172864, + 1029344768, 1028509120, 1027665856, 1026814912, 1025956416, 1025090240, 1024216576, 1023335232, + 1022446400, 1021549888, 1020645824, 1019734208, 1018815104, 1017888384, 1016954112, 1016012288, + 1015062912, 1014106112, 1013141760, 1012169856, 1011190464, 1010203584, 1009209280, 1008207424, + 1007198144, 1006181376, 1005157120, 1004125440, 1003086336, 1002039744, 1000985792, 999924352, + 998855552, 997779328, 996695744, 995604736, 994506368, 993400640, 992287552, 991167104, + 990039296, 988904128, 987761664, 986611904, 985454784, 984290304, 983118592, 981939648, + 980753408, 979559872, 978359104, 977151040, 975935744, 974713216, 973483456, 972246528, + 971002304, 969750976, 968492480, 967226688, 965953792, 964673728, 963386496, 962092288, + 960790784, 959482176, 958166464, 956843648, 955513792, 954176832, 952832768, 951481600, + 950123456, 948758272, 947386048, 946006720, 944620480, 943227264, 941826944, 940419776, + 939005568, 937584384, 936156224, 934721152, 933279232, 931830336, 930374528, 928911808, + 927442176, 925965760, 924482432, 922992320, 921495296, 919991424, 918480832, 916963328, + 915439040, 913907968, 912370176, 910825600, 909274240, 907716160, 906151360, 904579840, + 903001664, 901416768, 899825216, 898226944, 896622016, 895010432, 893392256, 891767424, + 890136000, 888497984, 886853376, 885202176, 883544448, 881880128, 880209344, 878532032, + 876848192, 875157824, 873460992, 871757696, 870047872, 868331648, 866608960, 864879872, + 863144384, 861402496, 859654208, 857899584, 856138624, 854371264, 852597632, 850817600, + 849031296, 847238720, 845439808, 843634688, 841823296, 840005632, 838181760, 836351680, + 834515456, 832672960, 830824384, 828969600, 827108672, 825241600, 823368448, 821489152, + 819603840, 817712384, 815814912, 813911360, 812001728, 810086208, 808164608, 806237056, + 804303424, 802363904, 800418496, 798467072, 796509760, 794546560, 792577408, 790602432, + 788621568, 786634880, 784642368, 782644096, 780640000, 778630016, 776614336, 774592896, + 772565696, 770532864, 768494208, 766449856, 764399872, 762344192, 760282944, 758215936, + 756143424, 754065280, 751981504, 749892160, 747797248, 745696832, 743590848, 741479424, + 739362432, 737240000, 735112128, 732978752, 730839936, 728695744, 726546176, 724391168, + 722230784, 720065088, 717894080, 715717696, 713536000, 711349056, 709156864, 706959360, + 704756672, 702548672, 700335488, 698117184, 695893696, 693665024, 691431168, 689192192, + 686948224, 684699008, 682444864, 680185600, 677921280, 675651968, 673377536, 671098176, + 668813888, 666524608, 664230464, 661931328, 659627264, 657318400, 655004544, 652685952, + 650362432, 648034112, 645701056, 643363136, 641020480, 638673088, 636320896, 633964032, + 631602496, 629236224, 626865344, 624489792, 622109632, 619724800, 617335424, 614941504, + 612542976, 610139968, 607732352, 605320256, 602903680, 600482624, 598057152, 595627264, + 593192960, 590754240, 588311104, 585863680, 583411840, 580955712, 578495296, 576030528, + 573561536, 571088320, 568610816, 566129216, 563643264, 561153152, 558659008, 556160576, + 553658112, 551151488, 548640896, 546126144, 543607360, 541084480, 538557696, 536026848, + 533492096, 530953376, 528410656, 525864096, 523313568, 520759232, 518200960, 515638880, + 513073024, 510503328, 507929856, 505352608, 502771616, 500186880, 497598464, 495006400, + 492410624, 489811200, 487208128, 484601440, 481991200, 479377376, 476760000, 474139104, + 471514656, 468886720, 466255328, 463620448, 460982144, 458340480, 455695360, 453046880, + 450395040, 447739872, 445081408, 442419584, 439754496, 437086176, 434414624, 431739840, + 429061792, 426380672, 423696320, 421008864, 418318304, 415624576, 412927808, 410227968, + 407525120, 404819200, 402110304, 399398464, 396683616, 393965856, 391245120, 388521568, + 385795104, 383065760, 380333600, 377598592, 374860800, 372120256, 369376960, 366630848, + 363882080, 361130624, 358376480, 355619648, 352860192, 350098176, 347333536, 344566304, + 341796512, 339024192, 336249376, 333472064, 330692256, 327910016, 325125344, 322338304, + 319548832, 316756960, 313962784, 311166304, 308367488, 305566368, 302763008, 299957376, + 297149568, 294339552, 291527296, 288712928, 285896416, 283077792, 280257024, 277434208, + 274609376, 271782464, 268953568, 266122608, 263289760, 260454928, 257618144, 254779488, + 251938928, 249096480, 246252208, 243406128, 240558224, 237708512, 234857088, 232003888, + 229148976, 226292384, 223434080, 220574160, 217712592, 214849392, 211984608, 209118256, + 206250352, 203380944, 200510000, 197637584, 194763696, 191888352, 189011600, 186133440, + 183253936, 180373024, 177490800, 174607264, 171722416, 168836304, 165948944, 163060368, + 160170544, 157279584, 154387424, 151494128, 148599712, 145704176, 142807600, 139909920, + 137011232, 134111504, 131210816, 128309144, 125406504, 122502952, 119598480, 116693128, + 113786920, 110879856, 107971976, 105063288, 102153832, 99243616, 96332656, 93420992, + 90508624, 87595600, 84681920, 81767616, 78852704, 75937200, 73021144, 70104536, + 67187416, 64269804, 61351708, 58433156, 55514176, 52594776, 49674996, 46754840, + 43834344, 40913520, 37992392, 35070980, 32149316, 29227408, 26305284, 23382966, + 20460476, 17537830, 14615058, 11692176, 8769208, 5846174, 2923098, 0 +}; + +/************************ Q30 *******************************/ +const Word32 ivas_fb_fr_12band_1ms_re_fx[IVAS_FB_12_1MS_LEN] = { + 1046768256, 1012312512, 944113536, 843565952, 712700800, 554033920, 370399360, 163534048, -67588040, + -313003296, -547361792, -745791424, -889130944, -964720960, -967822016, -901839040, -777730304, + -612432896, -426573984, -241764928, -77701744, 50405768, 134107528, 173698992, 183571312, + 181978912, 174963648, 163434880, 148881184, 132470640, 115304208, 98219512, 81912736, + 66862960, 53409868, 41724844, 31871182, 23797162, 17385436, 12455156, 8801240, + 6197829, 4427144, 3280128, 2575327, 2155348, 1897329, 1705752, 1516863, + 1289431, 1005694, 661856, 267796, -161263, -604780, -1043282, -1457411, + -1832285, -2155534, -2420027, -2621275, -2759126, -2835035, -2853297, -2818571, + -2737039, -2614376, -2456980, -2270381, -2060530, -1832512, -1591794, -1343094, + -1091494, -841376, -597362, -363290, -143021, 60510, 244561, 407408, + 547618, 664738, 758550, 829643, 878668, 906840, 915250, 905346, + 878343, 835721, 778738, 708948, 627794, 537107, 438729, 334948, + 228103, 120925, 16090, -83524, -175327, -256811, -326026, -381381, + -422046, -447703, -458837, -456405, -442013, -417522, -385138, -347000, + -305255, -261681, -217812, -174648, -132866, -92642, -53935, -16402, + 20279, 56463, 92235, 127494, 161728, 194173, 223691, 249012, + 268700, 281445, 286068, 281804, 268278, 245720, 214858, 177029, + 133974, 87839, 40901, -4492, -46220, -82436, -111817, -133546, + -147456, -153913, -153846, -148528, -139528, -128444, -116827, -105934, + -96699, -89563, -84536, -81138, -78561, -75704, -71400, -64501, + -54108, -39627, -20946, 1593, 27122, 54374, 81719, 107372, + 129497, 146446, 156855, 159848, 155068, 142780, 123803, 99496, + 71589, 42078, 8610925, 16407290, 31915518, 54983844, 85416624, 123087880, + 168063984, 221958576, 289536032, 364878560, 426914240, 455184448, 434995104, 358099712, + 224036640, 40240900, -178615296, -412308800, -637390400, -829991424, -968687232, -1037118016, + -1026013056, -934381184, -769721024, -547208704, -287987072, -16727445, 241188016, 462583776, + 629070144, 729071296, 758930560, 723116864, 633312128, 506752128, 363680000, 224696192, + 107612800, 25033840, -24212064, -54589336, -75035176, -87485160, -93580896, -94591848, + -91737704, -86038536, -78437624, -69711224, -60533488, -51423856, -42794000, -34920752, + -27987240, -22072318, -17188296, -13279352, -10254646, -7989723, -6353249, -5207335, + -4426934, -3897128, -3525509, -3236283, -2977071, -2710878, -2419337, -2094076, + -1738366, -1359253, -969076, -579170, -201992, 153445, 478767, 769398, + 1021418, 1233894, 1405828, 1538184, 1631253, 1686663, 1705249, 1689093, + 1639776, 1560317, 1453594, 1324024, 1175972, 1015086, 846649, 676618, + 509991, 351706, 205173, 73207, -43142, -143513, -229073, -301290, + -362531, -414799, -460247, -500043, -534968, -564551, -587849, -602888, + -607619, -599579, -576918, -538114, -482894, -411845, -327078, -231622, + -129783, -26319, 73437, 164513, 242258, 303205, 344935, 366711, + 369107, 354325, 325569, 287088, 243371, 199057, 158131, 123882, + 98274, 82114, 74715, 74333, 78122, 82791, 84734, 80757, + 68210, 45592, 12513, -29958, -79606, -133015, -186134, -234445, + -273650, -299897, -310406, -303565, -279332, -239075, -185665, -123028, + -55984, 10396, 12276729, 12693837, 13547048, 14871155, 16707203, 19094012, + 22050984, 25567530, 29581572, 33971516, 38534384, 42985632, 46940136, 49924776, + 51363228, 50604824, 46909464, 39493740, 27503144, 10070768, -13759776, -44999620, + -84980336, -136135984, -207135712, -303422240, -412817600, -514972896, -589851392, -619651584, + -591583168, -499579936, -345470464, -138966128, 103208400, 359174656, 604351488, 814326528, + 967700992, 1048627328, 1048680832, 967863296, 814603776, 604752128, 359708672, 103884792, + -138140928, -344495008, -498458752, -590328384, -618282624, -588395136, -513462144, -411289888, + -301917376, -205694144, -134796400, -83778624, -43967052, -12923312, 10688964, 27884292, + 39622020, 46770036, 50183460, 50644772, 48893804, 45580600, 41282912, 36475948, + 31549672, 26793770, 22418028, 18548592, 15250408, 12530037, 10357491, 8671122, + 7396225, 6448686, 5748701, 5221465, 4805724, 4451326, 4123487, 3798131, + 3463431, 3114322, 2752946, 2383612, 2013354, 1648090, 1293873, 954378, + 632818, 330406, 48532, -212349, -450755, -665332, -853410, -1012414, + -1138953, -1230412, -1284349, -1300013, -1277722, -1220043, -1130902, -1016282, + -883017, -739061, -592113, -449695, -317863, -201395, -102837, -23014, + 39453, 87271, 124545, 155673, 185224, 216854, 253275, 295449, + 342868, 393176, 442827, 487113, 521090, 539819, 539332, 516817, + 471355, 403816, 317194, 216106, 106711, -4112, -109126, -201659, + -275976, -328059, -355725, -359045, -340068, -302808, -252589, -195699, + -138533, -87141, -46428, -19866, -8984, -13439, -30918, -57611, + -88487, -118040, -140755, -151891, -147872, -126858, -88834, -35798, + 28549, 99021, 169585, 233841, 285797, 320360, 333987, 324942, + 293611, 242374, 175498, 98630, 18357, -58534, -125609, -177509, + -210361, -222240, -213241, -185532, -143021, -91031, -35654, 16794, + 60506, 90695, 104157, 99518, 77443, 40482, -7123, -59963, + -111945, -157005, -189668, -205697, -202469, -179335, -137639, -80671, + -13290, 58484, 128123, 189173, 235954, 264066, 270883, 255765, + 220174, 2505037, 2442157, 2316154, 2126672, 1874467, 1561489, 1192761, + 775600, 321304, -157412, -645618, -1131069, -1604363, -2065994, -2526609, + -3015154, -3577470, -4283816, -5223516, -6510031, -8269471, -10642073, -13763168, + -17761360, -22731886, -28733746, -35756756, -43722016, -52444716, -61644104, -70903304, + -79696304, -87342288, -93058336, -95895816, -94830640, -88641344, -76058616, -55443336, + -24863958, 24611116, 107440320, 224788944, 364047616, 507399776, 634242176, 724330048, + 760427264, 730852288, 631136576, 464936832, 243827808, -13803173, -284784032, -543737088, + -765995008, -930417472, -1021827456, -1032720576, -964074624, -825139200, -632243584, -406773696, + -172552176, 47020828, 231770176, 367063072, 445488224, 467504928, 441322720, 381553248, + 308519520, 243096544, 190940560, 146958368, 109144704, 76984176, 50110068, 28195132, + 10859917, -2331860, -11867127, -18267046, -22063578, -23780578, -23911906, -22907786, + -21160858, -19000796, -16689673, -14424574, -12340740, -10519832, -8997765, -7775391, + -6827615, -6113435, -5583605, -5187945, -4880011, -4620898, -4380691, -4139162, + -3884798, -3613535, -3326639, -3028821, -2726195, -2424818, -2129499, -1843272, + -1567228, -1300854, -1042591, -790584, -543428, -300799, -63891, 164435, + 379755, 576491, 748467, 889663, 994911, 1060624, 1085268, 1069727, + 1017300, 933554, 825817, 702603, 572797, 444929, 326372, 222801, + 137707, 72284, 25430, -5886, -26190, -40792, -55143, -74076, + -101256, -138661, -186386, -242548, -303550, -364410, -419384, -462555, + -488576, -493231, -474014, -430404, -364059, -278663, -179684, -73826, + 31531, 129079, 212203, 275656, 315980, 331857, 324141, 295780, + 251424, 196978, 138929, 83734, 37113, 3535, -14258, -15450, + -1229, 25423, 60045, 97246, 131265, 156654, 168829, 164631, + 142633, 103366, 49247, -15601, -85794, -155177, -217478, -266899, + -298743, -309847, -298949, -266783, -216054, -151145, -77727, -2174, + 69017, 702811, 654136, 559557, 424419, 255932, 62727, -146313, + -362395, -578054, -786994, -985086, -1169469, -1339221, -1493760, -1633415, + -1757450, -1864970, -1953010, -2018235, -2055396, -2060043, -2027296, -1955369, + -1844129, -1698799, -1527422, -1343910, -1163448, -1004247, -880298, -801810, + -765486, -754582, -727814, -620985, -336399, 251272, 1302991, 3002489, + 5560181, 9191239, 14115464, 20525480, 28584940, 38387408, 49958096, 63204572, + 77930464, 93777392, 110263472, 126708904, 142322784, 156083648, 166946144, 173586320, + 175308576, 166325584, 128680304, 48303544, -74757040, -231715952, -407042976, -580775616, + -731094848, -837272320, -882366976, -855569984, -753729472, -582012992, -353498368, -87845872, + 190881904, 456905760, 685667520, 856595200, 955419584, 975703808, 919454400, 796692096, + 624085824, 422776032, 215700912, 24714716, -132116288, -242736960, -302620672, -315365760, + -293500640, -258619744, -225315280, -194015376, -163910608, -135501680, -109209736, -85466480, + -64529184, -46551644, -31533836, -19377918, -9878438, -2769905, 2268515, 5573895, + 7492172, 8348992, 8445734, 8040905, 7351921, 6546074, 5747758, 5036624, + 4458304, 4026662, 3735443, 3561663, 3475902, 3444629, 3437763, 3428836, + 3399492, 3337488, 3238697, 3103696, 2938339, 2749967, 2547660, 2338971, + 2130630, 1926285, 1727949, 1534741, 1344902, 1155176, 962956, 765794, + 563232, 356016, 147339, -58398, -254956, -435840, -594040, -723684, + -819800, -879714, -902536, -890086, -845966, -775986, -686897, -586473, + -482133, -380953, -288451, -208799, -143979, -94350, -58234, -32830, + -14133, 1978, 19701, 42276, 72069, 109808, 154947, 205272, + 257581, 307614, 350943, 383061, 400284, 399785, 380309, 341971, + 286657, 217523, 139066, 56385, -24953, -99742, -163283, -212106, + -243951, -258230, -255733, -167174, -239722, -322173, -408810, -492821, + -566516, -622391, -653378, -653921, -619965, -549788, -443508, -303565, + -133727, 60691, 274135, 500595, 734943, 972407, 1209697, 1443978, + 1673718, 1897211, 2113333, 2319888, 2514652, 2693915, 2854207, 2991285, + 3102696, 3187122, 3247515, 3290252, 3328147, 3378477, 3464934, 3613501, + 3852565, 4205968, 4691138, 5309438, 6043184, 6844465, 7633047, 8285794, + 8638327, 8477588, 7550391, 5561188, 2190063, -2903797, -10053462, -19577218, + -31739716, -46747292, -64700276, -85602512, -109304912, -135555296, -163926944, -194002976, + -225285872, -258586768, -293477632, -315364832, -302650912, -242803328, -132218944, 24580560, + 215544720, 422611008, 623927680, 796557504, 919359168, 975661312, 955439360, 856681664, + 685819520, 457116384, 191139072, -87558504, -353200000, -581723904, -753469440, -855356160, + -882212736, -837186048, -731079168, -580827520, -407153984, -231873488, -74945544, 48100840, + 128479736, 166141328, 175151264, 173462112, 166856272, 156024384, 142286160, 126683672, + 110236760, 93736176, 77863432, 63103528, 49819328, 38212324, 28380444, 20303444, + 13891988, 8985083, 5391207, 2889572, 1262319, 294475, -203348, -398749, + -423662, -382151, -343523, -352875, -428668, -574135, -776792, -1018896, + -1276918, -1529859, -1757571, -1946540, -2086827, -2175642, -2213314, -2205436, + -2158564, -2081784, -1982822, -1869689, -1747600, -1621008, -1491391, -1359644, + -1224514, -1085096, -939557, -787433, -628324, -463767, -295726, -127991, + 35529, 189782, 330335, 452518, 553054, 629169, 679950, 705285, + 706896, 687113, 649626, 598183, 537192, 470470, 401849, 334088, + 269582, 209498, 154619, 104683, 59308, 17469, -21588, -58843, + -94673, -129406, -162639, -193876, -221997, -245959, -264363, -276167, + -280285, -276237, -263718, -243144, -215155, -181048, -225261, -273555, + -307889, -326103, -327476, -312684, -283609, -243038, -194256, -140631, + -85182, -30244, 22798, 73608, 122885, 172169, 223570, 279366, + 341593, 411622, 489814, 575248, 665622, 757256, 845294, 923987, + 987121, 1028456, 1042203, 1023430, 968397, 874758, 741642, 569587, + 360379, 116796, -157659, -459031, -783110, -1125546, -1481872, -1847416, + -2217186, -2585716, -2947037, -3294742, -3622346, -3923849, -4194709, -4432970, + -4640760, -4825675, -5002266, -5192922, -5428408, -5747161, -6193793, -6815752, + -7658969, -8761350, -10145511, -11809549, -13717971, -15791409, -17898084, -19845242, + -21374384, -22157722, -21800466, -19845174, -15783279, -9068449, 863064, 14571969, + 32592328, 55410852, 83458416, 117107272, 156758688, 202942128, 257651808, 325933440, + 402044000, 464971200, 494205696, 474891008, 398522784, 264288720, 79206760, -142533824, + -381224512, -613975168, -817483264, -970950784, -1058690624, -1072345920, -1012679872, -893613760, + -734287744, -546547584, -339769856, -124623176, 88170360, 288225568, 466194112, 614172160, + 726163904, 798321728, 829131584, 819397568, 772133120, 692285376, 586377152, 462039040, + 327503712, 191064064, 60554008, -57130884, -156432848, -233429280, -286014272, -313941504, + -318749984, -303544416, -272698496, -231426688, -185371904, -140057616, -100631488, -69996648, + -46622364, -28166424, -13810469, -2980571, 4834391, 10133794, 13384151, 15027667, + 15460742, 15036408, 14051635, 12751812, 11326396, 9916592, 8616869, 7484565, + 6544389, 5798046, 5229236, 4811721, 4513168, 4300801, 4143382, 4014381, + 3892172, 3761242, 3611156, 3436579, 3235728, 3009947, 2762235, 2496885, + 2218419, 1931526, 1640448, 1349202, 1061301, 780105, 508675, 250099, + 7326, -216639, -418984, -597023, -748502, -871609, -965247, -1029025, + -1063439, -1069768, -1050128, -1007269, -944511, -865478, -773983, -673761, + -568371, -460991, -354385, -250799, -152007, -59299, 26411, 104546, + 174730, 236744, 290418, 335608, 372145, 399853, 418548, 428095, + 428430, 419636, 401963, 375881, 342083, 301499, 255265, 204699, + 151239, 96397, 41685, -11436, -61625, -107696, -148661, -183744, + -212399, -234301, -249338, -257586, -259295, -171383, -167771, -160946, + -151648, -140875, -129741, -119346, -110602, -104127, -100108, -98276, + -97857, -97667, -96155, -91604, -82246, -66504, -43110, -11334, + 28976, 77253, 132282, 192171, 254555, 316653, 375561, 428343, + 472340, 505222, 525246, 531204, 522588, 499415, 462302, 412189, + 350367, 278167, 197008, 108113, 12645, -88501, -194453, -304491, + -417705, -533098, -649202, -764225, -875703, -980757, -1075829, -1157086, + -1220253, -1261142, -1275529, -1259757, -1210576, -1125738, -1003720, -844248, + -647867, -416383, -152288, 140834, 458975, 797247, 1150575, 1513140, + 1879071, 2241774, 2594688, 2930577, 3242477, 3523085, 3766061, 3965621, + 4118279, 4222622, 4281408, 4301274, 4294860, 4279931, 4280984, 4327080, + 4452293, 4691546, 5079427, 5643594, 6401946, 7353690, 8475606, 9711576, + 10969534, 12110916, 12950640, 13248182, 12713298, 10999818, 7719470, 2437137, + -5306709, -16007364, -30173754, -48382488, -71457888, -101754088, -140816912, -185763344, + -231466336, -272424224, -303010560, -318021792, -313081312, -285067456, -232401024, -155266144, + -55676148, 62564504, 194048000, 332049728, 468930560, 596597632, 707022848, 792757376, + 847434880, 866203136, 846081856, 786193920, 687883392, 554677120, 392130080, 207514704, + 9432382, -192707744, -389200480, -570675136, -728479808, -856350656, -952308800, -1015864832, + -1046220032, -1043342848, -1008126784, -942413952, -848923648, -731177152, -593366784, -440223744, + -276851936, -108565096, 59292484, 221513920, 373199296, 509904800, 627780928, 723682304, + 795257728, 841006144, 860308096, 853421632, 821452480, 766292160, 690533568, 597361024, + 490425248, 373702496, 251347920, 127544600, 6357648, -108405296, -213318272, -305445280, + -382425728, -442537280, -484731648, -508645408, -514583008, -503476768, -476822816, -436599136, + -385166592, -325160416, -259373680, -190640560, -121721768, -55198692, 6621388, 61783672, + 108746912, 146423216, 174197536, 191924704, 199906864, 198850976, 189810704, 174114128, + 153282784, 128943984, 102742896, 76256368, 50914548, 27932052, 8253544, -7485707, + -18981258, -26263536, -29686804, -29902128, -27874808, -24904632, -21873452, -18924710, + -16109369, -13513449, -11193274, -9184409, -7497119, -6124396, -5043505, -4222392, + -3622104, -3201531, -2919256, -2736657, -2618792, -2536063, -2464195, -2384826, + -2284834, -2156265, -1995319, -1801974, -1578908, -1331064, -1064692, -787000, + -505396, -227288, 40476, 291657, 521006, 724191, 898044, 1040397, + 1150221, 1227397, 1272778, 1287922, 1275099, 1237007, 1176756, 1097593, + 1002895, 895923, 779853, 657586, 531818, 404912, 279016, 155978, + 37491, -74965, -179989, -276315, -362698, -438012, -501167, -551237, + -587418, -609171, -616196, -608571, -586708, -551466, -504065, -446144, + -379632, -306754, -229859, -151391, -73706, 962, 70672, 133776, + 189046, 235630, 273114, 301432, 320873, 331952, 335393, 331988, + 322579, 307941, 288792, 265710, 239189, 209598, 177267, 142480, + 105576, 66945, 27114, -13271, -53400, -92348, -129065, -162474, + -191486, -215114, -232503, -243037, -246348, -242394, -231432, -214048, + -191082, -163619, -132881, -100182, -66814, -34004, -2809, 25897, + 51498, 73603, 92073, 106961, 118497, 127000, 132851, 136409, + 137987, 137791, 135930, 132384, 127051, 119749, 110286, 98485, + 84255, 67615, 48748, 27996, 5888, -16902, -39568, -61243, + -81031, -98099, -111715, -121326, -162998, -160088, -154357, -145969, + -135159, -122211, -107436, -91156, -73678, -55283, -36214, -16667, + 3198, 23260, 43411, 63547, 83543, 103238, 122414, 140790, + 158012, 173664, 187268, 198317, 206286, 210673, 211020, 206956, + 198214, 184663, 166317, 143347, 116078, 84982, 50655, 13802, + -24798, -64311, -103888, -142674, -179845, -214613, -246243, -274051, + -297418, -315773, -328608, -335464, -335942, -329700, -316476, -296086, + -268464, -233660, -191884, -143511, -89112, -29451, 34490, 101547, + 170354, 239401, 307043, 371566, 431212, 484258, 529040, 564034, + 587875, 599425, 597777, 582315, 552693, 508884, 451144, 380049, + 296447, 201490, 96577, -16612, -136189, -260017, -385787, -510997, + -633031, -749140, -856549, -952436, -1034059, -1098739, -1143998, -1167540, + -1167397, -1141901, -1089827, -1010351, -903194, -768558, -607272, -420711, + -210944, 19368, 266825, 527423, 796421, 1068545, 1337896, 1598264, + 1843121, 2066095, 2261075, 2422874, 2547443, 2632705, 2678810, 2689041, + 2669949, 2632165, 2590157, 2562709, 2571986, 2643435, 2803848, 3080521, + 3498078, 4076931, 4828788, 5754789, 6839761, 8050914, 9330877, 10598671, + 11740823, 12618964, 13055458, 12877144, 11632705, 8232321, 1712792, -8269488, + -21676128, -38124492, -56918448, -77081536, -97412152, -116545320, -133029752, -145407808, + -152301808, -152496656, -145019616, -129208872, -104771344, -71822984, -30912372, 16976826, + 70442824, 127704136, 186656480, 244947920, 300068000, 349448640, 390571840, 421080480, + 438886880, 442275104, 429992032, 401322976, 356148672, 294980192, 218969888, 129897104, + 30128484, -77446248, -189501472, -302382688, -412230048, -515113984, -607177664, -684781632, + -744644480, -783974400, -800586304, -792999936, -760514496, -703256576, -622199232, -519150624, + -396712160, -258207056, -107581408, 50718884, 211891600, 370936768, 522825024, 662669440, + 785895232, 888400000, 966700096, 1018056320, 1040574720, 1033278976, 996150976, 930138240, + 837128128, 719891072, 581993344, 427717504, 261968336, 89712808, -84335696, -255470448, + -419050304, -570668224, -706270592, -822273344, -915657792, -984053440, -1025798848, -1039984064, + -1026470080, -985886720, -919608064, -829707328, -718891392, -590417984, -447997504, -295682944, + -137750720, 21423548, 177490944, 326252736, 463778272, 586513216, 691375872, 775837824, + 837987456, 876574784, 891035520, 881494912, 848751424, 794240448, 719980032, 628500544, + 522760032, 406049152, 281887712, 153916800, 25789502, -98936256, -216899504, -325029824, + -420629824, -501444512, -565715328, -612217792, -640282304, -649796800, -641192896, -615415808, + -573878848, -518405728, -451161088, -374573216, -291251040, -203897664, -115224504, -27867474, + 55691216, 133193880, 202668432, 262478208, 311359200, 348444032, 373271968, 385785760, + 386315040, 375548096, 354492672, 324428128, 286850336, 243411744, 195858832, 145969024, + 95489384, 46079124, -742270, -43639588, -81497992, -113449472, -138889424, -157482720, + -169159888, -174103616, -172726688, -165642240, -153628176, -137586864, -118502264, -97395800, + -75283368, -53134364, -31835154, -12157406, 5266631, 19962188, 31621642, 40107016, + 45443876, 47808948, 47510056, 44961972, 40656428, 35131248, 28935710, 22599292, + 16597725, 11327856, 7077267, 4007588, 2004813, 698472, -159366, -668117, + -915026, -972592, -904574, -762742, -589613, -417127, -268777, -159451, + -97435, -84877, -119630, -195920, -305911, -440293, -589480, -743976, + -895177, -1035483, -1158746, -1260167, -1336478, -1385695, -1407139, -1401122, + -1368900, -1312362, -1233971, -1136502, -1023004, -896600, -760484, -617774, + -471538, -324684, -179997, -40056, 92731, 216208, 328430, 427747, + 512770, 582446, 636028, 673130, 693701, 698053, 686825, 660989, + 621793, 570758, 509593, 440184, 364504, 284586, 202444, 120043, + 39232, -38277, -110964, -177497, -236776, -287918, -330276, -363413, + -387116, -401358, -406302, -402269, -389735, -369301, -341693, -307732, + -268335, -224488, -177248, -127707, -76997, -26251, 23403, 70879, + 115146, 155262, 190393, 219846, 243073, 259708, 269557, 272617, + 269062, 259245, 243667, 222969, 197896, 169274, 137970, 104873, + 70854, 36751, 3337, -28682, -58696, -86176, -110690, -131889, + -149514, -163373, -173350, -179385, -181478, -179682, -174108, -164916, + -152331, -136632, -118169, -97351, -74653, -50603, -25781, -795, + 23721, 47148, 68883, 88374, 105138, 118782, 129014, 135661, + 138666, 138092, 134111, 126995, -72761, -56245, -38209, -19019, + 926, 21206, 41377, 60995, 79616, 96811, 112175, 125335, + 135964, 143783, 148571, 150171, 148491, 143510, 135276, 123908, + 109592, 92580, 73182, 51764, 28741, 4570, -20258, -45231, + -69817, -93477, -115679, -135902, -153653, -168473, -179953, -187739, + -191549, -191176, -186499, -177490, -164220, -146855, -125663, -101009, + -73349, -43220, -11236, 21933, 55569, 88924, 121238, 151753, + 179734, 204484, 225359, 241786, 253272, 259417, 259926, 254614, + 243416, 226386, 203704, 175675, 142727, 105408, 64381, 20414, + -25629, -72803, -120096, -166448, -210776, -251991, -289028, -320870, + -346577, -365309, -376354, -379149, -373302, -358603, -335043, -302817, + -262324, -214167, -159142, -98227, -32564, 36563, 107751, 179503, + 250256, 318414, 382371, 440551, 491426, 533563, 565640, 586488, + 595111, 590727, 572783, 540991, 495337, 436112, 363911, 279647, + 184541, 80117, -31824, -149225, -269813, -391137, -510624, -625621, + -733459, -831498, -917191, -988123, -1042078, -1077064, -1091376, -1083624, + -1052786, -998241, -919828, -817879, -693286, -547530, -382754, -201766, + -8088, 194084, 399903, 603998, 800600, 983813, 1147877, 1287596, + 1398749, 1478666, 1526731, 1545029, 1538843, 1517225, 1493308, 1484620, + 1512997, 1604428, 1788384, 2097022, 2563860, 3222329, 4104042, 5237042, + 6645377, 8348986, 10388584, 12857124, 15616492, 18195220, 20086854, 20833852, + 20030730, 17354698, 12586763, 5632648, -3464912, -14518786, -27198686, -41038776, + -55453300, -69758216, -83199240, -94984200, -104319184, -110446312, -112682200, -110454752, + -103337336, -91078120, -73623784, -51135812, -23998892, 7179643, 41579336, 78185368, + 115815920, 153157712, 188808416, 221324672, 249274288, 271290496, 286126560, 292708608, + 290184736, 277968256, 255773584, 223642784, 181961872, 131465504, 73229656, 8652162, + -60578956, -132528392, -205066832, -275933056, -342803008, -403363968, -455390976, -496823520, + -525839776, -540925440, -540935296, -525144960, -493290304, -445593920, -382776288, -306051584, + -217107424, -118068792, -11447024, 99925072, 212970192, 324453472, 431076864, 529578144, + 616831424, 689946368, 746362368, 783935232, 801012800, 796497984, 769895232, 721340928, + 651613760, 562127360, 454901984, 332518336, 198053008, 54997860, -92834592, -241417152, + -386622272, -524341152, -650604416, -761700160, -854286656, -925495040, -973019712, -995193152, + -991042688, -960327360, -903553472, -821968256, -717531648, -592866496, -451188992, -296220608, + -132085040, 36808156, 205888512, 370555840, 526312064, 668891968, 794386240, 899356480, + 980934400, 1036909248, 1065792000, 1066936320, 1040546496, 987467136, 909149824, 807691200, + 685777408, 546616256, 393851264, 231466848, 63682176, -105158952, -270702912, -428699744, + -575114688, -706232704, -818754752, -909882496, -977389312, -1019675904, -1035808896, -1025541568, + -989316224, -928248256, -844092096, -739190912, -616410240, -479058656, -330797152, -175539264, + -17346022, 139682832, 291517408, 434303488, 564462720, 678784448, 774506688, 849384640, + 901743936, 930519040, 935273728, 916205312, 874131520, 810461056, 727147968, 626633152, + 511772224, 385754272, 252012128, 114127448, -24266644, -159583088, -288375648, -407428352, + -513837376, -605083264, -679091392, -734279488, -769591104, -784513984, -779083840, -753872640, + -709962816, -648908288, -572682880, -483618976, -384336832, -277668320, -166575776, -54069264, + 56875640, 163397472, 262823600, 352738016, 431040544, 495996064, 546272512, 580966656, + 599617664, 602207872, 589151552, 561271552, 519765696, 466163232, 402273376, 330127520, + 251916672, 169926224, 86470040, 3825426, -75828792, -150469632, -218281248, -277698720, + -327443424, -366549120, -394378400, -410629056, -415330784, -408832544, -391780864, -365090688, + -329909184, -287574176, -239568528, -187472016, -132911848, -77513936, -22855780, 29577298, + 78431608, 122519032, 160844800, 192628240, 217316432, 234590304, 244363440, 246773968, + 242169824, 231088240, 214230352, 192431808, 166630544, 137832768, 107078304, 75406624, + 43824304, 13275079, -15386599, -41417940, -64205456, -83277544, -98311776, -109136888, + -115729656, -118206952, -116813448, -111905648, -103932808, -93415768, -80924248, -67053716, + -52402552, -37550280, -23037704, -9349536, 3099972, 13977919, 23039974, 30133750, + 35198404, 38260568, 39427008, 38874332, 36836352, 33589632, 29437968, 24696382, + 19675442, 14666438, 9928193, 5675861, 2072344, -777524, -2829749, -4100893, + -4665396, -4650187, -4237832, -3670417, -3111787, -2588999, -2111154, -1692910, + -1342761, -1064792, -858034, -718046, -637371, -606817, -616039, -654489, + -711863, -778707, -846654, -908726, -959364, -994500, -1011439, -1008780, + -986218, -944402, -884714, -809115, -719958, -619860, -511553, -397807, + -281326, -164706, -50372, 59439, 162717, 257679, 342798, 416803, + 478690, 527728, 563468, 585733, 594629, 590529, 574063, 546100, + 507723, 460200, 404950, 343501, 277458, 208453, 138112, 68013, + -346, -65582, -126442, -181831, -230824, -272671, -306807, -332846, + -350584, -359987, -361185, -354465, -340256, -319119, -291736, -258891, + -221458, -180384, -136669, -91350, -45474, -81, 43821, 85280, + 123419, 157461, 186741, 210730, 229036, 241421, 247797, 248224, + 242908, 232183, 216503, 196419, 172565, 145631, 116349, 85467, + 53736, 21886, -9380, -39409, -67596, -93402, -116356, -136059, + -152188, -164499, -172828, -177091, -177288, -173497, -165880, -154675, + -140195, -122823, -103005, -81242, -58073, -34073, -9827, 14076, + 37067, 58607, 78202, 95423, 109908, 121382, 129651, 134613, + 136254, 134645, 129937, 122348, -44011, -24892, -4829, 15720, + 36281, 56369, 75506, 93227, 109092, 122701, 133696, 141775, + 146697, 148290, 146451, 141157, 132459, 120486, 105445, 87616, + 67345, 45046, 21187, -3718, -29118, -54435, -79078, -102456, + -123992, -143137, -159380, -172271, -181421, -186524, -187359, -183802, + -175830, -163523, -147066, -126746, -102945, -76138, -46876, -15782, + 16466, 49153, 81535, 112860, 142385, 169387, 193186, 213156, + 228742, 239468, 244958, 244937, 239247, 227851, 210839, 188425, + 160956, 128901, 92851, 53506, 11664, -31790, -75908, -119691, + -162116, -202159, -238815, -271127, -298207, -319262, -333613, -340713, + -340163, -331730, -315348, -291129, -259362, -220512, -175214, -124263, + -68599, -9299, 52451, 115372, 178114, 239282, 297468, 351266, + 399319, 440334, 473120, 496614, 509913, 512295, 503248, 482484, + 449964, 405893, 350744, 285237, 210350, 127286, 37477, -57465, + -155750, -255468, -354592, -451046, -542708, -627478, -703289, -768173, + -820272, -857921, -879657, -884318, -871054, -839446, -789522, -721878, + -637689, -538829, -427837, -308012, -183306, -58351, 61766, 171575, + 265595, 338530, 385818, 403920, 391045, 347469, 276387, 184146, + 81162, -18121, -94264, -123407, -76036, 81568, 389991, 895519, + 1710701, 3002792, 4825273, 7109226, 9729646, 12512602, 15248433, 17702624, + 19630608, 20791430, 20963006, 19955790, 17626208, 13887624, 8719623, 2174045, + -5621665, -14464834, -24081046, -34131360, -44222504, -53920252, -62765096, -70290080, + -76039792, -79590136, -80567832, -78669104, -73676656, -65474260, -54058260, -39545472, + -22176940, -2317326, 19550376, 42834668, 66849928, 90834856, 113974736, 135426640, + 154347008, 169920736, 181390720, 188086896, 189453888, 185076096, 174699280, 158247904, + 135837376, 107780464, 74587640, 36960972, -4218522, -47909872, -92937136, -138019856, + -181808096, -222921312, -259989808, -291697568, -316825344, -334292320, -343195264, -342844000, + -332791264, -312856704, -283143456, -244046832, -196254272, -140736784, -78731208, -11714102, + 58632672, 130463552, 201817312, 270670080, 334992000, 392806176, 442247552, 481620896, + 509455360, 524554208, 526038368, 513381696, 486437344, 445453888, 391080448, 324360480, + 246714016, 159908576, 66019492, -32619810, -133476120, -233882016, -331106848, -422431424, + -505224224, -577016896, -635577152, -678976448, -705651136, -714454400, -704697856, -676181184, + -629208640, -564592384, -483640672, -388133216, -280282016, -162679760, -38236756, 89892360, + 218389968, 343862752, 462932736, 572329472, 668980864, 750100160, 813266368, 856496128, + 878304640, 877753856, 854486592, 808744960, 741372928, 653802560, 548023872, 426538944, + 292301664, 148644560, -806035, -152223392, -301680672, -445254848, -579131904, -699710144, + -803698816, -888209216, -950836352, -989727616, -1003637824, -991967616, -954785856, -892832832, + -807506624, -700830848, -575405568, -434342368, -281185056, -119818392, 45633172, 210913568, + 371747552, 523954144, 663558144, 786896576, 890717440, 972267648, 1029367616, 1060471360, + 1064709056, 1041912064, 992618752, 918061696, 820136128, 701350912, 564763136, 413905312, + 252702016, 85283768, -84153016, -251373152, -412193952, -562598208, -698834304, -817510976, + -915681728, -990918592, -1041372160, -1065817344, -1063683392, -1035067008, -980729024, -902074176, + -801114432, -680417408, -543040576, -392453440, -232449024, -67047936, 99603672, 263338768, + 420074528, 565914944, 697248640, 810838912, 903904448, 974187712, 1020010432, 1040314112, + 1034684224, 1003358720, 947219392, 867767552, 767083328, 647771264, 512892224, 365884480, + 210475200, 50585176, -109770824, -266585856, -415961728, -554206912, -677928256, -784115520, + -870214784, -934190464, -974573952, -990497408, -981711808, -948590080, -892113472, -813843264, + -715877760, -600795712, -471588352, -331581056, -184347104, -33615956, 116822016, 263211632, + 401927360, 529563904, 643020416, 739576448, 816957632, 873389632, 907638720, 919038784, + 907503104, 873521728, 818144448, 742948992, 649996672, 541776128, 421136352, 291211584, + 155339280, 16974000, -120401088, -253362480, -378632256, -493159552, -594195200, -679358336, + -746692608, -794711040, -822428992, -829383232, -815638016, -781777600, -728885632, -658512064, + -572628224, -473572352, -363985824, -246742688, -124873992, -1489180, 120303760, 237476976, + 347158464, 446702912, 533755744, 606308928, 662747520, 701884928, 722987456, 725786624, + 710479424, 677716736, 628580224, 564548800, 487455296, 399434400, 302864160, 200301680, + 94415504, -12084029, -116514408, -216288720, -308979968, -392380352, -464553824, -523880992, + -569095168, -599308544, -614028672, -613164032, -597019520, -566281600, -521994336, -465525920, + -398528192, -322889120, -240680240, -154100192, -65416176, 23095468, 109207648, 190798608, + 265904304, 332765472, 389868896, 435980928, 470173824, 491842976, 500715808, 496851904, + 480634304, 452752704, 414179264, 366137088, 310063456, 247567808, 180386464, 110334864, + 39258892, -31013516, -98719224, -162203968, -219962560, -270674336, -313232768, -346769088, + -370668672, -384580928, -388421408, -382367424, -366846528, -342518912, -310254080, -271102432, + -226263200, -177048848, -124847760, -71085712, -17187518, 35460372, 85545152, 131860032, + 173332944, 209050736, 238278608, 260474080, 275295552, 282605088, 282465888, 275134240, + 261046656, 240802480, 215142736, 184925744, 151100368, 114677616, 76701576, 38220244, + 257309, -36214540, -70298016, -101192744, -128213464, -150804368, -168549456, -181178720, + -188570000, -190746832, -187872144, -180238592, -168255376, -152432528, -133362752, -111701864, + -88148040, -63420712, -38239704, -13305140, 10721270, 33233146, 53694084, 71649704, + 86736888, 98689968, 107343928, 112634456, 114595192, 113352176, 109115832, 102170872, + 92864472, 81593048, 68788288, 54902676, 40395092, 25716910, 11298924, -2460449, + -15205434, -26631372, -36491212, -44599896, -50836640, -55145052, -57531268, -58060172, + -56849976, -54065368, -49909488, -44615140, -38435440, -31634326, -24477204, -17222048, + -10111227, -3364318, 2827930, 8308287, 12956318, 16690166, 19466890, 21281350, + 22163806, 22176328, 21408246, 19970784, 17991204, 15606606, 12957738, 10182934, + 7412561, 4764010, 2337587, 213264, -1551419, -2922471, -3889289, -4463602, + -4677182, -4578945, -4230953, -3704343, -3074240, -2415525, -1797252, -1280920, + -898770, -627791, -434755, -305164, -227603, -191690, -187557, -206218, + -239500, -280340, -322733, -361874, -394053, -416670, -428076, -427515, + -414945, -390943, -356535, -313106, -262250, -205705, -145243, -82626, + -19530, 42469, 101945, 157622, 208399, 253344, 291709, 322917, + 346571, 362440, 370466, 370745, 363530, 349215, 328325, 301500, + 269486, 233106, 193250, 150849, 106856, 62226, 17894, -25242, + -66343, -104637, -139433, -170137, -196253, -217395, -233281, -243746, + -248732, -248291, -242579, -231853, -216463, -196846, -173514, -147048, + -118082, -87293, -55383, -23069, 8934, 39937, 69279, 96351, + 120609, 141582, 158888, 172233, 181426, 186370, 187072, 183631, + 176235, 165155, 150734, 133374, 113527, 91685, 68363, 44092, + 19408, -5162, -29106, -51936, -73196, -92471, -109389, -123633, + -134942, -143118, -148026, -149603, -147856, -142863, -134772, -123799, + -110225, -94386, -76670, -57503, -37343, -16663, 4054, 24338, + 43732, 61811, 78191, 92535, 62535, 80267, 96515, 110869, + 122950, 132423, 139005, 142473, 142671, 139519, 133011, 123223, + 110309, 94503, 76111, 55508, 33131, 9465, -14962, -39597, + -63868, -87203, -109039, -128839, -146103, -160377, -171269, -178455, + -181688, -180805, -175730, -166482, -153172, -136001, -115264, -91340, + -64689, -35842, -5393, 26011, 57690, 88934, 119026, 147254, + 172929, 195397, 214061, 228390, 237937, 242348, 241373, 234879, + 222848, 205389, 182733, 155232, 123355, 87684, 48894, 7752, + -34905, -78188, -121168, -162899, -202440, -238873, -271320, -298971, + -321092, -337048, -346317, -348499, -343329, -330684, -310588, -283215, + -248890, -208087, -161430, -109684, -53754, 5325, 66401, 128208, + 189391, 248521, 304122, 354711, 398828, 435097, 462282, 479357, + 485586, 480607, 464520, 437982, 402277, 359398, 312090, 263877, + 219044, 182590, 160108, 157649, 181489, 237891, 332809, 471594, + 658900, 898625, 1197641, 1570523, 1996663, 2404745, 2717774, 2865679, + 2785718, 2427096, 1754169, 749686, -583221, -2219740, -4113328, -6196593, + -8383364, -10571665, -12647668, -14490343, -15976733, -16987568, -17413068, -17158614, + -16150145, -14338955, -11705745, -8263683, -4060347, 821616, 6265157, 12120884, + 18210488, 24331478, 30263100, 35773284, 40626432, 44591748, 47451940, 49011856, + 49106908, 47610828, 44442580, 39572032, 33024242, 24882062, 15286939, 4437778, + -7412170, -19960400, -32862134, -45739056, -58189596, -69800496, -80159352, -88867704, + -95554448, -99888904, -101593376, -100454560, -96333512, -89173816, -79007528, -65958664, + -50244076, -32171454, -12134525, 9394608, 31875820, 54713840, 77273336, 98895824, + 118918056, 136691248, 151600704, 163085296, 170656112, 173913744, 172563664, 166429120, + 155461200, 139745456, 119505000, 95099632, 67021116, 35884416, 2415097, -32566908, + -68166792, -103437232, -137402992, -169087216, -197538720, -221859376, -241231120, -254941424, + -262406848, -263193680, -257034992, -243843760, -223721280, -196960640, -164045024, -125640616, + -82584344, -35866404, 13391901, 63964612, 114551216, 163809728, 210391808, 252979168, + 290320064, 321265088, 344801344, 360083392, 366461088, 363502304, 351010944, 329038400, + 297889248, 258119712, 210529696, 156147840, 96210000, 32131786, -34524592, -102088152, + -168820816, -232961936, -292774464, -346591552, -392862560, -430196672, -457403712, -473530208, + -477890048, -470088800, -450040832, -417978368, -374452640, -320326336, -256757808, -185176992, + -107253736, -24859086, 59979564, 145128320, 228400464, 307612608, 380641824, 445482432, + 500300512, 543485312, 573695616, 589899584, 591407872, 577897856, 549428800, 506447456, + 449783328, 380634208, 300541536, 211356352, 115196864, 14397969, -88545520, -191040832, + -290462720, -384220896, -469827680, -544963968, -607541824, -655762304, -688166080, -703676928, + -701634816, -681819648, -644463424, -590250752, -520308160, -436181376, -339801440, -233440544, + -119658328, -1240033, 118872048, 237652048, 352067200, 459155616, 556103232, 640318080, + 709499520, 761700928, 795384128, 809463808, 803340864, 776923520, 730635776, 665412608, + 582681792, 484333184, 372675584, 250382144, 120426184, -13991622, -149522608, -282754144, + -410296096, -528867712, -635382464, -727028736, -801344512, -856283200, -890270272, -902247552, + -891705280, -858699904, -803857856, -728364736, -633940096, -522797984, -397595008, -261366368, + -117451720, 30587386, 179056320, 324220320, 462399104, 590061056, 703913984, 800990592, + 878726208, 935027008, 968326336, 977628096, 962536000, 923267520, 860652416, 776115520, + 671644160, 549741504, 413365632, 265857680, 110858864, -47779968, -206094880, -360108800, + -505932192, -639862208, -758477376, -858725824, -938004160, -994225728, -1025875712, -1032052032, + -1012490816, -967575808, -898331200, -806398464, -693996736, -563869056, -419215008, -263610912, + -100920864, 64800176, 229408368, 388775616, 538893952, 675977408, 796558208, 897575488, + 976453568, 1031168128, 1060298880, 1063066560, 1039353856, 989709440, 915335680, 818058560, + 700282816, 564931648, 415373344, 255336384, 88815592, -80029120, -246977680, -407857120, + -558646720, -695580608, -815240832, -914661376, -991426624, -1043686208, -1070172608, -1070248192, + -1043923520, -991857408, -915341120, -816266432, -697079168, -560719104, -410547744, -250265472, + -83820864, 84686600, 251107216, 411343136, 561449088, 697729408, 816829056, 915815936, + 992253184, 1044259072, 1070553344, 1070488704, 1044066752, 991938048, 915385920, 816295104, + 697105216, 560750656, 410588608, 250316144, 83879304, -84624008, -251044992, -411286048, + -561401792, -697695936, -816812672, -915819008, -992277056, -1044304128, -1070619200, -1070574144, + -1044169920, -992056576, -915517184, -816436096, -697252864, -560901952, -410740480, -250465744, + -84023984, 84486696, 250917232, 411169760, 561298496, 697607040, 816739008, 915761280, + 992235520, 1044278912, 1070609856, 1070580032, 1044190208, 992090048, 915562432, 816491584, + 697316864, 560972608, 410815936, 250544048, 84103240, -84408312, -250841440, -411098144, + -561232512, -697547840, -816687680, -915718464, -992201920, -1044254720, -1070595200, -1070574848, + -1044194112, -992102592, -915582912, -816519232, -697350784, -561011712, -410859200, -250590352, + -84151408, 84359424, 250792960, 411051168, 561188032, 697506752, 816650880, 915686656, + 992175616, 1044234432, 1070581248, 1070567360, 1044193024, 992107776, 915594112, 816535872, + 697372352, 561037568, 410888512, 250622304, 84185136, -84324824, -250758368, -411017408, + -561155904, -697477056, -816624192, -915663552, -992156544, -1044219712, -1070571008, -1070561728, + -1044192000, -992111168, -915601728, -816547392, -697387392, -561055616, -410909120, -250644896, + -84209144, 84299992, 250733312, 410992736, 561132224, 697454848, 816603968, 915645824, + 992141696, 1044208000, 1070562816, 1070557056, 1044191040, 992113920, 915607936, 816556928, + 697399936, 561070784, 410926464, 250663904, 84229272, -84279312, -250712656, -410972640, + -561113216, -697437440, -816588608, -915632832, -992131328, -1044200448, -1070558208, -1070555520, + -1044192384, -992118080, -915614784, -816566208, -697411328, -561084032, -410941184, -250679696, + -84245752, 84262552, 250696016, 410956544, 561098048, 697423552, 816576320, 915622464, + 992123200, 1044194816, 1070555200 +}; + +/************************ Q30 *******************************/ +const Word32 ivas_fb_fr_12band_1ms_im_fx[IVAS_FB_12_1MS_LEN] = { + -96495528, -286734272, -468692800, -637041216, -786562176, -912433280, -1009964416, -1075182976, -1098333440, + -1060972224, -954328512, -784950848, -567387776, -321857280, -71378072, 161019520, 355191072, + 496249664, 576290688, 595228096, 560553408, 486341472, 391112608, 296445024, 219833024, + 161425424, 113971872, 75074912, 43676944, 18947558, 106207, -13606639, -22959300, + -28697174, -31541624, -32158708, -31154358, -29054292, -26304144, -23261552, -20202826, + -17324756, -14756116, -12565362, -10774012, -9366401, -8302065, -7524551, -6970827, + -6577419, -6286071, -6046737, -5819771, -5576294, -5297871, -4975268, -4606808, + -4196583, -3752523, -3284873, -2804624, -2322651, -1848752, -1391471, -957667, + -552820, -180887, 155183, 453533, 712892, 932744, 1112922, 1253892, + 1356428, 1421957, 1452251, 1449752, 1417222, 1357998, 1275581, 1173833, + 1056523, 927513, 790325, 648358, 504521, 361522, 221574, 86743, + -41290, -160871, -270597, -368994, -454781, -526614, -583403, -624117, + -648145, -655120, -645267, -619210, -578251, -524110, -459110, -385841, + -307254, -226274, -145851, -68575, 3253, 67950, 124299, 171779, + 210318, 240423, 262847, 278659, 288884, 294565, 296445, 295082, + 290614, 282963, 271701, 256332, 236226, 210937, 180155, 143993, + 102888, 57812, 10083, -38529, -86081, -130429, -169562, -201608, + -225146, -239179, -243376, -237949, -223786, -202225, -175080, -144342, + -112142, -80430, -50955, -24990, -3380, 13628, 26240, 35170, + 41402, 46169, 50665, 56013, 62999, 72081, 83214, 95949, + 109364, 122266, 133211, 140767, 143575, 140609, 131207, 115267, + 93186, 65957, 34996, 2134, -30636, -61239, -87791, -108676, + -122781, -129495, 12356724, 36406252, 58390684, 76977432, 90719600, 98265728, + 98008264, 88608552, 62420976, 2547174, -98862584, -234978608, -391650304, -549723776, + -687929024, -785620992, -825677888, -796781568, -695135040, -525144384, -299188480, -36327380, + 239749920, 503413376, 729982272, 898556864, 994367488, 1010422464, 948197568, 817333696, + 634343104, 420516896, 199273200, -6719048, -178276784, -302004160, -371805248, -389615456, + -365008416, -315253344, -262675984, -217917568, -178521248, -143001072, -111343304, -83569488, + -59728692, -39750832, -23483756, -10668693, -980101, 5968707, 10589352, 13306198, + 14527738, 14637296, 13974127, 12830675, 11443325, 9996437, 8620832, 7402724, + 6386965, 5588127, 4995412, 4583292, 4315642, 4154179, 4060473, 4001515, + 3949354, 3884093, 3791711, 3665350, 3502261, 3304372, 3075215, 2820550, + 2545809, 2257129, 1959450, 1657946, 1356600, 1059795, 771079, 494646, + 234059, -6519, -223731, -414017, -575061, -704879, -803133, -870150, + -907983, -919252, -907936, -878057, -834296, -780659, -721070, -658192, + -594157, -529649, -464852, -398810, -330536, -258557, -182049, -100384, + -14134, 75538, 166137, 254665, 337160, 409716, 468199, 509317, + 530349, 530086, 508400, 466928, 408381, 336929, 257279, 174830, + 94651, 21581, -40724, -89563, -123905, -143909, -151339, -148811, + -139947, -128462, -118197, -112219, -112926, -121327, -137375, -159531, + -185372, -211440, -234054, -249316, -253979, -245431, -222426, -184880, + -134334, -73467, -6263, 62723, 128418, 186074, 231361, 261147, + 273444, 267948, 261810, 763373, 1198560, 1499796, 1578270, 1304628, + 517808, -987783, -3443484, -7111908, -12256820, -19143168, -27996048, -39000040, + -52248820, -67752040, -85376464, -104873664, -125808744, -147634944, -169591248, -190910720, + -210637232, -228834976, -242239792, -233744176, -184602112, -88256112, 52564248, 227312048, + 419154080, 607121280, 768828480, 883312000, 933778624, 909811200, 808862336, 636755584, + 407214048, 140391440, -139342896, -406167488, -635714880, -807834944, -908809408, -932820096, + -882419648, -768029696, -606446400, -418634368, -226977824, -52442412, 88143752, 184240560, + 233125792, 241364816, 227710480, 209276640, 189331712, 167814560, 145682224, 123701848, + 102633120, 83021960, 65302000, 49722020, 36415812, 25376218, 16511686, 9640718, + 4539034, 941445, -1420767, -2818065, -3495818, -3676385, -3542409, -3243683, + -2888735, -2555377, -2287831, -2108851, -2019462, -2010501, -2062586, -2155553, + -2267238, -2380241, -2479146, -2554886, -2600826, -2615545, -2598567, -2552488, + -2479078, -2381454, -2260948, -2119607, -1957826, -1777065, -1577959, -1362941, + -1134431, -897064, -655697, -417094, -187702, 25095, 215280, 377113, + 507239, 603471, 666470, 698219, 703186, 686502, 654728, 613906, + 570192, 528056, 491058, 460427, 436171, 416130, 397422, 375887, + 347709, 309014, 257411, 191469, 111939, 20899, -77459, -178052, + -274516, -360654, -430246, -478480, -501684, -498487, -469248, -416789, + -345433, -261310, -171090, -82033, -635, 67321, 117943, 148920, + 160318, 153895, 133448, 103776, 70703, 39859, 16616, 4954, + 7564, 25024, 56260, 98143, 146331, 195238, 239125, 272241, + 289930, 288679, 266989, 225117, 165550, 92349, 11219, -71466, + -148857, -214705, -263567, -291740, -297224, -280306, -243136, -189895, + -125985, -57873, 7933, 65157, 108741, 134971, 142193, 130597, + 102524, 61859, 13944, -35316, -79751, -113898, -133249, -135053, + -118286, -84087, -35339, 23302, 86186, 146930, 199365, 237874, + 258253, 257864, 236196, 194657, 136724, 67341, -7287, -80567, + -145896, -270343, -808574, -1340072, -1858807, -2358665, -2831742, -3270963, + -3669340, -4023521, -4333619, -4606985, -4857566, -5108708, -5390687, -5741295, + -6200425, -6807718, -7593886, -8575752, -9745172, -11063108, -12448231, -13772797, + -14853837, -15454158, -15279006, -13985197, -11185029, -6465256, 602227, 10431847, + 23410894, 39863840, 60045788, 84103768, 112100696, 143979968, 179711728, 219302416, + 264231232, 316950432, 366815488, 391499840, 373734272, 303947296, 180205328, 8607086, + -197450336, -418782432, -632721152, -815848960, -946877184, -1009294400, -993460928, -897898880, + -729596672, -503316064, -239947616, 35840880, 298430624, 524143840, 693923584, 795387200, + 824107840, 783846592, 685860544, 547189184, 388365568, 230527600, 92671240, -11219515, + -74492144, -105158200, -120261872, -127544112, -128388320, -124354624, -116661448, -106489408, + -94793200, -82429304, -70062176, -58237700, -47334588, -37619828, -29226616, -22202334, + -16501587, -12028281, -8635400, -6159899, -4423260, -3257870, -2504859, -2031762, + -1726474, -1507393, -1314142, -1112384, -883004, -624119, -340602, -45467, + 248842, 528315, 783713, 1007231, 1196662, 1351165, 1473983, 1568019, + 1637995, 1686519, 1716364, 1727429, 1719421, 1689696, 1636232, 1556028, + 1448006, 1311510, 1148760, 963094, 760758, 548770, 336091, 131254, + -56814, -221101, -355658, -457521, -525555, -561787, -569830, -555666, + -525766, -487535, -447411, -411297, -382938, -364634, -356100, -355594, + -359287, -362732, -360583, -348172, -321291, -277591, -216139, -138411, + -47457, 51579, 152676, 248783, 333218, 399646, 443388, 461240, + 452449, 418164, 361960, 288882, 205559, 118975, 36377, -35977, + -92851, -131037, -149092, -147929, -130154, -100234, -63486, -25973, + 6639, 29226, 38204, 31469, 9051, -27322, -73989, -126155, + -177996, -223678, -257577, -275273, -273644, -251592, -209808, -151108, + -79807, -1677, 76962, 149510, 210060, 253638, 277008, 278653, + 259231, -101021, -297456, -477733, -632297, -753728, -836696, -878615, + -879031, -839751, -763739, -654959, -517096, -353514, -166209, 43748, + 276781, 533724, 815969, 1123958, 1457300, 1813342, 2187857, 2574262, + 2965417, 3353797, 3734536, 4106324, 4475222, 4855377, 5272512, 5763051, + 6375849, 7168185, 8204533, 9548340, 11257436, 13371571, 15905385, 18833006, + 22081010, 25512624, 28924300, 32032662, 34478724, 35820256, 35546928, 33078728, + 27793346, 19027280, 6112874, -11628489, -34851840, -64232176, -100493888, -144608256, + -198909072, -270631488, -359662496, -448624032, -516131776, -543967680, -518454176, -432622496, + -287176640, -90768024, 140893552, 386715040, 622670976, 824595136, 971067648, 1045974272, + 1040467264, 954060352, 794731136, 578022784, 325234560, 60958056, -189791088, -404423968, + -565354624, -661869440, -691213888, -658569600, -576189312, -461441856, -334519392, -215323504, + -121182328, -57886044, -14972652, 16811060, 39759696, 55435020, 65035460, 69706136, + 70441104, 68189248, 63775032, 57948004, 51329736, 44447116, 37701544, 31399154, + 25736924, 20832988, 16723796, 13393488, 10776430, 8783249, 7304115, 6229334, + 5450365, 4874027, 4420041, 4029271, 3658127, 3282309, 2889391, 2480032, + 2060348, 1642421, 1237795, 858544, 512575, 205752, -60998, -288674, + -481834, -645256, -785054, -905653, -1011013, -1102347, -1179780, -1240896, + -1282805, -1301283, -1292960, -1254661, -1185341, -1085250, -957344, -806069, + -638185, -461195, -283738, -113885, 40607, 173836, 281340, 361227, + 413418, 440281, 445517, 434398, 412451, 385525, 358529, 335589, + 319068, 309999, 307515, 309612, 312947, 313829, 308220, 292759, + 264732, 222913, 167314, 99696, 23013, -58414, -139717, -215530, + -280898, -331372, -363803, -376281, -368659, -342216, -299851, -245477, + -183947, -120287, -59527, -210294, -218804, -207034, -170663, -107684, + -17542, 97483, 233628, 384636, 543572, 702055, 852320, 986414, + 1098210, 1182279, 1235630, 1256080, 1243695, 1198697, 1122785, 1016812, + 882318, 719277, 528144, 307851, 58485, -220576, -527549, -860384, + -1213683, -1581737, -1955989, -2329539, -2695405, -3052665, -3405215, -3769076, + -4170617, -4653891, -5276647, -6116192, -7261256, -8815022, -10881268, -13564073, + -16947616, -21093540, -26015144, -31675226, -37956612, -44665032, -51498380, -58060316, + -63829408, -68189520, -70395848, -69627624, -64938208, -55334156, -39669268, -16742548, + 15011598, 57892376, 121157856, 215274688, 334456672, 461378272, 576139200, 658546880, + 691230336, 661933376, 565469888, 404588960, 189999104, -60718748, -324979552, -577770304, + -794500352, -953869504, -1040332032, -1045906432, -971073600, -824675520, -622820672, -386923360, + -141145440, 90490632, 286893152, 432351840, 518213184, 543769536, 515984864, 448531552, + 359622208, 270636384, 198948336, 144668672, 100561448, 64293740, 34896780, 11649924, + -6117171, -19054578, -27836140, -33125540, -35583508, -35831208, -34449244, -31950346, + -28780702, -25304532, -21811144, -18510242, -15544263, -12991323, -10880449, -9198353, + -7904592, -6938712, -6232849, -5716818, -5326765, -5007114, -4715109, -4419761, + -4103101, -3757115, -3383050, -2987624, -2581751, -2177166, -1785567, -1416314, + -1076470, -769692, -497117, -257162, -46868, 137886, 301064, 446309, + 576003, 691438, 792390, 877665, 945087, 992265, 1016767, 1016861, + 991628, 941464, 867976, 774150, 663993, 542420, 414732, 286370, + 162380, 47204, -55707, -143950, -216326, -272693, -313915, -341561, + -357718, -364650, -364603, -359521, -350944, -339867, -326770, -311628, + -294057, -273429, -249069, -220397, -187092, -149183, -107127, -61803, + -14483, 33260, 79674, 122959, 161417, 193583, -137153, -86096, + -23462, 46165, 118296, 188311, 252569, 308033, 353183, 387345, + 411326, 426448, 434961, 438884, 440375, 440558, 440044, 437930, + 432614, 421046, 399869, 364878, 312384, 238720, 141646, 19702, + -126527, -295376, -483051, -684957, -894831, -1106337, -1312215, -1505978, + -1680884, -1831578, -1952736, -2040617, -2091372, -2102604, -2071473, -1996480, + -1875541, -1708206, -1493799, -1234127, -931547, -591976, -222473, 165877, + 561490, 950008, 1319512, 1659151, 1966270, 2245658, 2518227, 2819813, + 3210306, 3770160, 4608328, 5854141, 7662371, 10198175, 13638330, 18147660, + 23877010, 30930782, 39364468, 49144104, 60148836, 72123392, 84694024, 97312800, + 109298904, 119765360, 127705376, 131866912, 130934488, 123231464, 107234464, 75050672, + 9470806, -97677456, -239897616, -403333024, -569087680, -716066368, -823729024, -874943616, + -858298112, -769767616, -613463168, -401328448, -152012800, 111316600, 362752096, 579800640, + 754066560, 884317376, 967646720, 1002358976, 988932224, 930137792, 830908864, 698079680, + 539965760, 365883200, 185588480, 8720114, -155758112, -300047104, -417930816, -505075680, + -559213504, -580180096, -569826624, -531795520, -471193568, -394169856, -307444800, -217803664, + -131610264, -54348980, 9748328, 57999172, 89445504, 104945984, 107368432, 102279568, + 94596192, 85655480, 75877136, 65846368, 56016016, 46757852, 38321108, 30867838, + 24467266, 19124186, 14784349, 11357873, 8727069, 6764325, 5338255, 4325655, + 3614320, 3109507, 2733412, 2427369, 2148937, 1871452, 1580043, 1270071, + 943252, 606145, 267130, -64446, -380185, -672695, -936550, -1167777, + -1364195, -1524669, -1649207, -1738275, -1792904, -1814221, -1803670, -1762759, + -1693364, -1597596, -1478091, -1337881, -1180581, -1010189, -831132, -647987, + -465420, -287874, -119474, 36238, 176365, 298810, 402244, 486148, + 550683, 596630, 625208, 637968, 636614, 622900, 598511, 565006, + 523771, 476024, 422831, 365155, 303902, 239978, 174336, 108003, + 42099, -22177, -83566, -140800, -192647, -237981, -275829, -305435, + -326287, -338158, -341095, -335431, -321739, -300823, -273643, -241298, + -204944, -165780, -124974, -83660, -42880, 10137, 29849, 47985, + 63702, 76520, 86314, 93425, 98550, 102746, 107236, 113334, + 122202, 134769, 151505, 172398, 196816, 223585, 250966, 276853, + 298844, 314511, 321522, 317919, 302199, 273538, 231774, 177523, + 112040, 37218, -44643, -130911, -218896, -305922, -389579, -467717, + -538627, -600924, -653636, -695990, -727439, -747408, -755314, -750348, + -731559, -697715, -647504, -579487, -492405, -385195, -257342, -108895, + 59211, 245234, 446381, 659034, 878627, 1100007, 1317397, 1524851, + 1716231, 1885675, 2027510, 2136678, 2208531, 2239209, 2225330, 2164370, + 2054318, 1894140, 1683476, 1423258, 1115462, 763860, 373717, -47467, + -490570, -944379, -1396841, -1835173, -2248037, -2626382, -2966637, -3272111, + -3556917, -3847305, -4185583, -4630274, -5258922, -6165632, -7461554, -9268313, + -11715324, -14927984, -19021866, -24085232, -30171698, -37277344, -45335748, -54189964, + -63598244, -73198584, -82549584, -91078392, -98377112, -103118416, -100391208, -84628624, + -52954552, -4492618, 59827860, 137363792, 223933312, 314109568, 401591168, 479653696, + 541630720, 581410176, 593897728, 575427264, 524078976, 439891712, 324946016, 183315184, + 20883088, -154960944, -335730752, -512333504, -675605952, -816870016, -928462720, -1004220224, + -1039868736, -1033319296, -984830528, -897064000, -775182272, -627308096, -461708352, -284291552, + -100579392, 83598736, 262525088, 430732416, 583209600, 715532736, 824009920, 905775040, + 958871552, 982291840, 975995776, 940888192, 878773504, 792274432, 684731072, 560072576, + 422675872, 277208288, 128466608, -18787604, -159985744, -290901824, -407785088, -507474624, + -587489088, -646091776, -682326144, -696024192, -687785152, -658928000, -611418688, -547776704, + -470963680, -384259392, -291130144, -195094672, -99592464, -7860071, 77180528, 153017120, + 217622960, 269510560, 307761952, 332035072, 342546656, 340033376, 325693088, 301109632, + 268164672, 228941216, 185622192, 140390128, 95330560, 52345244, 13076479, -21151680, + -49376268, -71017224, -85881800, -94147080, -96327536, -93222768, -85856648, -75400496, + -63097824, -50176000, -37774988, -26857674, -18169908, -11863887, -7301392, -3914018, + -1479242, 185291, 1236420, 1817970, 2053955, 2052907, 1903852, 1679448, + 1434536, 1209401, 1029974, 911183, 857962, 868350, 934655, 1046022, + 1189342, 1351150, 1518125, 1678330, 1821294, 1938725, 2024278, 2073883, + 2085335, 2058391, 1994281, 1895693, 1766278, 1610593, 1433645, 1240831, + 1037545, 829139, 620601, 416556, 221024, 37473, -131344, -283279, + -416878, -531220, -625958, -701127, -757159, -794697, -814605, -817824, + -805400, -778384, -737905, -685103, -621229, -547610, -465741, -377252, + -283979, -187900, -91166, 4001, 95326, 180608, 257764, 324972, + 380709, 423871, 453787, 470280, 473637, 464613, 444338, 414280, + 376112, 331644, 282692, 231012, 178188, 125609, 74399, 25440, + -20646, -63433, -102670, -138199, -169921, -197722, -221454, -240892, + -255747, -265667, -270281, -269233, -262252, -249189, -230092, -205221, + -175099, -140492, -102411, -62059, -20785, 19997, 58880, 94556, + 125879, 151942, 172113, 186075, 193810, 195596, 191955, 183604, + 171377, 156168, 138843, 120200, 100900, 81458, 62216, 43368, + 24971, 6998, -10624, -27957, -45013, -61705, -77836, -93079, + -106999, -119067, -128714, -135370, -138532, -137806, -132971, -123999, + -111091, -94667, -75361, -53969, 10765, 32074, 52722, 72311, + 90486, 106963, 121523, 134027, 144392, 152600, 158658, 162605, + 164468, 164267, 161985, 157577, 150955, 142011, 130615, 116649, + 100019, 80692, 58704, 34200, 7431, -21221, -51265, -82083, + -112977, -143167, -171845, -198187, -221409, -240776, -255657, -265518, + -269970, -268744, -261725, -248915, -230452, -206572, -177616, -143996, + -106204, -64784, -20348, 26444, 74865, 124130, 173377, 221686, + 268054, 311432, 350709, 384766, 412472, 432751, 444591, 447117, + 439606, 421553, 392681, 352994, 302769, 242592, 173323, 96118, + 12366, -76299, -168083, -261025, -353085, -442152, -526117, -602884, + -670441, -726859, -770364, -799329, -812348, -808221, -786031, -745129, + -685209, -606288, -508783, -393474, -261578, -114689, 45155, 215561, + 393723, 576534, 760547, 942104, 1117306, 1282158, 1432549, 1564416, + 1673729, 1756688, 1809722, 1829726, 1814087, 1760970, 1669365, 1539414, + 1372449, 1171316, 940345, 685584, 414591, 136477, -138614, -399774, + -636264, -838162, -997771, -1110606, -1177191, -1204204, -1206433, -1207707, + -1242622, -1356751, -1607660, -2063815, -2804506, -3917005, -5495374, -7636020, + -10436517, -13992514, -18402674, -23818388, -30616280, -38795064, -47468192, -55465196, + -61624760, -64816688, -64030596, -58439904, -47471160, -30852034, -8650500, 18708296, + 50440096, 85421744, 122227560, 159185040, 194443776, 226058080, 252076752, 270638720, + 280067616, 278963616, 266285680, 241422224, 204245248, 155146128, 95049592, 25405990, + -51839956, -134302160, -219227456, -303587872, -384188544, -457786240, -521215424, -571515392, + -606054656, -622647040, -619654592, -596072512, -551593600, -486646944, -402411264, -300798944, + -184413264, -56477480, 79260352, 218645328, 357251200, 490529920, 613968768, 723250432, + 814409344, 883978944, 929123648, 947751552, 938601472, 901303104, 836405248, 745373248, + 630551936, 495099232, 342887840, 178382704, 6494100, -167583760, -338549120, -501169472, + -650463872, -781868416, -891402304, -975790912, -1032769600, -1061261696, -1060915456, -1031960960, + -975385600, -892916224, -786977856, -660620736, -517435968, -361449888, -197010624, -28662768, + 138980608, 301369056, 454141632, 593248768, 715063168, 816478784, 894992576, 948769664, + 976686784, 978356608, 954128576, 905069824, 832924288, 740053568, 629360000, 504194944, + 368255424, 225472400, 79893288, -64436384, -203589744, -333869568, -451910592, -554770112, + -640004160, -705727744, -750656768, -774131456, -776120512, -757206720, -718553856, -661857536, + -589281088, -503378688, -407008864, -303241088, -195258304, -86258672, 20640266, 122492392, + 216605760, 300615264, 372542752, 430843584, 474437952, 502727104, 515593600, 513386816, + 496894016, 467298720, 426127872, 375190336, 316508064, 252243568, 184625248, 115873648, + 48130852, -16604751, -76536328, -130117360, -176090096, -213512624, -241774240, -260598816, + -270036736, -270445792, -262462656, -246965456, -225030192, -197881696, -166842016, -133277536, + -98547200, -63953468, -30697916, 157309, 27720696, 51294532, 70389352, 84729480, + 94249824, 99084304, 99546808, 96105616, 89352656, 79969008, 68688296, 56259452, + 43410724, 30816176, 19066356, 8644033, -93590, -6926218, -11773978, -14694671, + -15872813, -15605618, -14280676, -12378042, -10430668, -8704424, -7182491, -5854782, + -4729147, -3804335, -3072066, -2516383, -2116394, -1847634, -1684290, -1600530, + -1572012, -1576721, -1595767, -1613665, -1618550, -1602016, -1558925, -1486975, + -1386301, -1258946, -1108416, -939180, -756297, -565028, -370575, -177839, + 8715, 185182, 348246, 495214, 623986, 733038, 821363, 888436, + 934161, 958831, 963086, 947887, 914478, 864367, 799293, 721209, + 632236, 534643, 430794, 323115, 214029, 105923, 1076, -98376, + -190504, -273617, -346304, -407458, -456294, -492355, -515505, -525917, + -524051, -510616, -486547, -452951, -411079, -362277, -307954, -249541, + -188465, -126117, -63839, -2894, 55536, 110376, 160649, 205502, + 244200, 276144, 300872, 318070, 327574, 329385, 323660, 310724, + 291059, 265298, 234214, 198698, 159739, 118393, 75754, 32922, + -9033, -49104, -86375, -120044, -149449, -174076, -193569, -207727, + -216503, -219983, -218381, -212007, -201261, -186599, -168524, -147564, + -124261, -99161, -72807, -45733, -18468, 8473, 34584, 59372, + 82359, 103090, 121141, 136131, 147730, 155680, 159803, 160015, + 156337, 148897, 137934, 123794, 106916, 87821, 67091, 45345, + 23216, 1326, -19743, -39465, 109887, 120382, 128416, 133765, + 136261, 135794, 132320, 125859, 116497, 104388, 89749, 72858, + 54047, 33695, 12222, -9922, -32266, -54329, -75626, -95683, + -114044, -130284, -144009, -154878, -162593, -166923, -167696, -164811, + -158239, -148026, -134294, -117244, -97153, -74370, -49314, -22469, + 5628, 34390, 63198, 91407, 118365, 143426, 165965, 185395, + 201183, 212860, 220042, 222435, 219848, 212195, 199508, 181929, + 159715, 133233, 102952, 69434, 33331, -4639, -43696, -83016, + -121744, -159013, -193957, -225733, -253530, -276597, -294249, -305894, + -311042, -309326, -300512, -284516, -261407, -231423, -194963, -152600, + -105060, -53228, 1881, 59128, 117284, 175043, 231069, 284005, + 332527, 375354, 411300, 439283, 458370, 467783, 466935, 455431, + 433101, 399985, 356360, 302726, 239820, 168592, 90219, 6068, + -82296, -173156, -264641, -354785, -441533, -522811, -596538, -660703, + -713385, -752830, -777471, -786003, -777391, -750944, -706300, -643488, + -562898, -465330, -351937, -224267, -84196, 66044, 223948, 386697, + 551263, 714370, 872609, 1022412, 1160192, 1282340, 1385409, 1466141, + 1521718, 1549819, 1548936, 1518450, 1458982, 1372447, 1262386, 1133907, + 993924, 850871, 714752, 596518, 507835, 460031, 463573, 526525, + 653821, 845263, 1094812, 1388217, 1702729, 2004387, 2248836, 2377871, + 2322716, 1997670, 1310909, 31361, -2276023, -5884963, -10790734, -16840258, + -23748608, -31120974, -38472224, -45255760, -50892408, -54804412, -56448304, -55348896, + -51129788, -43541476, -32483506, -18021422, -395893, 19975162, 42503072, 66442420, + 90913264, 114929960, 137436576, 157346768, 173587488, 185144144, 191106144, 190710336, + 183381248, 168765648, 146760624, 117533176, 81530704, 39481248, -7616625, -58514600, + -111745512, -165663824, -218494432, -268388400, -313484064, -351971232, -382156480, -402527424, + -411813344, -409040128, -393577504, -365176384, -323994752, -270611200, -206024384, -131639056, + -49237472, 39062252, 130860688, 223542656, 314352192, 400474784, 479124064, 547630784, + 603530816, 644649344, 669178624, 675746624, 663473536, 632014912, 581589056, 512987520, + 427568224, 327230528, 214373088, 91835128, -37177272, -169178032, -300498464, -427392512, + -546146752, -653191616, -745210944, -819245440, -872788352, -903868288, -911118272, -893827520, + -851974272, -786238976, -697996288, -589286400, -462766208, -321640832, -169578832, -10611593, + 150978672, 310780032, 464377088, 607478720, 736043264, 846397952, 935348160, 1000273472, + 1039207744, 1050900416, 1034856960, 991357632, 921452992, 826937088, 710298944, 574652800, + 423651328, 261382080, 92266240, -79072984, -248102448, -410503776, -562126720, -699092736, + -817911936, -915573376, -989624896, -1038234688, -1060238592, -1055167808, -1023259008, -965445760, + -883330880, -779142016, -655670144, -516193728, -364390176, -204236960, -39905496, 124349848, + 284304192, 435873248, 575219968, 698854144, 803721536, 887281600, 947570240, 983247040, + 993625152, 978684224, 939064256, 876042880, 791495168, 687838208, 567961280, 435144608, + 292968064, 145212944, -4240369, -151516576, -292848000, -424673056, -543728192, -647130176, + -732447680, -797759168, -841696640, -863474048, -862898880, -840368384, -796849536, -733844032, + -653339328, -557747648, -449833824, -332635680, -209377712, -83381528, 42024892, 163596368, + 278255872, 383173696, 475838368, 554117568, 616307264, 661168640, 687951104, 696401792, + 686761024, 659744256, 616512064, 558627584, 488004704, 406847392, 317582464, 222787984, + 125119136, 27233782, -68280144, -158973472, -242598960, -317167264, -380994112, -432737696, + -471425664, -496470656, -507674976, -505223904, -489668640, -461899200, -423108800, -374750624, + -318488480, -256143216, -189636144, -120931576, -51979948, 15336795, 79255984, 138179872, + 190714864, 235703648, 272249056, 299729728, 317807040, 326423456, 325792768, 316382656, + 298890368, 274212512, 243410272, 207670816, 168266608, 126513920, 83731472, 41200944, + 130175, -38379756, -73362784, -104010672, -129689920, -149952464, -164540112, -173382736, + -176590656, -174441552, -167362736, -155909328, -140739472, -122587248, -102234616, -80482928, + -58125464, -35921428, -14572560, 5297181, 23158150, 38587464, 51277008, 61037024, + 67795232, 71591800, 72570464, 70966328, 67090884, 61315048, 54050700, 45731812, + 36795552, 27664472, 18730052, 10338603, 2779584, -3722787, -9014984, -13015846, + -15715349, -17169656, -17493876, -16851572, -15443180, -13491852, -11229971, -8883501, + -6659666, -4731320, -3230436, -2179638, -1456508, -951706, -619736, -422906, + -328742, -307762, -334784, -388143, -450439, -507929, -550755, -572282, + -568989, -539768, -485654, -409163, -313997, -204481, -85334, 38748, + 163232, 284008, 397435, 500481, 590686, 666220, 725799, 768696, + 794640, 803805, 796717, 774237, 737483, 687817, 626774, 556060, + 477482, 392946, 304395, 213796, 123081, 34130, -51284, -131518, + -205101, -270753, -327424, -374293, -410797, -436619, -451696, -456198, + -450524, -435265, -411195, -379231, -340412, -295864, -246780, -194382, + -139908, -84576, -29579, 23948, 74940, 122415, 165488, 203392, + 235477, 261232, 280287, 292420, 297563, 295805, 287381, 272679, + 252217, 226642, 196699, 163225, 127113, 89298, 50723, 12319, + -25022, -60468, -93267, -122762, -148403, -169755, -186505, -198455, + -205529, -207755, -205269, -198296, -187147, -172200, -153899, -132733, + -109235, -83965, -57505, -30448, -3387, 23090, 48419, 72062, + 93519, 112344, 128152, 140629, 149540, 154739, 156171, 153875, + 147984, 138721, 126390, 111370, 94099, 75064, 54779, 33779, + 12593, -8262, -28303, -47084, 123494, 129971, 133493, 133924, + 131201, 125331, 116398, 104559, 90037, 73124, 54170, 33578, + 11793, -10702, -33406, -55797, -77356, -97567, -115939, -132009, + -145355, -155607, -162458, -165670, -165080, -160609, -152268, -140154, + -124457, -105454, -83508, -59060, -32622, -4767, 23884, 52680, + 80946, 108005, 133192, 155874, 175459, 191418, 203293, 210711, + 213394, 211167, 203964, 191828, 174916, 153495, 127939, 98723, + 66416, 31667, -4798, -42202, -79720, -116501, -151685, -184419, + -213882, -239294, -259946, -275209, -284560, -287590, -284024, -273728, + -256722, -233178, -203429, -167959, -127402, -82528, -34229, 16495, + 68562, 120826, 172104, 221199, 266929, 308151, 343787, 372847, + 394455, 407868, 412493, 407908, 393872, 370338, 337461, 295599, + 245318, 187388, 122773, 52620, -21757, -98901, -177232, -255084, + -330731, -402431, -468456, -527135, -576892, -616284, -644032, -659054, + -660495, -647746, -620468, -578601, -522379, -452338, -369318, -274467, + -169243, -55405, 64986, 189594, 315816, 440826, 561623, 675096, + 778120, 867669, 940959, 995619, 1029881, 1042792, 1034432, 1006137, + 960689, 902497, 837686, 774157, 721490, 690799, 694367, 745251, + 856581, 1040935, 1309312, 1670468, 2129651, 2688819, 3345656, 4105519, + 4976393, 5840188, 6459558, 6619945, 6147045, 4905821, 2810464, -169248, + -4002855, -8597662, -13799897, -19399282, -25136440, -30713178, -35805064, -40075928, + -43193604, -44846368, -44759276, -42709760, -38541820, -32178052, -23629058, -12999656, + -491521, 13597969, 28880844, 44887552, 61079704, 76866240, 91622528, 104711816, + 115508400, 123421568, 127919688, 128553392, 124977088, 116967832, 104440944, 87461480, + 66251100, 41189824, 12812431, -18200672, -51037968, -84776544, -118406512, -150859520, + -181040640, -207862576, -230281344, -247332144, -258164320, -262074240, -258534976, -247221616, + -228031216, -201096704, -166793872, -125740976, -78790864, -27015406, 28317512, 85773968, + 143790256, 200714592, 254853088, 304518720, 348082144, 384022272, 410975936, 427784064, + 433533952, 427595232, 409648832, 379707872, 338129120, 285614880, 223204848, 152257552, + 74422120, -8399482, -94098672, -180413920, -264990464, -345444480, -419429888, -484706304, + -539205312, -581094272, -608834752, -621234048, -617488768, -597217728, -560484416, -507806784, + -440154880, -358935456, -265963920, -163424032, -53816484, 60102860, 175393008, 289004832, + 397862624, 498948160, 589385088, 666520704, 728003904, 771855360, 796529472, 800965376, + 784625088, 747518528, 690213376, 613829888, 520020448, 410934048, 289166720, 157698512, + 19819390, -120954952, -260974400, -396551008, -524057792, -640027584, -741248576, -824854336, + -888405760, -929962176, -948139904, -942156672, -911859520, -857736896, -780912768, -683123584, + -566678912, -434405344, -289576544, -135830144, 22925716, 182614304, 339097376, 488284896, + 626244608, 749307648, 854168576, 937975616, 998409984, 1033750912, 1042925056, 1025539008, + 981893504, 912979136, 820453376, 706599552, 574268864, 426807104, 267967136, 101810936, + -67397744, -235305840, -397586848, -550055296, -688779008, -810183040, -911146880, -989084800, + -1042054592, -1068829184, -1068826112, -1042089792, -989328512, -911898304, -811770624, -691481728, + -554069376, -402995648, -242059584, -75301504, 93098968, 258928160, 418044256, 566481536, + 700549504, 816925696, 912738304, 985637504, 1033853888, 1056241408, 1052304960, 1022211200, + 966782848, 887476096, 786342208, 665974016, 529439200, 380201408, 222031488, 58911676, + -105065728, -265801808, -419294496, -561739072, -689623232, -799814720, -889638656, -956942720, + -1000149696, -1018294336, -1011044736, -978708096, -922219648, -843115968, -743493120, -625951040, + -493525056, -349607232, -197858608, -42115448, 113708584, 265721584, 410151424, 543440192, + 662332480, 763955904, 845890496, 906227200, 943612480, 957278400, 947058112, 913385664, + 857280704, 780318336, 684585088, 572622656, 447359776, 312035584, 170115056, 25199920, + -119063552, -259076960, -391380192, -512737632, -620217856, -711264960, -783759808, -836069184, + -867082944, -876236800, -863521472, -829477248, -775175296, -702184896, -612528832, -508627616, + -393234080, -269360256, -140198384, -9038325, 120816904, 246134720, 363834016, 471061440, + 565260864, 644234816, 706195520, 749805696, 774206528, 779033856, 764420928, 730989120, + 679825600, 612449984, 530770240, 437028800, 333741664, 223630656, 109551536, -5580210, + -118864264, -227488864, -328800992, -420371296, -500052800, -566030976, -616865088, -651519232, + -669382144, -670276608, -654456960, -622595968, -575760768, -515379648, -443199648, -361236896, + -271720576, -177032864, -79645232, 17945830, 113283088, 204010512, 287931712, 363063040, + 427680576, 480359328, 520004224, 545871936, 557583232, 555125952, 538848000, 509441632, + 467918976, 415579744, 353972064, 284847840, 210113616, 131778400, 51899980, -27469024, + -104333832, -176807568, -243157520, -301846336, -351567360, -391273184, -420196800, -437865024, + -444103968, -439036576, -423072480, -396890720, -361415584, -317786848, -267324960, -211492304, + -151851792, -90023688, -27642056, 33688092, 92431824, 147162464, 196595872, 239620272, + 275320544, 302996800, 322176864, 332622304, 334328064, 327516064, 312622880, 290282112, + 261301872, 226638432, 187366672, 144647984, 99697160, 53748436, 8022341, -36306296, + -78138080, -116475864, -150447968, -179327376, -202546304, -219706160, -230582416, -235124880, + -233452928, -225846496, -212732912, -194670144, -172327120, -146461568, -117896304, -87494416, + -56134348, -24685366, 6015840, 35186796, 62118600, 86192504, 106893400, 123819856, + 136690672, 145347696, 149755152, 149995552, 146262368, 138849824, 128140336, 114589888, + 98711832, 81059840, 62210316, 42744900, 23233612, 4218996, -13798199, -30371520, + -45119144, -57731856, -67978520, -75708944, -80854288, -83424880, -83505872, -81250776, + -76873240, -70637384, -62847076, -53834452, -43948188, -33541804, -22962404, -12540202, + -2579104, 6651381, 14922708, 22052188, 27906138, 32401252, 35504228, 37229756, + 37636996, 36824736, 34925464, 32098614, 28523208, 24390258, 19895138, 15230230, + 10578097, 6105390, 1957699, -1744518, -4908812, -7472372, -9402388, -10695210, + -11374340, -11487438, -11102430, -10302999, -9183557, -7844043, -6384651, -4900844, + -3478715, -2191066, -1094124, -225317, 398208, 779956, 943926, 936293, + 833844, 703157, 565034, 427621, 299915, 188242, 97070, 28671, + -16282, -38631, -40246, -23848, 7370, 49924, 100305, 155103, + 211184, 265743, 316398, 361188, 398601, 427542, 447320, 457596, + 458351, 449838, 432541, 407131, 374438, 335404, 291067, 242523, + 190911, 137380, 83081, 29131, -23391, -73477, -120193, -162709, + -200302, -232373, -258456, -278222, -291483, -298191, -298431, -292422, + -280496, -263099, -240767, -214119, -183837, -150654, -115335, -78667, + -41439, -4430, 31603, 65943, 97920, 126924, 152420, 173951, + 191152, 203753, 211586, 214590, 212809, 206390, 195581, 180724, + 162245, 140642, 116472, 90338, 62871, 34716, 6512, -21115, + -47577, -72327, -94874, -114790, -131717, -145374, -155554, -162130, + -165050, -164338, -160089, -152466, -141696, -128062, -111900, -93592, + -73557, -52247, -30134, -7706, 14546, 36139, 56604, 75501, + 92426, 107025, 118997, 128106, 134187, 137146, 136964, 133700, + 127480, 118502, 107020, 93345, 116040, 106373, 94004, 79158, + 62121, 43240, 22912, 1579, -20281, -42169, -63569, -83966, + -102856, -119760, -134234, -145882, -154369, -159426, -160859, -158557, + -152493, -142728, -129410, -112770, -93122, -70853, -46417, -20326, + 6860, 34548, 62118, 88942, 114393, 137861, 158767, 176575, + 190802, 201034, 206937, 208261, 204852, 196660, 183736, 166241, + 144442, 118709, 89511, 57407, 23039, -12886, -49603, -86311, + -122184, -156394, -188125, -216596, -241075, -260902, -275496, -284383, + -287194, -283688, -273753, -257415, -234835, -206316, -172290, -133320, + -90085, -43369, 5950, 56922, 108538, 159746, 209478, 256659, + 300236, 339190, 372562, 399462, 419103, 430808, 434043, 428427, + 413772, 390087, 357626, 316892, 268676, 214058, 154439, 91515, + 27295, -35962, -95765, -149503, -194502, -228208, -248287, -252875, + -240711, -211453, -165805, -105883, -35276, 40539, 114314, 176503, + 215759, 217978, 167946, 29216, -265669, -759935, -1454826, -2329191, + -3341857, -4434792, -5535889, -6563153, -7428902, -8044769, -8326572, -8199427, + -7602384, -6492797, -4849871, -2677498, -5997, 3107152, 6577829, 10296906, + 14133125, 17937022, 21545892, 24789544, 27496750, 29502072, 30652904, 30816402, + 29886096, 27787848, 24484978, 19982264, 14328683, 7618649, -8275, -8369346, + -17242212, -26370120, -35468600, -44233488, -52350068, -59503100, -65387360, -69718488, + -72243656, -72751784, -71082920, -67136432, -60877660, -52342804, -41641768, -28958772, + -14550630, 1257369, 18077938, 35470524, 52952152, 70010080, 86115976, 100741256, + 113373128, 123530864, 130781872, 134756976, 135164528, 131802696, 124569704, 113471440, + 98626208, 80266312, 58736392, 34488268, 8072537, -19873172, -48638900, -77459776, + -105535736, -132052984, -156206736, -177224544, -194389536, -207063008, -214705568, -216896176, + -213348592, -203924480, -188642880, -167685488, -141397504, -110283944, -75001352, -36344852, + 4768980, 47323316, 90225720, 132335712, 172494592, 209556688, 242421216, 270063936, + 291567712, 306150848, 313192864, 312256320, 303104480, 285713824, 260281152, 227224928, + 187180496, 140989248, 89681992, 34456540, -23349740, -82291968, -140853584, -197485040, + -250644464, -298839136, -340666720, -374855200, -400300192, -416098816, -421578912, -416322848, + -400184960, -373302304, -336098016, -289277056, -233814336, -170935472, -102090216, -28919474, + 46783608, 123117448, 198119696, 269817600, 336279616, 395667328, 446285568, 486630272, + 515431904, 531693952, 534724512, 524161024, 499986336, 462536352, 412498304, 350899776, + 279088736, 198704400, 111640296, 19999716, -73955136, -167859072, -259303504, -345898400, + -425334720, -495445856, -554266496, -600087168, -631503040, -647455744, -647266496, -630660352, + -597779904, -549188672, -485863232, -409174688, -320859648, -222981056, -117879984, -8119592, + 103577704, 214398032, 321507232, 422123680, 513590720, 593446784, 659491904, 709847616, + 743010112, 757894080, 753866240, 730767680, 688924608, 629145984, 552709376, 461334048, + 357142464, 242611072, 120511064, -6158985, -134247200, -260527344, -381780576, -494877952, + -596861632, -685022336, -756971776, -810707072, -844666432, -857773504, -849470528, -819737792, + -769099840, -698617600, -609866880, -504903104, -386213792, -256659104, -119402648, 22166518, + 164518080, 304069184, 437275360, 560721088, 671207872, 765837888, 842089984, 897887232, + 931653440, 942357376, 929543168, 893346752, 834496704, 754300416, 654615040, 537804480, + 406682912, 264446352, 114594352, -39157032, -192968032, -342971968, -485373120, -616543680, + -733116800, -832073664, -910822080, -967264896, -999856064, -1007642752, -990292800, -948106752, + -882013184, -793548800, -684822016, -558462848, -417558400, -265576992, -106281872, 56362708, + 218291040, 375438528, 523844608, 659753344, 779709440, 880646656, 959966976, 1015607872, + 1046096320, 1050588096, 1028890880, 981471296, 909444864, 814549696, 699104192, 565949568, + 418379808, 260058736, 94928648, -72889120, -239197984, -399832192, -550762240, -688196992, + -808680064, -909177600, -987155392, -1040643904, -1068288256, -1069383232, -1043891456, -992444800, + -916328960, -817451520, -698297344, -561877056, -411613792, -251225136, -84665176, 83959240, + 250492800, 410833184, 561032192, 697392512, 816558400, 915598016, 992075520, 1044110528, + 1070424512, 1070372096, 1043956672, 991830592, 915278784, 816187328, 696996800, 560642560, + 410482208, 250213232, 83781792, -84714288, -251126384, -411357152, -561461504, -697743552, + -816847808, -915841536, -992287296, -1044302592, -1070606528, -1070551232, -1044137856, -992016512, + -915470336, -816383744, -697196352, -560842560, -410679552, -250404528, -83963680, 84544936, + 250972336, 411220768, 561344576, 697647424, 816773248, 915788800, 992256192, 1044292480, + 1070616448, 1070579840, 1044183488, 992077376, 915544384, 816468800, 697290112, 560942720, + 410783712, 250510352, 84068912, -84442472, -250874656, -411129728, -561261824, -697574272, + -816710848, -915738048, -992217536, -1044266240, -1070602624, -1070578112, -1044193344, -992097920, + -915574656, -816507712, -697336256, -560994752, -410840192, -250569808, -84129840, 84381496, + 250815008, 411072672, 561208512, 697525760, 816667968, 915701504, 992187968, 1044243968, + 1070587840, 1070570944, 1044193664, 992105472, 915588992, 816528256, 697362432, 561025728, + 410875072, 250607648, 84169704, -84340632, -250774144, -411032768, -561170496, -697490560, + -816636288, -915674048, -992165248, -1044226432, -1070575744, -1070564352, -1044192576, -992109760, + -915598336, -816542272, -697380608, -561047424, -410899648, -250634432, -84197944, 84311648, + 250745136, 411004448, 561143488, 697465472, 816613632, 915654272, 992148736, 1044213504, + 1070566592, 1070559104, 1044191232, 992112320, 915604608, 816552064, 697393600, 561063296, + 410917984, 250654720, 84219640, -84289112, -250722352, -410981984, -561121984, -697445376, + -816595520, -915638656, -992135872, -1044203776, -1070560128, -1070556032, -1044191616, -992116032, + -915611456, -816561792, -697405888, -561077696, -410934112, -250672080, -84237752, 84270736, + 250704176, 410964480, 561105536, 697430400, 816582400, 915627520, 992127104, 1044197440, + 1070556416, 1070555008, 1044193216, 992120256, 915618176, 816570816, 697417024, 561090688, + 410948576, 250687680, 84254088 +}; + +#endif diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index e82ffe9b1d9079486385074580855c1a4d032c83..6adf3b6bf5e10837eb9f9dbbc03bbc68cf46f348 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -532,6 +532,11 @@ extern const Word16 ivas_fb_cf_1ms_16k_fx[IVAS_FB_1MS_16K_SAMP]; extern const float ivas_fb_resp_cheby_ramp_32del[IVAS_FB_1MS_32K_SAMP + 1]; extern const float ivas_fb_resp_cheby_ramp_16del[IVAS_FB_1MS_16K_SAMP + 1]; +#ifdef IVAS_FLOAT_FIXED +extern const Word32 ivas_fb_resp_cheby_ramp_32del_fx[IVAS_FB_1MS_32K_SAMP + 1]; +extern const Word32 ivas_fb_resp_cheby_ramp_16del_fx[IVAS_FB_1MS_16K_SAMP + 1]; +#endif + extern const int16_t ivas_num_active_bands[FB - WB + 1]; /*------------------------------------------------------------------------------------------* @@ -582,5 +587,18 @@ extern const ACPL_QUANT_TABLE ivas_mc_paramupmix_beta_quant_table[9]; extern const ACPL_QUANT_TABLE_FX ivas_mc_paramupmix_alpha_quant_table_fx; extern const ACPL_QUANT_TABLE_FX ivas_mc_paramupmix_beta_quant_table_fx[9]; #endif // IVAS_FLOAT_FIXED + +#ifdef IVAS_FLOAT_FIXED +extern const Word32 ivas_han_win_48k_fx[L_FRAME32k]; +extern const Word32 ivas_han_win_32k_fx[L_FRAME32k]; +extern const Word32 ivas_han_win_16k_fx[L_FRAME32k]; + +extern const Word32 ivas_sine_delay_32_fx[32]; +extern const Word32 ivas_sine_frame_len_640_fx[577]; + +extern const Word32 ivas_fb_fr_12band_1ms_re_fx[IVAS_FB_12_1MS_LEN]; +extern const Word32 ivas_fb_fr_12band_1ms_im_fx[IVAS_FB_12_1MS_LEN]; +#endif + /* IVAS_ROM_COM_H */ #endif diff --git a/lib_com/ivas_spar_com.c b/lib_com/ivas_spar_com.c index c178fcc80641c0d06b682b3b3abb57979319d218..5928252414ed1725f197b880e622983a71e586bd 100644 --- a/lib_com/ivas_spar_com.c +++ b/lib_com/ivas_spar_com.c @@ -935,8 +935,8 @@ static void ivas_get_pred_coeffs_fx( den_f = L_shl( Mpy_32_32( dm_beta_re, g_th_sq ), 1 ); den_f = L_max( den_f, 1 ); dm_g[b] = activew_quad_thresh; // Q29 - DM_F[b] = BASOP_Util_Divide3232_Scale( Mpy_32_32( dm_g[b], num_f ), den_f, &s_dm_f ); - div_shift = 15 - ( 29 - ( 31 ) ) + s_dm_f; + DM_F[b] = BASOP_Util_Divide3232_Scale_cadence( Mpy_32_32( dm_g[b], num_f ), den_f, &s_dm_f ); + div_shift = sub(s_dm_f, 2); DM_F[b] = L_shl( DM_F[b], div_shift ); // Q30 } } diff --git a/lib_com/ivas_stat_com.h b/lib_com/ivas_stat_com.h index 47ab659aa68e92cfc82aff722959fd67e56812a6..437b8d55ee7a79d3559bef548b5b7094cfb8c50c 100644 --- a/lib_com/ivas_stat_com.h +++ b/lib_com/ivas_stat_com.h @@ -789,6 +789,11 @@ typedef struct ivas_fb_consts_t const int16_t *pFilterbank_bins_per_band; const int16_t *pFilterbank_bins_start_offset; +#ifdef IVAS_FLOAT_FIXED + const Word32 *ppFilterbank_FRs_fx[2][IVAS_MAX_NUM_BANDS]; // Q30 + Word32 *ppFilterbank_FRs_non48k_fx[2][IVAS_MAX_NUM_BANDS]; // Q30 +#endif + } ivas_fb_consts_t; typedef struct ivas_fb_bin_to_band_data_t @@ -834,6 +839,13 @@ typedef struct ivas_fb_mixer_state_structure float *ppFilterbank_prior_input[IVAS_MAX_FB_MIXER_IN_CH]; float *prior_mixer[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; +#ifdef IVAS_FLOAT_FIXED + Word32 *ppFilterbank_inFR_re_fx[IVAS_MAX_FB_MIXER_IN_CH]; + Word32 *ppFilterbank_inFR_im_fx[IVAS_MAX_FB_MIXER_IN_CH]; + Word32 *ppFilterbank_prior_input_fx[IVAS_MAX_FB_MIXER_IN_CH]; + Word32 *prior_mixer_fx[IVAS_MAX_FB_MIXER_OUT_CH][IVAS_MAX_SPAR_FB_MIXER_IN_CH]; +#endif + /* store sin part in const table (no need to store 1s and 0s, no need to do windowing for 1's and 0's as well) */ int16_t cross_fade_start_offset; int16_t cross_fade_end_offset; @@ -848,6 +860,7 @@ typedef struct ivas_fb_mixer_state_structure const Word16 *pFilterbank_cross_fade_fx; Word16 cldfb_cross_fade_fx[CLDFB_NO_COL_MAX]; Word16 cldfb_cross_fade_q; + const Word16 *pAna_window_fx; #endif // IVAS_FLOAT_FIXED int16_t cldfb_cross_fade_start; int16_t cldfb_cross_fade_end; diff --git a/lib_dec/acelp_core_dec_ivas_fx.c b/lib_dec/acelp_core_dec_ivas_fx.c index d235d54b66569178e6ed422618b289d7d7dc37ee..211a696d1f811ca7c230f58c7397340439025abe 100644 --- a/lib_dec/acelp_core_dec_ivas_fx.c +++ b/lib_dec/acelp_core_dec_ivas_fx.c @@ -1572,9 +1572,11 @@ ivas_error acelp_core_dec_ivas_fx( Word16 offset = sub(st->cldfbAna->p_filter_length, st->cldfbAna->no_channels); Scale_sig32(st->cldfbAna->cldfb_state_fx, offset, 1); //Q12 + st->cldfbAna->Q_cldfb_state = Q12; cldfbAnalysis_ivas_fx(syn_32_fx, realBuffer_fx, imagBuffer_fx, -1, st->cldfbAna); Scale_sig32(st->cldfbAna->cldfb_state_fx, offset, -1); //Q11 + st->cldfbAna->Q_cldfb_state = Q11; /* analysis and add the BPF error signal */ Word32 tmp_bpf_error_signal_fx[L_FRAME16k]; @@ -1594,6 +1596,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, -Q7); //Q0 } Scale_sig32(st->cldfbBPF->cldfb_state_fx, cldfb_state_offset, q_bpf_error_signal - Q10); //q_bpf_error_signal (Q6) + st->cldfbBPF->Q_cldfb_state = q_bpf_error_signal; tmp = -1; move16(); @@ -1605,6 +1608,7 @@ ivas_error acelp_core_dec_ivas_fx( addBassPostFilter_ivas_fx(tmp_bpf_error_signal_fx, tmp, realBuffer_fx, imagBuffer_fx, st->cldfbBPF); Scale_sig32(st->cldfbBPF->cldfb_state_fx, cldfb_state_offset, -(q_bpf_error_signal - Q10)); //Q10 + st->cldfbBPF->Q_cldfb_state = Q10; /* set output mask for upsampling */ IF(EQ_16(st->bwidth, NB)) @@ -1667,6 +1671,7 @@ ivas_error acelp_core_dec_ivas_fx( scale_sig32( imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_imag); } scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, ( Q_real - 1 ) - Q10 ); // (Q_real-1) + st->cldfbSynHB->Q_cldfb_state = sub(Q_real, 1); Scale_sig32(save_hb_synth_fx, L_FRAME48k, Q_real - 1); FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) @@ -1687,6 +1692,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(save_hb_synth_fx, L_FRAME48k, -(Q_real - 1)); //Q0 Scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->p_filter_length, Q10 - ( Q_real - 1 ) ); // Q10 + st->cldfbSynHB->Q_cldfb_state = Q10; /* restore lowband */ FOR( j = 0; j < CLDFB_NO_CHANNELS_MAX; j++ ) @@ -1698,9 +1704,11 @@ ivas_error acelp_core_dec_ivas_fx( } } Scale_sig32( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, (Q_real - 1) - Q10); //Q_real-1 + st->cldfbSynHB->Q_cldfb_state = sub(Q_real, 1); cldfbSynthesis_ivas_fx(pRealSave_fx, pImagSave_fx, synth_fx, -1, st->cldfbSyn); Scale_sig32(synth_fx, L_FRAME48k, -(Q_real - 1)); Scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, Q10 - (Q_real - 1)); //Q10 + st->cldfbSynHB->Q_cldfb_state = Q10; } else { @@ -1725,6 +1733,7 @@ ivas_error acelp_core_dec_ivas_fx( scale_sig32(imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, Q_real); } scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, (Q_real - 1) - Q10); //(Q_real - 1) + st->cldfbSyn->Q_cldfb_state = Q_real - 1; #ifndef MSAN_FIX Scale_sig32( synth_fx, L_FRAME48k, Q_real - 1); #endif @@ -1736,6 +1745,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(synth_fx, L_FRAME48k, -(Q_real - 1)); #endif scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, Q10 - (Q_real - 1)); //Q10 + st->cldfbSyn->Q_cldfb_state = Q10; } /* save synthesis - needed in case of core switching */ @@ -1758,10 +1768,11 @@ ivas_error acelp_core_dec_ivas_fx( Word16 offset = sub(st->cldfbAna->p_filter_length, st->cldfbAna->no_channels); Scale_sig32(st->cldfbAna->cldfb_state_fx, offset, 1); //Q12 - + st->cldfbAna->Q_cldfb_state = Q12; cldfbAnalysis_ivas_fx(syn_32_fx + st->L_frame - nSamples, realBuffer_fx, imagBuffer_fx, nSamples, st->cldfbAna); Scale_sig32(st->cldfbAna->cldfb_state_fx, offset, -1); //Q11 + st->cldfbAna->Q_cldfb_state = Q11; /* analysis and add the BPF error signal - needed for DFT stereo -> TD stereo switching */ Word32 tmp_bpf_error_signal_fx[L_FRAME16k]; @@ -1778,6 +1789,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(imagBuffer_fx[i], CLDFB_NO_CHANNELS_MAX, -Q7); //Q0 } Scale_sig32(st->cldfbBPF->cldfb_state_fx, cldfb_state_offset, q_bpf_error_signal - Q10); //q_bpf_error_signal (Q6) + st->cldfbBPF->Q_cldfb_state = q_bpf_error_signal; tmp = 0; move16(); @@ -1790,6 +1802,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(st->cldfbBPF->cldfb_state_fx, cldfb_state_offset, -(q_bpf_error_signal - Q10)); //Q10 + st->cldfbBPF->Q_cldfb_state = Q10; /* synthesis of the combined signal - needed for DFT stereo -> TD stereo switching */ Word16 Q_real = 0, Q_imag = 0; Word32 max_real = 0, max_imag = 0; @@ -1823,6 +1836,7 @@ ivas_error acelp_core_dec_ivas_fx( Scale_sig32(synth_fx, L_FRAME48k, -(Q_real - 1)); #endif Scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, Q10 - (Q_real - 1)); + st->cldfbSyn->Q_cldfb_state = Q10; if (st->p_bpf_noise_buf_32) { diff --git a/lib_dec/acelp_core_switch_dec_fx.c b/lib_dec/acelp_core_switch_dec_fx.c index c6a5d3123f3e8f614a19806521decb18fc2e95b8..0e993139eb719cd9e7123209b45d63d0472c3aaf 100644 --- a/lib_dec/acelp_core_switch_dec_fx.c +++ b/lib_dec/acelp_core_switch_dec_fx.c @@ -825,11 +825,13 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx( /*cldfbSynthesisFiltering( st_fx->cldfbSyn, realBuffer, imagBuffer, &scaleFactor, synth_out, negate(st_fx->Q_syn), CLDFB_NO_COL_MAX_SWITCH_BFI, workBuffer );*/ Scale_sig32(st_fx->cldfbSyn->cldfb_state_fx,st_fx->cldfbSyn->cldfb_state_length,1); + st_fx->cldfbSyn->Q_cldfb_state = add(st_fx->cldfbSyn->Q_cldfb_state, 1); Copy_Scale_sig_16_32(synth_out, synth32, L_FRAME48k, 11 - 5 - 1); //cldfbSynthesis_ivas_fx(realBuffer, imagBuffer, synth_out, (int16_t)(st_fx->output_Fs * 0.01f), st_fx->cldfbSyn); cldfbSynthesis_ivas_fx( realBuffer, imagBuffer, synth32, extract_l( Mpy_32_16_1( st_fx->output_Fs, 328 ) ), st_fx->cldfbSyn ); Scale_sig32(st_fx->cldfbSyn->cldfb_state_fx, st_fx->cldfbSyn->cldfb_state_length, -1); + st_fx->cldfbSyn->Q_cldfb_state = sub(st_fx->cldfbSyn->Q_cldfb_state, 1); Copy_Scale_sig_32_16(synth32, synth_out, L_FRAME48k, -5); /* output to Q0 */ diff --git a/lib_dec/core_switching_dec.c b/lib_dec/core_switching_dec.c index ffe9f5a69a84d42614f03c93b276b5208c0d5f31..ec718f6c9a20ce672ec4fe86f7a3b3ccb5bf20ff 100644 --- a/lib_dec/core_switching_dec.c +++ b/lib_dec/core_switching_dec.c @@ -516,6 +516,7 @@ ivas_error core_switching_pre_dec_ivas_fx( } Copy_Scale_sig_16_32( st->hTcxDec->old_synthFB_fx, old_synthFB_fx, st->hTcxDec->old_synth_lenFB, Q10 - Q_old_synthFB ); Copy32( old_synthFB_fx + st->hTcxDec->old_synth_lenFB - offset, st->cldfbAna->cldfb_state_fx, offset ); + st->cldfbAna->Q_cldfb_state = Q10; IF( old_synthFB_fx ) free( old_synthFB_fx ); } diff --git a/lib_dec/core_switching_dec_fx.c b/lib_dec/core_switching_dec_fx.c index f2a03ebc8b9b265111106f63d89b2eb360a0d1fc..e5a94c5feaa1d2e653f29e92d6de4a74e8797e7c 100644 --- a/lib_dec/core_switching_dec_fx.c +++ b/lib_dec/core_switching_dec_fx.c @@ -1779,6 +1779,7 @@ ivas_error core_switching_post_dec_ivas_fx( move16(); } } + st_fx->cldfbAna->Q_cldfb_state = Q10; } } ELSE IF( NE_16( st_fx->element_mode, EVS_MONO ) ) @@ -1824,6 +1825,7 @@ ivas_error core_switching_post_dec_ivas_fx( move16(); } } + st_fx->cldfbAna->Q_cldfb_state = Q10; } } IF( st_fx->hBWE_TD != NULL ) diff --git a/lib_dec/ivas_core_dec.c b/lib_dec/ivas_core_dec.c index ae20b0b42191bfb8a85e97a8dcd79cec4edff421..222aae2a829beaaa01e929dccaf029326f952f09 100644 --- a/lib_dec/ivas_core_dec.c +++ b/lib_dec/ivas_core_dec.c @@ -177,17 +177,14 @@ ivas_error ivas_core_dec( st = sts[n]; IF( st->cldfbAna ) { - floatToFixed_arr32( st->cldfbAna->cldfb_state, st->cldfbAna->cldfb_state_fx, Q10, st->cldfbAna->cldfb_size ); + scale_sig32( st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, sub(Q10, Q11) ); + st->cldfbAna->Q_cldfb_state = Q10; } - - IF( st->cldfbBPF ) - floatToFixed_arr32( st->cldfbBPF->cldfb_state, st->cldfbBPF->cldfb_state_fx, Q11, st->cldfbBPF->cldfb_size ); - IF( st->cldfbSyn ) + IF(st->cldfbSynHB) { - floatToFixed_arr32( st->cldfbSyn->cldfb_state, st->cldfbSyn->cldfb_state_fx, Q11, st->cldfbSyn->cldfb_size ); + scale_sig32( st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->cldfb_size, sub(Q10, Q11) ); + st->cldfbSynHB->Q_cldfb_state = Q10; } - IF(st->cldfbSynHB) - floatToFixed_arrL(st->cldfbSynHB->cldfb_state, st->cldfbSynHB->cldfb_state_fx, Q10, st->cldfbSynHB->p_filter_length); } output_Fs = sts[0]->output_Fs; @@ -423,11 +420,20 @@ ivas_error ivas_core_dec( /* float2fix, to be removed */ IF(st->cldfbAna) + { scale_sig32(st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, sub(Q11, Q10)); + st->cldfbAna->Q_cldfb_state = Q11; + } IF(st->cldfbBPF) + { scale_sig32(st->cldfbBPF->cldfb_state_fx, st->cldfbBPF->cldfb_size, sub(Q10, Q11)); + st->cldfbBPF->Q_cldfb_state = Q10; + } IF(st->cldfbSyn) + { scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->cldfb_size, sub(Q10, Q11)); + st->cldfbSyn->Q_cldfb_state = Q10; + } IF( st->hFdCngDec != NULL ) { @@ -446,11 +452,20 @@ ivas_error ivas_core_dec( Copy_Scale_sig_16_32(output_16_fx[n],output_32_fx[n],L_FRAME48k, Q11 - st->Q_syn2); Scale_sig(output_16_fx[n], L_FRAME48k, -st->Q_syn2); IF(st->cldfbAna) + { scale_sig32(st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, sub(Q10, Q11)); /* 9 * (Word16)(st->L_frame * FRAMES_PER_SEC * INV_CLDFB_BANDWIDTH + 0.5f) */ + st->cldfbAna->Q_cldfb_state = Q10; + } IF(st->cldfbBPF) + { scale_sig32(st->cldfbBPF->cldfb_state_fx, st->cldfbBPF->cldfb_size, sub(Q11, Q10)); + st->cldfbBPF->Q_cldfb_state = Q11; + } IF(st->cldfbSyn) + { scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->cldfb_size, sub(Q11, Q10)); + st->cldfbSyn->Q_cldfb_state = Q11; + } st->prev_Q_syn = st->Q_syn; if ( save_hb_synth_32_fx ) @@ -549,14 +564,16 @@ ivas_error ivas_core_dec( FOR(n = 0; n < n_channels; n++) { st = sts[n]; - IF( st->cldfbAna ) - fixedToFloat_arrL( st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_state, Q10, st->cldfbAna->cldfb_size ); - IF( st->cldfbBPF ) - fixedToFloat_arrL( st->cldfbBPF->cldfb_state_fx, st->cldfbBPF->cldfb_state, Q11, st->cldfbBPF->cldfb_size ); - IF( st->cldfbSyn ) - fixedToFloat_arrL( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->cldfb_state, Q11, st->cldfbSyn->cldfb_size ); + IF(st->cldfbAna) + { + scale_sig32(st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, sub(Q11, Q10)); + st->cldfbAna->Q_cldfb_state = Q11; + } IF(st->cldfbSynHB) - fixedToFloat_arrL(st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->cldfb_state, Q10, st->cldfbSynHB->cldfb_size); + { + scale_sig32(st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->cldfb_size, sub(Q11, Q10)); + st->cldfbSynHB->Q_cldfb_state = Q11; + } } pop_wmops(); @@ -709,6 +726,7 @@ ivas_error ivas_core_dec( IF (st->cldfbSyn != NULL) { scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub(Q4, Q11)); + st->cldfbSyn->Q_cldfb_state = Q4; } Word16 q_audio, old_syn_fx; @@ -791,6 +809,7 @@ ivas_error ivas_core_dec( IF (st->cldfbSyn != NULL) { scale_sig32(st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->p_filter_length, sub(Q11, Q4)); + st->cldfbSyn->Q_cldfb_state = Q11; } #ifdef MSAN_FIX @@ -1296,14 +1315,16 @@ ivas_error ivas_core_dec( FOR(n = 0; n < n_channels; n++) { st = sts[n]; - IF( st->cldfbAna ) - fixedToFloat_arrL( st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_state, Q10, st->cldfbAna->cldfb_size ); - IF( st->cldfbBPF ) - fixedToFloat_arrL( st->cldfbBPF->cldfb_state_fx, st->cldfbBPF->cldfb_state, Q11, st->cldfbBPF->cldfb_size ); - IF( st->cldfbSyn ) - fixedToFloat_arrL( st->cldfbSyn->cldfb_state_fx, st->cldfbSyn->cldfb_state, Q11, st->cldfbSyn->cldfb_size ); + IF(st->cldfbAna) + { + scale_sig32(st->cldfbAna->cldfb_state_fx, st->cldfbAna->cldfb_size, sub(Q11, Q10)); + st->cldfbAna->Q_cldfb_state = Q11; + } IF(st->cldfbSynHB) - fixedToFloat_arrL(st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->cldfb_state, Q10, st->cldfbSynHB->cldfb_size); + { + scale_sig32(st->cldfbSynHB->cldfb_state_fx, st->cldfbSynHB->cldfb_size, sub(Q11, Q10)); + st->cldfbSynHB->Q_cldfb_state = Q11; + } } pop_wmops(); diff --git a/lib_dec/ivas_corecoder_dec_reconfig.c b/lib_dec/ivas_corecoder_dec_reconfig.c index 5646c71c1aa55f240ca62423a5fb1cfb3ccaaeac..9a2b56c17755742200852f4c6032eb3e610148cc 100644 --- a/lib_dec/ivas_corecoder_dec_reconfig.c +++ b/lib_dec/ivas_corecoder_dec_reconfig.c @@ -1006,8 +1006,10 @@ ivas_error ivas_cldfb_dec_reconfig_fx( ivas_spar_get_cldfb_gains_fx( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); FOR( i = 0; i < st_ivas->cldfbAnaDec[0]->cldfb_state_length; i++ ) st_ivas->cldfbAnaDec[0]->cldfb_state_fx[i] = L_shr( st_ivas->cldfbAnaDec[0]->cldfb_state_fx[i], 16 ); // Scaling down from 27 to 11 + st_ivas->cldfbAnaDec[0]->Q_cldfb_state = Q11; FOR( i = 0; i < st_ivas->cldfbSynDec[0]->cldfb_state_length; i++ ) st_ivas->cldfbSynDec[0]->cldfb_state_fx[i] = L_shr( st_ivas->cldfbSynDec[0]->cldfb_state_fx[i], 21 - 11); // Scaling down from 21 to 11 + st_ivas->cldfbSynDec[0]->Q_cldfb_state = Q11; } return IVAS_ERR_OK; } diff --git a/lib_dec/ivas_dirac_dec.c b/lib_dec/ivas_dirac_dec.c index 06fed1a79e30cb2a80da6fb2194e3e0c35810ba0..52a7ccf3c34b0297c31e25259a4e9d98d12a4dbe 100644 --- a/lib_dec/ivas_dirac_dec.c +++ b/lib_dec/ivas_dirac_dec.c @@ -3502,29 +3502,6 @@ void ivas_dirac_dec_render_sf_fx( set_s( q_proto_diffuse_buffer, hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_q, CLDFB_SLOTS_PER_SUBFRAME ); set_zero_fx( surCohRatio_fx, CLDFB_NO_CHANNELS_MAX ); //////////////////////////////////////////////////////////////////////////// to be removed /////////////////////////////////////////////////////////////////// - - FOR( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[hSpatParamRendCom->subframes_rendered]; slot_idx++ ) - { - IF( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) - { - - } - ELSE - { - offset = i_mult( hSpatParamRendCom->num_freq_bands, add( hSpatParamRendCom->slots_rendered, slot_idx ) ); - FOR( ch = 0; ch < nchan_transport; ch++ ) - { - //floatToFixed_arrL32( &st_ivas->hTcBuffer->tc[hDirACRend->sba_map_tc[ch]][offset], &st_ivas->hTcBuffer->tc_fx[hDirACRend->sba_map_tc[ch]][offset], Q11, hSpatParamRendCom->num_freq_bands ); - floatToFixed_arrL32( st_ivas->cldfbAnaDec[ch]->cldfb_state, st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, Q11, ( st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels ) ); - } - } - } - - IF( EQ_16( st_ivas->nchan_transport, 1 ) && st_ivas->hSCE[0]->hCoreCoder[0] != NULL && st_ivas->hSCE[0]->hCoreCoder[0]->cna_dirac_flag && !( L_or( EQ_16( st_ivas->ivas_format, SBA_FORMAT ), EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) ) ) - { - floatToFixed_arrL32( st_ivas->cldfbAnaDec[1]->cldfb_state, st_ivas->cldfbAnaDec[1]->cldfb_state_fx, Q11, ( st_ivas->cldfbAnaDec[1]->p_filter_length - st_ivas->cldfbAnaDec[1]->no_channels ) ); - } - IF( EQ_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_MONO ) ) { floatToFixed_arrL32( hDirACRend->h_output_synthesis_psd_state.proto_power_smooth, hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_smooth_q, i_mult( 2, hSpatParamRendCom->num_freq_bands ) ); @@ -3601,8 +3578,7 @@ void ivas_dirac_dec_render_sf_fx( { FOR( ch = 0; ch < st_ivas->hDecoderConfig->nchan_out; ch++ ) { - st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q_factor_arrL( st_ivas->cldfbSynDec[ch]->cldfb_state, st_ivas->cldfbSynDec[ch]->p_filter_length ); - floatToFixed_arrL( st_ivas->cldfbSynDec[ch]->cldfb_state, st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->Q_cldfb_state, st_ivas->cldfbSynDec[ch]->p_filter_length ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } } else if ( !L_or( EQ_16( st_ivas->ivas_format, SBA_FORMAT ), EQ_16( st_ivas->ivas_format, SBA_ISM_FORMAT ) ) ) @@ -3643,8 +3619,7 @@ void ivas_dirac_dec_render_sf_fx( IF( EQ_16( st_ivas->mc_mode, MC_MODE_MCMASA ) && !hDirACRend->hOutSetup.separateChannelEnabled ) { Word16 cldfbSynIdx = add( hDirACRend->hOutSetup.nchan_out_woLFE, idx_lfe ); - st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state = Q_factor_arrL( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state, st_ivas->cldfbSynDec[cldfbSynIdx]->p_filter_length ); - floatToFixed_arrL( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state, st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state_fx, st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state, st_ivas->cldfbSynDec[cldfbSynIdx]->p_filter_length ); + st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state = Q11; } } ELSE IF( ( hDirACRend->hOutSetup.separateChannelEnabled ) && EQ_16( hDirACRend->hOutSetup.separateChannelIndex, ch ) ) @@ -3652,8 +3627,7 @@ void ivas_dirac_dec_render_sf_fx( } ELSE { - st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = Q_factor_arrL( st_ivas->cldfbSynDec[idx_in]->cldfb_state, st_ivas->cldfbSynDec[idx_in]->p_filter_length ); - floatToFixed_arrL( st_ivas->cldfbSynDec[idx_in]->cldfb_state, st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, st_ivas->cldfbSynDec[idx_in]->p_filter_length ); + st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = Q11; idx_in = add( idx_in, 1 ); } } @@ -5072,13 +5046,6 @@ void ivas_dirac_dec_render_sf_fx( fixedToFloat_arrL32( hDirACRend->h_output_synthesis_psd_state.direct_responses_square_fx, hDirACRend->h_output_synthesis_psd_state.direct_responses_square, hDirACRend->h_output_synthesis_psd_state.direct_responses_square_q, i_mult( hSpatParamRendCom->num_freq_bands, hDirACRend->num_outputs_dir ) ); } } - IF( !( st_ivas->ivas_format == SBA_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT ) ) - { - FOR( ch = 0; ch < nchan_transport; ch++ ) - { - fixedToFloat_arrL32( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, st_ivas->cldfbAnaDec[ch]->cldfb_state, Q11, ( st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels ) ); - } - } IF( EQ_16( hDirACRend->synthesisConf, DIRAC_SYNTHESIS_GAIN_SHD ) ) { IF( nchan_transport >= 4 ) @@ -5255,7 +5222,8 @@ void ivas_dirac_dec_render_sf_fx( { for ( i = 0; i < st_ivas->hDecoderConfig->nchan_out; i++ ) { - fixedToFloat_arrL( st_ivas->cldfbSynDec[i]->cldfb_state_fx, st_ivas->cldfbSynDec[i]->cldfb_state, st_ivas->cldfbSynDec[i]->Q_cldfb_state, st_ivas->cldfbSynDec[i]->p_filter_length ); + scale_sig32( st_ivas->cldfbSynDec[i]->cldfb_state_fx, st_ivas->cldfbSynDec[i]->cldfb_size, sub(Q11, st_ivas->cldfbSynDec[i]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[i]->Q_cldfb_state = Q11; fixedToFloat_arrL( output_buf_fx[i], output_f[i], Q11, index_slot * hSpatParamRendCom->num_freq_bands + hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx] ); } } @@ -5300,15 +5268,14 @@ void ivas_dirac_dec_render_sf_fx( IF( EQ_16( st_ivas->mc_mode, MC_MODE_MCMASA ) && !hDirACRend->hOutSetup.separateChannelEnabled ) { Word16 cldfbSynIdx = add( hDirACRend->hOutSetup.nchan_out_woLFE, idx_lfe ); - fixedToFloat_arrL( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state_fx, st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state, st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state, st_ivas->cldfbSynDec[cldfbSynIdx]->p_filter_length ); + scale_sig32( st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_state_fx, st_ivas->cldfbSynDec[cldfbSynIdx]->cldfb_size, sub(Q11, st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[cldfbSynIdx]->Q_cldfb_state = Q11; } } - ELSE IF( ( hDirACRend->hOutSetup.separateChannelEnabled ) && EQ_16( hDirACRend->hOutSetup.separateChannelIndex, ch ) ) - { - } - ELSE + ELSE IF( ( hDirACRend->hOutSetup.separateChannelEnabled == 0 ) || NE_16( hDirACRend->hOutSetup.separateChannelIndex, ch ) ) { - fixedToFloat_arrL( st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->cldfb_state, st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, st_ivas->cldfbSynDec[idx_in]->p_filter_length ); + scale_sig32( st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->cldfb_size, sub(Q11, st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = Q11; idx_in = add( idx_in, 1 ); } } diff --git a/lib_dec/ivas_dirac_output_synthesis_cov.c b/lib_dec/ivas_dirac_output_synthesis_cov.c index b87204eea25af976da4520e3f7a676f0a4adcaf7..b876dad4820ab856b38cb0e54af9979b5cee8d17 100644 --- a/lib_dec/ivas_dirac_output_synthesis_cov.c +++ b/lib_dec/ivas_dirac_output_synthesis_cov.c @@ -2754,7 +2754,11 @@ int16_t computeMixingMatricesISM( Word32 svd_in_buffer_fx[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; Word32 svd_u_buffer_fx[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; +#ifdef MSAN_FIX + Word32 svd_s_buffer_fx[MAX_OUTPUT_CHANNELS] = { 0 }; +#else Word32 svd_s_buffer_fx[MAX_OUTPUT_CHANNELS]; +#endif // MSAN_FIX Word16 svd_s_buffer_fx_e; Word32 svd_v_buffer_fx[MAX_OUTPUT_CHANNELS][MAX_OUTPUT_CHANNELS]; diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index 48b316cabcacc75312b596cffa4d5c493a4b2dac..99a88845dc0f14e433d4c389baddb9182082310c 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -2772,11 +2772,6 @@ ivas_error ivas_init_decoder_fx( #ifdef IVAS_FLOAT_FIXED #if 1 Word16 Q_cldfbSynDec = Q11; - FOR( i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - floatToFixed_arrL( st_ivas->cldfbAnaDec[i]->cldfb_state, st_ivas->cldfbAnaDec[i]->cldfb_state_fx, 11, sub( st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels ) ); - } #ifndef MSAN_FIX IF( st_ivas->hSpar ) { @@ -2784,26 +2779,15 @@ ivas_error ivas_init_decoder_fx( floatToFixed_arr( st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16 ); } #endif - IF( st_ivas->cldfbSynDec[0] ) - { - floatToFixed_arrL( st_ivas->cldfbSynDec[0]->cldfb_state, st_ivas->cldfbSynDec[0]->cldfb_state_fx, Q_cldfbSynDec, sub( st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels ) ); - } #endif ivas_spar_get_cldfb_gains_fx( st_ivas->hSpar, st_ivas->cldfbAnaDec[0], st_ivas->cldfbSynDec[0], hDecoderConfig ); #if 1 FOR( i = 0; i < st_ivas->cldfbAnaDec[0]->cldfb_state_length; i++ ) st_ivas->cldfbAnaDec[0]->cldfb_state_fx[i] = L_shr( st_ivas->cldfbAnaDec[0]->cldfb_state_fx[i], 16 ); // Scaling down from 27 to 11 + st_ivas->cldfbAnaDec[0]->Q_cldfb_state = Q11; FOR( i = 0; i < st_ivas->cldfbSynDec[0]->cldfb_state_length; i++ ) st_ivas->cldfbSynDec[0]->cldfb_state_fx[i] = L_shr( st_ivas->cldfbSynDec[0]->cldfb_state_fx[i], 21 - Q_cldfbSynDec ); // Scaling down from 21 to Q_cldfbSynDec - FOR( i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - fixedToFloat_arrL( st_ivas->cldfbAnaDec[i]->cldfb_state_fx, st_ivas->cldfbAnaDec[i]->cldfb_state, 11, sub( st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels ) ); - } - IF( st_ivas->cldfbSynDec[0] ) - { - fixedToFloat_arrL( st_ivas->cldfbSynDec[0]->cldfb_state_fx, st_ivas->cldfbSynDec[0]->cldfb_state, Q_cldfbSynDec, sub( st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels ) ); - } + st_ivas->cldfbSynDec[0]->Q_cldfb_state = Q11; IF( st_ivas->hSpar ) { fixedToFloat_arr( st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16 ); diff --git a/lib_dec/ivas_ism_param_dec.c b/lib_dec/ivas_ism_param_dec.c index 8085781fdb4ed59216f84a84ab8bd24e3fd5beca..f733f38c5b17210b781c3ad52f0960c009685fdb 100644 --- a/lib_dec/ivas_ism_param_dec.c +++ b/lib_dec/ivas_ism_param_dec.c @@ -922,9 +922,6 @@ ivas_error ivas_param_ism_dec_open_fx( output_config = st_ivas->hDecoderConfig->output_config; ivas_param_ism_config_fx( hParamIsmDec->hParamIsm, st_ivas->nchan_ism ); // assuming Q14 for gains; -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - hParamIsmDec->hParamIsm->last_dmx_gain = 1.0f; -#endif /*-----------------------------------------------------------------* * set input parameters @@ -2197,7 +2194,8 @@ void ivas_param_ism_dec_digest_tc( float direct_response[MAX_NUM_OBJECTS][PARAM_ISM_MAX_CHAN]; FOR( ch = 0; ch < nchan_transport; ch++ ) { - fixedToFloat_arrL( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, st_ivas->cldfbAnaDec[ch]->cldfb_state, Q13, st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels ); + scale_sig32( st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, st_ivas->cldfbAnaDec[ch]->cldfb_size, sub(Q11, Q13) ); + st_ivas->cldfbAnaDec[ch]->Q_cldfb_state = Q11; /* CLDFB Analysis */ FOR( slot_idx = 0; slot_idx < nCldfbSlots; slot_idx++ ) { @@ -2217,10 +2215,6 @@ void ivas_param_ism_dec_digest_tc( } ref_power[band_idx] = me2f( ref_power_fx[band_idx], max_exp_ref_power ); } - IF ( st_ivas->hDecoderConfig->Opt_tsm ) - { - st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain = fixedToFloat( st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_fx, 15 - st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_e ); - } FOR( i = 0; i < st_ivas->nchan_ism; i++ ) { fixedToFloat_arrL( direct_response_fx[i], direct_response[i], Q30, PARAM_ISM_MAX_CHAN ); @@ -2704,8 +2698,10 @@ static void ivas_ism_param_dec_render_sf_fx( } Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub(sub( Q_real , 1 ) , Q11) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q_real - 1; cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, output_f_fx[ch], hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx], st_ivas->cldfbSynDec[ch] ); Scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->p_filter_length, sub(Q11 , sub( Q_real , 1 )) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; /*scaling the output_f buffer to have common Q accross the buffer*/ samplesProcessed = hSpatParamRendCom->num_freq_bands * hSpatParamRendCom->subframe_nbslots[subframe_idx]; diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index 9ffc349345a640686c6adffd6b72787946762d2d..7e0267be1052c878376da4376c42a6eb7e243f1c 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -2168,15 +2168,13 @@ void ivas_jbm_dec_feed_tc_to_renderer( #ifdef IVAS_FLOAT_FIXED floatToFixed_arr32( p_data_f[0], p_data_f_fx[0], Q13, MAX_CLDFB_DIGEST_CHANNELS * MAX_JBM_L_FRAME48k ); #if 1/*Float to fixed conversions*/ - IF( st_ivas->hDecoderConfig->Opt_tsm ) - { - /*TODO : FhG to check*/ - st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_fx = float_to_fix16( st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain, 15 - st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_e ); - } FOR( Word16 ch = 0; ch < MAX_INTERN_CHANNELS; ch++ ) { - IF( st_ivas->cldfbAnaDec[ch] ) - floatToFixed_arr32( st_ivas->cldfbAnaDec[ch]->cldfb_state, st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, Q13, st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels ); + IF(st_ivas->cldfbAnaDec[ch]) + { + scale_sig32(st_ivas->cldfbAnaDec[ch]->cldfb_state_fx, st_ivas->cldfbAnaDec[ch]->cldfb_size, sub(Q13, Q11)); + st_ivas->cldfbAnaDec[ch]->Q_cldfb_state = Q13; + } } FOR( Word16 ch = 0; ch < st_ivas->nchan_transport; ch++ ) { @@ -2233,15 +2231,7 @@ void ivas_jbm_dec_feed_tc_to_renderer( { FOR ( n = 0; n < st_ivas->nchan_ism; n++ ) { -#if 1 - floatToFixed_arrL( st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_fx[n], st_ivas->hTcBuffer->q_tc_fx, st_ivas->hSbaIsmData->delayBuffer_size ); - delay_signal_fx( st_ivas->hTcBuffer->tc_fx[n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hSbaIsmData->delayBuffer_fx[n], st_ivas->hSbaIsmData->delayBuffer_size ); - - fixedToFloat_arrL( st_ivas->hSbaIsmData->delayBuffer_fx[n], st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hTcBuffer->q_tc_fx, st_ivas->hSbaIsmData->delayBuffer_size ); -#else - delay_signal_float( st_ivas->hTcBuffer->tc[n], st_ivas->hTcBuffer->n_samples_available, st_ivas->hSbaIsmData->delayBuffer[n], st_ivas->hSbaIsmData->delayBuffer_size ); -#endif } } @@ -2777,10 +2767,6 @@ ivas_error ivas_jbm_dec_render( n_out = st_ivas->hIntSetup.nchan_out_woLFE + st_ivas->hIntSetup.num_lfe; } - for ( ch = 0; ch < n_out; ch++ ) - { - floatToFixed_arrL( st_ivas->cldfbSynDec[ch]->cldfb_state, st_ivas->cldfbSynDec[ch]->cldfb_state_fx, Q11, st_ivas->cldfbSynDec[ch]->p_filter_length ); - } /*-------------------------------------flt 2 fix----------------------------------------------------------*/ ivas_param_ism_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx_tmp ); @@ -2788,7 +2774,6 @@ ivas_error ivas_jbm_dec_render( /*-----------------------------------------fix 2 flt--------------------------------------------*/ for ( ch = 0; ch < n_out; ch++ ) { - fixedToFloat_arrL( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_state, Q11, st_ivas->cldfbSynDec[ch]->p_filter_length ); fixedToFloat_arrL( p_output_fx_tmp[ch], p_output[ch], Q11, L_FRAME48k ); } /*-----------------------------------------fix 2 flt--------------------------------------------*/ @@ -3008,30 +2993,8 @@ ivas_error ivas_jbm_dec_render( uint16_t nchan_internal; nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); #endif - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - hSpar->hMdDec->Q_mixer_mat = 30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } + hSpar->hMdDec->Q_mixer_mat = 30; #endif // if ( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ) != IVAS_ERR_OK ) { @@ -3042,23 +3005,6 @@ ivas_error ivas_jbm_dec_render( { fixedToFloat_arrL( p_output_fx[n], p_output[n], 11, 960 ); } - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } #endif } } @@ -3097,29 +3043,7 @@ ivas_error ivas_jbm_dec_render( #if 1 /*Float to fixed conversion*/ SPAR_DEC_HANDLE hSpar; hSpar = st_ivas->hSpar; - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - - hSpar->hMdDec->Q_mixer_mat = 30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } + hSpar->hMdDec->Q_mixer_mat = 30; #endif // IF( ( error = ivas_osba_dirac_td_binaural_jbm_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, output_q_factor, 960 ) ) != IVAS_ERR_OK ) @@ -3132,23 +3056,6 @@ ivas_error ivas_jbm_dec_render( { fixedToFloat_arrL( p_output_fx[n], p_output[n], 11, 960 ); } - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } #endif #if 1 /*TODO: remove fixed to float conversions */ @@ -3228,28 +3135,7 @@ ivas_error ivas_jbm_dec_render( #if 1 /*Float to fixed conversion*/ SPAR_DEC_HANDLE hSpar; hSpar = st_ivas->hSpar; - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - hSpar->hMdDec->Q_mixer_mat = 30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } + hSpar->hMdDec->Q_mixer_mat = 30; #endif // if ( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, &p_output_fx[st_ivas->nchan_ism], 960 ) ) != IVAS_ERR_OK ) { @@ -3260,23 +3146,6 @@ ivas_error ivas_jbm_dec_render( { fixedToFloat_arrL( p_output_fx[n], p_output[n], 11, 960 ); } - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } #endif for ( n = 0; n < st_ivas->nchan_ism; n++ ) @@ -3299,28 +3168,7 @@ ivas_error ivas_jbm_dec_render( #if 1 /*Float to fixed conversion*/ SPAR_DEC_HANDLE hSpar; hSpar = st_ivas->hSpar; - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - hSpar->hMdDec->Q_mixer_mat = 30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } + hSpar->hMdDec->Q_mixer_mat = 30; #endif // if ( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ) != IVAS_ERR_OK ) { @@ -3331,23 +3179,6 @@ ivas_error ivas_jbm_dec_render( { fixedToFloat_arrL( p_output_fx[n], p_output[n], 11, 960 ); } - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } #endif } } @@ -3357,32 +3188,6 @@ ivas_error ivas_jbm_dec_render( } else { -#if 1 /*Float to fixed conversion*/ - SPAR_DEC_HANDLE hSpar; - hSpar = st_ivas->hSpar; - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } -#endif // if ( ( error = ivas_sba_dec_render_fx( st_ivas, nSamplesAskedLocal, nSamplesRendered, nSamplesAvailableNext, p_output_fx, 960 ) ) != IVAS_ERR_OK ) { return error; @@ -3392,23 +3197,6 @@ ivas_error ivas_jbm_dec_render( { fixedToFloat_arrL( p_output_fx[n], p_output[n], 11, 960 ); } - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } #endif if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_EXTERNAL ) @@ -3751,12 +3539,10 @@ ivas_error ivas_jbm_dec_render( /* CLDFB synthesis */ for (int ch = 0; ch < nchan_out_cldfb; ch++) { - if (channel_active_fx[ch]) + if (st_ivas->cldfbSynDec[ch]) { - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbSynDec[ch]->cldfb_state[i] * (1LL << (5))); - } + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q5, Q11)); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5; } } @@ -3774,11 +3560,10 @@ ivas_error ivas_jbm_dec_render( #if 1//ftf changes for (int ch = 0; ch < nchan_out_cldfb; ch++) { - if (channel_active_fx[ch]) { - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[ch]->cldfb_state[i] = ((float)st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] / (1LL << (5))); - } + if (st_ivas->cldfbSynDec[ch]) + { + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q11, Q5)); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } fixedToFloat_arrL(p_output_fx[ch], p_output[ch], Q11, *nSamplesRendered); } diff --git a/lib_dec/ivas_masa_dec.c b/lib_dec/ivas_masa_dec.c index 97c5b57836ff304b10b1c1d55718a3bdc87d57f7..77a6bbb2a364699b6d1e32ed2f06ffed82d3d104 100644 --- a/lib_dec/ivas_masa_dec.c +++ b/lib_dec/ivas_masa_dec.c @@ -3134,36 +3134,16 @@ ivas_error ivas_masa_dec_reconfigure_fx( #else #if 1 // Float to fix conversions for ivas_cldfb_dec_reconfig_fx - FOR( Word16 i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - floatToFixed_arrL32( st_ivas->cldfbAnaDec[i]->cldfb_state, st_ivas->cldfbAnaDec[i]->cldfb_state_fx, 11, st_ivas->cldfbAnaDec[i]->cldfb_size ); - } IF( st_ivas->hSpar ) { st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q_factor_arr( st_ivas->hSpar->hFbMixer->cldfb_cross_fade, 16 ); floatToFixed_arr( st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16 ); } - IF( st_ivas->cldfbSynDec[0] ) - { - floatToFixed_arrL32( st_ivas->cldfbSynDec[0]->cldfb_state, st_ivas->cldfbSynDec[0]->cldfb_state_fx, Q11, st_ivas->cldfbSynDec[0]->cldfb_size ); - } #endif if ( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, st_ivas->nchan_transport, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { return error; } -#if 1 - FOR( Word16 i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - fixedToFloat_arrL32( st_ivas->cldfbAnaDec[i]->cldfb_state_fx, st_ivas->cldfbAnaDec[i]->cldfb_state, 11, st_ivas->cldfbAnaDec[i]->cldfb_size ); - } - IF( st_ivas->cldfbSynDec[0] ) - { - fixedToFloat_arrL32( st_ivas->cldfbSynDec[0]->cldfb_state_fx, st_ivas->cldfbSynDec[0]->cldfb_state, Q11, st_ivas->cldfbSynDec[0]->cldfb_size ); - } -#endif #endif } diff --git a/lib_dec/ivas_mc_paramupmix_dec.c b/lib_dec/ivas_mc_paramupmix_dec.c index 937c686c3f3153b238bc33cf442f736e5078b9db..acd53db478e29b98b815e85fb19452c5018770de 100644 --- a/lib_dec/ivas_mc_paramupmix_dec.c +++ b/lib_dec/ivas_mc_paramupmix_dec.c @@ -688,14 +688,8 @@ static void ivas_mc_paramupmix_dec_sf( /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) { - for (i = 0; i < st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels; i++) { - st_ivas->cldfbAnaDec[ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbAnaDec[ch]->cldfb_state[i] * (1LL << (11))); - } Word16 q_cldfb = 11; cldfbAnalysis_ts_fx_fixed_q( &( pPcm_temp_fx[ch][hMCParamUpmix->num_freq_bands * slot_idx] ), Cldfb_RealBuffer_fx[ch][slot_idx], Cldfb_ImagBuffer_fx[ch][slot_idx], hMCParamUpmix->num_freq_bands, st_ivas->cldfbAnaDec[ch], &q_cldfb); - for (i = 0; i < st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels; i++) { - st_ivas->cldfbAnaDec[ch]->cldfb_state[i] = ((float)st_ivas->cldfbAnaDec[ch]->cldfb_state_fx[i]/ (1LL << (11))); - } } } @@ -744,18 +738,12 @@ static void ivas_mc_paramupmix_dec_sf( /* slot loop for gathering the input data */ for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) { - for (i = 0; i < st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels; i++) { - st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in]->cldfb_state[i] * (1LL << (11))); - } Word16 q_cldfb = 11; cldfbAnalysis_ts_fx_fixed_q(&(pPcm_temp_fx[ch][hMCParamUpmix->num_freq_bands * slot_idx]), Cldfb_RealBuffer_subfr_fx[idx_in][slot_idx], Cldfb_ImagBuffer_subfr_fx[idx_in][slot_idx], maxBand, st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in],&q_cldfb); - for (i = 0; i < st_ivas->cldfbAnaDec[ch]->p_filter_length - st_ivas->cldfbAnaDec[ch]->no_channels; i++) { - st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in]->cldfb_state[i] = ((float)st_ivas->cldfbAnaDec[2 * MC_PARAMUPMIX_COMBINATIONS + idx_in]->cldfb_state_fx[i]/ (1LL << (11))); - } } idx_in++; } @@ -813,14 +801,11 @@ static void ivas_mc_paramupmix_dec_sf( RealBuffer_fx[slot_idx] = Cldfb_RealBuffer_Binaural_fx[ch][slot_idx]; ImagBuffer_fx[slot_idx] = Cldfb_ImagBuffer_Binaural_fx[ch][slot_idx]; } - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) { - st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbSynDec[ch]->cldfb_state[i] * (1LL << (5))); - } + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q5, Q11) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5; cldfbSynthesis_ivas_fx( RealBuffer_fx, ImagBuffer_fx, &( output_fx[ch][0] ), maxBand * st_ivas->hTcBuffer->subframe_nbslots[subframeIdx], st_ivas->cldfbSynDec[ch] ); - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[ch]->cldfb_state[i] = ((float)st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] / (1LL << (5))); - } + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q11, Q5) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } for (ch = 0; ch < BINAURAL_CHANNELS; ch++) { @@ -842,6 +827,8 @@ static void ivas_mc_paramupmix_dec_sf( /* CLDFB synthesis */ for ( ch = 0; ch < MC_PARAMUPMIX_COMBINATIONS * 2; ch++ ) { + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q5, st_ivas->cldfbSynDec[ch]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q5; for ( slot_idx = 0; slot_idx < st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->subframes_rendered]; slot_idx++ ) { Word32 *ptr_im_fx[1], *ptr_re_fx[1]; @@ -849,17 +836,11 @@ static void ivas_mc_paramupmix_dec_sf( ptr_re_fx[0] = Cldfb_RealBuffer_fx[ch][slot_idx]; ptr_im_fx[0] = Cldfb_ImagBuffer_fx[ch][slot_idx]; - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) { - st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbSynDec[ch]->cldfb_state[i] * (1LL << (5))); - } - cldfbSynthesis_ivas_fx(ptr_re_fx, ptr_im_fx, &(pPcm_temp_fx[ch][hMCParamUpmix->num_freq_bands * slot_idx]), hMCParamUpmix->num_freq_bands, st_ivas->cldfbSynDec[ch]); - for (i = 0; i < st_ivas->cldfbSynDec[ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[ch]->cldfb_state[i] = ((float)st_ivas->cldfbSynDec[ch]->cldfb_state_fx[i] / (1LL << (5))); - } } + scale_sig32(st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q11, st_ivas->cldfbSynDec[ch]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } //Done to keep entire buffer in q11 for (ch = 4; ch < 12; ch++) diff --git a/lib_dec/ivas_omasa_dec.c b/lib_dec/ivas_omasa_dec.c index 99b0440f0e06848fe7b83af29cf323270746b608..da4195bf38a082d179865b98ea6812604916bd7a 100644 --- a/lib_dec/ivas_omasa_dec.c +++ b/lib_dec/ivas_omasa_dec.c @@ -313,87 +313,10 @@ ivas_error ivas_omasa_dec_config_fx( move16(); } ELSE{ - ///////////////////////////////local flt2fix: to be removed - Word16 n_samples_granularity; - - n_samples_granularity = NS2SA(st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS); - DECODER_CONFIG_HANDLE hDecoderConfig = NULL; - Word16 numch_out_dirac = 0; - SPAR_DEC_HANDLE hSpar = NULL; - Word16 numch_in; - IF(EQ_16(st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC) || EQ_16(st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC_ROOM) || EQ_16(st_ivas->renderer_type, RENDERER_STEREO_PARAMETRIC)) - { - IF(EQ_16(st_ivas->renderer_type, RENDERER_BINAURAL_PARAMETRIC) && NE_16(st_ivas->ism_mode, ISM_MASA_MODE_DISC)) - { - IF(LT_16(n_samples_granularity, st_ivas->hTcBuffer->n_samples_granularity)) - { - if (st_ivas->hSbaIsmData) - { - for (Word16 ch_idx = 0; ch_idx < st_ivas->hSbaIsmData->delayBuffer_nchan; ch_idx++) - { - floatToFixed_arr32(st_ivas->hSbaIsmData->delayBuffer[ch_idx], st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], Q11, st_ivas->hSbaIsmData->delayBuffer_size); - } - } - hSpar = st_ivas->hSpar; - //uint16_t nchan_internal; - //nchan_internal = ivas_sba_get_nchan_metadata(st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate); - hDecoderConfig = st_ivas->hDecoderConfig; - numch_out_dirac = hDecoderConfig->nchan_out; - IF(hSpar) - { - //numch_out = hSpar->hFbMixer->fb_cfg->num_out_chans; - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - //num_md_sub_frames = ivas_get_spar_dec_md_num_subframes(st_ivas->sba_order, hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate); - - for (Word16 in_ch = 0; in_ch < numch_in; in_ch++) - { - for (Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * (1LL << (Q11))); - } - } - FOR(Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++) - { - IF(st_ivas->cldfbSynDec[out_ch]) - { - FOR(Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix(st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11); - } - } - } - } - } - } - } - //////////////////////////// local flt2fix end IF((error = ivas_masa_dec_reconfigure_fx(st_ivas, nSamplesRendered, data)) != IVAS_ERR_OK) { return error; } - //////////////////////////// local fix2flt: to be removed - IF(hSpar) - { - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - FOR(Word16 in_ch = 0; in_ch < numch_in; in_ch++) - { - FOR(Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ((float)(st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i]) / (1LL << (Q11))); /*Rounding off*/ - } - } - FOR(Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++) - { - IF(st_ivas->cldfbSynDec[out_ch]) - { - FOR(Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ((float)(st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i]) / (float)(1LL << (Q11))); - } - } - } - } - //////////////////////////////////////////////local fix2flt end } IF( LT_32( cpe_brate, MASA_STEREO_MIN_BITRATE ) ) @@ -424,13 +347,6 @@ ivas_error ivas_omasa_dec_config_fx( { return error; } -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - /* Float code to be removed. */ - //IF( ( error = ivas_hp20_dec_reconfig( st_ivas, nchan_hp20_old ) ) != IVAS_ERR_OK ) - //{ - // return error; - //} -#endif /* reconfigure core-coders for ISMs */ k = 0; diff --git a/lib_dec/ivas_osba_dec.c b/lib_dec/ivas_osba_dec.c index 1691bfe040948e3bee8c9c838e35c10b11ca57fe..9431b8f08baf1e51ea6988118d7ff9e38eb2e580 100644 --- a/lib_dec/ivas_osba_dec.c +++ b/lib_dec/ivas_osba_dec.c @@ -107,12 +107,6 @@ ivas_error ivas_osba_data_open_fx( { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); } -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - if ( ( hSbaIsmData->delayBuffer = (float **) malloc( hSbaIsmData->delayBuffer_nchan * sizeof( float * ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); - } -#endif for ( i = 0; i < hSbaIsmData->delayBuffer_nchan; i++ ) { @@ -121,13 +115,6 @@ ivas_error ivas_osba_data_open_fx( return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); } set_zero_fx( hSbaIsmData->delayBuffer_fx[i], hSbaIsmData->delayBuffer_size ); -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - if ( ( hSbaIsmData->delayBuffer[i] = (float *) malloc( hSbaIsmData->delayBuffer_size * sizeof( float ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for OSBA delay buffer \n" ) ); - } - set_zero( hSbaIsmData->delayBuffer[i], hSbaIsmData->delayBuffer_size ); -#endif // IVAS_FLOAT_FIXED } st_ivas->hSbaIsmData = hSbaIsmData; @@ -192,18 +179,6 @@ void ivas_osba_data_close_fx( ( *hSbaIsmData )->delayBuffer_fx = NULL; } -#ifdef IVAS_FLOAT_FIXED_TO_BE_REMOVED - if ( ( *hSbaIsmData )->delayBuffer != NULL ) - { - for ( i = 0; i < ( *hSbaIsmData )->delayBuffer_nchan; i++ ) - { - free( ( *hSbaIsmData )->delayBuffer[i] ); - } - free( ( *hSbaIsmData )->delayBuffer ); - ( *hSbaIsmData )->delayBuffer = NULL; - } -#endif - free( *hSbaIsmData ); *hSbaIsmData = NULL; @@ -395,56 +370,10 @@ ivas_error ivas_osba_render_sf_fx( v_shr(p_output[n], sub(Q11, Q11), output_ism[n], nSamplesAsked); } -#if 1 /*Float to fixed conversion*/ - SPAR_DEC_HANDLE hSpar; - hSpar = st_ivas->hSpar; - Word16 numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - DECODER_CONFIG_HANDLE hDecoderConfig; - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - hSpar->hMdDec->Q_mixer_mat = Q30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( int i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( int i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11 ); - } - } - } -#endif // - IF((error = ivas_sba_dec_render_fx(st_ivas, nSamplesAsked, nSamplesRendered, nSamplesAvailableNext, p_output, 960)) != IVAS_ERR_OK) { return error; } -#if 1 /*Fixed to float */ - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( int i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( int i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } -#endif IF(st_ivas->renderer_type != RENDERER_BINAURAL_FASTCONV_ROOM) { diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index 7e854a90f66492348a38a093162daf13aa57afef..7c63005b76c2e806c46f39c9f2324ca5926d3fb9 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -250,155 +250,10 @@ ivas_error ivas_sba_dec_reconfigure( st_ivas->sba_analysis_order = sba_analysis_order_old_flush; st_ivas->hDecoderConfig->ivas_total_brate = last_ivas_total_brate; -#ifdef IVAS_FLOAT_FIXED -#if 1 /*Float to fixed conversion*/ - DECODER_TC_BUFFER_HANDLE hTcBuffer; - hTcBuffer = st_ivas->hTcBuffer; - IF( st_ivas->hCombinedOrientationData ) - FOR( Word16 ind1 = 0; ind1 < 3; ind1++ ) - { - FOR( Word16 ind2 = 0; ind2 < 3; ind2++ ) - { - st_ivas->hCombinedOrientationData->Rmat_fx[0][ind1][ind2] = (Word32) ( st_ivas->hCombinedOrientationData->Rmat[0][ind1][ind2] * ( 1 << 15 ) ); - } - } - if ( st_ivas->hSbaIsmData ) - { - for ( Word16 ch_idx = 0; ch_idx < st_ivas->hSbaIsmData->delayBuffer_nchan; ch_idx++ ) - { - floatToFixed_arr32( st_ivas->hSbaIsmData->delayBuffer[ch_idx], st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], Q11, st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - SPAR_DEC_HANDLE hSpar; - hSpar = st_ivas->hSpar; - uint16_t nchan_internal; - nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_in = 0, numch_out, q1 = 30, q2 = 30; - ; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - IF( hSpar ) - { - numch_out = hSpar->hFbMixer->fb_cfg->num_out_chans; - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ); - hSpar->hMdDec->Q_mixer_mat = 30; - //for ( int l = 0; l < numch_out; l++ ) - //{ - // for ( int j = 0; j < numch_in; j++ ) - // { - // for ( int k = 0; k < num_md_sub_frames * IVAS_MAX_NUM_BANDS; k++ ) - // { - // hSpar->hMdDec->mixer_mat_fx[l][j][k] = floatToFixed( hSpar->hMdDec->mixer_mat[l][j][k], q1 ); - // } - // } - //} - //for ( int m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES + 1; m++ ) - //{ - // for ( int j = 0; j < IVAS_MAX_FB_MIXER_OUT_CH; j++ ) - // { - // for ( int k = 0; k < IVAS_MAX_SPAR_FB_MIXER_IN_CH; k++ ) - // { - // for ( int l = 0; l < IVAS_MAX_NUM_BANDS; l++ ) - // { - // hSpar->hMdDec->mixer_mat_prev_fx[m][j][k][l] = floatToFixed( hSpar->hMdDec->mixer_mat_prev[m][j][k][l], q2 ); - // } - // } - // } - //} - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) - { - for ( Word16 i = 0; i < IVAS_MAX_NUM_BANDS; i++ ) - { - floatToFixed_arrL( hSpar->hMdDec->smooth_buf[i], hSpar->hMdDec->smooth_buf_fx[i], 0, 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); - } - floatToFixed_arr( hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_fac_fx, Q15, IVAS_MAX_NUM_BANDS ); - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] , Q11 ); - } - } - } - } - Word16 n_tc; - if (st_ivas->ivas_format == MASA_ISM_FORMAT || st_ivas->ivas_format == SBA_ISM_FORMAT) - n_tc = st_ivas->nchan_ism; - else - n_tc = st_ivas->hTcBuffer->nchan_transport_internal; - for (int ch = 0; ch < n_tc; ch++) - { - floatToFixed_arrL(st_ivas->hTcBuffer->tc[ch], st_ivas->hTcBuffer->tc_fx[ch], Q11, L_FRAME48k); - } -#endif - if ( ( error = ivas_jbm_dec_flush_renderer_fx( st_ivas, granularity_new, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, st_ivas->mc_mode, ism_mode_old, nSamplesFlushed, data ) ) != IVAS_ERR_OK ) - { - return error; - } -#if 1 /*Fixed to float */ - if ( hTcBuffer->tc_buffer ) - fixedToFloat_arrL( hTcBuffer->tc_buffer_fx, hTcBuffer->tc_buffer, Q11, hTcBuffer->tc_buff_len ); - IF( hSpar ) - { - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); - } - } - /*FOR( int m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES + 1; m++ ) - { - FOR( int j = 0; j < IVAS_MAX_FB_MIXER_OUT_CH; j++ ) - { - FOR( int k = 0; k < IVAS_MAX_SPAR_FB_MIXER_IN_CH; k++ ) - { - FOR( int l = 0; l < IVAS_MAX_NUM_BANDS; l++ ) - { - hSpar->hMdDec->mixer_mat_prev[m][j][k][l] = ( (float) hSpar->hMdDec->mixer_mat_prev_fx[m][j][k][l] / ( 1 << q2 ) ); - } - } - } - }*/ - // fix2float (to be cleaned) - IF( ( LT_32( hDecoderConfig->ivas_total_brate, IVAS_24k4 ) ) && ( ( EQ_16( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_HOA2 ) ) || ( EQ_16( hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_HOA3 ) ) ) ) - { - fixedToFloat_arr( hSpar->hMdDec->smooth_fac_fx, hSpar->hMdDec->smooth_fac, Q15, IVAS_MAX_NUM_BANDS ); - FOR( Word16 i = 0; i < IVAS_MAX_NUM_BANDS; i++ ) - { - fixedToFloat_arrL( hSpar->hMdDec->smooth_buf_fx[i], hSpar->hMdDec->smooth_buf[i], 0, 2 * SBA_DIRAC_NRG_SMOOTH_LONG + 1 ); - } - } - // fix2float end - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } - } -#endif -#else if ( ( error = ivas_jbm_dec_flush_renderer( st_ivas, granularity_new, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, st_ivas->mc_mode, ism_mode_old, nSamplesFlushed, data ) ) != IVAS_ERR_OK ) { return error; } -#endif // IVAS_FLOAT_FIXED /* restore correct values for the current frame*/ st_ivas->sba_analysis_order = ivas_sba_get_analysis_order( ivas_total_brate, st_ivas->sba_order ); @@ -1023,83 +878,12 @@ ivas_error ivas_sba_dec_reconfigure_fx( st_ivas->hIsmMetaData[ind1]->elevation_fx = (Word32) ( st_ivas->hIsmMetaData[ind1]->elevation * ( 1 << 22 ) ); } } - if ( st_ivas->hSbaIsmData ) - { - for ( Word16 ch_idx = 0; ch_idx < st_ivas->hSbaIsmData->delayBuffer_nchan; ch_idx++ ) - { - floatToFixed_arr32( st_ivas->hSbaIsmData->delayBuffer[ch_idx], st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], Q11, st_ivas->hSbaIsmData->delayBuffer_size ); - } - } - SPAR_DEC_HANDLE hSpar; - hSpar = st_ivas->hSpar; - //uint16_t nchan_internal; - //nchan_internal = ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); - hDecoderConfig = st_ivas->hDecoderConfig; - Word16 numch_in = 0; - Word16 numch_out_dirac = hDecoderConfig->nchan_out; - IF( hSpar ) - { - //numch_out = hSpar->hFbMixer->fb_cfg->num_out_chans; - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - num_md_sub_frames = ivas_get_spar_dec_md_num_subframes( st_ivas->sba_order, hDecoderConfig->ivas_total_brate, st_ivas->last_active_ivas_total_brate ); - hSpar->hMdDec->Q_mixer_mat = 30; - for ( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] , Q11 ); - } - } - } - } #endif if ( ( error = ivas_jbm_dec_flush_renderer_fx( st_ivas, granularity_new, st_ivas->renderer_type, st_ivas->intern_config, &st_ivas->hIntSetup, st_ivas->mc_mode, ism_mode_old, nSamplesFlushed, data ) ) != IVAS_ERR_OK ) { return error; } #if 1 /*Fixed to float */ - IF( hSpar ) - { - FOR( Word16 in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); - } - } - /*FOR( int m = 0; m < MAX_PARAM_SPATIAL_SUBFRAMES + 1; m++ ) - { - FOR( int j = 0; j < IVAS_MAX_FB_MIXER_OUT_CH; j++ ) - { - FOR( int k = 0; k < IVAS_MAX_SPAR_FB_MIXER_IN_CH; k++ ) - { - FOR( int l = 0; l < IVAS_MAX_NUM_BANDS; l++ ) - { - hSpar->hMdDec->mixer_mat_prev[m][j][k][l] = ( (float) hSpar->hMdDec->mixer_mat_prev_fx[m][j][k][l] / ( 1 << q2 ) ); - } - } - } - }*/ - FOR( Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( Word16 i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } - } FOR( Word16 ind1 = 0; ind1 < MAX_NUM_OBJECTS; ind1++ ) { if ( st_ivas->hIsmMetaData[ind1] ) @@ -1529,11 +1313,6 @@ ivas_error ivas_sba_dec_reconfigure_fx( #ifdef IVAS_FLOAT_FIXED #if 1 // Float to fix conversions for ivas_cldfb_dec_reconfig_fx - FOR( Word16 i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - floatToFixed_arrL32( st_ivas->cldfbAnaDec[i]->cldfb_state, st_ivas->cldfbAnaDec[i]->cldfb_state_fx, 11, st_ivas->cldfbAnaDec[i]->cldfb_size ); - } #ifndef MSAN_FIX IF( st_ivas->hSpar ) { @@ -1541,26 +1320,11 @@ ivas_error ivas_sba_dec_reconfigure_fx( floatToFixed_arr( st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16 ); } #endif // MSAN_FIX - IF( st_ivas->cldfbSynDec[0] ) - { - floatToFixed_arrL32( st_ivas->cldfbSynDec[0]->cldfb_state, st_ivas->cldfbSynDec[0]->cldfb_state_fx, Q11, st_ivas->cldfbSynDec[0]->cldfb_size ); - } #endif if ( ( error = ivas_cldfb_dec_reconfig_fx( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { return error; } -#if 1 - FOR( Word16 i = 0; i < 16; i++ ) - { - IF( st_ivas->cldfbAnaDec[i] ) - fixedToFloat_arrL32( st_ivas->cldfbAnaDec[i]->cldfb_state_fx, st_ivas->cldfbAnaDec[i]->cldfb_state, 11, st_ivas->cldfbAnaDec[i]->cldfb_size ); - } - IF( st_ivas->cldfbSynDec[0] ) - { - fixedToFloat_arrL32( st_ivas->cldfbSynDec[0]->cldfb_state_fx, st_ivas->cldfbSynDec[0]->cldfb_state, Q11, st_ivas->cldfbSynDec[0]->cldfb_size ); - } -#endif #else if ( ( error = ivas_cldfb_dec_reconfig( st_ivas, nchan_transport_old, numCldfbAnalyses_old, numCldfbSyntheses_old ) ) != IVAS_ERR_OK ) { diff --git a/lib_dec/ivas_spar_decoder.c b/lib_dec/ivas_spar_decoder.c index 7c4e50bce8f99d86408e4ee2a5a3700e09ebfb0d..aa7694ad304cef0184fc457ddb52e87e6ec77fb7 100644 --- a/lib_dec/ivas_spar_decoder.c +++ b/lib_dec/ivas_spar_decoder.c @@ -357,10 +357,17 @@ ivas_error ivas_spar_dec_open_fx( fb_cfg->remix_order = remix_order_set[hSpar->hMdDec->spar_md_cfg.remix_unmix_order]; /* FB mixer handle */ +#ifdef IVAS_FLOAT_FIXED + IF( ( error = ivas_FB_mixer_open_fx( &hSpar->hFbMixer, output_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) + { + return error; + } +#else if ( ( error = ivas_FB_mixer_open( &hSpar->hFbMixer, output_Fs, fb_cfg, spar_reconfig_flag ) ) != IVAS_ERR_OK ) { return error; } +#endif /* AGC handle */ #ifdef IVAS_FLOAT_FIXED @@ -1134,6 +1141,7 @@ void ivas_spar_get_cldfb_gains_fx( cldfbAnaDec0->cldfb_state_fx[sample] = L_shl(x_fx,12); } Word16 q_cldfb = 27; + cldfbAnaDec0->Q_cldfb_state = q_cldfb; FOR( slot = 0; slot < num_cf_slots; slot++ ) { FOR( sample = 0; sample < stride; sample++ ) @@ -1205,9 +1213,7 @@ void ivas_spar_get_cldfb_gains_fx( return; } -#endif // IVAS_FLOAT_FIXED - -#ifndef IVAS_FLOAT_FIXED +#else void ivas_spar_get_cldfb_gains( SPAR_DEC_HANDLE hSpar, HANDLE_CLDFB_FILTER_BANK cldfbAnaDec0, @@ -1308,26 +1314,7 @@ void ivas_spar_get_cldfb_gains( ts_inout[sample] = x; } -#ifdef IVAS_FLOAT_FIXED - Word32 ts_inout_fx[CLDFB_NO_CHANNELS_MAX], ts_re_fx[CLDFB_NO_CHANNELS_MAX], ts_im_fx[CLDFB_NO_CHANNELS_MAX]; - Word16 q_cldfb = 27; - for (Word16 i = 0; i < CLDFB_NO_CHANNELS_MAX; i++) { - ts_inout_fx[i] = (Word32)(ts_inout[i] * (1LL << (31-4))); - } - for (Word16 i = 0; i < cldfbAnaDec0->p_filter_length - cldfbAnaDec0->no_channels; i++) { - cldfbAnaDec0->cldfb_state_fx[i] = (Word32)(cldfbAnaDec0->cldfb_state[i] * (1LL << (31-4))); - } - cldfbAnalysis_ts_fx( ts_inout_fx, ts_re_fx, ts_im_fx, num_cldfb_bands, cldfbAnaDec0, &q_cldfb ); - for (Word16 i = 0; i < CLDFB_NO_CHANNELS_MAX; i++) { - ts_im[i] = (float)(ts_im_fx[i]) / (float)(1LL << q_cldfb); - ts_re[i] = (float)(ts_re_fx[i]) / (float)(1LL << q_cldfb); - } - for (Word16 i = 0; i < cldfbAnaDec0->p_filter_length - cldfbAnaDec0->no_channels; i++) { - cldfbAnaDec0->cldfb_state_fx[i] = (Word32)(cldfbAnaDec0->cldfb_state[i] * (1LL << (31-4))); - } -#else cldfbAnalysis_ts_ivas( ts_inout, ts_re, ts_im, num_cldfb_bands, cldfbAnaDec0 ); -#endif cldfb_reset_memory_ivas( cldfbSynDec0 ); cldfbSynthesis_ivas( pp_ts_re, pp_ts_im, ts_inout, num_cldfb_bands, cldfbSynDec0 ); @@ -1407,7 +1394,7 @@ void ivas_spar_get_cldfb_gains( return; } -#endif +#endif // IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* @@ -2951,15 +2938,6 @@ void ivas_spar_dec_upmixer_sf_fx( /* CLDFB analysis of incoming frame */ -#ifdef IVAS_FLOAT_FIXED /*Float to fixed*/ - FOR ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * ( 1LL << ( Q11 ) ) ); - } - } -#endif FOR ( in_ch = 0; in_ch < numch_in; in_ch++ ) { FOR ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) @@ -2990,27 +2968,6 @@ void ivas_spar_dec_upmixer_sf_fx( FOR ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { md_idx = hSpar->render_to_md_map[ts + slot_idx_start]; -#if 1 /*TODO: To be removed later when ivas_spar_get_parameters is integerated*/ - FOR( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - FOR( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } -#endif -#if 1 - FOR( out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ( (float) ( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] ) / (float) ( 1LL << ( Q11 ) ) ); - } - } - } -#endif floatToFixed_arr( hSpar->hFbMixer->cldfb_cross_fade, hSpar->hFbMixer->cldfb_cross_fade_fx, Q15, CLDFB_NO_COL_MAX ); ivas_spar_get_parameters_fx( hSpar, hDecoderConfig, md_idx, numch_out, numch_in, num_spar_bands, mixer_mat_fx ); @@ -3052,10 +3009,11 @@ void ivas_spar_dec_upmixer_sf_fx( ELSE { cldfb_par_fx = 0; - FOR ( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) + FOR( spar_band = bin2band->p_spar_start_bands[cldfb_band]; spar_band < num_spar_bands; spar_band++ ) { /* accumulate contributions from all SPAR bands */ - cldfb_par_fx = L_add(cldfb_par_fx,Mult_32_16(mixer_mat_fx[out_ch][in_ch][spar_band] , float_to_fix16(bin2band->pp_cldfb_weights_per_spar_band[cldfb_band][spar_band],15)));/*q1*/ + Word16 tmp = extract_l(L_shr( bin2band->pp_cldfb_weights_per_spar_band_fx[cldfb_band][spar_band], 7 )); + cldfb_par_fx = L_add_sat( cldfb_par_fx, Mult_32_16( mixer_mat_fx[out_ch][in_ch][spar_band], tmp ) ); /*q1*/ } } @@ -3113,17 +3071,6 @@ void ivas_spar_dec_upmixer_sf_fx( #else ivas_dirac_dec_render_sf_fx( st_ivas, p_output, nchan_internal, cldfb_in_ts_re_fx, cldfb_in_ts_im_fx ); #endif // MSAN_FIX - /*TODO: To be removed later when ivas_dirac_dec_render_sf is integerated*/ - FOR( out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) - { - IF( st_ivas->cldfbSynDec[out_ch] ) - { - FOR( i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++ ) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix( st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] ,Q11); - } - } - } } /*------------------------------------------------------------------ends*/ IF ( st_ivas->hDirAC != NULL ) @@ -3150,6 +3097,7 @@ void ivas_spar_dec_upmixer_sf_fx( !( EQ_16(st_ivas->ivas_format , SBA_ISM_FORMAT) && EQ_16(st_ivas->ism_mode , ISM_SBA_MODE_DISC) && EQ_16(st_ivas->renderer_type , RENDERER_BINAURAL_FASTCONV_ROOM) ) ) { Scale_sig32(st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->p_filter_length, -6 ); + st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = sub(st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, 6); Scale_sig32( output_fx[ch], out_len, -6 ); FOR ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { @@ -3157,6 +3105,7 @@ void ivas_spar_dec_upmixer_sf_fx( } Scale_sig32( output_fx[ch], out_len, 6 ); Scale_sig32(st_ivas->cldfbSynDec[idx_in]->cldfb_state_fx, st_ivas->cldfbSynDec[idx_in]->p_filter_length, 6 ); + st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state = add(st_ivas->cldfbSynDec[idx_in]->Q_cldfb_state, 6); } idx_in++; @@ -3169,6 +3118,7 @@ void ivas_spar_dec_upmixer_sf_fx( FOR ( out_ch = 0; out_ch < numch_out_dirac; out_ch++ ) { Scale_sig32( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx, st_ivas->cldfbSynDec[out_ch]->p_filter_length, -6 ); + st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state = sub(st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state, 6); Scale_sig32( output_fx[out_ch], out_len, -6 ); FOR ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) { @@ -3176,6 +3126,7 @@ void ivas_spar_dec_upmixer_sf_fx( } Scale_sig32( output_fx[out_ch], out_len, 6 ); Scale_sig32( st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx, st_ivas->cldfbSynDec[out_ch]->p_filter_length, 6 ); + st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state = add(st_ivas->cldfbSynDec[out_ch]->Q_cldfb_state, 6); } } @@ -3321,15 +3272,6 @@ void ivas_spar_dec_upmixer_sf( /* CLDFB analysis of incoming frame */ -#ifdef IVAS_FLOAT_FIXED/*Float to fixed*/ - for (in_ch = 0; in_ch < numch_in; in_ch++) - { - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * (1LL << (Q11))); - } - } -#endif for ( in_ch = 0; in_ch < numch_in; in_ch++ ) { for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) @@ -3349,23 +3291,6 @@ void ivas_spar_dec_upmixer_sf( } } -#ifdef IVAS_FLOAT_FIXED/*Fixed to float */ - for ( in_ch = 0; in_ch < numch_in; in_ch++ ) - { - for ( ts = 0; ts < hSpar->subframe_nbslots[hSpar->subframes_rendered]; ts++ ) - { - for ( i = 0; i < CLDFB_NO_CHANNELS_MAX; i++ ) - { - cldfb_in_ts_re[in_ch][ts][i] = (float) ( cldfb_in_ts_re_fx[in_ch][ts][i] ) / (float) ( 1LL << 6 ); /*q_cldfb-5*/ - cldfb_in_ts_im[in_ch][ts][i] = (float) ( cldfb_in_ts_im_fx[in_ch][ts][i] ) / (float) ( 1LL << 6 ); /*q_cldfb-5*/ - } - } - for ( i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++ ) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = (float) ( ( st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] + ( 1 << 10 ) ) / ( 1LL << ( Q11 ) ) ); /*Rounding off*/ - } - } -#endif if ( ( hDecoderConfig->ivas_total_brate < IVAS_24k4 ) && ( ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA2 ) || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_HOA3 ) ) ) { ivas_spar_calc_smooth_facs( cldfb_in_ts_re[0], cldfb_in_ts_im[0], num_spar_bands, hSpar->subframe_nbslots[hSpar->subframes_rendered], hSpar->subframes_rendered == 0, &hSpar->hFbMixer->pFb->fb_bin_to_band, hSpar->hMdDec->smooth_fac, hSpar->hMdDec->smooth_buf ); diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 86c3f8c7f31063120f9ad2422e1a224fde5116d1..e12b810face983afa01c42a9febc16da8b7ddd7b 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1074,8 +1074,9 @@ typedef struct ivas_osba_data { #ifdef IVAS_FLOAT_FIXED Word32 **delayBuffer_fx; -#endif // IVAS_FLOAT_FIXED +#else // IVAS_FLOAT_FIXED float **delayBuffer; +#endif int16_t delayBuffer_size; int16_t delayBuffer_nchan; diff --git a/lib_dec/lib_dec_fx.c b/lib_dec/lib_dec_fx.c index 35535e8cfd819918f6a10d94751936b884685683..06ee287581d758c3446da40d64ec9c730aaf6ba6 100644 --- a/lib_dec/lib_dec_fx.c +++ b/lib_dec/lib_dec_fx.c @@ -1101,9 +1101,6 @@ static ivas_error IVAS_DEC_Setup( n_samples_granularity = NS2SA(st_ivas->hDecoderConfig->output_Fs, CLDFB_SLOT_NS); DECODER_CONFIG_HANDLE hDecoderConfig = NULL; - Word16 numch_out_dirac = 0; - SPAR_DEC_HANDLE hSpar = NULL; - Word16 numch_in; Word32 ivas_total_brate; ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate; Word16 SrcInd[MAX_NUM_TDREND_CHANNELS]; @@ -1121,31 +1118,7 @@ static ivas_error IVAS_DEC_Setup( { FOR(Word16 ch_idx = 0; ch_idx < st_ivas->hSbaIsmData->delayBuffer_nchan; ch_idx++) { - floatToFixed_arr32(st_ivas->hSbaIsmData->delayBuffer[ch_idx], st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], Q11, st_ivas->hSbaIsmData->delayBuffer_size); - } - } - hSpar = st_ivas->hSpar; - hDecoderConfig = st_ivas->hDecoderConfig; - numch_out_dirac = hDecoderConfig->nchan_out; - IF(hSpar) - { - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - FOR (Word16 in_ch = 0; in_ch < numch_in; in_ch++) - { - FOR (i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i] = (Word32)(st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] * (1LL << (Q11))); - } - } - FOR(Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++) - { - IF(st_ivas->cldfbSynDec[out_ch]) - { - FOR(i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i] = float_to_fix(st_ivas->cldfbSynDec[out_ch]->cldfb_state[i], Q11); - } - } + //floatToFixed_arr32(st_ivas->hSbaIsmData->delayBuffer[ch_idx], st_ivas->hSbaIsmData->delayBuffer_fx[ch_idx], Q11, st_ivas->hSbaIsmData->delayBuffer_size); } } Word16 n_tc; @@ -1175,20 +1148,11 @@ static ivas_error IVAS_DEC_Setup( } } // Float to fix conversions for ivas_cldfb_dec_reconfig_fx - FOR(i = 0; i < 16; i++) - { - IF(st_ivas->cldfbAnaDec[i]) - floatToFixed_arrL(st_ivas->cldfbAnaDec[i]->cldfb_state, st_ivas->cldfbAnaDec[i]->cldfb_state_fx, 11, sub(st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels)); - } IF(st_ivas->hSpar) { st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q_factor_arr(st_ivas->hSpar->hFbMixer->cldfb_cross_fade, 16); floatToFixed_arr(st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16); } - IF(st_ivas->cldfbSynDec[0]) - { - floatToFixed_arrL(st_ivas->cldfbSynDec[0]->cldfb_state, st_ivas->cldfbSynDec[0]->cldfb_state_fx, Q11, sub(st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels)); - } } IF(EQ_16(is_DTXrate(ivas_total_brate), 0) && st_ivas->ivas_format == MASA_ISM_FORMAT && GT_16(st_ivas->ini_frame, 0) && (GT_32(ivas_total_brate, IVAS_SID_5k2) && NE_32(ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate)) && EQ_16(st_ivas->ini_active_frame, 0)) { @@ -1202,21 +1166,11 @@ static ivas_error IVAS_DEC_Setup( } } // Float to fix conversions for ivas_cldfb_dec_reconfig_fx - FOR(i = 0; i < 16; i++) - { - IF(st_ivas->cldfbAnaDec[i]) - floatToFixed_arrL(st_ivas->cldfbAnaDec[i]->cldfb_state, st_ivas->cldfbAnaDec[i]->cldfb_state_fx, 11, sub(st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels)); - } IF(st_ivas->hSpar) { st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q = Q_factor_arr(st_ivas->hSpar->hFbMixer->cldfb_cross_fade, 16); floatToFixed_arr(st_ivas->hSpar->hFbMixer->cldfb_cross_fade, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_fx, st_ivas->hSpar->hFbMixer->cldfb_cross_fade_q, 16); } - - IF(st_ivas->cldfbSynDec[0]) - { - floatToFixed_arrL(st_ivas->cldfbSynDec[0]->cldfb_state, st_ivas->cldfbSynDec[0]->cldfb_state_fx, Q11, sub(st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels)); - } } IF(EQ_16(is_DTXrate(ivas_total_brate), 0) && (st_ivas->ivas_format == MC_FORMAT)) { @@ -1293,33 +1247,6 @@ static ivas_error IVAS_DEC_Setup( } } - IF(EQ_16(is_DTXrate(ivas_total_brate), 0) && (!(EQ_16(st_ivas->ini_active_frame, 0) && NE_32(ivas_total_brate, FRAME_NO_DATA) && LT_32(ivas_total_brate, MASA_STEREO_MIN_BITRATE) && EQ_16(st_ivas->nCPE, 1))) && st_ivas->bit_stream[(ivas_total_brate / FRAMES_PER_SEC) - 1] && st_ivas->ivas_format == MASA_FORMAT && ((GT_32(ivas_total_brate, IVAS_SID_5k2) && NE_32(ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate)) || EQ_16(st_ivas->ini_active_frame, 0))) - { - //IF (hTcBuffer->tc_buffer) - //fixedToFloat_arrL(hTcBuffer->tc_buffer_fx, hTcBuffer->tc_buffer, Q11, hTcBuffer->tc_buff_len); - IF(hSpar) - { - numch_in = hSpar->hFbMixer->fb_cfg->num_in_chans; - FOR(Word16 in_ch = 0; in_ch < numch_in; in_ch++) - { - FOR(i = 0; i < st_ivas->cldfbAnaDec[in_ch]->p_filter_length - st_ivas->cldfbAnaDec[in_ch]->no_channels; i++) - { - st_ivas->cldfbAnaDec[in_ch]->cldfb_state[i] = ((float)(st_ivas->cldfbAnaDec[in_ch]->cldfb_state_fx[i]) / (1LL << (Q11))); /*Rounding off*/ - } - } - FOR(Word16 out_ch = 0; out_ch < numch_out_dirac; out_ch++) - { - IF(st_ivas->cldfbSynDec[out_ch]) - { - FOR(i = 0; i < st_ivas->cldfbSynDec[out_ch]->p_filter_length; i++) - { - st_ivas->cldfbSynDec[out_ch]->cldfb_state[i] = ((float)(st_ivas->cldfbSynDec[out_ch]->cldfb_state_fx[i]) / (float)(1LL << (Q11))); - } - } - } - } - } - IF(EQ_16(is_DTXrate(ivas_total_brate), 0) && (!(EQ_16(st_ivas->ini_active_frame, 0) && NE_32(ivas_total_brate, FRAME_NO_DATA) && LT_32(ivas_total_brate, MASA_STEREO_MIN_BITRATE) && EQ_16(st_ivas->nCPE, 1))) && st_ivas->bit_stream[(ivas_total_brate / FRAMES_PER_SEC) - 1] && st_ivas->ivas_format == MASA_FORMAT && ((GT_32(ivas_total_brate, IVAS_SID_5k2) && NE_32(ivas_total_brate, st_ivas->hDecoderConfig->last_ivas_total_brate)) || EQ_16(st_ivas->ini_active_frame, 0))) { IF(EQ_16(st_ivas->ism_mode, ISM_MASA_MODE_DISC)) { @@ -1339,15 +1266,6 @@ static ivas_error IVAS_DEC_Setup( SrcSpatial_p->q_Pos_p = Q31; } } - FOR(i = 0; i < 16; i++) - { - IF(st_ivas->cldfbAnaDec[i]) - fixedToFloat_arrL(st_ivas->cldfbAnaDec[i]->cldfb_state_fx, st_ivas->cldfbAnaDec[i]->cldfb_state, 11, sub(st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels)); - } - IF(st_ivas->cldfbSynDec[0]) - { - fixedToFloat_arrL(st_ivas->cldfbSynDec[0]->cldfb_state_fx, st_ivas->cldfbSynDec[0]->cldfb_state, Q11, sub(st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels)); - } } @@ -1370,16 +1288,7 @@ static ivas_error IVAS_DEC_Setup( SrcSpatial_p->q_Pos_p = Q31; } } - FOR(i = 0; i < 16; i++) - { - IF(st_ivas->cldfbAnaDec[i]) - fixedToFloat_arrL(st_ivas->cldfbAnaDec[i]->cldfb_state_fx, st_ivas->cldfbAnaDec[i]->cldfb_state, 11, sub(st_ivas->cldfbAnaDec[i]->p_filter_length, st_ivas->cldfbAnaDec[i]->no_channels)); - } - IF(st_ivas->cldfbSynDec[0]) - { - fixedToFloat_arrL(st_ivas->cldfbSynDec[0]->cldfb_state_fx, st_ivas->cldfbSynDec[0]->cldfb_state, Q11, sub(st_ivas->cldfbSynDec[0]->p_filter_length, st_ivas->cldfbSynDec[0]->no_channels)); } - } IF(EQ_16(is_DTXrate(ivas_total_brate), 0) && (st_ivas->ivas_format == MC_FORMAT)) { IF (st_ivas->mc_mode == MC_MODE_PARAMMC) @@ -1451,7 +1360,6 @@ static ivas_error IVAS_DEC_GetTcSamples( MCT_DEC_HANDLE hMCT; Word16 ch, nCPE, cpe_id; nCPE = st_ivas->nCPE; - Word16 Q_tc = 11; DECODER_TC_BUFFER_HANDLE hTcBuffer = st_ivas->hTcBuffer; Word16 n_ch_cldfb_tmp = hTcBuffer->nchan_transport_jbm - hTcBuffer->nchan_buffer_full; hMCT = st_ivas->hMCT; @@ -1516,23 +1424,6 @@ static ivas_error IVAS_DEC_GetTcSamples( IF( NE_16( st_ivas->hDecoderConfig->Opt_tsm, 1) ) { - IF (st_ivas->hParamIsmDec != NULL) - { - f2me_16(st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain, &st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_fx, &st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_e); - } - // cldfb_state - - FOR ( ch = 0; ch < n_ch_cldfb_tmp; ch++) - { - Word16 cldfb_size = st_ivas->cldfbAnaDec[ch]->cldfb_size; - FOR (Word16 lp = 0; lp < cldfb_size; lp++) - { - st_ivas->cldfbAnaDec[ch]->cldfb_state_fx[lp] = floatToFixed(st_ivas->cldfbAnaDec[ch]->cldfb_state[lp], Q_tc); - } - } - // cldfb - - IF (st_ivas->ivas_format == ISM_FORMAT) { IF (st_ivas->hSpatParamRendCom != NULL) @@ -1594,14 +1485,6 @@ static ivas_error IVAS_DEC_GetTcSamples( IF( NE_16( st_ivas->hDecoderConfig->Opt_tsm, 1 ) ) { - FOR( ch = 0; ch < n_ch_cldfb_tmp; ch++) - { - Word16 cldfb_size = st_ivas->cldfbAnaDec[ch]->cldfb_size; - FOR(Word16 lp = 0; lp < cldfb_size; lp++) - { - st_ivas->cldfbAnaDec[ch]->cldfb_state[lp] = fixedToFloat(st_ivas->cldfbAnaDec[ch]->cldfb_state_fx[lp], Q_tc); - } - } IF(st_ivas->ivas_format == ISM_FORMAT) { IF(st_ivas->hSpatParamRendCom != NULL) @@ -1638,11 +1521,6 @@ static ivas_error IVAS_DEC_GetTcSamples( } } } - - IF(st_ivas->hParamIsmDec != NULL) - { - st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain = me2f_16(st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_fx, st_ivas->hParamIsmDec->hParamIsm->last_dmx_gain_e); - } /*------------------------fix 2 flt----------------------*/ } @@ -1675,17 +1553,14 @@ static ivas_error IVAS_DEC_GetTcSamples( /*note : cldfb_size here signifies the original size which was assigned to cldfb_state_fx buffer not its current size*/ IF (sts[n]->cldfbAna != NULL) { - fixedToFloat_arrL(sts[n]->cldfbAna->cldfb_state_fx, sts[n]->cldfbAna->cldfb_state, 10, sts[n]->cldfbAna->cldfb_state_length); + scale_sig32(sts[n]->cldfbAna->cldfb_state_fx, sts[n]->cldfbAna->cldfb_size, sub(Q11, Q10) ); + sts[n]->cldfbAna->Q_cldfb_state = Q11; } IF (sts[n]->cldfbSyn != NULL) { - fixedToFloat_arrL(sts[n]->cldfbSyn->cldfb_state_fx, sts[n]->cldfbSyn->cldfb_state, 4, sts[n]->cldfbSyn->p_filter_length); + scale_sig32(sts[n]->cldfbSyn->cldfb_state_fx, sts[n]->cldfbSyn->cldfb_size, sub(Q11, Q4) ); + sts[n]->cldfbSyn->Q_cldfb_state = Q11; } - IF (sts[n]->cldfbBPF != NULL) - { - fixedToFloat_arrL(sts[n]->cldfbBPF->cldfb_state_fx, sts[n]->cldfbBPF->cldfb_state, 11, sts[n]->cldfbBPF->cldfb_state_length); - } - /*-------------------cldfb-end---------------------------*/ /* reset WB BWE buffers */ diff --git a/lib_rend/ivas_dirac_dec_binaural_functions.c b/lib_rend/ivas_dirac_dec_binaural_functions.c index 6b4029be87b838d53daacb3c338e77f2eadb939d..b40d30d80eaf7def8dfcb96782bfad3ef23a3f43 100644 --- a/lib_rend/ivas_dirac_dec_binaural_functions.c +++ b/lib_rend/ivas_dirac_dec_binaural_functions.c @@ -36,6 +36,7 @@ #include #include "prot.h" #include "prot_fx2.h" +#include "prot_fx1.h" #include "ivas_prot.h" #include "ivas_prot_rend.h" #include "ivas_cnst.h" @@ -1133,19 +1134,6 @@ static void ivas_dirac_dec_binaural_internal( nchan_tc = add( nchan_tc, ivas_sba_get_nchan_metadata( st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ) ); #endif -#ifdef MSAN_FIX - // FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) - FOR( Word16 cha = 0; cha < MAX_INTERN_CHANNELS; cha++ ) -#else - FOR( Word16 cha = 0; cha < 3 + max( 1, st_ivas->nchan_ism ); cha++ ) -#endif - { - IF( st_ivas->cldfbAnaDec[cha] && st_ivas->cldfbAnaDec[cha]->cldfb_state ) - FOR( Word16 ind = 0; ind < st_ivas->cldfbAnaDec[cha]->cldfb_state_length; ind++ ) - { - st_ivas->cldfbAnaDec[cha]->cldfb_state_fx[ind] = (Word32) ( st_ivas->cldfbAnaDec[cha]->cldfb_state[ind] * ( 1 << q_input ) ); - } - } st_ivas->cldfbAnaDec[1]->q_scale = 15; IF( abs_s( (Word16) st_ivas->cldfbAnaDec[1]->scale_flt ) != 0 ) st_ivas->cldfbAnaDec[1]->q_scale = norm_s( (Word16) st_ivas->cldfbAnaDec[1]->scale_flt ); @@ -1355,7 +1343,7 @@ static void ivas_dirac_dec_binaural_internal( } } - IF ( config_data.ivas_format == SBA_FORMAT || config_data.ivas_format == SBA_ISM_FORMAT ) + IF( config_data.ivas_format == SBA_FORMAT || config_data.ivas_format == SBA_ISM_FORMAT ) { hDiracDecBin->hDiffuseDist = &diffuseDistData; ivas_spar_param_to_masa_param_mapping_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_cldfb, subframe ); @@ -1364,10 +1352,16 @@ static void ivas_dirac_dec_binaural_internal( FOR( int idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) { - floatToFixed_arrL(st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band[idx], st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], Q31, IVAS_MAX_NUM_FB_BANDS ); + // floatToFixed_arrL( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band[idx], st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], Q31, IVAS_MAX_NUM_FB_BANDS ); + Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, sub( Q31, Q22 ) ); } #endif ivas_sba_prototype_renderer_fx( st_ivas, Cldfb_RealBuffer_in_fx, Cldfb_ImagBuffer_in_fx, q_cldfb, subframe ); + FOR( int idx = 0; idx < CLDFB_NO_CHANNELS_MAX; idx++ ) + { + // floatToFixed_arrL( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band[idx], st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], Q31, IVAS_MAX_NUM_FB_BANDS ); + Scale_sig32( st_ivas->hSpar->hFbMixer->pFb->fb_bin_to_band.pp_cldfb_weights_per_spar_band_fx[idx], IVAS_MAX_NUM_FB_BANDS, sub( Q22, Q31 ) ); + } } Word16 q_inp = Q6; @@ -1511,18 +1505,6 @@ static void ivas_dirac_dec_binaural_internal( hDiracDecBin->ChCrossImOutPrev[j] = me2f( hDiracDecBin->ChCrossImOutPrev_fx[j], hDiracDecBin->ChCrossImOutPrev_e[j] ); } fixedToFloat_arrL( hDiracDecBin->frameMeanDiffuseness_fx, hDiracDecBin->frameMeanDiffuseness, 29, CLDFB_NO_CHANNELS_MAX ); - -#ifdef MSAN_FIX - // FOR( Word16 cha = 0; cha < nchan_tc; cha++ ) - FOR( Word16 cha = 0; cha < MAX_INTERN_CHANNELS; cha++ ) -#else - FOR( Word16 cha = 0; cha < 3 + max( 1, st_ivas->nchan_ism ); cha++ ) -#endif - IF( st_ivas->cldfbAnaDec[cha] && st_ivas->cldfbAnaDec[cha]->cldfb_state ) - FOR( Word16 ind = 0; ind < st_ivas->cldfbAnaDec[cha]->cldfb_state_length; ind++ ) - { - st_ivas->cldfbAnaDec[cha]->cldfb_state[ind] = (float) ( st_ivas->cldfbAnaDec[cha]->cldfb_state_fx[ind] ) / (float) ( 1 << q_input ); - } #endif //TODO: To be removed once below function is fixed @@ -1584,7 +1566,6 @@ static void ivas_dirac_dec_binaural_internal( floatToFixed_arr16( hDiracDecBin->processMtxRePrev[ch][slot], hDiracDecBin->processMtxRePrev_fx[ch][slot], q_mat, nBins ); floatToFixed_arr16( hDiracDecBin->processMtxImPrev[ch][slot], hDiracDecBin->processMtxImPrev_fx[ch][slot], q_mat, nBins ); } - floatToFixed_arrL( st_ivas->cldfbSynDec[ch]->cldfb_state, st_ivas->cldfbSynDec[ch]->cldfb_state_fx, Q11, st_ivas->cldfbSynDec[ch]->p_filter_length ); st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } #endif @@ -1599,7 +1580,8 @@ static void ivas_dirac_dec_binaural_internal( FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { fixedToFloat_arrL32( output_fx[ch], output_f[ch], q_out, imult1616( nBins, hSpatParamRendCom->subframe_nbslots[subframe] ) ); - fixedToFloat_arrL32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_state, st_ivas->cldfbSynDec[ch]->Q_cldfb_state, st_ivas->cldfbSynDec[ch]->p_filter_length ); + scale_sig32( st_ivas->cldfbSynDec[ch]->cldfb_state_fx, st_ivas->cldfbSynDec[ch]->cldfb_size, sub(Q11, st_ivas->cldfbSynDec[ch]->Q_cldfb_state) ); + st_ivas->cldfbSynDec[ch]->Q_cldfb_state = Q11; } #endif @@ -3146,7 +3128,9 @@ static void ivas_dirac_dec_binaural_process_output_fx( // scaling cldfb states to q_result-1// scale_sig32( cldfbSynDec[0]->cldfb_state_fx, cldfbSynDec[0]->p_filter_length, cldfb_state_shift ); + cldfbSynDec[0]->Q_cldfb_state = add(cldfbSynDec[0]->Q_cldfb_state, cldfb_state_shift); scale_sig32( cldfbSynDec[1]->cldfb_state_fx, cldfbSynDec[1]->p_filter_length, cldfb_state_shift ); + cldfbSynDec[1]->Q_cldfb_state = add(cldfbSynDec[1]->Q_cldfb_state, cldfb_state_shift); q_inp_mix = add( q_inp_mix, q_input ); @@ -5763,8 +5747,6 @@ static void ivas_masa_ext_rend_parambin_internal( { output_fx[ch] = output_fx_buff[ch]; floatToFixed_arrL32(output_f[ch], output_fx[ch], Q11, L_FRAME48k); - IF(hMasaExtRend->cldfbAnaRend[ch]) - floatToFixed_arrL32(hMasaExtRend->cldfbAnaRend[ch]->cldfb_state, hMasaExtRend->cldfbAnaRend[ch]->cldfb_state_fx, Q11, hMasaExtRend->cldfbAnaRend[ch]->p_filter_length - hMasaExtRend->cldfbAnaRend[ch]->no_channels); } #endif @@ -5915,11 +5897,6 @@ static void ivas_masa_ext_rend_parambin_internal( } fixedToFloat_arrL( hDiracDecBin->frameMeanDiffuseness_fx, hDiracDecBin->frameMeanDiffuseness, 29, CLDFB_NO_CHANNELS_MAX ); - FOR( ch = 0; ch < 2; ch++) - { - IF(hMasaExtRend->cldfbAnaRend[ch]) - fixedToFloat_arrL32(hMasaExtRend->cldfbAnaRend[ch]->cldfb_state_fx, hMasaExtRend->cldfbAnaRend[ch]->cldfb_state, Q11, hMasaExtRend->cldfbAnaRend[ch]->p_filter_length - hMasaExtRend->cldfbAnaRend[ch]->no_channels); - } #endif @@ -5979,7 +5956,6 @@ static void ivas_masa_ext_rend_parambin_internal( floatToFixed_arr16( hDiracDecBin->processMtxRePrev[ch][slot], hDiracDecBin->processMtxRePrev_fx[ch][slot], q_mat, nBins ); floatToFixed_arr16( hDiracDecBin->processMtxImPrev[ch][slot], hDiracDecBin->processMtxImPrev_fx[ch][slot], q_mat, nBins ); } - floatToFixed_arrL( hMasaExtRend->cldfbSynRend[ch]->cldfb_state, hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx, Q11, hMasaExtRend->cldfbSynRend[ch]->p_filter_length ); hMasaExtRend->cldfbSynRend[ch]->Q_cldfb_state = Q11; } #endif //Float to fix ends @@ -5996,7 +5972,8 @@ static void ivas_masa_ext_rend_parambin_internal( FOR( ch = 0; ch < BINAURAL_CHANNELS; ch++ ) { fixedToFloat_arrL32( output_fx[ch], output_f[ch], q_out, nBins * hSpatParamRendCom->subframe_nbslots[subframe] ); - fixedToFloat_arrL32( hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx, hMasaExtRend->cldfbSynRend[ch]->cldfb_state, hMasaExtRend->cldfbSynRend[ch]->Q_cldfb_state, hMasaExtRend->cldfbSynRend[ch]->p_filter_length ); + scale_sig32( hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx, hMasaExtRend->cldfbSynRend[ch]->cldfb_size, sub(Q11, hMasaExtRend->cldfbSynRend[ch]->Q_cldfb_state) ); + hMasaExtRend->cldfbSynRend[ch]->Q_cldfb_state = Q11; } #endif diff --git a/lib_rend/ivas_dirac_rend.c b/lib_rend/ivas_dirac_rend.c index 23522ead2ba7a3e3769d0193415e516b1d441dd3..5f526df8e606d8fbb89b2725e3f7b6ea60e5ea74 100644 --- a/lib_rend/ivas_dirac_rend.c +++ b/lib_rend/ivas_dirac_rend.c @@ -4455,6 +4455,9 @@ void ivas_masa_init_stereotype_detection_fx( stereo_type_detect->subtract_power_y_smooth_fx = 0; stereo_type_detect->q_subtract_power_y_smooth = Q31; stereo_type_detect->target_power_y_smooth_fx = 0; +#ifdef MSAN_FIX + stereo_type_detect->q_target_power_y_smooth = 31; +#endif stereo_type_detect->lr_total_bb_ratio_db_fx = 0; stereo_type_detect->lr_total_hi_ratio_db_fx = 0; diff --git a/lib_rend/ivas_limiter.c b/lib_rend/ivas_limiter.c index 0caee4ed25b02918c06160b1c32bbedd1da6d6ea..a6dae2fcce7e5bfe4cd1348fecc3813da0abccf9 100644 --- a/lib_rend/ivas_limiter.c +++ b/lib_rend/ivas_limiter.c @@ -94,7 +94,7 @@ Word32 release_cnst_table[201] = //Q31 * Detection of very strong saturations, * usually happens as a consequence of a heavy corrupted bitstream *-------------------------------------------------------------------*/ - +#ifndef IVAS_FLOAT_FIXED /*! r: apply_strong_limiting flag */ static int16_t detect_strong_saturations( const int16_t BER_detect, /* i : BER detect flag */ @@ -142,7 +142,7 @@ static int16_t detect_strong_saturations( return apply_strong_limiting; } -#ifdef IVAS_FLOAT_FIXED +#else /*-------------------------------------------------------------------* * detect_strong_saturations() * @@ -201,6 +201,8 @@ static Word16 detect_strong_saturations_fx( return apply_strong_limiting; } +#endif +#ifdef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * ivas_limiter_open() * @@ -230,10 +232,10 @@ ivas_error ivas_limiter_open( hLimiter->max_num_channels = max_num_channels; hLimiter->num_channels = max_num_channels; - if ( ( hLimiter->channel_ptrs = malloc( max_num_channels * sizeof( float * ) ) ) == NULL ) + /*if ( ( hLimiter->channel_ptrs = malloc( max_num_channels * sizeof( float * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Limiter handle\n" ) ); - } + }*/ if ( ( hLimiter->channel_ptrs_fx = malloc( max_num_channels * sizeof( Word32 * ) ) ) == NULL ) { return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for Limiter handle\n" ) ); @@ -337,7 +339,7 @@ void ivas_limiter_close( return; } - free( ( *phLimiter )->channel_ptrs ); + //free( ( *phLimiter )->channel_ptrs ); free( ( *phLimiter )->channel_ptrs_fx ); free( *phLimiter ); *phLimiter = NULL; @@ -407,7 +409,7 @@ void ivas_limiter_dec_fx( return; } -#endif +#else /*-------------------------------------------------------------------* * ivas_limiter_dec() @@ -447,6 +449,7 @@ void ivas_limiter_dec( return; } +#endif #ifdef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * limiter_process() @@ -628,7 +631,7 @@ void limiter_process_fx( return; } -#endif +#else /*-------------------------------------------------------------------* * limiter_process() * @@ -795,3 +798,4 @@ void limiter_process( return; } +#endif \ No newline at end of file diff --git a/lib_rend/ivas_stat_rend.h b/lib_rend/ivas_stat_rend.h index ca4989a8b436cf80175a5baae399fa4f9da43b67..c6f192f4c457d0a96d6662b92ce5b2a886f0d7c8 100644 --- a/lib_rend/ivas_stat_rend.h +++ b/lib_rend/ivas_stat_rend.h @@ -2180,14 +2180,14 @@ typedef struct { Word16 max_num_channels; Word16 num_channels; - float **channel_ptrs; + //float **channel_ptrs; Word32 **channel_ptrs_fx; Word32 sampling_rate; - float gain; + //float gain; Word32 gain_fx; - float release_heuristic; + //float release_heuristic; Word32 release_heuristic_fx; - float attack_constant; + //float attack_constant; Word32 attack_constant_fx; Word16 strong_saturation_count; diff --git a/lib_rend/lib_rend.c b/lib_rend/lib_rend.c index 31b4712da2c8f44b59dd1842294a835355c4302e..4aa4ba942c97fe6d34e29ccda82e2cd1d19d7cbe 100644 --- a/lib_rend/lib_rend.c +++ b/lib_rend/lib_rend.c @@ -677,7 +677,7 @@ static Word32 limitRendererOutput_fx( return numClipping; } -#endif +#else /*-------------------------------------------------------------------* * limitRendererOutput() @@ -723,7 +723,7 @@ static int32_t limitRendererOutput( return numClipping; } - +#endif #ifdef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * validateOutputAudioConfig() @@ -1104,12 +1104,12 @@ static ivas_error initLimiter( return error; } // The below code has to be deleted once whole conversion is completed - ( *phLimiter )->gain = 1.0f; - ( *phLimiter )->release_heuristic = 0.f; - ( *phLimiter )->attack_constant = powf( 0.01f, 1.0f / ( IVAS_LIMITER_ATTACK_SECONDS * sampleRate ) ); + //( *phLimiter )->gain = 1.0f; + //( *phLimiter )->release_heuristic = 0.f; + //( *phLimiter )->attack_constant = powf( 0.01f, 1.0f / ( IVAS_LIMITER_ATTACK_SECONDS * sampleRate ) ); for ( Word32 i = 0; i < numChannels; ++i ) { - ( *phLimiter )->channel_ptrs[i] = NULL; + //( *phLimiter )->channel_ptrs[i] = NULL; } // Till this line. @@ -12305,7 +12305,16 @@ static ivas_error renderInputMasa( #if 1 //TOBE REMOVED intermidiate_ext_dirac_render(masaInput->hMasaExtRend, tmpBuffer_fx, tmpBuffer, 1); #endif + FOR ( ch = 0; ch < masaInput->hMasaExtRend->hDirACRend->hOutSetup.nchan_out_woLFE + masaInput->hMasaExtRend->hDirACRend->hOutSetup.num_lfe; ch++ ) + { + masaInput->hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state = Q11; + } ivas_masa_ext_dirac_render_fx( masaInput->hMasaExtRend, tmpBuffer_fx, num_subframes ); + FOR ( ch = 0; ch < masaInput->hMasaExtRend->hDirACRend->hOutSetup.nchan_out_woLFE + masaInput->hMasaExtRend->hDirACRend->hOutSetup.num_lfe; ch++ ) + { + scale_sig32(masaInput->hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx, masaInput->hMasaExtRend->cldfbSynRend[ch]->cldfb_size, sub(Q11, masaInput->hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state)); + masaInput->hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state = Q11; + } #if 1 //TOBE REMOVED intermidiate_ext_dirac_render(masaInput->hMasaExtRend, tmpBuffer_fx, tmpBuffer, 0); @@ -12910,7 +12919,7 @@ static ivas_error getSamplesInternal( return error; } - IF( NE_32( hIvasRend->inputsSba[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) || NE_32( hIvasRend->inputsMc[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )|| NE_32( hIvasRend->inputsIsm[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )) + /*IF( NE_32( hIvasRend->inputsSba[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) || NE_32( hIvasRend->inputsMc[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )|| NE_32( hIvasRend->inputsIsm[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )) { #ifndef DISABLE_LIMITER Word32 limiter_thresold = L_lshl( IVAS_LIMITER_THRESHOLD, *outAudio.pq_fact ); @@ -12923,8 +12932,19 @@ static ivas_error getSamplesInternal( limitRendererOutput( hIvasRend->hLimiter, outAudio.data, outAudio.config.numSamplesPerChannel, IVAS_LIMITER_THRESHOLD ); *outAudio.pq_fact = 0; #endif - } - + }*/ + IF( NE_32( hIvasRend->inputsSba[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID ) || NE_32( hIvasRend->inputsMc[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )|| NE_32( hIvasRend->inputsIsm[0].base.inConfig, IVAS_AUDIO_CONFIG_INVALID )) + { + Word32 limiter_thresold = L_lshl( IVAS_LIMITER_THRESHOLD, *outAudio.pq_fact ); + limitRendererOutput_fx( hIvasRend->hLimiter, outAudio.data_fx, outAudio.config.numSamplesPerChannel, limiter_thresold, *outAudio.pq_fact ); + } + ELSE + { + floatToFixed_arrL(outAudio.data, outAudio.data_fx, *outAudio.pq_fact, hIvasRend->hLimiter->num_channels * outAudio.config.numSamplesPerChannel); + Word32 limiter_thresold = L_lshl( IVAS_LIMITER_THRESHOLD, *outAudio.pq_fact ); + limitRendererOutput_fx( hIvasRend->hLimiter, outAudio.data_fx, outAudio.config.numSamplesPerChannel, limiter_thresold, *outAudio.pq_fact ); + fixedToFloat_arrL(outAudio.data_fx, outAudio.data, *outAudio.pq_fact, hIvasRend->hLimiter->num_channels * outAudio.config.numSamplesPerChannel); + } /* update global cominbed orientation start index */ ivas_combined_orientation_update_start_index( hIvasRend->hCombinedOrientationData, outAudio.config.numSamplesPerChannel ); @@ -14833,21 +14853,12 @@ static void intermidiate_ext_dirac_render( f2me_buf(hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f, hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_fx, &hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_q, hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_len); hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_q = 31 - hDirACRend->h_output_synthesis_psd_state.proto_diffuse_buffer_f_q; - FOR ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[subframe_idx]; slot_idx++ ) { /* CLDFB Analysis*/ FOR ( ch = 0; ch < nchan_transport; ch++ ) { - q_cldfb = 11; - hMasaExtRend->cldfbAnaRend[ch]->Q_cldfb_state = q_cldfb; - - /*for (i = 0; i < CLDFB_NO_CHANNELS_MAX; i++) { - output_f_fx[ch][hSpatParamRendCom->num_freq_bands * index_slot + i] = (Word32)(output_f[ch][hSpatParamRendCom->num_freq_bands * index_slot + i] * (1 << q_cldfb)); - }*/ - for (i = 0; i < hMasaExtRend->cldfbAnaRend[ch]->p_filter_length - hMasaExtRend->cldfbAnaRend[ch]->no_channels; i++) { - hMasaExtRend->cldfbAnaRend[ch]->cldfb_state_fx[i] = (Word32)(hMasaExtRend->cldfbAnaRend[ch]->cldfb_state[i] * (1 << (hMasaExtRend->cldfbAnaRend[ch]->Q_cldfb_state))); - } + hMasaExtRend->cldfbAnaRend[ch]->Q_cldfb_state = Q11; } } if(DirAC_mem.frame_dec_f) @@ -14871,14 +14882,6 @@ static void intermidiate_ext_dirac_render( floatToFixed_arrL( hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_fx, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_q, hDirACRend->h_output_synthesis_psd_state.proto_power_diff_smooth_prev_len ); } - for ( ch = 0; ch < hDirACRend->hOutSetup.nchan_out_woLFE + hDirACRend->hOutSetup.num_lfe; ch++ ) - { - q_cldfb = 11; - hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state = q_cldfb; - for (i = 0; i < hMasaExtRend->cldfbSynRend[ch]->p_filter_length; i++) { - hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx[i] = (Word32)(hMasaExtRend->cldfbSynRend[ch]->cldfb_state[i] * (1 << (hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state - 1))); - } - } } else { @@ -14947,14 +14950,11 @@ static void intermidiate_ext_dirac_render( FOR ( slot_idx = 0; slot_idx < hSpatParamRendCom->subframe_nbslots[hSpatParamRendCom->subframes_rendered]; slot_idx++ ) { - //q_cldfb = 11; - //hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state = q_cldfb; /* CLDFB Analysis*/ FOR ( ch = 0; ch < nchan_transport; ch++ ) { - for (i = 0; i < hMasaExtRend->cldfbAnaRend[ch]->p_filter_length - hMasaExtRend->cldfbAnaRend[ch]->no_channels; i++) { - hMasaExtRend->cldfbAnaRend[ch]->cldfb_state[i] = (float)(hMasaExtRend->cldfbAnaRend[ch]->cldfb_state_fx[i] / (1 << (hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state))); - } + scale_sig32(hMasaExtRend->cldfbAnaRend[ch]->cldfb_state_fx, hMasaExtRend->cldfbAnaRend[ch]->cldfb_size, sub(Q11, hMasaExtRend->cldfbAnaRend[0]->Q_cldfb_state) ); + hMasaExtRend->cldfbAnaRend[ch]->Q_cldfb_state = Q11; } } if(hDirACRend->h_output_synthesis_psd_state.proto_power_smooth){ @@ -14968,10 +14968,8 @@ static void intermidiate_ext_dirac_render( for ( ch = 0; ch < hDirACRend->hOutSetup.nchan_out_woLFE + hDirACRend->hOutSetup.num_lfe; ch++ ) { - for (i = 0; i < hMasaExtRend->cldfbSynRend[ch]->p_filter_length; i++) - { - hMasaExtRend->cldfbSynRend[ch]->cldfb_state[i] = ((float)hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx[i] / (1 << ((hMasaExtRend->cldfbSynRend[0]->Q_cldfb_state)))); - } + scale_sig32(hMasaExtRend->cldfbSynRend[ch]->cldfb_state_fx, hMasaExtRend->cldfbSynRend[ch]->cldfb_size, sub(Q11, hMasaExtRend->cldfbSynRend[0]->Q_cldfb_state) ); + hMasaExtRend->cldfbSynRend[ch]->Q_cldfb_state = Q11; } for(i = 0; i < MAX_OUTPUT_CHANNELS; i++) {