From d0e88a8781e1406786c17f1a246e6db48d80cd08 Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 16:45:17 +0200 Subject: [PATCH 1/6] merge duplicated files --- Workspace_msvc/lib_com.vcxproj | 9 +- Workspace_msvc/lib_com.vcxproj.filters | 28 +- lib_com/cldfb_fx.c | 1 - lib_com/cng_exc_fx.c | 22 +- lib_com/fft_fx.c | 2 - lib_com/fft_rel_fx.c | 241 +- lib_com/ivas_dirac_com_fx.c | 4 +- lib_com/ivas_fb_mixer_fx.c | 1 - lib_com/ivas_lfe_com_fx.c | 10 +- lib_com/ivas_limiter_fx.c | 2 +- lib_com/ivas_masa_com_fx.c | 1 - lib_com/ivas_mc_param_com_fx.c | 3 +- lib_com/ivas_mdct_imdct_fx.c | 2 +- lib_com/ivas_mdft_imdft_fx.c | 1 - lib_com/ivas_qmetadata_com_fx.c | 2 - lib_com/ivas_qspherical_com_fx.c | 1 - lib_com/ivas_rom_com.c | 2916 ------- lib_com/ivas_rom_com.h | 191 +- lib_com/ivas_rom_com_fx.c | 3180 +++++++- lib_com/ivas_rom_com_fx.h | 302 - ..._rotation_com.c => ivas_rotation_com_fx.c} | 2 + lib_com/ivas_spar_com_fx.c | 1 - lib_com/ivas_spar_com_quant_util_fx.c | 9 +- lib_com/ivas_stereo_ica_com_fx.c | 58 +- lib_com/ivas_stereo_td_bit_alloc_fx.c | 1 - lib_com/options_warnings.h | 3 - lib_com/prot_fx.h | 6 - lib_com/rom_com.c | 6759 ++++++++++++++++- lib_com/rom_com.h | 120 +- lib_com/rom_com_fx.c | 6704 ---------------- lib_com/rom_com_fx.h | 120 - lib_com/swb_tbe_com_fx.c | 7 +- lib_com/tools.c | 901 --- lib_com/tools_fx.c | 1573 +++- lib_dec/dec_tcx_fx.c | 14 +- lib_dec/ivas_binRenderer_internal_fx.c | 12 +- lib_dec/ivas_dirac_dec_fx.c | 3 +- lib_dec/ivas_ism_metadata_dec_fx.c | 2 +- lib_dec/ivas_ism_param_dec_fx.c | 4 +- lib_dec/ivas_lfe_plc_fx.c | 1 - lib_dec/ivas_masa_dec_fx.c | 1 - lib_dec/ivas_mc_paramupmix_dec_fx.c | 11 +- lib_dec/ivas_qmetadata_dec_fx.c | 4 +- lib_dec/ivas_qspherical_dec_fx.c | 1 - lib_dec/ivas_sba_dirac_stereo_dec_fx.c | 2 +- lib_dec/ivas_sns_dec_fx.c | 1 - lib_dec/ivas_spar_md_dec_fx.c | 2 +- lib_dec/ivas_stereo_cng_dec_fx.c | 2 +- lib_dec/ivas_stereo_dft_dec_fx.c | 1 - lib_dec/ivas_stereo_icbwe_dec_fx.c | 1 - lib_dec/ivas_stereo_switching_dec_fx.c | 1 - lib_dec/ivas_stereo_td_dec_fx.c | 10 +- lib_enc/FEC_enc_fx.c | 10 +- lib_enc/acelp_core_enc_fx.c | 1 - lib_enc/acelp_core_switch_enc_fx.c | 2 +- lib_enc/acelp_enc_util_fx.c | 1 - lib_enc/amr_wb_enc_fx.c | 8 +- lib_enc/analy_lp_fx.c | 2 +- lib_enc/cod4t64_fx.c | 3 +- lib_enc/cod_tcx_fx.c | 5 +- lib_enc/core_enc_init_fx.c | 3 - lib_enc/core_enc_ol_fx.c | 2 - lib_enc/core_enc_reconf_fx.c | 8 +- lib_enc/core_enc_switch_fx.c | 2 +- lib_enc/core_switching_enc_fx.c | 11 +- lib_enc/decision_matrix_enc_fx.c | 2 - lib_enc/diffcod_fx.c | 9 +- lib_enc/dtx_fx.c | 8 +- lib_enc/enc_acelp_fx.c | 170 +- lib_enc/enc_amr_wb_fx.c | 9 +- lib_enc/enc_gain_fx.c | 14 +- lib_enc/enc_gen_voic_fx.c | 2 +- lib_enc/enc_gen_voic_rf_fx.c | 1 - lib_enc/enc_higher_acelp_fx.c | 14 +- lib_enc/enc_pit_exc_fx.c | 3 +- lib_enc/enc_prm_fx.c | 1 - lib_enc/enc_tran_fx.c | 8 +- lib_enc/eval_pit_contr_fx.c | 25 +- lib_enc/fd_cng_enc_fx.c | 2 - lib_enc/gain_enc_fx.c | 12 +- lib_enc/gaus_enc_fx.c | 7 +- lib_enc/gs_enc_fx.c | 5 +- lib_enc/hf_cod_amrwb_fx.c | 5 +- lib_enc/hq_classifier_enc_fx.c | 18 +- lib_enc/hq_core_enc_fx.c | 13 +- lib_enc/hq_hr_enc_fx.c | 10 +- lib_enc/hq_lr_enc_fx.c | 5 +- lib_enc/init_enc_fx.c | 10 +- lib_enc/inov_enc_fx.c | 3 +- lib_enc/ivas_dirac_enc_fx.c | 4 +- lib_enc/ivas_ism_metadata_enc_fx.c | 1 - lib_enc/ivas_ism_param_enc_fx.c | 5 +- lib_enc/ivas_masa_enc_fx.c | 1 - lib_enc/ivas_mc_paramupmix_enc_fx.c | 1 - lib_enc/ivas_mcmasa_enc_fx.c | 1 - lib_enc/ivas_qmetadata_enc_fx.c | 73 +- lib_enc/ivas_qspherical_enc_fx.c | 1 - lib_enc/ivas_sns_enc_fx.c | 2 +- lib_enc/ivas_spar_md_enc_fx.c | 1 - lib_enc/ivas_stereo_dft_enc_fx.c | 1 - lib_enc/ivas_stereo_dmx_evs_fx.c | 5 +- lib_enc/ivas_stereo_ica_enc_fx.c | 5 +- lib_enc/ivas_stereo_icbwe_enc_fx.c | 3 +- lib_enc/ivas_stereo_mdct_stereo_enc_fx.c | 1 - lib_enc/ivas_stereo_switching_enc_fx.c | 2 +- lib_enc/ivas_stereo_td_analysis_fx.c | 1 - lib_enc/ivas_stereo_td_enc_fx.c | 2 +- lib_enc/ivas_tcx_core_enc_fx.c | 1 - lib_enc/lead_indexing_fx.c | 5 +- lib_enc/lsf_enc_fx.c | 10 +- lib_enc/lsf_msvq_ma_enc_fx.c | 2 - lib_enc/mslvq_enc_fx.c | 3 +- lib_enc/noise_adjust_fx.c | 24 +- lib_enc/peak_vq_enc_fx.c | 8 +- lib_enc/pit_enc_fx.c | 11 +- lib_enc/pitch_ol2_fx.c | 12 +- lib_enc/pitch_ol_fx.c | 3 +- lib_enc/ppp_enc_fx.c | 4 +- lib_enc/pre_proc_fx.c | 4 +- lib_enc/pvq_core_enc_fx.c | 4 +- lib_enc/pvq_encode_fx.c | 13 +- lib_enc/q_gain2p_fx.c | 2 +- lib_enc/qlpc_stoch_fx.c | 3 - lib_enc/range_enc_fx.c | 9 +- lib_enc/reordernorm_fx.c | 2 +- lib_enc/rst_enc_fx.c | 9 +- lib_enc/scale_enc_fx.c | 11 +- lib_enc/set_impulse_fx.c | 12 +- lib_enc/setmodeindex_fx.c | 3 +- lib_enc/speech_music_classif_fx.c | 4 +- lib_enc/stat_noise_uv_enc_fx.c | 3 +- lib_enc/swb_bwe_enc_fx.c | 1 - lib_enc/swb_bwe_enc_hr_fx.c | 11 +- lib_enc/swb_pre_proc_fx.c | 4 +- lib_enc/swb_tbe_enc_fx.c | 66 +- lib_enc/tcx_ltp_enc_fx.c | 22 +- lib_enc/tns_base_enc_fx.c | 4 +- lib_enc/transition_enc_fx.c | 1 - lib_enc/updt_enc_fx.c | 7 +- lib_enc/vbr_average_rate_fx.c | 6 +- lib_enc/vlpc_1st_cod_fx.c | 3 +- lib_enc/voiced_enc_fx.c | 5 +- lib_enc/waveadjust_fec_cod_fx.c | 3 +- lib_rend/ivas_dirac_output_synthesis_dec_fx.c | 2 +- lib_rend/ivas_mcmasa_ana_fx.c | 2 +- lib_rend/ivas_objectRenderer_fx.c | 5 +- lib_rend/ivas_output_init_fx.c | 3 +- lib_rend/ivas_reflections_fx.c | 3 +- lib_rend/ivas_reverb_utils_fx.c | 2 +- lib_rend/ivas_shoebox_fx.c | 1 - lib_rend/lib_rend_fx.c | 3 +- 151 files changed, 11729 insertions(+), 12367 deletions(-) delete mode 100644 lib_com/ivas_rom_com.c delete mode 100644 lib_com/ivas_rom_com_fx.h rename lib_com/{ivas_rotation_com.c => ivas_rotation_com_fx.c} (99%) delete mode 100644 lib_com/options_warnings.h delete mode 100644 lib_com/rom_com_fx.c delete mode 100644 lib_com/rom_com_fx.h delete mode 100644 lib_com/tools.c diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index 6c57d3170..e25fc22cd 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -215,9 +215,8 @@ - - + @@ -264,7 +263,6 @@ - @@ -281,7 +279,6 @@ - @@ -313,7 +310,6 @@ - @@ -326,12 +322,9 @@ - - - diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index 3fbbb7bc5..2f73f59a6 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -73,15 +73,9 @@ common_ivas_c - - common_ivas_c - common_ivas_c - - common_ivas_c - common_ivas_c @@ -184,9 +178,6 @@ common_all_c - - common_all_c - common_all_c @@ -442,9 +433,6 @@ common_all_c - - common_all_c - common_all_c @@ -487,9 +475,6 @@ common_all_c - - common_all_c - common_all_c @@ -517,6 +502,9 @@ common_all_c + + common_ivas_c + @@ -531,9 +519,6 @@ common_h - - common_h - common_h @@ -588,15 +573,9 @@ common_h - - common_h - common_h - - common_h - common_h @@ -629,7 +608,6 @@ - diff --git a/lib_com/cldfb_fx.c b/lib_com/cldfb_fx.c index 00cb884d4..3a5908277 100644 --- a/lib_com/cldfb_fx.c +++ b/lib_com/cldfb_fx.c @@ -41,7 +41,6 @@ #include "stat_dec.h" #include "prot_fx.h" #include "rom_com.h" -#include "rom_com_fx.h" #include "wmc_auto.h" #if __STDC_VERSION__ >= 199901L #if defined __ICL diff --git a/lib_com/cng_exc_fx.c b/lib_com/cng_exc_fx.c index 6296b406c..56701bf61 100644 --- a/lib_com/cng_exc_fx.c +++ b/lib_com/cng_exc_fx.c @@ -1,20 +1,26 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "rom_com.h" -#include "ivas_rom_com_fx.h" +#include "ivas_rom_com.h" + /*---------------------------------------------------------------------* * Local constants *---------------------------------------------------------------------*/ + #define A2 6554 #define OmA2 ( 32768 - A2 ) #define GAIN_VAR 11811 /* in Q31 divided by 2 (Q30) */ + const Word16 att_pow_tbl[SIZE_SCALE_TABLE_STEREO + 1] = { 9234, 10361, 13044, 16422, 22669, 31292, 32767, 26634, 28212, 20674, 16422, 27254, 30934, 32767 }; + + /*-------------------------------------------------------* * CNG_exc() * @@ -22,22 +28,22 @@ const Word16 att_pow_tbl[SIZE_SCALE_TABLE_STEREO + 1] = { 9234, 10361, 13044, 16 *-------------------------------------------------------*/ void CNG_exc_fx( - const Word32 core_brate, /* i : core bitrate */ + const Word32 core_brate, /* i : core bitrate */ const Word16 L_frame, /* i : length of the frame */ Word32 *Enew, /* i/o: decoded SID energy Q6 */ Word16 *seed, /* i/o: random generator seed */ Word16 exc[], /* o : current non-enhanced excitation Q_new */ Word16 exc2[], /* o : current enhanced excitation Q_new */ - Word32 *lp_ener, /* i/o: LP filtered E Q6 */ + Word32 *lp_ener, /* i/o: LP filtered E Q6 */ const Word32 last_core_brate, /* i : previous frame core bitrate */ Word16 *first_CNG, /* i/o: first CNG frame flag for energy init. */ Word16 *cng_ener_seed, /* i/o: random generator seed for CNG energy */ - Word16 bwe_exc[], /* o : excitation for SWB TBE Q_syn */ + Word16 bwe_exc[], /* o : excitation for SWB TBE Q_syn */ const Word16 allow_cn_step, /* i : allow CN step */ - Word16 *last_allow_cn_step, /* i/o: last allow step */ - const Word16 OldQ_exc, /* i : Old excitation scaling */ - const Word16 Q_exc, /* i : excitation scaling */ - const Word16 num_ho, /* i : number of selected hangover frames */ + Word16 *last_allow_cn_step, /* i/o: last allow step */ + const Word16 OldQ_exc, /* i : Old excitation scaling */ + const Word16 Q_exc, /* i : excitation scaling */ + const Word16 num_ho, /* i : number of selected hangover frames */ Word32 q_env[], /*Q6*/ Word32 *lp_env, /*Q6*/ Word32 *old_env, /*Q6*/ diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index b1323e156..aa52bf306 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -46,7 +46,6 @@ #include "cnst.h" #include "prot_fx.h" #include "rom_com.h" -#include "rom_com_fx.h" #include "wmc_auto.h" #include "complex_basop.h" @@ -7174,7 +7173,6 @@ void rfft_fx( #define WMC_TOOL_SKIP -#define SHC( x ) ( (Word16) x ) #define FFTC( x ) WORD322WORD16( (Word32) x ) #define C81_FX ( FFTC( 0x5a82799a ) ) /* FL2WORD32( 7.071067811865475e-1) */ diff --git a/lib_com/fft_rel_fx.c b/lib_com/fft_rel_fx.c index a0905cc16..fe5d2bb8d 100644 --- a/lib_com/fft_rel_fx.c +++ b/lib_com/fft_rel_fx.c @@ -142,17 +142,17 @@ static void c_fft_fx( * is counted as a move16() */ - input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); // Qx + input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); // Qx L_tmp1 = L_mult( *input_ptr1++, 16384 ); L_tmp2 = L_mult( *input_ptr1, 16384 ); - input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); tmp1 = msu_r_sat( L_tmp1, *input_ptr1, 16384 ); tmp3 = mac_r_sat( L_tmp1, *input_ptr1++, 16384 ); - input_ptr2 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr3 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr2 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr3 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); L_tmp1 = L_mult( *input_ptr2++, 16384 ); tmp2 = mac_r_sat( L_tmp1, *input_ptr3, 16384 ); @@ -240,11 +240,11 @@ static void c_fft_fx( * The addition of 'in_ptr' + and index value from 'reorder_ptr' * is counted as a move16() */ - input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr2 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr2 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr3 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr4 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr3 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr4 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); tmp3 = sub( *input_ptr1, *input_ptr2 ); @@ -468,231 +468,6 @@ void r_fft_fx_lc( * ..., re[n/2], im[n/2-1], ..., im[1]. *---------------------------------------------------------------------*/ -void fft_rel( - float x[], /* i/o: input/output vector */ - const int16_t n, /* i : vector length */ - const int16_t m /* i : log2 of vector length */ -) -{ - int16_t i, j, k, n1, n2, n4; - int16_t step; - float xt, t1, t2; - float *x0, *x1, *x2; - float *xi2, *xi3, *xi4, *xi1; - const float *s, *c; - const int16_t *idx; - - /* !!!! NMAX = 256 is hardcoded here (similar optimizations should be done for NMAX > 256) !!! */ - - float *x2even, *x2odd; - float temp[512]; - - if ( n == 128 || n == 256 || n == 512 ) - { - idx = fft256_read_indexes; - - /* Combined Digit reverse counter & Length two butterflies */ - if ( n == 128 ) - { - x2 = temp; - for ( i = 0; i < 64; i++ ) - { - j = *idx++; - k = *idx++; - - *x2++ = x[j >> 1] + x[k >> 1]; - *x2++ = x[j >> 1] - x[k >> 1]; - } - } - else if ( n == 256 ) - { - x2 = temp; - for ( i = 0; i < 128; i++ ) - { - j = *idx++; - k = *idx++; - - *x2++ = x[j] + x[k]; - *x2++ = x[j] - x[k]; - } - } - else if ( n == 512 ) - { - x2even = temp; - x2odd = temp + 256; - - for ( i = 0; i < 128; i++ ) - { - j = 2 * *idx++; - k = 2 * *idx++; - - *x2even++ = x[j] + x[k]; - *x2even++ = x[j] - x[k]; - *x2odd++ = x[++j] + x[++k]; - *x2odd++ = x[j] - x[k]; - } - } - - /*-----------------------------------------------------------------* - * 1st Stage Loop has been Unrolled because n4 is '1' and that - * allows the elimination of the 'for_ (j = 1; j < n4; j++)' loop - * and the associated pointers initialization. - * Also, it allows to Put the Data from 'temp' back into 'x' due - * to the previous Combined Digit Reverse and Length two butterflies - *-----------------------------------------------------------------*/ - - /*for_ (k = 2; k < 3; k++)*/ - { - x0 = temp; - x1 = x0 + 2; - x2 = x; - - for ( i = 0; i < n; i += 4 ) - { - *x2++ = *x0++ + *x1; /* x[i] = xt + x[i+n2]; */ - *x2++ = *x0; - *x2++ = *--x0 - *x1++; /* x[i+n2] = xt - x[i+n2]; */ - *x2++ = -*x1; /* x[i+n2+n4] = -x[i+n2+n4]; */ - - x0 += 4; - x1 += 3; /* x1 has already advanced */ - } - } - } - else - { - /*-----------------------------------------------------------------* - * Digit reverse counter - *-----------------------------------------------------------------*/ - - j = 0; - x0 = &x[0]; - for ( i = 0; i < n - 1; i++ ) - { - if ( i < j ) - { - xt = x[j]; - x[j] = *x0; - *x0 = xt; - } - x0++; - k = n / 2; - while ( k <= j ) - { - j -= k; - k = k >> 1; - } - j += k; - } - - /*-----------------------------------------------------------------* - * Length two butterflies - *-----------------------------------------------------------------*/ - - x0 = &x[0]; - x1 = &x[1]; - for ( i = 0; i < n / 2; i++ ) - { - *x1 = *x0 - *x1; - *x0 = *x0 * 2 - *x1; - - x0++; - x0++; - x1++; - x1++; - } - - /*-----------------------------------------------------------------* - * 1st Stage Loop has been Unrolled because n4 is '1' and that - * allows the elimination of the 'for_ (j = 1; j < n4; j++)' loop - * and the associated pointers initialization. - *-----------------------------------------------------------------*/ - - /* for_ (k = 2; k < 3; k++) */ - { - x0 = x; - x1 = x0 + 2; - - for ( i = 0; i < n; i += 4 ) - { - *x1 = *x0 - *x1; /* x[i+n2] = xt - x[i+n2]; */ - *x0 = *x0 * 2 - *x1++; /* x[i] = xt + x[i+n2]; */ - *x1 = -*x1; /* x[i+n2+n4] = -x[i+n2+n4]; */ - - x0 += 4; - x1 += 3; /* x1 has already advanced */ - } - } - } - - /*-----------------------------------------------------------------* - * Other butterflies - * - * The implementation described in [1] has been changed by using - * table lookup for evaluating sine and cosine functions. The - * variable ind and its increment step are needed to access table - * entries. Note that this implementation assumes n4 to be so - * small that ind will never exceed the table. Thus the input - * argument n and the constant N_MAX_FFT must be set properly. - *-----------------------------------------------------------------*/ - - n4 = 1; - n2 = 2; - n1 = 4; - - step = N_MAX_DIV4; - - for ( k = 3; k <= m; k++ ) - { - step >>= 1; - n4 <<= 1; - n2 <<= 1; - n1 <<= 1; - - x0 = x; - x1 = x0 + n2; - x2 = x1 + n4; - - for ( i = 0; i < n; i += n1 ) - { - *x1 = *x0 - *x1; /* x[i+n2] = xt - x[i+n2]; */ - *x0 = *x0 * 2 - *x1; /* x[i] = xt + x[i+n2]; */ - *x2 = -*x2; /* x[i+n2+n4] = -x[i+n2+n4]; */ - - s = sincos_t_ext; - c = s + N_MAX_FFT / 4; /* 1024/4 = 256, 256/4=64 */ - xi1 = x0; - xi3 = xi1 + n2; - xi2 = xi3; - x0 += n1; - xi4 = x0; - - for ( j = 1; j < n4; j++ ) - { - xi3++; - xi1++; - xi4--; - xi2--; - c += step; - s += step; /* autoincrement by ar0 */ - - t1 = *xi3 * *c + *xi4 * *s; /* t1 = *xi3**(pt_c+ind) + *xi4**(pt_s+ind); */ - t2 = *xi3 * *s - *xi4 * *c; /* t2 = *xi3**(pt_s+ind) - *xi4**(pt_c+ind); */ - - *xi4 = *xi2 - t2; - *xi2 = *xi1 - t1; - *xi1 = *xi1 * 2 - *xi2; - *xi3 = -2 * t2 - *xi4; - } - - x1 += n1; - x2 += n1; - } - } - - return; -} - void fft_rel_16_32fx( Word16 x[], /* i/o: input/output vector Qx */ Word16 *q_x, /* extra scaling added on speech buffer*/ diff --git a/lib_com/ivas_dirac_com_fx.c b/lib_com/ivas_dirac_com_fx.c index 26d58936f..20b04e974 100644 --- a/lib_com/ivas_dirac_com_fx.c +++ b/lib_com/ivas_dirac_com_fx.c @@ -40,15 +40,15 @@ #include "cnst.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ - static UWord16 deindex_sph_idx_general_fx( const Word16 idx_sph, const Word16 no_bits, Word32 *theta_dec_fx, Word32 *phi_dec_fx, UWord16 *p_id_phi, const MC_LS_SETUP mc_format ); + /*------------------------------------------------------------------------- * ivas_get_hodirac_flag() * diff --git a/lib_com/ivas_fb_mixer_fx.c b/lib_com/ivas_fb_mixer_fx.c index b55e069d7..3478daefa 100644 --- a/lib_com/ivas_fb_mixer_fx.c +++ b/lib_com/ivas_fb_mixer_fx.c @@ -39,7 +39,6 @@ #include "ivas_rom_com.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_lfe_com_fx.c b/lib_com/ivas_lfe_com_fx.c index ba64b517f..fa7cb4b26 100644 --- a/lib_com/ivas_lfe_com_fx.c +++ b/lib_com/ivas_lfe_com_fx.c @@ -41,7 +41,6 @@ #include #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-----------------------------------------------------------------------------------------* @@ -49,11 +48,12 @@ * * Selects LFE filter coeff based on config. *-----------------------------------------------------------------------------------------*/ + void ivas_lfe_lpf_select_filt_coeff_fx( - const Word32 sampling_rate, /* i : sampling rate */ - const Word16 order, /* i : filter order */ - const Word32 **ppFilt_coeff_fx, /* o : filter coefficients */ - const Word16 **ppFilt_coeff_e /* o : exponents of filter coefficients */ + const Word32 sampling_rate, /* i : sampling rate */ + const Word16 order, /* i : filter order */ + const Word32 **ppFilt_coeff_fx, /* o : filter coefficients */ + const Word16 **ppFilt_coeff_e /* o : exponents of filter coefficients */ ) { SWITCH( order ) diff --git a/lib_com/ivas_limiter_fx.c b/lib_com/ivas_limiter_fx.c index 60982f3f2..4250d7a7a 100644 --- a/lib_com/ivas_limiter_fx.c +++ b/lib_com/ivas_limiter_fx.c @@ -36,7 +36,7 @@ #include "prot_fx.h" #include "ivas_prot_rend_fx.h" #include "ivas_rom_rend.h" -#include "ivas_rom_com_fx.h" +#include "ivas_rom_com.h" #include "wmc_auto.h" #include #include "ivas_prot_fx.h" diff --git a/lib_com/ivas_masa_com_fx.c b/lib_com/ivas_masa_com_fx.c index f4c8fab10..9c706bc74 100644 --- a/lib_com/ivas_masa_com_fx.c +++ b/lib_com/ivas_masa_com_fx.c @@ -39,7 +39,6 @@ #include "ivas_rom_com.h" #include "ivas_stat_dec.h" #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" diff --git a/lib_com/ivas_mc_param_com_fx.c b/lib_com/ivas_mc_param_com_fx.c index 4469e7f93..e3827c568 100644 --- a/lib_com/ivas_mc_param_com_fx.c +++ b/lib_com/ivas_mc_param_com_fx.c @@ -39,7 +39,6 @@ #include "ivas_stat_com.h" #include "ivas_rom_com.h" #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" @@ -47,9 +46,9 @@ * Local function prototypes *------------------------------------------------------------------------*/ - static void ivas_param_mc_set_coding_scheme_fx( const MC_LS_SETUP mc_ls_setup, const Word32 ivas_total_brate, HANDLE_IVAS_PARAM_MC_METADATA hMetadataPMC ); + /*------------------------------------------------------------------------- * ivas_param_mc_get_configuration_index() * diff --git a/lib_com/ivas_mdct_imdct_fx.c b/lib_com/ivas_mdct_imdct_fx.c index 542f5ca74..960b823ae 100644 --- a/lib_com/ivas_mdct_imdct_fx.c +++ b/lib_com/ivas_mdct_imdct_fx.c @@ -34,7 +34,7 @@ #include "options.h" #include "prot_fx.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" +#include "ivas_rom_com.h" #ifdef DEBUGGING #include "debug.h" #endif diff --git a/lib_com/ivas_mdft_imdft_fx.c b/lib_com/ivas_mdft_imdft_fx.c index 5d7bee1a6..1d07ab133 100644 --- a/lib_com/ivas_mdft_imdft_fx.c +++ b/lib_com/ivas_mdft_imdft_fx.c @@ -40,7 +40,6 @@ #include #include #include "debug.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" /*-----------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_qmetadata_com_fx.c b/lib_com/ivas_qmetadata_com_fx.c index a5fbf9e83..906277f54 100644 --- a/lib_com/ivas_qmetadata_com_fx.c +++ b/lib_com/ivas_qmetadata_com_fx.c @@ -40,9 +40,7 @@ #include "cnst.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" -// #include "debug.h" /*-----------------------------------------------------------------------* * Local constants diff --git a/lib_com/ivas_qspherical_com_fx.c b/lib_com/ivas_qspherical_com_fx.c index 844c3ecde..7d7c159b3 100644 --- a/lib_com/ivas_qspherical_com_fx.c +++ b/lib_com/ivas_qspherical_com_fx.c @@ -40,7 +40,6 @@ #include "cnst.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------- diff --git a/lib_com/ivas_rom_com.c b/lib_com/ivas_rom_com.c deleted file mode 100644 index 4441f3342..000000000 --- a/lib_com/ivas_rom_com.c +++ /dev/null @@ -1,2916 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#include -#include "options.h" -#include -#include "cnst.h" -#include "ivas_cnst.h" -#include "ivas_rom_com.h" -#include "wmc_auto.h" - -/* clang-format off */ - -/*----------------------------------------------------------------------------------* - * Table of IVAS bitrates - *----------------------------------------------------------------------------------*/ - -const Word32 ivas_brate_tbl[SIZE_IVAS_BRATE_TBL] = -{ - FRAME_NO_DATA, IVAS_SID_5k2, - IVAS_13k2, IVAS_16k4, IVAS_24k4, IVAS_32k, IVAS_48k, - IVAS_64k, IVAS_80k, IVAS_96k, IVAS_128k, IVAS_160k, - IVAS_192k, IVAS_256k, IVAS_384k, IVAS_512k -}; - -/*------------------------------------------------------------------------- - * DFT Stereo ROM tables - *------------------------------------------------------------------------*/ - -/*4xERB scale: max of 14 bands*/ -const Word16 dft_band_limits_erb4[STEREO_DFT_ERB4_BANDS] = -{ - 1, 3, 5, 10, 18, 26, 41, 56, 84, 132, 214, 342, 470, 601 -}; - -/*8xERB scale: max of 8 bands*/ -const Word16 dft_band_limits_erb8[STEREO_DFT_ERB8_BANDS] = -{ - 1, 5, 18, 41, 84, 214, 470, 601 -}; - - -const Word16 dft_band_ipd[3][4] = -{ - {0,8,10,13}, - {0,5,6,8}, - {0,2,3,4} -}; - -const Word16 dft_band_res_cod[3][4] = -{ - {0,8,10,11}, - {0,5,6,7}, - {0,5,6,7} -}; - -// Q31 -const Word32 dft_res_gains_q_Q31[][2] = -{ - /* quantization points for joint quantization of prediction gain and residual energy */ - - /* column 1 (|ILD| = 0): */ - {0, 0 }, - {0, 251216928 }, - {0, 487459456 }, - {0, 731632640 }, - {0, 997611392 }, - {0, 1299397248 }, - {0, 1666984192 }, - {0, 2147483647 }, - - /* column 2 (|ILD| = 2): */ - {246151024, 0 }, - {249475328, 247871152 }, - {258660112, 480729248 }, - {274304544, 720918848 }, - {298427200, 981720000 }, - {334663840, 1276185088 }, - {391374592, 1632160640 }, - {485919712, 2091786496 }, - - /* column 3 (|ILD| = 4): */ - {485919712, 0 }, - {492224736, 238188144 }, - {509610752, 461283776 }, - {539117184, 690072384 }, - {584326016, 936189056 }, - {651608832, 1210182144 }, - {755411712, 1534299776 }, - {924504576, 1938292992 }, - - /* column 4 (|ILD| = 6): */ - {713563712, 0 }, - {722237376, 223142880 }, - {746085184, 431184640 }, - {786311872, 642617280 }, - {847364864, 866812416 }, - {936938496, 1111020032 }, - {1072199936, 1390431232 }, - {1285225984, 1720430720 }, - - /* column 5 (|ILD| = 8): */ - {924504576, 0 }, - {934784576, 204139792 }, - {962942400, 393358880 }, - {1010083968, 583482048 }, - {1080789888, 781462848 }, - {1182728704, 991308544 }, - {1332741248, 1221608960 }, - {1559902080, 1475937536 }, - - /* column 6 (|ILD| = 10): */ - {1115604864, 0 }, - {1126709504, 182744416 }, - {1156997632, 351025536 }, - {1207276672, 517958016 }, - {1281710592, 688294272 }, - {1387005952, 863412992 }, - {1537761536, 1046870336 }, - {1757032448, 1234717184 }, - - /* column 7 (|ILD| = 13): */ - {1361843968, 0 }, - {1372924928, 149366080 }, - {1402942464, 285507936 }, - {1452130560, 417893888 }, - {1523515136, 548787328 }, - {1621670144, 677135936 }, - {1756740352, 802203264 }, - {1942499840, 915633344 }, - - /* column 8 (|ILD| = 16): */ - {1559902080, 0 }, - {1569913600, 117815248 }, - {1596862336, 224162928 }, - {1640492800, 325650848 }, - {1702660352, 423060736 }, - {1785997696, 514412544 }, - {1896788608, 597466432 }, - {2042241920, 664027712 }, - - /* column 9 (|ILD| = 19): */ - {1714196608, 0 }, - {1722634112, 90359672 }, - {1745223424, 171238192 }, - {1781415040, 247171072 }, - {1832190080, 318199104 }, - {1898830848, 382271424 }, - {1984989952, 437025792 }, - {2094086528, 475912448 }, - - /* column 10 (|ILD| = 22): */ - {1831427712, 0 }, - {1838194432, 67828272 }, - {1856228992, 128123168 }, - {1884882944, 183977072 }, - {1924581248, 235132272 }, - {1975822336, 279821408 }, - {2040659200, 316058048 }, - {2120554240, 339023232 }, - - /* column 11 (|ILD| = 25): */ - {1918819584, 0 }, - {1924055168, 50102940 }, - {1937964416, 94399088 }, - {1959916032, 135003712 }, - {1990038784, 171579648 }, - {2028424960, 202728896 }, - {2076217216, 226931040 }, - {2133943808, 240762976 }, - - /* column 12 (|ILD| = 30): */ - {2015827840, 0 }, - {2019068416, 29502130 }, - {2027636864, 55420112 }, - {2041056512, 78889960 }, - {2059271424, 99626064 }, - {2082150784, 116769424 }, - {2110128128, 129415952 }, - {2143192960, 135682304 }, - - /* column 13 (|ILD| = 35): */ - {2072441984, 0 }, - {2074364032, 17033840 }, - {2079438464, 31939524 }, - {2087347712, 45337676 }, - {2098012032, 57039312 }, - {2111296384, 66537632 }, - {2127368192, 73321536 }, - {2146126464, 76351632 }, - - /* column 14 (|ILD| = 40): */ - {2104959232, 0 }, - {2106073728, 9723806 }, - {2109011456, 18212808 }, - {2113579136, 25810606 }, - {2119712384, 32401234 }, - {2127314432, 37692632 }, - {2136458496, 41399188 }, - {2147054208, 42945376 }, - - /* column 15 (|ILD| = 45): */ - {2123466240, 0 }, - {2124103936, 5514738 }, - {2125783296, 10322954 }, - {2128390400, 14615774 }, - {2131882240, 18322330 }, - {2136200832, 21283710 }, - {2141376256, 23332410 }, - {2147348352, 24150602 }, - - /* column 16 (|ILD| = 50): */ - {2133943808, 0 }, - {2134306688, 3115998 }, - {2135260160, 5830418 }, - {2136737664, 8250632 }, - {2138715520, 10335839 }, - {2141157120, 11995844 }, - {2144077696, 13136157 }, - {2147440640, 13580687 } -}; - - -/* tables for adaptive Golomb-Rice coding of DFT stereo parameters */ -const Word16 dft_code_itd[] = -{ - 0, 3, 4, 13, 8, 9, 12, 5, 10, 44, 23, 60, 45, 31, 235, 59, 28, 61, 234, 116 -}; - -const Word16 dft_len_itd[] = -{ - 2, 3, 4, 4, 4, 4, 4, 4, 4, 6, 5, 6, 6, 5, 8, 6, 5, 6, 8, 7 -}; - -const Word16 dft_maps_rpg[] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, - 2, 0, 1, 3, 4, 5, 6, 7, - 6, 2, 0, 1, 3, 4, 5, 7, - 7, 5, 2, 0, 1, 3, 4, 6, - 7, 6, 4, 3, 1, 0, 2, 5, - 7, 6, 5, 3, 2, 1, 0, 4, - 7, 6, 5, 4, 3, 2, 0, 1, - 7, 6, 5, 4, 3, 2, 0, 1, - 6, 5, 4, 3, 1, 0, 2, 7, -}; - -const Word16 dft_maps_sg[NO_SYMB_GR_SIDE_G * NO_SYMB_GR_SIDE_G] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 15, 4, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 12, 9, 4, 1, 0, 2, 3, 5, 6, 7, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 16, 14, 8, 4, 2, 0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 18, 16, 14, 10, 5, 0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 21, 19, 17, 15, 8, 4, 2, 0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 21, 19, 17, 15, 12, 8, 4, 0, 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 21, 19, 17, 15, 13, 11, 9, 3, 0, 1, 2, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 24, 22, 20, 18, 16, 14, 12, 9, 6, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 15, 17, 19, 21, 23, 25, 26, 27, 28, 29, 30, - 25, 23, 21, 19, 17, 15, 13, 11, 9, 6, 0, 1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 27, 28, 29, 30, - 27, 25, 23, 21, 19, 17, 15, 13, 11, 8, 5, 0, 1, 2, 3, 4, 6, 7, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 30, - 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 1, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 28, 29, 30, - 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 30, - 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, - 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 1, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, - 30, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, - 30, 29, 28, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, - 30, 29, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 9, 7, 6, 4, 3, 2, 1, 0, 5, 8, 11, 13, 15, 17, 19, 21, 23, 25, 27, - 30, 29, 28, 27, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 7, 5, 4, 3, 2, 1, 0, 6, 9, 11, 13, 15, 17, 19, 21, 23, 25, - 30, 29, 28, 27, 26, 25, 23, 21, 19, 17, 15, 13, 11, 10, 8, 7, 5, 4, 3, 2, 1, 0, 6, 9, 12, 14, 16, 18, 20, 22, 24, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 12, 10, 8, 7, 6, 5, 4, 2, 1, 0, 3, 9, 11, 13, 15, 17, 19, 21, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 13, 11, 10, 9, 7, 6, 5, 3, 2, 1, 0, 4, 8, 12, 15, 17, 19, 21, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 13, 12, 11, 10, 9, 7, 6, 5, 3, 1, 0, 2, 4, 8, 15, 17, 19, 21, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 17, 15, 13, 12, 11, 9, 8, 7, 6, 4, 3, 2, 1, 0, 5, 10, 14, 16, 18, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 15, 13, 12, 11, 10, 9, 7, 6, 5, 3, 1, 0, 2, 4, 8, 14, 16, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 10, 8, 7, 6, 5, 3, 2, 0, 1, 4, 9, 12, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 3, 2, 1, 0, 4, 15, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 0, 1, - 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 -}; - - -/*------------------------------------------------------------------------- - * Range Coder ROM tables - *------------------------------------------------------------------------*/ - -/* Create separate tables for cumulative frequency and symbol frequency */ -const UWord16 cum_freq_ari_pk_s17_LC_ext[RANGE_N_CONTEXT][1 + RANGE_N_SYMBOLS] = -{ - { 0,16,47,153,241,269,325,468,591,674,798,912,1017,1082,1183,1277,1364,16384 }, - { 0,7401,7844,7886,7899,12065,12718,12790,12805,14099,14476,14533,14549,15058,15264,15299,15310,16384 }, - { 0,4362,6345,6864,7038,9037,11049,11736,12002,12569,13301,13656,13822,14021,14334,14515,14607,16384 }, - { 0,2955,5183,5822,6013,8153,10671,11614,11943,12586,13540,14025,14232,14437,14770,14978,15080,16384 }, - { 0,3155,4981,5615,5855,7969,9953,10739,11073,11936,12837,13208,13383,13767,14203,14400,14498,16384 }, - { 0,1216,2630,3264,3558,4831,6679,7661,8157,8709,9622,10204,10542,10799,11243,11568,11777,16384 }, - { 0,1759,3641,4350,4612,6325,8678,9732,10161,10790,11790,12361,12642,12883,13295,13566,13720,16384 }, - { 0,1109,2705,3433,3732,5226,7532,8732,9263,9978,11142,11842,12188,12490,12986,13321,13520,16384 }, - { 0,11524,13046,13170,13191,14956,15708,15813,15837,16028,16162,16195,16204,16245,16282,16295,16300,16384 }, - { 0,8027,10586,10909,10974,13291,14861,15157,15232,15535,15824,15914,15943,16014,16090,16123,16136,16384 }, - { 0,834,2034,2674,2997,4087,5843,6891,7455,8030,9013,9688,10085,10376,10893,11277,11528,16384 }, - { 0,6038,9086,9451,9519,12332,14521,14913,15003,15329,15711,15848,15893,15955,16045,16091,16111,16384 }, - { 0,4732,7685,8354,8545,10717,12924,13618,13852,14291,14842,15083,15181,15314,15491,15582,15625,16384 }, - { 0,745,1783,2347,2655,3537,4963,5864,6406,6863,7664,8248,8634,8891,9351,9708,9958,16384 }, - { 0,3957,6794,7669,7998,9743,11676,12498,12869,13313,13894,14186,14332,14498,14714,14835,14906,16384 }, - { 0,2779,5388,6021,6201,8582,11352,12260,12544,13117,13981,14408,14580,14751,15039,15213,15298,16384 }, - { 0,448,1160,1625,1920,2576,3706,4518,5053,5474,6234,6835,7262,7531,8032,8446,8758,16384 }, - { 0,1,2,1555,2246,2247,2248,3489,4112,5449,6596,7302,7710,8311,8876,9266,9517,16384 }, - { 0,2496,4910,5544,5722,8049,10799,11689,11973,12583,13467,13878,14047,14234,14537,14712,14803,16384 }, - { 0,921,2222,2880,3188,4407,6321,7406,7955,8573,9616,10296,10679,10978,11502,11880,12118,16384 }, - { 0,2620,4443,5017,5233,7072,9213,10083,10441,11049,11954,12442,12676,12918,13310,13565,13705,16384 }, - { 0,11205,13084,13178,13187,15164,16010,16081,16091,16213,16303,16321,16325,16340,16355,16360,16362,16384 }, - { 0,358,916,1288,1542,2055,2937,3594,4062,4399,5017,5524,5907,6136,6573,6941,7236,16384 }, - { 0,3575,5093,5536,5735,7408,9185,9878,10188,10727,11497,11933,12165,12410,12794,13019,13166,16384 }, - { 0,1,2,640,1036,1037,1038,1670,2096,2696,3287,3732,4056,4417,4800,5106,5339,16384 }, - { 0,969,1397,1518,1578,2633,3338,3566,3675,4197,4664,4857,4957,5288,5625,5783,5874,16384 }, - { 0,10458,12104,12294,12331,14246,15264,15437,15481,15752,15971,16031,16050,16120,16186,16210,16218,16384 }, - { 0,7178,9744,10039,10093,12701,14612,14961,15042,15360,15732,15869,15917,15978,16070,16117,16139,16384 }, - { 0,1298,2418,2879,3113,4146,5509,6227,6621,7053,7755,8229,8539,8776,9186,9492,9714,16384 }, - { 0,4957,7785,8252,8357,10978,13372,13955,14114,14561,15140,15378,15464,15570,15730,15820,15860,16384 }, - { 0,4823,8164,8570,8647,11604,14169,14653,14763,15105,15554,15727,15785,15852,15960,16018,16045,16384 }, - { 0,4735,7010,7517,7660,9986,12230,12914,13131,13666,14374,14689,14814,14972,15212,15342,15404,16384 }, - { 0,3363,5881,6658,6941,8864,11113,12015,12368,12889,13643,14019,14203,14394,14665,14823,14906,16384 }, - { 0,2569,4996,5779,6068,7917,10251,11209,11602,12129,12918,13321,13520,13696,13976,14155,14259,16384 }, - { 0,209,577,848,1046,1378,1982,2465,2835,3072,3513,3893,4202,4374,4703,4994,5241,16384 }, - { 0,2074,4337,5048,5274,7319,10003,11066,11446,12105,13112,13652,13885,14100,14464,14691,14810,16384 }, - { 0,1619,3560,4288,4550,6381,8955,10102,10543,11239,12362,12982,13261,13516,13958,14234,14381,16384 }, - { 0,89,257,441,582,734,1024,1325,1568,1716,1983,2222,2430,2545,2750,2941,3109,16384 }, - { 0,2202,3563,4044,4264,5686,7344,8100,8476,9006,9835,10331,10612,10864,11304,11599,11787,16384 }, - { 0,1220,2801,3492,3784,5223,7387,8496,8998,9640,10711,11369,11711,11993,12486,12829,13035,16384 }, - { 0,12626,13813,13903,13917,15396,15906,15972,15987,16139,16230,16251,16257,16289,16315,16323,16326,16384 }, - { 0,1579,3191,3831,4099,5678,7788,8761,9206,9842,10821,11388,11681,11958,12417,12722,12902,16384 }, - { 0,597,1514,2064,2379,3237,4679,5637,6213,6733,7649,8316,8755,9052,9599,10023,10323,16384 }, - { 0,9273,11762,12080,12151,14038,15210,15446,15514,15725,15929,15995,16019,16068,16124,16148,16158,16384 }, - { 0,9238,11681,11852,11872,14306,15644,15801,15828,16013,16183,16231,16243,16266,16297,16312,16318,16384 }, - { 0,6791,9200,9531,9594,12240,14178,14552,14639,15064,15506,15643,15687,15785,15908,15960,15983,16384 }, - { 0,7175,10415,10905,11033,13038,14621,15002,15123,15367,15651,15762,15806,15864,15938,15974,15992,16384 }, - { 0,5060,7703,8132,8225,10934,13270,13778,13911,14397,14972,15173,15242,15367,15537,15619,15654,16384 }, - { 0,3721,6311,6857,6992,9557,12180,12895,13098,13671,14418,14718,14830,14984,15212,15333,15390,16384 }, - { 0,5971,9288,10044,10269,11991,13680,14228,14437,14750,15130,15293,15374,15459,15579,15642,15677,16384 }, - { 0,3047,5311,5907,6078,8339,10850,11679,11946,12580,13442,13854,14024,14220,14534,14716,14810,16384 }, - { 0,2061,4280,4993,5228,7201,9735,10735,11097,11708,12606,13082,13295,13498,13836,14043,14161,16384 }, - { 0,4738,7949,8880,9234,10781,12502,13214,13531,13897,14355,14593,14718,14835,14998,15096,15153,16384 }, - { 0,3237,5045,5632,5860,7609,9702,10608,10986,11571,12476,12978,13230,13451,13830,14074,14208,16384 }, - { 0,1833,3889,4677,5028,6422,8379,9378,9884,10350,11086,11545,11809,12003,12327,12559,12711,16384 }, - { 0,3989,6858,7352,7459,10254,12936,13571,13735,14240,14895,15153,15242,15364,15548,15646,15690,16384 }, - { 0,1463,3197,3909,4220,5626,7609,8632,9127,9657,10520,11078,11380,11607,11991,12265,12442,16384 }, - { 0,14233,15083,15108,15110,16069,16300,16314,16316,16352,16370,16373,16374,16377,16380,16381,16382,16384 }, - { 0,1,2,2610,3293,3294,3295,5097,5671,8467,10332,11119,11437,12223,12850,13185,13345,16384 }, - { 0,2010,4053,4696,4910,6879,9391,10386,10750,11393,12376,12886,13119,13348,13726,13967,14099,16384 }, - { 0,7586,10517,10758,10791,13543,15346,15577,15619,15846,16082,16150,16169,16202,16245,16265,16273,16384 }, - { 0,3059,5772,6369,6524,9041,11801,12582,12813,13361,14115,14439,14567,14714,14944,15075,15141,16384 }, - { 0,8643,10594,10813,10856,13274,14686,14920,14975,15350,15680,15771,15799,15897,16003,16042,16057,16384 }, - { 0,6720,8878,9325,9467,11564,13248,13744,13929,14384,14880,15087,15167,15311,15488,15569,15607,16384 }, -}; - -const UWord16 sym_freq_ari_pk_s17_LC_ext[RANGE_N_CONTEXT][RANGE_N_SYMBOLS] = -{ - { 16,31,106,88,28,56,143,123,83,124,114,105,65,101,94,87,15020 }, - { 7401,443,42,13,4166,653,72,15,1294,377,57,16,509,206,35,11,1074 }, - { 4362,1983,519,174,1999,2012,687,266,567,732,355,166,199,313,181,92,1777 }, - { 2955,2228,639,191,2140,2518,943,329,643,954,485,207,205,333,208,102,1304 }, - { 3155,1826,634,240,2114,1984,786,334,863,901,371,175,384,436,197,98,1886 }, - { 1216,1414,634,294,1273,1848,982,496,552,913,582,338,257,444,325,209,4607 }, - { 1759,1882,709,262,1713,2353,1054,429,629,1000,571,281,241,412,271,154,2664 }, - { 1109,1596,728,299,1494,2306,1200,531,715,1164,700,346,302,496,335,199,2864 }, - { 11524,1522,124,21,1765,752,105,24,191,134,33,9,41,37,13,5,84 }, - { 8027,2559,323,65,2317,1570,296,75,303,289,90,29,71,76,33,13,248 }, - { 834,1200,640,323,1090,1756,1048,564,575,983,675,397,291,517,384,251,4856 }, - { 6038,3048,365,68,2813,2189,392,90,326,382,137,45,62,90,46,20,273 }, - { 4732,2953,669,191,2172,2207,694,234,439,551,241,98,133,177,91,43,759 }, - { 745,1038,564,308,882,1426,901,542,457,801,584,386,257,460,357,250,6426 }, - { 3957,2837,875,329,1745,1933,822,371,444,581,292,146,166,216,121,71,1478 }, - { 2779,2609,633,180,2381,2770,908,284,573,864,427,172,171,288,174,85,1086 }, - { 448,712,465,295,656,1130,812,535,421,760,601,427,269,501,414,312,7626 }, - { 1,1,1553,691,1,1,1241,623,1337,1147,706,408,601,565,390,251,6867 }, - { 2496,2414,634,178,2327,2750,890,284,610,884,411,169,187,303,175,91,1581 }, - { 921,1301,658,308,1219,1914,1085,549,618,1043,680,383,299,524,378,238,4266 }, - { 2620,1823,574,216,1839,2141,870,358,608,905,488,234,242,392,255,140,2679 }, - { 11205,1879,94,9,1977,846,71,10,122,90,18,4,15,15,5,2,22 }, - { 358,558,372,254,513,882,657,468,337,618,507,383,229,437,368,295,9148 }, - { 3575,1518,443,199,1673,1777,693,310,539,770,436,232,245,384,225,147,3218 }, - { 1,1,638,396,1,1,632,426,600,591,445,324,361,383,306,233,11045 }, - { 969,428,121,60,1055,705,228,109,522,467,193,100,331,337,158,91,10510 }, - { 10458,1646,190,37,1915,1018,173,44,271,219,60,19,70,66,24,8,166 }, - { 7178,2566,295,54,2608,1911,349,81,318,372,137,48,61,92,47,22,245 }, - { 1298,1120,461,234,1033,1363,718,394,432,702,474,310,237,410,306,222,6670 }, - { 4957,2828,467,105,2621,2394,583,159,447,579,238,86,106,160,90,40,524 }, - { 4823,3341,406,77,2957,2565,484,110,342,449,173,58,67,108,58,27,339 }, - { 4735,2275,507,143,2326,2244,684,217,535,708,315,125,158,240,130,62,980 }, - { 3363,2518,777,283,1923,2249,902,353,521,754,376,184,191,271,158,83,1478 }, - { 2569,2427,783,289,1849,2334,958,393,527,789,403,199,176,280,179,104,2125 }, - { 209,368,271,198,332,604,483,370,237,441,380,309,172,329,291,247,11143 }, - { 2074,2263,711,226,2045,2684,1063,380,659,1007,540,233,215,364,227,119,1574 }, - { 1619,1941,728,262,1831,2574,1147,441,696,1123,620,279,255,442,276,147,2003 }, - { 89,168,184,141,152,290,301,243,148,267,239,208,115,205,191,168,13275 }, - { 2202,1361,481,220,1422,1658,756,376,530,829,496,281,252,440,295,188,4597 }, - { 1220,1581,691,292,1439,2164,1109,502,642,1071,658,342,282,493,343,206,3349 }, - { 12626,1187,90,14,1479,510,66,15,152,91,21,6,32,26,8,3,58 }, - { 1579,1612,640,268,1579,2110,973,445,636,979,567,293,277,459,305,180,3482 }, - { 597,917,550,315,858,1442,958,576,520,916,667,439,297,547,424,300,6061 }, - { 9273,2489,318,71,1887,1172,236,68,211,204,66,24,49,56,24,10,226 }, - { 9238,2443,171,20,2434,1338,157,27,185,170,48,12,23,31,15,6,66 }, - { 6791,2409,331,63,2646,1938,374,87,425,442,137,44,98,123,52,23,401 }, - { 7175,3240,490,128,2005,1583,381,121,244,284,111,44,58,74,36,18,392 }, - { 5060,2643,429,93,2709,2336,508,133,486,575,201,69,125,170,82,35,730 }, - { 3721,2590,546,135,2565,2623,715,203,573,747,300,112,154,228,121,57,994 }, - { 5971,3317,756,225,1722,1689,548,209,313,380,163,81,85,120,63,35,707 }, - { 3047,2264,596,171,2261,2511,829,267,634,862,412,170,196,314,182,94,1574 }, - { 2061,2219,713,235,1973,2534,1000,362,611,898,476,213,203,338,207,118,2223 }, - { 4738,3211,931,354,1547,1721,712,317,366,458,238,125,117,163,98,57,1231 }, - { 3237,1808,587,228,1749,2093,906,378,585,905,502,252,221,379,244,134,2176 }, - { 1833,2056,788,351,1394,1957,999,506,466,736,459,264,194,324,232,152,3673 }, - { 3989,2869,494,107,2795,2682,635,164,505,655,258,89,122,184,98,44,694 }, - { 1463,1734,712,311,1406,1983,1023,495,530,863,558,302,227,384,274,177,3942 }, - { 14233,850,25,2,959,231,14,2,36,18,3,1,3,3,1,1,2 }, - { 1,1,2608,683,1,1,1802,574,2796,1865,787,318,786,627,335,160,3039 }, - { 2010,2043,643,214,1969,2512,995,364,643,983,510,233,229,378,241,132,2285 }, - { 7586,2931,241,33,2752,1803,231,42,227,236,68,19,33,43,20,8,111 }, - { 3059,2713,597,155,2517,2760,781,231,548,754,324,128,147,230,131,66,1243 }, - { 8643,1951,219,43,2418,1412,234,55,375,330,91,28,98,106,39,15,327 }, - { 6720,2158,447,142,2097,1684,496,185,455,496,207,80,144,177,81,38,777 }, -}; - - -/*------------------------------------------------------------------------- - * ECLVQ Stereo ROM tables - *------------------------------------------------------------------------*/ - -/* table with round(ECSQ_PROB_TOTAL / index) for entropy coding, with i in {1, .., ECSQ_SEGMENT_SIZE} */ -const UWord16 ECSQ_tab_inverse[1 + ECSQ_SEGMENT_SIZE] = -{ - 0, 16384, 8192, 5461, 4096, 3277, 2731, 2341, 2048 -}; - - -const Word16 tdm_bit_allc_tbl[5][6] = -{ - /* IC -- UC -- GC -- TM --AC */ - { 1650, 3500, 0, 4400, 0, 5000 }, /* IVAS_13k2 */ - { 1650, 3500, 0, 5000, 0, 5000 }, /* IVAS_16k4 */ - { 1650, 3500, 0, 6000, 0, 5000 }, /* IVAS_24k4 */ - { 1650, 6050, 0, 10000, 0, 10000 }, /* IVAS_32k */ - { 1650, 6050, 0, 13000, 0, 14000 } /* IVAS_48k */ -}; - - -const Word16 fast_FCB_bits_2sfr[] = {8, 14, 18, 20, 24, 128/*stop value*/}; - -const Word16 fast_FCB_rates_2sfr[] = {/*16*50,*/ (8+14)*50, 28*50, 32*50, 34*50, 36*50, 38*50, 40*50, 42*50, 44*50, 48*50}; - - -/*----------------------------------------------------------------------------------* - * MDCT Stereo ROM tables - *----------------------------------------------------------------------------------*/ - - /* PsychLPC */ - -const SpectrumWarping sw32000Hz[] = -{{ - { - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, - 6, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 14, 14, - 14, 16, 18, 18, 18, 20, 22, 22, 22, 24, 26, 26, 26, 28, 30, 32 - }, - { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, - 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10 - }, -}}; - -const SpectrumWarping sw25600Hz[] = -{{ - { - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, - 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 12, 12, 12, 12, - 12, 12, 14, 14, 14, 14, 14, 16, 16, 18, 18, 18, 18, 18, 20, 20 - }, - { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 - }, -}}; - -const SpectrumWarping sw16000Hz[] = -{{ - { - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 - }, - { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 - }, -}}; - -const MDCTStereoBands_config mdctStereoBands_32000_640[] = -{{ - /*TCX 20*/ - { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, - 12, 20, 20, 20, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 42, - 64, 64, 96, 160}, - {44, 41,38, 29},/*number of bands for frame lengths 960, 640, 512, 320 respectively*/ - - /*TCX 10*/ - { - 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 20, 32, 32, - 32, 48, 80 - }, - {33, 29, 26, 18}/*number of bands for frame lengths 480, 320, 256, 160 respectively*/ -}}; - - -const Word16 dft_cng_coh_u2i[9] = { 4, 5, 3, 6, 2, 7, 1, 8, 0 }; /* Coherence unary codeword -> residual codeword conversion table */ - -const Word16 dft_cng_coh_i2u[9] = { 8, 6, 4, 2, 0, 1, 3, 5, 7 }; /* Coherence residual codeword -> unary codeword conversion table */ - -const Word16 dft_cng_coh_alpha_start[STEREO_DFT_N_COH_ALPHA_STEPS - 1] = { 15, 16, 17, 18 }; - - -const Word16 DirAC_band_grouping_12[12 + 1] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 11, 17, 25, 40, 60 -}; - - -const Word16 DirAC_band_grouping_6[6 + 1] = -{ - 0, 1, 4, 8, 20, 30, 60 -}; - -const Word16 DirAC_band_grouping_5[5 + 1] = -{ - 0, 1, 3, 7, 15, 60 -}; - -const Word16 DirAC_block_grouping[MAX_PARAM_SPATIAL_SUBFRAMES + 1] = -{ - 0, 4, 8, 12, 16 -}; - -const Word16 DirAC_block_grouping_5ms_MDFT[MAX_PARAM_SPATIAL_SUBFRAMES + 1] = -{ - 0, 1, 2, 3, 4 -}; - -const Word32 c_weights_fx[DIRAC_NO_FB_BANDS_MAX] /* Q30 */ = { 106970960, 1033798336, 1065867776, 1071704704, 1073381888, 1073741824, 1073494016, 1072883072, 1072012032, 1070930560, 1069665600, 1068232640, 1066641792, 1064899968, 1063012224, 1060982464, 1058814144, 1056510016, 1054072832, 1051505280, 1048809664, 1045988480, 1043044160, 1039979072, 1036795776, 1033496576, 1030084096, 1026560960, 1022929600, 1019192512, 1015352576, 1011412416, 1007374720, 1003242112, 999017472, 994703488, 990302976, 985818688, 981253568, 976610304, 971891712, 967100672, 962240064, 957312576, 952321088, 947268224, 942156992, 936990080, 931770048, 926499840, 921182016, 915819200, 910414208, 904969344, 899487488, 893970944, 888422272, 882843840, 877238144, 871607552, 865954432, 860280896, 854589184, 848881728, 843160384, 837427328, 831684672, 825934208, 820178240, 814418240, 808656320, 802894208, 797133568, 791376192, 785623744, 779877568, 774139520, 768410880, 762693184, 756987904, 751296064, 745619328, 739958784, 734315584, 728691008, 723086208, 717502016, 711939712, 706400064, 700884096, 695392768, 689926912, 684487232, 679074688, 673689856, 668333504, 663006464, 657709056, 652442176, 647206144, 642001600, 636828992, 631688896, 626581696, 621507776, 616467520, 611461184, 606489344, 601552064, 596649792, 591782528, 586950784, 582154560, 577394112, 572669696, 567981312, 563329088, 558713152, 554133568, 549590464, 545083840, 540613760, 536180160, 531783104, 527422528, 523098464, 518810784, 514559520, 510344672, 506165856, 502023360, 497916832, 493846304, 489811488, 485812448, 481848832, 477920672, 474027808, 470169952, 466347008, 462558848, 458805152, 455085920, 451400736, 447749600, 444132160, 440548320, 436997792, 433480416, 429995904, 426544032, 423124608, 419737376, 416382144, 413058720, 409766720, 406505984, 403276288, 400077280, 396908768, 393770656, 390662496, 387584064, 384535200, 381515616, 378525024, 375563200, 372629952, 369724864, 366847872, 363998592, 361176672, 358382176, 355614592, 352873760, 350159456, 347471328, 344809216, 342172864, 339562048, 336976384, 334415808, 331879840, 329368576, 326881472, 324418432, 321979104, 319563392, 317170976, 314801664, 312455232, 310131328, 307829856, 305550528, 303293088, 301057440, 298843168, 296650176, 294478304, 292327168, 290196672, 288086432, 285996512, 283926432, 281876224, 279845472, 277834016, 275841792, 273868480, 271913856, 269977792, 268059968, 266160304, 264278672, 262414768, 260568368, 258739360, 256927520, 255132768, 253354752, 251593392, 249848448, 248119936, 246407424, 244710816, 243030080, 241364928, 239715120, 238080672, 236461248, 234856752, 233267088, 231692016, 230131440, 228585136, 227053024, 225534848, 224030544, 222539872, 221062832 }; - -/*----------------------------------------------------------------------* -* SPAR ROM tables -*-----------------------------------------------------------------------*/ - -const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] = -{ -/* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel - so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ - { 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 10000, 8150, 13150 } }, - { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, - - { 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 13200, 11350, 16350 } }, - { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, - - { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 16400, 14850, 24350 } }, - { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, - - { 32000, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 24000, 20450, 31950 } }, - { { 21, 1, 5, 1 },{ 15, 1, 5, 1 },{ 15, 1, 3, 1 } }, 0, 0, 0 }, - - { 48000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 24000, 21000, 31950 },{ 16000, 15000, 20400 } }, - { { 15, 7, 5, 1 },{ 15, 7, 3, 1 },{ 7, 7, 3, 1 } }, 1, 0, 0 }, - - { 64000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 38000, 34050, 56000 },{ 16000, 15600, 20400 } },{ { 21, 7, 5, 1 },{ 15, 7, 5, 1 },{ 15, 7, 3, 1 } }, 1, 1, 0 }, - - { 80000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 46000, 43000, 56000 },{ 24000, 23000, 31950 } }, - { { 21, 7, 5, 1 },{ 15, 7, 5, 1 },{ 15, 7, 3, 1 } }, 1, 0, 0 }, - - { 96000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 47000, 42600, 56000 },{ 23000, 22600, 31950 },{ 16000, 15600, 20400 } }, - { { 21, 9, 9, 1 },{ 21, 7, 5, 1 },{ 21, 7, 5, 1 } }, 1, 0, 0 }, - - { 128000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 55000, 50000, 56000 },{ 36000, 36000, 56000 },{ 27000, 27000, 31950 } }, - { { 21, 11, 9, 1 },{ 21, 9, 7, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, - - { 160000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 74000, 70900, 112000 },{ 41000, 40050, 56000 },{ 35000, 34050, 56000 } }, - { { 21, 11, 11, 1 },{ 21, 9, 9, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, - - { 192000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 90000, 87900, 112000 },{ 50000, 48050, 56000 },{ 42000, 41050, 56000 } }, - { { 21, 11, 11, 1 },{ 21, 9, 9, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, - - { 256000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 90000, 85000, 112000 },{ 70000, 69000, 112000 },{ 50000, 48950, 56000 },{ 36400, 35600, 56000 } }, - { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 256000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 84650, 83000, 112000 },{ 65850, 64550, 56000 },{ 47000, 46100, 48000 },{ 28200, 27650, 40000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 256000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 76300, 73550, 112000 },{ 59350, 57200, 56000 },{ 42400, 40850, 48000 },{ 25450, 24500, 40000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 }, { 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } }, - { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, - { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, - - { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, - { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, -}; - -const ivas_spar_br_table_t ivas_spar_br_table_consts_fx[IVAS_SPAR_BR_TABLE_LEN] = /*ceilf(log2f)*/ -{ - /* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel - so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ - { 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 10000, 8150, 13150 } }, - { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, - - { 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 13200, 11350, 16350 } }, - { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, - - { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 16400, 14850, 24350 } }, - { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, - - { 32000, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 24000, 20450, 31950 } }, - { { 5, 0, 3, 0 },{ 4, 0, 3, 0 },{ 4, 0, 2, 0 } }, 0, 0, 0 }, - - { 48000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 24000, 21000, 31950 },{ 16000, 15000, 20400 } }, - { { 4, 3, 3, 0 },{ 4, 3, 2, 0 },{ 3, 3, 2, 0 } }, 1, 0, 0 }, - - { 64000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 38000, 34050, 56000 },{ 16000, 15600, 20400 } },{ { 5, 3, 3, 0 },{ 4, 3, 3, 0 },{ 4, 3, 2, 0 } }, 1, 1, 0 }, - - { 80000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 46000, 43000, 56000 },{ 24000, 23000, 31950 } }, - { { 5, 3, 3, 0 },{ 4, 3, 3, 0 },{ 4, 3, 2, 0 } }, 1, 0, 0 }, - - { 96000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 47000, 42600, 56000 },{ 23000, 22600, 31950 },{ 16000, 15600, 20400 } }, - { { 5, 4, 4, 0 },{ 5, 3, 3, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, - - { 128000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 55000, 50000, 56000 },{ 36000, 36000, 56000 },{ 27000, 27000, 31950 } }, - { { 5, 4, 4, 0 },{ 5, 4, 3, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, - - { 160000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 74000, 70900, 112000 },{ 41000, 40050, 56000 },{ 35000, 34050, 56000 } }, - { { 5, 4, 4, 0 },{ 5, 4, 4, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, - - { 192000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 90000, 87900, 112000 },{ 50000, 48050, 56000 },{ 42000, 41050, 56000 } }, - { { 5, 4, 4, 0 },{ 5, 4, 4, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, - - { 256000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 90000, 85000, 112000 },{ 70000, 69000, 112000 },{ 50000, 48950, 56000 },{ 36400, 35600, 56000 } }, - { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 256000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 84650, 83000, 112000 },{ 65850, 64550, 56000 },{ 47000, 46100, 48000 },{ 28200, 27650, 40000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 256000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 76300, 73550, 112000 },{ 59350, 57200, 56000 },{ 42400, 40850, 48000 },{ 25450, 24500, 40000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } }, - { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, - { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, - - { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, - { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, -}; -const ivas_freq_models_t ivas_arith_pred_r_consts[TOTAL_PRED_QUANT_STRATS_ARITH] = -{ - /* entry for 1 quantization points */ - { - /* pred_R real */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* pred_R real differential */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* pred_R real : values for general and differential */ - { 0 },{ 0 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 7 quantization points for br_table_idx >= 2 */ - { - /* pred_R real */ - { - { 0,546,1092,2184,8740,2184,1092,546, }, - { 0,1779,2116,2516,3562,2516,2116,1779, }, - { 0,1848,2614,5229,2614,1848,1307,924, }, - { 0,924,1307,1848,2614,5229,2614,1848, }, - }, - /* pred_R real differential */ - { - { 0,125,399,1269,12798,1269,399,125, }, - { 0,744,1327,2365,7512,2365,1327,744, }, - { 0,1354,2413,7664,2413,1354,760,426, }, - { 0,426,760,1354,2413,7664,2413,1354, }, - }, - /* pred_R real : values for general and differential */ - { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 15 quantization points for br_table_idx >= 2 */ - { - /* pred_R real */ - { - { 0,32,64,128,257,514,1028,2056,8226,2056,1028,514,257,128,64,32, }, - { 0,565,672,799,950,1130,1344,1598,2268,1598,1344,1130,950,799,672,565, }, - { 0,353,500,707,1000,1414,2000,4010,2000,1414,1000,707,500,353,250,176, }, - { 0,176,250,353,500,707,1000,1414,2000,4010,2000,1414,1000,707,500,353, }, - }, - /* pred_R real differential */ - { - { 0,1,3,12,39,125,397,1260,12710,1260,397,125,39,12,3,1, }, - { 0,66,119,212,378,674,1201,2140,6804,2140,1201,674,378,212,119,66, }, - { 0,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119,67,37, }, - { 0,37,67,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119, }, - }, - /* pred_R real : values for general and differential */ - { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, - { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 21 quantization points for br_table_idx >= 2 */ - { - /* pred_R real */ - { - { 0,4,8,16,32,64,128,256,512,1024,2049,8198,2049,1024,512,256,128,64,32,16,8,4, }, - { 0,292,348,414,492,585,696,828,984,1171,1392,1980,1392,1171,984,828,696,585,492,414,348,292, }, - { 0,119,168,238,336,476,673,952,1346,1904,3817,1904,1346,952,673,476,336,238,168,119,84,59, }, - { 0,59,84,119,168,238,336,476,673,952,1346,1904,3817,1904,1346,952,673,476,336,238,168,119, }, - }, - /* pred_R real differential */ - { - { 0,1,1,1,1,3,12,39,125,397,1260,12704,1260,397,125,39,12,3,1,1,1,1, }, - { 0,11,20,37,66,118,210,375,668,1191,2122,6748,2122,1191,668,375,210,118,66,37,20,11, }, - { 0,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20,11,6, }, - { 0,6,11,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20, }, - }, - /* pred_R real : values for general and differential */ - { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, - { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 31 quantization points */ - { - /* pred real */ - { - { 0,1,1,1,1,2,4,8,16,32,64,128,256,512,1024,2048,8188,2048,1024,512,256,128,64,32,16,8,4,2,1,1,1,1, }, - { 0,110,131,156,186,221,263,313,373,443,527,627,746,887,1055,1255,1798,1255,1055,887,746,627,527,443,373,313,263,221,186,156,131,110, }, - { 0,20,29,41,58,82,116,164,233,329,466,659,932,1318,1864,3738,1864,1318,932,659,466,329,233,164,116,82,58,41,29,20,14,10, }, - { 0,10,14,20,29,41,58,82,116,164,233,329,466,659,932,1318,1864,3738,1864,1318,932,659,466,329,233,164,116,82,58,41,29,20, } - }, - /* pred real differential */ - { - { 0,1,1,1,1,1,1,1,1,1,3,12,39,125,397,1260,12694,1260,397,125,39,12,3,1,1,1,1,1,1,1,1,1, }, - { 0,1,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1,1, }, - { 0,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1,1,1, }, - { 0,1,1,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1, } - }, - /* pred real : values for general and differential */ - { -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, - { -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, - /* pred real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 7 quantization points for br_table_idx < 2 */ - { - /* pred_R real */ - { - { 0,327,778,1851,10472,1851,778,327, }, - { 0,1057,1630,2514,5982,2514,1630,1057, }, - { 0,1668,2572,6122,2572,1668,1081,701, }, - { 0,701,1081,1668,2572,6122,2572,1668, }, - }, - /* pred_R real differential */ - { - { 0,125,399,1269,12798,1269,399,125, }, - { 0,744,1327,2365,7512,2365,1327,744, }, - { 0,1354,2413,7664,2413,1354,760,426, }, - { 0,426,760,1354,2413,7664,2413,1354, }, - }, - /* pred_R real : values for general and differential */ - { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 15 quantization points for br_table_idx < 2 */ - { - /* pred real */ - { - { 0,9,23,56,133,318,757,1800,10192,1800,757,318,133,56,23,9, }, - { 0,156,240,371,573,883,1363,2102,5008,2102,1363,883,573,371,240,156, }, - { 0,241,372,575,886,1367,2109,5027,2109,1367,886,575,372,241,156,101, }, - { 0,101,156,241,372,575,886,1367,2109,5027,2109,1367,886,575,372,241, } - }, - /* pred real differential */ - { - { 0,1,3,12,39,125,397,1260,12710,1260,397,125,39,12,3,1, }, - { 0,66,119,212,378,674,1201,2140,6804,2140,1201,674,378,212,119,66, }, - { 0,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119,67,37, }, - { 0,37,67,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119, } - }, - /* pred real : values for general and differential */ - {-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7}, - { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, - /* pred real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 21 quantization points for br_table_idx < 2 */ - { - /* pred_R real */ - { - { 0,1,1,4,9,23,56,133,318,756,1799,10184,1799,756,318,133,56,23,9,4,1,1, }, - { 0,41,64,98,152,234,362,558,861,1329,2049,4888,2049,1329,861,558,362,234,152,98,64,41, }, - { 0,64,98,152,235,362,559,862,1330,2051,4891,2051,1330,862,559,362,235,152,98,64,41,26, }, - { 0,26,41,64,98,152,235,362,559,862,1330,2051,4891,2051,1330,862,559,362,235,152,98,64, }, - }, - /* pred_R real differential */ - { - { 0,1,1,1,1,3,12,39,125,397,1260,12704,1260,397,125,39,12,3,1,1,1,1, }, - { 0,11,20,37,66,118,210,375,668,1191,2122,6748,2122,1191,668,375,210,118,66,37,20,11, }, - { 0,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20,11,6, }, - { 0,6,11,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20, }, - }, - /* pred_R real : values for general and differential */ - { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, - { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, - /* pred_R real : num dyn models for general and differential */ - 4, 4 - } -}; - -const ivas_freq_models_t ivas_arith_drct_r_consts[TOTAL_DRCT_QUANT_STRATS] = -{ - /* entry for 1 quantization points */ - { - /* drct real */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* drct real differential */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* drct real : values for general and differential */ - {0},{ 0 }, - /* drct real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 7 quantization points */ - { /* drct real */ - { - { 0,125,399,1269,12798,1269,399,125, }, - { 0,744,1327,2365,7512,2365,1327,744, }, - { 0,988,1244,1568,1976,2489,3136,4983, }, - { 0,2111,2262,2425,2788,2425,2262,2111, }, - }, - /* drct real differential */ - { - { 0,125,399,1269,12798,1269,399,125, }, - { 0,744,1327,2365,7512,2365,1327,744, }, - { 0,1354,2413,7664,2413,1354,760,426, }, - { 0,426,760,1354,2413,7664,2413,1354, }, - }, - /* drct real : values for general and differential */ - { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, - /* drct real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 9 quantization points */ - { - /* drct real */ - { - { 0,39,125,397,1263,12736,1263,397,125,39, }, - { 0,397,708,1262,2250,7150,2250,1262,708,397, }, - { 0,573,722,909,1146,1444,1819,2292,2888,4591, }, - { 0,1587,1701,1824,1955,2250,1955,1824,1701,1587, }, - }, - /* drct real differential */ - { - { 0,39,125,397,1263,12736,1263,397,125,39, }, - { 0,397,708,1262,2250,7150,2250,1262,708,397, }, - { 0,716,1276,2274,7225,2274,1276,716,402,225, }, - { 0,225,402,716,1276,2274,7225,2274,1276,716, } - }, - /* drct real : values for general and differential */ - { -4,-3,-2,-1,0,1,2,3,4 },{ -4,-3,-2,-1,0,1,2,3,4 }, - /* drct real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 11 quantization points */ - { - /* drct real */ - { - { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, - { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, - { 0,343,433,546,687,866,1092,1375,1733,2184,2751,4374, }, - { 0,1254,1344,1441,1544,1655,1908,1655,1544,1441,1344,1254, }, - }, - /* drct real differential */ - { - { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, - { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, - { 0,389,694,1236,2203,7000,2203,1236,694,389,218,122, }, - { 0,122,218,389,694,1236,2203,7000,2203,1236,694,389, }, - }, - /* drct real : values for general and differential */ - { -5,-4,-3,-2,-1,0,1,2,3,4,5 },{ -5,-4,-3,-2,-1,0,1,2,3,4,5 }, - /* drct real : num dyn models for general and differential */ - 4, 4 - } -}; - -const ivas_freq_models_t ivas_arith_decd_r_consts[TOTAL_DECD_QUANT_STRATS] = -{ - /* entry for 1 quantization points */ - { - /* decd real */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* decd real differential */ - { - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - { 0,16384, }, - }, - /* decd real : values for general and differential */ - { 0 },{ 0 }, - /* decd real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 3 quantization points */ - { - /* decd real */ - { - { 0,11917,2978,1489, }, - { 0,8840,4419,3125, }, - { 0,4567,7250,4567, }, - { 0,5203,5978,5203, }, - }, - /* decd real differential */ - { - { 0,1356,13672,1356, }, - { 0,3166,10052,3166, }, - { 0,10984,3459,1941, }, - { 0,1941,3459,10984, }, - }, - /* decd real : values for general and differential */ - { 0,1,2 },{-1,0,1}, - /* decd real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 5 quantization points */ - { - /* decd real */ - { - { 0,11157,2788,1394,697,348, }, - { 0,7186,3592,2540,1796,1270, }, - { 0,2512,3166,5028,3166,2512, }, - { 0,3048,3267,3754,3267,3048, }, - }, - /* decd real differential */ - { - { 0,406,1289,12994,1289,406, }, - { 0,1460,2601,8262,2601,1460, }, - { 0,2707,8599,2707,1519,852, }, - { 0,852,1519,2707,8599,2707, }, - }, - /* decd real : values for general and differential */ - { 0,1,2,3,4 },{ -2,-1,0,1,2 }, - /* decd real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 7 quantization points */ - { - /* decd real */ - { - { 0,10983,2744,1372,686,343,171,85, }, - { 0,6573,3285,2322,1642,1161,821,580, }, - { 0,1603,2020,2546,4046,2546,2020,1603, }, - { 0,2111,2262,2425,2788,2425,2262,2111, }, - }, - /* decd real differential */ - { - { 0,125,399,1269,12798,1269,399,125, }, - { 0,744,1327,2365,7512,2365,1327,744, }, - { 0,1354,2413,7664,2413,1354,760,426, }, - { 0,426,760,1354,2413,7664,2413,1354, } - }, - /* decd real : values for general and differential */ - { 0,1,2,3,4,5,6 },{ -3,-2,-1,0,1,2,3 }, - /* decd real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 9 quantization points */ - { /* decd real */ - { - { 0,10941,2734,1367,683,341,170,85,42,21, }, - { 0,6305,3150,2227,1575,1113,787,556,393,278, }, - { 0,1101,1388,1749,2203,3502,2203,1749,1388,1101, }, - { 0,1587,1701,1824,1955,2250,1955,1824,1701,1587, }, - }, - /* decd real differential */ - { - { 0,39,125,397,1263,12736,1263,397,125,39, }, - { 0,397,708,1262,2250,7150,2250,1262,708,397, }, - { 0,716,1276,2274,7225,2274,1276,716,402,225, }, - { 0,225,402,716,1276,2274,7225,2274,1276,716, } - }, - /* decd real : values for general and differential */ - { 0,1,2,3,4,5,6,7,8 },{ -4,-3,-2,-1,0,1,2,3,4 }, - /* decd real : num dyn models for general and differential */ - 4, 4 - }, - /* entry for 11 quantization points */ - { - /* decd real */ - { - { 0,10932,2731,1365,682,341,170,85,42,21,10,5, }, - { 0,6181,3086,2182,1543,1091,771,545,385,272,192,136, }, - { 0,790,995,1254,1580,1991,3164,1991,1580,1254,995,790, }, - { 0,1254,1344,1441,1544,1655,1908,1655,1544,1441,1344,1254, }, - }, - /* decd real differential */ - { - { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, - { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, - { 0,389,694,1236,2203,7000,2203,1236,694,389,218,122, }, - { 0,122,218,389,694,1236,2203,7000,2203,1236,694,389, }, - }, - /* decd real : values for general and differential */ - { 0,1,2,3,4,5,6,7,8,9,10 },{ -5,-4,-3,-2,-1,0,1,2,3,4,5 }, - /* decd real : num dyn models for general and differential */ - 4, 4 - } -}; - -const ivas_huff_models_t ivas_huff_pred_r_consts[TOTAL_PRED_QUANT_STRATS_HUFF] = -{ - /* entry for 1 quantization points for br_table_idx */ - {{{ 0 }}, {{ 0 }}}, - /* entry for 7 quantization points for br_table_idx */ - { - /* pred_R codebook */ - { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 }, }, - /* pred_R differential codebook */ - { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 }, }, - }, - /* entry for 15 quantization points for br_table_idx */ - { - /* pred_r codebook */ - { { -7,4,2 },{ -6,4,3 },{ -5, 4, 4 },{ -4, 4, 5 },{ -3,4,6 },{ -2,4,7 },{ -1,4,8 }, - { 0,3,0 },{ 1,4,9 },{ 2,4,10 },{ 3,4,11 },{ 4,4,12 },{ 5,4,13 },{ 6,4,14 },{ 7,4,15 } }, - /* pred_r differential codebook */ - { { -7,4,2 },{ -6,4,3 },{ -5, 4, 4 },{ -4, 4, 5 },{ -3,4,6 },{ -2,4,7 },{ -1,4,8 }, - { 0,3,0 },{ 1,4,9 },{ 2,4,10 },{ 3,4,11 },{ 4,4,12 },{ 5,4,13 },{ 6,4,14 },{ 7,4,15 } }, - }, - /* entry for 21 quantization points for br_table_idx=0 */ - { - /* pred_r codebook */ - { {-10,5,22},{-9,5,23},{-8,5,24},{-7,5,25},{-6,5,26}, { -5, 4, 0 },{ -4, 4, 1 },{ -3,4,2 },{ -2,4,3 },{ -1,4,4 }, - { 0,4,5 },{ 1,4,6 },{ 2,4,7 },{ 3,4,8 },{ 4,4,9 },{ 5,4,10 },{6,5,27},{7,5,28},{8,5,29},{9,5,30},{10,5,31} }, - /* pred_r differential codebook */ - { { -10,5,22 },{ -9,5,23 },{ -8,5,24 },{ -7,5,25 },{ -6,5,26 },{ -5, 4, 0 },{ -4, 4, 1 },{ -3,4,2 },{ -2,4,3 },{ -1,4,4 }, - { 0,4,5 },{ 1,4,6 },{ 2,4,7 },{ 3,4,8 },{ 4,4,9 },{ 5,4,10 },{ 6,5,27 },{ 7,5,28 },{ 8,5,29 },{ 9,5,30 },{ 10,5,31 } }, - }, - - /* entry for 31 quantization points for br_table_idx>0 */ - { - /* pred_r codebook */ - { {-15,5,2},{-14,5,3},{-13,5,4},{-12,5,5},{-11,5,6}, { -10,5,7 },{ -9,5,8 },{ -8,5,9 }, - { -7,5,10 },{ -6,5,11 },{ -5, 5, 12 },{ -4, 5, 13 },{ -3,5,14 },{ -2,5,15 },{ -1,5,16 }, - { 0,4,0 },{ 1,5,17 },{ 2,5,18 },{ 3,5,19 },{ 4,5,20 },{ 5,5,21 },{ 6,5,22 },{ 7,5,23 }, - { 8,5,24 },{ 9,5,25 },{ 10,5,26 },{11,5,27},{12,5,28},{13,5,29},{14,5,30},{15,5,31} }, - /* pred_r differential codebook */ - { { -15,5,2 },{ -14,5,3 },{ -13,5,4 },{ -12,5,5 },{ -11,5,6 },{ -10,5,7 },{ -9,5,8 },{ -8,5,9 }, - { -7,5,10 },{ -6,5,11 },{ -5, 5, 12 },{ -4, 5, 13 },{ -3,5,14 },{ -2,5,15 },{ -1,5,16 }, - { 0,4,0 },{ 1,5,17 },{ 2,5,18 },{ 3,5,19 },{ 4,5,20 },{ 5,5,21 },{ 6,5,22 },{ 7,5,23 }, - { 8,5,24 },{ 9,5,25 },{ 10,5,26 },{ 11,5,27 },{ 12,5,28 },{ 13,5,29 },{ 14,5,30 },{ 15,5,31 } }, - }, - }; - - const ivas_huff_models_t ivas_huff_drct_r_consts[TOTAL_DRCT_QUANT_STRATS] = -{ - /* entry for 1 quantization points */ - {{{ 0 }}, {{ 0 }}}, - /* entry for 7 quantization points */ - { - /* drct_r codebook */ - { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, - /* drct_r differential codebook */ - { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, - }, - /* entry for 9 quantization points */ - { - /* drct_r codebook */ - { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, - /* drct_r differential codebook */ - { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, - }, - /* entry for 11 quantization points */ - { - /* drct_r codebook */ - { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, - /* drct_r differential codebook */ - { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, - }, -}; - -const ivas_huff_models_t ivas_huff_decd_r_consts[TOTAL_DECD_QUANT_STRATS] = -{ - /* entry for 1 quantization points */ - {{{ 0 }}, {{ 0 }}}, - /* entry for 3 quantization points */ - { - /* decd_r codebook */ - { { 0, 2, 2 },{ 1, 1, 0 },{ 2,2,3 } }, - /* decd_r differential codebook */ - { { -1, 2, 2 },{ 0, 1, 0 },{ 1,2,3 } }, - }, - /* entry for 5 quantization points */ - { - /* decd_r codebook */ - { { 0,3,6 },{ 1,2,0 },{ 2,2,1 },{ 3,2,2 },{ 4,3,7 } }, - /* decd_r differential codebook */ - { { -2,3,6 },{ -1,2,0 },{ 0,2,1 },{ 1,2,2 },{ 2,3,7 } }, - }, - /* entry for 7 quantization points */ - { - /* decd_r */ - { { 0, 3, 2 },{ 1, 3, 3 },{ 2,3,4 },{ 3,3,0 },{ 4,3,5 },{ 5,3,6 },{ 6,3,7 } }, - /* decd_r codebook differential codebook */ - { { -3, 3, 2 },{ -2, 3, 3 },{ -1,3,4 },{ 0,3,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, - }, - /* entry for 9 quantization points */ - { - /* decd_r codebook */ - { { 0, 4, 14 },{ 1,3,0 },{ 2,3,1 },{ 3,3,2 },{ 4,3,3 },{ 5,3,4 },{ 6,3,5 },{ 7,3,6 },{ 8,4,15 } }, - /* decd_r differential codebook */ - { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, - }, - /* entry for 11 quantization points */ - { - /* decd_r codebook */ - { { 0, 4, 10 },{ 1, 4, 11 },{ 2,4,12 },{ 3,3,0 },{ 4,3,1 },{ 5,3,2 },{ 6,3,3 },{ 7,3,4 },{ 8,4,13 },{ 9,4,14 },{ 10,4,15 } }, - /* decd_r differential codebook */ - { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, - }, -}; - -/* DTX quantization and bitstream constants */ - -const Word16 dtx_pd_real_q_levels[3][3] = { { 7,7,7 },{ 7,7,0 },{ 3,0,0 } }; -const Word16 dtx_pr_real_q_levels[3][3] = { { 9,9,9 },{ 9,7,9 },{ 9,5,7 } }; -const Word16 pr_pr_idx_pairs[3][3][2] = { { { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 1, 3 },{ 0, 0 } } }; -const Word16 pr_pd_idx_pairs[3][3][2] = { { { 1, 1 },{ 2, 2 },{ 3, 3 } },{ { 1, 1 },{ 3, 2 },{ 2, 0 } },{ { 2, 1 },{ 0, 0 },{ 0, 0 } } }; - -const Word16 remix_order_set[1][DIRAC_MAX_ANA_CHANS] = { /* WYZX --> WYXZ... */ - { 0, 1, 3, 2, 4, 5, 6, 7, 8, 9, 10 } -}; - -const Word16 HOA_keep_ind[IVAS_SPAR_MAX_FB_IN_CHAN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15}; -const Word16 HOA_keep_ind_spar[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 8, 9, 10, 10, 10, 10}; -const Word16 HOA_keep_ind_spar512[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - - -/*----------------------------------------------------------------------* -* PCA ROM tables -*-----------------------------------------------------------------------*/ - -const Word32 ivas_pca_offset_index1[IVAS_PCA_N1 + 1] = -{ - 0, 1, 9, 61, 163, 359, 685, 1125, 1747, - 2519, 3521, 4713, 6183, 7883, 9809, 12093, 14633, 17575, - 20807, 24343, 28181, 32487, 37121, 42097, 47405, 53057, 59061, - 65421, 72137, 79205, 86625, 94415, 102345, 110629, 119263, 128017, - 137097, 146515, 156043, 165637, 175551, 185515, 195535, 205837, 216183, - 226545, 236911, 247273, 257619, 267921, 277941, 287905, 297819, 307413, - 316941, 326359, 335439, 344193, 352827, 361111, 369041, 376831, 384251, - 391319, 398035, 404395, 410399, 416051, 421359, 426335, 430969, 435275, - 439113, 442649, 445881, 448823, 451363, 453647, 455573, 457273, 458743, - 459935, 460937, 461709, 462331, 462771, 463097, 463293, 463395, 463447, - 463455, 463456 -}; - -const Word16 ivas_pca_offset_index2[2692] = -{ - 0, 1, 0, 1, 7, 8, 0, 1, 7, 19, - 33, 45, 51, 52, 0, 1, 9, 23, 41, 61, - 79, 93, 101, 102, 0, 1, 7, 21, 39, 61, - 85, 111, 135, 157, 175, 189, 195, 196, 0, 1, - 7, 19, 37, 59, 85, 115, 147, 179, 211, 241, - 267, 289, 307, 319, 325, 326, 0, 1, 7, 21, - 41, 65, 95, 127, 163, 201, 239, 277, 313, 345, - 375, 399, 419, 433, 439, 440, 0, 1, 7, 19, - 37, 61, 91, 125, 163, 203, 245, 289, 333, 377, - 419, 459, 497, 531, 561, 585, 603, 615, 621, 622, - 0, 1, 7, 21, 41, 67, 97, 133, 173, 217, - 263, 311, 361, 411, 461, 509, 555, 599, 639, 675, - 705, 731, 751, 765, 771, 772, 0, 1, 7, 19, - 37, 61, 91, 127, 167, 211, 259, 309, 363, 417, - 473, 529, 585, 639, 693, 743, 791, 835, 875, 911, - 941, 965, 983, 995, 1001, 1002, 0, 1, 7, 21, - 41, 67, 99, 135, 177, 223, 273, 327, 383, 443, - 503, 565, 627, 689, 749, 809, 865, 919, 969, 1015, - 1057, 1093, 1125, 1151, 1171, 1185, 1191, 1192, 0, 1, - 7, 19, 37, 61, 91, 127, 169, 215, 265, 319, - 377, 437, 501, 567, 633, 701, 769, 837, 903, 969, - 1033, 1093, 1151, 1205, 1255, 1301, 1343, 1379, 1409, 1433, - 1451, 1463, 1469, 1470, 0, 1, 7, 21, 41, 67, - 99, 137, 179, 227, 279, 335, 395, 459, 525, 595, - 667, 739, 813, 887, 961, 1033, 1105, 1175, 1241, 1305, - 1365, 1421, 1473, 1521, 1563, 1601, 1633, 1659, 1679, 1693, - 1699, 1700, 0, 1, 9, 23, 43, 69, 101, 139, - 183, 231, 285, 343, 405, 471, 541, 613, 689, 765, - 843, 923, 1003, 1083, 1161, 1237, 1313, 1385, 1455, 1521, - 1583, 1641, 1695, 1743, 1787, 1825, 1857, 1883, 1903, 1917, - 1925, 1926, 0, 1, 7, 21, 41, 67, 99, 137, - 179, 227, 281, 339, 401, 467, 537, 611, 687, 767, - 849, 931, 1015, 1099, 1185, 1269, 1353, 1435, 1517, 1597, - 1673, 1747, 1817, 1883, 1945, 2003, 2057, 2105, 2147, 2185, - 2217, 2243, 2263, 2277, 2283, 2284, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 285, 345, 409, 477, - 549, 625, 705, 787, 871, 957, 1045, 1135, 1225, 1315, - 1405, 1495, 1583, 1669, 1753, 1835, 1915, 1991, 2063, 2131, - 2195, 2255, 2309, 2359, 2403, 2441, 2473, 2499, 2519, 2533, - 2539, 2540, 0, 1, 7, 19, 39, 65, 97, 135, - 177, 225, 279, 337, 401, 469, 541, 617, 697, 781, - 867, 955, 1045, 1137, 1231, 1327, 1423, 1519, 1615, 1711, - 1805, 1897, 1987, 2075, 2161, 2245, 2325, 2401, 2473, 2541, - 2605, 2663, 2717, 2765, 2807, 2845, 2877, 2903, 2923, 2935, - 2941, 2942, 0, 1, 7, 21, 41, 67, 99, 137, - 181, 229, 283, 343, 407, 477, 551, 629, 711, 797, - 885, 977, 1071, 1167, 1265, 1365, 1465, 1565, 1667, 1767, - 1867, 1967, 2065, 2161, 2255, 2347, 2435, 2521, 2603, 2681, - 2755, 2825, 2889, 2949, 3003, 3051, 3095, 3133, 3165, 3191, - 3211, 3225, 3231, 3232, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 347, 413, 483, 559, 639, - 723, 811, 903, 997, 1093, 1193, 1295, 1399, 1503, 1609, - 1715, 1821, 1927, 2033, 2137, 2241, 2343, 2443, 2539, 2633, - 2725, 2813, 2897, 2977, 3053, 3123, 3189, 3249, 3305, 3355, - 3399, 3437, 3469, 3495, 3515, 3529, 3535, 3536, 0, 1, - 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, - 415, 487, 563, 645, 731, 821, 915, 1011, 1111, 1213, - 1317, 1423, 1531, 1641, 1751, 1863, 1975, 2087, 2197, 2307, - 2415, 2521, 2625, 2727, 2827, 2923, 3017, 3107, 3193, 3275, - 3351, 3423, 3489, 3551, 3607, 3657, 3701, 3739, 3771, 3797, - 3817, 3831, 3837, 3838, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 285, 345, 411, 481, 557, 637, - 721, 809, 901, 997, 1097, 1199, 1305, 1413, 1523, 1635, - 1749, 1863, 1979, 2095, 2211, 2327, 2443, 2557, 2671, 2783, - 2893, 3001, 3107, 3209, 3309, 3405, 3497, 3585, 3669, 3749, - 3825, 3895, 3961, 4021, 4075, 4125, 4169, 4207, 4239, 4265, - 4285, 4299, 4305, 4306, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 347, 413, 485, 561, 643, - 729, 819, 913, 1011, 1113, 1217, 1325, 1435, 1547, 1663, - 1779, 1897, 2017, 2137, 2257, 2377, 2497, 2617, 2737, 2855, - 2971, 3087, 3199, 3309, 3417, 3521, 3623, 3721, 3815, 3905, - 3991, 4073, 4149, 4221, 4287, 4347, 4403, 4453, 4497, 4535, - 4567, 4593, 4613, 4627, 4633, 4634, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 415, 487, - 565, 647, 733, 825, 921, 1021, 1125, 1231, 1341, 1453, - 1569, 1687, 1807, 1929, 2051, 2175, 2299, 2425, 2551, 2677, - 2801, 2925, 3047, 3169, 3289, 3407, 3523, 3635, 3745, 3851, - 3955, 4055, 4151, 4243, 4329, 4411, 4489, 4561, 4627, 4689, - 4745, 4795, 4839, 4877, 4909, 4935, 4955, 4969, 4975, 4976, - 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, - 287, 349, 417, 489, 567, 649, 737, 829, 925, 1025, - 1129, 1237, 1349, 1463, 1581, 1701, 1823, 1947, 2073, 2201, - 2329, 2459, 2589, 2719, 2849, 2979, 3107, 3235, 3361, 3485, - 3607, 3727, 3845, 3959, 4071, 4179, 4283, 4383, 4479, 4571, - 4659, 4741, 4819, 4891, 4959, 5021, 5077, 5127, 5171, 5209, - 5241, 5267, 5287, 5301, 5307, 5308, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 489, - 567, 651, 739, 831, 929, 1031, 1137, 1247, 1361, 1477, - 1597, 1719, 1843, 1969, 2097, 2227, 2359, 2491, 2625, 2759, - 2893, 3027, 3161, 3293, 3425, 3555, 3683, 3809, 3933, 4055, - 4175, 4291, 4405, 4515, 4621, 4723, 4821, 4913, 5001, 5085, - 5163, 5235, 5303, 5365, 5421, 5471, 5515, 5553, 5585, 5611, - 5631, 5645, 5651, 5652, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 569, 653, - 741, 835, 933, 1035, 1141, 1251, 1365, 1483, 1603, 1727, - 1853, 1983, 2115, 2249, 2383, 2519, 2657, 2795, 2933, 3071, - 3209, 3347, 3485, 3621, 3755, 3889, 4021, 4151, 4277, 4401, - 4521, 4639, 4753, 4863, 4969, 5071, 5169, 5263, 5351, 5435, - 5513, 5587, 5655, 5717, 5773, 5823, 5867, 5905, 5937, 5963, - 5983, 5997, 6003, 6004, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 569, 653, - 741, 835, 933, 1037, 1145, 1257, 1373, 1491, 1613, 1739, - 1867, 1997, 2131, 2267, 2405, 2543, 2683, 2825, 2967, 3109, - 3251, 3393, 3535, 3677, 3817, 3955, 4093, 4229, 4363, 4493, - 4621, 4747, 4869, 4987, 5103, 5215, 5323, 5427, 5525, 5619, - 5707, 5791, 5869, 5943, 6011, 6073, 6129, 6179, 6223, 6261, - 6293, 6319, 6339, 6353, 6359, 6360, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, - 569, 653, 743, 837, 935, 1039, 1147, 1259, 1375, 1495, - 1619, 1745, 1875, 2007, 2143, 2281, 2421, 2563, 2705, 2849, - 2993, 3139, 3285, 3431, 3577, 3723, 3867, 4011, 4153, 4295, - 4435, 4573, 4709, 4841, 4971, 5097, 5221, 5341, 5457, 5569, - 5677, 5781, 5879, 5973, 6063, 6147, 6225, 6299, 6367, 6429, - 6485, 6535, 6579, 6617, 6649, 6675, 6695, 6709, 6715, 6716, - 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, - 287, 349, 417, 491, 569, 653, 743, 837, 937, 1041, - 1149, 1261, 1377, 1497, 1621, 1749, 1879, 2013, 2149, 2287, - 2429, 2573, 2717, 2863, 3011, 3159, 3309, 3459, 3609, 3759, - 3909, 4057, 4205, 4351, 4495, 4639, 4781, 4919, 5055, 5189, - 5319, 5447, 5571, 5691, 5807, 5919, 6027, 6131, 6231, 6325, - 6415, 6499, 6577, 6651, 6719, 6781, 6837, 6887, 6931, 6969, - 7001, 7027, 7047, 7061, 7067, 7068, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, - 569, 653, 743, 837, 937, 1041, 1149, 1261, 1377, 1497, - 1621, 1749, 1881, 2015, 2153, 2293, 2435, 2579, 2725, 2873, - 3023, 3175, 3327, 3479, 3633, 3787, 3941, 4093, 4245, 4397, - 4547, 4695, 4841, 4985, 5127, 5267, 5405, 5539, 5671, 5799, - 5923, 6043, 6159, 6271, 6379, 6483, 6583, 6677, 6767, 6851, - 6929, 7003, 7071, 7133, 7189, 7239, 7283, 7321, 7353, 7379, - 7399, 7413, 7419, 7420, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 489, 567, 651, - 741, 835, 935, 1039, 1147, 1259, 1377, 1499, 1625, 1753, - 1885, 2021, 2159, 2301, 2445, 2591, 2739, 2889, 3041, 3195, - 3349, 3505, 3661, 3817, 3973, 4129, 4285, 4441, 4595, 4749, - 4901, 5051, 5199, 5345, 5489, 5631, 5769, 5905, 6037, 6165, - 6291, 6413, 6531, 6643, 6751, 6855, 6955, 7049, 7139, 7223, - 7301, 7373, 7441, 7503, 7559, 7609, 7653, 7691, 7723, 7749, - 7769, 7783, 7789, 7790, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, - 747, 843, 945, 1051, 1161, 1277, 1397, 1521, 1649, 1781, - 1915, 2053, 2195, 2339, 2485, 2635, 2787, 2941, 3095, 3251, - 3409, 3567, 3725, 3885, 4045, 4205, 4363, 4521, 4679, 4835, - 4989, 5143, 5295, 5445, 5591, 5735, 5877, 6015, 6149, 6281, - 6409, 6533, 6653, 6769, 6879, 6985, 7087, 7183, 7273, 7359, - 7439, 7513, 7581, 7643, 7699, 7749, 7793, 7831, 7863, 7889, - 7909, 7923, 7929, 7930, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, - 747, 843, 943, 1049, 1159, 1273, 1393, 1517, 1645, 1777, - 1913, 2051, 2193, 2337, 2485, 2635, 2787, 2941, 3097, 3255, - 3415, 3575, 3737, 3899, 4061, 4223, 4385, 4547, 4709, 4869, - 5029, 5187, 5343, 5497, 5649, 5799, 5947, 6091, 6233, 6371, - 6507, 6639, 6767, 6891, 7011, 7125, 7235, 7341, 7441, 7537, - 7627, 7713, 7793, 7867, 7935, 7997, 8053, 8103, 8147, 8185, - 8217, 8243, 8263, 8277, 8283, 8284, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, - 571, 655, 745, 841, 941, 1047, 1157, 1271, 1389, 1513, - 1641, 1773, 1907, 2045, 2187, 2331, 2479, 2629, 2783, 2939, - 3097, 3257, 3417, 3579, 3743, 3907, 4071, 4235, 4399, 4563, - 4727, 4891, 5055, 5217, 5377, 5537, 5695, 5851, 6005, 6155, - 6303, 6447, 6589, 6727, 6861, 6993, 7121, 7245, 7363, 7477, - 7587, 7693, 7793, 7889, 7979, 8063, 8143, 8217, 8285, 8347, - 8403, 8453, 8497, 8535, 8567, 8593, 8613, 8627, 8633, 8634, - 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, - 287, 349, 417, 491, 571, 657, 749, 845, 947, 1053, - 1165, 1281, 1401, 1527, 1657, 1791, 1929, 2069, 2213, 2361, - 2511, 2663, 2819, 2977, 3137, 3299, 3463, 3627, 3793, 3959, - 4125, 4293, 4461, 4629, 4795, 4961, 5127, 5291, 5455, 5617, - 5777, 5935, 6091, 6243, 6393, 6541, 6685, 6825, 6963, 7097, - 7227, 7353, 7473, 7589, 7701, 7807, 7909, 8005, 8097, 8183, - 8263, 8337, 8405, 8467, 8523, 8573, 8617, 8655, 8687, 8713, - 8733, 8747, 8753, 8754, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, - 747, 843, 943, 1049, 1159, 1275, 1395, 1519, 1647, 1779, - 1915, 2055, 2199, 2345, 2495, 2647, 2803, 2961, 3121, 3283, - 3447, 3613, 3779, 3947, 4115, 4285, 4455, 4625, 4795, 4965, - 5133, 5301, 5467, 5633, 5797, 5959, 6119, 6277, 6433, 6585, - 6735, 6881, 7025, 7165, 7301, 7433, 7561, 7685, 7805, 7921, - 8031, 8137, 8237, 8333, 8423, 8509, 8589, 8663, 8731, 8793, - 8849, 8899, 8943, 8981, 9013, 9039, 9059, 9073, 9079, 9080, - 0, 1, 7, 19, 39, 65, 97, 135, 179, 229, - 285, 347, 415, 489, 567, 651, 741, 835, 935, 1041, - 1151, 1265, 1385, 1509, 1637, 1769, 1905, 2045, 2189, 2335, - 2485, 2637, 2793, 2951, 3111, 3273, 3437, 3603, 3771, 3939, - 4109, 4279, 4451, 4623, 4795, 4967, 5139, 5309, 5479, 5647, - 5815, 5981, 6145, 6307, 6467, 6625, 6781, 6933, 7083, 7229, - 7373, 7513, 7649, 7781, 7909, 8033, 8153, 8267, 8377, 8483, - 8583, 8677, 8767, 8851, 8929, 9003, 9071, 9133, 9189, 9239, - 9283, 9321, 9353, 9379, 9399, 9411, 9417, 9418, 0, 1, - 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, - 417, 491, 571, 657, 747, 843, 945, 1051, 1163, 1279, - 1399, 1525, 1655, 1789, 1927, 2069, 2213, 2361, 2513, 2667, - 2825, 2985, 3147, 3311, 3477, 3645, 3815, 3985, 4157, 4329, - 4503, 4677, 4851, 5025, 5199, 5371, 5543, 5713, 5883, 6051, - 6217, 6381, 6543, 6703, 6861, 7015, 7167, 7315, 7459, 7601, - 7739, 7873, 8003, 8129, 8249, 8365, 8477, 8583, 8685, 8781, - 8871, 8957, 9037, 9111, 9179, 9241, 9297, 9347, 9391, 9429, - 9461, 9487, 9507, 9521, 9527, 9528, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, - 571, 657, 749, 845, 947, 1055, 1167, 1285, 1407, 1533, - 1663, 1797, 1935, 2077, 2223, 2373, 2525, 2681, 2839, 3001, - 3165, 3331, 3499, 3669, 3839, 4011, 4185, 4359, 4533, 4709, - 4885, 5061, 5235, 5409, 5583, 5755, 5925, 6095, 6263, 6429, - 6593, 6755, 6913, 7069, 7221, 7371, 7517, 7659, 7797, 7931, - 8061, 8187, 8309, 8427, 8539, 8647, 8749, 8845, 8937, 9023, - 9103, 9177, 9245, 9307, 9363, 9413, 9457, 9495, 9527, 9553, - 9573, 9587, 9593, 9594, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 655, - 745, 841, 941, 1047, 1157, 1273, 1393, 1517, 1647, 1781, - 1919, 2061, 2207, 2355, 2507, 2663, 2821, 2981, 3145, 3311, - 3479, 3649, 3821, 3993, 4167, 4341, 4517, 4693, 4869, 5045, - 5221, 5397, 5573, 5747, 5921, 6093, 6265, 6435, 6603, 6769, - 6933, 7093, 7251, 7407, 7559, 7707, 7853, 7995, 8133, 8267, - 8397, 8521, 8641, 8757, 8867, 8973, 9073, 9169, 9259, 9343, - 9423, 9497, 9565, 9627, 9683, 9733, 9777, 9815, 9847, 9873, - 9893, 9907, 9913, 9914, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, - 747, 843, 945, 1051, 1163, 1279, 1401, 1527, 1657, 1791, - 1929, 2071, 2217, 2367, 2519, 2675, 2835, 2997, 3161, 3327, - 3495, 3665, 3837, 4011, 4185, 4361, 4537, 4715, 4893, 5071, - 5249, 5427, 5603, 5779, 5953, 6127, 6299, 6469, 6637, 6803, - 6967, 7129, 7289, 7445, 7597, 7747, 7893, 8035, 8173, 8307, - 8437, 8563, 8685, 8801, 8913, 9019, 9121, 9217, 9307, 9393, - 9473, 9547, 9615, 9677, 9733, 9783, 9827, 9865, 9897, 9923, - 9943, 9957, 9963, 9964, 0, 1, 7, 21, 41, 67, - 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, - 749, 845, 947, 1055, 1167, 1285, 1407, 1533, 1663, 1799, - 1939, 2083, 2229, 2379, 2533, 2689, 2849, 3011, 3177, 3345, - 3515, 3687, 3861, 4035, 4211, 4387, 4565, 4743, 4921, 5099, - 5277, 5455, 5633, 5809, 5985, 6159, 6333, 6505, 6675, 6843, - 7009, 7171, 7331, 7487, 7641, 7791, 7937, 8081, 8221, 8357, - 8487, 8613, 8735, 8853, 8965, 9073, 9175, 9271, 9363, 9449, - 9529, 9603, 9671, 9733, 9789, 9839, 9883, 9921, 9953, 9979, - 9999, 10013, 10019, 10020, 0, 1, 7, 19, 39, 65, - 97, 135, 179, 229, 285, 347, 415, 489, 567, 651, - 741, 837, 937, 1043, 1153, 1269, 1389, 1513, 1643, 1777, - 1915, 2057, 2203, 2351, 2503, 2659, 2817, 2979, 3143, 3309, - 3477, 3647, 3819, 3993, 4169, 4345, 4523, 4701, 4881, 5061, - 5241, 5421, 5601, 5779, 5957, 6133, 6309, 6483, 6655, 6825, - 6993, 7159, 7323, 7485, 7643, 7799, 7951, 8099, 8245, 8387, - 8525, 8659, 8789, 8913, 9033, 9149, 9259, 9365, 9465, 9561, - 9651, 9735, 9813, 9887, 9955, 10017, 10073, 10123, 10167, 10205, - 10237, 10263, 10283, 10295, 10301, 10302, 0, 1, 7, 21, - 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, - 571, 655, 745, 841, 941, 1047, 1159, 1275, 1395, 1521, - 1651, 1785, 1923, 2065, 2211, 2361, 2513, 2669, 2829, 2991, - 3155, 3321, 3491, 3663, 3837, 4011, 4187, 4365, 4543, 4723, - 4903, 5083, 5263, 5443, 5623, 5803, 5981, 6159, 6335, 6509, - 6683, 6855, 7025, 7191, 7355, 7517, 7677, 7833, 7985, 8135, - 8281, 8423, 8561, 8695, 8825, 8951, 9071, 9187, 9299, 9405, - 9505, 9601, 9691, 9775, 9855, 9929, 9997, 10059, 10115, 10165, - 10209, 10247, 10279, 10305, 10325, 10339, 10345, 10346, 0, 1, - 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, - 417, 491, 571, 655, 745, 841, 943, 1049, 1161, 1277, - 1397, 1523, 1653, 1787, 1925, 2067, 2213, 2363, 2517, 2673, - 2833, 2995, 3159, 3327, 3497, 3669, 3843, 4019, 4195, 4373, - 4551, 4731, 4911, 5091, 5271, 5451, 5631, 5811, 5989, 6167, - 6343, 6519, 6693, 6865, 7035, 7203, 7367, 7529, 7689, 7845, - 7999, 8149, 8295, 8437, 8575, 8709, 8839, 8965, 9085, 9201, - 9313, 9419, 9521, 9617, 9707, 9791, 9871, 9945, 10013, 10075, - 10131, 10181, 10225, 10263, 10295, 10321, 10341, 10355, 10361, 10362, - 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, - 287, 349, 417, 491, 571, 657, 747, 843, 945, 1051, - 1163, 1279, 1399, 1525, 1655, 1789, 1927, 2069, 2215, 2365, - 2519, 2675, 2835, 2997, 3161, 3329, 3499, 3671, 3845, 4021, - 4197, 4375, 4553, 4733, 4913, 5093, 5273, 5453, 5633, 5813, - 5991, 6169, 6345, 6521, 6695, 6867, 7037, 7205, 7369, 7531, - 7691, 7847, 8001, 8151, 8297, 8439, 8577, 8711, 8841, 8967, - 9087, 9203, 9315, 9421, 9523, 9619, 9709, 9795, 9875, 9949, - 10017, 10079, 10135, 10185, 10229, 10267, 10299, 10325, 10345, 10359, - 10365, 10366 -}; - -const Word16 ivas_pca_offset_n2[IVAS_PCA_N1] = -{ - 0, 2, 6, 14, 24, 38, 56, 76, 100, 126, 156, 188, - 224, 262, 302, 346, 392, 442, 494, 548, 604, 664, 726, 790, - 856, 924, 994, 1066, 1140, 1216, 1294, 1374, 1454, 1536, 1620, 1704, - 1790, 1878, 1966, 2054, 2144, 2234, 2324, 2416, 2508, 2600, 2692, 2784, - 2876, 2968, 3058, 3148, 3238, 3326, 3414, 3502, 3588, 3672, 3756, 3838, - 3918, 3998, 4076, 4152, 4226, 4298, 4368, 4436, 4502, 4566, 4628, 4688, - 4744, 4798, 4850, 4900, 4946, 4990, 5030, 5068, 5104, 5136, 5166, 5192, - 5216, 5236, 5254, 5268, 5278, 5286, 5290 -}; - -const Word16 ph1_q_n2_tbl[IVAS_PCA_N1][2] = { /* ph1_q : Q13, n2 : Q0 */ - { 0, 1 }, - { 286, 3 }, - { 572, 7 }, - { 858, 9 }, - { 1144, 13 }, - { 1430, 17 }, - { 1716, 19 }, - { 2002, 23 }, - { 2288, 25 }, - { 2574, 29 }, - { 2860, 31 }, - { 3146, 35 }, - { 3431, 37 }, - { 3717, 39 }, - { 4003, 43 }, - { 4289, 45 }, - { 4575, 49 }, - { 4861, 51 }, - { 5147, 53 }, - { 5433, 55 }, - { 5719, 59 }, - { 6005, 61 }, - { 6291, 63 }, - { 6577, 65 }, - { 6863, 67 }, - { 7149, 69 }, - { 7435, 71 }, - { 7721, 73 }, - { 8007, 75 }, - { 8293, 77 }, - { 8579, 79 }, - { 8865, 79 }, - { 9151, 81 }, - { 9437, 83 }, - { 9722, 83 }, - { 10008, 85 }, - { 10294, 87 }, - { 10580, 87 }, - { 10866, 87 }, - { 11152, 89 }, - { 11438, 89 }, - { 11724, 89 }, - { 12010, 91 }, - { 12296, 91 }, - { 12582, 91 }, - { 12868, 91 }, - { 13154, 91 }, - { 13440, 91 }, - { 13726, 91 }, - { 14012, 89 }, - { 14298, 89 }, - { 14584, 89 }, - { 14870, 87 }, - { 15156, 87 }, - { 15442, 87 }, - { 15728, 85 }, - { 16013, 83 }, - { 16299, 83 }, - { 16585, 81 }, - { 16871, 79 }, - { 17157, 79 }, - { 17443, 77 }, - { 17729, 75 }, - { 18015, 73 }, - { 18301, 71 }, - { 18587, 69 }, - { 18873, 67 }, - { 19159, 65 }, - { 19445, 63 }, - { 19731, 61 }, - { 20017, 59 }, - { 20303, 55 }, - { 20589, 53 }, - { 20875, 51 }, - { 21161, 49 }, - { 21447, 45 }, - { 21733, 43 }, - { 22019, 39 }, - { 22304, 37 }, - { 22590, 35 }, - { 22876, 31 }, - { 23162, 29 }, - { 23448, 25 }, - { 23734, 23 }, - { 24020, 19 }, - { 24306, 17 }, - { 24592, 13 }, - { 24878, 9 }, - { 25164, 7 }, - { 25450, 3 }, - { 25736, 1 } -}; - - -/*----------------------------------------------------------------------------------* - * Parametric MC ROM tables - *----------------------------------------------------------------------------------*/ - -const Word16 param_mc_band_grouping_20[20 + 1] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 17, 20, 23, 27, 33, 40, 52, 60 -}; - -const Word16 param_mc_coding_band_mapping_20[20] = -{ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -const Word16 param_mc_bands_coded_20[4] = -{ - 10, 14, 18, 20 -}; - -const Word16 param_mc_band_grouping_14[14 + 1] = -{ - 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 28, 40, 60 -}; - -const Word16 param_mc_coding_band_mapping_14[14] = -{ - 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 -}; - -const Word16 param_mc_bands_coded_14[4] = -{ - 8, 11, 13, 14 -}; - -const Word16 param_mc_band_grouping_10[10 + 1] = -{ - 0, 1, 2, 3, 5, 7, 10, 14, 20, 40, 60 -}; - - -const Word16 param_mc_bands_coded_10[4] = -{ - 6, 8, 9, 10 -}; - -const Word16 param_mc_coding_band_mapping_10[10] = -{ - 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 -}; - -const Word16 Param_MC_index[MAX_CICP_CHANNELS] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 -}; - - -const Word32 ivas_param_mc_dmx_fac_CICP6_2tc_fx[12] = -{ - 2147483647,0,1518500224,1518500224,2147483647,0, /*Lt*/ - 0,2147483647,1518500224,1518500224,0,2147483647 /*Rt*/ -}; - -const Word32 ivas_param_mc_dmx_fac_CICP12_2tc_fx[16] = -{ - 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647 /*Rt*/ -}; - -const Word32 ivas_param_mc_dmx_fac_CICP12_3tc_fx[24] = -{ - 2147483647,0,0,0,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,0,0,0,2147483647,0,2147483647, /*Rt*/ - 0,0,2147483647,2147483647,0,0,0,0 /*Ct*/ -}; - -const Word32 ivas_param_mc_dmx_fac_CICP14_2tc_fx[16] = -{ - 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647 /*Rt*/ -}; -const Word32 ivas_param_mc_dmx_fac_CICP14_3tc_fx[24] = -{ - 2147483647,0,0,0,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,0,0,0,2147483647,0,2147483647, /*Rt*/ - 0,0,2147483647,2147483647,0,0,0,0 /*Ct*/ -}; - -const Word32 ivas_param_mc_dmx_fac_CICP16_3tc_fx[30] = -{ - 2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,0,0,0,2147483647,0,2147483647,0,2147483647, /*Rt*/ - 0,0,2147483647,2147483647,0,0,0,0,0,0 /*Ct*/ -}; - -const Word32 ivas_param_mc_dmx_fac_CICP19_3tc_fx[36] = -{ - 2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0,2147483647,0, /*Lt*/ - 0,2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0,2147483647, /*Rt*/ - 0,0,2147483647,2147483647,0,0,0,0,0,0,0,0 /*Ct*/ -}; - -#ifndef FIX_1157_OBSOLETE_DMX_TABLE -const Word32 ivas_param_mc_dmx_fac_CICP19_4tc_fx[48] = -{ - 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0,0,0,0,0, /*Lht*/ - 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647,0,0,0,0, /*Rht*/ - 0,0,0,0,0,0,0,0,2147483647,0,2147483647,0, /*Lut*/ - 0,0,0,0,0,0,0,0,0,2147483647,0,2147483647 /*Rut*/ -}; -#endif - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP6_2tc_fx[6] = -{ - 12832, - 12832, - 6820, - 10607, - 10607, - 6820 -}; - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP12_2tc_fx[8] = -{ - 11965, - 11965, - 6816, - 6877, - 6877, - 5619, - 5619, - 6816 -}; - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP12_3tc_fx[8] = -{ - 16384, - 16384, - 9502, - 9502, - 6553, - 6553, - 32767, - 8192 -}; -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP14_2tc_fx[8] = -{ - 11936, - 11936, - 5993, - 6945, - 6945, - 8049, - 8049, - 6816 -}; - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP14_3tc_fx[8] = -{ - 16291, - 16291, - 8257, - 8257, - 9666, - 9666, - 32767, - 8192 -}; - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP16_3tc_fx[10] = -{ - 11141, - 11141, - 7209, - 7209, - 6553, - 6553, - 5898, - 5898, - 32767, - 8192 -}; - -//Q15 -const Word16 ivas_param_mc_ild_fac_CICP19_3tc_fx[12] = -{ - 9830, - 9830, - 5570, - 5570, - 3932, - 3932, - 6226, - 6226, - 6226, - 6226, - 32767, - 16384 -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = -{ - 5, - 6, - {0,1,2,4,5,3}, - {1,1,2,1,1,2}, - {{0},{1},{0,1},{0},{1},{0,1}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP12_2tc = -{ - 7, - 8, - {0,1,2,4,5,6,7,3}, - {1,1,2,1,1,1,1,2}, - {{0},{1},{0,1},{0},{1},{0},{1},{0,1}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP12_3tc = -{ - 6, - 8, - {0,1,4,5,6,7,2,3}, - {1,1,1,1,1,1,1,1}, - {{0},{1},{0},{1},{0},{1},{2},{2}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP14_2tc = -{ - 7, - 8, - {0,1,2,4,5,6,7,3}, - {1,1,2,1,1,1,1,2}, - {{0},{1},{0,1},{0},{1},{0},{1},{0,1}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP14_3tc = -{ - 6, - 8, - {0,1,4,5,6,7,2,3}, - {1,1,1,1,1,1,1,1}, - {{0},{1},{0},{1},{0},{1},{2},{2}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP16_3tc = -{ - 8, - 10, - {0,1,4,5,6,7,8,9,2,3}, - {1,1,1,1,1,1,1,1,1,1}, - {{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} -}; - -const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = -{ - 10, - 12, - {0,1,4,5,6,7,8,9,10,11,2,3}, - {1,1,1,1,1,1,1,1,1,1,1,1}, - {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = -{ - 4, - 5, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 2, 3 }} /* C/LFE */ -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP12_2tc = -{ - 6, - 7, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 2, 6 }, /* C/BLS */ - { 2, 7 }, /* C/BRS */ - { 2, 3 } /* C/LFE */ - } -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP12_3tc = -{ - 6, - 7, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/BLS */ - { 1, 7 }, /* R/BRS */ - { 2, 3 } /* C/LFE */ - } -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP14_2tc = -{ - 6, - 7, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 2, 6 }, /* C/UFL */ - { 2, 7 }, /* C/UFR */ - { 2, 3 } /* C/LFE */ - } -}; -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP14_3tc = -{ - 6, - 7, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/UFL */ - { 1, 7 }, /* R/UFR */ - { 2, 3 } /* C/LFE */ - } -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP16_3tc = -{ - 8, - 9, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/UFL */ - { 1, 7 }, /* R/UFR */ - { 4, 8 }, /* LS/UBL */ - { 5, 9 }, /* RS/UBR */ - { 2, 3 } /* C/LFE */ - } -}; - -const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = -{ - 10, - 11, - { { 0, 4 }, /* L/LS */ - { 1, 5 }, /* R/RS */ - { 0, 2 }, /* L/C */ - { 1, 2 }, /* R/C */ - { 0, 6 }, /* L/LBS */ - { 1, 7 }, /* R/RBS */ - { 0, 8 }, /* L/UFL */ - { 1, 9 }, /* R/UFR */ - { 6, 10 }, /* LBS/UBL */ - { 7, 11 }, /* RBS/UBR */ - { 2, 3 } /* C/LFE */ - } -}; - -const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = -{ - /* CICP6 48000 */ - { - MC_LS_SETUP_5_1, - 6, - 2, - IVAS_48k, - &ivas_param_mc_ild_mapping_CICP6_2tc, - &ivas_param_mc_icc_mapping_CICP6_2tc, - &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] - }, - /* CICP6 64000 */ - { - MC_LS_SETUP_5_1, - 6, - 2, - IVAS_64k, - &ivas_param_mc_ild_mapping_CICP6_2tc, - &ivas_param_mc_icc_mapping_CICP6_2tc, - &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], - & ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] - }, - /* CICP6 80000 */ - { - MC_LS_SETUP_5_1, - 6, - 2, - IVAS_80k, - &ivas_param_mc_ild_mapping_CICP6_2tc, - &ivas_param_mc_icc_mapping_CICP6_2tc, - &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], - & ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] - }, - /* CICP12 48000 */ - { - MC_LS_SETUP_7_1, - 8, - 2, - IVAS_48k, - &ivas_param_mc_ild_mapping_CICP12_2tc, - &ivas_param_mc_icc_mapping_CICP12_2tc, - &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0] - }, - /* CICP12 64000 */ - { - MC_LS_SETUP_7_1, - 8, - 2, - IVAS_64k, - &ivas_param_mc_ild_mapping_CICP12_2tc, - &ivas_param_mc_icc_mapping_CICP12_2tc, - &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0] - }, - /* CICP12 80000 */ - { - MC_LS_SETUP_7_1, - 8, - 2, - IVAS_80k, - &ivas_param_mc_ild_mapping_CICP12_2tc, - &ivas_param_mc_icc_mapping_CICP12_2tc, - &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0], - }, - /* CICP12 96000 */ - { - MC_LS_SETUP_7_1, - 8, - 3, - IVAS_96k, - &ivas_param_mc_ild_mapping_CICP12_3tc, - &ivas_param_mc_icc_mapping_CICP12_3tc, - &ivas_param_mc_ild_fac_CICP12_3tc_fx[0], - &ivas_param_mc_dmx_fac_CICP12_3tc_fx[0] - }, - /* CICP14 48000 */ - { - MC_LS_SETUP_5_1_2, - 8, - 2, - IVAS_48k, - &ivas_param_mc_ild_mapping_CICP14_2tc, - &ivas_param_mc_icc_mapping_CICP14_2tc, - &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] - }, - /* CICP14 64000 */ - { - MC_LS_SETUP_5_1_2, - 8, - 2, - IVAS_64k, - &ivas_param_mc_ild_mapping_CICP14_2tc, - &ivas_param_mc_icc_mapping_CICP14_2tc, - &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] - }, - /* CICP14 80000 */ - { - MC_LS_SETUP_5_1_2, - 8, - 2, - IVAS_80k, - &ivas_param_mc_ild_mapping_CICP14_2tc, - &ivas_param_mc_icc_mapping_CICP14_2tc, - &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], - &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] - }, - /* CICP14 96000 */ - { - MC_LS_SETUP_5_1_2, - 8, - 3, - IVAS_96k, - &ivas_param_mc_ild_mapping_CICP14_3tc, - &ivas_param_mc_icc_mapping_CICP14_3tc, - &ivas_param_mc_ild_fac_CICP14_3tc_fx[0], - &ivas_param_mc_dmx_fac_CICP14_3tc_fx[0] - }, - /* CICP16 96000 */ - { - MC_LS_SETUP_5_1_4, - 10, - 3, - IVAS_96k, - &ivas_param_mc_ild_mapping_CICP16_3tc, - &ivas_param_mc_icc_mapping_CICP16_3tc, - &ivas_param_mc_ild_fac_CICP16_3tc_fx[0], - &ivas_param_mc_dmx_fac_CICP16_3tc_fx[0] - }, - /* CICP16 128000 */ - { - MC_LS_SETUP_5_1_4, - 10, - 3, - IVAS_128k, - &ivas_param_mc_ild_mapping_CICP16_3tc, - &ivas_param_mc_icc_mapping_CICP16_3tc, - &ivas_param_mc_ild_fac_CICP16_3tc_fx[0], - &ivas_param_mc_dmx_fac_CICP16_3tc_fx[0] - }, - /* CICP19 128000 */ - { - MC_LS_SETUP_7_1_4, - 12, - 3, - IVAS_128k, - &ivas_param_mc_ild_mapping_CICP19_3tc, - &ivas_param_mc_icc_mapping_CICP19_3tc, - &ivas_param_mc_ild_fac_CICP19_3tc_fx[0], - &ivas_param_mc_dmx_fac_CICP19_3tc_fx[0] - } -}; - - -/* Alphabet for delta coding for the ICCs in Parametric MC processing */ -const UWord16 ivas_param_mc_cum_freq_icc_cicp6_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = -{ - 0, 24, 224, 20873, 42384, 51699, 57122, 60572, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_cicp6_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 24, 200, 20649, 21511, 9315, 5423, 3450, 4963 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 0, 4, 9, 124, 447, 1311, 4453, 18116, 48636, 60573, 63692, 64746, 65327, 65531, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = -{ - 4, 5, 115, 323, 864, 3142, 13663, 30520, 11937, 3119, 1054, 581, 204, 3, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_cicp12_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = -{ - 0, 30, 848, 26611, 47846, 57358, 61679, 63237, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_cicp12_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 30, 818, 25763, 21235, 9512, 4321, 1558, 2298 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 0, 2, 7, 53, 243, 979, 3994, 16732, 49642, 61343, 64331, 65158, 65438, 65532, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = -{ - 2, 5, 46, 190, 736, 3015, 12738, 32910, 11701, 2988, 827, 280, 94, 2, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_cicp14_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = -{ - 0, 46, 826, 27798, 49552, 58447, 62046, 63284, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_cicp14_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER ]={ - 46, 780, 26972, 21754, 8895, 3599, 1238, 2251 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 0, 3, 8, 36, 172, 763, 3436, 15845, 50168, 62005, 64676, 65298, 65481, 65533, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp14_48_16bits[2* PARAM_MC_SZ_ICC_QUANTIZER - 1] = -{ - 3, 5, 28, 136, 591, 2673, 12409, 34323, 11837, 2671, 622, 183, 52, 1, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_combined_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = -{ - 0, 34, 552, 24717, 45819, 54772, 59054, 61166, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_combined_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 34, 518, 24165, 21102, 8953, 4282, 2112, 4369 -}; - -const UWord16 ivas_param_mc_cum_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = -{ - 0, 3, 7, 74, 304, 1009, 3870, 16502, 49834, 61384, 64217, 65020, 65369, 65531, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = -{ - 3, 4, 67, 230, 705, 2861, 12632, 33332, 11550, 2833, 803, 349, 162, 3, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_cicp6_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = -{ - 0, 1092, 5574, 8315, 10652, 13875, 19656, 27664, 36284, 47058, 56251, 62579, 65118, 65462, 65513, 65532, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_cicp6_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 1092, 4482, 2741, 2337, 3223, 5781, 8008, 8620, 10774, 9193, 6328, 2539, 344, 51, 19, 3 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 0, 1, 2, 3, 5, 38, 146, 352, 638, 997, 1559, 2323, 3570, 5859, 10556, 21075, 44682, 55617, 60408, 62739, 63833, 64443, 64809, 65074, 65279, 65400, 65484, 65531, 65532, 65533, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = -{ - 1, 1, 1, 2, 33, 108, 206, 286, 359, 562, 764, 1247, 2289, 4697, 10519, 23607, 10935, 4791, 2331, 1094, 610, 366, 265, 205, 121, 84, 47, 1, 1, 1, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_cicp12_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = -{ - 0, 967, 6335, 9941, 12837, 16652, 22416, 29814, 38807, 48497, 57184, 62661, 64916, 65466, 65514, 65530, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_cicp12_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 967, 5368, 3606, 2896, 3815, 5764, 7398, 8993, 9690, 8687, 5477, 2255, 550, 48, 16, 5 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 0, 1, 2, 3, 5, 18, 61, 149, 320, 592, 1083, 1793, 2974, 5257, 10133, 21274, 44342, 55891, 60895, 63174, 64244, 64793, 65100, 65287, 65406, 65477, 65517, 65531, 65532, 65533, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = -{ - 1, 1, 1, 2, 13, 43, 88, 171, 272, 491, 710, 1181, 2283, 4876, 11141, 23068, 11549, 5004, 2279, 1070, 549, 307, 187, 119, 71, 40, 14, 1, 1, 1, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_cicp14_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = -{ - 0, 229, 7068, 10910, 13856, 17467, 22629, 29174, 36906, 46558, 55579, 61802, 65222, 65505, 65527, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_cicp14_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 229, 6839, 3842, 2946, 3611, 5162, 6545, 7732, 9652, 9021, 6223, 3420, 283, 22, 7, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 0, 1, 2, 3, 4, 12, 56, 153, 278, 475, 856, 1430, 2489, 4723, 9580, 20685, 45423, 56274, 60948, 63097, 64128, 64679, 65002, 65208, 65348, 65445, 65517, 65531, 65532, 65533, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = -{ - 1, 1, 1, 1, 8, 44, 97, 125, 197, 381, 574, 1059, 2234, 4857, 11105, 24738, 10851, 4674, 2149, 1031, 551, 323, 206, 140, 97, 72, 14, 1, 1, 1, 1 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_combined_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS+1] = -{ - 0, 1453, 8326, 12221, 15164, 18764, 24177, 31297, 39520, 49154, 57135, 62460, 64821, 65468, 65514, 65530, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_combined_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 1453, 6873, 3895, 2943, 3600, 5413, 7120, 8223, 9634, 7981, 5325, 2361, 647, 46, 16, 5 -}; - -const UWord16 ivas_param_mc_cum_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = -{ - 0, 1, 2, 3, 5, 29, 98, 220, 414, 699, 1186, 1876, 3049, 5304, 10013, 20612, 45247, 56109, 60818, 63022, 64081, 64647, 64977, 65198, 65348, 65443, 65502, 65530, 65532, 65533, 65534, 65535 -}; - -const UWord16 ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = -{ - 1, 1, 1, 2, 24, 69, 122, 194, 285, 487, 690, 1173, 2255, 4709, 10599, 24635, 10862, 4709, 2204, 1059, 566, 330, 221, 150, 95, 59, 28, 2, 1, 1, 1 -}; - - -/*----------------------------------------------------------------------------------* - * MASA ROM tables - *----------------------------------------------------------------------------------*/ - - -#ifdef FIX_1121_MASA_DESCRIPTOR -const UWord8 ivasmasaFormatDescriptor[8] = -{ - 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */ -}; - -#endif -const Word64 diffuseness_reconstructions_hr_fx[HR_MASA_ER_LEVELS] = { /* Q62 */ - 0, - 65865144550293504, - 138485688541642752, - 239816680157478912, - 355502895585558528, - 485544334825881600, - 667940119734386688, - 902690250311073792, - 1225260573621485568, - 1635651089665622016, - 2011983133527769088, - 2354256705207926784, - 2741003323208368128, - 3172222987529093120, - 3693796119373938688, - 4305722718742904832, -}; - -const Word32 diffuseness_thresholds_hr_fx[HR_MASA_ER_LEVELS + 1] = { /* Q30 */ - 0, - 10223616, - 20447232, - 44040192, - 67633152, - 97910784, - 128188416, - 182845440, - 237502464, - 333053952, - 428605440, - 508297216, - 587988992, - 688390144, - 788791296, - 931266560, - MAX_32 /* out-of-range large value to make searching easier */ -}; - -const Word16 bits_direction_masa[DIRAC_DIFFUSE_LEVELS] = -{ - 11, - 11, - 10, - 9, - 7, - 6, - 5, - 3 -}; - - -const Word16 len_cb_dct0_masa[DIRAC_DIFFUSE_LEVELS] = { 7, 6, 5, 4, 4, 4, 3, 2 }; - -const UWord8 sur_coherence_cb_masa[MASA_MAX_NO_CV_SUR_COH*MASA_NO_CB_SUR_COH] = -{ - 16, 99, 0, 0, 0, 0, 0, 0, - 12, 64, 167, 0, 0, 0, 0, 0, - 10, 45, 100, 218, 0, 0, 0, 0, - 8, 34, 70, 124, 235, 0, 0, 0, - 7, 27, 55, 90, 141, 242, 0, 0, - 7, 23, 45, 71, 105, 153, 247, 0, - 6, 20, 38, 60, 86, 119, 165, 249 -}; - -const Word16 idx_cb_sur_coh_masa[MASA_MAX_NO_CV_SUR_COH] = { 0, 1, 2, 3, 4, 5, 5, 6 }; - -const Word16 len_huf_masa[MASA_NO_CV_COH1] = { 4, 2, 1, 3, 4 }; - -const Word16 huff_code_av_masa[MASA_NO_CV_COH1] = { 15, 2, 0, 6, 14 }; - -const Word16 no_theta_masa[NO_SPHERICAL_GRIDS-2] = /* from 1 to 11 bits */ -{ /*1, 1,*/ 2 ,2 , 4, 5, 6, 7, 10, 14, 19 - /*0, 2, 8, 6, 7, 12, 14, 16*/ -}; - -const Word16 no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = /* from 1 to 11 bits*/ -{ - { 2 }, - { 4 }, - { 4, 2 }, - { 8, 4 }, /* 8, 4*/ - { 12, 7, 2, 1 }, /* 12, */ - { 14, 13, 9, 2, 1 }, - { 22, 21, 17, 11, 3, 1 }, - { 33, 32, 29, 23, 17, 9, 1 }, - { 48, 47, 45, 41, 35, 28, 20, 12, 2, 1 }, - { 60, 60, 58, 56, 54, 50, 46, 41, 36, 30, 23, 17, 10, 1 }, - { 89, 89, 88, 86, 84, 81, 77, 73, 68, 63, 57, 51, 44, 38, 30, 23, 15, 8, 1 } -}; - -const Word16 MASA_band_grouping_24[24 + 1] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 40, 60 -}; - -const Word16 MASA_band_mapping_24_to_18[18 + 1] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 17, 20, 21, 22, 23, 24 -}; - -const Word16 MASA_band_mapping_24_to_12[12 + 1] = -{ - 0, 1, 2, 3, 4, 5, 7, 9, 12, 15, 20, 22, 24 -}; - -const Word16 MASA_band_mapping_24_to_8[8 + 1] = -{ - 0, 1, 2, 3, 5, 8, 12, 20, 24 -}; - -const Word16 MASA_band_mapping_24_to_5[5 + 1] = -{ - 0, 1, 3, 7, 15, 24 -}; - -const Word16 MASA_grouping_8_to_5[8] = -{ - 0, 1, 1, 2, 3, 3, 4, 4 -}; - -const Word16 MASA_grouping_12_to_5[12] = -{ - 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4 -}; - -const Word16 MASA_grouping_18_to_5[18] = -{ - 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 -}; - -const Word16 MASA_grouping_24_to_5[24] = -{ - 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 -}; - -/* IVAS_13k2, IVAS_16k4, IVAS_24k4, IVAS_32k, IVAS_48k, IVAS_64k, IVAS_80k, IVAS_96k, IVAS_128k, IVAS_160k, IVAS_192k, IVAS_256k, IVAS_384k, IVAS_512k */ -const Word16 masa_bits[IVAS_NUM_ACTIVE_BRATES] = -{ - 50, 60, 70, 85, 140, 180, 220, 256, 350, 432, 528, 832, 1024, MASA_MAX_BITS -}; - -const Word16 masa_bits_LR_stereo[4] = -{ - 50, 50, 60, 70 -}; - -const Word16 mcmasa_bits[IVAS_NUM_ACTIVE_BRATES] = -{ - 50, 70, 80, 120, 140, 160, 220, 256, 288, 432, 528, 832, 1024, MASA_MAX_BITS -}; - -const UWord8 masa_nbands[IVAS_NUM_ACTIVE_BRATES] = -{ - 5, 5, 5, 5, 5, 5, 5, 5, 8, 12, 18, 24, 24, 24 -}; - -const UWord8 masa_joined_nbands[IVAS_NUM_ACTIVE_BRATES] = -{ - 5, 5, 5, 8, 12, 12, 12, 18, 18, 18, 18, 24, 24, 24 -}; - -const UWord8 masa_twodir_bands[IVAS_NUM_ACTIVE_BRATES] = -{ - 0, 0, 0, 0, 0, 1, 1, 1, 3, 4, 6, 6, 9, 24 -}; - -const UWord8 masa_twodir_bands_joined[IVAS_NUM_ACTIVE_BRATES] = -{ - 0, 0, 0, 0, 0, 2, 2, 3, 4, 6, 8, 9, 12, MASA_MAXIMUM_TWO_DIR_BANDS -}; - - -/*----------------------------------------------------------------------------------* - * OMASA ROM tables - *----------------------------------------------------------------------------------*/ - -const Word32 sep_object_brate[][MAX_NUM_OBJECTS] = -{ - {0, 0, 0, 0}, /* 13k2 */ - {0, 0, 0, 0}, /* 16k4 */ - {9600, 0, 0, 0}, /* 24k4 */ - {IVAS_13k2, 0, 0, 0}, /* 32k */ - {16000, 11000, 0, 0}, /* 48k */ - {16000, 11700, 0, 0}, /* 64k */ - {20000, 16000, 0, 0}, /* 80k */ - {IVAS_32k, 20000, 20000, 0}, /* 96k */ - {IVAS_32k, IVAS_24k4, 24000, 24000}, /* 128k */ - {IVAS_48k, IVAS_32k, IVAS_24k4, 24000}, /* 160k */ - {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ - {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ - {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ - {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ -}; - -/* column wise DCT matrices for 4 5, and 8 dim */ -/*----------------------------------------------------------------------------------* - * Param ISM ROM tables - *----------------------------------------------------------------------------------*/ - -const Word16 Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1] = -{ - 0, 1, 2, 3, 4, 6, 8, 11, 15, 21, 31, 60 -}; - -/*----------------------------------------------------------------------------------* - * LFE coding ROM tables - *----------------------------------------------------------------------------------*/ - -const ivas_lfe_freq_models ivas_str_lfe_freq_models = -{ - { 16384, 14924, 13463, 12003, 10542, 9082, 7622, 6161, - 4701, 4336, 3970, 3605, 3240, 2875, 2510, 2145, - 1780, 1689, 1597, 1506, 1415, 1323, 1232, 1141, - 1050, 1004, 958, 913, 867, 821, 776, 730, - 685, 639, 593, 548, 502, 456, 411, 365, - 319, 297, 274, 251, 228, 205, 183, 160, - 137, 126, 114, 103, 91, 80, 68, 57, - 46, 40, 34, 29, 23, 17, 11, 6, 0 }, - - { 16384, 13463, 10542, 7622, 4701, 3970, 3240, 2510, - 1780, 1597, 1415, 1232, 1050, 958, 867, 776, - 685, 593, 502, 411, 319, 274, 228, 183, - 137, 114, 91, 68, 46, 34, 23, 11, 0 }, - - { 16384, 4701, 1780, 1050, 685, 319, 137, 46, - 0, }, - - { 16384, 3277, 0 }, - - { 16384, 13463, 10542, 7622, 4701, 3970, 3240, 2510, - 1780, 1597, 1415, 1232, 1050, 958, 867, 776, - 685, 593, 502, 411, 319, 274, 228, 183, - 137, 114, 91, 68, 46, 34, 23, 11, - 0 }, - - { 16384, 10542, 4701, 3240, 1780, 1415, 1050, 867, - 685, 502, 319, 228, 137, 91, 46, 23, - 0 }, - - { 16384, 4468, 1489, 745, 0 }, 0, -}; - -const Word16 ivas_lfe_num_ele_in_coder_models[2][4] = -{ - { 63, 31, 7, 1 },{ 31, 15, 3, 0 } -}; - -const Word16 ivas_lfe_log2_num_ele_in_coder_models_fx[2][4] = -{ - { 6, 5, 3, 1 },{ 5, 4, 2, 0 } -}; - -const Word16 ivas_lfe_num_dct_pass_bins_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP] = { 8, 6 }; - -const Word16 ivas_lfe_min_shift_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP] = { 1, 0 }; - -const Word16 ivas_lfe_lpf_delay_Q15[2] = { 57, 114 }; -#ifdef NONBE_FIX_MC_LFE_LPF -const Word32 ivas_lfe_lpf_delay_ns[2] = { 1750000, 3500000 }; -#endif - -const Word16 dirac_gains_P_idx[16] = -{ - -1, 1, 0, 1, 4, 3, 2, 3, 4, 8, 7, 6, 5, 6, 7, 8 -}; - -/*----------------------------------------------------------------------------------* - * FB ROM tables - *----------------------------------------------------------------------------------*/ - -const Word32 ivas_fb_fcs_12band_1ms_fx[IVAS_FB_BANDS_12] = -{ - 17895696, 53687092, 89478488, 125269880, - 161061280, 196852672, 232644064, 304226848, - 465288128, 715827904, 1091637520, 1735882615 -};/*Q31*/ - -const Word16 ivas_fb_abs_bins_per_band_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = -{ - { 24, 30, 30, 30, 30, 30, 42, 76, 124, 182, 291, 367 }, - { 24, 30, 30, 30, 30, 30, 42, 76, 124, 182, 260, 47 }, - { 24, 30, 30, 30, 30, 30, 42, 75, 122, 73, 0, 0 } -}; - -const Word16 ivas_fb_abs_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = -{ - {0, 9, 25, 41, 57, 73, 88, 110, 158, 246, 380, 593 }, - {0, 9, 25, 41, 57, 73, 88, 110, 158, 246, 380, 593 }, - {0, 9, 25, 41, 57, 73, 88, 110, 159, 247, 0, 0 } -}; - -const Word16 ivas_fb_bins_per_band_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = -{ - { - IVAS_FB_12_1MS_48K_END_BINS_BAND_0 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_0, - IVAS_FB_12_1MS_48K_END_BINS_BAND_1 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_48K_END_BINS_BAND_2 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_2, - IVAS_FB_12_1MS_48K_END_BINS_BAND_3 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_48K_END_BINS_BAND_4 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_4, - IVAS_FB_12_1MS_48K_END_BINS_BAND_5 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_48K_END_BINS_BAND_6 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_6, - IVAS_FB_12_1MS_48K_END_BINS_BAND_7 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_48K_END_BINS_BAND_8 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_8, - IVAS_FB_12_1MS_48K_END_BINS_BAND_9 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_48K_END_BINS_BAND_10 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_10, - IVAS_FB_12_1MS_48K_END_BINS_BAND_11 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_11 - }, - { - IVAS_FB_12_1MS_32K_END_BINS_BAND_0 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_0, - IVAS_FB_12_1MS_32K_END_BINS_BAND_1 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_32K_END_BINS_BAND_2 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_2, - IVAS_FB_12_1MS_32K_END_BINS_BAND_3 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_32K_END_BINS_BAND_4 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_4, - IVAS_FB_12_1MS_32K_END_BINS_BAND_5 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_32K_END_BINS_BAND_6 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_6, - IVAS_FB_12_1MS_32K_END_BINS_BAND_7 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_32K_END_BINS_BAND_8 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_8, - IVAS_FB_12_1MS_32K_END_BINS_BAND_9 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_32K_END_BINS_BAND_10 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_10, - IVAS_FB_12_1MS_32K_END_BINS_BAND_11 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_11 - }, - { - IVAS_FB_12_1MS_16K_END_BINS_BAND_0 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_0, - IVAS_FB_12_1MS_16K_END_BINS_BAND_1 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_16K_END_BINS_BAND_2 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_2, - IVAS_FB_12_1MS_16K_END_BINS_BAND_3 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_16K_END_BINS_BAND_4 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_4, - IVAS_FB_12_1MS_16K_END_BINS_BAND_5 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_16K_END_BINS_BAND_6 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_6, - IVAS_FB_12_1MS_16K_END_BINS_BAND_7 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_16K_END_BINS_BAND_8 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_8, - IVAS_FB_12_1MS_16K_END_BINS_BAND_9 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_16K_END_BINS_BAND_10 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_10, - IVAS_FB_12_1MS_16K_END_BINS_BAND_11 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_11 - }, -}; - -const Word16 ivas_fb_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = -{ - { - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_11 - }, - { - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_11 - }, - { - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_1, - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_3, - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_5, - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_7, - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_9, - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_11 - }, -}; - - -const Word16 ivas_num_active_bands[FB - WB + 1] = -{ - IVAS_16K_12BANDS_ACTIVE_BANDS, IVAS_FB_BANDS_12, IVAS_FB_BANDS_12 -}; - -/*------------------------------------------------------------------------------------------* - * SNS MSVQ codebooks and means - *------------------------------------------------------------------------------------------*/ - -const Word16 ivas_sns_cdbks_tcx20_levels[SNS_MSVQ_NSTAGES_TCX20] = { 128, 64, 32, 32 }; - -const Word16 ivas_sns_cdbks_tcx20_bits[SNS_MSVQ_NSTAGES_TCX20] = { 7, 6, 5, 5 }; - -/* pre-rounded codebook vectors for singed Q4.12 represantation */ - -const Word16 ivas_sns_cdbks_tcx10_levels[SNS_MSVQ_NSTAGES_TCX10] = { 128, 32, 8 }; - -const Word16 ivas_sns_cdbks_tcx10_bits[SNS_MSVQ_NSTAGES_TCX10] = { 7, 5, 3 }; - - -const Word16 ivas_sns_cdbks_side_tcx20_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 32 }; -const Word16 ivas_sns_cdbks_side_tcx20_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 5 }; -const Word16 ivas_sns_cdbks_side_tcx10_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 8 }; -const Word16 ivas_sns_cdbks_side_tcx10_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 3 }; - - -const Word16 sns_1st_cdbk[2][2][8 * 32] = -{ - { /* split 1 */ - { /* TCX 20 */ - -10900, -11064, -10637, -10471, -9051, -6381, -4688, -2438, - -2119, -5087, -6702, -8118, -7586, -6343, -4828, -3406, - 2004, -3443, -4289, -3757, -3234, -2952, -2313, -1781, - 1749, 5598, 3916, 732, -1472, -2964, -3275, -2332, - -11978, -14369, -5600, -545, 981, -929, -57, 1903, - 1745, 391, 202, 115, 256, -291, -862, -1637, - -4052, 2059, 4709, 6768, 5595, 1975, -1723, -1218, - 2093, 7263, 8679, 7576, 3701, -2438, -4389, -2686, - -7120, -6279, -5715, -5520, -4752, -3125, -1856, -438, - 8131, -2543, -6285, -6723, -5588, -4321, -3264, -2164, - -653, -1301, -660, 608, 1598, 1805, 1698, 760, - 4882, 9309, 6333, 1734, 284, 364, 560, 1015, - -7686, -5737, -3443, -1642, 245, 1531, 1827, 1769, - -1468, 3782, 144, -5130, -6883, -5165, -1497, 2072, - -12937, -8429, -2619, 2894, 5004, 4710, 4627, 3740, - 3198, 3928, 4358, 4554, 3887, 2844, 1299, 129, - -13828, -12296, -9364, -7918, -5571, -1909, 307, 2047, - -4314, -1211, -559, -1061, -1928, -2228, -2359, -1902, - -309, -3224, -3404, -1895, -743, -59, 757, 908, - 10914, 5865, 1599, -386, -1392, -2285, -2236, -2042, - -11825, -16241, -11402, -3627, 6556, 8953, 6421, 1546, - 6102, 777, -301, 536, 902, 541, 210, -429, - -3052, 3997, 5389, 1842, -344, 1556, 2667, 2428, - 11788, 10894, 7448, 5423, 2372, -677, -2385, -3839, - -45, -7602, -8923, -7179, -3273, 65, 4500, 6726, - 5895, 626, -1610, -2598, -3240, -3540, -2930, -2156, - -971, 461, 1494, 4907, 5859, 5199, 3678, 2502, - 10766, 5297, 1844, 1236, 2498, 3503, 2846, 838, - -7816, -1212, 891, 2387, 1317, 2225, 1859, 1602, - 2376, 5357, 2088, -2719, -3419, -420, 2431, 2943, - -8383, -795, 4351, 7026, 7460, 7191, 5262, 3796, - 1522, 6283, 8714, 8222, 7434, 5768, 3586, 1499, - }, - { /* TCX 10 */ - -15596, -16321, -10264, -1002, 5955, 5543, -29, -1688, - 17, -3794, -6207, -7356, -6998, -6081, -4453, -2448, - -12543, -11530, -10186, -8817, -7083, -4440, -1946, 892, - 5198, 2751, -274, -2574, -4561, -6087, -5944, -4600, - -683, -2640, -2753, -1195, -239, -217, -286, 90, - -1400, -1146, -1853, -2845, -3456, -3788, -3171, -1969, - -1835, 392, 1725, 1209, -392, -1640, -2001, -1608, - 5770, 7707, 5210, 2112, -382, -2088, -2634, -3007, - -10766, -8101, -5137, -3754, -1881, 331, 2339, 3679, - -2637, -4640, -5811, -5651, -3790, -1359, 913, 1893, - -7793, -4768, -1762, -545, -717, -837, -441, -75, - 4030, 1770, 467, 379, 10, -1330, -2398, -2290, - -9395, -6952, -2494, 2022, 4753, 5614, 4443, 2642, - -1486, 1748, 859, -2586, -3368, -638, 2761, 3269, - -2408, 306, 3633, 6567, 5950, 2474, -621, -1421, - 5478, 7986, 9498, 8165, 5477, 1244, -523, -1586, - -13564, -14673, -10597, -5504, 1575, 8248, 7662, 4025, - 4978, -682, -3586, -4305, -3703, -3001, -2227, -1278, - -8002, -6831, -5558, -4868, -4243, -3393, -2486, -1110, - 11485, 5472, 1645, -533, -1792, -2814, -3169, -2706, - 1617, 421, 232, 1382, 2162, 2017, 1318, 744, - 3677, 5212, 1990, -1514, -2894, -2441, -451, 592, - 731, 4295, 5860, 3756, 1991, 1437, 869, 127, - 12736, 11722, 7768, 4682, 1574, -744, -1989, -3131, - -3490, -4269, -3681, -1531, 1111, 3327, 4138, 3815, - 7344, 1400, -1302, -1502, -1015, 57, 1212, 1498, - -4836, -1881, 1071, 2055, 2114, 2465, 2093, 1458, - 8569, 5879, 3654, 2879, 2530, 1703, 781, -233, - -3709, -990, 2338, 6227, 7083, 7102, 5657, 3401, - 3389, 6392, 5267, 1011, 275, 3519, 5236, 4339, - 599, 3752, 6943, 9211, 8152, 5568, 3337, 1838, - 9885, 9591, 7905, 8068, 7929, 7421, 4234, 757, - } - }, - { /* split 2 */ - { /* TCX 20 */ - -178, -3476, -5982, -7081, -7548, -7440, -6859, -5798, - -3596, -3670, -1501, 770, 812, -286, -2001, -3377, - -3998, -5191, -4988, -4421, -3889, -3571, -2738, -1969, - -2981, -2687, -1501, -83, 1136, 2377, 3248, 4105, - 1842, -41, -1972, -4282, -6779, -8405, -8674, -7835, - -259, 571, 2124, 3344, 2959, 1407, -750, -2523, - -524, -1956, -2855, -3202, -3939, -4666, -4907, -4782, - -5110, -4768, -3017, -663, 4188, 9210, 16602, 21081, - 4373, 4846, -603, -6495, -7289, -5540, -4749, -5527, - -1448, -1043, -619, -105, 356, 362, 542, 857, - 1373, -752, -5334, -6244, -3001, -932, -1040, -3125, - -2403, -1397, 612, 2449, 3920, 5231, 6819, 8581, - 2183, 1211, -111, -1084, -2836, -4977, -6701, -7284, - -751, 1255, 3408, 6474, 7503, 7026, 5413, 4464, - 935, 850, 589, 353, 160, -434, -939, -931, - 268, 2284, 3884, 5423, 6680, 7996, 9244, 9472, - 1075, 113, -1289, -4457, -7512, -5930, -1799, -571, - -3689, -4254, -3755, -2995, -1581, -135, 1049, 1589, - -1166, -1752, -1790, -1897, -1927, -1831, -1359, -805, - -1494, -735, 635, 1993, 2909, 3546, 4226, 4956, - 4435, 4299, 4269, 1328, -3731, -7621, -9319, -9170, - 1358, 2227, 3873, 4469, 4692, 4057, 2601, 1608, - 813, 398, -499, -666, -1286, -2271, -3316, -4025, - -3300, -1255, 2181, 6431, 10002, 12760, 13549, 12584, - 3714, 4180, 484, -2905, -2864, -1359, -1256, -2477, - 308, 868, 1373, 1629, 1793, 1834, 1814, 1746, - 1472, 798, -282, -1935, -1818, 320, 2221, 2914, - 2281, 3240, 2988, 1400, 2383, 4072, 5667, 6675, - 2672, 2678, 2874, 2096, -226, -2301, -3861, -4534, - 4988, 7231, 7641, 7731, 7061, 6447, 5411, 3513, - 3978, 4156, 4126, 2896, 1469, 759, 368, -68, - -264, 4210, 8534, 11008, 11606, 11888, 11072, 8949, - }, - { /* TCX 10 */ - -2852, -6158, -7231, -7830, -8012, -7922, -7556, -6706, - -3911, -5340, -5053, -4741, -4805, -4484, -3727, -3037, - -966, -1461, -1694, -2427, -3081, -3037, -2547, -2230, - -3455, -3315, -2451, -836, 1383, 3196, 3720, 3379, - 3052, 281, -3351, -6866, -9051, -9586, -8983, -8236, - -748, -4465, -4314, -2251, 29, -40, -3963, -6195, - 200, 1293, 2535, 2803, 1603, -186, -1397, -1697, - -1707, -265, 2196, 5295, 5894, 4216, 3440, 3826, - -237, -2133, -2279, -3149, -4377, -5638, -6520, -6764, - -2407, -2049, -1246, -664, -521, -430, -349, -211, - 3874, 1335, -1501, -2055, -1268, -990, -1852, -2871, - -1883, -1845, -1681, -484, 384, 2035, 5839, 9597, - 275, 380, 1048, 424, -1146, -3012, -4431, -5104, - -1699, -484, 756, 1261, 1279, 1377, 1975, 2590, - 2139, 4502, 3645, 4975, 6491, 5972, 5012, 4346, - -3821, -2581, -433, 2667, 6436, 10038, 11311, 8783, - 2359, -2689, -6604, -7039, -5992, -4268, -3711, -4840, - -2776, -4251, -4539, -3672, -2494, -1055, 280, 695, - 491, 866, 822, -44, -1009, -1165, -831, -538, - -1024, 91, 786, 1295, 2433, 3910, 4975, 5403, - 3117, 2590, 2337, -667, -4580, -8147, -9400, -9523, - -103, -630, -831, 669, 3062, 3398, 549, -1690, - 2113, 3467, 4279, 5047, 5344, 3361, 127, -2313, - -1199, 1153, 2914, 3688, 4260, 5421, 7471, 8831, - 2815, 2184, 316, -3058, -5596, -5564, -4343, -3793, - 922, 126, -1414, -1731, -1007, 359, 2029, 3088, - 4889, 4619, 2537, 1114, 950, 946, 799, 419, - -4271, -3750, -3359, -484, 1448, 4106, 10487, 20479, - 3818, 4687, 4064, 2212, -172, -2287, -3535, -4041, - 884, 2456, 3394, 2925, 2182, 2323, 2583, 2507, - 4767, 8057, 8263, 6461, 5003, 4055, 2923, 1845, - 19, 3813, 6926, 8432, 10141, 10850, 9692, 8383, - } - } -}; - -const Word16 sns_1st_means_16k[2][16] = -{ - { /* TCX 20 */ - 14210, 19017, 14362, 9309, 5385, 2674, 1055, -211, -1407, -3059, -4393, -8597, -11180, -11756, -12131, -13281, - }, - { /* TCX 10*/ - 12018, 15915, 11089, 6015, 847, -705, -539, -1548, -893, -2163, -1806, -4189, -7017, -8670, -8874, -9480, - } -}; - -const Word16 sns_1st_means_25k6[2][16] = -{ - { /* TCX 20 */ - 14973, 20323, 16461, 9554, 4017, 3103, 1602, 1694, -221, -1401, -6817, -10071, -11503, -11805, -13158, -16749, - }, - { /* TCX 10 */ - 15560, 19489, 14623, 5595, 2084, 1699, 775, -1312, -2195, -6101, -9078, -9465, -7825, -6603, -7281, -9960, - } -}; - -const Word16 sns_1st_means_32k[2][16] = -{ - { /* TCX 20 */ - 15041, 20603, 16969, 10289, 4973, 4283, 3003, 3316, 1684, -259, -6614, -9535, -10363, -11834, -16625, -24930, - }, - { /* TCX 10 */ - 16510, 20660, 16025, 7224, 3921, 3868, 2623, 742, -1316, -6269, -8284, -7288, -6380, -8410, -13351, -20277, - } -}; - - -/*----------------------------------------------------------------------* - * MC ParamUpmix ROM tables - *-----------------------------------------------------------------------*/ - -const Word16 ivas_param_upmx_mx_qmap[33] = -{ - 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0 -}; - -/* clang-format on */ diff --git a/lib_com/ivas_rom_com.h b/lib_com/ivas_rom_com.h index 515293693..6260e1ba6 100644 --- a/lib_com/ivas_rom_com.h +++ b/lib_com/ivas_rom_com.h @@ -78,6 +78,29 @@ extern const UWord16 ECSQ_tab_inverse[1 + ECSQ_SEGMENT_SIZE]; /*----------------------------------------------------------------------------------* * Stereo ICA ROM tables *----------------------------------------------------------------------------------*/ + +extern const Word32 ica_sincInterp2_fx[]; // Q31 +extern const Word32 ica_sincInterp4_fx[]; // Q31 +extern const Word32 ica_sincInterp6_fx[]; // Q31 + +/*----------------------------------------------------------------------------------* + * Stereo IC-BWE ROM tables + *----------------------------------------------------------------------------------*/ + +extern const Word16 pow_10_icbwe_gsMapping_tbl_fx[]; +extern const Word16 pow_10_icbwe_gsMappingDFT_tbl_fx[]; + +extern const Word16 icbwe_gsMapping_tbl_fx[]; +extern const Word16 icbwe_gsMappingDFT_tbl_fx[]; + +/*----------------------------------------------------------------------------------* + * TD Stereo ROM tables + *----------------------------------------------------------------------------------*/ + +extern const UWord32 tdm_ratio_tabl_fx[TDM_NQ + 1]; +extern const Word32 tdm_ratio_tabl_fx_Q30[TDM_NQ + 1]; +extern const Word32 tdm_ratio_tabl_fx_Q24[TDM_NQ + 1]; +extern const UWord32 tdm_den_ratio_tabl_fx[]; extern const Word16 tdm_bit_allc_tbl[5][6]; /* LSFs Intra-frame prediction tables */ @@ -97,7 +120,6 @@ extern const Word16 tdm_LSF_MEAN_PRED_QNT_IN_fx[M]; extern const Word16 tdm_LSF_MEAN_PRED_QNT_fx[M]; extern const Word16 tdm_PRED_QNT_fixed_beta_prd_diag_3_fx[15 + 16 + 15]; - extern const Word16 fast_FCB_bits_2sfr[]; extern const Word16 fast_FCB_rates_2sfr[]; @@ -114,6 +136,7 @@ extern const MDCTStereoBands_config mdctStereoBands_32000_640[]; /*----------------------------------------------------------------------------------* * Stereo DTX ROM tables *----------------------------------------------------------------------------------*/ + extern const Word16 dft_cng_coh_pred_fx[][STEREO_DFT_COH_PRED_COEFFS]; extern const Word16 dft_cng_coh_u2i[9]; extern const Word16 dft_cng_coh_i2u[9]; @@ -123,6 +146,10 @@ extern const Word16 dft_cng_coh_alpha_start[STEREO_DFT_N_COH_ALPHA_STEPS - 1]; /*----------------------------------------------------------------------------------* * DirAC ROM tables *----------------------------------------------------------------------------------*/ + +extern const Word32 diffuseness_reconstructions_fx[DIRAC_DIFFUSE_LEVELS]; +extern const Word32 diffuseness_thresholds_fx[DIRAC_DIFFUSE_LEVELS + 1]; +extern const Masa_Diffuseness_Ratios masa_diffuse_ratios[DIRAC_DIFFUSE_LEVELS][DIRAC_DIFFUSE_LEVELS]; extern const Word16 DirAC_band_grouping_12[12 + 1]; extern const Word16 DirAC_band_grouping_6[6 + 1]; extern const Word16 DirAC_band_grouping_5[5 + 1]; @@ -131,6 +158,8 @@ extern const Word16 DirAC_block_grouping_5ms_MDFT[MAX_PARAM_SPATIAL_SUBFRAMES + extern const Word32 c_weights_fx[DIRAC_NO_FB_BANDS_MAX]; // Q30 +extern const Word16 ivas_divde_255[256]; + /*------------------------------------------------------------------------------------------* * SPAR ROM tables *------------------------------------------------------------------------------------------*/ @@ -153,6 +182,9 @@ extern const Word16 dtx_pr_real_q_levels[3][3]; extern const Word16 pr_pr_idx_pairs[3][3][2]; extern const Word16 pr_pd_idx_pairs[3][3][2]; +extern const Word32 dtx_pd_real_min_max_fx[2]; +extern const Word32 one_by_q_level[64]; + /*----------------------------------------------------------------------* * PCA ROM tables *-----------------------------------------------------------------------*/ @@ -162,7 +194,6 @@ extern const Word16 ivas_pca_offset_index2[2692]; extern const Word16 ivas_pca_offset_n2[IVAS_PCA_N1]; extern const Word16 ph1_q_n2_tbl[IVAS_PCA_N1][2]; - /*----------------------------------------------------------------------------------* * Parametric MC ROM tables *----------------------------------------------------------------------------------*/ @@ -220,6 +251,8 @@ extern const UWord16 ivas_param_mc_sym_freq_icc_combined_48_16bits[PARAM_MC_SZ_I extern const UWord16 ivas_param_mc_cum_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER]; extern const UWord16 ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1]; +extern const Word16 ivas_param_mc_quant_ild_5d1_48_fx[PARAM_MC_SZ_ILD_QUANTIZER_4BITS]; +extern const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER]; /*----------------------------------------------------------------------------------* * MASA ROM tables @@ -260,23 +293,86 @@ extern const UWord8 masa_twodir_bands_joined[]; extern const Word64 diffuseness_reconstructions_hr_fx[HR_MASA_ER_LEVELS]; extern const Word32 diffuseness_thresholds_hr_fx[HR_MASA_ER_LEVELS + 1]; +extern const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; +extern const Word32 azimuth_cb_fx[8]; +extern const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2]; +extern const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; +extern const Word32 coherence_cb0_masa_fx[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; +extern const Word16 coherence_cb1_masa_Q15[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */ +extern const Word32 coherence_cb1_masa_fx[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */ + +/* Multi-channel input and output setups */ +extern const Word16 ls_azimuth_CICP2_idx[2]; +extern const Word16 ls_elevation_CICP2_idx[2]; +extern const Word16 ls_azimuth_CICP6_idx[5]; +extern const Word16 ls_elevation_CICP6_idx[5]; +extern const Word16 ls_azimuth_CICP12_idx[7]; +extern const Word16 ls_elevation_CICP12_idx[7]; +extern const Word16 ls_azimuth_CICP14_idx[7]; +extern const Word16 ls_elevation_CICP14_idx[7]; +extern const Word16 ls_azimuth_CICP16_idx[9]; +extern const Word16 ls_elevation_CICP16_idx[9]; +extern const Word16 ls_azimuth_CICP19_idx[11]; +extern const Word16 ls_elevation_CICP19_idx[11]; + +extern const Word32 shoebox_sin_cos_tbl_fx[11][2]; + +extern const Word32 delta_phi_val[90]; +extern const Word32 inv_delta_phi_val[90]; +extern const Word32 dd_val[90]; +extern const Word32 cb_azi_chan_fx[]; // Q22 +extern const Word16 cb_azi_chan_16fx[]; // Q0 + +/* Multi-channel input and output setups */ +extern const Word32 ls_azimuth_CICP1_fx[1]; +extern const Word32 ls_elevation_CICP1_fx[1]; +extern const Word32 ls_azimuth_CICP2_fx[2]; +extern const Word32 ls_elevation_CICP2_fx[2]; +extern const Word32 ls_azimuth_CICP6_fx[5]; +extern const Word32 ls_elevation_CICP6_fx[5]; +extern const Word32 ls_azimuth_CICP12_fx[7]; +extern const Word32 ls_elevation_CICP12_fx[7]; +extern const Word32 ls_azimuth_CICP14_fx[7]; +extern const Word32 ls_elevation_CICP14_fx[7]; +extern const Word32 ls_azimuth_CICP16_fx[9]; +extern const Word32 ls_elevation_CICP16_fx[9]; +extern const Word32 ls_azimuth_CICP19_fx[11]; +extern const Word32 ls_elevation_CICP19_fx[11]; +extern const Word16 pow_10_q11[128]; +extern const Word32 pow_10_q23[14]; +extern const Word16 ivas_sin_az_fx[361]; +extern const Word16 ivas_sine_panning_tbl_fx[601]; +extern const Word16 ivas_tan_panning_gain_dirac_tbl_fx[601]; + +extern const UWord16 cum_n_for_id_th[122]; + +extern const Word16 gridEq_Table[NO_THETA16_MAX]; +extern const Word32 McMASA_LFEGain_vectors_fx[64]; /* Q25 */ + /*----------------------------------------------------------------------------------* * MASA and ISM (OMASA) combined format ROM tables *----------------------------------------------------------------------------------*/ extern const Word32 sep_object_brate[][MAX_NUM_OBJECTS]; +extern const Word32 dct4_fx[]; +extern const Word32 dct5_fx[]; +extern const Word32 dct8_fx[]; +extern const Word32 dct12_fx[]; + /*----------------------------------------------------------------------------------* * Param ISM ROM tables *----------------------------------------------------------------------------------*/ +extern const Word32 ism_azimuth_borders_fx[4]; +extern const Word32 ism_elevation_borders_fx[4]; + extern const Word16 Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1]; /*----------------------------------------------------------------------------------* * LFE coding ROM tables *----------------------------------------------------------------------------------*/ - extern const Word16 ivas_lfe_num_ele_in_coder_models[2][4]; extern const Word16 ivas_lfe_log2_num_ele_in_coder_models_fx[2][4]; extern const Word16 ivas_lfe_num_dct_pass_bins_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP]; @@ -289,6 +385,38 @@ extern const Word32 ivas_lfe_lpf_delay_ns[2]; extern const Word16 dirac_gains_P_idx[16]; +extern const Word32 ivas_lpf_4_butter_16k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; +extern const Word16 ivas_lpf_4_butter_16k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; +extern const Word32 ivas_lpf_4_butter_32k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; +extern const Word16 ivas_lpf_4_butter_32k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; +extern const Word32 ivas_lpf_4_butter_48k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; +extern const Word16 ivas_lpf_4_butter_48k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; +#ifndef NONBE_FIX_MC_LFE_LPF +extern const Word32 ivas_lpf_2_butter_16k_fx[IVAS_BIQUAD_FILT_LEN << 1]; +extern const Word32 ivas_lpf_2_butter_32k_fx[IVAS_BIQUAD_FILT_LEN << 1]; +extern const Word32 ivas_lpf_2_butter_48k_fx[IVAS_BIQUAD_FILT_LEN << 1]; +#endif + +extern const Word32 ivas_lfe_window_coeff_48k_fx[IVAS_LFE_FADE_LEN_48K]; // Q31 +extern const Word32 ivas_lfe_window_coeff_32k_fx[IVAS_LFE_FADE_LEN_32K]; // Q31 +extern const Word32 ivas_lfe_window_coeff_16k_fx[IVAS_LFE_FADE_LEN_16K]; // Q31 + +extern const UWord32 d_hamm_lfe_plc_fx[LFE_PLC_LENANA / 2]; + +/*------------------------------------------------------------------------------------------* + * MDFT/iMDFT ROM tables + *------------------------------------------------------------------------------------------*/ + +extern const Word32 ivas_mdft_coeff_cos_twid_240_fx[IVAS_240_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_160_fx[IVAS_160_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_120_fx[IVAS_120_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_80_fx[IVAS_80_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_40_fx[IVAS_40_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_960_fx[IVAS_960_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_640_fx[IVAS_640_PT_LEN + 1]; +extern const Word32 ivas_mdft_coeff_cos_twid_320_fx[IVAS_320_PT_LEN + 1]; +extern const Word32 dirac_gains_trg_term_fx[181][2]; + /*------------------------------------------------------------------------------------------* * FB ROM tables *------------------------------------------------------------------------------------------*/ @@ -300,9 +428,18 @@ extern const Word16 ivas_fb_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][ extern const Word16 ivas_fb_abs_bins_per_band_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12]; extern const Word16 ivas_fb_abs_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12]; - extern const Word16 ivas_num_active_bands[FB - WB + 1]; +extern const Word16 ivas_fb_cf_4ms_48k_fx[IVAS_FB_4MS_48K_SAMP]; +extern const Word16 ivas_fb_cf_1ms_48k_fx[IVAS_FB_1MS_48K_SAMP]; +extern const Word16 ivas_fb_cf_4ms_32k_fx[IVAS_FB_4MS_32K_SAMP]; +extern const Word16 ivas_fb_cf_1ms_32k_fx[IVAS_FB_1MS_32K_SAMP]; +extern const Word16 ivas_fb_cf_4ms_16k_fx[IVAS_FB_4MS_16K_SAMP]; +extern const Word16 ivas_fb_cf_1ms_16k_fx[IVAS_FB_1MS_16K_SAMP]; + +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]; + /*------------------------------------------------------------------------------------------* * SNS MSVQ codebooks and means *------------------------------------------------------------------------------------------*/ @@ -313,19 +450,22 @@ extern const Word16 ivas_sns_cdbks_tcx20_bits[]; extern const Word16 ivas_sns_cdbks_tcx10_levels[]; extern const Word16 ivas_sns_cdbks_tcx10_bits[]; - extern const Word16 ivas_sns_cdbks_side_tcx20_levels[]; extern const Word16 ivas_sns_cdbks_side_tcx20_bits[]; extern const Word16 ivas_sns_cdbks_side_tcx10_levels[]; extern const Word16 ivas_sns_cdbks_side_tcx10_bits[]; - /* means and codebooks for the split VQ in the 2-stage SNS VQ */ extern const Word16 sns_1st_cdbk[2][2][8 * 32]; extern const Word16 sns_1st_means_16k[2][16]; extern const Word16 sns_1st_means_25k6[2][16]; extern const Word16 sns_1st_means_32k[2][16]; +extern const Word16 *const ivas_sns_cdbks_tcx20_fx[]; +extern const Word16 *const ivas_sns_cdbks_tcx10_fx[]; + +extern const Word16 *const ivas_sns_cdbks_side_tcx20_fx[]; +extern const Word16 *const ivas_sns_cdbks_side_tcx10_fx[]; /*----------------------------------------------------------------------* * MC ParamUpmix ROM tables @@ -333,6 +473,45 @@ extern const Word16 sns_1st_means_32k[2][16]; extern const Word16 ivas_param_upmx_mx_qmap[33]; +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]; + +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_del_32_fx[577]; +extern const Word32 ivas_sine_frame_len_640_del_16_fx[289]; + +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]; + +/*----------------------------------------------------------------------* + * Limiter tables + *-----------------------------------------------------------------------*/ + +extern const Word32 release_cnst_table[4][201]; // Q31 + +/*----------------------------------------------------------------------* + * MDCT/IMDCT tables + *-----------------------------------------------------------------------*/ + +extern const Word16 ivas_sin_twiddle_480_fx[IVAS_480_PT_LEN >> 1]; +extern const Word16 ivas_cos_twiddle_480_fx[IVAS_480_PT_LEN >> 1]; +extern const Word16 ivas_sin_twiddle_320_fx[IVAS_320_PT_LEN >> 1]; +extern const Word16 ivas_cos_twiddle_320_fx[IVAS_320_PT_LEN >> 1]; +extern const Word16 ivas_sin_twiddle_160_fx[IVAS_160_PT_LEN >> 1]; +extern const Word16 ivas_cos_twiddle_160_fx[IVAS_160_PT_LEN >> 1]; +extern const Word16 ivas_sin_twiddle_80_fx[IVAS_80_PT_LEN >> 1]; +extern const Word16 ivas_cos_twiddle_80_fx[IVAS_80_PT_LEN >> 1]; +extern const Word16 nf_tw_smoothing_coeffs_fx[N_LTP_GAIN_MEMS]; +extern const Word32 dft_res_gains_q_fx[][2]; +extern const Word16 dft_res_cod_alpha_fx[STEREO_DFT_BAND_MAX]; +extern const Word16 dft_trigo_12k8_fx[STEREO_DFT_N_12k8_ENC / 4 + 1]; +extern const Word16 dft_trigo_32k_fx[STEREO_DFT_N_32k_ENC / 4 + 1]; +extern const Word16 dft_trigo_48k_fx[STEREO_DFT_N_MAX_ENC / 4 + 1]; /* IVAS_ROM_COM_H */ #endif diff --git a/lib_com/ivas_rom_com_fx.c b/lib_com/ivas_rom_com_fx.c index 1f51c6a6b..bdeab2b8c 100644 --- a/lib_com/ivas_rom_com_fx.c +++ b/lib_com/ivas_rom_com_fx.c @@ -35,12 +35,2891 @@ #include #include "cnst.h" #include "ivas_cnst.h" -#include "ivas_rom_com_fx.h" +#include "ivas_rom_com.h" #include "wmc_auto.h" +/* clang-format off */ + +/*----------------------------------------------------------------------------------* + * Table of IVAS bitrates + *----------------------------------------------------------------------------------*/ + +const Word32 ivas_brate_tbl[SIZE_IVAS_BRATE_TBL] = +{ + FRAME_NO_DATA, IVAS_SID_5k2, + IVAS_13k2, IVAS_16k4, IVAS_24k4, IVAS_32k, IVAS_48k, + IVAS_64k, IVAS_80k, IVAS_96k, IVAS_128k, IVAS_160k, + IVAS_192k, IVAS_256k, IVAS_384k, IVAS_512k +}; + +/*------------------------------------------------------------------------- + * DFT Stereo ROM tables + *------------------------------------------------------------------------*/ + +/*4xERB scale: max of 14 bands*/ +const Word16 dft_band_limits_erb4[STEREO_DFT_ERB4_BANDS] = +{ + 1, 3, 5, 10, 18, 26, 41, 56, 84, 132, 214, 342, 470, 601 +}; + +/*8xERB scale: max of 8 bands*/ +const Word16 dft_band_limits_erb8[STEREO_DFT_ERB8_BANDS] = +{ + 1, 5, 18, 41, 84, 214, 470, 601 +}; + + +const Word16 dft_band_ipd[3][4] = +{ + {0,8,10,13}, + {0,5,6,8}, + {0,2,3,4} +}; + +const Word16 dft_band_res_cod[3][4] = +{ + {0,8,10,11}, + {0,5,6,7}, + {0,5,6,7} +}; + +// Q31 +const Word32 dft_res_gains_q_Q31[][2] = +{ + /* quantization points for joint quantization of prediction gain and residual energy */ + + /* column 1 (|ILD| = 0): */ + {0, 0 }, + {0, 251216928 }, + {0, 487459456 }, + {0, 731632640 }, + {0, 997611392 }, + {0, 1299397248 }, + {0, 1666984192 }, + {0, 2147483647 }, + + /* column 2 (|ILD| = 2): */ + {246151024, 0 }, + {249475328, 247871152 }, + {258660112, 480729248 }, + {274304544, 720918848 }, + {298427200, 981720000 }, + {334663840, 1276185088 }, + {391374592, 1632160640 }, + {485919712, 2091786496 }, + + /* column 3 (|ILD| = 4): */ + {485919712, 0 }, + {492224736, 238188144 }, + {509610752, 461283776 }, + {539117184, 690072384 }, + {584326016, 936189056 }, + {651608832, 1210182144 }, + {755411712, 1534299776 }, + {924504576, 1938292992 }, + + /* column 4 (|ILD| = 6): */ + {713563712, 0 }, + {722237376, 223142880 }, + {746085184, 431184640 }, + {786311872, 642617280 }, + {847364864, 866812416 }, + {936938496, 1111020032 }, + {1072199936, 1390431232 }, + {1285225984, 1720430720 }, + + /* column 5 (|ILD| = 8): */ + {924504576, 0 }, + {934784576, 204139792 }, + {962942400, 393358880 }, + {1010083968, 583482048 }, + {1080789888, 781462848 }, + {1182728704, 991308544 }, + {1332741248, 1221608960 }, + {1559902080, 1475937536 }, + + /* column 6 (|ILD| = 10): */ + {1115604864, 0 }, + {1126709504, 182744416 }, + {1156997632, 351025536 }, + {1207276672, 517958016 }, + {1281710592, 688294272 }, + {1387005952, 863412992 }, + {1537761536, 1046870336 }, + {1757032448, 1234717184 }, + + /* column 7 (|ILD| = 13): */ + {1361843968, 0 }, + {1372924928, 149366080 }, + {1402942464, 285507936 }, + {1452130560, 417893888 }, + {1523515136, 548787328 }, + {1621670144, 677135936 }, + {1756740352, 802203264 }, + {1942499840, 915633344 }, + + /* column 8 (|ILD| = 16): */ + {1559902080, 0 }, + {1569913600, 117815248 }, + {1596862336, 224162928 }, + {1640492800, 325650848 }, + {1702660352, 423060736 }, + {1785997696, 514412544 }, + {1896788608, 597466432 }, + {2042241920, 664027712 }, + + /* column 9 (|ILD| = 19): */ + {1714196608, 0 }, + {1722634112, 90359672 }, + {1745223424, 171238192 }, + {1781415040, 247171072 }, + {1832190080, 318199104 }, + {1898830848, 382271424 }, + {1984989952, 437025792 }, + {2094086528, 475912448 }, + + /* column 10 (|ILD| = 22): */ + {1831427712, 0 }, + {1838194432, 67828272 }, + {1856228992, 128123168 }, + {1884882944, 183977072 }, + {1924581248, 235132272 }, + {1975822336, 279821408 }, + {2040659200, 316058048 }, + {2120554240, 339023232 }, + + /* column 11 (|ILD| = 25): */ + {1918819584, 0 }, + {1924055168, 50102940 }, + {1937964416, 94399088 }, + {1959916032, 135003712 }, + {1990038784, 171579648 }, + {2028424960, 202728896 }, + {2076217216, 226931040 }, + {2133943808, 240762976 }, + + /* column 12 (|ILD| = 30): */ + {2015827840, 0 }, + {2019068416, 29502130 }, + {2027636864, 55420112 }, + {2041056512, 78889960 }, + {2059271424, 99626064 }, + {2082150784, 116769424 }, + {2110128128, 129415952 }, + {2143192960, 135682304 }, + + /* column 13 (|ILD| = 35): */ + {2072441984, 0 }, + {2074364032, 17033840 }, + {2079438464, 31939524 }, + {2087347712, 45337676 }, + {2098012032, 57039312 }, + {2111296384, 66537632 }, + {2127368192, 73321536 }, + {2146126464, 76351632 }, + + /* column 14 (|ILD| = 40): */ + {2104959232, 0 }, + {2106073728, 9723806 }, + {2109011456, 18212808 }, + {2113579136, 25810606 }, + {2119712384, 32401234 }, + {2127314432, 37692632 }, + {2136458496, 41399188 }, + {2147054208, 42945376 }, + + /* column 15 (|ILD| = 45): */ + {2123466240, 0 }, + {2124103936, 5514738 }, + {2125783296, 10322954 }, + {2128390400, 14615774 }, + {2131882240, 18322330 }, + {2136200832, 21283710 }, + {2141376256, 23332410 }, + {2147348352, 24150602 }, + + /* column 16 (|ILD| = 50): */ + {2133943808, 0 }, + {2134306688, 3115998 }, + {2135260160, 5830418 }, + {2136737664, 8250632 }, + {2138715520, 10335839 }, + {2141157120, 11995844 }, + {2144077696, 13136157 }, + {2147440640, 13580687 } +}; + + +/* tables for adaptive Golomb-Rice coding of DFT stereo parameters */ +const Word16 dft_code_itd[] = +{ + 0, 3, 4, 13, 8, 9, 12, 5, 10, 44, 23, 60, 45, 31, 235, 59, 28, 61, 234, 116 +}; + +const Word16 dft_len_itd[] = +{ + 2, 3, 4, 4, 4, 4, 4, 4, 4, 6, 5, 6, 6, 5, 8, 6, 5, 6, 8, 7 +}; + +const Word16 dft_maps_rpg[] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, + 2, 0, 1, 3, 4, 5, 6, 7, + 6, 2, 0, 1, 3, 4, 5, 7, + 7, 5, 2, 0, 1, 3, 4, 6, + 7, 6, 4, 3, 1, 0, 2, 5, + 7, 6, 5, 3, 2, 1, 0, 4, + 7, 6, 5, 4, 3, 2, 0, 1, + 7, 6, 5, 4, 3, 2, 0, 1, + 6, 5, 4, 3, 1, 0, 2, 7, +}; + +const Word16 dft_maps_sg[NO_SYMB_GR_SIDE_G * NO_SYMB_GR_SIDE_G] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 15, 4, 0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 12, 9, 4, 1, 0, 2, 3, 5, 6, 7, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 16, 14, 8, 4, 2, 0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 18, 16, 14, 10, 5, 0, 1, 2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 21, 19, 17, 15, 8, 4, 2, 0, 1, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 21, 19, 17, 15, 12, 8, 4, 0, 1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 21, 19, 17, 15, 13, 11, 9, 3, 0, 1, 2, 4, 5, 6, 7, 8, 10, 12, 14, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 24, 22, 20, 18, 16, 14, 12, 9, 6, 0, 1, 2, 3, 4, 5, 7, 8, 10, 11, 13, 15, 17, 19, 21, 23, 25, 26, 27, 28, 29, 30, + 25, 23, 21, 19, 17, 15, 13, 11, 9, 6, 0, 1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 27, 28, 29, 30, + 27, 25, 23, 21, 19, 17, 15, 13, 11, 8, 5, 0, 1, 2, 3, 4, 6, 7, 9, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 29, 30, + 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 1, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 28, 29, 30, + 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 30, + 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, + 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 1, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, + 30, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, + 30, 29, 28, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 0, 1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, + 30, 29, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 9, 7, 6, 4, 3, 2, 1, 0, 5, 8, 11, 13, 15, 17, 19, 21, 23, 25, 27, + 30, 29, 28, 27, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 7, 5, 4, 3, 2, 1, 0, 6, 9, 11, 13, 15, 17, 19, 21, 23, 25, + 30, 29, 28, 27, 26, 25, 23, 21, 19, 17, 15, 13, 11, 10, 8, 7, 5, 4, 3, 2, 1, 0, 6, 9, 12, 14, 16, 18, 20, 22, 24, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 12, 10, 8, 7, 6, 5, 4, 2, 1, 0, 3, 9, 11, 13, 15, 17, 19, 21, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 13, 11, 10, 9, 7, 6, 5, 3, 2, 1, 0, 4, 8, 12, 15, 17, 19, 21, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 20, 18, 16, 14, 13, 12, 11, 10, 9, 7, 6, 5, 3, 1, 0, 2, 4, 8, 15, 17, 19, 21, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 17, 15, 13, 12, 11, 9, 8, 7, 6, 4, 3, 2, 1, 0, 5, 10, 14, 16, 18, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 15, 13, 12, 11, 10, 9, 7, 6, 5, 3, 1, 0, 2, 4, 8, 14, 16, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 11, 10, 8, 7, 6, 5, 3, 2, 0, 1, 4, 9, 12, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 3, 2, 1, 0, 4, 15, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 0, 1, + 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 +}; + + +/*------------------------------------------------------------------------- + * Range Coder ROM tables + *------------------------------------------------------------------------*/ + +/* Create separate tables for cumulative frequency and symbol frequency */ +const UWord16 cum_freq_ari_pk_s17_LC_ext[RANGE_N_CONTEXT][1 + RANGE_N_SYMBOLS] = +{ + { 0,16,47,153,241,269,325,468,591,674,798,912,1017,1082,1183,1277,1364,16384 }, + { 0,7401,7844,7886,7899,12065,12718,12790,12805,14099,14476,14533,14549,15058,15264,15299,15310,16384 }, + { 0,4362,6345,6864,7038,9037,11049,11736,12002,12569,13301,13656,13822,14021,14334,14515,14607,16384 }, + { 0,2955,5183,5822,6013,8153,10671,11614,11943,12586,13540,14025,14232,14437,14770,14978,15080,16384 }, + { 0,3155,4981,5615,5855,7969,9953,10739,11073,11936,12837,13208,13383,13767,14203,14400,14498,16384 }, + { 0,1216,2630,3264,3558,4831,6679,7661,8157,8709,9622,10204,10542,10799,11243,11568,11777,16384 }, + { 0,1759,3641,4350,4612,6325,8678,9732,10161,10790,11790,12361,12642,12883,13295,13566,13720,16384 }, + { 0,1109,2705,3433,3732,5226,7532,8732,9263,9978,11142,11842,12188,12490,12986,13321,13520,16384 }, + { 0,11524,13046,13170,13191,14956,15708,15813,15837,16028,16162,16195,16204,16245,16282,16295,16300,16384 }, + { 0,8027,10586,10909,10974,13291,14861,15157,15232,15535,15824,15914,15943,16014,16090,16123,16136,16384 }, + { 0,834,2034,2674,2997,4087,5843,6891,7455,8030,9013,9688,10085,10376,10893,11277,11528,16384 }, + { 0,6038,9086,9451,9519,12332,14521,14913,15003,15329,15711,15848,15893,15955,16045,16091,16111,16384 }, + { 0,4732,7685,8354,8545,10717,12924,13618,13852,14291,14842,15083,15181,15314,15491,15582,15625,16384 }, + { 0,745,1783,2347,2655,3537,4963,5864,6406,6863,7664,8248,8634,8891,9351,9708,9958,16384 }, + { 0,3957,6794,7669,7998,9743,11676,12498,12869,13313,13894,14186,14332,14498,14714,14835,14906,16384 }, + { 0,2779,5388,6021,6201,8582,11352,12260,12544,13117,13981,14408,14580,14751,15039,15213,15298,16384 }, + { 0,448,1160,1625,1920,2576,3706,4518,5053,5474,6234,6835,7262,7531,8032,8446,8758,16384 }, + { 0,1,2,1555,2246,2247,2248,3489,4112,5449,6596,7302,7710,8311,8876,9266,9517,16384 }, + { 0,2496,4910,5544,5722,8049,10799,11689,11973,12583,13467,13878,14047,14234,14537,14712,14803,16384 }, + { 0,921,2222,2880,3188,4407,6321,7406,7955,8573,9616,10296,10679,10978,11502,11880,12118,16384 }, + { 0,2620,4443,5017,5233,7072,9213,10083,10441,11049,11954,12442,12676,12918,13310,13565,13705,16384 }, + { 0,11205,13084,13178,13187,15164,16010,16081,16091,16213,16303,16321,16325,16340,16355,16360,16362,16384 }, + { 0,358,916,1288,1542,2055,2937,3594,4062,4399,5017,5524,5907,6136,6573,6941,7236,16384 }, + { 0,3575,5093,5536,5735,7408,9185,9878,10188,10727,11497,11933,12165,12410,12794,13019,13166,16384 }, + { 0,1,2,640,1036,1037,1038,1670,2096,2696,3287,3732,4056,4417,4800,5106,5339,16384 }, + { 0,969,1397,1518,1578,2633,3338,3566,3675,4197,4664,4857,4957,5288,5625,5783,5874,16384 }, + { 0,10458,12104,12294,12331,14246,15264,15437,15481,15752,15971,16031,16050,16120,16186,16210,16218,16384 }, + { 0,7178,9744,10039,10093,12701,14612,14961,15042,15360,15732,15869,15917,15978,16070,16117,16139,16384 }, + { 0,1298,2418,2879,3113,4146,5509,6227,6621,7053,7755,8229,8539,8776,9186,9492,9714,16384 }, + { 0,4957,7785,8252,8357,10978,13372,13955,14114,14561,15140,15378,15464,15570,15730,15820,15860,16384 }, + { 0,4823,8164,8570,8647,11604,14169,14653,14763,15105,15554,15727,15785,15852,15960,16018,16045,16384 }, + { 0,4735,7010,7517,7660,9986,12230,12914,13131,13666,14374,14689,14814,14972,15212,15342,15404,16384 }, + { 0,3363,5881,6658,6941,8864,11113,12015,12368,12889,13643,14019,14203,14394,14665,14823,14906,16384 }, + { 0,2569,4996,5779,6068,7917,10251,11209,11602,12129,12918,13321,13520,13696,13976,14155,14259,16384 }, + { 0,209,577,848,1046,1378,1982,2465,2835,3072,3513,3893,4202,4374,4703,4994,5241,16384 }, + { 0,2074,4337,5048,5274,7319,10003,11066,11446,12105,13112,13652,13885,14100,14464,14691,14810,16384 }, + { 0,1619,3560,4288,4550,6381,8955,10102,10543,11239,12362,12982,13261,13516,13958,14234,14381,16384 }, + { 0,89,257,441,582,734,1024,1325,1568,1716,1983,2222,2430,2545,2750,2941,3109,16384 }, + { 0,2202,3563,4044,4264,5686,7344,8100,8476,9006,9835,10331,10612,10864,11304,11599,11787,16384 }, + { 0,1220,2801,3492,3784,5223,7387,8496,8998,9640,10711,11369,11711,11993,12486,12829,13035,16384 }, + { 0,12626,13813,13903,13917,15396,15906,15972,15987,16139,16230,16251,16257,16289,16315,16323,16326,16384 }, + { 0,1579,3191,3831,4099,5678,7788,8761,9206,9842,10821,11388,11681,11958,12417,12722,12902,16384 }, + { 0,597,1514,2064,2379,3237,4679,5637,6213,6733,7649,8316,8755,9052,9599,10023,10323,16384 }, + { 0,9273,11762,12080,12151,14038,15210,15446,15514,15725,15929,15995,16019,16068,16124,16148,16158,16384 }, + { 0,9238,11681,11852,11872,14306,15644,15801,15828,16013,16183,16231,16243,16266,16297,16312,16318,16384 }, + { 0,6791,9200,9531,9594,12240,14178,14552,14639,15064,15506,15643,15687,15785,15908,15960,15983,16384 }, + { 0,7175,10415,10905,11033,13038,14621,15002,15123,15367,15651,15762,15806,15864,15938,15974,15992,16384 }, + { 0,5060,7703,8132,8225,10934,13270,13778,13911,14397,14972,15173,15242,15367,15537,15619,15654,16384 }, + { 0,3721,6311,6857,6992,9557,12180,12895,13098,13671,14418,14718,14830,14984,15212,15333,15390,16384 }, + { 0,5971,9288,10044,10269,11991,13680,14228,14437,14750,15130,15293,15374,15459,15579,15642,15677,16384 }, + { 0,3047,5311,5907,6078,8339,10850,11679,11946,12580,13442,13854,14024,14220,14534,14716,14810,16384 }, + { 0,2061,4280,4993,5228,7201,9735,10735,11097,11708,12606,13082,13295,13498,13836,14043,14161,16384 }, + { 0,4738,7949,8880,9234,10781,12502,13214,13531,13897,14355,14593,14718,14835,14998,15096,15153,16384 }, + { 0,3237,5045,5632,5860,7609,9702,10608,10986,11571,12476,12978,13230,13451,13830,14074,14208,16384 }, + { 0,1833,3889,4677,5028,6422,8379,9378,9884,10350,11086,11545,11809,12003,12327,12559,12711,16384 }, + { 0,3989,6858,7352,7459,10254,12936,13571,13735,14240,14895,15153,15242,15364,15548,15646,15690,16384 }, + { 0,1463,3197,3909,4220,5626,7609,8632,9127,9657,10520,11078,11380,11607,11991,12265,12442,16384 }, + { 0,14233,15083,15108,15110,16069,16300,16314,16316,16352,16370,16373,16374,16377,16380,16381,16382,16384 }, + { 0,1,2,2610,3293,3294,3295,5097,5671,8467,10332,11119,11437,12223,12850,13185,13345,16384 }, + { 0,2010,4053,4696,4910,6879,9391,10386,10750,11393,12376,12886,13119,13348,13726,13967,14099,16384 }, + { 0,7586,10517,10758,10791,13543,15346,15577,15619,15846,16082,16150,16169,16202,16245,16265,16273,16384 }, + { 0,3059,5772,6369,6524,9041,11801,12582,12813,13361,14115,14439,14567,14714,14944,15075,15141,16384 }, + { 0,8643,10594,10813,10856,13274,14686,14920,14975,15350,15680,15771,15799,15897,16003,16042,16057,16384 }, + { 0,6720,8878,9325,9467,11564,13248,13744,13929,14384,14880,15087,15167,15311,15488,15569,15607,16384 }, +}; + +const UWord16 sym_freq_ari_pk_s17_LC_ext[RANGE_N_CONTEXT][RANGE_N_SYMBOLS] = +{ + { 16,31,106,88,28,56,143,123,83,124,114,105,65,101,94,87,15020 }, + { 7401,443,42,13,4166,653,72,15,1294,377,57,16,509,206,35,11,1074 }, + { 4362,1983,519,174,1999,2012,687,266,567,732,355,166,199,313,181,92,1777 }, + { 2955,2228,639,191,2140,2518,943,329,643,954,485,207,205,333,208,102,1304 }, + { 3155,1826,634,240,2114,1984,786,334,863,901,371,175,384,436,197,98,1886 }, + { 1216,1414,634,294,1273,1848,982,496,552,913,582,338,257,444,325,209,4607 }, + { 1759,1882,709,262,1713,2353,1054,429,629,1000,571,281,241,412,271,154,2664 }, + { 1109,1596,728,299,1494,2306,1200,531,715,1164,700,346,302,496,335,199,2864 }, + { 11524,1522,124,21,1765,752,105,24,191,134,33,9,41,37,13,5,84 }, + { 8027,2559,323,65,2317,1570,296,75,303,289,90,29,71,76,33,13,248 }, + { 834,1200,640,323,1090,1756,1048,564,575,983,675,397,291,517,384,251,4856 }, + { 6038,3048,365,68,2813,2189,392,90,326,382,137,45,62,90,46,20,273 }, + { 4732,2953,669,191,2172,2207,694,234,439,551,241,98,133,177,91,43,759 }, + { 745,1038,564,308,882,1426,901,542,457,801,584,386,257,460,357,250,6426 }, + { 3957,2837,875,329,1745,1933,822,371,444,581,292,146,166,216,121,71,1478 }, + { 2779,2609,633,180,2381,2770,908,284,573,864,427,172,171,288,174,85,1086 }, + { 448,712,465,295,656,1130,812,535,421,760,601,427,269,501,414,312,7626 }, + { 1,1,1553,691,1,1,1241,623,1337,1147,706,408,601,565,390,251,6867 }, + { 2496,2414,634,178,2327,2750,890,284,610,884,411,169,187,303,175,91,1581 }, + { 921,1301,658,308,1219,1914,1085,549,618,1043,680,383,299,524,378,238,4266 }, + { 2620,1823,574,216,1839,2141,870,358,608,905,488,234,242,392,255,140,2679 }, + { 11205,1879,94,9,1977,846,71,10,122,90,18,4,15,15,5,2,22 }, + { 358,558,372,254,513,882,657,468,337,618,507,383,229,437,368,295,9148 }, + { 3575,1518,443,199,1673,1777,693,310,539,770,436,232,245,384,225,147,3218 }, + { 1,1,638,396,1,1,632,426,600,591,445,324,361,383,306,233,11045 }, + { 969,428,121,60,1055,705,228,109,522,467,193,100,331,337,158,91,10510 }, + { 10458,1646,190,37,1915,1018,173,44,271,219,60,19,70,66,24,8,166 }, + { 7178,2566,295,54,2608,1911,349,81,318,372,137,48,61,92,47,22,245 }, + { 1298,1120,461,234,1033,1363,718,394,432,702,474,310,237,410,306,222,6670 }, + { 4957,2828,467,105,2621,2394,583,159,447,579,238,86,106,160,90,40,524 }, + { 4823,3341,406,77,2957,2565,484,110,342,449,173,58,67,108,58,27,339 }, + { 4735,2275,507,143,2326,2244,684,217,535,708,315,125,158,240,130,62,980 }, + { 3363,2518,777,283,1923,2249,902,353,521,754,376,184,191,271,158,83,1478 }, + { 2569,2427,783,289,1849,2334,958,393,527,789,403,199,176,280,179,104,2125 }, + { 209,368,271,198,332,604,483,370,237,441,380,309,172,329,291,247,11143 }, + { 2074,2263,711,226,2045,2684,1063,380,659,1007,540,233,215,364,227,119,1574 }, + { 1619,1941,728,262,1831,2574,1147,441,696,1123,620,279,255,442,276,147,2003 }, + { 89,168,184,141,152,290,301,243,148,267,239,208,115,205,191,168,13275 }, + { 2202,1361,481,220,1422,1658,756,376,530,829,496,281,252,440,295,188,4597 }, + { 1220,1581,691,292,1439,2164,1109,502,642,1071,658,342,282,493,343,206,3349 }, + { 12626,1187,90,14,1479,510,66,15,152,91,21,6,32,26,8,3,58 }, + { 1579,1612,640,268,1579,2110,973,445,636,979,567,293,277,459,305,180,3482 }, + { 597,917,550,315,858,1442,958,576,520,916,667,439,297,547,424,300,6061 }, + { 9273,2489,318,71,1887,1172,236,68,211,204,66,24,49,56,24,10,226 }, + { 9238,2443,171,20,2434,1338,157,27,185,170,48,12,23,31,15,6,66 }, + { 6791,2409,331,63,2646,1938,374,87,425,442,137,44,98,123,52,23,401 }, + { 7175,3240,490,128,2005,1583,381,121,244,284,111,44,58,74,36,18,392 }, + { 5060,2643,429,93,2709,2336,508,133,486,575,201,69,125,170,82,35,730 }, + { 3721,2590,546,135,2565,2623,715,203,573,747,300,112,154,228,121,57,994 }, + { 5971,3317,756,225,1722,1689,548,209,313,380,163,81,85,120,63,35,707 }, + { 3047,2264,596,171,2261,2511,829,267,634,862,412,170,196,314,182,94,1574 }, + { 2061,2219,713,235,1973,2534,1000,362,611,898,476,213,203,338,207,118,2223 }, + { 4738,3211,931,354,1547,1721,712,317,366,458,238,125,117,163,98,57,1231 }, + { 3237,1808,587,228,1749,2093,906,378,585,905,502,252,221,379,244,134,2176 }, + { 1833,2056,788,351,1394,1957,999,506,466,736,459,264,194,324,232,152,3673 }, + { 3989,2869,494,107,2795,2682,635,164,505,655,258,89,122,184,98,44,694 }, + { 1463,1734,712,311,1406,1983,1023,495,530,863,558,302,227,384,274,177,3942 }, + { 14233,850,25,2,959,231,14,2,36,18,3,1,3,3,1,1,2 }, + { 1,1,2608,683,1,1,1802,574,2796,1865,787,318,786,627,335,160,3039 }, + { 2010,2043,643,214,1969,2512,995,364,643,983,510,233,229,378,241,132,2285 }, + { 7586,2931,241,33,2752,1803,231,42,227,236,68,19,33,43,20,8,111 }, + { 3059,2713,597,155,2517,2760,781,231,548,754,324,128,147,230,131,66,1243 }, + { 8643,1951,219,43,2418,1412,234,55,375,330,91,28,98,106,39,15,327 }, + { 6720,2158,447,142,2097,1684,496,185,455,496,207,80,144,177,81,38,777 }, +}; + + +/*------------------------------------------------------------------------- + * ECLVQ Stereo ROM tables + *------------------------------------------------------------------------*/ + +/* table with round(ECSQ_PROB_TOTAL / index) for entropy coding, with i in {1, .., ECSQ_SEGMENT_SIZE} */ +const UWord16 ECSQ_tab_inverse[1 + ECSQ_SEGMENT_SIZE] = +{ + 0, 16384, 8192, 5461, 4096, 3277, 2731, 2341, 2048 +}; + + +const Word16 tdm_bit_allc_tbl[5][6] = +{ + /* IC -- UC -- GC -- TM --AC */ + { 1650, 3500, 0, 4400, 0, 5000 }, /* IVAS_13k2 */ + { 1650, 3500, 0, 5000, 0, 5000 }, /* IVAS_16k4 */ + { 1650, 3500, 0, 6000, 0, 5000 }, /* IVAS_24k4 */ + { 1650, 6050, 0, 10000, 0, 10000 }, /* IVAS_32k */ + { 1650, 6050, 0, 13000, 0, 14000 } /* IVAS_48k */ +}; + + +const Word16 fast_FCB_bits_2sfr[] = {8, 14, 18, 20, 24, 128/*stop value*/}; + +const Word16 fast_FCB_rates_2sfr[] = {/*16*50,*/ (8+14)*50, 28*50, 32*50, 34*50, 36*50, 38*50, 40*50, 42*50, 44*50, 48*50}; + + +/*----------------------------------------------------------------------------------* + * MDCT Stereo ROM tables + *----------------------------------------------------------------------------------*/ + + /* PsychLPC */ + +const SpectrumWarping sw32000Hz[] = +{{ + { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, + 6, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 14, 14, + 14, 16, 18, 18, 18, 20, 22, 22, 22, 24, 26, 26, 26, 28, 30, 32 + }, + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, + 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10 + }, +}}; + +const SpectrumWarping sw25600Hz[] = +{{ + { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, + 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 10, 12, 12, 12, 12, + 12, 12, 14, 14, 14, 14, 14, 16, 16, 18, 18, 18, 18, 18, 20, 20 + }, + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 + }, +}}; + +const SpectrumWarping sw16000Hz[] = +{{ + { + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 + }, + { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 + }, +}}; + +const MDCTStereoBands_config mdctStereoBands_32000_640[] = +{{ + /*TCX 20*/ + { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, + 12, 20, 20, 20, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 42, + 64, 64, 96, 160}, + {44, 41,38, 29},/*number of bands for frame lengths 960, 640, 512, 320 respectively*/ + + /*TCX 10*/ + { + 4, 4, 4, 4, 4, 8, 8, 8, 8, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 20, 32, 32, + 32, 48, 80 + }, + {33, 29, 26, 18}/*number of bands for frame lengths 480, 320, 256, 160 respectively*/ +}}; + + +const Word16 dft_cng_coh_u2i[9] = { 4, 5, 3, 6, 2, 7, 1, 8, 0 }; /* Coherence unary codeword -> residual codeword conversion table */ + +const Word16 dft_cng_coh_i2u[9] = { 8, 6, 4, 2, 0, 1, 3, 5, 7 }; /* Coherence residual codeword -> unary codeword conversion table */ + +const Word16 dft_cng_coh_alpha_start[STEREO_DFT_N_COH_ALPHA_STEPS - 1] = { 15, 16, 17, 18 }; + + +const Word16 DirAC_band_grouping_12[12 + 1] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 11, 17, 25, 40, 60 +}; + + +const Word16 DirAC_band_grouping_6[6 + 1] = +{ + 0, 1, 4, 8, 20, 30, 60 +}; + +const Word16 DirAC_band_grouping_5[5 + 1] = +{ + 0, 1, 3, 7, 15, 60 +}; + +const Word16 DirAC_block_grouping[MAX_PARAM_SPATIAL_SUBFRAMES + 1] = +{ + 0, 4, 8, 12, 16 +}; + +const Word16 DirAC_block_grouping_5ms_MDFT[MAX_PARAM_SPATIAL_SUBFRAMES + 1] = +{ + 0, 1, 2, 3, 4 +}; + +const Word32 c_weights_fx[DIRAC_NO_FB_BANDS_MAX] /* Q30 */ = { 106970960, 1033798336, 1065867776, 1071704704, 1073381888, 1073741824, 1073494016, 1072883072, 1072012032, 1070930560, 1069665600, 1068232640, 1066641792, 1064899968, 1063012224, 1060982464, 1058814144, 1056510016, 1054072832, 1051505280, 1048809664, 1045988480, 1043044160, 1039979072, 1036795776, 1033496576, 1030084096, 1026560960, 1022929600, 1019192512, 1015352576, 1011412416, 1007374720, 1003242112, 999017472, 994703488, 990302976, 985818688, 981253568, 976610304, 971891712, 967100672, 962240064, 957312576, 952321088, 947268224, 942156992, 936990080, 931770048, 926499840, 921182016, 915819200, 910414208, 904969344, 899487488, 893970944, 888422272, 882843840, 877238144, 871607552, 865954432, 860280896, 854589184, 848881728, 843160384, 837427328, 831684672, 825934208, 820178240, 814418240, 808656320, 802894208, 797133568, 791376192, 785623744, 779877568, 774139520, 768410880, 762693184, 756987904, 751296064, 745619328, 739958784, 734315584, 728691008, 723086208, 717502016, 711939712, 706400064, 700884096, 695392768, 689926912, 684487232, 679074688, 673689856, 668333504, 663006464, 657709056, 652442176, 647206144, 642001600, 636828992, 631688896, 626581696, 621507776, 616467520, 611461184, 606489344, 601552064, 596649792, 591782528, 586950784, 582154560, 577394112, 572669696, 567981312, 563329088, 558713152, 554133568, 549590464, 545083840, 540613760, 536180160, 531783104, 527422528, 523098464, 518810784, 514559520, 510344672, 506165856, 502023360, 497916832, 493846304, 489811488, 485812448, 481848832, 477920672, 474027808, 470169952, 466347008, 462558848, 458805152, 455085920, 451400736, 447749600, 444132160, 440548320, 436997792, 433480416, 429995904, 426544032, 423124608, 419737376, 416382144, 413058720, 409766720, 406505984, 403276288, 400077280, 396908768, 393770656, 390662496, 387584064, 384535200, 381515616, 378525024, 375563200, 372629952, 369724864, 366847872, 363998592, 361176672, 358382176, 355614592, 352873760, 350159456, 347471328, 344809216, 342172864, 339562048, 336976384, 334415808, 331879840, 329368576, 326881472, 324418432, 321979104, 319563392, 317170976, 314801664, 312455232, 310131328, 307829856, 305550528, 303293088, 301057440, 298843168, 296650176, 294478304, 292327168, 290196672, 288086432, 285996512, 283926432, 281876224, 279845472, 277834016, 275841792, 273868480, 271913856, 269977792, 268059968, 266160304, 264278672, 262414768, 260568368, 258739360, 256927520, 255132768, 253354752, 251593392, 249848448, 248119936, 246407424, 244710816, 243030080, 241364928, 239715120, 238080672, 236461248, 234856752, 233267088, 231692016, 230131440, 228585136, 227053024, 225534848, 224030544, 222539872, 221062832 }; + +/*----------------------------------------------------------------------* +* SPAR ROM tables +*-----------------------------------------------------------------------*/ + +const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] = +{ +/* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel + so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ + { 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 10000, 8150, 13150 } }, + { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, + + { 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 13200, 11350, 16350 } }, + { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, + + { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 16400, 14850, 24350 } }, + { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 }, + + { 32000, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 24000, 20450, 31950 } }, + { { 21, 1, 5, 1 },{ 15, 1, 5, 1 },{ 15, 1, 3, 1 } }, 0, 0, 0 }, + + { 48000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 24000, 21000, 31950 },{ 16000, 15000, 20400 } }, + { { 15, 7, 5, 1 },{ 15, 7, 3, 1 },{ 7, 7, 3, 1 } }, 1, 0, 0 }, + + { 64000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 38000, 34050, 56000 },{ 16000, 15600, 20400 } },{ { 21, 7, 5, 1 },{ 15, 7, 5, 1 },{ 15, 7, 3, 1 } }, 1, 1, 0 }, + + { 80000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 46000, 43000, 56000 },{ 24000, 23000, 31950 } }, + { { 21, 7, 5, 1 },{ 15, 7, 5, 1 },{ 15, 7, 3, 1 } }, 1, 0, 0 }, + + { 96000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 47000, 42600, 56000 },{ 23000, 22600, 31950 },{ 16000, 15600, 20400 } }, + { { 21, 9, 9, 1 },{ 21, 7, 5, 1 },{ 21, 7, 5, 1 } }, 1, 0, 0 }, + + { 128000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 55000, 50000, 56000 },{ 36000, 36000, 56000 },{ 27000, 27000, 31950 } }, + { { 21, 11, 9, 1 },{ 21, 9, 7, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, + + { 160000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 74000, 70900, 112000 },{ 41000, 40050, 56000 },{ 35000, 34050, 56000 } }, + { { 21, 11, 11, 1 },{ 21, 9, 9, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, + + { 192000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 90000, 87900, 112000 },{ 50000, 48050, 56000 },{ 42000, 41050, 56000 } }, + { { 21, 11, 11, 1 },{ 21, 9, 9, 1 },{ 21, 7, 7, 1 } }, 1, 0, 0 }, + + { 256000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 90000, 85000, 112000 },{ 70000, 69000, 112000 },{ 50000, 48950, 56000 },{ 36400, 35600, 56000 } }, + { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 256000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 84650, 83000, 112000 },{ 65850, 64550, 56000 },{ 47000, 46100, 48000 },{ 28200, 27650, 40000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 256000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 76300, 73550, 112000 },{ 59350, 57200, 56000 },{ 42400, 40850, 48000 },{ 25450, 24500, 40000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 }, { 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } }, + { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, + { { 31, 1, 1, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, + + { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, + { { 31, 11, 11, 1 },{ 1, 1, 1, 1 },{ 1, 1, 1, 1 } }, 1, 2, 0 }, +}; + +const ivas_spar_br_table_t ivas_spar_br_table_consts_fx[IVAS_SPAR_BR_TABLE_LEN] = /*ceilf(log2f)*/ +{ + /* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each core-coder channel + so minimum core-coder bitrate per channel can be min core-coder bitrates as per the table - AGC_BITS_PER_CH */ + { 13200, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 10000, 8150, 13150 } }, + { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, + + { 16400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 13200, 11350, 16350 } }, + { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, + + { 24400, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 16400, 14850, 24350 } }, + { { 4, 0, 3, 0 },{ 4, 0, 2, 0 },{ 3, 0, 2, 0 } }, 0, 0, 0 }, + + { 32000, 0, SBA_FOA_ORDER, FB, 24000, 1, WYXZ, 1, 0, { { 24000, 20450, 31950 } }, + { { 5, 0, 3, 0 },{ 4, 0, 3, 0 },{ 4, 0, 2, 0 } }, 0, 0, 0 }, + + { 48000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 24000, 21000, 31950 },{ 16000, 15000, 20400 } }, + { { 4, 3, 3, 0 },{ 4, 3, 2, 0 },{ 3, 3, 2, 0 } }, 1, 0, 0 }, + + { 64000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 38000, 34050, 56000 },{ 16000, 15600, 20400 } },{ { 5, 3, 3, 0 },{ 4, 3, 3, 0 },{ 4, 3, 2, 0 } }, 1, 1, 0 }, + + { 80000, 0, SBA_FOA_ORDER, FB, 24000, 2, WYXZ, 0, 0, { { 46000, 43000, 56000 },{ 24000, 23000, 31950 } }, + { { 5, 3, 3, 0 },{ 4, 3, 3, 0 },{ 4, 3, 2, 0 } }, 1, 0, 0 }, + + { 96000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 47000, 42600, 56000 },{ 23000, 22600, 31950 },{ 16000, 15600, 20400 } }, + { { 5, 4, 4, 0 },{ 5, 3, 3, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, + + { 128000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 55000, 50000, 56000 },{ 36000, 36000, 56000 },{ 27000, 27000, 31950 } }, + { { 5, 4, 4, 0 },{ 5, 4, 3, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, + + { 160000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 74000, 70900, 112000 },{ 41000, 40050, 56000 },{ 35000, 34050, 56000 } }, + { { 5, 4, 4, 0 },{ 5, 4, 4, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, + + { 192000, 0, SBA_FOA_ORDER, FB, 24000, 3, WYXZ, 0, 0, { { 90000, 87900, 112000 },{ 50000, 48050, 56000 },{ 42000, 41050, 56000 } }, + { { 5, 4, 4, 0 },{ 5, 4, 4, 0 },{ 5, 3, 3, 0 } }, 1, 0, 0 }, + + { 256000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 90000, 85000, 112000 },{ 70000, 69000, 112000 },{ 50000, 48950, 56000 },{ 36400, 35600, 56000 } }, + { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 256000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 84650, 83000, 112000 },{ 65850, 64550, 56000 },{ 47000, 46100, 48000 },{ 28200, 27650, 40000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 256000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 76300, 73550, 112000 },{ 59350, 57200, 56000 },{ 42400, 40850, 48000 },{ 25450, 24500, 40000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 }, { 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 384000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 100000, 100000, 128000 },{ 79850, 79850, 104000 },{ 66600, 66600, 104000 } }, + { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 384000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 105350, 103300, 112000 },{ 75200, 73750, 96000 },{ 45100, 44250, 48000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 384000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 124300, 121550, 128000 },{ 96700, 94550, 112000 },{ 69050, 67500, 96000 },{ 41450, 40500, 48000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 512000, 0, SBA_FOA_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 128000, 128000, 128000 },{ 128000, 128000, 128000 },{ 128000, 128000, 128000 }, {118450, 118450, 128000 } }, + { { 5, 0, 0, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 512000, 0, SBA_HOA2_ORDER, FB, 24000, 4, WYXZ, 0, 0,{ { 124000, 124000, 128000 },{ 124000, 124000, 128000 },{ 125200, 118450, 128000 },{ 76300, 73000, 128000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, + + { 512000, 0, SBA_HOA3_ORDER, FB, 24000, 4, WYXZ, 0, 0, { { 118000, 118000, 128000 },{ 118000, 118000, 128000 },{ 117200, 109250, 128000 },{ 72300, 69000, 128000 } }, + { { 5, 4, 4, 0 },{ 0, 0, 0, 0 },{ 0, 0, 0, 0 } }, 1, 2, 0 }, +}; +const ivas_freq_models_t ivas_arith_pred_r_consts[TOTAL_PRED_QUANT_STRATS_ARITH] = +{ + /* entry for 1 quantization points */ + { + /* pred_R real */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* pred_R real differential */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* pred_R real : values for general and differential */ + { 0 },{ 0 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 7 quantization points for br_table_idx >= 2 */ + { + /* pred_R real */ + { + { 0,546,1092,2184,8740,2184,1092,546, }, + { 0,1779,2116,2516,3562,2516,2116,1779, }, + { 0,1848,2614,5229,2614,1848,1307,924, }, + { 0,924,1307,1848,2614,5229,2614,1848, }, + }, + /* pred_R real differential */ + { + { 0,125,399,1269,12798,1269,399,125, }, + { 0,744,1327,2365,7512,2365,1327,744, }, + { 0,1354,2413,7664,2413,1354,760,426, }, + { 0,426,760,1354,2413,7664,2413,1354, }, + }, + /* pred_R real : values for general and differential */ + { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 15 quantization points for br_table_idx >= 2 */ + { + /* pred_R real */ + { + { 0,32,64,128,257,514,1028,2056,8226,2056,1028,514,257,128,64,32, }, + { 0,565,672,799,950,1130,1344,1598,2268,1598,1344,1130,950,799,672,565, }, + { 0,353,500,707,1000,1414,2000,4010,2000,1414,1000,707,500,353,250,176, }, + { 0,176,250,353,500,707,1000,1414,2000,4010,2000,1414,1000,707,500,353, }, + }, + /* pred_R real differential */ + { + { 0,1,3,12,39,125,397,1260,12710,1260,397,125,39,12,3,1, }, + { 0,66,119,212,378,674,1201,2140,6804,2140,1201,674,378,212,119,66, }, + { 0,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119,67,37, }, + { 0,37,67,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119, }, + }, + /* pred_R real : values for general and differential */ + { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, + { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 21 quantization points for br_table_idx >= 2 */ + { + /* pred_R real */ + { + { 0,4,8,16,32,64,128,256,512,1024,2049,8198,2049,1024,512,256,128,64,32,16,8,4, }, + { 0,292,348,414,492,585,696,828,984,1171,1392,1980,1392,1171,984,828,696,585,492,414,348,292, }, + { 0,119,168,238,336,476,673,952,1346,1904,3817,1904,1346,952,673,476,336,238,168,119,84,59, }, + { 0,59,84,119,168,238,336,476,673,952,1346,1904,3817,1904,1346,952,673,476,336,238,168,119, }, + }, + /* pred_R real differential */ + { + { 0,1,1,1,1,3,12,39,125,397,1260,12704,1260,397,125,39,12,3,1,1,1,1, }, + { 0,11,20,37,66,118,210,375,668,1191,2122,6748,2122,1191,668,375,210,118,66,37,20,11, }, + { 0,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20,11,6, }, + { 0,6,11,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20, }, + }, + /* pred_R real : values for general and differential */ + { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, + { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 31 quantization points */ + { + /* pred real */ + { + { 0,1,1,1,1,2,4,8,16,32,64,128,256,512,1024,2048,8188,2048,1024,512,256,128,64,32,16,8,4,2,1,1,1,1, }, + { 0,110,131,156,186,221,263,313,373,443,527,627,746,887,1055,1255,1798,1255,1055,887,746,627,527,443,373,313,263,221,186,156,131,110, }, + { 0,20,29,41,58,82,116,164,233,329,466,659,932,1318,1864,3738,1864,1318,932,659,466,329,233,164,116,82,58,41,29,20,14,10, }, + { 0,10,14,20,29,41,58,82,116,164,233,329,466,659,932,1318,1864,3738,1864,1318,932,659,466,329,233,164,116,82,58,41,29,20, } + }, + /* pred real differential */ + { + { 0,1,1,1,1,1,1,1,1,1,3,12,39,125,397,1260,12694,1260,397,125,39,12,3,1,1,1,1,1,1,1,1,1, }, + { 0,1,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1,1, }, + { 0,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1,1,1, }, + { 0,1,1,1,2,3,6,11,20,37,66,117,210,374,667,1189,2118,6740,2118,1189,667,374,210,117,66,37,20,11,6,3,2,1, } + }, + /* pred real : values for general and differential */ + { -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, + { -15,-14,-13,-12,-11,-10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 }, + /* pred real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 7 quantization points for br_table_idx < 2 */ + { + /* pred_R real */ + { + { 0,327,778,1851,10472,1851,778,327, }, + { 0,1057,1630,2514,5982,2514,1630,1057, }, + { 0,1668,2572,6122,2572,1668,1081,701, }, + { 0,701,1081,1668,2572,6122,2572,1668, }, + }, + /* pred_R real differential */ + { + { 0,125,399,1269,12798,1269,399,125, }, + { 0,744,1327,2365,7512,2365,1327,744, }, + { 0,1354,2413,7664,2413,1354,760,426, }, + { 0,426,760,1354,2413,7664,2413,1354, }, + }, + /* pred_R real : values for general and differential */ + { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 15 quantization points for br_table_idx < 2 */ + { + /* pred real */ + { + { 0,9,23,56,133,318,757,1800,10192,1800,757,318,133,56,23,9, }, + { 0,156,240,371,573,883,1363,2102,5008,2102,1363,883,573,371,240,156, }, + { 0,241,372,575,886,1367,2109,5027,2109,1367,886,575,372,241,156,101, }, + { 0,101,156,241,372,575,886,1367,2109,5027,2109,1367,886,575,372,241, } + }, + /* pred real differential */ + { + { 0,1,3,12,39,125,397,1260,12710,1260,397,125,39,12,3,1, }, + { 0,66,119,212,378,674,1201,2140,6804,2140,1201,674,378,212,119,66, }, + { 0,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119,67,37, }, + { 0,37,67,119,212,379,675,1203,2144,6816,2144,1203,675,379,212,119, } + }, + /* pred real : values for general and differential */ + {-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7}, + { -7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7 }, + /* pred real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 21 quantization points for br_table_idx < 2 */ + { + /* pred_R real */ + { + { 0,1,1,4,9,23,56,133,318,756,1799,10184,1799,756,318,133,56,23,9,4,1,1, }, + { 0,41,64,98,152,234,362,558,861,1329,2049,4888,2049,1329,861,558,362,234,152,98,64,41, }, + { 0,64,98,152,235,362,559,862,1330,2051,4891,2051,1330,862,559,362,235,152,98,64,41,26, }, + { 0,26,41,64,98,152,235,362,559,862,1330,2051,4891,2051,1330,862,559,362,235,152,98,64, }, + }, + /* pred_R real differential */ + { + { 0,1,1,1,1,3,12,39,125,397,1260,12704,1260,397,125,39,12,3,1,1,1,1, }, + { 0,11,20,37,66,118,210,375,668,1191,2122,6748,2122,1191,668,375,210,118,66,37,20,11, }, + { 0,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20,11,6, }, + { 0,6,11,20,37,66,118,210,375,668,1191,2123,6751,2123,1191,668,375,210,118,66,37,20, }, + }, + /* pred_R real : values for general and differential */ + { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, + { -10,-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10 }, + /* pred_R real : num dyn models for general and differential */ + 4, 4 + } +}; + +const ivas_freq_models_t ivas_arith_drct_r_consts[TOTAL_DRCT_QUANT_STRATS] = +{ + /* entry for 1 quantization points */ + { + /* drct real */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* drct real differential */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* drct real : values for general and differential */ + {0},{ 0 }, + /* drct real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 7 quantization points */ + { /* drct real */ + { + { 0,125,399,1269,12798,1269,399,125, }, + { 0,744,1327,2365,7512,2365,1327,744, }, + { 0,988,1244,1568,1976,2489,3136,4983, }, + { 0,2111,2262,2425,2788,2425,2262,2111, }, + }, + /* drct real differential */ + { + { 0,125,399,1269,12798,1269,399,125, }, + { 0,744,1327,2365,7512,2365,1327,744, }, + { 0,1354,2413,7664,2413,1354,760,426, }, + { 0,426,760,1354,2413,7664,2413,1354, }, + }, + /* drct real : values for general and differential */ + { -3,-2,-1,0,1,2,3 },{ -3,-2,-1,0,1,2,3 }, + /* drct real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 9 quantization points */ + { + /* drct real */ + { + { 0,39,125,397,1263,12736,1263,397,125,39, }, + { 0,397,708,1262,2250,7150,2250,1262,708,397, }, + { 0,573,722,909,1146,1444,1819,2292,2888,4591, }, + { 0,1587,1701,1824,1955,2250,1955,1824,1701,1587, }, + }, + /* drct real differential */ + { + { 0,39,125,397,1263,12736,1263,397,125,39, }, + { 0,397,708,1262,2250,7150,2250,1262,708,397, }, + { 0,716,1276,2274,7225,2274,1276,716,402,225, }, + { 0,225,402,716,1276,2274,7225,2274,1276,716, } + }, + /* drct real : values for general and differential */ + { -4,-3,-2,-1,0,1,2,3,4 },{ -4,-3,-2,-1,0,1,2,3,4 }, + /* drct real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 11 quantization points */ + { + /* drct real */ + { + { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, + { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, + { 0,343,433,546,687,866,1092,1375,1733,2184,2751,4374, }, + { 0,1254,1344,1441,1544,1655,1908,1655,1544,1441,1344,1254, }, + }, + /* drct real differential */ + { + { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, + { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, + { 0,389,694,1236,2203,7000,2203,1236,694,389,218,122, }, + { 0,122,218,389,694,1236,2203,7000,2203,1236,694,389, }, + }, + /* drct real : values for general and differential */ + { -5,-4,-3,-2,-1,0,1,2,3,4,5 },{ -5,-4,-3,-2,-1,0,1,2,3,4,5 }, + /* drct real : num dyn models for general and differential */ + 4, 4 + } +}; + +const ivas_freq_models_t ivas_arith_decd_r_consts[TOTAL_DECD_QUANT_STRATS] = +{ + /* entry for 1 quantization points */ + { + /* decd real */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* decd real differential */ + { + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + { 0,16384, }, + }, + /* decd real : values for general and differential */ + { 0 },{ 0 }, + /* decd real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 3 quantization points */ + { + /* decd real */ + { + { 0,11917,2978,1489, }, + { 0,8840,4419,3125, }, + { 0,4567,7250,4567, }, + { 0,5203,5978,5203, }, + }, + /* decd real differential */ + { + { 0,1356,13672,1356, }, + { 0,3166,10052,3166, }, + { 0,10984,3459,1941, }, + { 0,1941,3459,10984, }, + }, + /* decd real : values for general and differential */ + { 0,1,2 },{-1,0,1}, + /* decd real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 5 quantization points */ + { + /* decd real */ + { + { 0,11157,2788,1394,697,348, }, + { 0,7186,3592,2540,1796,1270, }, + { 0,2512,3166,5028,3166,2512, }, + { 0,3048,3267,3754,3267,3048, }, + }, + /* decd real differential */ + { + { 0,406,1289,12994,1289,406, }, + { 0,1460,2601,8262,2601,1460, }, + { 0,2707,8599,2707,1519,852, }, + { 0,852,1519,2707,8599,2707, }, + }, + /* decd real : values for general and differential */ + { 0,1,2,3,4 },{ -2,-1,0,1,2 }, + /* decd real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 7 quantization points */ + { + /* decd real */ + { + { 0,10983,2744,1372,686,343,171,85, }, + { 0,6573,3285,2322,1642,1161,821,580, }, + { 0,1603,2020,2546,4046,2546,2020,1603, }, + { 0,2111,2262,2425,2788,2425,2262,2111, }, + }, + /* decd real differential */ + { + { 0,125,399,1269,12798,1269,399,125, }, + { 0,744,1327,2365,7512,2365,1327,744, }, + { 0,1354,2413,7664,2413,1354,760,426, }, + { 0,426,760,1354,2413,7664,2413,1354, } + }, + /* decd real : values for general and differential */ + { 0,1,2,3,4,5,6 },{ -3,-2,-1,0,1,2,3 }, + /* decd real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 9 quantization points */ + { /* decd real */ + { + { 0,10941,2734,1367,683,341,170,85,42,21, }, + { 0,6305,3150,2227,1575,1113,787,556,393,278, }, + { 0,1101,1388,1749,2203,3502,2203,1749,1388,1101, }, + { 0,1587,1701,1824,1955,2250,1955,1824,1701,1587, }, + }, + /* decd real differential */ + { + { 0,39,125,397,1263,12736,1263,397,125,39, }, + { 0,397,708,1262,2250,7150,2250,1262,708,397, }, + { 0,716,1276,2274,7225,2274,1276,716,402,225, }, + { 0,225,402,716,1276,2274,7225,2274,1276,716, } + }, + /* decd real : values for general and differential */ + { 0,1,2,3,4,5,6,7,8 },{ -4,-3,-2,-1,0,1,2,3,4 }, + /* decd real : num dyn models for general and differential */ + 4, 4 + }, + /* entry for 11 quantization points */ + { + /* decd real */ + { + { 0,10932,2731,1365,682,341,170,85,42,21,10,5, }, + { 0,6181,3086,2182,1543,1091,771,545,385,272,192,136, }, + { 0,790,995,1254,1580,1991,3164,1991,1580,1254,995,790, }, + { 0,1254,1344,1441,1544,1655,1908,1655,1544,1441,1344,1254, }, + }, + /* decd real differential */ + { + { 0,12,39,125,397,1261,12716,1261,397,125,39,12, }, + { 0,217,387,689,1229,2190,6960,2190,1229,689,387,217, }, + { 0,389,694,1236,2203,7000,2203,1236,694,389,218,122, }, + { 0,122,218,389,694,1236,2203,7000,2203,1236,694,389, }, + }, + /* decd real : values for general and differential */ + { 0,1,2,3,4,5,6,7,8,9,10 },{ -5,-4,-3,-2,-1,0,1,2,3,4,5 }, + /* decd real : num dyn models for general and differential */ + 4, 4 + } +}; + +const ivas_huff_models_t ivas_huff_pred_r_consts[TOTAL_PRED_QUANT_STRATS_HUFF] = +{ + /* entry for 1 quantization points for br_table_idx */ + {{{ 0 }}, {{ 0 }}}, + /* entry for 7 quantization points for br_table_idx */ + { + /* pred_R codebook */ + { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 }, }, + /* pred_R differential codebook */ + { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 }, }, + }, + /* entry for 15 quantization points for br_table_idx */ + { + /* pred_r codebook */ + { { -7,4,2 },{ -6,4,3 },{ -5, 4, 4 },{ -4, 4, 5 },{ -3,4,6 },{ -2,4,7 },{ -1,4,8 }, + { 0,3,0 },{ 1,4,9 },{ 2,4,10 },{ 3,4,11 },{ 4,4,12 },{ 5,4,13 },{ 6,4,14 },{ 7,4,15 } }, + /* pred_r differential codebook */ + { { -7,4,2 },{ -6,4,3 },{ -5, 4, 4 },{ -4, 4, 5 },{ -3,4,6 },{ -2,4,7 },{ -1,4,8 }, + { 0,3,0 },{ 1,4,9 },{ 2,4,10 },{ 3,4,11 },{ 4,4,12 },{ 5,4,13 },{ 6,4,14 },{ 7,4,15 } }, + }, + /* entry for 21 quantization points for br_table_idx=0 */ + { + /* pred_r codebook */ + { {-10,5,22},{-9,5,23},{-8,5,24},{-7,5,25},{-6,5,26}, { -5, 4, 0 },{ -4, 4, 1 },{ -3,4,2 },{ -2,4,3 },{ -1,4,4 }, + { 0,4,5 },{ 1,4,6 },{ 2,4,7 },{ 3,4,8 },{ 4,4,9 },{ 5,4,10 },{6,5,27},{7,5,28},{8,5,29},{9,5,30},{10,5,31} }, + /* pred_r differential codebook */ + { { -10,5,22 },{ -9,5,23 },{ -8,5,24 },{ -7,5,25 },{ -6,5,26 },{ -5, 4, 0 },{ -4, 4, 1 },{ -3,4,2 },{ -2,4,3 },{ -1,4,4 }, + { 0,4,5 },{ 1,4,6 },{ 2,4,7 },{ 3,4,8 },{ 4,4,9 },{ 5,4,10 },{ 6,5,27 },{ 7,5,28 },{ 8,5,29 },{ 9,5,30 },{ 10,5,31 } }, + }, + + /* entry for 31 quantization points for br_table_idx>0 */ + { + /* pred_r codebook */ + { {-15,5,2},{-14,5,3},{-13,5,4},{-12,5,5},{-11,5,6}, { -10,5,7 },{ -9,5,8 },{ -8,5,9 }, + { -7,5,10 },{ -6,5,11 },{ -5, 5, 12 },{ -4, 5, 13 },{ -3,5,14 },{ -2,5,15 },{ -1,5,16 }, + { 0,4,0 },{ 1,5,17 },{ 2,5,18 },{ 3,5,19 },{ 4,5,20 },{ 5,5,21 },{ 6,5,22 },{ 7,5,23 }, + { 8,5,24 },{ 9,5,25 },{ 10,5,26 },{11,5,27},{12,5,28},{13,5,29},{14,5,30},{15,5,31} }, + /* pred_r differential codebook */ + { { -15,5,2 },{ -14,5,3 },{ -13,5,4 },{ -12,5,5 },{ -11,5,6 },{ -10,5,7 },{ -9,5,8 },{ -8,5,9 }, + { -7,5,10 },{ -6,5,11 },{ -5, 5, 12 },{ -4, 5, 13 },{ -3,5,14 },{ -2,5,15 },{ -1,5,16 }, + { 0,4,0 },{ 1,5,17 },{ 2,5,18 },{ 3,5,19 },{ 4,5,20 },{ 5,5,21 },{ 6,5,22 },{ 7,5,23 }, + { 8,5,24 },{ 9,5,25 },{ 10,5,26 },{ 11,5,27 },{ 12,5,28 },{ 13,5,29 },{ 14,5,30 },{ 15,5,31 } }, + }, + }; + + const ivas_huff_models_t ivas_huff_drct_r_consts[TOTAL_DRCT_QUANT_STRATS] = +{ + /* entry for 1 quantization points */ + {{{ 0 }}, {{ 0 }}}, + /* entry for 7 quantization points */ + { + /* drct_r codebook */ + { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, + /* drct_r differential codebook */ + { { -3,3,2 },{ -2,3,3 },{ -1,3,4 },{ 0,2,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, + }, + /* entry for 9 quantization points */ + { + /* drct_r codebook */ + { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, + /* drct_r differential codebook */ + { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, + }, + /* entry for 11 quantization points */ + { + /* drct_r codebook */ + { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, + /* drct_r differential codebook */ + { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, + }, +}; + +const ivas_huff_models_t ivas_huff_decd_r_consts[TOTAL_DECD_QUANT_STRATS] = +{ + /* entry for 1 quantization points */ + {{{ 0 }}, {{ 0 }}}, + /* entry for 3 quantization points */ + { + /* decd_r codebook */ + { { 0, 2, 2 },{ 1, 1, 0 },{ 2,2,3 } }, + /* decd_r differential codebook */ + { { -1, 2, 2 },{ 0, 1, 0 },{ 1,2,3 } }, + }, + /* entry for 5 quantization points */ + { + /* decd_r codebook */ + { { 0,3,6 },{ 1,2,0 },{ 2,2,1 },{ 3,2,2 },{ 4,3,7 } }, + /* decd_r differential codebook */ + { { -2,3,6 },{ -1,2,0 },{ 0,2,1 },{ 1,2,2 },{ 2,3,7 } }, + }, + /* entry for 7 quantization points */ + { + /* decd_r */ + { { 0, 3, 2 },{ 1, 3, 3 },{ 2,3,4 },{ 3,3,0 },{ 4,3,5 },{ 5,3,6 },{ 6,3,7 } }, + /* decd_r codebook differential codebook */ + { { -3, 3, 2 },{ -2, 3, 3 },{ -1,3,4 },{ 0,3,0 },{ 1,3,5 },{ 2,3,6 },{ 3,3,7 } }, + }, + /* entry for 9 quantization points */ + { + /* decd_r codebook */ + { { 0, 4, 14 },{ 1,3,0 },{ 2,3,1 },{ 3,3,2 },{ 4,3,3 },{ 5,3,4 },{ 6,3,5 },{ 7,3,6 },{ 8,4,15 } }, + /* decd_r differential codebook */ + { { -4, 4, 14 },{ -3,3,0 },{ -2,3,1 },{ -1,3,2 },{ 0,3,3 },{ 1,3,4 },{ 2,3,5 },{ 3,3,6 },{ 4,4,15 } }, + }, + /* entry for 11 quantization points */ + { + /* decd_r codebook */ + { { 0, 4, 10 },{ 1, 4, 11 },{ 2,4,12 },{ 3,3,0 },{ 4,3,1 },{ 5,3,2 },{ 6,3,3 },{ 7,3,4 },{ 8,4,13 },{ 9,4,14 },{ 10,4,15 } }, + /* decd_r differential codebook */ + { { -5, 4, 10 },{ -4, 4, 11 },{ -3,4,12 },{ -2,3,0 },{ -1,3,1 },{ 0,3,2 },{ 1,3,3 },{ 2,3,4 },{ 3,4,13 },{ 4,4,14 },{ 5,4,15 } }, + }, +}; + +/* DTX quantization and bitstream constants */ + +const Word16 dtx_pd_real_q_levels[3][3] = { { 7,7,7 },{ 7,7,0 },{ 3,0,0 } }; +const Word16 dtx_pr_real_q_levels[3][3] = { { 9,9,9 },{ 9,7,9 },{ 9,5,7 } }; +const Word16 pr_pr_idx_pairs[3][3][2] = { { { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 0, 0 },{ 0, 0 } },{ { 0, 0 },{ 1, 3 },{ 0, 0 } } }; +const Word16 pr_pd_idx_pairs[3][3][2] = { { { 1, 1 },{ 2, 2 },{ 3, 3 } },{ { 1, 1 },{ 3, 2 },{ 2, 0 } },{ { 2, 1 },{ 0, 0 },{ 0, 0 } } }; + +const Word16 remix_order_set[1][DIRAC_MAX_ANA_CHANS] = { /* WYZX --> WYXZ... */ + { 0, 1, 3, 2, 4, 5, 6, 7, 8, 9, 10 } +}; + +const Word16 HOA_keep_ind[IVAS_SPAR_MAX_FB_IN_CHAN] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 15}; +const Word16 HOA_keep_ind_spar[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 8, 9, 10, 10, 10, 10}; +const Word16 HOA_keep_ind_spar512[IVAS_SPAR_MAX_CH] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + + +/*----------------------------------------------------------------------* +* PCA ROM tables +*-----------------------------------------------------------------------*/ + +const Word32 ivas_pca_offset_index1[IVAS_PCA_N1 + 1] = +{ + 0, 1, 9, 61, 163, 359, 685, 1125, 1747, + 2519, 3521, 4713, 6183, 7883, 9809, 12093, 14633, 17575, + 20807, 24343, 28181, 32487, 37121, 42097, 47405, 53057, 59061, + 65421, 72137, 79205, 86625, 94415, 102345, 110629, 119263, 128017, + 137097, 146515, 156043, 165637, 175551, 185515, 195535, 205837, 216183, + 226545, 236911, 247273, 257619, 267921, 277941, 287905, 297819, 307413, + 316941, 326359, 335439, 344193, 352827, 361111, 369041, 376831, 384251, + 391319, 398035, 404395, 410399, 416051, 421359, 426335, 430969, 435275, + 439113, 442649, 445881, 448823, 451363, 453647, 455573, 457273, 458743, + 459935, 460937, 461709, 462331, 462771, 463097, 463293, 463395, 463447, + 463455, 463456 +}; + +const Word16 ivas_pca_offset_index2[2692] = +{ + 0, 1, 0, 1, 7, 8, 0, 1, 7, 19, + 33, 45, 51, 52, 0, 1, 9, 23, 41, 61, + 79, 93, 101, 102, 0, 1, 7, 21, 39, 61, + 85, 111, 135, 157, 175, 189, 195, 196, 0, 1, + 7, 19, 37, 59, 85, 115, 147, 179, 211, 241, + 267, 289, 307, 319, 325, 326, 0, 1, 7, 21, + 41, 65, 95, 127, 163, 201, 239, 277, 313, 345, + 375, 399, 419, 433, 439, 440, 0, 1, 7, 19, + 37, 61, 91, 125, 163, 203, 245, 289, 333, 377, + 419, 459, 497, 531, 561, 585, 603, 615, 621, 622, + 0, 1, 7, 21, 41, 67, 97, 133, 173, 217, + 263, 311, 361, 411, 461, 509, 555, 599, 639, 675, + 705, 731, 751, 765, 771, 772, 0, 1, 7, 19, + 37, 61, 91, 127, 167, 211, 259, 309, 363, 417, + 473, 529, 585, 639, 693, 743, 791, 835, 875, 911, + 941, 965, 983, 995, 1001, 1002, 0, 1, 7, 21, + 41, 67, 99, 135, 177, 223, 273, 327, 383, 443, + 503, 565, 627, 689, 749, 809, 865, 919, 969, 1015, + 1057, 1093, 1125, 1151, 1171, 1185, 1191, 1192, 0, 1, + 7, 19, 37, 61, 91, 127, 169, 215, 265, 319, + 377, 437, 501, 567, 633, 701, 769, 837, 903, 969, + 1033, 1093, 1151, 1205, 1255, 1301, 1343, 1379, 1409, 1433, + 1451, 1463, 1469, 1470, 0, 1, 7, 21, 41, 67, + 99, 137, 179, 227, 279, 335, 395, 459, 525, 595, + 667, 739, 813, 887, 961, 1033, 1105, 1175, 1241, 1305, + 1365, 1421, 1473, 1521, 1563, 1601, 1633, 1659, 1679, 1693, + 1699, 1700, 0, 1, 9, 23, 43, 69, 101, 139, + 183, 231, 285, 343, 405, 471, 541, 613, 689, 765, + 843, 923, 1003, 1083, 1161, 1237, 1313, 1385, 1455, 1521, + 1583, 1641, 1695, 1743, 1787, 1825, 1857, 1883, 1903, 1917, + 1925, 1926, 0, 1, 7, 21, 41, 67, 99, 137, + 179, 227, 281, 339, 401, 467, 537, 611, 687, 767, + 849, 931, 1015, 1099, 1185, 1269, 1353, 1435, 1517, 1597, + 1673, 1747, 1817, 1883, 1945, 2003, 2057, 2105, 2147, 2185, + 2217, 2243, 2263, 2277, 2283, 2284, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 285, 345, 409, 477, + 549, 625, 705, 787, 871, 957, 1045, 1135, 1225, 1315, + 1405, 1495, 1583, 1669, 1753, 1835, 1915, 1991, 2063, 2131, + 2195, 2255, 2309, 2359, 2403, 2441, 2473, 2499, 2519, 2533, + 2539, 2540, 0, 1, 7, 19, 39, 65, 97, 135, + 177, 225, 279, 337, 401, 469, 541, 617, 697, 781, + 867, 955, 1045, 1137, 1231, 1327, 1423, 1519, 1615, 1711, + 1805, 1897, 1987, 2075, 2161, 2245, 2325, 2401, 2473, 2541, + 2605, 2663, 2717, 2765, 2807, 2845, 2877, 2903, 2923, 2935, + 2941, 2942, 0, 1, 7, 21, 41, 67, 99, 137, + 181, 229, 283, 343, 407, 477, 551, 629, 711, 797, + 885, 977, 1071, 1167, 1265, 1365, 1465, 1565, 1667, 1767, + 1867, 1967, 2065, 2161, 2255, 2347, 2435, 2521, 2603, 2681, + 2755, 2825, 2889, 2949, 3003, 3051, 3095, 3133, 3165, 3191, + 3211, 3225, 3231, 3232, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 347, 413, 483, 559, 639, + 723, 811, 903, 997, 1093, 1193, 1295, 1399, 1503, 1609, + 1715, 1821, 1927, 2033, 2137, 2241, 2343, 2443, 2539, 2633, + 2725, 2813, 2897, 2977, 3053, 3123, 3189, 3249, 3305, 3355, + 3399, 3437, 3469, 3495, 3515, 3529, 3535, 3536, 0, 1, + 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, + 415, 487, 563, 645, 731, 821, 915, 1011, 1111, 1213, + 1317, 1423, 1531, 1641, 1751, 1863, 1975, 2087, 2197, 2307, + 2415, 2521, 2625, 2727, 2827, 2923, 3017, 3107, 3193, 3275, + 3351, 3423, 3489, 3551, 3607, 3657, 3701, 3739, 3771, 3797, + 3817, 3831, 3837, 3838, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 285, 345, 411, 481, 557, 637, + 721, 809, 901, 997, 1097, 1199, 1305, 1413, 1523, 1635, + 1749, 1863, 1979, 2095, 2211, 2327, 2443, 2557, 2671, 2783, + 2893, 3001, 3107, 3209, 3309, 3405, 3497, 3585, 3669, 3749, + 3825, 3895, 3961, 4021, 4075, 4125, 4169, 4207, 4239, 4265, + 4285, 4299, 4305, 4306, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 347, 413, 485, 561, 643, + 729, 819, 913, 1011, 1113, 1217, 1325, 1435, 1547, 1663, + 1779, 1897, 2017, 2137, 2257, 2377, 2497, 2617, 2737, 2855, + 2971, 3087, 3199, 3309, 3417, 3521, 3623, 3721, 3815, 3905, + 3991, 4073, 4149, 4221, 4287, 4347, 4403, 4453, 4497, 4535, + 4567, 4593, 4613, 4627, 4633, 4634, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 415, 487, + 565, 647, 733, 825, 921, 1021, 1125, 1231, 1341, 1453, + 1569, 1687, 1807, 1929, 2051, 2175, 2299, 2425, 2551, 2677, + 2801, 2925, 3047, 3169, 3289, 3407, 3523, 3635, 3745, 3851, + 3955, 4055, 4151, 4243, 4329, 4411, 4489, 4561, 4627, 4689, + 4745, 4795, 4839, 4877, 4909, 4935, 4955, 4969, 4975, 4976, + 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, + 287, 349, 417, 489, 567, 649, 737, 829, 925, 1025, + 1129, 1237, 1349, 1463, 1581, 1701, 1823, 1947, 2073, 2201, + 2329, 2459, 2589, 2719, 2849, 2979, 3107, 3235, 3361, 3485, + 3607, 3727, 3845, 3959, 4071, 4179, 4283, 4383, 4479, 4571, + 4659, 4741, 4819, 4891, 4959, 5021, 5077, 5127, 5171, 5209, + 5241, 5267, 5287, 5301, 5307, 5308, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 489, + 567, 651, 739, 831, 929, 1031, 1137, 1247, 1361, 1477, + 1597, 1719, 1843, 1969, 2097, 2227, 2359, 2491, 2625, 2759, + 2893, 3027, 3161, 3293, 3425, 3555, 3683, 3809, 3933, 4055, + 4175, 4291, 4405, 4515, 4621, 4723, 4821, 4913, 5001, 5085, + 5163, 5235, 5303, 5365, 5421, 5471, 5515, 5553, 5585, 5611, + 5631, 5645, 5651, 5652, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 569, 653, + 741, 835, 933, 1035, 1141, 1251, 1365, 1483, 1603, 1727, + 1853, 1983, 2115, 2249, 2383, 2519, 2657, 2795, 2933, 3071, + 3209, 3347, 3485, 3621, 3755, 3889, 4021, 4151, 4277, 4401, + 4521, 4639, 4753, 4863, 4969, 5071, 5169, 5263, 5351, 5435, + 5513, 5587, 5655, 5717, 5773, 5823, 5867, 5905, 5937, 5963, + 5983, 5997, 6003, 6004, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 569, 653, + 741, 835, 933, 1037, 1145, 1257, 1373, 1491, 1613, 1739, + 1867, 1997, 2131, 2267, 2405, 2543, 2683, 2825, 2967, 3109, + 3251, 3393, 3535, 3677, 3817, 3955, 4093, 4229, 4363, 4493, + 4621, 4747, 4869, 4987, 5103, 5215, 5323, 5427, 5525, 5619, + 5707, 5791, 5869, 5943, 6011, 6073, 6129, 6179, 6223, 6261, + 6293, 6319, 6339, 6353, 6359, 6360, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, + 569, 653, 743, 837, 935, 1039, 1147, 1259, 1375, 1495, + 1619, 1745, 1875, 2007, 2143, 2281, 2421, 2563, 2705, 2849, + 2993, 3139, 3285, 3431, 3577, 3723, 3867, 4011, 4153, 4295, + 4435, 4573, 4709, 4841, 4971, 5097, 5221, 5341, 5457, 5569, + 5677, 5781, 5879, 5973, 6063, 6147, 6225, 6299, 6367, 6429, + 6485, 6535, 6579, 6617, 6649, 6675, 6695, 6709, 6715, 6716, + 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, + 287, 349, 417, 491, 569, 653, 743, 837, 937, 1041, + 1149, 1261, 1377, 1497, 1621, 1749, 1879, 2013, 2149, 2287, + 2429, 2573, 2717, 2863, 3011, 3159, 3309, 3459, 3609, 3759, + 3909, 4057, 4205, 4351, 4495, 4639, 4781, 4919, 5055, 5189, + 5319, 5447, 5571, 5691, 5807, 5919, 6027, 6131, 6231, 6325, + 6415, 6499, 6577, 6651, 6719, 6781, 6837, 6887, 6931, 6969, + 7001, 7027, 7047, 7061, 7067, 7068, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, + 569, 653, 743, 837, 937, 1041, 1149, 1261, 1377, 1497, + 1621, 1749, 1881, 2015, 2153, 2293, 2435, 2579, 2725, 2873, + 3023, 3175, 3327, 3479, 3633, 3787, 3941, 4093, 4245, 4397, + 4547, 4695, 4841, 4985, 5127, 5267, 5405, 5539, 5671, 5799, + 5923, 6043, 6159, 6271, 6379, 6483, 6583, 6677, 6767, 6851, + 6929, 7003, 7071, 7133, 7189, 7239, 7283, 7321, 7353, 7379, + 7399, 7413, 7419, 7420, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 489, 567, 651, + 741, 835, 935, 1039, 1147, 1259, 1377, 1499, 1625, 1753, + 1885, 2021, 2159, 2301, 2445, 2591, 2739, 2889, 3041, 3195, + 3349, 3505, 3661, 3817, 3973, 4129, 4285, 4441, 4595, 4749, + 4901, 5051, 5199, 5345, 5489, 5631, 5769, 5905, 6037, 6165, + 6291, 6413, 6531, 6643, 6751, 6855, 6955, 7049, 7139, 7223, + 7301, 7373, 7441, 7503, 7559, 7609, 7653, 7691, 7723, 7749, + 7769, 7783, 7789, 7790, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, + 747, 843, 945, 1051, 1161, 1277, 1397, 1521, 1649, 1781, + 1915, 2053, 2195, 2339, 2485, 2635, 2787, 2941, 3095, 3251, + 3409, 3567, 3725, 3885, 4045, 4205, 4363, 4521, 4679, 4835, + 4989, 5143, 5295, 5445, 5591, 5735, 5877, 6015, 6149, 6281, + 6409, 6533, 6653, 6769, 6879, 6985, 7087, 7183, 7273, 7359, + 7439, 7513, 7581, 7643, 7699, 7749, 7793, 7831, 7863, 7889, + 7909, 7923, 7929, 7930, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, + 747, 843, 943, 1049, 1159, 1273, 1393, 1517, 1645, 1777, + 1913, 2051, 2193, 2337, 2485, 2635, 2787, 2941, 3097, 3255, + 3415, 3575, 3737, 3899, 4061, 4223, 4385, 4547, 4709, 4869, + 5029, 5187, 5343, 5497, 5649, 5799, 5947, 6091, 6233, 6371, + 6507, 6639, 6767, 6891, 7011, 7125, 7235, 7341, 7441, 7537, + 7627, 7713, 7793, 7867, 7935, 7997, 8053, 8103, 8147, 8185, + 8217, 8243, 8263, 8277, 8283, 8284, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, + 571, 655, 745, 841, 941, 1047, 1157, 1271, 1389, 1513, + 1641, 1773, 1907, 2045, 2187, 2331, 2479, 2629, 2783, 2939, + 3097, 3257, 3417, 3579, 3743, 3907, 4071, 4235, 4399, 4563, + 4727, 4891, 5055, 5217, 5377, 5537, 5695, 5851, 6005, 6155, + 6303, 6447, 6589, 6727, 6861, 6993, 7121, 7245, 7363, 7477, + 7587, 7693, 7793, 7889, 7979, 8063, 8143, 8217, 8285, 8347, + 8403, 8453, 8497, 8535, 8567, 8593, 8613, 8627, 8633, 8634, + 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, + 287, 349, 417, 491, 571, 657, 749, 845, 947, 1053, + 1165, 1281, 1401, 1527, 1657, 1791, 1929, 2069, 2213, 2361, + 2511, 2663, 2819, 2977, 3137, 3299, 3463, 3627, 3793, 3959, + 4125, 4293, 4461, 4629, 4795, 4961, 5127, 5291, 5455, 5617, + 5777, 5935, 6091, 6243, 6393, 6541, 6685, 6825, 6963, 7097, + 7227, 7353, 7473, 7589, 7701, 7807, 7909, 8005, 8097, 8183, + 8263, 8337, 8405, 8467, 8523, 8573, 8617, 8655, 8687, 8713, + 8733, 8747, 8753, 8754, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, + 747, 843, 943, 1049, 1159, 1275, 1395, 1519, 1647, 1779, + 1915, 2055, 2199, 2345, 2495, 2647, 2803, 2961, 3121, 3283, + 3447, 3613, 3779, 3947, 4115, 4285, 4455, 4625, 4795, 4965, + 5133, 5301, 5467, 5633, 5797, 5959, 6119, 6277, 6433, 6585, + 6735, 6881, 7025, 7165, 7301, 7433, 7561, 7685, 7805, 7921, + 8031, 8137, 8237, 8333, 8423, 8509, 8589, 8663, 8731, 8793, + 8849, 8899, 8943, 8981, 9013, 9039, 9059, 9073, 9079, 9080, + 0, 1, 7, 19, 39, 65, 97, 135, 179, 229, + 285, 347, 415, 489, 567, 651, 741, 835, 935, 1041, + 1151, 1265, 1385, 1509, 1637, 1769, 1905, 2045, 2189, 2335, + 2485, 2637, 2793, 2951, 3111, 3273, 3437, 3603, 3771, 3939, + 4109, 4279, 4451, 4623, 4795, 4967, 5139, 5309, 5479, 5647, + 5815, 5981, 6145, 6307, 6467, 6625, 6781, 6933, 7083, 7229, + 7373, 7513, 7649, 7781, 7909, 8033, 8153, 8267, 8377, 8483, + 8583, 8677, 8767, 8851, 8929, 9003, 9071, 9133, 9189, 9239, + 9283, 9321, 9353, 9379, 9399, 9411, 9417, 9418, 0, 1, + 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, + 417, 491, 571, 657, 747, 843, 945, 1051, 1163, 1279, + 1399, 1525, 1655, 1789, 1927, 2069, 2213, 2361, 2513, 2667, + 2825, 2985, 3147, 3311, 3477, 3645, 3815, 3985, 4157, 4329, + 4503, 4677, 4851, 5025, 5199, 5371, 5543, 5713, 5883, 6051, + 6217, 6381, 6543, 6703, 6861, 7015, 7167, 7315, 7459, 7601, + 7739, 7873, 8003, 8129, 8249, 8365, 8477, 8583, 8685, 8781, + 8871, 8957, 9037, 9111, 9179, 9241, 9297, 9347, 9391, 9429, + 9461, 9487, 9507, 9521, 9527, 9528, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, + 571, 657, 749, 845, 947, 1055, 1167, 1285, 1407, 1533, + 1663, 1797, 1935, 2077, 2223, 2373, 2525, 2681, 2839, 3001, + 3165, 3331, 3499, 3669, 3839, 4011, 4185, 4359, 4533, 4709, + 4885, 5061, 5235, 5409, 5583, 5755, 5925, 6095, 6263, 6429, + 6593, 6755, 6913, 7069, 7221, 7371, 7517, 7659, 7797, 7931, + 8061, 8187, 8309, 8427, 8539, 8647, 8749, 8845, 8937, 9023, + 9103, 9177, 9245, 9307, 9363, 9413, 9457, 9495, 9527, 9553, + 9573, 9587, 9593, 9594, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 655, + 745, 841, 941, 1047, 1157, 1273, 1393, 1517, 1647, 1781, + 1919, 2061, 2207, 2355, 2507, 2663, 2821, 2981, 3145, 3311, + 3479, 3649, 3821, 3993, 4167, 4341, 4517, 4693, 4869, 5045, + 5221, 5397, 5573, 5747, 5921, 6093, 6265, 6435, 6603, 6769, + 6933, 7093, 7251, 7407, 7559, 7707, 7853, 7995, 8133, 8267, + 8397, 8521, 8641, 8757, 8867, 8973, 9073, 9169, 9259, 9343, + 9423, 9497, 9565, 9627, 9683, 9733, 9777, 9815, 9847, 9873, + 9893, 9907, 9913, 9914, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, + 747, 843, 945, 1051, 1163, 1279, 1401, 1527, 1657, 1791, + 1929, 2071, 2217, 2367, 2519, 2675, 2835, 2997, 3161, 3327, + 3495, 3665, 3837, 4011, 4185, 4361, 4537, 4715, 4893, 5071, + 5249, 5427, 5603, 5779, 5953, 6127, 6299, 6469, 6637, 6803, + 6967, 7129, 7289, 7445, 7597, 7747, 7893, 8035, 8173, 8307, + 8437, 8563, 8685, 8801, 8913, 9019, 9121, 9217, 9307, 9393, + 9473, 9547, 9615, 9677, 9733, 9783, 9827, 9865, 9897, 9923, + 9943, 9957, 9963, 9964, 0, 1, 7, 21, 41, 67, + 99, 137, 181, 231, 287, 349, 417, 491, 571, 657, + 749, 845, 947, 1055, 1167, 1285, 1407, 1533, 1663, 1799, + 1939, 2083, 2229, 2379, 2533, 2689, 2849, 3011, 3177, 3345, + 3515, 3687, 3861, 4035, 4211, 4387, 4565, 4743, 4921, 5099, + 5277, 5455, 5633, 5809, 5985, 6159, 6333, 6505, 6675, 6843, + 7009, 7171, 7331, 7487, 7641, 7791, 7937, 8081, 8221, 8357, + 8487, 8613, 8735, 8853, 8965, 9073, 9175, 9271, 9363, 9449, + 9529, 9603, 9671, 9733, 9789, 9839, 9883, 9921, 9953, 9979, + 9999, 10013, 10019, 10020, 0, 1, 7, 19, 39, 65, + 97, 135, 179, 229, 285, 347, 415, 489, 567, 651, + 741, 837, 937, 1043, 1153, 1269, 1389, 1513, 1643, 1777, + 1915, 2057, 2203, 2351, 2503, 2659, 2817, 2979, 3143, 3309, + 3477, 3647, 3819, 3993, 4169, 4345, 4523, 4701, 4881, 5061, + 5241, 5421, 5601, 5779, 5957, 6133, 6309, 6483, 6655, 6825, + 6993, 7159, 7323, 7485, 7643, 7799, 7951, 8099, 8245, 8387, + 8525, 8659, 8789, 8913, 9033, 9149, 9259, 9365, 9465, 9561, + 9651, 9735, 9813, 9887, 9955, 10017, 10073, 10123, 10167, 10205, + 10237, 10263, 10283, 10295, 10301, 10302, 0, 1, 7, 21, + 41, 67, 99, 137, 181, 231, 287, 349, 417, 491, + 571, 655, 745, 841, 941, 1047, 1159, 1275, 1395, 1521, + 1651, 1785, 1923, 2065, 2211, 2361, 2513, 2669, 2829, 2991, + 3155, 3321, 3491, 3663, 3837, 4011, 4187, 4365, 4543, 4723, + 4903, 5083, 5263, 5443, 5623, 5803, 5981, 6159, 6335, 6509, + 6683, 6855, 7025, 7191, 7355, 7517, 7677, 7833, 7985, 8135, + 8281, 8423, 8561, 8695, 8825, 8951, 9071, 9187, 9299, 9405, + 9505, 9601, 9691, 9775, 9855, 9929, 9997, 10059, 10115, 10165, + 10209, 10247, 10279, 10305, 10325, 10339, 10345, 10346, 0, 1, + 7, 21, 41, 67, 99, 137, 181, 231, 287, 349, + 417, 491, 571, 655, 745, 841, 943, 1049, 1161, 1277, + 1397, 1523, 1653, 1787, 1925, 2067, 2213, 2363, 2517, 2673, + 2833, 2995, 3159, 3327, 3497, 3669, 3843, 4019, 4195, 4373, + 4551, 4731, 4911, 5091, 5271, 5451, 5631, 5811, 5989, 6167, + 6343, 6519, 6693, 6865, 7035, 7203, 7367, 7529, 7689, 7845, + 7999, 8149, 8295, 8437, 8575, 8709, 8839, 8965, 9085, 9201, + 9313, 9419, 9521, 9617, 9707, 9791, 9871, 9945, 10013, 10075, + 10131, 10181, 10225, 10263, 10295, 10321, 10341, 10355, 10361, 10362, + 0, 1, 7, 21, 41, 67, 99, 137, 181, 231, + 287, 349, 417, 491, 571, 657, 747, 843, 945, 1051, + 1163, 1279, 1399, 1525, 1655, 1789, 1927, 2069, 2215, 2365, + 2519, 2675, 2835, 2997, 3161, 3329, 3499, 3671, 3845, 4021, + 4197, 4375, 4553, 4733, 4913, 5093, 5273, 5453, 5633, 5813, + 5991, 6169, 6345, 6521, 6695, 6867, 7037, 7205, 7369, 7531, + 7691, 7847, 8001, 8151, 8297, 8439, 8577, 8711, 8841, 8967, + 9087, 9203, 9315, 9421, 9523, 9619, 9709, 9795, 9875, 9949, + 10017, 10079, 10135, 10185, 10229, 10267, 10299, 10325, 10345, 10359, + 10365, 10366 +}; + +const Word16 ivas_pca_offset_n2[IVAS_PCA_N1] = +{ + 0, 2, 6, 14, 24, 38, 56, 76, 100, 126, 156, 188, + 224, 262, 302, 346, 392, 442, 494, 548, 604, 664, 726, 790, + 856, 924, 994, 1066, 1140, 1216, 1294, 1374, 1454, 1536, 1620, 1704, + 1790, 1878, 1966, 2054, 2144, 2234, 2324, 2416, 2508, 2600, 2692, 2784, + 2876, 2968, 3058, 3148, 3238, 3326, 3414, 3502, 3588, 3672, 3756, 3838, + 3918, 3998, 4076, 4152, 4226, 4298, 4368, 4436, 4502, 4566, 4628, 4688, + 4744, 4798, 4850, 4900, 4946, 4990, 5030, 5068, 5104, 5136, 5166, 5192, + 5216, 5236, 5254, 5268, 5278, 5286, 5290 +}; + +const Word16 ph1_q_n2_tbl[IVAS_PCA_N1][2] = { /* ph1_q : Q13, n2 : Q0 */ + { 0, 1 }, + { 286, 3 }, + { 572, 7 }, + { 858, 9 }, + { 1144, 13 }, + { 1430, 17 }, + { 1716, 19 }, + { 2002, 23 }, + { 2288, 25 }, + { 2574, 29 }, + { 2860, 31 }, + { 3146, 35 }, + { 3431, 37 }, + { 3717, 39 }, + { 4003, 43 }, + { 4289, 45 }, + { 4575, 49 }, + { 4861, 51 }, + { 5147, 53 }, + { 5433, 55 }, + { 5719, 59 }, + { 6005, 61 }, + { 6291, 63 }, + { 6577, 65 }, + { 6863, 67 }, + { 7149, 69 }, + { 7435, 71 }, + { 7721, 73 }, + { 8007, 75 }, + { 8293, 77 }, + { 8579, 79 }, + { 8865, 79 }, + { 9151, 81 }, + { 9437, 83 }, + { 9722, 83 }, + { 10008, 85 }, + { 10294, 87 }, + { 10580, 87 }, + { 10866, 87 }, + { 11152, 89 }, + { 11438, 89 }, + { 11724, 89 }, + { 12010, 91 }, + { 12296, 91 }, + { 12582, 91 }, + { 12868, 91 }, + { 13154, 91 }, + { 13440, 91 }, + { 13726, 91 }, + { 14012, 89 }, + { 14298, 89 }, + { 14584, 89 }, + { 14870, 87 }, + { 15156, 87 }, + { 15442, 87 }, + { 15728, 85 }, + { 16013, 83 }, + { 16299, 83 }, + { 16585, 81 }, + { 16871, 79 }, + { 17157, 79 }, + { 17443, 77 }, + { 17729, 75 }, + { 18015, 73 }, + { 18301, 71 }, + { 18587, 69 }, + { 18873, 67 }, + { 19159, 65 }, + { 19445, 63 }, + { 19731, 61 }, + { 20017, 59 }, + { 20303, 55 }, + { 20589, 53 }, + { 20875, 51 }, + { 21161, 49 }, + { 21447, 45 }, + { 21733, 43 }, + { 22019, 39 }, + { 22304, 37 }, + { 22590, 35 }, + { 22876, 31 }, + { 23162, 29 }, + { 23448, 25 }, + { 23734, 23 }, + { 24020, 19 }, + { 24306, 17 }, + { 24592, 13 }, + { 24878, 9 }, + { 25164, 7 }, + { 25450, 3 }, + { 25736, 1 } +}; + + +/*----------------------------------------------------------------------------------* + * Parametric MC ROM tables + *----------------------------------------------------------------------------------*/ + +const Word16 param_mc_band_grouping_20[20 + 1] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 17, 20, 23, 27, 33, 40, 52, 60 +}; + +const Word16 param_mc_coding_band_mapping_20[20] = +{ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +const Word16 param_mc_bands_coded_20[4] = +{ + 10, 14, 18, 20 +}; + +const Word16 param_mc_band_grouping_14[14 + 1] = +{ + 0, 1, 2, 3, 4, 5, 6, 8, 10, 13, 16, 20, 28, 40, 60 +}; + +const Word16 param_mc_coding_band_mapping_14[14] = +{ + 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 +}; + +const Word16 param_mc_bands_coded_14[4] = +{ + 8, 11, 13, 14 +}; + +const Word16 param_mc_band_grouping_10[10 + 1] = +{ + 0, 1, 2, 3, 5, 7, 10, 14, 20, 40, 60 +}; + + +const Word16 param_mc_bands_coded_10[4] = +{ + 6, 8, 9, 10 +}; + +const Word16 param_mc_coding_band_mapping_10[10] = +{ + 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 +}; + +const Word16 Param_MC_index[MAX_CICP_CHANNELS] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +}; + + +const Word32 ivas_param_mc_dmx_fac_CICP6_2tc_fx[12] = +{ + 2147483647,0,1518500224,1518500224,2147483647,0, /*Lt*/ + 0,2147483647,1518500224,1518500224,0,2147483647 /*Rt*/ +}; + +const Word32 ivas_param_mc_dmx_fac_CICP12_2tc_fx[16] = +{ + 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647 /*Rt*/ +}; + +const Word32 ivas_param_mc_dmx_fac_CICP12_3tc_fx[24] = +{ + 2147483647,0,0,0,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,0,0,0,2147483647,0,2147483647, /*Rt*/ + 0,0,2147483647,2147483647,0,0,0,0 /*Ct*/ +}; + +const Word32 ivas_param_mc_dmx_fac_CICP14_2tc_fx[16] = +{ + 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647 /*Rt*/ +}; +const Word32 ivas_param_mc_dmx_fac_CICP14_3tc_fx[24] = +{ + 2147483647,0,0,0,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,0,0,0,2147483647,0,2147483647, /*Rt*/ + 0,0,2147483647,2147483647,0,0,0,0 /*Ct*/ +}; + +const Word32 ivas_param_mc_dmx_fac_CICP16_3tc_fx[30] = +{ + 2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,0,0,0,2147483647,0,2147483647,0,2147483647, /*Rt*/ + 0,0,2147483647,2147483647,0,0,0,0,0,0 /*Ct*/ +}; + +const Word32 ivas_param_mc_dmx_fac_CICP19_3tc_fx[36] = +{ + 2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0,2147483647,0, /*Lt*/ + 0,2147483647,0,0,0,2147483647,0,2147483647,0,2147483647,0,2147483647, /*Rt*/ + 0,0,2147483647,2147483647,0,0,0,0,0,0,0,0 /*Ct*/ +}; + +#ifndef FIX_1157_OBSOLETE_DMX_TABLE +const Word32 ivas_param_mc_dmx_fac_CICP19_4tc_fx[48] = +{ + 2147483647,0,1518500224,1518500224,2147483647,0,2147483647,0,0,0,0,0, /*Lht*/ + 0,2147483647,1518500224,1518500224,0,2147483647,0,2147483647,0,0,0,0, /*Rht*/ + 0,0,0,0,0,0,0,0,2147483647,0,2147483647,0, /*Lut*/ + 0,0,0,0,0,0,0,0,0,2147483647,0,2147483647 /*Rut*/ +}; +#endif + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP6_2tc_fx[6] = +{ + 12832, + 12832, + 6820, + 10607, + 10607, + 6820 +}; + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP12_2tc_fx[8] = +{ + 11965, + 11965, + 6816, + 6877, + 6877, + 5619, + 5619, + 6816 +}; + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP12_3tc_fx[8] = +{ + 16384, + 16384, + 9502, + 9502, + 6553, + 6553, + 32767, + 8192 +}; +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP14_2tc_fx[8] = +{ + 11936, + 11936, + 5993, + 6945, + 6945, + 8049, + 8049, + 6816 +}; + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP14_3tc_fx[8] = +{ + 16291, + 16291, + 8257, + 8257, + 9666, + 9666, + 32767, + 8192 +}; + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP16_3tc_fx[10] = +{ + 11141, + 11141, + 7209, + 7209, + 6553, + 6553, + 5898, + 5898, + 32767, + 8192 +}; + +//Q15 +const Word16 ivas_param_mc_ild_fac_CICP19_3tc_fx[12] = +{ + 9830, + 9830, + 5570, + 5570, + 3932, + 3932, + 6226, + 6226, + 6226, + 6226, + 32767, + 16384 +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP6_2tc = +{ + 5, + 6, + {0,1,2,4,5,3}, + {1,1,2,1,1,2}, + {{0},{1},{0,1},{0},{1},{0,1}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP12_2tc = +{ + 7, + 8, + {0,1,2,4,5,6,7,3}, + {1,1,2,1,1,1,1,2}, + {{0},{1},{0,1},{0},{1},{0},{1},{0,1}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP12_3tc = +{ + 6, + 8, + {0,1,4,5,6,7,2,3}, + {1,1,1,1,1,1,1,1}, + {{0},{1},{0},{1},{0},{1},{2},{2}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP14_2tc = +{ + 7, + 8, + {0,1,2,4,5,6,7,3}, + {1,1,2,1,1,1,1,2}, + {{0},{1},{0,1},{0},{1},{0},{1},{0,1}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP14_3tc = +{ + 6, + 8, + {0,1,4,5,6,7,2,3}, + {1,1,1,1,1,1,1,1}, + {{0},{1},{0},{1},{0},{1},{2},{2}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP16_3tc = +{ + 8, + 10, + {0,1,4,5,6,7,8,9,2,3}, + {1,1,1,1,1,1,1,1,1,1}, + {{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} +}; + +const PARAM_MC_ILD_MAPPING ivas_param_mc_ild_mapping_CICP19_3tc = +{ + 10, + 12, + {0,1,4,5,6,7,8,9,10,11,2,3}, + {1,1,1,1,1,1,1,1,1,1,1,1}, + {{0},{1},{0},{1},{0},{1},{0},{1},{0},{1},{2},{2}} +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP6_2tc = +{ + 4, + 5, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 2, 3 }} /* C/LFE */ +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP12_2tc = +{ + 6, + 7, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 2, 6 }, /* C/BLS */ + { 2, 7 }, /* C/BRS */ + { 2, 3 } /* C/LFE */ + } +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP12_3tc = +{ + 6, + 7, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 0, 6 }, /* L/BLS */ + { 1, 7 }, /* R/BRS */ + { 2, 3 } /* C/LFE */ + } +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP14_2tc = +{ + 6, + 7, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 2, 6 }, /* C/UFL */ + { 2, 7 }, /* C/UFR */ + { 2, 3 } /* C/LFE */ + } +}; +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP14_3tc = +{ + 6, + 7, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 0, 6 }, /* L/UFL */ + { 1, 7 }, /* R/UFR */ + { 2, 3 } /* C/LFE */ + } +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP16_3tc = +{ + 8, + 9, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 0, 6 }, /* L/UFL */ + { 1, 7 }, /* R/UFR */ + { 4, 8 }, /* LS/UBL */ + { 5, 9 }, /* RS/UBR */ + { 2, 3 } /* C/LFE */ + } +}; + +const PARAM_MC_ICC_MAPPING ivas_param_mc_icc_mapping_CICP19_3tc = +{ + 10, + 11, + { { 0, 4 }, /* L/LS */ + { 1, 5 }, /* R/RS */ + { 0, 2 }, /* L/C */ + { 1, 2 }, /* R/C */ + { 0, 6 }, /* L/LBS */ + { 1, 7 }, /* R/RBS */ + { 0, 8 }, /* L/UFL */ + { 1, 9 }, /* R/UFR */ + { 6, 10 }, /* LBS/UBL */ + { 7, 11 }, /* RBS/UBR */ + { 2, 3 } /* C/LFE */ + } +}; + +const PARAM_MC_CONF ivas_param_mc_conf[PARAM_MC_NUM_CONFIGS] = +{ + /* CICP6 48000 */ + { + MC_LS_SETUP_5_1, + 6, + 2, + IVAS_48k, + &ivas_param_mc_ild_mapping_CICP6_2tc, + &ivas_param_mc_icc_mapping_CICP6_2tc, + &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] + }, + /* CICP6 64000 */ + { + MC_LS_SETUP_5_1, + 6, + 2, + IVAS_64k, + &ivas_param_mc_ild_mapping_CICP6_2tc, + &ivas_param_mc_icc_mapping_CICP6_2tc, + &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], + & ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] + }, + /* CICP6 80000 */ + { + MC_LS_SETUP_5_1, + 6, + 2, + IVAS_80k, + &ivas_param_mc_ild_mapping_CICP6_2tc, + &ivas_param_mc_icc_mapping_CICP6_2tc, + &ivas_param_mc_ild_fac_CICP6_2tc_fx[0], + & ivas_param_mc_dmx_fac_CICP6_2tc_fx[0] + }, + /* CICP12 48000 */ + { + MC_LS_SETUP_7_1, + 8, + 2, + IVAS_48k, + &ivas_param_mc_ild_mapping_CICP12_2tc, + &ivas_param_mc_icc_mapping_CICP12_2tc, + &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0] + }, + /* CICP12 64000 */ + { + MC_LS_SETUP_7_1, + 8, + 2, + IVAS_64k, + &ivas_param_mc_ild_mapping_CICP12_2tc, + &ivas_param_mc_icc_mapping_CICP12_2tc, + &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0] + }, + /* CICP12 80000 */ + { + MC_LS_SETUP_7_1, + 8, + 2, + IVAS_80k, + &ivas_param_mc_ild_mapping_CICP12_2tc, + &ivas_param_mc_icc_mapping_CICP12_2tc, + &ivas_param_mc_ild_fac_CICP12_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP12_2tc_fx[0], + }, + /* CICP12 96000 */ + { + MC_LS_SETUP_7_1, + 8, + 3, + IVAS_96k, + &ivas_param_mc_ild_mapping_CICP12_3tc, + &ivas_param_mc_icc_mapping_CICP12_3tc, + &ivas_param_mc_ild_fac_CICP12_3tc_fx[0], + &ivas_param_mc_dmx_fac_CICP12_3tc_fx[0] + }, + /* CICP14 48000 */ + { + MC_LS_SETUP_5_1_2, + 8, + 2, + IVAS_48k, + &ivas_param_mc_ild_mapping_CICP14_2tc, + &ivas_param_mc_icc_mapping_CICP14_2tc, + &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] + }, + /* CICP14 64000 */ + { + MC_LS_SETUP_5_1_2, + 8, + 2, + IVAS_64k, + &ivas_param_mc_ild_mapping_CICP14_2tc, + &ivas_param_mc_icc_mapping_CICP14_2tc, + &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] + }, + /* CICP14 80000 */ + { + MC_LS_SETUP_5_1_2, + 8, + 2, + IVAS_80k, + &ivas_param_mc_ild_mapping_CICP14_2tc, + &ivas_param_mc_icc_mapping_CICP14_2tc, + &ivas_param_mc_ild_fac_CICP14_2tc_fx[0], + &ivas_param_mc_dmx_fac_CICP14_2tc_fx[0] + }, + /* CICP14 96000 */ + { + MC_LS_SETUP_5_1_2, + 8, + 3, + IVAS_96k, + &ivas_param_mc_ild_mapping_CICP14_3tc, + &ivas_param_mc_icc_mapping_CICP14_3tc, + &ivas_param_mc_ild_fac_CICP14_3tc_fx[0], + &ivas_param_mc_dmx_fac_CICP14_3tc_fx[0] + }, + /* CICP16 96000 */ + { + MC_LS_SETUP_5_1_4, + 10, + 3, + IVAS_96k, + &ivas_param_mc_ild_mapping_CICP16_3tc, + &ivas_param_mc_icc_mapping_CICP16_3tc, + &ivas_param_mc_ild_fac_CICP16_3tc_fx[0], + &ivas_param_mc_dmx_fac_CICP16_3tc_fx[0] + }, + /* CICP16 128000 */ + { + MC_LS_SETUP_5_1_4, + 10, + 3, + IVAS_128k, + &ivas_param_mc_ild_mapping_CICP16_3tc, + &ivas_param_mc_icc_mapping_CICP16_3tc, + &ivas_param_mc_ild_fac_CICP16_3tc_fx[0], + &ivas_param_mc_dmx_fac_CICP16_3tc_fx[0] + }, + /* CICP19 128000 */ + { + MC_LS_SETUP_7_1_4, + 12, + 3, + IVAS_128k, + &ivas_param_mc_ild_mapping_CICP19_3tc, + &ivas_param_mc_icc_mapping_CICP19_3tc, + &ivas_param_mc_ild_fac_CICP19_3tc_fx[0], + &ivas_param_mc_dmx_fac_CICP19_3tc_fx[0] + } +}; + + +/* Alphabet for delta coding for the ICCs in Parametric MC processing */ +const UWord16 ivas_param_mc_cum_freq_icc_cicp6_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = +{ + 0, 24, 224, 20873, 42384, 51699, 57122, 60572, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_cicp6_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 24, 200, 20649, 21511, 9315, 5423, 3450, 4963 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 0, 4, 9, 124, 447, 1311, 4453, 18116, 48636, 60573, 63692, 64746, 65327, 65531, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = +{ + 4, 5, 115, 323, 864, 3142, 13663, 30520, 11937, 3119, 1054, 581, 204, 3, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_cicp12_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = +{ + 0, 30, 848, 26611, 47846, 57358, 61679, 63237, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_cicp12_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 30, 818, 25763, 21235, 9512, 4321, 1558, 2298 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 0, 2, 7, 53, 243, 979, 3994, 16732, 49642, 61343, 64331, 65158, 65438, 65532, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = +{ + 2, 5, 46, 190, 736, 3015, 12738, 32910, 11701, 2988, 827, 280, 94, 2, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_cicp14_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = +{ + 0, 46, 826, 27798, 49552, 58447, 62046, 63284, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_cicp14_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER ]={ + 46, 780, 26972, 21754, 8895, 3599, 1238, 2251 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 0, 3, 8, 36, 172, 763, 3436, 15845, 50168, 62005, 64676, 65298, 65481, 65533, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_delta_cicp14_48_16bits[2* PARAM_MC_SZ_ICC_QUANTIZER - 1] = +{ + 3, 5, 28, 136, 591, 2673, 12409, 34323, 11837, 2671, 622, 183, 52, 1, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_combined_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER + 1] = +{ + 0, 34, 552, 24717, 45819, 54772, 59054, 61166, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_combined_48_16bits[PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 34, 518, 24165, 21102, 8953, 4282, 2112, 4369 +}; + +const UWord16 ivas_param_mc_cum_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER] = +{ + 0, 3, 7, 74, 304, 1009, 3870, 16502, 49834, 61384, 64217, 65020, 65369, 65531, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_icc_delta_combined_48_16bits[2 * PARAM_MC_SZ_ICC_QUANTIZER - 1] = +{ + 3, 4, 67, 230, 705, 2861, 12632, 33332, 11550, 2833, 803, 349, 162, 3, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_cicp6_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = +{ + 0, 1092, 5574, 8315, 10652, 13875, 19656, 27664, 36284, 47058, 56251, 62579, 65118, 65462, 65513, 65532, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_cicp6_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 1092, 4482, 2741, 2337, 3223, 5781, 8008, 8620, 10774, 9193, 6328, 2539, 344, 51, 19, 3 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 0, 1, 2, 3, 5, 38, 146, 352, 638, 997, 1559, 2323, 3570, 5859, 10556, 21075, 44682, 55617, 60408, 62739, 63833, 64443, 64809, 65074, 65279, 65400, 65484, 65531, 65532, 65533, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp6_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = +{ + 1, 1, 1, 2, 33, 108, 206, 286, 359, 562, 764, 1247, 2289, 4697, 10519, 23607, 10935, 4791, 2331, 1094, 610, 366, 265, 205, 121, 84, 47, 1, 1, 1, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_cicp12_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = +{ + 0, 967, 6335, 9941, 12837, 16652, 22416, 29814, 38807, 48497, 57184, 62661, 64916, 65466, 65514, 65530, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_cicp12_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 967, 5368, 3606, 2896, 3815, 5764, 7398, 8993, 9690, 8687, 5477, 2255, 550, 48, 16, 5 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 0, 1, 2, 3, 5, 18, 61, 149, 320, 592, 1083, 1793, 2974, 5257, 10133, 21274, 44342, 55891, 60895, 63174, 64244, 64793, 65100, 65287, 65406, 65477, 65517, 65531, 65532, 65533, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp12_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = +{ + 1, 1, 1, 2, 13, 43, 88, 171, 272, 491, 710, 1181, 2283, 4876, 11141, 23068, 11549, 5004, 2279, 1070, 549, 307, 187, 119, 71, 40, 14, 1, 1, 1, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_cicp14_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS + 1] = +{ + 0, 229, 7068, 10910, 13856, 17467, 22629, 29174, 36906, 46558, 55579, 61802, 65222, 65505, 65527, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_cicp14_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 229, 6839, 3842, 2946, 3611, 5162, 6545, 7732, 9652, 9021, 6223, 3420, 283, 22, 7, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 0, 1, 2, 3, 4, 12, 56, 153, 278, 475, 856, 1430, 2489, 4723, 9580, 20685, 45423, 56274, 60948, 63097, 64128, 64679, 65002, 65208, 65348, 65445, 65517, 65531, 65532, 65533, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_delta_cicp14_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = +{ + 1, 1, 1, 1, 8, 44, 97, 125, 197, 381, 574, 1059, 2234, 4857, 11105, 24738, 10851, 4674, 2149, 1031, 551, 323, 206, 140, 97, 72, 14, 1, 1, 1, 1 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_combined_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS+1] = +{ + 0, 1453, 8326, 12221, 15164, 18764, 24177, 31297, 39520, 49154, 57135, 62460, 64821, 65468, 65514, 65530, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_combined_48_16bits[PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 1453, 6873, 3895, 2943, 3600, 5413, 7120, 8223, 9634, 7981, 5325, 2361, 647, 46, 16, 5 +}; + +const UWord16 ivas_param_mc_cum_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS] = +{ + 0, 1, 2, 3, 5, 29, 98, 220, 414, 699, 1186, 1876, 3049, 5304, 10013, 20612, 45247, 56109, 60818, 63022, 64081, 64647, 64977, 65198, 65348, 65443, 65502, 65530, 65532, 65533, 65534, 65535 +}; + +const UWord16 ivas_param_mc_sym_freq_ild_delta_combined_48_16bits[2 * PARAM_MC_SZ_ILD_QUANTIZER_4BITS - 1] = +{ + 1, 1, 1, 2, 24, 69, 122, 194, 285, 487, 690, 1173, 2255, 4709, 10599, 24635, 10862, 4709, 2204, 1059, 566, 330, 221, 150, 95, 59, 28, 2, 1, 1, 1 +}; + + +/*----------------------------------------------------------------------------------* + * MASA ROM tables + *----------------------------------------------------------------------------------*/ + + +#ifdef FIX_1121_MASA_DESCRIPTOR +const UWord8 ivasmasaFormatDescriptor[8] = +{ + 0x49, 0x56, 0x41, 0x53, 0x4D, 0x41, 0x53, 0x41 /* "IVASMASA" */ +}; + +#endif +const Word64 diffuseness_reconstructions_hr_fx[HR_MASA_ER_LEVELS] = { /* Q62 */ + 0, + 65865144550293504, + 138485688541642752, + 239816680157478912, + 355502895585558528, + 485544334825881600, + 667940119734386688, + 902690250311073792, + 1225260573621485568, + 1635651089665622016, + 2011983133527769088, + 2354256705207926784, + 2741003323208368128, + 3172222987529093120, + 3693796119373938688, + 4305722718742904832, +}; + +const Word32 diffuseness_thresholds_hr_fx[HR_MASA_ER_LEVELS + 1] = { /* Q30 */ + 0, + 10223616, + 20447232, + 44040192, + 67633152, + 97910784, + 128188416, + 182845440, + 237502464, + 333053952, + 428605440, + 508297216, + 587988992, + 688390144, + 788791296, + 931266560, + MAX_32 /* out-of-range large value to make searching easier */ +}; + +const Word16 bits_direction_masa[DIRAC_DIFFUSE_LEVELS] = +{ + 11, + 11, + 10, + 9, + 7, + 6, + 5, + 3 +}; + + +const Word16 len_cb_dct0_masa[DIRAC_DIFFUSE_LEVELS] = { 7, 6, 5, 4, 4, 4, 3, 2 }; + +const UWord8 sur_coherence_cb_masa[MASA_MAX_NO_CV_SUR_COH*MASA_NO_CB_SUR_COH] = +{ + 16, 99, 0, 0, 0, 0, 0, 0, + 12, 64, 167, 0, 0, 0, 0, 0, + 10, 45, 100, 218, 0, 0, 0, 0, + 8, 34, 70, 124, 235, 0, 0, 0, + 7, 27, 55, 90, 141, 242, 0, 0, + 7, 23, 45, 71, 105, 153, 247, 0, + 6, 20, 38, 60, 86, 119, 165, 249 +}; + +const Word16 idx_cb_sur_coh_masa[MASA_MAX_NO_CV_SUR_COH] = { 0, 1, 2, 3, 4, 5, 5, 6 }; + +const Word16 len_huf_masa[MASA_NO_CV_COH1] = { 4, 2, 1, 3, 4 }; + +const Word16 huff_code_av_masa[MASA_NO_CV_COH1] = { 15, 2, 0, 6, 14 }; + +const Word16 no_theta_masa[NO_SPHERICAL_GRIDS-2] = /* from 1 to 11 bits */ +{ /*1, 1,*/ 2 ,2 , 4, 5, 6, 7, 10, 14, 19 + /*0, 2, 8, 6, 7, 12, 14, 16*/ +}; + +const Word16 no_phi_masa[NO_SPHERICAL_GRIDS][MAX_NO_THETA] = /* from 1 to 11 bits*/ +{ + { 2 }, + { 4 }, + { 4, 2 }, + { 8, 4 }, /* 8, 4*/ + { 12, 7, 2, 1 }, /* 12, */ + { 14, 13, 9, 2, 1 }, + { 22, 21, 17, 11, 3, 1 }, + { 33, 32, 29, 23, 17, 9, 1 }, + { 48, 47, 45, 41, 35, 28, 20, 12, 2, 1 }, + { 60, 60, 58, 56, 54, 50, 46, 41, 36, 30, 23, 17, 10, 1 }, + { 89, 89, 88, 86, 84, 81, 77, 73, 68, 63, 57, 51, 44, 38, 30, 23, 15, 8, 1 } +}; + +const Word16 MASA_band_grouping_24[24 + 1] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 30, 40, 60 +}; + +const Word16 MASA_band_mapping_24_to_18[18 + 1] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 17, 20, 21, 22, 23, 24 +}; + +const Word16 MASA_band_mapping_24_to_12[12 + 1] = +{ + 0, 1, 2, 3, 4, 5, 7, 9, 12, 15, 20, 22, 24 +}; + +const Word16 MASA_band_mapping_24_to_8[8 + 1] = +{ + 0, 1, 2, 3, 5, 8, 12, 20, 24 +}; + +const Word16 MASA_band_mapping_24_to_5[5 + 1] = +{ + 0, 1, 3, 7, 15, 24 +}; + +const Word16 MASA_grouping_8_to_5[8] = +{ + 0, 1, 1, 2, 3, 3, 4, 4 +}; + +const Word16 MASA_grouping_12_to_5[12] = +{ + 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4 +}; + +const Word16 MASA_grouping_18_to_5[18] = +{ + 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4 +}; + +const Word16 MASA_grouping_24_to_5[24] = +{ + 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4 +}; + +/* IVAS_13k2, IVAS_16k4, IVAS_24k4, IVAS_32k, IVAS_48k, IVAS_64k, IVAS_80k, IVAS_96k, IVAS_128k, IVAS_160k, IVAS_192k, IVAS_256k, IVAS_384k, IVAS_512k */ +const Word16 masa_bits[IVAS_NUM_ACTIVE_BRATES] = +{ + 50, 60, 70, 85, 140, 180, 220, 256, 350, 432, 528, 832, 1024, MASA_MAX_BITS +}; + +const Word16 masa_bits_LR_stereo[4] = +{ + 50, 50, 60, 70 +}; + +const Word16 mcmasa_bits[IVAS_NUM_ACTIVE_BRATES] = +{ + 50, 70, 80, 120, 140, 160, 220, 256, 288, 432, 528, 832, 1024, MASA_MAX_BITS +}; + +const UWord8 masa_nbands[IVAS_NUM_ACTIVE_BRATES] = +{ + 5, 5, 5, 5, 5, 5, 5, 5, 8, 12, 18, 24, 24, 24 +}; + +const UWord8 masa_joined_nbands[IVAS_NUM_ACTIVE_BRATES] = +{ + 5, 5, 5, 8, 12, 12, 12, 18, 18, 18, 18, 24, 24, 24 +}; + +const UWord8 masa_twodir_bands[IVAS_NUM_ACTIVE_BRATES] = +{ + 0, 0, 0, 0, 0, 1, 1, 1, 3, 4, 6, 6, 9, 24 +}; + +const UWord8 masa_twodir_bands_joined[IVAS_NUM_ACTIVE_BRATES] = +{ + 0, 0, 0, 0, 0, 2, 2, 3, 4, 6, 8, 9, 12, MASA_MAXIMUM_TWO_DIR_BANDS +}; + + +/*----------------------------------------------------------------------------------* + * OMASA ROM tables + *----------------------------------------------------------------------------------*/ + +const Word32 sep_object_brate[][MAX_NUM_OBJECTS] = +{ + {0, 0, 0, 0}, /* 13k2 */ + {0, 0, 0, 0}, /* 16k4 */ + {9600, 0, 0, 0}, /* 24k4 */ + {IVAS_13k2, 0, 0, 0}, /* 32k */ + {16000, 11000, 0, 0}, /* 48k */ + {16000, 11700, 0, 0}, /* 64k */ + {20000, 16000, 0, 0}, /* 80k */ + {IVAS_32k, 20000, 20000, 0}, /* 96k */ + {IVAS_32k, IVAS_24k4, 24000, 24000}, /* 128k */ + {IVAS_48k, IVAS_32k, IVAS_24k4, 24000}, /* 160k */ + {IVAS_64k, IVAS_48k, IVAS_32k, IVAS_24k4}, /* 192k */ + {IVAS_96k, IVAS_64k, IVAS_48k, IVAS_32k}, /* 256k */ + {IVAS_128k, IVAS_80k, IVAS_64k, IVAS_48k}, /* 384k */ + {IVAS_128k, IVAS_96k, IVAS_80k, IVAS_64k} /* 512k */ +}; + +/* column wise DCT matrices for 4 5, and 8 dim */ +/*----------------------------------------------------------------------------------* + * Param ISM ROM tables + *----------------------------------------------------------------------------------*/ + +const Word16 Param_ISM_band_grouping[MAX_PARAM_ISM_NBANDS + 1] = +{ + 0, 1, 2, 3, 4, 6, 8, 11, 15, 21, 31, 60 +}; + +/*----------------------------------------------------------------------------------* + * LFE coding ROM tables + *----------------------------------------------------------------------------------*/ + +const ivas_lfe_freq_models ivas_str_lfe_freq_models = +{ + { 16384, 14924, 13463, 12003, 10542, 9082, 7622, 6161, + 4701, 4336, 3970, 3605, 3240, 2875, 2510, 2145, + 1780, 1689, 1597, 1506, 1415, 1323, 1232, 1141, + 1050, 1004, 958, 913, 867, 821, 776, 730, + 685, 639, 593, 548, 502, 456, 411, 365, + 319, 297, 274, 251, 228, 205, 183, 160, + 137, 126, 114, 103, 91, 80, 68, 57, + 46, 40, 34, 29, 23, 17, 11, 6, 0 }, + + { 16384, 13463, 10542, 7622, 4701, 3970, 3240, 2510, + 1780, 1597, 1415, 1232, 1050, 958, 867, 776, + 685, 593, 502, 411, 319, 274, 228, 183, + 137, 114, 91, 68, 46, 34, 23, 11, 0 }, + + { 16384, 4701, 1780, 1050, 685, 319, 137, 46, + 0, }, + + { 16384, 3277, 0 }, + + { 16384, 13463, 10542, 7622, 4701, 3970, 3240, 2510, + 1780, 1597, 1415, 1232, 1050, 958, 867, 776, + 685, 593, 502, 411, 319, 274, 228, 183, + 137, 114, 91, 68, 46, 34, 23, 11, + 0 }, + + { 16384, 10542, 4701, 3240, 1780, 1415, 1050, 867, + 685, 502, 319, 228, 137, 91, 46, 23, + 0 }, + + { 16384, 4468, 1489, 745, 0 }, 0, +}; + +const Word16 ivas_lfe_num_ele_in_coder_models[2][4] = +{ + { 63, 31, 7, 1 },{ 31, 15, 3, 0 } +}; + +const Word16 ivas_lfe_log2_num_ele_in_coder_models_fx[2][4] = +{ + { 6, 5, 3, 1 },{ 5, 4, 2, 0 } +}; + +const Word16 ivas_lfe_num_dct_pass_bins_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP] = { 8, 6 }; + +const Word16 ivas_lfe_min_shift_tbl[IVAS_LFE_NUM_COEFFS_IN_SUBGRP] = { 1, 0 }; + +const Word16 ivas_lfe_lpf_delay_Q15[2] = { 57, 114 }; +#ifdef NONBE_FIX_MC_LFE_LPF +const Word32 ivas_lfe_lpf_delay_ns[2] = { 1750000, 3500000 }; +#endif + +const Word16 dirac_gains_P_idx[16] = +{ + -1, 1, 0, 1, 4, 3, 2, 3, 4, 8, 7, 6, 5, 6, 7, 8 +}; + +/*----------------------------------------------------------------------------------* + * FB ROM tables + *----------------------------------------------------------------------------------*/ + +const Word32 ivas_fb_fcs_12band_1ms_fx[IVAS_FB_BANDS_12] = +{ + 17895696, 53687092, 89478488, 125269880, + 161061280, 196852672, 232644064, 304226848, + 465288128, 715827904, 1091637520, 1735882615 +};/*Q31*/ + +const Word16 ivas_fb_abs_bins_per_band_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = +{ + { 24, 30, 30, 30, 30, 30, 42, 76, 124, 182, 291, 367 }, + { 24, 30, 30, 30, 30, 30, 42, 76, 124, 182, 260, 47 }, + { 24, 30, 30, 30, 30, 30, 42, 75, 122, 73, 0, 0 } +}; + +const Word16 ivas_fb_abs_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = +{ + {0, 9, 25, 41, 57, 73, 88, 110, 158, 246, 380, 593 }, + {0, 9, 25, 41, 57, 73, 88, 110, 158, 246, 380, 593 }, + {0, 9, 25, 41, 57, 73, 88, 110, 159, 247, 0, 0 } +}; + +const Word16 ivas_fb_bins_per_band_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = +{ + { + IVAS_FB_12_1MS_48K_END_BINS_BAND_0 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_0, + IVAS_FB_12_1MS_48K_END_BINS_BAND_1 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_48K_END_BINS_BAND_2 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_2, + IVAS_FB_12_1MS_48K_END_BINS_BAND_3 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_48K_END_BINS_BAND_4 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_4, + IVAS_FB_12_1MS_48K_END_BINS_BAND_5 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_48K_END_BINS_BAND_6 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_6, + IVAS_FB_12_1MS_48K_END_BINS_BAND_7 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_48K_END_BINS_BAND_8 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_8, + IVAS_FB_12_1MS_48K_END_BINS_BAND_9 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_48K_END_BINS_BAND_10 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_10, + IVAS_FB_12_1MS_48K_END_BINS_BAND_11 - IVAS_FB_12_1MS_48K_START_OFFSET_BAND_11 + }, + { + IVAS_FB_12_1MS_32K_END_BINS_BAND_0 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_0, + IVAS_FB_12_1MS_32K_END_BINS_BAND_1 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_32K_END_BINS_BAND_2 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_2, + IVAS_FB_12_1MS_32K_END_BINS_BAND_3 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_32K_END_BINS_BAND_4 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_4, + IVAS_FB_12_1MS_32K_END_BINS_BAND_5 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_32K_END_BINS_BAND_6 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_6, + IVAS_FB_12_1MS_32K_END_BINS_BAND_7 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_32K_END_BINS_BAND_8 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_8, + IVAS_FB_12_1MS_32K_END_BINS_BAND_9 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_32K_END_BINS_BAND_10 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_10, + IVAS_FB_12_1MS_32K_END_BINS_BAND_11 - IVAS_FB_12_1MS_32K_START_OFFSET_BAND_11 + }, + { + IVAS_FB_12_1MS_16K_END_BINS_BAND_0 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_0, + IVAS_FB_12_1MS_16K_END_BINS_BAND_1 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_16K_END_BINS_BAND_2 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_2, + IVAS_FB_12_1MS_16K_END_BINS_BAND_3 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_16K_END_BINS_BAND_4 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_4, + IVAS_FB_12_1MS_16K_END_BINS_BAND_5 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_16K_END_BINS_BAND_6 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_6, + IVAS_FB_12_1MS_16K_END_BINS_BAND_7 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_16K_END_BINS_BAND_8 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_8, + IVAS_FB_12_1MS_16K_END_BINS_BAND_9 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_16K_END_BINS_BAND_10 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_10, + IVAS_FB_12_1MS_16K_END_BINS_BAND_11 - IVAS_FB_12_1MS_16K_START_OFFSET_BAND_11 + }, +}; + +const Word16 ivas_fb_bins_start_offset_12band_1ms[IVAS_NUM_SUPPORTED_FS][IVAS_FB_BANDS_12] = +{ + { + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_48K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_48K_START_OFFSET_BAND_11 + }, + { + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_32K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_32K_START_OFFSET_BAND_11 + }, + { + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_0, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_1, + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_2, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_3, + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_4, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_5, + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_6, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_7, + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_8, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_9, + IVAS_FB_12_1MS_16K_START_OFFSET_BAND_10, IVAS_FB_12_1MS_16K_START_OFFSET_BAND_11 + }, +}; + + +const Word16 ivas_num_active_bands[FB - WB + 1] = +{ + IVAS_16K_12BANDS_ACTIVE_BANDS, IVAS_FB_BANDS_12, IVAS_FB_BANDS_12 +}; + +/*------------------------------------------------------------------------------------------* + * SNS MSVQ codebooks and means + *------------------------------------------------------------------------------------------*/ + +const Word16 ivas_sns_cdbks_tcx20_levels[SNS_MSVQ_NSTAGES_TCX20] = { 128, 64, 32, 32 }; + +const Word16 ivas_sns_cdbks_tcx20_bits[SNS_MSVQ_NSTAGES_TCX20] = { 7, 6, 5, 5 }; + +/* pre-rounded codebook vectors for singed Q4.12 represantation */ + +const Word16 ivas_sns_cdbks_tcx10_levels[SNS_MSVQ_NSTAGES_TCX10] = { 128, 32, 8 }; + +const Word16 ivas_sns_cdbks_tcx10_bits[SNS_MSVQ_NSTAGES_TCX10] = { 7, 5, 3 }; + + +const Word16 ivas_sns_cdbks_side_tcx20_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 32 }; +const Word16 ivas_sns_cdbks_side_tcx20_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 5 }; +const Word16 ivas_sns_cdbks_side_tcx10_levels[SNS_MSVQ_NSTAGES_SIDE] = { 32, 8 }; +const Word16 ivas_sns_cdbks_side_tcx10_bits[SNS_MSVQ_NSTAGES_SIDE] = { 5, 3 }; + + +const Word16 sns_1st_cdbk[2][2][8 * 32] = +{ + { /* split 1 */ + { /* TCX 20 */ + -10900, -11064, -10637, -10471, -9051, -6381, -4688, -2438, + -2119, -5087, -6702, -8118, -7586, -6343, -4828, -3406, + 2004, -3443, -4289, -3757, -3234, -2952, -2313, -1781, + 1749, 5598, 3916, 732, -1472, -2964, -3275, -2332, + -11978, -14369, -5600, -545, 981, -929, -57, 1903, + 1745, 391, 202, 115, 256, -291, -862, -1637, + -4052, 2059, 4709, 6768, 5595, 1975, -1723, -1218, + 2093, 7263, 8679, 7576, 3701, -2438, -4389, -2686, + -7120, -6279, -5715, -5520, -4752, -3125, -1856, -438, + 8131, -2543, -6285, -6723, -5588, -4321, -3264, -2164, + -653, -1301, -660, 608, 1598, 1805, 1698, 760, + 4882, 9309, 6333, 1734, 284, 364, 560, 1015, + -7686, -5737, -3443, -1642, 245, 1531, 1827, 1769, + -1468, 3782, 144, -5130, -6883, -5165, -1497, 2072, + -12937, -8429, -2619, 2894, 5004, 4710, 4627, 3740, + 3198, 3928, 4358, 4554, 3887, 2844, 1299, 129, + -13828, -12296, -9364, -7918, -5571, -1909, 307, 2047, + -4314, -1211, -559, -1061, -1928, -2228, -2359, -1902, + -309, -3224, -3404, -1895, -743, -59, 757, 908, + 10914, 5865, 1599, -386, -1392, -2285, -2236, -2042, + -11825, -16241, -11402, -3627, 6556, 8953, 6421, 1546, + 6102, 777, -301, 536, 902, 541, 210, -429, + -3052, 3997, 5389, 1842, -344, 1556, 2667, 2428, + 11788, 10894, 7448, 5423, 2372, -677, -2385, -3839, + -45, -7602, -8923, -7179, -3273, 65, 4500, 6726, + 5895, 626, -1610, -2598, -3240, -3540, -2930, -2156, + -971, 461, 1494, 4907, 5859, 5199, 3678, 2502, + 10766, 5297, 1844, 1236, 2498, 3503, 2846, 838, + -7816, -1212, 891, 2387, 1317, 2225, 1859, 1602, + 2376, 5357, 2088, -2719, -3419, -420, 2431, 2943, + -8383, -795, 4351, 7026, 7460, 7191, 5262, 3796, + 1522, 6283, 8714, 8222, 7434, 5768, 3586, 1499, + }, + { /* TCX 10 */ + -15596, -16321, -10264, -1002, 5955, 5543, -29, -1688, + 17, -3794, -6207, -7356, -6998, -6081, -4453, -2448, + -12543, -11530, -10186, -8817, -7083, -4440, -1946, 892, + 5198, 2751, -274, -2574, -4561, -6087, -5944, -4600, + -683, -2640, -2753, -1195, -239, -217, -286, 90, + -1400, -1146, -1853, -2845, -3456, -3788, -3171, -1969, + -1835, 392, 1725, 1209, -392, -1640, -2001, -1608, + 5770, 7707, 5210, 2112, -382, -2088, -2634, -3007, + -10766, -8101, -5137, -3754, -1881, 331, 2339, 3679, + -2637, -4640, -5811, -5651, -3790, -1359, 913, 1893, + -7793, -4768, -1762, -545, -717, -837, -441, -75, + 4030, 1770, 467, 379, 10, -1330, -2398, -2290, + -9395, -6952, -2494, 2022, 4753, 5614, 4443, 2642, + -1486, 1748, 859, -2586, -3368, -638, 2761, 3269, + -2408, 306, 3633, 6567, 5950, 2474, -621, -1421, + 5478, 7986, 9498, 8165, 5477, 1244, -523, -1586, + -13564, -14673, -10597, -5504, 1575, 8248, 7662, 4025, + 4978, -682, -3586, -4305, -3703, -3001, -2227, -1278, + -8002, -6831, -5558, -4868, -4243, -3393, -2486, -1110, + 11485, 5472, 1645, -533, -1792, -2814, -3169, -2706, + 1617, 421, 232, 1382, 2162, 2017, 1318, 744, + 3677, 5212, 1990, -1514, -2894, -2441, -451, 592, + 731, 4295, 5860, 3756, 1991, 1437, 869, 127, + 12736, 11722, 7768, 4682, 1574, -744, -1989, -3131, + -3490, -4269, -3681, -1531, 1111, 3327, 4138, 3815, + 7344, 1400, -1302, -1502, -1015, 57, 1212, 1498, + -4836, -1881, 1071, 2055, 2114, 2465, 2093, 1458, + 8569, 5879, 3654, 2879, 2530, 1703, 781, -233, + -3709, -990, 2338, 6227, 7083, 7102, 5657, 3401, + 3389, 6392, 5267, 1011, 275, 3519, 5236, 4339, + 599, 3752, 6943, 9211, 8152, 5568, 3337, 1838, + 9885, 9591, 7905, 8068, 7929, 7421, 4234, 757, + } + }, + { /* split 2 */ + { /* TCX 20 */ + -178, -3476, -5982, -7081, -7548, -7440, -6859, -5798, + -3596, -3670, -1501, 770, 812, -286, -2001, -3377, + -3998, -5191, -4988, -4421, -3889, -3571, -2738, -1969, + -2981, -2687, -1501, -83, 1136, 2377, 3248, 4105, + 1842, -41, -1972, -4282, -6779, -8405, -8674, -7835, + -259, 571, 2124, 3344, 2959, 1407, -750, -2523, + -524, -1956, -2855, -3202, -3939, -4666, -4907, -4782, + -5110, -4768, -3017, -663, 4188, 9210, 16602, 21081, + 4373, 4846, -603, -6495, -7289, -5540, -4749, -5527, + -1448, -1043, -619, -105, 356, 362, 542, 857, + 1373, -752, -5334, -6244, -3001, -932, -1040, -3125, + -2403, -1397, 612, 2449, 3920, 5231, 6819, 8581, + 2183, 1211, -111, -1084, -2836, -4977, -6701, -7284, + -751, 1255, 3408, 6474, 7503, 7026, 5413, 4464, + 935, 850, 589, 353, 160, -434, -939, -931, + 268, 2284, 3884, 5423, 6680, 7996, 9244, 9472, + 1075, 113, -1289, -4457, -7512, -5930, -1799, -571, + -3689, -4254, -3755, -2995, -1581, -135, 1049, 1589, + -1166, -1752, -1790, -1897, -1927, -1831, -1359, -805, + -1494, -735, 635, 1993, 2909, 3546, 4226, 4956, + 4435, 4299, 4269, 1328, -3731, -7621, -9319, -9170, + 1358, 2227, 3873, 4469, 4692, 4057, 2601, 1608, + 813, 398, -499, -666, -1286, -2271, -3316, -4025, + -3300, -1255, 2181, 6431, 10002, 12760, 13549, 12584, + 3714, 4180, 484, -2905, -2864, -1359, -1256, -2477, + 308, 868, 1373, 1629, 1793, 1834, 1814, 1746, + 1472, 798, -282, -1935, -1818, 320, 2221, 2914, + 2281, 3240, 2988, 1400, 2383, 4072, 5667, 6675, + 2672, 2678, 2874, 2096, -226, -2301, -3861, -4534, + 4988, 7231, 7641, 7731, 7061, 6447, 5411, 3513, + 3978, 4156, 4126, 2896, 1469, 759, 368, -68, + -264, 4210, 8534, 11008, 11606, 11888, 11072, 8949, + }, + { /* TCX 10 */ + -2852, -6158, -7231, -7830, -8012, -7922, -7556, -6706, + -3911, -5340, -5053, -4741, -4805, -4484, -3727, -3037, + -966, -1461, -1694, -2427, -3081, -3037, -2547, -2230, + -3455, -3315, -2451, -836, 1383, 3196, 3720, 3379, + 3052, 281, -3351, -6866, -9051, -9586, -8983, -8236, + -748, -4465, -4314, -2251, 29, -40, -3963, -6195, + 200, 1293, 2535, 2803, 1603, -186, -1397, -1697, + -1707, -265, 2196, 5295, 5894, 4216, 3440, 3826, + -237, -2133, -2279, -3149, -4377, -5638, -6520, -6764, + -2407, -2049, -1246, -664, -521, -430, -349, -211, + 3874, 1335, -1501, -2055, -1268, -990, -1852, -2871, + -1883, -1845, -1681, -484, 384, 2035, 5839, 9597, + 275, 380, 1048, 424, -1146, -3012, -4431, -5104, + -1699, -484, 756, 1261, 1279, 1377, 1975, 2590, + 2139, 4502, 3645, 4975, 6491, 5972, 5012, 4346, + -3821, -2581, -433, 2667, 6436, 10038, 11311, 8783, + 2359, -2689, -6604, -7039, -5992, -4268, -3711, -4840, + -2776, -4251, -4539, -3672, -2494, -1055, 280, 695, + 491, 866, 822, -44, -1009, -1165, -831, -538, + -1024, 91, 786, 1295, 2433, 3910, 4975, 5403, + 3117, 2590, 2337, -667, -4580, -8147, -9400, -9523, + -103, -630, -831, 669, 3062, 3398, 549, -1690, + 2113, 3467, 4279, 5047, 5344, 3361, 127, -2313, + -1199, 1153, 2914, 3688, 4260, 5421, 7471, 8831, + 2815, 2184, 316, -3058, -5596, -5564, -4343, -3793, + 922, 126, -1414, -1731, -1007, 359, 2029, 3088, + 4889, 4619, 2537, 1114, 950, 946, 799, 419, + -4271, -3750, -3359, -484, 1448, 4106, 10487, 20479, + 3818, 4687, 4064, 2212, -172, -2287, -3535, -4041, + 884, 2456, 3394, 2925, 2182, 2323, 2583, 2507, + 4767, 8057, 8263, 6461, 5003, 4055, 2923, 1845, + 19, 3813, 6926, 8432, 10141, 10850, 9692, 8383, + } + } +}; + +const Word16 sns_1st_means_16k[2][16] = +{ + { /* TCX 20 */ + 14210, 19017, 14362, 9309, 5385, 2674, 1055, -211, -1407, -3059, -4393, -8597, -11180, -11756, -12131, -13281, + }, + { /* TCX 10*/ + 12018, 15915, 11089, 6015, 847, -705, -539, -1548, -893, -2163, -1806, -4189, -7017, -8670, -8874, -9480, + } +}; + +const Word16 sns_1st_means_25k6[2][16] = +{ + { /* TCX 20 */ + 14973, 20323, 16461, 9554, 4017, 3103, 1602, 1694, -221, -1401, -6817, -10071, -11503, -11805, -13158, -16749, + }, + { /* TCX 10 */ + 15560, 19489, 14623, 5595, 2084, 1699, 775, -1312, -2195, -6101, -9078, -9465, -7825, -6603, -7281, -9960, + } +}; + +const Word16 sns_1st_means_32k[2][16] = +{ + { /* TCX 20 */ + 15041, 20603, 16969, 10289, 4973, 4283, 3003, 3316, 1684, -259, -6614, -9535, -10363, -11834, -16625, -24930, + }, + { /* TCX 10 */ + 16510, 20660, 16025, 7224, 3921, 3868, 2623, 742, -1316, -6269, -8284, -7288, -6380, -8410, -13351, -20277, + } +}; + + +/*----------------------------------------------------------------------* + * MC ParamUpmix ROM tables + *-----------------------------------------------------------------------*/ + +const Word16 ivas_param_upmx_mx_qmap[33] = +{ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 7, 6, 5, 4, 3, 2, 1, 0 +}; + + +/*----------------------------------------------------------------------* + * MDCT/IMDCT tables + *-----------------------------------------------------------------------*/ + #define SHC( x ) ( (Word16) x ) -/* clang-format off */ const Word16 ivas_sin_twiddle_480_fx[ IVAS_480_PT_LEN >> 1 ] = { SHC( 0xffe6 ), SHC( 0xff0f ), SHC( 0xfe39 ), SHC( 0xfd62 ), SHC( 0xfc8c ), SHC( 0xfbb6 ), SHC( 0xfadf ), SHC( 0xfa09 ), SHC( 0xf933 ), SHC( 0xf85d ), SHC( 0xf787 ), SHC( 0xf6b1 ), SHC( 0xf5db ), SHC( 0xf505 ), SHC( 0xf42f ), SHC( 0xf35a ), @@ -573,9 +3452,10 @@ const Word16 pow_10_q11[128] = { 13540, 13786, 14036, 14291, 14550, 14815, 15084, 15357, 15636, 15920, 16209, 16503, 16803, 17108, 17418, 17734, 18056, 18384, 18718, 19058, 19404, 19756, 20114 }; - // Q12 -const Word16 icbwe_gsMapping_tbl_fx[16] = { -8192, -5527, -3935, -2907, -2289, -1824, -1404, -1035, -692, -404, -286, -204, -81, 0, 163, 327 }; +const Word16 icbwe_gsMapping_tbl_fx[16] = { + -8192, -5527, -3935, -2907, -2289, -1824, -1404, -1035, -692, -404, -286, -204, -81, 0, 163, 327 +}; // Q12 const Word16 icbwe_gsMappingDFT_tbl_fx[128] = { @@ -590,7 +3470,6 @@ const Word32 pow_10_q23[14] = { 2364231, 2652711, 3339565, 4204263, 5803499, 8011059, 8388608, 6818517, 7222539, 5292854, 4204263, 6977341, 7919357, 8388608 }; -/* clang-format on */ // Q15 const Word16 ivas_tan_panning_gain_dirac_tbl_fx[601] = { SHC( 0x8000 ), @@ -2524,297 +5403,6 @@ const Word32 ivas_mdft_coeff_cos_twid_40_fx[IVAS_40_PT_LEN + 1] = { 252409632, 168489632, 84309816, 0 }; -// Q30 -const Word32 dirac_gains_norm_term_int[9] = { - 1073741824, 759250176, 1073741824, 438353280, 219176688, 1073741824, 309962528, 98018768, - 40015996 -}; - -// Q31 -const Word32 dirac_gains_norm_term_fx[9] = { - 2147483647, 1518500352, 2147483647, 876706560, 438353376, 2147483647, 619925056, 196037536, 80031992 -}; - -// Q27 -const Word32 dirac_gains_Pnm_int[91][9] = { - { -134217728, 0, 134217728, 0, 0, -134217728, 0, 0, 0 }, - { -134197288, 2342396, 134156400, -7026119, 122639, -134095104, 14049026, -613106, 10701 }, - { -134135976, 4684105, 133972536, -14043751, 490416, -133727536, 28061840, -2450586, 85575 }, - { -134033784, 7024438, 133666264, -21044428, 1102895, -133115936, 42002312, -5506921, 288606 }, - { -133890784, 9362478, 133238096, -28019012, 1959264, -132262040, 55833192, -9772457, 683351 }, - { -133706992, 11697809, 132688440, -34959892, 3058584, -131167848, 69520408, -15234719, 1332861 }, - { -133482480, 14029564, 132017976, -41858120, 4399464, -129836328, 83027720, -21876818, 2299344 }, - { -133217280, 16357047, 131227600, -48705360, 5980272, -128270864, 96320208, -29678480, 3644062 }, - { -132911536, 18679510, 130318176, -55493180, 7799064, -126475552, 109363520, -38615824, 5427104 }, - { -132565296, 20996256, 129290928, -62213284, 9853607, -124455056, 122123976, -48661468, 7707213 }, - { -132178656, 23306694, 128146968, -68857816, 12141505, -122214432, 134569248, -59785232, 10541761 }, - { -131751776, 25609964, 126887800, -75418320, 14659851, -119759704, 146666688, -71952528, 13986158 }, - { -131284736, 27905410, 125514928, -81886824, 17405570, -117097048, 158385376, -85126080, 18094094 }, - { -130777744, 30192412, 124030024, -88255768, 20375446, -114233392, 169695776, -99266128, 22917396 }, - { -130230888, 32470208, 122434848, -94517128, 23565774, -111176104, 180568608, -114328832, 28505376 }, - { -129644368, 34738112, 120731408, -100663320, 26972664, -107933048, 190976128, -130267952, 34905200 }, - { -129018344, 36995424, 118921736, -106686840, 30591964, -104512608, 200891728, -147034448, 42161440 }, - { -128353056, 39241452, 117008088, -112580368, 34419264, -100923608, 210290720, -164576576, 50316080 }, - { -127648640, 41475572, 114992728, -118336848, 38449984, -97175216, 219149232, -182840512, 59408524 }, - { -126905360, 43697012, 112878208, -123949000, 42679048, -93277184, 227444688, -201769248, 69474696 }, - { -126123408, 45905176, 110666976, -129410248, 47101484, -89239304, 235156848, -221304640, 80548296 }, - { -125303040, 48099312, 108361848, -134713792, 51711740, -85072152, 242266352, -241385344, 92659128 }, - { -124444528, 50278820, 105965584, -139853120, 56504308, -80786280, 248755776, -261949392, 105834368 }, - { -123548080, 52443040, 103481048, -144822272, 61473384, -76392608, 254609280, -282932704, 120097808 }, - { -122614016, 54591264, 100911328, -149614784, 66612780, -71902504, 259812912, -304269024, 135469312 }, - { -121642584, 56722880, 98259536, -154225168, 71916384, -67327280, 264354304, -325891904, 151965872 }, - { -120634104, 58837188, 95528944, -158647504, 77377552, -62678672, 268222720, -347732352, 169600480 }, - { -119588872, 60933588, 92722800, -162876704, 82989840, -57968464, 271409984, -369722464, 188383040 }, - { -118507224, 63011412, 89844624, -166907264, 88746208, -53208660, 273908992, -391791360, 208319200 }, - { -117389480, 65070028, 86897888, -170734608, 94639696, -48411356, 275714624, -413868832, 229411120 }, - { -116235952, 67108864, 83886096, -174353936, 100663296, -43588484, 276824064, -435884832, 251658240 }, - { -115047032, 69127240, 80812992, -177760784, 106809472, -38752388, 277236128, -457767936, 275054816 }, - { -113823072, 71124576, 77682296, -180951136, 113070880, -33915128, 276951296, -479447744, 299592224 }, - { -112564464, 73100224, 74497888, -183920976, 119439696, -29088994, 275972448, -500852768, 325257600 }, - { -111271560, 75053584, 71263600, -186666800, 125908272, -24285974, 274304128, -521913568, 352034976 }, - { -109944736, 76984136, 67983320, -189185120, 132468856, -19517968, 271952224, -542560640, 379905024 }, - { -108584440, 78891192, 64661120, -191472992, 139113184, -14796968, 268925472, -562724864, 408843424 }, - { -107191040, 80774240, 61300996, -193527600, 145833472, -10134552, 265233552, -582338944, 438823936 }, - { -105765016, 82632672, 57907084, -195346384, 152621264, -5542341, 260888528, -601335936, 469815200 }, - { -104306760, 84465968, 54483472, -196927072, 159468512, -1031517, 255903808, -619651456, 501783968 }, - { -102816736, 86273488, 51034412, -198267904, 166366624, 3386773, 250294992, -637221056, 534692032 }, - { -101295408, 88054736, 47564080, -199367280, 173307296, 7701825, 244078832, -653983232, 568498944 }, - { -99743224, 89809192, 44076620, -200223728, 180282192, 11903295, 237274256, -669879040, 603161856 }, - { -98160648, 91536272, 40576356, -200836160, 187282720, 15980983, 229901280, -684849728, 638632640 }, - { -96548144, 93235488, 37067500, -201203920, 194300432, 19925212, 221981760, -698840192, 674862144 }, - { -94906272, 94906272, 33554432, -201326592, 201326592, 23726568, 213539056, -711796992, 711796992 }, - { -93235488, 96548144, 30041364, -201203920, 208352752, 27376188, 204597888, -723670016, 749382016 }, - { -91536272, 98160648, 26532496, -200836160, 215370464, 30865648, 195183856, -734411520, 787559936 }, - { -89809200, 99743208, 23032272, -200223728, 222370864, 34186800, 185324752, -743976000, 826268864 }, - { -88054736, 101295408, 19544786, -199367280, 229345888, 37332284, 175048640, -752322176, 865447872 }, - { -86273488, 102816736, 16074439, -198268032, 236286560, 40294912, 164385440, -759410496, 905030144 }, - { -84465944, 104306784, 12625336, -196927072, 243184800, 43068320, 153365504, -765205632, 944950528 }, - { -82632672, 105765016, 9201773, -195346384, 250031920, 45646496, 142020480, -769675200, 985139200 }, - { -80774256, 107191032, 5807891, -193527600, 256819584, 48024044, 130382952, -772789696, 1025526400 }, - { -78891192, 108584440, 2447739, -191472992, 263540000, 50196224, 118485736, -774524480, 1066041600 }, - { -76984120, 109944720, -874438, -189185120, 270184320, 52158672, 106363224, -774856768, 1106610176 }, - { -75053584, 111271544, -4154720, -186666800, 276744864, 53907864, 94049432, -773768704, 1147159552 }, - { -73100224, 112564464, -7389016, -183920976, 283213504, 55440728, 81579720, -771245696, 1187614080 }, - { -71124568, 113823072, -10573435, -180951136, 289582400, 56754824, 68989160, -767276288, 1227898496 }, - { -69127232, 115047064, -13704140, -177760784, 295843776, 57848416, 56313356, -761853888, 1267938048 }, - { -67108880, 116235952, -16777203, -174353936, 301989888, 58720256, 43588536, -754974720, 1307654528 }, - { -65070028, 117389472, -19788994, -170734608, 308013440, 59369844, 30850226, -746639232, 1346972928 }, - { -63011400, 118507224, -22735772, -166907264, 313906944, 59797272, 18134762, -736851968, 1385816832 }, - { -60933588, 119588872, -25613950, -162876704, 319663424, 60003204, 5477891, -725620736, 1424110464 }, - { -58837172, 120634088, -28420080, -158647504, 325275584, 59989016, -7084927, -712957184, 1461778688 }, - { -56722868, 121642576, -31150674, -154225168, 330736768, 59756660, -19517928, -698877184, 1498746240 }, - { -54591276, 122613992, -33802452, -149614784, 336040384, 59308680, -31786382, -683399744, 1534940800 }, - { -52443040, 123548064, -36372160, -144822272, 341179712, 58648260, -43855684, -666547776, 1570288384 }, - { -50278848, 124444520, -38856688, -139853264, 346148864, 57779188, -55691916, -648348160, 1604717952 }, - { -48099324, 125303040, -41252988, -134713792, 350941376, 56705796, -67261816, -628830848, 1638160896 }, - { -45905160, 126123416, -43558124, -129410240, 355551744, 55433036, -78532848, -608029120, 1670546304 }, - { -43697012, 126905360, -45769332, -123949000, 359974080, 53966400, -89473440, -585980480, 1701810944 }, - { -41475560, 127648632, -47883864, -118336808, 364203168, 52311936, -100052728, -562724992, 1731889152 }, - { -39241464, 128353048, -49899212, -112580408, 368233856, 50476188, -110241232, -538305984, 1760719104 }, - { -36995424, 129018360, -51812888, -106686856, 372061216, 48466224, -120010336, -512769824, 1788240512 }, - { -34738100, 129644368, -53622532, -100663280, 375680512, 46289628, -129332608, -486166400, 1814398208 }, - { -32470208, 130230888, -55325984, -94517088, 379087360, 43954400, -138181984, -458547616, 1839134464 }, - { -30192412, 130777744, -56921148, -88255752, 382277728, 41469052, -146533552, -429968768, 1862399872 }, - { -27905450, 131284752, -58406064, -81886920, 385247552, 38842476, -154363936, -400487584, 1884144384 }, - { -25609950, 131751776, -59778952, -75418272, 387993376, 36083912, -161651424, -370163232, 1904324096 }, - { -23306666, 132178656, -61038128, -68857760, 390511712, 33203050, -168375472, -339058272, 1922894464 }, - { -20996270, 132565280, -62182040, -62213328, 392799456, 30209874, -174517136, -307236864, 1939817984 }, - { -18679498, 132911536, -63209344, -55493124, 394854208, 27114732, -180059392, -274765312, 1955057024 }, - { -16357021, 133217280, -64118736, -48705292, 396672992, 23928188, -184986656, -241711232, 1968580864 }, - { -14029578, 133482472, -64909128, -41858176, 398253664, 20661142, -189285248, -208144320, 1980359808 }, - { -11697849, 133706992, -65579560, -34960012, 399594624, 17324636, -192943088, -174134880, 1990369664 }, - { -9362556, 133890784, -66129224, -28019252, 400693888, 13929935, -195949824, -139755008, 1998589184 }, - { -7024411, 134033784, -66557432, -21044346, 401550304, 10488515, -198297168, -105077560, 2004999424 }, - { -4684126, 134135976, -66863648, -14043818, 402162752, 7011926, -199978640, -70176320, 2009588352 }, - { -2342414, 134197304, -67047540, -7026174, 402530496, 3511839, -200989440, -35125516, 2012346496 }, - { -5, 134217728, -67108864, -17, 402653184, 8, -201326592, -88, 2013265920 } -}; - -// Q30 -const Word32 dirac_gains_trg_term_int[181][2] = { - { -1073741824, 93 }, - { -1073578304, -18739436 }, - { -1073087680, -37473000 }, - { -1072270272, -56195404 }, - { -1071126272, -74900440 }, - { -1069655936, -93582656 }, - { -1067859776, -112236624 }, - { -1065738240, -130856168 }, - { -1063292288, -149436080 }, - { -1060522368, -167970160 }, - { -1057429248, -186453440 }, - { -1054014208, -204879600 }, - { -1050278016, -223243376 }, - { -1046221952, -241539408 }, - { -1041847104, -259761664 }, - { -1037154944, -277904896 }, - { -1032146880, -295963392 }, - { -1026824448, -313931616 }, - { -1021189120, -331804480 }, - { -1015242880, -349576096 }, - { -1008987264, -367241408 }, - { -1002424448, -384794592 }, - { -995556160, -402230656 }, - { -988384640, -419544416 }, - { -980912000, -436730112 }, - { -973140608, -453782944 }, - { -965072832, -470697376 }, - { -956710976, -487468704 }, - { -948057792, -504091296 }, - { -939115840, -520560224 }, - { -929887680, -536871040 }, - { -920376384, -553017856 }, - { -910584576, -568996544 }, - { -900515712, -584801664 }, - { -890172480, -600428672 }, - { -879557888, -615873088 }, - { -868675520, -631129536 }, - { -857528320, -646194048 }, - { -846120128, -661061376 }, - { -834454080, -675727744 }, - { -822533888, -690187904 }, - { -810363392, -704438016 }, - { -797945664, -718473536 }, - { -785285056, -732290112 }, - { -772385152, -745883904 }, - { -759250176, -759250176 }, - { -745883904, -772385152 }, - { -732290112, -785285056 }, - { -718473600, -797945664 }, - { -704438016, -810363392 }, - { -690187904, -822533888 }, - { -675727552, -834454144 }, - { -661061376, -846120128 }, - { -646194048, -857528320 }, - { -631129536, -868675392 }, - { -615873088, -879557760 }, - { -600428672, -890172352 }, - { -584801792, -900515712 }, - { -568996544, -910584576 }, - { -553017856, -920376384 }, - { -536871040, -929887680 }, - { -520560224, -939115776 }, - { -504091296, -948057792 }, - { -487468704, -956710976 }, - { -470697376, -965072832 }, - { -453782944, -973140608 }, - { -436730208, -980911936 }, - { -419544416, -988384640 }, - { -402230784, -995556160 }, - { -384794592, -1002424448 }, - { -367241280, -1008987264 }, - { -349576096, -1015242880 }, - { -331804480, -1021189120 }, - { -313931712, -1026824384 }, - { -295963392, -1032146880 }, - { -277904800, -1037154944 }, - { -259761664, -1041847104 }, - { -241539296, -1046221952 }, - { -223243488, -1050278016 }, - { -204879600, -1054014208 }, - { -186453328, -1057429248 }, - { -167970160, -1060522368 }, - { -149435984, -1063292288 }, - { -130856168, -1065738240 }, - { -112236624, -1067859776 }, - { -93582792, -1069655936 }, - { -74900448, -1071126272 }, - { -56195288, -1072270272 }, - { -37473008, -1073087680 }, - { -18739318, -1073578304 }, - { -46, -1073741824 }, - { 18739350, -1073578304 }, - { 37473052, -1073087680 }, - { 56195320, -1072270272 }, - { 74900480, -1071126272 }, - { 93582824, -1069655936 }, - { 112236512, -1067859776 }, - { 130856168, -1065738240 }, - { 149435984, -1063292288 }, - { 167970272, -1060522368 }, - { 186453328, -1057429248 }, - { 204879504, -1054014208 }, - { 223243488, -1050278016 }, - { 241539296, -1046221952 }, - { 259761664, -1041847104 }, - { 277904896, -1037154944 }, - { 295963392, -1032146880 }, - { 313931712, -1026824448 }, - { 331804480, -1021189120 }, - { 349576096, -1015242880 }, - { 367241408, -1008987264 }, - { 384794720, -1002424320 }, - { 402230784, -995556160 }, - { 419544320, -988384640 }, - { 436730112, -980912000 }, - { 453782848, -973140608 }, - { 470697504, -965072832 }, - { 487468576, -956710976 }, - { 504091296, -948057792 }, - { 520560352, -939115776 }, - { 536870912, -929887680 }, - { 553017920, -920376384 }, - { 568996544, -910584704 }, - { 584801664, -900515712 }, - { 600428800, -890172224 }, - { 615873088, -879557888 }, - { 631129536, -868675392 }, - { 646193920, -857528320 }, - { 661061504, -846120064 }, - { 675727616, -834454144 }, - { 690187904, -822533888 }, - { 704438016, -810363136 }, - { 718473536, -797945792 }, - { 732290176, -785285056 }, - { 745883776, -772385216 }, - { 759250176, -759250176 }, - { 772385216, -745883776 }, - { 785285056, -732290112 }, - { 797945664, -718473536 }, - { 810363264, -704438016 }, - { 822533888, -690187904 }, - { 834454144, -675727616 }, - { 846120128, -661061504 }, - { 857528320, -646193920 }, - { 868675392, -631129536 }, - { 879557888, -615873088 }, - { 890172352, -600428800 }, - { 900515712, -584801792 }, - { 910584704, -568996544 }, - { 920376384, -553017920 }, - { 929887680, -536870912 }, - { 939115776, -520560352 }, - { 948057792, -504091296 }, - { 956710976, -487468576 }, - { 965072832, -470697504 }, - { 973140608, -453782944 }, - { 980911936, -436730112 }, - { 988384640, -419544320 }, - { 995556160, -402230784 }, - { 1002424320, -384794592 }, - { 1008987264, -367241280 }, - { 1015242880, -349576096 }, - { 1021189120, -331804480 }, - { 1026824448, -313931712 }, - { 1032146880, -295963392 }, - { 1037154944, -277904800 }, - { 1041847104, -259761664 }, - { 1046221952, -241539296 }, - { 1050278016, -223243488 }, - { 1054014208, -204879600 }, - { 1057429248, -186453328 }, - { 1060522368, -167970272 }, - { 1063292288, -149435984 }, - { 1065738240, -130856168 }, - { 1067859776, -112236624 }, - { 1069655936, -93582760 }, - { 1071126272, -74900440 }, - { 1072270272, -56195308 }, - { 1073087680, -37473052 }, - { 1073578304, -18739382 }, - { 1073741824, 0 } -}; - // Q31 const Word32 dirac_gains_trg_term_fx[181][2] = { { ( -2147483647 - 1 ), 187 }, diff --git a/lib_com/ivas_rom_com_fx.h b/lib_com/ivas_rom_com_fx.h deleted file mode 100644 index 4b3b36dfa..000000000 --- a/lib_com/ivas_rom_com_fx.h +++ /dev/null @@ -1,302 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -#ifndef IVAS_ROM_COM_FX_H -#define IVAS_ROM_COM_FX_H - -#include -#include "options.h" -#include "cnst.h" -#include "ivas_cnst.h" -#include "stat_com.h" -#include "ivas_stat_com.h" - - -extern const Word16 ivas_sin_twiddle_480_fx[IVAS_480_PT_LEN >> 1]; -extern const Word16 ivas_cos_twiddle_480_fx[IVAS_480_PT_LEN >> 1]; -extern const Word16 ivas_sin_twiddle_320_fx[IVAS_320_PT_LEN >> 1]; -extern const Word16 ivas_cos_twiddle_320_fx[IVAS_320_PT_LEN >> 1]; -extern const Word16 ivas_sin_twiddle_160_fx[IVAS_160_PT_LEN >> 1]; -extern const Word16 ivas_cos_twiddle_160_fx[IVAS_160_PT_LEN >> 1]; -extern const Word16 ivas_sin_twiddle_80_fx[IVAS_80_PT_LEN >> 1]; -extern const Word16 ivas_cos_twiddle_80_fx[IVAS_80_PT_LEN >> 1]; -extern const Word16 nf_tw_smoothing_coeffs_fx[N_LTP_GAIN_MEMS]; -extern const Word32 dft_res_gains_q_fx[][2]; -extern const Word16 dft_res_cod_alpha_fx[STEREO_DFT_BAND_MAX]; -extern const Word16 dft_trigo_12k8_fx[STEREO_DFT_N_12k8_ENC / 4 + 1]; -extern const Word16 dft_trigo_32k_fx[STEREO_DFT_N_32k_ENC / 4 + 1]; -extern const Word16 dft_trigo_48k_fx[STEREO_DFT_N_MAX_ENC / 4 + 1]; -extern const Word16 gridEq_Table[NO_THETA16_MAX]; -extern const Word32 McMASA_LFEGain_vectors_fx[64]; /* Q25 */ - -extern const Word16 ivas_divde_255[256]; - -extern const Word32 ism_azimuth_borders_fx[4]; -extern const Word32 ism_elevation_borders_fx[4]; - -extern const UWord16 cum_n_for_id_th[122]; - -/* Multi-channel input and output setups */ - -extern const Word32 ls_azimuth_CICP1_fx[1]; -extern const Word32 ls_elevation_CICP1_fx[1]; -extern const Word32 ls_azimuth_CICP2_fx[2]; -extern const Word32 ls_elevation_CICP2_fx[2]; -extern const Word32 ls_azimuth_CICP6_fx[5]; -extern const Word32 ls_elevation_CICP6_fx[5]; -extern const Word32 ls_azimuth_CICP12_fx[7]; -extern const Word32 ls_elevation_CICP12_fx[7]; -extern const Word32 ls_azimuth_CICP14_fx[7]; -extern const Word32 ls_elevation_CICP14_fx[7]; -extern const Word32 ls_azimuth_CICP16_fx[9]; -extern const Word32 ls_elevation_CICP16_fx[9]; -extern const Word32 ls_azimuth_CICP19_fx[11]; -extern const Word32 ls_elevation_CICP19_fx[11]; -extern const Word16 pow_10_q11[128]; -extern const Word32 pow_10_q23[14]; -extern const Word16 ivas_sin_az_fx[361]; -extern const Word16 ivas_sine_panning_tbl_fx[601]; -extern const Word16 ivas_tan_panning_gain_dirac_tbl_fx[601]; - -/*----------------------------------------------------------------------------------* - * Stereo ICA ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 ica_sincInterp2_fx[]; // Q31 -extern const Word32 ica_sincInterp4_fx[]; // Q31 -extern const Word32 ica_sincInterp6_fx[]; // Q31 - -/*----------------------------------------------------------------------------------* - * Stereo IC-BWE ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word16 pow_10_icbwe_gsMapping_tbl_fx[]; -extern const Word16 pow_10_icbwe_gsMappingDFT_tbl_fx[]; - -/*----------------------------------------------------------------------------------* - * TD Stereo ROM tables - *----------------------------------------------------------------------------------*/ - -extern const UWord32 tdm_ratio_tabl_fx[TDM_NQ + 1]; -extern const Word32 tdm_ratio_tabl_fx_Q30[TDM_NQ + 1]; -extern const Word32 tdm_ratio_tabl_fx_Q24[TDM_NQ + 1]; -extern const UWord32 tdm_den_ratio_tabl_fx[]; -extern const Word16 icbwe_gsMapping_tbl_fx[]; // Q12 -extern const Word16 icbwe_gsMappingDFT_tbl_fx[]; // Q12 - -/* LSFs Intra-frame prediction tables */ -extern const Word16 tdm_LSF_MEAN_RE_USE_OUT_fx[M]; -extern const Word16 tdm_LSF_MEAN_RE_USE_IN_fx[M]; -extern const Word16 tdm_LSF_MEAN_RE_USE_fx[M]; - -extern const Word16 tdm_Beta_Q1bit_re_use_13k2_fx[2]; -extern const Word16 tdm_Beta_Q1bit_re_use_16k4_fx[2]; -extern const Word16 tdm_Beta_Q1bit_re_use_24k4_32k_fx[2]; -extern const Word16 tdm_Beta_Q1bit_re_use_48k_fx[2]; - -extern const Word16 tdm_RE_USE_adaptive_beta_prd_diag_3_fx[15 + 16 + 15]; - -extern const Word16 tdm_LSF_MEAN_PRED_QNT_OUT_fx[M]; -extern const Word16 tdm_LSF_MEAN_PRED_QNT_IN_fx[M]; -extern const Word16 tdm_LSF_MEAN_PRED_QNT_fx[M]; -extern const Word16 tdm_PRED_QNT_fixed_beta_prd_diag_3_fx[15 + 16 + 15]; - -/*----------------------------------------------------------------------------------* - * Stereo DTX ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word16 dft_cng_alpha_bits_fx[STEREO_DFT_N_COH_ALPHA_STEPS][STEREO_DFT_N_COH_ALPHA_LEVELS]; -extern const Word16 dft_cng_coh_pred_fx[][STEREO_DFT_COH_PRED_COEFFS]; - -/*----------------------------------------------------------------------------------* - * DirAC ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 diffuseness_reconstructions_fx[DIRAC_DIFFUSE_LEVELS]; -extern const Word32 diffuseness_thresholds_fx[DIRAC_DIFFUSE_LEVELS + 1]; -extern const Masa_Diffuseness_Ratios masa_diffuse_ratios[DIRAC_DIFFUSE_LEVELS][DIRAC_DIFFUSE_LEVELS]; - -/*------------------------------------------------------------------------------------------* - * SPAR ROM tables - *------------------------------------------------------------------------------------------*/ - -extern const Word32 dtx_pd_real_min_max_fx[2]; -extern const Word32 one_by_q_level[64]; - -/*----------------------------------------------------------------------------------* - * Parametric MC ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word16 ivas_param_mc_quant_ild_5d1_48_fx[PARAM_MC_SZ_ILD_QUANTIZER_4BITS]; -extern const Word16 ivas_param_mc_quant_icc_fx[PARAM_MC_SZ_ICC_QUANTIZER]; - -/*----------------------------------------------------------------------------------* - * MASA ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 no_phi_masa_inv_fx[NO_SPHERICAL_GRIDS][MAX_NO_THETA]; -extern const Word32 azimuth_cb_fx[8]; -extern const Word32 delta_theta_masa_fx[NO_SPHERICAL_GRIDS - 2]; -extern const Word16 coherence_cb0_masa_Q14[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; -extern const Word32 coherence_cb0_masa_fx[DIRAC_DIFFUSE_LEVELS * 2 * MASA_NO_CV_COH]; -extern const Word16 coherence_cb1_masa_Q15[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */ -extern const Word32 coherence_cb1_masa_fx[MASA_NO_CV_COH1 * MASA_MAXIMUM_CODING_SUBBANDS]; /* 25 */ - -/* Multi-channel input and output setups */ -extern const Word16 ls_azimuth_CICP2_idx[2]; -extern const Word16 ls_elevation_CICP2_idx[2]; -extern const Word16 ls_azimuth_CICP6_idx[5]; -extern const Word16 ls_elevation_CICP6_idx[5]; -extern const Word16 ls_azimuth_CICP12_idx[7]; -extern const Word16 ls_elevation_CICP12_idx[7]; -extern const Word16 ls_azimuth_CICP14_idx[7]; -extern const Word16 ls_elevation_CICP14_idx[7]; -extern const Word16 ls_azimuth_CICP16_idx[9]; -extern const Word16 ls_elevation_CICP16_idx[9]; -extern const Word16 ls_azimuth_CICP19_idx[11]; -extern const Word16 ls_elevation_CICP19_idx[11]; - -extern const Word32 shoebox_sin_cos_tbl_fx[11][2]; - -extern const Word32 delta_phi_val[90]; -extern const Word32 inv_delta_phi_val[90]; -extern const Word32 dd_val[90]; -extern const Word32 cb_azi_chan_fx[]; // Q22 -extern const Word16 cb_azi_chan_16fx[]; // Q0 - -/*----------------------------------------------------------------------------------* - * MASA and ISM (OMASA) combined format ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 dct4_fx[]; -extern const Word32 dct5_fx[]; -extern const Word32 dct8_fx[]; -extern const Word32 dct12_fx[]; - -/*----------------------------------------------------------------------------------* - * ISM ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 ism_azimuth_borders_fx[4]; -extern const Word32 ism_elevation_borders_fx[4]; - -/*----------------------------------------------------------------------------------* - * LFE coding ROM tables - *----------------------------------------------------------------------------------*/ - -extern const Word32 ivas_lpf_4_butter_16k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; -extern const Word16 ivas_lpf_4_butter_16k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; -extern const Word32 ivas_lpf_4_butter_32k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; -extern const Word16 ivas_lpf_4_butter_32k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; -extern const Word32 ivas_lpf_4_butter_48k_sos_fx[IVAS_BIQUAD_FILT_LEN << 2]; -extern const Word16 ivas_lpf_4_butter_48k_sos_e[IVAS_BIQUAD_FILT_LEN << 2]; -#ifndef NONBE_FIX_MC_LFE_LPF -extern const Word32 ivas_lpf_2_butter_16k_fx[IVAS_BIQUAD_FILT_LEN << 1]; -extern const Word32 ivas_lpf_2_butter_32k_fx[IVAS_BIQUAD_FILT_LEN << 1]; -extern const Word32 ivas_lpf_2_butter_48k_fx[IVAS_BIQUAD_FILT_LEN << 1]; -#endif - -extern const Word32 ivas_lfe_window_coeff_48k_fx[IVAS_LFE_FADE_LEN_48K]; // Q31 -extern const Word32 ivas_lfe_window_coeff_32k_fx[IVAS_LFE_FADE_LEN_32K]; // Q31 -extern const Word32 ivas_lfe_window_coeff_16k_fx[IVAS_LFE_FADE_LEN_16K]; // Q31 - -extern const UWord32 d_hamm_lfe_plc_fx[LFE_PLC_LENANA / 2]; - -/*------------------------------------------------------------------------------------------* - * MDFT/iMDFT ROM tables - *------------------------------------------------------------------------------------------*/ - -extern const Word32 ivas_mdft_coeff_cos_twid_240_fx[IVAS_240_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_160_fx[IVAS_160_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_120_fx[IVAS_120_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_80_fx[IVAS_80_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_40_fx[IVAS_40_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_960_fx[IVAS_960_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_640_fx[IVAS_640_PT_LEN + 1]; -extern const Word32 ivas_mdft_coeff_cos_twid_320_fx[IVAS_320_PT_LEN + 1]; -extern const Word32 dirac_gains_norm_term_int[9]; -extern const Word32 dirac_gains_norm_term_fx[9]; -extern const Word32 dirac_gains_Pnm_int[91][9]; -extern const Word32 dirac_gains_trg_term_int[181][2]; -extern const Word32 dirac_gains_trg_term_fx[181][2]; - -/*------------------------------------------------------------------------------------------* - * FB ROM tables - *------------------------------------------------------------------------------------------*/ - -extern const Word16 ivas_fb_cf_4ms_48k_fx[IVAS_FB_4MS_48K_SAMP]; -extern const Word16 ivas_fb_cf_1ms_48k_fx[IVAS_FB_1MS_48K_SAMP]; -extern const Word16 ivas_fb_cf_4ms_32k_fx[IVAS_FB_4MS_32K_SAMP]; -extern const Word16 ivas_fb_cf_1ms_32k_fx[IVAS_FB_1MS_32K_SAMP]; -extern const Word16 ivas_fb_cf_4ms_16k_fx[IVAS_FB_4MS_16K_SAMP]; -extern const Word16 ivas_fb_cf_1ms_16k_fx[IVAS_FB_1MS_16K_SAMP]; - -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]; - -/*------------------------------------------------------------------------------------------* - * SNS MSVQ codebooks and means - *------------------------------------------------------------------------------------------*/ - -extern const Word16 *const ivas_sns_cdbks_tcx20_fx[]; -extern const Word16 *const ivas_sns_cdbks_tcx10_fx[]; - -extern const Word16 *const ivas_sns_cdbks_side_tcx20_fx[]; -extern const Word16 *const ivas_sns_cdbks_side_tcx10_fx[]; - -/*----------------------------------------------------------------------* - * MC ParamUpmix ROM tables - *-----------------------------------------------------------------------*/ - -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]; - -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_del_32_fx[577]; -extern const Word32 ivas_sine_frame_len_640_del_16_fx[289]; - -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]; - - -/*----------------------------------------------------------------------* - * Limiter tables - *-----------------------------------------------------------------------*/ - -extern const Word32 release_cnst_table[4][201]; // Q31 - -#endif diff --git a/lib_com/ivas_rotation_com.c b/lib_com/ivas_rotation_com_fx.c similarity index 99% rename from lib_com/ivas_rotation_com.c rename to lib_com/ivas_rotation_com_fx.c index 78a0837ab..a922082f7 100644 --- a/lib_com/ivas_rotation_com.c +++ b/lib_com/ivas_rotation_com_fx.c @@ -44,6 +44,8 @@ #include "wmc_auto.h" #include "basop_util.h" #include "enh64.h" + + /*------------------------------------------------------------------------- * Euler2Quat() * diff --git a/lib_com/ivas_spar_com_fx.c b/lib_com/ivas_spar_com_fx.c index 9b2e68307..8e45d73bc 100644 --- a/lib_com/ivas_spar_com_fx.c +++ b/lib_com/ivas_spar_com_fx.c @@ -44,7 +44,6 @@ #include "basop_util.h" #include "basop32.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------------------------* diff --git a/lib_com/ivas_spar_com_quant_util_fx.c b/lib_com/ivas_spar_com_quant_util_fx.c index cfd03a3b3..8e84e4e37 100644 --- a/lib_com/ivas_spar_com_quant_util_fx.c +++ b/lib_com/ivas_spar_com_quant_util_fx.c @@ -37,7 +37,6 @@ #include "ivas_rom_com.h" #include #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" @@ -215,19 +214,17 @@ void ivas_quantise_real_values_enc_fx( move32(); } } + return; } + /*-----------------------------------------------------------------------------------------* * Function ivas_spar_get_uniform_quant_strat() * * Sets the quant strat values *-----------------------------------------------------------------------------------------*/ -/*-----------------------------------------------------------------------------------------* - * Function ivas_spar_get_uniform_quant_strat_fx() - * - * Sets the quant strat values - *-----------------------------------------------------------------------------------------*/ + void ivas_spar_get_uniform_quant_strat_fx( ivas_spar_md_com_cfg *pSpar_md_com_cfg, const Word16 table_idx ) diff --git a/lib_com/ivas_stereo_ica_com_fx.c b/lib_com/ivas_stereo_ica_com_fx.c index 8548797a4..11f16d0a5 100644 --- a/lib_com/ivas_stereo_ica_com_fx.c +++ b/lib_com/ivas_stereo_ica_com_fx.c @@ -41,7 +41,6 @@ #include "rom_com.h" #include "ivas_rom_com.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*--------------------------------------------------------------- * interpTargetChannel_fx() @@ -51,69 +50,89 @@ * ---------------------------------------------------------------*/ #define SPREAD_FACTOR1 ( 1.0f / INTERP_FACTOR1 ) -Word32 table_596[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 table_596[N_MAX_SHIFT_CHANGE + 1] = { 0, 2441216, 1220608, 813738, 610304, 488243, 406869, 348745, 305152, 271246, 244121, 221928, 203434, 187785, 174372, 162747, 152576, 143600, 135623, 128485, 122060 }; // Q12 -Word32 inv_table_596[N_MAX_SHIFT_CHANGE + 1] = { +static Word32 inv_table_596[N_MAX_SHIFT_CHANGE + 1] = { 0, 7206320, 14412641, 21618962, 28825283, 36031605, 43237924, 50444244, 57650567, 64856889, 72063211, 79269528, 86475849, 93682173, 100888489, 108094813, 115301135, 122507459, 129713778, 136920096, 144126422 }; // Q31 -Word32 tableD1_596[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 tableD1_596[N_MAX_SHIFT_CHANGE + 1] = { 0, 216, 1731, 5842, 13849, 27049, 46741, 74223, 110794, 157752, 216396, 288023, 373932, 475422, 593791, 730337, 886359, 1063155, 1262023, 1484262, 1731170 }; // Q35 -Word32 table_298[N_MAX_SHIFT_CHANGE + 1] = { +static Word32 table_298[N_MAX_SHIFT_CHANGE + 1] = { 0, 1220608, 610304, 406869, 305152, 244121, 203434, 174372, 152576, 135623, 122060, 110964, 101717, 93892, 87186, 81373, 76288, 71800, 67811, 64242, 61030 }; // Q12 -Word32 inv_table_298[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 inv_table_298[N_MAX_SHIFT_CHANGE + 1] = { 0, 14412641, 28825283, 43237924, 57650567, 72063211, 86475849, 100888489, 115301135, 129713778, 144126422, 158539056, 172951698, 187364347, 201776979, 216189627, 230602270, 245014919, 259427557, 273840192, 288252845 }; // Q31 -Word32 tableD1_298[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 tableD1_298[N_MAX_SHIFT_CHANGE + 1] = { 0, 1731, 13849, 46741, 110794, 216396, 373932, 593791, 886359, 1262023, 1731170, 2304187, 2991462, 3803381, 4750330, 5842699, 7090873, 8505240, 10096185, 11874096, 13849363 }; // Q35 -Word32 table_290[N_MAX_SHIFT_CHANGE + 1] = { +static Word32 table_290[N_MAX_SHIFT_CHANGE + 1] = { 0, 1187840, 593920, 395946, 296960, 237568, 197973, 169691, 148480, 131982, 118784, 107985, 98986, 91372, 84845, 79189, 74240, 69872, 65991, 62517, 59392 }; // Q12 -Word32 inv_table_290[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 inv_table_290[N_MAX_SHIFT_CHANGE + 1] = { 0, 14810232, 29620464, 44430697, 59240928, 74051160, 88861394, 103671628, 118481856, 133292091, 148102320, 162912554, 177722789, 192533022, 207343256, 222153473, 236963712, 251773958, 266584183, 281394409, 296204640 }; // Q31 -Word32 tableD1_290[N_MAX_SHIFT_CHANGE + 1] = { 0, 1878, 15027, 50717, 120219, 234803, 405740, 644300, - 961755, 1369374, 1878428, 2500187, 3245924, 4126907, 5154407, 6339694, - 7694041, 9228719, 10954993, 12884138, 15027425 }; // Q35 +static Word32 tableD1_290[N_MAX_SHIFT_CHANGE + 1] = { + 0, 1878, 15027, 50717, 120219, 234803, 405740, 644300, + 961755, 1369374, 1878428, 2500187, 3245924, 4126907, 5154407, 6339694, + 7694041, 9228719, 10954993, 12884138, 15027425 +}; // Q35 -Word32 table_145[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 table_145[N_MAX_SHIFT_CHANGE + 1] = { 0, 593920, 296960, 197973, 148480, 118784, 98986, 84845, 74240, 65991, 59392, 53992, 49493, 45686, 42422, 39594, 37120, 34936, 32995, 31258, 29696 }; // Q12 -Word32 inv_table_145[N_MAX_SHIFT_CHANGE + 1] = { + +static Word32 inv_table_145[N_MAX_SHIFT_CHANGE + 1] = { 0, 29620464, 59240928, 88861394, 118481856, 148102320, 177722789, 207343256, 236963712, 266584183, 296204640, 325825109, 355445578, 385066045, 414686513, 444306946, 473927425, 503547916, 533168367, 562788819, 592409281 }; // Q31 -Word32 tableD1_145[N_MAX_SHIFT_CHANGE + 1] = { 0, 15027, 120219, 405740, 961755, 1878428, 3245924, 5154407, - 7694041, 10954993, 15027425, 20001503, 25967392, 33015256, 41235259, 50717555, - 61552334, 73829752, 87639951, 103073111, 120219402 }; // Q35 + +static Word32 tableD1_145[N_MAX_SHIFT_CHANGE + 1] = { + 0, 15027, 120219, 405740, 961755, 1878428, 3245924, 5154407, + 7694041, 10954993, 15027425, 20001503, 25967392, 33015256, 41235259, 50717555, + 61552334, 73829752, 87639951, 103073111, 120219402 +}; // Q35 + + +/*--------------------------------------------------------------- + * Function interpTargetChannel_fx() + * + * + *---------------------------------------------------------------*/ + static void interpTargetChannel_fx( Word32 *target_fx, // qsynth const Word16 prevShift, // Q0 @@ -269,7 +288,6 @@ static void interpTargetChannel_fx( x_fx[3] = L_add( x_fx[2], interp_factor2_fx ); // Q12 move32(); - res_a1 = L_sub( tempF1_fx, x_fx[0] ); // Q12 res_a2 = L_sub( tempF1_fx, x_fx[1] ); // Q12 res_a3 = L_sub( tempF1_fx, x_fx[2] ); // Q12 @@ -320,11 +338,13 @@ static void interpTargetChannel_fx( return; } + /*--------------------------------------------------------------- * Function targetCh_AlignStereoDFT() * * Align target channel in DFT stereo to correct FOR shift variations * ---------------------------------------------------------------*/ + static void targetCh_AlignStereoDFT_fx( Word32 *target_fx, // qsynth const Word16 prevShift, // Q0 @@ -385,11 +405,13 @@ static void targetCh_AlignStereoDFT_fx( return; } + /*--------------------------------------------------------------- * adjustTargetSignal() * * Target signal correction FOR shift variations. * ---------------------------------------------------------------*/ + void adjustTargetSignal_fx( Word32 *target_fx, // qsynth const Word16 prevShift, // Q0 diff --git a/lib_com/ivas_stereo_td_bit_alloc_fx.c b/lib_com/ivas_stereo_td_bit_alloc_fx.c index 27732e3a2..4a7eaf1e1 100644 --- a/lib_com/ivas_stereo_td_bit_alloc_fx.c +++ b/lib_com/ivas_stereo_td_bit_alloc_fx.c @@ -40,7 +40,6 @@ #include "prot_fx.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-------------------------------------------------------------------* diff --git a/lib_com/options_warnings.h b/lib_com/options_warnings.h deleted file mode 100644 index eaa66e36e..000000000 --- a/lib_com/options_warnings.h +++ /dev/null @@ -1,3 +0,0 @@ -/*Temporary file*/ - -#define UNUSED_PARAM( ... ) (void) ( __VA_ARGS__ ) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 2b3e200f2..4ae9d5755 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -11025,12 +11025,6 @@ void mdct_switching_dec_fx( Word16 print_disclaimer( FILE *fPtr ); -void fft_rel( - float x[], /* i/o: input/output vector */ - const Word16 n, /* i : vector length */ - const Word16 m /* i : log2 of vector length */ -); - void preemph_ivas_fx( Word32 *signal, /* i/o: signal Qx*/ const Word16 mu, /* i : preemphasis factor Q15*/ diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index 004413469..489ac5e5d 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -43,11 +43,12 @@ #include "wmc_auto.h" /* clang-format off */ +#define SHC(x) ( (Word16) x ) +#define W16(x) ( (Word16) x ) /*----------------------------------------------------------------------------------* * Table of bitrates *----------------------------------------------------------------------------------*/ -#define W16(x) ((Word16)x) const Word32 brate_tbl[SIZE_BRATE_TBL] = // Q0 { @@ -1008,92 +1009,6 @@ const Word16 sincos_t_fx[161] = * dimension of the table = 641=4*256*(5/8)+1 *----------------------------------------------------------------------------------*/ -/* every 4th value is identical to sincos_t above but as sincos_t is also used in SWB TBE a separate table has been defined here */ -const float sincos_t_ext[641] = -{ - 0.0f, - 0.006135884649154f, 0.012271538285720f, 0.018406729905805f, 0.024541228522912f, 0.030674803176637f, 0.036807222941359f, 0.042938256934941f, 0.049067674327418f, - 0.055195244349690f, 0.061320736302209f, 0.067443919563664f, 0.073564563599667f, 0.079682437971430f, 0.085797312344440f, 0.091908956497133f, 0.098017140329561f, - 0.104121633872055f, 0.110222207293883f, 0.116318630911905f, 0.122410675199216f, 0.128498110793793f, 0.134580708507126f, 0.140658239332849f, 0.146730474455362f, - 0.152797185258443f, 0.158858143333861f, 0.164913120489970f, 0.170961888760301f, 0.177004220412149f, 0.183039887955141f, 0.189068664149806f, 0.195090322016128f, - 0.201104634842092f, 0.207111376192219f, 0.213110319916091f, 0.219101240156870f, 0.225083911359793f, 0.231058108280671f, 0.237023605994367f, 0.242980179903264f, - 0.248927605745720f, 0.254865659604515f, 0.260794117915276f, 0.266712757474898f, 0.272621355449949f, 0.278519689385053f, 0.284407537211272f, 0.290284677254462f, - 0.296150888243624f, 0.302005949319228f, 0.307849640041535f, 0.313681740398892f, 0.319502030816016f, 0.325310292162263f, 0.331106305759876f, 0.336889853392220f, - 0.342660717311994f, 0.348418680249435f, 0.354163525420490f, 0.359895036534988f, 0.365612997804774f, 0.371317193951837f, 0.377007410216418f, 0.382683432365090f, - 0.388345046698826f, 0.393992040061048f, 0.399624199845647f, 0.405241314004990f, 0.410843171057904f, 0.416429560097637f, 0.422000270799800f, 0.427555093430282f, - 0.433093818853152f, 0.438616238538528f, 0.444122144570429f, 0.449611329654607f, 0.455083587126344f, 0.460538710958240f, 0.465976495767966f, 0.471396736825998f, - 0.476799230063322f, 0.482183772079123f, 0.487550160148436f, 0.492898192229784f, 0.498227666972782f, 0.503538383725718f, 0.508830142543107f, 0.514102744193222f, - 0.519355990165590f, 0.524589682678469f, 0.529803624686295f, 0.534997619887097f, 0.540171472729893f, 0.545324988422046f, 0.550457972936605f, 0.555570233019602f, - 0.560661576197336f, 0.565731810783613f, 0.570780745886967f, 0.575808191417845f, 0.580813958095765f, 0.585797857456439f, 0.590759701858874f, 0.595699304492433f, - 0.600616479383869f, 0.605511041404326f, 0.610382806276309f, 0.615231590580627f, 0.620057211763289f, 0.624859488142386f, 0.629638238914927f, 0.634393284163645f, - 0.639124444863776f, 0.643831542889791f, 0.648514401022112f, 0.653172842953777f, 0.657806693297079f, 0.662415777590172f, 0.666999922303637f, 0.671558954847018f, - 0.676092703575316f, 0.680600997795453f, 0.685083667772700f, 0.689540544737067f, 0.693971460889654f, 0.698376249408973f, 0.702754744457225f, 0.707106781186547f, - 0.711432195745216f, 0.715730825283819f, 0.720002507961382f, 0.724247082951467f, 0.728464390448225f, 0.732654271672413f, 0.736816568877370f, 0.740951125354959f, - 0.745057785441466f, 0.749136394523459f, 0.753186799043613f, 0.757208846506485f, 0.761202385484262f, 0.765167265622459f, 0.769103337645580f, 0.773010453362737f, - 0.776888465673232f, 0.780737228572094f, 0.784556597155575f, 0.788346427626606f, 0.792106577300212f, 0.795836904608884f, 0.799537269107905f, 0.803207531480645f, - 0.806847553543799f, 0.810457198252595f, 0.814036329705948f, 0.817584813151584f, 0.821102514991105f, 0.824589302785025f, 0.828045045257756f, 0.831469612302545f, - 0.834862874986380f, 0.838224705554838f, 0.841554977436898f, 0.844853565249707f, 0.848120344803297f, 0.851355193105265f, 0.854557988365401f, 0.857728610000272f, - 0.860866938637767f, 0.863972856121587f, 0.867046245515693f, 0.870086991108711f, 0.873094978418290f, 0.876070094195407f, 0.879012226428633f, 0.881921264348355f, - 0.884797098430938f, 0.887639620402854f, 0.890448723244758f, 0.893224301195515f, 0.895966249756185f, 0.898674465693954f, 0.901348847046022f, 0.903989293123443f, - 0.906595704514915f, 0.909167983090522f, 0.911706032005430f, 0.914209755703531f, 0.916679059921043f, 0.919113851690058f, 0.921514039342042f, 0.923879532511287f, - 0.926210242138311f, 0.928506080473216f, 0.930766961078984f, 0.932992798834739f, 0.935183509938948f, 0.937339011912575f, 0.939459223602190f, 0.941544065183021f, - 0.943593458161960f, 0.945607325380521f, 0.947585591017741f, 0.949528180593037f, 0.951435020969008f, 0.953306040354194f, 0.955141168305771f, 0.956940335732209f, - 0.958703474895872f, 0.960430519415566f, 0.962121404269042f, 0.963776065795440f, 0.965394441697689f, 0.966976471044852f, 0.968522094274417f, 0.970031253194544f, - 0.971503890986252f, 0.972939952205560f, 0.974339382785576f, 0.975702130038529f, 0.977028142657754f, 0.978317370719628f, 0.979569765685441f, 0.980785280403230f, - 0.981963869109555f, 0.983105487431216f, 0.984210092386929f, 0.985277642388941f, 0.986308097244599f, 0.987301418157858f, 0.988257567730749f, 0.989176509964781f, - 0.990058210262297f, 0.990902635427780f, 0.991709753669100f, 0.992479534598710f, 0.993211949234795f, 0.993906970002356f, 0.994564570734255f, 0.995184726672197f, - 0.995767414467660f, 0.996312612182778f, 0.996820299291166f, 0.997290456678690f, 0.997723066644192f, 0.998118112900149f, 0.998475580573295f, 0.998795456205172f, - 0.999077727752645f, 0.999322384588350f, 0.999529417501093f, 0.999698818696204f, 0.999830581795823f, 0.999924701839145f, 0.999981175282601f, 1.000000000000000f, - 0.999981175282601f, 0.999924701839145f, 0.999830581795823f, 0.999698818696204f, 0.999529417501093f, 0.999322384588350f, 0.999077727752645f, 0.998795456205172f, - 0.998475580573295f, 0.998118112900149f, 0.997723066644192f, 0.997290456678690f, 0.996820299291166f, 0.996312612182778f, 0.995767414467660f, 0.995184726672197f, - 0.994564570734255f, 0.993906970002356f, 0.993211949234795f, 0.992479534598710f, 0.991709753669100f, 0.990902635427780f, 0.990058210262297f, 0.989176509964781f, - 0.988257567730749f, 0.987301418157858f, 0.986308097244599f, 0.985277642388941f, 0.984210092386929f, 0.983105487431216f, 0.981963869109555f, 0.980785280403230f, - 0.979569765685441f, 0.978317370719628f, 0.977028142657754f, 0.975702130038529f, 0.974339382785576f, 0.972939952205560f, 0.971503890986252f, 0.970031253194544f, - 0.968522094274417f, 0.966976471044852f, 0.965394441697689f, 0.963776065795440f, 0.962121404269042f, 0.960430519415566f, 0.958703474895872f, 0.956940335732209f, - 0.955141168305771f, 0.953306040354194f, 0.951435020969008f, 0.949528180593037f, 0.947585591017741f, 0.945607325380521f, 0.943593458161960f, 0.941544065183021f, - 0.939459223602190f, 0.937339011912575f, 0.935183509938948f, 0.932992798834739f, 0.930766961078984f, 0.928506080473216f, 0.926210242138311f, 0.923879532511287f, - 0.921514039342042f, 0.919113851690058f, 0.916679059921043f, 0.914209755703531f, 0.911706032005430f, 0.909167983090522f, 0.906595704514915f, 0.903989293123443f, - 0.901348847046022f, 0.898674465693954f, 0.895966249756185f, 0.893224301195515f, 0.890448723244758f, 0.887639620402854f, 0.884797098430938f, 0.881921264348355f, - 0.879012226428634f, 0.876070094195407f, 0.873094978418290f, 0.870086991108711f, 0.867046245515693f, 0.863972856121587f, 0.860866938637767f, 0.857728610000272f, - 0.854557988365401f, 0.851355193105265f, 0.848120344803297f, 0.844853565249707f, 0.841554977436898f, 0.838224705554838f, 0.834862874986380f, 0.831469612302545f, - 0.828045045257756f, 0.824589302785025f, 0.821102514991105f, 0.817584813151584f, 0.814036329705949f, 0.810457198252595f, 0.806847553543799f, 0.803207531480645f, - 0.799537269107905f, 0.795836904608884f, 0.792106577300212f, 0.788346427626606f, 0.784556597155575f, 0.780737228572095f, 0.776888465673232f, 0.773010453362737f, - 0.769103337645580f, 0.765167265622459f, 0.761202385484262f, 0.757208846506485f, 0.753186799043613f, 0.749136394523459f, 0.745057785441466f, 0.740951125354959f, - 0.736816568877370f, 0.732654271672413f, 0.728464390448225f, 0.724247082951467f, 0.720002507961382f, 0.715730825283819f, 0.711432195745217f, 0.707106781186548f, - 0.702754744457225f, 0.698376249408973f, 0.693971460889654f, 0.689540544737067f, 0.685083667772700f, 0.680600997795453f, 0.676092703575316f, 0.671558954847019f, - 0.666999922303638f, 0.662415777590172f, 0.657806693297079f, 0.653172842953777f, 0.648514401022113f, 0.643831542889791f, 0.639124444863776f, 0.634393284163645f, - 0.629638238914927f, 0.624859488142386f, 0.620057211763289f, 0.615231590580627f, 0.610382806276310f, 0.605511041404326f, 0.600616479383869f, 0.595699304492433f, - 0.590759701858874f, 0.585797857456439f, 0.580813958095765f, 0.575808191417845f, 0.570780745886967f, 0.565731810783613f, 0.560661576197336f, 0.555570233019602f, - 0.550457972936605f, 0.545324988422046f, 0.540171472729893f, 0.534997619887097f, 0.529803624686295f, 0.524589682678469f, 0.519355990165590f, 0.514102744193222f, - 0.508830142543107f, 0.503538383725718f, 0.498227666972782f, 0.492898192229784f, 0.487550160148436f, 0.482183772079123f, 0.476799230063322f, 0.471396736825998f, - 0.465976495767966f, 0.460538710958240f, 0.455083587126344f, 0.449611329654607f, 0.444122144570429f, 0.438616238538528f, 0.433093818853152f, 0.427555093430282f, - 0.422000270799800f, 0.416429560097637f, 0.410843171057904f, 0.405241314004990f, 0.399624199845647f, 0.393992040061048f, 0.388345046698827f, 0.382683432365090f, - 0.377007410216418f, 0.371317193951838f, 0.365612997804774f, 0.359895036534988f, 0.354163525420490f, 0.348418680249435f, 0.342660717311994f, 0.336889853392220f, - 0.331106305759876f, 0.325310292162263f, 0.319502030816016f, 0.313681740398891f, 0.307849640041535f, 0.302005949319228f, 0.296150888243624f, 0.290284677254462f, - 0.284407537211272f, 0.278519689385053f, 0.272621355449949f, 0.266712757474898f, 0.260794117915276f, 0.254865659604515f, 0.248927605745720f, 0.242980179903264f, - 0.237023605994367f, 0.231058108280671f, 0.225083911359793f, 0.219101240156870f, 0.213110319916091f, 0.207111376192219f, 0.201104634842092f, 0.195090322016129f, - 0.189068664149806f, 0.183039887955141f, 0.177004220412149f, 0.170961888760301f, 0.164913120489970f, 0.158858143333861f, 0.152797185258444f, 0.146730474455362f, - 0.140658239332850f, 0.134580708507126f, 0.128498110793793f, 0.122410675199216f, 0.116318630911905f, 0.110222207293883f, 0.104121633872055f, 0.098017140329561f, - 0.091908956497133f, 0.085797312344440f, 0.079682437971430f, 0.073564563599668f, 0.067443919563664f, 0.061320736302208f, 0.055195244349690f, 0.049067674327418f, - 0.042938256934941f, 0.036807222941359f, 0.030674803176637f, 0.024541228522912f, 0.018406729905805f, 0.012271538285720f, 0.006135884649155f, 0.000000000000000f, - -0.006135884649155f, -0.012271538285720f, -0.018406729905805f, -0.024541228522912f, -0.030674803176637f, -0.036807222941359f, -0.042938256934941f, -0.049067674327418f, - -0.055195244349690f, -0.061320736302208f, -0.067443919563664f, -0.073564563599667f, -0.079682437971430f, -0.085797312344440f, -0.091908956497133f, -0.098017140329561f, - -0.104121633872054f, -0.110222207293883f, -0.116318630911904f, -0.122410675199216f, -0.128498110793793f, -0.134580708507126f, -0.140658239332849f, -0.146730474455362f, - -0.152797185258443f, -0.158858143333861f, -0.164913120489970f, -0.170961888760301f, -0.177004220412149f, -0.183039887955141f, -0.189068664149806f, -0.195090322016128f, - -0.201104634842092f, -0.207111376192219f, -0.213110319916091f, -0.219101240156870f, -0.225083911359793f, -0.231058108280671f, -0.237023605994367f, -0.242980179903264f, - -0.248927605745720f, -0.254865659604514f, -0.260794117915276f, -0.266712757474898f, -0.272621355449949f, -0.278519689385053f, -0.284407537211272f, -0.290284677254462f, - -0.296150888243624f, -0.302005949319228f, -0.307849640041535f, -0.313681740398891f, -0.319502030816016f, -0.325310292162263f, -0.331106305759876f, -0.336889853392220f, - -0.342660717311994f, -0.348418680249435f, -0.354163525420490f, -0.359895036534988f, -0.365612997804774f, -0.371317193951837f, -0.377007410216418f, -0.382683432365090f, - -0.388345046698826f, -0.393992040061048f, -0.399624199845647f, -0.405241314004990f, -0.410843171057904f, -0.416429560097637f, -0.422000270799800f, -0.427555093430282f, - -0.433093818853152f, -0.438616238538527f, -0.444122144570429f, -0.449611329654607f, -0.455083587126344f, -0.460538710958240f, -0.465976495767966f, -0.471396736825998f, - -0.476799230063322f, -0.482183772079123f, -0.487550160148436f, -0.492898192229784f, -0.498227666972782f, -0.503538383725717f, -0.508830142543107f, -0.514102744193222f, - -0.519355990165590f, -0.524589682678469f, -0.529803624686295f, -0.534997619887097f, -0.540171472729893f, -0.545324988422046f, -0.550457972936605f, -0.555570233019602f, - -0.560661576197336f, -0.565731810783613f, -0.570780745886967f, -0.575808191417845f, -0.580813958095764f, -0.585797857456439f, -0.590759701858874f, -0.595699304492433f, - -0.600616479383869f, -0.605511041404325f, -0.610382806276309f, -0.615231590580627f, -0.620057211763289f, -0.624859488142386f, -0.629638238914927f, -0.634393284163645f, - -0.639124444863776f, -0.643831542889791f, -0.648514401022112f, -0.653172842953777f, -0.657806693297079f, -0.662415777590172f, -0.666999922303637f, -0.671558954847018f, - -0.676092703575316f, -0.680600997795453f, -0.685083667772700f, -0.689540544737067f, -0.693971460889654f, -0.698376249408973f, -0.702754744457225f, -0.707106781186547f -}; - const Word16 sincos_t_ext_fx[641] = {//Q15 0, 201, 402, 603, 804, 1005, 1206, 1407, @@ -22907,7 +22822,7 @@ const Word16 acos_slope[128] =//Q15 -880, -933, -1004, -1079, -1170, -1279, -1409, -1579, -1771, -2064, -2405, -2979, -3799, -5243, -9039,-26214 }; -#define SHC(x) ((Word16)x) + const Word16 cos_coef_new[4] = { SHC(0x02BA), SHC(0xE60A), SHC(0xEEEF), SHC(0xAAAB) };//Q15 @@ -31254,3 +31169,6671 @@ const Word16 scales_p_ivas_fx[][MAX_NO_SCALES * 2] = /* 2 subvectors 20 modes Q1 3397, } }; + + +/*-----------------------------------------------------------------* + * FFT transform tables + *-----------------------------------------------------------------*/ + +const Word16 w_fft4_fx[2] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), +}; +const Word16 w_fft8_fx[8] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + +}; +const Word16 w_fft16_fx[8] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + +}; +const Word16 w_fft32_fx[16] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x7d8a ), + SHC( 0x18f8 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + +}; +const Word16 w_fft64_fx[32] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x7d8a ), + SHC( 0x18f8 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + SHC( 0x7f62 ), + SHC( 0x0c8b ), + SHC( 0x5133 ), + SHC( 0x62f2 ), + SHC( 0x70e2 ), + SHC( 0x3c56 ), + SHC( 0x2528 ), + SHC( 0x7a7d ), + SHC( 0x7a7d ), + SHC( 0x2528 ), + SHC( 0x3c56 ), + SHC( 0x70e2 ), + SHC( 0x62f2 ), + SHC( 0x5133 ), + SHC( 0x0c8b ), + SHC( 0x7f62 ), + +}; +const Word16 w_fft128_fx[64] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x7d8a ), + SHC( 0x18f8 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + SHC( 0x7f62 ), + SHC( 0x0c8b ), + SHC( 0x5133 ), + SHC( 0x62f2 ), + SHC( 0x70e2 ), + SHC( 0x3c56 ), + SHC( 0x2528 ), + SHC( 0x7a7d ), + SHC( 0x7a7d ), + SHC( 0x2528 ), + SHC( 0x3c56 ), + SHC( 0x70e2 ), + SHC( 0x62f2 ), + SHC( 0x5133 ), + SHC( 0x0c8b ), + SHC( 0x7f62 ), + SHC( 0x7fd8 ), + SHC( 0x0647 ), + SHC( 0x55f5 ), + SHC( 0x5ed7 ), + SHC( 0x73b5 ), + SHC( 0x36ba ), + SHC( 0x2b1f ), + SHC( 0x7884 ), + SHC( 0x7c29 ), + SHC( 0x1f19 ), + SHC( 0x41ce ), + SHC( 0x6dca ), + SHC( 0x66cf ), + SHC( 0x4c3f ), + SHC( 0x12c8 ), + SHC( 0x7e9d ), + SHC( 0x7e9d ), + SHC( 0x12c8 ), + SHC( 0x4c3f ), + SHC( 0x66cf ), + SHC( 0x6dca ), + SHC( 0x41ce ), + SHC( 0x1f19 ), + SHC( 0x7c29 ), + SHC( 0x7884 ), + SHC( 0x2b1f ), + SHC( 0x36ba ), + SHC( 0x73b5 ), + SHC( 0x5ed7 ), + SHC( 0x55f5 ), + SHC( 0x0647 ), + SHC( 0x7fd8 ), + +}; +const Word16 w_fft256_fx[128] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x7d8a ), + SHC( 0x18f8 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + SHC( 0x7f62 ), + SHC( 0x0c8b ), + SHC( 0x5133 ), + SHC( 0x62f2 ), + SHC( 0x70e2 ), + SHC( 0x3c56 ), + SHC( 0x2528 ), + SHC( 0x7a7d ), + SHC( 0x7a7d ), + SHC( 0x2528 ), + SHC( 0x3c56 ), + SHC( 0x70e2 ), + SHC( 0x62f2 ), + SHC( 0x5133 ), + SHC( 0x0c8b ), + SHC( 0x7f62 ), + SHC( 0x7fd8 ), + SHC( 0x0647 ), + SHC( 0x55f5 ), + SHC( 0x5ed7 ), + SHC( 0x73b5 ), + SHC( 0x36ba ), + SHC( 0x2b1f ), + SHC( 0x7884 ), + SHC( 0x7c29 ), + SHC( 0x1f19 ), + SHC( 0x41ce ), + SHC( 0x6dca ), + SHC( 0x66cf ), + SHC( 0x4c3f ), + SHC( 0x12c8 ), + SHC( 0x7e9d ), + SHC( 0x7e9d ), + SHC( 0x12c8 ), + SHC( 0x4c3f ), + SHC( 0x66cf ), + SHC( 0x6dca ), + SHC( 0x41ce ), + SHC( 0x1f19 ), + SHC( 0x7c29 ), + SHC( 0x7884 ), + SHC( 0x2b1f ), + SHC( 0x36ba ), + SHC( 0x73b5 ), + SHC( 0x5ed7 ), + SHC( 0x55f5 ), + SHC( 0x0647 ), + SHC( 0x7fd8 ), + SHC( 0x7ff6 ), + SHC( 0x0324 ), + SHC( 0x5842 ), + SHC( 0x5cb4 ), + SHC( 0x7504 ), + SHC( 0x33de ), + SHC( 0x2e11 ), + SHC( 0x776c ), + SHC( 0x7ce3 ), + SHC( 0x1c0b ), + SHC( 0x447a ), + SHC( 0x6c24 ), + SHC( 0x68a6 ), + SHC( 0x49b4 ), + SHC( 0x15e2 ), + SHC( 0x7e1d ), + SHC( 0x7f09 ), + SHC( 0x0fab ), + SHC( 0x4ebf ), + SHC( 0x64e8 ), + SHC( 0x6f5f ), + SHC( 0x3f17 ), + SHC( 0x2223 ), + SHC( 0x7b5d ), + SHC( 0x798a ), + SHC( 0x2826 ), + SHC( 0x398c ), + SHC( 0x7255 ), + SHC( 0x60ec ), + SHC( 0x539b ), + SHC( 0x096a ), + SHC( 0x7fa7 ), + SHC( 0x7fa7 ), + SHC( 0x096a ), + SHC( 0x539b ), + SHC( 0x60ec ), + SHC( 0x7255 ), + SHC( 0x398c ), + SHC( 0x2826 ), + SHC( 0x798a ), + SHC( 0x7b5d ), + SHC( 0x2223 ), + SHC( 0x3f17 ), + SHC( 0x6f5f ), + SHC( 0x64e8 ), + SHC( 0x4ebf ), + SHC( 0x0fab ), + SHC( 0x7f09 ), + SHC( 0x7e1d ), + SHC( 0x15e2 ), + SHC( 0x49b4 ), + SHC( 0x68a6 ), + SHC( 0x6c24 ), + SHC( 0x447a ), + SHC( 0x1c0b ), + SHC( 0x7ce3 ), + SHC( 0x776c ), + SHC( 0x2e11 ), + SHC( 0x33de ), + SHC( 0x7504 ), + SHC( 0x5cb4 ), + SHC( 0x5842 ), + SHC( 0x0324 ), + SHC( 0x7ff6 ), + +}; +const Word16 w_fft512_fx[256] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x7641 ), + SHC( 0x30fb ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x7d8a ), + SHC( 0x18f8 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + SHC( 0x7f62 ), + SHC( 0x0c8b ), + SHC( 0x5133 ), + SHC( 0x62f2 ), + SHC( 0x70e2 ), + SHC( 0x3c56 ), + SHC( 0x2528 ), + SHC( 0x7a7d ), + SHC( 0x7a7d ), + SHC( 0x2528 ), + SHC( 0x3c56 ), + SHC( 0x70e2 ), + SHC( 0x62f2 ), + SHC( 0x5133 ), + SHC( 0x0c8b ), + SHC( 0x7f62 ), + SHC( 0x7fd8 ), + SHC( 0x0647 ), + SHC( 0x55f5 ), + SHC( 0x5ed7 ), + SHC( 0x73b5 ), + SHC( 0x36ba ), + SHC( 0x2b1f ), + SHC( 0x7884 ), + SHC( 0x7c29 ), + SHC( 0x1f19 ), + SHC( 0x41ce ), + SHC( 0x6dca ), + SHC( 0x66cf ), + SHC( 0x4c3f ), + SHC( 0x12c8 ), + SHC( 0x7e9d ), + SHC( 0x7e9d ), + SHC( 0x12c8 ), + SHC( 0x4c3f ), + SHC( 0x66cf ), + SHC( 0x6dca ), + SHC( 0x41ce ), + SHC( 0x1f19 ), + SHC( 0x7c29 ), + SHC( 0x7884 ), + SHC( 0x2b1f ), + SHC( 0x36ba ), + SHC( 0x73b5 ), + SHC( 0x5ed7 ), + SHC( 0x55f5 ), + SHC( 0x0647 ), + SHC( 0x7fd8 ), + SHC( 0x7ff6 ), + SHC( 0x0324 ), + SHC( 0x5842 ), + SHC( 0x5cb4 ), + SHC( 0x7504 ), + SHC( 0x33de ), + SHC( 0x2e11 ), + SHC( 0x776c ), + SHC( 0x7ce3 ), + SHC( 0x1c0b ), + SHC( 0x447a ), + SHC( 0x6c24 ), + SHC( 0x68a6 ), + SHC( 0x49b4 ), + SHC( 0x15e2 ), + SHC( 0x7e1d ), + SHC( 0x7f09 ), + SHC( 0x0fab ), + SHC( 0x4ebf ), + SHC( 0x64e8 ), + SHC( 0x6f5f ), + SHC( 0x3f17 ), + SHC( 0x2223 ), + SHC( 0x7b5d ), + SHC( 0x798a ), + SHC( 0x2826 ), + SHC( 0x398c ), + SHC( 0x7255 ), + SHC( 0x60ec ), + SHC( 0x539b ), + SHC( 0x096a ), + SHC( 0x7fa7 ), + SHC( 0x7fa7 ), + SHC( 0x096a ), + SHC( 0x539b ), + SHC( 0x60ec ), + SHC( 0x7255 ), + SHC( 0x398c ), + SHC( 0x2826 ), + SHC( 0x798a ), + SHC( 0x7b5d ), + SHC( 0x2223 ), + SHC( 0x3f17 ), + SHC( 0x6f5f ), + SHC( 0x64e8 ), + SHC( 0x4ebf ), + SHC( 0x0fab ), + SHC( 0x7f09 ), + SHC( 0x7e1d ), + SHC( 0x15e2 ), + SHC( 0x49b4 ), + SHC( 0x68a6 ), + SHC( 0x6c24 ), + SHC( 0x447a ), + SHC( 0x1c0b ), + SHC( 0x7ce3 ), + SHC( 0x776c ), + SHC( 0x2e11 ), + SHC( 0x33de ), + SHC( 0x7504 ), + SHC( 0x5cb4 ), + SHC( 0x5842 ), + SHC( 0x0324 ), + SHC( 0x7ff6 ), + SHC( 0x7ffd ), + SHC( 0x0192 ), + SHC( 0x5964 ), + SHC( 0x5b9d ), + SHC( 0x75a5 ), + SHC( 0x326e ), + SHC( 0x2f87 ), + SHC( 0x76d9 ), + SHC( 0x7d39 ), + SHC( 0x1a82 ), + SHC( 0x45cd ), + SHC( 0x6b4a ), + SHC( 0x698c ), + SHC( 0x4869 ), + SHC( 0x176d ), + SHC( 0x7dd6 ), + SHC( 0x7f38 ), + SHC( 0x0e1b ), + SHC( 0x4ffb ), + SHC( 0x63ef ), + SHC( 0x7023 ), + SHC( 0x3db8 ), + SHC( 0x23a6 ), + SHC( 0x7aef ), + SHC( 0x7a05 ), + SHC( 0x26a8 ), + SHC( 0x3af2 ), + SHC( 0x719e ), + SHC( 0x61f1 ), + SHC( 0x5269 ), + SHC( 0x0afb ), + SHC( 0x7f87 ), + SHC( 0x7fc2 ), + SHC( 0x07d9 ), + SHC( 0x54ca ), + SHC( 0x5fe3 ), + SHC( 0x7307 ), + SHC( 0x3824 ), + SHC( 0x29a3 ), + SHC( 0x7909 ), + SHC( 0x7bc5 ), + SHC( 0x209f ), + SHC( 0x4073 ), + SHC( 0x6e96 ), + SHC( 0x65dd ), + SHC( 0x4d81 ), + SHC( 0x1139 ), + SHC( 0x7ed5 ), + SHC( 0x7e5f ), + SHC( 0x1455 ), + SHC( 0x4afb ), + SHC( 0x67bd ), + SHC( 0x6cf9 ), + SHC( 0x4325 ), + SHC( 0x1d93 ), + SHC( 0x7c89 ), + SHC( 0x77fa ), + SHC( 0x2c98 ), + SHC( 0x354d ), + SHC( 0x745f ), + SHC( 0x5dc7 ), + SHC( 0x571d ), + SHC( 0x04b6 ), + SHC( 0x7fe9 ), + SHC( 0x7fe9 ), + SHC( 0x04b6 ), + SHC( 0x571d ), + SHC( 0x5dc7 ), + SHC( 0x745f ), + SHC( 0x354d ), + SHC( 0x2c98 ), + SHC( 0x77fa ), + SHC( 0x7c89 ), + SHC( 0x1d93 ), + SHC( 0x4325 ), + SHC( 0x6cf9 ), + SHC( 0x67bd ), + SHC( 0x4afb ), + SHC( 0x1455 ), + SHC( 0x7e5f ), + SHC( 0x7ed5 ), + SHC( 0x1139 ), + SHC( 0x4d81 ), + SHC( 0x65dd ), + SHC( 0x6e96 ), + SHC( 0x4073 ), + SHC( 0x209f ), + SHC( 0x7bc5 ), + SHC( 0x7909 ), + SHC( 0x29a3 ), + SHC( 0x3824 ), + SHC( 0x7307 ), + SHC( 0x5fe3 ), + SHC( 0x54ca ), + SHC( 0x07d9 ), + SHC( 0x7fc2 ), + SHC( 0x7f87 ), + SHC( 0x0afb ), + SHC( 0x5269 ), + SHC( 0x61f1 ), + SHC( 0x719e ), + SHC( 0x3af2 ), + SHC( 0x26a8 ), + SHC( 0x7a05 ), + SHC( 0x7aef ), + SHC( 0x23a6 ), + SHC( 0x3db8 ), + SHC( 0x7023 ), + SHC( 0x63ef ), + SHC( 0x4ffb ), + SHC( 0x0e1b ), + SHC( 0x7f38 ), + SHC( 0x7dd6 ), + SHC( 0x176d ), + SHC( 0x4869 ), + SHC( 0x698c ), + SHC( 0x6b4a ), + SHC( 0x45cd ), + SHC( 0x1a82 ), + SHC( 0x7d39 ), + SHC( 0x76d9 ), + SHC( 0x2f87 ), + SHC( 0x326e ), + SHC( 0x75a5 ), + SHC( 0x5b9d ), + SHC( 0x5964 ), + SHC( 0x0192 ), + SHC( 0x7ffd ), + +}; +const Word16 FFT_RotVector_960_fx[1860] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ffd ), + SHC( 0xfe54 ), + SHC( 0x7ff4 ), + SHC( 0xfca7 ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7fb9 ), + SHC( 0xf7a1 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f76 ), + SHC( 0xf44a ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7eac ), + SHC( 0xeda3 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e26 ), + SHC( 0xea53 ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7cd8 ), + SHC( 0xe3c1 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7c0f ), + SHC( 0xe07f ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7aba ), + SHC( 0xdba6 ), + SHC( 0x7a3e ), + SHC( 0xda0b ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7935 ), + SHC( 0xd6dc ), + SHC( 0x78a8 ), + SHC( 0xd546 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x76e3 ), + SHC( 0xd092 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff4 ), + SHC( 0xfca7 ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7aba ), + SHC( 0xdba6 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x78a8 ), + SHC( 0xd546 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x7387 ), + SHC( 0xc8e6 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x707d ), + SHC( 0xc2ed ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x697c ), + SHC( 0xb780 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x658c ), + SHC( 0xb215 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5cd9 ), + SHC( 0xa7e4 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6485 ), + SHC( 0xb0c2 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5dfe ), + SHC( 0xa91e ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4f3e ), + SHC( 0x9b7b ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x3596 ), + SHC( 0x8bc2 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x508d ), + SHC( 0x9c87 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x45b6 ), + SHC( 0x94a7 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x2ddf ), + SHC( 0x8881 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x2120 ), + SHC( 0x845d ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x06b2 ), + SHC( 0x802d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fb9 ), + SHC( 0xf7a1 ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7935 ), + SHC( 0xd6dc ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x72cc ), + SHC( 0xc764 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x658c ), + SHC( 0xb215 ), + SHC( 0x603c ), + SHC( 0xab9b ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5465 ), + SHC( 0x9fc4 ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x389c ), + SHC( 0x8d34 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2924 ), + SHC( 0x86cb ), + SHC( 0x2120 ), + SHC( 0x845d ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x10b5 ), + SHC( 0x8119 ), + SHC( 0x085f ), + SHC( 0x8047 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf7a1 ), + SHC( 0x8047 ), + SHC( 0xef4b ), + SHC( 0x8119 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xdee0 ), + SHC( 0x845d ), + SHC( 0xd6dc ), + SHC( 0x86cb ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xe21f ), + SHC( 0x838a ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xacdf ), + SHC( 0x9eac ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f76 ), + SHC( 0xf44a ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x72cc ), + SHC( 0xc764 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x668f ), + SHC( 0xb36b ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x444d ), + SHC( 0x93c0 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x2f6e ), + SHC( 0x891d ), + SHC( 0x245a ), + SHC( 0x8546 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x01ac ), + SHC( 0x8003 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xea53 ), + SHC( 0x81da ), + SHC( 0xdee0 ), + SHC( 0x845d ), + SHC( 0xd3b3 ), + SHC( 0x87ea ), + SHC( 0xc8e6 ), + SHC( 0x8c79 ), + SHC( 0xbe8e ), + SHC( 0x91ff ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xab9b ), + SHC( 0x9fc4 ), + SHC( 0xa327 ), + SHC( 0xa7e4 ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x94a7 ), + SHC( 0xba4a ), + SHC( 0x8eb9 ), + SHC( 0xc467 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf29f ), + SHC( 0x80b4 ), + SHC( 0xe564 ), + SHC( 0x82cd ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xcbf1 ), + SHC( 0x8b11 ), + SHC( 0xc000 ), + SHC( 0x9127 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xaa5a ), + SHC( 0xa0e1 ), + SHC( 0xa0e1 ), + SHC( 0xaa5a ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x9127 ), + SHC( 0xc000 ), + SHC( 0x8b11 ), + SHC( 0xcbf1 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x82cd ), + SHC( 0xe564 ), + SHC( 0x80b4 ), + SHC( 0xf29f ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xca6a ), + SHC( 0x8bc2 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xb0c2 ), + SHC( 0x9b7b ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x8bc2 ), + SHC( 0xca6a ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x801a ), + SHC( 0x0506 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x84cf ), + SHC( 0x22be ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x658c ), + SHC( 0xb215 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2120 ), + SHC( 0x845d ), + SHC( 0x10b5 ), + SHC( 0x8119 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xef4b ), + SHC( 0x8119 ), + SHC( 0xdee0 ), + SHC( 0x845d ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xc000 ), + SHC( 0x9127 ), + SHC( 0xb215 ), + SHC( 0x9a74 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9a74 ), + SHC( 0xb215 ), + SHC( 0x9127 ), + SHC( 0xc000 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x845d ), + SHC( 0xdee0 ), + SHC( 0x8119 ), + SHC( 0xef4b ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8119 ), + SHC( 0x10b5 ), + SHC( 0x845d ), + SHC( 0x2120 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9127 ), + SHC( 0x4000 ), + SHC( 0x9a74 ), + SHC( 0x4deb ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7eac ), + SHC( 0xeda3 ), + SHC( 0x7aba ), + SHC( 0xdba6 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x603c ), + SHC( 0xab9b ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x444d ), + SHC( 0x93c0 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x10b5 ), + SHC( 0x8119 ), + SHC( 0xfe54 ), + SHC( 0x8003 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xda0b ), + SHC( 0x85c2 ), + SHC( 0xc8e6 ), + SHC( 0x8c79 ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xaa5a ), + SHC( 0xa0e1 ), + SHC( 0x9d97 ), + SHC( 0xae27 ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x8a66 ), + SHC( 0xcd7a ), + SHC( 0x845d ), + SHC( 0xdee0 ), + SHC( 0x80e4 ), + SHC( 0xf0f5 ), + SHC( 0x800c ), + SHC( 0x0359 ), + SHC( 0x81da ), + SHC( 0x15ad ), + SHC( 0x8644 ), + SHC( 0x278d ), + SHC( 0x8d34 ), + SHC( 0x389c ), + SHC( 0x9684 ), + SHC( 0x4880 ), + SHC( 0xa202 ), + SHC( 0x56e2 ), + SHC( 0xaf73 ), + SHC( 0x6379 ), + SHC( 0xbe8e ), + SHC( 0x6e01 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x8644 ), + SHC( 0x278d ), + SHC( 0x8df4 ), + SHC( 0x3a1c ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xa57e ), + SHC( 0x5a82 ), + SHC( 0xb4c4 ), + SHC( 0x678d ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xd873 ), + SHC( 0x79bc ), + SHC( 0xebfa ), + SHC( 0x7e6c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e26 ), + SHC( 0xea53 ), + SHC( 0x78a8 ), + SHC( 0xd546 ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x5465 ), + SHC( 0x9fc4 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x2f6e ), + SHC( 0x891d ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xef4b ), + SHC( 0x8119 ), + SHC( 0xda0b ), + SHC( 0x85c2 ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb36b ), + SHC( 0x9971 ), + SHC( 0xa327 ), + SHC( 0xa7e4 ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x8b11 ), + SHC( 0xcbf1 ), + SHC( 0x83f1 ), + SHC( 0xe07f ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x808a ), + SHC( 0x0bb6 ), + SHC( 0x845d ), + SHC( 0x2120 ), + SHC( 0x8bc2 ), + SHC( 0x3596 ), + SHC( 0x9684 ), + SHC( 0x4880 ), + SHC( 0xa451 ), + SHC( 0x5951 ), + SHC( 0xb4c4 ), + SHC( 0x678d ), + SHC( 0xc764 ), + SHC( 0x72cc ), + SHC( 0xdba6 ), + SHC( 0x7aba ), + SHC( 0xf0f5 ), + SHC( 0x7f1c ), + SHC( 0x06b2 ), + SHC( 0x7fd3 ), + SHC( 0x1c3f ), + SHC( 0x7cd8 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x245a ), + SHC( 0x8546 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xdee0 ), + SHC( 0x845d ), + SHC( 0xc8e6 ), + SHC( 0x8c79 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa327 ), + SHC( 0xa7e4 ), + SHC( 0x94a7 ), + SHC( 0xba4a ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x82cd ), + SHC( 0xe564 ), + SHC( 0x800c ), + SHC( 0xfca7 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x8758 ), + SHC( 0x2aba ), + SHC( 0x9127 ), + SHC( 0x4000 ), + SHC( 0x9eac ), + SHC( 0x5321 ), + SHC( 0xaf73 ), + SHC( 0x6379 ), + SHC( 0xc2ed ), + SHC( 0x707d ), + SHC( 0xd873 ), + SHC( 0x79bc ), + SHC( 0xef4b ), + SHC( 0x7ee7 ), + SHC( 0x06b2 ), + SHC( 0x7fd3 ), + SHC( 0x1de1 ), + SHC( 0x7c76 ), + SHC( 0x340f ), + SHC( 0x74ef ), + SHC( 0x4880 ), + SHC( 0x697c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8276 ), + SHC( 0x18f8 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9593 ), + SHC( 0x471c ), + SHC( 0xa57e ), + SHC( 0x5a82 ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), + SHC( 0xcf05 ), + SHC( 0x7641 ), + SHC( 0xe708 ), + SHC( 0x7d8a ), + SHC( 0x0000 ), + SHC( 0x7fff ), + SHC( 0x18f8 ), + SHC( 0x7d8a ), + SHC( 0x30fb ), + SHC( 0x7641 ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x5a82 ), + SHC( 0x5a82 ), + SHC( 0x6a6d ), + SHC( 0x471c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fff ), + SHC( 0xff2a ), + SHC( 0x7ffd ), + SHC( 0xfe54 ), + SHC( 0x7ff9 ), + SHC( 0xfd7d ), + SHC( 0x7ff4 ), + SHC( 0xfca7 ), + SHC( 0x7fee ), + SHC( 0xfbd0 ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7fdd ), + SHC( 0xfa24 ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7fb9 ), + SHC( 0xf7a1 ), + SHC( 0x7fab ), + SHC( 0xf6cb ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f89 ), + SHC( 0xf520 ), + SHC( 0x7f76 ), + SHC( 0xf44a ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7f35 ), + SHC( 0xf1ca ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7f02 ), + SHC( 0xf020 ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7eac ), + SHC( 0xeda3 ), + SHC( 0x7e8d ), + SHC( 0xecce ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e4a ), + SHC( 0xeb27 ), + SHC( 0x7e26 ), + SHC( 0xea53 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x7db3 ), + SHC( 0xe7da ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff9 ), + SHC( 0xfd7d ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7d06 ), + SHC( 0xe492 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7bda ), + SHC( 0xdfaf ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x78ef ), + SHC( 0xd611 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7732 ), + SHC( 0xd15a ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x732a ), + SHC( 0xc824 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6bcd ), + SHC( 0xbafe ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fee ), + SHC( 0xfbd0 ), + SHC( 0x7fb9 ), + SHC( 0xf7a1 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7ee7 ), + SHC( 0xef4b ), + SHC( 0x7e4a ), + SHC( 0xeb27 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7ca8 ), + SHC( 0xe2f0 ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7935 ), + SHC( 0xd6dc ), + SHC( 0x77cb ), + SHC( 0xd2ea ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x7497 ), + SHC( 0xcb2d ), + SHC( 0x72cc ), + SHC( 0xc764 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6cb2 ), + SHC( 0xbc69 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x680b ), + SHC( 0xb572 ), + SHC( 0x658c ), + SHC( 0xb215 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x603c ), + SHC( 0xab9b ), + SHC( 0x5d6c ), + SHC( 0xa881 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x577f ), + SHC( 0xa294 ), + SHC( 0x5465 ), + SHC( 0x9fc4 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x4a8e ), + SHC( 0x97f5 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fdd ), + SHC( 0xfa24 ), + SHC( 0x7f76 ), + SHC( 0xf44a ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7ddb ), + SHC( 0xe8ad ), + SHC( 0x7ca8 ), + SHC( 0xe2f0 ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7979 ), + SHC( 0xd7a7 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x72cc ), + SHC( 0xc764 ), + SHC( 0x7016 ), + SHC( 0xc231 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x69f5 ), + SHC( 0xb832 ), + SHC( 0x668f ), + SHC( 0xb36b ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5b19 ), + SHC( 0xa616 ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x527d ), + SHC( 0x9e21 ), + SHC( 0x4deb ), + SHC( 0x9a74 ), + SHC( 0x4930 ), + SHC( 0x96fe ), + SHC( 0x444d ), + SHC( 0x93c0 ), + SHC( 0x3f45 ), + SHC( 0x90bc ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x34d3 ), + SHC( 0x8b69 ), + SHC( 0x2f6e ), + SHC( 0x891d ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x245a ), + SHC( 0x8546 ), + SHC( 0x1eb1 ), + SHC( 0x83bd ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x660e ), + SHC( 0xb2bf ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5c44 ), + SHC( 0xa749 ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4502 ), + SHC( 0x9433 ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x37dc ), + SHC( 0x8cd6 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x1b6e ), + SHC( 0x82fa ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xfd7d ), + SHC( 0x8007 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xee77 ), + SHC( 0x8136 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fab ), + SHC( 0xf6cb ), + SHC( 0x7eac ), + SHC( 0xeda3 ), + SHC( 0x7d06 ), + SHC( 0xe492 ), + SHC( 0x7aba ), + SHC( 0xdba6 ), + SHC( 0x77cb ), + SHC( 0xd2ea ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x7016 ), + SHC( 0xc231 ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x660e ), + SHC( 0xb2bf ), + SHC( 0x603c ), + SHC( 0xab9b ), + SHC( 0x59ea ), + SHC( 0xa4e7 ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4be9 ), + SHC( 0x98f1 ), + SHC( 0x444d ), + SHC( 0x93c0 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x2b84 ), + SHC( 0x87a0 ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x19ca ), + SHC( 0x82a1 ), + SHC( 0x10b5 ), + SHC( 0x8119 ), + SHC( 0x0789 ), + SHC( 0x8039 ), + SHC( 0xfe54 ), + SHC( 0x8003 ), + SHC( 0xf520 ), + SHC( 0x8077 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xe2f0 ), + SHC( 0x8358 ), + SHC( 0xda0b ), + SHC( 0x85c2 ), + SHC( 0xd15a ), + SHC( 0x88ce ), + SHC( 0xc8e6 ), + SHC( 0x8c79 ), + SHC( 0xc0bb ), + SHC( 0x90bc ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f89 ), + SHC( 0xf520 ), + SHC( 0x7e26 ), + SHC( 0xea53 ), + SHC( 0x7bda ), + SHC( 0xdfaf ), + SHC( 0x78a8 ), + SHC( 0xd546 ), + SHC( 0x7497 ), + SHC( 0xcb2d ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x69f5 ), + SHC( 0xb832 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x5c44 ), + SHC( 0xa749 ), + SHC( 0x5465 ), + SHC( 0x9fc4 ), + SHC( 0x4be9 ), + SHC( 0x98f1 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x395c ), + SHC( 0x8d93 ), + SHC( 0x2f6e ), + SHC( 0x891d ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x0fe0 ), + SHC( 0x80fe ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xfa24 ), + SHC( 0x8023 ), + SHC( 0xef4b ), + SHC( 0x8119 ), + SHC( 0xe492 ), + SHC( 0x82fa ), + SHC( 0xda0b ), + SHC( 0x85c2 ), + SHC( 0xcfcb ), + SHC( 0x896d ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xbc69 ), + SHC( 0x934e ), + SHC( 0xb36b ), + SHC( 0x9971 ), + SHC( 0xaafa ), + SHC( 0xa052 ), + SHC( 0xa327 ), + SHC( 0xa7e4 ), + SHC( 0x9c01 ), + SHC( 0xb01a ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf375 ), + SHC( 0x809e ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xdad8 ), + SHC( 0x8583 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xaecd ), + SHC( 0x9d0e ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9d0e ), + SHC( 0xaecd ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x8583 ), + SHC( 0xdad8 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f35 ), + SHC( 0xf1ca ), + SHC( 0x7cd8 ), + SHC( 0xe3c1 ), + SHC( 0x78ef ), + SHC( 0xd611 ), + SHC( 0x7387 ), + SHC( 0xc8e6 ), + SHC( 0x6cb2 ), + SHC( 0xbc69 ), + SHC( 0x6485 ), + SHC( 0xb0c2 ), + SHC( 0x5b19 ), + SHC( 0xa616 ), + SHC( 0x508d ), + SHC( 0x9c87 ), + SHC( 0x4502 ), + SHC( 0x9433 ), + SHC( 0x389c ), + SHC( 0x8d34 ), + SHC( 0x2b84 ), + SHC( 0x87a0 ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0x0fe0 ), + SHC( 0x80fe ), + SHC( 0x01ac ), + SHC( 0x8003 ), + SHC( 0xf375 ), + SHC( 0x809e ), + SHC( 0xe564 ), + SHC( 0x82cd ), + SHC( 0xd7a7 ), + SHC( 0x8687 ), + SHC( 0xca6a ), + SHC( 0x8bc2 ), + SHC( 0xbdd6 ), + SHC( 0x926e ), + SHC( 0xb215 ), + SHC( 0x9a74 ), + SHC( 0xa749 ), + SHC( 0xa3bc ), + SHC( 0x9d97 ), + SHC( 0xae27 ), + SHC( 0x951c ), + SHC( 0xb996 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8835 ), + SHC( 0xd2ea ), + SHC( 0x83f1 ), + SHC( 0xe07f ), + SHC( 0x8136 ), + SHC( 0xee77 ), + SHC( 0x800c ), + SHC( 0xfca7 ), + SHC( 0x8077 ), + SHC( 0x0ae0 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f02 ), + SHC( 0xf020 ), + SHC( 0x7c0f ), + SHC( 0xe07f ), + SHC( 0x7732 ), + SHC( 0xd15a ), + SHC( 0x707d ), + SHC( 0xc2ed ), + SHC( 0x680b ), + SHC( 0xb572 ), + SHC( 0x5dfe ), + SHC( 0xa91e ), + SHC( 0x527d ), + SHC( 0x9e21 ), + SHC( 0x45b6 ), + SHC( 0x94a7 ), + SHC( 0x37dc ), + SHC( 0x8cd6 ), + SHC( 0x2924 ), + SHC( 0x86cb ), + SHC( 0x19ca ), + SHC( 0x82a1 ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0xfa24 ), + SHC( 0x8023 ), + SHC( 0xea53 ), + SHC( 0x81da ), + SHC( 0xdad8 ), + SHC( 0x8583 ), + SHC( 0xcbf1 ), + SHC( 0x8b11 ), + SHC( 0xbdd6 ), + SHC( 0x926e ), + SHC( 0xb0c2 ), + SHC( 0x9b7b ), + SHC( 0xa4e7 ), + SHC( 0xa616 ), + SHC( 0x9a74 ), + SHC( 0xb215 ), + SHC( 0x9192 ), + SHC( 0xbf47 ), + SHC( 0x8a66 ), + SHC( 0xcd7a ), + SHC( 0x850a ), + SHC( 0xdc74 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x8012 ), + SHC( 0xfbd0 ), + SHC( 0x808a ), + SHC( 0x0bb6 ), + SHC( 0x82fa ), + SHC( 0x1b6e ), + SHC( 0x8758 ), + SHC( 0x2aba ), + SHC( 0x8d93 ), + SHC( 0x395c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x4930 ), + SHC( 0x96fe ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0789 ), + SHC( 0x8039 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xe492 ), + SHC( 0x82fa ), + SHC( 0xd3b3 ), + SHC( 0x87ea ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa749 ), + SHC( 0xa3bc ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x9192 ), + SHC( 0xbf47 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x8426 ), + SHC( 0xdfaf ), + SHC( 0x80e4 ), + SHC( 0xf0f5 ), + SHC( 0x8007 ), + SHC( 0x0283 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x8583 ), + SHC( 0x2528 ), + SHC( 0x8bc2 ), + SHC( 0x3596 ), + SHC( 0x9433 ), + SHC( 0x4502 ), + SHC( 0x9eac ), + SHC( 0x5321 ), + SHC( 0xaafa ), + SHC( 0x5fae ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e8d ), + SHC( 0xecce ), + SHC( 0x7a3e ), + SHC( 0xda0b ), + SHC( 0x732a ), + SHC( 0xc824 ), + SHC( 0x697c ), + SHC( 0xb780 ), + SHC( 0x5d6c ), + SHC( 0xa881 ), + SHC( 0x4f3e ), + SHC( 0x9b7b ), + SHC( 0x3f45 ), + SHC( 0x90bc ), + SHC( 0x2ddf ), + SHC( 0x8881 ), + SHC( 0x1b6e ), + SHC( 0x82fa ), + SHC( 0x085f ), + SHC( 0x8047 ), + SHC( 0xf520 ), + SHC( 0x8077 ), + SHC( 0xe21f ), + SHC( 0x838a ), + SHC( 0xcfcb ), + SHC( 0x896d ), + SHC( 0xbe8e ), + SHC( 0x91ff ), + SHC( 0xaecd ), + SHC( 0x9d0e ), + SHC( 0xa0e1 ), + SHC( 0xaa5a ), + SHC( 0x951c ), + SHC( 0xb996 ), + SHC( 0x8bc2 ), + SHC( 0xca6a ), + SHC( 0x850a ), + SHC( 0xdc74 ), + SHC( 0x8119 ), + SHC( 0xef4b ), + SHC( 0x8007 ), + SHC( 0x0283 ), + SHC( 0x81da ), + SHC( 0x15ad ), + SHC( 0x8687 ), + SHC( 0x2859 ), + SHC( 0x8df4 ), + SHC( 0x3a1c ), + SHC( 0x97f5 ), + SHC( 0x4a8e ), + SHC( 0xa451 ), + SHC( 0x5951 ), + SHC( 0xb2bf ), + SHC( 0x660e ), + SHC( 0xc2ed ), + SHC( 0x707d ), + SHC( 0xd47c ), + SHC( 0x7860 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e4a ), + SHC( 0xeb27 ), + SHC( 0x7935 ), + SHC( 0xd6dc ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x658c ), + SHC( 0xb215 ), + SHC( 0x577f ), + SHC( 0xa294 ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x34d3 ), + SHC( 0x8b69 ), + SHC( 0x2120 ), + SHC( 0x845d ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xf7a1 ), + SHC( 0x8047 ), + SHC( 0xe2f0 ), + SHC( 0x8358 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xbc69 ), + SHC( 0x934e ), + SHC( 0xab9b ), + SHC( 0x9fc4 ), + SHC( 0x9d0e ), + SHC( 0xaecd ), + SHC( 0x9127 ), + SHC( 0xc000 ), + SHC( 0x8835 ), + SHC( 0xd2ea ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8012 ), + SHC( 0xfbd0 ), + SHC( 0x8119 ), + SHC( 0x10b5 ), + SHC( 0x8583 ), + SHC( 0x2528 ), + SHC( 0x8d34 ), + SHC( 0x389c ), + SHC( 0x97f5 ), + SHC( 0x4a8e ), + SHC( 0xa57e ), + SHC( 0x5a82 ), + SHC( 0xb572 ), + SHC( 0x680b ), + SHC( 0xc764 ), + SHC( 0x72cc ), + SHC( 0xdad8 ), + SHC( 0x7a7d ), + SHC( 0xef4b ), + SHC( 0x7ee7 ), + SHC( 0x0430 ), + SHC( 0x7fee ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0xfd7d ), + SHC( 0x8007 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd15a ), + SHC( 0x88ce ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xaafa ), + SHC( 0xa052 ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8136 ), + SHC( 0xee77 ), + SHC( 0x801a ), + SHC( 0x0506 ), + SHC( 0x82fa ), + SHC( 0x1b6e ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9433 ), + SHC( 0x4502 ), + SHC( 0xa202 ), + SHC( 0x56e2 ), + SHC( 0xb2bf ), + SHC( 0x660e ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xdad8 ), + SHC( 0x7a7d ), + SHC( 0xf0f5 ), + SHC( 0x7f1c ), + SHC( 0x0789 ), + SHC( 0x7fc7 ), + SHC( 0x1de1 ), + SHC( 0x7c76 ), + SHC( 0x334b ), + SHC( 0x7545 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7db3 ), + SHC( 0xe7da ), + SHC( 0x76e3 ), + SHC( 0xd092 ), + SHC( 0x6bcd ), + SHC( 0xbafe ), + SHC( 0x5cd9 ), + SHC( 0xa7e4 ), + SHC( 0x4a8e ), + SHC( 0x97f5 ), + SHC( 0x3596 ), + SHC( 0x8bc2 ), + SHC( 0x1eb1 ), + SHC( 0x83bd ), + SHC( 0x06b2 ), + SHC( 0x802d ), + SHC( 0xee77 ), + SHC( 0x8136 ), + SHC( 0xd6dc ), + SHC( 0x86cb ), + SHC( 0xc0bb ), + SHC( 0x90bc ), + SHC( 0xacdf ), + SHC( 0x9eac ), + SHC( 0x9c01 ), + SHC( 0xb01a ), + SHC( 0x8eb9 ), + SHC( 0xc467 ), + SHC( 0x8583 ), + SHC( 0xdad8 ), + SHC( 0x80b4 ), + SHC( 0xf29f ), + SHC( 0x8077 ), + SHC( 0x0ae0 ), + SHC( 0x84cf ), + SHC( 0x22be ), + SHC( 0x8d93 ), + SHC( 0x395c ), + SHC( 0x9a74 ), + SHC( 0x4deb ), + SHC( 0xaafa ), + SHC( 0x5fae ), + SHC( 0xbe8e ), + SHC( 0x6e01 ), + SHC( 0xd47c ), + SHC( 0x7860 ), + SHC( 0xebfa ), + SHC( 0x7e6c ), + SHC( 0x0430 ), + SHC( 0x7fee ), + SHC( 0x1c3f ), + SHC( 0x7cd8 ), + SHC( 0x334b ), + SHC( 0x7545 ), + SHC( 0x4880 ), + SHC( 0x697c ), + SHC( 0x5b19 ), + SHC( 0x59ea ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d5f ), + SHC( 0xe636 ), + SHC( 0x759a ), + SHC( 0xcd7a ), + SHC( 0x6902 ), + SHC( 0xb6d0 ), + SHC( 0x581c ), + SHC( 0xa327 ), + SHC( 0x4397 ), + SHC( 0x934e ), + SHC( 0x2c4d ), + SHC( 0x87ea ), + SHC( 0x1332 ), + SHC( 0x8173 ), + SHC( 0xf94e ), + SHC( 0x802d ), + SHC( 0xdfaf ), + SHC( 0x8426 ), + SHC( 0xc764 ), + SHC( 0x8d34 ), + SHC( 0xb16b ), + SHC( 0x9af7 ), + SHC( 0x9eac ), + SHC( 0xacdf ), + SHC( 0x8fea ), + SHC( 0xc231 ), + SHC( 0x85c2 ), + SHC( 0xda0b ), + SHC( 0x809e ), + SHC( 0xf375 ), + SHC( 0x80b4 ), + SHC( 0x0d61 ), + SHC( 0x8603 ), + SHC( 0x26c1 ), + SHC( 0x9053 ), + SHC( 0x3e8b ), + SHC( 0x9f37 ), + SHC( 0x53c3 ), + SHC( 0xb215 ), + SHC( 0x658c ), + SHC( 0xc824 ), + SHC( 0x732a ), + SHC( 0xe07f ), + SHC( 0x7c0f ), + SHC( 0xfa24 ), + SHC( 0x7fdd ), + SHC( 0x1406 ), + SHC( 0x7e6c ), + SHC( 0x2d16 ), + SHC( 0x77cb ), + SHC( 0x444d ), + SHC( 0x6c40 ), + SHC( 0x58b7 ), + SHC( 0x5c44 ), + SHC( 0x697c ), + SHC( 0x4880 ), + SHC( 0x75ee ), + SHC( 0x31c1 ), +}; + +const Word16 FFT_RotVector_640_fx[1240] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff9 ), + SHC( 0xfd7d ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7d06 ), + SHC( 0xe492 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7bda ), + SHC( 0xdfaf ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x78ef ), + SHC( 0xd611 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7732 ), + SHC( 0xd15a ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6485 ), + SHC( 0xb0c2 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5dfe ), + SHC( 0xa91e ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x660e ), + SHC( 0xb2bf ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5c44 ), + SHC( 0xa749 ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4502 ), + SHC( 0x9433 ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x37dc ), + SHC( 0x8cd6 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf375 ), + SHC( 0x809e ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xdad8 ), + SHC( 0x8583 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xca6a ), + SHC( 0x8bc2 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xb0c2 ), + SHC( 0x9b7b ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x4930 ), + SHC( 0x96fe ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0789 ), + SHC( 0x8039 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xe492 ), + SHC( 0x82fa ), + SHC( 0xd3b3 ), + SHC( 0x87ea ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa749 ), + SHC( 0xa3bc ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x9192 ), + SHC( 0xbf47 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0xfd7d ), + SHC( 0x8007 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd15a ), + SHC( 0x88ce ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xaafa ), + SHC( 0xa052 ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8136 ), + SHC( 0xee77 ), + SHC( 0x801a ), + SHC( 0x0506 ), + SHC( 0x82fa ), + SHC( 0x1b6e ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8276 ), + SHC( 0x18f8 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9593 ), + SHC( 0x471c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d06 ), + SHC( 0xe492 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x660e ), + SHC( 0xb2bf ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x0789 ), + SHC( 0x8039 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd15a ), + SHC( 0x88ce ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xa3bc ), + SHC( 0xa749 ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x8711 ), + SHC( 0xd611 ), + SHC( 0x80e4 ), + SHC( 0xf0f5 ), + SHC( 0x809e ), + SHC( 0x0c8b ), + SHC( 0x8644 ), + SHC( 0x278d ), + SHC( 0x9192 ), + SHC( 0x40b9 ), + SHC( 0xa202 ), + SHC( 0x56e2 ), + SHC( 0xb6d0 ), + SHC( 0x6902 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xacdf ), + SHC( 0x6154 ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xe21f ), + SHC( 0x7c76 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7bda ), + SHC( 0xdfaf ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x5c44 ), + SHC( 0xa749 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xe492 ), + SHC( 0x82fa ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xaafa ), + SHC( 0xa052 ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x8711 ), + SHC( 0xd611 ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x81ff ), + SHC( 0x1680 ), + SHC( 0x8bc2 ), + SHC( 0x3596 ), + SHC( 0x9d0e ), + SHC( 0x5133 ), + SHC( 0xb4c4 ), + SHC( 0x678d ), + SHC( 0xd15a ), + SHC( 0x7732 ), + SHC( 0xf0f5 ), + SHC( 0x7f1c ), + SHC( 0x1189 ), + SHC( 0x7eca ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xd3b3 ), + SHC( 0x87ea ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x80e4 ), + SHC( 0xf0f5 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x8bc2 ), + SHC( 0x3596 ), + SHC( 0x9eac ), + SHC( 0x5321 ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), + SHC( 0xd873 ), + SHC( 0x79bc ), + SHC( 0xfafa ), + SHC( 0x7fe6 ), + SHC( 0x1de1 ), + SHC( 0x7c76 ), + SHC( 0x3e8b ), + SHC( 0x6fad ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x809e ), + SHC( 0x0c8b ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9d0e ), + SHC( 0x5133 ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), + SHC( 0xdad8 ), + SHC( 0x7a7d ), + SHC( 0x0000 ), + SHC( 0x7fff ), + SHC( 0x2528 ), + SHC( 0x7a7d ), + SHC( 0x471c ), + SHC( 0x6a6d ), + SHC( 0x62f2 ), + SHC( 0x5133 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ffe ), + SHC( 0xfebf ), + SHC( 0x7ff9 ), + SHC( 0xfd7d ), + SHC( 0x7ff1 ), + SHC( 0xfc3c ), + SHC( 0x7fe6 ), + SHC( 0xfafa ), + SHC( 0x7fd8 ), + SHC( 0xf9b9 ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7fb2 ), + SHC( 0xf736 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f80 ), + SHC( 0xf4b5 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7f41 ), + SHC( 0xf235 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7ef5 ), + SHC( 0xefb6 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e38 ), + SHC( 0xeabd ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7dc7 ), + SHC( 0xe844 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff1 ), + SHC( 0xfc3c ), + SHC( 0x7fc7 ), + SHC( 0xf877 ), + SHC( 0x7f80 ), + SHC( 0xf4b5 ), + SHC( 0x7f1c ), + SHC( 0xf0f5 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7d4a ), + SHC( 0xe5cd ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7b87 ), + SHC( 0xde78 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7957 ), + SHC( 0xd741 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x76bb ), + SHC( 0xd02f ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x7049 ), + SHC( 0xc28f ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6c79 ), + SHC( 0xbc0e ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fd8 ), + SHC( 0xf9b9 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7c29 ), + SHC( 0xe0e7 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7884 ), + SHC( 0xd4e1 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6dca ), + SHC( 0xbe32 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x66cf ), + SHC( 0xb3c1 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x55f5 ), + SHC( 0xa129 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4c3f ), + SHC( 0x9931 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fb2 ), + SHC( 0xf736 ), + SHC( 0x7eca ), + SHC( 0xee77 ), + SHC( 0x7d4a ), + SHC( 0xe5cd ), + SHC( 0x7b31 ), + SHC( 0xdd42 ), + SHC( 0x7884 ), + SHC( 0xd4e1 ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x7179 ), + SHC( 0xc4c6 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6849 ), + SHC( 0xb5c9 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5d22 ), + SHC( 0xa832 ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x503a ), + SHC( 0x9c44 ), + SHC( 0x4930 ), + SHC( 0x96fe ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x3224 ), + SHC( 0x8a3b ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x2188 ), + SHC( 0x8479 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f80 ), + SHC( 0xf4b5 ), + SHC( 0x7e01 ), + SHC( 0xe980 ), + SHC( 0x7b87 ), + SHC( 0xde78 ), + SHC( 0x7816 ), + SHC( 0xd3b3 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x6849 ), + SHC( 0xb5c9 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x599d ), + SHC( 0xa49c ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4827 ), + SHC( 0x9647 ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x3471 ), + SHC( 0x8b3d ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x08ca ), + SHC( 0x804e ), + SHC( 0xfd7d ), + SHC( 0x8007 ), + SHC( 0xf235 ), + SHC( 0x80bf ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f41 ), + SHC( 0xf235 ), + SHC( 0x7d06 ), + SHC( 0xe492 ), + SHC( 0x7957 ), + SHC( 0xd741 ), + SHC( 0x743e ), + SHC( 0xca6a ), + SHC( 0x6dca ), + SHC( 0xbe32 ), + SHC( 0x660e ), + SHC( 0xb2bf ), + SHC( 0x5d22 ), + SHC( 0xa832 ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4827 ), + SHC( 0x9647 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x2fd1 ), + SHC( 0x8945 ), + SHC( 0x22be ), + SHC( 0x84cf ), + SHC( 0x1543 ), + SHC( 0x81c8 ), + SHC( 0x0789 ), + SHC( 0x8039 ), + SHC( 0xf9b9 ), + SHC( 0x8028 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xde78 ), + SHC( 0x8479 ), + SHC( 0xd15a ), + SHC( 0x88ce ), + SHC( 0xc4c6 ), + SHC( 0x8e87 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ef5 ), + SHC( 0xefb6 ), + SHC( 0x7bda ), + SHC( 0xdfaf ), + SHC( 0x76bb ), + SHC( 0xd02f ), + SHC( 0x6fad ), + SHC( 0xc175 ), + SHC( 0x66cf ), + SHC( 0xb3c1 ), + SHC( 0x5c44 ), + SHC( 0xa749 ), + SHC( 0x503a ), + SHC( 0x9c44 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x3471 ), + SHC( 0x8b3d ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x1543 ), + SHC( 0x81c8 ), + SHC( 0x0506 ), + SHC( 0x801a ), + SHC( 0xf4b5 ), + SHC( 0x8080 ), + SHC( 0xe492 ), + SHC( 0x82fa ), + SHC( 0xd4e1 ), + SHC( 0x877c ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb7d9 ), + SHC( 0x9647 ), + SHC( 0xaafa ), + SHC( 0xa052 ), + SHC( 0x9f7e ), + SHC( 0xabec ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xf9b9 ), + SHC( 0x8028 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd4e1 ), + SHC( 0x877c ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb3c1 ), + SHC( 0x9931 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9931 ), + SHC( 0xb3c1 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x877c ), + SHC( 0xd4e1 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e38 ), + SHC( 0xeabd ), + SHC( 0x78ef ), + SHC( 0xd611 ), + SHC( 0x7049 ), + SHC( 0xc28f ), + SHC( 0x6485 ), + SHC( 0xb0c2 ), + SHC( 0x55f5 ), + SHC( 0xa129 ), + SHC( 0x4502 ), + SHC( 0x9433 ), + SHC( 0x3224 ), + SHC( 0x8a3b ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0x08ca ), + SHC( 0x804e ), + SHC( 0xf375 ), + SHC( 0x809e ), + SHC( 0xde78 ), + SHC( 0x8479 ), + SHC( 0xca6a ), + SHC( 0x8bc2 ), + SHC( 0xb7d9 ), + SHC( 0x9647 ), + SHC( 0xa749 ), + SHC( 0xa3bc ), + SHC( 0x9931 ), + SHC( 0xb3c1 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x85e2 ), + SHC( 0xd9a5 ), + SHC( 0x8136 ), + SHC( 0xee77 ), + SHC( 0x800f ), + SHC( 0x03c4 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7dc7 ), + SHC( 0xe844 ), + SHC( 0x7732 ), + SHC( 0xd15a ), + SHC( 0x6c79 ), + SHC( 0xbc0e ), + SHC( 0x5dfe ), + SHC( 0xa91e ), + SHC( 0x4c3f ), + SHC( 0x9931 ), + SHC( 0x37dc ), + SHC( 0x8cd6 ), + SHC( 0x2188 ), + SHC( 0x8479 ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0xf235 ), + SHC( 0x80bf ), + SHC( 0xdad8 ), + SHC( 0x8583 ), + SHC( 0xc4c6 ), + SHC( 0x8e87 ), + SHC( 0xb0c2 ), + SHC( 0x9b7b ), + SHC( 0x9f7e ), + SHC( 0xabec ), + SHC( 0x9192 ), + SHC( 0xbf47 ), + SHC( 0x877c ), + SHC( 0xd4e1 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x800f ), + SHC( 0x03c4 ), + SHC( 0x82fa ), + SHC( 0x1b6e ), + SHC( 0x8a3b ), + SHC( 0x3224 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d4a ), + SHC( 0xe5cd ), + SHC( 0x7545 ), + SHC( 0xccb5 ), + SHC( 0x6849 ), + SHC( 0xb5c9 ), + SHC( 0x56e2 ), + SHC( 0xa202 ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x29ef ), + SHC( 0x8711 ), + SHC( 0x104a ), + SHC( 0x810b ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xdc0d ), + SHC( 0x8528 ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xadd5 ), + SHC( 0x9ddc ), + SHC( 0x9b7b ), + SHC( 0xb0c2 ), + SHC( 0x8d63 ), + SHC( 0xc703 ), + SHC( 0x8426 ), + SHC( 0xdfaf ), + SHC( 0x8028 ), + SHC( 0xf9b9 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x885b ), + SHC( 0x2d7a ), + SHC( 0x9433 ), + SHC( 0x4502 ), + SHC( 0xa49c ), + SHC( 0x599d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7cc0 ), + SHC( 0xe358 ), + SHC( 0x732a ), + SHC( 0xc824 ), + SHC( 0x63bc ), + SHC( 0xafc6 ), + SHC( 0x4f3e ), + SHC( 0x9b7b ), + SHC( 0x36ba ), + SHC( 0x8c4b ), + SHC( 0x1b6e ), + SHC( 0x82fa ), + SHC( 0xfebf ), + SHC( 0x8002 ), + SHC( 0xe21f ), + SHC( 0x838a ), + SHC( 0xc703 ), + SHC( 0x8d63 ), + SHC( 0xaecd ), + SHC( 0x9d0e ), + SHC( 0x9ab5 ), + SHC( 0xb1c0 ), + SHC( 0x8bc2 ), + SHC( 0xca6a ), + SHC( 0x82b6 ), + SHC( 0xe5cd ), + SHC( 0x8007 ), + SHC( 0x0283 ), + SHC( 0x83d7 ), + SHC( 0x1f19 ), + SHC( 0x8df4 ), + SHC( 0x3a1c ), + SHC( 0x9ddc ), + SHC( 0x522b ), + SHC( 0xb2bf ), + SHC( 0x660e ), + SHC( 0xcb8f ), + SHC( 0x74c3 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7c29 ), + SHC( 0xe0e7 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x2b1f ), + SHC( 0x877c ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xed38 ), + SHC( 0x8163 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xb3c1 ), + SHC( 0x9931 ), + SHC( 0x9d0e ), + SHC( 0xaecd ), + SHC( 0x8c4b ), + SHC( 0xc946 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8028 ), + SHC( 0x0647 ), + SHC( 0x8583 ), + SHC( 0x2528 ), + SHC( 0x9236 ), + SHC( 0x41ce ), + SHC( 0xa57e ), + SHC( 0x5a82 ), + SHC( 0xbe32 ), + SHC( 0x6dca ), + SHC( 0xdad8 ), + SHC( 0x7a7d ), + SHC( 0xf9b9 ), + SHC( 0x7fd8 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7b87 ), + SHC( 0xde78 ), + SHC( 0x6e6e ), + SHC( 0xbf47 ), + SHC( 0x599d ), + SHC( 0xa49c ), + SHC( 0x3e8b ), + SHC( 0x9053 ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0xfd7d ), + SHC( 0x8007 ), + SHC( 0xdc0d ), + SHC( 0x8528 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xa2de ), + SHC( 0xa832 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x8340 ), + SHC( 0xe358 ), + SHC( 0x801a ), + SHC( 0x0506 ), + SHC( 0x85e2 ), + SHC( 0x265b ), + SHC( 0x9433 ), + SHC( 0x4502 ), + SHC( 0xaa0b ), + SHC( 0x5ed7 ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xe5cd ), + SHC( 0x7d4a ), + SHC( 0x0789 ), + SHC( 0x7fc7 ), + SHC( 0x28bf ), + SHC( 0x7957 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ad8 ), + SHC( 0xdc0d ), + SHC( 0x6bcd ), + SHC( 0xbafe ), + SHC( 0x5414 ), + SHC( 0x9f7e ), + SHC( 0x3596 ), + SHC( 0x8bc2 ), + SHC( 0x12c8 ), + SHC( 0x8163 ), + SHC( 0xee77 ), + SHC( 0x8136 ), + SHC( 0xcb8f ), + SHC( 0x8b3d ), + SHC( 0xacdf ), + SHC( 0x9eac ), + SHC( 0x94e1 ), + SHC( 0xb9f0 ), + SHC( 0x8583 ), + SHC( 0xdad8 ), + SHC( 0x8002 ), + SHC( 0xfebf ), + SHC( 0x84cf ), + SHC( 0x22be ), + SHC( 0x9387 ), + SHC( 0x43f2 ), + SHC( 0xaafa ), + SHC( 0x5fae ), + SHC( 0xc946 ), + SHC( 0x73b5 ), + SHC( 0xebfa ), + SHC( 0x7e6c ), + SHC( 0x104a ), + SHC( 0x7ef5 ), + SHC( 0x334b ), + SHC( 0x7545 ), + SHC( 0x522b ), + SHC( 0x6224 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7a1e ), + SHC( 0xd9a5 ), + SHC( 0x6902 ), + SHC( 0xb6d0 ), + SHC( 0x4e40 ), + SHC( 0x9ab5 ), + SHC( 0x2c4d ), + SHC( 0x87ea ), + SHC( 0x0647 ), + SHC( 0x8028 ), + SHC( 0xdfaf ), + SHC( 0x8426 ), + SHC( 0xbc0e ), + SHC( 0x9387 ), + SHC( 0x9eac ), + SHC( 0xacdf ), + SHC( 0x8a3b ), + SHC( 0xcddc ), + SHC( 0x809e ), + SHC( 0xf375 ), + SHC( 0x82b6 ), + SHC( 0x1a33 ), + SHC( 0x9053 ), + SHC( 0x3e8b ), + SHC( 0xa832 ), + SHC( 0x5d22 ), + SHC( 0xc824 ), + SHC( 0x732a ), + SHC( 0xed38 ), + SHC( 0x7e9d ), + SHC( 0x1406 ), + SHC( 0x7e6c ), + SHC( 0x38fd ), + SHC( 0x729d ), + SHC( 0x58b7 ), + SHC( 0x5c44 ), + SHC( 0x7049 ), + SHC( 0x3d71 ), +}; + +const Word16 FFT_RotVector_600_fx[1140] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff8 ), + SHC( 0xfd52 ), + SHC( 0x7fe3 ), + SHC( 0xfaa4 ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7f8d ), + SHC( 0xf54b ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7ea0 ), + SHC( 0xed4e ), + SHC( 0x7e35 ), + SHC( 0xeaa8 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7c9e ), + SHC( 0xe2c6 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7b48 ), + SHC( 0xdd95 ), + SHC( 0x7a89 ), + SHC( 0xdb02 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x78e1 ), + SHC( 0xd5e8 ), + SHC( 0x77f8 ), + SHC( 0xd362 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x75ff ), + SHC( 0xce66 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x72a6 ), + SHC( 0xc717 ), + SHC( 0x716f ), + SHC( 0xc4b3 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6d7c ), + SHC( 0xbdb2 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x6a9d ), + SHC( 0xb92b ), + SHC( 0x691b ), + SHC( 0xb6f3 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fe3 ), + SHC( 0xfaa4 ), + SHC( 0x7f8d ), + SHC( 0xf54b ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7e35 ), + SHC( 0xeaa8 ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7a89 ), + SHC( 0xdb02 ), + SHC( 0x78e1 ), + SHC( 0xd5e8 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x72a6 ), + SHC( 0xc717 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6d7c ), + SHC( 0xbdb2 ), + SHC( 0x6a9d ), + SHC( 0xb92b ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6450 ), + SHC( 0xb07f ), + SHC( 0x60e5 ), + SHC( 0xac5d ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x598e ), + SHC( 0xa48d ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4d63 ), + SHC( 0x9a0c ), + SHC( 0x490d ), + SHC( 0x96e5 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x3b4d ), + SHC( 0x8e91 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x319a ), + SHC( 0x8a01 ), + SHC( 0x2c9e ), + SHC( 0x8808 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x62a0 ), + SHC( 0xae69 ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x579f ), + SHC( 0xa2b2 ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x3daa ), + SHC( 0x8fd6 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x2f1e ), + SHC( 0x88fe ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x17fc ), + SHC( 0x8245 ), + SHC( 0x100a ), + SHC( 0x8103 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf7f7 ), + SHC( 0x8041 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xe02b ), + SHC( 0x8406 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f8d ), + SHC( 0xf54b ), + SHC( 0x7e35 ), + SHC( 0xeaa8 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x78e1 ), + SHC( 0xd5e8 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6a9d ), + SHC( 0xb92b ), + SHC( 0x6450 ), + SHC( 0xb07f ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x4d63 ), + SHC( 0x9a0c ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x3b4d ), + SHC( 0x8e91 ), + SHC( 0x319a ), + SHC( 0x8a01 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1d3a ), + SHC( 0x8362 ), + SHC( 0x12b2 ), + SHC( 0x8160 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xfd52 ), + SHC( 0x8008 ), + SHC( 0xf29f ), + SHC( 0x80b4 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xdd95 ), + SHC( 0x84b8 ), + SHC( 0xd362 ), + SHC( 0x8808 ), + SHC( 0xc981 ), + SHC( 0x8c2f ), + SHC( 0xc000 ), + SHC( 0x9127 ), + SHC( 0xb6f3 ), + SHC( 0x96e5 ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0xa672 ), + SHC( 0xa48d ), + SHC( 0x9f1b ), + SHC( 0xac5d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf29f ), + SHC( 0x80b4 ), + SHC( 0xe564 ), + SHC( 0x82cd ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xcbf1 ), + SHC( 0x8b11 ), + SHC( 0xc000 ), + SHC( 0x9127 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xaa5a ), + SHC( 0xa0e1 ), + SHC( 0xa0e1 ), + SHC( 0xaa5a ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x9127 ), + SHC( 0xc000 ), + SHC( 0x8b11 ), + SHC( 0xcbf1 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x82cd ), + SHC( 0xe564 ), + SHC( 0x80b4 ), + SHC( 0xf29f ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x17fc ), + SHC( 0x8245 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xf7f7 ), + SHC( 0x8041 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc981 ), + SHC( 0x8c2f ), + SHC( 0xbb6b ), + SHC( 0x93ee ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0xa2b2 ), + SHC( 0xa861 ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x88fe ), + SHC( 0xd0e2 ), + SHC( 0x8406 ), + SHC( 0xe02b ), + SHC( 0x8103 ), + SHC( 0xeff6 ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8103 ), + SHC( 0x100a ), + SHC( 0x8406 ), + SHC( 0x1fd5 ), + SHC( 0x88fe ), + SHC( 0x2f1e ), + SHC( 0x8fd6 ), + SHC( 0x3daa ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ea0 ), + SHC( 0xed4e ), + SHC( 0x7a89 ), + SHC( 0xdb02 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x6a9d ), + SHC( 0xb92b ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x424e ), + SHC( 0x9284 ), + SHC( 0x319a ), + SHC( 0x8a01 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0xfaa4 ), + SHC( 0x801d ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xd5e8 ), + SHC( 0x871f ), + SHC( 0xc4b3 ), + SHC( 0x8e91 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa672 ), + SHC( 0xa48d ), + SHC( 0x9a0c ), + SHC( 0xb29d ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x8808 ), + SHC( 0xd362 ), + SHC( 0x82cd ), + SHC( 0xe564 ), + SHC( 0x8041 ), + SHC( 0xf7f7 ), + SHC( 0x8073 ), + SHC( 0x0ab5 ), + SHC( 0x8362 ), + SHC( 0x1d3a ), + SHC( 0x88fe ), + SHC( 0x2f1e ), + SHC( 0x9127 ), + SHC( 0x4000 ), + SHC( 0x9bb0 ), + SHC( 0x4f81 ), + SHC( 0xa861 ), + SHC( 0x5d4e ), + SHC( 0xb6f3 ), + SHC( 0x691b ), + SHC( 0xc717 ), + SHC( 0x72a6 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e35 ), + SHC( 0xeaa8 ), + SHC( 0x78e1 ), + SHC( 0xd5e8 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6450 ), + SHC( 0xb07f ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x319a ), + SHC( 0x8a01 ), + SHC( 0x1d3a ), + SHC( 0x8362 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xf29f ), + SHC( 0x80b4 ), + SHC( 0xdd95 ), + SHC( 0x84b8 ), + SHC( 0xc981 ), + SHC( 0x8c2f ), + SHC( 0xb6f3 ), + SHC( 0x96e5 ), + SHC( 0xa672 ), + SHC( 0xa48d ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8d5a ), + SHC( 0xc717 ), + SHC( 0x8577 ), + SHC( 0xdb02 ), + SHC( 0x8103 ), + SHC( 0xeff6 ), + SHC( 0x801d ), + SHC( 0x055c ), + SHC( 0x82cd ), + SHC( 0x1a9c ), + SHC( 0x88fe ), + SHC( 0x2f1e ), + SHC( 0x9284 ), + SHC( 0x424e ), + SHC( 0x9f1b ), + SHC( 0x53a3 ), + SHC( 0xae69 ), + SHC( 0x62a0 ), + SHC( 0xc000 ), + SHC( 0x6ed9 ), + SHC( 0xd362 ), + SHC( 0x77f8 ), + SHC( 0xe804 ), + SHC( 0x7dbb ), + SHC( 0xfd52 ), + SHC( 0x7ff8 ), + SHC( 0x12b2 ), + SHC( 0x7ea0 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc256 ), + SHC( 0x8fd6 ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0x9d60 ), + SHC( 0xae69 ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8103 ), + SHC( 0xeff6 ), + SHC( 0x8041 ), + SHC( 0x0809 ), + SHC( 0x8406 ), + SHC( 0x1fd5 ), + SHC( 0x8c2f ), + SHC( 0x367f ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xa861 ), + SHC( 0x5d4e ), + SHC( 0xbb6b ), + SHC( 0x6c12 ), + SHC( 0xd0e2 ), + SHC( 0x7702 ), + SHC( 0xe804 ), + SHC( 0x7dbb ), + SHC( 0x0000 ), + SHC( 0x7fff ), + SHC( 0x17fc ), + SHC( 0x7dbb ), + SHC( 0x2f1e ), + SHC( 0x7702 ), + SHC( 0x4495 ), + SHC( 0x6c12 ), + SHC( 0x579f ), + SHC( 0x5d4e ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ffe ), + SHC( 0xfea9 ), + SHC( 0x7ff8 ), + SHC( 0xfd52 ), + SHC( 0x7fef ), + SHC( 0xfbfb ), + SHC( 0x7fe3 ), + SHC( 0xfaa4 ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7fa8 ), + SHC( 0xf6a1 ), + SHC( 0x7f8d ), + SHC( 0xf54b ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7f26 ), + SHC( 0xf14a ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7ed0 ), + SHC( 0xeea1 ), + SHC( 0x7ea0 ), + SHC( 0xed4e ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e35 ), + SHC( 0xeaa8 ), + SHC( 0x7dfa ), + SHC( 0xe956 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7d79 ), + SHC( 0xe6b4 ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7c9e ), + SHC( 0xe2c6 ), + SHC( 0x7c4e ), + SHC( 0xe178 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x7b48 ), + SHC( 0xdd95 ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x7a89 ), + SHC( 0xdb02 ), + SHC( 0x7a24 ), + SHC( 0xd9ba ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fef ), + SHC( 0xfbfb ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x786e ), + SHC( 0xd4a5 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x7578 ), + SHC( 0xcd2b ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6e2c ), + SHC( 0xbed8 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x69dd ), + SHC( 0xb80e ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x62a0 ), + SHC( 0xae69 ), + SHC( 0x6003 ), + SHC( 0xab5b ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x579f ), + SHC( 0xa2b2 ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4e73 ), + SHC( 0x9add ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fd3 ), + SHC( 0xf94e ), + SHC( 0x7f4c ), + SHC( 0xf29f ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7d33 ), + SHC( 0xe564 ), + SHC( 0x7ba3 ), + SHC( 0xdee0 ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x74ef ), + SHC( 0xcbf1 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6ed9 ), + SHC( 0xc000 ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x55a6 ), + SHC( 0xa0e1 ), + SHC( 0x508d ), + SHC( 0x9c87 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x45b6 ), + SHC( 0x94a7 ), + SHC( 0x4000 ), + SHC( 0x9127 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x2ddf ), + SHC( 0x8881 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x2120 ), + SHC( 0x845d ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x06b2 ), + SHC( 0x802d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fa8 ), + SHC( 0xf6a1 ), + SHC( 0x7ea0 ), + SHC( 0xed4e ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7a89 ), + SHC( 0xdb02 ), + SHC( 0x777f ), + SHC( 0xd221 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x6f83 ), + SHC( 0xc12b ), + SHC( 0x6a9d ), + SHC( 0xb92b ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x5f1f ), + SHC( 0xaa5a ), + SHC( 0x5898 ), + SHC( 0xa39e ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4a25 ), + SHC( 0x97aa ), + SHC( 0x424e ), + SHC( 0x9284 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x319a ), + SHC( 0x8a01 ), + SHC( 0x28d3 ), + SHC( 0x86b0 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x16aa ), + SHC( 0x8206 ), + SHC( 0x0d61 ), + SHC( 0x80b4 ), + SHC( 0x0405 ), + SHC( 0x8011 ), + SHC( 0xfaa4 ), + SHC( 0x801d ), + SHC( 0xf14a ), + SHC( 0x80da ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xdee0 ), + SHC( 0x845d ), + SHC( 0xd5e8 ), + SHC( 0x871f ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xc4b3 ), + SHC( 0x8e91 ), + SHC( 0xbc8d ), + SHC( 0x9337 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4128 ), + SHC( 0x91d4 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x2b5b ), + SHC( 0x8792 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xfbfb ), + SHC( 0x8011 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xe414 ), + SHC( 0x8316 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xc256 ), + SHC( 0x8fd6 ), + SHC( 0xb80e ), + SHC( 0x9623 ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9d60 ), + SHC( 0xae69 ), + SHC( 0x9623 ), + SHC( 0xb80e ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x8a88 ), + SHC( 0xcd2b ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f26 ), + SHC( 0xf14a ), + SHC( 0x7c9e ), + SHC( 0xe2c6 ), + SHC( 0x786e ), + SHC( 0xd4a5 ), + SHC( 0x72a6 ), + SHC( 0xc717 ), + SHC( 0x6b59 ), + SHC( 0xba4a ), + SHC( 0x62a0 ), + SHC( 0xae69 ), + SHC( 0x5898 ), + SHC( 0xa39e ), + SHC( 0x4d63 ), + SHC( 0x9a0c ), + SHC( 0x4128 ), + SHC( 0x91d4 ), + SHC( 0x340f ), + SHC( 0x8b11 ), + SHC( 0x2646 ), + SHC( 0x85dc ), + SHC( 0x17fc ), + SHC( 0x8245 ), + SHC( 0x095f ), + SHC( 0x8058 ), + SHC( 0xfaa4 ), + SHC( 0x801d ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xdd95 ), + SHC( 0x84b8 ), + SHC( 0xcfa3 ), + SHC( 0x897e ), + SHC( 0xc256 ), + SHC( 0x8fd6 ), + SHC( 0xb5db ), + SHC( 0x97aa ), + SHC( 0xaa5a ), + SHC( 0xa0e1 ), + SHC( 0x9ffd ), + SHC( 0xab5b ), + SHC( 0x96e5 ), + SHC( 0xb6f3 ), + SHC( 0x8f32 ), + SHC( 0xc384 ), + SHC( 0x88fe ), + SHC( 0xd0e2 ), + SHC( 0x845d ), + SHC( 0xdee0 ), + SHC( 0x8160 ), + SHC( 0xed4e ), + SHC( 0x8011 ), + SHC( 0xfbfb ), + SHC( 0x8073 ), + SHC( 0x0ab5 ), + SHC( 0x8287 ), + SHC( 0x194c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ed0 ), + SHC( 0xeea1 ), + SHC( 0x7b48 ), + SHC( 0xdd95 ), + SHC( 0x7578 ), + SHC( 0xcd2b ), + SHC( 0x6d7c ), + SHC( 0xbdb2 ), + SHC( 0x6379 ), + SHC( 0xaf73 ), + SHC( 0x579f ), + SHC( 0xa2b2 ), + SHC( 0x4a25 ), + SHC( 0x97aa ), + SHC( 0x3b4d ), + SHC( 0x8e91 ), + SHC( 0x2b5b ), + SHC( 0x8792 ), + SHC( 0x1a9c ), + SHC( 0x82cd ), + SHC( 0x095f ), + SHC( 0x8058 ), + SHC( 0xf7f7 ), + SHC( 0x8041 ), + SHC( 0xe6b4 ), + SHC( 0x8287 ), + SHC( 0xd5e8 ), + SHC( 0x871f ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb6f3 ), + SHC( 0x96e5 ), + SHC( 0xa95d ), + SHC( 0xa1c8 ), + SHC( 0x9d60 ), + SHC( 0xae69 ), + SHC( 0x9337 ), + SHC( 0xbc8d ), + SHC( 0x8b11 ), + SHC( 0xcbf1 ), + SHC( 0x8516 ), + SHC( 0xdc4b ), + SHC( 0x8160 ), + SHC( 0xed4e ), + SHC( 0x8002 ), + SHC( 0xfea9 ), + SHC( 0x8103 ), + SHC( 0x100a ), + SHC( 0x845d ), + SHC( 0x2120 ), + SHC( 0x8a01 ), + SHC( 0x319a ), + SHC( 0x91d4 ), + SHC( 0x4128 ), + SHC( 0x9bb0 ), + SHC( 0x4f81 ), + SHC( 0xa768 ), + SHC( 0x5c62 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x8644 ), + SHC( 0x278d ), + SHC( 0x8df4 ), + SHC( 0x3a1c ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xa57e ), + SHC( 0x5a82 ), + SHC( 0xb4c4 ), + SHC( 0x678d ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xd873 ), + SHC( 0x79bc ), + SHC( 0xebfa ), + SHC( 0x7e6c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7dfa ), + SHC( 0xe956 ), + SHC( 0x77f8 ), + SHC( 0xd362 ), + SHC( 0x6e2c ), + SHC( 0xbed8 ), + SHC( 0x60e5 ), + SHC( 0xac5d ), + SHC( 0x508d ), + SHC( 0x9c87 ), + SHC( 0x3daa ), + SHC( 0x8fd6 ), + SHC( 0x28d3 ), + SHC( 0x86b0 ), + SHC( 0x12b2 ), + SHC( 0x8160 ), + SHC( 0xfbfb ), + SHC( 0x8011 ), + SHC( 0xe564 ), + SHC( 0x82cd ), + SHC( 0xcfa3 ), + SHC( 0x897e ), + SHC( 0xbb6b ), + SHC( 0x93ee ), + SHC( 0xa95d ), + SHC( 0xa1c8 ), + SHC( 0x9a0c ), + SHC( 0xb29d ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8577 ), + SHC( 0xdb02 ), + SHC( 0x80da ), + SHC( 0xf14a ), + SHC( 0x8041 ), + SHC( 0x0809 ), + SHC( 0x83b2 ), + SHC( 0x1e88 ), + SHC( 0x8b11 ), + SHC( 0x340f ), + SHC( 0x9623 ), + SHC( 0x47f2 ), + SHC( 0xa48d ), + SHC( 0x598e ), + SHC( 0xb5db ), + SHC( 0x6856 ), + SHC( 0xc981 ), + SHC( 0x73d1 ), + SHC( 0xdee0 ), + SHC( 0x7ba3 ), + SHC( 0xf54b ), + SHC( 0x7f8d ), + SHC( 0x0c0b ), + SHC( 0x7f6e ), + SHC( 0x226b ), + SHC( 0x7b48 ), + SHC( 0x37b5 ), + SHC( 0x733d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d79 ), + SHC( 0xe6b4 ), + SHC( 0x75ff ), + SHC( 0xce66 ), + SHC( 0x69dd ), + SHC( 0xb80e ), + SHC( 0x598e ), + SHC( 0xa48d ), + SHC( 0x45b6 ), + SHC( 0x94a7 ), + SHC( 0x2f1e ), + SHC( 0x88fe ), + SHC( 0x16aa ), + SHC( 0x8206 ), + SHC( 0xfd52 ), + SHC( 0x8008 ), + SHC( 0xe414 ), + SHC( 0x8316 ), + SHC( 0xcbf1 ), + SHC( 0x8b11 ), + SHC( 0xb5db ), + SHC( 0x97aa ), + SHC( 0xa2b2 ), + SHC( 0xa861 ), + SHC( 0x9337 ), + SHC( 0xbc8d ), + SHC( 0x8808 ), + SHC( 0xd362 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x801d ), + SHC( 0x055c ), + SHC( 0x83b2 ), + SHC( 0x1e88 ), + SHC( 0x8c2f ), + SHC( 0x367f ), + SHC( 0x993e ), + SHC( 0x4c51 ), + SHC( 0xaa5a ), + SHC( 0x5f1f ), + SHC( 0xbed8 ), + SHC( 0x6e2c ), + SHC( 0xd5e8 ), + SHC( 0x78e1 ), + SHC( 0xeea1 ), + SHC( 0x7ed0 ), + SHC( 0x0809 ), + SHC( 0x7fbf ), + SHC( 0x2120 ), + SHC( 0x7ba3 ), + SHC( 0x38e9 ), + SHC( 0x72a6 ), + SHC( 0x4e73 ), + SHC( 0x6523 ), + SHC( 0x60e5 ), + SHC( 0x53a3 ), + SHC( 0x6f83 ), + SHC( 0x3ed5 ), +}; + +const Word16 FFT_RotVector_400_fx[760] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fef ), + SHC( 0xfbfb ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x786e ), + SHC( 0xd4a5 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x7578 ), + SHC( 0xcd2b ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6e2c ), + SHC( 0xbed8 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x69dd ), + SHC( 0xb80e ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x62a0 ), + SHC( 0xae69 ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x579f ), + SHC( 0xa2b2 ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x3daa ), + SHC( 0x8fd6 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x2f1e ), + SHC( 0x88fe ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x4128 ), + SHC( 0x91d4 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x2b5b ), + SHC( 0x8792 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xfbfb ), + SHC( 0x8011 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xe414 ), + SHC( 0x8316 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x17fc ), + SHC( 0x8245 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xf7f7 ), + SHC( 0x8041 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc981 ), + SHC( 0x8c2f ), + SHC( 0xbb6b ), + SHC( 0x93ee ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0xa2b2 ), + SHC( 0xa861 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xc256 ), + SHC( 0x8fd6 ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0x9d60 ), + SHC( 0xae69 ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8103 ), + SHC( 0xeff6 ), + SHC( 0x8041 ), + SHC( 0x0809 ), + SHC( 0x8406 ), + SHC( 0x1fd5 ), + SHC( 0x8c2f ), + SHC( 0x367f ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x0405 ), + SHC( 0x8011 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xb4c4 ), + SHC( 0x9873 ), + SHC( 0x9ffd ), + SHC( 0xab5b ), + SHC( 0x8fd6 ), + SHC( 0xc256 ), + SHC( 0x8516 ), + SHC( 0xdc4b ), + SHC( 0x8041 ), + SHC( 0xf7f7 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x88fe ), + SHC( 0x2f1e ), + SHC( 0x9623 ), + SHC( 0x47f2 ), + SHC( 0xa861 ), + SHC( 0x5d4e ), + SHC( 0xbed8 ), + SHC( 0x6e2c ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x702a ), + SHC( 0xc256 ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x4495 ), + SHC( 0x93ee ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x0809 ), + SHC( 0x8041 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xc981 ), + SHC( 0x8c2f ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0x9873 ), + SHC( 0xb4c4 ), + SHC( 0x88fe ), + SHC( 0xd0e2 ), + SHC( 0x8103 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0x100a ), + SHC( 0x88fe ), + SHC( 0x2f1e ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xae69 ), + SHC( 0x62a0 ), + SHC( 0xc981 ), + SHC( 0x73d1 ), + SHC( 0xe804 ), + SHC( 0x7dbb ), + SHC( 0x0809 ), + SHC( 0x7fbf ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0x9623 ), + SHC( 0xb80e ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8011 ), + SHC( 0xfbfb ), + SHC( 0x8406 ), + SHC( 0x1fd5 ), + SHC( 0x91d4 ), + SHC( 0x4128 ), + SHC( 0xa861 ), + SHC( 0x5d4e ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xe804 ), + SHC( 0x7dbb ), + SHC( 0x0c0b ), + SHC( 0x7f6e ), + SHC( 0x2f1e ), + SHC( 0x7702 ), + SHC( 0x4e73 ), + SHC( 0x6523 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ffb ), + SHC( 0xfdfe ), + SHC( 0x7fef ), + SHC( 0xfbfb ), + SHC( 0x7fdb ), + SHC( 0xf9f9 ), + SHC( 0x7fbf ), + SHC( 0xf7f7 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7f3a ), + SHC( 0xf1f5 ), + SHC( 0x7efd ), + SHC( 0xeff6 ), + SHC( 0x7eb9 ), + SHC( 0xedf7 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7e18 ), + SHC( 0xe9ff ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7d57 ), + SHC( 0xe60c ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7bfa ), + SHC( 0xe02b ), + SHC( 0x7b76 ), + SHC( 0xde3a ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x7a57 ), + SHC( 0xda5d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fdb ), + SHC( 0xf9f9 ), + SHC( 0x7f6e ), + SHC( 0xf3f5 ), + SHC( 0x7eb9 ), + SHC( 0xedf7 ), + SHC( 0x7dbb ), + SHC( 0xe804 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x7919 ), + SHC( 0xd68a ), + SHC( 0x7702 ), + SHC( 0xd0e2 ), + SHC( 0x74a8 ), + SHC( 0xcb54 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6f2f ), + SHC( 0xc095 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x68b9 ), + SHC( 0xb667 ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5d4e ), + SHC( 0xa861 ), + SHC( 0x5913 ), + SHC( 0xa415 ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x5007 ), + SHC( 0x9c1b ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f9a ), + SHC( 0xf5f6 ), + SHC( 0x7e6c ), + SHC( 0xebfa ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x79bc ), + SHC( 0xd873 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x678d ), + SHC( 0xb4c4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x278d ), + SHC( 0x8644 ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f3a ), + SHC( 0xf1f5 ), + SHC( 0x7cea ), + SHC( 0xe414 ), + SHC( 0x7919 ), + SHC( 0xd68a ), + SHC( 0x73d1 ), + SHC( 0xc981 ), + SHC( 0x6d23 ), + SHC( 0xbd1f ), + SHC( 0x6523 ), + SHC( 0xb18d ), + SHC( 0x5beb ), + SHC( 0xa6ed ), + SHC( 0x5197 ), + SHC( 0x9d60 ), + SHC( 0x4646 ), + SHC( 0x9505 ), + SHC( 0x3a1c ), + SHC( 0x8df4 ), + SHC( 0x2d3e ), + SHC( 0x8844 ), + SHC( 0x1fd5 ), + SHC( 0x8406 ), + SHC( 0x1209 ), + SHC( 0x8147 ), + SHC( 0x0405 ), + SHC( 0x8011 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xe804 ), + SHC( 0x8245 ), + SHC( 0xda5d ), + SHC( 0x85a9 ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xc095 ), + SHC( 0x90d1 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7eb9 ), + SHC( 0xedf7 ), + SHC( 0x7aea ), + SHC( 0xdc4b ), + SHC( 0x74a8 ), + SHC( 0xcb54 ), + SHC( 0x6c12 ), + SHC( 0xbb6b ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x54a5 ), + SHC( 0x9ffd ), + SHC( 0x4646 ), + SHC( 0x9505 ), + SHC( 0x367f ), + SHC( 0x8c2f ), + SHC( 0x25a3 ), + SHC( 0x85a9 ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0x0202 ), + SHC( 0x8005 ), + SHC( 0xeff6 ), + SHC( 0x8103 ), + SHC( 0xde3a ), + SHC( 0x848a ), + SHC( 0xcd2b ), + SHC( 0x8a88 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xae69 ), + SHC( 0x9d60 ), + SHC( 0xa154 ), + SHC( 0xa9db ), + SHC( 0x9623 ), + SHC( 0xb80e ), + SHC( 0x8d0e ), + SHC( 0xc7b1 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e18 ), + SHC( 0xe9ff ), + SHC( 0x786e ), + SHC( 0xd4a5 ), + SHC( 0x6f2f ), + SHC( 0xc095 ), + SHC( 0x62a0 ), + SHC( 0xae69 ), + SHC( 0x5321 ), + SHC( 0x9eac ), + SHC( 0x4128 ), + SHC( 0x91d4 ), + SHC( 0x2d3e ), + SHC( 0x8844 ), + SHC( 0x17fc ), + SHC( 0x8245 ), + SHC( 0x0202 ), + SHC( 0x8005 ), + SHC( 0xebfa ), + SHC( 0x8194 ), + SHC( 0xd68a ), + SHC( 0x86e7 ), + SHC( 0xc256 ), + SHC( 0x8fd6 ), + SHC( 0xaff9 ), + SHC( 0x9c1b ), + SHC( 0x9ffd ), + SHC( 0xab5b ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x88fe ), + SHC( 0xd0e2 ), + SHC( 0x82a9 ), + SHC( 0xe60c ), + SHC( 0x8011 ), + SHC( 0xfbfb ), + SHC( 0x8147 ), + SHC( 0x1209 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7d57 ), + SHC( 0xe60c ), + SHC( 0x7578 ), + SHC( 0xcd2b ), + SHC( 0x68b9 ), + SHC( 0xb667 ), + SHC( 0x579f ), + SHC( 0xa2b2 ), + SHC( 0x42e1 ), + SHC( 0x92dd ), + SHC( 0x2b5b ), + SHC( 0x8792 ), + SHC( 0x1209 ), + SHC( 0x8147 ), + SHC( 0xf7f7 ), + SHC( 0x8041 ), + SHC( 0xde3a ), + SHC( 0x848a ), + SHC( 0xc5e4 ), + SHC( 0x8df4 ), + SHC( 0xaff9 ), + SHC( 0x9c1b ), + SHC( 0x9d60 ), + SHC( 0xae69 ), + SHC( 0x8ee1 ), + SHC( 0xc41b ), + SHC( 0x8516 ), + SHC( 0xdc4b ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x8103 ), + SHC( 0x100a ), + SHC( 0x86e7 ), + SHC( 0x2976 ), + SHC( 0x91d4 ), + SHC( 0x4128 ), + SHC( 0xa154 ), + SHC( 0x5625 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7c76 ), + SHC( 0xe21f ), + SHC( 0x720c ), + SHC( 0xc5e4 ), + SHC( 0x6154 ), + SHC( 0xacdf ), + SHC( 0x4b3c ), + SHC( 0x9873 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x1406 ), + SHC( 0x8194 ), + SHC( 0xf5f6 ), + SHC( 0x8066 ), + SHC( 0xd873 ), + SHC( 0x8644 ), + SHC( 0xbd1f ), + SHC( 0x92dd ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x92dd ), + SHC( 0xbd1f ), + SHC( 0x8644 ), + SHC( 0xd873 ), + SHC( 0x8066 ), + SHC( 0xf5f6 ), + SHC( 0x8194 ), + SHC( 0x1406 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9873 ), + SHC( 0x4b3c ), + SHC( 0xacdf ), + SHC( 0x6154 ), + SHC( 0xc5e4 ), + SHC( 0x720c ), + SHC( 0xe21f ), + SHC( 0x7c76 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7b76 ), + SHC( 0xde3a ), + SHC( 0x6e2c ), + SHC( 0xbed8 ), + SHC( 0x5913 ), + SHC( 0xa415 ), + SHC( 0x3daa ), + SHC( 0x8fd6 ), + SHC( 0x1de1 ), + SHC( 0x838a ), + SHC( 0xfbfb ), + SHC( 0x8011 ), + SHC( 0xda5d ), + SHC( 0x85a9 ), + SHC( 0xbb6b ), + SHC( 0x93ee ), + SHC( 0xa154 ), + SHC( 0xa9db ), + SHC( 0x8df4 ), + SHC( 0xc5e4 ), + SHC( 0x82a9 ), + SHC( 0xe60c ), + SHC( 0x8041 ), + SHC( 0x0809 ), + SHC( 0x86e7 ), + SHC( 0x2976 ), + SHC( 0x9623 ), + SHC( 0x47f2 ), + SHC( 0xacdf ), + SHC( 0x6154 ), + SHC( 0xc981 ), + SHC( 0x73d1 ), + SHC( 0xe9ff ), + SHC( 0x7e18 ), + SHC( 0x0c0b ), + SHC( 0x7f6e ), + SHC( 0x2d3e ), + SHC( 0x77bc ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7a57 ), + SHC( 0xda5d ), + SHC( 0x69dd ), + SHC( 0xb80e ), + SHC( 0x5007 ), + SHC( 0x9c1b ), + SHC( 0x2f1e ), + SHC( 0x88fe ), + SHC( 0x0a0a ), + SHC( 0x8066 ), + SHC( 0xe414 ), + SHC( 0x8316 ), + SHC( 0xc095 ), + SHC( 0x90d1 ), + SHC( 0xa2b2 ), + SHC( 0xa861 ), + SHC( 0x8d0e ), + SHC( 0xc7b1 ), + SHC( 0x8194 ), + SHC( 0xebfa ), + SHC( 0x8147 ), + SHC( 0x1209 ), + SHC( 0x8c2f ), + SHC( 0x367f ), + SHC( 0xa154 ), + SHC( 0x5625 ), + SHC( 0xbed8 ), + SHC( 0x6e2c ), + SHC( 0xe21f ), + SHC( 0x7c76 ), + SHC( 0x0809 ), + SHC( 0x7fbf ), + SHC( 0x2d3e ), + SHC( 0x77bc ), + SHC( 0x4e73 ), + SHC( 0x6523 ), + SHC( 0x68b9 ), + SHC( 0x4999 ), +}; + +const Word16 FFT_RotVector_256_fx[448] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7ff6 ), + SHC( 0xfcdc ), + SHC( 0x7fd8 ), + SHC( 0xf9b9 ), + SHC( 0x7fa7 ), + SHC( 0xf696 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7f09 ), + SHC( 0xf055 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7e1d ), + SHC( 0xea1e ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7ce3 ), + SHC( 0xe3f5 ), + SHC( 0x7c29 ), + SHC( 0xe0e7 ), + SHC( 0x7b5d ), + SHC( 0xdddd ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x798a ), + SHC( 0xd7da ), + SHC( 0x7884 ), + SHC( 0xd4e1 ), + SHC( 0x776c ), + SHC( 0xd1ef ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x7504 ), + SHC( 0xcc22 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x7255 ), + SHC( 0xc674 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6f5f ), + SHC( 0xc0e9 ), + SHC( 0x6dca ), + SHC( 0xbe32 ), + SHC( 0x6c24 ), + SHC( 0xbb86 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x68a6 ), + SHC( 0xb64c ), + SHC( 0x66cf ), + SHC( 0xb3c1 ), + SHC( 0x64e8 ), + SHC( 0xb141 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x60ec ), + SHC( 0xac65 ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5cb4 ), + SHC( 0xa7be ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fd8 ), + SHC( 0xf9b9 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7c29 ), + SHC( 0xe0e7 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7884 ), + SHC( 0xd4e1 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6dca ), + SHC( 0xbe32 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x66cf ), + SHC( 0xb3c1 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x55f5 ), + SHC( 0xa129 ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x4c3f ), + SHC( 0x9931 ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x36ba ), + SHC( 0x8c4b ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2b1f ), + SHC( 0x877c ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x12c8 ), + SHC( 0x8163 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0647 ), + SHC( 0x8028 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fa7 ), + SHC( 0xf696 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7ce3 ), + SHC( 0xe3f5 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x776c ), + SHC( 0xd1ef ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x6f5f ), + SHC( 0xc0e9 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x64e8 ), + SHC( 0xb141 ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5842 ), + SHC( 0xa34c ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x49b4 ), + SHC( 0x975a ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x398c ), + SHC( 0x8dab ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2826 ), + SHC( 0x8676 ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0x15e2 ), + SHC( 0x81e3 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0324 ), + SHC( 0x800a ), + SHC( 0xf9b9 ), + SHC( 0x8028 ), + SHC( 0xf055 ), + SHC( 0x80f7 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xdddd ), + SHC( 0x84a3 ), + SHC( 0xd4e1 ), + SHC( 0x877c ), + SHC( 0xcc22 ), + SHC( 0x8afc ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xbb86 ), + SHC( 0x93dc ), + SHC( 0xb3c1 ), + SHC( 0x9931 ), + SHC( 0xac65 ), + SHC( 0x9f14 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f62 ), + SHC( 0xf375 ), + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x3c56 ), + SHC( 0x8f1e ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x2528 ), + SHC( 0x8583 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0xf375 ), + SHC( 0x809e ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xdad8 ), + SHC( 0x8583 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb8e4 ), + SHC( 0x9593 ), + SHC( 0xaecd ), + SHC( 0x9d0e ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9d0e ), + SHC( 0xaecd ), + SHC( 0x9593 ), + SHC( 0xb8e4 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x8583 ), + SHC( 0xdad8 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x809e ), + SHC( 0xf375 ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7f09 ), + SHC( 0xf055 ), + SHC( 0x7c29 ), + SHC( 0xe0e7 ), + SHC( 0x776c ), + SHC( 0xd1ef ), + SHC( 0x70e2 ), + SHC( 0xc3aa ), + SHC( 0x68a6 ), + SHC( 0xb64c ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x539b ), + SHC( 0x9f14 ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x398c ), + SHC( 0x8dab ), + SHC( 0x2b1f ), + SHC( 0x877c ), + SHC( 0x1c0b ), + SHC( 0x831d ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xfcdc ), + SHC( 0x800a ), + SHC( 0xed38 ), + SHC( 0x8163 ), + SHC( 0xdddd ), + SHC( 0x84a3 ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xc0e9 ), + SHC( 0x90a1 ), + SHC( 0xb3c1 ), + SHC( 0x9931 ), + SHC( 0xa7be ), + SHC( 0xa34c ), + SHC( 0x9d0e ), + SHC( 0xaecd ), + SHC( 0x93dc ), + SHC( 0xbb86 ), + SHC( 0x8c4b ), + SHC( 0xc946 ), + SHC( 0x8676 ), + SHC( 0xd7da ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8059 ), + SHC( 0xf696 ), + SHC( 0x8028 ), + SHC( 0x0647 ), + SHC( 0x81e3 ), + SHC( 0x15e2 ), + SHC( 0x8583 ), + SHC( 0x2528 ), + SHC( 0x8afc ), + SHC( 0x33de ), + SHC( 0x9236 ), + SHC( 0x41ce ), + SHC( 0x9b18 ), + SHC( 0x4ebf ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e9d ), + SHC( 0xed38 ), + SHC( 0x7a7d ), + SHC( 0xdad8 ), + SHC( 0x73b5 ), + SHC( 0xc946 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5ed7 ), + SHC( 0xaa0b ), + SHC( 0x5133 ), + SHC( 0x9d0e ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x1f19 ), + SHC( 0x83d7 ), + SHC( 0x0c8b ), + SHC( 0x809e ), + SHC( 0xf9b9 ), + SHC( 0x8028 ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xd4e1 ), + SHC( 0x877c ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb3c1 ), + SHC( 0x9931 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x9931 ), + SHC( 0xb3c1 ), + SHC( 0x8f1e ), + SHC( 0xc3aa ), + SHC( 0x877c ), + SHC( 0xd4e1 ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x8028 ), + SHC( 0xf9b9 ), + SHC( 0x809e ), + SHC( 0x0c8b ), + SHC( 0x83d7 ), + SHC( 0x1f19 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0x9236 ), + SHC( 0x41ce ), + SHC( 0x9d0e ), + SHC( 0x5133 ), + SHC( 0xaa0b ), + SHC( 0x5ed7 ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), + SHC( 0xc946 ), + SHC( 0x73b5 ), + SHC( 0xdad8 ), + SHC( 0x7a7d ), + SHC( 0xed38 ), + SHC( 0x7e9d ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7e1d ), + SHC( 0xea1e ), + SHC( 0x7884 ), + SHC( 0xd4e1 ), + SHC( 0x6f5f ), + SHC( 0xc0e9 ), + SHC( 0x62f2 ), + SHC( 0xaecd ), + SHC( 0x539b ), + SHC( 0x9f14 ), + SHC( 0x41ce ), + SHC( 0x9236 ), + SHC( 0x2e11 ), + SHC( 0x8894 ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x0324 ), + SHC( 0x800a ), + SHC( 0xed38 ), + SHC( 0x8163 ), + SHC( 0xd7da ), + SHC( 0x8676 ), + SHC( 0xc3aa ), + SHC( 0x8f1e ), + SHC( 0xb141 ), + SHC( 0x9b18 ), + SHC( 0xa129 ), + SHC( 0xaa0b ), + SHC( 0x93dc ), + SHC( 0xbb86 ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x831d ), + SHC( 0xe3f5 ), + SHC( 0x8028 ), + SHC( 0xf9b9 ), + SHC( 0x80f7 ), + SHC( 0x0fab ), + SHC( 0x8583 ), + SHC( 0x2528 ), + SHC( 0x8dab ), + SHC( 0x398c ), + SHC( 0x9931 ), + SHC( 0x4c3f ), + SHC( 0xa7be ), + SHC( 0x5cb4 ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), + SHC( 0xcc22 ), + SHC( 0x7504 ), + SHC( 0xe0e7 ), + SHC( 0x7c29 ), + SHC( 0xf696 ), + SHC( 0x7fa7 ), + SHC( 0x0c8b ), + SHC( 0x7f62 ), + SHC( 0x2223 ), + SHC( 0x7b5d ), + SHC( 0x36ba ), + SHC( 0x73b5 ), + SHC( 0x49b4 ), + SHC( 0x68a6 ), +}; + +const Word16 FFT_RotVector_32_fx[40] = { + // Q15 + SHC( 0x7d8a ), + SHC( 0xe708 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x471c ), + SHC( 0x9593 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0x18f8 ), + SHC( 0x8276 ), + SHC( 0x7641 ), + SHC( 0xcf05 ), + SHC( 0x5a82 ), + SHC( 0xa57e ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x89bf ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x89bf ), + SHC( 0xcf05 ), + SHC( 0x6a6d ), + SHC( 0xb8e4 ), + SHC( 0x30fb ), + SHC( 0x89bf ), + SHC( 0xe708 ), + SHC( 0x8276 ), + SHC( 0xa57e ), + SHC( 0xa57e ), + SHC( 0x8276 ), + SHC( 0xe708 ), + SHC( 0x89bf ), + SHC( 0x30fb ), + SHC( 0xb8e4 ), + SHC( 0x6a6d ), +}; + +const Word16 cos_twiddle_table_25_5_5[25] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7bfa ), + SHC( 0x702a ), + SHC( 0x5d4e ), + SHC( 0x4495 ), + SHC( 0x7fff ), + SHC( 0x702a ), + SHC( 0x4495 ), + SHC( 0x0809 ), + SHC( 0xc981 ), + SHC( 0x7fff ), + SHC( 0x5d4e ), + SHC( 0x0809 ), + SHC( 0xae69 ), + SHC( 0x8103 ), + SHC( 0x7fff ), + SHC( 0x4495 ), + SHC( 0xc981 ), + SHC( 0x8103 ), + SHC( 0xae69 ), +}; + +const Word16 sin_twiddle_table_25_5_5[25] = { + // Q15 + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0xe02b ), + SHC( 0xc256 ), + SHC( 0xa861 ), + SHC( 0x93ee ), + SHC( 0x0000 ), + SHC( 0xc256 ), + SHC( 0x93ee ), + SHC( 0x8041 ), + SHC( 0x8c2f ), + SHC( 0x0000 ), + SHC( 0xa861 ), + SHC( 0x8041 ), + SHC( 0x9d60 ), + SHC( 0xeff6 ), + SHC( 0x0000 ), + SHC( 0x93ee ), + SHC( 0x8c2f ), + SHC( 0xeff6 ), + SHC( 0x62a0 ), +}; +const Word16 cos_twiddle_table_16_8_2[16] = { + // Q15 + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7fff ), + SHC( 0x7641 ), + SHC( 0x7fff ), + SHC( 0x5a82 ), + SHC( 0x7fff ), + SHC( 0x30fb ), + SHC( 0x7fff ), + SHC( 0x0000 ), + SHC( 0x7fff ), + SHC( 0xcf05 ), + SHC( 0x7fff ), + SHC( 0xa57e ), + SHC( 0x7fff ), + SHC( 0x89bf ), +}; +const Word16 sin_twiddle_table_16_8_2[16] = { + // Q15 + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0x0000 ), + SHC( 0xcf05 ), + SHC( 0x0000 ), + SHC( 0xa57e ), + SHC( 0x0000 ), + SHC( 0x89bf ), + SHC( 0x0000 ), + SHC( 0x8000 ), + SHC( 0x0000 ), + SHC( 0x89bf ), + SHC( 0x0000 ), + SHC( 0xa57e ), + SHC( 0x0000 ), + SHC( 0xcf05 ), +}; + + +/*----------------------------------------------------------------------------------* + * LP analysis windows + *----------------------------------------------------------------------------------*/ + +/* LP analysis window (length of the window is 25 ms which is 320 samples at 12.8kHz (Q15)*/ +const Word16 LP_assym_window_fx[L_LP] = { + 0x0a3d, 0x0a3f, 0x0a45, 0x0a50, 0x0a5f, 0x0a72, 0x0a89, 0x0aa4, + 0x0ac4, 0x0ae8, 0x0b10, 0x0b3c, 0x0b6d, 0x0ba1, 0x0bda, 0x0c17, + 0x0c57, 0x0c9c, 0x0ce5, 0x0d32, 0x0d83, 0x0dd8, 0x0e31, 0x0e8e, + 0x0eef, 0x0f54, 0x0fbd, 0x1029, 0x109a, 0x110e, 0x1185, 0x1201, + 0x1280, 0x1303, 0x1389, 0x1413, 0x14a1, 0x1532, 0x15c6, 0x165e, + 0x16f9, 0x1798, 0x183a, 0x18df, 0x1987, 0x1a32, 0x1ae1, 0x1b92, + 0x1c47, 0x1cfe, 0x1db8, 0x1e75, 0x1f35, 0x1ff8, 0x20bd, 0x2185, + 0x224f, 0x231c, 0x23ec, 0x24bd, 0x2592, 0x2668, 0x2740, 0x281b, + 0x28f8, 0x29d7, 0x2ab8, 0x2b9a, 0x2c7f, 0x2d65, 0x2e4d, 0x2f37, + 0x3022, 0x310f, 0x31fd, 0x32ec, 0x33dd, 0x34cf, 0x35c2, 0x36b7, + 0x37ac, 0x38a3, 0x399a, 0x3a92, 0x3b8b, 0x3c84, 0x3d7e, 0x3e79, + 0x3f74, 0x4070, 0x416c, 0x4268, 0x4364, 0x4461, 0x455d, 0x465a, + 0x4756, 0x4853, 0x494f, 0x4a4a, 0x4b46, 0x4c41, 0x4d3b, 0x4e35, + 0x4f2e, 0x5027, 0x511e, 0x5215, 0x530b, 0x5400, 0x54f4, 0x55e6, + 0x56d8, 0x57c8, 0x58b7, 0x59a4, 0x5a90, 0x5b7b, 0x5c64, 0x5d4b, + 0x5e30, 0x5f14, 0x5ff5, 0x60d5, 0x61b3, 0x628f, 0x6369, 0x6440, + 0x6515, 0x65e8, 0x66b9, 0x6787, 0x6853, 0x691c, 0x69e2, 0x6aa6, + 0x6b68, 0x6c26, 0x6ce2, 0x6d9b, 0x6e50, 0x6f03, 0x6fb3, 0x7060, + 0x710a, 0x71b1, 0x7254, 0x72f4, 0x7391, 0x742b, 0x74c1, 0x7554, + 0x75e3, 0x766f, 0x76f7, 0x777b, 0x77fc, 0x787a, 0x78f3, 0x7969, + 0x79dc, 0x7a4a, 0x7ab5, 0x7b1b, 0x7b7e, 0x7bdd, 0x7c38, 0x7c8f, + 0x7ce2, 0x7d31, 0x7d7c, 0x7dc3, 0x7e06, 0x7e45, 0x7e80, 0x7eb6, + 0x7ee9, 0x7f17, 0x7f41, 0x7f67, 0x7f89, 0x7fa6, 0x7fc0, 0x7fd5, + 0x7fe6, 0x7ff2, 0x7ffb, 0x7fff, 0x7ffe, 0x7ff6, 0x7fe5, 0x7fcb, + 0x7fa8, 0x7f7e, 0x7f4a, 0x7f0e, 0x7eca, 0x7e7d, 0x7e28, 0x7dca, + 0x7d64, 0x7cf6, 0x7c80, 0x7c02, 0x7b7b, 0x7aed, 0x7a57, 0x79b9, + 0x7914, 0x7866, 0x77b2, 0x76f6, 0x7632, 0x7568, 0x7496, 0x73be, + 0x72de, 0x71f8, 0x710c, 0x7019, 0x6f20, 0x6e20, 0x6d1b, 0x6c10, + 0x6aff, 0x69e8, 0x68cd, 0x67ab, 0x6685, 0x655a, 0x642b, 0x62f7, + 0x61be, 0x6081, 0x5f40, 0x5dfc, 0x5cb4, 0x5b68, 0x5a19, 0x58c7, + 0x5772, 0x561b, 0x54c1, 0x5365, 0x5206, 0x50a6, 0x4f44, 0x4de1, + 0x4c7c, 0x4b16, 0x49af, 0x4848, 0x46e0, 0x4578, 0x4410, 0x42a8, + 0x4141, 0x3fda, 0x3e73, 0x3d0e, 0x3baa, 0x3a47, 0x38e6, 0x3787, + 0x3629, 0x34ce, 0x3376, 0x321f, 0x30cc, 0x2f7b, 0x2e2e, 0x2ce4, + 0x2b9e, 0x2a5b, 0x291c, 0x27e2, 0x26ab, 0x2579, 0x244c, 0x2323, + 0x2200, 0x20e1, 0x1fc8, 0x1eb4, 0x1da6, 0x1c9e, 0x1b9c, 0x1a9f, + 0x19a9, 0x18b9, 0x17d0, 0x16ed, 0x1612, 0x153c, 0x146e, 0x13a7, + 0x12e8, 0x122f, 0x117e, 0x10d5, 0x1033, 0x0f99, 0x0f07, 0x0e7d, + 0x0dfa, 0x0d80, 0x0d0e, 0x0ca4, 0x0c42, 0x0be9, 0x0b98, 0x0b4f, + 0x0b0f, 0x0ad8, 0x0aa8, 0x0a82, 0x0a64, 0x0a4e, 0x0a41, 0x0a3d +}; + +/* LP analysis window (length of the window is 25ms which is 400 samples at 16kHz (Q15) */ +const Word16 LP_assym_window_16k_fx[L_LP_16k] = { + 0x0a3d, + 0x0a3e, + 0x0a42, + 0x0a49, + 0x0a53, + 0x0a5f, + 0x0a6e, + 0x0a7f, + 0x0a93, + 0x0aaa, + 0x0ac4, + 0x0ae0, + 0x0aff, + 0x0b21, + 0x0b45, + 0x0b6c, + 0x0b96, + 0x0bc2, + 0x0bf1, + 0x0c23, + 0x0c57, + 0x0c8e, + 0x0cc7, + 0x0d03, + 0x0d41, + 0x0d82, + 0x0dc6, + 0x0e0c, + 0x0e55, + 0x0ea0, + 0x0eee, + 0x0f3e, + 0x0f91, + 0x0fe6, + 0x103e, + 0x1098, + 0x10f4, + 0x1153, + 0x11b4, + 0x1218, + 0x127e, + 0x12e6, + 0x1351, + 0x13be, + 0x142d, + 0x149e, + 0x1512, + 0x1588, + 0x1600, + 0x167a, + 0x16f6, + 0x1774, + 0x17f5, + 0x1878, + 0x18fc, + 0x1983, + 0x1a0c, + 0x1a96, + 0x1b23, + 0x1bb1, + 0x1c42, + 0x1cd4, + 0x1d68, + 0x1dfe, + 0x1e96, + 0x1f30, + 0x1fcb, + 0x2068, + 0x2107, + 0x21a7, + 0x2249, + 0x22ed, + 0x2392, + 0x2439, + 0x24e1, + 0x258b, + 0x2636, + 0x26e2, + 0x2790, + 0x2840, + 0x28f0, + 0x29a2, + 0x2a56, + 0x2b0a, + 0x2bc0, + 0x2c77, + 0x2d2e, + 0x2de7, + 0x2ea2, + 0x2f5d, + 0x3019, + 0x30d6, + 0x3194, + 0x3253, + 0x3313, + 0x33d3, + 0x3495, + 0x3557, + 0x361a, + 0x36dd, + 0x37a2, + 0x3867, + 0x392c, + 0x39f2, + 0x3ab9, + 0x3b80, + 0x3c47, + 0x3d0f, + 0x3dd7, + 0x3ea0, + 0x3f68, + 0x4032, + 0x40fb, + 0x41c4, + 0x428e, + 0x4358, + 0x4422, + 0x44ec, + 0x45b6, + 0x4680, + 0x4749, + 0x4813, + 0x48dd, + 0x49a6, + 0x4a6f, + 0x4b38, + 0x4c01, + 0x4cca, + 0x4d92, + 0x4e59, + 0x4f20, + 0x4fe7, + 0x50ad, + 0x5173, + 0x5238, + 0x52fd, + 0x53c1, + 0x5484, + 0x5547, + 0x5608, + 0x56c9, + 0x578a, + 0x5849, + 0x5908, + 0x59c5, + 0x5a82, + 0x5b3d, + 0x5bf8, + 0x5cb2, + 0x5d6a, + 0x5e21, + 0x5ed8, + 0x5f8d, + 0x6041, + 0x60f3, + 0x61a5, + 0x6255, + 0x6303, + 0x63b0, + 0x645c, + 0x6507, + 0x65b0, + 0x6657, + 0x66fd, + 0x67a2, + 0x6844, + 0x68e6, + 0x6985, + 0x6a23, + 0x6abf, + 0x6b5a, + 0x6bf2, + 0x6c89, + 0x6d1e, + 0x6db2, + 0x6e43, + 0x6ed2, + 0x6f60, + 0x6fec, + 0x7075, + 0x70fd, + 0x7183, + 0x7206, + 0x7288, + 0x7307, + 0x7385, + 0x7400, + 0x7479, + 0x74f0, + 0x7565, + 0x75d7, + 0x7648, + 0x76b6, + 0x7721, + 0x778b, + 0x77f2, + 0x7857, + 0x78b9, + 0x7919, + 0x7977, + 0x79d2, + 0x7a2b, + 0x7a81, + 0x7ad5, + 0x7b27, + 0x7b76, + 0x7bc2, + 0x7c0c, + 0x7c54, + 0x7c98, + 0x7cdb, + 0x7d1b, + 0x7d58, + 0x7d93, + 0x7dcb, + 0x7e00, + 0x7e33, + 0x7e63, + 0x7e91, + 0x7ebc, + 0x7ee4, + 0x7f0a, + 0x7f2d, + 0x7f4d, + 0x7f6b, + 0x7f86, + 0x7f9e, + 0x7fb3, + 0x7fc6, + 0x7fd7, + 0x7fe4, + 0x7fef, + 0x7ff7, + 0x7ffc, + 0x7fff, + 0x7fff, + 0x7ff9, + 0x7fee, + 0x7fde, + 0x7fc8, + 0x7fac, + 0x7f8c, + 0x7f65, + 0x7f39, + 0x7f08, + 0x7ed1, + 0x7e95, + 0x7e54, + 0x7e0d, + 0x7dc1, + 0x7d70, + 0x7d19, + 0x7cbd, + 0x7c5c, + 0x7bf6, + 0x7b8b, + 0x7b1b, + 0x7aa5, + 0x7a2b, + 0x79ab, + 0x7927, + 0x789e, + 0x7810, + 0x777d, + 0x76e6, + 0x764a, + 0x75a9, + 0x7504, + 0x745a, + 0x73ac, + 0x72fa, + 0x7243, + 0x7188, + 0x70c9, + 0x7006, + 0x6f3f, + 0x6e74, + 0x6da5, + 0x6cd2, + 0x6bfc, + 0x6b22, + 0x6a44, + 0x6963, + 0x687f, + 0x6797, + 0x66ac, + 0x65be, + 0x64cd, + 0x63d9, + 0x62e2, + 0x61e8, + 0x60ec, + 0x5fed, + 0x5eeb, + 0x5de7, + 0x5ce1, + 0x5bd8, + 0x5ace, + 0x59c1, + 0x58b3, + 0x57a2, + 0x5690, + 0x557c, + 0x5467, + 0x5350, + 0x5238, + 0x511f, + 0x5005, + 0x4ee9, + 0x4dcd, + 0x4cb0, + 0x4b92, + 0x4a74, + 0x4955, + 0x4836, + 0x4716, + 0x45f6, + 0x44d6, + 0x43b6, + 0x4297, + 0x4177, + 0x4058, + 0x3f39, + 0x3e1b, + 0x3cfe, + 0x3be1, + 0x3ac5, + 0x39aa, + 0x3891, + 0x3778, + 0x3661, + 0x354b, + 0x3436, + 0x3323, + 0x3212, + 0x3102, + 0x2ff5, + 0x2ee9, + 0x2de0, + 0x2cd8, + 0x2bd3, + 0x2ad0, + 0x29d0, + 0x28d2, + 0x27d7, + 0x26df, + 0x25e9, + 0x24f7, + 0x2407, + 0x231a, + 0x2231, + 0x214b, + 0x2068, + 0x1f89, + 0x1ead, + 0x1dd5, + 0x1d00, + 0x1c2f, + 0x1b62, + 0x1a99, + 0x19d4, + 0x1913, + 0x1856, + 0x179d, + 0x16e9, + 0x1638, + 0x158d, + 0x14e5, + 0x1442, + 0x13a4, + 0x130a, + 0x1275, + 0x11e5, + 0x1159, + 0x10d3, + 0x1051, + 0x0fd4, + 0x0f5c, + 0x0ee9, + 0x0e7b, + 0x0e12, + 0x0daf, + 0x0d50, + 0x0cf7, + 0x0ca3, + 0x0c55, + 0x0c0b, + 0x0bc7, + 0x0b88, + 0x0b4f, + 0x0b1b, + 0x0aed, + 0x0ac3, + 0x0aa0, + 0x0a82, + 0x0a69, + 0x0a56, + 0x0a48, + 0x0a40, + 0x0a3d, +}; + +/* 4-bit/3-bit TD SWB BWE differential LSF scalar quantizer tables */ +/*Q15*/ +const Word16 lsf_q_cb_4b_fx[16] = { + 589, 773, 914, 1043, + 1173, 1302, 1430, 1558, + 1698, 1843, 1973, 2103, + 2258, 2470, 2787, 3282 + +}; + +/*Q15*/ +const Word16 lsf_q_cb_3b_fx[8] = { + 679, 976, 1245, 1491, + 1739, 2011, 2365, 2953 +}; + +const Word16 *const lsf_q_cb_fx[NUM_Q_LSF] = { + lsf_q_cb_4b_fx, lsf_q_cb_4b_fx, lsf_q_cb_3b_fx, lsf_q_cb_3b_fx, lsf_q_cb_3b_fx +}; // Q15 + +/*Q15*/ +const Word16 lsf_grid_fx[4][5] = { + { + 5242, + 10229, + 15516, + 21804, + 27540, + }, + { + 5117, + 10059, + 14949, + 20478, + 25493, + }, + { + 4648, + 8732, + 13022, + 18247, + 24474, + }, + { + 5052, + 8925, + 12903, + 19427, + 28382, + } +}; + +/*Q15*/ +const Word16 grid_smoothing_fx[5] = { + 6554, 11469, 16384, 24576, 26214 +}; diff --git a/lib_com/rom_com.h b/lib_com/rom_com.h index 8a8ff7dd0..f0fd09295 100644 --- a/lib_com/rom_com.h +++ b/lib_com/rom_com.h @@ -47,21 +47,17 @@ #define MINSFTAB 7 #define MAXSFTAB 25 #define INTERP_EXP 0 + typedef struct { - Word32 fin_fx; /* input frequency Q0 */ - Word32 fout_fx; /* output frequency Q0 */ - Word16 fac_num_fx; /* numerator of resampling factor Q0 */ - - Word16 fac_den_fx; /* denominator of resampling factor Q0 */ - Word16 lg_out; /* denominator of resampling factor Q15 */ - + Word32 fin_fx; /* input frequency Q0 */ + Word32 fout_fx; /* output frequency Q0 */ + Word16 fac_num_fx; /* numerator of resampling factor Q0 */ + Word16 fac_den_fx; /* denominator of resampling factor Q0 */ + Word16 lg_out; /* denominator of resampling factor Q15 */ const Word16 *filter_fx; /* resampling filter coefficients Q14 */ - - Word16 filt_len_fx; /* number of filter coeff. Q0 */ - UWord16 flags_fx; /* flags from config. table Q0 */ - // UNS_Word16 flags_fx; /* flags from config. table Q0 */ - + Word16 filt_len_fx; /* number of filter coeff. Q0 */ + UWord16 flags_fx; /* flags from config. table Q0 */ } Resampling_cfg; typedef struct @@ -70,27 +66,24 @@ typedef struct Word16 bw; // Q0 const Word16 *band_width; // Q0 Word32 L_qint; - Word16 eref_fx; Word16 eref; - Word16 bit_alloc_weight_fx; Word16 bit_alloc_weight; - Word16 gqlevs; // Q0 Word16 Ngq; // Q0 Word16 p2a_bands; // Q0 - Word16 p2a_th; - Word16 pd_thresh; - Word16 ld_slope; - Word16 ni_coef; } Xcore_Config; +/*-----------------------------------------------------------------* + * LP filters tables + *-----------------------------------------------------------------*/ + extern const Word16 filter_LP15_180H_fx[]; // Q14 /* Sincfilt.m: N=180*2+1, Fmin=0, Fmax=1/15, hann( N )' */ extern const Word16 filter_LP3_90H_fx[]; // Q14 /* Sincfilt.m: N=90*2+1, Fmin=0, Fmax=1/3, hann( N )' */ extern const Word16 filter_LP12_180H_13b_fx[]; // Q13/* Sincfilt.m: N=180*2+1, Fmin=0, Fmax=1/12, hann( N )' */ @@ -156,7 +149,6 @@ extern const Word16 inv_N_fx[32]; // Q15 extern const Word16 band_len_harm[]; // Q0 /* PVQ tables */ - extern const Word32 thren_fx[39]; // Q8 /* Band structure */ @@ -169,8 +161,6 @@ extern const Word16 h_high_fx[5]; // Q15 extern const Word16 sincos_t_fx[161]; // Q15 extern const Word16 sincos_t_ext_fx[]; // Q15 extern const Word32 crit_bands_fx[]; -extern const float sincos_t_ext[]; // fft_rel dep -extern const Word16 sincos_t_rad3_fx[]; // Q15 extern const Word16 fft256_read_indexes[]; /* FFT Q0*/ extern const Word16 inter4_2_fx[]; extern const Word16 pitch_inter4_1[UP_SAMP * L_INTERPOL1 + 1]; /*1Q14*/ @@ -336,17 +326,14 @@ extern const Word16 hq_swb_bwe_nb_bits[]; // Q0 /*----------------------------------------------------------------------------------* * ISF quantization (AMR-WB IO mode) *----------------------------------------------------------------------------------*/ -extern const Word16 Indirect_dico1[SIZE_BK1]; // Q0 - -extern const Word16 mean_isf_amr_wb_fx[M]; /*Qlog2(2.56)*/ /* Mean ISF vector (only in AMR-WB IO mode) */ +extern const Word16 Indirect_dico1[SIZE_BK1]; // Q0 +extern const Word16 mean_isf_amr_wb_fx[M]; /*Qlog2(2.56)*/ /* Mean ISF vector (only in AMR-WB IO mode) */ extern const Word16 mean_isf_noise_amr_wb_fx[]; /*Qlog2(2.56)*/ /* Mean ISF vector for SID frame (only in AMR-WB IO mode) */ - -extern const Word16 gaus_dico_fx[]; // Q12 -extern const Word16 gaus_dico_swb_fx[]; // Q15 +extern const Word16 gaus_dico_fx[]; // Q12 +extern const Word16 gaus_dico_swb_fx[]; // Q15 extern const Word16 dico1_isf_fx[]; /* ISF codebook - common 1st stage, 1st split (only in AMR-WB IO mode) Qlog2(2.56)*/ - extern const Word16 dico2_isf_fx[]; /* ISF codebook - common 1st stage, 2nd split (only in AMR-WB IO mode) Qlog2(2.56)*/ extern const Word16 dico21_isf_46b_fx[]; /* ISF codebook - 46b, 2nd stage, 1st split (only in AMR-WB IO mode) Qlog2(2.56)*/ @@ -356,9 +343,7 @@ extern const Word16 dico24_isf_46b_fx[]; /* ISF codebook - 46b, 2nd stage, 4th s extern const Word16 dico25_isf_46b_fx[]; /* ISF codebook - 46b, 2nd stage, 5th split (only in AMR-WB IO mode) Qlog2(2.56)*/ extern const Word16 dico21_isf_36b_fx[]; /* ISF codebook - 36b, 2nd stage, 1st split (only in AMR-WB IO mode) Qlog2(2.56)*/ - extern const Word16 dico22_isf_36b_fx[]; /* ISF codebook - 36b, 2nd stage, 2nd split (only in AMR-WB IO mode) Qlog2(2.56)*/ - extern const Word16 dico23_isf_36b_fx[]; /* ISF codebook - 36b, 2nd stage, 3rd split (only in AMR-WB IO mode) Qlog2(2.56)*/ extern const Word16 dico1_ns_28b_fx[]; /*Qlog2(2.56)*/ /* ISF codebook for SID frames - 28b, 1st split Qlog2(2.56)*/ @@ -1126,13 +1111,6 @@ extern const Word16 CLDFB80_32[320]; // Q.5 extern const Word16 CLDFB80_40[400]; // Q.5 extern const Word16 CLDFB80_60[600]; // Q.5 extern const Word16 CLDFB80_30[300]; // Q.5 -extern const Word16 LDQMF_10_enc_fx[100]; -extern const Word16 LDQMF_16_enc_fx[160]; -extern const Word16 LDQMF_20_enc_fx[200]; -extern const Word16 LDQMF_30_enc_fx[300]; -extern const Word16 LDQMF_32_enc_fx[320]; -extern const Word16 LDQMF_40_enc_fx[400]; -extern const Word16 LDQMF_60_enc_fx[600]; extern const Word16 rRotVectr_10[]; // Q(sqrt(1.0/16.00)) extern const Word16 iRotVectr_10[]; // Q(sqrt(1.0/16.00)) @@ -1497,6 +1475,7 @@ extern const Word16 FFT_W256[]; // Q15 extern const Word16 FFT_W512[]; // Q15 extern const Word16 Gamma_19661_Tbl_fx[]; // Q15 extern const Word16 Gamma_29491_Tbl[]; // Q15 + /*---------------------------------------------------------------------* * NB post-filter tables *---------------------------------------------------------------------*/ @@ -1587,4 +1566,69 @@ extern const Word16 sin_scale_tbl_800[800]; // Q15 extern const Word16 scales_ivas_fx[][MAX_NO_SCALES * 2]; // Q11 extern const Word16 scales_p_ivas_fx[][MAX_NO_SCALES * 2]; // Q11 +/*------------------------------------------------------------------------------* + * FFT transform tables + *------------------------------------------------------------------------------*/ + +extern const Word16 w_fft64_fx[32]; // Q15 +extern const Word16 w_fft32_fx[16]; // Q15 +extern const Word16 w_fft16_fx[8]; // Q15 +extern const Word16 w_fft8_fx[8]; // Q15 +extern const Word16 w_fft128_fx[64]; // Q15 +extern const Word16 w_fft256_fx[128]; // Q15 +extern const Word16 w_fft512_fx[256]; // Q15 +extern const Word16 w_fft4_fx[2]; // Q15 + +extern const Word16 FFT_RotVector_960_fx[1860]; // Q15 +extern const Word16 FFT_RotVector_640_fx[1240]; // Q15 +extern const Word16 FFT_RotVector_600_fx[1140]; // Q15 +extern const Word16 FFT_RotVector_400_fx[760]; // Q15 +extern const Word16 FFT_RotVector_256_fx[448]; // Q15 +extern const Word16 FFT_RotVector_32_fx[40]; // Q15 + +extern const Word16 sincos_t_rad3_fx[T_SIN_PI_2 + 1]; // Q15 + +extern const Word16 cos_twiddle_table_25_5_5[25]; // Q15 +extern const Word16 sin_twiddle_table_25_5_5[25]; // Q15 +extern const Word16 cos_twiddle_table_16_8_2[16]; // Q15 +extern const Word16 sin_twiddle_table_16_8_2[16]; // Q15 + +extern const Word32 CLDFB80_10_fx[100]; // Q30 +extern const Word32 CLDFB80_16_fx[160]; // Q30 +extern const Word32 CLDFB80_20_fx[200]; // Q30 +extern const Word32 CLDFB80_30_fx[300]; // Q30 +extern const Word32 CLDFB80_32_fx[320]; // Q30 +extern const Word32 CLDFB80_40_fx[400]; // Q30 +extern const Word32 CLDFB80_60_fx[600]; // Q30 + +/*5ms delay*/ +extern const Word32 LDQMF_10_fx[100]; // Q30 +extern const Word32 LDQMF_16_fx[160]; // Q30 +extern const Word32 LDQMF_20_fx[200]; // Q30 +extern const Word32 LDQMF_30_fx[300]; // Q30 +extern const Word32 LDQMF_32_fx[320]; // Q30 +extern const Word32 LDQMF_40_fx[400]; // Q30 +extern const Word32 LDQMF_60_fx[600]; // Q30 + +extern const Word32 rot_vec_delay_re_LDQMF_fx[60]; // Q31 +extern const Word32 rot_vec_delay_im_LDQMF_fx[60]; // Q31 + +extern const Word32 rot_vec_ana_re_L10_fx[5]; // Q29 +extern const Word32 rot_vec_ana_im_L10_fx[5]; // Q29 +extern const Word32 rot_vec_ana_re_L16_fx[8]; // Q29 +extern const Word32 rot_vec_ana_im_L16_fx[8]; // Q29 +extern const Word32 rot_vec_ana_re_L20_fx[10]; // Q29 +extern const Word32 rot_vec_ana_im_L20_fx[10]; // Q29 +extern const Word32 rot_vec_ana_re_L30_fx[15]; // Q29 +extern const Word32 rot_vec_ana_im_L30_fx[15]; // Q29 +extern const Word32 rot_vec_ana_re_L32_fx[16]; // Q29 +extern const Word32 rot_vec_ana_im_L32_fx[16]; // Q29 +extern const Word32 rot_vec_ana_re_L40_fx[20]; // Q29 +extern const Word32 rot_vec_ana_im_L40_fx[20]; // Q29 +extern const Word32 rot_vec_ana_re_L60_fx[30]; // Q29 +extern const Word32 rot_vec_ana_im_L60_fx[30]; // Q29 + +extern const Word16 LP_assym_window_fx[]; /* Assymetric window for LP analysis @12.8kHz (Q15) */ +extern const Word16 LP_assym_window_16k_fx[]; /* Assymetric window for LP analysis @16kHz (Q15) */ + #endif diff --git a/lib_com/rom_com_fx.c b/lib_com/rom_com_fx.c deleted file mode 100644 index 49f50e162..000000000 --- a/lib_com/rom_com_fx.c +++ /dev/null @@ -1,6704 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -/*==================================================================================== - 3GPP TS26.258 Aug 24, 2023. IVAS Codec Version IVAS-FL-1.0 - ====================================================================================*/ - -/*==================================================================================== - EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 - ====================================================================================*/ - -#include "prot_fx.h" -#include "basop_util.h" -#include "wmc_auto.h" -#include "rom_com_fx.h" - -#define SHC( x ) ( (Word16) x ) - -const Word16 w_fft4_fx[2] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), -}; -const Word16 w_fft8_fx[8] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - -}; -const Word16 w_fft16_fx[8] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - -}; -const Word16 w_fft32_fx[16] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x7d8a ), - SHC( 0x18f8 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - -}; -const Word16 w_fft64_fx[32] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x7d8a ), - SHC( 0x18f8 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - SHC( 0x7f62 ), - SHC( 0x0c8b ), - SHC( 0x5133 ), - SHC( 0x62f2 ), - SHC( 0x70e2 ), - SHC( 0x3c56 ), - SHC( 0x2528 ), - SHC( 0x7a7d ), - SHC( 0x7a7d ), - SHC( 0x2528 ), - SHC( 0x3c56 ), - SHC( 0x70e2 ), - SHC( 0x62f2 ), - SHC( 0x5133 ), - SHC( 0x0c8b ), - SHC( 0x7f62 ), - -}; -const Word16 w_fft128_fx[64] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x7d8a ), - SHC( 0x18f8 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - SHC( 0x7f62 ), - SHC( 0x0c8b ), - SHC( 0x5133 ), - SHC( 0x62f2 ), - SHC( 0x70e2 ), - SHC( 0x3c56 ), - SHC( 0x2528 ), - SHC( 0x7a7d ), - SHC( 0x7a7d ), - SHC( 0x2528 ), - SHC( 0x3c56 ), - SHC( 0x70e2 ), - SHC( 0x62f2 ), - SHC( 0x5133 ), - SHC( 0x0c8b ), - SHC( 0x7f62 ), - SHC( 0x7fd8 ), - SHC( 0x0647 ), - SHC( 0x55f5 ), - SHC( 0x5ed7 ), - SHC( 0x73b5 ), - SHC( 0x36ba ), - SHC( 0x2b1f ), - SHC( 0x7884 ), - SHC( 0x7c29 ), - SHC( 0x1f19 ), - SHC( 0x41ce ), - SHC( 0x6dca ), - SHC( 0x66cf ), - SHC( 0x4c3f ), - SHC( 0x12c8 ), - SHC( 0x7e9d ), - SHC( 0x7e9d ), - SHC( 0x12c8 ), - SHC( 0x4c3f ), - SHC( 0x66cf ), - SHC( 0x6dca ), - SHC( 0x41ce ), - SHC( 0x1f19 ), - SHC( 0x7c29 ), - SHC( 0x7884 ), - SHC( 0x2b1f ), - SHC( 0x36ba ), - SHC( 0x73b5 ), - SHC( 0x5ed7 ), - SHC( 0x55f5 ), - SHC( 0x0647 ), - SHC( 0x7fd8 ), - -}; -const Word16 w_fft256_fx[128] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x7d8a ), - SHC( 0x18f8 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - SHC( 0x7f62 ), - SHC( 0x0c8b ), - SHC( 0x5133 ), - SHC( 0x62f2 ), - SHC( 0x70e2 ), - SHC( 0x3c56 ), - SHC( 0x2528 ), - SHC( 0x7a7d ), - SHC( 0x7a7d ), - SHC( 0x2528 ), - SHC( 0x3c56 ), - SHC( 0x70e2 ), - SHC( 0x62f2 ), - SHC( 0x5133 ), - SHC( 0x0c8b ), - SHC( 0x7f62 ), - SHC( 0x7fd8 ), - SHC( 0x0647 ), - SHC( 0x55f5 ), - SHC( 0x5ed7 ), - SHC( 0x73b5 ), - SHC( 0x36ba ), - SHC( 0x2b1f ), - SHC( 0x7884 ), - SHC( 0x7c29 ), - SHC( 0x1f19 ), - SHC( 0x41ce ), - SHC( 0x6dca ), - SHC( 0x66cf ), - SHC( 0x4c3f ), - SHC( 0x12c8 ), - SHC( 0x7e9d ), - SHC( 0x7e9d ), - SHC( 0x12c8 ), - SHC( 0x4c3f ), - SHC( 0x66cf ), - SHC( 0x6dca ), - SHC( 0x41ce ), - SHC( 0x1f19 ), - SHC( 0x7c29 ), - SHC( 0x7884 ), - SHC( 0x2b1f ), - SHC( 0x36ba ), - SHC( 0x73b5 ), - SHC( 0x5ed7 ), - SHC( 0x55f5 ), - SHC( 0x0647 ), - SHC( 0x7fd8 ), - SHC( 0x7ff6 ), - SHC( 0x0324 ), - SHC( 0x5842 ), - SHC( 0x5cb4 ), - SHC( 0x7504 ), - SHC( 0x33de ), - SHC( 0x2e11 ), - SHC( 0x776c ), - SHC( 0x7ce3 ), - SHC( 0x1c0b ), - SHC( 0x447a ), - SHC( 0x6c24 ), - SHC( 0x68a6 ), - SHC( 0x49b4 ), - SHC( 0x15e2 ), - SHC( 0x7e1d ), - SHC( 0x7f09 ), - SHC( 0x0fab ), - SHC( 0x4ebf ), - SHC( 0x64e8 ), - SHC( 0x6f5f ), - SHC( 0x3f17 ), - SHC( 0x2223 ), - SHC( 0x7b5d ), - SHC( 0x798a ), - SHC( 0x2826 ), - SHC( 0x398c ), - SHC( 0x7255 ), - SHC( 0x60ec ), - SHC( 0x539b ), - SHC( 0x096a ), - SHC( 0x7fa7 ), - SHC( 0x7fa7 ), - SHC( 0x096a ), - SHC( 0x539b ), - SHC( 0x60ec ), - SHC( 0x7255 ), - SHC( 0x398c ), - SHC( 0x2826 ), - SHC( 0x798a ), - SHC( 0x7b5d ), - SHC( 0x2223 ), - SHC( 0x3f17 ), - SHC( 0x6f5f ), - SHC( 0x64e8 ), - SHC( 0x4ebf ), - SHC( 0x0fab ), - SHC( 0x7f09 ), - SHC( 0x7e1d ), - SHC( 0x15e2 ), - SHC( 0x49b4 ), - SHC( 0x68a6 ), - SHC( 0x6c24 ), - SHC( 0x447a ), - SHC( 0x1c0b ), - SHC( 0x7ce3 ), - SHC( 0x776c ), - SHC( 0x2e11 ), - SHC( 0x33de ), - SHC( 0x7504 ), - SHC( 0x5cb4 ), - SHC( 0x5842 ), - SHC( 0x0324 ), - SHC( 0x7ff6 ), - -}; -const Word16 w_fft512_fx[256] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x7641 ), - SHC( 0x30fb ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x7d8a ), - SHC( 0x18f8 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - SHC( 0x7f62 ), - SHC( 0x0c8b ), - SHC( 0x5133 ), - SHC( 0x62f2 ), - SHC( 0x70e2 ), - SHC( 0x3c56 ), - SHC( 0x2528 ), - SHC( 0x7a7d ), - SHC( 0x7a7d ), - SHC( 0x2528 ), - SHC( 0x3c56 ), - SHC( 0x70e2 ), - SHC( 0x62f2 ), - SHC( 0x5133 ), - SHC( 0x0c8b ), - SHC( 0x7f62 ), - SHC( 0x7fd8 ), - SHC( 0x0647 ), - SHC( 0x55f5 ), - SHC( 0x5ed7 ), - SHC( 0x73b5 ), - SHC( 0x36ba ), - SHC( 0x2b1f ), - SHC( 0x7884 ), - SHC( 0x7c29 ), - SHC( 0x1f19 ), - SHC( 0x41ce ), - SHC( 0x6dca ), - SHC( 0x66cf ), - SHC( 0x4c3f ), - SHC( 0x12c8 ), - SHC( 0x7e9d ), - SHC( 0x7e9d ), - SHC( 0x12c8 ), - SHC( 0x4c3f ), - SHC( 0x66cf ), - SHC( 0x6dca ), - SHC( 0x41ce ), - SHC( 0x1f19 ), - SHC( 0x7c29 ), - SHC( 0x7884 ), - SHC( 0x2b1f ), - SHC( 0x36ba ), - SHC( 0x73b5 ), - SHC( 0x5ed7 ), - SHC( 0x55f5 ), - SHC( 0x0647 ), - SHC( 0x7fd8 ), - SHC( 0x7ff6 ), - SHC( 0x0324 ), - SHC( 0x5842 ), - SHC( 0x5cb4 ), - SHC( 0x7504 ), - SHC( 0x33de ), - SHC( 0x2e11 ), - SHC( 0x776c ), - SHC( 0x7ce3 ), - SHC( 0x1c0b ), - SHC( 0x447a ), - SHC( 0x6c24 ), - SHC( 0x68a6 ), - SHC( 0x49b4 ), - SHC( 0x15e2 ), - SHC( 0x7e1d ), - SHC( 0x7f09 ), - SHC( 0x0fab ), - SHC( 0x4ebf ), - SHC( 0x64e8 ), - SHC( 0x6f5f ), - SHC( 0x3f17 ), - SHC( 0x2223 ), - SHC( 0x7b5d ), - SHC( 0x798a ), - SHC( 0x2826 ), - SHC( 0x398c ), - SHC( 0x7255 ), - SHC( 0x60ec ), - SHC( 0x539b ), - SHC( 0x096a ), - SHC( 0x7fa7 ), - SHC( 0x7fa7 ), - SHC( 0x096a ), - SHC( 0x539b ), - SHC( 0x60ec ), - SHC( 0x7255 ), - SHC( 0x398c ), - SHC( 0x2826 ), - SHC( 0x798a ), - SHC( 0x7b5d ), - SHC( 0x2223 ), - SHC( 0x3f17 ), - SHC( 0x6f5f ), - SHC( 0x64e8 ), - SHC( 0x4ebf ), - SHC( 0x0fab ), - SHC( 0x7f09 ), - SHC( 0x7e1d ), - SHC( 0x15e2 ), - SHC( 0x49b4 ), - SHC( 0x68a6 ), - SHC( 0x6c24 ), - SHC( 0x447a ), - SHC( 0x1c0b ), - SHC( 0x7ce3 ), - SHC( 0x776c ), - SHC( 0x2e11 ), - SHC( 0x33de ), - SHC( 0x7504 ), - SHC( 0x5cb4 ), - SHC( 0x5842 ), - SHC( 0x0324 ), - SHC( 0x7ff6 ), - SHC( 0x7ffd ), - SHC( 0x0192 ), - SHC( 0x5964 ), - SHC( 0x5b9d ), - SHC( 0x75a5 ), - SHC( 0x326e ), - SHC( 0x2f87 ), - SHC( 0x76d9 ), - SHC( 0x7d39 ), - SHC( 0x1a82 ), - SHC( 0x45cd ), - SHC( 0x6b4a ), - SHC( 0x698c ), - SHC( 0x4869 ), - SHC( 0x176d ), - SHC( 0x7dd6 ), - SHC( 0x7f38 ), - SHC( 0x0e1b ), - SHC( 0x4ffb ), - SHC( 0x63ef ), - SHC( 0x7023 ), - SHC( 0x3db8 ), - SHC( 0x23a6 ), - SHC( 0x7aef ), - SHC( 0x7a05 ), - SHC( 0x26a8 ), - SHC( 0x3af2 ), - SHC( 0x719e ), - SHC( 0x61f1 ), - SHC( 0x5269 ), - SHC( 0x0afb ), - SHC( 0x7f87 ), - SHC( 0x7fc2 ), - SHC( 0x07d9 ), - SHC( 0x54ca ), - SHC( 0x5fe3 ), - SHC( 0x7307 ), - SHC( 0x3824 ), - SHC( 0x29a3 ), - SHC( 0x7909 ), - SHC( 0x7bc5 ), - SHC( 0x209f ), - SHC( 0x4073 ), - SHC( 0x6e96 ), - SHC( 0x65dd ), - SHC( 0x4d81 ), - SHC( 0x1139 ), - SHC( 0x7ed5 ), - SHC( 0x7e5f ), - SHC( 0x1455 ), - SHC( 0x4afb ), - SHC( 0x67bd ), - SHC( 0x6cf9 ), - SHC( 0x4325 ), - SHC( 0x1d93 ), - SHC( 0x7c89 ), - SHC( 0x77fa ), - SHC( 0x2c98 ), - SHC( 0x354d ), - SHC( 0x745f ), - SHC( 0x5dc7 ), - SHC( 0x571d ), - SHC( 0x04b6 ), - SHC( 0x7fe9 ), - SHC( 0x7fe9 ), - SHC( 0x04b6 ), - SHC( 0x571d ), - SHC( 0x5dc7 ), - SHC( 0x745f ), - SHC( 0x354d ), - SHC( 0x2c98 ), - SHC( 0x77fa ), - SHC( 0x7c89 ), - SHC( 0x1d93 ), - SHC( 0x4325 ), - SHC( 0x6cf9 ), - SHC( 0x67bd ), - SHC( 0x4afb ), - SHC( 0x1455 ), - SHC( 0x7e5f ), - SHC( 0x7ed5 ), - SHC( 0x1139 ), - SHC( 0x4d81 ), - SHC( 0x65dd ), - SHC( 0x6e96 ), - SHC( 0x4073 ), - SHC( 0x209f ), - SHC( 0x7bc5 ), - SHC( 0x7909 ), - SHC( 0x29a3 ), - SHC( 0x3824 ), - SHC( 0x7307 ), - SHC( 0x5fe3 ), - SHC( 0x54ca ), - SHC( 0x07d9 ), - SHC( 0x7fc2 ), - SHC( 0x7f87 ), - SHC( 0x0afb ), - SHC( 0x5269 ), - SHC( 0x61f1 ), - SHC( 0x719e ), - SHC( 0x3af2 ), - SHC( 0x26a8 ), - SHC( 0x7a05 ), - SHC( 0x7aef ), - SHC( 0x23a6 ), - SHC( 0x3db8 ), - SHC( 0x7023 ), - SHC( 0x63ef ), - SHC( 0x4ffb ), - SHC( 0x0e1b ), - SHC( 0x7f38 ), - SHC( 0x7dd6 ), - SHC( 0x176d ), - SHC( 0x4869 ), - SHC( 0x698c ), - SHC( 0x6b4a ), - SHC( 0x45cd ), - SHC( 0x1a82 ), - SHC( 0x7d39 ), - SHC( 0x76d9 ), - SHC( 0x2f87 ), - SHC( 0x326e ), - SHC( 0x75a5 ), - SHC( 0x5b9d ), - SHC( 0x5964 ), - SHC( 0x0192 ), - SHC( 0x7ffd ), - -}; -const Word16 FFT_RotVector_960_fx[1860] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ffd ), - SHC( 0xfe54 ), - SHC( 0x7ff4 ), - SHC( 0xfca7 ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7fb9 ), - SHC( 0xf7a1 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f76 ), - SHC( 0xf44a ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7eac ), - SHC( 0xeda3 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e26 ), - SHC( 0xea53 ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7cd8 ), - SHC( 0xe3c1 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7c0f ), - SHC( 0xe07f ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7aba ), - SHC( 0xdba6 ), - SHC( 0x7a3e ), - SHC( 0xda0b ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7935 ), - SHC( 0xd6dc ), - SHC( 0x78a8 ), - SHC( 0xd546 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x76e3 ), - SHC( 0xd092 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff4 ), - SHC( 0xfca7 ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7aba ), - SHC( 0xdba6 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x78a8 ), - SHC( 0xd546 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x7387 ), - SHC( 0xc8e6 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x707d ), - SHC( 0xc2ed ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x697c ), - SHC( 0xb780 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x658c ), - SHC( 0xb215 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5cd9 ), - SHC( 0xa7e4 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6485 ), - SHC( 0xb0c2 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5dfe ), - SHC( 0xa91e ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4f3e ), - SHC( 0x9b7b ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x3596 ), - SHC( 0x8bc2 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x508d ), - SHC( 0x9c87 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x45b6 ), - SHC( 0x94a7 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x2ddf ), - SHC( 0x8881 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x2120 ), - SHC( 0x845d ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x06b2 ), - SHC( 0x802d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fb9 ), - SHC( 0xf7a1 ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7935 ), - SHC( 0xd6dc ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x72cc ), - SHC( 0xc764 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x658c ), - SHC( 0xb215 ), - SHC( 0x603c ), - SHC( 0xab9b ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5465 ), - SHC( 0x9fc4 ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x389c ), - SHC( 0x8d34 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2924 ), - SHC( 0x86cb ), - SHC( 0x2120 ), - SHC( 0x845d ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x10b5 ), - SHC( 0x8119 ), - SHC( 0x085f ), - SHC( 0x8047 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf7a1 ), - SHC( 0x8047 ), - SHC( 0xef4b ), - SHC( 0x8119 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xdee0 ), - SHC( 0x845d ), - SHC( 0xd6dc ), - SHC( 0x86cb ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xe21f ), - SHC( 0x838a ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xacdf ), - SHC( 0x9eac ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f76 ), - SHC( 0xf44a ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x72cc ), - SHC( 0xc764 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x668f ), - SHC( 0xb36b ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x444d ), - SHC( 0x93c0 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x2f6e ), - SHC( 0x891d ), - SHC( 0x245a ), - SHC( 0x8546 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x01ac ), - SHC( 0x8003 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xea53 ), - SHC( 0x81da ), - SHC( 0xdee0 ), - SHC( 0x845d ), - SHC( 0xd3b3 ), - SHC( 0x87ea ), - SHC( 0xc8e6 ), - SHC( 0x8c79 ), - SHC( 0xbe8e ), - SHC( 0x91ff ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xab9b ), - SHC( 0x9fc4 ), - SHC( 0xa327 ), - SHC( 0xa7e4 ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x94a7 ), - SHC( 0xba4a ), - SHC( 0x8eb9 ), - SHC( 0xc467 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf29f ), - SHC( 0x80b4 ), - SHC( 0xe564 ), - SHC( 0x82cd ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xcbf1 ), - SHC( 0x8b11 ), - SHC( 0xc000 ), - SHC( 0x9127 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xaa5a ), - SHC( 0xa0e1 ), - SHC( 0xa0e1 ), - SHC( 0xaa5a ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x9127 ), - SHC( 0xc000 ), - SHC( 0x8b11 ), - SHC( 0xcbf1 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x82cd ), - SHC( 0xe564 ), - SHC( 0x80b4 ), - SHC( 0xf29f ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xca6a ), - SHC( 0x8bc2 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xb0c2 ), - SHC( 0x9b7b ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x8bc2 ), - SHC( 0xca6a ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x801a ), - SHC( 0x0506 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x84cf ), - SHC( 0x22be ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x658c ), - SHC( 0xb215 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2120 ), - SHC( 0x845d ), - SHC( 0x10b5 ), - SHC( 0x8119 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xef4b ), - SHC( 0x8119 ), - SHC( 0xdee0 ), - SHC( 0x845d ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xc000 ), - SHC( 0x9127 ), - SHC( 0xb215 ), - SHC( 0x9a74 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9a74 ), - SHC( 0xb215 ), - SHC( 0x9127 ), - SHC( 0xc000 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x845d ), - SHC( 0xdee0 ), - SHC( 0x8119 ), - SHC( 0xef4b ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8119 ), - SHC( 0x10b5 ), - SHC( 0x845d ), - SHC( 0x2120 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9127 ), - SHC( 0x4000 ), - SHC( 0x9a74 ), - SHC( 0x4deb ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7eac ), - SHC( 0xeda3 ), - SHC( 0x7aba ), - SHC( 0xdba6 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x603c ), - SHC( 0xab9b ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x444d ), - SHC( 0x93c0 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x10b5 ), - SHC( 0x8119 ), - SHC( 0xfe54 ), - SHC( 0x8003 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xda0b ), - SHC( 0x85c2 ), - SHC( 0xc8e6 ), - SHC( 0x8c79 ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xaa5a ), - SHC( 0xa0e1 ), - SHC( 0x9d97 ), - SHC( 0xae27 ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x8a66 ), - SHC( 0xcd7a ), - SHC( 0x845d ), - SHC( 0xdee0 ), - SHC( 0x80e4 ), - SHC( 0xf0f5 ), - SHC( 0x800c ), - SHC( 0x0359 ), - SHC( 0x81da ), - SHC( 0x15ad ), - SHC( 0x8644 ), - SHC( 0x278d ), - SHC( 0x8d34 ), - SHC( 0x389c ), - SHC( 0x9684 ), - SHC( 0x4880 ), - SHC( 0xa202 ), - SHC( 0x56e2 ), - SHC( 0xaf73 ), - SHC( 0x6379 ), - SHC( 0xbe8e ), - SHC( 0x6e01 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x8644 ), - SHC( 0x278d ), - SHC( 0x8df4 ), - SHC( 0x3a1c ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xa57e ), - SHC( 0x5a82 ), - SHC( 0xb4c4 ), - SHC( 0x678d ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xd873 ), - SHC( 0x79bc ), - SHC( 0xebfa ), - SHC( 0x7e6c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e26 ), - SHC( 0xea53 ), - SHC( 0x78a8 ), - SHC( 0xd546 ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x5465 ), - SHC( 0x9fc4 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x2f6e ), - SHC( 0x891d ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xef4b ), - SHC( 0x8119 ), - SHC( 0xda0b ), - SHC( 0x85c2 ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb36b ), - SHC( 0x9971 ), - SHC( 0xa327 ), - SHC( 0xa7e4 ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x8b11 ), - SHC( 0xcbf1 ), - SHC( 0x83f1 ), - SHC( 0xe07f ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x808a ), - SHC( 0x0bb6 ), - SHC( 0x845d ), - SHC( 0x2120 ), - SHC( 0x8bc2 ), - SHC( 0x3596 ), - SHC( 0x9684 ), - SHC( 0x4880 ), - SHC( 0xa451 ), - SHC( 0x5951 ), - SHC( 0xb4c4 ), - SHC( 0x678d ), - SHC( 0xc764 ), - SHC( 0x72cc ), - SHC( 0xdba6 ), - SHC( 0x7aba ), - SHC( 0xf0f5 ), - SHC( 0x7f1c ), - SHC( 0x06b2 ), - SHC( 0x7fd3 ), - SHC( 0x1c3f ), - SHC( 0x7cd8 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x245a ), - SHC( 0x8546 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xdee0 ), - SHC( 0x845d ), - SHC( 0xc8e6 ), - SHC( 0x8c79 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa327 ), - SHC( 0xa7e4 ), - SHC( 0x94a7 ), - SHC( 0xba4a ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x82cd ), - SHC( 0xe564 ), - SHC( 0x800c ), - SHC( 0xfca7 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x8758 ), - SHC( 0x2aba ), - SHC( 0x9127 ), - SHC( 0x4000 ), - SHC( 0x9eac ), - SHC( 0x5321 ), - SHC( 0xaf73 ), - SHC( 0x6379 ), - SHC( 0xc2ed ), - SHC( 0x707d ), - SHC( 0xd873 ), - SHC( 0x79bc ), - SHC( 0xef4b ), - SHC( 0x7ee7 ), - SHC( 0x06b2 ), - SHC( 0x7fd3 ), - SHC( 0x1de1 ), - SHC( 0x7c76 ), - SHC( 0x340f ), - SHC( 0x74ef ), - SHC( 0x4880 ), - SHC( 0x697c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8276 ), - SHC( 0x18f8 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9593 ), - SHC( 0x471c ), - SHC( 0xa57e ), - SHC( 0x5a82 ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), - SHC( 0xcf05 ), - SHC( 0x7641 ), - SHC( 0xe708 ), - SHC( 0x7d8a ), - SHC( 0x0000 ), - SHC( 0x7fff ), - SHC( 0x18f8 ), - SHC( 0x7d8a ), - SHC( 0x30fb ), - SHC( 0x7641 ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x5a82 ), - SHC( 0x5a82 ), - SHC( 0x6a6d ), - SHC( 0x471c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fff ), - SHC( 0xff2a ), - SHC( 0x7ffd ), - SHC( 0xfe54 ), - SHC( 0x7ff9 ), - SHC( 0xfd7d ), - SHC( 0x7ff4 ), - SHC( 0xfca7 ), - SHC( 0x7fee ), - SHC( 0xfbd0 ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7fdd ), - SHC( 0xfa24 ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7fb9 ), - SHC( 0xf7a1 ), - SHC( 0x7fab ), - SHC( 0xf6cb ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f89 ), - SHC( 0xf520 ), - SHC( 0x7f76 ), - SHC( 0xf44a ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7f35 ), - SHC( 0xf1ca ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7f02 ), - SHC( 0xf020 ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7eac ), - SHC( 0xeda3 ), - SHC( 0x7e8d ), - SHC( 0xecce ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e4a ), - SHC( 0xeb27 ), - SHC( 0x7e26 ), - SHC( 0xea53 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x7db3 ), - SHC( 0xe7da ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff9 ), - SHC( 0xfd7d ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7d06 ), - SHC( 0xe492 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7bda ), - SHC( 0xdfaf ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x78ef ), - SHC( 0xd611 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7732 ), - SHC( 0xd15a ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x732a ), - SHC( 0xc824 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6bcd ), - SHC( 0xbafe ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fee ), - SHC( 0xfbd0 ), - SHC( 0x7fb9 ), - SHC( 0xf7a1 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7ee7 ), - SHC( 0xef4b ), - SHC( 0x7e4a ), - SHC( 0xeb27 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7ca8 ), - SHC( 0xe2f0 ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7935 ), - SHC( 0xd6dc ), - SHC( 0x77cb ), - SHC( 0xd2ea ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x7497 ), - SHC( 0xcb2d ), - SHC( 0x72cc ), - SHC( 0xc764 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6cb2 ), - SHC( 0xbc69 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x680b ), - SHC( 0xb572 ), - SHC( 0x658c ), - SHC( 0xb215 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x603c ), - SHC( 0xab9b ), - SHC( 0x5d6c ), - SHC( 0xa881 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x577f ), - SHC( 0xa294 ), - SHC( 0x5465 ), - SHC( 0x9fc4 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x4a8e ), - SHC( 0x97f5 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fdd ), - SHC( 0xfa24 ), - SHC( 0x7f76 ), - SHC( 0xf44a ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7ddb ), - SHC( 0xe8ad ), - SHC( 0x7ca8 ), - SHC( 0xe2f0 ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7979 ), - SHC( 0xd7a7 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x72cc ), - SHC( 0xc764 ), - SHC( 0x7016 ), - SHC( 0xc231 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x69f5 ), - SHC( 0xb832 ), - SHC( 0x668f ), - SHC( 0xb36b ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5b19 ), - SHC( 0xa616 ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x527d ), - SHC( 0x9e21 ), - SHC( 0x4deb ), - SHC( 0x9a74 ), - SHC( 0x4930 ), - SHC( 0x96fe ), - SHC( 0x444d ), - SHC( 0x93c0 ), - SHC( 0x3f45 ), - SHC( 0x90bc ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x34d3 ), - SHC( 0x8b69 ), - SHC( 0x2f6e ), - SHC( 0x891d ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x245a ), - SHC( 0x8546 ), - SHC( 0x1eb1 ), - SHC( 0x83bd ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x660e ), - SHC( 0xb2bf ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5c44 ), - SHC( 0xa749 ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4502 ), - SHC( 0x9433 ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x37dc ), - SHC( 0x8cd6 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x1b6e ), - SHC( 0x82fa ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xfd7d ), - SHC( 0x8007 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xee77 ), - SHC( 0x8136 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fab ), - SHC( 0xf6cb ), - SHC( 0x7eac ), - SHC( 0xeda3 ), - SHC( 0x7d06 ), - SHC( 0xe492 ), - SHC( 0x7aba ), - SHC( 0xdba6 ), - SHC( 0x77cb ), - SHC( 0xd2ea ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x7016 ), - SHC( 0xc231 ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x660e ), - SHC( 0xb2bf ), - SHC( 0x603c ), - SHC( 0xab9b ), - SHC( 0x59ea ), - SHC( 0xa4e7 ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4be9 ), - SHC( 0x98f1 ), - SHC( 0x444d ), - SHC( 0x93c0 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x2b84 ), - SHC( 0x87a0 ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x19ca ), - SHC( 0x82a1 ), - SHC( 0x10b5 ), - SHC( 0x8119 ), - SHC( 0x0789 ), - SHC( 0x8039 ), - SHC( 0xfe54 ), - SHC( 0x8003 ), - SHC( 0xf520 ), - SHC( 0x8077 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xe2f0 ), - SHC( 0x8358 ), - SHC( 0xda0b ), - SHC( 0x85c2 ), - SHC( 0xd15a ), - SHC( 0x88ce ), - SHC( 0xc8e6 ), - SHC( 0x8c79 ), - SHC( 0xc0bb ), - SHC( 0x90bc ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f89 ), - SHC( 0xf520 ), - SHC( 0x7e26 ), - SHC( 0xea53 ), - SHC( 0x7bda ), - SHC( 0xdfaf ), - SHC( 0x78a8 ), - SHC( 0xd546 ), - SHC( 0x7497 ), - SHC( 0xcb2d ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x69f5 ), - SHC( 0xb832 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x5c44 ), - SHC( 0xa749 ), - SHC( 0x5465 ), - SHC( 0x9fc4 ), - SHC( 0x4be9 ), - SHC( 0x98f1 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x395c ), - SHC( 0x8d93 ), - SHC( 0x2f6e ), - SHC( 0x891d ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x0fe0 ), - SHC( 0x80fe ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xfa24 ), - SHC( 0x8023 ), - SHC( 0xef4b ), - SHC( 0x8119 ), - SHC( 0xe492 ), - SHC( 0x82fa ), - SHC( 0xda0b ), - SHC( 0x85c2 ), - SHC( 0xcfcb ), - SHC( 0x896d ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xbc69 ), - SHC( 0x934e ), - SHC( 0xb36b ), - SHC( 0x9971 ), - SHC( 0xaafa ), - SHC( 0xa052 ), - SHC( 0xa327 ), - SHC( 0xa7e4 ), - SHC( 0x9c01 ), - SHC( 0xb01a ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf375 ), - SHC( 0x809e ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xdad8 ), - SHC( 0x8583 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xaecd ), - SHC( 0x9d0e ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9d0e ), - SHC( 0xaecd ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x8583 ), - SHC( 0xdad8 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f35 ), - SHC( 0xf1ca ), - SHC( 0x7cd8 ), - SHC( 0xe3c1 ), - SHC( 0x78ef ), - SHC( 0xd611 ), - SHC( 0x7387 ), - SHC( 0xc8e6 ), - SHC( 0x6cb2 ), - SHC( 0xbc69 ), - SHC( 0x6485 ), - SHC( 0xb0c2 ), - SHC( 0x5b19 ), - SHC( 0xa616 ), - SHC( 0x508d ), - SHC( 0x9c87 ), - SHC( 0x4502 ), - SHC( 0x9433 ), - SHC( 0x389c ), - SHC( 0x8d34 ), - SHC( 0x2b84 ), - SHC( 0x87a0 ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0x0fe0 ), - SHC( 0x80fe ), - SHC( 0x01ac ), - SHC( 0x8003 ), - SHC( 0xf375 ), - SHC( 0x809e ), - SHC( 0xe564 ), - SHC( 0x82cd ), - SHC( 0xd7a7 ), - SHC( 0x8687 ), - SHC( 0xca6a ), - SHC( 0x8bc2 ), - SHC( 0xbdd6 ), - SHC( 0x926e ), - SHC( 0xb215 ), - SHC( 0x9a74 ), - SHC( 0xa749 ), - SHC( 0xa3bc ), - SHC( 0x9d97 ), - SHC( 0xae27 ), - SHC( 0x951c ), - SHC( 0xb996 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8835 ), - SHC( 0xd2ea ), - SHC( 0x83f1 ), - SHC( 0xe07f ), - SHC( 0x8136 ), - SHC( 0xee77 ), - SHC( 0x800c ), - SHC( 0xfca7 ), - SHC( 0x8077 ), - SHC( 0x0ae0 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f02 ), - SHC( 0xf020 ), - SHC( 0x7c0f ), - SHC( 0xe07f ), - SHC( 0x7732 ), - SHC( 0xd15a ), - SHC( 0x707d ), - SHC( 0xc2ed ), - SHC( 0x680b ), - SHC( 0xb572 ), - SHC( 0x5dfe ), - SHC( 0xa91e ), - SHC( 0x527d ), - SHC( 0x9e21 ), - SHC( 0x45b6 ), - SHC( 0x94a7 ), - SHC( 0x37dc ), - SHC( 0x8cd6 ), - SHC( 0x2924 ), - SHC( 0x86cb ), - SHC( 0x19ca ), - SHC( 0x82a1 ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0xfa24 ), - SHC( 0x8023 ), - SHC( 0xea53 ), - SHC( 0x81da ), - SHC( 0xdad8 ), - SHC( 0x8583 ), - SHC( 0xcbf1 ), - SHC( 0x8b11 ), - SHC( 0xbdd6 ), - SHC( 0x926e ), - SHC( 0xb0c2 ), - SHC( 0x9b7b ), - SHC( 0xa4e7 ), - SHC( 0xa616 ), - SHC( 0x9a74 ), - SHC( 0xb215 ), - SHC( 0x9192 ), - SHC( 0xbf47 ), - SHC( 0x8a66 ), - SHC( 0xcd7a ), - SHC( 0x850a ), - SHC( 0xdc74 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x8012 ), - SHC( 0xfbd0 ), - SHC( 0x808a ), - SHC( 0x0bb6 ), - SHC( 0x82fa ), - SHC( 0x1b6e ), - SHC( 0x8758 ), - SHC( 0x2aba ), - SHC( 0x8d93 ), - SHC( 0x395c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x4930 ), - SHC( 0x96fe ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0789 ), - SHC( 0x8039 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xe492 ), - SHC( 0x82fa ), - SHC( 0xd3b3 ), - SHC( 0x87ea ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa749 ), - SHC( 0xa3bc ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x9192 ), - SHC( 0xbf47 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x8426 ), - SHC( 0xdfaf ), - SHC( 0x80e4 ), - SHC( 0xf0f5 ), - SHC( 0x8007 ), - SHC( 0x0283 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x8583 ), - SHC( 0x2528 ), - SHC( 0x8bc2 ), - SHC( 0x3596 ), - SHC( 0x9433 ), - SHC( 0x4502 ), - SHC( 0x9eac ), - SHC( 0x5321 ), - SHC( 0xaafa ), - SHC( 0x5fae ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e8d ), - SHC( 0xecce ), - SHC( 0x7a3e ), - SHC( 0xda0b ), - SHC( 0x732a ), - SHC( 0xc824 ), - SHC( 0x697c ), - SHC( 0xb780 ), - SHC( 0x5d6c ), - SHC( 0xa881 ), - SHC( 0x4f3e ), - SHC( 0x9b7b ), - SHC( 0x3f45 ), - SHC( 0x90bc ), - SHC( 0x2ddf ), - SHC( 0x8881 ), - SHC( 0x1b6e ), - SHC( 0x82fa ), - SHC( 0x085f ), - SHC( 0x8047 ), - SHC( 0xf520 ), - SHC( 0x8077 ), - SHC( 0xe21f ), - SHC( 0x838a ), - SHC( 0xcfcb ), - SHC( 0x896d ), - SHC( 0xbe8e ), - SHC( 0x91ff ), - SHC( 0xaecd ), - SHC( 0x9d0e ), - SHC( 0xa0e1 ), - SHC( 0xaa5a ), - SHC( 0x951c ), - SHC( 0xb996 ), - SHC( 0x8bc2 ), - SHC( 0xca6a ), - SHC( 0x850a ), - SHC( 0xdc74 ), - SHC( 0x8119 ), - SHC( 0xef4b ), - SHC( 0x8007 ), - SHC( 0x0283 ), - SHC( 0x81da ), - SHC( 0x15ad ), - SHC( 0x8687 ), - SHC( 0x2859 ), - SHC( 0x8df4 ), - SHC( 0x3a1c ), - SHC( 0x97f5 ), - SHC( 0x4a8e ), - SHC( 0xa451 ), - SHC( 0x5951 ), - SHC( 0xb2bf ), - SHC( 0x660e ), - SHC( 0xc2ed ), - SHC( 0x707d ), - SHC( 0xd47c ), - SHC( 0x7860 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e4a ), - SHC( 0xeb27 ), - SHC( 0x7935 ), - SHC( 0xd6dc ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x658c ), - SHC( 0xb215 ), - SHC( 0x577f ), - SHC( 0xa294 ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x34d3 ), - SHC( 0x8b69 ), - SHC( 0x2120 ), - SHC( 0x845d ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xf7a1 ), - SHC( 0x8047 ), - SHC( 0xe2f0 ), - SHC( 0x8358 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xbc69 ), - SHC( 0x934e ), - SHC( 0xab9b ), - SHC( 0x9fc4 ), - SHC( 0x9d0e ), - SHC( 0xaecd ), - SHC( 0x9127 ), - SHC( 0xc000 ), - SHC( 0x8835 ), - SHC( 0xd2ea ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8012 ), - SHC( 0xfbd0 ), - SHC( 0x8119 ), - SHC( 0x10b5 ), - SHC( 0x8583 ), - SHC( 0x2528 ), - SHC( 0x8d34 ), - SHC( 0x389c ), - SHC( 0x97f5 ), - SHC( 0x4a8e ), - SHC( 0xa57e ), - SHC( 0x5a82 ), - SHC( 0xb572 ), - SHC( 0x680b ), - SHC( 0xc764 ), - SHC( 0x72cc ), - SHC( 0xdad8 ), - SHC( 0x7a7d ), - SHC( 0xef4b ), - SHC( 0x7ee7 ), - SHC( 0x0430 ), - SHC( 0x7fee ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0xfd7d ), - SHC( 0x8007 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd15a ), - SHC( 0x88ce ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xaafa ), - SHC( 0xa052 ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8136 ), - SHC( 0xee77 ), - SHC( 0x801a ), - SHC( 0x0506 ), - SHC( 0x82fa ), - SHC( 0x1b6e ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9433 ), - SHC( 0x4502 ), - SHC( 0xa202 ), - SHC( 0x56e2 ), - SHC( 0xb2bf ), - SHC( 0x660e ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xdad8 ), - SHC( 0x7a7d ), - SHC( 0xf0f5 ), - SHC( 0x7f1c ), - SHC( 0x0789 ), - SHC( 0x7fc7 ), - SHC( 0x1de1 ), - SHC( 0x7c76 ), - SHC( 0x334b ), - SHC( 0x7545 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7db3 ), - SHC( 0xe7da ), - SHC( 0x76e3 ), - SHC( 0xd092 ), - SHC( 0x6bcd ), - SHC( 0xbafe ), - SHC( 0x5cd9 ), - SHC( 0xa7e4 ), - SHC( 0x4a8e ), - SHC( 0x97f5 ), - SHC( 0x3596 ), - SHC( 0x8bc2 ), - SHC( 0x1eb1 ), - SHC( 0x83bd ), - SHC( 0x06b2 ), - SHC( 0x802d ), - SHC( 0xee77 ), - SHC( 0x8136 ), - SHC( 0xd6dc ), - SHC( 0x86cb ), - SHC( 0xc0bb ), - SHC( 0x90bc ), - SHC( 0xacdf ), - SHC( 0x9eac ), - SHC( 0x9c01 ), - SHC( 0xb01a ), - SHC( 0x8eb9 ), - SHC( 0xc467 ), - SHC( 0x8583 ), - SHC( 0xdad8 ), - SHC( 0x80b4 ), - SHC( 0xf29f ), - SHC( 0x8077 ), - SHC( 0x0ae0 ), - SHC( 0x84cf ), - SHC( 0x22be ), - SHC( 0x8d93 ), - SHC( 0x395c ), - SHC( 0x9a74 ), - SHC( 0x4deb ), - SHC( 0xaafa ), - SHC( 0x5fae ), - SHC( 0xbe8e ), - SHC( 0x6e01 ), - SHC( 0xd47c ), - SHC( 0x7860 ), - SHC( 0xebfa ), - SHC( 0x7e6c ), - SHC( 0x0430 ), - SHC( 0x7fee ), - SHC( 0x1c3f ), - SHC( 0x7cd8 ), - SHC( 0x334b ), - SHC( 0x7545 ), - SHC( 0x4880 ), - SHC( 0x697c ), - SHC( 0x5b19 ), - SHC( 0x59ea ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d5f ), - SHC( 0xe636 ), - SHC( 0x759a ), - SHC( 0xcd7a ), - SHC( 0x6902 ), - SHC( 0xb6d0 ), - SHC( 0x581c ), - SHC( 0xa327 ), - SHC( 0x4397 ), - SHC( 0x934e ), - SHC( 0x2c4d ), - SHC( 0x87ea ), - SHC( 0x1332 ), - SHC( 0x8173 ), - SHC( 0xf94e ), - SHC( 0x802d ), - SHC( 0xdfaf ), - SHC( 0x8426 ), - SHC( 0xc764 ), - SHC( 0x8d34 ), - SHC( 0xb16b ), - SHC( 0x9af7 ), - SHC( 0x9eac ), - SHC( 0xacdf ), - SHC( 0x8fea ), - SHC( 0xc231 ), - SHC( 0x85c2 ), - SHC( 0xda0b ), - SHC( 0x809e ), - SHC( 0xf375 ), - SHC( 0x80b4 ), - SHC( 0x0d61 ), - SHC( 0x8603 ), - SHC( 0x26c1 ), - SHC( 0x9053 ), - SHC( 0x3e8b ), - SHC( 0x9f37 ), - SHC( 0x53c3 ), - SHC( 0xb215 ), - SHC( 0x658c ), - SHC( 0xc824 ), - SHC( 0x732a ), - SHC( 0xe07f ), - SHC( 0x7c0f ), - SHC( 0xfa24 ), - SHC( 0x7fdd ), - SHC( 0x1406 ), - SHC( 0x7e6c ), - SHC( 0x2d16 ), - SHC( 0x77cb ), - SHC( 0x444d ), - SHC( 0x6c40 ), - SHC( 0x58b7 ), - SHC( 0x5c44 ), - SHC( 0x697c ), - SHC( 0x4880 ), - SHC( 0x75ee ), - SHC( 0x31c1 ), -}; - -const Word16 FFT_RotVector_640_fx[1240] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff9 ), - SHC( 0xfd7d ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7d06 ), - SHC( 0xe492 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7bda ), - SHC( 0xdfaf ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x78ef ), - SHC( 0xd611 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7732 ), - SHC( 0xd15a ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6485 ), - SHC( 0xb0c2 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5dfe ), - SHC( 0xa91e ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x660e ), - SHC( 0xb2bf ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5c44 ), - SHC( 0xa749 ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4502 ), - SHC( 0x9433 ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x37dc ), - SHC( 0x8cd6 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf375 ), - SHC( 0x809e ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xdad8 ), - SHC( 0x8583 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xca6a ), - SHC( 0x8bc2 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xb0c2 ), - SHC( 0x9b7b ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x4930 ), - SHC( 0x96fe ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0789 ), - SHC( 0x8039 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xe492 ), - SHC( 0x82fa ), - SHC( 0xd3b3 ), - SHC( 0x87ea ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa749 ), - SHC( 0xa3bc ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x9192 ), - SHC( 0xbf47 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0xfd7d ), - SHC( 0x8007 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd15a ), - SHC( 0x88ce ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xaafa ), - SHC( 0xa052 ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8136 ), - SHC( 0xee77 ), - SHC( 0x801a ), - SHC( 0x0506 ), - SHC( 0x82fa ), - SHC( 0x1b6e ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8276 ), - SHC( 0x18f8 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9593 ), - SHC( 0x471c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d06 ), - SHC( 0xe492 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x660e ), - SHC( 0xb2bf ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x0789 ), - SHC( 0x8039 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd15a ), - SHC( 0x88ce ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xa3bc ), - SHC( 0xa749 ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x8711 ), - SHC( 0xd611 ), - SHC( 0x80e4 ), - SHC( 0xf0f5 ), - SHC( 0x809e ), - SHC( 0x0c8b ), - SHC( 0x8644 ), - SHC( 0x278d ), - SHC( 0x9192 ), - SHC( 0x40b9 ), - SHC( 0xa202 ), - SHC( 0x56e2 ), - SHC( 0xb6d0 ), - SHC( 0x6902 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xacdf ), - SHC( 0x6154 ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xe21f ), - SHC( 0x7c76 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7bda ), - SHC( 0xdfaf ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x5c44 ), - SHC( 0xa749 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xe492 ), - SHC( 0x82fa ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xaafa ), - SHC( 0xa052 ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x8711 ), - SHC( 0xd611 ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x81ff ), - SHC( 0x1680 ), - SHC( 0x8bc2 ), - SHC( 0x3596 ), - SHC( 0x9d0e ), - SHC( 0x5133 ), - SHC( 0xb4c4 ), - SHC( 0x678d ), - SHC( 0xd15a ), - SHC( 0x7732 ), - SHC( 0xf0f5 ), - SHC( 0x7f1c ), - SHC( 0x1189 ), - SHC( 0x7eca ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xd3b3 ), - SHC( 0x87ea ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x80e4 ), - SHC( 0xf0f5 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x8bc2 ), - SHC( 0x3596 ), - SHC( 0x9eac ), - SHC( 0x5321 ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), - SHC( 0xd873 ), - SHC( 0x79bc ), - SHC( 0xfafa ), - SHC( 0x7fe6 ), - SHC( 0x1de1 ), - SHC( 0x7c76 ), - SHC( 0x3e8b ), - SHC( 0x6fad ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x809e ), - SHC( 0x0c8b ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9d0e ), - SHC( 0x5133 ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), - SHC( 0xdad8 ), - SHC( 0x7a7d ), - SHC( 0x0000 ), - SHC( 0x7fff ), - SHC( 0x2528 ), - SHC( 0x7a7d ), - SHC( 0x471c ), - SHC( 0x6a6d ), - SHC( 0x62f2 ), - SHC( 0x5133 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ffe ), - SHC( 0xfebf ), - SHC( 0x7ff9 ), - SHC( 0xfd7d ), - SHC( 0x7ff1 ), - SHC( 0xfc3c ), - SHC( 0x7fe6 ), - SHC( 0xfafa ), - SHC( 0x7fd8 ), - SHC( 0xf9b9 ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7fb2 ), - SHC( 0xf736 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f80 ), - SHC( 0xf4b5 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7f41 ), - SHC( 0xf235 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7ef5 ), - SHC( 0xefb6 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e38 ), - SHC( 0xeabd ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7dc7 ), - SHC( 0xe844 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff1 ), - SHC( 0xfc3c ), - SHC( 0x7fc7 ), - SHC( 0xf877 ), - SHC( 0x7f80 ), - SHC( 0xf4b5 ), - SHC( 0x7f1c ), - SHC( 0xf0f5 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7d4a ), - SHC( 0xe5cd ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7b87 ), - SHC( 0xde78 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7957 ), - SHC( 0xd741 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x76bb ), - SHC( 0xd02f ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x7049 ), - SHC( 0xc28f ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6c79 ), - SHC( 0xbc0e ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fd8 ), - SHC( 0xf9b9 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7c29 ), - SHC( 0xe0e7 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7884 ), - SHC( 0xd4e1 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6dca ), - SHC( 0xbe32 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x66cf ), - SHC( 0xb3c1 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x55f5 ), - SHC( 0xa129 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4c3f ), - SHC( 0x9931 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fb2 ), - SHC( 0xf736 ), - SHC( 0x7eca ), - SHC( 0xee77 ), - SHC( 0x7d4a ), - SHC( 0xe5cd ), - SHC( 0x7b31 ), - SHC( 0xdd42 ), - SHC( 0x7884 ), - SHC( 0xd4e1 ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x7179 ), - SHC( 0xc4c6 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6849 ), - SHC( 0xb5c9 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5d22 ), - SHC( 0xa832 ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x503a ), - SHC( 0x9c44 ), - SHC( 0x4930 ), - SHC( 0x96fe ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x3224 ), - SHC( 0x8a3b ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x2188 ), - SHC( 0x8479 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f80 ), - SHC( 0xf4b5 ), - SHC( 0x7e01 ), - SHC( 0xe980 ), - SHC( 0x7b87 ), - SHC( 0xde78 ), - SHC( 0x7816 ), - SHC( 0xd3b3 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x6849 ), - SHC( 0xb5c9 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x599d ), - SHC( 0xa49c ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4827 ), - SHC( 0x9647 ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x3471 ), - SHC( 0x8b3d ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x08ca ), - SHC( 0x804e ), - SHC( 0xfd7d ), - SHC( 0x8007 ), - SHC( 0xf235 ), - SHC( 0x80bf ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f41 ), - SHC( 0xf235 ), - SHC( 0x7d06 ), - SHC( 0xe492 ), - SHC( 0x7957 ), - SHC( 0xd741 ), - SHC( 0x743e ), - SHC( 0xca6a ), - SHC( 0x6dca ), - SHC( 0xbe32 ), - SHC( 0x660e ), - SHC( 0xb2bf ), - SHC( 0x5d22 ), - SHC( 0xa832 ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4827 ), - SHC( 0x9647 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x2fd1 ), - SHC( 0x8945 ), - SHC( 0x22be ), - SHC( 0x84cf ), - SHC( 0x1543 ), - SHC( 0x81c8 ), - SHC( 0x0789 ), - SHC( 0x8039 ), - SHC( 0xf9b9 ), - SHC( 0x8028 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xde78 ), - SHC( 0x8479 ), - SHC( 0xd15a ), - SHC( 0x88ce ), - SHC( 0xc4c6 ), - SHC( 0x8e87 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ef5 ), - SHC( 0xefb6 ), - SHC( 0x7bda ), - SHC( 0xdfaf ), - SHC( 0x76bb ), - SHC( 0xd02f ), - SHC( 0x6fad ), - SHC( 0xc175 ), - SHC( 0x66cf ), - SHC( 0xb3c1 ), - SHC( 0x5c44 ), - SHC( 0xa749 ), - SHC( 0x503a ), - SHC( 0x9c44 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x3471 ), - SHC( 0x8b3d ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x1543 ), - SHC( 0x81c8 ), - SHC( 0x0506 ), - SHC( 0x801a ), - SHC( 0xf4b5 ), - SHC( 0x8080 ), - SHC( 0xe492 ), - SHC( 0x82fa ), - SHC( 0xd4e1 ), - SHC( 0x877c ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb7d9 ), - SHC( 0x9647 ), - SHC( 0xaafa ), - SHC( 0xa052 ), - SHC( 0x9f7e ), - SHC( 0xabec ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xf9b9 ), - SHC( 0x8028 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd4e1 ), - SHC( 0x877c ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb3c1 ), - SHC( 0x9931 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9931 ), - SHC( 0xb3c1 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x877c ), - SHC( 0xd4e1 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e38 ), - SHC( 0xeabd ), - SHC( 0x78ef ), - SHC( 0xd611 ), - SHC( 0x7049 ), - SHC( 0xc28f ), - SHC( 0x6485 ), - SHC( 0xb0c2 ), - SHC( 0x55f5 ), - SHC( 0xa129 ), - SHC( 0x4502 ), - SHC( 0x9433 ), - SHC( 0x3224 ), - SHC( 0x8a3b ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0x08ca ), - SHC( 0x804e ), - SHC( 0xf375 ), - SHC( 0x809e ), - SHC( 0xde78 ), - SHC( 0x8479 ), - SHC( 0xca6a ), - SHC( 0x8bc2 ), - SHC( 0xb7d9 ), - SHC( 0x9647 ), - SHC( 0xa749 ), - SHC( 0xa3bc ), - SHC( 0x9931 ), - SHC( 0xb3c1 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x85e2 ), - SHC( 0xd9a5 ), - SHC( 0x8136 ), - SHC( 0xee77 ), - SHC( 0x800f ), - SHC( 0x03c4 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7dc7 ), - SHC( 0xe844 ), - SHC( 0x7732 ), - SHC( 0xd15a ), - SHC( 0x6c79 ), - SHC( 0xbc0e ), - SHC( 0x5dfe ), - SHC( 0xa91e ), - SHC( 0x4c3f ), - SHC( 0x9931 ), - SHC( 0x37dc ), - SHC( 0x8cd6 ), - SHC( 0x2188 ), - SHC( 0x8479 ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0xf235 ), - SHC( 0x80bf ), - SHC( 0xdad8 ), - SHC( 0x8583 ), - SHC( 0xc4c6 ), - SHC( 0x8e87 ), - SHC( 0xb0c2 ), - SHC( 0x9b7b ), - SHC( 0x9f7e ), - SHC( 0xabec ), - SHC( 0x9192 ), - SHC( 0xbf47 ), - SHC( 0x877c ), - SHC( 0xd4e1 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x800f ), - SHC( 0x03c4 ), - SHC( 0x82fa ), - SHC( 0x1b6e ), - SHC( 0x8a3b ), - SHC( 0x3224 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d4a ), - SHC( 0xe5cd ), - SHC( 0x7545 ), - SHC( 0xccb5 ), - SHC( 0x6849 ), - SHC( 0xb5c9 ), - SHC( 0x56e2 ), - SHC( 0xa202 ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x29ef ), - SHC( 0x8711 ), - SHC( 0x104a ), - SHC( 0x810b ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xdc0d ), - SHC( 0x8528 ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xadd5 ), - SHC( 0x9ddc ), - SHC( 0x9b7b ), - SHC( 0xb0c2 ), - SHC( 0x8d63 ), - SHC( 0xc703 ), - SHC( 0x8426 ), - SHC( 0xdfaf ), - SHC( 0x8028 ), - SHC( 0xf9b9 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x885b ), - SHC( 0x2d7a ), - SHC( 0x9433 ), - SHC( 0x4502 ), - SHC( 0xa49c ), - SHC( 0x599d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7cc0 ), - SHC( 0xe358 ), - SHC( 0x732a ), - SHC( 0xc824 ), - SHC( 0x63bc ), - SHC( 0xafc6 ), - SHC( 0x4f3e ), - SHC( 0x9b7b ), - SHC( 0x36ba ), - SHC( 0x8c4b ), - SHC( 0x1b6e ), - SHC( 0x82fa ), - SHC( 0xfebf ), - SHC( 0x8002 ), - SHC( 0xe21f ), - SHC( 0x838a ), - SHC( 0xc703 ), - SHC( 0x8d63 ), - SHC( 0xaecd ), - SHC( 0x9d0e ), - SHC( 0x9ab5 ), - SHC( 0xb1c0 ), - SHC( 0x8bc2 ), - SHC( 0xca6a ), - SHC( 0x82b6 ), - SHC( 0xe5cd ), - SHC( 0x8007 ), - SHC( 0x0283 ), - SHC( 0x83d7 ), - SHC( 0x1f19 ), - SHC( 0x8df4 ), - SHC( 0x3a1c ), - SHC( 0x9ddc ), - SHC( 0x522b ), - SHC( 0xb2bf ), - SHC( 0x660e ), - SHC( 0xcb8f ), - SHC( 0x74c3 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7c29 ), - SHC( 0xe0e7 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x2b1f ), - SHC( 0x877c ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xed38 ), - SHC( 0x8163 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xb3c1 ), - SHC( 0x9931 ), - SHC( 0x9d0e ), - SHC( 0xaecd ), - SHC( 0x8c4b ), - SHC( 0xc946 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8028 ), - SHC( 0x0647 ), - SHC( 0x8583 ), - SHC( 0x2528 ), - SHC( 0x9236 ), - SHC( 0x41ce ), - SHC( 0xa57e ), - SHC( 0x5a82 ), - SHC( 0xbe32 ), - SHC( 0x6dca ), - SHC( 0xdad8 ), - SHC( 0x7a7d ), - SHC( 0xf9b9 ), - SHC( 0x7fd8 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7b87 ), - SHC( 0xde78 ), - SHC( 0x6e6e ), - SHC( 0xbf47 ), - SHC( 0x599d ), - SHC( 0xa49c ), - SHC( 0x3e8b ), - SHC( 0x9053 ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0xfd7d ), - SHC( 0x8007 ), - SHC( 0xdc0d ), - SHC( 0x8528 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xa2de ), - SHC( 0xa832 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x8340 ), - SHC( 0xe358 ), - SHC( 0x801a ), - SHC( 0x0506 ), - SHC( 0x85e2 ), - SHC( 0x265b ), - SHC( 0x9433 ), - SHC( 0x4502 ), - SHC( 0xaa0b ), - SHC( 0x5ed7 ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xe5cd ), - SHC( 0x7d4a ), - SHC( 0x0789 ), - SHC( 0x7fc7 ), - SHC( 0x28bf ), - SHC( 0x7957 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ad8 ), - SHC( 0xdc0d ), - SHC( 0x6bcd ), - SHC( 0xbafe ), - SHC( 0x5414 ), - SHC( 0x9f7e ), - SHC( 0x3596 ), - SHC( 0x8bc2 ), - SHC( 0x12c8 ), - SHC( 0x8163 ), - SHC( 0xee77 ), - SHC( 0x8136 ), - SHC( 0xcb8f ), - SHC( 0x8b3d ), - SHC( 0xacdf ), - SHC( 0x9eac ), - SHC( 0x94e1 ), - SHC( 0xb9f0 ), - SHC( 0x8583 ), - SHC( 0xdad8 ), - SHC( 0x8002 ), - SHC( 0xfebf ), - SHC( 0x84cf ), - SHC( 0x22be ), - SHC( 0x9387 ), - SHC( 0x43f2 ), - SHC( 0xaafa ), - SHC( 0x5fae ), - SHC( 0xc946 ), - SHC( 0x73b5 ), - SHC( 0xebfa ), - SHC( 0x7e6c ), - SHC( 0x104a ), - SHC( 0x7ef5 ), - SHC( 0x334b ), - SHC( 0x7545 ), - SHC( 0x522b ), - SHC( 0x6224 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7a1e ), - SHC( 0xd9a5 ), - SHC( 0x6902 ), - SHC( 0xb6d0 ), - SHC( 0x4e40 ), - SHC( 0x9ab5 ), - SHC( 0x2c4d ), - SHC( 0x87ea ), - SHC( 0x0647 ), - SHC( 0x8028 ), - SHC( 0xdfaf ), - SHC( 0x8426 ), - SHC( 0xbc0e ), - SHC( 0x9387 ), - SHC( 0x9eac ), - SHC( 0xacdf ), - SHC( 0x8a3b ), - SHC( 0xcddc ), - SHC( 0x809e ), - SHC( 0xf375 ), - SHC( 0x82b6 ), - SHC( 0x1a33 ), - SHC( 0x9053 ), - SHC( 0x3e8b ), - SHC( 0xa832 ), - SHC( 0x5d22 ), - SHC( 0xc824 ), - SHC( 0x732a ), - SHC( 0xed38 ), - SHC( 0x7e9d ), - SHC( 0x1406 ), - SHC( 0x7e6c ), - SHC( 0x38fd ), - SHC( 0x729d ), - SHC( 0x58b7 ), - SHC( 0x5c44 ), - SHC( 0x7049 ), - SHC( 0x3d71 ), -}; - -const Word16 FFT_RotVector_600_fx[1140] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff8 ), - SHC( 0xfd52 ), - SHC( 0x7fe3 ), - SHC( 0xfaa4 ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7f8d ), - SHC( 0xf54b ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7ea0 ), - SHC( 0xed4e ), - SHC( 0x7e35 ), - SHC( 0xeaa8 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7c9e ), - SHC( 0xe2c6 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7b48 ), - SHC( 0xdd95 ), - SHC( 0x7a89 ), - SHC( 0xdb02 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x78e1 ), - SHC( 0xd5e8 ), - SHC( 0x77f8 ), - SHC( 0xd362 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x75ff ), - SHC( 0xce66 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x72a6 ), - SHC( 0xc717 ), - SHC( 0x716f ), - SHC( 0xc4b3 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6d7c ), - SHC( 0xbdb2 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x6a9d ), - SHC( 0xb92b ), - SHC( 0x691b ), - SHC( 0xb6f3 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fe3 ), - SHC( 0xfaa4 ), - SHC( 0x7f8d ), - SHC( 0xf54b ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7e35 ), - SHC( 0xeaa8 ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7a89 ), - SHC( 0xdb02 ), - SHC( 0x78e1 ), - SHC( 0xd5e8 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x72a6 ), - SHC( 0xc717 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6d7c ), - SHC( 0xbdb2 ), - SHC( 0x6a9d ), - SHC( 0xb92b ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6450 ), - SHC( 0xb07f ), - SHC( 0x60e5 ), - SHC( 0xac5d ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x598e ), - SHC( 0xa48d ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4d63 ), - SHC( 0x9a0c ), - SHC( 0x490d ), - SHC( 0x96e5 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x3b4d ), - SHC( 0x8e91 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x319a ), - SHC( 0x8a01 ), - SHC( 0x2c9e ), - SHC( 0x8808 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x62a0 ), - SHC( 0xae69 ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x579f ), - SHC( 0xa2b2 ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x3daa ), - SHC( 0x8fd6 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x2f1e ), - SHC( 0x88fe ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x17fc ), - SHC( 0x8245 ), - SHC( 0x100a ), - SHC( 0x8103 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf7f7 ), - SHC( 0x8041 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xe02b ), - SHC( 0x8406 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f8d ), - SHC( 0xf54b ), - SHC( 0x7e35 ), - SHC( 0xeaa8 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x78e1 ), - SHC( 0xd5e8 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6a9d ), - SHC( 0xb92b ), - SHC( 0x6450 ), - SHC( 0xb07f ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x4d63 ), - SHC( 0x9a0c ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x3b4d ), - SHC( 0x8e91 ), - SHC( 0x319a ), - SHC( 0x8a01 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1d3a ), - SHC( 0x8362 ), - SHC( 0x12b2 ), - SHC( 0x8160 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xfd52 ), - SHC( 0x8008 ), - SHC( 0xf29f ), - SHC( 0x80b4 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xdd95 ), - SHC( 0x84b8 ), - SHC( 0xd362 ), - SHC( 0x8808 ), - SHC( 0xc981 ), - SHC( 0x8c2f ), - SHC( 0xc000 ), - SHC( 0x9127 ), - SHC( 0xb6f3 ), - SHC( 0x96e5 ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0xa672 ), - SHC( 0xa48d ), - SHC( 0x9f1b ), - SHC( 0xac5d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf29f ), - SHC( 0x80b4 ), - SHC( 0xe564 ), - SHC( 0x82cd ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xcbf1 ), - SHC( 0x8b11 ), - SHC( 0xc000 ), - SHC( 0x9127 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xaa5a ), - SHC( 0xa0e1 ), - SHC( 0xa0e1 ), - SHC( 0xaa5a ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x9127 ), - SHC( 0xc000 ), - SHC( 0x8b11 ), - SHC( 0xcbf1 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x82cd ), - SHC( 0xe564 ), - SHC( 0x80b4 ), - SHC( 0xf29f ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x17fc ), - SHC( 0x8245 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xf7f7 ), - SHC( 0x8041 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc981 ), - SHC( 0x8c2f ), - SHC( 0xbb6b ), - SHC( 0x93ee ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0xa2b2 ), - SHC( 0xa861 ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x88fe ), - SHC( 0xd0e2 ), - SHC( 0x8406 ), - SHC( 0xe02b ), - SHC( 0x8103 ), - SHC( 0xeff6 ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8103 ), - SHC( 0x100a ), - SHC( 0x8406 ), - SHC( 0x1fd5 ), - SHC( 0x88fe ), - SHC( 0x2f1e ), - SHC( 0x8fd6 ), - SHC( 0x3daa ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ea0 ), - SHC( 0xed4e ), - SHC( 0x7a89 ), - SHC( 0xdb02 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x6a9d ), - SHC( 0xb92b ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x424e ), - SHC( 0x9284 ), - SHC( 0x319a ), - SHC( 0x8a01 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0xfaa4 ), - SHC( 0x801d ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xd5e8 ), - SHC( 0x871f ), - SHC( 0xc4b3 ), - SHC( 0x8e91 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa672 ), - SHC( 0xa48d ), - SHC( 0x9a0c ), - SHC( 0xb29d ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x8808 ), - SHC( 0xd362 ), - SHC( 0x82cd ), - SHC( 0xe564 ), - SHC( 0x8041 ), - SHC( 0xf7f7 ), - SHC( 0x8073 ), - SHC( 0x0ab5 ), - SHC( 0x8362 ), - SHC( 0x1d3a ), - SHC( 0x88fe ), - SHC( 0x2f1e ), - SHC( 0x9127 ), - SHC( 0x4000 ), - SHC( 0x9bb0 ), - SHC( 0x4f81 ), - SHC( 0xa861 ), - SHC( 0x5d4e ), - SHC( 0xb6f3 ), - SHC( 0x691b ), - SHC( 0xc717 ), - SHC( 0x72a6 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e35 ), - SHC( 0xeaa8 ), - SHC( 0x78e1 ), - SHC( 0xd5e8 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6450 ), - SHC( 0xb07f ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x319a ), - SHC( 0x8a01 ), - SHC( 0x1d3a ), - SHC( 0x8362 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xf29f ), - SHC( 0x80b4 ), - SHC( 0xdd95 ), - SHC( 0x84b8 ), - SHC( 0xc981 ), - SHC( 0x8c2f ), - SHC( 0xb6f3 ), - SHC( 0x96e5 ), - SHC( 0xa672 ), - SHC( 0xa48d ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8d5a ), - SHC( 0xc717 ), - SHC( 0x8577 ), - SHC( 0xdb02 ), - SHC( 0x8103 ), - SHC( 0xeff6 ), - SHC( 0x801d ), - SHC( 0x055c ), - SHC( 0x82cd ), - SHC( 0x1a9c ), - SHC( 0x88fe ), - SHC( 0x2f1e ), - SHC( 0x9284 ), - SHC( 0x424e ), - SHC( 0x9f1b ), - SHC( 0x53a3 ), - SHC( 0xae69 ), - SHC( 0x62a0 ), - SHC( 0xc000 ), - SHC( 0x6ed9 ), - SHC( 0xd362 ), - SHC( 0x77f8 ), - SHC( 0xe804 ), - SHC( 0x7dbb ), - SHC( 0xfd52 ), - SHC( 0x7ff8 ), - SHC( 0x12b2 ), - SHC( 0x7ea0 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc256 ), - SHC( 0x8fd6 ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0x9d60 ), - SHC( 0xae69 ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8103 ), - SHC( 0xeff6 ), - SHC( 0x8041 ), - SHC( 0x0809 ), - SHC( 0x8406 ), - SHC( 0x1fd5 ), - SHC( 0x8c2f ), - SHC( 0x367f ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xa861 ), - SHC( 0x5d4e ), - SHC( 0xbb6b ), - SHC( 0x6c12 ), - SHC( 0xd0e2 ), - SHC( 0x7702 ), - SHC( 0xe804 ), - SHC( 0x7dbb ), - SHC( 0x0000 ), - SHC( 0x7fff ), - SHC( 0x17fc ), - SHC( 0x7dbb ), - SHC( 0x2f1e ), - SHC( 0x7702 ), - SHC( 0x4495 ), - SHC( 0x6c12 ), - SHC( 0x579f ), - SHC( 0x5d4e ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ffe ), - SHC( 0xfea9 ), - SHC( 0x7ff8 ), - SHC( 0xfd52 ), - SHC( 0x7fef ), - SHC( 0xfbfb ), - SHC( 0x7fe3 ), - SHC( 0xfaa4 ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7fa8 ), - SHC( 0xf6a1 ), - SHC( 0x7f8d ), - SHC( 0xf54b ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7f26 ), - SHC( 0xf14a ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7ed0 ), - SHC( 0xeea1 ), - SHC( 0x7ea0 ), - SHC( 0xed4e ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e35 ), - SHC( 0xeaa8 ), - SHC( 0x7dfa ), - SHC( 0xe956 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7d79 ), - SHC( 0xe6b4 ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7c9e ), - SHC( 0xe2c6 ), - SHC( 0x7c4e ), - SHC( 0xe178 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x7b48 ), - SHC( 0xdd95 ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x7a89 ), - SHC( 0xdb02 ), - SHC( 0x7a24 ), - SHC( 0xd9ba ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fef ), - SHC( 0xfbfb ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x786e ), - SHC( 0xd4a5 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x7578 ), - SHC( 0xcd2b ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6e2c ), - SHC( 0xbed8 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x69dd ), - SHC( 0xb80e ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x62a0 ), - SHC( 0xae69 ), - SHC( 0x6003 ), - SHC( 0xab5b ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x579f ), - SHC( 0xa2b2 ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4e73 ), - SHC( 0x9add ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fd3 ), - SHC( 0xf94e ), - SHC( 0x7f4c ), - SHC( 0xf29f ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7d33 ), - SHC( 0xe564 ), - SHC( 0x7ba3 ), - SHC( 0xdee0 ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x74ef ), - SHC( 0xcbf1 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6ed9 ), - SHC( 0xc000 ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x55a6 ), - SHC( 0xa0e1 ), - SHC( 0x508d ), - SHC( 0x9c87 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x45b6 ), - SHC( 0x94a7 ), - SHC( 0x4000 ), - SHC( 0x9127 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x2ddf ), - SHC( 0x8881 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x2120 ), - SHC( 0x845d ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x06b2 ), - SHC( 0x802d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fa8 ), - SHC( 0xf6a1 ), - SHC( 0x7ea0 ), - SHC( 0xed4e ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7a89 ), - SHC( 0xdb02 ), - SHC( 0x777f ), - SHC( 0xd221 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x6f83 ), - SHC( 0xc12b ), - SHC( 0x6a9d ), - SHC( 0xb92b ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x5f1f ), - SHC( 0xaa5a ), - SHC( 0x5898 ), - SHC( 0xa39e ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4a25 ), - SHC( 0x97aa ), - SHC( 0x424e ), - SHC( 0x9284 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x319a ), - SHC( 0x8a01 ), - SHC( 0x28d3 ), - SHC( 0x86b0 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x16aa ), - SHC( 0x8206 ), - SHC( 0x0d61 ), - SHC( 0x80b4 ), - SHC( 0x0405 ), - SHC( 0x8011 ), - SHC( 0xfaa4 ), - SHC( 0x801d ), - SHC( 0xf14a ), - SHC( 0x80da ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xdee0 ), - SHC( 0x845d ), - SHC( 0xd5e8 ), - SHC( 0x871f ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xc4b3 ), - SHC( 0x8e91 ), - SHC( 0xbc8d ), - SHC( 0x9337 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4128 ), - SHC( 0x91d4 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x2b5b ), - SHC( 0x8792 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xfbfb ), - SHC( 0x8011 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xe414 ), - SHC( 0x8316 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xc256 ), - SHC( 0x8fd6 ), - SHC( 0xb80e ), - SHC( 0x9623 ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9d60 ), - SHC( 0xae69 ), - SHC( 0x9623 ), - SHC( 0xb80e ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x8a88 ), - SHC( 0xcd2b ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f26 ), - SHC( 0xf14a ), - SHC( 0x7c9e ), - SHC( 0xe2c6 ), - SHC( 0x786e ), - SHC( 0xd4a5 ), - SHC( 0x72a6 ), - SHC( 0xc717 ), - SHC( 0x6b59 ), - SHC( 0xba4a ), - SHC( 0x62a0 ), - SHC( 0xae69 ), - SHC( 0x5898 ), - SHC( 0xa39e ), - SHC( 0x4d63 ), - SHC( 0x9a0c ), - SHC( 0x4128 ), - SHC( 0x91d4 ), - SHC( 0x340f ), - SHC( 0x8b11 ), - SHC( 0x2646 ), - SHC( 0x85dc ), - SHC( 0x17fc ), - SHC( 0x8245 ), - SHC( 0x095f ), - SHC( 0x8058 ), - SHC( 0xfaa4 ), - SHC( 0x801d ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xdd95 ), - SHC( 0x84b8 ), - SHC( 0xcfa3 ), - SHC( 0x897e ), - SHC( 0xc256 ), - SHC( 0x8fd6 ), - SHC( 0xb5db ), - SHC( 0x97aa ), - SHC( 0xaa5a ), - SHC( 0xa0e1 ), - SHC( 0x9ffd ), - SHC( 0xab5b ), - SHC( 0x96e5 ), - SHC( 0xb6f3 ), - SHC( 0x8f32 ), - SHC( 0xc384 ), - SHC( 0x88fe ), - SHC( 0xd0e2 ), - SHC( 0x845d ), - SHC( 0xdee0 ), - SHC( 0x8160 ), - SHC( 0xed4e ), - SHC( 0x8011 ), - SHC( 0xfbfb ), - SHC( 0x8073 ), - SHC( 0x0ab5 ), - SHC( 0x8287 ), - SHC( 0x194c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ed0 ), - SHC( 0xeea1 ), - SHC( 0x7b48 ), - SHC( 0xdd95 ), - SHC( 0x7578 ), - SHC( 0xcd2b ), - SHC( 0x6d7c ), - SHC( 0xbdb2 ), - SHC( 0x6379 ), - SHC( 0xaf73 ), - SHC( 0x579f ), - SHC( 0xa2b2 ), - SHC( 0x4a25 ), - SHC( 0x97aa ), - SHC( 0x3b4d ), - SHC( 0x8e91 ), - SHC( 0x2b5b ), - SHC( 0x8792 ), - SHC( 0x1a9c ), - SHC( 0x82cd ), - SHC( 0x095f ), - SHC( 0x8058 ), - SHC( 0xf7f7 ), - SHC( 0x8041 ), - SHC( 0xe6b4 ), - SHC( 0x8287 ), - SHC( 0xd5e8 ), - SHC( 0x871f ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb6f3 ), - SHC( 0x96e5 ), - SHC( 0xa95d ), - SHC( 0xa1c8 ), - SHC( 0x9d60 ), - SHC( 0xae69 ), - SHC( 0x9337 ), - SHC( 0xbc8d ), - SHC( 0x8b11 ), - SHC( 0xcbf1 ), - SHC( 0x8516 ), - SHC( 0xdc4b ), - SHC( 0x8160 ), - SHC( 0xed4e ), - SHC( 0x8002 ), - SHC( 0xfea9 ), - SHC( 0x8103 ), - SHC( 0x100a ), - SHC( 0x845d ), - SHC( 0x2120 ), - SHC( 0x8a01 ), - SHC( 0x319a ), - SHC( 0x91d4 ), - SHC( 0x4128 ), - SHC( 0x9bb0 ), - SHC( 0x4f81 ), - SHC( 0xa768 ), - SHC( 0x5c62 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x8644 ), - SHC( 0x278d ), - SHC( 0x8df4 ), - SHC( 0x3a1c ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xa57e ), - SHC( 0x5a82 ), - SHC( 0xb4c4 ), - SHC( 0x678d ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xd873 ), - SHC( 0x79bc ), - SHC( 0xebfa ), - SHC( 0x7e6c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7dfa ), - SHC( 0xe956 ), - SHC( 0x77f8 ), - SHC( 0xd362 ), - SHC( 0x6e2c ), - SHC( 0xbed8 ), - SHC( 0x60e5 ), - SHC( 0xac5d ), - SHC( 0x508d ), - SHC( 0x9c87 ), - SHC( 0x3daa ), - SHC( 0x8fd6 ), - SHC( 0x28d3 ), - SHC( 0x86b0 ), - SHC( 0x12b2 ), - SHC( 0x8160 ), - SHC( 0xfbfb ), - SHC( 0x8011 ), - SHC( 0xe564 ), - SHC( 0x82cd ), - SHC( 0xcfa3 ), - SHC( 0x897e ), - SHC( 0xbb6b ), - SHC( 0x93ee ), - SHC( 0xa95d ), - SHC( 0xa1c8 ), - SHC( 0x9a0c ), - SHC( 0xb29d ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8577 ), - SHC( 0xdb02 ), - SHC( 0x80da ), - SHC( 0xf14a ), - SHC( 0x8041 ), - SHC( 0x0809 ), - SHC( 0x83b2 ), - SHC( 0x1e88 ), - SHC( 0x8b11 ), - SHC( 0x340f ), - SHC( 0x9623 ), - SHC( 0x47f2 ), - SHC( 0xa48d ), - SHC( 0x598e ), - SHC( 0xb5db ), - SHC( 0x6856 ), - SHC( 0xc981 ), - SHC( 0x73d1 ), - SHC( 0xdee0 ), - SHC( 0x7ba3 ), - SHC( 0xf54b ), - SHC( 0x7f8d ), - SHC( 0x0c0b ), - SHC( 0x7f6e ), - SHC( 0x226b ), - SHC( 0x7b48 ), - SHC( 0x37b5 ), - SHC( 0x733d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d79 ), - SHC( 0xe6b4 ), - SHC( 0x75ff ), - SHC( 0xce66 ), - SHC( 0x69dd ), - SHC( 0xb80e ), - SHC( 0x598e ), - SHC( 0xa48d ), - SHC( 0x45b6 ), - SHC( 0x94a7 ), - SHC( 0x2f1e ), - SHC( 0x88fe ), - SHC( 0x16aa ), - SHC( 0x8206 ), - SHC( 0xfd52 ), - SHC( 0x8008 ), - SHC( 0xe414 ), - SHC( 0x8316 ), - SHC( 0xcbf1 ), - SHC( 0x8b11 ), - SHC( 0xb5db ), - SHC( 0x97aa ), - SHC( 0xa2b2 ), - SHC( 0xa861 ), - SHC( 0x9337 ), - SHC( 0xbc8d ), - SHC( 0x8808 ), - SHC( 0xd362 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x801d ), - SHC( 0x055c ), - SHC( 0x83b2 ), - SHC( 0x1e88 ), - SHC( 0x8c2f ), - SHC( 0x367f ), - SHC( 0x993e ), - SHC( 0x4c51 ), - SHC( 0xaa5a ), - SHC( 0x5f1f ), - SHC( 0xbed8 ), - SHC( 0x6e2c ), - SHC( 0xd5e8 ), - SHC( 0x78e1 ), - SHC( 0xeea1 ), - SHC( 0x7ed0 ), - SHC( 0x0809 ), - SHC( 0x7fbf ), - SHC( 0x2120 ), - SHC( 0x7ba3 ), - SHC( 0x38e9 ), - SHC( 0x72a6 ), - SHC( 0x4e73 ), - SHC( 0x6523 ), - SHC( 0x60e5 ), - SHC( 0x53a3 ), - SHC( 0x6f83 ), - SHC( 0x3ed5 ), -}; - -const Word16 FFT_RotVector_400_fx[760] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fef ), - SHC( 0xfbfb ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x786e ), - SHC( 0xd4a5 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x7578 ), - SHC( 0xcd2b ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6e2c ), - SHC( 0xbed8 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x69dd ), - SHC( 0xb80e ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x62a0 ), - SHC( 0xae69 ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x579f ), - SHC( 0xa2b2 ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x3daa ), - SHC( 0x8fd6 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x2f1e ), - SHC( 0x88fe ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x4128 ), - SHC( 0x91d4 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x2b5b ), - SHC( 0x8792 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xfbfb ), - SHC( 0x8011 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xe414 ), - SHC( 0x8316 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x17fc ), - SHC( 0x8245 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xf7f7 ), - SHC( 0x8041 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc981 ), - SHC( 0x8c2f ), - SHC( 0xbb6b ), - SHC( 0x93ee ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0xa2b2 ), - SHC( 0xa861 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xc256 ), - SHC( 0x8fd6 ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0x9d60 ), - SHC( 0xae69 ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8103 ), - SHC( 0xeff6 ), - SHC( 0x8041 ), - SHC( 0x0809 ), - SHC( 0x8406 ), - SHC( 0x1fd5 ), - SHC( 0x8c2f ), - SHC( 0x367f ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x0405 ), - SHC( 0x8011 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xb4c4 ), - SHC( 0x9873 ), - SHC( 0x9ffd ), - SHC( 0xab5b ), - SHC( 0x8fd6 ), - SHC( 0xc256 ), - SHC( 0x8516 ), - SHC( 0xdc4b ), - SHC( 0x8041 ), - SHC( 0xf7f7 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x88fe ), - SHC( 0x2f1e ), - SHC( 0x9623 ), - SHC( 0x47f2 ), - SHC( 0xa861 ), - SHC( 0x5d4e ), - SHC( 0xbed8 ), - SHC( 0x6e2c ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x702a ), - SHC( 0xc256 ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x4495 ), - SHC( 0x93ee ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x0809 ), - SHC( 0x8041 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xc981 ), - SHC( 0x8c2f ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0x9873 ), - SHC( 0xb4c4 ), - SHC( 0x88fe ), - SHC( 0xd0e2 ), - SHC( 0x8103 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0x100a ), - SHC( 0x88fe ), - SHC( 0x2f1e ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xae69 ), - SHC( 0x62a0 ), - SHC( 0xc981 ), - SHC( 0x73d1 ), - SHC( 0xe804 ), - SHC( 0x7dbb ), - SHC( 0x0809 ), - SHC( 0x7fbf ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0x9623 ), - SHC( 0xb80e ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8011 ), - SHC( 0xfbfb ), - SHC( 0x8406 ), - SHC( 0x1fd5 ), - SHC( 0x91d4 ), - SHC( 0x4128 ), - SHC( 0xa861 ), - SHC( 0x5d4e ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xe804 ), - SHC( 0x7dbb ), - SHC( 0x0c0b ), - SHC( 0x7f6e ), - SHC( 0x2f1e ), - SHC( 0x7702 ), - SHC( 0x4e73 ), - SHC( 0x6523 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ffb ), - SHC( 0xfdfe ), - SHC( 0x7fef ), - SHC( 0xfbfb ), - SHC( 0x7fdb ), - SHC( 0xf9f9 ), - SHC( 0x7fbf ), - SHC( 0xf7f7 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7f3a ), - SHC( 0xf1f5 ), - SHC( 0x7efd ), - SHC( 0xeff6 ), - SHC( 0x7eb9 ), - SHC( 0xedf7 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7e18 ), - SHC( 0xe9ff ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7d57 ), - SHC( 0xe60c ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7bfa ), - SHC( 0xe02b ), - SHC( 0x7b76 ), - SHC( 0xde3a ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x7a57 ), - SHC( 0xda5d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fdb ), - SHC( 0xf9f9 ), - SHC( 0x7f6e ), - SHC( 0xf3f5 ), - SHC( 0x7eb9 ), - SHC( 0xedf7 ), - SHC( 0x7dbb ), - SHC( 0xe804 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x7919 ), - SHC( 0xd68a ), - SHC( 0x7702 ), - SHC( 0xd0e2 ), - SHC( 0x74a8 ), - SHC( 0xcb54 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6f2f ), - SHC( 0xc095 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x68b9 ), - SHC( 0xb667 ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5d4e ), - SHC( 0xa861 ), - SHC( 0x5913 ), - SHC( 0xa415 ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x5007 ), - SHC( 0x9c1b ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f9a ), - SHC( 0xf5f6 ), - SHC( 0x7e6c ), - SHC( 0xebfa ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x79bc ), - SHC( 0xd873 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x678d ), - SHC( 0xb4c4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x278d ), - SHC( 0x8644 ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f3a ), - SHC( 0xf1f5 ), - SHC( 0x7cea ), - SHC( 0xe414 ), - SHC( 0x7919 ), - SHC( 0xd68a ), - SHC( 0x73d1 ), - SHC( 0xc981 ), - SHC( 0x6d23 ), - SHC( 0xbd1f ), - SHC( 0x6523 ), - SHC( 0xb18d ), - SHC( 0x5beb ), - SHC( 0xa6ed ), - SHC( 0x5197 ), - SHC( 0x9d60 ), - SHC( 0x4646 ), - SHC( 0x9505 ), - SHC( 0x3a1c ), - SHC( 0x8df4 ), - SHC( 0x2d3e ), - SHC( 0x8844 ), - SHC( 0x1fd5 ), - SHC( 0x8406 ), - SHC( 0x1209 ), - SHC( 0x8147 ), - SHC( 0x0405 ), - SHC( 0x8011 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xe804 ), - SHC( 0x8245 ), - SHC( 0xda5d ), - SHC( 0x85a9 ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xc095 ), - SHC( 0x90d1 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7eb9 ), - SHC( 0xedf7 ), - SHC( 0x7aea ), - SHC( 0xdc4b ), - SHC( 0x74a8 ), - SHC( 0xcb54 ), - SHC( 0x6c12 ), - SHC( 0xbb6b ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x54a5 ), - SHC( 0x9ffd ), - SHC( 0x4646 ), - SHC( 0x9505 ), - SHC( 0x367f ), - SHC( 0x8c2f ), - SHC( 0x25a3 ), - SHC( 0x85a9 ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0x0202 ), - SHC( 0x8005 ), - SHC( 0xeff6 ), - SHC( 0x8103 ), - SHC( 0xde3a ), - SHC( 0x848a ), - SHC( 0xcd2b ), - SHC( 0x8a88 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xae69 ), - SHC( 0x9d60 ), - SHC( 0xa154 ), - SHC( 0xa9db ), - SHC( 0x9623 ), - SHC( 0xb80e ), - SHC( 0x8d0e ), - SHC( 0xc7b1 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e18 ), - SHC( 0xe9ff ), - SHC( 0x786e ), - SHC( 0xd4a5 ), - SHC( 0x6f2f ), - SHC( 0xc095 ), - SHC( 0x62a0 ), - SHC( 0xae69 ), - SHC( 0x5321 ), - SHC( 0x9eac ), - SHC( 0x4128 ), - SHC( 0x91d4 ), - SHC( 0x2d3e ), - SHC( 0x8844 ), - SHC( 0x17fc ), - SHC( 0x8245 ), - SHC( 0x0202 ), - SHC( 0x8005 ), - SHC( 0xebfa ), - SHC( 0x8194 ), - SHC( 0xd68a ), - SHC( 0x86e7 ), - SHC( 0xc256 ), - SHC( 0x8fd6 ), - SHC( 0xaff9 ), - SHC( 0x9c1b ), - SHC( 0x9ffd ), - SHC( 0xab5b ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x88fe ), - SHC( 0xd0e2 ), - SHC( 0x82a9 ), - SHC( 0xe60c ), - SHC( 0x8011 ), - SHC( 0xfbfb ), - SHC( 0x8147 ), - SHC( 0x1209 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7d57 ), - SHC( 0xe60c ), - SHC( 0x7578 ), - SHC( 0xcd2b ), - SHC( 0x68b9 ), - SHC( 0xb667 ), - SHC( 0x579f ), - SHC( 0xa2b2 ), - SHC( 0x42e1 ), - SHC( 0x92dd ), - SHC( 0x2b5b ), - SHC( 0x8792 ), - SHC( 0x1209 ), - SHC( 0x8147 ), - SHC( 0xf7f7 ), - SHC( 0x8041 ), - SHC( 0xde3a ), - SHC( 0x848a ), - SHC( 0xc5e4 ), - SHC( 0x8df4 ), - SHC( 0xaff9 ), - SHC( 0x9c1b ), - SHC( 0x9d60 ), - SHC( 0xae69 ), - SHC( 0x8ee1 ), - SHC( 0xc41b ), - SHC( 0x8516 ), - SHC( 0xdc4b ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x8103 ), - SHC( 0x100a ), - SHC( 0x86e7 ), - SHC( 0x2976 ), - SHC( 0x91d4 ), - SHC( 0x4128 ), - SHC( 0xa154 ), - SHC( 0x5625 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7c76 ), - SHC( 0xe21f ), - SHC( 0x720c ), - SHC( 0xc5e4 ), - SHC( 0x6154 ), - SHC( 0xacdf ), - SHC( 0x4b3c ), - SHC( 0x9873 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x1406 ), - SHC( 0x8194 ), - SHC( 0xf5f6 ), - SHC( 0x8066 ), - SHC( 0xd873 ), - SHC( 0x8644 ), - SHC( 0xbd1f ), - SHC( 0x92dd ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x92dd ), - SHC( 0xbd1f ), - SHC( 0x8644 ), - SHC( 0xd873 ), - SHC( 0x8066 ), - SHC( 0xf5f6 ), - SHC( 0x8194 ), - SHC( 0x1406 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9873 ), - SHC( 0x4b3c ), - SHC( 0xacdf ), - SHC( 0x6154 ), - SHC( 0xc5e4 ), - SHC( 0x720c ), - SHC( 0xe21f ), - SHC( 0x7c76 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7b76 ), - SHC( 0xde3a ), - SHC( 0x6e2c ), - SHC( 0xbed8 ), - SHC( 0x5913 ), - SHC( 0xa415 ), - SHC( 0x3daa ), - SHC( 0x8fd6 ), - SHC( 0x1de1 ), - SHC( 0x838a ), - SHC( 0xfbfb ), - SHC( 0x8011 ), - SHC( 0xda5d ), - SHC( 0x85a9 ), - SHC( 0xbb6b ), - SHC( 0x93ee ), - SHC( 0xa154 ), - SHC( 0xa9db ), - SHC( 0x8df4 ), - SHC( 0xc5e4 ), - SHC( 0x82a9 ), - SHC( 0xe60c ), - SHC( 0x8041 ), - SHC( 0x0809 ), - SHC( 0x86e7 ), - SHC( 0x2976 ), - SHC( 0x9623 ), - SHC( 0x47f2 ), - SHC( 0xacdf ), - SHC( 0x6154 ), - SHC( 0xc981 ), - SHC( 0x73d1 ), - SHC( 0xe9ff ), - SHC( 0x7e18 ), - SHC( 0x0c0b ), - SHC( 0x7f6e ), - SHC( 0x2d3e ), - SHC( 0x77bc ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7a57 ), - SHC( 0xda5d ), - SHC( 0x69dd ), - SHC( 0xb80e ), - SHC( 0x5007 ), - SHC( 0x9c1b ), - SHC( 0x2f1e ), - SHC( 0x88fe ), - SHC( 0x0a0a ), - SHC( 0x8066 ), - SHC( 0xe414 ), - SHC( 0x8316 ), - SHC( 0xc095 ), - SHC( 0x90d1 ), - SHC( 0xa2b2 ), - SHC( 0xa861 ), - SHC( 0x8d0e ), - SHC( 0xc7b1 ), - SHC( 0x8194 ), - SHC( 0xebfa ), - SHC( 0x8147 ), - SHC( 0x1209 ), - SHC( 0x8c2f ), - SHC( 0x367f ), - SHC( 0xa154 ), - SHC( 0x5625 ), - SHC( 0xbed8 ), - SHC( 0x6e2c ), - SHC( 0xe21f ), - SHC( 0x7c76 ), - SHC( 0x0809 ), - SHC( 0x7fbf ), - SHC( 0x2d3e ), - SHC( 0x77bc ), - SHC( 0x4e73 ), - SHC( 0x6523 ), - SHC( 0x68b9 ), - SHC( 0x4999 ), -}; - -const Word16 FFT_RotVector_256_fx[448] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7ff6 ), - SHC( 0xfcdc ), - SHC( 0x7fd8 ), - SHC( 0xf9b9 ), - SHC( 0x7fa7 ), - SHC( 0xf696 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7f09 ), - SHC( 0xf055 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7e1d ), - SHC( 0xea1e ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7ce3 ), - SHC( 0xe3f5 ), - SHC( 0x7c29 ), - SHC( 0xe0e7 ), - SHC( 0x7b5d ), - SHC( 0xdddd ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x798a ), - SHC( 0xd7da ), - SHC( 0x7884 ), - SHC( 0xd4e1 ), - SHC( 0x776c ), - SHC( 0xd1ef ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x7504 ), - SHC( 0xcc22 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x7255 ), - SHC( 0xc674 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6f5f ), - SHC( 0xc0e9 ), - SHC( 0x6dca ), - SHC( 0xbe32 ), - SHC( 0x6c24 ), - SHC( 0xbb86 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x68a6 ), - SHC( 0xb64c ), - SHC( 0x66cf ), - SHC( 0xb3c1 ), - SHC( 0x64e8 ), - SHC( 0xb141 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x60ec ), - SHC( 0xac65 ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5cb4 ), - SHC( 0xa7be ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fd8 ), - SHC( 0xf9b9 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7c29 ), - SHC( 0xe0e7 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7884 ), - SHC( 0xd4e1 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6dca ), - SHC( 0xbe32 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x66cf ), - SHC( 0xb3c1 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x55f5 ), - SHC( 0xa129 ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x4c3f ), - SHC( 0x9931 ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x36ba ), - SHC( 0x8c4b ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2b1f ), - SHC( 0x877c ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x12c8 ), - SHC( 0x8163 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0647 ), - SHC( 0x8028 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fa7 ), - SHC( 0xf696 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7ce3 ), - SHC( 0xe3f5 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x776c ), - SHC( 0xd1ef ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x6f5f ), - SHC( 0xc0e9 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x64e8 ), - SHC( 0xb141 ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5842 ), - SHC( 0xa34c ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x49b4 ), - SHC( 0x975a ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x398c ), - SHC( 0x8dab ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2826 ), - SHC( 0x8676 ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0x15e2 ), - SHC( 0x81e3 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0324 ), - SHC( 0x800a ), - SHC( 0xf9b9 ), - SHC( 0x8028 ), - SHC( 0xf055 ), - SHC( 0x80f7 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xdddd ), - SHC( 0x84a3 ), - SHC( 0xd4e1 ), - SHC( 0x877c ), - SHC( 0xcc22 ), - SHC( 0x8afc ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xbb86 ), - SHC( 0x93dc ), - SHC( 0xb3c1 ), - SHC( 0x9931 ), - SHC( 0xac65 ), - SHC( 0x9f14 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f62 ), - SHC( 0xf375 ), - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x3c56 ), - SHC( 0x8f1e ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x2528 ), - SHC( 0x8583 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0xf375 ), - SHC( 0x809e ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xdad8 ), - SHC( 0x8583 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb8e4 ), - SHC( 0x9593 ), - SHC( 0xaecd ), - SHC( 0x9d0e ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9d0e ), - SHC( 0xaecd ), - SHC( 0x9593 ), - SHC( 0xb8e4 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x8583 ), - SHC( 0xdad8 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x809e ), - SHC( 0xf375 ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7f09 ), - SHC( 0xf055 ), - SHC( 0x7c29 ), - SHC( 0xe0e7 ), - SHC( 0x776c ), - SHC( 0xd1ef ), - SHC( 0x70e2 ), - SHC( 0xc3aa ), - SHC( 0x68a6 ), - SHC( 0xb64c ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x539b ), - SHC( 0x9f14 ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x398c ), - SHC( 0x8dab ), - SHC( 0x2b1f ), - SHC( 0x877c ), - SHC( 0x1c0b ), - SHC( 0x831d ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xfcdc ), - SHC( 0x800a ), - SHC( 0xed38 ), - SHC( 0x8163 ), - SHC( 0xdddd ), - SHC( 0x84a3 ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xc0e9 ), - SHC( 0x90a1 ), - SHC( 0xb3c1 ), - SHC( 0x9931 ), - SHC( 0xa7be ), - SHC( 0xa34c ), - SHC( 0x9d0e ), - SHC( 0xaecd ), - SHC( 0x93dc ), - SHC( 0xbb86 ), - SHC( 0x8c4b ), - SHC( 0xc946 ), - SHC( 0x8676 ), - SHC( 0xd7da ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8059 ), - SHC( 0xf696 ), - SHC( 0x8028 ), - SHC( 0x0647 ), - SHC( 0x81e3 ), - SHC( 0x15e2 ), - SHC( 0x8583 ), - SHC( 0x2528 ), - SHC( 0x8afc ), - SHC( 0x33de ), - SHC( 0x9236 ), - SHC( 0x41ce ), - SHC( 0x9b18 ), - SHC( 0x4ebf ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e9d ), - SHC( 0xed38 ), - SHC( 0x7a7d ), - SHC( 0xdad8 ), - SHC( 0x73b5 ), - SHC( 0xc946 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5ed7 ), - SHC( 0xaa0b ), - SHC( 0x5133 ), - SHC( 0x9d0e ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x1f19 ), - SHC( 0x83d7 ), - SHC( 0x0c8b ), - SHC( 0x809e ), - SHC( 0xf9b9 ), - SHC( 0x8028 ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xd4e1 ), - SHC( 0x877c ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb3c1 ), - SHC( 0x9931 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x9931 ), - SHC( 0xb3c1 ), - SHC( 0x8f1e ), - SHC( 0xc3aa ), - SHC( 0x877c ), - SHC( 0xd4e1 ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x8028 ), - SHC( 0xf9b9 ), - SHC( 0x809e ), - SHC( 0x0c8b ), - SHC( 0x83d7 ), - SHC( 0x1f19 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0x9236 ), - SHC( 0x41ce ), - SHC( 0x9d0e ), - SHC( 0x5133 ), - SHC( 0xaa0b ), - SHC( 0x5ed7 ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), - SHC( 0xc946 ), - SHC( 0x73b5 ), - SHC( 0xdad8 ), - SHC( 0x7a7d ), - SHC( 0xed38 ), - SHC( 0x7e9d ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7e1d ), - SHC( 0xea1e ), - SHC( 0x7884 ), - SHC( 0xd4e1 ), - SHC( 0x6f5f ), - SHC( 0xc0e9 ), - SHC( 0x62f2 ), - SHC( 0xaecd ), - SHC( 0x539b ), - SHC( 0x9f14 ), - SHC( 0x41ce ), - SHC( 0x9236 ), - SHC( 0x2e11 ), - SHC( 0x8894 ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x0324 ), - SHC( 0x800a ), - SHC( 0xed38 ), - SHC( 0x8163 ), - SHC( 0xd7da ), - SHC( 0x8676 ), - SHC( 0xc3aa ), - SHC( 0x8f1e ), - SHC( 0xb141 ), - SHC( 0x9b18 ), - SHC( 0xa129 ), - SHC( 0xaa0b ), - SHC( 0x93dc ), - SHC( 0xbb86 ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x831d ), - SHC( 0xe3f5 ), - SHC( 0x8028 ), - SHC( 0xf9b9 ), - SHC( 0x80f7 ), - SHC( 0x0fab ), - SHC( 0x8583 ), - SHC( 0x2528 ), - SHC( 0x8dab ), - SHC( 0x398c ), - SHC( 0x9931 ), - SHC( 0x4c3f ), - SHC( 0xa7be ), - SHC( 0x5cb4 ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), - SHC( 0xcc22 ), - SHC( 0x7504 ), - SHC( 0xe0e7 ), - SHC( 0x7c29 ), - SHC( 0xf696 ), - SHC( 0x7fa7 ), - SHC( 0x0c8b ), - SHC( 0x7f62 ), - SHC( 0x2223 ), - SHC( 0x7b5d ), - SHC( 0x36ba ), - SHC( 0x73b5 ), - SHC( 0x49b4 ), - SHC( 0x68a6 ), -}; - -const Word16 FFT_RotVector_32_fx[40] = { - // Q15 - SHC( 0x7d8a ), - SHC( 0xe708 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x471c ), - SHC( 0x9593 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0x18f8 ), - SHC( 0x8276 ), - SHC( 0x7641 ), - SHC( 0xcf05 ), - SHC( 0x5a82 ), - SHC( 0xa57e ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x89bf ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x89bf ), - SHC( 0xcf05 ), - SHC( 0x6a6d ), - SHC( 0xb8e4 ), - SHC( 0x30fb ), - SHC( 0x89bf ), - SHC( 0xe708 ), - SHC( 0x8276 ), - SHC( 0xa57e ), - SHC( 0xa57e ), - SHC( 0x8276 ), - SHC( 0xe708 ), - SHC( 0x89bf ), - SHC( 0x30fb ), - SHC( 0xb8e4 ), - SHC( 0x6a6d ), -}; - -const Word16 cos_twiddle_table_25_5_5[25] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7bfa ), - SHC( 0x702a ), - SHC( 0x5d4e ), - SHC( 0x4495 ), - SHC( 0x7fff ), - SHC( 0x702a ), - SHC( 0x4495 ), - SHC( 0x0809 ), - SHC( 0xc981 ), - SHC( 0x7fff ), - SHC( 0x5d4e ), - SHC( 0x0809 ), - SHC( 0xae69 ), - SHC( 0x8103 ), - SHC( 0x7fff ), - SHC( 0x4495 ), - SHC( 0xc981 ), - SHC( 0x8103 ), - SHC( 0xae69 ), -}; -const Word16 sin_twiddle_table_25_5_5[25] = { - // Q15 - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0xe02b ), - SHC( 0xc256 ), - SHC( 0xa861 ), - SHC( 0x93ee ), - SHC( 0x0000 ), - SHC( 0xc256 ), - SHC( 0x93ee ), - SHC( 0x8041 ), - SHC( 0x8c2f ), - SHC( 0x0000 ), - SHC( 0xa861 ), - SHC( 0x8041 ), - SHC( 0x9d60 ), - SHC( 0xeff6 ), - SHC( 0x0000 ), - SHC( 0x93ee ), - SHC( 0x8c2f ), - SHC( 0xeff6 ), - SHC( 0x62a0 ), -}; -const Word16 cos_twiddle_table_16_8_2[16] = { - // Q15 - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7fff ), - SHC( 0x7641 ), - SHC( 0x7fff ), - SHC( 0x5a82 ), - SHC( 0x7fff ), - SHC( 0x30fb ), - SHC( 0x7fff ), - SHC( 0x0000 ), - SHC( 0x7fff ), - SHC( 0xcf05 ), - SHC( 0x7fff ), - SHC( 0xa57e ), - SHC( 0x7fff ), - SHC( 0x89bf ), -}; -const Word16 sin_twiddle_table_16_8_2[16] = { - // Q15 - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0x0000 ), - SHC( 0xcf05 ), - SHC( 0x0000 ), - SHC( 0xa57e ), - SHC( 0x0000 ), - SHC( 0x89bf ), - SHC( 0x0000 ), - SHC( 0x8000 ), - SHC( 0x0000 ), - SHC( 0x89bf ), - SHC( 0x0000 ), - SHC( 0xa57e ), - SHC( 0x0000 ), - SHC( 0xcf05 ), -}; - - -/*----------------------------------------------------------------------------------* - * LP analysis windows - *----------------------------------------------------------------------------------*/ - -/* LP analysis window (length of the window is 25 ms which is 320 samples at 12.8kHz (Q15)*/ -const Word16 LP_assym_window_fx[L_LP] = { - 0x0a3d, 0x0a3f, 0x0a45, 0x0a50, 0x0a5f, 0x0a72, 0x0a89, 0x0aa4, - 0x0ac4, 0x0ae8, 0x0b10, 0x0b3c, 0x0b6d, 0x0ba1, 0x0bda, 0x0c17, - 0x0c57, 0x0c9c, 0x0ce5, 0x0d32, 0x0d83, 0x0dd8, 0x0e31, 0x0e8e, - 0x0eef, 0x0f54, 0x0fbd, 0x1029, 0x109a, 0x110e, 0x1185, 0x1201, - 0x1280, 0x1303, 0x1389, 0x1413, 0x14a1, 0x1532, 0x15c6, 0x165e, - 0x16f9, 0x1798, 0x183a, 0x18df, 0x1987, 0x1a32, 0x1ae1, 0x1b92, - 0x1c47, 0x1cfe, 0x1db8, 0x1e75, 0x1f35, 0x1ff8, 0x20bd, 0x2185, - 0x224f, 0x231c, 0x23ec, 0x24bd, 0x2592, 0x2668, 0x2740, 0x281b, - 0x28f8, 0x29d7, 0x2ab8, 0x2b9a, 0x2c7f, 0x2d65, 0x2e4d, 0x2f37, - 0x3022, 0x310f, 0x31fd, 0x32ec, 0x33dd, 0x34cf, 0x35c2, 0x36b7, - 0x37ac, 0x38a3, 0x399a, 0x3a92, 0x3b8b, 0x3c84, 0x3d7e, 0x3e79, - 0x3f74, 0x4070, 0x416c, 0x4268, 0x4364, 0x4461, 0x455d, 0x465a, - 0x4756, 0x4853, 0x494f, 0x4a4a, 0x4b46, 0x4c41, 0x4d3b, 0x4e35, - 0x4f2e, 0x5027, 0x511e, 0x5215, 0x530b, 0x5400, 0x54f4, 0x55e6, - 0x56d8, 0x57c8, 0x58b7, 0x59a4, 0x5a90, 0x5b7b, 0x5c64, 0x5d4b, - 0x5e30, 0x5f14, 0x5ff5, 0x60d5, 0x61b3, 0x628f, 0x6369, 0x6440, - 0x6515, 0x65e8, 0x66b9, 0x6787, 0x6853, 0x691c, 0x69e2, 0x6aa6, - 0x6b68, 0x6c26, 0x6ce2, 0x6d9b, 0x6e50, 0x6f03, 0x6fb3, 0x7060, - 0x710a, 0x71b1, 0x7254, 0x72f4, 0x7391, 0x742b, 0x74c1, 0x7554, - 0x75e3, 0x766f, 0x76f7, 0x777b, 0x77fc, 0x787a, 0x78f3, 0x7969, - 0x79dc, 0x7a4a, 0x7ab5, 0x7b1b, 0x7b7e, 0x7bdd, 0x7c38, 0x7c8f, - 0x7ce2, 0x7d31, 0x7d7c, 0x7dc3, 0x7e06, 0x7e45, 0x7e80, 0x7eb6, - 0x7ee9, 0x7f17, 0x7f41, 0x7f67, 0x7f89, 0x7fa6, 0x7fc0, 0x7fd5, - 0x7fe6, 0x7ff2, 0x7ffb, 0x7fff, 0x7ffe, 0x7ff6, 0x7fe5, 0x7fcb, - 0x7fa8, 0x7f7e, 0x7f4a, 0x7f0e, 0x7eca, 0x7e7d, 0x7e28, 0x7dca, - 0x7d64, 0x7cf6, 0x7c80, 0x7c02, 0x7b7b, 0x7aed, 0x7a57, 0x79b9, - 0x7914, 0x7866, 0x77b2, 0x76f6, 0x7632, 0x7568, 0x7496, 0x73be, - 0x72de, 0x71f8, 0x710c, 0x7019, 0x6f20, 0x6e20, 0x6d1b, 0x6c10, - 0x6aff, 0x69e8, 0x68cd, 0x67ab, 0x6685, 0x655a, 0x642b, 0x62f7, - 0x61be, 0x6081, 0x5f40, 0x5dfc, 0x5cb4, 0x5b68, 0x5a19, 0x58c7, - 0x5772, 0x561b, 0x54c1, 0x5365, 0x5206, 0x50a6, 0x4f44, 0x4de1, - 0x4c7c, 0x4b16, 0x49af, 0x4848, 0x46e0, 0x4578, 0x4410, 0x42a8, - 0x4141, 0x3fda, 0x3e73, 0x3d0e, 0x3baa, 0x3a47, 0x38e6, 0x3787, - 0x3629, 0x34ce, 0x3376, 0x321f, 0x30cc, 0x2f7b, 0x2e2e, 0x2ce4, - 0x2b9e, 0x2a5b, 0x291c, 0x27e2, 0x26ab, 0x2579, 0x244c, 0x2323, - 0x2200, 0x20e1, 0x1fc8, 0x1eb4, 0x1da6, 0x1c9e, 0x1b9c, 0x1a9f, - 0x19a9, 0x18b9, 0x17d0, 0x16ed, 0x1612, 0x153c, 0x146e, 0x13a7, - 0x12e8, 0x122f, 0x117e, 0x10d5, 0x1033, 0x0f99, 0x0f07, 0x0e7d, - 0x0dfa, 0x0d80, 0x0d0e, 0x0ca4, 0x0c42, 0x0be9, 0x0b98, 0x0b4f, - 0x0b0f, 0x0ad8, 0x0aa8, 0x0a82, 0x0a64, 0x0a4e, 0x0a41, 0x0a3d -}; - -/* LP analysis window (length of the window is 25ms which is 400 samples at 16kHz (Q15) */ -const Word16 LP_assym_window_16k_fx[L_LP_16k] = { - 0x0a3d, - 0x0a3e, - 0x0a42, - 0x0a49, - 0x0a53, - 0x0a5f, - 0x0a6e, - 0x0a7f, - 0x0a93, - 0x0aaa, - 0x0ac4, - 0x0ae0, - 0x0aff, - 0x0b21, - 0x0b45, - 0x0b6c, - 0x0b96, - 0x0bc2, - 0x0bf1, - 0x0c23, - 0x0c57, - 0x0c8e, - 0x0cc7, - 0x0d03, - 0x0d41, - 0x0d82, - 0x0dc6, - 0x0e0c, - 0x0e55, - 0x0ea0, - 0x0eee, - 0x0f3e, - 0x0f91, - 0x0fe6, - 0x103e, - 0x1098, - 0x10f4, - 0x1153, - 0x11b4, - 0x1218, - 0x127e, - 0x12e6, - 0x1351, - 0x13be, - 0x142d, - 0x149e, - 0x1512, - 0x1588, - 0x1600, - 0x167a, - 0x16f6, - 0x1774, - 0x17f5, - 0x1878, - 0x18fc, - 0x1983, - 0x1a0c, - 0x1a96, - 0x1b23, - 0x1bb1, - 0x1c42, - 0x1cd4, - 0x1d68, - 0x1dfe, - 0x1e96, - 0x1f30, - 0x1fcb, - 0x2068, - 0x2107, - 0x21a7, - 0x2249, - 0x22ed, - 0x2392, - 0x2439, - 0x24e1, - 0x258b, - 0x2636, - 0x26e2, - 0x2790, - 0x2840, - 0x28f0, - 0x29a2, - 0x2a56, - 0x2b0a, - 0x2bc0, - 0x2c77, - 0x2d2e, - 0x2de7, - 0x2ea2, - 0x2f5d, - 0x3019, - 0x30d6, - 0x3194, - 0x3253, - 0x3313, - 0x33d3, - 0x3495, - 0x3557, - 0x361a, - 0x36dd, - 0x37a2, - 0x3867, - 0x392c, - 0x39f2, - 0x3ab9, - 0x3b80, - 0x3c47, - 0x3d0f, - 0x3dd7, - 0x3ea0, - 0x3f68, - 0x4032, - 0x40fb, - 0x41c4, - 0x428e, - 0x4358, - 0x4422, - 0x44ec, - 0x45b6, - 0x4680, - 0x4749, - 0x4813, - 0x48dd, - 0x49a6, - 0x4a6f, - 0x4b38, - 0x4c01, - 0x4cca, - 0x4d92, - 0x4e59, - 0x4f20, - 0x4fe7, - 0x50ad, - 0x5173, - 0x5238, - 0x52fd, - 0x53c1, - 0x5484, - 0x5547, - 0x5608, - 0x56c9, - 0x578a, - 0x5849, - 0x5908, - 0x59c5, - 0x5a82, - 0x5b3d, - 0x5bf8, - 0x5cb2, - 0x5d6a, - 0x5e21, - 0x5ed8, - 0x5f8d, - 0x6041, - 0x60f3, - 0x61a5, - 0x6255, - 0x6303, - 0x63b0, - 0x645c, - 0x6507, - 0x65b0, - 0x6657, - 0x66fd, - 0x67a2, - 0x6844, - 0x68e6, - 0x6985, - 0x6a23, - 0x6abf, - 0x6b5a, - 0x6bf2, - 0x6c89, - 0x6d1e, - 0x6db2, - 0x6e43, - 0x6ed2, - 0x6f60, - 0x6fec, - 0x7075, - 0x70fd, - 0x7183, - 0x7206, - 0x7288, - 0x7307, - 0x7385, - 0x7400, - 0x7479, - 0x74f0, - 0x7565, - 0x75d7, - 0x7648, - 0x76b6, - 0x7721, - 0x778b, - 0x77f2, - 0x7857, - 0x78b9, - 0x7919, - 0x7977, - 0x79d2, - 0x7a2b, - 0x7a81, - 0x7ad5, - 0x7b27, - 0x7b76, - 0x7bc2, - 0x7c0c, - 0x7c54, - 0x7c98, - 0x7cdb, - 0x7d1b, - 0x7d58, - 0x7d93, - 0x7dcb, - 0x7e00, - 0x7e33, - 0x7e63, - 0x7e91, - 0x7ebc, - 0x7ee4, - 0x7f0a, - 0x7f2d, - 0x7f4d, - 0x7f6b, - 0x7f86, - 0x7f9e, - 0x7fb3, - 0x7fc6, - 0x7fd7, - 0x7fe4, - 0x7fef, - 0x7ff7, - 0x7ffc, - 0x7fff, - 0x7fff, - 0x7ff9, - 0x7fee, - 0x7fde, - 0x7fc8, - 0x7fac, - 0x7f8c, - 0x7f65, - 0x7f39, - 0x7f08, - 0x7ed1, - 0x7e95, - 0x7e54, - 0x7e0d, - 0x7dc1, - 0x7d70, - 0x7d19, - 0x7cbd, - 0x7c5c, - 0x7bf6, - 0x7b8b, - 0x7b1b, - 0x7aa5, - 0x7a2b, - 0x79ab, - 0x7927, - 0x789e, - 0x7810, - 0x777d, - 0x76e6, - 0x764a, - 0x75a9, - 0x7504, - 0x745a, - 0x73ac, - 0x72fa, - 0x7243, - 0x7188, - 0x70c9, - 0x7006, - 0x6f3f, - 0x6e74, - 0x6da5, - 0x6cd2, - 0x6bfc, - 0x6b22, - 0x6a44, - 0x6963, - 0x687f, - 0x6797, - 0x66ac, - 0x65be, - 0x64cd, - 0x63d9, - 0x62e2, - 0x61e8, - 0x60ec, - 0x5fed, - 0x5eeb, - 0x5de7, - 0x5ce1, - 0x5bd8, - 0x5ace, - 0x59c1, - 0x58b3, - 0x57a2, - 0x5690, - 0x557c, - 0x5467, - 0x5350, - 0x5238, - 0x511f, - 0x5005, - 0x4ee9, - 0x4dcd, - 0x4cb0, - 0x4b92, - 0x4a74, - 0x4955, - 0x4836, - 0x4716, - 0x45f6, - 0x44d6, - 0x43b6, - 0x4297, - 0x4177, - 0x4058, - 0x3f39, - 0x3e1b, - 0x3cfe, - 0x3be1, - 0x3ac5, - 0x39aa, - 0x3891, - 0x3778, - 0x3661, - 0x354b, - 0x3436, - 0x3323, - 0x3212, - 0x3102, - 0x2ff5, - 0x2ee9, - 0x2de0, - 0x2cd8, - 0x2bd3, - 0x2ad0, - 0x29d0, - 0x28d2, - 0x27d7, - 0x26df, - 0x25e9, - 0x24f7, - 0x2407, - 0x231a, - 0x2231, - 0x214b, - 0x2068, - 0x1f89, - 0x1ead, - 0x1dd5, - 0x1d00, - 0x1c2f, - 0x1b62, - 0x1a99, - 0x19d4, - 0x1913, - 0x1856, - 0x179d, - 0x16e9, - 0x1638, - 0x158d, - 0x14e5, - 0x1442, - 0x13a4, - 0x130a, - 0x1275, - 0x11e5, - 0x1159, - 0x10d3, - 0x1051, - 0x0fd4, - 0x0f5c, - 0x0ee9, - 0x0e7b, - 0x0e12, - 0x0daf, - 0x0d50, - 0x0cf7, - 0x0ca3, - 0x0c55, - 0x0c0b, - 0x0bc7, - 0x0b88, - 0x0b4f, - 0x0b1b, - 0x0aed, - 0x0ac3, - 0x0aa0, - 0x0a82, - 0x0a69, - 0x0a56, - 0x0a48, - 0x0a40, - 0x0a3d, -}; - -/* 4-bit/3-bit TD SWB BWE differential LSF scalar quantizer tables */ -/*Q15*/ -const Word16 lsf_q_cb_4b_fx[16] = { - 589, 773, 914, 1043, - 1173, 1302, 1430, 1558, - 1698, 1843, 1973, 2103, - 2258, 2470, 2787, 3282 - -}; - -/*Q15*/ -const Word16 lsf_q_cb_3b_fx[8] = { - 679, 976, 1245, 1491, - 1739, 2011, 2365, 2953 -}; - -const Word16 *const lsf_q_cb_fx[NUM_Q_LSF] = { lsf_q_cb_4b_fx, lsf_q_cb_4b_fx, lsf_q_cb_3b_fx, lsf_q_cb_3b_fx, lsf_q_cb_3b_fx }; // Q15 - -/*Q15*/ -const Word16 lsf_grid_fx[4][5] = { - { - 5242, - 10229, - 15516, - 21804, - 27540, - }, - { - 5117, - 10059, - 14949, - 20478, - 25493, - }, - { - 4648, - 8732, - 13022, - 18247, - 24474, - }, - { - 5052, - 8925, - 12903, - 19427, - 28382, - } -}; - -/*Q15*/ -const Word16 grid_smoothing_fx[5] = { 6554, 11469, 16384, 24576, 26214 }; diff --git a/lib_com/rom_com_fx.h b/lib_com/rom_com_fx.h deleted file mode 100644 index 3f35abb9f..000000000 --- a/lib_com/rom_com_fx.h +++ /dev/null @@ -1,120 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -/*==================================================================================== - 3GPP TS26.258 Aug 24, 2023. IVAS Codec Version IVAS-FL-1.0 - ====================================================================================*/ - -/*==================================================================================== - EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 - ====================================================================================*/ - -#ifndef ROM_COM_FX_H -#define ROM_COM_FX_H - -#include "typedef.h" - -/*------------------------------------------------------------------------------* - * FFT transform - *------------------------------------------------------------------------------*/ - -extern const Word16 w_fft64_fx[32]; // Q15 -extern const Word16 w_fft32_fx[16]; // Q15 -extern const Word16 w_fft16_fx[8]; // Q15 -extern const Word16 w_fft8_fx[8]; // Q15 -extern const Word16 w_fft128_fx[64]; // Q15 -extern const Word16 w_fft256_fx[128]; // Q15 -extern const Word16 w_fft512_fx[256]; // Q15 -extern const Word16 w_fft4_fx[2]; // Q15 - -extern const Word16 FFT_RotVector_960_fx[1860]; // Q15 -extern const Word16 FFT_RotVector_640_fx[1240]; // Q15 -extern const Word16 FFT_RotVector_600_fx[1140]; // Q15 -extern const Word16 FFT_RotVector_400_fx[760]; // Q15 -extern const Word16 FFT_RotVector_256_fx[448]; // Q15 -extern const Word16 FFT_RotVector_32_fx[40]; // Q15 - -extern const Word16 sincos_t_rad3_fx[T_SIN_PI_2 + 1]; // Q15 - -extern const Word16 cos_twiddle_table_25_5_5[25]; // Q15 -extern const Word16 sin_twiddle_table_25_5_5[25]; // Q15 -extern const Word16 cos_twiddle_table_16_8_2[16]; // Q15 -extern const Word16 sin_twiddle_table_16_8_2[16]; // Q15 - - -extern const Word32 CLDFB80_10_fx[100]; // Q30 -extern const Word32 CLDFB80_16_fx[160]; // Q30 -extern const Word32 CLDFB80_20_fx[200]; // Q30 -extern const Word32 CLDFB80_30_fx[300]; // Q30 -extern const Word32 CLDFB80_32_fx[320]; // Q30 -extern const Word32 CLDFB80_40_fx[400]; // Q30 -extern const Word32 CLDFB80_60_fx[600]; // Q30 - -/*5ms delay*/ -extern const Word32 LDQMF_10_fx[100]; // Q30 -extern const Word32 LDQMF_16_fx[160]; // Q30 -extern const Word32 LDQMF_20_fx[200]; // Q30 -extern const Word32 LDQMF_30_fx[300]; // Q30 -extern const Word32 LDQMF_32_fx[320]; // Q30 -extern const Word32 LDQMF_40_fx[400]; // Q30 -extern const Word32 LDQMF_60_fx[600]; // Q30 -/* Not used anywhere -extern const Word16 LDQMF_10_enc_fx[100]; -extern const Word16 LDQMF_16_enc_fx[160]; -extern const Word16 LDQMF_20_enc_fx[200]; -extern const Word16 LDQMF_30_enc_fx[300]; -extern const Word16 LDQMF_32_enc_fx[320]; -extern const Word16 LDQMF_40_enc_fx[400]; -extern const Word16 LDQMF_60_enc_fx[600]; -*/ -extern const Word32 rot_vec_delay_re_LDQMF_fx[60]; // Q31 -extern const Word32 rot_vec_delay_im_LDQMF_fx[60]; // Q31 - -extern const Word32 rot_vec_ana_re_L10_fx[5]; // Q29 -extern const Word32 rot_vec_ana_im_L10_fx[5]; // Q29 -extern const Word32 rot_vec_ana_re_L16_fx[8]; // Q29 -extern const Word32 rot_vec_ana_im_L16_fx[8]; // Q29 -extern const Word32 rot_vec_ana_re_L20_fx[10]; // Q29 -extern const Word32 rot_vec_ana_im_L20_fx[10]; // Q29 -extern const Word32 rot_vec_ana_re_L30_fx[15]; // Q29 -extern const Word32 rot_vec_ana_im_L30_fx[15]; // Q29 -extern const Word32 rot_vec_ana_re_L32_fx[16]; // Q29 -extern const Word32 rot_vec_ana_im_L32_fx[16]; // Q29 -extern const Word32 rot_vec_ana_re_L40_fx[20]; // Q29 -extern const Word32 rot_vec_ana_im_L40_fx[20]; // Q29 -extern const Word32 rot_vec_ana_re_L60_fx[30]; // Q29 -extern const Word32 rot_vec_ana_im_L60_fx[30]; // Q29 - -extern const Word16 LP_assym_window_fx[]; /* Assymetric window for LP analysis @12.8kHz (Q15) */ -extern const Word16 LP_assym_window_16k_fx[]; /* Assymetric window for LP analysis @16kHz (Q15) */ - -#endif diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index d789bc70c..68d6f677b 100755 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -2,7 +2,6 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ - #include #include "options.h" #include "cnst.h" /* Common constants */ @@ -10,7 +9,11 @@ #include "prot_fx.h" #include "basop_util.h" #include "ivas_prot_fx.h" -#include "options_warnings.h" + + +/*-----------------------------------------------------------------* + * Local constants + *-----------------------------------------------------------------*/ #define POW_EXC16k_WHTND 1.14e11f /* power of random excitation, length 320 samples, uniform distribution */ #define POW_EXC16k_WHTND_FX_INV_SQRT 6360 // Q31 diff --git a/lib_com/tools.c b/lib_com/tools.c deleted file mode 100644 index 909460c5d..000000000 --- a/lib_com/tools.c +++ /dev/null @@ -1,901 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -/*==================================================================================== - EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 - ====================================================================================*/ - -#include -#include "options.h" -#include -#include "prot_fx.h" -#include "wmc_auto.h" - -/*------------------------------------------------------------------* - * own_random() - * - * Random generator - *------------------------------------------------------------------*/ - -/*! r: output random value */ -Word16 own_random( - Word16 *seed /* i/o: random seed */ -) -{ - *seed = (Word16) ( *seed * 31821L + 13849L ); - - return ( *seed ); -} - -/*--------------------------------------------------------------------- - * norm_ul_float() - * - *---------------------------------------------------------------------*/ - -Word16 norm_ul_float( UWord32 UL_var1 ) -{ - Word16 var_out; - - if ( UL_var1 == 0 ) - { - var_out = 0; - } - else - { - for ( var_out = 0; UL_var1 < (UWord32) 0x80000000U; var_out++ ) - { - UL_var1 <<= 1; - } - } - BASOP_CHECK(); - - return ( var_out ); -} - - -/*--------------------------------------------------------------------- - * sum_s() - * sum_l() - * - *---------------------------------------------------------------------*/ - -/*! r: sum of all vector elements */ -Word16 sum_s( - const Word16 *vec, /* i : input vector */ - const Word16 lvec /* i : length of input vector */ -) -{ - Word16 i; - Word16 tmp; - - tmp = 0; - for ( i = 0; i < lvec; i++ ) - { - tmp += vec[i]; - } - - return tmp; -} - -/*! r: sum of all vector elements */ -Word32 sum_l_fx( - const Word32 *vec, /* i : input vector */ - const Word16 lvec /* i : length of input vector */ -) -{ - Word16 i; - Word32 tmpL; - - tmpL = 0; - move32(); - FOR( i = 0; i < lvec; i++ ) - { - tmpL = L_add( tmpL, vec[i] ); - } - - return tmpL; -} - -/*---------------------------------------------------------------------- - * sum2_f() - * - *---------------------------------------------------------------------*/ - -/*! r: sum of all squared vector elements */ -Word32 sum2_f_16_fx( - const Word16 *vec, /* i : input vector */ - const Word16 lvec /* i : length of input vector */ -) -{ - Word16 i; - Word32 tmp; - - tmp = 0; - move32(); - FOR( i = 0; i < lvec; i++ ) - { - tmp = L_add( tmp, L_mult0( vec[i], vec[i] ) ); - } - - return tmp; -} -Word32 sum2_f_16_gb_fx( - const Word16 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word16 gb ) -{ - Word16 i; - Word32 tmp; - - tmp = 0; - FOR( i = 0; i < lvec; i++ ) - { - tmp = L_add( tmp, L_shr( L_mult0( vec[i], vec[i] ), gb ) ); - } - - return tmp; -} - -Word32 sum2_16_exp_fx( - const Word16 *vec, /* i : input vector Q(15 - exp) */ - const Word16 lvec, /* i : length of input vector */ - Word16 *exp, /* i/o: exponent of vector */ - Word16 gb /* i : guard bits */ -) -{ - Word16 i, s; - Word32 L_tmp, var_a; - - L_tmp = 0; - move32(); - var_a = 0; - move32(); - FOR( i = 0; i < lvec; i++ ) - { - var_a = L_mult0( vec[i], vec[i] ); /* 2 * Q(15 - exp) */ - L_tmp = L_add( L_tmp, L_shr( var_a, gb ) ); /* 2 * Q(15 - exp) - gb */ - } - - s = norm_l( L_tmp ); - L_tmp = L_shl( L_tmp, s ); /* 2 * Q(15 - exp) - gb + s */ - - *exp = add( sub( add( shl( *exp, 1 ), gb ), s ), 1 ); - move16(); - - return L_tmp; -} - -Word32 sum2_32_exp_fx( - const Word32 *vec, /* i : input vector, Qx */ - const Word16 lvec, /* i : length of input vector */ - Word16 *exp, /* i/o: exponent of vector */ - Word16 gb /* i : guard bits */ -) -{ - Word16 i, s, norm; - Word64 W_tmp; - - W_tmp = 0; - Word64 var_a = 0; - move64(); - move64(); - - norm = L_norm_arr( vec, lvec ); - - gb = sub( gb, norm ); - - FOR( i = 0; i < lvec; i++ ) - { - var_a = W_mult0_32_32( vec[i], vec[i] ); // 2x - W_tmp = W_add( W_tmp, W_shr( var_a, gb ) ); // 2x-gb - } - - s = W_norm( W_tmp ); - W_tmp = W_shl( W_tmp, s ); // 2x - gb + s - - //*exp = 31 - (2*(31 - *exp) - gb + s) + 32; - *exp = add( sub( add( shl( *exp, 1 ), gb ), s ), 1 ); - move16(); - - return W_extract_h( W_tmp ); -} - -Word32 sum2_f_32_fx( /* o : Q(2x - 31 - gb) */ - const Word32 *vec, /* i : input vector, Qx */ - const Word16 lvec, /* i : length of input vector */ - Word16 gb /* i : guard bits */ -) -{ - Word16 i; - Word32 tmp; - - tmp = 0; - Word32 var_a = 0; - move32(); - move32(); - FOR( i = 0; i < lvec; i++ ) - { - var_a = Mpy_32_32( vec[i], vec[i] ); // 2x-31 - tmp = L_add( tmp, L_shr( var_a, gb ) ); // 2x-31-gb - } - - return tmp; -} - -Word32 sum2_32_fx( - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word16 *e ) -{ - Word16 i; - Word32 tmp; - - tmp = 0; - Word32 var_a = 0; - Word16 exp = 0, exp_tmp; - move32(); - move32(); - move16(); - FOR( i = 0; i < lvec; i++ ) - { - exp_tmp = norm_l( vec[i] ); - var_a = L_shl( vec[i], exp_tmp ); - var_a = Mpy_32_32( var_a, var_a ); - exp_tmp = shl( sub( *e, exp_tmp ), 1 ); - tmp = BASOP_Util_Add_Mant32Exp( tmp, exp, var_a, exp_tmp, &exp ); - } - *e = exp; - move16(); - - return tmp; -} - -/*-------------------------------------------------------------------* - * set_c() - * set_s() - * set_l() - * set_d() - * - * Set the vector elements to a value - *-------------------------------------------------------------------*/ - -void set_c( - Word8 y[], /* i/o: Vector to set */ - const Word8 a, /* i : Value to set the vector to */ - const Word32 N /* i : Length of the vector */ -) -{ - Word16 i; - - for ( i = 0; i < N; i++ ) - { - y[i] = a; - } - - return; -} - - -void set_s( - Word16 y[], /* i/o: Vector to set */ - const Word16 a, /* i : Value to set the vector to */ - const Word16 N /* i : Length of the vector */ -) -{ - Word16 i; - - for ( i = 0; i < N; i++ ) - { - y[i] = a; - } - - return; -} - - -void set_l( - Word32 y[], /* i/o: Vector to set */ - const Word32 a, /* i : Value to set the vector to */ - const Word16 N /* i : Length of the vector */ -) -{ - Word16 i; - - for ( i = 0; i < N; i++ ) - { - y[i] = a; - } - - return; -} - -/*---------------------------------------------------------------------* - * set_zero() - * - * Set a vector vec[] of dimension lvec to zero - *---------------------------------------------------------------------*/ - -void set_zero( - float *vec, /* o : input vector */ - const Word16 lvec /* i : length of the vector */ -) -{ - Word16 i; - - for ( i = 0; i < lvec; i++ ) - { - *vec++ = 0.0f; - } - - return; -} - - -/*---------------------------------------------------------------------* - * mvr2r() - * mvs2s() - * mvr2d() - * mvd2r() - * - * Transfer the contents of vector x[] to vector y[] - *---------------------------------------------------------------------*/ - -void mvr2r( - const float x[], /* i : input vector */ - float y[], /* o : output vector */ - const Word16 n /* i : vector size */ -) -{ - Word16 i; - - if ( n <= 0 ) - { - /* cannot transfer vectors with size 0 */ - return; - } - - if ( y < x ) - { - for ( i = 0; i < n; i++ ) - { - y[i] = x[i]; - } - } - else - { - for ( i = n - 1; i >= 0; i-- ) - { - y[i] = x[i]; - } - } - - return; -} - -void mvs2s( - const Word16 x[], /* i : input vector */ - Word16 y[], /* o : output vector */ - const Word16 n /* i : vector size */ -) -{ - Word16 i; - - if ( n <= 0 ) - { - /* cannot transfer vectors with size 0 */ - return; - } - - if ( y < x ) - { - for ( i = 0; i < n; i++ ) - { - y[i] = x[i]; - } - } - else - { - for ( i = n - 1; i >= 0; i-- ) - { - y[i] = x[i]; - } - } - - return; -} - -void mvl2l( - const Word32 x[], /* i : input vector */ - Word32 y[], /* o : output vector */ - const Word16 n /* i : vector size */ -) -{ - Word16 i; - - if ( n <= 0 ) - { - /* no need to transfer vectors with size 0 */ - return; - } - - if ( y < x ) - { - for ( i = 0; i < n; i++ ) - { - y[i] = x[i]; - } - } - else - { - for ( i = n - 1; i >= 0; i-- ) - { - y[i] = x[i]; - } - } - - return; -} - -/*! r: index of the maximum value in the input vector */ -Word16 maximum_s( - const Word16 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word16 *max /* o : maximum value in the input vector */ -) -{ - Word16 i, ind; - Word16 tmp; - - ind = 0; - move16(); - tmp = vec[0]; - move16(); - - FOR( i = 1; i < lvec; i++ ) - { - IF( GT_16( vec[i], tmp ) ) - { - ind = i; - move16(); - tmp = vec[i]; - move16(); - } - } - - if ( max != NULL ) - { - *max = tmp; - move16(); - } - - return ind; -} - -/*! r: index of the maximum value in the input vector */ -Word16 maximum_l( - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ -) -{ - Word16 i, ind; - Word32 tmp; - - ind = 0; - tmp = vec[0]; - move16(); - move32(); - FOR( i = 1; i < lvec; i++ ) - { - IF( GT_32( vec[i], tmp ) ) - { - ind = i; - tmp = vec[i]; - move16(); - move32(); - } - } - - if ( max_val != NULL ) - { - *max_val = tmp; - move32(); - } - - return ind; -} - -/*! r: index of the maximum value in the input vector */ -Word16 maximumAbs_l( - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ -) -{ - Word16 j, ind; - Word32 tmp; - - ind = 0; - move16(); - tmp = L_abs( vec[0] ); - - FOR( j = 1; j < lvec; j++ ) - { - IF( GT_32( L_abs( vec[j] ), tmp ) ) - { - ind = j; - move16(); - tmp = L_abs( vec[j] ); - } - } - - IF( max_val != NULL ) - { - *max_val = tmp; - move32(); - } - - return ind; -} - -/*-------------------------------------------------------------------* - * minimum_s() - * - * Finds minimum 16-bit signed integer value in the array and returns it. - *-------------------------------------------------------------------*/ - -/*! r: index of the minimum value in the input vector */ -Word16 minimum_s( - const Word16 *vec, /* i : Input vector */ - const Word16 lvec, /* i : Vector length */ - Word16 *min_val /* o : minimum value in the input vector */ -) -{ - Word16 i, ind; - - ind = 0; - move16(); - - FOR( i = 1; i < lvec; i++ ) - { - if ( LT_16( vec[i], vec[ind] ) ) - { - ind = i; - move16(); - } - } - - if ( min_val != NULL ) - { - *min_val = vec[ind]; - move16(); - } - - return ind; -} - -/*-------------------------------------------------------------------* - * minimum_l() - * - * Finds minimum 16-bit signed integer value in the array and returns it. - *-------------------------------------------------------------------*/ - -/*! r: index of the minimum value in the input vector */ -Word16 minimum_l( - const Word32 *vec, /* i : Input vector */ - const Word16 lvec, /* i : Vector length */ - Word32 *min_val /* o : minimum value in the input vector */ -) -{ - Word16 i, ind; - - ind = 0; - move16(); - - FOR( i = 1; i < lvec; i++ ) - { - if ( LT_32( vec[i], vec[ind] ) ) - { - ind = i; - move16(); - } - } - - if ( min_val != NULL ) - { - *min_val = vec[ind]; - move32(); - } - - return ind; -} - -/*---------------------------------------------------------------------* - * dotp() - * - * Dot product of vector x[] and vector y[] - *---------------------------------------------------------------------*/ - -/*! r: dot product of x[] and y[] */ -Word32 dotp_fixed( - const Word32 x[], /* i : vector x[] Qx */ - const Word32 y[], /* i : vector y[] Qy */ - const Word16 n /* i : vector length */ -) -{ - Word16 i; - Word32 suma; - - suma = Mpy_32_32( x[0], y[0] ); - - FOR( i = 1; i < n; i++ ) - { - suma = L_add( suma, Mpy_32_32( x[i], y[i] ) ); - } - - return suma; -} - -/*To calculate dot product of two 32 bit arrays in case of overflow*/ -Word32 dotp_fixed_o( - const Word32 x[], /* i : vector x[] */ - const Word32 y[], /* i : vector y[] */ - const Word16 n, /* i : vector length */ - const Word16 log_len, /* i : max factor added to result q after dot product (equal to log2(n)) */ - Word16 *res_q /*stores resultant Q*/ -) -{ - Word16 i; - Word64 suma; /*resultant q= q(x)+q(y)-9-x such that q<=31*/ - - suma = W_shr( W_mult_32_32( x[0], y[0] ), log_len ); - - FOR( i = 1; i < n; i++ ) - { - suma = W_add( suma, W_shr( W_mult_32_32( x[i], y[i] ), log_len ) ); - } - *res_q = add( sub( *res_q, log_len ), 1 ); - move16(); - test(); - test(); - FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); ) - { - suma = W_shr( suma, 1 ); - *res_q = sub( *res_q, 1 ); - move16(); - } - return W_extract_l( suma ); -} - -Word32 dotp_fixed_32( - const Word32 x[], /* i : vector x[] */ - const Word32 y[], /* i : vector y[] */ - const Word16 n, /* i : vector length */ - const Word16 log_len, /* i : max factor added to result q after dot product (equal to log2(n)) */ - Word16 *res_q /*stores resultant Q*/ -) -{ - Word16 i; - Word64 suma; /*resultant q= q(x)+q(y)-9-x such that q<=31*/ - - suma = W_shr( W_mult_32_32( x[0], y[0] ), log_len ); - - FOR( i = 1; i < n; i++ ) - { - suma = W_add( suma, W_shr( W_mult_32_32( x[i], y[i] ), log_len ) ); - } - *res_q = add( *res_q, add( sub( *res_q, log_len ), 1 ) ); - move16(); - test(); - test(); - FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); ) - { - suma = W_shr( suma, 1 ); - *res_q = sub( *res_q, 1 ); - move16(); - } - return W_extract_l( suma ); -} - -/*-------------------------------------------------------------------* - * v_add_w64() - * - * Subtraction of two vectors sample by sample - *-------------------------------------------------------------------*/ - -void v_add_w64( - const Word64 x1[], /* i : Input vector 1 */ - const Word64 x2[], /* i : Input vector 2 */ - Word64 y[], /* o : Output vector that contains vector 1 - vector 2 */ - const Word16 N, /* i : Vector length */ - const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = W_add( W_shr( x1[i], hdrm ), W_shr( x2[i], hdrm ) ); - move64(); - } - - return; -} - -/*-------------------------------------------------------------------* - * v_sub_fixed() - * - * Subtraction of two vectors sample by sample - *-------------------------------------------------------------------*/ - -void v_sub_fixed( - const Word32 x1[], /* i : Input vector 1 */ - const Word32 x2[], /* i : Input vector 2 */ - Word32 y[], /* o : Output vector that contains vector 1 - vector 2 */ - const Word16 N, /* i : Vector length */ - const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = L_sub( L_shr( x1[i], hdrm ), L_shr( x2[i], hdrm ) ); - move32(); - } - - return; -} - -void v_sub_fixed_no_hdrm( - const Word32 x1[], /* i : Input vector 1 */ - const Word32 x2[], /* i : Input vector 2 */ - Word32 y[], /* o : Output vector that contains vector 1 - vector 2 */ - const Word16 N /* i : Vector length */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = L_sub( x1[i], x2[i] ); - move32(); - } - - return; -} - -/*-------------------------------------------------------------------* - * v_multc_fixed() - * - * Multiplication of vector by constant - *-------------------------------------------------------------------*/ - -void v_multc_fixed( - const Word32 x[], /* i : Input vector */ - const Word32 c, /* i : Constant */ - Word32 y[], /* o : Output vector that contains c*x */ - const Word16 N /* i : Vector length */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = Mpy_32_32( c, x[i] ); - move32(); - } - - return; -} - -void v_multc_fixed_16( - const Word32 x[], /* i : Input vector */ - const Word16 c, /* i : Constant */ - Word32 y[], /* o : Output vector that contains c*x */ - const Word16 N /* i : Vector length */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = Mpy_32_16_1( x[i], c ); - move32(); - } - - return; -} - -void v_multc_fixed_16_16( - const Word16 x[], /* i : Input vector */ - const Word16 c, /* i : Constant */ - Word16 y[], /* o : Output vector that contains c*x */ - const Word16 N /* i : Vector length */ -) -{ - Word16 i; - - FOR( i = 0; i < N; i++ ) - { - y[i] = mult_r( x[i], c ); - move16(); - } - - return; -} - -/*-------------------------------------------------------------------* - * usdequant() - * - * Uniform scalar de-quantizer routine - * - * Applies de-quantization based on scale and round operations. - *-------------------------------------------------------------------*/ - -float usdequant( - const Word16 idx, /* i : quantizer index */ - const float qlow, /* i : lowest codebook entry (index 0) */ - const float delta /* i : quantization step */ -) -{ - float g; - - g = idx * delta + qlow; - - return ( g ); -} - -void sort( - UWord16 *x, /* i/o: Vector to be sorted */ - UWord16 len /* i/o: vector length */ -) -{ - Word16 i; - UWord16 j, tempr; - - FOR( i = len - 2; i >= 0; i-- ) - { - tempr = x[i]; - move16(); - FOR( j = i + 1; ( j < len ) && ( tempr > x[j] ); j++ ) - { - test(); - x[j - 1] = x[j]; - move16(); - } - x[j - 1] = tempr; - move16(); - } - - return; -} diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 0cfca3883..d7882d5b1 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -52,12 +52,882 @@ #include "prot_fx_enc.h" #include "ivas_prot_fx.h" -#define INV_BANDS10 3277 /* 1/10 in Q15 */ -#define INV_BANDS9 3641 /* 1/9 in Q15 */ -#define INV_BANDS3 10923 /* 1/9 in Q15 */ -const Word16 b_hp400_fx[3] = { 3660, -7320, 3660 }; /* Q12 (/4) */ -const Word16 a_hp400_fx[3] = { 16384, 29280, -14160 }; -const Word16 a_hp400_ivas_fx[3] = { 4096, 7320, -3540 }; /*Q12*/ + +#define INV_BANDS10 3277 /* 1/10 in Q15 */ +#define INV_BANDS9 3641 /* 1/9 in Q15 */ +#define INV_BANDS3 10923 /* 1/9 in Q15 */ +static const Word16 b_hp400_fx[3] = { 3660, -7320, 3660 }; /* Q12 (/4) */ +static const Word16 a_hp400_fx[3] = { 16384, 29280, -14160 }; +static const Word16 a_hp400_ivas_fx[3] = { 4096, 7320, -3540 }; /*Q12*/ + +/*------------------------------------------------------------------* + * own_random() + * + * Random generator + *------------------------------------------------------------------*/ + +/*! r: output random value */ +Word16 own_random( + Word16 *seed /* i/o: random seed */ +) +{ + *seed = (Word16) ( *seed * 31821L + 13849L ); + + return ( *seed ); +} + +/*--------------------------------------------------------------------- + * norm_ul_float() + * + *---------------------------------------------------------------------*/ + +Word16 norm_ul_float( UWord32 UL_var1 ) +{ + Word16 var_out; + + if ( UL_var1 == 0 ) + { + var_out = 0; + } + else + { + for ( var_out = 0; UL_var1 < (UWord32) 0x80000000U; var_out++ ) + { + UL_var1 <<= 1; + } + } + BASOP_CHECK(); + + return ( var_out ); +} + + +/*--------------------------------------------------------------------- + * sum_s() + * sum_l() + * + *---------------------------------------------------------------------*/ + +/*! r: sum of all vector elements */ +Word16 sum_s( + const Word16 *vec, /* i : input vector */ + const Word16 lvec /* i : length of input vector */ +) +{ + Word16 i; + Word16 tmp; + + tmp = 0; + for ( i = 0; i < lvec; i++ ) + { + tmp += vec[i]; + } + + return tmp; +} + +/*! r: sum of all vector elements */ +Word32 sum_l_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec /* i : length of input vector */ +) +{ + Word16 i; + Word32 tmpL; + + tmpL = 0; + move32(); + FOR( i = 0; i < lvec; i++ ) + { + tmpL = L_add( tmpL, vec[i] ); + } + + return tmpL; +} + +/*---------------------------------------------------------------------- + * sum2_f() + * + *---------------------------------------------------------------------*/ + +/*! r: sum of all squared vector elements */ +Word32 sum2_f_16_fx( + const Word16 *vec, /* i : input vector */ + const Word16 lvec /* i : length of input vector */ +) +{ + Word16 i; + Word32 tmp; + + tmp = 0; + move32(); + FOR( i = 0; i < lvec; i++ ) + { + tmp = L_add( tmp, L_mult0( vec[i], vec[i] ) ); + } + + return tmp; +} +Word32 sum2_f_16_gb_fx( + const Word16 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word16 gb ) +{ + Word16 i; + Word32 tmp; + + tmp = 0; + FOR( i = 0; i < lvec; i++ ) + { + tmp = L_add( tmp, L_shr( L_mult0( vec[i], vec[i] ), gb ) ); + } + + return tmp; +} + + +Word32 sum2_16_exp_fx( + const Word16 *vec, /* i : input vector Q(15 - exp) */ + const Word16 lvec, /* i : length of input vector */ + Word16 *exp, /* i/o: exponent of vector */ + Word16 gb /* i : guard bits */ +) +{ + Word16 i, s; + Word32 L_tmp, var_a; + + L_tmp = 0; + move32(); + var_a = 0; + move32(); + FOR( i = 0; i < lvec; i++ ) + { + var_a = L_mult0( vec[i], vec[i] ); /* 2 * Q(15 - exp) */ + L_tmp = L_add( L_tmp, L_shr( var_a, gb ) ); /* 2 * Q(15 - exp) - gb */ + } + + s = norm_l( L_tmp ); + L_tmp = L_shl( L_tmp, s ); /* 2 * Q(15 - exp) - gb + s */ + + *exp = add( sub( add( shl( *exp, 1 ), gb ), s ), 1 ); + move16(); + + return L_tmp; +} + + +Word32 sum2_32_exp_fx( + const Word32 *vec, /* i : input vector, Qx */ + const Word16 lvec, /* i : length of input vector */ + Word16 *exp, /* i/o: exponent of vector */ + Word16 gb /* i : guard bits */ +) +{ + Word16 i, s, norm; + Word64 W_tmp; + + W_tmp = 0; + Word64 var_a = 0; + move64(); + move64(); + + norm = L_norm_arr( vec, lvec ); + + gb = sub( gb, norm ); + + FOR( i = 0; i < lvec; i++ ) + { + var_a = W_mult0_32_32( vec[i], vec[i] ); // 2x + W_tmp = W_add( W_tmp, W_shr( var_a, gb ) ); // 2x-gb + } + + s = W_norm( W_tmp ); + W_tmp = W_shl( W_tmp, s ); // 2x - gb + s + + //*exp = 31 - (2*(31 - *exp) - gb + s) + 32; + *exp = add( sub( add( shl( *exp, 1 ), gb ), s ), 1 ); + move16(); + + return W_extract_h( W_tmp ); +} + + +/* o : Q(2x - 31 - gb) */ +Word32 sum2_f_32_fx( + const Word32 *vec, /* i : input vector, Qx */ + const Word16 lvec, /* i : length of input vector */ + Word16 gb /* i : guard bits */ +) +{ + Word16 i; + Word32 tmp; + + tmp = 0; + Word32 var_a = 0; + move32(); + move32(); + FOR( i = 0; i < lvec; i++ ) + { + var_a = Mpy_32_32( vec[i], vec[i] ); // 2x-31 + tmp = L_add( tmp, L_shr( var_a, gb ) ); // 2x-31-gb + } + + return tmp; +} + +Word32 sum2_32_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word16 *e ) +{ + Word16 i; + Word32 tmp; + + tmp = 0; + Word32 var_a = 0; + Word16 exp = 0, exp_tmp; + move32(); + move32(); + move16(); + FOR( i = 0; i < lvec; i++ ) + { + exp_tmp = norm_l( vec[i] ); + var_a = L_shl( vec[i], exp_tmp ); + var_a = Mpy_32_32( var_a, var_a ); + exp_tmp = shl( sub( *e, exp_tmp ), 1 ); + tmp = BASOP_Util_Add_Mant32Exp( tmp, exp, var_a, exp_tmp, &exp ); + } + *e = exp; + move16(); + + return tmp; +} + + +/*-------------------------------------------------------------------* + * set_c() + * set_s() + * set_l() + * set_d() + * + * Set the vector elements to a value + *-------------------------------------------------------------------*/ + +void set_c( + Word8 y[], /* i/o: Vector to set */ + const Word8 a, /* i : Value to set the vector to */ + const Word32 N /* i : Length of the vector */ +) +{ + Word16 i; + + for ( i = 0; i < N; i++ ) + { + y[i] = a; + } + + return; +} + + +void set_s( + Word16 y[], /* i/o: Vector to set */ + const Word16 a, /* i : Value to set the vector to */ + const Word16 N /* i : Length of the vector */ +) +{ + Word16 i; + + for ( i = 0; i < N; i++ ) + { + y[i] = a; + } + + return; +} + + +void set_l( + Word32 y[], /* i/o: Vector to set */ + const Word32 a, /* i : Value to set the vector to */ + const Word16 N /* i : Length of the vector */ +) +{ + Word16 i; + + for ( i = 0; i < N; i++ ) + { + y[i] = a; + } + + return; +} + +/*---------------------------------------------------------------------* + * set_zero() + * + * Set a vector vec[] of dimension lvec to zero + *---------------------------------------------------------------------*/ + +void set_zero( + float *vec, /* o : input vector */ + const Word16 lvec /* i : length of the vector */ +) +{ + Word16 i; + + for ( i = 0; i < lvec; i++ ) + { + *vec++ = 0.0f; + } + + return; +} + + +/*---------------------------------------------------------------------* + * mvr2r() + * mvs2s() + * mvr2d() + * mvd2r() + * + * Transfer the contents of vector x[] to vector y[] + *---------------------------------------------------------------------*/ + +void mvr2r( + const float x[], /* i : input vector */ + float y[], /* o : output vector */ + const Word16 n /* i : vector size */ +) +{ + Word16 i; + + if ( n <= 0 ) + { + /* cannot transfer vectors with size 0 */ + return; + } + + if ( y < x ) + { + for ( i = 0; i < n; i++ ) + { + y[i] = x[i]; + } + } + else + { + for ( i = n - 1; i >= 0; i-- ) + { + y[i] = x[i]; + } + } + + return; +} + +void mvs2s( + const Word16 x[], /* i : input vector */ + Word16 y[], /* o : output vector */ + const Word16 n /* i : vector size */ +) +{ + Word16 i; + + if ( n <= 0 ) + { + /* cannot transfer vectors with size 0 */ + return; + } + + if ( y < x ) + { + for ( i = 0; i < n; i++ ) + { + y[i] = x[i]; + } + } + else + { + for ( i = n - 1; i >= 0; i-- ) + { + y[i] = x[i]; + } + } + + return; +} + +void mvl2l( + const Word32 x[], /* i : input vector */ + Word32 y[], /* o : output vector */ + const Word16 n /* i : vector size */ +) +{ + Word16 i; + + if ( n <= 0 ) + { + /* no need to transfer vectors with size 0 */ + return; + } + + if ( y < x ) + { + for ( i = 0; i < n; i++ ) + { + y[i] = x[i]; + } + } + else + { + for ( i = n - 1; i >= 0; i-- ) + { + y[i] = x[i]; + } + } + + return; +} + +/*! r: index of the maximum value in the input vector */ +Word16 maximum_s( + const Word16 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word16 *max /* o : maximum value in the input vector */ +) +{ + Word16 i, ind; + Word16 tmp; + + ind = 0; + move16(); + tmp = vec[0]; + move16(); + + FOR( i = 1; i < lvec; i++ ) + { + IF( GT_16( vec[i], tmp ) ) + { + ind = i; + move16(); + tmp = vec[i]; + move16(); + } + } + + if ( max != NULL ) + { + *max = tmp; + move16(); + } + + return ind; +} + +/*! r: index of the maximum value in the input vector */ +Word16 maximum_l( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ +) +{ + Word16 i, ind; + Word32 tmp; + + ind = 0; + tmp = vec[0]; + move16(); + move32(); + FOR( i = 1; i < lvec; i++ ) + { + IF( GT_32( vec[i], tmp ) ) + { + ind = i; + tmp = vec[i]; + move16(); + move32(); + } + } + + if ( max_val != NULL ) + { + *max_val = tmp; + move32(); + } + + return ind; +} + +/*! r: index of the maximum value in the input vector */ +Word16 maximumAbs_l( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ +) +{ + Word16 j, ind; + Word32 tmp; + + ind = 0; + move16(); + tmp = L_abs( vec[0] ); + + FOR( j = 1; j < lvec; j++ ) + { + IF( GT_32( L_abs( vec[j] ), tmp ) ) + { + ind = j; + move16(); + tmp = L_abs( vec[j] ); + } + } + + IF( max_val != NULL ) + { + *max_val = tmp; + move32(); + } + + return ind; +} + +/*-------------------------------------------------------------------* + * minimum_s() + * + * Finds minimum 16-bit signed integer value in the array and returns it. + *-------------------------------------------------------------------*/ + +/*! r: index of the minimum value in the input vector */ +Word16 minimum_s( + const Word16 *vec, /* i : Input vector */ + const Word16 lvec, /* i : Vector length */ + Word16 *min_val /* o : minimum value in the input vector */ +) +{ + Word16 i, ind; + + ind = 0; + move16(); + + FOR( i = 1; i < lvec; i++ ) + { + if ( LT_16( vec[i], vec[ind] ) ) + { + ind = i; + move16(); + } + } + + if ( min_val != NULL ) + { + *min_val = vec[ind]; + move16(); + } + + return ind; +} + +/*-------------------------------------------------------------------* + * minimum_l() + * + * Finds minimum 16-bit signed integer value in the array and returns it. + *-------------------------------------------------------------------*/ + +/*! r: index of the minimum value in the input vector */ +Word16 minimum_l( + const Word32 *vec, /* i : Input vector */ + const Word16 lvec, /* i : Vector length */ + Word32 *min_val /* o : minimum value in the input vector */ +) +{ + Word16 i, ind; + + ind = 0; + move16(); + + FOR( i = 1; i < lvec; i++ ) + { + if ( LT_32( vec[i], vec[ind] ) ) + { + ind = i; + move16(); + } + } + + if ( min_val != NULL ) + { + *min_val = vec[ind]; + move32(); + } + + return ind; +} + +/*---------------------------------------------------------------------* + * dotp() + * + * Dot product of vector x[] and vector y[] + *---------------------------------------------------------------------*/ + +/*! r: dot product of x[] and y[] */ +Word32 dotp_fixed( + const Word32 x[], /* i : vector x[] Qx */ + const Word32 y[], /* i : vector y[] Qy */ + const Word16 n /* i : vector length */ +) +{ + Word16 i; + Word32 suma; + + suma = Mpy_32_32( x[0], y[0] ); + + FOR( i = 1; i < n; i++ ) + { + suma = L_add( suma, Mpy_32_32( x[i], y[i] ) ); + } + + return suma; +} + +/*To calculate dot product of two 32 bit arrays in case of overflow*/ +Word32 dotp_fixed_o( + const Word32 x[], /* i : vector x[] */ + const Word32 y[], /* i : vector y[] */ + const Word16 n, /* i : vector length */ + const Word16 log_len, /* i : max factor added to result q after dot product (equal to log2(n)) */ + Word16 *res_q /*stores resultant Q*/ +) +{ + Word16 i; + Word64 suma; /*resultant q= q(x)+q(y)-9-x such that q<=31*/ + + suma = W_shr( W_mult_32_32( x[0], y[0] ), log_len ); + + FOR( i = 1; i < n; i++ ) + { + suma = W_add( suma, W_shr( W_mult_32_32( x[i], y[i] ), log_len ) ); + } + *res_q = add( sub( *res_q, log_len ), 1 ); + move16(); + test(); + test(); + FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); ) + { + suma = W_shr( suma, 1 ); + *res_q = sub( *res_q, 1 ); + move16(); + } + + return W_extract_l( suma ); +} + + +Word32 dotp_fixed_32( + const Word32 x[], /* i : vector x[] */ + const Word32 y[], /* i : vector y[] */ + const Word16 n, /* i : vector length */ + const Word16 log_len, /* i : max factor added to result q after dot product (equal to log2(n)) */ + Word16 *res_q /*stores resultant Q*/ +) +{ + Word16 i; + Word64 suma; /*resultant q= q(x)+q(y)-9-x such that q<=31*/ + + suma = W_shr( W_mult_32_32( x[0], y[0] ), log_len ); + + FOR( i = 1; i < n; i++ ) + { + suma = W_add( suma, W_shr( W_mult_32_32( x[i], y[i] ), log_len ) ); + } + *res_q = add( *res_q, add( sub( *res_q, log_len ), 1 ) ); + move16(); + test(); + test(); + FOR( ; ( suma > MAX_32 ) || ( suma < MIN_32 ) || ( *res_q > 31 ); ) + { + suma = W_shr( suma, 1 ); + *res_q = sub( *res_q, 1 ); + move16(); + } + return W_extract_l( suma ); +} + + +/*-------------------------------------------------------------------* + * v_add_w64() + * + * Subtraction of two vectors sample by sample + *-------------------------------------------------------------------*/ + +void v_add_w64( + const Word64 x1[], /* i : Input vector 1 */ + const Word64 x2[], /* i : Input vector 2 */ + Word64 y[], /* o : Output vector that contains vector 1 - vector 2 */ + const Word16 N, /* i : Vector length */ + const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = W_add( W_shr( x1[i], hdrm ), W_shr( x2[i], hdrm ) ); + move64(); + } + + return; +} + + +/*-------------------------------------------------------------------* + * v_sub_fixed() + * + * Subtraction of two vectors sample by sample + *-------------------------------------------------------------------*/ + +void v_sub_fixed( + const Word32 x1[], /* i : Input vector 1 */ + const Word32 x2[], /* i : Input vector 2 */ + Word32 y[], /* o : Output vector that contains vector 1 - vector 2 */ + const Word16 N, /* i : Vector length */ + const Word16 hdrm /* i : headroom for when subtraction result > 1 or < -1 */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = L_sub( L_shr( x1[i], hdrm ), L_shr( x2[i], hdrm ) ); + move32(); + } + + return; +} + +void v_sub_fixed_no_hdrm( + const Word32 x1[], /* i : Input vector 1 */ + const Word32 x2[], /* i : Input vector 2 */ + Word32 y[], /* o : Output vector that contains vector 1 - vector 2 */ + const Word16 N /* i : Vector length */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = L_sub( x1[i], x2[i] ); + move32(); + } + + return; +} + +/*-------------------------------------------------------------------* + * v_multc_fixed() + * + * Multiplication of vector by constant + *-------------------------------------------------------------------*/ + +void v_multc_fixed( + const Word32 x[], /* i : Input vector */ + const Word32 c, /* i : Constant */ + Word32 y[], /* o : Output vector that contains c*x */ + const Word16 N /* i : Vector length */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = Mpy_32_32( c, x[i] ); + move32(); + } + + return; +} + +void v_multc_fixed_16( + const Word32 x[], /* i : Input vector */ + const Word16 c, /* i : Constant */ + Word32 y[], /* o : Output vector that contains c*x */ + const Word16 N /* i : Vector length */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = Mpy_32_16_1( x[i], c ); + move32(); + } + + return; +} + +void v_multc_fixed_16_16( + const Word16 x[], /* i : Input vector */ + const Word16 c, /* i : Constant */ + Word16 y[], /* o : Output vector that contains c*x */ + const Word16 N /* i : Vector length */ +) +{ + Word16 i; + + FOR( i = 0; i < N; i++ ) + { + y[i] = mult_r( x[i], c ); + move16(); + } + + return; +} + +/*-------------------------------------------------------------------* + * usdequant() + * + * Uniform scalar de-quantizer routine + * + * Applies de-quantization based on scale and round operations. + *-------------------------------------------------------------------*/ + +float usdequant( + const Word16 idx, /* i : quantizer index */ + const float qlow, /* i : lowest codebook entry (index 0) */ + const float delta /* i : quantization step */ +) +{ + float g; + + g = idx * delta + qlow; + + return ( g ); +} + +void sort( + UWord16 *x, /* i/o: Vector to be sorted */ + UWord16 len /* i/o: vector length */ +) +{ + Word16 i; + UWord16 j, tempr; + + FOR( i = len - 2; i >= 0; i-- ) + { + tempr = x[i]; + move16(); + FOR( j = i + 1; ( j < len ) && ( tempr > x[j] ); j++ ) + { + test(); + x[j - 1] = x[j]; + move16(); + } + x[j - 1] = tempr; + move16(); + } + + return; +} #define WMC_TOOL_SKIP @@ -78,14 +948,18 @@ Word32 float_to_fix( float number, Word32 Q ) return ret; } -float fix_to_float( Word32 number, Word32 Q ) +float fix_to_float( + Word32 number, + Word32 Q ) { assert( Q >= 0 ); float ret = (float) number / ( (UWord32) 1 << Q ); return ret; } -Word16 float_to_fix16( float number, Word16 Q ) +Word16 float_to_fix16( + float number, + Word16 Q ) { assert( Q >= 0 ); IF( isnan( number ) ) @@ -241,6 +1115,7 @@ void fix2f_16( Word16 *var_fix, float *var_flt, Word32 expo ) #undef WMC_TOOL_SKIP + /*-------------------------------------------------------------------* * usdequant_fx() * @@ -248,10 +1123,12 @@ void fix2f_16( Word16 *var_fix, float *var_flt, Word32 expo ) * * Applies de-quantization based on scale and round operations. *-------------------------------------------------------------------*/ -Word16 usdequant_fx( /* Qx*/ - const Word16 idx, /* i: quantizer index Q0*/ - const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word16 delta /* i: quantization step Qx-1*/ + +/* Qx*/ +Word16 usdequant_fx( + const Word16 idx, /* i: quantizer index Q0*/ + const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word16 delta /* i: quantization step Qx-1*/ ) { Word16 g; @@ -264,10 +1141,11 @@ Word16 usdequant_fx( /* Qx*/ return ( g ); } -Word32 usdequant32_fx( /* Qx*/ - const Word16 idx, /* i: quantizer index Q0*/ - const Word32 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word32 delta /* i: quantization step Qx-1*/ +/* Qx*/ +Word32 usdequant32_fx( + const Word16 idx, /* i: quantizer index Q0*/ + const Word32 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word32 delta /* i: quantization step Qx-1*/ ) { Word32 g; @@ -288,6 +1166,7 @@ Word32 usdequant32_fx( /* Qx*/ return ( g ); } + /*-------------------------------------------------------------------* * usquant() * @@ -297,12 +1176,14 @@ Word32 usdequant32_fx( /* Qx*/ * Applies quantization based on scale and round operations. * Index of the winning codeword and the winning codeword itself are returned. *-------------------------------------------------------------------*/ -Word16 usquant_fx( /* o: index of the winning codeword */ - const Word16 x, /* i: scalar value to quantize Qx*/ - Word16 *xq, /* o: quantized value Qx*/ - const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word16 delta, /* i: quantization step Qx-1*/ - const Word16 cbsize /* i: codebook size */ + +/* o: index of the winning codeword */ +Word16 usquant_fx( + const Word16 x, /* i: scalar value to quantize Qx*/ + Word16 *xq, /* o: quantized value Qx*/ + const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word16 delta, /* i: quantization step Qx-1*/ + const Word16 cbsize /* i: codebook size */ ) { Word16 idx; @@ -339,16 +1220,19 @@ Word16 usquant_fx( /* o: index of the winning codeword */ #endif return idx; } + + /*-------------------------------------------------------------------* * Dot_product: * * Compute scalar product of using accumulator. * Performs no normalization, as opposed to Dot_product12() *-------------------------------------------------------------------*/ -Word32 Dot_product( /* o : Sum */ - const Word16 x[], /* i : 12bits: x vector */ - const Word16 y[], /* i : 12bits: y vector */ - const Word16 lg /* i : vector length */ +/* o : Sum */ +Word32 Dot_product( + const Word16 x[], /* i : 12bits: x vector */ + const Word16 y[], /* i : 12bits: y vector */ + const Word16 lg /* i : vector length */ ) { Word16 i; @@ -362,19 +1246,23 @@ Word32 Dot_product( /* o : Sum */ L64_sum = W_mac_16_16( L64_sum, x[i], y[i] ); } L_sum = W_sat_l( L64_sum ); + return L_sum; } + + /*---------------------------------------------------------------------* * dotp_fx() * * Dot product of vector x[] and vector y[] *---------------------------------------------------------------------*/ -Word32 dotp_fx( /* o : dot product of x[] and y[] */ - const Word16 x[], /* i : vector x[] */ - const Word16 y[], /* i : vector y[] */ - const Word16 n, /* i : vector length */ - Word16 *exp /* (o) : exponent of result (0..+30) */ +/* o : dot product of x[] and y[] */ +Word32 dotp_fx( + const Word16 x[], /* i : vector x[] */ + const Word16 y[], /* i : vector y[] */ + const Word16 n, /* i : vector length */ + Word16 *exp /* o : exponent of result (0..+30) */ ) { Word16 sft; @@ -395,9 +1283,10 @@ Word32 dotp_fx( /* o : dot product of x[] and y[] */ return L_sum; } -Word32 sum2_fx( /* o : sum of all squared vector elements Q(2x+1)*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all squared vector elements Q(2x+1)*/ +Word32 sum2_fx( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -421,9 +1310,11 @@ Word32 sum2_fx( /* o : sum of all squared vector elements return L_tmp; } -Word64 sum2_fx_no_sat( /* o : sum of all squared vector elements Q(2*Qx)*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ + +/* o : sum of all squared vector elements Q(2*Qx)*/ +Word64 sum2_fx_no_sat( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -462,9 +1353,10 @@ Word32 sum_32_fx( return ans; } -Word32 sum2_fx_mod( /* o : sum of all squared vector elements Q(2x+1 -5)*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all squared vector elements Q(2x+1 -5)*/ +Word32 sum2_fx_mod( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -488,12 +1380,15 @@ Word32 sum2_fx_mod( /* o : sum of all squared vector element return L_tmp; } + + /*-------------------------------------------------------------------* * Copy: * * Copy vector x[] to y[] * *-------------------------------------------------------------------*/ + void Copy( const Word16 x[], /* i : input vector */ Word16 y[], /* o : output vector */ @@ -522,11 +1417,14 @@ void Copy( return; } + + /*-------------------------------------------------------------------* * Copy64: * * Copy vector x[] to y[] (64 bits) *-------------------------------------------------------------------*/ + void Copy64( const Word64 x[], /* i : input vector */ Word64 y[], /* o : output vector */ @@ -650,12 +1548,14 @@ void set8_fx( return; } + /*-------------------------------------------------------------------* * set16_fx() * set32_fx() * * Set the vector elements to a value *-------------------------------------------------------------------*/ + void set16_fx( Word16 y[], /* i/o: Vector to set */ const Word16 a, /* i : Value to set the vector to */ @@ -689,11 +1589,14 @@ void set32_fx( return; } + + /*-------------------------------------------------------------------* * Copy_Scale_sig * * Up/down scale a 16 bits vector x and move it into y *-------------------------------------------------------------------*/ + void Copy_Scale_sig( const Word16 x[], /* i : signal to scale input Qx */ Word16 y[], /* o : scaled signal output Qx */ @@ -737,12 +1640,17 @@ void Copy_Scale_sig( #endif move16(); /* saturation can occur here */ } + + return; } + + /*-------------------------------------------------------------------* * Copy_Scale_sig * * Up/down scale a 16 bits vector x and move it into y *-------------------------------------------------------------------*/ + void Copy_Scale_sig_16_32_DEPREC( const Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ @@ -801,8 +1709,11 @@ void Copy_Scale_sig_16_32_DEPREC( y[i] = L_mult0( x[i], tmp ); move32(); /* saturation can occur here */ } + + return; } + void Copy_Scale_sig_16_32_no_sat( const Word16 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ @@ -868,8 +1779,11 @@ void Copy_Scale_sig_16_32_no_sat( move32(); } } + + return; } + void Copy_Scale_sig_32_16( const Word32 x[], /* i : signal to scale input Qx */ Word16 y[], /* o : scaled signal output Qx */ @@ -911,13 +1825,17 @@ void Copy_Scale_sig_32_16( move16(); } } + + return; } + /*-------------------------------------------------------------------* * Scale_sig32 * * Up/down scale a 32 bits vector *-------------------------------------------------------------------*/ + void Scale_sig32( Word32 x[], /* i/o: signal to scale Qx */ const Word16 lg, /* i : size of x[] Q0 */ @@ -945,8 +1863,11 @@ void Scale_sig32( #endif move32(); /* saturation can occur here */ } + + return; } + /*------------------------------------------------------------------* * function Random_Fill * @@ -954,6 +1875,7 @@ void Scale_sig32( * (Avoids Store of Seed to Memory for 'n' Random Values and * Combines Scaling Operation.) *------------------------------------------------------------------*/ + void Random_Fill( Word16 *seed, /* i/o: random seed */ Word16 n, /* i : number of values */ @@ -974,11 +1896,16 @@ void Random_Fill( } *seed = local_seed; move16(); + + return; } + + /*-------------------------------------------------------------------* * Scale_sig * Up/down scale a 16 bits vector *-------------------------------------------------------------------*/ + void Scale_sig( Word16 x[], /* i/o: signal to scale Qx */ const Word16 lg, /* i : size of x[] Q0 */ @@ -1009,10 +1936,12 @@ void Scale_sig( } } + /*-------------------------------------------------------------------* * scale_sig * Up/down scale a 16 bits vector *-------------------------------------------------------------------*/ + void scale_sig( Word16 x[], /* i/o: signal to scale Qx */ const Word16 lg, /* i : size of x[] Q0 */ @@ -1035,9 +1964,11 @@ void scale_sig( * mean_fx() * *---------------------------------------------------------------------*/ -Word16 mean_fx( /* o : mean of vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 lvec_fx /* i : length of input vector */ + +/* o : mean of vector */ +Word16 mean_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 lvec_fx /* i : length of input vector */ ) { Word16 tmp; @@ -1048,9 +1979,10 @@ Word16 mean_fx( /* o : mean of vector return tmp; } -Word16 mean_no_sat_fx( /* o : mean of vector Qx */ - const Word16 *vec_fx, /* i : input vector Qx */ - const Word16 lvec_fx /* i : length of input vector */ +/* o : mean of vector Qx */ +Word16 mean_no_sat_fx( + const Word16 *vec_fx, /* i : input vector Qx */ + const Word16 lvec_fx /* i : length of input vector */ ) { Word16 i; @@ -1064,10 +1996,12 @@ Word16 mean_no_sat_fx( /* o : mean of vector Qx * return extract_l( L_tmp ); } -Word32 mean_no_sat_Word32_fx( /* o : mean of vector Qx */ - const Word32 *vec_fx, /* i : input vector Qx */ - const Word16 lvec_fx, /* i : length of input vector */ - const Word16 gb ) + +/* o : mean of vector Qx */ +Word32 mean_no_sat_Word32_fx( + const Word32 *vec_fx, /* i : input vector Qx */ + const Word16 lvec_fx, /* i : length of input vector */ + const Word16 gb ) { Word16 i; Word32 L_tmp = 0; @@ -1080,11 +2014,14 @@ Word32 mean_no_sat_Word32_fx( /* o : mean of vector return L_tmp; } + + /*-------------------------------------------------------------------* * Vr_add * * Add two Word16 vectors together integer by integer *-------------------------------------------------------------------*/ + void Vr_add( const Word16 *in1, /* i : Input vector 1 */ const Word16 *in2, /* i : Input vector 2 */ @@ -1129,6 +2066,8 @@ void sort_fx( r[j - 1] = tempr; move16(); } + + return; } void sort_32_fx( @@ -1160,10 +2099,11 @@ void sort_32_fx( return; } -Word16 minimum_fx( /* o : index of the minimum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word16 *min_fx /* o : minimum value in the input vector */ +/* o : index of the minimum value in the input vector */ +Word16 minimum_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word16 *min_fx /* o : minimum value in the input vector */ ) { Word16 j, ind; @@ -1190,10 +2130,11 @@ Word16 minimum_fx( /* o : index of the minimum value in t return ind; } -Word16 maximum_fx( /* o : index of the maximum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word16 *max_fx /* o : maximum value in the input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word16 *max_fx /* o : maximum value in the input vector */ ) { Word16 j, ind; @@ -1218,10 +2159,11 @@ Word16 maximum_fx( /* o : index of the maximum value in t return ind; } -Word16 maximum_exp_fx( /* o : index of the maximum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 *exp_vec, /* i : exponents of input vector */ - const Word16 lvec_fx /* i : length of input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_exp_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 *exp_vec, /* i : exponents of input vector */ + const Word16 lvec_fx /* i : length of input vector */ ) { Word16 j, ind; @@ -1249,16 +2191,18 @@ Word16 maximum_exp_fx( /* o : index of the maximum value return ind; } + /*---------------------------------------------------------------------* * maximum_abs_16_fx() * * Find index and value of the absolute maximum in a vector *---------------------------------------------------------------------*/ -Word16 maximum_abs_16_fx( /* o : index of the maximum abs value in the input vector */ - const Word16 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word16 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum abs value in the input vector */ +Word16 maximum_abs_16_fx( + const Word16 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word16 *max_val /* o : maximum value in the input vector */ ) { Word16 j, ind; @@ -1287,10 +2231,12 @@ Word16 maximum_abs_16_fx( /* o : index of the maximum abs va * * Find index and value of the absolute minimum in a vector *---------------------------------------------------------------------*/ -Word16 minimum_abs32_fx( /* o : index of the minimum value in the input vector */ - const Word32 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word32 *min_fx /* o : minimum value in the input vector */ + +/* o : index of the minimum value in the input vector */ +Word16 minimum_abs32_fx( + const Word32 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word32 *min_fx /* o : minimum value in the input vector */ ) { Word16 j, ind; @@ -1317,16 +2263,18 @@ Word16 minimum_abs32_fx( /* o : index of the minimum valu return ind; } + /*---------------------------------------------------------------------* * minimum_32_fx() * * Find index and value of the minimum in a vector *---------------------------------------------------------------------*/ -Word16 minimum_32_fx( /* o : index of the minimum value in the input vector */ - const Word32 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word32 *min_fx /* o : minimum value in the input vector */ +/* o : index of the minimum value in the input vector */ +Word16 minimum_32_fx( + const Word32 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word32 *min_fx /* o : minimum value in the input vector */ ) { Word16 j, ind; @@ -1355,16 +2303,18 @@ Word16 minimum_32_fx( /* o : index of the minimum value i return ind; } + /*---------------------------------------------------------------------* * maximum_32_fx() * * Find index and value of the maximum in a vector *---------------------------------------------------------------------*/ -Word16 maximum_32_fx( /* o : index of the maximum value in the input vector */ - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_32_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ ) { Word16 j, ind; @@ -1392,10 +2342,11 @@ Word16 maximum_32_fx( /* o : index of the maximum value in t return ind; } -Word16 maximum_abs_32_fx( /* o : index of the maximum abs value in the input vector */ - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum abs value in the input vector */ +Word16 maximum_abs_32_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ ) { Word16 j, ind; @@ -1426,6 +2377,7 @@ Word16 maximum_abs_32_fx( /* o : index of the maximum abs va *Return value *Number of shifts *----------------------------------------------------------------*/ + Word16 Exp16Array( const Word16 n, /* (i): Array size */ const Word16 *sx /* (i): Data array */ @@ -1475,9 +2427,10 @@ Word16 Exp32Array( return exp; } -Word32 sum16_32_fx( /* o : sum of all vector elements Qx*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : index of the maximum abs value in the input vector */ +Word32 sum16_32_fx( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -1493,9 +2446,11 @@ Word32 sum16_32_fx( /* o : sum of all vector elements return tmp; } -Word32 sum32_sat( /* o : sum of all vector elements Qx*/ - const Word32 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ + +/* o : sum of all vector elements Qx*/ +Word32 sum32_sat( + const Word32 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -1510,10 +2465,11 @@ Word32 sum32_sat( /* o : sum of all vector elements return tmp; } -Word32 var_fx_32( /* o: variance of vector Qx+16*/ - const Word16 *x, /* i: input vector Qx*/ - const Word16 Qx, - const Word16 len /* i: length of inputvector */ +/* o: variance of vector Qx+16*/ +Word32 var_fx_32( + const Word16 *x, /* i: input vector Qx*/ + const Word16 Qx, + const Word16 len /* i: length of inputvector */ ) { Word16 m; @@ -1522,7 +2478,6 @@ Word32 var_fx_32( /* o: variance of vector Q Word16 tmp, exp, inv_len; Word32 L_tmp; - L_tmp = L_add( x[0], 0 ); FOR( i = 1; i < len; i++ ) { @@ -1545,11 +2500,12 @@ Word32 var_fx_32( /* o: variance of vector Q return v; } -Word32 var_fx_32in_32out( /* o: variance of vector Qx*/ - const Word32 *x, /* i: input vector Qx*/ - Word16 *Qx, /*i/o:Q for input/output */ - const Word16 len, /* i: length of inputvector */ - const Word16 gb ) +/* o: variance of vector Qx*/ +Word32 var_fx_32in_32out( + const Word32 *x, /* i: input vector Qx*/ + Word16 *Qx, /*i/o:Q for input/output */ + const Word16 len, /* i: length of inputvector */ + const Word16 gb ) { Word16 i; Word16 shift; @@ -1568,8 +2524,11 @@ Word32 var_fx_32in_32out( /* o: variance of vector *Qx = sub( add( shl( sub( *Qx, gb ), 1 ), shift ), 32 ); move16(); + return L_tmp; } + + /*-------------------------------------------------------------------* * conv() * @@ -1604,9 +2563,11 @@ Flag conv_fx( y[n] = mac_ro( L_sum, x[i], h[0], &Overflow ); move16(); } + return Overflow; } + /*-------------------------------------------------------------------* * conv_fx_32() * @@ -1614,6 +2575,7 @@ Flag conv_fx( * All vectors are of length L. Only the first L samples of the * convolution are considered. *-------------------------------------------------------------------*/ + Flag conv_fx_32( const Word16 x[], /* i : input vector Q_new*/ const Word16 h[], /* i : impulse response (or second input vector) Q(15)*/ @@ -1621,7 +2583,6 @@ Flag conv_fx_32( const Word16 L /* i : vector size */ ) { - Word16 i, n; Word32 L_sum; Flag Overflow = 0; @@ -1637,12 +2598,15 @@ Flag conv_fx_32( y[n] = L_mac_o( L_sum, x[i], h[0], &Overflow ); move32(); } + return Overflow; } -Word16 var_fx( /* o: variance of vector Qx*/ - const Word16 *x, /* i: input vector Qx*/ - const Word16 Qx, - const Word16 len /* i: length of inputvector */ + +/* o: variance of vector Qx*/ +Word16 var_fx( + const Word16 *x, /* i: input vector Qx*/ + const Word16 Qx, + const Word16 len /* i: length of inputvector */ ) { Word16 m; @@ -1675,15 +2639,17 @@ Word16 var_fx( /* o: variance of vector Qx*/ return v_16; } + /*---------------------------------------------------------------------* * std_fx() * * Calculate the standard deviation of a vector *---------------------------------------------------------------------*/ -Word16 std_fx( /* o: standard deviation */ - const Word16 x[], /* i: input vector */ - const Word16 len /* i: length of the input vector */ +/* o: standard deviation */ +Word16 std_fx( + const Word16 x[], /* i: input vector */ + const Word16 len /* i: length of the input vector */ ) { Word16 i; @@ -1710,14 +2676,14 @@ Word16 std_fx( /* o: standard deviation */ stdev = L_shl( stdev, sub( exp1, 1 ) ); /*30 */ } - return extract_h( stdev ); } -Word32 dot_product_mat_fx( /* o : the dot product x'*A*x */ - const Word16 *x, /* i : vector x Q15 */ - const Word32 *A, /* i : matrix A Q0*/ - const Word16 m /* i : vector & matrix size */ +/* o : the dot product x'*A*x */ +Word32 dot_product_mat_fx( + const Word16 *x, /* i : vector x Q15 */ + const Word32 *A, /* i : matrix A Q0*/ + const Word16 m /* i : vector & matrix size */ ) { @@ -1744,13 +2710,17 @@ Word32 dot_product_mat_fx( /* o : the dot product x'*A*x tmp_sum = W_sat_m( tmp_sum_64 ); suma = Madd_32_16( suma, tmp_sum, x[i] ); /*Q0 */ } + return suma; } + + /*-------------------------------------------------------------------* * Vr_subt * * Subtract two Word16 vectors integer by integer *-------------------------------------------------------------------*/ + void Vr_subt( const Word16 x1[], /* i : Input vector 1 */ const Word16 x2[], /* i : Input vector 2 */ @@ -1765,7 +2735,11 @@ void Vr_subt( y[i] = sub_sat( x1[i], x2[i] ); move16(); } + + return; } + + /*-------------------------------------------------------------------* * vquant() * @@ -1774,13 +2748,15 @@ void Vr_subt( * Searches a given codebook to find the nearest neighbour in Euclidean space. * Index of the winning codevector and the winning vector itself are returned. *-------------------------------------------------------------------*/ -Word16 vquant_ivas_fx( /* o: index of the winning codevector */ - Word32 x[], /* i: vector to quantize Q25 */ - const Word32 x_mean[], /* i: vector mean to subtract (0 if none) Q25 */ - Word32 xq[], /* o: quantized vector Q25 */ - const Word32 cb[], /* i: codebook Q25 */ - const Word16 dim, /* i: dimension of codebook vectors */ - const Word16 cbsize /* i: codebook size */ + +/* o: index of the winning codevector */ +Word16 vquant_ivas_fx( + Word32 x[], /* i: vector to quantize Q25 */ + const Word32 x_mean[], /* i: vector mean to subtract (0 if none) Q25 */ + Word32 xq[], /* o: quantized vector Q25 */ + const Word32 cb[], /* i: codebook Q25 */ + const Word16 dim, /* i: dimension of codebook vectors */ + const Word16 cbsize /* i: codebook size */ ) { Word16 c, d, idx, j; @@ -1844,13 +2820,14 @@ Word16 vquant_ivas_fx( /* o: index of the winning codevec return idx; } -Word16 vquant_fx( /* o: index of the winning codevector */ - Word16 x[], /* i: vector to quantize Q13 */ - const Word16 x_mean[], /* i: vector mean to subtract (0 if none) Q13 */ - Word16 xq[], /* o: quantized vector Q13 */ - const Word16 cb[], /* i: codebook Q13 */ - const Word16 dim, /* i: dimension of codebook vectors */ - const Word16 cbsize /* i: codebook size */ +/* o: index of the winning codevector */ +Word16 vquant_fx( + Word16 x[], /* i: vector to quantize Q13 */ + const Word16 x_mean[], /* i: vector mean to subtract (0 if none) Q13 */ + Word16 xq[], /* o: quantized vector Q13 */ + const Word16 cb[], /* i: codebook Q13 */ + const Word16 dim, /* i: dimension of codebook vectors */ + const Word16 cbsize /* i: codebook size */ ) { Word16 tmp; @@ -1915,6 +2892,7 @@ Word16 vquant_fx( /* o: index of the winning codevector return idx; } + /*-------------------------------------------------------------------* * w_vquant_fx() * @@ -1924,6 +2902,7 @@ Word16 vquant_fx( /* o: index of the winning codevector * Weights are put on the error for each vector element. * Index of the winning codevector and the winning vector itself are returned. *-------------------------------------------------------------------*/ + Word16 w_vquant_fx( Word16 x[], /* i: vector to quantize in Q10 */ Word16 Qx, @@ -2100,16 +3079,20 @@ Word16 w_vquant_fx( return idx; } + + /*-------------------------------------------------------------------* * Emaximum: * * Find index of a maximum energy in a vector *-------------------------------------------------------------------*/ -Word16 emaximum_fx( /* o : return index with max energy value in vector Q0 */ - const Word16 Qvec, /* i : Q of input vector Q0 */ - const Word16 *vec, /* i : input vector Qx */ - const Word16 lvec, /* i : length of input vector Q0 */ - Word32 *ener_max /* o : maximum energy value Q0 */ + +/* o : return index with max energy value in vector Q0 */ +Word16 emaximum_fx( + const Word16 Qvec, /* i : Q of input vector Q0 */ + const Word16 *vec, /* i : input vector Qx */ + const Word16 lvec, /* i : length of input vector Q0 */ + Word32 *ener_max /* o : maximum energy value Q0 */ ) { Word16 j, ind; @@ -2138,11 +3121,12 @@ Word16 emaximum_fx( /* o : return index with max energy valu return ind; } -Word16 emaximum_32fx( /* o : return index with max energy value in vector Q0 */ - const Word16 Qvec, /* i : Q of input vector Q0 */ - const Word32 *vec, /* i : input vector Qx */ - const Word16 lvec, /* i : length of input vector Q0 */ - Word32 *ener_max /* o : maximum energy value Q0 */ +/* o : return index with max energy value in vector Q0 */ +Word16 emaximum_32fx( + const Word16 Qvec, /* i : Q of input vector Q0 */ + const Word32 *vec, /* i : input vector Qx */ + const Word16 lvec, /* i : length of input vector Q0 */ + Word32 *ener_max /* o : maximum energy value Q0 */ ) { Word16 j, ind; @@ -2175,14 +3159,16 @@ Word16 emaximum_32fx( /* o : return index with max energy va return ind; } + /*-------------------------------------------------------------------* * mean32: * * Find the mean of a 32 bits vector *-------------------------------------------------------------------*/ -Word32 Mean32( /* o : mean of the elements of the vector */ - const Word32 in[], /* i : input vector */ - const Word16 L /* i : length of input vector */ +/* o : mean of the elements of the vector */ +Word32 Mean32( + const Word32 in[], /* i : input vector */ + const Word16 L /* i : length of input vector */ ) { Word32 Ltmp; @@ -2202,9 +3188,11 @@ Word32 Mean32( /* o : mean of the elements of the vector */ return Ltmp; } -Word32 sum32_fx( /* o : sum of all vector elements Qx*/ - const Word32 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ + +/* o : sum of all vector elements Qx*/ +Word32 sum32_fx( + const Word32 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -2218,9 +3206,11 @@ Word32 sum32_fx( /* o : sum of all vector elements return tmp; } -Word16 sum16_fx( /* o : sum of all vector elements Qx*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ + +/* o : sum of all vector elements Qx*/ +Word16 sum16_fx( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ) { Word16 i; @@ -2234,25 +3224,32 @@ Word16 sum16_fx( /* o : sum of all vector elements return tmp; } + + /*------------------------------------------------------------------* * function Random * * Signed 16 bits random generator. *------------------------------------------------------------------*/ -Word16 Random( /* o : output random value */ - Word16 *seed /* i/o: random seed */ + +/* o : output random value */ +Word16 Random( + Word16 *seed /* i/o: random seed */ ) { *seed = extract_l( L_mac0( 13849L, *seed, 31821 ) ); move16(); + return *seed; } -Word16 own_random2_fx( Word16 seed ) +Word16 own_random2_fx( + Word16 seed ) { return extract_l( L_mac0( 13849, seed, 31821 ) ); } + /*--------------------------------------------------------------------- * sign_fx() * @@ -2287,12 +3284,16 @@ Word16 sign16_fx( } } + /*------------------------------------------------------------------* * function Div_32_optmz * * Performs 32 bits interger division *------------------------------------------------------------------*/ -static Word32 Div_32_optmz( Word32 L_num, Word16 denom_hi ) + +static Word32 Div_32_optmz( + Word32 L_num, + Word16 denom_hi ) { Word16 approx, hi, lo, n_hi, n_lo; Word32 L_32; @@ -2316,12 +3317,15 @@ static Word32 Div_32_optmz( Word32 L_num, Word16 denom_hi ) return ( L_32 ); } + + /*------------------------------------------------------------------* * function iDiv_and_mod_32 * * return the quotient and the modulo 32 bits numerator divided by a 16 bit denominator * The denominator might be right shifted by 1 *------------------------------------------------------------------*/ + void iDiv_and_mod_32( const Word32 Numer, /* i : 32 bits numerator */ const Word16 Denom, /* i : 16 bits denominator */ @@ -2498,6 +3502,8 @@ void pz_filter_sp_fx( y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } + + return; } @@ -2590,6 +3596,7 @@ Word32 root_a_over_b_fx( return L_tmp; } + Word32 root_a_over_b_ivas_fx( Word32 a, /* Q(Q_a) */ Word16 Q_a, @@ -2693,6 +3700,7 @@ Word32 root_a_over_b_ivas_fx( return approx; } + /*===================================================================*/ /* FUNCTION : fir_fx () */ /*-------------------------------------------------------------------*/ @@ -2716,15 +3724,16 @@ Word32 root_a_over_b_ivas_fx( /*-------------------------------------------------------------------*/ /* RETURN ARGUMENTS : _ None. */ /*===================================================================*/ -void fir_fx( const Word16 x[], /* i : input vector Qx*/ - const Word16 h[], /* i : impulse response of the FIR filter Q12*/ - Word16 y[], /* o : output vector (result of filtering) Qx*/ - Word16 mem[], /* i/o: memory of the input signal (L samples) Qx*/ - const Word16 L, /* i : input vector size */ - const Word16 K, /* i : order of the FIR filter (K+1 coefs.) */ - const Word16 upd /* i : 1 = update the memory, 0 = not */ - , - Word16 shift /* i : difference between Q15 and scaling of h[] */ + +void fir_fx( + const Word16 x[], /* i : input vector Qx*/ + const Word16 h[], /* i : impulse response of the FIR filter Q12*/ + Word16 y[], /* o : output vector (result of filtering) Qx*/ + Word16 mem[], /* i/o: memory of the input signal (L samples) Qx*/ + const Word16 L, /* i : input vector size */ + const Word16 K, /* i : order of the FIR filter (K+1 coefs.) */ + const Word16 upd, /* i : 1 = update the memory, 0 = not */ + Word16 shift /* i : difference between Q15 and scaling of h[] */ ) { @@ -2771,8 +3780,11 @@ void fir_fx( const Word16 x[], /* i : input vector #endif move16(); } + + return; } + /*-------------------------------------------------------------------* * v_add_32() * @@ -2894,11 +3906,13 @@ void v_sub_16( /*--------------------------------------------------------------------------------*/ /* squant_fx() */ /*--------------------------------------------------------------------------------*/ -Word16 squant_fx( /* o: index of the winning codeword */ - const Word16 x, /* i: scalar value to quantize */ - Word16 *xq, /* o: quantized value */ - const Word16 cb[], /* i: codebook */ - const Word16 cbsize /* i: codebook size */ + +/* o: index of the winning codeword */ +Word16 squant_fx( + const Word16 x, /* i: scalar value to quantize */ + Word16 *xq, /* o: quantized value */ + const Word16 cb[], /* i: codebook */ + const Word16 cbsize /* i: codebook size */ ) { Word16 tmp; @@ -2998,7 +4012,7 @@ Word16 squant_int_fx( /*-------------------------------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* */ -/* _ (Word32 []) buf : filter memory (Qx+Qc) */ +/* _ (Word32 []) buf : filter memory (Qx+Qc) */ /*-------------------------------------------------------------------*/ /* RETURN ARGUMENTS : _ None. */ /*===================================================================*/ @@ -3050,18 +4064,22 @@ void pz_filter_dp_fx( y[i] = extract_h( Ltemp1 ); /* y[i] in Qn */ move16(); } + + return; } + /*-------------------------------------------------------------------* * Copy_Scale_sig * * Up/down scale a 16 bits vector x and move it into y *-------------------------------------------------------------------*/ + void Copy_Scale_sig32( const Word32 x[], /* i : signal to scale input Qx */ Word32 y[], /* o : scaled signal output Qx */ const Word16 lg, /* i : size of x[] Q0 */ - const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ + const Word16 exp0 /* i : exponent: x = round(x << exp) Qx ?exp */ ) { Word16 i; @@ -3105,6 +4123,8 @@ void Copy_Scale_sig32( y[i] = W_extract_l( W_mult_32_32( L_tmp, x[i] ) ); move32(); /* saturation can occur here */ } + + return; } @@ -3139,6 +4159,8 @@ void Copy_Scale_sig32_16( *dst++ = round_fx_sat( L_temp ); move16(); } + + return; } /*-------------------------------------------------------------------* @@ -3163,7 +4185,12 @@ void v_multc_att( move16(); } } -} /*-------------------------------------------------------------------* + + return; +} + + +/*-------------------------------------------------------------------* * v_multc_att32() * * Attenuation of a vector,, attenuation factor in Q15 @@ -3185,6 +4212,8 @@ void v_multc_att32( move32(); } } + + return; } /*-------------------------------------------------------------------* @@ -3209,6 +4238,8 @@ void v_multc_att3232( move32(); } } + + return; } /*-------------------------------------------------------------------* @@ -3308,20 +4339,24 @@ void add_vec_fx( move16(); } } + return; } + /*-------------------------------------------------------------------* * Add_flt32_flt32 * * Add two Pseudo Float Value that are 32 Bits Mantisa and 16 Bits Exp *-------------------------------------------------------------------*/ -Word32 Add_flt32_flt32( /* o: Result (Normalized) */ - Word32 a, /* i: 1st Value */ - Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ - Word32 b, /* i: 2nd Value */ - Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ - Word16 *exp_out /* o: Exponent of Result */ + +/* o: Result (Normalized) */ +Word32 Add_flt32_flt32( + Word32 a, /* i: 1st Value */ + Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ + Word32 b, /* i: 2nd Value */ + Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ + Word16 *exp_out /* o: Exponent of Result */ ) { Word16 temp, temp2; @@ -3346,16 +4381,19 @@ Word32 Add_flt32_flt32( /* o: Result (Normalized) return L_shl( L_temp, temp2 ); } + /*-------------------------------------------------------------------* * Mul_flt32_Q15 * * Multiply one Pseudo Float Value (32 Bits Mantisa and 16 Bits Exp) * with a Q15 value *-------------------------------------------------------------------*/ -Word32 Mul_flt32_Q15( /* o: Result (Normalized) */ - Word32 value, /* i: Pseudo_float Value */ - Word16 *exp_v, /*i/o: Exponent of Value (Q of Value) */ - Word16 frac /* i: Q15 value */ + +/* o: Result (Normalized) */ +Word32 Mul_flt32_Q15( + Word32 value, /* i: Pseudo_float Value */ + Word16 *exp_v, /*i/o: Exponent of Value (Q of Value) */ + Word16 frac /* i: Q15 value */ ) { Word16 temp; @@ -3370,18 +4408,21 @@ Word32 Mul_flt32_Q15( /* o: Result (Normalized) */ return L_shl( L_temp, temp ); } + /*-------------------------------------------------------------------* * Div_flt32_flt32 * * Divide one Pseudo Float Value (32 Bits Mantisa and 16 Bits Exp) * by another one *-------------------------------------------------------------------*/ -Word32 Div_flt32_flt32( /* o: Result (Normalized) */ - Word32 a, /* i: 1st Value */ - Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ - Word32 b, /* i: 2nd Value */ - Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ - Word16 *exp_out /* o: Exponent of Result */ + +/* o: Result (Normalized) */ +Word32 Div_flt32_flt32( + Word32 a, /* i: 1st Value */ + Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ + Word32 b, /* i: 2nd Value */ + Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ + Word16 *exp_out /* o: Exponent of Result */ ) { Word16 temp, temp2; @@ -3406,11 +4447,13 @@ Word32 Div_flt32_flt32( /* o: Result (Normalized) * * Calculate Energy with overflow protection *-------------------------------------------------------------------*/ -Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) */ - const Word16 *signal, /* i: Signal */ - Word16 signal_exp, /* i: Exponent of Signal (Q of Signal) */ - Word16 len, /* i: Frame Length */ - Word16 *energy_exp /* o: Exponent of Energy (Q of Energy) */ + +/* o: Result (Energy) */ +Word32 Calc_Energy_Autoscaled( + const Word16 *signal, /* i: Signal */ + Word16 signal_exp, /* i: Exponent of Signal (Q of Signal) */ + Word16 len, /* i: Frame Length */ + Word16 *energy_exp /* o: Exponent of Energy (Q of Energy) */ ) { Word16 temp, temp2; @@ -3481,7 +4524,9 @@ Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) return L_Energy; } -Word16 Find_Max_Norm16( const Word16 *src, Word16 len ) +Word16 Find_Max_Norm16( + const Word16 *src, + Word16 len ) { Word16 i; Word16 max16; @@ -3499,7 +4544,9 @@ Word16 Find_Max_Norm16( const Word16 *src, Word16 len ) return norm_s( max16 ); } -Word16 Find_Max_Norm32( const Word32 *src, Word16 len ) +Word16 Find_Max_Norm32( + const Word32 *src, + Word16 len ) { Word16 i; Word32 max32; @@ -3514,17 +4561,20 @@ Word16 Find_Max_Norm32( const Word32 *src, Word16 len ) return norm_l( max32 ); } + /*-------------------------------------------------------------------* * Sqrt_Ratio32 * * Calculate Sqrt of Val1/Val2 *-------------------------------------------------------------------*/ -Word32 Sqrt_Ratio32( /* o: Result in Q31 */ - Word32 L_val1, /* i: Mantisa of Val1 */ - Word16 exp1, /* i: Exp of Val1 (>0: Val was Left Shifted, <0:Right Shifted) */ - Word32 L_val2, /* i: Mantisa of Val2 */ - Word16 exp2, /* i: Exp of Val2 (same as exp1) */ - Word16 *exp /* o: Exp of Result (# of 'L_shl' Req to get to Final Value) */ + +/* o: Result in Q31 */ +Word32 Sqrt_Ratio32( + Word32 L_val1, /* i: Mantisa of Val1 */ + Word16 exp1, /* i: Exp of Val1 (>0: Val was Left Shifted, <0:Right Shifted) */ + Word32 L_val2, /* i: Mantisa of Val2 */ + Word16 exp2, /* i: Exp of Val2 (same as exp1) */ + Word16 *exp /* o: Exp of Result (# of 'L_shl' Req to get to Final Value) */ ) { Word16 temp; @@ -3565,9 +4615,10 @@ Word32 Sqrt_Ratio32( /* o: Result in Q31 return L_val1; } -Word16 Invert16( /* result in Q'15 + 'exp' */ - Word16 val, - Word16 *exp ) +/* result in Q'15 + 'exp' */ +Word16 Invert16( + Word16 val, + Word16 *exp ) { Word16 temp; @@ -3585,7 +4636,10 @@ Word16 Invert16( /* result in Q'15 + 'exp' */ return temp; } -Word16 find_rem( Word16 n, Word16 m, Word16 *r ) +Word16 find_rem( + Word16 n, + Word16 m, + Word16 *r ) { Word16 i, q1, q2, qd; Word32 Ltemp2; @@ -3627,11 +4681,15 @@ Word16 find_rem( Word16 n, Word16 m, Word16 *r ) Ltemp2 = L_shr( Lacc, q2 ); *r = extract_h( Ltemp2 ); move16(); + return ( q1 ); } -Word32 find_remd( Word32 n, Word32 m, Word32 *r ) +Word32 find_remd( + Word32 n, + Word32 m, + Word32 *r ) { Word16 i, q1, q2, qd; Word32 Ltemp2, qo; @@ -3675,9 +4733,11 @@ Word32 find_remd( Word32 n, Word32 m, Word32 *r ) } *r = L_shr( Lacc, q2 ); move16(); + return ( qo ); } + Word16 rint_new_fx( Word32 x /*Q16 */ ) @@ -3740,7 +4800,15 @@ Word16 rint_new_fx( /* CALLED FROM : TX */ /*===================================================================*/ -Word16 erb_diff_search_fx( Word16 *prev_erb, const Word16 *curr_erb, Word16 *dif_erb, Word16 *pow_spec, const Word16 *cb_fx, Word16 cb_size, Word16 cb_dim, Word16 offset ) +Word16 erb_diff_search_fx( + Word16 *prev_erb, + const Word16 *curr_erb, + Word16 *dif_erb, + Word16 *pow_spec, + const Word16 *cb_fx, + Word16 cb_size, + Word16 cb_dim, + Word16 offset ) { Word16 i, j, mmseindex; Word16 dh, dl; @@ -3825,6 +4893,8 @@ Word16 erb_diff_search_fx( Word16 *prev_erb, const Word16 *curr_erb, Word16 *dif return ( mmseindex ); } + + void Acelp_dec_total_exc( Word16 *exc_fx, /* i/o: adapt. excitation exc */ Word16 *exc2_fx, /* i/o: adapt. excitation/total exc */ @@ -3847,14 +4917,20 @@ void Acelp_dec_total_exc( move16(); move16(); } + + return; } + /*-------------------------------------------------------------------* * UL_inverse * * Calculate inverse of UL_val. Output in Q_exp. *-------------------------------------------------------------------*/ -UWord32 UL_inverse( const UWord32 UL_val, Word16 *exp ) + +UWord32 UL_inverse( + const UWord32 UL_val, + Word16 *exp ) { UWord32 UL_tmp; @@ -3874,7 +4950,10 @@ UWord32 UL_inverse( const UWord32 UL_val, Word16 *exp ) * Calculate UL_num/UL_den. UL_num assumed to be Q31, UL_den assumed * to be Q32, then result is in Q32. *-------------------------------------------------------------------*/ -UWord32 UL_div( const UWord32 UL_num, const UWord32 UL_den ) + +UWord32 UL_div( + const UWord32 UL_num, + const UWord32 UL_den ) { UWord32 UL_e, UL_Q; UWord32 UL_msb, UL_lsb; @@ -3914,9 +4993,11 @@ Word16 ratio( const Word32 numer, const Word32 denom, Word16 *expo ) *expo = sub( expNumer, expDenom ); move16(); + return quotient; /* Q14 */ } + /*-----------------------------------------------------------------------* * Function hp400_12k8() * * * @@ -3937,6 +5018,7 @@ Word16 ratio( const Word32 numer, const Word32 denom, Word16 *expo ) * float --> b[3] = {0.893554687, -1.787109375, 0.893554687}; * * a[3] = {1.000000000, 1.787109375, -0.864257812}; * *-----------------------------------------------------------------------*/ + void hp400_12k8_fx( Word16 signal[], /* i/o: input signal / output is divided by 16 */ const Word16 lg, /* i : lenght of signal */ @@ -4014,6 +5096,7 @@ void hp400_12k8_fx( return; } + void hp400_12k8_ivas_fx( Word16 signal[], /* i/o: input signal / output is divided by 16 */ const Word16 lg, /* i : lenght of signal */ @@ -4063,10 +5146,18 @@ void hp400_12k8_ivas_fx( mem[5] = x1; /* Q_syn */ move16(); move16(); + return; } -Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy, Word16 *qo, Word16 len ) + +Word16 dot_prod_satcontr( + const Word16 *x, + const Word16 *y, + Word16 qx, + Word16 qy, + Word16 *qo, + Word16 len ) { Word16 tmp_tab_x[L_FRAME16k]; Word16 tmp_tab_y[L_FRAME16k]; @@ -4078,7 +5169,6 @@ Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy move32(); #endif - Copy( x, tmp_tab_x, len ); /* OPTIMIZE !!!!! the copy into local table is not necessary */ Copy( y, tmp_tab_y, len ); /* could be reworked to do a 1st iteration with the original x[] and y[] */ /* then check if there is an overflow and do a more complex 2nd, 3rd, ... processing */ @@ -4113,6 +5203,7 @@ Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy q = add( q, add( qx, qy ) ); *qo = sub( q, add( shift, 16 ) ); move16(); + return ener; } @@ -4134,7 +5225,11 @@ Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy * Returns: * void */ -void E_UTIL_f_convolve( const Word16 x[], const Word16 h[], Word16 y[], const Word16 size ) +void E_UTIL_f_convolve( + const Word16 x[], + const Word16 h[], + Word16 y[], + const Word16 size ) { Word16 i, n; Word32 L_sum; @@ -4152,14 +5247,17 @@ void E_UTIL_f_convolve( const Word16 x[], const Word16 h[], Word16 y[], const Wo y[n] = mac_r( L_sum, x[i], h[0] ); move16(); } + return; } + /*----------------------------------------------------------------------------- * floating_point_add: * * Add two floating point numbers: x <- x + y. *----------------------------------------------------------------------------*/ + void floating_point_add( Word32 *mx, /* io: mantissa of the addend Q31 */ Word16 *ex, /* io: exponent of the addend Q0 */ @@ -4193,9 +5291,11 @@ void floating_point_add( *ex = sub( add( *ex, expo ), 1 ); /* Subtract 1 due to 1-bit down-shift above ensuring 1 bit headroom before addition. */ move32(); move16(); + return; } + /*-------------------------------------------------------------------* * delay_signal_fx() * @@ -4281,6 +5381,7 @@ void v_add_fx( return; } + Word16 floor_log_2( Word32 num ) { @@ -4328,6 +5429,7 @@ void v_shr_16( return; } + /*---------------------------------------------------------------------* * lin_interp_fx() * @@ -4408,6 +5510,7 @@ Word16 lin_interp_ivas_fx( return add_sat( y1, round_fx( L_shl( L_mult( sub( x, x1 ), div_res ), div_res_e ) ) ); } + /*--------------------------------------------------------------------- * sign_l() * @@ -4467,6 +5570,7 @@ void set_zero_fx( return; } + void set_zero2_fx( Word32 *vec, /* o : input vector */ const Word32 lvec /* i : length of the vector */ @@ -4638,6 +5742,7 @@ Word32 dotp_fixed_ivas_fx( return suma; } + /*-------------------------------------------------------------------* * v_mult() * @@ -4663,11 +5768,13 @@ void v_mult_fixed( return; } + /*-------------------------------------------------------------------* * anint_fixed() * * Round to the nearest integer. *-------------------------------------------------------------------*/ + Word32 anint_fixed( Word32 x, Word16 exp ) { IF( x == 0 ) @@ -4684,20 +5791,26 @@ Word32 anint_fixed( Word32 x, Word16 exp ) } } + /*-------------------------------------------------------------------* * ceil_fixed() * * Ceil to the next multiple of (1 << exp). *-------------------------------------------------------------------*/ -Word32 ceil_fixed( Word32 x, Word16 exp ) + +Word32 ceil_fixed( + Word32 x, + Word16 exp ) { Word32 step; + // step = x / L_shl( 1, exp ); step = L_shr( x, exp ); IF( ( x % L_shl( 1, exp ) ) > 0 ) { step = L_add( step, 1 ); } + return L_shl( step, exp ); } @@ -4725,6 +5838,7 @@ void sort_l( return; } + /*-------------------------------------------------------------------* * v_add_fixed() * @@ -4795,7 +5909,8 @@ void v_add_fixed_me( return; } -Word16 find_guarded_bits_fx( Word32 n ) +Word16 find_guarded_bits_fx( + Word32 n ) { // return n <= 1 ? 0 : n <= 2 ? 1 // : n <= 4 ? 2 @@ -4830,10 +5945,14 @@ Word16 find_guarded_bits_fx( Word32 n ) } } -Word16 L_norm_arr( const Word32 *arr, Word16 size ) + +Word16 L_norm_arr( + const Word32 *arr, + Word16 size ) { Word16 q = 31; move16(); + FOR( Word16 i = 0; i < size; i++ ) { Word16 q_tst; @@ -4848,12 +5967,15 @@ Word16 L_norm_arr( const Word32 *arr, Word16 size ) return q; } -Word16 norm_arr( Word16 *arr, Word16 size ) +Word16 norm_arr( + Word16 *arr, + Word16 size ) { Word16 q = 15; Word16 exp = 0; move16(); move16(); + FOR( Word16 i = 0; i < size; i++ ) { if ( arr[i] != 0 ) @@ -4865,15 +5987,19 @@ Word16 norm_arr( Word16 *arr, Word16 size ) q = s_min( q, exp ); } } + return q; } -Word16 W_norm_arr( Word64 *arr, Word16 size ) +Word16 W_norm_arr( + Word64 *arr, + Word16 size ) { Word16 q = 63; Word16 exp = 0; move16(); move16(); + FOR( Word16 i = 0; i < size; i++ ) { if ( arr[i] != 0 ) @@ -4885,10 +6011,13 @@ Word16 W_norm_arr( Word64 *arr, Word16 size ) q = s_min( q, exp ); } } + return q; } -Word16 get_min_scalefactor( Word32 x, Word32 y ) +Word16 get_min_scalefactor( + Word32 x, + Word32 y ) { Word16 scf_y; Word16 scf = Q31; @@ -4916,18 +6045,24 @@ Word16 get_min_scalefactor( Word32 x, Word32 y ) } -Flag is_zero_arr( Word32 *arr, Word16 size ) +Flag is_zero_arr( + Word32 *arr, + Word16 size ) { FOR( Word16 i = 0; i < size; i++ ) - IF( arr[i] != 0 ) { - return 0; + IF( arr[i] != 0 ) + { + return 0; + } } return 1; } -Flag is_zero_arr16( Word16 *arr, Word16 size ) +Flag is_zero_arr16( + Word16 *arr, + Word16 size ) { FOR( Word16 i = 0; i < size; i++ ) IF( arr[i] != 0 ) @@ -4938,7 +6073,9 @@ Flag is_zero_arr16( Word16 *arr, Word16 size ) return 1; } -Flag is_zero_arr64( Word64 *arr, Word16 size ) +Flag is_zero_arr64( + Word64 *arr, + Word16 size ) { FOR( Word16 i = 0; i < size; i++ ) { @@ -4957,7 +6094,9 @@ void Scale_sig64( ) { Word16 i; + assert( exp <= 63 && exp >= -63 ); + IF( exp == 0 ) { return; @@ -4969,4 +6108,6 @@ void Scale_sig64( x[i] = W_shl( x[i], exp ); move64(); } + + return; } diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index e728382cc..5c900eadd 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -13,14 +13,16 @@ #include "ivas_prot_fx.h" #include "rom_com.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" + + extern const Word16 T_DIV_L_Frame[]; /*0Q15 * 2^-7 */ -static Word32 CalculateAbsEnergy_fx( /* o : normalized result Q31 */ - const Word32 L_off, /* i : initial sum value Qn */ - const Word16 x[], /* i : x vector Qn */ - const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ - Word16 *exp /* o : exponent of result in [-32,31] Q0 */ +/* o : normalized result Q31 */ +static Word32 CalculateAbsEnergy_fx( + const Word32 L_off, /* i : initial sum value Qn */ + const Word16 x[], /* i : x vector Qn */ + const Word16 lg, /* i : vector length, range [0..7FFF] Q0 */ + Word16 *exp /* o : exponent of result in [-32,31] Q0 */ ); void decoder_tcx_fx( diff --git a/lib_dec/ivas_binRenderer_internal_fx.c b/lib_dec/ivas_binRenderer_internal_fx.c index 92682ad01..6c4df2855 100644 --- a/lib_dec/ivas_binRenderer_internal_fx.c +++ b/lib_dec/ivas_binRenderer_internal_fx.c @@ -43,18 +43,19 @@ #include "ivas_rom_binauralRenderer.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" #include "debug.h" + + +/*----------------------------------------------------------------------------------* + * Local constants + *----------------------------------------------------------------------------------*/ + #define NUM_TAPS_F0_6 ( Word16 )( 58 ) // (Word16) ceil( 0.6f * hBinRenConvModule->numTaps ) #define NUM_TAPS_F0_5 ( Word16 )( 48 ) // (Word16) ceil( 0.5f * hBinRenConvModule->numTaps ) #define NUM_TAPS_F0_4 ( Word16 )( 39 ) // (Word16) ceil( 0.4f * hBinRenConvModule->numTaps ) #define NUM_TAPS_F0_3 ( Word16 )( 29 ) // (Word16) ceil( 0.3f * hBinRenConvModule->numTaps ) #ifdef FIX_1053_REVERB_RECONFIGURATION -/*----------------------------------------------------------------------------------* - * Local constants - *----------------------------------------------------------------------------------*/ - #define REVERB_INPUT_DOWNMIX_CHANNELS ( 11 ) /* Downmix table for sparse frequency domain reverberator*/ const Word32 dmxmtx_table_fx[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] = { @@ -64,6 +65,7 @@ const Word32 dmxmtx_table_fx[BINAURAL_CHANNELS][REVERB_INPUT_DOWNMIX_CHANNELS] = }; #endif + /*------------------------------------------------------------------------- * ivas_binRenderer_filterModule_fx() * diff --git a/lib_dec/ivas_dirac_dec_fx.c b/lib_dec/ivas_dirac_dec_fx.c index 39bcf9039..66fbd9241 100644 --- a/lib_dec/ivas_dirac_dec_fx.c +++ b/lib_dec/ivas_dirac_dec_fx.c @@ -42,12 +42,13 @@ #include "ivas_rom_dec.h" #include "ivas_rom_rend.h" #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" + /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ + static ivas_error ivas_dirac_dec_config_internal_fx( Decoder_Struct *st_ivas, /* i/o: IVAS decoder structure */ const DIRAC_CONFIG_FLAG flag_config_inp /* i/ : Flag determining if we open or reconfigure the DirAC decoder */ diff --git a/lib_dec/ivas_ism_metadata_dec_fx.c b/lib_dec/ivas_ism_metadata_dec_fx.c index 17bc36346..e6f07dfc4 100644 --- a/lib_dec/ivas_ism_metadata_dec_fx.c +++ b/lib_dec/ivas_ism_metadata_dec_fx.c @@ -35,7 +35,6 @@ #include "ivas_cnst.h" #include "ivas_prot_fx.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "prot_fx.h" #include "ivas_stat_enc.h" #include @@ -46,6 +45,7 @@ /*-----------------------------------------------------------------------* * Local functions *-----------------------------------------------------------------------*/ + static void decode_angle_indices_fx( DEC_CORE_HANDLE st0, ISM_METADATA_ANGLE_HANDLE angle, const Word16 non_diegetic_flag, Word16 *flag_abs_azimuth ); static Word16 decode_radius_fx( DEC_CORE_HANDLE st0, Word16 *last_radius_idx, Word16 *flag_abs_radius ); diff --git a/lib_dec/ivas_ism_param_dec_fx.c b/lib_dec/ivas_ism_param_dec_fx.c index f9d03f6f9..c660a7f33 100644 --- a/lib_dec/ivas_ism_param_dec_fx.c +++ b/lib_dec/ivas_ism_param_dec_fx.c @@ -42,14 +42,14 @@ #include "wmc_auto.h" #include "ivas_prot_fx.h" #include "debug.h" -#include "ivas_rom_com_fx.h" + /*-----------------------------------------------------------------------* * Local function definitions *-----------------------------------------------------------------------*/ static void ivas_param_ism_dec_dequant_DOA_fx( - PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ + PARAM_ISM_DEC_HANDLE hParamIsmDec, /* i/o: decoder ParamISM handle */ const Word16 nchan_ism /* i : number of ISM channels */ ) { diff --git a/lib_dec/ivas_lfe_plc_fx.c b/lib_dec/ivas_lfe_plc_fx.c index 2510ded15..70424e632 100755 --- a/lib_dec/ivas_lfe_plc_fx.c +++ b/lib_dec/ivas_lfe_plc_fx.c @@ -37,7 +37,6 @@ #include #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------------------------* * Local constants diff --git a/lib_dec/ivas_masa_dec_fx.c b/lib_dec/ivas_masa_dec_fx.c index 0f22a8b29..882761209 100644 --- a/lib_dec/ivas_masa_dec_fx.c +++ b/lib_dec/ivas_masa_dec_fx.c @@ -42,7 +42,6 @@ #include "prot_fx.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-----------------------------------------------------------------------* diff --git a/lib_dec/ivas_mc_paramupmix_dec_fx.c b/lib_dec/ivas_mc_paramupmix_dec_fx.c index c49b41342..a2a53c825 100644 --- a/lib_dec/ivas_mc_paramupmix_dec_fx.c +++ b/lib_dec/ivas_mc_paramupmix_dec_fx.c @@ -44,16 +44,18 @@ #include "math.h" #include "wmc_auto.h" #include "rom_dec.h" -#include "ivas_rom_com_fx.h" + /*-----------------------------------------------------------------------* * Local arrays *-----------------------------------------------------------------------*/ /* boxes = { 0 1 2 3 [4 6] [5 7] [8 10] [9 11] }; */ -const Word16 MC_PARAMUPMIX_CHIDX1[MC_PARAMUPMIX_COMBINATIONS] = { 0, 1, 4, 5 }; -const Word16 MC_PARAMUPMIX_CHIDX2[MC_PARAMUPMIX_COMBINATIONS] = { 2, 3, 6, 7 }; -const Word16 qmf_to_par_band[] = { +static const Word16 MC_PARAMUPMIX_CHIDX1[MC_PARAMUPMIX_COMBINATIONS] = { 0, 1, 4, 5 }; + +static const Word16 MC_PARAMUPMIX_CHIDX2[MC_PARAMUPMIX_COMBINATIONS] = { 2, 3, 6, 7 }; + +static const Word16 qmf_to_par_band[] = { 0, 1, 2, 3, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, @@ -62,6 +64,7 @@ const Word16 qmf_to_par_band[] = { 11, 11, 11, 11, 11, 11, 11, 11, 11, 11 }; + /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ diff --git a/lib_dec/ivas_qmetadata_dec_fx.c b/lib_dec/ivas_qmetadata_dec_fx.c index bf0cbbd8e..cec6867d3 100644 --- a/lib_dec/ivas_qmetadata_dec_fx.c +++ b/lib_dec/ivas_qmetadata_dec_fx.c @@ -39,13 +39,13 @@ #include "ivas_rom_dec.h" #include "wmc_auto.h" #include "prot_fx.h" - #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ + static Word16 ivas_qmetadata_entropy_decode_diffuseness( UWord16 *bitstream, Word16 *index, IVAS_QDIRECTION *q_direction, UWord16 *diffuseness_index_max_ec_frame ); static Word16 ivas_qmetadata_entropy_decode_df_ratio( UWord16 *bitstream, Word16 *index, IVAS_QDIRECTION *q_direction, Word16 *dfRatio_bits ); static Word16 ivas_qmetadata_raw_decode_dir_fx( IVAS_QDIRECTION *q_direction, UWord16 *bitstream, Word16 *index, const Word16 nbands, const Word16 start_band, const Word16 hrmasa_flag ); diff --git a/lib_dec/ivas_qspherical_dec_fx.c b/lib_dec/ivas_qspherical_dec_fx.c index f6ac39a99..f443cc81d 100644 --- a/lib_dec/ivas_qspherical_dec_fx.c +++ b/lib_dec/ivas_qspherical_dec_fx.c @@ -37,7 +37,6 @@ #include "ivas_stat_dec.h" #include "wmc_auto.h" #include "prot_fx.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" diff --git a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c index d68571c1f..fe2244fb7 100644 --- a/lib_dec/ivas_sba_dirac_stereo_dec_fx.c +++ b/lib_dec/ivas_sba_dirac_stereo_dec_fx.c @@ -38,10 +38,10 @@ #include "ivas_prot_fx.h" #include "rom_com.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_dec.h" #include "wmc_auto.h" + #define SIN_NEG_30_DEGREES_Q15 ( (Word16) 0xC000 ) #define SIN_30_DEGREES_Q15 ( (Word16) 0x4000 ) diff --git a/lib_dec/ivas_sns_dec_fx.c b/lib_dec/ivas_sns_dec_fx.c index 3bc6d337e..05bf47cb9 100644 --- a/lib_dec/ivas_sns_dec_fx.c +++ b/lib_dec/ivas_sns_dec_fx.c @@ -38,7 +38,6 @@ #include "ivas_cnst.h" #include #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" /*------------------------------------------------------------------- diff --git a/lib_dec/ivas_spar_md_dec_fx.c b/lib_dec/ivas_spar_md_dec_fx.c index 204840cc4..40bafe92c 100644 --- a/lib_dec/ivas_spar_md_dec_fx.c +++ b/lib_dec/ivas_spar_md_dec_fx.c @@ -39,7 +39,7 @@ #include "wmc_auto.h" #include "ivas_stat_dec.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*------------------------------------------------------------------------------------------* * Local constants diff --git a/lib_dec/ivas_stereo_cng_dec_fx.c b/lib_dec/ivas_stereo_cng_dec_fx.c index c214b36fc..07fff48d3 100644 --- a/lib_dec/ivas_stereo_cng_dec_fx.c +++ b/lib_dec/ivas_stereo_cng_dec_fx.c @@ -39,7 +39,7 @@ #include "ivas_rom_com.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*------------------------------------------------------------------- * Local constants diff --git a/lib_dec/ivas_stereo_dft_dec_fx.c b/lib_dec/ivas_stereo_dft_dec_fx.c index 7d3bec07d..a97c32c9d 100644 --- a/lib_dec/ivas_stereo_dft_dec_fx.c +++ b/lib_dec/ivas_stereo_dft_dec_fx.c @@ -41,7 +41,6 @@ #include "ivas_prot_fx.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_dec.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" diff --git a/lib_dec/ivas_stereo_icbwe_dec_fx.c b/lib_dec/ivas_stereo_icbwe_dec_fx.c index af31aea40..8ef404ede 100644 --- a/lib_dec/ivas_stereo_icbwe_dec_fx.c +++ b/lib_dec/ivas_stereo_icbwe_dec_fx.c @@ -41,7 +41,6 @@ #include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #define Q_icBWE 16 diff --git a/lib_dec/ivas_stereo_switching_dec_fx.c b/lib_dec/ivas_stereo_switching_dec_fx.c index 8801ccf60..3e2ef1aa1 100644 --- a/lib_dec/ivas_stereo_switching_dec_fx.c +++ b/lib_dec/ivas_stereo_switching_dec_fx.c @@ -41,7 +41,6 @@ #include "wmc_auto.h" #include #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-------------------------------------------------------------------* diff --git a/lib_dec/ivas_stereo_td_dec_fx.c b/lib_dec/ivas_stereo_td_dec_fx.c index 6209d5684..7169e31e2 100644 --- a/lib_dec/ivas_stereo_td_dec_fx.c +++ b/lib_dec/ivas_stereo_td_dec_fx.c @@ -39,9 +39,13 @@ #include "ivas_rom_com.h" #include "ivas_cnst.h" #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" #include "ivas_prot_fx.h" +/*-------------------------------------------------------------------* + * stereo_td_init_dec() + * + * Initialize TD stereo decoder + *-------------------------------------------------------------------*/ void stereo_td_init_dec_fx( STEREO_TD_DEC_DATA_HANDLE hStereoTD, /* i/o: TD stereo decoder handle */ @@ -89,13 +93,15 @@ void stereo_td_init_dec_fx( * * Configure TD stereo decoder *-------------------------------------------------------------------*/ -Word32 power_table[32 + 1] = { + +static Word32 power_table[32 + 1] = { 53687092, 60237908, 67588048, 75835024, 85088304, 95470648, 107119832, 120190432, 134855872, 151310800, 169773488, 190488992, 213732176, 239811440, 269072832, 301904704, 338742656, 380075520, 426451744, 478486688, 536870912, 602379200, 675880448, 758350272, 850883136, 954706496, 1071198464, 1201904384, 1348558720, 1513107968, 1697734912, 1904890240, 2137321728 }; // Q29 + void tdm_configure_dec_fx( const Word16 ivas_format, /* i : IVAS format Q0*/ const Word16 ism_mode, /* i : ISM mode in combined format Q0*/ diff --git a/lib_enc/FEC_enc_fx.c b/lib_enc/FEC_enc_fx.c index 69b14eb9b..1a813b462 100644 --- a/lib_enc/FEC_enc_fx.c +++ b/lib_enc/FEC_enc_fx.c @@ -1,11 +1,10 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -30,13 +29,14 @@ /*----------------------------------------------------------------------------*/ /* INPUT/OUTPUT ARGUMENTS : */ /* Word16 *last_pulse_pos i/o: Position of the last pulse */ -/* Encoder_State *st_fx i/o: state structure */ +/* Encoder_State *st_fx i/o: state structure */ /*----------------------------------------------------------------------------*/ /* RETURN ARGUMENTS : */ /* _ None */ /*----------------------------------------------------------------------------*/ /* */ /*============================================================================*/ + void FEC_encode_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP */ diff --git a/lib_enc/acelp_core_enc_fx.c b/lib_enc/acelp_core_enc_fx.c index d621923ba..72c912cf3 100644 --- a/lib_enc/acelp_core_enc_fx.c +++ b/lib_enc/acelp_core_enc_fx.c @@ -10,7 +10,6 @@ #include "stat_enc.h" #include "rom_com.h" #include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "ivas_cnst.h" #include "ivas_prot_fx.h" diff --git a/lib_enc/acelp_core_switch_enc_fx.c b/lib_enc/acelp_core_switch_enc_fx.c index 1854b2875..654d1c303 100644 --- a/lib_enc/acelp_core_switch_enc_fx.c +++ b/lib_enc/acelp_core_switch_enc_fx.c @@ -5,12 +5,12 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*---------------------------------------------------------------------* * Local function prototypes *---------------------------------------------------------------------*/ diff --git a/lib_enc/acelp_enc_util_fx.c b/lib_enc/acelp_enc_util_fx.c index 7f57b55da..8d9765785 100644 --- a/lib_enc/acelp_enc_util_fx.c +++ b/lib_enc/acelp_enc_util_fx.c @@ -13,7 +13,6 @@ #include "prot_fx_enc.h" /* Function prototypes */ #include "stat_enc.h" #include "rom_com.h" -#include "rom_com_fx.h" #include "rom_enc.h" diff --git a/lib_enc/amr_wb_enc_fx.c b/lib_enc/amr_wb_enc_fx.c index 1580a7818..76c9930b6 100644 --- a/lib_enc/amr_wb_enc_fx.c +++ b/lib_enc/amr_wb_enc_fx.c @@ -3,11 +3,9 @@ ====================================================================================*/ #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_enc.h" /* Encoder static table prototypes */ #include "basop_util.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ diff --git a/lib_enc/analy_lp_fx.c b/lib_enc/analy_lp_fx.c index 9b6ff2108..def862b84 100644 --- a/lib_enc/analy_lp_fx.c +++ b/lib_enc/analy_lp_fx.c @@ -5,12 +5,12 @@ #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "rom_enc.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * analy_lp_fx() * diff --git a/lib_enc/cod4t64_fx.c b/lib_enc/cod4t64_fx.c index 6d9e8fa43..3f5e135df 100644 --- a/lib_enc/cod4t64_fx.c +++ b/lib_enc/cod4t64_fx.c @@ -1,12 +1,12 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* VMR-WB compilation switches */ #include "cnst.h" /* Common constants */ #include "rom_enc.h" /* Encoder static table prototypes */ #include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -22,6 +22,7 @@ /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ + static Word16 quant_1p_N1_fx( const Word16 pos, const Word16 N ); static Word16 quant_3p_3N1_fx( const Word16 pos1, const Word16 pos2, const Word16 pos3, const Word16 N ); static Word32 quant_4p_4N_fx( const Word16 pos[], const Word16 N ); diff --git a/lib_enc/cod_tcx_fx.c b/lib_enc/cod_tcx_fx.c index c598af538..6155054c2 100644 --- a/lib_enc/cod_tcx_fx.c +++ b/lib_enc/cod_tcx_fx.c @@ -8,19 +8,18 @@ #include #include "rom_com.h" #include "stat_com.h" -// #include "prot_fx.h" #include "prot_fx.h" #include "basop_util.h" #include "stl.h" -// #include "basop_mpy.h" #include "prot_fx_enc.h" #include #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" +#include "ivas_rom_com.h" #ifdef DEBUGGING #include "debug.h" #endif + #define SIMILAR_TNS_THRESHOLD_FX_IN_Q15 ( 1311 ) #define TNS_GAIN_THRESHOLD_FOR_WHITE_FX_IN_Q7 ( 384 ) #define TNS_GAIN_THRESHOLD_FOR_WHITE_FX_IN_Q23 ( 25165824 ) diff --git a/lib_enc/core_enc_init_fx.c b/lib_enc/core_enc_init_fx.c index b46e4cb71..7bf836a6d 100644 --- a/lib_enc/core_enc_init_fx.c +++ b/lib_enc/core_enc_init_fx.c @@ -3,13 +3,10 @@ ====================================================================================*/ #include -// #include "prot_fx.h" -// #include "basop_mpy.h" #include "options.h" #include "cnst.h" #include "stl.h" #include "basop_util.h" -#include "rom_com_fx.h" #include "ivas_cnst.h" #include #include "rom_com.h" /* Common constants */ diff --git a/lib_enc/core_enc_ol_fx.c b/lib_enc/core_enc_ol_fx.c index 2f2682b8e..c8c075e68 100644 --- a/lib_enc/core_enc_ol_fx.c +++ b/lib_enc/core_enc_ol_fx.c @@ -6,9 +6,7 @@ #include #include "options.h" #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" #include "basop_util.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/core_enc_reconf_fx.c b/lib_enc/core_enc_reconf_fx.c index 9e7380aaa..5f01935c7 100644 --- a/lib_enc/core_enc_reconf_fx.c +++ b/lib_enc/core_enc_reconf_fx.c @@ -4,20 +4,20 @@ #include #include "options.h" -//#include "prot_fx.h" -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" +#include "cnst.h" /* Common constants */ #include "rom_enc.h" /* Encoder static table prototypes */ #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*-----------------------------------------------------------------* - * Funtion core_coder_reconfig_fx * + * Funtion core_coder_reconfig_fx * * ~~~~~~~~~~~~~~~~~~~ * * - reconfig core coder when switching to another frame type * *-----------------------------------------------------------------*/ + void core_coder_reconfig_fx( Encoder_State *st, const Word32 last_total_brate ) diff --git a/lib_enc/core_enc_switch_fx.c b/lib_enc/core_enc_switch_fx.c index fb5fd037a..52f799442 100644 --- a/lib_enc/core_enc_switch_fx.c +++ b/lib_enc/core_enc_switch_fx.c @@ -1,13 +1,13 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include #include "options.h" #include "prot_fx.h" #include "cnst.h" /* Common constants */ #include "ivas_cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ diff --git a/lib_enc/core_switching_enc_fx.c b/lib_enc/core_switching_enc_fx.c index fcfe151f6..0752d5fe7 100644 --- a/lib_enc/core_switching_enc_fx.c +++ b/lib_enc/core_switching_enc_fx.c @@ -1,13 +1,12 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_enc.h" /* Encoder static table prototypes */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "ivas_prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index bc5feeb6b..6f20edc4f 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -6,9 +6,7 @@ #include #include "options.h" #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" #include "stat_enc.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/diffcod_fx.c b/lib_enc/diffcod_fx.c index 51a31fa8a..6a14a27ee 100644 --- a/lib_enc/diffcod_fx.c +++ b/lib_enc/diffcod_fx.c @@ -1,14 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Compilation switches */ -#include "rom_com_fx.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function Prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Compilation switches */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*--------------------------------------------------------------------------*/ /* Function diffcod */ /* ~~~~~~~~~~~~~~~~~ */ diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 442c548e9..7d2a8395e 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -1,19 +1,20 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" #include "rom_com.h" -// #include "basop_mpy.h" #include #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ + #define ALPHA_ENER_FAST_FX 29491 /* Fast adaptation (noise down, speech up) */ #define ALPHA_ENER_SLOW_FX 32440 /* Fast adaptation (noise down, speech up) */ @@ -33,11 +34,14 @@ #define MAX_BRATE_DTX_EVS ACELP_24k40 /* maximum bitrate to which the default DTX is applied in EVS; otherwise DTX is applied only in silence */ #define MAX_BRATE_DTX_IVAS IVAS_80k /* maximum bitrate to which the default DTX is applied in IVAS; otherwise DTX is applied only in silence */ + /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ static void update_SID_cnt_fx( DTX_ENC_HANDLE hDtxEnc, const Word32 core_brate, const Word16 Opt_AMR_WB ); + + /*==================================================================================*/ /* FUNCTION : dtx_ivas_fx() */ /*----------------------------------------------------------------------------------*/ diff --git a/lib_enc/enc_acelp_fx.c b/lib_enc/enc_acelp_fx.c index e9feb81d3..711f5052d 100644 --- a/lib_enc/enc_acelp_fx.c +++ b/lib_enc/enc_acelp_fx.c @@ -1,15 +1,14 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "typedef.h" #include #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" #include "basop_util.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "rom_enc.h" #include "prot_fx.h" /* Function prototypes */ @@ -51,7 +50,15 @@ void E_ACELP_corrmatrix_fx( Word16 h[] /*Q12*/, Word16 sign[] /*Q0*/, Word16 vec * Returns: * void */ -void E_ACELP_h_vec_corr1_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 track /*Q0*/, Word16 sign[] /*Q15*/, Word16 ( *rrixix )[16] /*Q9*/, Word16 cor[] /*Q9*/, Word16 dn2_pos[] /*Q0*/, Word16 nb_pulse /*Q0*/ ) +void E_ACELP_h_vec_corr1_fx( + Word16 h[] /*Qx*/, + Word16 vec[] /*Qx*/, + UWord8 track /*Q0*/, + Word16 sign[] /*Q15*/, + Word16 ( *rrixix )[16] /*Q9*/, + Word16 cor[] /*Q9*/, + Word16 dn2_pos[] /*Q0*/, + Word16 nb_pulse /*Q0*/ ) { Word16 i, j; Word16 dn, corr; @@ -97,7 +104,14 @@ void E_ACELP_h_vec_corr1_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 trac return; } -void E_ACELP_h_vec_corr2_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 track /*Q0*/, Word16 sign[] /*Q15*/, Word16 ( *rrixix )[16] /*Q9*/, Word16 cor[] /*Q9*/ ) + +void E_ACELP_h_vec_corr2_fx( + Word16 h[] /*Qx*/, + Word16 vec[] /*Qx*/, + UWord8 track /*Q0*/, + Word16 sign[] /*Q15*/, + Word16 ( *rrixix )[16] /*Q9*/, + Word16 cor[] /*Q9*/ ) { Word16 i, j, pos, corr; Word16 *p0, *p1, *p2; @@ -164,7 +178,19 @@ void E_ACELP_h_vec_corr2_fx( Word16 h[] /*Qx*/, Word16 vec[] /*Qx*/, UWord8 trac * Returns: * void */ -static void E_ACELP_2pulse_search( Word16 nb_pos_ix /*Q0*/, UWord8 track_x /*Q0*/, UWord8 track_y /*Q0*/, Word16 *ps /*Qdn*/, Word16 *alp /*Qx*/, Word16 *ix /*Q0*/, Word16 *iy /*Q0*/, Word16 dn[] /*Qdn*/, Word16 *dn2 /*Q0*/, Word16 cor_x[] /*Qx*/, Word16 cor_y[] /*Qx*/, Word16 ( *rrixiy )[256] /*Q9*/ ) +static void E_ACELP_2pulse_search( + Word16 nb_pos_ix /*Q0*/, + UWord8 track_x /*Q0*/, + UWord8 track_y /*Q0*/, + Word16 *ps /*Qdn*/, + Word16 *alp /*Qx*/, + Word16 *ix /*Q0*/, + Word16 *iy /*Q0*/, + Word16 dn[] /*Qdn*/, + Word16 *dn2 /*Q0*/, + Word16 cor_x[] /*Qx*/, + Word16 cor_y[] /*Qx*/, + Word16 ( *rrixiy )[256] /*Q9*/ ) { Word16 x, x2, y, i, *pos_x; Word16 ps0, ps1, alp2_16, ps2, sq; @@ -291,13 +317,14 @@ static void E_ACELP_2pulse_search( Word16 nb_pos_ix /*Q0*/, UWord8 track_x /*Q0* * Returns: * void */ -static void E_ACELP_1pulse_search( UWord8 tracks[2], - Word16 *ps, /*Qdn*/ - Word16 *alp, /*Qx*/ - Word16 *ix, /*Q0*/ - Word16 dn[], /*Qdn*/ - Word16 cor_x[], /*Q6*/ - Word16 cor_y[] /*Q6*/ ) +static void E_ACELP_1pulse_search( + UWord8 tracks[2], + Word16 *ps, /*Qdn*/ + Word16 *alp, /*Qx*/ + Word16 *ix, /*Q0*/ + Word16 dn[], /*Qdn*/ + Word16 cor_x[], /*Q6*/ + Word16 cor_y[] /*Q6*/ ) { Word16 x, x_save = 0; Word16 ps0; @@ -400,7 +427,11 @@ static void E_ACELP_1pulse_search( UWord8 tracks[2], * Returns: * void */ -static void E_ACELP_xh_corr( Word16 *x /*Qx*/, Word16 *y /*Qy*/, Word16 *h /*Q12*/, Word16 L_subfr /*Q0*/ ) +static void E_ACELP_xh_corr( + Word16 *x /*Qx*/, + Word16 *y /*Qy*/, + Word16 *h /*Q12*/, + Word16 L_subfr /*Q0*/ ) { Word16 i, j, k; Word32 L_tmp, y32[L_SUBFR16k], L_maxloc, L_tot; @@ -452,7 +483,11 @@ static void E_ACELP_xh_corr( Word16 *x /*Qx*/, Word16 *y /*Qy*/, Word16 *h /*Q12 * \param bits amount of target headroom bits for y * \return exponent of y */ -Word16 E_ACELP_hh_corr( Word16 *x /*Q11*/, Word16 *y /*Qy*/, Word16 L_subfr /*Q0*/, Word16 bits /*Q0*/ ) +Word16 E_ACELP_hh_corr( + Word16 *x /*Q11*/, + Word16 *y /*Qy*/, + Word16 L_subfr /*Q0*/, + Word16 bits /*Q0*/ ) { Word16 i, j, k = 0; /* initialize just to avoid compiler warning */ Word32 L_tmp, L_sum; @@ -518,7 +553,13 @@ Word16 E_ACELP_hh_corr( Word16 *x /*Q11*/, Word16 *y /*Qy*/, Word16 L_subfr /*Q0 * Returns: * pitch gain (0 ... 1.2F) (Q14) */ -Word16 E_ACELP_xy1_corr_fx( Word16 xn[] /*Q15-exp_xn*/, Word16 y1[] /*Q15-exp_xn*/, ACELP_CbkCorr *g_corr, Word16 norm_flag /*Q0*/, Word16 L_subfr /*Q0*/, Word16 exp_xn ) +Word16 E_ACELP_xy1_corr_fx( + Word16 xn[] /*Q15-exp_xn*/, + Word16 y1[] /*Q15-exp_xn*/, + ACELP_CbkCorr *g_corr, + Word16 norm_flag /*Q0*/, + Word16 L_subfr /*Q0*/, + Word16 exp_xn ) { Word16 i, Q_xn; Word16 xy, yy, exp_xy, exp_yy, gain; @@ -622,7 +663,13 @@ bail: * Returns: * pitch gain (0 ... 1.2F) */ -void E_ACELP_xy2_corr( Word16 xn[] /*Q_xn*/, Word16 y1[] /*Q_xn*/, Word16 y2[] /*Q9*/, ACELP_CbkCorr *g_corr, Word16 L_subfr /*Q0*/, Word16 exp_xn ) +void E_ACELP_xy2_corr( + Word16 xn[] /*Q_xn*/, + Word16 y1[] /*Q_xn*/, + Word16 y2[] /*Q9*/, + ACELP_CbkCorr *g_corr, + Word16 L_subfr /*Q0*/, + Word16 exp_xn ) { Word16 xny2, y2y2, y1y2, xx, exp_xny2, exp_y2y2, exp_y1y2, exp_xx; Word32 L_off; @@ -684,7 +731,12 @@ void E_ACELP_xy2_corr( Word16 xn[] /*Q_xn*/, Word16 y1[] /*Q_xn*/, Word16 y2[] / * Returns: * void */ -void E_ACELP_codebook_target_update_fx( Word16 *x /*Q_xn*/, Word16 *x2 /*Q_xn*/, Word16 *y /*Q_xn*/, Word16 gain /*Q14*/, Word16 L_subfr /*Q0*/ ) +void E_ACELP_codebook_target_update_fx( + Word16 *x /*Q_xn*/, + Word16 *x2 /*Q_xn*/, + Word16 *y /*Q_xn*/, + Word16 gain /*Q14*/, + Word16 L_subfr /*Q0*/ ) { Word16 i, Q15_flag; Word32 L_tmp; @@ -736,7 +788,15 @@ void E_ACELP_codebook_target_update_fx( Word16 *x /*Q_xn*/, Word16 *x2 /*Q_xn*/, * Returns: * void */ -void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 dn2[] /*Qdn2*/, Word16 sign[] /*Q13*/, Word16 vec[] /*Q15*/, const Word16 alp /*Q13*/, const Word16 sign_val /*Q15*/, const Word16 L_subfr /*Q0*/ ) +void E_ACELP_pulsesign( + const Word16 cn[] /*Q_xn*/, + Word16 dn[] /*Qdn*/, + Word16 dn2[] /*Qdn2*/, + Word16 sign[] /*Q13*/, + Word16 vec[] /*Q15*/, + const Word16 alp /*Q13*/, + const Word16 sign_val /*Q15*/, + const Word16 L_subfr /*Q0*/ ) { Word16 i; Word32 Lval, Lcor; @@ -813,7 +873,10 @@ void E_ACELP_pulsesign( const Word16 cn[] /*Q_xn*/, Word16 dn[] /*Qdn*/, Word16 } -void E_ACELP_findcandidates( Word16 dn2[] /*Qx*/, Word16 dn2_pos[] /*Q0*/, Word16 pos_max[] /*Q0*/ ) +void E_ACELP_findcandidates( + Word16 dn2[] /*Qx*/, + Word16 dn2_pos[] /*Q0*/, + Word16 pos_max[] /*Q0*/ ) { Word16 i, k, j, i8; Word16 *ps_ptr; @@ -845,7 +908,9 @@ void E_ACELP_findcandidates( Word16 dn2[] /*Qx*/, Word16 dn2_pos[] /*Q0*/, Word1 } -static void E_ACELP_apply_sign( Word16 *p0 /*Qx*/, Word16 *psign0 /*Q15*/ ) +static void E_ACELP_apply_sign( + Word16 *p0 /*Qx*/, + Word16 *psign0 /*Q15*/ ) { p0[0] = mult_r( p0[0], psign0[0] ); /*Qx*/ move16(); @@ -879,9 +944,14 @@ static void E_ACELP_apply_sign( Word16 *p0 /*Qx*/, Word16 *psign0 /*Q15*/ ) move16(); p0[15] = mult_r( p0[15], psign0[60] ); move16(); + + return; } -void E_ACELP_vec_neg_fx( Word16 h[] /*Qx*/, Word16 h_inv[] /*Qx*/, Word16 L_subfr /*Q0*/ ) +void E_ACELP_vec_neg_fx( + Word16 h[] /*Qx*/, + Word16 h_inv[] /*Qx*/, + Word16 L_subfr /*Q0*/ ) { Word16 i; @@ -890,10 +960,17 @@ void E_ACELP_vec_neg_fx( Word16 h[] /*Qx*/, Word16 h_inv[] /*Qx*/, Word16 L_subf h_inv[i] = negate( h[i] ); move16(); } + + return; } -void E_ACELP_corrmatrix_fx( Word16 h[] /*Q12*/, Word16 sign[] /*Q0*/, Word16 vec[] /*Q15*/, Word16 rrixix[4][16] /*Q9*/, Word16 rrixiy[4][256] /*Q9*/ ) +void E_ACELP_corrmatrix_fx( + Word16 h[] /*Q12*/, + Word16 sign[] /*Q0*/, + Word16 vec[] /*Q15*/, + Word16 rrixix[4][16] /*Q9*/, + Word16 rrixiy[4][256] /*Q9*/ ) { Word16 *p0, *p1, *p2, *p3, *psign0, *psign1, *psign2, *psign3; @@ -931,7 +1008,6 @@ void E_ACELP_corrmatrix_fx( Word16 h[] /*Q12*/, Word16 sign[] /*Q0*/, Word16 vec *p0-- = round_fx( L_shr( cor, 1 ) ); /* Q9 */ } - /* * Compute rrixiy[][] needed for the codebook search. */ @@ -1068,13 +1144,29 @@ void E_ACELP_corrmatrix_fx( Word16 h[] /*Q12*/, Word16 sign[] /*Q0*/, Word16 vec E_ACELP_apply_sign( p3, psign3 ); p3 += 16; } + return; } #ifndef REUSE_EVS_BE_ACELP_4T64 -void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ) +void E_ACELP_4tsearch_fx( + Word16 dn[] /*Qdn*/, + const Word16 cn[] /*Q_xn*/, + const Word16 H[] /*Q12*/, + Word16 code[] /*Q9*/, + const PulseConfig *config, + Word16 ind[] /*Q0*/, + Word16 y[] /*Qy*/ ) #else -void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/, const Word16 element_mode ) +void E_ACELP_4tsearch_fx( + Word16 dn[] /*Qdn*/, + const Word16 cn[] /*Q_xn*/, + const Word16 H[] /*Q12*/, + Word16 code[] /*Q9*/, + const PulseConfig *config, + Word16 ind[] /*Q0*/, + Word16 y[] /*Qy*/, + const Word16 element_mode ) #endif { Word16 sign[L_SUBFR], vec[L_SUBFR]; @@ -1099,7 +1191,6 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const move32(); #endif - alp = config->alp; /* Q13 */ /* initial value for energy of all fixed pulses */ move16(); nb_pulse = config->nb_pulse; @@ -1163,13 +1254,11 @@ void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const E_ACELP_vec_neg_fx( h, h_inv, L_SUBFR ); - /* * Compute correlation matrices needed for the codebook search. */ E_ACELP_corrmatrix_fx( h, sign, vec, rrixix, rrixiy ); - /* * Deep first search: * ------------------ @@ -1803,7 +1892,6 @@ void E_ACELP_4t_fx( move16(); memcpy( &config, &PulseConfTable[cdk_index], sizeof( PulseConfTable[cdk_index] ) ); - if ( cmpl_flag > 0 ) { config.nbiter = cmpl_flag; @@ -1834,6 +1922,7 @@ void E_ACELP_4t_fx( #endif } E_ACELP_indexing_fx( code, &config, NB_TRACK_FCB_4T, _index ); + return; } #ifndef REUSE_EVS_BE_ACELP_4T64 @@ -1901,6 +1990,8 @@ void E_ACELP_4t_ivas_fx( return; } #endif + + static void E_ACELP_indexing_shift( Word16 wordcnt, /* i: 16-bit word count including the newly shifted-in bits Q0*/ Word16 shift_bits, /* i: number of bits to shift in from the lsb Q0*/ @@ -2049,11 +2140,13 @@ Word16 E_ACELP_indexing_fx( return saved_bits; } + /*--------------------------------------------------------------------------* * E_ACELP_adaptive_codebook * * Find adaptive codebook. *--------------------------------------------------------------------------*/ + void E_ACELP_adaptive_codebook( Word16 *exc, /* i/o: pointer to the excitation frame Q_new */ Word16 T0, /* i : integer pitch lag Q0 */ @@ -2252,6 +2345,7 @@ void E_ACELP_adaptive_codebook( * * Find innovative codebook. *--------------------------------------------------------------------------*/ + void E_ACELP_innovative_codebook_fx( Word16 *exc, /* i : pointer to the excitation frame Q_new */ Word16 T0, /* i : integer pitch lag Q0 */ @@ -2280,7 +2374,6 @@ void E_ACELP_innovative_codebook_fx( Word16 Rw2[L_SUBFR]; Word16 pitch, idx; - pitch = T0; move16(); idx = shr( i_subfr, 6 ); @@ -2354,7 +2447,12 @@ void E_ACELP_innovative_codebook_fx( * n - (output) range of possible states (0...n-1) * p - (output) number of pulses found *--------------------------------------------------------------------------*/ -static void E_ACELP_codearithp_fx( const Word16 v[] /*Q9*/, UWord32 *n /*Q0*/, UWord32 *ps /*Q0*/, Word16 *p /*Q0*/ ) + +static void E_ACELP_codearithp_fx( + const Word16 v[] /*Q9*/, + UWord32 *n /*Q0*/, + UWord32 *ps /*Q0*/, + Word16 *p /*Q0*/ ) { Word16 k, nb_pulse, i, t, pos[NPMAXPT], posno; Word16 sign, m; @@ -2439,10 +2537,17 @@ static void E_ACELP_codearithp_fx( const Word16 v[] /*Q9*/, UWord32 *n /*Q0*/, U *p = nb_pulse; /*Q0*/ move16(); + return; } -void fcb_pulse_track_joint_fx( UWord16 *idxs /*Q0*/, Word16 wordcnt /*Q0*/, UWord32 *index_n /*Q0*/, Word16 *pulse_num /*Q0*/, Word16 track_num /*Q0*/ ) + +void fcb_pulse_track_joint_fx( + UWord16 *idxs /*Q0*/, + Word16 wordcnt /*Q0*/, + UWord32 *index_n /*Q0*/, + Word16 *pulse_num /*Q0*/, + Word16 track_num /*Q0*/ ) { Word16 hi_to_low[10]; UWord32 index, index_mask; @@ -2557,5 +2662,6 @@ void fcb_pulse_track_joint_fx( UWord16 *idxs /*Q0*/, Word16 wordcnt /*Q0*/, UWor idxs[track] = extract_l( index ); index = L_lshr( index, 16 ); } + return; } diff --git a/lib_enc/enc_amr_wb_fx.c b/lib_enc/enc_amr_wb_fx.c index d9048ac69..69f8106be 100644 --- a/lib_enc/enc_amr_wb_fx.c +++ b/lib_enc/enc_amr_wb_fx.c @@ -1,21 +1,22 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * encod_amr_wb() * * Encode excitation signal in AMR-WB IO mode *-------------------------------------------------------------------*/ + void encod_amr_wb_fx( Encoder_State *st, /* i/o: state structure */ const Word16 speech[], /* i : input speech Q_new-1*/ diff --git a/lib_enc/enc_gain_fx.c b/lib_enc/enc_gain_fx.c index 7c9606cfc..1789813cc 100644 --- a/lib_enc/enc_gain_fx.c +++ b/lib_enc/enc_gain_fx.c @@ -6,15 +6,12 @@ #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "rom_enc.h" #include "basop_util.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ -void E_GAIN_norm_corr_fx( Word16 exc[] /*Q_new*/, Word16 xn[] /*(Q_new+shift-1)*/, Word16 h[] /*(Q14+shift)*/, Word16 t_min, Word16 t_max, Word16 corr_norm[] /*(Q15+(Q_new+shift-1)+scale)*/, Word16 L_subfr ); /* * E_GAIN_norm_corr @@ -36,14 +33,21 @@ void E_GAIN_norm_corr_fx( Word16 exc[] /*Q_new*/, Word16 xn[] /*(Q_new+shift-1)* * Returns: * void */ -void E_GAIN_norm_corr_fx( Word16 exc[] /*Q_new*/, Word16 xn[] /*(Q_new+shift-1)*/, Word16 h[] /*(Q14+shift)*/, Word16 t_min, Word16 t_max, Word16 corr_norm[] /*(Q15+(Q_new+shift-1)+scale)*/, Word16 L_subfr ) + +static void E_GAIN_norm_corr_fx( + Word16 exc[] /*Q_new*/, + Word16 xn[] /*(Q_new+shift-1)*/, + Word16 h[] /*(Q14+shift)*/, + Word16 t_min, + Word16 t_max, + Word16 corr_norm[] /*(Q15+(Q_new+shift-1)+scale)*/, + Word16 L_subfr ) { Word16 excf[L_SUBFR]; /* filtered past excitation (Q_new+shift-1) */ Word16 ps, norm, exp_alp, exp_ps, scale, L_subfr2; Word16 t, j, k; Word32 L_tmp, L_tmp2; - k = negate( t_min ); L_subfr2 = shr( L_subfr, 1 ); diff --git a/lib_enc/enc_gen_voic_fx.c b/lib_enc/enc_gen_voic_fx.c index 26b8ec31e..87b984767 100644 --- a/lib_enc/enc_gen_voic_fx.c +++ b/lib_enc/enc_gen_voic_fx.c @@ -1,11 +1,11 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/enc_gen_voic_rf_fx.c b/lib_enc/enc_gen_voic_rf_fx.c index 0e79baa5f..821ccbbc3 100644 --- a/lib_enc/enc_gen_voic_rf_fx.c +++ b/lib_enc/enc_gen_voic_rf_fx.c @@ -5,7 +5,6 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "stl.h" #include "rom_basop_util.h" #include "rom_com.h" /* Common constants */ diff --git a/lib_enc/enc_higher_acelp_fx.c b/lib_enc/enc_higher_acelp_fx.c index 986bdde0b..053d0e7ac 100644 --- a/lib_enc/enc_higher_acelp_fx.c +++ b/lib_enc/enc_higher_acelp_fx.c @@ -1,22 +1,26 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "prot_fx.h" /* Function prototypes */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx_enc.h" + /*---------------------------------------------------------------------* * Local function prototype *---------------------------------------------------------------------*/ + static void find_cn_fx( const Word16 xn[], const Word16 Ap[], const Word16 *p_Aq, Word16 cn[] ); + /*-----------------------------------------------------------------* * Transform domain contribution encoding *-----------------------------------------------------------------*/ + #define Q_MINUS 4 void transf_cdbk_enc_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ diff --git a/lib_enc/enc_pit_exc_fx.c b/lib_enc/enc_pit_exc_fx.c index 395f7da93..f36c97dd6 100644 --- a/lib_enc/enc_pit_exc_fx.c +++ b/lib_enc/enc_pit_exc_fx.c @@ -1,14 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*======================================================================*/ /* FUNCTION : enc_pit_exc_fx() */ /*----------------------------------------------------------------------*/ diff --git a/lib_enc/enc_prm_fx.c b/lib_enc/enc_prm_fx.c index 6d6a2d575..94d869a01 100644 --- a/lib_enc/enc_prm_fx.c +++ b/lib_enc/enc_prm_fx.c @@ -8,7 +8,6 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stl.h" #include "prot_fx.h" diff --git a/lib_enc/enc_tran_fx.c b/lib_enc/enc_tran_fx.c index 23f1377aa..9edf1087a 100644 --- a/lib_enc/enc_tran_fx.c +++ b/lib_enc/enc_tran_fx.c @@ -1,15 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Compilation switches */ -// #include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Compilation switches */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*=================================================================================*/ /* FUNCTION : void encod_tran_fx () */ /*---------------------------------------------------------------------------------*/ diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index ce7f05968..eafe13f53 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -1,17 +1,19 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local constantes *-------------------------------------------------------------------*/ + #define NB_VOIC_FX 13 #define DIV_NB_VOIC_FX 2521 @@ -23,6 +25,7 @@ #define HANGOVER_DELAY 2 + /*======================================================================*/ /* FUNCTION : Pit_exc_contribution_len_fx() */ /*----------------------------------------------------------------------*/ @@ -41,23 +44,21 @@ /* _ (Word16[]) dct_res : DCT of residual Qnew */ /* _ (Word16[]) dct_pitex : DCT of pitch contribution Qnew */ /*-----------------------------------------------------------------------*/ - - /*-----------------------------------------------------------------------*/ /* RETURN ARGUMENTS : */ /* _ None */ /*=======================================================================*/ -Word16 Pit_exc_contribution_len_fx( /* o : bin where pitch contribution is significant */ - Encoder_State *st_fx, /* i/o: state structure */ - const Word16 *dct_res, /* i : DCT of residual Qnew*/ - Word16 *dct_pitex, /* i/o: DCT of pitch contribution Qnew*/ - Word16 *pitch_buf, /* i/o: Pitch per subframe Q6*/ - const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ - Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ - Word16 Qnew ) +/* o : bin where pitch contribution is significant */ +Word16 Pit_exc_contribution_len_fx( + Encoder_State *st_fx, /* i/o: state structure */ + const Word16 *dct_res, /* i : DCT of residual Qnew*/ + Word16 *dct_pitex, /* i/o: DCT of pitch contribution Qnew*/ + Word16 *pitch_buf, /* i/o: Pitch per subframe Q6*/ + const Word16 nb_subfr, /* i : Number of subframe considered Q0*/ + Word16 *hangover, /* i : hangover for the time contribution switching Q0*/ + Word16 Qnew ) { - Word16 corr_dct_pit[MBANDS_LOC]; Word32 corr_tmp, L_tmp; Word16 av_corr, min_corr, ftmp, tmp_ex, tmp_res; diff --git a/lib_enc/fd_cng_enc_fx.c b/lib_enc/fd_cng_enc_fx.c index 9298c8634..e5011b577 100644 --- a/lib_enc/fd_cng_enc_fx.c +++ b/lib_enc/fd_cng_enc_fx.c @@ -2,13 +2,11 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ - #include #include "stl.h" #include "options.h" #include "cnst.h" #include "stl.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "rom_enc.h" #include "prot_fx.h" diff --git a/lib_enc/gain_enc_fx.c b/lib_enc/gain_enc_fx.c index ea7a26685..af940f595 100644 --- a/lib_enc/gain_enc_fx.c +++ b/lib_enc/gain_enc_fx.c @@ -1,15 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ @@ -17,12 +17,14 @@ #define RANGE 64 #define NB_QUA_GAIN7B 128 /* Number of quantization levels */ + /*-------------------------------------------------------------------* * Local function prototype *-------------------------------------------------------------------*/ static Word16 Find_Opt_gainQ_fx( Word16 *coeff, Word16 *exp_coeff, Word16 *gain_pit, Word32 *gain_code, Word16 gcode0, Word16 exp_gcode0, const Word16 *cdbk, const Word16 size ); + /*==========================================================================*/ /* FUNCTION : Es_pred_enc_fx() */ /*--------------------------------------------------------------------------*/ diff --git a/lib_enc/gaus_enc_fx.c b/lib_enc/gaus_enc_fx.c index 986f15bbc..acf87b022 100644 --- a/lib_enc/gaus_enc_fx.c +++ b/lib_enc/gaus_enc_fx.c @@ -1,15 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "rom_enc.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ -//#include "basop_mpy.h" + /*-------------------------------------------------------------------* * Local constants @@ -19,6 +19,7 @@ /* #define FAC_DELTA 16.0f */ #define SFAC_DELTA 11 + /*-------------------------------------------------------------------* * Local functions *-------------------------------------------------------------------*/ @@ -29,6 +30,8 @@ static void gauss2v_fx( BSTR_ENC_HANDLE hBstr, const Word16 h[], const Word16 xn #ifndef REUSE_EVS_BE_GAUSS static void gauss2v_ivas_fx( BSTR_ENC_HANDLE hBstr, const Word16 h[], const Word16 xn[], const Word16 dn[], Word16 code[], Word16 y1[], Word32 *gain, const Word16 lg, const Word16 shift, const Word16 Q_new, const Word16 nb_bits ); #endif + + /*-------------------------------------------------------------------* * Gaus_encode * diff --git a/lib_enc/gs_enc_fx.c b/lib_enc/gs_enc_fx.c index 7bf52970d..488a32ab4 100644 --- a/lib_enc/gs_enc_fx.c +++ b/lib_enc/gs_enc_fx.c @@ -1,25 +1,28 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ static Word16 edyn_fx( const Word16 *vec, const Word16 lvec, Word16 Qnew ); + /*-------------------------------------------------------------------* * encod_audio() * * Encode audio (AC) frames *-------------------------------------------------------------------*/ + void encod_audio_fx( Encoder_State *st_fx, /* i/o: State structure */ const Word16 speech[], /* i : input speech Q_new */ diff --git a/lib_enc/hf_cod_amrwb_fx.c b/lib_enc/hf_cod_amrwb_fx.c index e21a8bd67..cf390b2db 100644 --- a/lib_enc/hf_cod_amrwb_fx.c +++ b/lib_enc/hf_cod_amrwb_fx.c @@ -1,22 +1,23 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "cnst.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*---------------------------------------------------------------------* * hf_cod_init() * * *---------------------------------------------------------------------*/ + void hf_cod_init_fx( Word16 *mem_hp400_enc, /* o: memory of hp 400 Hz filter */ Word16 *mem_hf1_enc, /* o: HF band-pass filter memory */ diff --git a/lib_enc/hq_classifier_enc_fx.c b/lib_enc/hq_classifier_enc_fx.c index aa2c319f1..9abeb2d58 100644 --- a/lib_enc/hq_classifier_enc_fx.c +++ b/lib_enc/hq_classifier_enc_fx.c @@ -1,15 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-----------------------------------------------------------------* * Local constants *-----------------------------------------------------------------*/ @@ -28,20 +28,20 @@ *-----------------------------------------------------------------*/ void hvq_classifier_fx( const Word32 *input /*Q12*/, Word16 *prev_Npeaks, Word16 *prev_peaks, Word16 *hqswb_clas, Word16 *Npeaks, Word16 *peaks, const Word32 L_core_brate, const Word16 last_core, Word32 *L_nf_gains /*Q12*/, Word16 *hvq_hangover, Word32 *L_pe_gains /*Q12*/ ); -static Word16 hf_spectrum_sparseness_fx( - Encoder_State *st, /* i/o: encoder state structure */ - const Word32 *coefs_fx /* i : MDCT spectrum Q12*/ -); +static Word16 hf_spectrum_sparseness_fx( Encoder_State *st, const Word32 *coefs_fx ); + + /*--------------------------------------------------------------------------* * hf_spectrum_sparseness() * * Detection of sparse spectrum in high band for activation of harmonic * modes HQ_HARMONIC and HQ_HVQ *--------------------------------------------------------------------------*/ + /*! r: Harmonic decision for high band */ static Word16 hf_spectrum_sparseness_fx( Encoder_State *st, /* i/o: encoder state structure */ - const Word32 *coefs_fx /* i : MDCT spectrum (Q12) */ + const Word32 *coefs_fx /* i : MDCT spectrum (Q12) */ ) { Word16 i; diff --git a/lib_enc/hq_core_enc_fx.c b/lib_enc/hq_core_enc_fx.c index b5e1abbca..edf20eeba 100644 --- a/lib_enc/hq_core_enc_fx.c +++ b/lib_enc/hq_core_enc_fx.c @@ -1,14 +1,15 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------------- * hq_core_enc() * @@ -17,11 +18,11 @@ void hq_core_enc_fx( Encoder_State *st_fx, - const Word16 *audio, /* i : input audio signal Q0 */ - const Word16 input_frame_orig, /* i : frame length Q0*/ - const Word16 hq_core_type, /* i : HQ core type Q0*/ - const Word16 Voicing_flag, /* i : Voicing flag for FER method selection Q0*/ - const Word16 vad_hover_flag /* i : VAD hangover flag Q0*/ + const Word16 *audio, /* i : input audio signal Q0*/ + const Word16 input_frame_orig, /* i : frame length Q0*/ + const Word16 hq_core_type, /* i : HQ core type Q0*/ + const Word16 Voicing_flag, /* i : Voicing flag for FER method selection Q0*/ + const Word16 vad_hover_flag /* i : VAD hangover flag Q0*/ ) { Word16 i, is_transient, num_bits, extra_unused; diff --git a/lib_enc/hq_hr_enc_fx.c b/lib_enc/hq_hr_enc_fx.c index 05654e775..f462ca4dc 100644 --- a/lib_enc/hq_hr_enc_fx.c +++ b/lib_enc/hq_hr_enc_fx.c @@ -1,20 +1,22 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -#include "prot_fx.h" /* Function prototypes */ +#include "rom_com.h" /* Static table prototypes */ +#include "prot_fx.h" /* Function prototypes */ #include "ivas_prot_fx.h" #include "prot_fx_enc.h" /* Function prototypes */ + + /*--------------------------------------------------------------------------* * hq_hr_enc_fx() * * HQ High rate encoding routine *--------------------------------------------------------------------------*/ + void hq_hr_enc_fx( Encoder_State *st_fx, /* i/o: encoder state structure fx */ Word32 *t_audio, /* i/o: transform-domain coefficients Q12 */ diff --git a/lib_enc/hq_lr_enc_fx.c b/lib_enc/hq_lr_enc_fx.c index af2780682..5364a43d5 100644 --- a/lib_enc/hq_lr_enc_fx.c +++ b/lib_enc/hq_lr_enc_fx.c @@ -1,18 +1,17 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" #include "cnst.h" -// #include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_enc.h" -// #include "basop_mpy.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*--------------------------------------------------------------------------* * Local function prototypes *--------------------------------------------------------------------------*/ diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index 0ee479a7c..b84fd8fb7 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -2,11 +2,9 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -// #include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "stl.h" #include "ivas_cnst.h" #include "ivas_error.h" @@ -29,8 +27,6 @@ ivas_error init_encoder_fx( { Word16 i; Word32 L_tmp; - - Word16 idchan = 0; /* i : channel ID */ Word16 vad_only_flag = 0; /* i : channel ID */ move16(); diff --git a/lib_enc/inov_enc_fx.c b/lib_enc/inov_enc_fx.c index 86200cb43..ca74961e6 100644 --- a/lib_enc/inov_enc_fx.c +++ b/lib_enc/inov_enc_fx.c @@ -1,12 +1,11 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ #include "basop_util.h" -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "ivas_prot_fx.h" /* Function prototypes */ diff --git a/lib_enc/ivas_dirac_enc_fx.c b/lib_enc/ivas_dirac_enc_fx.c index bc1f65c95..befd5a09d 100644 --- a/lib_enc/ivas_dirac_enc_fx.c +++ b/lib_enc/ivas_dirac_enc_fx.c @@ -39,12 +39,13 @@ #include "ivas_prot_fx.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "wmc_auto.h" + /*------------------------------------------------------------------------- * Local function prototypes *------------------------------------------------------------------------*/ + static void computeIntensityVector_enc_fx( const DIRAC_ENC_HANDLE hDirAC, Word32 Cldfb_RealBuffer[DIRAC_MAX_ANA_CHANS][DIRAC_NO_FB_BANDS_MAX], @@ -55,6 +56,7 @@ static void computeIntensityVector_enc_fx( Word16 q_cldfb, Word16 q_intensity_real[DIRAC_MAX_NBANDS] ); + /*------------------------------------------------------------------------- * ivas_dirac_enc_open() * diff --git a/lib_enc/ivas_ism_metadata_enc_fx.c b/lib_enc/ivas_ism_metadata_enc_fx.c index d35327de0..32582f2db 100644 --- a/lib_enc/ivas_ism_metadata_enc_fx.c +++ b/lib_enc/ivas_ism_metadata_enc_fx.c @@ -41,7 +41,6 @@ #include #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-----------------------------------------------------------------------* diff --git a/lib_enc/ivas_ism_param_enc_fx.c b/lib_enc/ivas_ism_param_enc_fx.c index cda8cffd6..47da31a1a 100644 --- a/lib_enc/ivas_ism_param_enc_fx.c +++ b/lib_enc/ivas_ism_param_enc_fx.c @@ -40,7 +40,6 @@ #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "wmc_auto.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------- * Local function definitions @@ -310,7 +309,7 @@ void ivas_param_ism_stereo_dmx_fx( cardioid_right[i] = sub( ONE_IN_Q14 /* 1.0f in Q14 */, cardioid_left[i] ); /* corresponds to: alpha + ( 1 - alpha ) * cosf( tmp + tmp_1 ); */ move16(); /* Loop over all samples */ - FOR( j = 0; j < input_frame >> 1; j++ ) + FOR( j = 0; j < ( input_frame >> 1 ); j++ ) { tmp = data[i][j]; move32(); @@ -387,7 +386,7 @@ void ivas_param_ism_stereo_dmx_fx( tmp_1 = 15 + 1; move16(); - FOR( i = 0; i < input_frame >> 1; i++ ) + FOR( i = 0; i < ( input_frame >> 1 ); i++ ) { stereo_dmx[0][i] = W_extract_l( W_shr( W_mult_32_32( stereo_dmx[0][i], L_add( tmp, mult0( i, grad ) ) ), tmp_1 ) ); // Qx move32(); diff --git a/lib_enc/ivas_masa_enc_fx.c b/lib_enc/ivas_masa_enc_fx.c index 334feb7c5..2a0919b05 100644 --- a/lib_enc/ivas_masa_enc_fx.c +++ b/lib_enc/ivas_masa_enc_fx.c @@ -40,7 +40,6 @@ #include "prot_fx.h" #include "prot_fx_enc.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-----------------------------------------------------------------------* diff --git a/lib_enc/ivas_mc_paramupmix_enc_fx.c b/lib_enc/ivas_mc_paramupmix_enc_fx.c index c1f735704..0e8c845e1 100644 --- a/lib_enc/ivas_mc_paramupmix_enc_fx.c +++ b/lib_enc/ivas_mc_paramupmix_enc_fx.c @@ -39,7 +39,6 @@ #include "prot_fx.h" #include "ivas_prot_fx.h" #include "basop_util.h" -#include "ivas_rom_com_fx.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" #include "ivas_rom_enc.h" diff --git a/lib_enc/ivas_mcmasa_enc_fx.c b/lib_enc/ivas_mcmasa_enc_fx.c index 1a208d0cc..5c8822919 100644 --- a/lib_enc/ivas_mcmasa_enc_fx.c +++ b/lib_enc/ivas_mcmasa_enc_fx.c @@ -39,7 +39,6 @@ #include "options.h" #include "prot_fx.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_enc.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" diff --git a/lib_enc/ivas_qmetadata_enc_fx.c b/lib_enc/ivas_qmetadata_enc_fx.c index ba658b31a..451a96cb1 100644 --- a/lib_enc/ivas_qmetadata_enc_fx.c +++ b/lib_enc/ivas_qmetadata_enc_fx.c @@ -40,53 +40,29 @@ #include "ivas_rom_com.h" #include "ivas_stat_enc.h" #include "wmc_auto.h" - #include "basop_util.h" -#include "ivas_rom_com_fx.h" #if defined( DEBUGGING ) && defined( DBG_BITSTREAM_ANALYSIS ) #include #endif + /*-----------------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------------*/ static void ivas_qmetadata_quantize_diffuseness_nrg_ratios_fx( IVAS_QMETADATA_HANDLE hQMetaData, Word16 *needed_bits, Word16 *nbits_diff, Word16 *dfRatioBits, const Word16 hodirac_flag ); -static Word16 ivas_qmetadata_entropy_encode_diffuseness_fx( - BSTR_ENC_HANDLE hMetaData, - IVAS_QDIRECTION *q_direction, - UWord16 *diffuseness_index_max_ec_frame ); +static Word16 ivas_qmetadata_entropy_encode_diffuseness_fx( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, UWord16 *diffuseness_index_max_ec_frame ); static void ivas_qmetadata_reorder_2dir_bands_fx( IVAS_QMETADATA_HANDLE hQMetaData ); -static Word16 ivas_qmetadata_entropy_encode_df_ratio_fx( - BSTR_ENC_HANDLE hMetaData, - IVAS_QDIRECTION *q_direction, - Word16 *df_ratio_bits ); +static Word16 ivas_qmetadata_entropy_encode_df_ratio_fx( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, Word16 *df_ratio_bits ); -static Word16 ivas_qmetadata_entropy_encode_dir_fx( - BSTR_ENC_HANDLE hMetaData, - IVAS_QDIRECTION *q_direction, - const UWord16 diffuseness_index_max_ec_frame, - const Word16 nbands, - const Word16 start_band, - const Word16 direction_bits_raw, - Word16 max_bits, - const Word16 hrmasa_flag ); - -static Word16 ivas_qmetadata_raw_encode_dir_fx( - BSTR_ENC_HANDLE hMetaData, - IVAS_QDIRECTION *q_direction, - const Word16 nbands, - const Word16 start_band ); +static Word16 ivas_qmetadata_entropy_encode_dir_fx( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const UWord16 diffuseness_index_max_ec_frame, const Word16 nbands, const Word16 start_band, const Word16 direction_bits_raw, Word16 max_bits, const Word16 hrmasa_flag ); +static Word16 ivas_qmetadata_raw_encode_dir_fx( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const Word16 nbands, const Word16 start_band ); -static Word16 ivas_qmetadata_get_optimal_gr_param_fx( - UWord16 *unsigned_data, - const Word16 count, - const Word16 gr_param_count, - Word16 *opt_gr_size ); +static Word16 ivas_qmetadata_get_optimal_gr_param_fx( UWord16 *unsigned_data, const Word16 count, const Word16 gr_param_count, Word16 *opt_gr_size ); Word16 ivas_qmetadata_encode_extended_gr_length_fx( const UWord16 value, const UWord16 alphabet_size, const Word16 gr_param ); @@ -94,17 +70,11 @@ static Word16 ivas_qmetadata_encode_quasi_uniform_length_fx( const UWord16 value static void ivas_qmetadata_encode_quasi_uniform_fx( BSTR_ENC_HANDLE hMetaData, const UWord16 value, const UWord16 alphabet_size ); -static Word16 ivas_qmetadata_reorder_elevation_index_fx( - const Word16 elevation_index, - const Word16 avg_elevation_index, - const Word16 elevation_alphabet ); +static Word16 ivas_qmetadata_reorder_elevation_index_fx( const Word16 elevation_index, const Word16 avg_elevation_index, const Word16 elevation_alphabet ); -static Word16 ivas_qmetadata_reorder_azimuth_index_fx( - const Word16 azimuth_index, - const Word16 avg_azimuth_index, - const Word16 azimuth_alphabet ); -static ivas_error requantize_direction_EC_3_fx( Word16 *extra_bits, IVAS_QDIRECTION *q_direction, const Word16 coding_subbands, BSTR_ENC_HANDLE hMetaData, Word32 elevation_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], Word32 azimuth_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], Word16 *ind_order ); +static Word16 ivas_qmetadata_reorder_azimuth_index_fx( const Word16 azimuth_index, const Word16 avg_azimuth_index, const Word16 azimuth_alphabet ); +static ivas_error requantize_direction_EC_3_fx( Word16 *extra_bits, IVAS_QDIRECTION *q_direction, const Word16 coding_subbands, BSTR_ENC_HANDLE hMetaData, Word32 elevation_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], Word32 azimuth_orig[MASA_MAXIMUM_CODING_SUBBANDS][MAX_PARAM_SPATIAL_SUBFRAMES], Word16 *ind_order ); static void calculate_two_distances_fx( Word32 *el_fx, /* i : elevation values */ @@ -119,7 +89,6 @@ static void joint_encoding_fx( IVAS_QDIRECTION *q_direction, const Word16 j, con static ivas_error write_ec_direction_fx( Word16 *num_bits_written, BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const Word16 j_idx, const Word16 len, const Word16 GR_ord_elevation, const Word16 GR_ord_azimuth, const Word16 use_context, const Word16 same ); static Word16 write_fixed_rate_direction_fx( BSTR_ENC_HANDLE hMetaData, IVAS_QDIRECTION *q_direction, const Word16 j_idx, const Word16 len ); - static Word16 ivas_qmetadata_quantize_coherence_fx( IVAS_QMETADATA *hQMetaData, /* i/o: quantized metadata */ const Word16 idx_d, /* i : current direction index */ @@ -168,31 +137,17 @@ static Word16 encode_surround_coherence_fx( IVAS_QMETADATA *hQMetaData, /* i : quantized metadata */ BSTR_ENC_HANDLE hMetaData /* i/o: metadata bitstream handle */ ); -static Word16 common_direction_fx( - IVAS_QDIRECTION *q_direction, - const Word16 band_idx, - const Word16 len, - const Word16 bits_allowed, - BSTR_ENC_HANDLE hMetaData, - Word32 *elevation_orig_fx, - Word32 *azimuth_orig_fx ); -static Word16 ivas_diffuseness_huff_ec_encode_fx( - BSTR_ENC_HANDLE hMetaData, - const UWord16 idx ); +static Word16 common_direction_fx( IVAS_QDIRECTION *q_direction, const Word16 band_idx, const Word16 len, const Word16 bits_allowed, BSTR_ENC_HANDLE hMetaData, Word32 *elevation_orig_fx, Word32 *azimuth_orig_fx ); -static void ivas_diffuseness_huff_ec_prepare_fx( - IVAS_QDIRECTION *q_direction, - Word16 *best_av, - UWord16 *avr_idx, - Word16 *diffuseness_bits_huff ); +static Word16 ivas_diffuseness_huff_ec_encode_fx( BSTR_ENC_HANDLE hMetaData, const UWord16 idx ); + +static void ivas_diffuseness_huff_ec_prepare_fx( IVAS_QDIRECTION *q_direction, Word16 *best_av, UWord16 *avr_idx, Word16 *diffuseness_bits_huff ); static Word16 coherence_coding_length( const UWord16 *idx_sur_coh_shift, const UWord8 idx_shift_len, const Word16 coding_subbands, const Word16 *no_cv, UWord16 *mr_idx, Word16 *no_cv_shift, Word16 *p_min_idx, Word16 *GR_ord, Word16 *nbits_fr, Word16 *nbits_fr1 ); static Word16 write_2dir_info( BSTR_ENC_HANDLE hMetaData, UWord8 *twoDirBands, const Word16 n, const Word16 k ); -static void transform_azimuth_dir2_fx( - IVAS_QMETADATA_HANDLE hQMetaData, - Word16 *dir2_bands ); +static void transform_azimuth_dir2_fx( IVAS_QMETADATA_HANDLE hQMetaData, Word16 *dir2_bands ); static Word16 ivas_qmetadata_quantize_coherence_hr_512_fx( IVAS_QMETADATA *hQMetaData, const Word16 idx_d, const Word16 all_coherence_zero, BSTR_ENC_HANDLE hMetaData, const Word16 bits_coh ); diff --git a/lib_enc/ivas_qspherical_enc_fx.c b/lib_enc/ivas_qspherical_enc_fx.c index 2e7a289f9..3f17a423e 100644 --- a/lib_enc/ivas_qspherical_enc_fx.c +++ b/lib_enc/ivas_qspherical_enc_fx.c @@ -40,7 +40,6 @@ #include "wmc_auto.h" #include "prot_fx.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-----------------------------------------------------------------------* diff --git a/lib_enc/ivas_sns_enc_fx.c b/lib_enc/ivas_sns_enc_fx.c index 610f39b1b..252637e73 100644 --- a/lib_enc/ivas_sns_enc_fx.c +++ b/lib_enc/ivas_sns_enc_fx.c @@ -39,11 +39,11 @@ #include "ivas_prot_fx.h" #include "rom_com.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_cnst.h" #include "wmc_auto.h" #include "prot_fx_enc.h" + /*------------------------------------------------------------------- * sns_1st_cod() * diff --git a/lib_enc/ivas_spar_md_enc_fx.c b/lib_enc/ivas_spar_md_enc_fx.c index 14f8acba6..38890da11 100644 --- a/lib_enc/ivas_spar_md_enc_fx.c +++ b/lib_enc/ivas_spar_md_enc_fx.c @@ -37,7 +37,6 @@ #include "ivas_prot_fx.h" #include "math.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include #include "wmc_auto.h" diff --git a/lib_enc/ivas_stereo_dft_enc_fx.c b/lib_enc/ivas_stereo_dft_enc_fx.c index 80c4b5a21..1eb89a74a 100644 --- a/lib_enc/ivas_stereo_dft_enc_fx.c +++ b/lib_enc/ivas_stereo_dft_enc_fx.c @@ -41,7 +41,6 @@ #include "ivas_prot_fx.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_enc.h" #include "wmc_auto.h" diff --git a/lib_enc/ivas_stereo_dmx_evs_fx.c b/lib_enc/ivas_stereo_dmx_evs_fx.c index e3e49193a..852be98fe 100644 --- a/lib_enc/ivas_stereo_dmx_evs_fx.c +++ b/lib_enc/ivas_stereo_dmx_evs_fx.c @@ -39,7 +39,6 @@ #include "prot_fx.h" #include "ivas_prot_fx.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_enc.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" @@ -529,7 +528,7 @@ static void calc_poc_fx( move32(); gamma = L_sub( gamma, igamma ); } - FOR( ; i < n0 >> 4; i++ ) /*search from 4 angles */ + FOR( ; i < ( n0 >> 4 ); i++ ) /*search from 4 angles */ { tmp1 = Mpy_32_16_1( Mpy_32_32_r( wnd[i * step + bias], gamma ), 23170 /*0.7071f*/ ); @@ -540,7 +539,7 @@ static void calc_poc_fx( gamma = L_sub( gamma, igamma ); } - FOR( ; i < n0 >> 3; i++ ) /* binary search from 8 angles */ + FOR( ; i < ( n0 >> 3 ); i++ ) /* binary search from 8 angles */ { tmp1 = Mpy_32_32_r( wnd[i * step + bias], gamma ); // Q31 diff --git a/lib_enc/ivas_stereo_ica_enc_fx.c b/lib_enc/ivas_stereo_ica_enc_fx.c index d0252a1f1..e5c7af987 100644 --- a/lib_enc/ivas_stereo_ica_enc_fx.c +++ b/lib_enc/ivas_stereo_ica_enc_fx.c @@ -40,13 +40,13 @@ #include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" - #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*--------------------------------------------------------------- * Local function prototypes * ---------------------------------------------------------------*/ + static void unclr_calc_corr_features_fx( STEREO_CLASSIF_HANDLE hStereoClassif, /* i/o: stereo classifier handle */ STEREO_TCA_ENC_HANDLE hStereoTCA, /* i/o: ICA Stereo Encoder handle */ @@ -78,6 +78,7 @@ static void unclr_calc_corr_features_fx( * * Temporal channel adjustment of LA samples in target channel * ---------------------------------------------------------------*/ + static void tcaTargetCh_LA_fx( STEREO_TCA_ENC_HANDLE hStereoTCA, Word32 *ptrChanL, /* q_com */ diff --git a/lib_enc/ivas_stereo_icbwe_enc_fx.c b/lib_enc/ivas_stereo_icbwe_enc_fx.c index 67ba071a0..85c35ed50 100644 --- a/lib_enc/ivas_stereo_icbwe_enc_fx.c +++ b/lib_enc/ivas_stereo_icbwe_enc_fx.c @@ -39,15 +39,14 @@ #include "wmc_auto.h" #include "rom_com.h" #include "ivas_rom_com.h" - #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-------------------------------------------------------------------* * ic_bwe_enc_reset() * * core switching reset of IC BWE memory *-------------------------------------------------------------------*/ + static void ic_bwe_enc_reset_fx( STEREO_ICBWE_ENC_HANDLE hStereoICBWE /* i/o: Stereo ICBWE handle */ ) diff --git a/lib_enc/ivas_stereo_mdct_stereo_enc_fx.c b/lib_enc/ivas_stereo_mdct_stereo_enc_fx.c index db634379a..25282f8f4 100644 --- a/lib_enc/ivas_stereo_mdct_stereo_enc_fx.c +++ b/lib_enc/ivas_stereo_mdct_stereo_enc_fx.c @@ -39,7 +39,6 @@ #include "prot_fx.h" #include "prot_fx_enc.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_enc.h" #include "wmc_auto.h" #include "stat_enc.h" diff --git a/lib_enc/ivas_stereo_switching_enc_fx.c b/lib_enc/ivas_stereo_switching_enc_fx.c index 5663a4f4f..f11f6ba8f 100644 --- a/lib_enc/ivas_stereo_switching_enc_fx.c +++ b/lib_enc/ivas_stereo_switching_enc_fx.c @@ -35,13 +35,13 @@ #include "cnst.h" #include "rom_com.h" #include "prot_fx.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_com.h" #include "assert.h" #include "wmc_auto.h" #include "prot_fx_enc.h" #include "ivas_prot_fx.h" + /*-------------------------------------------------------------------* * Function allocate_CoreCoder_enc() * diff --git a/lib_enc/ivas_stereo_td_analysis_fx.c b/lib_enc/ivas_stereo_td_analysis_fx.c index de47ea8e2..ab28f7f7e 100644 --- a/lib_enc/ivas_stereo_td_analysis_fx.c +++ b/lib_enc/ivas_stereo_td_analysis_fx.c @@ -41,7 +41,6 @@ #include "rom_enc.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/ivas_stereo_td_enc_fx.c b/lib_enc/ivas_stereo_td_enc_fx.c index 8f1d2d9c9..e617e1a9a 100644 --- a/lib_enc/ivas_stereo_td_enc_fx.c +++ b/lib_enc/ivas_stereo_td_enc_fx.c @@ -43,7 +43,6 @@ #endif #include "prot_fx_enc.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" /*-------------------------------------------------------------------* @@ -51,6 +50,7 @@ * * Initialize TD stereo encoder *-------------------------------------------------------------------*/ + void stereo_td_init_enc_fx( STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle */ const Word16 last_element_mode /* i : last element mode */ diff --git a/lib_enc/ivas_tcx_core_enc_fx.c b/lib_enc/ivas_tcx_core_enc_fx.c index da141f473..b06989226 100644 --- a/lib_enc/ivas_tcx_core_enc_fx.c +++ b/lib_enc/ivas_tcx_core_enc_fx.c @@ -41,7 +41,6 @@ #include "wmc_auto.h" #include "ivas_prot_fx.h" #include "prot_fx_enc.h" -#include "rom_com_fx.h" #include "ivas_prot_fx.h" /*-------------------------------------------------------------------* diff --git a/lib_enc/lead_indexing_fx.c b/lib_enc/lead_indexing_fx.c index 70e0c4796..c26c817f4 100644 --- a/lib_enc/lead_indexing_fx.c +++ b/lib_enc/lead_indexing_fx.c @@ -1,11 +1,10 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" /* Compilation switches */ #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -13,6 +12,7 @@ /*-------------------------------------------------------------------* * Local function prototypes *-------------------------------------------------------------------*/ + static Word16 fcb_encode_pos_fx( const Word16 pos_vector[], const Word16 pulse_num, const Word16 pos_num ); /*-------------------------------------------------------------------* @@ -20,6 +20,7 @@ static Word16 fcb_encode_pos_fx( const Word16 pos_vector[], const Word16 pulse_n * * Compute base index for RE8 *-------------------------------------------------------------------*/ + void re8_compute_base_index_fx( const Word16 *x, /* i : Elemen of Q2, Q3 or Q4 */ const Word16 ka, /* i : Identifier of the absolute leader related to x Q0*/ diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index 8db83c2b9..d806df9aa 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -5,9 +5,7 @@ #include #include "options.h" /* Compilation switches */ #include "rom_enc.h" -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "ivas_prot_fx.h" /* Function prototypes */ @@ -16,6 +14,7 @@ /*-----------------------------------------------------------------* * Local constants *-----------------------------------------------------------------*/ + #define MIN_LOG_FX 0 #define MIN_LOG_VAL_FX -15360 /* -60.0f in Q8 */ #define MSVQ_MAXCNT 3000 @@ -35,6 +34,7 @@ static void lsf_mid_enc_fx( BSTR_ENC_HANDLE hBstr, Word16 nb_bits, const Word16 static void lsf_mid_enc_ivas_fx( BSTR_ENC_HANDLE hBstr, Word16 nb_bits, const Word32 int_fs, const Word16 qlsp0[], const Word16 qlsp1[], Word16 lsp[], const Word16 coder_type, const Word16 bwidth, Word32 Bin_Ener_old[], Word16 Q_ener, Word16 ppp_mode, Word16 nelp_mode ); + /*===========================================================================*/ /* FUNCTION : lsf_enc_fx() */ /*---------------------------------------------------------------------------*/ @@ -1989,7 +1989,7 @@ static void first_VQstages( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ @@ -2179,7 +2179,7 @@ static void first_VQstages_ivas_fx( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ diff --git a/lib_enc/lsf_msvq_ma_enc_fx.c b/lib_enc/lsf_msvq_ma_enc_fx.c index 981c7e51c..876abd0a0 100644 --- a/lib_enc/lsf_msvq_ma_enc_fx.c +++ b/lib_enc/lsf_msvq_ma_enc_fx.c @@ -5,9 +5,7 @@ #include #include #include "options.h" -//#include "prot_fx.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "rom_enc.h" #include "basop_util.h" diff --git a/lib_enc/mslvq_enc_fx.c b/lib_enc/mslvq_enc_fx.c index 4955dede8..05c379f31 100644 --- a/lib_enc/mslvq_enc_fx.c +++ b/lib_enc/mslvq_enc_fx.c @@ -2,8 +2,9 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ +#include +#include "options.h" /* Compilation switches */ #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stl.h" #include "prot_fx.h" /* Function prototypes */ diff --git a/lib_enc/noise_adjust_fx.c b/lib_enc/noise_adjust_fx.c index 1a2e204ae..2a6ffd22e 100644 --- a/lib_enc/noise_adjust_fx.c +++ b/lib_enc/noise_adjust_fx.c @@ -1,27 +1,29 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*--------------------------------------------------------------------------* * noise_adjust_fx() * * Calculate attenuation *--------------------------------------------------------------------------*/ -Word16 noise_adjust_fx( /* o : index of noise attenuation Q0 */ - const Word16 *coeffs_norm, /* i : normalized coefficients Qx */ - const Word16 qx, /* i : Q value of coeffs_norm */ - const Word16 *bitalloc, /* i : bit allocation Q0 */ - const Word16 *sfm_start, /* i : band start Q0 */ - const Word16 *sfm_end, /* i : band end Q0 */ - const Word16 core_sfm /* i : index of the end band for core Q0 */ +/* o : index of noise attenuation Q0 */ +Word16 noise_adjust_fx( + const Word16 *coeffs_norm, /* i : normalized coefficients Qx */ + const Word16 qx, /* i : Q value of coeffs_norm */ + const Word16 *bitalloc, /* i : bit allocation Q0 */ + const Word16 *sfm_start, /* i : band start Q0 */ + const Word16 *sfm_end, /* i : band end Q0 */ + const Word16 core_sfm /* i : index of the end band for core Q0 */ ) { Word16 nf_idx, sfm, bin, num_coeffs; diff --git a/lib_enc/peak_vq_enc_fx.c b/lib_enc/peak_vq_enc_fx.c index dffab4900..bd87efb23 100644 --- a/lib_enc/peak_vq_enc_fx.c +++ b/lib_enc/peak_vq_enc_fx.c @@ -6,13 +6,12 @@ #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -//#include "prot_fx.h" #include "rom_enc.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------------- * Local function prototypes *--------------------------------------------------------------------------*/ @@ -23,7 +22,7 @@ static Word16 sparse_code_pos_fx( const Word16 *inp, const Word16 length, Word16 static Word16 hvq_code_pos_ivas_fx( BSTR_ENC_HANDLE hBstr, const Word16 *inp, const Word16 length, const Word16 num_peaks ); static void quant_peaks_ivas_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle*/ const Word32 *vect_in, /* i : Target vector in Q12 */ Word32 *vect_out, /* i/o: Quantized vector in Q12 */ const Word32 *peak_gain, /* i : Peak gain vector in Q12 */ @@ -32,11 +31,14 @@ static void quant_peaks_ivas_fx( const Word32 core_brate, /* i : Core bitrate */ const Word16 Npeaks /* i : Number of peaks */ ); + + /*-------------------------------------------------------------------------- * peak_vq_enc_fx() * * Vector Quantization of MDCT peaks *--------------------------------------------------------------------------*/ + Word16 peak_vq_enc_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word16 bwidth, /* i : audio bandwidth */ diff --git a/lib_enc/pit_enc_fx.c b/lib_enc/pit_enc_fx.c index 510761a63..20302ea67 100644 --- a/lib_enc/pit_enc_fx.c +++ b/lib_enc/pit_enc_fx.c @@ -3,17 +3,16 @@ ====================================================================================*/ #include #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_enc.h" /* Encoder static table prototypes */ +#include "rom_com.h" /* Static table prototypes */ #include "rom_basop_util.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + #define inv_T0_res InvIntTable static void limit_T0_voiced2( Word16 res, const Word16 *T_op, Word16 *T0_min, Word16 *T0_min_frac, Word16 *T0_max, Word16 *T0_max_frac, Word16 pit_min, Word16 pit_max, Word16 i_subfr ); diff --git a/lib_enc/pitch_ol2_fx.c b/lib_enc/pitch_ol2_fx.c index c0c17ec63..1e23b7cdb 100644 --- a/lib_enc/pitch_ol2_fx.c +++ b/lib_enc/pitch_ol2_fx.c @@ -1,17 +1,17 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Encoder static table prototypes */ -#include "rom_com.h" /* Encoder static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_enc.h" /* Encoder static table prototypes */ +#include "rom_com.h" /* Encoder static table prototypes */ #include "rom_dec.h" -//#include "prot_fx.h" /* Function prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ diff --git a/lib_enc/pitch_ol_fx.c b/lib_enc/pitch_ol_fx.c index 56647f7b1..4e2aff772 100644 --- a/lib_enc/pitch_ol_fx.c +++ b/lib_enc/pitch_ol_fx.c @@ -5,14 +5,13 @@ #include #include "options.h" #include "cnst.h" -// #include "prot_fx.h" #include "basop_util.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "rom_enc.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-----------------------------------------------------------------* * Local Constants *-----------------------------------------------------------------*/ diff --git a/lib_enc/ppp_enc_fx.c b/lib_enc/ppp_enc_fx.c index d6dc8b6d6..836689df2 100644 --- a/lib_enc/ppp_enc_fx.c +++ b/lib_enc/ppp_enc_fx.c @@ -5,15 +5,16 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local constants *-------------------------------------------------------------------*/ + #define ERB_CBSIZE1 64 #define ERB_CBSIZE2 64 #define P_CBSIZE 64 @@ -21,6 +22,7 @@ /*-------------------------------------------------------------------* * Local functions *--------------------------------------------------------------------*/ + static Word16 DTFS_quant_cw_fx( DTFS_STRUCTURE *X_fx, Word16 pl, const Word16 *curr_lpc_fx, Word16 *POWER_IDX, Word16 *AMP_IDX, Word16 *lastLgainE_fx, Word16 *lastHgainE_fx, Word16 *lasterbE_fx, Word16 *sin_tab, Word16 *cos_tab ); static Word16 DTFS_alignment_fine_new_fx( DTFS_STRUCTURE X1_fx, DTFS_STRUCTURE X2_fx, Word16 *S_fx, Word16 *C_fx ); static void erb_diff_fx( const Word16 *prev_erb, Word16 pl, const Word16 *curr_erb, Word16 l, const Word16 *curr_lsp, Word16 *index, Word16 num_erb ); diff --git a/lib_enc/pre_proc_fx.c b/lib_enc/pre_proc_fx.c index 0dc722acd..b2f414664 100644 --- a/lib_enc/pre_proc_fx.c +++ b/lib_enc/pre_proc_fx.c @@ -5,12 +5,12 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * pre_proc() * @@ -215,7 +215,7 @@ void pre_proc_fx( /*----------------------------------------------------------------* * Change the sampling frequency to 12.8 kHz *----------------------------------------------------------------*/ - modify_Fs_fx( signal_in, input_frame, st->input_Fs, new_inp_12k8, INT_FS_12k8, st->mem_decim_fx, ( const Word16 )( EQ_16( st->max_bwidth, NB ) ) ); + modify_Fs_fx( signal_in, input_frame, st->input_Fs, new_inp_12k8, INT_FS_12k8, st->mem_decim_fx, (const Word16) ( EQ_16( st->max_bwidth, NB ) ) ); Copy( new_inp_12k8, st->buf_speech_enc + L_FRAME32k, L_FRAME ); Scale_sig( st->buf_speech_enc + L_FRAME32k, L_FRAME, 1 ); /*------------------------------------------------------------------* diff --git a/lib_enc/pvq_core_enc_fx.c b/lib_enc/pvq_core_enc_fx.c index a5e193461..958eafccb 100644 --- a/lib_enc/pvq_core_enc_fx.c +++ b/lib_enc/pvq_core_enc_fx.c @@ -5,15 +5,16 @@ #include #include "options.h" /* Compilation switches */ #include "cnst.h" -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "ivas_prot_fx.h" + /*-------------------------------------------------------------------* * Local function prototypes *--------------------------------------------------------------------*/ + static Word16 calc_pvq_splits_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ, const Word16 band_bits, const Word16 sfmsize, const Word16 *y, const Word16 Q_y, Word16 *bits ); static Word16 calc_pvq_splits_ivas_fx( /* o : Number of segments */ BSTR_ENC_HANDLE hBstr, /* i/o: Encoder state */ @@ -44,7 +45,6 @@ static void pvq_encode_band_ivas_fx( const Word16 strict_bits /* i : conservative rounding flag */ ) { - Word16 K_val; Word16 j, Np; Word32 enr, E_part[MAX_SPLITS + 1]; diff --git a/lib_enc/pvq_encode_fx.c b/lib_enc/pvq_encode_fx.c index e98906704..0034f5423 100644 --- a/lib_enc/pvq_encode_fx.c +++ b/lib_enc/pvq_encode_fx.c @@ -6,18 +6,19 @@ #include "cnst.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ -#include "rom_com_fx.h" #include "rom_com.h" + /* PVQ MIXED_SEARCH_LOOP: low precision 16/32 + energy selective high precision 32/64, mixed perf , 10 dB SEGSNR better than the low precision loop only, active if k>=128 and accumulated energy is high enough, comes at a controlled complexity cost, as dimensions decrease for high k's*/ -static Word16 max_val_fx( /* o : maximum value in the input vector */ - const Word16 *vec, /* i : input vector */ - const Word16 lvec /* i : length of input vector */ +/* o : maximum value in the input vector */ +static Word16 max_val_fx( + const Word16 *vec, /* i : input vector */ + const Word16 lvec /* i : length of input vector */ ) { Word16 j, tmp; @@ -31,7 +32,9 @@ static Word16 max_val_fx( /* o : maximum value in the input return tmp; } -static Word16 pyramidSearchProjInit_fx( Word16 L, Word16 Ptot ) +static Word16 pyramidSearchProjInit_fx( + const Word16 L, + const Word16 Ptot ) { return ( sub( Ptot, extract_l( L_shr( L_mult0( 8223, (Word32) L ), 14 ) ) ) > 0 ); } diff --git a/lib_enc/q_gain2p_fx.c b/lib_enc/q_gain2p_fx.c index 4618483d2..be5d41799 100644 --- a/lib_enc/q_gain2p_fx.c +++ b/lib_enc/q_gain2p_fx.c @@ -7,12 +7,12 @@ #include "options.h" #include "cnst.h" /* Common constants */ #include "basop_util.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + static Word16 gain_enc( /* o : quantization pitch index */ const Word16 *code, /* i : algebraic excitation */ Word16 lcode, /* i : Subframe size in range: 40,64,80 */ diff --git a/lib_enc/qlpc_stoch_fx.c b/lib_enc/qlpc_stoch_fx.c index d6f0b504f..e6a30da0f 100644 --- a/lib_enc/qlpc_stoch_fx.c +++ b/lib_enc/qlpc_stoch_fx.c @@ -2,15 +2,12 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ - #include #include #include "options.h" #include "cnst.h" #include "rom_enc.h" -#include "rom_com_fx.h" #include "rom_com.h" -//#include "prot_fx.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" diff --git a/lib_enc/range_enc_fx.c b/lib_enc/range_enc_fx.c index 767b2ecb5..3f157b093 100644 --- a/lib_enc/range_enc_fx.c +++ b/lib_enc/range_enc_fx.c @@ -4,11 +4,9 @@ #include #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -17,6 +15,7 @@ static void rc_enc_shift_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ ); static void rc_enc_write_fx( BSTR_ENC_HANDLE hBstr, Word16 byte, Word16 bits ); static void rc_enc_shift_ivas_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ ); static void rc_enc_write_ivas_fx( BSTR_ENC_HANDLE hBstr, Word16 byte, Word16 bits ); + /*-------------------------------------------------------------------* * rc_enc_init() * diff --git a/lib_enc/reordernorm_fx.c b/lib_enc/reordernorm_fx.c index 176b54f8e..31d7ad869 100644 --- a/lib_enc/reordernorm_fx.c +++ b/lib_enc/reordernorm_fx.c @@ -5,11 +5,11 @@ #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*--------------------------------------------------------------------------*/ /* Function reordernorm_fx */ /* ~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/lib_enc/rst_enc_fx.c b/lib_enc/rst_enc_fx.c index 9c5c7263b..bbe32afb3 100644 --- a/lib_enc/rst_enc_fx.c +++ b/lib_enc/rst_enc_fx.c @@ -2,15 +2,14 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "stl.h" + /*-------------------------------------------------------------------* * CNG_reset_enc() * diff --git a/lib_enc/scale_enc_fx.c b/lib_enc/scale_enc_fx.c index 32633c89d..3f5d2605a 100644 --- a/lib_enc/scale_enc_fx.c +++ b/lib_enc/scale_enc_fx.c @@ -2,19 +2,20 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "stl.h" + /*-------------------------------------------------------------------* * Scale_wsp * * Find scaling factor for weighted speech input *-------------------------------------------------------------------*/ + void Scale_wsp( Word16 *wsp, /* i : Weigthed speech */ Word16 *old_wsp_max, /* i : Last weigthed speech maximal valu */ @@ -24,7 +25,7 @@ void Scale_wsp( Word16 *old_wsp, /* i/o: Old weighted speech buffer */ Word16 *mem_decim2, /* i/o: Decimation buffer */ Word16 *old_wsp12k8, /* i/o: wsp memory @ 12.8 kHz used in pitol2 */ - const Word16 Len_p_look /* i : L_frame + look ahead Q0*/ + const Word16 Len_p_look /* i : L_frame + look ahead Q0*/ ) { Word16 max, i, tmp; diff --git a/lib_enc/set_impulse_fx.c b/lib_enc/set_impulse_fx.c index 7a2224611..7d8fc54fa 100644 --- a/lib_enc/set_impulse_fx.c +++ b/lib_enc/set_impulse_fx.c @@ -1,27 +1,31 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include "options.h" -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -#include "rom_com.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "cnst.h" /* Common constants */ +#include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-----------------------------------------------------------------* * Local constant *-----------------------------------------------------------------*/ + #define INPOL 4 /* +- range in samples for impulse position searching */ + /*-----------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------*/ + static void convolve_tc_fx( const Word16 g[], const Word16 h[], Word16 y[], const Word16 L_1, const Word16 L_2 ); static void correlate_tc_fx( const Word16 *x, Word16 *y, const Word16 *h, const Word16 start, const Word16 L_1, const Word16 L_2 ); static void convolve_tc2_fx( const Word16 g[], const Word16 h[], Word16 y[], const Word16 pos_max ); + /*---------------------------------------------------------------------------------------* * Function set_impulse() for TC * * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * diff --git a/lib_enc/setmodeindex_fx.c b/lib_enc/setmodeindex_fx.c index 012c5757f..c1d52bbc7 100644 --- a/lib_enc/setmodeindex_fx.c +++ b/lib_enc/setmodeindex_fx.c @@ -5,11 +5,12 @@ #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" +#include "rom_com.h" #include "rom_enc.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*--------------------------------------------------------------------------- function name: SetModeIndex_fx diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 65f3fb1b8..b01d4160f 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -6,9 +6,7 @@ #include #include "options.h" #include "cnst.h" -// #include "prot_fx.h" #include "rom_enc.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stl.h" #include "prot_fx.h" /* Function prototypes */ @@ -23,6 +21,7 @@ /*---------------------------------------------------------------------* * Local constants *---------------------------------------------------------------------*/ + #define ATT_NSEG 32 #define ATT_SEG_LEN ( L_FRAME / ATT_NSEG ) #define ATT_3LSUB_POS ( 3 * ATT_NSEG / NB_SUBFR ) @@ -44,7 +43,6 @@ static Word16 sp_mus_classif_gmm_fx( Encoder_State *st_fx, const Word16 localVAD_HE_SAD, const Word16 lsp_new[M], const Word16 cor_map_sum, const Word32 epsP[M + 1], const Word32 PS[], Word16 non_sta, Word16 relE, Word16 *voi_fv, Word16 *cor_map_sum_fv, Word16 *LPCErr, Word16 Q_esp, Word16 *high_lpn_flag_ptr ); - static void sp_mus_classif_2nd_fx( Encoder_State *st, const Word16 Etot, Word16 *attack_flag, const Word16 *inp, const Word16 Qx ); static void music_mixed_classif_improv_fx( Encoder_State *st, const Word16 *new_inp, const Word32 *epsP, Word16 Q_epsP, Word16 etot, Word16 old_cor, Word16 cor_map_sum ); diff --git a/lib_enc/stat_noise_uv_enc_fx.c b/lib_enc/stat_noise_uv_enc_fx.c index 598745ebd..ed65b6793 100644 --- a/lib_enc/stat_noise_uv_enc_fx.c +++ b/lib_enc/stat_noise_uv_enc_fx.c @@ -5,8 +5,6 @@ #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -37,6 +35,7 @@ /* RETURN ARGUMENTS : */ /* _ None */ /*=======================================================================*/ + void stat_noise_uv_enc_fx( Encoder_State *st_fx, /* i/o: state structure */ const Word32 *LepsP, /* i : LP prediction errors */ diff --git a/lib_enc/swb_bwe_enc_fx.c b/lib_enc/swb_bwe_enc_fx.c index 40fefd684..ee3a4c74c 100644 --- a/lib_enc/swb_bwe_enc_fx.c +++ b/lib_enc/swb_bwe_enc_fx.c @@ -6,7 +6,6 @@ #include "options.h" #include "prot_fx.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stl.h" #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/swb_bwe_enc_hr_fx.c b/lib_enc/swb_bwe_enc_hr_fx.c index dc962d1bc..dbd6a258d 100644 --- a/lib_enc/swb_bwe_enc_hr_fx.c +++ b/lib_enc/swb_bwe_enc_hr_fx.c @@ -1,12 +1,12 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include #include #include "options.h" #include "cnst.h" /* Common constants */ #include "rom_enc.h" /* Encoder static table prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -38,10 +38,11 @@ * Quantize the band envelop *-------------------------------------------------------------------*/ -static Word16 en_band_quant_fx( /* o : quantization index */ - Word16 *en_band, /* i/o: (un)quantized envelope value */ - const Word16 *env_code, /* i : envelope codebook */ - const Word16 N /* i : codebook dimension */ +/* o : quantization index */ +static Word16 en_band_quant_fx( + Word16 *en_band, /* i/o: (un)quantized envelope value */ + const Word16 *env_code, /* i : envelope codebook */ + const Word16 N /* i : codebook dimension */ ) { Word16 i, ind, tmp16; diff --git a/lib_enc/swb_pre_proc_fx.c b/lib_enc/swb_pre_proc_fx.c index ca7233c95..2cd295acd 100644 --- a/lib_enc/swb_pre_proc_fx.c +++ b/lib_enc/swb_pre_proc_fx.c @@ -5,8 +5,6 @@ #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stl.h" #include "prot_fx.h" /* Function prototypes */ @@ -14,9 +12,9 @@ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" #include "ivas_rom_enc.h" - #include + /*========================================================================*/ /* FUNCTION : wb_pre_proc_fx() */ /*------------------------------------------------------------------------*/ diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index f243cd27c..3090568fb 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -2,11 +2,9 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ - #include #include "options.h" #include "cnst.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ @@ -24,16 +22,11 @@ /*-----------------------------------------------------------------* * Local functions *-----------------------------------------------------------------*/ -static void return_M_Least_fx_GainFrame( const Word32 *inp, - const Word32 *codebook, - const Word16 num_grp, - const Word16 interNum, - Word16 *least ); +static void return_M_Least_fx_GainFrame( const Word32 *inp, const Word32 *codebook, const Word16 num_grp, const Word16 interNum, Word16 *least ); static void singlevectortest_gain_fx( const Word32 *inp, const Word16 dimen, const Word16 cb_size, Word16 *index, Word32 *recon, const Word32 *codebook ); - static void determine_gain_weights_fx( const Word32 *gain, Word16 *weights, const Word16 dims ); static void QuantizeSHBsubgains_fx( Encoder_State *st_fx, Word16 *subgains, const Word16 extl ); @@ -48,38 +41,11 @@ static Word16 closest_centroid_fx( const Word16 *data, const Word16 *weights, co static Word16 closest_centroid_lc_fx( const Word16 *data, const Word16 *quantizer, const Word16 centroids ); -static void EstimateSHBFrameGain_fx( const Word16 length, - const Word16 *oriSHB, - const Word16 Q_oriSHB, - const Word16 *synSHB, - const Word16 Q_synSHB, - Word16 *subgain, - Word32 *GainFrame, - const Word16 *win_shb, - const Word16 *subwin_shb, - const Word16 n_subfr_saturation ); - -static void EstimateSHBFrameGain_ivas_fx( const Word16 length, - const Word16 *oriSHB, - const Word16 Q_oriSHB, - const Word16 *synSHB, - const Word16 Q_synSHB, - Word16 *subgain, - Word32 *GainFrame, - const Word16 *win_shb, - const Word16 *subwin_shb, - const Word16 n_subfr_saturation ); - -static void EstimateSHBGainShape_fx( const Word16 length, - const Word16 *oriSHB, - const Word16 Q_oriSHB, - const Word16 *synSHB, - const Word16 Q_synSHB, - Word16 *subgain, - const Word16 *subwin, - Word16 *n_subfr_saturation, - const Flag limit_min_gain ); +static void EstimateSHBFrameGain_fx( const Word16 length, const Word16 *oriSHB, const Word16 Q_oriSHB, const Word16 *synSHB, const Word16 Q_synSHB, Word16 *subgain, Word32 *GainFrame, const Word16 *win_shb, const Word16 *subwin_shb, const Word16 n_subfr_saturation ); +static void EstimateSHBFrameGain_ivas_fx( const Word16 length, const Word16 *oriSHB, const Word16 Q_oriSHB, const Word16 *synSHB, const Word16 Q_synSHB, Word16 *subgain, Word32 *GainFrame, const Word16 *win_shb, const Word16 *subwin_shb, const Word16 n_subfr_saturation ); + +static void EstimateSHBGainShape_fx( const Word16 length, const Word16 *oriSHB, const Word16 Q_oriSHB, const Word16 *synSHB, const Word16 Q_synSHB, Word16 *subgain, const Word16 *subwin, Word16 *n_subfr_saturation, const Flag limit_min_gain ); static Word32 pow_off_pk_fx( Word16 a[], Word16 len, Word16 step ); @@ -90,9 +56,7 @@ static void rescale_genSHB_mem_enc( Encoder_State *st_fx, Word16 sf ); static void find_max_mem_wb_enc( Encoder_State *st_fx, Word16 *n_mem ); static void rescale_genWB_mem_enc( Encoder_State *st_fx, Word16 sf ); -static void Quant_lower_LSF_fx( const Word16 lsf[], - Word16 lsf_q[], - Word16 lsf_idx[] ); +static void Quant_lower_LSF_fx( const Word16 lsf[], Word16 lsf_q[], Word16 lsf_idx[] ); static Word16 Quant_mirror_point_fx( const Word16 lsf[], const Word16 lsf_q[], Word16 *m ); static Word16 Find_LSF_grid_fx( const Word16 lsf[], Word16 lsf_q[], const Word16 m ); @@ -109,21 +73,9 @@ static void Quant_shb_res_gshape_fx( Encoder_State *st_fx, Word16 *shb_res_gshap static void Quant_shb_res_gshape_ivas_fx( Encoder_State *st, Word16 shb_res_gshape_fx[] ); -static void gainFrSmooth_En_fx( Encoder_State *st_fx, - Word16 *shb_frame_fx, - const Word16 *lpc_shb_fx, - const Word16 *lsp_shb_fx, - Word16 *MA_lsp_shb_spacing, - Word16 *frGainAttenuate, - Word16 *frGainSmoothEn ); +static void gainFrSmooth_En_fx( Encoder_State *st_fx, Word16 *shb_frame_fx, const Word16 *lpc_shb_fx, const Word16 *lsp_shb_fx, Word16 *MA_lsp_shb_spacing, Word16 *frGainAttenuate, Word16 *frGainSmoothEn ); -static void gainFrSmooth_En_ivas_fx( Encoder_State *st_fx, - Word16 *shb_frame_fx /* Q_in */, - const Word16 *lpc_shb_fx /* Q12 */, - const Word16 *lsp_shb_fx /* Q15 */, - Word16 *MA_lsp_shb_spacing /* Q15 */, - Word16 *frGainAttenuate /* Q0 */, - Word16 *frGainSmoothEn /* Q0 */ ); +static void gainFrSmooth_En_ivas_fx( Encoder_State *st_fx, Word16 *shb_frame_fx /* Q_in */, const Word16 *lpc_shb_fx /* Q12 */, const Word16 *lsp_shb_fx /* Q15 */, Word16 *MA_lsp_shb_spacing /* Q15 */, Word16 *frGainAttenuate /* Q0 */, Word16 *frGainSmoothEn /* Q0 */ ); /*-------------------------------------------------------------------* @@ -6909,7 +6861,7 @@ static void first_VQstages_fx( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ diff --git a/lib_enc/tcx_ltp_enc_fx.c b/lib_enc/tcx_ltp_enc_fx.c index a069f99b4..2bae2a092 100644 --- a/lib_enc/tcx_ltp_enc_fx.c +++ b/lib_enc/tcx_ltp_enc_fx.c @@ -8,12 +8,15 @@ #include "stl.h" #include "cnst.h" #include "basop_util.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ -static Word32 dot( const Word16 *X, const Word16 *Y, Word16 n ) + +static Word32 dot( + const Word16 *X, + const Word16 *Y, + Word16 n ) { Word32 acc; Word16 i; @@ -30,20 +33,22 @@ static Word32 dot( const Word16 *X, const Word16 *Y, Word16 n ) return acc; } -static Word32 interpolate_corr( /* o : interpolated value */ - const Word32 *x, /* i : input vector */ - const Word16 frac, /* i : fraction of lag */ - const Word16 frac_max /* i : max fraction */ + +/* o : interpolated value */ +static Word32 interpolate_corr( + const Word32 *x, /* i : input vector */ + const Word16 frac, /* i : fraction of lag */ + const Word16 frac_max /* i : max fraction */ ) { Word32 s; const Word16 *c, *win; - win = E_ROM_inter4_1_fx; if ( EQ_16( frac_max, 6 ) ) + { win = E_ROM_inter6_1_fx; - + } s = L_deposit_l( 0 ); @@ -93,7 +98,6 @@ static void tcx_ltp_pitch_search( #endif #endif - delta = 16; move16(); if ( EQ_16( pitres, 6 ) ) diff --git a/lib_enc/tns_base_enc_fx.c b/lib_enc/tns_base_enc_fx.c index 05b35813a..5a8daddc3 100644 --- a/lib_enc/tns_base_enc_fx.c +++ b/lib_enc/tns_base_enc_fx.c @@ -2,7 +2,7 @@ EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ - +#include "options.h" #include "cnst.h" #include "stl.h" //#include "prot_fx.h" @@ -10,11 +10,11 @@ #include "stl.h" #include #include -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + #define HLM_MIN_NRG_FX 858993459 // ( 32768.0f * 2 * NORM_MDCT_FACTOR / ( 640 * 640 ) ) in Q26 /** Get TNS filter parameters from autocorrelation. diff --git a/lib_enc/transition_enc_fx.c b/lib_enc/transition_enc_fx.c index 952d706ec..f15ebab48 100644 --- a/lib_enc/transition_enc_fx.c +++ b/lib_enc/transition_enc_fx.c @@ -5,7 +5,6 @@ #include #include "options.h" /* Compilation switches */ #include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ #include "rom_com.h" /* Static table prototypes */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/updt_enc_fx.c b/lib_enc/updt_enc_fx.c index aed3bf812..2982e6189 100644 --- a/lib_enc/updt_enc_fx.c +++ b/lib_enc/updt_enc_fx.c @@ -1,11 +1,10 @@ /*==================================================================================== EVS Codec 3GPP TS26.452 Aug 12, 2021. Version 16.3.0 ====================================================================================*/ + #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -#include "rom_com_fx.h" /* Static table prototypes */ -//#include "prot_fx.h" /* Function prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ diff --git a/lib_enc/vbr_average_rate_fx.c b/lib_enc/vbr_average_rate_fx.c index 28371b2d7..d591db58a 100644 --- a/lib_enc/vbr_average_rate_fx.c +++ b/lib_enc/vbr_average_rate_fx.c @@ -3,10 +3,8 @@ ====================================================================================*/ #include -#include "options.h" /* Compilation switches */ -#include "cnst.h" /* Common constants */ -//#include "prot_fx.h" /* Function prototypes */ -#include "rom_com_fx.h" /* Static table prototypes */ +#include "options.h" /* Compilation switches */ +#include "cnst.h" /* Common constants */ #include "stat_enc.h" /* Static table prototypes */ #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ diff --git a/lib_enc/vlpc_1st_cod_fx.c b/lib_enc/vlpc_1st_cod_fx.c index 9bfe0d8ae..9cbbd8796 100644 --- a/lib_enc/vlpc_1st_cod_fx.c +++ b/lib_enc/vlpc_1st_cod_fx.c @@ -5,12 +5,11 @@ #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + #define ISF_ONE 3 /*1.0f*1.28f Q1*/ /*=1.0f in 14Q1*1.28*/ /*------------------------------------------------------------------* diff --git a/lib_enc/voiced_enc_fx.c b/lib_enc/voiced_enc_fx.c index 0de0285d5..bd1b3e7af 100644 --- a/lib_enc/voiced_enc_fx.c +++ b/lib_enc/voiced_enc_fx.c @@ -5,21 +5,22 @@ #include #include "options.h" #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" /* Common constants */ #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ #include "basop_util.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * Local functions *--------------------------------------------------------------------*/ + static void synthesis_filter_fx( Word16 b[], Word16 x[], Word16 y[], Word16 buf[], Word16 P, Word16 N ); static Word32 DTFS_freq_corr_fx( DTFS_STRUCTURE X1_DTFS_fx, DTFS_STRUCTURE X2_DTFS_fx, Word16 lband, Word16 hband, Word16 *Qout ); static Word16 DTFS_alignment_extract_td_fx( Word16 *x1, Word16 *x2, Word16 lag ); static Word32 DTFS_getEngy_band_fx( DTFS_STRUCTURE X_fx, const Word16 lband, const Word16 hband ); + /*=======================================================================================*/ /* FUNCTION : ppp_voiced_encoder_fx() */ /*---------------------------------------------------------------------------------------*/ diff --git a/lib_enc/waveadjust_fec_cod_fx.c b/lib_enc/waveadjust_fec_cod_fx.c index f10a1bd0b..4efe9b9fe 100644 --- a/lib_enc/waveadjust_fec_cod_fx.c +++ b/lib_enc/waveadjust_fec_cod_fx.c @@ -5,13 +5,12 @@ #include #include "options.h" /* for wmc_tool */ #include "cnst.h" -//#include "prot_fx.h" -#include "rom_com_fx.h" #include "rom_com.h" #include "stat_com.h" #include "prot_fx.h" /* Function prototypes */ #include "prot_fx_enc.h" /* Function prototypes */ + /*-------------------------------------------------------------------* * SFM_Cal_fx() * diff --git a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c index 541e4d5a8..574a6950e 100644 --- a/lib_rend/ivas_dirac_output_synthesis_dec_fx.c +++ b/lib_rend/ivas_dirac_output_synthesis_dec_fx.c @@ -43,7 +43,7 @@ #include "ivas_rom_dec.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*------------------------------------------------------------------------- * Local constants diff --git a/lib_rend/ivas_mcmasa_ana_fx.c b/lib_rend/ivas_mcmasa_ana_fx.c index 4d41d73a5..b183c088a 100644 --- a/lib_rend/ivas_mcmasa_ana_fx.c +++ b/lib_rend/ivas_mcmasa_ana_fx.c @@ -41,7 +41,7 @@ #include "ivas_rom_com.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" -#include "ivas_rom_com_fx.h" + /*------------------------------------------------------------------------- * Local constants diff --git a/lib_rend/ivas_objectRenderer_fx.c b/lib_rend/ivas_objectRenderer_fx.c index d3c7b7002..1cf795451 100644 --- a/lib_rend/ivas_objectRenderer_fx.c +++ b/lib_rend/ivas_objectRenderer_fx.c @@ -40,15 +40,12 @@ #include "wmc_auto.h" #include "ivas_prot_fx.h" #include "debug.h" -#include "ivas_rom_com_fx.h" -#define float_to_fixed( n, factor ) ( round( n * ( 1 << factor ) ) ) -#define fixed_to_float( n, factor ) ( (float) n / ( 1 << factor ) ) + /*---------------------------------------------------------------------* * Local function prototypes *---------------------------------------------------------------------*/ - static void TDREND_Clear_Update_flags_fx( BINAURAL_TD_OBJECT_RENDERER_HANDLE hBinRendererTd /* i/o: TD renderer handle */ ); diff --git a/lib_rend/ivas_output_init_fx.c b/lib_rend/ivas_output_init_fx.c index a863373f8..c9ed0c006 100644 --- a/lib_rend/ivas_output_init_fx.c +++ b/lib_rend/ivas_output_init_fx.c @@ -37,9 +37,10 @@ #include "prot_fx.h" #include "ivas_prot_rend_fx.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "wmc_auto.h" #include "ivas_prot_fx.h" + + /*-------------------------------------------------------------------------* * audioCfg2channels() * diff --git a/lib_rend/ivas_reflections_fx.c b/lib_rend/ivas_reflections_fx.c index 6bd0ed87c..3bf9f7169 100644 --- a/lib_rend/ivas_reflections_fx.c +++ b/lib_rend/ivas_reflections_fx.c @@ -42,7 +42,7 @@ #include "ivas_rom_com.h" #include "wmc_auto.h" #include "debug.h" -#include "ivas_rom_com_fx.h" + /*-----------------------------------------------------------------------------------------* * Local constants/tabels @@ -66,6 +66,7 @@ static UWord16 LC_mixing_7_1_4[11] = { 0, 1, 2, 3, 4, 3, 4, 0, 1, 3, 4 }; * * Initializes the reflections data structure according to the requested input config. *-----------------------------------------------------------------------------------------*/ + ivas_error ivas_er_init( er_struct_t *reflections, const AUDIO_CONFIG inConfig ) diff --git a/lib_rend/ivas_reverb_utils_fx.c b/lib_rend/ivas_reverb_utils_fx.c index 553dbdb0a..d527bb663 100644 --- a/lib_rend/ivas_reverb_utils_fx.c +++ b/lib_rend/ivas_reverb_utils_fx.c @@ -37,7 +37,7 @@ #include "ivas_rom_rend.h" #include #include "wmc_auto.h" -#include "options_warnings.h" + /*-----------------------------------------------------------------------------------------* * Local constants diff --git a/lib_rend/ivas_shoebox_fx.c b/lib_rend/ivas_shoebox_fx.c index fb580de75..36af55838 100644 --- a/lib_rend/ivas_shoebox_fx.c +++ b/lib_rend/ivas_shoebox_fx.c @@ -40,7 +40,6 @@ #include "prot_fx.h" #include "wmc_auto.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" /*------------------------------------------------------------------------- diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 9f2345890..3aa351677 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -41,7 +41,6 @@ #include "lib_isar_pre_rend.h" #include "ivas_cnst.h" #include "ivas_rom_com.h" -#include "ivas_rom_com_fx.h" #include "ivas_rom_rend.h" #include #include @@ -9031,7 +9030,7 @@ static ivas_error getSamplesInternal( if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const Word16 )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const Word16) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From dd7707f29b11b0850bd18ca5e6523e836e225e9b Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 16:52:18 +0200 Subject: [PATCH 2/6] rename file --- Workspace_msvc/lib_com.vcxproj | 2 +- Workspace_msvc/lib_com.vcxproj.filters | 6 +++--- lib_com/{rom_com.c => rom_com_fx.c} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename lib_com/{rom_com.c => rom_com_fx.c} (100%) diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index e25fc22cd..a1f15745e 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -262,7 +262,7 @@ - + diff --git a/Workspace_msvc/lib_com.vcxproj.filters b/Workspace_msvc/lib_com.vcxproj.filters index 2f73f59a6..177c53156 100644 --- a/Workspace_msvc/lib_com.vcxproj.filters +++ b/Workspace_msvc/lib_com.vcxproj.filters @@ -430,9 +430,6 @@ common_all_c - - common_all_c - common_all_c @@ -505,6 +502,9 @@ common_ivas_c + + common_all_c + diff --git a/lib_com/rom_com.c b/lib_com/rom_com_fx.c similarity index 100% rename from lib_com/rom_com.c rename to lib_com/rom_com_fx.c -- GitLab From 4290523b3d4a7f205ead7772559241a275d231ae Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 17:23:08 +0200 Subject: [PATCH 3/6] merge igf_enc.c and igf_enc_fx.h + clang-format --- Workspace_msvc/lib_enc.vcxproj | 1 - Workspace_msvc/lib_enc.vcxproj.filters | 3 - lib_com/fft_rel_fx.c | 16 +- lib_com/igf_base_fx.c | 20 - lib_com/prot_fx.h | 10 - lib_com/tools_fx.c | 8 +- lib_enc/igf_enc.c | 2688 ----------------------- lib_enc/igf_enc_fx.c | 2716 +++++++++++++++++++++++- lib_enc/lsf_enc_fx.c | 4 +- lib_enc/pre_proc_fx.c | 2 +- lib_enc/swb_tbe_enc_fx.c | 2 +- lib_rend/lib_rend_fx.c | 2 +- 12 files changed, 2689 insertions(+), 2783 deletions(-) delete mode 100644 lib_enc/igf_enc.c diff --git a/Workspace_msvc/lib_enc.vcxproj b/Workspace_msvc/lib_enc.vcxproj index 123754142..5222b16b5 100644 --- a/Workspace_msvc/lib_enc.vcxproj +++ b/Workspace_msvc/lib_enc.vcxproj @@ -240,7 +240,6 @@ - diff --git a/Workspace_msvc/lib_enc.vcxproj.filters b/Workspace_msvc/lib_enc.vcxproj.filters index e8f429f49..4194dbc5a 100644 --- a/Workspace_msvc/lib_enc.vcxproj.filters +++ b/Workspace_msvc/lib_enc.vcxproj.filters @@ -253,9 +253,6 @@ encoder_all_c - - encoder_all_c - encoder_all_c diff --git a/lib_com/fft_rel_fx.c b/lib_com/fft_rel_fx.c index fe5d2bb8d..9f8f03556 100644 --- a/lib_com/fft_rel_fx.c +++ b/lib_com/fft_rel_fx.c @@ -142,17 +142,17 @@ static void c_fft_fx( * is counted as a move16() */ - input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); // Qx + input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); // Qx L_tmp1 = L_mult( *input_ptr1++, 16384 ); L_tmp2 = L_mult( *input_ptr1, 16384 ); - input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); tmp1 = msu_r_sat( L_tmp1, *input_ptr1, 16384 ); tmp3 = mac_r_sat( L_tmp1, *input_ptr1++, 16384 ); - input_ptr2 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr3 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr2 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr3 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); L_tmp1 = L_mult( *input_ptr2++, 16384 ); tmp2 = mac_r_sat( L_tmp1, *input_ptr3, 16384 ); @@ -240,11 +240,11 @@ static void c_fft_fx( * The addition of 'in_ptr' + and index value from 'reorder_ptr' * is counted as a move16() */ - input_ptr1 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr2 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr1 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr2 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr3 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); - input_ptr4 = in_ptr + (const Word16) ( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr3 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); + input_ptr4 = in_ptr + ( const Word16 )( (uintptr_t) ( *table_ptr++ ) >> (uintptr_t) shift ); tmp3 = sub( *input_ptr1, *input_ptr2 ); diff --git a/lib_com/igf_base_fx.c b/lib_com/igf_base_fx.c index 44cf27c5f..bdfb5df70 100644 --- a/lib_com/igf_base_fx.c +++ b/lib_com/igf_base_fx.c @@ -1230,26 +1230,6 @@ void IGFCommonFuncsMDCTSquareSpec_ivas( const Word16 sqrtBgn, /**< in } -/**********************************************************************/ /* -write bits to stream -**************************************************************************/ -void IGFCommonFuncsWriteSerialBit( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< out: Q0 | bit offset */ - Word16 bit /**< in: Q0 | value of bit */ -) -{ - - IF( hBstr ) - { - push_next_indice( hBstr, bit, 1 ); - } - *pBitOffset = add( *pBitOffset, 1 ); - move16(); - - return; -} - /**********************************************************************/ /* changes the IGF configuration **************************************************************************/ diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 4ae9d5755..101b7889b 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -5701,12 +5701,6 @@ void IGFCommonFuncsMDCTSquareSpec_ivas( Word16 indexOffset /**< in: Q0 | index offset */ ); -void IGFCommonFuncsWriteSerialBit( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< out: Q0 | bit offset */ - Word16 bit /**< in: Q0 | value of bit */ -); - Word16 IGFCommonFuncsIGFConfiguration( const Word32 total_brate, /* i : bitrate in bs e.g. 9600 for 9.6kbs */ const Word16 bwidth, /* i : audio bandwidth */ @@ -11352,10 +11346,6 @@ Word16 is_EVS_bitrate( Word16 *Opt_AMR_WB /* i : AMR-WB IO flag */ ); -void IGFEncResetTCX10BitCounter_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ -); - ivas_error IGF_Reconfig( IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ const Word16 igf, /* i : IGF on/off */ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index d7882d5b1..a1d35062b 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -4191,10 +4191,10 @@ void v_multc_att( /*-------------------------------------------------------------------* - * v_multc_att32() - * - * Attenuation of a vector,, attenuation factor in Q15 - *-------------------------------------------------------------------*/ + * v_multc_att32() + * + * Attenuation of a vector,, attenuation factor in Q15 + *-------------------------------------------------------------------*/ void v_multc_att32( const Word32 x[], /* i : Input vector Qx */ diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c deleted file mode 100644 index a639317be..000000000 --- a/lib_enc/igf_enc.c +++ /dev/null @@ -1,2688 +0,0 @@ -/****************************************************************************************************** - - (C) 2022-2025 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository. All Rights Reserved. - - This software is protected by copyright law and by international treaties. - The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB, - Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD., - Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange, - Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other - contributors to this repository retain full ownership rights in their respective contributions in - the software. This notice grants no license of any kind, including but not limited to patent - license, nor is any license granted by implication, estoppel or otherwise. - - Contributors are required to enter into the IVAS codec Public Collaboration agreement before making - contributions. - - This software is provided "AS IS", without any express or implied warranties. The software is in the - development stage. It is intended exclusively for experts who have experience with such software and - solely for the purpose of inspection. All implied warranties of non-infringement, merchantability - and fitness for a particular purpose are hereby disclaimed and excluded. - - Any dispute, controversy or claim arising under or in relation to providing this software shall be - submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in - accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and - the United Nations Convention on Contracts on the International Sales of Goods. - -*******************************************************************************************************/ - -/*==================================================================================== - EVS Codec 3GPP TS26.443 Nov 04, 2021. Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0 - ====================================================================================*/ - -#include -#include -#include "options.h" -#include -#include "prot_fx.h" -#include "cnst.h" -#include "stat_enc.h" -#include "wmc_auto.h" -#include "prot_fx_enc.h" - - -#define INV_Log2_10_Q15 9864 /*1/log2(10) in Q15*/ -#define INV_Log2_10_Q12 1233 /*1/log2(10) in Q12*/ -#define INV_Log2_e_Q15 22713 /*1/log2(e) in Q15*/ -/*-------------------------------------------------------------------* - * IGF_write_bit_fx() - * - * write single bit to stream - *-------------------------------------------------------------------*/ -static void IGF_write_bit_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *bitCount, /* i/o: bit counter */ - const Word16 value /* i : value */ -) -{ - IF( hBstr ) - { - push_next_indice( hBstr, value, 1 ); - } - - ( *bitCount ) = add( ( *bitCount ), 1 ); - move16(); - - return; -} - -/*-------------------------------------------------------------------* - * IGF_write_bits() - * - * write bits to stream - *-------------------------------------------------------------------*/ -static void IGF_write_bits( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *bitCount, /* i/o: bit counter */ - const Word16 value, /* i/o: value */ - Word16 bits /* i : number of bits */ -) -{ - WHILE( bits-- ) - { - IF( s_and( value, shl( 1, bits ) ) == 0 ) - { - IGF_write_bit_fx( hBstr, bitCount, 0 ); - } - ELSE - { - IGF_write_bit_fx( hBstr, bitCount, 1 ); - } - } - - return; -} - - -/*-------------------------------------------------------------------* - * IGF_getCrest_new() - * - * crest factor calculation - *-------------------------------------------------------------------*/ - -/*! r: crest factor */ -static Word16 IGF_getCrest_new_fx( - const Word16 *logSpec, /* i : power spectrum */ - const Word16 start, /* i : start subband index */ - const Word16 stop, /* i : stop subband index */ - Word16 *crest_exp /*Stores the exponent of the result(return value)*/ -) -{ - Word16 i; - Word16 x; - Word32 x_eff; - Word16 x_max; - Word16 exp; - Word16 temp; - Word16 temp_e; - Word16 crest; /*1.0f in Q15*/ - x_eff = 0; - x_max = 0; - exp = 0; - temp = 0; - crest = 32767; /*1.0f in Q15*/ - move32(); - move16(); - move16(); - move16(); - move16(); - - FOR( i = start; i < stop; i++ ) - { - x = logSpec[i]; - move16(); - x_eff = L_mac0( x_eff, x, x ); - - if ( GT_16( x, x_max ) ) - { - x_max = x; - move16(); - } - } - - x_eff = BASOP_Util_Divide3216_Scale( x_eff, sub( stop, start ), &temp_e ); - temp_e = add( temp_e, 16 ); /*exp += 31 - 15 + 16(because x_eff is word32)*/ - x_eff = L_shr( x_eff, sub( 15, temp_e ) ); - temp_e = 15; - move16(); - temp = Sqrt16( extract_l( x_eff ), &temp_e ); - - test(); - IF( x_eff > 0 && x_max > 0 ) - { - temp = BASOP_Util_Divide1616_Scale( x_max, temp, &exp ); - exp = add( exp, sub( 15, temp_e ) ); - IF( exp < 0 ) - { - temp = shl( temp, exp ); - exp = 0; - move16(); - } - crest = s_max( shl_sat( 1, sub( 15, exp ) ), temp ); - } - *crest_exp = exp; - move16(); - return crest; -} - - -/*-------------------------------------------------------------------* - * IGF_getSFM_new() - * - * calculates spectral flatness measurement - *-------------------------------------------------------------------*/ - -/*! r: SFM value */ -static Word16 IGF_getSFM_new_fx( - const Word32 *powerSpectrum, /* i : power spectrum */ - const Word16 *logSpec, /* i : log of power spectrum */ - const Word16 start, /* i : start subband index */ - const Word16 stop, /* i : stop subband index */ - Word16 *e_ps /*Stores exp related to power spectrum*/ -) -{ - Word16 n; - Word16 i; - Word16 num; - Word32 denom; - Word16 numf; - Word32 tmp; - Word16 sfm; - Word16 sfm_e; - Word16 denom_e; - Word16 numf_e; /*stores exponent for numf*/ - Word16 tmp_e; - - num = 0; - denom = ONE_IN_Q30; - denom_e = 1; - sfm = MAX16B; // Q15 - move16(); - move32(); - move16(); - move16(); - - FOR( i = start; i < stop; i++ ) - { - tmp = powerSpectrum[i]; - n = logSpec[i /*-start*/]; - move32(); - move16(); - num = add( num, n ); - denom = BASOP_Util_Add_Mant32Exp( tmp, e_ps[i], denom, denom_e, &denom_e ); - } - - numf = BASOP_Util_Divide1616_Scale( num, sub( stop, start ), &numf_e ); - denom = BASOP_Util_Divide3216_Scale( denom, sub( stop, start ), &tmp_e ); - denom_e = add( add( denom_e, tmp_e ), 1 ); /*denom_e+tmp_e-15 +16(because type of denom is word32)*/ - - IF( denom != 0 ) - { - tmp = BASOP_util_Pow2( L_add( numf, shl_sat( 1, sub( 14, numf_e ) ) ), add( 16, numf_e ), &tmp_e ); - sfm = BASOP_Util_Divide3232_Scale( tmp, denom, &sfm_e ); - sfm_e = add( sfm_e, sub( tmp_e, denom_e ) ); - sfm = shl_sat( extract_l( L_min( sfm, L_shl_sat( 1, sub( 15, sfm_e ) ) ) ), sfm_e ); - } - - return sfm; -} -/*-------------------------------------------------------------------* - * IGF_getTilt() - * - * calculates spectral tilt - *-------------------------------------------------------------------*/ - -/*! r: spectral tilt value */ - -/*-------------------------------------------------------------------* - * IGF_getTNR() - * - * calculates tonal-to-noise ratio - *-------------------------------------------------------------------*/ - -/*! r: spectral tilt value */ -/* Returns value with exponent as 9 and Q as 22*/ - -static Word32 IGF_getTNR_ivas_fx( - const Word32 *powerSpectrum, /* i : energies */ - const Word16 start, /* i : start subband index */ - const Word16 stop, /* i : stop subband index */ - const Word16 adap, /* i : SFB width adaptation */ - Word16 *e_ps, /*Stores exponent for powerSpectrum*/ - Word16 e_adap /*Stores exponent for adap*/ -) -{ - Word16 i; - Word16 width; - Word32 avg; - Word32 tonal; - Word16 tonal_e; /* holds exp for tonal*/ - Word32 noise; - Word16 noise_e; /* holds exp for noise*/ - Word32 tonalToNoise; - Word32 rootSpec[300]; - Word16 rootSpec_e[300]; /*rootSpec_e[i] holds exp for rootSpec[i]*/ - Word16 avg_e; /* holds exp for avg*/ - Word16 tmp_e; - avg = 0; - tonal = 0; - noise = EPSILON_FX; - tonal_e = 0; - noise_e = 0; - avg_e = 0; - tmp_e = 0; - move32(); - move32(); - move32(); - move16(); - move16(); - move16(); - move16(); - - set32_fx( rootSpec, 0, 300 ); - set16_fx( rootSpec_e, 0, 300 ); - - width = sub( stop, start ); - FOR( i = start; i < stop; i++ ) - { - rootSpec_e[( i - start )] = e_ps[i]; - move16(); - rootSpec[( i - start )] = Sqrt32( powerSpectrum[i], &rootSpec_e[( i - start )] ); /*rootSpec[i - start] = sqrtf( powerSpectrum[i] );*/ - move32(); - avg = BASOP_Util_Add_Mant32Exp( avg, avg_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &avg_e ); /*avg += rootSpec[i - start];resultant exponent is avg_e*/ - } - avg = BASOP_Util_Divide3216_Scale( avg, width, &tmp_e ); /*avg /= width;*/ - avg_e = add( 16, sub( add( avg_e, tmp_e ), 15 ) ); - - FOR( i = start; i < stop; i++ ) - { - Word16 normSpec_e; /*stores resultant exponent for normSpec*/ - Word16 normSpec = BASOP_Util_Divide3232_Scale( rootSpec[i - start], avg, &normSpec_e ); /*rootSpec[i - start] / avg;*/ - normSpec_e = add( normSpec_e, sub( rootSpec_e[i - start], avg_e ) ); - IF( GT_32( normSpec, L_add_sat( L_shl_sat( 1, sub( 15, normSpec_e ) ), L_shl_sat( adap, sub( e_adap, normSpec_e ) ) ) ) ) - { - tonal = BASOP_Util_Add_Mant32Exp( tonal, tonal_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &tonal_e ); /*tonal += rootSpec[i - start];*/ - } - ELSE IF( LT_32( normSpec, L_shl_sat( 1, sub( 15, normSpec_e ) ) ) ) - { - noise = BASOP_Util_Add_Mant32Exp( noise, noise_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &noise_e ); /*noise += rootSpec[i - start];*/ - } - } - - /*tonalToNoise = 20.f * log10f( max( 1e-018f, tonal / noise ) )*/ - IF( noise == 0 ) // To handle condition if denom = 0 - { - tonalToNoise = imult3216( L_shr( L_add( L_shl( 18 /* log10f(1e-018f) */, Q25 ), Mpy_32_16_1( L_add( BASOP_Util_Log2( tonal ), L_shl( tonal_e, Q25 ) ) /*Q25*/, INV_Log2_10_Q15 ) /*25+15-15*/ ), 3 ) /*Q22*/, 20 ); - } - ELSE - { - Word16 temp = BASOP_Util_Divide3232_Scale( tonal, noise, &tmp_e ); /*tonal / noise*/ - tmp_e = add( tmp_e, sub( tonal_e, noise_e ) ); - IF( GE_16( temp, 1 ) ) - { - tonalToNoise = imult3216( Mult_32_16( L_add( BASOP_Util_Log2( temp ), L_shl( add( 16, tmp_e ), Q25 ) ) /*Q25*/, INV_Log2_10_Q12 ) /*25+12-15*/, 20 ); /*Q22*/ - } - ELSE - { - tonalToNoise = -1509949440; /*-360.f Q22*/ - move32(); - } - } - - return tonalToNoise; -} - -/*-------------------------------------------------------------------* - * IGF_CalculateEnvelope() - * - * envelope estimation - *-------------------------------------------------------------------*/ - -static void IGF_CalculateEnvelope_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ - Word32 *pMDCTSpectrum_fx, /* i : MDCT spectrum */ - Word16 e_mdct, /* i : exp of MDCT spectrum */ - Word32 *pPowerSpectrum_fx, /* i : MDCT^2 + MDST^2 spectrum, or estimate */ - Word16 *e_ps, /* i : exp of power spectrum */ - const Word16 igfGridIdx, /* i : IGF grid index */ - const Word16 isTransient, /* i : flag indicating if transient is detected */ - const Word16 last_core_acelp, /* i : indicator if last frame was ACELP core */ - const Word16 element_mode, /* i : IVAS element_mode */ - const Word16 att /* i : attenuation */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - H_IGF_GRID hGrid; - Word16 *swb_offset; - Word16 sfb; /* this is the actual scalefactor band */ - Word16 width; /* this is width in subbands of the actual scalefactor band */ - Word16 tile_idx; - Word16 strt_cpy; - Word32 gain; /* the gain which has to be applied to the source tile to get the destination energy */ - Word16 sb; - Word32 sfbEnergyR; - Word32 sfbEnergyC; /* the energy of the destination region of the tile */ - Word32 sfbEnergyTileR; - Word32 sfbEnergyTileC; /* the energy of the destination region of the tile */ - Word16 tmp, x, y; - Word16 mean_x_fx, mean_y_fx; - Word32 mean_xy_fx, mean_x2_fx; - Word16 tmp_tb; - Word16 tmp_sb; - Word16 sfbCnt; - Word16 sfm; - Word16 crest; - Word16 temp; - Word16 mean_x_e, mean_y_e; /*Stores exponent for mean_x and mean_y respectively*/ - Word16 mean_xy_e, mean_x2_e; /*stores exponent for mean_xy and mean_x2 respectively*/ - Word16 sfbEnergyTileR_e; /*Exponent for sfbEnergyTileR*/ - Word16 sfbEnergyTileC_e; /*Exponent for sfbEnergyTileC*/ - Word16 sfbEnergyC_e; /*Exponent for sfbEnergyC*/ - Word16 sfbEnergyR_e; - Word16 gain_e; /*exponent for gain*/ - Word16 tmp_tb_e; /*Stores exponent for tmp_tb*/ - Word16 tmp_sb_e; /*stores exponent for tmp_sb*/ - Word16 crest_exp; /*Stores the exponent of the result(return value)*/ - Word16 sfm_exp; /*stores exponent for ouput from sfm*/ - Word16 tmp_e; - - hPrivateData = &hIGFEnc->igfData; - hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; - swb_offset = hGrid->swb_offset; - - IF( element_mode > EVS_MONO ) - { - IF( igfGridIdx != IGF_GRID_LB_NORM ) - { - FOR( sfbCnt = 0; sfbCnt < sub( hGrid->sfbWrap[hGrid->nTiles], hGrid->sfbWrap[0] ); sfbCnt++ ) - { - /* reset filter */ - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_TB_e[sfbCnt] - hPrivateData->prevSFB_FIR_TB_e[sfbCnt] = 0; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_TB_e[sfbCnt] - hPrivateData->prevSFB_IIR_TB_e[sfbCnt] = 0; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_SB_e[sfbCnt] - hPrivateData->prevSFB_FIR_SB_e[sfbCnt] = 0; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_SB_e[sfbCnt] - hPrivateData->prevSFB_IIR_SB_e[sfbCnt] = 0; - hPrivateData->prevDampingFactor_IIR_fx[sfbCnt] = MIN16B; /* -1.f in Q15*/ - hPrivateData->prevDampingFactor_IIR_e[sfbCnt] = 0; - hPrivateData->dampingFactorSmoothing[sfbCnt] = 2; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - } - } - - IF( pPowerSpectrum_fx ) - { - FOR( sb = hGrid->sbWrap[0]; sb < swb_offset[hGrid->sfbWrap[hGrid->nTiles]]; sb++ ) - { - IF( LT_32( 1, pPowerSpectrum_fx[sb] ) ) - { - hPrivateData->logSpec[sb] = s_max( 0, extract_l( W_extract_l( W_shr( W_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), W_shl( e_ps[sb], Q25 ) ), Q25 ) ) ) ); - move16(); - } - ELSE - { - hPrivateData->logSpec[sb] = 0; - move16(); - } - } - } - - FOR( tile_idx = 0; tile_idx < hGrid->nTiles; tile_idx++ ) - { - strt_cpy = hGrid->sbWrap[tile_idx]; - move16(); - - FOR( sfb = hGrid->sfbWrap[tile_idx]; sfb < hGrid->sfbWrap[tile_idx + 1]; sfb++ ) - { - width = sub( swb_offset[sfb + 1], swb_offset[sfb] ); - sfbEnergyTileR = EPSILON_FIX; - sfbEnergyTileC = EPSILON_FIX; - sfbEnergyC = EPSILON_FX; - sfbEnergyTileR_e = 0; - sfbEnergyTileC_e = 0; - sfbEnergyC_e = 0; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - - IF( pPowerSpectrum_fx != NULL ) - { - tmp = strt_cpy; - move16(); - FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) - { - Word16 shift = norm_l( pPowerSpectrum_fx[sb] ); - sfbEnergyC = BASOP_Util_Add_Mant32Exp( sfbEnergyC, sfbEnergyC_e, L_shl( pPowerSpectrum_fx[sb], shift ), sub( e_ps[sb], shift ), &sfbEnergyC_e ); - // sfbEnergyTileR = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR, sfbEnergyTileR_e, Mult_32_32( pMDCTSpectrum_fx[strt_cpy], pMDCTSpectrum_fx[strt_cpy] ), shl( e_mdct, 1 ), &sfbEnergyTileR_e ); - Word64 tmp64 = W_mult_32_32( pMDCTSpectrum_fx[strt_cpy], pMDCTSpectrum_fx[strt_cpy] ); - Word16 tmp64_e = W_norm( tmp64 ); - tmp64 = W_shl( tmp64, tmp64_e ); - - sfbEnergyTileR = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR, sfbEnergyTileR_e, W_extract_h( tmp64 ), shl( e_mdct, 1 ) - tmp64_e, &sfbEnergyTileR_e ); - shift = norm_l( pPowerSpectrum_fx[strt_cpy] ); - sfbEnergyTileC = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC, sfbEnergyTileC_e, L_shl( pPowerSpectrum_fx[strt_cpy], shift ), sub( e_ps[strt_cpy], shift ), &sfbEnergyTileC_e ); - - strt_cpy = add( strt_cpy, 1 ); - } - - sfbEnergyTileR = L_deposit_h( BASOP_Util_Divide3232_Scale( sfbEnergyTileR, width, &tmp_e ) ); - sfbEnergyTileR_e = add( sub( sfbEnergyTileR_e, Q31 ), tmp_e ); - - IF( sfbEnergyTileR == 0 ) - { - sfbEnergyTileR = EPSILON_FX; - sfbEnergyTileR_e = 0; - move32(); - move16(); - } - IF( sfbEnergyC == 0 ) - { - sfbEnergyC = EPSILON_FX; - sfbEnergyC_e = 0; - move32(); - move16(); - } - IF( sfbEnergyTileC == 0 ) - { - sfbEnergyTileC = EPSILON_FX; - sfbEnergyTileC_e = 0; - temp = BASOP_Util_Divide3232_Scale( sfbEnergyC, sfbEnergyTileC, &tmp_e ); - tmp_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); - move32(); - move16(); - } - ELSE - { - /*gain = (float) ( sfbEnergyTileR * ( sfbEnergyC / sfbEnergyTileC ) );*/ - temp = BASOP_Util_Divide3232_Scale( sfbEnergyC, sfbEnergyTileC, &tmp_e ); - tmp_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); - } - - gain = Mult_32_16( sfbEnergyTileR, temp ); // gain_e - gain_e = add( tmp_e, sfbEnergyTileR_e ); - - IF( element_mode > EVS_MONO ) - { - test(); - IF( !isTransient ) - { - Word16 diffSFM; - Word16 shiftedSFM = 0; - Word16 shiftedSFM_e = 0; - move16(); - move16(); - - // tmp_tb = IGF_getSFM_new( pPowerSpectrum, hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1] ) / IGF_getCrest_new( hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1] ); - sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1], e_ps ); - sfm_exp = 0; - move16(); - crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1], &crest_exp ); - tmp_tb = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); // tmp_tb_e - tmp_tb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); - - // tmp_sb = IGF_getSFM_new( pPowerSpectrum, hPrivateData->logSpec, tmp, strt_cpy ) / IGF_getCrest_new( hPrivateData->logSpec, tmp, strt_cpy ); - sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, tmp, strt_cpy, e_ps ); - crest = IGF_getCrest_new_fx( hPrivateData->logSpec, tmp, strt_cpy, &crest_exp ); - tmp_sb = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); // tmp_sb_e - tmp_sb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); - - test(); - IF( last_core_acelp || hPrivateData->wasTransient ) - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = tmp_tb; /*Exponent for hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] : hPrivateData->prevSFB_FIR_TB_e[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] : hPrivateData->prevSFB_IIR_TB_e[sfb] */ - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = tmp_sb; /*Exponent for hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] : hPrivateData->prevSFB_FIR_SB_e[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] : hPrivateData->prevSFB_IIR_SB_e[sfb] */ - hPrivateData->prevSFB_FIR_TB_e[sfb] = hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_tb_e; - hPrivateData->prevSFB_FIR_SB_e[sfb] = hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - - tmp_tb = shr( tmp_tb, 2 ); /*taking 2 guard bits so it's exponent tmp_sb_e=+2*/ - tmp_sb = shr( tmp_sb, 2 ); /*taking 2 guard bits so it's exponent tmp_tb_e=+2 */ - tmp_sb_e = add( tmp_sb_e, 2 ); - tmp_tb_e = add( tmp_tb_e, 2 ); - - Word16 tmp0, tmp2, tmp3, tmp4; - Word16 tmp0_e, tmp2_e, tmp3_e, tmp4_e; - tmp0 = shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], 2 ); - tmp0_e = add( hPrivateData->prevSFB_FIR_TB_e[sfb], 2 ); - move16(); - tmp2 = shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], 2 ); - tmp2_e = add( hPrivateData->prevSFB_IIR_TB_e[sfb], 2 ); - move16(); - tmp3 = shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], 2 ); - tmp3_e = add( hPrivateData->prevSFB_FIR_SB_e[sfb], 2 ); - move16(); - tmp4 = shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], 2 ); - tmp4_e = add( hPrivateData->prevSFB_IIR_SB_e[sfb], 2 ); - move16(); - Word16 x1, x2; - - Word16 x1_e = BASOP_Util_Add_MantExp( tmp0, tmp0_e, tmp2, tmp2_e - 1, &x1 ); - Word16 x2_e = BASOP_Util_Add_MantExp( tmp3, tmp3_e, tmp4, tmp4_e - 1, &x2 ); - hPrivateData->sfb_tb_e[sfb] = BASOP_Util_Add_MantExp( tmp_tb, tmp_tb_e, x1, x1_e, &hPrivateData->SFM_tb_fx[sfb] ); // hPrivateData->sfb_sb_e[sfb] - move16(); - BASOP_Util_Add_MantExp( 22118, 2, negate( hPrivateData->SFM_tb_fx[sfb] ), hPrivateData->sfb_tb_e[sfb], &tmp ); - - IF( tmp < 0 ) - { - hPrivateData->sfb_tb_e[sfb] = 2; - hPrivateData->SFM_tb_fx[sfb] = 22118; - move16(); - move16(); - } - - hPrivateData->sfb_sb_e[sfb] = BASOP_Util_Add_MantExp( tmp_sb, tmp_sb_e, x2, x2_e, &hPrivateData->SFM_sb_fx[sfb] ); // hPrivateData->sfb_tb_e[sfb] - move16(); - BASOP_Util_Add_MantExp( 22118, 2, negate( hPrivateData->SFM_sb_fx[sfb] ), hPrivateData->sfb_sb_e[sfb], &tmp ); - - IF( tmp < 0 ) - { - hPrivateData->sfb_sb_e[sfb] = 2; - hPrivateData->SFM_sb_fx[sfb] = 22118; - move16(); - move16(); - } - - BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sfb], hPrivateData->sfb_sb_e[sfb], negate( hPrivateData->SFM_tb_fx[sfb] ), hPrivateData->sfb_tb_e[sfb], &diffSFM ); - - test(); - IF( diffSFM > 0 && LT_32( hPrivateData->SFM_tb_fx[sfb], L_shr( 3277 /*0.1 Q15*/, hPrivateData->sfb_tb_e[sfb] ) ) ) /* check whether target SFB is more tonal than source SFB */ - { - Word16 currDampingFactor, dampingFactor; - Word16 slope, threshold; - Word16 alpha; - Word16 slope_e, threshold_e, currDampingFactor_e, dampingFactor_e, alpha_e; - - /* calculate spectral tilt to detect sudden drops (or increases) in energy in the current SFB */ - // slope = IGF_getTilt_fx( pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1], e_ps, &slope_e ); - - x = 1; - mean_x_fx = mean_y_fx = 0; - Word32 mean_y_fx_tmp = 0; - move32(); - mean_xy_fx = mean_x2_fx = 0; - mean_x_e = 15; - mean_xy_e = mean_y_e = mean_x2_e = 31; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - - FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) - { - mean_x_fx = add( mean_x_fx, x ); /*Q0*/ - mean_x2_fx = L_add( mean_x2_fx, L_mult0( x, x ) ); /*Q0*/ - - /*y = 20.f * log10f( max( 1.f, powerSpectrum[i] ) );*/ - IF( LE_64( W_deposit32_l( pPowerSpectrum_fx[sb] ), W_shl( 1, ( sub( 31, e_ps[sb] ) ) ) ) ) - { - y = 0; - move16(); - } - ELSE - { - y = imult1616( 20, extract_l( L_shr( Mult_32_16( ( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( e_ps[sb], Q25 ) ) ), INV_Log2_10_Q15 ), Q25 ) ) ); /*Q0*/ - } - mean_y_fx_tmp = L_mac0( mean_y_fx_tmp, y, 1 ); /*Q0*/ - mean_xy_fx = L_add( mean_xy_fx, L_mult0( y, x ) ); /*Q0*/ - - x = add( x, 1 ); - } - mean_y_fx = BASOP_Util_Divide3216_Scale( mean_y_fx_tmp, width, &tmp_e ); /* mean_y_e*/ - - mean_y_e = add( mean_y_e, sub( tmp_e, 15 ) ); - mean_x_fx = BASOP_Util_Divide1616_Scale( mean_x_fx, width, &tmp_e ); /* mean_x_e*/ - mean_x_e = add( mean_x_e, sub( tmp_e, 15 ) ); - mean_xy_fx = BASOP_Util_Divide3216_Scale( mean_xy_fx, width, &tmp_e ); /* mean_xy_e*/ - mean_xy_e = add( mean_xy_e, sub( tmp_e, 15 ) ); - mean_x2_fx = BASOP_Util_Divide3216_Scale( mean_x2_fx, width, &tmp_e ); /* mean_x2_e*/ - mean_x2_e = add( mean_x2_e, sub( tmp_e, 15 ) ); - - /*slope = ( mean_xy - mean_x * mean_y ) / ( mean_x2 - mean_x * mean_x );*/ - slope = BASOP_Util_Divide3232_Scale( ( L_sub( mean_xy_fx, L_shl( mult( mean_x_fx, mean_y_fx ), sub( add( mean_x_e, mean_y_e ), mean_xy_e ) ) ) ), ( L_sub( mean_x2_fx, L_shl( mult( mean_x_fx, mean_x_fx ), sub( add( mean_x_e, mean_x_e ), mean_x2_e ) ) ) ), &slope_e ); - slope_e = add( slope_e, sub( mean_xy_e, mean_x2_e ) ); - - /* determine whether strong tilt is due to a step in the spectrum (e.g. band limitation, no damping) - or a tonal component close the band border (apply damping) by calculating SFM for a shift of 1/2 SFB width*/ - threshold = BASOP_Util_Divide1616_Scale( 60, width, &threshold_e ); - - test(); - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope, add( slope_e, 16 ), negate( threshold ), add( threshold_e, 16 ) ), -1 ) ) - { - Word16 shift = shr( width, 1 ); - sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift, e_ps ); - crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift, &crest_exp ); - shiftedSFM = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); - } - ELSE IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope, add( slope_e, 16 ), threshold, add( threshold_e, 16 ) ), 1 ) && ( NE_16( sfb, sub( hGrid->sfbWrap[hGrid->nTiles], 1 ) ) ) ) - { - Word16 shift = shr( width, 1 ); - shiftedSFM = BASOP_Util_Divide1616_Scale( IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, e_ps ), IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, &crest_exp ), &tmp_e ); - sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, e_ps ); - crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, &crest_exp ); - shiftedSFM = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); - } - shiftedSFM_e = add( shiftedSFM_e, sub( sfm_exp, crest_exp ) ); - - IF( GT_32( shiftedSFM, L_shl( 1311 /*0.04f Q15*/, negate( shiftedSFM_e ) ) ) ) - { - currDampingFactor = 32767; /*1.f Q15*/ - currDampingFactor_e = 0; - move16(); - move16(); - } - ELSE - { - // alpha = min( 320.f / (float) swb_offset[sfb + 1], 1.25f ); - temp = BASOP_Util_Divide1616_Scale( 320, swb_offset[sfb + 1], &alpha_e ); - alpha = extract_l( L_min( temp, L_shl( 20480 /*1.25 Q14*/, sub( 1, alpha_e ) ) ) ); // alpha_e - - // currDampingFactor = expf( 1.25f * alpha * logf( hPrivateData->SFM_tb[sfb] / hPrivateData->SFM_sb[sfb] ) ); - temp = BASOP_Util_Divide1616_Scale( hPrivateData->SFM_tb_fx[sfb], hPrivateData->SFM_sb_fx[sfb], &tmp_e ); // tmp_e - tmp_e = add( tmp_e, sub( hPrivateData->sfb_tb_e[sfb], hPrivateData->sfb_sb_e[sfb] ) ); - Word16 temp1 = mult( 20480 /* 1.25f in Q14 */, alpha ); - Word16 tmp1_e = add( 1, alpha_e ); - currDampingFactor = round_fx( BASOP_util_Pow2( Mpy_32_16_1( L_add( BASOP_Util_Log2( temp ), L_shl_sat( add( 16, tmp_e ), 25 ) ), temp1 ), add( tmp1_e, 6 ), &currDampingFactor_e ) ); // currDampingFactor_e - - /* calculate tonal-to-noise ratio and reduce damping for low values*/ - - Word32 tonalToNoise; - Word16 adap; - Word16 adap_e; /*stores exp for adap*/ - Word16 tonalToNoise_e; /*stores exponent for tonalToNoise*/ - tonalToNoise_e = 9; - move16(); - adap = BASOP_Util_Divide1616_Scale( width, 40, &adap_e ); - tonalToNoise = IGF_getTNR_ivas_fx( pPowerSpectrum_fx, swb_offset[sfb], swb_offset[sfb + 1], adap, e_ps, adap_e ); /*Q22*/ - - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( tonalToNoise, tonalToNoise_e, L_add( L_shl( 10, sub( 15, adap_e ) ), adap ), add( 16, adap_e ) ), -1 ) ) - { - // currDampingFactor += 0.03f * ( ( 10 + adap ) - tonalToNoise ); - Word32 temp2 = BASOP_Util_Add_Mant32Exp( L_add( L_shl( 10, sub( 15, adap_e ) ) /*exp:adap_e*/, adap ), add( adap_e, 16 ), L_negate( tonalToNoise ), tonalToNoise_e, &tmp_e ); // tmp_e - currDampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor, currDampingFactor_e, extract_l( Mult_32_32( 983 /*0.03f Q15*/, temp2 ) ), tmp_e, &currDampingFactor ); // currDampingFactor_e - } - } - - Word32 L_tmp = hPrivateData->prevDampingFactor_IIR_fx[sfb]; - move32(); - L_tmp = L_shl( L_tmp, hPrivateData->prevDampingFactor_IIR_e[sfb] ); - test(); - test(); - IF( last_core_acelp || hPrivateData->wasTransient || EQ_32( L_tmp, MIN16B ) ) - { - tmp = BASOP_Util_Cmp_Mant32Exp( currDampingFactor, currDampingFactor_e, 3277 /* 0.1f in Q15 */, 0 ); - IF( tmp >= 0 ) - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = currDampingFactor; - hPrivateData->prevDampingFactor_IIR_e[sfb] = currDampingFactor_e; - move16(); - move16(); - } - ELSE - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = 3277; /* 0.1 in Q15 */ - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - move16(); - move16(); - } - } - IF( last_core_acelp ) - { - hPrivateData->dampingFactorSmoothing[sfb] = 2; - move16(); - } - - dampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor, currDampingFactor_e, hPrivateData->prevDampingFactor_IIR_fx[sfb], hPrivateData->prevDampingFactor_IIR_e[sfb], &dampingFactor ); // dampingFactor_e - dampingFactor = shr( dampingFactor, 1 ); - - gain = Mult_32_16( gain, shl_sat( extract_l( L_min( L_add( dampingFactor, Mult_32_16( L_shl( hPrivateData->dampingFactorSmoothing[sfb], sub( 15, dampingFactor_e ) ) /*Q:15-dampingFactor_e*/, 3277 /*0.1f Q15*/ ) /*Q:15-dampingFactor_e*/ ), shl_sat( 1, sub( 15, dampingFactor_e ) ) ) ), dampingFactor_e ) /*Q15*/ ); - - hPrivateData->prevDampingFactor_IIR_fx[sfb] = dampingFactor; - move16(); - hPrivateData->prevDampingFactor_IIR_e[sfb] = dampingFactor_e; - move16(); - if ( hPrivateData->dampingFactorSmoothing[sfb] > 0 ) - { - hPrivateData->dampingFactorSmoothing[sfb] = sub( hPrivateData->dampingFactorSmoothing[sfb], 1 ); - move16(); - } - } - ELSE - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; // exponent : hPrivateData->prevDampingFactor_IIR_e[sfb] - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - hPrivateData->dampingFactorSmoothing[sfb] = 1; - move16(); - move16(); - move16(); - } - - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = tmp_tb; // hPrivateData->prevSFB_FIR_TB_e[sfb] - hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_tb_e; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = hPrivateData->SFM_tb_fx[sfb]; // hPrivateData->prevSFB_IIR_TB_e[sfb] - hPrivateData->prevSFB_IIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = tmp_sb; // hPrivateData->prevSFB_FIR_SB_e[sfb] - hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = hPrivateData->SFM_sb_fx[sfb]; // hPrivateData->prevSFB_IIR_SB_e[sfb] - hPrivateData->prevSFB_IIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - ELSE - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_FIR_TB_e[sfb] - hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] - hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] - hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_SB_e[sfb] - hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; - hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; /* hPrivateData->prevDampingFactor_IIR_e[sfb]*/ - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - hPrivateData->dampingFactorSmoothing[sfb] = 2; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - } - } - ELSE - { - tmp_e = e_mdct; - move16(); - sfbEnergyR = add_sat( EPSILON_FX, BASOP_Util_Divide3216_Scale( sum2_32_fx( pMDCTSpectrum_fx + swb_offset[sfb], width, &tmp_e ) /*exp: tmp_e*/, width, &sfbEnergyR_e ) ); // sfbEnergyR_e - sfbEnergyR_e = add( sfbEnergyR_e, add( tmp_e, -15 ) ); - gain = L_shl( sfbEnergyR, 16 ); // gain_e - move32(); - gain_e = sfbEnergyR_e; - - IF( element_mode > EVS_MONO ) - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_FIR_TB_e[sfb] - hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] - hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] - hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_SB_e[sfb] - hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; - hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; /* hPrivateData->prevDampingFactor_IIR_e[sfb]*/ - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - hPrivateData->dampingFactorSmoothing[sfb] = 2; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - } - - gain = Mult_32_16( gain, att ); // gain_e - gain_e = add( gain_e, 0 ); - - /*gain=0.5f+log2f(gain)*2+16 becuase 2.885390081777927f=2*1/loge(2) so 2*1/loge(2)*loge(x) can be written as 2*log2(x)*/ - gain = L_add( ONE_IN_Q22, L_add( L_add( L_shr( BASOP_Util_Log2( gain ), 1 ), L_shl( gain_e, Q24 ) ), L_shl( 16, Q23 ) ) ); /*Q23*/ - test(); - test(); - IF( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) - { - gain = L_add( gain, ONE_IN_Q21 ); /* better preservation of original HF band energy */ - } - test(); - test(); - IF( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_64000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_64000_CPE ) ) ) - { - gain = L_add( gain, ONE_IN_Q20 ); - } - gain = L_min( gain, 91 << Q23 ); /* 13+15+63, see arithcode encode residual */ - gain = L_max( gain, 0 ); - gain_e = 8; /* stores exponent for gain_fx*/ - move16(); - hPrivateData->igfScfQuantized[sfb] = extract_l( L_shr( gain, Q23 ) ); /*Q0*/ - move16(); - } - } - - return; -} - -/*-------------------------------------------------------------------* - * IGF_CalculateStereoEnvelope_fx() - * - * envelope estimation - - *-------------------------------------------------------------------*/ -static void IGF_CalculateStereoEnvelope_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ - const Word32 *pMDCTSpectrum_fx, /* i : MDCT spectrum */ - Word16 pMDCTSpectrum_e, /* i : exponent for pMDCTSpectrum_fx */ - const Word32 *pMDCTSpectrumMsInv_fx, /* i : MDCT spectrum */ - Word16 pMDCTSpectrumMsInv_e, /* i : expontent for pMDCTSpectrumMsInv_fx */ - const Word32 *pPowerSpectrum_fx, /* i : MDCT^2 + MDST^2 spectrum, or estimate */ - Word16 *pPowerSpectrum_e, /* i : exponent for pPowerSpectrum_fx */ - const Word32 *pPowerSpectrumMsInv_fx, /* i : inverse power spectrum */ - Word16 *q_pPowerSpectrumMsInv, /* i : Q for pPowerSpectrumMsInv_fx */ - const Word16 igfGridIdx, /* i : IGF grid index */ - const Word16 coreMsMask[N_MAX], /* i : line wise ms Mask */ - const Word16 isTransient, /* i : flag indicating if transient is detected */ - const Word16 last_core_acelp, /* i : indicator if last frame was ACELP core */ - const Word16 mct_on ) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - H_IGF_GRID hGrid; - Word16 *swb_offset; - Word16 sfb; /* this is the actual scalefactor band */ - Word16 width; /* this is width in subbands of the actual scalefactor band */ - Word16 tile_idx; - Word16 strt_cpy; - Word32 gain_fx; /* the gain which has to be applied to the source tile to get the destination energy */ - Word16 sb; - Word16 sfbEnergyR_fx; - Word32 sfbEnergyC_fx; /* the energy of the destination region of the tile */ - Word32 sfbEnergyTileR_fx; - Word32 sfbEnergyTileC_fx; /* the energy of the destination region of the tile */ - Word16 tmp, x, y; - Word16 mean_x_fx, mean_y_fx; - Word32 mean_xy_fx, mean_x2_fx; - Word16 slope_fx; - Word16 tmp_tb_fx; - Word16 tmp_sb_fx; - Word16 sfbCnt; - Word32 tileSrcSpec_fx[MAX_IGF_SFB_LEN]; - Word16 sfm; - Word16 crest; - Word16 temp; - Word16 mean_x_e, mean_y_e; /*Stores exponent for mean_x and mean_y respectively*/ - Word16 mean_xy_e, mean_x2_e; /*stores exponent for mean_xy and mean_x2 respectively*/ - Word16 tileSrcSpec_e[MAX_IGF_SFB_LEN]; /*Exponent for tileSrcSpec_fx*/ - Word16 sfbEnergyTileR_e; /*Exponent for sfbEnergyTileR_fx*/ - Word16 sfbEnergyTileC_e; /*Exponent for sfbEnergyTileC_fx*/ - Word16 sfbEnergyC_e; /*Exponent for sfbEnergyC_fx*/ - Word16 gain_e; /*exponent for gain_fx*/ - Word16 crest_exp; /*stores exponent for output from crest*/ - Word16 sfm_exp; /*stores exponent for ouput from sfm*/ - Word16 tmp_tb_e; /*Stores exponent for tmp_tb_fx*/ - Word16 tmp_sb_e; /*stores exponent for tmp_sb_fx*/ - Word16 slope_e; /*stores exponent for slope_fx*/ - Word16 sfbEnergyR_e; /*stores exponent for sfbEnergyR*/ - Word16 tmp_e; - Word32 temp_pPowerSpectrumMsInv[N_MAX], length; - Word16 q_temp_pPowerSpectrumMsInv = Q31, i; - move16(); - - IF( pPowerSpectrumMsInv_fx != NULL ) - { - length = N_MAX; - move16(); - if ( mct_on ) - { - length = L_FRAME48k; - move16(); - } - FOR( i = 0; i < length; i++ ) - { - IF( pPowerSpectrumMsInv_fx[i] != 0 ) - { - q_temp_pPowerSpectrumMsInv = s_min( q_temp_pPowerSpectrumMsInv, add( q_pPowerSpectrumMsInv[i], norm_l( pPowerSpectrumMsInv_fx[i] ) ) ); - } - } - FOR( i = 0; i < length; i++ ) - { - temp_pPowerSpectrumMsInv[i] = L_shl( pPowerSpectrumMsInv_fx[i], sub( q_temp_pPowerSpectrumMsInv, q_pPowerSpectrumMsInv[i] ) ); - move32(); - } - } - - hPrivateData = &hIGFEnc->igfData; - hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; - swb_offset = hGrid->swb_offset; - move16(); - - IF( igfGridIdx != IGF_GRID_LB_NORM ) - { - FOR( sfbCnt = 0; sfbCnt < sub( hGrid->sfbWrap[hGrid->nTiles], hGrid->sfbWrap[0] ); sfbCnt++ ) - { - /* reset filter */ - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_TB_e[sfbCnt] - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_TB_e[sfbCnt] - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_SB_e[sfbCnt] - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_SB_e[sfbCnt] - hPrivateData->prevSFB_FIR_TB_e[sfbCnt] = 0; - hPrivateData->prevSFB_IIR_TB_e[sfbCnt] = 0; - hPrivateData->prevSFB_FIR_SB_e[sfbCnt] = 0; - hPrivateData->prevSFB_IIR_SB_e[sfbCnt] = 0; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - } - - IF( pPowerSpectrum_fx ) - { - FOR( sb = hGrid->sbWrap[0]; sb < swb_offset[hGrid->sfbWrap[hGrid->nTiles]]; sb++ ) - { - /*hPrivateData->logSpec[sb] = max( 0, (Word16) ( logf( max( FLT_MIN, pPowerSpectrum[sb] ) ) * INV_LOG_2 ) );*/ - IF( LE_32( 1, pPowerSpectrum_fx[sb] ) ) - { - hPrivateData->logSpec[sb] = s_max( 0, (Word16) L_shr( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( pPowerSpectrum_e[sb], Q25 ) ), 25 ) ); - } - ELSE - { - hPrivateData->logSpec[sb] = 0; /*max(0,-126) is always 0*/ - } - move16(); - } - } - - FOR( tile_idx = 0; tile_idx < hGrid->nTiles; tile_idx++ ) - { - strt_cpy = hGrid->sbWrap[tile_idx]; - move16(); - - FOR( sfb = hGrid->sfbWrap[tile_idx]; sfb < hGrid->sfbWrap[tile_idx + 1]; sfb++ ) - { - width = sub( swb_offset[sfb + 1], swb_offset[sfb] ); - sfbEnergyTileR_fx = EPSILON_FX; - sfbEnergyTileC_fx = EPSILON_FX; - sfbEnergyC_fx = EPSILON_FX; - sfbEnergyTileR_e = 0; - sfbEnergyTileC_e = 0; - sfbEnergyC_e = 0; - move16(); - move16(); - move16(); - move32(); - move32(); - move32(); - IF( pPowerSpectrum_fx ) - { - Word16 final_exp; - Word16 norm_exp; - Word32 scaled_value; - tmp = strt_cpy; - move16(); - - FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) - { - IF( NE_16( coreMsMask[sb], coreMsMask[strt_cpy] ) ) - { - sfbEnergyC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyC_fx, sfbEnergyC_e, pPowerSpectrum_fx[sb], pPowerSpectrum_e[sb], &sfbEnergyC_e ); /*resultant exponent is stored in sfbEnergyC_e*/ - norm_exp = norm_l( pMDCTSpectrumMsInv_fx[strt_cpy] ); - final_exp = sub( pMDCTSpectrumMsInv_e, norm_exp ); - scaled_value = L_shl( pMDCTSpectrumMsInv_fx[strt_cpy], norm_exp ); - sfbEnergyTileR_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR_fx, sfbEnergyTileR_e, Mult_32_32( scaled_value, scaled_value ), shl( final_exp, 1 ), &sfbEnergyTileR_e ); /*resultant exponent is stored in sfbEnergyTileR_e*/ - sfbEnergyTileC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC_fx, sfbEnergyTileC_e, pPowerSpectrumMsInv_fx[strt_cpy], sub( 31, q_pPowerSpectrumMsInv[strt_cpy] ), &sfbEnergyTileC_e ); /*resultant exponent is stored in sfbEnergyTileC_e*/ - tileSrcSpec_fx[strt_cpy - tmp] = temp_pPowerSpectrumMsInv[strt_cpy]; /*resultant exponent is stored in tileSrcSpec_e*/ - tileSrcSpec_e[strt_cpy - tmp] = sub( 31, q_temp_pPowerSpectrumMsInv ); - } - ELSE - { - sfbEnergyC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyC_fx, sfbEnergyC_e, pPowerSpectrum_fx[sb], pPowerSpectrum_e[sb], &sfbEnergyC_e ); /*resultant exponent is stored in sfbEnergyC_e*/ - norm_exp = norm_l( pMDCTSpectrum_fx[strt_cpy] ); - final_exp = sub( pMDCTSpectrum_e, norm_exp ); - scaled_value = L_shl( pMDCTSpectrum_fx[strt_cpy], norm_exp ); - sfbEnergyTileR_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR_fx, sfbEnergyTileR_e, Mult_32_32( scaled_value, scaled_value ), shl( final_exp, 1 ), &sfbEnergyTileR_e ); /*resultant exponent is stored in sfbEnergyTileR_e*/ - sfbEnergyTileC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC_fx, sfbEnergyTileC_e, pPowerSpectrum_fx[strt_cpy], pPowerSpectrum_e[strt_cpy], &sfbEnergyTileC_e ); /*resultant exponent is stored in sfbEnergyTileC_e*/ - tileSrcSpec_fx[strt_cpy - tmp] = pPowerSpectrum_fx[strt_cpy]; /*resultant exponent is stored in tileSrcSpec_e*/ - tileSrcSpec_e[strt_cpy - tmp] = pPowerSpectrum_e[strt_cpy]; - } - move32(); - move16(); - strt_cpy = add( strt_cpy, 1 ); - } - - sfbEnergyTileR_fx = BASOP_Util_Divide3216_Scale( sfbEnergyTileR_fx, width, &tmp_e ); - sfbEnergyTileR_e = sub( add( sfbEnergyTileR_e, tmp_e ), 15 ); /*stores the resultant exponent for sfbEnergyTileR_fx*/ - - /*gain = (float) ( sfbEnergyTileR * ( sfbEnergyC / sfbEnergyTileC ) );*/ - temp = BASOP_Util_Divide3232_Scale( sfbEnergyC_fx, L_add( sfbEnergyTileC_fx, EPSILON_FX ), &tmp_e ); - gain_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); - gain_fx = Mult_32_16( sfbEnergyTileR_fx, temp ); - gain_e = add( 16, add( gain_e, sfbEnergyTileR_e ) ); /*stores the resultant exponent for gain_fx*/ - - IF( !isTransient ) - { - Word16 diffSFM_fx; - Word16 shiftedSFM_fx; - Word16 shiftedSFM_e; /*stores the resultant exponent for shiftedSFM_fx*/ - shiftedSFM_fx = 0; - shiftedSFM_e = 0; - move16(); - move16(); - - // tmp_tb = IGF_getSFM_ivas(pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1]) / IGF_getCrest_ivas(pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1]); - sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, swb_offset[sfb], swb_offset[sfb + 1] ); - crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, swb_offset[sfb], swb_offset[sfb + 1] ); - tmp_tb_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); - tmp_tb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); /*stores the resultant exponent for tmp_tb_fx*/ - - // tmp_sb = IGF_getSFM_ivas(tileSrcSpec, 0, strt_cpy - tmp) / IGF_getCrest_ivas(tileSrcSpec, 0, strt_cpy - tmp); - sfm = IGF_getSFM_ivas_fx( &sfm_exp, tileSrcSpec_fx, tileSrcSpec_e, 0, sub( strt_cpy, tmp ) ); - crest = IGF_getCrest_ivas( &crest_exp, tileSrcSpec_fx, tileSrcSpec_e, 0, sub( strt_cpy, tmp ) ); - tmp_sb_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); - tmp_sb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); /*stores the resultant exponent for tmp_sb_fx*/ - - IF( last_core_acelp || hPrivateData->wasTransient ) - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = tmp_tb_fx; /*Exponent for hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] values stored in hPrivateData->sfb_tb_e[sfb] */ - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = tmp_sb_fx; /*Exponent for hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] values stored in hPrivateData->sfb_sb_e[sfb]*/ - hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_sb_e; - hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_sb_e; - hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; - hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - ELSE - { - /* Purpose of this block: - -to make the exponent of hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] equal to that of tmp_tb_fx - -to make the exponent of hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] equal to that of tmp_sb_fx - */ - Word16 diff_sb_e; /*stores the difference of exponents for sb*/ - Word16 diff_tb_e; /*stores the difference of exponents for tb*/ - diff_sb_e = sub( tmp_sb_e, hPrivateData->sfb_sb_e[sfb] ); - diff_tb_e = sub( tmp_tb_e, hPrivateData->sfb_tb_e[sfb] ); - IF( LE_16( tmp_tb_e, hPrivateData->sfb_tb_e[sfb] ) ) - { - tmp_tb_fx = shl( tmp_tb_fx, diff_tb_e ); - tmp_tb_e = hPrivateData->sfb_tb_e[sfb]; - move16(); - } - ELSE - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], diff_tb_e ); - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], diff_tb_e ); - move16(); - move16(); - hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_tb_e; - hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_tb_e; - move16(); - move16(); - } - IF( LE_16( tmp_sb_e, hPrivateData->sfb_sb_e[sfb] ) ) - { - tmp_sb_fx = shl( tmp_sb_fx, diff_sb_e ); - tmp_sb_e = hPrivateData->sfb_sb_e[sfb]; - move16(); - } - ELSE - { - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], diff_sb_e ); - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], diff_sb_e ); - move16(); - move16(); - hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; - hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; - move16(); - move16(); - } - } - tmp_tb_fx = shr_sat( tmp_tb_fx, sub( 2, tmp_tb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - tmp_sb_fx = shr_sat( tmp_sb_fx, sub( 2, tmp_sb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_tb_fx[sfb] = add_sat( tmp_tb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_TB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_TB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_tb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_tb_fx[sfb] ); /* resultant exponent stored in hPrivateData->sfb_sb_e[sfb]*/ - hPrivateData->SFM_sb_fx[sfb] = add_sat( tmp_sb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_SB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_SB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ - hPrivateData->SFM_sb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_sb_fx[sfb] ); /*resultant exponent stores in hPrivateData->sfb_tb_e[sfb]*/ - move16(); - move16(); - move16(); - move16(); - hPrivateData->sfb_sb_e[sfb] = 2; - hPrivateData->sfb_tb_e[sfb] = 2; - move16(); - move16(); - - diffSFM_fx = sub( hPrivateData->SFM_sb_fx[sfb], hPrivateData->SFM_tb_fx[sfb] ); /*Q13*/ - - test(); - IF( diffSFM_fx > 0 && LT_16( hPrivateData->SFM_tb_fx[sfb], 819 /*0.1 Q13*/ ) ) /* check whether target SFB is more tonal than source SFB */ - { - Word16 currDampingFactor_fx, dampingFactor_fx, alpha_fx; - Word16 threshold_e, threshold_fx, alpha_e, currDampingFactor_e, dampingFactor_e; - /* calculate spectral tilt to detect sudden drops (or increases) in energy in the current SFB */ - x = 1; - mean_x_fx = mean_y_fx = 0; - mean_xy_fx = mean_x2_fx = 0; - mean_x_e = mean_y_e = 15; - mean_xy_e = mean_x2_e = 31; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) - { - mean_x_fx = add( mean_x_fx, x ); /*Q0*/ - mean_x2_fx = L_add( mean_x2_fx, L_mult0( x, x ) ); /*Q0*/ - - /*y = 20 * (Word16) log10f( max( 1e-018f, pPowerSpectrum[sb] ) );*/ - IF( LT_32( pPowerSpectrum_fx[sb], 1 ) ) - { - y = 20 * ( -18 ); - move16(); - } - ELSE - { - y = imult1616( 20, extract_l( L_shr( Mult_32_16( ( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( pPowerSpectrum_e[sb], Q25 ) ) ), INV_Log2_10_Q15 ), 25 ) ) ); /*Q0*/ - } - mean_y_fx = add( mean_y_fx, y ); /*Q0*/ - mean_xy_fx = L_add( mean_xy_fx, L_mult0( y, x ) ); /*Q0*/ - - x = add( x, 1 ); - } - mean_y_fx = BASOP_Util_Divide1616_Scale( mean_y_fx, width, &tmp_e ); /* resultant exp stores in mean_y_e*/ - mean_y_e = add( mean_y_e, sub( tmp_e, 15 ) ); - mean_x_fx = BASOP_Util_Divide1616_Scale( mean_x_fx, width, &tmp_e ); /* resultant exp stores in mean_x_e*/ - mean_x_e = add( mean_x_e, sub( tmp_e, 15 ) ); - mean_xy_fx = BASOP_Util_Divide3216_Scale( mean_xy_fx, width, &tmp_e ); /* resultant exp stores in mean_xy_e*/ - mean_xy_e = add( mean_xy_e, sub( tmp_e, 15 ) ); - mean_x2_fx = BASOP_Util_Divide3216_Scale( mean_x2_fx, width, &tmp_e ); /* resultant exp stores in mean_x2_e*/ - mean_x2_e = add( mean_x2_e, sub( tmp_e, 15 ) ); - - /*slope = ( mean_xy - mean_x * mean_y ) / ( mean_x2 - mean_x * mean_x );*/ - slope_fx = BASOP_Util_Divide3232_Scale( ( L_sub( mean_xy_fx, L_shl( mult( mean_x_fx, mean_y_fx ), sub( add( mean_x_e, mean_y_e ), mean_xy_e ) ) ) ), ( L_sub( mean_x2_fx, L_shl( mult( mean_x_fx, mean_x_fx ), sub( add( mean_x_e, mean_x_e ), mean_x2_e ) ) ) ), &slope_e ); - slope_e = add( slope_e, sub( mean_xy_e, mean_x2_e ) ); /*stores resultant exponent for slope_fx*/ - - /* determine whether strong tilt is due to a step in the spectrum (e.g. band limitation, no damping) - or a tonal component close the band border (apply damping) by calculating SFM for a shift of 1/2 SFB width*/ - threshold_fx = BASOP_Util_Divide1616_Scale( 60, width, &threshold_e ); /*stores resultant exponent for threshold_fx*/ - test(); - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope_fx, add( slope_e, 16 ), negate( threshold_fx ), add( threshold_e, 16 ) ), -1 ) ) - { - Word16 shift = shr( width, 1 ); - // shiftedSFM = IGF_getSFM_ivas( pPowerSpectrum, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift ) / IGF_getCrest_ivas( pPowerSpectrum, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift ); - sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, sub( swb_offset[sfb], shift ), sub( swb_offset[sfb + 1], shift ) ); - crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, sub( swb_offset[sfb], shift ), sub( swb_offset[sfb + 1], shift ) ); - shiftedSFM_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); - } - ELSE IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope_fx, add( slope_e, 16 ), threshold_fx, add( threshold_e, 16 ) ), 1 ) && ( NE_16( sfb, sub( hGrid->sfbWrap[hGrid->nTiles], 1 ) ) ) ) - { - Word16 shift; - shift = shr( width, 1 ); - // shiftedSFM = IGF_getSFM_ivas( pPowerSpectrum, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift ) / IGF_getCrest_ivas( pPowerSpectrum, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift ); - sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, add( swb_offset[sfb], shift ), add( swb_offset[sfb + 1], shift ) ); - crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, add( swb_offset[sfb], shift ), add( swb_offset[sfb + 1], shift ) ); - shiftedSFM_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); - } - IF( shiftedSFM_fx ) - { - shiftedSFM_e = add( shiftedSFM_e, sub( sfm_exp, crest_exp ) ); /* stores resultant exponent for shiftedSFM_fx*/ - } - - // alpha = min( 320.f / (float) swb_offset[sfb + 1], 1.25f ); - temp = BASOP_Util_Divide1616_Scale( 320, swb_offset[sfb + 1], &alpha_e ); - alpha_fx = extract_l( L_min( temp, L_shl( 20480 /*1.25 Q14*/, sub( 1, alpha_e ) ) ) ); /* exponent is alpha_e*/ - temp = BASOP_Util_Divide1616_Scale( hPrivateData->SFM_tb_fx[sfb], hPrivateData->SFM_sb_fx[sfb], &tmp_e ); - tmp_e = add( tmp_e, sub( hPrivateData->sfb_tb_e[sfb], hPrivateData->sfb_sb_e[sfb] ) ); /* stores resultant exponent for temp */ - - // currDampingFactor = expf( alpha * logf( hPrivateData->SFM_tb[sfb] / hPrivateData->SFM_sb[sfb] ) ); - currDampingFactor_fx = round_fx( BASOP_util_Pow2( Mpy_32_16_1( L_add( BASOP_Util_Log2( temp ), L_shl( add( 16, tmp_e ), 25 ) ), alpha_fx ), add( alpha_e, 6 ), &currDampingFactor_e ) ); /*exp is currDampingFactor_e*/ - - IF( GT_32( shiftedSFM_fx, L_shl( 1311 /*0.04f Q15*/, negate( shiftedSFM_e ) ) ) ) - { - currDampingFactor_fx = 32767; /*1.f Q15*/ - currDampingFactor_e = 0; - move16(); - move16(); - } - test(); - test(); - IF( last_core_acelp || hPrivateData->wasTransient || EQ_32( hPrivateData->prevDampingFactor_IIR_fx[sfb], L_shl( -1, sub( 15, hPrivateData->prevDampingFactor_IIR_e[sfb] ) ) ) ) - { - tmp = BASOP_Util_Cmp_Mant32Exp( currDampingFactor_fx, currDampingFactor_e, 3277, 0 ); - IF( tmp >= 0 ) - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = currDampingFactor_fx; - hPrivateData->prevDampingFactor_IIR_e[sfb] = currDampingFactor_e; - } - ELSE - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = 3277; /* 0.1 in Q15 */ - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - } - - move16(); - move16(); - } - - { - Word32 tonalToNoise; - Word16 adap; - Word16 adap_e; /*stores exp for adap*/ - Word16 tonalToNoise_e; /*stores exponent for tonalToNoise*/ - tonalToNoise_e = 9; /*stores exponent for tonalToNoise*/ - move16(); - adap = BASOP_Util_Divide1616_Scale( width, 30, &adap_e ); - tonalToNoise = IGF_getTNR_ivas_fx( pPowerSpectrum_fx, swb_offset[sfb], swb_offset[sfb + 1], adap, pPowerSpectrum_e, adap_e ); /*Q22*/ - IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( tonalToNoise, tonalToNoise_e, L_add( L_shl( 10, sub( 15, adap_e ) ), adap ), add( 16, adap_e ) ), -1 ) ) - { - // currDampingFactor += 0.1f * ( ( 10 + adap ) - tonalToNoise ); - Word32 temp2 = BASOP_Util_Add_Mant32Exp( L_add( L_shl( 10, sub( 15, adap_e ) ) /*exp:adap_e*/, adap ), add( adap_e, 16 ), L_negate( tonalToNoise ), tonalToNoise_e, &tmp_e ); /* resultant exp is tmp_e*/ - currDampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor_fx, currDampingFactor_e, extract_l( Mult_32_16( temp2, 3277 /*0.1f Q15*/ ) ), tmp_e, &currDampingFactor_fx ); /*stores resultant exp for currDampingFactor_fx*/ - } - } - - dampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor_fx, currDampingFactor_e, hPrivateData->prevDampingFactor_IIR_fx[sfb], hPrivateData->prevDampingFactor_IIR_e[sfb], &dampingFactor_fx ); - dampingFactor_fx = shr( dampingFactor_fx, 1 ); /* resultant exponent is dampingFactor_e*/ - IF( NE_16( BASOP_Util_Cmp_Mant32Exp( dampingFactor_fx, add( dampingFactor_e, 16 ), shr( hPrivateData->prevDampingFactor_IIR_fx[sfb], 1 ), add( hPrivateData->prevDampingFactor_IIR_e[sfb], 16 ) ), -1 ) ) - { - // do nothing - } - ELSE - { - dampingFactor_fx = shr( hPrivateData->prevDampingFactor_IIR_fx[sfb], 1 ); /* resultant exponent is hPrivateData->prevDampingFactor_IIR_e[sfb]*/ - dampingFactor_e = hPrivateData->prevDampingFactor_IIR_e[sfb]; - move16(); - } - IF( dampingFactor_e < 0 ) - { - dampingFactor_fx = shl( dampingFactor_fx, dampingFactor_e ); - dampingFactor_e = 0; - move16(); - } - gain_fx = Mult_32_16( gain_fx, shl_sat( extract_l( L_min( L_add( dampingFactor_fx, Mult_32_16( L_shl( hPrivateData->dampingFactorSmoothing[sfb], sub( 15, dampingFactor_e ) ) /*Q:15-dampingFactor_e*/, 3277 /*0.1f Q15*/ ) /*Q:15-dampingFactor_e*/ ), shl_sat( 1, sub( 15, dampingFactor_e ) ) ) ), dampingFactor_e ) /*Q15*/ ); - - hPrivateData->prevDampingFactor_IIR_fx[sfb] = dampingFactor_fx; - hPrivateData->prevDampingFactor_IIR_e[sfb] = dampingFactor_e; - move16(); - move16(); - if ( hPrivateData->dampingFactorSmoothing[sfb] > 0 ) - { - hPrivateData->dampingFactorSmoothing[sfb] = sub( hPrivateData->dampingFactorSmoothing[sfb], 1 ); - move16(); - } - } - ELSE - { - hPrivateData->prevDampingFactor_IIR_fx[sfb] = -( 1 << 15 ); /* resultant exp which is 0 stores in hPrivateData->prevDampingFactor_IIR_e[sfb]*/ - hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; - hPrivateData->dampingFactorSmoothing[sfb] = 1; - move16(); - move16(); - move16(); - } - - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = tmp_tb_fx; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = hPrivateData->SFM_tb_fx[sfb]; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = tmp_sb_fx; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = hPrivateData->SFM_sb_fx[sfb]; - hPrivateData->prevSFB_FIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; - hPrivateData->prevSFB_IIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; - hPrivateData->prevSFB_FIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; - hPrivateData->prevSFB_IIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - ELSE - { - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; - hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; - hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; - hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; - hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; - - hPrivateData->dampingFactorSmoothing[sfb] = 2; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - } - ELSE - { - tmp_e = pMDCTSpectrum_e; - sfbEnergyR_fx = add_sat( EPSILON_FX, BASOP_Util_Divide3216_Scale( sum2_32_fx( pMDCTSpectrum_fx + swb_offset[sfb], width, &tmp_e ) /*exp: tmp_e*/, width, &sfbEnergyR_e ) ); - sfbEnergyR_e = add( sfbEnergyR_e, add( tmp_e, -15 ) ); /* stores resultant exponent for sfbEnergyR_fx*/ - gain_fx = sfbEnergyR_fx; /*resultant exponent stored in gain_e=sfbEnergyR_e*/ - move32(); - gain_e = add( sfbEnergyR_e, 16 ); /* because gain_fx is word32;only after adding 16 q of gain_fx is 15-sfbEnergyR_e*/ - - hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; - hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; - hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; - hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; - hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; - hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; - hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - move16(); - } - /*gain=0.5f+log2f(gain)*2+16 becuase 2.885390081777927f=2*1/loge(2) so 2*1/loge(2)*loge(x) can be written as 2*log2(x)*/ - gain_fx = L_add( ONE_IN_Q22, L_add( L_add( L_shr( BASOP_Util_Log2( gain_fx ), 1 ), L_shl( gain_e, Q24 ) ), L_shl( 16, Q23 ) ) ); /*Q23*/ - test(); - test(); - if ( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) - { - gain_fx = L_add( gain_fx, ONE_IN_Q21 ); /* better preservation of original HF band energy */ - } - test(); - test(); - if ( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_64000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_64000_CPE ) ) ) - { - gain_fx = L_add( gain_fx, ONE_IN_Q20 ); - } - gain_fx = L_min( gain_fx, 91 << Q23 ); /* 13+15+63, see arithcode encode residual */ - gain_fx = L_max( gain_fx, 0 ); - gain_e = 8; /* stores exponent for gain_fx*/ - move16(); - hPrivateData->igfScfQuantized[sfb] = (Word16) ( L_shr( gain_fx, 23 ) ); /*Q0*/ - move16(); - } - } - - return; -} - - -/*-------------------------------------------------------------------* - * IGF_WriteEnvelope() - * - * writes IGF SCF values - *-------------------------------------------------------------------*/ -/*! r: number of bits writen */ -static Word16 IGF_WriteEnvelope( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /* i : ptr to bitOffset counter */ - const Word16 igfGridIdx, /* i : igf grid index see declaration of IGF_GRID_IDX for details */ - const Word16 isIndepFlag, /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ - Word16 *igfAllZero /* i : returns 1 if all IGF scfs are zero, else 0 */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - H_IGF_GRID hGrid; - Word16 sfb; - Word16 totBitCount; - Word16 startBitCount; - - startBitCount = *pBitOffset; - totBitCount = 0; - *igfAllZero = 1; - move16(); - move16(); - move16(); - hPrivateData = &hIGFEnc->igfData; - hGrid = &hPrivateData->igfInfo.grid[igfGridIdx]; - - FOR( sfb = hGrid->startSfb; sfb < hGrid->stopSfb; sfb++ ) - { - IF( hPrivateData->igfScfQuantized[sfb] != 0 ) - { - *igfAllZero = 0; - move16(); - BREAK; - } - } - - IF( *igfAllZero != 0 ) - { - IGF_write_bit_fx( hBstr, pBitOffset, 1 ); - - if ( NULL == hBstr ) - { - IGFSCFEncoderSaveContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); - } - - IGFSCFEncoderReset_fx( &hPrivateData->hIGFSCFArithEnc ); - - if ( NULL == hBstr ) - { - IGFSCFEncoderRestoreContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); - } - } - ELSE - { - IGF_write_bit_fx( hBstr, pBitOffset, 0 ); - - if ( NULL == hBstr ) - { - IGFSCFEncoderSaveContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); - } - - *pBitOffset = IGFSCFEncoderEncode_ivas_fx( &hPrivateData->hIGFSCFArithEnc, hBstr, *pBitOffset, &hPrivateData->igfScfQuantized[hGrid->startSfb], igfGridIdx, isIndepFlag ); - move16(); - - if ( NULL == hBstr ) - { - IGFSCFEncoderRestoreContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); - } - } - totBitCount = sub( *pBitOffset, startBitCount ); - - return totBitCount; -} - - -/*-------------------------------------------------------------------* - * IGF_Whitening() - * - * calculates the IGF whitening levels by SFM and crest - *-------------------------------------------------------------------*/ -static void IGF_Whitening_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : | instance handle of IGF Encoder */ - Word32 *powerSpectrum, /* i : Q31 | MDCT/MDST power spectrum */ - Word16 *powerSpectrum_e, /* i : Q31 | MDCT/MDST power spectrum */ - const Word16 igfGridIdx, /* i : Q0 | IGF grid index */ - const Word16 isTransient, /* i : Q0 | flag indicating if transient is detected */ - const Word16 last_core_acelp, /* i : Q0 | indicator if last frame was ACELP core */ - const Word16 isTNSActive, /* i : Q0 | indicator if TNS is active */ - const Word16 sp_aud_decision0, /* i : Q0 | first stage classifier decision */ - const Word32 brate, /* i : Q0 | bitrate */ - const Word16 element_mode /* i : Q0 | element mode */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - H_IGF_GRID hGrid; - Word16 p; /*Q0*/ - Word16 tmp; - Word16 tmp_e; - Word16 SFM_src; - Word16 SFM_tar; - Word16 SFM_src_e; - Word16 SFM_tar_e; - Word16 num_Tiles; - Word16 SFM; - Word16 crest_e; - - SFM = -ONE_IN_Q13; /*1.0f Q13*/ - move16(); - - hPrivateData = &hIGFEnc->igfData; - hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; - - IF( NE_16( igfGridIdx, IGF_GRID_LB_NORM ) ) - { - FOR( p = 0; p < hGrid->nTiles; p++ ) - { - /* reset filter */ - hPrivateData->prevSFM_FIR[p] = L_deposit_l( 0 ); - hPrivateData->prevSFM_IIR[p] = 0; - move16(); - - /* preset values: */ - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; - move16(); - } - } - - FOR( p = 0; p < IGF_MAX_TILES; p++ ) - { - /* update prev data: */ - hPrivateData->igfPrevWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p]; - /* preset values: */ - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; - move16(); - move16(); - } - - test(); - IF( !( isTransient || hPrivateData->wasTransient ) ) - { - IF( powerSpectrum ) - { - FOR( p = 0; p < hGrid->nTiles; p++ ) - { - Word16 sb; - - IF( isTNSActive ) - { - FOR( sb = hGrid->tile[p]; sb < hGrid->tile[p + 1]; sb++ ) - { - IF( LT_32( powerSpectrum[sb], 1 ) ) - hPrivateData->logSpec[sb] = 0; /* max(0,FLT_MIN_EXP )*/ - ELSE - hPrivateData->logSpec[sb] = extract_l( L_max( 0, L_shr( L_add( BASOP_Util_Log2( powerSpectrum[sb] ), L_shl( powerSpectrum_e[sb], Q25 ) ), Q25 ) ) ); - move16(); - } - } - - /* if current tile contains only a single SFB, reuse already computed SFM values */ - test(); - IF( element_mode > EVS_MONO && EQ_16( sub( hGrid->sfbWrap[p + 1], hGrid->sfbWrap[p] ), 1 ) ) - { - tmp = hPrivateData->SFM_tb_fx[p]; - tmp_e = hPrivateData->sfb_tb_e[p]; - move16(); - move16(); - } - ELSE - { - tmp = BASOP_Util_Divide1616_Scale( IGF_getSFM_new_fx( powerSpectrum, hPrivateData->logSpec, hGrid->tile[p], hGrid->tile[p + 1], powerSpectrum_e ), IGF_getCrest_new_fx( hPrivateData->logSpec, hGrid->tile[p], hGrid->tile[p + 1], &crest_e ), &tmp_e ); - tmp_e = sub( tmp_e, crest_e ); - } - - test(); - IF( last_core_acelp || hPrivateData->wasTransient ) - { - hPrivateData->prevSFM_FIR[p] = L_shl( tmp, add( 1, tmp_e ) ); /*16-(15-exp)=>15Q16*/ - hPrivateData->prevSFM_IIR[p] = shl( tmp, sub( tmp_e, 2 ) ); /*13-(15-exp)=>2Q13*/ - move32(); - move16(); - } - - test(); - IF( LE_32( brate, IVAS_48k ) && EQ_16( element_mode, IVAS_CPE_MDCT ) ) - { - Word16 temp; - num_Tiles = 0; - SFM_src = 0; - SFM_tar = 0; - SFM_src_e = 0; - SFM_tar_e = 0; - move16(); - move16(); - move16(); - move16(); - move16(); - - FOR( sb = hGrid->sfbWrap[p]; sb < hGrid->sfbWrap[p + 1]; sb++ ) - { - num_Tiles = add( num_Tiles, 1 ); - SFM_src_e = BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sb], hPrivateData->sfb_sb_e[sb], SFM_src, SFM_src_e, &SFM_src ); - SFM_tar_e = BASOP_Util_Add_MantExp( hPrivateData->SFM_tb_fx[sb], hPrivateData->sfb_tb_e[sb], SFM_tar, SFM_tar_e, &SFM_tar ); - } - - /* compute the average */ - SFM_src = shr( BASOP_Util_Divide1616_Scale( SFM_src, num_Tiles, &temp ), 2 ); - SFM_src_e = add( SFM_src_e, sub( temp, 13 ) ); /*temp-15+2:because right shifted by 2 which are the guard bits*/ - SFM_tar = shr( BASOP_Util_Divide1616_Scale( SFM_tar, num_Tiles, &temp ), 2 ); - SFM_tar_e = add( SFM_tar_e, sub( temp, 13 ) ); /*temp-15+2:because right shifted by 2 which are the guard bits*/ - - IF( LT_16( SFM_tar_e, SFM_src_e ) ) - { - SFM_tar = shl( SFM_tar, sub( SFM_tar_e, SFM_src_e ) ); /*making the q for SFM_tar and SFM_src equal with 2 as guard bits*/ - SFM_tar_e = SFM_src_e; - } - ELSE - { - SFM_src = shr( SFM_src, sub( SFM_tar_e, SFM_src_e ) ); /*making the q for SFM_tar and SFM_src equal with 2 as guard bits*/ - SFM_src_e = SFM_tar_e; - } - move16(); - - test(); - test(); - IF( ( p > 0 ) && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) - { - test(); - if ( EQ_16( p, 1 ) && EQ_16( abs_s( sub( hPrivateData->igfCurrWhiteningLevel[0], hPrivateData->igfCurrWhiteningLevel[1] ) ), 2 ) ) /* OFF vs. STRONG */ - { - hPrivateData->igfCurrWhiteningLevel[0] = IGF_WHITENING_MID; - move16(); - } - hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p - 1]; - move16(); - } - ELSE IF( sp_aud_decision0 ) - { - /* Music */ - /* whitening Off: when tonality of target is more than source or tonality of target is close to that of source */ - test(); - if ( LE_16( SFM_tar, SFM_src ) || LE_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; - move16(); - } - - /* whitening mid: */ - test(); - if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) && LE_32( SFM_tar, L_add( SFM_src, L_shl( 5, sub( 13, SFM_src_e ) ) /*1.25 with exponent SFM_src_e*/ ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; - move16(); - } - - /* whitening strong */ - if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 5, sub( 13, SFM_src_e ) ) /*1.25 with exponent SFM_src_e*/ ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; - move16(); - } - } - ELSE - { - /* Speech */ - /* whitening Off: when tonality of target is more than source or tonality of target is close to that of source */ - test(); - if ( LE_16( SFM_tar, SFM_src ) || LE_32( SFM_tar, L_add( SFM_src, L_shr( 3277 /*0.1 Q15*/, SFM_src_e ) ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; - move16(); - } - - /* whitening mid: */ - test(); - if ( GT_32( SFM_tar, L_add( SFM_src, L_shr( 3277 /*0.1 Q15*/, SFM_src_e ) ) ) && LE_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; - move16(); - } - - /* whitening strong */ - if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; - move16(); - } - } - - SFM = shl( SFM_tar, sub( SFM_tar_e, 2 ) ); /*2Q13*/ - } - ELSE - { - test(); - IF( element_mode > EVS_MONO && EQ_16( sub( hGrid->sfbWrap[p + 1], hGrid->sfbWrap[p] ), 1 ) ) - { - SFM = shl( tmp, sub( tmp_e, 2 ) ); /*2Q13*/ - } - ELSE - { - Word32 temp; - temp = L_add( L_shl( tmp, sub( tmp_e, 2 ) ), L_add( L_shr( hPrivateData->prevSFM_FIR[p], 3 ), L_shr( hPrivateData->prevSFM_IIR[p], 1 ) ) ); - SFM = extract_l( L_min( 22118 /*2.7*/, temp ) ); /*2Q13*/ - } - hPrivateData->prevSFM_FIR[p] = L_shl( tmp, add( 1, tmp_e ) ); /*15Q16*/ - hPrivateData->prevSFM_IIR[p] = SFM; - move32(); - move16(); - - IF( GT_16( SFM, hGrid->whiteningThreshold[1][p] ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; - move16(); - } - ELSE IF( GT_16( SFM, hGrid->whiteningThreshold[0][p] ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; - move16(); - } - ELSE - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; - move16(); - } - } - - IF( element_mode > EVS_MONO ) - { - IF( last_core_acelp ) /* reset */ - { - set16_fx( hPrivateData->igfPastSFM_fx[p], -ONE_IN_Q13, IGF_PAST_SFM_LEN ); - hPrivateData->igfWhiteningHangoverCnt[p] = 2; - move16(); - } - ELSE - { - test(); - test(); - test(); - test(); - /* check whether change in whitening level should be allowed or not (if SFM is inside a certain margin around thresholds) */ - IF( NE_16( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ) && - ( ( GT_32( SFM, L_sub( hGrid->whiteningThreshold[0][p], 1229 /*0.15f Q13*/ ) ) && LT_32( SFM, L_add( hGrid->whiteningThreshold[0][p], 1229 ) ) ) || - ( GT_32( SFM, L_sub( hGrid->whiteningThreshold[1][p], 1229 ) ) && LT_32( SFM, L_add( hGrid->whiteningThreshold[1][p], 1229 ) ) ) ) ) - { - Word16 mean_past_SFM; - Word16 mean_past_SFM_e; - Word16 countable; - Word16 i; - mean_past_SFM = 0; - mean_past_SFM_e = 0; - countable = 0; - move16(); - move16(); - move16(); - - /* compute mean of last (available) SFM values */ - FOR( i = 0; i < IGF_PAST_SFM_LEN; i++ ) - { - IF( hPrivateData->igfPastSFM_fx[p][i] >= 0 ) - { - mean_past_SFM_e = BASOP_Util_Add_MantExp( mean_past_SFM, mean_past_SFM_e, hPrivateData->igfPastSFM_fx[p][i], 2, &mean_past_SFM ); - countable = add( countable, 1 ); - } - } - IF( countable ) - { - Word16 temp; - mean_past_SFM = BASOP_Util_Divide1616_Scale( mean_past_SFM, countable, &temp ); - mean_past_SFM_e = add( mean_past_SFM_e, sub( temp, 15 ) ); - mean_past_SFM = shl( mean_past_SFM, sub( mean_past_SFM_e, 2 ) ); /*mean_past_SFM_e=2*/ - /* deny change in whitening level for small deviations from mean SFM */ - if ( LT_16( abs_s( sub( SFM, mean_past_SFM ) ), 1638 ) /*0.2 in Q13*/ ) - { - hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfPrevWhiteningLevel[p]; - move16(); - } - } - } - } - - hPrivateData->igfPastSFM_fx[p][hPrivateData->igfPastSFM_pos] = SFM; /*2Q13*/ - move16(); - } - } - - SWITCH( hPrivateData->igfInfo.bitRateIndex ) - { - case IGF_BITRATE_WB_9600: - case IGF_BITRATE_RF_WB_13200: - case IGF_BITRATE_WB_13200_CPE: - case IGF_BITRATE_WB_16400_CPE: - case IGF_BITRATE_RF_SWB_13200: - case IGF_BITRATE_SWB_9600: - case IGF_BITRATE_SWB_13200_CPE: - case IGF_BITRATE_SWB_16400: - case IGF_BITRATE_SWB_24400: - case IGF_BITRATE_SWB_24400_CPE: - case IGF_BITRATE_SWB_32000_CPE: - case IGF_BITRATE_SWB_32000: - case IGF_BITRATE_FB_16400: - case IGF_BITRATE_FB_24400: - case IGF_BITRATE_FB_24400_CPE: - case IGF_BITRATE_FB_32000_CPE: - case IGF_BITRATE_FB_32000: - hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 1] = hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 2]; - move16(); - break; - default: - break; - } - } - ELSE - { - FOR( p = 0; p < hGrid->nTiles; p++ ) - { - hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; - move16(); - } - } - } - ELSE - { - /* reset filter */ - FOR( p = 0; p < IGF_MAX_TILES; p++ ) - { - hPrivateData->prevSFM_FIR[p] = L_deposit_l( 0 ); - hPrivateData->prevSFM_IIR[p] = 0; - move32(); - move16(); - } - } - - IF( element_mode > EVS_MONO ) - { - IF( EQ_16( SFM, -ONE_IN_Q13 /*1.0f 2Q13*/ ) ) /* reset */ - { - FOR( p = 0; p < hGrid->nTiles; p++ ) - { - set16_fx( hPrivateData->igfPastSFM_fx[p], -ONE_IN_Q13, IGF_PAST_SFM_LEN ); - hPrivateData->igfWhiteningHangoverCnt[p] = 2; - move16(); - } - } - - /* vibrato handling */ - FOR( p = 0; p < hGrid->nTiles; p = p + 2 ) - { - test(); - test(); - test(); - IF( ( hPrivateData->igfPrevWhiteningLevel[p] == IGF_WHITENING_OFF && hPrivateData->igfCurrWhiteningLevel[p] != IGF_WHITENING_OFF ) || - ( hPrivateData->igfPrevWhiteningLevel[p + 1] == IGF_WHITENING_OFF && hPrivateData->igfCurrWhiteningLevel[p + 1] != IGF_WHITENING_OFF ) ) - { - Word16 i; - Word16 pastSfm_a[4], pastSfm_b[4]; - Word16 pastSfmDiffSum_a, pastSfmDiffSum_b; - - FOR( i = 0; i < 4; i++ ) - { - pastSfm_a[i] = hPrivateData->igfPastSFM_fx[p][add( hPrivateData->igfPastSFM_pos, sub( 4, i ) ) % IGF_PAST_SFM_LEN]; - pastSfm_b[i] = hPrivateData->igfPastSFM_fx[p + 1][add( hPrivateData->igfPastSFM_pos, sub( 4, i ) ) % IGF_PAST_SFM_LEN]; - move16(); - move16(); - } - pastSfmDiffSum_a = pastSfmDiffSum_b = 0; - move16(); - move16(); - FOR( i = 0; i < 3; i++ ) - { - IF( NE_16( pastSfm_a[i + 1], -ONE_IN_Q13 ) ) - { - pastSfmDiffSum_a = add( pastSfmDiffSum_a, sub( pastSfm_a[i], pastSfm_a[i + 1] ) ); - pastSfmDiffSum_b = add( pastSfmDiffSum_b, sub( pastSfm_b[i], pastSfm_b[i + 1] ) ); - } - ELSE - { - break; - } - } - test(); - test(); - test(); - test(); - /* if tonality oscillates between two tiles, turn whitening off in both */ - IF( ( ( pastSfmDiffSum_a > 0 && pastSfmDiffSum_b < 0 ) || - ( pastSfmDiffSum_a < 0 && pastSfmDiffSum_b > 0 ) ) && - ( GT_32( L_abs( L_sub( pastSfmDiffSum_a, pastSfmDiffSum_b ) ), ONE_IN_Q12 /* 0.5 in Q13 */ ) ) ) - { - hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p + 1] = IGF_WHITENING_OFF; - move16(); - move16(); - } - } - } - - /* hangover */ - FOR( p = 0; p < hGrid->nTiles; p++ ) - { - IF( NE_16( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ) ) - { - hPrivateData->igfWhiteningHangoverCnt[p] = add( hPrivateData->igfWhiteningHangoverCnt[p], 1 ); - IF( EQ_16( hPrivateData->igfWhiteningHangoverCnt[p], 3 ) ) - { - hPrivateData->igfWhiteningHangoverCnt[p] = 0; - } - ELSE - { - hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfPrevWhiteningLevel[p]; - } - move16(); - move16(); - } - ELSE - { - hPrivateData->igfWhiteningHangoverCnt[p] = 0; - move16(); - } - } - - hPrivateData->igfPastSFM_pos = add( hPrivateData->igfPastSFM_pos, 1 ) % IGF_PAST_SFM_LEN; - move16(); - } - - hPrivateData->wasTransient = isTransient; - move16(); - - return; -} - - -/*-------------------------------------------------------------------* - * IGF_WriteWhiteningTile_fx() - * - * write whitening levels into bitstream - *-------------------------------------------------------------------*/ - -/*! r: number of bits written */ -static Word16 IGF_WriteWhiteningTile_fx( /**< out: Q0 | number of bits written */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ - Word16 whiteningLevel /**< in: Q0 | whitening levels to write */ -) -{ - Word16 totBitCount; - Word16 startBitCount; - - totBitCount = 0; - startBitCount = *pBitOffset; - move16(); - move16(); - - IF( EQ_32( whiteningLevel, IGF_WHITENING_MID ) ) - { - IGF_write_bits( hBstr, pBitOffset, 0, 1 ); - } - ELSE - { - IGF_write_bits( hBstr, pBitOffset, 1, 1 ); - IF( whiteningLevel == IGF_WHITENING_OFF ) - { - IGF_write_bits( hBstr, pBitOffset, 0, 1 ); - } - ELSE - { - IGF_write_bits( hBstr, pBitOffset, 1, 1 ); - } - } - totBitCount = sub( *pBitOffset, startBitCount ); - - return totBitCount; -} - - -/*-------------------------------------------------------------------* - * IGF_WriteWhiteningLevels_fx() - * - * writes the whitening levels - *-------------------------------------------------------------------*/ - -static Word16 IGF_WriteWhiteningLevels_fx( /**< out: Q0 | total number of bits written */ - const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF encoder */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ - const Word16 igfGridIdx, /**< in: Q0 | igf grid index see declaration of IGF_GRID_IDX for details */ - const Word16 isIndepFlag /**< in: Q0 | if 1 frame is independent, 0 = frame is coded with data from previous frame */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - H_IGF_GRID hGrid; - Word16 p; - Word16 nTiles; - Word16 isSame; - Word32 tmp32; - Word16 totBitCount; - Word16 startBitCount; - - totBitCount = 0; - move16(); - isSame = 1; - move16(); - startBitCount = *pBitOffset; - move16(); - hPrivateData = &hInstance->igfData; - hGrid = &hPrivateData->igfInfo.grid[igfGridIdx]; - nTiles = hGrid->nTiles; - move16(); - - IF( isIndepFlag ) - { - isSame = 0; - move16(); - } - ELSE - { - p = 0; - move16(); - tmp32 = 0; - move32(); - test(); - WHILE( ( LT_16( p, nTiles ) ) && ( tmp32 == 0 ) ) - { - test(); - tmp32 = L_sub( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ); - if ( tmp32 != 0 ) - { - isSame = 0; - move16(); - } - p++; - } - } - IF( isSame ) - { - IGF_write_bits( hBstr, pBitOffset, 1, 1 ); - } - ELSE - { - IF( !isIndepFlag ) - { - IGF_write_bits( hBstr, pBitOffset, 0, 1 ); - } - IGF_WriteWhiteningTile_fx( hBstr, pBitOffset, hPrivateData->igfCurrWhiteningLevel[0] ); - p = 1; - move16(); - tmp32 = 0; - move32(); - test(); - IF( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) - { - isSame = 1; - move16(); - } - ELSE - { - if ( LT_16( p, nTiles ) ) - { - isSame = 1; - move16(); - } - test(); - WHILE( ( LT_16( p, nTiles ) ) && ( tmp32 == 0 ) ) - { - test(); - tmp32 = L_sub( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfCurrWhiteningLevel[p - 1] ); - if ( tmp32 != 0 ) - { - isSame = 0; - move16(); - } - p++; - } - } - test(); - IF( !isSame ) - { - IGF_write_bits( hBstr, pBitOffset, 1, 1 ); - FOR( p = 1; p < nTiles; p++ ) - { - IGF_WriteWhiteningTile_fx( hBstr, pBitOffset, hPrivateData->igfCurrWhiteningLevel[p] ); - } - } - ELSE IF( NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) && NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) - { - IGF_write_bits( hBstr, pBitOffset, 0, 1 ); - } - } - - totBitCount = sub( *pBitOffset, startBitCount ); - - return totBitCount; -} - - -/*-------------------------------------------------------------------* - * IGF_WriteFlatteningTrigger_fx() - * - * write flattening trigger - *-------------------------------------------------------------------*/ - -/*! r: number of bits written */ -static Word16 IGF_WriteFlatteningTrigger_fx( /**< out: | number of bits written */ - const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset /**< in: | ptr to bitOffset counter */ -) -{ - Word16 flatteningTrigger; - - Word16 totBitCount; - Word16 startBitCount; - totBitCount = 0; - startBitCount = *pBitOffset; - flatteningTrigger = hInstance->flatteningTrigger; - move16(); - move16(); - move16(); - - IGF_write_bits( hBstr, pBitOffset, flatteningTrigger, 1 ); - totBitCount = sub( *pBitOffset, startBitCount ); - - return totBitCount; -} - - -/*-------------------------------------------------------------------* - * IGF_UpdateInfo() - * - * updates the start/stop frequency of IGF according to igfGridIdx - *-------------------------------------------------------------------*/ - -/*-------------------------------------------------------------------* - * IGFEncWriteBitstream() - * - * IGF bitstream writer - *-------------------------------------------------------------------*/ - -/*! r: number of bits written per frame */ -Word16 IGFEncWriteBitstream_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /* i : ptr to bitOffset counter */ - const Word16 igfGridIdx, /* i : igf grid index see declaration of IGF_GRID_IDX for details */ - const Word16 isIndepFlag /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ -) -{ - Word16 igfAllZero; - Word16 startBitCount; - - startBitCount = *pBitOffset; - move16(); - hIGFEnc->infoTotalBitsPerFrameWritten = 0; - move16(); - - if ( isIndepFlag ) - { - hIGFEnc->infoTotalBitsWritten = 0; - move16(); - } - - IGF_WriteEnvelope( hIGFEnc, /* i: instance handle of IGF Encoder */ - hBstr, /* i: encoder state */ - pBitOffset, /* i: ptr to bitOffset counter */ - igfGridIdx, /* i: igf grid index see definition of IGF_GRID_IDX for details */ - isIndepFlag, /* i: if 1 frame is independent, 0 = frame is coded with data from previous frame */ - &igfAllZero ); /* o: *igfAllZero */ - - IGF_WriteWhiteningLevels_fx( hIGFEnc, /* i: instance handle of IGF Encoder */ - hBstr, /* i: encoder state */ - pBitOffset, /* i: ptr to bitOffset counter */ - igfGridIdx, /* i: igf grid index see definition of IGF_GRID_IDX for details */ - isIndepFlag ); /* i: if 1 frame is independent, 0 = frame is coded with data from previous frame */ - - IGF_WriteFlatteningTrigger_fx( hIGFEnc, /* i: instance handle of IGF Encoder */ - hBstr, /* i: encoder state */ - pBitOffset ); /* i: ptr to bitOffset counter */ - - hIGFEnc->infoTotalBitsPerFrameWritten = sub( *pBitOffset, startBitCount ); - hIGFEnc->infoTotalBitsWritten = add( hIGFEnc->infoTotalBitsWritten, hIGFEnc->infoTotalBitsPerFrameWritten ); - move16(); - move16(); - - return hIGFEnc->infoTotalBitsPerFrameWritten; -} - - -/*-------------------------------------------------------------------* - * IGFEncSetMode() - * - * sets the IGF mode according to given bitrate - *-------------------------------------------------------------------*/ -void IGFEncSetMode_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */ - const Word32 total_brate, /* i : encoder total bitrate */ - const Word16 bwidth, /* i : encoder audio bandwidth */ - const Word16 element_mode, /* i : IVAS element mode */ - const Word16 rf_mode /* i : flag to signal the RF mode */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - Word16 i; - - hPrivateData = &hIGFEnc->igfData; - hPrivateData->igfBitstreamBits = 0; - move16(); - set16_fx( hPrivateData->igfScfQuantized, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->igfCurrWhiteningLevel, 0, IGF_MAX_TILES ); - set16_fx( hPrivateData->igfPrevWhiteningLevel, 0, IGF_MAX_TILES ); - set16_fx( hPrivateData->igfWhiteningHangoverCnt, 0, IGF_MAX_TILES ); - FOR( i = 0; i < IGF_MAX_TILES; i++ ) - { - set16_fx( hPrivateData->igfPastSFM_fx[i], -( ONE_IN_Q13 ), IGF_PAST_SFM_LEN ); - } - - hPrivateData->igfPastSFM_pos = 0; - move16(); - - FOR( i = 0; i < IGF_BITBUFSIZE / 8; i++ ) - { - hPrivateData->igfBitstream[i] = 0; - move16(); - } - hPrivateData->wasTransient = 0; - move16(); - set32_fx( hPrivateData->prevSFM_FIR, 0, IGF_MAX_TILES ); - set16_fx( hPrivateData->prevSFM_IIR, 0, IGF_MAX_TILES ); - set16_fx( hPrivateData->dampingFactorSmoothing, 2, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFM_FIR_SFB_SB_fx, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFB_FIR_TB_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFB_FIR_SB_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFM_IIR_SFB_SB_fx, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFB_IIR_SB_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFM_FIR_SFB_TB_fx, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFB_IIR_TB_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->sfb_tb_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->sfb_sb_e, 15, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevSFM_IIR_SFB_TB_fx, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->prevDampingFactor_IIR_fx, -( ONE_IN_Q15 ), IGF_MAX_SFB ); - set16_fx( hPrivateData->prevDampingFactor_IIR_e, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->logSpec, 0, L_FRAME_PLUS ); - set16_fx( hPrivateData->SFM_sb_fx, 0, IGF_MAX_SFB ); - set16_fx( hPrivateData->SFM_tb_fx, 0, IGF_MAX_SFB ); - - IF( IGFCommonFuncsIGFConfiguration_ivas_fx( total_brate, bwidth, element_mode, &hPrivateData->igfInfo, rf_mode ) != 0 ) - { - IGFSCFEncoderOpen_fx( &hPrivateData->hIGFSCFArithEnc, &hPrivateData->igfInfo, total_brate, bwidth, element_mode, rf_mode ); - - hIGFEnc->infoSamplingRate = hPrivateData->igfInfo.sampleRate; - move32(); - hIGFEnc->infoStartFrequency = hPrivateData->igfInfo.grid[0].startFrequency; - move16(); - hIGFEnc->infoStopFrequency = hPrivateData->igfInfo.grid[0].stopFrequency; - move16(); - hIGFEnc->infoStartLine = hPrivateData->igfInfo.grid[0].startLine; - move16(); - hIGFEnc->infoStopLine = hPrivateData->igfInfo.grid[0].stopLine; - move16(); - } - ELSE - { - /* IGF configuration failed -> error! */ - hIGFEnc->infoSamplingRate = 0; - move32(); - hIGFEnc->infoStartFrequency = -1; - move16(); - hIGFEnc->infoStopFrequency = -1; - move16(); - hIGFEnc->infoStartLine = -1; - move16(); - hIGFEnc->infoStopLine = -1; - move16(); - fprintf( stderr, "IGFEncSetMode_fx: initialization error!\n" ); - } - - /* reset remaining variables */ - hIGFEnc->infoTotalBitsWritten = 0; - move16(); - hIGFEnc->infoTotalBitsPerFrameWritten = 0; - move16(); - hIGFEnc->flatteningTrigger = 0; - move16(); - hIGFEnc->spec_be_igf_e = 0; - move16(); - hIGFEnc->tns_predictionGain = 0; - move16(); - set32_fx( hIGFEnc->spec_be_igf, 0, N_MAX_TCX - IGF_START_MN ); - return; -} - - -/*-------------------------------------------------------------------* - * IGFEncConcatenateBitstream() - * - * IGF bitstream concatenation for TCX10 modes - *-------------------------------------------------------------------*/ - -/*-------------------------------------------------------------------* - * IGFEncResetTCX10BitCounter_ivas_fx() - * - * IGF reset bitstream bit counter for TCX10 modes - *-------------------------------------------------------------------*/ - -void IGFEncResetTCX10BitCounter_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - - hPrivateData = &hIGFEnc->igfData; - hPrivateData->igfBitstreamBits = 0; - hIGFEnc->infoTotalBitsWritten = 0; - move16(); - move16(); - return; -} - - -/*-------------------------------------------------------------------* - * IGFEncApplyMono() - * - * apply the IGF encoder, main encoder interface - *-------------------------------------------------------------------*/ - -void IGFEncApplyMono_ivas_fx( - Encoder_State *st, /* i : Encoder state */ - Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx buffer */ - const Word16 igfGridIdx, /* i : IGF grid index */ - Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ - Word16 e_mdct, /* i : exponent of pMDCTspectrum */ - Word32 *pPowerSpectrum_fx, /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ - Word16 *e_ps, /* i : exponent of pPowerSpectrum */ - const Word16 isTCX20, /* i : flag indicating if the input is TCX20 or TCX10/2xTCX5 */ - const Word8 isTNSActive, /* i : flag indicating if the TNS is active */ - const Word16 sp_aud_decision0, /* i : first stage switching decision */ - const Word16 vad_hover_flag /* i : VAD hangover flag */ -) -{ - Word32 *pPowerSpectrumParameter_fx; - Word16 *pPowerSpectrumParameter_exp; - Word16 att_fx = MAX16B; - Word16 last_core_acelp; - move16(); - - Word32 common_pPowerSpectrum_fx[N_MAX + L_MDCT_OVLP_MAX]; - - set32_fx( common_pPowerSpectrum_fx, 0, N_MAX ); - - Word16 common_pPowerSpectrum_exp = MIN16B; - move16(); - IF( st->last_core == ACELP_CORE ) - { - last_core_acelp = 1; - move16(); - } - ELSE - { - last_core_acelp = 0; - move16(); - } - - test(); - IF( !isTNSActive && isTCX20 ) - { - pPowerSpectrumParameter_fx = pPowerSpectrum_fx; - pPowerSpectrumParameter_exp = e_ps; - } - ELSE - { - pPowerSpectrumParameter_fx = NULL; - pPowerSpectrumParameter_exp = NULL; - } - - IGF_UpdateInfo( st->hIGFEnc, igfGridIdx ); - - test(); - IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) - { - calculate_hangover_attenuation_gain_ivas_fx( st, &att_fx, vad_hover_flag ); - } - - IGF_CalculateEnvelope_ivas_fx( st->hIGFEnc, pMDCTSpectrum_fx, e_mdct, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, st->element_mode, att_fx ); - - IF( isTCX20 ) - { - pPowerSpectrumParameter_fx = pPowerSpectrum_fx; - pPowerSpectrumParameter_exp = e_ps; - } - ELSE - { - pPowerSpectrumParameter_fx = NULL; - pPowerSpectrumParameter_exp = NULL; - } - - IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) ) - { - IGF_Whitening_ivas_fx( st->hIGFEnc, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, isTNSActive, sp_aud_decision0, st->element_brate, st->element_mode ); - } - ELSE - { - IGF_Whitening_ivas_fx( st->hIGFEnc, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, isTNSActive, sp_aud_decision0, st->total_brate, st->element_mode ); - } - - IF( pPowerSpectrumParameter_fx ) - { - FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) - { - common_pPowerSpectrum_exp = s_max( common_pPowerSpectrum_exp, pPowerSpectrumParameter_exp[i] ); - } - - FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) - { - common_pPowerSpectrum_fx[i] = L_shl( pPowerSpectrumParameter_fx[i], sub( pPowerSpectrumParameter_exp[i], common_pPowerSpectrum_exp ) ); - move16(); - } - pPowerSpectrumParameter_fx = common_pPowerSpectrum_fx; - } - IGF_ErodeSpectrum_ivas_fx( st->hIGFEnc, pMDCTSpectrum_fx, pPowerSpectrumParameter_fx, common_pPowerSpectrum_exp, igfGridIdx, 0 ); -} - - -/*-------------------------------------------------------------------* - * IGFEncApplyStereo() - * - * apply the IGF encoder, main encoder interface - *-------------------------------------------------------------------*/ - -void IGFEncApplyStereo_fx( - STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT stereo encoder structure */ - Word16 ms_mask[2][MAX_SFB], /* i : bandwise MS mask */ - const IGF_ENC_INSTANCE_HANDLE hIGFEnc[CPE_CHANNELS], /* i : instance handle of IGF Encoder */ - const Word16 igfGridIdx, /* i : IGF grid index */ - Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */ - Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ - Word16 *exp_pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: exp of pPowerSpectrum_fx */ - Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i/o: inverse power spectrum */ - Word16 *q_pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i/o: Q of pPowerSpectrumMsInv_fx */ - Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ - Word16 exp_inv_spectrum_fx[CPE_CHANNELS], /* i : exp of inverse spectrum */ - const Word16 frameno, /* i : flag indicating index of current subfr. */ - const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */ - const Word32 element_brate, /* i : element bitrate */ - const Word16 mct_on ) -{ - Word32 *pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */ - Word16 *exp_pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */ - Word32 *pPowerSpectrumParameterMsInv_fx[NB_DIV]; - Word16 *q_pPowerSpectrumParameterMsInv_fx[NB_DIV]; - Word16 coreMsMask[N_MAX]; - Word16 sfb, ch, last_core_acelp; - STEREO_MDCT_BAND_PARAMETERS *sfbConf; - Word32 common_pPowerSpectrum_fx[N_MAX]; - - set32_fx( common_pPowerSpectrum_fx, 0, N_MAX ); - - Word16 common_pPowerSpectrum_exp = MIN16B; - move16(); - - /* assumptions: stereo filling was already done on the flattened spectra - * IGF region is always coded M/S, never L/R (to be done in the encoder) - * for residual bands with stereo filling infoTcxNoise is set to zero - * both channels have the same IGF configuration - */ - - /* sanity checks: check if both channels have the same configuration...*/ - assert( ( sts[0]->core == sts[1]->core ) ); - - /* initialization */ - IF( EQ_16( sts[0]->core, TCX_20_CORE ) ) - { - sfbConf = &hStereoMdct->stbParamsTCX20; - } - ELSE - { - sfbConf = &hStereoMdct->stbParamsTCX10; - } - if ( sts[0]->last_core == ACELP_CORE ) - { - sfbConf = &hStereoMdct->stbParamsTCX20afterACELP; - } - - /* create line wise ms mask for the core bands */ - set16_fx( coreMsMask, 0, N_MAX ); - FOR( sfb = 0; sfb < sfbConf->sfbCnt; sfb++ ) - { - set16_fx( &coreMsMask[sfbConf->sfbOffset[sfb]], ms_mask[frameno][sfb], sub( sfbConf->sfbOffset[sfb + 1], sfbConf->sfbOffset[sfb] ) ); - } - - test(); - test(); - IF( EQ_16( sts[0]->core, TCX_20_CORE ) && !sts[0]->hTcxEnc->fUseTns[frameno] && !sts[1]->hTcxEnc->fUseTns[frameno] ) - { - pPowerSpectrumParameter_fx[0] = &pPowerSpectrum_fx[0][0]; - exp_pPowerSpectrumParameter_fx[0] = &exp_pPowerSpectrum_fx[0][0]; - pPowerSpectrumParameter_fx[1] = &pPowerSpectrum_fx[1][0]; - exp_pPowerSpectrumParameter_fx[1] = &exp_pPowerSpectrum_fx[1][0]; - pPowerSpectrumParameterMsInv_fx[0] = pPowerSpectrumMsInv_fx[0][0]; - pPowerSpectrumParameterMsInv_fx[1] = pPowerSpectrumMsInv_fx[1][0]; - q_pPowerSpectrumParameterMsInv_fx[0] = q_pPowerSpectrumMsInv_fx[0][0]; - q_pPowerSpectrumParameterMsInv_fx[1] = q_pPowerSpectrumMsInv_fx[1][0]; - } - ELSE - { - pPowerSpectrumParameter_fx[0] = NULL; - pPowerSpectrumParameter_fx[1] = NULL; - pPowerSpectrumParameterMsInv_fx[0] = NULL; - pPowerSpectrumParameterMsInv_fx[1] = NULL; - q_pPowerSpectrumParameterMsInv_fx[0] = NULL; - q_pPowerSpectrumParameterMsInv_fx[1] = NULL; - } - FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) - { - last_core_acelp = extract_l( EQ_16( sts[ch]->last_core, ACELP_CORE ) ); - - IGF_UpdateInfo( hIGFEnc[ch], igfGridIdx ); - IGF_CalculateStereoEnvelope_fx( hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], sts[ch]->hTcxEnc->spectrum_e[frameno], inv_spectrum_fx[ch][frameno], - exp_inv_spectrum_fx[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrum_fx[ch], pPowerSpectrumParameterMsInv_fx[ch], - q_pPowerSpectrumParameterMsInv_fx[ch], igfGridIdx, coreMsMask, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, mct_on ); - - IF( EQ_16( sts[ch]->core, TCX_20_CORE ) ) - { - pPowerSpectrumParameter_fx[ch] = pPowerSpectrum_fx[ch]; - exp_pPowerSpectrumParameter_fx[ch] = exp_pPowerSpectrum_fx[ch]; - } - ELSE - { - pPowerSpectrumParameter_fx[ch] = NULL; - } - - IGF_Whitening_ivas_fx( hIGFEnc[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrumParameter_fx[ch], igfGridIdx, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, ( sts[0]->hTcxEnc->fUseTns[frameno] || sts[1]->hTcxEnc->fUseTns[frameno] ), sp_aud_decision0, element_brate, sts[ch]->element_mode ); - - IF( pPowerSpectrumParameter_fx[ch] ) - { - Word16 length = N_MAX; - move16(); - if ( mct_on ) - { - length = L_FRAME48k; - move16(); - } - FOR( Word16 i = 0; i < length; i++ ) - { - common_pPowerSpectrum_exp = s_max( common_pPowerSpectrum_exp, exp_pPowerSpectrumParameter_fx[ch][i] ); - } - - FOR( Word16 i = 0; i < length; i++ ) - { - common_pPowerSpectrum_fx[i] = L_shl( pPowerSpectrumParameter_fx[ch][i], sub( exp_pPowerSpectrumParameter_fx[ch][i], common_pPowerSpectrum_exp ) ); - move32(); - } - pPowerSpectrumParameter_fx[ch] = common_pPowerSpectrum_fx; - } - IGF_ErodeSpectrum_ivas_fx( hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], pPowerSpectrumParameter_fx[ch], common_pPowerSpectrum_exp, igfGridIdx, mct_on ); - } - return; -} - - -/*-------------------------------------------------------------------* - * IGFSaveSpectrumForITF() - * - * - *-------------------------------------------------------------------*/ - -void IGFSaveSpectrumForITF_ivas_fx( - IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */ - const Word16 igfGridIdx, /* i : IGF grid index */ - const Word32 *pITFSpectrum, /* i : MDCT spectrum */ - Word16 exp_pITFSpectrum ) -{ - IGF_UpdateInfo( hIGFEnc, igfGridIdx ); - - Copy32( pITFSpectrum + IGF_START_MN, hIGFEnc->spec_be_igf, sub( hIGFEnc->infoStopLine, IGF_START_MN ) ); - - scale_sig32( hIGFEnc->spec_be_igf, sub( hIGFEnc->infoStopLine, IGF_START_MN ), sub( exp_pITFSpectrum, s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ) ) ); - scale_sig32( hIGFEnc->spec_be_igf + sub( hIGFEnc->infoStopLine, IGF_START_MN ), sub( N_MAX_TCX - IGF_START_MN, sub( hIGFEnc->infoStopLine, IGF_START_MN ) ), sub( hIGFEnc->spec_be_igf_e, s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ) ) ); - hIGFEnc->spec_be_igf_e = s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ); - move16(); - - return; -} - -ivas_error IGF_Reconfig( - IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ - const Word16 igf, /* i : IGF on/off */ - const Word16 reset, /* i : reset flag */ - const Word32 brate, /* i : bitrate for configuration */ - const Word16 bwidth, /* i : signal bandwidth */ - const Word16 element_mode, /* i : IVAS element mode */ - const Word16 rf_mode /* i : flag to signal the RF mode */ -) -{ - ivas_error error; - - error = IVAS_ERR_OK; - move32(); - - test(); - test(); - test(); - IF( igf && *hIGFEnc == NULL ) - { - IF( ( *hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) - { - return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); - } - IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); - } - ELSE IF( igf && reset ) - { - IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); - } - ELSE IF( !igf && *hIGFEnc != NULL ) - { - free( *hIGFEnc ); - *hIGFEnc = NULL; - } - - return error; -} diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index c57f5ffb0..31372c136 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -13,35 +13,46 @@ #include "stat_enc.h" #include "basop_util.h" -/**********************************************************************/ /* -write single bit to stream -**************************************************************************/ + +/*-------------------------------------------------------------------* + * IGF_write_bit_fx() + * + * write single bit to stream + *-------------------------------------------------------------------*/ + static void IGF_write_bit_fx( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *bitCount, /**< in/out: | bit counter */ - Word16 bit /**< in: | value of bit */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *bitCount, /* i/o: bit counter */ + const Word16 value /* i : value */ ) { - IGFCommonFuncsWriteSerialBit( hBstr, bitCount, bit ); + IF( hBstr ) + { + push_next_indice( hBstr, value, 1 ); + } + + ( *bitCount ) = add( ( *bitCount ), 1 ); + move16(); + + return; } -/**********************************************************************/ /* -write bits to stream -**************************************************************************/ +/*-------------------------------------------------------------------* + * IGF_write_bits() + * + * write bits to stream + *-------------------------------------------------------------------*/ + static void IGF_write_bits( - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *bitCount, /**< in/out: | bit counter */ - Word16 value, /**< in: | value to be written */ - Word16 bits /**< in: Q0 | number of bits */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *bitCount, /* i/o: bit counter */ + const Word16 value, /* i/o: value */ + Word16 bits /* i : number of bits */ ) { - Word16 tmp; - - WHILE( bits ) + WHILE( bits-- ) { - bits = sub( bits, 1 ); - tmp = s_and( value, shl( 1, bits ) ); - IF( tmp == 0 ) + IF( s_and( value, shl( 1, bits ) ) == 0 ) { IGF_write_bit_fx( hBstr, bitCount, 0 ); } @@ -55,15 +66,16 @@ static void IGF_write_bits( } -/**********************************************************************/ /* +/**********************************************************************/ /* envelope estimation **************************************************************************/ -static void IGF_CalculateEnvelope( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ - Word32 *pMDCTSpectrum, /**< in: Q31 | MDCT spectrum */ - Word16 MDCTSpectrum_e, /**< in: | exponent of MDCT spectrum */ - Word32 *pPowerSpectrum, /**< in: Q31 | MDCT^2 + MDST^2 spectrum, or estimate */ - Word16 PowerSpectrum_e, /**< in: | exponent of MDCT^2 + MDST^2 spectrum, or estimate */ - const Word16 igfGridIdx /**< in: Q0 | IGF grid index */ +static void IGF_CalculateEnvelope( + const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ + Word32 *pMDCTSpectrum, /**< in: Q31 | MDCT spectrum */ + Word16 MDCTSpectrum_e, /**< in: | exponent of MDCT spectrum */ + Word32 *pPowerSpectrum, /**< in: Q31 | MDCT^2 + MDST^2 spectrum, or estimate */ + Word16 PowerSpectrum_e, /**< in: | exponent of MDCT^2 + MDST^2 spectrum, or estimate */ + const Word16 igfGridIdx /**< in: Q0 | IGF grid index */ ) { @@ -277,16 +289,19 @@ static void IGF_CalculateEnvelope( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< return; } + /**********************************************************************/ /* writes IGF SCF values **************************************************************************/ -static void IGF_WriteEnvelope( /**< out: Q0 | number of bits writen */ - const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ - const Word16 igfGridIdx, /**< in: Q0 | igf grid index see declaration of IGF_GRID_IDX for details */ - const Word16 isIndepFlag, /**< in: Q0 | if 1 frame is independent, 0 = frame is coded with data from previous frame */ - Word16 *igfAllZero /**< in: Q0 | returns 1 if all IGF scfs are zero, else 0 */ + +/**< out: Q0 | number of bits writen */ +static void IGF_WriteEnvelope( + const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ + const Word16 igfGridIdx, /**< in: Q0 | igf grid index see declaration of IGF_GRID_IDX for details */ + const Word16 isIndepFlag, /**< in: Q0 | if 1 frame is independent, 0 = frame is coded with data from previous frame */ + Word16 *igfAllZero /**< in: Q0 | returns 1 if all IGF scfs are zero, else 0 */ ) { IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; @@ -1232,15 +1247,20 @@ static void IGF_Whitening( const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in } hPrivateData->wasTransient = isTransient; move16(); + + return; } + /**********************************************************************/ /* write whitening levels into bitstream **************************************************************************/ -static void IGF_WriteWhiteningTile_fx( /**< out: Q0 | number of bits written */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ - Word16 whiteningLevel /**< in: Q0 | whitening levels to write */ + +/**< out: Q0 | number of bits written */ +static void IGF_WriteWhiteningTile_fx( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ + Word16 whiteningLevel /**< in: Q0 | whitening levels to write */ ) { IF( EQ_32( whiteningLevel, IGF_WHITENING_MID ) ) @@ -1259,6 +1279,8 @@ static void IGF_WriteWhiteningTile_fx( /**< ou IGF_write_bits( hBstr, pBitOffset, 1, 1 ); } } + + return; } /**********************************************************************/ /* @@ -1627,23 +1649,30 @@ hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, nb_bits_written ); return; } -/**********************************************************************/ /* - IGF reset bitsream bit counter for TCX10 modes - **************************************************************************/ -void IGFEncResetTCX10BitCounter_fx( const IGF_ENC_INSTANCE_HANDLE hInstance /**< in: | instance handle of IGF Encoder */ + + +/*-------------------------------------------------------------------* + * IGFEncResetTCX10BitCounter_ivas_fx() + * + * IGF reset bitstream bit counter for TCX10 modes + *-------------------------------------------------------------------*/ + +void IGFEncResetTCX10BitCounter_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ ) { IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - hPrivateData = &hInstance->igfData; + hPrivateData = &hIGFEnc->igfData; hPrivateData->igfBitstreamBits = 0; + hIGFEnc->infoTotalBitsWritten = 0; move16(); - hInstance->infoTotalBitsWritten = 0; move16(); return; } + /**********************************************************************/ /* IGF write concatenated bitsream for TCX10 modes **************************************************************************/ @@ -1809,3 +1838,2602 @@ ivas_error IGF_Reconfig_fx( return error; } + + +#define INV_Log2_10_Q15 9864 /*1/log2(10) in Q15*/ +#define INV_Log2_10_Q12 1233 /*1/log2(10) in Q12*/ +#define INV_Log2_e_Q15 22713 /*1/log2(e) in Q15*/ + + +/*-------------------------------------------------------------------* + * IGF_getCrest_new() + * + * crest factor calculation + *-------------------------------------------------------------------*/ + +/*! r: crest factor */ +static Word16 IGF_getCrest_new_fx( + const Word16 *logSpec, /* i : power spectrum */ + const Word16 start, /* i : start subband index */ + const Word16 stop, /* i : stop subband index */ + Word16 *crest_exp /*Stores the exponent of the result(return value)*/ +) +{ + Word16 i; + Word16 x; + Word32 x_eff; + Word16 x_max; + Word16 exp; + Word16 temp; + Word16 temp_e; + Word16 crest; /*1.0f in Q15*/ + x_eff = 0; + x_max = 0; + exp = 0; + temp = 0; + crest = 32767; /*1.0f in Q15*/ + move32(); + move16(); + move16(); + move16(); + move16(); + + FOR( i = start; i < stop; i++ ) + { + x = logSpec[i]; + move16(); + x_eff = L_mac0( x_eff, x, x ); + + if ( GT_16( x, x_max ) ) + { + x_max = x; + move16(); + } + } + + x_eff = BASOP_Util_Divide3216_Scale( x_eff, sub( stop, start ), &temp_e ); + temp_e = add( temp_e, 16 ); /*exp += 31 - 15 + 16(because x_eff is word32)*/ + x_eff = L_shr( x_eff, sub( 15, temp_e ) ); + temp_e = 15; + move16(); + temp = Sqrt16( extract_l( x_eff ), &temp_e ); + + test(); + IF( x_eff > 0 && x_max > 0 ) + { + temp = BASOP_Util_Divide1616_Scale( x_max, temp, &exp ); + exp = add( exp, sub( 15, temp_e ) ); + IF( exp < 0 ) + { + temp = shl( temp, exp ); + exp = 0; + move16(); + } + crest = s_max( shl_sat( 1, sub( 15, exp ) ), temp ); + } + *crest_exp = exp; + move16(); + return crest; +} + + +/*-------------------------------------------------------------------* + * IGF_getSFM_new() + * + * calculates spectral flatness measurement + *-------------------------------------------------------------------*/ + +/*! r: SFM value */ +static Word16 IGF_getSFM_new_fx( + const Word32 *powerSpectrum, /* i : power spectrum */ + const Word16 *logSpec, /* i : log of power spectrum */ + const Word16 start, /* i : start subband index */ + const Word16 stop, /* i : stop subband index */ + Word16 *e_ps /*Stores exp related to power spectrum*/ +) +{ + Word16 n; + Word16 i; + Word16 num; + Word32 denom; + Word16 numf; + Word32 tmp; + Word16 sfm; + Word16 sfm_e; + Word16 denom_e; + Word16 numf_e; /*stores exponent for numf*/ + Word16 tmp_e; + + num = 0; + denom = ONE_IN_Q30; + denom_e = 1; + sfm = MAX16B; // Q15 + move16(); + move32(); + move16(); + move16(); + + FOR( i = start; i < stop; i++ ) + { + tmp = powerSpectrum[i]; + n = logSpec[i /*-start*/]; + move32(); + move16(); + num = add( num, n ); + denom = BASOP_Util_Add_Mant32Exp( tmp, e_ps[i], denom, denom_e, &denom_e ); + } + + numf = BASOP_Util_Divide1616_Scale( num, sub( stop, start ), &numf_e ); + denom = BASOP_Util_Divide3216_Scale( denom, sub( stop, start ), &tmp_e ); + denom_e = add( add( denom_e, tmp_e ), 1 ); /*denom_e+tmp_e-15 +16(because type of denom is word32)*/ + + IF( denom != 0 ) + { + tmp = BASOP_util_Pow2( L_add( numf, shl_sat( 1, sub( 14, numf_e ) ) ), add( 16, numf_e ), &tmp_e ); + sfm = BASOP_Util_Divide3232_Scale( tmp, denom, &sfm_e ); + sfm_e = add( sfm_e, sub( tmp_e, denom_e ) ); + sfm = shl_sat( extract_l( L_min( sfm, L_shl_sat( 1, sub( 15, sfm_e ) ) ) ), sfm_e ); + } + + return sfm; +} +/*-------------------------------------------------------------------* + * IGF_getTilt() + * + * calculates spectral tilt + *-------------------------------------------------------------------*/ + +/*! r: spectral tilt value */ + +/*-------------------------------------------------------------------* + * IGF_getTNR() + * + * calculates tonal-to-noise ratio + *-------------------------------------------------------------------*/ + +/*! r: spectral tilt value */ +/* Returns value with exponent as 9 and Q as 22*/ + +static Word32 IGF_getTNR_ivas_fx( + const Word32 *powerSpectrum, /* i : energies */ + const Word16 start, /* i : start subband index */ + const Word16 stop, /* i : stop subband index */ + const Word16 adap, /* i : SFB width adaptation */ + Word16 *e_ps, /*Stores exponent for powerSpectrum*/ + Word16 e_adap /*Stores exponent for adap*/ +) +{ + Word16 i; + Word16 width; + Word32 avg; + Word32 tonal; + Word16 tonal_e; /* holds exp for tonal*/ + Word32 noise; + Word16 noise_e; /* holds exp for noise*/ + Word32 tonalToNoise; + Word32 rootSpec[300]; + Word16 rootSpec_e[300]; /*rootSpec_e[i] holds exp for rootSpec[i]*/ + Word16 avg_e; /* holds exp for avg*/ + Word16 tmp_e; + avg = 0; + tonal = 0; + noise = EPSILON_FX; + tonal_e = 0; + noise_e = 0; + avg_e = 0; + tmp_e = 0; + move32(); + move32(); + move32(); + move16(); + move16(); + move16(); + move16(); + + set32_fx( rootSpec, 0, 300 ); + set16_fx( rootSpec_e, 0, 300 ); + + width = sub( stop, start ); + FOR( i = start; i < stop; i++ ) + { + rootSpec_e[( i - start )] = e_ps[i]; + move16(); + rootSpec[( i - start )] = Sqrt32( powerSpectrum[i], &rootSpec_e[( i - start )] ); /*rootSpec[i - start] = sqrtf( powerSpectrum[i] );*/ + move32(); + avg = BASOP_Util_Add_Mant32Exp( avg, avg_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &avg_e ); /*avg += rootSpec[i - start];resultant exponent is avg_e*/ + } + avg = BASOP_Util_Divide3216_Scale( avg, width, &tmp_e ); /*avg /= width;*/ + avg_e = add( 16, sub( add( avg_e, tmp_e ), 15 ) ); + + FOR( i = start; i < stop; i++ ) + { + Word16 normSpec_e; /*stores resultant exponent for normSpec*/ + Word16 normSpec = BASOP_Util_Divide3232_Scale( rootSpec[i - start], avg, &normSpec_e ); /*rootSpec[i - start] / avg;*/ + normSpec_e = add( normSpec_e, sub( rootSpec_e[i - start], avg_e ) ); + IF( GT_32( normSpec, L_add_sat( L_shl_sat( 1, sub( 15, normSpec_e ) ), L_shl_sat( adap, sub( e_adap, normSpec_e ) ) ) ) ) + { + tonal = BASOP_Util_Add_Mant32Exp( tonal, tonal_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &tonal_e ); /*tonal += rootSpec[i - start];*/ + } + ELSE IF( LT_32( normSpec, L_shl_sat( 1, sub( 15, normSpec_e ) ) ) ) + { + noise = BASOP_Util_Add_Mant32Exp( noise, noise_e, rootSpec[( i - start )], rootSpec_e[( i - start )], &noise_e ); /*noise += rootSpec[i - start];*/ + } + } + + /*tonalToNoise = 20.f * log10f( max( 1e-018f, tonal / noise ) )*/ + IF( noise == 0 ) // To handle condition if denom = 0 + { + tonalToNoise = imult3216( L_shr( L_add( L_shl( 18 /* log10f(1e-018f) */, Q25 ), Mpy_32_16_1( L_add( BASOP_Util_Log2( tonal ), L_shl( tonal_e, Q25 ) ) /*Q25*/, INV_Log2_10_Q15 ) /*25+15-15*/ ), 3 ) /*Q22*/, 20 ); + } + ELSE + { + Word16 temp = BASOP_Util_Divide3232_Scale( tonal, noise, &tmp_e ); /*tonal / noise*/ + tmp_e = add( tmp_e, sub( tonal_e, noise_e ) ); + IF( GE_16( temp, 1 ) ) + { + tonalToNoise = imult3216( Mult_32_16( L_add( BASOP_Util_Log2( temp ), L_shl( add( 16, tmp_e ), Q25 ) ) /*Q25*/, INV_Log2_10_Q12 ) /*25+12-15*/, 20 ); /*Q22*/ + } + ELSE + { + tonalToNoise = -1509949440; /*-360.f Q22*/ + move32(); + } + } + + return tonalToNoise; +} + +/*-------------------------------------------------------------------* + * IGF_CalculateEnvelope() + * + * envelope estimation + *-------------------------------------------------------------------*/ + +static void IGF_CalculateEnvelope_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ + Word32 *pMDCTSpectrum_fx, /* i : MDCT spectrum */ + Word16 e_mdct, /* i : exp of MDCT spectrum */ + Word32 *pPowerSpectrum_fx, /* i : MDCT^2 + MDST^2 spectrum, or estimate */ + Word16 *e_ps, /* i : exp of power spectrum */ + const Word16 igfGridIdx, /* i : IGF grid index */ + const Word16 isTransient, /* i : flag indicating if transient is detected */ + const Word16 last_core_acelp, /* i : indicator if last frame was ACELP core */ + const Word16 element_mode, /* i : IVAS element_mode */ + const Word16 att /* i : attenuation */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + H_IGF_GRID hGrid; + Word16 *swb_offset; + Word16 sfb; /* this is the actual scalefactor band */ + Word16 width; /* this is width in subbands of the actual scalefactor band */ + Word16 tile_idx; + Word16 strt_cpy; + Word32 gain; /* the gain which has to be applied to the source tile to get the destination energy */ + Word16 sb; + Word32 sfbEnergyR; + Word32 sfbEnergyC; /* the energy of the destination region of the tile */ + Word32 sfbEnergyTileR; + Word32 sfbEnergyTileC; /* the energy of the destination region of the tile */ + Word16 tmp, x, y; + Word16 mean_x_fx, mean_y_fx; + Word32 mean_xy_fx, mean_x2_fx; + Word16 tmp_tb; + Word16 tmp_sb; + Word16 sfbCnt; + Word16 sfm; + Word16 crest; + Word16 temp; + Word16 mean_x_e, mean_y_e; /*Stores exponent for mean_x and mean_y respectively*/ + Word16 mean_xy_e, mean_x2_e; /*stores exponent for mean_xy and mean_x2 respectively*/ + Word16 sfbEnergyTileR_e; /*Exponent for sfbEnergyTileR*/ + Word16 sfbEnergyTileC_e; /*Exponent for sfbEnergyTileC*/ + Word16 sfbEnergyC_e; /*Exponent for sfbEnergyC*/ + Word16 sfbEnergyR_e; + Word16 gain_e; /*exponent for gain*/ + Word16 tmp_tb_e; /*Stores exponent for tmp_tb*/ + Word16 tmp_sb_e; /*stores exponent for tmp_sb*/ + Word16 crest_exp; /*Stores the exponent of the result(return value)*/ + Word16 sfm_exp; /*stores exponent for ouput from sfm*/ + Word16 tmp_e; + + hPrivateData = &hIGFEnc->igfData; + hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; + swb_offset = hGrid->swb_offset; + + IF( element_mode > EVS_MONO ) + { + IF( igfGridIdx != IGF_GRID_LB_NORM ) + { + FOR( sfbCnt = 0; sfbCnt < sub( hGrid->sfbWrap[hGrid->nTiles], hGrid->sfbWrap[0] ); sfbCnt++ ) + { + /* reset filter */ + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_TB_e[sfbCnt] + hPrivateData->prevSFB_FIR_TB_e[sfbCnt] = 0; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_TB_e[sfbCnt] + hPrivateData->prevSFB_IIR_TB_e[sfbCnt] = 0; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_SB_e[sfbCnt] + hPrivateData->prevSFB_FIR_SB_e[sfbCnt] = 0; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_SB_e[sfbCnt] + hPrivateData->prevSFB_IIR_SB_e[sfbCnt] = 0; + hPrivateData->prevDampingFactor_IIR_fx[sfbCnt] = MIN16B; /* -1.f in Q15*/ + hPrivateData->prevDampingFactor_IIR_e[sfbCnt] = 0; + hPrivateData->dampingFactorSmoothing[sfbCnt] = 2; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + } + } + + IF( pPowerSpectrum_fx ) + { + FOR( sb = hGrid->sbWrap[0]; sb < swb_offset[hGrid->sfbWrap[hGrid->nTiles]]; sb++ ) + { + IF( LT_32( 1, pPowerSpectrum_fx[sb] ) ) + { + hPrivateData->logSpec[sb] = s_max( 0, extract_l( W_extract_l( W_shr( W_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), W_shl( e_ps[sb], Q25 ) ), Q25 ) ) ) ); + move16(); + } + ELSE + { + hPrivateData->logSpec[sb] = 0; + move16(); + } + } + } + + FOR( tile_idx = 0; tile_idx < hGrid->nTiles; tile_idx++ ) + { + strt_cpy = hGrid->sbWrap[tile_idx]; + move16(); + + FOR( sfb = hGrid->sfbWrap[tile_idx]; sfb < hGrid->sfbWrap[tile_idx + 1]; sfb++ ) + { + width = sub( swb_offset[sfb + 1], swb_offset[sfb] ); + sfbEnergyTileR = EPSILON_FIX; + sfbEnergyTileC = EPSILON_FIX; + sfbEnergyC = EPSILON_FX; + sfbEnergyTileR_e = 0; + sfbEnergyTileC_e = 0; + sfbEnergyC_e = 0; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + + IF( pPowerSpectrum_fx != NULL ) + { + tmp = strt_cpy; + move16(); + FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) + { + Word16 shift = norm_l( pPowerSpectrum_fx[sb] ); + sfbEnergyC = BASOP_Util_Add_Mant32Exp( sfbEnergyC, sfbEnergyC_e, L_shl( pPowerSpectrum_fx[sb], shift ), sub( e_ps[sb], shift ), &sfbEnergyC_e ); + // sfbEnergyTileR = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR, sfbEnergyTileR_e, Mult_32_32( pMDCTSpectrum_fx[strt_cpy], pMDCTSpectrum_fx[strt_cpy] ), shl( e_mdct, 1 ), &sfbEnergyTileR_e ); + Word64 tmp64 = W_mult_32_32( pMDCTSpectrum_fx[strt_cpy], pMDCTSpectrum_fx[strt_cpy] ); + Word16 tmp64_e = W_norm( tmp64 ); + tmp64 = W_shl( tmp64, tmp64_e ); + + sfbEnergyTileR = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR, sfbEnergyTileR_e, W_extract_h( tmp64 ), shl( e_mdct, 1 ) - tmp64_e, &sfbEnergyTileR_e ); + shift = norm_l( pPowerSpectrum_fx[strt_cpy] ); + sfbEnergyTileC = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC, sfbEnergyTileC_e, L_shl( pPowerSpectrum_fx[strt_cpy], shift ), sub( e_ps[strt_cpy], shift ), &sfbEnergyTileC_e ); + + strt_cpy = add( strt_cpy, 1 ); + } + + sfbEnergyTileR = L_deposit_h( BASOP_Util_Divide3232_Scale( sfbEnergyTileR, width, &tmp_e ) ); + sfbEnergyTileR_e = add( sub( sfbEnergyTileR_e, Q31 ), tmp_e ); + + IF( sfbEnergyTileR == 0 ) + { + sfbEnergyTileR = EPSILON_FX; + sfbEnergyTileR_e = 0; + move32(); + move16(); + } + IF( sfbEnergyC == 0 ) + { + sfbEnergyC = EPSILON_FX; + sfbEnergyC_e = 0; + move32(); + move16(); + } + IF( sfbEnergyTileC == 0 ) + { + sfbEnergyTileC = EPSILON_FX; + sfbEnergyTileC_e = 0; + temp = BASOP_Util_Divide3232_Scale( sfbEnergyC, sfbEnergyTileC, &tmp_e ); + tmp_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); + move32(); + move16(); + } + ELSE + { + /*gain = (float) ( sfbEnergyTileR * ( sfbEnergyC / sfbEnergyTileC ) );*/ + temp = BASOP_Util_Divide3232_Scale( sfbEnergyC, sfbEnergyTileC, &tmp_e ); + tmp_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); + } + + gain = Mult_32_16( sfbEnergyTileR, temp ); // gain_e + gain_e = add( tmp_e, sfbEnergyTileR_e ); + + IF( element_mode > EVS_MONO ) + { + test(); + IF( !isTransient ) + { + Word16 diffSFM; + Word16 shiftedSFM = 0; + Word16 shiftedSFM_e = 0; + move16(); + move16(); + + // tmp_tb = IGF_getSFM_new( pPowerSpectrum, hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1] ) / IGF_getCrest_new( hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1] ); + sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1], e_ps ); + sfm_exp = 0; + move16(); + crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb], swb_offset[sfb + 1], &crest_exp ); + tmp_tb = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); // tmp_tb_e + tmp_tb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); + + // tmp_sb = IGF_getSFM_new( pPowerSpectrum, hPrivateData->logSpec, tmp, strt_cpy ) / IGF_getCrest_new( hPrivateData->logSpec, tmp, strt_cpy ); + sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, tmp, strt_cpy, e_ps ); + crest = IGF_getCrest_new_fx( hPrivateData->logSpec, tmp, strt_cpy, &crest_exp ); + tmp_sb = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); // tmp_sb_e + tmp_sb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); + + test(); + IF( last_core_acelp || hPrivateData->wasTransient ) + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = tmp_tb; /*Exponent for hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] : hPrivateData->prevSFB_FIR_TB_e[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] : hPrivateData->prevSFB_IIR_TB_e[sfb] */ + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = tmp_sb; /*Exponent for hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] : hPrivateData->prevSFB_FIR_SB_e[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] : hPrivateData->prevSFB_IIR_SB_e[sfb] */ + hPrivateData->prevSFB_FIR_TB_e[sfb] = hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_tb_e; + hPrivateData->prevSFB_FIR_SB_e[sfb] = hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + + tmp_tb = shr( tmp_tb, 2 ); /*taking 2 guard bits so it's exponent tmp_sb_e=+2*/ + tmp_sb = shr( tmp_sb, 2 ); /*taking 2 guard bits so it's exponent tmp_tb_e=+2 */ + tmp_sb_e = add( tmp_sb_e, 2 ); + tmp_tb_e = add( tmp_tb_e, 2 ); + + Word16 tmp0, tmp2, tmp3, tmp4; + Word16 tmp0_e, tmp2_e, tmp3_e, tmp4_e; + tmp0 = shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], 2 ); + tmp0_e = add( hPrivateData->prevSFB_FIR_TB_e[sfb], 2 ); + move16(); + tmp2 = shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], 2 ); + tmp2_e = add( hPrivateData->prevSFB_IIR_TB_e[sfb], 2 ); + move16(); + tmp3 = shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], 2 ); + tmp3_e = add( hPrivateData->prevSFB_FIR_SB_e[sfb], 2 ); + move16(); + tmp4 = shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], 2 ); + tmp4_e = add( hPrivateData->prevSFB_IIR_SB_e[sfb], 2 ); + move16(); + Word16 x1, x2; + + Word16 x1_e = BASOP_Util_Add_MantExp( tmp0, tmp0_e, tmp2, tmp2_e - 1, &x1 ); + Word16 x2_e = BASOP_Util_Add_MantExp( tmp3, tmp3_e, tmp4, tmp4_e - 1, &x2 ); + hPrivateData->sfb_tb_e[sfb] = BASOP_Util_Add_MantExp( tmp_tb, tmp_tb_e, x1, x1_e, &hPrivateData->SFM_tb_fx[sfb] ); // hPrivateData->sfb_sb_e[sfb] + move16(); + BASOP_Util_Add_MantExp( 22118, 2, negate( hPrivateData->SFM_tb_fx[sfb] ), hPrivateData->sfb_tb_e[sfb], &tmp ); + + IF( tmp < 0 ) + { + hPrivateData->sfb_tb_e[sfb] = 2; + hPrivateData->SFM_tb_fx[sfb] = 22118; + move16(); + move16(); + } + + hPrivateData->sfb_sb_e[sfb] = BASOP_Util_Add_MantExp( tmp_sb, tmp_sb_e, x2, x2_e, &hPrivateData->SFM_sb_fx[sfb] ); // hPrivateData->sfb_tb_e[sfb] + move16(); + BASOP_Util_Add_MantExp( 22118, 2, negate( hPrivateData->SFM_sb_fx[sfb] ), hPrivateData->sfb_sb_e[sfb], &tmp ); + + IF( tmp < 0 ) + { + hPrivateData->sfb_sb_e[sfb] = 2; + hPrivateData->SFM_sb_fx[sfb] = 22118; + move16(); + move16(); + } + + BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sfb], hPrivateData->sfb_sb_e[sfb], negate( hPrivateData->SFM_tb_fx[sfb] ), hPrivateData->sfb_tb_e[sfb], &diffSFM ); + + test(); + IF( diffSFM > 0 && LT_32( hPrivateData->SFM_tb_fx[sfb], L_shr( 3277 /*0.1 Q15*/, hPrivateData->sfb_tb_e[sfb] ) ) ) /* check whether target SFB is more tonal than source SFB */ + { + Word16 currDampingFactor, dampingFactor; + Word16 slope, threshold; + Word16 alpha; + Word16 slope_e, threshold_e, currDampingFactor_e, dampingFactor_e, alpha_e; + + /* calculate spectral tilt to detect sudden drops (or increases) in energy in the current SFB */ + // slope = IGF_getTilt_fx( pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1], e_ps, &slope_e ); + + x = 1; + mean_x_fx = mean_y_fx = 0; + Word32 mean_y_fx_tmp = 0; + move32(); + mean_xy_fx = mean_x2_fx = 0; + mean_x_e = 15; + mean_xy_e = mean_y_e = mean_x2_e = 31; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + + FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) + { + mean_x_fx = add( mean_x_fx, x ); /*Q0*/ + mean_x2_fx = L_add( mean_x2_fx, L_mult0( x, x ) ); /*Q0*/ + + /*y = 20.f * log10f( max( 1.f, powerSpectrum[i] ) );*/ + IF( LE_64( W_deposit32_l( pPowerSpectrum_fx[sb] ), W_shl( 1, ( sub( 31, e_ps[sb] ) ) ) ) ) + { + y = 0; + move16(); + } + ELSE + { + y = imult1616( 20, extract_l( L_shr( Mult_32_16( ( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( e_ps[sb], Q25 ) ) ), INV_Log2_10_Q15 ), Q25 ) ) ); /*Q0*/ + } + mean_y_fx_tmp = L_mac0( mean_y_fx_tmp, y, 1 ); /*Q0*/ + mean_xy_fx = L_add( mean_xy_fx, L_mult0( y, x ) ); /*Q0*/ + + x = add( x, 1 ); + } + mean_y_fx = BASOP_Util_Divide3216_Scale( mean_y_fx_tmp, width, &tmp_e ); /* mean_y_e*/ + + mean_y_e = add( mean_y_e, sub( tmp_e, 15 ) ); + mean_x_fx = BASOP_Util_Divide1616_Scale( mean_x_fx, width, &tmp_e ); /* mean_x_e*/ + mean_x_e = add( mean_x_e, sub( tmp_e, 15 ) ); + mean_xy_fx = BASOP_Util_Divide3216_Scale( mean_xy_fx, width, &tmp_e ); /* mean_xy_e*/ + mean_xy_e = add( mean_xy_e, sub( tmp_e, 15 ) ); + mean_x2_fx = BASOP_Util_Divide3216_Scale( mean_x2_fx, width, &tmp_e ); /* mean_x2_e*/ + mean_x2_e = add( mean_x2_e, sub( tmp_e, 15 ) ); + + /*slope = ( mean_xy - mean_x * mean_y ) / ( mean_x2 - mean_x * mean_x );*/ + slope = BASOP_Util_Divide3232_Scale( ( L_sub( mean_xy_fx, L_shl( mult( mean_x_fx, mean_y_fx ), sub( add( mean_x_e, mean_y_e ), mean_xy_e ) ) ) ), ( L_sub( mean_x2_fx, L_shl( mult( mean_x_fx, mean_x_fx ), sub( add( mean_x_e, mean_x_e ), mean_x2_e ) ) ) ), &slope_e ); + slope_e = add( slope_e, sub( mean_xy_e, mean_x2_e ) ); + + /* determine whether strong tilt is due to a step in the spectrum (e.g. band limitation, no damping) + or a tonal component close the band border (apply damping) by calculating SFM for a shift of 1/2 SFB width*/ + threshold = BASOP_Util_Divide1616_Scale( 60, width, &threshold_e ); + + test(); + IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope, add( slope_e, 16 ), negate( threshold ), add( threshold_e, 16 ) ), -1 ) ) + { + Word16 shift = shr( width, 1 ); + sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift, e_ps ); + crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift, &crest_exp ); + shiftedSFM = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); + } + ELSE IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope, add( slope_e, 16 ), threshold, add( threshold_e, 16 ) ), 1 ) && ( NE_16( sfb, sub( hGrid->sfbWrap[hGrid->nTiles], 1 ) ) ) ) + { + Word16 shift = shr( width, 1 ); + shiftedSFM = BASOP_Util_Divide1616_Scale( IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, e_ps ), IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, &crest_exp ), &tmp_e ); + sfm = IGF_getSFM_new_fx( pPowerSpectrum_fx, hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, e_ps ); + crest = IGF_getCrest_new_fx( hPrivateData->logSpec, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift, &crest_exp ); + shiftedSFM = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); + } + shiftedSFM_e = add( shiftedSFM_e, sub( sfm_exp, crest_exp ) ); + + IF( GT_32( shiftedSFM, L_shl( 1311 /*0.04f Q15*/, negate( shiftedSFM_e ) ) ) ) + { + currDampingFactor = 32767; /*1.f Q15*/ + currDampingFactor_e = 0; + move16(); + move16(); + } + ELSE + { + // alpha = min( 320.f / (float) swb_offset[sfb + 1], 1.25f ); + temp = BASOP_Util_Divide1616_Scale( 320, swb_offset[sfb + 1], &alpha_e ); + alpha = extract_l( L_min( temp, L_shl( 20480 /*1.25 Q14*/, sub( 1, alpha_e ) ) ) ); // alpha_e + + // currDampingFactor = expf( 1.25f * alpha * logf( hPrivateData->SFM_tb[sfb] / hPrivateData->SFM_sb[sfb] ) ); + temp = BASOP_Util_Divide1616_Scale( hPrivateData->SFM_tb_fx[sfb], hPrivateData->SFM_sb_fx[sfb], &tmp_e ); // tmp_e + tmp_e = add( tmp_e, sub( hPrivateData->sfb_tb_e[sfb], hPrivateData->sfb_sb_e[sfb] ) ); + Word16 temp1 = mult( 20480 /* 1.25f in Q14 */, alpha ); + Word16 tmp1_e = add( 1, alpha_e ); + currDampingFactor = round_fx( BASOP_util_Pow2( Mpy_32_16_1( L_add( BASOP_Util_Log2( temp ), L_shl_sat( add( 16, tmp_e ), 25 ) ), temp1 ), add( tmp1_e, 6 ), &currDampingFactor_e ) ); // currDampingFactor_e + + /* calculate tonal-to-noise ratio and reduce damping for low values*/ + + Word32 tonalToNoise; + Word16 adap; + Word16 adap_e; /*stores exp for adap*/ + Word16 tonalToNoise_e; /*stores exponent for tonalToNoise*/ + tonalToNoise_e = 9; + move16(); + adap = BASOP_Util_Divide1616_Scale( width, 40, &adap_e ); + tonalToNoise = IGF_getTNR_ivas_fx( pPowerSpectrum_fx, swb_offset[sfb], swb_offset[sfb + 1], adap, e_ps, adap_e ); /*Q22*/ + + IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( tonalToNoise, tonalToNoise_e, L_add( L_shl( 10, sub( 15, adap_e ) ), adap ), add( 16, adap_e ) ), -1 ) ) + { + // currDampingFactor += 0.03f * ( ( 10 + adap ) - tonalToNoise ); + Word32 temp2 = BASOP_Util_Add_Mant32Exp( L_add( L_shl( 10, sub( 15, adap_e ) ) /*exp:adap_e*/, adap ), add( adap_e, 16 ), L_negate( tonalToNoise ), tonalToNoise_e, &tmp_e ); // tmp_e + currDampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor, currDampingFactor_e, extract_l( Mult_32_32( 983 /*0.03f Q15*/, temp2 ) ), tmp_e, &currDampingFactor ); // currDampingFactor_e + } + } + + Word32 L_tmp = hPrivateData->prevDampingFactor_IIR_fx[sfb]; + move32(); + L_tmp = L_shl( L_tmp, hPrivateData->prevDampingFactor_IIR_e[sfb] ); + test(); + test(); + IF( last_core_acelp || hPrivateData->wasTransient || EQ_32( L_tmp, MIN16B ) ) + { + tmp = BASOP_Util_Cmp_Mant32Exp( currDampingFactor, currDampingFactor_e, 3277 /* 0.1f in Q15 */, 0 ); + IF( tmp >= 0 ) + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = currDampingFactor; + hPrivateData->prevDampingFactor_IIR_e[sfb] = currDampingFactor_e; + move16(); + move16(); + } + ELSE + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = 3277; /* 0.1 in Q15 */ + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + move16(); + move16(); + } + } + IF( last_core_acelp ) + { + hPrivateData->dampingFactorSmoothing[sfb] = 2; + move16(); + } + + dampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor, currDampingFactor_e, hPrivateData->prevDampingFactor_IIR_fx[sfb], hPrivateData->prevDampingFactor_IIR_e[sfb], &dampingFactor ); // dampingFactor_e + dampingFactor = shr( dampingFactor, 1 ); + + gain = Mult_32_16( gain, shl_sat( extract_l( L_min( L_add( dampingFactor, Mult_32_16( L_shl( hPrivateData->dampingFactorSmoothing[sfb], sub( 15, dampingFactor_e ) ) /*Q:15-dampingFactor_e*/, 3277 /*0.1f Q15*/ ) /*Q:15-dampingFactor_e*/ ), shl_sat( 1, sub( 15, dampingFactor_e ) ) ) ), dampingFactor_e ) /*Q15*/ ); + + hPrivateData->prevDampingFactor_IIR_fx[sfb] = dampingFactor; + move16(); + hPrivateData->prevDampingFactor_IIR_e[sfb] = dampingFactor_e; + move16(); + if ( hPrivateData->dampingFactorSmoothing[sfb] > 0 ) + { + hPrivateData->dampingFactorSmoothing[sfb] = sub( hPrivateData->dampingFactorSmoothing[sfb], 1 ); + move16(); + } + } + ELSE + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; // exponent : hPrivateData->prevDampingFactor_IIR_e[sfb] + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + hPrivateData->dampingFactorSmoothing[sfb] = 1; + move16(); + move16(); + move16(); + } + + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = tmp_tb; // hPrivateData->prevSFB_FIR_TB_e[sfb] + hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_tb_e; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = hPrivateData->SFM_tb_fx[sfb]; // hPrivateData->prevSFB_IIR_TB_e[sfb] + hPrivateData->prevSFB_IIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = tmp_sb; // hPrivateData->prevSFB_FIR_SB_e[sfb] + hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = hPrivateData->SFM_sb_fx[sfb]; // hPrivateData->prevSFB_IIR_SB_e[sfb] + hPrivateData->prevSFB_IIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + ELSE + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_FIR_TB_e[sfb] + hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] + hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] + hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_SB_e[sfb] + hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; + hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; /* hPrivateData->prevDampingFactor_IIR_e[sfb]*/ + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + hPrivateData->dampingFactorSmoothing[sfb] = 2; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + } + } + ELSE + { + tmp_e = e_mdct; + move16(); + sfbEnergyR = add_sat( EPSILON_FX, BASOP_Util_Divide3216_Scale( sum2_32_fx( pMDCTSpectrum_fx + swb_offset[sfb], width, &tmp_e ) /*exp: tmp_e*/, width, &sfbEnergyR_e ) ); // sfbEnergyR_e + sfbEnergyR_e = add( sfbEnergyR_e, add( tmp_e, -15 ) ); + gain = L_shl( sfbEnergyR, 16 ); // gain_e + move32(); + gain_e = sfbEnergyR_e; + + IF( element_mode > EVS_MONO ) + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_FIR_TB_e[sfb] + hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] + hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_TB_e[sfb] + hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; // hPrivateData->prevSFB_IIR_SB_e[sfb] + hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; + hPrivateData->prevDampingFactor_IIR_fx[sfb] = MIN16B; /* hPrivateData->prevDampingFactor_IIR_e[sfb]*/ + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + hPrivateData->dampingFactorSmoothing[sfb] = 2; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + } + + gain = Mult_32_16( gain, att ); // gain_e + gain_e = add( gain_e, 0 ); + + /*gain=0.5f+log2f(gain)*2+16 becuase 2.885390081777927f=2*1/loge(2) so 2*1/loge(2)*loge(x) can be written as 2*log2(x)*/ + gain = L_add( ONE_IN_Q22, L_add( L_add( L_shr( BASOP_Util_Log2( gain ), 1 ), L_shl( gain_e, Q24 ) ), L_shl( 16, Q23 ) ) ); /*Q23*/ + test(); + test(); + IF( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) + { + gain = L_add( gain, ONE_IN_Q21 ); /* better preservation of original HF band energy */ + } + test(); + test(); + IF( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_64000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_64000_CPE ) ) ) + { + gain = L_add( gain, ONE_IN_Q20 ); + } + gain = L_min( gain, 91 << Q23 ); /* 13+15+63, see arithcode encode residual */ + gain = L_max( gain, 0 ); + gain_e = 8; /* stores exponent for gain_fx*/ + move16(); + hPrivateData->igfScfQuantized[sfb] = extract_l( L_shr( gain, Q23 ) ); /*Q0*/ + move16(); + } + } + + return; +} + +/*-------------------------------------------------------------------* + * IGF_CalculateStereoEnvelope_fx() + * + * envelope estimation + + *-------------------------------------------------------------------*/ +static void IGF_CalculateStereoEnvelope_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ + const Word32 *pMDCTSpectrum_fx, /* i : MDCT spectrum */ + Word16 pMDCTSpectrum_e, /* i : exponent for pMDCTSpectrum_fx */ + const Word32 *pMDCTSpectrumMsInv_fx, /* i : MDCT spectrum */ + Word16 pMDCTSpectrumMsInv_e, /* i : expontent for pMDCTSpectrumMsInv_fx */ + const Word32 *pPowerSpectrum_fx, /* i : MDCT^2 + MDST^2 spectrum, or estimate */ + Word16 *pPowerSpectrum_e, /* i : exponent for pPowerSpectrum_fx */ + const Word32 *pPowerSpectrumMsInv_fx, /* i : inverse power spectrum */ + Word16 *q_pPowerSpectrumMsInv, /* i : Q for pPowerSpectrumMsInv_fx */ + const Word16 igfGridIdx, /* i : IGF grid index */ + const Word16 coreMsMask[N_MAX], /* i : line wise ms Mask */ + const Word16 isTransient, /* i : flag indicating if transient is detected */ + const Word16 last_core_acelp, /* i : indicator if last frame was ACELP core */ + const Word16 mct_on ) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + H_IGF_GRID hGrid; + Word16 *swb_offset; + Word16 sfb; /* this is the actual scalefactor band */ + Word16 width; /* this is width in subbands of the actual scalefactor band */ + Word16 tile_idx; + Word16 strt_cpy; + Word32 gain_fx; /* the gain which has to be applied to the source tile to get the destination energy */ + Word16 sb; + Word16 sfbEnergyR_fx; + Word32 sfbEnergyC_fx; /* the energy of the destination region of the tile */ + Word32 sfbEnergyTileR_fx; + Word32 sfbEnergyTileC_fx; /* the energy of the destination region of the tile */ + Word16 tmp, x, y; + Word16 mean_x_fx, mean_y_fx; + Word32 mean_xy_fx, mean_x2_fx; + Word16 slope_fx; + Word16 tmp_tb_fx; + Word16 tmp_sb_fx; + Word16 sfbCnt; + Word32 tileSrcSpec_fx[MAX_IGF_SFB_LEN]; + Word16 sfm; + Word16 crest; + Word16 temp; + Word16 mean_x_e, mean_y_e; /*Stores exponent for mean_x and mean_y respectively*/ + Word16 mean_xy_e, mean_x2_e; /*stores exponent for mean_xy and mean_x2 respectively*/ + Word16 tileSrcSpec_e[MAX_IGF_SFB_LEN]; /*Exponent for tileSrcSpec_fx*/ + Word16 sfbEnergyTileR_e; /*Exponent for sfbEnergyTileR_fx*/ + Word16 sfbEnergyTileC_e; /*Exponent for sfbEnergyTileC_fx*/ + Word16 sfbEnergyC_e; /*Exponent for sfbEnergyC_fx*/ + Word16 gain_e; /*exponent for gain_fx*/ + Word16 crest_exp; /*stores exponent for output from crest*/ + Word16 sfm_exp; /*stores exponent for ouput from sfm*/ + Word16 tmp_tb_e; /*Stores exponent for tmp_tb_fx*/ + Word16 tmp_sb_e; /*stores exponent for tmp_sb_fx*/ + Word16 slope_e; /*stores exponent for slope_fx*/ + Word16 sfbEnergyR_e; /*stores exponent for sfbEnergyR*/ + Word16 tmp_e; + Word32 temp_pPowerSpectrumMsInv[N_MAX], length; + Word16 q_temp_pPowerSpectrumMsInv = Q31, i; + move16(); + + IF( pPowerSpectrumMsInv_fx != NULL ) + { + length = N_MAX; + move16(); + if ( mct_on ) + { + length = L_FRAME48k; + move16(); + } + FOR( i = 0; i < length; i++ ) + { + IF( pPowerSpectrumMsInv_fx[i] != 0 ) + { + q_temp_pPowerSpectrumMsInv = s_min( q_temp_pPowerSpectrumMsInv, add( q_pPowerSpectrumMsInv[i], norm_l( pPowerSpectrumMsInv_fx[i] ) ) ); + } + } + FOR( i = 0; i < length; i++ ) + { + temp_pPowerSpectrumMsInv[i] = L_shl( pPowerSpectrumMsInv_fx[i], sub( q_temp_pPowerSpectrumMsInv, q_pPowerSpectrumMsInv[i] ) ); + move32(); + } + } + + hPrivateData = &hIGFEnc->igfData; + hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; + swb_offset = hGrid->swb_offset; + move16(); + + IF( igfGridIdx != IGF_GRID_LB_NORM ) + { + FOR( sfbCnt = 0; sfbCnt < sub( hGrid->sfbWrap[hGrid->nTiles], hGrid->sfbWrap[0] ); sfbCnt++ ) + { + /* reset filter */ + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_TB_e[sfbCnt] + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_TB_e[sfbCnt] + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_FIR_SB_e[sfbCnt] + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfbCnt] = 0; // exponent : hPrivateData->prevSFB_IIR_SB_e[sfbCnt] + hPrivateData->prevSFB_FIR_TB_e[sfbCnt] = 0; + hPrivateData->prevSFB_IIR_TB_e[sfbCnt] = 0; + hPrivateData->prevSFB_FIR_SB_e[sfbCnt] = 0; + hPrivateData->prevSFB_IIR_SB_e[sfbCnt] = 0; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + } + + IF( pPowerSpectrum_fx ) + { + FOR( sb = hGrid->sbWrap[0]; sb < swb_offset[hGrid->sfbWrap[hGrid->nTiles]]; sb++ ) + { + /*hPrivateData->logSpec[sb] = max( 0, (Word16) ( logf( max( FLT_MIN, pPowerSpectrum[sb] ) ) * INV_LOG_2 ) );*/ + IF( LE_32( 1, pPowerSpectrum_fx[sb] ) ) + { + hPrivateData->logSpec[sb] = s_max( 0, (Word16) L_shr( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( pPowerSpectrum_e[sb], Q25 ) ), 25 ) ); + } + ELSE + { + hPrivateData->logSpec[sb] = 0; /*max(0,-126) is always 0*/ + } + move16(); + } + } + + FOR( tile_idx = 0; tile_idx < hGrid->nTiles; tile_idx++ ) + { + strt_cpy = hGrid->sbWrap[tile_idx]; + move16(); + + FOR( sfb = hGrid->sfbWrap[tile_idx]; sfb < hGrid->sfbWrap[tile_idx + 1]; sfb++ ) + { + width = sub( swb_offset[sfb + 1], swb_offset[sfb] ); + sfbEnergyTileR_fx = EPSILON_FX; + sfbEnergyTileC_fx = EPSILON_FX; + sfbEnergyC_fx = EPSILON_FX; + sfbEnergyTileR_e = 0; + sfbEnergyTileC_e = 0; + sfbEnergyC_e = 0; + move16(); + move16(); + move16(); + move32(); + move32(); + move32(); + IF( pPowerSpectrum_fx ) + { + Word16 final_exp; + Word16 norm_exp; + Word32 scaled_value; + tmp = strt_cpy; + move16(); + + FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) + { + IF( NE_16( coreMsMask[sb], coreMsMask[strt_cpy] ) ) + { + sfbEnergyC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyC_fx, sfbEnergyC_e, pPowerSpectrum_fx[sb], pPowerSpectrum_e[sb], &sfbEnergyC_e ); /*resultant exponent is stored in sfbEnergyC_e*/ + norm_exp = norm_l( pMDCTSpectrumMsInv_fx[strt_cpy] ); + final_exp = sub( pMDCTSpectrumMsInv_e, norm_exp ); + scaled_value = L_shl( pMDCTSpectrumMsInv_fx[strt_cpy], norm_exp ); + sfbEnergyTileR_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR_fx, sfbEnergyTileR_e, Mult_32_32( scaled_value, scaled_value ), shl( final_exp, 1 ), &sfbEnergyTileR_e ); /*resultant exponent is stored in sfbEnergyTileR_e*/ + sfbEnergyTileC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC_fx, sfbEnergyTileC_e, pPowerSpectrumMsInv_fx[strt_cpy], sub( 31, q_pPowerSpectrumMsInv[strt_cpy] ), &sfbEnergyTileC_e ); /*resultant exponent is stored in sfbEnergyTileC_e*/ + tileSrcSpec_fx[strt_cpy - tmp] = temp_pPowerSpectrumMsInv[strt_cpy]; /*resultant exponent is stored in tileSrcSpec_e*/ + tileSrcSpec_e[strt_cpy - tmp] = sub( 31, q_temp_pPowerSpectrumMsInv ); + } + ELSE + { + sfbEnergyC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyC_fx, sfbEnergyC_e, pPowerSpectrum_fx[sb], pPowerSpectrum_e[sb], &sfbEnergyC_e ); /*resultant exponent is stored in sfbEnergyC_e*/ + norm_exp = norm_l( pMDCTSpectrum_fx[strt_cpy] ); + final_exp = sub( pMDCTSpectrum_e, norm_exp ); + scaled_value = L_shl( pMDCTSpectrum_fx[strt_cpy], norm_exp ); + sfbEnergyTileR_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileR_fx, sfbEnergyTileR_e, Mult_32_32( scaled_value, scaled_value ), shl( final_exp, 1 ), &sfbEnergyTileR_e ); /*resultant exponent is stored in sfbEnergyTileR_e*/ + sfbEnergyTileC_fx = BASOP_Util_Add_Mant32Exp( sfbEnergyTileC_fx, sfbEnergyTileC_e, pPowerSpectrum_fx[strt_cpy], pPowerSpectrum_e[strt_cpy], &sfbEnergyTileC_e ); /*resultant exponent is stored in sfbEnergyTileC_e*/ + tileSrcSpec_fx[strt_cpy - tmp] = pPowerSpectrum_fx[strt_cpy]; /*resultant exponent is stored in tileSrcSpec_e*/ + tileSrcSpec_e[strt_cpy - tmp] = pPowerSpectrum_e[strt_cpy]; + } + move32(); + move16(); + strt_cpy = add( strt_cpy, 1 ); + } + + sfbEnergyTileR_fx = BASOP_Util_Divide3216_Scale( sfbEnergyTileR_fx, width, &tmp_e ); + sfbEnergyTileR_e = sub( add( sfbEnergyTileR_e, tmp_e ), 15 ); /*stores the resultant exponent for sfbEnergyTileR_fx*/ + + /*gain = (float) ( sfbEnergyTileR * ( sfbEnergyC / sfbEnergyTileC ) );*/ + temp = BASOP_Util_Divide3232_Scale( sfbEnergyC_fx, L_add( sfbEnergyTileC_fx, EPSILON_FX ), &tmp_e ); + gain_e = add( tmp_e, sub( sfbEnergyC_e, sfbEnergyTileC_e ) ); + gain_fx = Mult_32_16( sfbEnergyTileR_fx, temp ); + gain_e = add( 16, add( gain_e, sfbEnergyTileR_e ) ); /*stores the resultant exponent for gain_fx*/ + + IF( !isTransient ) + { + Word16 diffSFM_fx; + Word16 shiftedSFM_fx; + Word16 shiftedSFM_e; /*stores the resultant exponent for shiftedSFM_fx*/ + shiftedSFM_fx = 0; + shiftedSFM_e = 0; + move16(); + move16(); + + // tmp_tb = IGF_getSFM_ivas(pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1]) / IGF_getCrest_ivas(pPowerSpectrum, swb_offset[sfb], swb_offset[sfb + 1]); + sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, swb_offset[sfb], swb_offset[sfb + 1] ); + crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, swb_offset[sfb], swb_offset[sfb + 1] ); + tmp_tb_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); + tmp_tb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); /*stores the resultant exponent for tmp_tb_fx*/ + + // tmp_sb = IGF_getSFM_ivas(tileSrcSpec, 0, strt_cpy - tmp) / IGF_getCrest_ivas(tileSrcSpec, 0, strt_cpy - tmp); + sfm = IGF_getSFM_ivas_fx( &sfm_exp, tileSrcSpec_fx, tileSrcSpec_e, 0, sub( strt_cpy, tmp ) ); + crest = IGF_getCrest_ivas( &crest_exp, tileSrcSpec_fx, tileSrcSpec_e, 0, sub( strt_cpy, tmp ) ); + tmp_sb_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &tmp_e ); + tmp_sb_e = add( tmp_e, sub( sfm_exp, crest_exp ) ); /*stores the resultant exponent for tmp_sb_fx*/ + + IF( last_core_acelp || hPrivateData->wasTransient ) + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = tmp_tb_fx; /*Exponent for hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] values stored in hPrivateData->sfb_tb_e[sfb] */ + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = tmp_sb_fx; /*Exponent for hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] values stored in hPrivateData->sfb_sb_e[sfb]*/ + hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_sb_e; + hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_sb_e; + hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; + hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + ELSE + { + /* Purpose of this block: + -to make the exponent of hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] equal to that of tmp_tb_fx + -to make the exponent of hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] and hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] equal to that of tmp_sb_fx + */ + Word16 diff_sb_e; /*stores the difference of exponents for sb*/ + Word16 diff_tb_e; /*stores the difference of exponents for tb*/ + diff_sb_e = sub( tmp_sb_e, hPrivateData->sfb_sb_e[sfb] ); + diff_tb_e = sub( tmp_tb_e, hPrivateData->sfb_tb_e[sfb] ); + IF( LE_16( tmp_tb_e, hPrivateData->sfb_tb_e[sfb] ) ) + { + tmp_tb_fx = shl( tmp_tb_fx, diff_tb_e ); + tmp_tb_e = hPrivateData->sfb_tb_e[sfb]; + move16(); + } + ELSE + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], diff_tb_e ); + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], diff_tb_e ); + move16(); + move16(); + hPrivateData->prevSFB_FIR_TB_e[sfb] = tmp_tb_e; + hPrivateData->prevSFB_IIR_TB_e[sfb] = tmp_tb_e; + move16(); + move16(); + } + IF( LE_16( tmp_sb_e, hPrivateData->sfb_sb_e[sfb] ) ) + { + tmp_sb_fx = shl( tmp_sb_fx, diff_sb_e ); + tmp_sb_e = hPrivateData->sfb_sb_e[sfb]; + move16(); + } + ELSE + { + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], diff_sb_e ); + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], diff_sb_e ); + move16(); + move16(); + hPrivateData->prevSFB_FIR_SB_e[sfb] = tmp_sb_e; + hPrivateData->prevSFB_IIR_SB_e[sfb] = tmp_sb_e; + move16(); + move16(); + } + } + tmp_tb_fx = shr_sat( tmp_tb_fx, sub( 2, tmp_tb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ + tmp_sb_fx = shr_sat( tmp_sb_fx, sub( 2, tmp_sb_e ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ + hPrivateData->SFM_tb_fx[sfb] = add_sat( tmp_tb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_TB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_TB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ + hPrivateData->SFM_tb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_tb_fx[sfb] ); /* resultant exponent stored in hPrivateData->sfb_sb_e[sfb]*/ + hPrivateData->SFM_sb_fx[sfb] = add_sat( tmp_sb_fx, add_sat( shr( hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb], sub( 2, hPrivateData->prevSFB_FIR_SB_e[sfb] ) ), shr( hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb], sub( 3, hPrivateData->prevSFB_IIR_SB_e[sfb] ) ) ) ); /* Since we're limiting max value to 2.7f we can saturate to Q13 */ + hPrivateData->SFM_sb_fx[sfb] = s_min( 22118 /*2.7f Q13*/, hPrivateData->SFM_sb_fx[sfb] ); /*resultant exponent stores in hPrivateData->sfb_tb_e[sfb]*/ + move16(); + move16(); + move16(); + move16(); + hPrivateData->sfb_sb_e[sfb] = 2; + hPrivateData->sfb_tb_e[sfb] = 2; + move16(); + move16(); + + diffSFM_fx = sub( hPrivateData->SFM_sb_fx[sfb], hPrivateData->SFM_tb_fx[sfb] ); /*Q13*/ + + test(); + IF( diffSFM_fx > 0 && LT_16( hPrivateData->SFM_tb_fx[sfb], 819 /*0.1 Q13*/ ) ) /* check whether target SFB is more tonal than source SFB */ + { + Word16 currDampingFactor_fx, dampingFactor_fx, alpha_fx; + Word16 threshold_e, threshold_fx, alpha_e, currDampingFactor_e, dampingFactor_e; + /* calculate spectral tilt to detect sudden drops (or increases) in energy in the current SFB */ + x = 1; + mean_x_fx = mean_y_fx = 0; + mean_xy_fx = mean_x2_fx = 0; + mean_x_e = mean_y_e = 15; + mean_xy_e = mean_x2_e = 31; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + FOR( sb = swb_offset[sfb]; sb < swb_offset[sfb + 1]; sb++ ) + { + mean_x_fx = add( mean_x_fx, x ); /*Q0*/ + mean_x2_fx = L_add( mean_x2_fx, L_mult0( x, x ) ); /*Q0*/ + + /*y = 20 * (Word16) log10f( max( 1e-018f, pPowerSpectrum[sb] ) );*/ + IF( LT_32( pPowerSpectrum_fx[sb], 1 ) ) + { + y = 20 * ( -18 ); + move16(); + } + ELSE + { + y = imult1616( 20, extract_l( L_shr( Mult_32_16( ( L_add( BASOP_Util_Log2( pPowerSpectrum_fx[sb] ), L_shl( pPowerSpectrum_e[sb], Q25 ) ) ), INV_Log2_10_Q15 ), 25 ) ) ); /*Q0*/ + } + mean_y_fx = add( mean_y_fx, y ); /*Q0*/ + mean_xy_fx = L_add( mean_xy_fx, L_mult0( y, x ) ); /*Q0*/ + + x = add( x, 1 ); + } + mean_y_fx = BASOP_Util_Divide1616_Scale( mean_y_fx, width, &tmp_e ); /* resultant exp stores in mean_y_e*/ + mean_y_e = add( mean_y_e, sub( tmp_e, 15 ) ); + mean_x_fx = BASOP_Util_Divide1616_Scale( mean_x_fx, width, &tmp_e ); /* resultant exp stores in mean_x_e*/ + mean_x_e = add( mean_x_e, sub( tmp_e, 15 ) ); + mean_xy_fx = BASOP_Util_Divide3216_Scale( mean_xy_fx, width, &tmp_e ); /* resultant exp stores in mean_xy_e*/ + mean_xy_e = add( mean_xy_e, sub( tmp_e, 15 ) ); + mean_x2_fx = BASOP_Util_Divide3216_Scale( mean_x2_fx, width, &tmp_e ); /* resultant exp stores in mean_x2_e*/ + mean_x2_e = add( mean_x2_e, sub( tmp_e, 15 ) ); + + /*slope = ( mean_xy - mean_x * mean_y ) / ( mean_x2 - mean_x * mean_x );*/ + slope_fx = BASOP_Util_Divide3232_Scale( ( L_sub( mean_xy_fx, L_shl( mult( mean_x_fx, mean_y_fx ), sub( add( mean_x_e, mean_y_e ), mean_xy_e ) ) ) ), ( L_sub( mean_x2_fx, L_shl( mult( mean_x_fx, mean_x_fx ), sub( add( mean_x_e, mean_x_e ), mean_x2_e ) ) ) ), &slope_e ); + slope_e = add( slope_e, sub( mean_xy_e, mean_x2_e ) ); /*stores resultant exponent for slope_fx*/ + + /* determine whether strong tilt is due to a step in the spectrum (e.g. band limitation, no damping) + or a tonal component close the band border (apply damping) by calculating SFM for a shift of 1/2 SFB width*/ + threshold_fx = BASOP_Util_Divide1616_Scale( 60, width, &threshold_e ); /*stores resultant exponent for threshold_fx*/ + test(); + IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope_fx, add( slope_e, 16 ), negate( threshold_fx ), add( threshold_e, 16 ) ), -1 ) ) + { + Word16 shift = shr( width, 1 ); + // shiftedSFM = IGF_getSFM_ivas( pPowerSpectrum, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift ) / IGF_getCrest_ivas( pPowerSpectrum, swb_offset[sfb] - shift, swb_offset[sfb + 1] - shift ); + sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, sub( swb_offset[sfb], shift ), sub( swb_offset[sfb + 1], shift ) ); + crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, sub( swb_offset[sfb], shift ), sub( swb_offset[sfb + 1], shift ) ); + shiftedSFM_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); + } + ELSE IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( slope_fx, add( slope_e, 16 ), threshold_fx, add( threshold_e, 16 ) ), 1 ) && ( NE_16( sfb, sub( hGrid->sfbWrap[hGrid->nTiles], 1 ) ) ) ) + { + Word16 shift; + shift = shr( width, 1 ); + // shiftedSFM = IGF_getSFM_ivas( pPowerSpectrum, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift ) / IGF_getCrest_ivas( pPowerSpectrum, swb_offset[sfb] + shift, swb_offset[sfb + 1] + shift ); + sfm = IGF_getSFM_ivas_fx( &sfm_exp, pPowerSpectrum_fx, pPowerSpectrum_e, add( swb_offset[sfb], shift ), add( swb_offset[sfb + 1], shift ) ); + crest = IGF_getCrest_ivas( &crest_exp, pPowerSpectrum_fx, pPowerSpectrum_e, add( swb_offset[sfb], shift ), add( swb_offset[sfb + 1], shift ) ); + shiftedSFM_fx = BASOP_Util_Divide1616_Scale( sfm, crest, &shiftedSFM_e ); + } + IF( shiftedSFM_fx ) + { + shiftedSFM_e = add( shiftedSFM_e, sub( sfm_exp, crest_exp ) ); /* stores resultant exponent for shiftedSFM_fx*/ + } + + // alpha = min( 320.f / (float) swb_offset[sfb + 1], 1.25f ); + temp = BASOP_Util_Divide1616_Scale( 320, swb_offset[sfb + 1], &alpha_e ); + alpha_fx = extract_l( L_min( temp, L_shl( 20480 /*1.25 Q14*/, sub( 1, alpha_e ) ) ) ); /* exponent is alpha_e*/ + temp = BASOP_Util_Divide1616_Scale( hPrivateData->SFM_tb_fx[sfb], hPrivateData->SFM_sb_fx[sfb], &tmp_e ); + tmp_e = add( tmp_e, sub( hPrivateData->sfb_tb_e[sfb], hPrivateData->sfb_sb_e[sfb] ) ); /* stores resultant exponent for temp */ + + // currDampingFactor = expf( alpha * logf( hPrivateData->SFM_tb[sfb] / hPrivateData->SFM_sb[sfb] ) ); + currDampingFactor_fx = round_fx( BASOP_util_Pow2( Mpy_32_16_1( L_add( BASOP_Util_Log2( temp ), L_shl( add( 16, tmp_e ), 25 ) ), alpha_fx ), add( alpha_e, 6 ), &currDampingFactor_e ) ); /*exp is currDampingFactor_e*/ + + IF( GT_32( shiftedSFM_fx, L_shl( 1311 /*0.04f Q15*/, negate( shiftedSFM_e ) ) ) ) + { + currDampingFactor_fx = 32767; /*1.f Q15*/ + currDampingFactor_e = 0; + move16(); + move16(); + } + test(); + test(); + IF( last_core_acelp || hPrivateData->wasTransient || EQ_32( hPrivateData->prevDampingFactor_IIR_fx[sfb], L_shl( -1, sub( 15, hPrivateData->prevDampingFactor_IIR_e[sfb] ) ) ) ) + { + tmp = BASOP_Util_Cmp_Mant32Exp( currDampingFactor_fx, currDampingFactor_e, 3277, 0 ); + IF( tmp >= 0 ) + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = currDampingFactor_fx; + hPrivateData->prevDampingFactor_IIR_e[sfb] = currDampingFactor_e; + } + ELSE + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = 3277; /* 0.1 in Q15 */ + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + } + + move16(); + move16(); + } + + { + Word32 tonalToNoise; + Word16 adap; + Word16 adap_e; /*stores exp for adap*/ + Word16 tonalToNoise_e; /*stores exponent for tonalToNoise*/ + tonalToNoise_e = 9; /*stores exponent for tonalToNoise*/ + move16(); + adap = BASOP_Util_Divide1616_Scale( width, 30, &adap_e ); + tonalToNoise = IGF_getTNR_ivas_fx( pPowerSpectrum_fx, swb_offset[sfb], swb_offset[sfb + 1], adap, pPowerSpectrum_e, adap_e ); /*Q22*/ + IF( EQ_16( BASOP_Util_Cmp_Mant32Exp( tonalToNoise, tonalToNoise_e, L_add( L_shl( 10, sub( 15, adap_e ) ), adap ), add( 16, adap_e ) ), -1 ) ) + { + // currDampingFactor += 0.1f * ( ( 10 + adap ) - tonalToNoise ); + Word32 temp2 = BASOP_Util_Add_Mant32Exp( L_add( L_shl( 10, sub( 15, adap_e ) ) /*exp:adap_e*/, adap ), add( adap_e, 16 ), L_negate( tonalToNoise ), tonalToNoise_e, &tmp_e ); /* resultant exp is tmp_e*/ + currDampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor_fx, currDampingFactor_e, extract_l( Mult_32_16( temp2, 3277 /*0.1f Q15*/ ) ), tmp_e, &currDampingFactor_fx ); /*stores resultant exp for currDampingFactor_fx*/ + } + } + + dampingFactor_e = BASOP_Util_Add_MantExp( currDampingFactor_fx, currDampingFactor_e, hPrivateData->prevDampingFactor_IIR_fx[sfb], hPrivateData->prevDampingFactor_IIR_e[sfb], &dampingFactor_fx ); + dampingFactor_fx = shr( dampingFactor_fx, 1 ); /* resultant exponent is dampingFactor_e*/ + IF( NE_16( BASOP_Util_Cmp_Mant32Exp( dampingFactor_fx, add( dampingFactor_e, 16 ), shr( hPrivateData->prevDampingFactor_IIR_fx[sfb], 1 ), add( hPrivateData->prevDampingFactor_IIR_e[sfb], 16 ) ), -1 ) ) + { + // do nothing + } + ELSE + { + dampingFactor_fx = shr( hPrivateData->prevDampingFactor_IIR_fx[sfb], 1 ); /* resultant exponent is hPrivateData->prevDampingFactor_IIR_e[sfb]*/ + dampingFactor_e = hPrivateData->prevDampingFactor_IIR_e[sfb]; + move16(); + } + IF( dampingFactor_e < 0 ) + { + dampingFactor_fx = shl( dampingFactor_fx, dampingFactor_e ); + dampingFactor_e = 0; + move16(); + } + gain_fx = Mult_32_16( gain_fx, shl_sat( extract_l( L_min( L_add( dampingFactor_fx, Mult_32_16( L_shl( hPrivateData->dampingFactorSmoothing[sfb], sub( 15, dampingFactor_e ) ) /*Q:15-dampingFactor_e*/, 3277 /*0.1f Q15*/ ) /*Q:15-dampingFactor_e*/ ), shl_sat( 1, sub( 15, dampingFactor_e ) ) ) ), dampingFactor_e ) /*Q15*/ ); + + hPrivateData->prevDampingFactor_IIR_fx[sfb] = dampingFactor_fx; + hPrivateData->prevDampingFactor_IIR_e[sfb] = dampingFactor_e; + move16(); + move16(); + if ( hPrivateData->dampingFactorSmoothing[sfb] > 0 ) + { + hPrivateData->dampingFactorSmoothing[sfb] = sub( hPrivateData->dampingFactorSmoothing[sfb], 1 ); + move16(); + } + } + ELSE + { + hPrivateData->prevDampingFactor_IIR_fx[sfb] = -( 1 << 15 ); /* resultant exp which is 0 stores in hPrivateData->prevDampingFactor_IIR_e[sfb]*/ + hPrivateData->prevDampingFactor_IIR_e[sfb] = 0; + hPrivateData->dampingFactorSmoothing[sfb] = 1; + move16(); + move16(); + move16(); + } + + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = tmp_tb_fx; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = hPrivateData->SFM_tb_fx[sfb]; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = tmp_sb_fx; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = hPrivateData->SFM_sb_fx[sfb]; + hPrivateData->prevSFB_FIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; + hPrivateData->prevSFB_IIR_TB_e[sfb] = hPrivateData->sfb_tb_e[sfb]; + hPrivateData->prevSFB_FIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; + hPrivateData->prevSFB_IIR_SB_e[sfb] = hPrivateData->sfb_sb_e[sfb]; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + ELSE + { + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; + hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; + hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; + hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; + hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; + + hPrivateData->dampingFactorSmoothing[sfb] = 2; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + } + ELSE + { + tmp_e = pMDCTSpectrum_e; + sfbEnergyR_fx = add_sat( EPSILON_FX, BASOP_Util_Divide3216_Scale( sum2_32_fx( pMDCTSpectrum_fx + swb_offset[sfb], width, &tmp_e ) /*exp: tmp_e*/, width, &sfbEnergyR_e ) ); + sfbEnergyR_e = add( sfbEnergyR_e, add( tmp_e, -15 ) ); /* stores resultant exponent for sfbEnergyR_fx*/ + gain_fx = sfbEnergyR_fx; /*resultant exponent stored in gain_e=sfbEnergyR_e*/ + move32(); + gain_e = add( sfbEnergyR_e, 16 ); /* because gain_fx is word32;only after adding 16 q of gain_fx is 15-sfbEnergyR_e*/ + + hPrivateData->prevSFM_FIR_SFB_TB_fx[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_TB_fx[sfb] = 0; + hPrivateData->prevSFM_FIR_SFB_SB_fx[sfb] = 0; + hPrivateData->prevSFM_IIR_SFB_SB_fx[sfb] = 0; + hPrivateData->prevSFB_FIR_TB_e[sfb] = 0; + hPrivateData->prevSFB_IIR_TB_e[sfb] = 0; + hPrivateData->prevSFB_FIR_SB_e[sfb] = 0; + hPrivateData->prevSFB_IIR_SB_e[sfb] = 0; + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + move16(); + } + /*gain=0.5f+log2f(gain)*2+16 becuase 2.885390081777927f=2*1/loge(2) so 2*1/loge(2)*loge(x) can be written as 2*log2(x)*/ + gain_fx = L_add( ONE_IN_Q22, L_add( L_add( L_shr( BASOP_Util_Log2( gain_fx ), 1 ), L_shl( gain_e, Q24 ) ), L_shl( 16, Q23 ) ) ); /*Q23*/ + test(); + test(); + if ( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) + { + gain_fx = L_add( gain_fx, ONE_IN_Q21 ); /* better preservation of original HF band energy */ + } + test(); + test(); + if ( !isTransient && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_64000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_64000_CPE ) ) ) + { + gain_fx = L_add( gain_fx, ONE_IN_Q20 ); + } + gain_fx = L_min( gain_fx, 91 << Q23 ); /* 13+15+63, see arithcode encode residual */ + gain_fx = L_max( gain_fx, 0 ); + gain_e = 8; /* stores exponent for gain_fx*/ + move16(); + hPrivateData->igfScfQuantized[sfb] = (Word16) ( L_shr( gain_fx, 23 ) ); /*Q0*/ + move16(); + } + } + + return; +} + + +/*-------------------------------------------------------------------* + * IGF_WriteEnvelope() + * + * writes IGF SCF values + *-------------------------------------------------------------------*/ +/*! r: number of bits writen */ +static Word16 IGF_WriteEnvelope_ivas( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /* i : ptr to bitOffset counter */ + const Word16 igfGridIdx, /* i : igf grid index see declaration of IGF_GRID_IDX for details */ + const Word16 isIndepFlag, /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ + Word16 *igfAllZero /* i : returns 1 if all IGF scfs are zero, else 0 */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + H_IGF_GRID hGrid; + Word16 sfb; + Word16 totBitCount; + Word16 startBitCount; + + startBitCount = *pBitOffset; + totBitCount = 0; + *igfAllZero = 1; + move16(); + move16(); + move16(); + hPrivateData = &hIGFEnc->igfData; + hGrid = &hPrivateData->igfInfo.grid[igfGridIdx]; + + FOR( sfb = hGrid->startSfb; sfb < hGrid->stopSfb; sfb++ ) + { + IF( hPrivateData->igfScfQuantized[sfb] != 0 ) + { + *igfAllZero = 0; + move16(); + BREAK; + } + } + + IF( *igfAllZero != 0 ) + { + IGF_write_bit_fx( hBstr, pBitOffset, 1 ); + + if ( NULL == hBstr ) + { + IGFSCFEncoderSaveContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); + } + + IGFSCFEncoderReset_fx( &hPrivateData->hIGFSCFArithEnc ); + + if ( NULL == hBstr ) + { + IGFSCFEncoderRestoreContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); + } + } + ELSE + { + IGF_write_bit_fx( hBstr, pBitOffset, 0 ); + + if ( NULL == hBstr ) + { + IGFSCFEncoderSaveContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); + } + + *pBitOffset = IGFSCFEncoderEncode_ivas_fx( &hPrivateData->hIGFSCFArithEnc, hBstr, *pBitOffset, &hPrivateData->igfScfQuantized[hGrid->startSfb], igfGridIdx, isIndepFlag ); + move16(); + + if ( NULL == hBstr ) + { + IGFSCFEncoderRestoreContextState_fx( &hPrivateData->hIGFSCFArithEnc, igfGridIdx ); + } + } + totBitCount = sub( *pBitOffset, startBitCount ); + + return totBitCount; +} + + +/*-------------------------------------------------------------------* + * IGF_Whitening() + * + * calculates the IGF whitening levels by SFM and crest + *-------------------------------------------------------------------*/ + +static void IGF_Whitening_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : | instance handle of IGF Encoder */ + Word32 *powerSpectrum, /* i : Q31 | MDCT/MDST power spectrum */ + Word16 *powerSpectrum_e, /* i : Q31 | MDCT/MDST power spectrum */ + const Word16 igfGridIdx, /* i : Q0 | IGF grid index */ + const Word16 isTransient, /* i : Q0 | flag indicating if transient is detected */ + const Word16 last_core_acelp, /* i : Q0 | indicator if last frame was ACELP core */ + const Word16 isTNSActive, /* i : Q0 | indicator if TNS is active */ + const Word16 sp_aud_decision0, /* i : Q0 | first stage classifier decision */ + const Word32 brate, /* i : Q0 | bitrate */ + const Word16 element_mode /* i : Q0 | element mode */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + H_IGF_GRID hGrid; + Word16 p; /*Q0*/ + Word16 tmp; + Word16 tmp_e; + Word16 SFM_src; + Word16 SFM_tar; + Word16 SFM_src_e; + Word16 SFM_tar_e; + Word16 num_Tiles; + Word16 SFM; + Word16 crest_e; + + SFM = -ONE_IN_Q13; /*1.0f Q13*/ + move16(); + + hPrivateData = &hIGFEnc->igfData; + hGrid = &hPrivateData->igfInfo.grid[(Word16) igfGridIdx]; + + IF( NE_16( igfGridIdx, IGF_GRID_LB_NORM ) ) + { + FOR( p = 0; p < hGrid->nTiles; p++ ) + { + /* reset filter */ + hPrivateData->prevSFM_FIR[p] = L_deposit_l( 0 ); + hPrivateData->prevSFM_IIR[p] = 0; + move16(); + + /* preset values: */ + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; + move16(); + } + } + + FOR( p = 0; p < IGF_MAX_TILES; p++ ) + { + /* update prev data: */ + hPrivateData->igfPrevWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p]; + /* preset values: */ + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; + move16(); + move16(); + } + + test(); + IF( !( isTransient || hPrivateData->wasTransient ) ) + { + IF( powerSpectrum ) + { + FOR( p = 0; p < hGrid->nTiles; p++ ) + { + Word16 sb; + + IF( isTNSActive ) + { + FOR( sb = hGrid->tile[p]; sb < hGrid->tile[p + 1]; sb++ ) + { + IF( LT_32( powerSpectrum[sb], 1 ) ) + hPrivateData->logSpec[sb] = 0; /* max(0,FLT_MIN_EXP )*/ + ELSE + hPrivateData->logSpec[sb] = extract_l( L_max( 0, L_shr( L_add( BASOP_Util_Log2( powerSpectrum[sb] ), L_shl( powerSpectrum_e[sb], Q25 ) ), Q25 ) ) ); + move16(); + } + } + + /* if current tile contains only a single SFB, reuse already computed SFM values */ + test(); + IF( element_mode > EVS_MONO && EQ_16( sub( hGrid->sfbWrap[p + 1], hGrid->sfbWrap[p] ), 1 ) ) + { + tmp = hPrivateData->SFM_tb_fx[p]; + tmp_e = hPrivateData->sfb_tb_e[p]; + move16(); + move16(); + } + ELSE + { + tmp = BASOP_Util_Divide1616_Scale( IGF_getSFM_new_fx( powerSpectrum, hPrivateData->logSpec, hGrid->tile[p], hGrid->tile[p + 1], powerSpectrum_e ), IGF_getCrest_new_fx( hPrivateData->logSpec, hGrid->tile[p], hGrid->tile[p + 1], &crest_e ), &tmp_e ); + tmp_e = sub( tmp_e, crest_e ); + } + + test(); + IF( last_core_acelp || hPrivateData->wasTransient ) + { + hPrivateData->prevSFM_FIR[p] = L_shl( tmp, add( 1, tmp_e ) ); /*16-(15-exp)=>15Q16*/ + hPrivateData->prevSFM_IIR[p] = shl( tmp, sub( tmp_e, 2 ) ); /*13-(15-exp)=>2Q13*/ + move32(); + move16(); + } + + test(); + IF( LE_32( brate, IVAS_48k ) && EQ_16( element_mode, IVAS_CPE_MDCT ) ) + { + Word16 temp; + num_Tiles = 0; + SFM_src = 0; + SFM_tar = 0; + SFM_src_e = 0; + SFM_tar_e = 0; + move16(); + move16(); + move16(); + move16(); + move16(); + + FOR( sb = hGrid->sfbWrap[p]; sb < hGrid->sfbWrap[p + 1]; sb++ ) + { + num_Tiles = add( num_Tiles, 1 ); + SFM_src_e = BASOP_Util_Add_MantExp( hPrivateData->SFM_sb_fx[sb], hPrivateData->sfb_sb_e[sb], SFM_src, SFM_src_e, &SFM_src ); + SFM_tar_e = BASOP_Util_Add_MantExp( hPrivateData->SFM_tb_fx[sb], hPrivateData->sfb_tb_e[sb], SFM_tar, SFM_tar_e, &SFM_tar ); + } + + /* compute the average */ + SFM_src = shr( BASOP_Util_Divide1616_Scale( SFM_src, num_Tiles, &temp ), 2 ); + SFM_src_e = add( SFM_src_e, sub( temp, 13 ) ); /*temp-15+2:because right shifted by 2 which are the guard bits*/ + SFM_tar = shr( BASOP_Util_Divide1616_Scale( SFM_tar, num_Tiles, &temp ), 2 ); + SFM_tar_e = add( SFM_tar_e, sub( temp, 13 ) ); /*temp-15+2:because right shifted by 2 which are the guard bits*/ + + IF( LT_16( SFM_tar_e, SFM_src_e ) ) + { + SFM_tar = shl( SFM_tar, sub( SFM_tar_e, SFM_src_e ) ); /*making the q for SFM_tar and SFM_src equal with 2 as guard bits*/ + SFM_tar_e = SFM_src_e; + } + ELSE + { + SFM_src = shr( SFM_src, sub( SFM_tar_e, SFM_src_e ) ); /*making the q for SFM_tar and SFM_src equal with 2 as guard bits*/ + SFM_src_e = SFM_tar_e; + } + move16(); + + test(); + test(); + IF( ( p > 0 ) && ( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) ) + { + test(); + if ( EQ_16( p, 1 ) && EQ_16( abs_s( sub( hPrivateData->igfCurrWhiteningLevel[0], hPrivateData->igfCurrWhiteningLevel[1] ) ), 2 ) ) /* OFF vs. STRONG */ + { + hPrivateData->igfCurrWhiteningLevel[0] = IGF_WHITENING_MID; + move16(); + } + hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p - 1]; + move16(); + } + ELSE IF( sp_aud_decision0 ) + { + /* Music */ + /* whitening Off: when tonality of target is more than source or tonality of target is close to that of source */ + test(); + if ( LE_16( SFM_tar, SFM_src ) || LE_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; + move16(); + } + + /* whitening mid: */ + test(); + if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) && LE_32( SFM_tar, L_add( SFM_src, L_shl( 5, sub( 13, SFM_src_e ) ) /*1.25 with exponent SFM_src_e*/ ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; + move16(); + } + + /* whitening strong */ + if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 5, sub( 13, SFM_src_e ) ) /*1.25 with exponent SFM_src_e*/ ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; + move16(); + } + } + ELSE + { + /* Speech */ + /* whitening Off: when tonality of target is more than source or tonality of target is close to that of source */ + test(); + if ( LE_16( SFM_tar, SFM_src ) || LE_32( SFM_tar, L_add( SFM_src, L_shr( 3277 /*0.1 Q15*/, SFM_src_e ) ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; + move16(); + } + + /* whitening mid: */ + test(); + if ( GT_32( SFM_tar, L_add( SFM_src, L_shr( 3277 /*0.1 Q15*/, SFM_src_e ) ) ) && LE_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; + move16(); + } + + /* whitening strong */ + if ( GT_32( SFM_tar, L_add( SFM_src, L_shl( 1, sub( 14, SFM_src_e /*0.5 with exponent SFM_src_e*/ ) ) ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; + move16(); + } + } + + SFM = shl( SFM_tar, sub( SFM_tar_e, 2 ) ); /*2Q13*/ + } + ELSE + { + test(); + IF( element_mode > EVS_MONO && EQ_16( sub( hGrid->sfbWrap[p + 1], hGrid->sfbWrap[p] ), 1 ) ) + { + SFM = shl( tmp, sub( tmp_e, 2 ) ); /*2Q13*/ + } + ELSE + { + Word32 temp; + temp = L_add( L_shl( tmp, sub( tmp_e, 2 ) ), L_add( L_shr( hPrivateData->prevSFM_FIR[p], 3 ), L_shr( hPrivateData->prevSFM_IIR[p], 1 ) ) ); + SFM = extract_l( L_min( 22118 /*2.7*/, temp ) ); /*2Q13*/ + } + hPrivateData->prevSFM_FIR[p] = L_shl( tmp, add( 1, tmp_e ) ); /*15Q16*/ + hPrivateData->prevSFM_IIR[p] = SFM; + move32(); + move16(); + + IF( GT_16( SFM, hGrid->whiteningThreshold[1][p] ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_STRONG; + move16(); + } + ELSE IF( GT_16( SFM, hGrid->whiteningThreshold[0][p] ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; + move16(); + } + ELSE + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_OFF; + move16(); + } + } + + IF( element_mode > EVS_MONO ) + { + IF( last_core_acelp ) /* reset */ + { + set16_fx( hPrivateData->igfPastSFM_fx[p], -ONE_IN_Q13, IGF_PAST_SFM_LEN ); + hPrivateData->igfWhiteningHangoverCnt[p] = 2; + move16(); + } + ELSE + { + test(); + test(); + test(); + test(); + /* check whether change in whitening level should be allowed or not (if SFM is inside a certain margin around thresholds) */ + IF( NE_16( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ) && + ( ( GT_32( SFM, L_sub( hGrid->whiteningThreshold[0][p], 1229 /*0.15f Q13*/ ) ) && LT_32( SFM, L_add( hGrid->whiteningThreshold[0][p], 1229 ) ) ) || + ( GT_32( SFM, L_sub( hGrid->whiteningThreshold[1][p], 1229 ) ) && LT_32( SFM, L_add( hGrid->whiteningThreshold[1][p], 1229 ) ) ) ) ) + { + Word16 mean_past_SFM; + Word16 mean_past_SFM_e; + Word16 countable; + Word16 i; + mean_past_SFM = 0; + mean_past_SFM_e = 0; + countable = 0; + move16(); + move16(); + move16(); + + /* compute mean of last (available) SFM values */ + FOR( i = 0; i < IGF_PAST_SFM_LEN; i++ ) + { + IF( hPrivateData->igfPastSFM_fx[p][i] >= 0 ) + { + mean_past_SFM_e = BASOP_Util_Add_MantExp( mean_past_SFM, mean_past_SFM_e, hPrivateData->igfPastSFM_fx[p][i], 2, &mean_past_SFM ); + countable = add( countable, 1 ); + } + } + IF( countable ) + { + Word16 temp; + mean_past_SFM = BASOP_Util_Divide1616_Scale( mean_past_SFM, countable, &temp ); + mean_past_SFM_e = add( mean_past_SFM_e, sub( temp, 15 ) ); + mean_past_SFM = shl( mean_past_SFM, sub( mean_past_SFM_e, 2 ) ); /*mean_past_SFM_e=2*/ + /* deny change in whitening level for small deviations from mean SFM */ + if ( LT_16( abs_s( sub( SFM, mean_past_SFM ) ), 1638 ) /*0.2 in Q13*/ ) + { + hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfPrevWhiteningLevel[p]; + move16(); + } + } + } + } + + hPrivateData->igfPastSFM_fx[p][hPrivateData->igfPastSFM_pos] = SFM; /*2Q13*/ + move16(); + } + } + + SWITCH( hPrivateData->igfInfo.bitRateIndex ) + { + case IGF_BITRATE_WB_9600: + case IGF_BITRATE_RF_WB_13200: + case IGF_BITRATE_WB_13200_CPE: + case IGF_BITRATE_WB_16400_CPE: + case IGF_BITRATE_RF_SWB_13200: + case IGF_BITRATE_SWB_9600: + case IGF_BITRATE_SWB_13200_CPE: + case IGF_BITRATE_SWB_16400: + case IGF_BITRATE_SWB_24400: + case IGF_BITRATE_SWB_24400_CPE: + case IGF_BITRATE_SWB_32000_CPE: + case IGF_BITRATE_SWB_32000: + case IGF_BITRATE_FB_16400: + case IGF_BITRATE_FB_24400: + case IGF_BITRATE_FB_24400_CPE: + case IGF_BITRATE_FB_32000_CPE: + case IGF_BITRATE_FB_32000: + hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 1] = hPrivateData->igfCurrWhiteningLevel[hGrid->nTiles - 2]; + move16(); + break; + default: + break; + } + } + ELSE + { + FOR( p = 0; p < hGrid->nTiles; p++ ) + { + hPrivateData->igfCurrWhiteningLevel[p] = IGF_WHITENING_MID; + move16(); + } + } + } + ELSE + { + /* reset filter */ + FOR( p = 0; p < IGF_MAX_TILES; p++ ) + { + hPrivateData->prevSFM_FIR[p] = L_deposit_l( 0 ); + hPrivateData->prevSFM_IIR[p] = 0; + move32(); + move16(); + } + } + + IF( element_mode > EVS_MONO ) + { + IF( EQ_16( SFM, -ONE_IN_Q13 /*1.0f 2Q13*/ ) ) /* reset */ + { + FOR( p = 0; p < hGrid->nTiles; p++ ) + { + set16_fx( hPrivateData->igfPastSFM_fx[p], -ONE_IN_Q13, IGF_PAST_SFM_LEN ); + hPrivateData->igfWhiteningHangoverCnt[p] = 2; + move16(); + } + } + + /* vibrato handling */ + FOR( p = 0; p < hGrid->nTiles; p = p + 2 ) + { + test(); + test(); + test(); + IF( ( hPrivateData->igfPrevWhiteningLevel[p] == IGF_WHITENING_OFF && hPrivateData->igfCurrWhiteningLevel[p] != IGF_WHITENING_OFF ) || + ( hPrivateData->igfPrevWhiteningLevel[p + 1] == IGF_WHITENING_OFF && hPrivateData->igfCurrWhiteningLevel[p + 1] != IGF_WHITENING_OFF ) ) + { + Word16 i; + Word16 pastSfm_a[4], pastSfm_b[4]; + Word16 pastSfmDiffSum_a, pastSfmDiffSum_b; + + FOR( i = 0; i < 4; i++ ) + { + pastSfm_a[i] = hPrivateData->igfPastSFM_fx[p][add( hPrivateData->igfPastSFM_pos, sub( 4, i ) ) % IGF_PAST_SFM_LEN]; + pastSfm_b[i] = hPrivateData->igfPastSFM_fx[p + 1][add( hPrivateData->igfPastSFM_pos, sub( 4, i ) ) % IGF_PAST_SFM_LEN]; + move16(); + move16(); + } + pastSfmDiffSum_a = pastSfmDiffSum_b = 0; + move16(); + move16(); + FOR( i = 0; i < 3; i++ ) + { + IF( NE_16( pastSfm_a[i + 1], -ONE_IN_Q13 ) ) + { + pastSfmDiffSum_a = add( pastSfmDiffSum_a, sub( pastSfm_a[i], pastSfm_a[i + 1] ) ); + pastSfmDiffSum_b = add( pastSfmDiffSum_b, sub( pastSfm_b[i], pastSfm_b[i + 1] ) ); + } + ELSE + { + break; + } + } + test(); + test(); + test(); + test(); + /* if tonality oscillates between two tiles, turn whitening off in both */ + IF( ( ( pastSfmDiffSum_a > 0 && pastSfmDiffSum_b < 0 ) || + ( pastSfmDiffSum_a < 0 && pastSfmDiffSum_b > 0 ) ) && + ( GT_32( L_abs( L_sub( pastSfmDiffSum_a, pastSfmDiffSum_b ) ), ONE_IN_Q12 /* 0.5 in Q13 */ ) ) ) + { + hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfCurrWhiteningLevel[p + 1] = IGF_WHITENING_OFF; + move16(); + move16(); + } + } + } + + /* hangover */ + FOR( p = 0; p < hGrid->nTiles; p++ ) + { + IF( NE_16( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ) ) + { + hPrivateData->igfWhiteningHangoverCnt[p] = add( hPrivateData->igfWhiteningHangoverCnt[p], 1 ); + IF( EQ_16( hPrivateData->igfWhiteningHangoverCnt[p], 3 ) ) + { + hPrivateData->igfWhiteningHangoverCnt[p] = 0; + } + ELSE + { + hPrivateData->igfCurrWhiteningLevel[p] = hPrivateData->igfPrevWhiteningLevel[p]; + } + move16(); + move16(); + } + ELSE + { + hPrivateData->igfWhiteningHangoverCnt[p] = 0; + move16(); + } + } + + hPrivateData->igfPastSFM_pos = add( hPrivateData->igfPastSFM_pos, 1 ) % IGF_PAST_SFM_LEN; + move16(); + } + + hPrivateData->wasTransient = isTransient; + move16(); + + return; +} + + +/*-------------------------------------------------------------------* + * IGF_WriteWhiteningTile_fx() + * + * write whitening levels into bitstream + *-------------------------------------------------------------------*/ + +/*! r: number of bits written */ +static Word16 IGF_WriteWhiteningTile_ivas_fx( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ + Word16 whiteningLevel /**< in: Q0 | whitening levels to write */ +) +{ + Word16 totBitCount; + Word16 startBitCount; + + totBitCount = 0; + startBitCount = *pBitOffset; + move16(); + move16(); + + IF( EQ_32( whiteningLevel, IGF_WHITENING_MID ) ) + { + IGF_write_bits( hBstr, pBitOffset, 0, 1 ); + } + ELSE + { + IGF_write_bits( hBstr, pBitOffset, 1, 1 ); + IF( whiteningLevel == IGF_WHITENING_OFF ) + { + IGF_write_bits( hBstr, pBitOffset, 0, 1 ); + } + ELSE + { + IGF_write_bits( hBstr, pBitOffset, 1, 1 ); + } + } + totBitCount = sub( *pBitOffset, startBitCount ); + + return totBitCount; +} + + +/*-------------------------------------------------------------------* + * IGF_WriteWhiteningLevels_fx() + * + * writes the whitening levels + *-------------------------------------------------------------------*/ + +/**< out: Q0 | total number of bits written */ +static Word16 IGF_WriteWhiteningLevels_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF encoder */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /**< in: | ptr to bitOffset counter */ + const Word16 igfGridIdx, /**< in: Q0 | igf grid index see declaration of IGF_GRID_IDX for details */ + const Word16 isIndepFlag /**< in: Q0 | if 1 frame is independent, 0 = frame is coded with data from previous frame */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + H_IGF_GRID hGrid; + Word16 p; + Word16 nTiles; + Word16 isSame; + Word32 tmp32; + Word16 totBitCount; + Word16 startBitCount; + + totBitCount = 0; + move16(); + isSame = 1; + move16(); + startBitCount = *pBitOffset; + move16(); + hPrivateData = &hInstance->igfData; + hGrid = &hPrivateData->igfInfo.grid[igfGridIdx]; + nTiles = hGrid->nTiles; + move16(); + + IF( isIndepFlag ) + { + isSame = 0; + move16(); + } + ELSE + { + p = 0; + move16(); + tmp32 = 0; + move32(); + test(); + WHILE( ( LT_16( p, nTiles ) ) && ( tmp32 == 0 ) ) + { + test(); + tmp32 = L_sub( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfPrevWhiteningLevel[p] ); + if ( tmp32 != 0 ) + { + isSame = 0; + move16(); + } + p++; + } + } + IF( isSame ) + { + IGF_write_bits( hBstr, pBitOffset, 1, 1 ); + } + ELSE + { + IF( !isIndepFlag ) + { + IGF_write_bits( hBstr, pBitOffset, 0, 1 ); + } + IGF_WriteWhiteningTile_ivas_fx( hBstr, pBitOffset, hPrivateData->igfCurrWhiteningLevel[0] ); + p = 1; + move16(); + tmp32 = 0; + move32(); + test(); + IF( EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) || EQ_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) + { + isSame = 1; + move16(); + } + ELSE + { + if ( LT_16( p, nTiles ) ) + { + isSame = 1; + move16(); + } + test(); + WHILE( ( LT_16( p, nTiles ) ) && ( tmp32 == 0 ) ) + { + test(); + tmp32 = L_sub( hPrivateData->igfCurrWhiteningLevel[p], hPrivateData->igfCurrWhiteningLevel[p - 1] ); + if ( tmp32 != 0 ) + { + isSame = 0; + move16(); + } + p++; + } + } + test(); + IF( !isSame ) + { + IGF_write_bits( hBstr, pBitOffset, 1, 1 ); + FOR( p = 1; p < nTiles; p++ ) + { + IGF_WriteWhiteningTile_ivas_fx( hBstr, pBitOffset, hPrivateData->igfCurrWhiteningLevel[p] ); + } + } + ELSE IF( NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_SWB_48000_CPE ) && NE_16( hPrivateData->igfInfo.bitRateIndex, IGF_BITRATE_FB_48000_CPE ) ) + { + IGF_write_bits( hBstr, pBitOffset, 0, 1 ); + } + } + + totBitCount = sub( *pBitOffset, startBitCount ); + + return totBitCount; +} + + +/*-------------------------------------------------------------------* + * IGF_WriteFlatteningTrigger_fx() + * + * write flattening trigger + *-------------------------------------------------------------------*/ + +/*! r: number of bits written */ +static Word16 IGF_WriteFlatteningTrigger_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset /**< in: | ptr to bitOffset counter */ +) +{ + Word16 flatteningTrigger; + + Word16 totBitCount; + Word16 startBitCount; + totBitCount = 0; + startBitCount = *pBitOffset; + flatteningTrigger = hInstance->flatteningTrigger; + move16(); + move16(); + move16(); + + IGF_write_bits( hBstr, pBitOffset, flatteningTrigger, 1 ); + totBitCount = sub( *pBitOffset, startBitCount ); + + return totBitCount; +} + + +/*-------------------------------------------------------------------* + * IGFEncWriteBitstream() + * + * IGF bitstream writer + *-------------------------------------------------------------------*/ + +/*! r: number of bits written per frame */ +Word16 IGFEncWriteBitstream_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i : instance handle of IGF Encoder */ + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + Word16 *pBitOffset, /* i : ptr to bitOffset counter */ + const Word16 igfGridIdx, /* i : igf grid index see declaration of IGF_GRID_IDX for details */ + const Word16 isIndepFlag /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ +) +{ + Word16 igfAllZero; + Word16 startBitCount; + + startBitCount = *pBitOffset; + move16(); + hIGFEnc->infoTotalBitsPerFrameWritten = 0; + move16(); + + if ( isIndepFlag ) + { + hIGFEnc->infoTotalBitsWritten = 0; + move16(); + } + + IGF_WriteEnvelope_ivas( hIGFEnc, /* i: instance handle of IGF Encoder */ + hBstr, /* i: encoder state */ + pBitOffset, /* i: ptr to bitOffset counter */ + igfGridIdx, /* i: igf grid index see definition of IGF_GRID_IDX for details */ + isIndepFlag, /* i: if 1 frame is independent, 0 = frame is coded with data from previous frame */ + &igfAllZero ); /* o: *igfAllZero */ + + IGF_WriteWhiteningLevels_ivas_fx( hIGFEnc, /* i: instance handle of IGF Encoder */ + hBstr, /* i: encoder state */ + pBitOffset, /* i: ptr to bitOffset counter */ + igfGridIdx, /* i: igf grid index see definition of IGF_GRID_IDX for details */ + isIndepFlag ); /* i: if 1 frame is independent, 0 = frame is coded with data from previous frame */ + + IGF_WriteFlatteningTrigger_ivas_fx( hIGFEnc, /* i: instance handle of IGF Encoder */ + hBstr, /* i: encoder state */ + pBitOffset ); /* i: ptr to bitOffset counter */ + + hIGFEnc->infoTotalBitsPerFrameWritten = sub( *pBitOffset, startBitCount ); + hIGFEnc->infoTotalBitsWritten = add( hIGFEnc->infoTotalBitsWritten, hIGFEnc->infoTotalBitsPerFrameWritten ); + move16(); + move16(); + + return hIGFEnc->infoTotalBitsPerFrameWritten; +} + + +/*-------------------------------------------------------------------* + * IGFEncSetMode() + * + * sets the IGF mode according to given bitrate + *-------------------------------------------------------------------*/ + +void IGFEncSetMode_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */ + const Word32 total_brate, /* i : encoder total bitrate */ + const Word16 bwidth, /* i : encoder audio bandwidth */ + const Word16 element_mode, /* i : IVAS element mode */ + const Word16 rf_mode /* i : flag to signal the RF mode */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + Word16 i; + + hPrivateData = &hIGFEnc->igfData; + hPrivateData->igfBitstreamBits = 0; + move16(); + set16_fx( hPrivateData->igfScfQuantized, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->igfCurrWhiteningLevel, 0, IGF_MAX_TILES ); + set16_fx( hPrivateData->igfPrevWhiteningLevel, 0, IGF_MAX_TILES ); + set16_fx( hPrivateData->igfWhiteningHangoverCnt, 0, IGF_MAX_TILES ); + FOR( i = 0; i < IGF_MAX_TILES; i++ ) + { + set16_fx( hPrivateData->igfPastSFM_fx[i], -( ONE_IN_Q13 ), IGF_PAST_SFM_LEN ); + } + + hPrivateData->igfPastSFM_pos = 0; + move16(); + + FOR( i = 0; i < IGF_BITBUFSIZE / 8; i++ ) + { + hPrivateData->igfBitstream[i] = 0; + move16(); + } + hPrivateData->wasTransient = 0; + move16(); + set32_fx( hPrivateData->prevSFM_FIR, 0, IGF_MAX_TILES ); + set16_fx( hPrivateData->prevSFM_IIR, 0, IGF_MAX_TILES ); + set16_fx( hPrivateData->dampingFactorSmoothing, 2, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFM_FIR_SFB_SB_fx, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFB_FIR_TB_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFB_FIR_SB_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFM_IIR_SFB_SB_fx, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFB_IIR_SB_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFM_FIR_SFB_TB_fx, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFB_IIR_TB_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->sfb_tb_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->sfb_sb_e, 15, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevSFM_IIR_SFB_TB_fx, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->prevDampingFactor_IIR_fx, -( ONE_IN_Q15 ), IGF_MAX_SFB ); + set16_fx( hPrivateData->prevDampingFactor_IIR_e, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->logSpec, 0, L_FRAME_PLUS ); + set16_fx( hPrivateData->SFM_sb_fx, 0, IGF_MAX_SFB ); + set16_fx( hPrivateData->SFM_tb_fx, 0, IGF_MAX_SFB ); + + IF( IGFCommonFuncsIGFConfiguration_ivas_fx( total_brate, bwidth, element_mode, &hPrivateData->igfInfo, rf_mode ) != 0 ) + { + IGFSCFEncoderOpen_fx( &hPrivateData->hIGFSCFArithEnc, &hPrivateData->igfInfo, total_brate, bwidth, element_mode, rf_mode ); + + hIGFEnc->infoSamplingRate = hPrivateData->igfInfo.sampleRate; + move32(); + hIGFEnc->infoStartFrequency = hPrivateData->igfInfo.grid[0].startFrequency; + move16(); + hIGFEnc->infoStopFrequency = hPrivateData->igfInfo.grid[0].stopFrequency; + move16(); + hIGFEnc->infoStartLine = hPrivateData->igfInfo.grid[0].startLine; + move16(); + hIGFEnc->infoStopLine = hPrivateData->igfInfo.grid[0].stopLine; + move16(); + } + ELSE + { + /* IGF configuration failed -> error! */ + hIGFEnc->infoSamplingRate = 0; + move32(); + hIGFEnc->infoStartFrequency = -1; + move16(); + hIGFEnc->infoStopFrequency = -1; + move16(); + hIGFEnc->infoStartLine = -1; + move16(); + hIGFEnc->infoStopLine = -1; + move16(); + fprintf( stderr, "IGFEncSetMode_fx: initialization error!\n" ); + } + + /* reset remaining variables */ + hIGFEnc->infoTotalBitsWritten = 0; + move16(); + hIGFEnc->infoTotalBitsPerFrameWritten = 0; + move16(); + hIGFEnc->flatteningTrigger = 0; + move16(); + hIGFEnc->spec_be_igf_e = 0; + move16(); + hIGFEnc->tns_predictionGain = 0; + move16(); + set32_fx( hIGFEnc->spec_be_igf, 0, N_MAX_TCX - IGF_START_MN ); + + return; +} + + +/*-------------------------------------------------------------------* + * IGFEncResetTCX10BitCounter_ivas_fx() + * + * IGF reset bitstream bit counter for TCX10 modes + *-------------------------------------------------------------------*/ + +void IGFEncResetTCX10BitCounter_ivas_fx( + const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ +) +{ + IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; + + hPrivateData = &hIGFEnc->igfData; + hPrivateData->igfBitstreamBits = 0; + hIGFEnc->infoTotalBitsWritten = 0; + move16(); + move16(); + + return; +} + + +/*-------------------------------------------------------------------* + * IGFEncApplyMono() + * + * apply the IGF encoder, main encoder interface + *-------------------------------------------------------------------*/ + +void IGFEncApplyMono_ivas_fx( + Encoder_State *st, /* i : Encoder state */ + Word16 powerSpectrum_len, /* i: length of pPowerSpectrum_fx buffer */ + const Word16 igfGridIdx, /* i : IGF grid index */ + Word32 *pMDCTSpectrum_fx, /* i/o: MDCT spectrum */ + Word16 e_mdct, /* i : exponent of pMDCTspectrum */ + Word32 *pPowerSpectrum_fx, /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ + Word16 *e_ps, /* i : exponent of pPowerSpectrum */ + const Word16 isTCX20, /* i : flag indicating if the input is TCX20 or TCX10/2xTCX5 */ + const Word8 isTNSActive, /* i : flag indicating if the TNS is active */ + const Word16 sp_aud_decision0, /* i : first stage switching decision */ + const Word16 vad_hover_flag /* i : VAD hangover flag */ +) +{ + Word32 *pPowerSpectrumParameter_fx; + Word16 *pPowerSpectrumParameter_exp; + Word16 att_fx = MAX16B; + Word16 last_core_acelp; + move16(); + + Word32 common_pPowerSpectrum_fx[N_MAX + L_MDCT_OVLP_MAX]; + + set32_fx( common_pPowerSpectrum_fx, 0, N_MAX ); + + Word16 common_pPowerSpectrum_exp = MIN16B; + move16(); + IF( st->last_core == ACELP_CORE ) + { + last_core_acelp = 1; + move16(); + } + ELSE + { + last_core_acelp = 0; + move16(); + } + + test(); + IF( !isTNSActive && isTCX20 ) + { + pPowerSpectrumParameter_fx = pPowerSpectrum_fx; + pPowerSpectrumParameter_exp = e_ps; + } + ELSE + { + pPowerSpectrumParameter_fx = NULL; + pPowerSpectrumParameter_exp = NULL; + } + + IGF_UpdateInfo( st->hIGFEnc, igfGridIdx ); + + test(); + IF( EQ_16( st->element_mode, IVAS_CPE_DFT ) || EQ_16( st->element_mode, IVAS_CPE_TD ) ) + { + calculate_hangover_attenuation_gain_ivas_fx( st, &att_fx, vad_hover_flag ); + } + + IGF_CalculateEnvelope_ivas_fx( st->hIGFEnc, pMDCTSpectrum_fx, e_mdct, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, st->element_mode, att_fx ); + + IF( isTCX20 ) + { + pPowerSpectrumParameter_fx = pPowerSpectrum_fx; + pPowerSpectrumParameter_exp = e_ps; + } + ELSE + { + pPowerSpectrumParameter_fx = NULL; + pPowerSpectrumParameter_exp = NULL; + } + + IF( EQ_16( st->element_mode, IVAS_CPE_MDCT ) ) + { + IGF_Whitening_ivas_fx( st->hIGFEnc, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, isTNSActive, sp_aud_decision0, st->element_brate, st->element_mode ); + } + ELSE + { + IGF_Whitening_ivas_fx( st->hIGFEnc, pPowerSpectrumParameter_fx, pPowerSpectrumParameter_exp, igfGridIdx, st->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, isTNSActive, sp_aud_decision0, st->total_brate, st->element_mode ); + } + + IF( pPowerSpectrumParameter_fx ) + { + FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) + { + common_pPowerSpectrum_exp = s_max( common_pPowerSpectrum_exp, pPowerSpectrumParameter_exp[i] ); + } + + FOR( Word16 i = 0; i < powerSpectrum_len; i++ ) + { + common_pPowerSpectrum_fx[i] = L_shl( pPowerSpectrumParameter_fx[i], sub( pPowerSpectrumParameter_exp[i], common_pPowerSpectrum_exp ) ); + move16(); + } + pPowerSpectrumParameter_fx = common_pPowerSpectrum_fx; + } + + IGF_ErodeSpectrum_ivas_fx( st->hIGFEnc, pMDCTSpectrum_fx, pPowerSpectrumParameter_fx, common_pPowerSpectrum_exp, igfGridIdx, 0 ); + + return; +} + + +/*-------------------------------------------------------------------* + * IGFEncApplyStereo() + * + * apply the IGF encoder, main encoder interface + *-------------------------------------------------------------------*/ + +void IGFEncApplyStereo_fx( + STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT stereo encoder structure */ + Word16 ms_mask[2][MAX_SFB], /* i : bandwise MS mask */ + const IGF_ENC_INSTANCE_HANDLE hIGFEnc[CPE_CHANNELS], /* i : instance handle of IGF Encoder */ + const Word16 igfGridIdx, /* i : IGF grid index */ + Encoder_State *sts[CPE_CHANNELS], /* i : Encoder state */ + Word32 *pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: MDCT^2 + MDST^2 spectrum, or estimate */ + Word16 *exp_pPowerSpectrum_fx[CPE_CHANNELS], /* i/o: exp of pPowerSpectrum_fx */ + Word32 *pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i/o: inverse power spectrum */ + Word16 *q_pPowerSpectrumMsInv_fx[CPE_CHANNELS][NB_DIV], /* i/o: Q of pPowerSpectrumMsInv_fx */ + Word32 *inv_spectrum_fx[CPE_CHANNELS][NB_DIV], /* i : inverse spectrum */ + Word16 exp_inv_spectrum_fx[CPE_CHANNELS], /* i : exp of inverse spectrum */ + const Word16 frameno, /* i : flag indicating index of current subfr. */ + const Word16 sp_aud_decision0, /* i : sp_aud_decision0 */ + const Word32 element_brate, /* i : element bitrate */ + const Word16 mct_on ) +{ + Word32 *pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */ + Word16 *exp_pPowerSpectrumParameter_fx[NB_DIV]; /* If it is NULL it informs a function that specific handling is needed */ + Word32 *pPowerSpectrumParameterMsInv_fx[NB_DIV]; + Word16 *q_pPowerSpectrumParameterMsInv_fx[NB_DIV]; + Word16 coreMsMask[N_MAX]; + Word16 sfb, ch, last_core_acelp; + STEREO_MDCT_BAND_PARAMETERS *sfbConf; + Word32 common_pPowerSpectrum_fx[N_MAX]; + + set32_fx( common_pPowerSpectrum_fx, 0, N_MAX ); + + Word16 common_pPowerSpectrum_exp = MIN16B; + move16(); + + /* assumptions: stereo filling was already done on the flattened spectra + * IGF region is always coded M/S, never L/R (to be done in the encoder) + * for residual bands with stereo filling infoTcxNoise is set to zero + * both channels have the same IGF configuration + */ + + /* sanity checks: check if both channels have the same configuration...*/ + assert( ( sts[0]->core == sts[1]->core ) ); + + /* initialization */ + IF( EQ_16( sts[0]->core, TCX_20_CORE ) ) + { + sfbConf = &hStereoMdct->stbParamsTCX20; + } + ELSE + { + sfbConf = &hStereoMdct->stbParamsTCX10; + } + if ( sts[0]->last_core == ACELP_CORE ) + { + sfbConf = &hStereoMdct->stbParamsTCX20afterACELP; + } + + /* create line wise ms mask for the core bands */ + set16_fx( coreMsMask, 0, N_MAX ); + FOR( sfb = 0; sfb < sfbConf->sfbCnt; sfb++ ) + { + set16_fx( &coreMsMask[sfbConf->sfbOffset[sfb]], ms_mask[frameno][sfb], sub( sfbConf->sfbOffset[sfb + 1], sfbConf->sfbOffset[sfb] ) ); + } + + test(); + test(); + IF( EQ_16( sts[0]->core, TCX_20_CORE ) && !sts[0]->hTcxEnc->fUseTns[frameno] && !sts[1]->hTcxEnc->fUseTns[frameno] ) + { + pPowerSpectrumParameter_fx[0] = &pPowerSpectrum_fx[0][0]; + exp_pPowerSpectrumParameter_fx[0] = &exp_pPowerSpectrum_fx[0][0]; + pPowerSpectrumParameter_fx[1] = &pPowerSpectrum_fx[1][0]; + exp_pPowerSpectrumParameter_fx[1] = &exp_pPowerSpectrum_fx[1][0]; + pPowerSpectrumParameterMsInv_fx[0] = pPowerSpectrumMsInv_fx[0][0]; + pPowerSpectrumParameterMsInv_fx[1] = pPowerSpectrumMsInv_fx[1][0]; + q_pPowerSpectrumParameterMsInv_fx[0] = q_pPowerSpectrumMsInv_fx[0][0]; + q_pPowerSpectrumParameterMsInv_fx[1] = q_pPowerSpectrumMsInv_fx[1][0]; + } + ELSE + { + pPowerSpectrumParameter_fx[0] = NULL; + pPowerSpectrumParameter_fx[1] = NULL; + pPowerSpectrumParameterMsInv_fx[0] = NULL; + pPowerSpectrumParameterMsInv_fx[1] = NULL; + q_pPowerSpectrumParameterMsInv_fx[0] = NULL; + q_pPowerSpectrumParameterMsInv_fx[1] = NULL; + } + FOR( ch = 0; ch < CPE_CHANNELS; ch++ ) + { + last_core_acelp = extract_l( EQ_16( sts[ch]->last_core, ACELP_CORE ) ); + + IGF_UpdateInfo( hIGFEnc[ch], igfGridIdx ); + IGF_CalculateStereoEnvelope_fx( hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], sts[ch]->hTcxEnc->spectrum_e[frameno], inv_spectrum_fx[ch][frameno], + exp_inv_spectrum_fx[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrum_fx[ch], pPowerSpectrumParameterMsInv_fx[ch], + q_pPowerSpectrumParameterMsInv_fx[ch], igfGridIdx, coreMsMask, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, mct_on ); + + IF( EQ_16( sts[ch]->core, TCX_20_CORE ) ) + { + pPowerSpectrumParameter_fx[ch] = pPowerSpectrum_fx[ch]; + exp_pPowerSpectrumParameter_fx[ch] = exp_pPowerSpectrum_fx[ch]; + } + ELSE + { + pPowerSpectrumParameter_fx[ch] = NULL; + } + + IGF_Whitening_ivas_fx( hIGFEnc[ch], pPowerSpectrumParameter_fx[ch], exp_pPowerSpectrumParameter_fx[ch], igfGridIdx, sts[ch]->hTranDet->transientDetector.bIsAttackPresent, last_core_acelp, ( sts[0]->hTcxEnc->fUseTns[frameno] || sts[1]->hTcxEnc->fUseTns[frameno] ), sp_aud_decision0, element_brate, sts[ch]->element_mode ); + + IF( pPowerSpectrumParameter_fx[ch] ) + { + Word16 length = N_MAX; + move16(); + if ( mct_on ) + { + length = L_FRAME48k; + move16(); + } + FOR( Word16 i = 0; i < length; i++ ) + { + common_pPowerSpectrum_exp = s_max( common_pPowerSpectrum_exp, exp_pPowerSpectrumParameter_fx[ch][i] ); + } + + FOR( Word16 i = 0; i < length; i++ ) + { + common_pPowerSpectrum_fx[i] = L_shl( pPowerSpectrumParameter_fx[ch][i], sub( exp_pPowerSpectrumParameter_fx[ch][i], common_pPowerSpectrum_exp ) ); + move32(); + } + pPowerSpectrumParameter_fx[ch] = common_pPowerSpectrum_fx; + } + IGF_ErodeSpectrum_ivas_fx( hIGFEnc[ch], sts[ch]->hTcxEnc->spectrum_fx[frameno], pPowerSpectrumParameter_fx[ch], common_pPowerSpectrum_exp, igfGridIdx, mct_on ); + } + + return; +} + + +/*-------------------------------------------------------------------* + * IGFSaveSpectrumForITF() + * + * + *-------------------------------------------------------------------*/ + +void IGFSaveSpectrumForITF_ivas_fx( + IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i/o: instance handle of IGF Encoder */ + const Word16 igfGridIdx, /* i : IGF grid index */ + const Word32 *pITFSpectrum, /* i : MDCT spectrum */ + Word16 exp_pITFSpectrum ) +{ + IGF_UpdateInfo( hIGFEnc, igfGridIdx ); + + Copy32( pITFSpectrum + IGF_START_MN, hIGFEnc->spec_be_igf, sub( hIGFEnc->infoStopLine, IGF_START_MN ) ); + + scale_sig32( hIGFEnc->spec_be_igf, sub( hIGFEnc->infoStopLine, IGF_START_MN ), sub( exp_pITFSpectrum, s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ) ) ); + scale_sig32( hIGFEnc->spec_be_igf + sub( hIGFEnc->infoStopLine, IGF_START_MN ), sub( N_MAX_TCX - IGF_START_MN, sub( hIGFEnc->infoStopLine, IGF_START_MN ) ), sub( hIGFEnc->spec_be_igf_e, s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ) ) ); + hIGFEnc->spec_be_igf_e = s_max( exp_pITFSpectrum, hIGFEnc->spec_be_igf_e ); + move16(); + + return; +} + + +/*-------------------------------------------------------------------* + * IGF_Reconfig() + * + * + *-------------------------------------------------------------------*/ + +ivas_error IGF_Reconfig( + IGF_ENC_INSTANCE_HANDLE *hIGFEnc, /* i/o: instance handle of IGF Encoder */ + const Word16 igf, /* i : IGF on/off */ + const Word16 reset, /* i : reset flag */ + const Word32 brate, /* i : bitrate for configuration */ + const Word16 bwidth, /* i : signal bandwidth */ + const Word16 element_mode, /* i : IVAS element mode */ + const Word16 rf_mode /* i : flag to signal the RF mode */ +) +{ + ivas_error error; + + error = IVAS_ERR_OK; + move32(); + + test(); + test(); + test(); + IF( igf && *hIGFEnc == NULL ) + { + IF( ( *hIGFEnc = (IGF_ENC_INSTANCE_HANDLE) malloc( sizeof( IGF_ENC_INSTANCE ) ) ) == NULL ) + { + return ( IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for hIGFEnc\n" ) ); + } + IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); + } + ELSE IF( igf && reset ) + { + IGFEncSetMode_ivas_fx( *hIGFEnc, brate, bwidth, element_mode, rf_mode ); + } + ELSE IF( !igf && *hIGFEnc != NULL ) + { + free( *hIGFEnc ); + *hIGFEnc = NULL; + } + + return error; +} diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index d806df9aa..a7634c935 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -1989,7 +1989,7 @@ static void first_VQstages( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ @@ -2179,7 +2179,7 @@ static void first_VQstages_ivas_fx( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ diff --git a/lib_enc/pre_proc_fx.c b/lib_enc/pre_proc_fx.c index b2f414664..2bfe01e59 100644 --- a/lib_enc/pre_proc_fx.c +++ b/lib_enc/pre_proc_fx.c @@ -215,7 +215,7 @@ void pre_proc_fx( /*----------------------------------------------------------------* * Change the sampling frequency to 12.8 kHz *----------------------------------------------------------------*/ - modify_Fs_fx( signal_in, input_frame, st->input_Fs, new_inp_12k8, INT_FS_12k8, st->mem_decim_fx, (const Word16) ( EQ_16( st->max_bwidth, NB ) ) ); + modify_Fs_fx( signal_in, input_frame, st->input_Fs, new_inp_12k8, INT_FS_12k8, st->mem_decim_fx, ( const Word16 )( EQ_16( st->max_bwidth, NB ) ) ); Copy( new_inp_12k8, st->buf_speech_enc + L_FRAME32k, L_FRAME ); Scale_sig( st->buf_speech_enc + L_FRAME32k, L_FRAME, 1 ); /*------------------------------------------------------------------* diff --git a/lib_enc/swb_tbe_enc_fx.c b/lib_enc/swb_tbe_enc_fx.c index 3090568fb..8ba4ff5c0 100644 --- a/lib_enc/swb_tbe_enc_fx.c +++ b/lib_enc/swb_tbe_enc_fx.c @@ -6861,7 +6861,7 @@ static void first_VQstages_fx( dist[1] = dist_buf + maxC; move16(); - set16_fx( idx_buf, 0, (const Word16) ( 2 * stagesVQ * maxC ) ); + set16_fx( idx_buf, 0, ( const Word16 )( 2 * stagesVQ * maxC ) ); set16_fx( parents, 0, maxC ); /* Set up inital distance vector */ diff --git a/lib_rend/lib_rend_fx.c b/lib_rend/lib_rend_fx.c index 3aa351677..b1ca62335 100644 --- a/lib_rend/lib_rend_fx.c +++ b/lib_rend/lib_rend_fx.c @@ -9030,7 +9030,7 @@ static ivas_error getSamplesInternal( if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec, hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms, hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms, - &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, (const Word16) ( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) + &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, ( const Word16 )( ( BINAURAL_MAXBANDS * hIvasRend->sampleRateOut ) / 48000 ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK ) { return error; } -- GitLab From 6f91e009dcd987e49bfa4d925fc833ccfec2c39e Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 18:39:43 +0200 Subject: [PATCH 4/6] fix build + format prot_fx.h --- lib_com/prot_fx.h | 2560 ++++++++++++++++++++++------------------ lib_dec/ivas_rom_dec.h | 1 - lib_enc/igf_enc_fx.c | 38 +- lib_enc/prot_fx_enc.h | 1460 +++++++++++++---------- 4 files changed, 2268 insertions(+), 1791 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 101b7889b..6132d36ce 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -391,10 +391,11 @@ Word16 WB_BWE_gain_pred_fx( Word16 last_extl_fx, Word16 tilt_wb_fx ); -Word32 calc_tilt_bwe_fx( /* o : Tilt in Q24 */ - const Word16 *sp0, /* i : i signal */ - const Word16 exp, /* i : Exp of inp signal */ - const Word16 N /* i : signal length */ +/* o : Tilt in Q24 */ +Word32 calc_tilt_bwe_fx( + const Word16 *sp0, /* i : i signal */ + const Word16 exp, /* i : Exp of inp signal */ + const Word16 N /* i : signal length */ ); void calc_norm_envelop_fx( @@ -556,16 +557,17 @@ void hq_swb_harmonic_calc_norm_envelop_fx( const Word16 SWB_flength /* i : length of i signal */ ); -Word16 build_nf_codebook_fx( /* o : Number of coefficients in nf codebook */ - const Word16 flag_32K_env_ho, /* i : Envelope attenuation hangover flag */ - const Word16 *coeff, /* i : Coded spectral coefficients */ - const Word16 *sfm_start, /* i : Subband start indices */ - const Word16 *sfmsize, /* i : Subband widths */ - const Word16 *sfm_end, /* i : Subband end indices */ - const Word16 last_sfm, /* i : Last coded band */ - const Word16 *R, /* i : Per-band bit allocation */ - Word16 *CodeBook, /* o : Noise-fill codebook */ - Word16 *CodeBook_mod /* o : Densified noise-fill codebook */ +/* o : Number of coefficients in nf codebook */ +Word16 build_nf_codebook_fx( + const Word16 flag_32K_env_ho, /* i : Envelope attenuation hangover flag */ + const Word16 *coeff, /* i : Coded spectral coefficients */ + const Word16 *sfm_start, /* i : Subband start indices */ + const Word16 *sfmsize, /* i : Subband widths */ + const Word16 *sfm_end, /* i : Subband end indices */ + const Word16 last_sfm, /* i : Last coded band */ + const Word16 *R, /* i : Per-band bit allocation */ + Word16 *CodeBook, /* o : Noise-fill codebook */ + Word16 *CodeBook_mod /* o : Densified noise-fill codebook */ ); void limit_band_noise_level_calc_fx( @@ -575,9 +577,10 @@ void limit_band_noise_level_calc_fx( Word16 *noise_level /* o : noise level Q15 */ ); -Word16 find_last_band_fx( /* o : index of last band */ - const Word16 *bitalloc, /* i : bit allocation */ - const Word16 nb_sfm /* i : number of possibly coded bands */ +/* o : index of last band */ +Word16 find_last_band_fx( + const Word16 *bitalloc, /* i : bit allocation */ + const Word16 nb_sfm /* i : number of possibly coded bands */ ); void apply_noisefill_HQ_fx( @@ -734,6 +737,7 @@ Word16 calc_nor_delta_hf_fx( const Word16 *sfm_start, /* i : Start index of bands */ const Word16 core_sfm /* i : index of the end band for core */ ); + Word16 calc_nor_delta_hf_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word32 *t_audio, /* i : transform-domain coefficients Qx*/ @@ -745,6 +749,7 @@ Word16 calc_nor_delta_hf_ivas_fx( const Word16 *sfm_start, /* i : Start index of bands */ const Word16 core_sfm /* i : index of the end band for core */ ); + void hq_bwe_fx( const Word16 HQ_mode, /* i : HQ mode */ Word32 *coeff_out1, /* i/o: BWE i & temporary buffer */ @@ -799,6 +804,7 @@ void enforce_zero_for_min_envelope_fx( const Word16 *sfm_start, /* i : Sub band start indices Q0 */ const Word16 *sfm_end /* i : Sub band end indices Q0 */ ); + void apply_envelope_enc_ivas_fx( const Word16 *coeff, /* i/o: Coded/noisefilled normalized spectrum Q12 */ const Word16 *norm, /* i : Envelope Q0 */ @@ -807,6 +813,7 @@ void apply_envelope_enc_ivas_fx( const Word16 *sfm_end, /* i : Sub band end indices Q0 */ Word32 *coeff_out /* o : coded/noisefilled spectrum Q12 */ ); + void apply_envelope_fx( const Word16 *coeff, /* i : Coded/noisefilled normalized spectrum Q12 */ const Word16 *norm, /* i : Envelope */ @@ -827,7 +834,10 @@ void apply_envelope_fx( lsf_tools_fx.c /========================================================================================================*/ -void compute_poly_product_fx( Word16 *coef, Word32 *p, Word16 order ); +void compute_poly_product_fx( + Word16 *coef, + Word32 *p, + Word16 order ); Word16 xsp_to_xsf( Word16 lsp ); @@ -836,8 +846,14 @@ Word16 xsf_to_xsp( Word16 lsf /* Q2.56 */ ); -void lsp_convolve_fx( Word32 x, Word32 *p1, Word32 *p2, Word16 len ); -Word32 poscos_fx( Word16 w ); +void lsp_convolve_fx( + Word32 x, + Word32 *p1, + Word32 *p2, + Word16 len ); + +Word32 poscos_fx( + Word16 w ); Word32 sub_lsp2lsf_fx( const Word16 lsp_i /* i : lsp[m] (range: -1<=val<1) Q15*/ @@ -854,16 +870,32 @@ void E_LPC_lsf_lsp_conversion( const Word16 m /* i : LPC order */ ); -void E_LPC_f_lsp_a_conversion( const Word16 *lsp, Word16 *a, const Word16 m ); +void E_LPC_f_lsp_a_conversion( + const Word16 *lsp, + Word16 *a, + const Word16 m ); + void E_LPC_a_isp_conversion( const Word16 *a, /* i : LP filter coefficients */ Word16 *isp, /* o : Line spectral pairs (in the cosine domain) */ const Word16 *old_isp, /* i : LSP vector from past frame */ const Word16 m /* i : LPC order */ ); -void E_LPC_isp_isf_conversion( const Word16 isp[], Word16 isf[], const Word16 m ); -void E_LPC_isf_isp_conversion( const Word16 isf[], Word16 isp[], const Word16 m ); -void E_LPC_f_isp_a_conversion( const Word16 *isp, Word16 *a, const Word16 m ); + +void E_LPC_isp_isf_conversion( + const Word16 isp[], + Word16 isf[], + const Word16 m ); + +void E_LPC_isf_isp_conversion( + const Word16 isf[], + Word16 isp[], + const Word16 m ); + +void E_LPC_f_isp_a_conversion( + const Word16 *isp, + Word16 *a, + const Word16 m ); void E_LPC_a_lsp_conversion( const Word16 *a, /* i : LP filter coefficients */ @@ -897,14 +929,21 @@ void E_LPC_a_lsp_conversion( const Word16 m /* i : LPC order */ ); -void v_sort( Word16 *r, const Word16 lo, const Word16 up ); +void v_sort( + Word16 *r, + const Word16 lo, + const Word16 up ); -void compute_poly_product_fx( Word16 *coef, Word32 *p, Word16 order ); +void compute_poly_product_fx( + Word16 *coef, + Word32 *p, + Word16 order ); void dec_prm_hm_fx( Decoder_State *st, Word16 *prm_hm, /* Q0 */ const Word16 L_frame ); + void msvq_dec( const Word16 *const *cb, /* i : Codebook (indexed cb[*stages][levels][p]) (0Q15) */ const Word16 dims[], /* i : Dimension of each codebook stage (NULL: full dim.) */ @@ -926,23 +965,22 @@ void lsf_syn_mem_restore_fx( Word32 gc_threshold_fx, /* i: Q16 */ Word16 *clip_var_bck_fx, /* i: Q(2.56), Q14, Q7, Q0, Q14, Q14 */ Word16 next_force_sf_bck_fx, /* i: */ - - Word16 *lsp_new, /* o: LSP vector to quantize Q15 */ - Word16 *lsf_new, /* o: quantized LSF vector Q15 */ - Word16 *lsp_mid, /* o: mid-frame LSP vector Q15 */ - Word16 clip_var, /* i: pitch clipping state var Q(2.56) */ - Word16 *mem_AR, /* i: quantizer memory for AR model Q15 */ - Word16 *mem_MA, /* i: quantizer memory for MA model Q15 */ - Word16 *lsp_new_bck, /* i: LSP vector to quantize- backup Q15 */ - Word16 *lsf_new_bck, /* i: quantized LSF vector - backup Q15 */ - Word16 *lsp_mid_bck, /* i: mid-frame LSP vector - backup Q15 */ - Word16 mCb1, /* i: counter for stationary frame after a transition frame */ - Word32 *Bin_E, /* i: FFT Bin energy 128 *2 sets Q_new + Q_SCALE - 2 */ - Word32 *Bin_E_old, /* i: FFT Bin energy 128 sets Q_new + Q_SCALE - 2 */ - Word16 *mem_syn_bck, /* i: synthesis filter memory ( 15 - st_fx->hLPDmem->e_mem_syn ) */ - Word16 mem_w0_bck, /* i: memory of the weighting filter ( 15 - st_fx->hLPDmem->e_mem_syn ) */ - Word16 streaklimit, /* i:LSF quantizer Q15 */ - Word16 pstreaklen /* i:LSF quantizer */ + Word16 *lsp_new, /* o: LSP vector to quantize Q15 */ + Word16 *lsf_new, /* o: quantized LSF vector Q15 */ + Word16 *lsp_mid, /* o: mid-frame LSP vector Q15 */ + Word16 clip_var, /* i: pitch clipping state var Q(2.56) */ + Word16 *mem_AR, /* i: quantizer memory for AR model Q15 */ + Word16 *mem_MA, /* i: quantizer memory for MA model Q15 */ + Word16 *lsp_new_bck, /* i: LSP vector to quantize- backup Q15 */ + Word16 *lsf_new_bck, /* i: quantized LSF vector - backup Q15 */ + Word16 *lsp_mid_bck, /* i: mid-frame LSP vector - backup Q15 */ + Word16 mCb1, /* i: counter for stationary frame after a transition frame */ + Word32 *Bin_E, /* i: FFT Bin energy 128 *2 sets Q_new + Q_SCALE - 2 */ + Word32 *Bin_E_old, /* i: FFT Bin energy 128 sets Q_new + Q_SCALE - 2 */ + Word16 *mem_syn_bck, /* i: synthesis filter memory ( 15 - st_fx->hLPDmem->e_mem_syn ) */ + Word16 mem_w0_bck, /* i: memory of the weighting filter ( 15 - st_fx->hLPDmem->e_mem_syn ) */ + Word16 streaklimit, /* i:LSF quantizer Q15 */ + Word16 pstreaklen /* i:LSF quantizer */ ); void lsf_syn_mem_restore_ivas_fx( @@ -1049,25 +1087,28 @@ void lsp2isp_fx( const Word16 m /* i : order of LP analysis */ ); -Word16 lsf_stab_fx( /* o : LP filter stability Q15*/ - const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ - const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ - const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ - const Word16 L_frame /* i : frame length */ +/* o : LP filter stability Q15*/ +Word16 lsf_stab_fx( + const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ + const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ + const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ + const Word16 L_frame /* i : frame length */ ); -Word16 lsf_stab_ivas_fx( /* o : LP filter stability Q15*/ - const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ - const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ - const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ - const Word16 L_frame /* i : frame length */ +/* o : LP filter stability Q15*/ +Word16 lsf_stab_ivas_fx( + const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ + const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ + const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ + const Word16 L_frame /* i : frame length */ ); -Word16 lsf_stab_ivas_fx( /* o : LP filter stability Q15*/ - const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ - const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ - const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ - const Word16 L_frame /* i : frame length */ +/* o : LP filter stability Q15*/ +Word16 lsf_stab_ivas_fx( + const Word16 *lsf, /* i : LSF vector Q(x2.56)*/ + const Word16 *lsfold, /* i : old LSF vector Q(x2.56)*/ + const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ + const Word16 L_frame /* i : frame length */ ); void reorder_isf_fx( @@ -1135,7 +1176,10 @@ Word16 vq_dec_lvq_ivas_fx( Word16 no_bits /* (i): no. bits for lattice */ ); -void a2rc_fx( const Word16 *a, Word16 *refl, Word16 lpcorder ); +void a2rc_fx( + const Word16 *a, + Word16 *refl, + Word16 lpcorder ); void lsp_weights_fx( Word16 lsp_nq_fx[], @@ -1202,14 +1246,56 @@ void autocorr_fx_32( const Word16 sym_flag /* i : symmetric window flag */ ); -Word16 E_LPC_lev_dur( const Word16 Rh[], const Word16 Rl[], Word16 A[], Word32 epsP[], const Word16 order, Word16 *parcorr ); -Word16 E_LPC_lev_dur_stab( const Word16 Rh[], const Word16 Rl[], Word16 A[], Word32 epsP[], const Word16 order, Word16 *parcorr, Word16 k_max ); - -Word16 E_LPC_lev_dur_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 A[], Word32 epsP[], const Word16 order, Word16 *parcorr ); -Word16 E_LPC_lev_dur_stab_ivas_fx( const Word16 Rh[], const Word16 Rl[], Word16 A[], Word32 epsP[], const Word16 order, Word16 *parcorr, Word16 k_max ); - -Word16 E_LPC_lev_dur_fx( const Word16 Rh[], const Word16 Rl[], Word32 A[], Word32 epsP[], const Word16 order, Word32 *mem ); -Word16 E_LPC_lev_dur_stab_fx( const Word16 Rh[], const Word16 Rl[], Word32 A[], Word32 epsP[], const Word16 order, Word32 *mem, Word16 k_max ); +Word16 E_LPC_lev_dur( + const Word16 Rh[], + const Word16 Rl[], + Word16 A[], + Word32 epsP[], + const Word16 order, + Word16 *parcorr ); + +Word16 E_LPC_lev_dur_stab( + const Word16 Rh[], + const Word16 Rl[], + Word16 A[], + Word32 epsP[], + const Word16 order, + Word16 *parcorr, + Word16 k_max ); + +Word16 E_LPC_lev_dur_ivas_fx( + const Word16 Rh[], + const Word16 Rl[], + Word16 A[], + Word32 epsP[], + const Word16 order, + Word16 *parcorr ); + +Word16 E_LPC_lev_dur_stab_ivas_fx( + const Word16 Rh[], + const Word16 Rl[], + Word16 A[], + Word32 epsP[], + const Word16 order, + Word16 *parcorr, + Word16 k_max ); + +Word16 E_LPC_lev_dur_fx( + const Word16 Rh[], + const Word16 Rl[], + Word32 A[], + Word32 epsP[], + const Word16 order, + Word32 *mem ); + +Word16 E_LPC_lev_dur_stab_fx( + const Word16 Rh[], + const Word16 Rl[], + Word32 A[], + Word32 epsP[], + const Word16 order, + Word32 *mem, + Word16 k_max ); Word16 lev_dur_fx( Word32 *a_fx, /* o : LP coefficients (a[0] = 1.0) Q(q_a)*/ @@ -1219,10 +1305,16 @@ Word16 lev_dur_fx( Word16 q_a, Word16 q_r ); -void E_LPC_a_add_tilt( const Word16 *a /*Qa*/, Word16 *ap /*Qa*/, Word16 gamma /*Q15*/, Word16 m ); -void E_LPC_int_lpc_tcx( const Word16 lsp_old[], /* i : LSPs from past frame (1Q14) */ - const Word16 lsp_new[], /* i : LSPs from present frame (1Q14) */ - Word16 a[] /* o : interpolated LP coefficients (4Q11) */ +void E_LPC_a_add_tilt( + const Word16 *a /*Qa*/, + Word16 *ap /*Qa*/, + Word16 gamma /*Q15*/, + Word16 m ); + +void E_LPC_int_lpc_tcx( + const Word16 lsp_old[], /* i : LSPs from past frame (1Q14) */ + const Word16 lsp_new[], /* i : LSPs from present frame (1Q14) */ + Word16 a[] /* o : interpolated LP coefficients (4Q11) */ ); Word16 E_LPC_lsp_unweight( @@ -1233,9 +1325,23 @@ Word16 E_LPC_lsp_unweight( Word16 lpcorder /* (I): prediction order Q0 */ ); -Word32 E_LPC_schur( Word32 r[] /*Qr*/, Word16 reflCoeff[] /*Q15*/, Word32 epsP[] /*Qr*/, const Word16 m ); -Word32 E_LPC_schur_ivas( Word32 r[] /*Qr*/, Word16 reflCoeff[] /*Q15*/, const Word16 m ); -void E_LPC_a_lsf_isf_conversion( Word16 *lpcCoeffs /*Qx*/, Word16 *lsf /*15Q16*/, const Word16 *old_lsf /*15Q16*/, Word16 lpcOrder, Word8 lpcRep /*Q0*/ ); +Word32 E_LPC_schur( + Word32 r[] /*Qr*/, + Word16 reflCoeff[] /*Q15*/, + Word32 epsP[] /*Qr*/, + const Word16 m ); + +Word32 E_LPC_schur_ivas( + Word32 r[] /*Qr*/, + Word16 reflCoeff[] /*Q15*/, + const Word16 m ); + +void E_LPC_a_lsf_isf_conversion( + Word16 *lpcCoeffs /*Qx*/, + Word16 *lsf /*15Q16*/, + const Word16 *old_lsf /*15Q16*/, + Word16 lpcOrder, + Word8 lpcRep /*Q0*/ ); /*========================================================================================================/ @@ -1419,29 +1525,31 @@ void hq_configure_evs_fx( ); // hp50.c -void hp20( Word16 signal[], /* i/o: signal to filter any */ - const Word16 stride, /* i : stride to be applied accessing signal */ - const Word16 lg, /* i : length of signal (integer) Q0 */ - Word32 mem[5], /* i/o: static filter memory with this layout: */ - /* mem[0]: y[-2] (32-bit) */ - /* mem[1]; y[-1] (32-bit) */ - /* mem[2]: x[-2] << 16 */ - /* mem[3]: x[-1] << 16 */ - /* Note: mem[0..3] need to be scaled per frame */ - /* mem[4]: states scale */ - const Word32 sFreq ); - -// get_gain.c -Word32 get_gain( /* encoder side; enc = 0 -> decoder side */ - Word16 *sign /* i/o: sign of the maximum */ + +/* o : impulse response energy Q3 */ +Word16 findpulse_fx( + const Word16 L_frame, /* i : length of the frame */ + const Word16 res[], /* i : Residual signal <12 bits */ + const Word16 T0, /* i : Pitch estimation Q0 */ + const Word16 enc, /* i : enc = 1 -> encoder side; enc = 0 -> decoder side */ + Word16 *sign /* i/o: sign of the maximum */ ); -// env_stab_trans.c void env_stab_transient_detect_fx( const Word16 is_transient, /* i: Transient flag */ const Word16 length, /* i : Length of spectrum (32 or 48 kHz) */ @@ -1657,8 +1766,6 @@ void env_stab_transient_detect_fx( const Word16 Qcoeff /* i : Q of coded spectral coefficients */ ); - -// env_adj.c void env_adj_fx( const Word16 *pulses, /* i : number of pulses per band Q0 */ const Word16 length, /* i : length of spectrum Q0 */ @@ -1668,32 +1775,33 @@ void env_adj_fx( const Word16 *sfmsize /* i : subband sizes Q0 */ ); - -// env_stab.c - -Word16 env_stability_fx( /* in Q15 */ - const Word16 *ynrm, /*i: Norm vector for current frame */ - const Word16 nb_sfm, /*i: Number of sub-bands */ - Word16 *mem_norm, /*i/o: Norm vector memory from past frame */ - Word16 *mem_env_delta, /*i/o: Envelope stability memory for smoothing in Q11 */ - const Word16 core_switching_flag /* i : Core switching flag */ +/* in Q15 */ +Word16 env_stability_fx( + const Word16 *ynrm, /*i: Norm vector for current frame */ + const Word16 nb_sfm, /*i: Number of sub-bands */ + Word16 *mem_norm, /*i/o: Norm vector memory from past frame */ + Word16 *mem_env_delta, /*i/o: Envelope stability memory for smoothing in Q11 */ + const Word16 core_switching_flag /* i : Core switching flag */ ); -Word16 env_stab_smo_fx( /* Q0 */ - Word16 env_stab, /*i : env_stab value Q15 */ - Word16 *env_stab_state_p, /*i/o: env_stab state probabilities Q15 */ - Word16 *ho_cnt /*i/o: hangover counter for speech state */ +/* Q0 */ +Word16 env_stab_smo_fx( + Word16 env_stab, /*i : env_stab value Q15 */ + Word16 *env_stab_state_p, /*i/o: env_stab state probabilities Q15 */ + Word16 *ho_cnt /*i/o: hangover counter for speech state */ ); -// enr_1_az.c -Word16 Enr_1_Az_fx( /* o : impulse response energy Q3 */ - const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ - const Word16 len /* i : impulse response length Q0 */ +/* o : impulse response energy Q3 */ +Word16 Enr_1_Az_fx( + const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ + const Word16 len /* i : impulse response length Q0 */ ); -Word16 Enr_1_Az_fx_o( /* o : impulse response energy Q3 */ - const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ - const Word16 len, /* i : impulse response length Q0 */ - Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ + +/* o : impulse response energy Q3 */ +Word16 Enr_1_Az_fx_o( + const Word16 Aq[], /* i : LP filter coefs Qx based on the fact that Aq[0] == 1.0 */ + const Word16 len, /* i : impulse response length Q0 */ + Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ ); // gs_gains_fx.c @@ -1703,6 +1811,7 @@ void Ener_per_band_comp_fx( const Word16 Q_exc_diff, const Word16 Mband, /* i : Max band */ const Word16 Eflag ); + void Ener_per_band_comp_ivas_fx( const Word16 exc_diff_fx[], /* i : target signal Q_exc_diff */ Word16 y_gain4_fx[], /* o : Energy per band to quantize Q12 */ @@ -1730,7 +1839,6 @@ void Comp_and_apply_gain_ivas_fx( Word16 Qexc_diff, Word16 *Q_exc ); -// gs_preech.c void pre_echo_att_fx( Word32 *Last_frame_ener_fx, /* i/o: Energy of the last frame 2*Q_new+1*/ Word16 *exc_fx, /* i/o: Excitation of the current frame Q_new*/ @@ -1738,7 +1846,6 @@ void pre_echo_att_fx( const Word16 Q_new, const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ - ); void pre_echo_att_ivas_fx( @@ -1749,7 +1856,7 @@ void pre_echo_att_ivas_fx( const Word16 last_coder_type, /* i : Last coding mode Q0*/ const Word16 L_frame /* i : Frame length Q0*/ ); -// wtda_fx.c + void tcx_get_windows_mode1( const Word16 left_mode, /* i: overlap mode of left window half */ const Word16 right_mode, /* i: overlap mode of right window half */ @@ -1893,15 +2000,16 @@ void noise_extr_corcod_fx( ); void sqrt_32n_16_fx( - Word32 L_in, /* i : i vector (Word32) */ + Word32 L_in, /* i : i vector (Word32) */ Word16 Qin, /* i : Q value for L_in */ - Word16 *out_fx, /* o : sqrt i vector (Word16) */ + Word16 *out_fx, /* o : sqrt i vector (Word16) */ Word16 *Qout /* o : Q value for out_fx */ ); -Word16 div_s_ss( /* o: result of division (Word16 Q0) */ - const Word16 n, /* i: numerator (Word16 Q0 */ - const Word16 d /* i: denominator (Word16 Q0) */ +/* o: result of division (Word16 Q0) */ +Word16 div_s_ss( + const Word16 n, /* i: numerator (Word16 Q0 */ + const Word16 d /* i: denominator (Word16 Q0) */ ); void noiseinj_hf_fx( @@ -1952,16 +2060,17 @@ void return_bits_normal2_fx( const Word16 bits_lagIndices_fx[] /* i : bits for lagIndices */ ); -Word16 spectrumsmooth_noiseton_fx( /* o : Qss ss_min */ - Word32 L_spectra[], /* i : Qs core coder */ - /*Word16 Qs,*/ /* i : Q0 Q value for spectra, spectra_ni */ - const Word32 L_spectra_ni[], /* i : Qs core coder with sparse filling */ - Word16 sspectra_fx[], /* o : Qss Smoothed tonal information from core coder */ - Word16 sspectra_diff_fx[], /* o : Qss non tonal infomration for gap filling */ - Word16 sspectra_ni_fx[], /* o : Qss smoothed core coder */ - Word16 *Qss, /* o : Q0 Q value for sspectra* */ - const Word16 fLenLow_fx, /* i : Q0 low frequency boundaries */ - Word16 *ni_seed_fx /* io : Q0 random seed */ +/* o : Qss ss_min */ +Word16 spectrumsmooth_noiseton_fx( + Word32 L_spectra[], /* i : Qs core coder */ + /*Word16 Qs,*/ /* i : Q0 Q value for spectra, spectra_ni */ + const Word32 L_spectra_ni[], /* i : Qs core coder with sparse filling */ + Word16 sspectra_fx[], /* o : Qss Smoothed tonal information from core coder */ + Word16 sspectra_diff_fx[], /* o : Qss non tonal infomration for gap filling */ + Word16 sspectra_ni_fx[], /* o : Qss smoothed core coder */ + Word16 *Qss, /* o : Q0 Q value for sspectra* */ + const Word16 fLenLow_fx, /* i : Q0 low frequency boundaries */ + Word16 *ni_seed_fx /* io : Q0 random seed */ ); void ton_ene_est_fx( @@ -2030,26 +2139,23 @@ void get_sigma_fx_har( ); void genhf_noise_fx( - const Word16 noise_flr_fx[], - /* i : Qss smoothed non tonal */ /* sspectra_diff_fx:Qss */ - const Word16 Qss, /* i : Q0 Q value */ - Word32 L_xSynth_har[], - /* o : QsL hf non tonal components */ /* xSynth_har:QsL */ - const Word16 QsL, /* i : Q0 Q value */ - const Word16 *predBuf_fx, - /* i : Qss smoothed tonal compone */ /* sspectra:Qss */ - const Word16 bands, /* i : Q0 total number of subbands in a frame */ - const Word16 harmonic_band, /* i : Q0 Number of LF harmonic frames */ - const Word16 har_freq_est2, /* i : Q0 harmonic signal parameter */ - const Word16 pos_max_hfe2, /* i : Q0 last pulse in core coder */ - Word16 *pul_res, /* o : Q0 pulse resolution */ - GainItem_fx pk_sf_fx[], /* o : representative region */ - const Word16 fLenLow, /* i : Q0 low frequency length */ - const Word16 fLenHigh, /* i : Q0 high frequency length */ - const Word16 sbWidth[], /* i : Q0 bandwidth for high bands */ - const Word16 lagIndices[], /* i : Q0 correlation indices for most representative */ - const Word16 subband_offsets[], /* i : Q0 band offsets for HF reconstruction */ - const Word16 subband_search_offset[] /* i : Q0 most representative regions offsets in LF */ + const Word16 noise_flr_fx[], /* i : Qss smoothed non tonal sspectra_diff_fx:Qss */ + const Word16 Qss, /* i : Q0 Q value */ + Word32 L_xSynth_har[], /* o : QsL hf non tonal components xSynth_har:QsL */ + const Word16 QsL, /* i : Q0 Q value */ + const Word16 *predBuf_fx, /* i : Qss smoothed tonal compone sspectra:Qss */ + const Word16 bands, /* i : Q0 total number of subbands in a frame */ + const Word16 harmonic_band, /* i : Q0 Number of LF harmonic frames */ + const Word16 har_freq_est2, /* i : Q0 harmonic signal parameter */ + const Word16 pos_max_hfe2, /* i : Q0 last pulse in core coder */ + Word16 *pul_res, /* o : Q0 pulse resolution */ + GainItem_fx pk_sf_fx[], /* o : representative region */ + const Word16 fLenLow, /* i : Q0 low frequency length */ + const Word16 fLenHigh, /* i : Q0 high frequency length */ + const Word16 sbWidth[], /* i : Q0 bandwidth for high bands */ + const Word16 lagIndices[], /* i : Q0 correlation indices for most representative */ + const Word16 subband_offsets[], /* i : Q0 band offsets for HF reconstruction */ + const Word16 subband_search_offset[] /* i : Q0 most representative regions offsets in LF */ ); Word16 har_est_fx( @@ -2075,23 +2181,19 @@ void FindNBiggest2_simple_fx_har( Word16 get_usebit_npswb_fx( Word16 hqswb_clas_fx ); -/*========================================================================================================/ -isf_dec_amr_wb_fx.c -/========================================================================================================*/ - void disf_2s_36b_fx( Word16 *indice, /* i : quantized indices (use indice[0] = -1 in the decoder) */ - Word16 *isf_q, /* (Qx2.56) o : quantized ISFs in the cosine domain */ - Word16 *mem_AR, /* (Qx2.56) i/o: quantizer memory for AR model */ - Word16 *mem_MA, /* (Qx2.56) i/o: quantizer memory for MA model */ + Word16 *isf_q, /* (Qx2.56) o : quantized ISFs in the cosine domain */ + Word16 *mem_AR, /* (Qx2.56) i/o: quantizer memory for AR model */ + Word16 *mem_MA, /* (Qx2.56) i/o: quantizer memory for MA model */ const Word16 enc_dec /* i : encoder (0), decoder (1) G722.2 FER */ ); void disf_2s_46b_fx( Word16 *indice, /* i : quantized indices (use indice[0] = -1 in the decoder) */ - Word16 *isf_q, /* (Qx2.56) o : quantized ISFs in the cosine domain */ - Word16 *mem_AR, /* (Qx2.56) o : quantizer memory for AR model */ - Word16 *mem_MA, /* (Qx2.56) i/o: quantizer memory for MA model */ + Word16 *isf_q, /* (Qx2.56) o : quantized ISFs in the cosine domain */ + Word16 *mem_AR, /* (Qx2.56) o : quantizer memory for AR model */ + Word16 *mem_MA, /* (Qx2.56) i/o: quantizer memory for MA model */ const Word16 enc_dec /* i : encoder (0), decoder (1) G722.2 FER */ ); @@ -2100,16 +2202,12 @@ void disf_ns_28b_fx( Word16 *isf_q ); void isf_dec_amr_wb_fx( - Decoder_State *st, /* i/o: State structure */ - Word16 *Aq, /* Q12 o : quantized A(z) for 4 subframes */ - Word16 *isf_new, /* Qlog2(2.56) o : de-quantized ISF vector */ - Word16 *isp_new /* Q15 o : de-quantized ISP vector */ + Decoder_State *st, /* i/o: State structure */ + Word16 *Aq, /* Q12 o : quantized A(z) for 4 subframes */ + Word16 *isf_new, /* Qlog2(2.56) o : de-quantized ISF vector */ + Word16 *isp_new /* Q15 o : de-quantized ISP vector */ ); -/*========================================================================================================/ -hq2_noise_inject.c fix part -/========================================================================================================*/ - void hq2_noise_inject_fx( Word32 L_y2[], /* Q12 */ const Word16 band_start[], /* Q0 */ @@ -2135,10 +2233,6 @@ void hq2_noise_inject_fx( const Word32 bwe_br /* Q0 */ ); -/*========================================================================================================/ -hq2_bit_alloc_fx.c -/========================================================================================================*/ - void Bits2indvsb_fx( const Word32 *L_be, /* i : Qbe Band Energy of sub-band */ const Word16 start_band, /* i : Q0 start band indices */ @@ -2180,10 +2274,6 @@ void reordvct_fx( Word16 *idx /* o : reordered vector index */ ); -/*========================================================================================================/ -nelp_fx.c -/========================================================================================================*/ - Word16 dequantize_uvg_fx( const Word16 iG1, /* i: gain 1 index */ const Word16 *iG2, /* i: gain 2 index */ @@ -2198,10 +2288,6 @@ void generate_nelp_excitation_fx( const Word16 gain_fac /* i : gain factor */ ); -/*========================================================================================================/ -ppp_fx.c -/========================================================================================================*/ - void Interpol_delay_fx( Word16 *out_fx, /* Q4 */ Word16 last_fx, /* Q0 */ @@ -2218,9 +2304,6 @@ void deemph_lpc_fx( const Word16 deemph_old /* Q0 */ ); -/*========================================================================================================/ -hq2_core_com_fx.c -/========================================================================================================*/ void mdct_spectrum_denorm_fx( const Word16 inp_vector[], /* i : Q0 : */ Word32 L_y2[], /* i/o : Qs : decoded spectrum */ @@ -2325,7 +2408,6 @@ void bit_allocation_second_fx( const Word16 *last_bitalloc, /* Q0 */ const Word16 input_frame /* Q0 */ ); -// synth_filt_fix.c Word32 syn_kern_16( Word32 L_tmp, @@ -2376,9 +2458,25 @@ void syn_filt_fx32( const Word16 update_m /* i : update memory flag Q0 : 0 --> no memory update */ ); -void E_UTIL_synthesis( const Word16 shift, const Word16 a[], const Word16 x[], Word16 y[], const Word16 lg, Word16 mem[], const Word16 update, const Word16 m ); +void E_UTIL_synthesis( + const Word16 shift, + const Word16 a[], + const Word16 x[], + Word16 y[], + const Word16 lg, + Word16 mem[], + const Word16 update, + const Word16 m ); -void E_UTIL_synthesis_fx( const Word16 shift, const Word32 a[], const Word32 x[], Word32 y[], const Word16 lg, Word32 mem[], const Word16 update, const Word16 m ); +void E_UTIL_synthesis_fx( + const Word16 shift, + const Word32 a[], + const Word32 x[], + Word32 y[], + const Word16 lg, + Word32 mem[], + const Word16 update, + const Word16 m ); void synth_mem_updt2( const Word16 L_frame, /* i : frame length */ @@ -2389,6 +2487,7 @@ void synth_mem_updt2( Word16 mem_syn[], /* o : synthesis filter memory for find_target */ const Word16 dec /* i : flag for decoder indication */ ); + void ivas_synth_mem_updt2_fx( const Word16 L_frame, /* i : frame length */ const Word16 last_L_frame, /* i : frame length */ @@ -2398,31 +2497,45 @@ void ivas_synth_mem_updt2_fx( Word16 mem_syn[], /* o : synthesis filter memory for find_target */ const Word16 dec ); +void lerp( + const Word16 *f, + Word16 *f_out, + Word16 bufferNewSize, + Word16 bufferOldSize ); -// lerp.c -void lerp( const Word16 *f, Word16 *f_out, Word16 bufferNewSize, Word16 bufferOldSize ); +void L_lerp_fx_q11( + Word32 *f, + Word32 *f_out, + Word16 bufferNewSize, + Word16 bufferOldSize ); -void L_lerp_fx_q11( Word32 *f, Word32 *f_out, Word16 bufferNewSize, Word16 bufferOldSize ); +void L_lerp_fx( + Word32 *f, + Word32 *f_out, + Word16 bufferNewSize, + Word16 bufferOldSize, + Word16 *q ); -void L_lerp_fx( Word32 *f, Word32 *f_out, Word16 bufferNewSize, Word16 bufferOldSize, Word16 *q ); - -// index_pvq_opt.c -PvqEntry mpvq_encode_vec_fx( /* o : leading_sign_index, index, size, k_val */ - const Word16 *vec_in, /* i : signed pulse train */ - Word16 dim_in, /* i : dimension */ - Word16 k_val_local /* i : nb unit pulses */ +/* o : leading_sign_index, index, size, k_val */ +PvqEntry mpvq_encode_vec_fx( + const Word16 *vec_in, /* i : signed pulse train */ + Word16 dim_in, /* i : dimension */ + Word16 k_val_local /* i : nb unit pulses */ ); -PvqEntry get_size_mpvq_calc_offset_fx( /* o : size, dim, k_val */ - Word16 dim_in, /* i : dimension */ - Word16 k_val_in, /* i : nb unit pulses */ - UWord32 *h_mem /* o : offsets */ + +/* o : size, dim, k_val */ +PvqEntry get_size_mpvq_calc_offset_fx( + Word16 dim_in, /* i : dimension */ + Word16 k_val_in, /* i : nb unit pulses */ + UWord32 *h_mem /* o : offsets */ ); -void mpvq_decode_vec_fx( /* o : void */ - const PvqEntry *entry, /* i : sign_ind, index, dim, k_val */ - UWord32 *h_mem, /* i : A/U offsets */ - Word16 *vec_out /* o : pulse train */ + +void mpvq_decode_vec_fx( + const PvqEntry *entry, /* i : sign_ind, index, dim, k_val */ + UWord32 *h_mem, /* i : A/U offsets */ + Word16 *vec_out /* o : pulse train */ ); -// weight_a_fx.c + void weight_a_subfr_fx( const Word16 nb_subfr, /* i : number of subframes Q0 */ const Word16 *A, /* i : LP filter coefficients Q12 */ @@ -2444,6 +2557,7 @@ void weight_a_fx( const Word16 gamma, /* i: weighting factor Q15 */ const Word16 m /* i: order of LP filter Q0 */ ); + void E_LPC_a_weight_inv( const Word16 *a, /* Q12 */ Word16 *ap, /* Q12 */ @@ -2451,7 +2565,6 @@ void E_LPC_a_weight_inv( const Word16 m /* Q0 */ ); -// residu_fx.c void Residu3_lc_fx( const Word16 a[], /* i : prediction coefficients Q12 */ const Word16 m, /* i : order of LP filter Q0 */ @@ -2482,44 +2595,48 @@ void calc_residu_fx( Word16 *res, /* o : residual signal Qx+1*/ const Word16 *p_Aq /* i : quantized LP filter coefficients Q12*/ ); -// inerpol_lc.c -Word32 Interpol_lc_fx( /* o : interpolated value Q15 */ - const Word16 *x, /* i : input vector Q0 */ - const Word16 *win, /* i : interpolation window Q14 */ - const Word16 frac, /* i : fraction (0..up_samp) Q0 */ - const Word16 up_samp, /* i : upsampling factor Q0 */ - const Word16 nb_coef /* i : number of coefficients Q0 */ -); - -Word16 modify_Fs_ivas_fx( /* o : length of output Q0 */ - const Word16 sigIn_fx[], /* i : signal to decimate Q0 */ - Word16 lg, /* i : length of input Q0 */ - const Word32 fin, /* i : frequency of input Q0 */ - Word16 sigOut_fx[], /* o : decimated signal Q0 */ - const Word32 fout, /* i : frequency of output Q0 */ - Word16 mem_fx[], /* i/o: filter memory Q0 */ - const Word16 nblp, /* i : flag indicating if NB low-pass is applied */ - Word16 *Q_new_inp, /*scaling added on sigOut_fx */ - Word16 *mem_decim_size /*i: size modified for mem_fx*/ -); -// modif_fs_fx.c -Word16 modify_Fs_fx( /* o : length of output Q0 */ - const Word16 sigIn_fx[], /* i : signal to decimate Q0 */ - Word16 lg, /* i : length of i Q0 */ - const Word32 fin, /* i : frequency of i Q0 */ - Word16 sigOut_fx[], /* o : decimated signal Q0 */ - const Word32 fout, /* i : frequency of output Q0 */ - Word16 mem_fx[], /* i/o: filter memory Q0 */ - const Word16 nblp /* i : flag indicating if NB low-pass is applied */ -); - -Word16 modify_Fs_intcub3m_sup_fx( /* o : length of output */ - const Word16 sigIn[], /* i : signal to decimate with memory of 2 samples (indexes -2 & -1) */ - const Word16 lg, /* i : length of input (suppose that lg is such that lg_out is integer, ex multiple of 5 in case of 16kHz to 12.8 kHz) */ - const Word32 fin, /* i : frequency of input */ - Word16 sigOut[], /* o : decimated signal */ - const Word32 fout, /* i : frequency of output */ - Word16 *delayout /* o : delay of output */ + +/* o : interpolated value Q15 */ +Word32 Interpol_lc_fx( + const Word16 *x, /* i : input vector Q0 */ + const Word16 *win, /* i : interpolation window Q14 */ + const Word16 frac, /* i : fraction (0..up_samp) Q0 */ + const Word16 up_samp, /* i : upsampling factor Q0 */ + const Word16 nb_coef /* i : number of coefficients Q0 */ +); + +/* o : length of output Q0 */ +Word16 modify_Fs_ivas_fx( + const Word16 sigIn_fx[], /* i : signal to decimate Q0 */ + Word16 lg, /* i : length of input Q0 */ + const Word32 fin, /* i : frequency of input Q0 */ + Word16 sigOut_fx[], /* o : decimated signal Q0 */ + const Word32 fout, /* i : frequency of output Q0 */ + Word16 mem_fx[], /* i/o: filter memory Q0 */ + const Word16 nblp, /* i : flag indicating if NB low-pass is applied */ + Word16 *Q_new_inp, /*scaling added on sigOut_fx */ + Word16 *mem_decim_size /*i: size modified for mem_fx*/ +); + +/* o : length of output Q0 */ +Word16 modify_Fs_fx( + const Word16 sigIn_fx[], /* i : signal to decimate Q0 */ + Word16 lg, /* i : length of i Q0 */ + const Word32 fin, /* i : frequency of i Q0 */ + Word16 sigOut_fx[], /* o : decimated signal Q0 */ + const Word32 fout, /* i : frequency of output Q0 */ + Word16 mem_fx[], /* i/o: filter memory Q0 */ + const Word16 nblp /* i : flag indicating if NB low-pass is applied */ +); + +/* o : length of output */ +Word16 modify_Fs_intcub3m_sup_fx( + const Word16 sigIn[], /* i : signal to decimate with memory of 2 samples (indexes -2 & -1) */ + const Word16 lg, /* i : length of input (suppose that lg is such that lg_out is integer, ex multiple of 5 in case of 16kHz to 12.8 kHz) */ + const Word32 fin, /* i : frequency of input */ + Word16 sigOut[], /* o : decimated signal */ + const Word32 fout, /* i : frequency of output */ + Word16 *delayout /* o : delay of output */ ); void Decimate_allpass_steep_fx( @@ -2597,8 +2714,6 @@ void retro_interp4_5_fx( void retro_interp5_4_fx( Word16 *pst_old_syn_fx ); -// lag_wind.c - void adapt_lag_wind( Word16 r_h[], /* in/out: autocorrelations */ Word16 r_l[], /* in/out: autocorrelations */ @@ -2665,7 +2780,7 @@ Word16 E_UTIL_f_preemph3_ivas_fx( Word16 *mem, /* Qx */ Word16 bits /* Q0 */ ); -// swb_bwe_com_fx.c + Word16 WB_BWE_gain_pred_fx( Word16 *WB_fenv, /* o : WB frequency envelopes */ const Word16 *core_dec_freq, /* i : Frequency domain core decoded signal */ @@ -2689,10 +2804,11 @@ void calc_normal_length_fx( Word16 *prev_L_swb_norm, /*i/o : last normalize length */ Word16 Q_syn ); -Word16 ivas_calc_tilt_bwe_fx( /* o : Tilt in Q24 */ - const Word32 *sp, /* i : i signal */ - const Word16 exp_sp, /* i : Exp of inp signal */ - const Word16 N /* i : signal length */ +/* o : Tilt in Q24 */ +Word16 ivas_calc_tilt_bwe_fx( + const Word32 *sp, /* i : i signal */ + const Word16 exp_sp, /* i : Exp of inp signal */ + const Word16 N /* i : signal length */ ); void calc_norm_envelop_fx( @@ -3108,22 +3224,18 @@ void ScaleShapedWB_fx( const Word16 *win, /* i : window */ const Word16 *subwin, /* i : subframes window */ const Word16 Q_bwe_exc, - Word16 L_frame /* i : Frame length - determines whether 12.8 or 16kHz core in-use */ - , - Word16 dynQ /* i : indicate whether output is dynamic Q, or Q0 */ - , - Word16 *Qx /* o : newly computed Q factor for synSHB */ - , - Word16 prev_Qx /* i : prev_Qx for memory scaling */ - , + Word16 L_frame, /* i : Frame length - determines whether 12.8 or 16kHz core in-use */ + Word16 dynQ, /* i : indicate whether output is dynamic Q, or Q0 */ + Word16 *Qx, /* o : newly computed Q factor for synSHB */ + Word16 prev_Qx, /* i : prev_Qx for memory scaling */ Word32 *Hilbert_Mem /* i : Hilbert memory used for computing Qx */ ); void non_linearity_fx( const Word16 i[], /* i : i signal Q_inp */ - Word32 output[], /* o : output signal 2*Q_inp */ + Word32 output[], /* o : output signal 2*Q_inp */ const Word16 length, /* i : i length */ - Word32 *prev_scale, /* i/o: memory Q30 */ + Word32 *prev_scale, /* i/o: memory Q30 */ Word16 Q_inp, Word16 coder_type, /* i : Coder Type */ Word16 *voice_factors, /* i : Voice Factors */ @@ -3132,9 +3244,9 @@ void non_linearity_fx( void non_linearity_ivas_fx( const Word16 i[], /* i : i signal Q_inp */ - Word32 output[], /* o : output signal 2*Q_inp */ + Word32 output[], /* o : output signal 2*Q_inp */ const Word16 length, /* i : i length */ - Word32 *prev_scale, /* i/o: memory Q30 */ + Word32 *prev_scale, /* i/o: memory Q30 */ Word16 Q_inp, Word16 coder_type, /* i : Coder Type */ Word16 *voice_factors, /* i : Voice Factors */ @@ -3143,17 +3255,21 @@ void non_linearity_ivas_fx( void interp_code_5over2_fx( const Word16 inp_code[], /* i : i vector */ - Word16 interp_code[], /* o : output vector */ + Word16 interp_code[], /* o : output vector */ const Word16 inp_length /* i : length of i vector */ ); void interp_code_4over2_fx( const Word16 inp_code_fx[], /* i : i vector Qx */ - Word16 interp_code_fx[], /* o : output vector Qx */ + Word16 interp_code_fx[], /* o : output vector Qx */ const Word16 inp_length /* i : length of i vector */ ); -void wb_tbe_extras_reset_synth_fx( Word16 state_lsyn_filt_shb[], Word16 state_lsyn_filt_dwn_shb[], Word16 state_32and48k_WB_upsample[], Word16 state_resamp_HB[] ); +void wb_tbe_extras_reset_synth_fx( + Word16 state_lsyn_filt_shb[], + Word16 state_lsyn_filt_dwn_shb[], + Word16 state_32and48k_WB_upsample[], + Word16 state_resamp_HB[] ); void elliptic_bpf_48k_generic_fx( const Word16 element_mode, @@ -3219,8 +3335,6 @@ Word16 get_tbe_bits_fx( const Word16 rf_mode /* i : bandwidht mode */ ); -// pvq_com_fx - UWord32 intLimCDivPos_fx( UWord32 NUM, /* Qx */ Word16 DEN /* Q0 */ @@ -3344,15 +3458,16 @@ void srt_vec_ind16_fx( Word16 length /* Q0 */ ); -Word16 atan2_fx( /* o: Angle between 0 and PI/2 radian (Q14) */ - const Word32 y, /* i : near side (Argument must be positive) (Q15) */ - const Word32 x /* i : opposite side (Q15) */ +/* o: Angle between 0 and PI/2 radian (Q14) */ +Word16 atan2_fx( + const Word32 y, /* i : near side (Argument must be positive) (Q15) */ + const Word32 x /* i : opposite side (Q15) */ ); -// rang_com_fx.c -Word16 rc_get_bits2_fx( /* o: Number of bits needed Q0*/ - const Word16 N, /* i: Number of bits currently used Q0*/ - const UWord32 range /* i: Range of range coder Q0*/ +/* o: Number of bits needed Q0*/ +Word16 rc_get_bits2_fx( + const Word16 N, /* i: Number of bits currently used Q0*/ + const UWord32 range /* i: Range of range coder Q0*/ ); void rangeCoderFinalizationFBits_fx( @@ -3361,10 +3476,8 @@ void rangeCoderFinalizationFBits_fx( Word16 *FBits /* i : Fractional finalization bits Q0*/ ); -// wi_fx.c - -ivas_error DTFS_new_fx( DTFS_STRUCTURE **dtfs_out ); - +ivas_error DTFS_new_fx( + DTFS_STRUCTURE **dtfs_out ); void DTFS_copy_fx( DTFS_STRUCTURE *Xout_fx, /* o: DTFS structure */ @@ -3385,11 +3498,23 @@ Word16 DTFS_alignment_full_fx( Word16 *C_fx, Word16 FR_flag ); -void DTFS_phaseShift_fx( DTFS_STRUCTURE *X_fx, Word16 ph, Word16 Lag, Word16 *S_fx, Word16 *C_fx ); +void DTFS_phaseShift_fx( + DTFS_STRUCTURE *X_fx, + Word16 ph, + Word16 Lag, + Word16 *S_fx, + Word16 *C_fx ); -void Q2phaseShift_fx( DTFS_STRUCTURE *X_fx, Word16 ph, Word16 Lag, Word16 *S_fx, Word16 *C_fx ); +void Q2phaseShift_fx( + DTFS_STRUCTURE *X_fx, + Word16 ph, + Word16 Lag, + Word16 *S_fx, + Word16 *C_fx ); -void DTFS_zeroPadd_fx( Word16 N_fx, DTFS_STRUCTURE *X_fx ); +void DTFS_zeroPadd_fx( + Word16 N_fx, + DTFS_STRUCTURE *X_fx ); void DTFS_to_fs_fx( const Word16 *x, /* i : time domain signal */ @@ -3407,39 +3532,46 @@ void DTFS_zeroFilter_fx( Word16 *S_fx, Word16 *C_fx ); -void DTFS_poleFilter_fx_9( DTFS_STRUCTURE *X_fx, Word16 *pf_temp1, Word16 *pf_temp2, Word16 *pf_temp, Word16 *pf_n2_temp1 ); +void DTFS_poleFilter_fx_9( + DTFS_STRUCTURE *X_fx, + Word16 *pf_temp1, + Word16 *pf_temp2, + Word16 *pf_temp, + Word16 *pf_n2_temp1 ); void DTFS_adjustLag_fx( DTFS_STRUCTURE *X_DTFS_FX, /* i/o : DTFS to adjust lag for */ Word16 N_fx /* i : Target lag */ ); -Word32 DTFS_getEngy_fx( DTFS_STRUCTURE *X_fx ); +Word32 DTFS_getEngy_fx( + DTFS_STRUCTURE *X_fx ); -Word32 DTFS_getEngy_P2A_fx( DTFS_STRUCTURE *X_fx ); +Word32 DTFS_getEngy_P2A_fx( + DTFS_STRUCTURE *X_fx ); void DTFS_car2pol_fx( DTFS_STRUCTURE *X_fx /* i/o : DTFS structure a, b, lag */ ); Word32 DTFS_setEngyHarm_fx( - Word16 f1_fx, /* i : lower band freq of i to control energy */ - Word16 f2_fx, /* i : upper band freq of i to control energy */ + Word16 f1_fx, /* i : lower band freq of i to control energy */ + Word16 f2_fx, /* i : upper band freq of i to control energy */ Word16 g1_fx, /* i : lower band freq of output to control energy */ Word16 g2_fx, /* i : upper band freq of output to control energy */ Word32 en2_fx, /* i : Target Energy to set the DTFS to */ - Word16 Qen2_fx, /* i : Input Q format for en2 */ - Word16 *Qa_fx, /* i : Output Q format for x->a */ + Word16 Qen2_fx, /* i : Input Q format for en2 */ + Word16 *Qa_fx, /* i : Output Q format for x->a */ DTFS_STRUCTURE *X_fx /* i/o: DTFS to adjust the energy of */ ); void DTFS_to_erb_fx( - const DTFS_STRUCTURE X_fx, /* i : DTFS i */ - Word16 *out_fx /* o : ERB output */ + const DTFS_STRUCTURE X_fx, /* i : DTFS i */ + Word16 *out_fx /* o : ERB output */ ); void erb_slot_fx( - Word16 lag_fx, /* i : i lag */ + Word16 lag_fx, /* i : i lag */ Word16 *out_fx, /* o : ERB slots */ Word16 *mfreq_fx, /* i : ERB frequencies */ Word16 num_erb_fx /* i : number of ERBs */ @@ -3449,8 +3581,8 @@ void DTFS_erb_inv_fx( Word16 *in_fx, /* i : ERB inpt */ Word16 *slot_fx, /* i : ERB slots filled based on lag */ Word16 *mfreq_fx, /* i : erb frequence edges */ - DTFS_STRUCTURE *X_fx, /* o : DTFS after erb-inv */ - Word16 num_erb_fx /* i : Number of ERB bands */ + DTFS_STRUCTURE *X_fx, /* o : DTFS after erb-inv */ + Word16 num_erb_fx /* i : Number of ERB bands */ ); void erb_add_fx( @@ -3462,7 +3594,13 @@ void erb_add_fx( Word16 num_erb_fx /* i : number of ERBs */ ); -void quant_target_fx( DTFS_STRUCTURE *X_fx, const Word16 *curr_lpc, Word16 *w, Word16 *target, Word16 *sin_tab, Word16 *cos_tab ); +void quant_target_fx( + DTFS_STRUCTURE *X_fx, + const Word16 *curr_lpc, + Word16 *w, + Word16 *target, + Word16 *sin_tab, + Word16 *cos_tab ); ivas_error WIsyn_fx( DTFS_STRUCTURE PREVCW_FX, /* i : Prev frame DTFS */ @@ -3496,19 +3634,53 @@ void DTFS_peaktoaverage_fx( Word16 *Qneg /* o : negative peak to ave Q format */ ); -void rshiftHarmBand_fx( DTFS_STRUCTURE *X_fx, Word16 lband_fx, Word16 hband_fx, Word16 shift_fx ); +void rshiftHarmBand_fx( + DTFS_STRUCTURE *X_fx, + Word16 lband_fx, + Word16 hband_fx, + Word16 shift_fx ); -void GetSinCosTab_fx( Word16 L, Word16 *sinTab, Word16 *cosTab ); +void GetSinCosTab_fx( + Word16 L, + Word16 *sinTab, + Word16 *cosTab ); -void r_fft_4_fx( Word16 *farray_ptr_fx, Word16 size, Word16 stage, Word16 isign ); +void r_fft_4_fx( + Word16 *farray_ptr_fx, + Word16 size, + Word16 stage, + Word16 isign ); -void copy_phase_fx( DTFS_STRUCTURE *X1_fx, DTFS_STRUCTURE X2_fx, DTFS_STRUCTURE *retX_fx ); +void copy_phase_fx( + DTFS_STRUCTURE *X1_fx, + DTFS_STRUCTURE X2_fx, + DTFS_STRUCTURE *retX_fx ); -Word32 getSpEngyFromResAmp_fx( DTFS_STRUCTURE *X_fx, Word16 lband, Word16 hband, const Word16 *curr_lpc, Word16 *sin_tab, Word16 *cos_tab ); +Word32 getSpEngyFromResAmp_fx( + DTFS_STRUCTURE *X_fx, + Word16 lband, + Word16 hband, + const Word16 *curr_lpc, + Word16 *sin_tab, + Word16 *cos_tab ); -void DTFS_poleFilter_fx( DTFS_STRUCTURE *X_fx, Word16 *LPC, Word16 N, Word16 *S_fx, Word16 *C_fx ); +void DTFS_poleFilter_fx( + DTFS_STRUCTURE *X_fx, + Word16 *LPC, + Word16 N, + Word16 *S_fx, + Word16 *C_fx ); -void poleFilter_setup_fx( const Word16 *LPC, Word16 N, DTFS_STRUCTURE X_fx, Word16 *S_fx, Word16 *C_fx, Word16 *pf_temp1, Word16 *pf_temp2, Word16 *pf_temp, Word16 *pf_n2_temp1 ); +void poleFilter_setup_fx( + const Word16 *LPC, + Word16 N, + DTFS_STRUCTURE X_fx, + Word16 *S_fx, + Word16 *C_fx, + Word16 *pf_temp1, + Word16 *pf_temp2, + Word16 *pf_temp, + Word16 *pf_n2_temp1 ); Word32 DTFS_getEngy_band_wb_fx( DTFS_STRUCTURE X_fx, @@ -3560,32 +3732,35 @@ void ApplyTnsFilter( Word32 spectrum[], const Word8 fIsAnalysis ); -Word16 ITF_Detect_fx( Word32 const pSpectrum[], - const Word16 startLine, - const Word16 stopLine, - const Word16 maxOrder, - Word16 *A, - Word16 *Q_A, - Word16 *predictionGain, - Word16 *curr_order, - Word16 Q ); - -Word16 ITF_Detect_ivas_fx( Word32 const pSpectrum[], - const Word16 startLine, - const Word16 stopLine, - const Word16 maxOrder, - Word16 *A, - Word16 *Q_A, - Word16 *predictionGain, - Word16 *curr_order, - Word16 Q ); - -void ITF_Apply_fx( Word32 spectrum[], - Word16 startLine, - Word16 stopLine, - const Word16 *A, - Word16 Q_A, - Word16 curr_order ); +Word16 ITF_Detect_fx( + Word32 const pSpectrum[], + const Word16 startLine, + const Word16 stopLine, + const Word16 maxOrder, + Word16 *A, + Word16 *Q_A, + Word16 *predictionGain, + Word16 *curr_order, + Word16 Q ); + +Word16 ITF_Detect_ivas_fx( + Word32 const pSpectrum[], + const Word16 startLine, + const Word16 stopLine, + const Word16 maxOrder, + Word16 *A, + Word16 *Q_A, + Word16 *predictionGain, + Word16 *curr_order, + Word16 Q ); + +void ITF_Apply_fx( + Word32 spectrum[], + Word16 startLine, + Word16 stopLine, + const Word16 *A, + Word16 Q_A, + Word16 curr_order ); void const *GetTnsFilterCoeff( void const *p, const Word16 index, Word16 *pValue ); @@ -3749,10 +3924,6 @@ void nelp_encoder_ivas_fx( Word16 *qIn1, Word16 reduce_gains ); -/*========================================================================================================/ -swb_bwe_enc_lr_fx.c -/========================================================================================================*/ - void swb_bwe_enc_lr_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ const Word32 L_m_core[], /* i : lowband synthesis */ @@ -3803,10 +3974,6 @@ void swb_bwe_enc_lr_ivas_fx( Word16 *ni_seed_fx /* i/o: random seed for search buffer NI */ ); -/*========================================================================================================/ -isf_enc_amr_wb_fx.c -/========================================================================================================*/ - void isf_enc_amr_wb_fx( Encoder_State *st, /* i/o: state structure */ Word16 *isf_new, /* i/o: quantized ISF vector */ @@ -3814,20 +3981,12 @@ void isf_enc_amr_wb_fx( Word16 *Aq /* o : quantized A(z) for 4 subframes */ ); -/*========================================================================================================/ -detect_transient_fx.c -/========================================================================================================*/ - Word16 detect_transient_fx( const Word16 *in_fx, /*Q_new */ const Word16 L, /*Q0*/ Word16 Q_new, Encoder_State *st_fx ); -/*========================================================================================================/ -codec_tcx_common.c -/========================================================================================================*/ - Word16 tcxGetNoiseFillingTilt( const Word16 A[], const Word16 lpcorder, @@ -3865,7 +4024,6 @@ void tcxInvertWindowGrouping( const Word16 frame_cnt, const Word16 bfi ); -// mslvq_com void permute_fx( Word16 *pTmp1, /* i/o: vector whose components are to be permuted */ const Word16 *perm /* i : permutation info (indexes that should be interchanged), max two perms */ @@ -3913,15 +4071,12 @@ Word16 deindex_lvq_cng_ivas_fx( Word16 no_bits /* i: number of bits for lattice */ ); -// lsp_convert_poly_fx.c Word16 lsp_convert_poly_fx( Word16 w[], /* i/o: LSP or ISP parameters */ const Word16 L_frame, /* i : flag for up or down conversion */ const Word16 Opt_AMRWB /* i : flag for the AMR-WB IO mode */ ); - -// cng_exe.c void CNG_exc_fx( const Word32 core_brate, /* i : core bitrate */ const Word16 L_frame, /* i : length of the frame */ @@ -3990,30 +4145,29 @@ void cng_params_upd_fx( ); void cng_params_upd_ivas_fx( - const Word16 lsp_new[], /* i : LSP aprameters Q15 */ - const Word16 exc2[], /* i : current enhanced excitation Q_exc */ - const Word16 L_frame, /* i : frame length Q0 */ - Word16 *ho_circ_ptr, /* i/o: pointer for CNG averaging buffers Q0 */ - Word32 ho_ener_circ[], /* o : energy buffer for CNG averaging Q6 */ - Word16 *ho_circ_size, /* i/o: size of DTX hangover history buffer for averaging Q0 */ - Word16 ho_lsp_circ[], /* o : old LSP buffer for CNG averaging Q15 */ - const Word16 Q_exc, /* i : Q value of excitation */ - const Word16 enc_dec_flag, /* i : Flag indicating encoder or decoder (ENC,DEC) */ - Word32 ho_env_circ[], /* i/o: Envelope buffer */ - Word16 *cng_buf_cnt, /* i/o: Counter of postponed FFT-processing instances */ - Word16 cng_exc2_buf[], /* i/o: Excitation buffer Q_exc */ - Word16 cng_Qexc_buf[], /* i/o: Q_exc buffer Q0 */ - Word32 cng_brate_buf[], /* i/o: last_active_brate buffer Q0 */ - const Word32 last_active_brate /* i : Last active bit rate Q0 */ - , - const Word16 element_mode, /* i : Element mode */ - const Word16 bwidth /* i : Audio bandwidth */ + const Word16 lsp_new[], /* i : LSP aprameters Q15 */ + const Word16 exc2[], /* i : current enhanced excitation Q_exc */ + const Word16 L_frame, /* i : frame length Q0 */ + Word16 *ho_circ_ptr, /* i/o: pointer for CNG averaging buffers Q0 */ + Word32 ho_ener_circ[], /* o : energy buffer for CNG averaging Q6 */ + Word16 *ho_circ_size, /* i/o: size of DTX hangover history buffer for averaging Q0 */ + Word16 ho_lsp_circ[], /* o : old LSP buffer for CNG averaging Q15 */ + const Word16 Q_exc, /* i : Q value of excitation */ + const Word16 enc_dec_flag, /* i : Flag indicating encoder or decoder (ENC,DEC) */ + Word32 ho_env_circ[], /* i/o: Envelope buffer */ + Word16 *cng_buf_cnt, /* i/o: Counter of postponed FFT-processing instances */ + Word16 cng_exc2_buf[], /* i/o: Excitation buffer Q_exc */ + Word16 cng_Qexc_buf[], /* i/o: Q_exc buffer Q0 */ + Word32 cng_brate_buf[], /* i/o: last_active_brate buffer Q0 */ + const Word32 last_active_brate, /* i : Last active bit rate Q0 */ + const Word16 element_mode, /* i : Element mode */ + const Word16 bwidth /* i : Audio bandwidth */ ); + Word16 get_cng_mode( const Word32 last_active_brate /* i : last active bitrate */ ); -// core_com_config.c /*! r: codec mode */ Word16 get_codec_mode( const Word32 total_brate /* i : total bitrate */ @@ -4029,13 +4183,13 @@ Word16 getTcxonly_fx( const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0)*/ const Word16 is_ism_format /* i : flag indicating ISM format */ ); + Word16 getCtxHm( const Word16 element_mode, /* i : IVAS element mode */ const Word32 total_brate, /* i : total bitrate */ const Word16 rf_flag /* i : flag to signal the RF mode */ ); - Word16 getResq( const Word32 total_brate /* i : total bitrate */ ); @@ -4068,7 +4222,8 @@ Word32 getCoreSamplerateMode2( const IVAS_FORMAT is_ism_format /* i : flag indicating ISM format */ ); -Word16 getTcxBandwidth( const Word16 bandwidth ); +Word16 getTcxBandwidth( + const Word16 bandwidth ); Word16 getIgfPresent_fx( const Word16 element_mode, /* i : IVAS element mode */ @@ -4096,7 +4251,8 @@ Word16 initPitchLagParameters( Word16 *pit_fr2, Word16 *pit_max ); -Word16 getNumTcxCodedLines( const Word16 bwidth ); +Word16 getNumTcxCodedLines( + const Word16 bwidth ); Word16 getTcxLpcShapedAri( const Word32 total_brate, /* i : total bitrate */ @@ -4125,8 +4281,8 @@ void mdct_window_aldo( Word16 n /* Q0 */ ); -// tcx_utils.c -Word16 getInvFrameLen( const Word16 L_frame ); /* returns 1/L_frame in Q21 format */ +Word16 getInvFrameLen( + const Word16 L_frame ); /* returns 1/L_frame in Q21 format */ void tcx_get_windows( TCX_CONFIG_HANDLE hTcxCfg, /* i : TCX configuration */ @@ -4232,12 +4388,20 @@ void mdct_noiseShaping_interp( Word16 gains[], Word16 gains_exp[] ); -void PsychAdaptLowFreqDeemph( Word32 x[], - const Word16 lpcGains[], - const Word16 lpcGains_e[], - Word16 lf_deemph_factors[] ); +void PsychAdaptLowFreqDeemph( + Word32 x[], + const Word16 lpcGains[], + const Word16 lpcGains_e[], + Word16 lf_deemph_factors[] ); -void AdaptLowFreqDeemph( Word32 x[], Word16 x_e, Word16 tcx_lpc_shaped_ari, Word16 lpcGains[], Word16 lpcGains_e[], const Word16 lg, Word16 lf_deemph_factors[] ); +void AdaptLowFreqDeemph( + Word32 x[], + Word16 x_e, + Word16 tcx_lpc_shaped_ari, + Word16 lpcGains[], + Word16 lpcGains_e[], + const Word16 lg, + Word16 lf_deemph_factors[] ); void tcx_noise_filling( Word32 *Q, @@ -4298,15 +4462,16 @@ void SetTnsConfig( const Word16 isTCX20, const Word16 isAfterACELP ); -void tcx_get_gain( Word32 *x, /* i: spectrum 1 */ - Word16 x_e, /* i: spectrum 1 exponent */ - Word32 *y, /* i: spectrum 2 */ - Word16 y_e, /* i: spectrum 2 exponent */ - Word16 n, /* i: length */ - Word16 *gain, /* o: gain */ - Word16 *gain_e, /* o: gain exponent */ - Word32 *en_y, /* o: energy of y (optional) */ - Word16 *en_y_e /* o: energy of y exponent (optional) */ +void tcx_get_gain( + Word32 *x, /* i: spectrum 1 */ + Word16 x_e, /* i: spectrum 1 exponent */ + Word32 *y, /* i: spectrum 2 */ + Word16 y_e, /* i: spectrum 2 exponent */ + Word16 n, /* i: length */ + Word16 *gain, /* o: gain */ + Word16 *gain_e, /* o: gain exponent */ + Word32 *en_y, /* o: energy of y (optional) */ + Word16 *en_y_e /* o: energy of y exponent (optional) */ ); void init_TCX_config( @@ -4320,7 +4485,6 @@ void init_TCX_config( void resetTecDec_Fx( TEC_DEC_HANDLE hTecDec ); - void resetTecEnc_Fx( TEC_ENC_HANDLE hTECEnc, Word16 flag ); @@ -4371,7 +4535,10 @@ void tecEnc_TBE_fx( const Word16 *voicing, const Word16 coder_type ); -void set_TEC_TFA_code_fx( const Word16 corrFlag, Word16 *tec_flag, Word16 *tfa_flag ); +void set_TEC_TFA_code_fx( + const Word16 corrFlag, + Word16 *tec_flag, + Word16 *tfa_flag ); // tcx_mdct_fx.c void TCX_MDCT( @@ -4427,8 +4594,8 @@ void TCX_MDXT_Inverse_fx( #define EDCT_FACTOR_SCALE 2 void edct_fx( const Word32 *x, /* i : i signal Qq */ - Word32 *y, /* o : output transform Qq */ - Word16 length, /* i : length */ + Word32 *y, /* o : output transform Qq */ + Word16 length, /* i : length */ Word16 *q /* i : Q value of i signal */ ); @@ -4441,23 +4608,23 @@ void edct_ivas_fx( void edst_fx( const Word32 *x, /* i : i signal Qq */ - Word32 *y, /* o : output transform Qq */ - Word16 length, /* i : length */ + Word32 *y, /* o : output transform Qq */ + Word16 length, /* i : length */ Word16 *q /* i : Q value of i signal */ ); void edct_16fx( const Word16 *x, /* i : i signal Qx */ Word16 *y, /* o : output transform Qx */ - Word16 length, /* i : length */ - Word16 bh, /* bit-headroom */ + Word16 length, /* i : length */ + Word16 bh, /* bit-headroom */ const Word16 element_mode ); void iedct_short_fx( const Word32 *in, /* i : i vector */ Word16 *Q, /* i/o: Q value of i */ - Word32 *out, /* o : output vector */ - const Word16 segment_length /* i : length */ + Word32 *out, /* o : output vector */ + const Word16 segment_length /* i : length */ ); void edxt_fx( @@ -4639,28 +4806,32 @@ void cldfbSynthesis_fx( Word32 *pWorkBuffer /*!< pointer to temporal working buffer */ ); -void configureCldfb( HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< CLDFB Handle */ - const Word16 no_channels, /*!< Number of critically sampled bands */ - const Word16 frameSize /*!< FrameSize */ +void configureCldfb( + HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< CLDFB Handle */ + const Word16 no_channels, /*!< Number of critically sampled bands */ + const Word16 frameSize /*!< FrameSize */ ); -ivas_error openCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb, /*!< CLDFB Handle */ - const Word16 type, /*!< analysis or synthesis */ - const Word16 maxCldfbBands, /*!< number of cldfb bands */ - const Word16 frameSize /*!< FrameSize */ +ivas_error openCldfb( + HANDLE_CLDFB_FILTER_BANK *h_cldfb, /*!< CLDFB Handle */ + const Word16 type, /*!< analysis or synthesis */ + const Word16 maxCldfbBands, /*!< number of cldfb bands */ + const Word16 frameSize /*!< FrameSize */ ); + void resampleCldfb( HANDLE_CLDFB_FILTER_BANK hs, /*!< CLDFB Handle */ const Word16 newCldfbBands, /*!< number of cldfb bands */ const Word16 frameSize, /*!< FrameSize */ const Word8 firstFrame ); -Word16 -AnalysisPostSpectrumScaling_Fx( HANDLE_CLDFB_FILTER_BANK cldfbBank, - Word32 **rSubband32, - Word32 **iSubband32, - Word16 **rSubband16, - Word16 **iSubband16, - Word16 *cldfbScale ); + +Word16 AnalysisPostSpectrumScaling_Fx( + HANDLE_CLDFB_FILTER_BANK cldfbBank, + Word32 **rSubband32, + Word32 **iSubband32, + Word16 **rSubband16, + Word16 **iSubband16, + Word16 *cldfbScale ); void analysisCldfbEncoder_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ @@ -4673,30 +4844,36 @@ void analysisCldfbEncoder_fx( Word16 *enerBuffSum_exp, CLDFB_SCALE_FACTOR *scale ); -void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q31 | pointer to the result in the core look-ahead slot */ - Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot - apply as negative exponent*/ - const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ - Word16 **realValues, /*!< i: Q15 | the real part of the CLDFB subsamples */ - Word16 **imagValues, /*!< i: Q15 | the imaginary part of the CLDFB subsamples */ - Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ - Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ - Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ - Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ - Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ - Word32 *energyValuesSum, /*!< o: Q31 | pointer to sum array of energy values, not initialized*/ - Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ - TEC_ENC_HANDLE hTECEnc ); +void GetEnergyCldfb( + Word32 *energyLookahead, /*!< o: Q31 | pointer to the result in the core look-ahead slot */ + Word16 *sf_energyLookahead, /*!< o: pointer to the scalefactor of the result in the core look-ahead slot - apply as negative exponent*/ + const Word16 numLookahead, /*!< i: Q0 the number of look-ahead time-slots */ + Word16 **realValues, /*!< i: Q15 | the real part of the CLDFB subsamples */ + Word16 **imagValues, /*!< i: Q15 | the imaginary part of the CLDFB subsamples */ + Word16 sf_Values, /*!< i: scalefactor of the CLDFB subcamples - apply as a negated Exponent */ + Word16 numberBands, /*!< i: Q0 | number of CLDFB bands */ + Word16 numberCols, /*!< i: Q0 | number of CLDFB subsamples */ + Word32 *energyHF, /*!< o: Q31 | pointer to HF energy */ + Word16 *energyHF_Exp, /*!< o: pointer to exponent of HF energy */ + Word32 *energyValuesSum, /*!< o: Q31 | pointer to sum array of energy values, not initialized*/ + Word16 *energyValuesSum_Exp, /*!< o: pointer to exponents of energyValuesSum, not initialized */ + TEC_ENC_HANDLE hTECEnc ); -Word16 -CLDFB_getNumChannels( Word32 sampleRate ); +Word16 CLDFB_getNumChannels( + Word32 sampleRate ); + +void deleteCldfb( + HANDLE_CLDFB_FILTER_BANK *h_cldfb ); /*!< CLDFB Handle */ + +ivas_error cldfb_save_memory( + HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ -void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ); /*!< CLDFB Handle */ +void cldfb_restore_memory( + HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ -ivas_error cldfb_save_memory( HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ -void cldfb_restore_memory( HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ -void cldfb_reset_memory( HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ +void cldfb_reset_memory( + HANDLE_CLDFB_FILTER_BANK hs ); /* i/o: cldfb handle */ -// bits_alloc.c from IVAS void BITS_ALLOC_init_config_acelp( const Word32 bit_rate, const Word16 narrowBand, @@ -4720,7 +4897,7 @@ Word16 set_ACELP_flag( const Word16 bwidth, /* i : audio bandwidth */ const Word16 cng_type /* i : CNG type */ ); -// syn_128_fx.c + void syn_12k8_fx( Word16 L_frame, const Word16 *Aq, /* i : LP filter coefficients Q12 */ @@ -4732,14 +4909,15 @@ void syn_12k8_fx( const Word16 Q_exc, /* i : Excitation scaling Q0 */ const Word16 Q_syn /* i : Synthesis scaling Q0 */ ); -// est_tilt_fx.c -Word16 est_tilt_fx( /* o : tilt of the code Q15 */ - const Word16 *exc, /* i : adaptive excitation vector Qx */ - const Word16 gain_pit, /* i : adaptive gain Q14 */ - const Word16 *code, /* i : algebraic exctitation vector Q9 */ - const Word32 gain_code, /* i : algebraic code gain Q16 */ - Word16 *voice_fac, /* o : voicing factor Q15 */ - const Word16 Q_exc /* i : Scaling factor of excitation Q0 */ + +/* o : tilt of the code Q15 */ +Word16 est_tilt_fx( + const Word16 *exc, /* i : adaptive excitation vector Qx */ + const Word16 gain_pit, /* i : adaptive gain Q14 */ + const Word16 *code, /* i : algebraic exctitation vector Q9 */ + const Word32 gain_code, /* i : algebraic code gain Q16 */ + Word16 *voice_fac, /* o : voicing factor Q15 */ + const Word16 Q_exc /* i : Scaling factor of excitation Q0 */ ); /* o : tilt of the code Q15 */ @@ -4754,26 +4932,28 @@ Word16 est_tilt_ivas_fx( const Word16 flag_tilt /* i : flag for special tilt */ ); -Word16 Est_tilt2( /* o : tilt of the code */ - const Word16 *exc, /* i : adaptive excitation vector Qx */ - const Word16 gain_pit, /* i : adaptive gain Q14 */ - const Word16 *code, /* i : algebraic exctitation vector Q9 */ - const Word32 gain_code, /* i : algebraic code gain Q16 */ - Word16 *voice_fac, /* o : voicing factor Q15 */ - const Word16 Q_exc /* i : Scaling factor of excitation Q0 */ +/* o : tilt of the code */ +Word16 Est_tilt2( + const Word16 *exc, /* i : adaptive excitation vector Qx */ + const Word16 gain_pit, /* i : adaptive gain Q14 */ + const Word16 *code, /* i : algebraic exctitation vector Q9 */ + const Word32 gain_code, /* i : algebraic code gain Q16 */ + Word16 *voice_fac, /* o : voicing factor Q15 */ + const Word16 Q_exc /* i : Scaling factor of excitation Q0 */ ); -void E_UTIL_voice_factor( Word16 *exc, /* i : pointer to the excitation frame Q_new */ - Word16 i_subfr, /* i : subframe index */ - Word16 *code, /* i : innovative codebook Q9 */ - Word16 gain_pit, /* i : adaptive codebook gain 1Q14 */ - Word32 gain_code, /* i : innovative cb. gain 15Q16 */ - Word16 *voice_fac, /* o : subframe voicing estimation Q15 */ - Word16 *tilt_code, /* o : tilt factor Q15 */ - Word16 L_subfr, /* i : subframe length */ - Word16 flag_tilt, /* i : Flag for triggering new voice factor tilt*/ - Word16 Q_new, /* i : excitation buffer format */ - Word16 shift /* i : scaling to get 12bit */ +void E_UTIL_voice_factor( + Word16 *exc, /* i : pointer to the excitation frame Q_new */ + Word16 i_subfr, /* i : subframe index */ + Word16 *code, /* i : innovative codebook Q9 */ + Word16 gain_pit, /* i : adaptive codebook gain 1Q14 */ + Word32 gain_code, /* i : innovative cb. gain 15Q16 */ + Word16 *voice_fac, /* o : subframe voicing estimation Q15 */ + Word16 *tilt_code, /* o : tilt factor Q15 */ + Word16 L_subfr, /* i : subframe length */ + Word16 flag_tilt, /* i : Flag for triggering new voice factor tilt*/ + Word16 Q_new, /* i : excitation buffer format */ + Word16 shift /* i : scaling to get 12bit */ ); // window_ola_fx.c @@ -4819,7 +4999,6 @@ void window_ola_ext_fx( const UWord16 kernel_type /* i : transform kernel type */ ); -// cb_shape_fx.c void cb_shape_fx( const Word16 preemphFlag, /* i : flag for pre-emphasis */ const Word16 pitchFlag, /* i : flag for pitch sharpening */ @@ -4836,7 +5015,6 @@ void cb_shape_fx( const Word16 L_subfr /* i : subframe lenght */ ); -// longarith.c void longadd( UWord16 a[], /* i/o: vector of the length lena */ const UWord16 b[], /* i/o: vector of the length lenb */ @@ -4864,7 +5042,6 @@ void longshr( Word16 bits, Word16 len ); -// gs_bitallocation.c void bands_and_bit_alloc_fx( const Word16 cor_strong_limit, /* i : HF correlation */ const Word16 noise_lev, /* i : dwn scaling factor */ @@ -4887,7 +5064,6 @@ void bands_and_bit_alloc_fx( const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); -// low_rate_band_att_fx.c void fine_gain_pred_fx( const Word16 *sfm_start, /* i : Sub band start indices */ const Word16 *sfm_end, /* i : Sub band end indices */ @@ -4921,6 +5097,7 @@ void get_max_pulses_fx( Word16 *inp_vector, /* i/o: Encoded shape vectors (int)Q0*/ Word16 *maxpulse /* o : Maximum pulse height per band Q0*/ ); + void fine_gain_dec_fx( Decoder_State *st, const Word16 *ord, /* i : Indices for energy order */ @@ -4929,17 +5106,16 @@ void fine_gain_dec_fx( Word16 *fg_pred /* i/o: Predicted gains / Corrected gains Q12*/ ); -// fine_gain_bits_fx.c -Word16 assign_gain_bits_fx( /* o : Number of assigned gain bits */ - const Word16 core, /* i : HQ core */ - const Word16 BANDS, /* i : Number of bands */ - const Word16 *band_width, /* i : Sub band bandwidth */ - Word16 *Rk, /* i/o: Bit allocation/Adjusted bit alloc. Q3 */ - Word16 *gain_bits_array, /* o : Assigned gain bits */ - Word16 *Rcalc /* o : Bit budget for shape quantizer Q3 */ +/* o : Number of assigned gain bits */ +Word16 assign_gain_bits_fx( + const Word16 core, /* i : HQ core */ + const Word16 BANDS, /* i : Number of bands */ + const Word16 *band_width, /* i : Sub band bandwidth */ + Word16 *Rk, /* i/o: Bit allocation/Adjusted bit alloc. Q3 */ + Word16 *gain_bits_array, /* o : Assigned gain bits */ + Word16 *Rcalc /* o : Bit budget for shape quantizer Q3 */ ); -// gs_noisefill.c void freq_dnw_scaling_fx( const Word16 cor_strong_limit, /* i : HF correlation */ const Word16 coder_type, /* i : coder type */ @@ -5014,7 +5190,6 @@ void highband_exc_dct_in_ivas_fx( const Word16 GSC_IVAS_mode /* i : GSC IVAS mode */ ); -// lsf_dec_bfi_fx.c void lsf_dec_bfi( const Word16 codec_mode, /* i: : codec mode: MODE1 | MODE2 */ Word16 *lsf, /*!< o : 14Q1*1.28 quantized ISFs */ @@ -5038,18 +5213,22 @@ void lsf_dec_bfi( const short bwidth /* i: coded bandwidth */ ); -Word16 const *PlcGetLsfBase( Word16 const lpcQuantization, - Word16 const narrowBand, - Word32 const sr_core ); +Word16 const *PlcGetLsfBase( + Word16 const lpcQuantization, + Word16 const narrowBand, + Word32 const sr_core ); -// fd_cng_com.c /* Create an instance of type FD_CNG */ -ivas_error createFdCngCom_fx( HANDLE_FD_CNG_COM *hFdCngCom ); +ivas_error createFdCngCom_fx( + HANDLE_FD_CNG_COM *hFdCngCom ); -void initFdCngCom( HANDLE_FD_CNG_COM hFdCngCom, Word16 scale ); +void initFdCngCom( + HANDLE_FD_CNG_COM hFdCngCom, + Word16 scale ); /* Delete the instance of type FD_CNG */ -void deleteFdCngCom_fx( HANDLE_FD_CNG_COM *hFdCngCom ); +void deleteFdCngCom_fx( + HANDLE_FD_CNG_COM *hFdCngCom ); /* Initialize the spectral partitioning */ void initPartitions( @@ -5092,27 +5271,28 @@ void expand_range_var_exp( Word16 *out_exp, const Word16 len ); -void minimum_statistics( Word16 len, /* i : Total number of partitions (CLDFB or FFT) */ - Word16 lenFFT, /* i : Number of FFT partitions */ - Word16 *psize, /* i : Partition sizes, fractional */ - Word16 *msPeriodog, /* i : Periodogram (energies) */ - Word16 *msNoiseFloor, /* i/o: Noise floors (energies) */ - Word16 *msNoiseEst, /* i/o: Noise estimates (energies) */ - Word32 *msAlpha, /* i/o: Forgetting factors */ - Word16 *msPsd, /* i/o: Power Spectral Density (smoothed periodogram => energies) */ - Word16 *msPsdFirstMoment, /* i/o: PSD statistics of 1st order (energy means) */ - Word32 *msPsdSecondMoment, /* i/o: PSD statistics of 2nd order (energy variances) */ - Word32 *msMinBuf, /* i/o: Buffer of minima (energies) */ - Word32 *msBminWin, /* o : Bias correction factors */ - Word32 *msBminSubWin, /* o : Bias correction factors */ - Word32 *msCurrentMin, /* i/o: Local minima (energies) */ - Word32 *msCurrentMinOut, /* i/o: Local minima (energies) */ - Word32 *msCurrentMinSubWindow, /* i/o: Local minima (energies) */ - Word16 *msLocalMinFlag, /* i : Binary flag */ - Word16 *msNewMinFlag, /* i : Binary flag */ - Word16 *msPeriodogBuf, /* i/o: Buffer of periodograms (energies) */ - Word16 *msPeriodogBufPtr, /* i/o: Counter */ - HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing buffers and variables */ +void minimum_statistics( + Word16 len, /* i : Total number of partitions (CLDFB or FFT) */ + Word16 lenFFT, /* i : Number of FFT partitions */ + Word16 *psize, /* i : Partition sizes, fractional */ + Word16 *msPeriodog, /* i : Periodogram (energies) */ + Word16 *msNoiseFloor, /* i/o: Noise floors (energies) */ + Word16 *msNoiseEst, /* i/o: Noise estimates (energies) */ + Word32 *msAlpha, /* i/o: Forgetting factors */ + Word16 *msPsd, /* i/o: Power Spectral Density (smoothed periodogram => energies) */ + Word16 *msPsdFirstMoment, /* i/o: PSD statistics of 1st order (energy means) */ + Word32 *msPsdSecondMoment, /* i/o: PSD statistics of 2nd order (energy variances) */ + Word32 *msMinBuf, /* i/o: Buffer of minima (energies) */ + Word32 *msBminWin, /* o : Bias correction factors */ + Word32 *msBminSubWin, /* o : Bias correction factors */ + Word32 *msCurrentMin, /* i/o: Local minima (energies) */ + Word32 *msCurrentMinOut, /* i/o: Local minima (energies) */ + Word32 *msCurrentMinSubWindow, /* i/o: Local minima (energies) */ + Word16 *msLocalMinFlag, /* i : Binary flag */ + Word16 *msNewMinFlag, /* i : Binary flag */ + Word16 *msPeriodogBuf, /* i/o: Buffer of periodograms (energies) */ + Word16 *msPeriodogBufPtr, /* i/o: Counter */ + HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing buffers and variables */ ); void minimum_statistics_fx( @@ -5260,9 +5440,12 @@ void ivas_updt_dec_common_fx( ); /* Random generator with Gaussian distribution with mean 0 and std 1 */ -Word32 rand_gauss( Word16 *seed ); +Word32 rand_gauss( + Word16 *seed ); -Word16 rand_gauss_fix( Word16 *x, Word16 *seed ); +Word16 rand_gauss_fix( + Word16 *x, + Word16 *seed ); void lpc_from_spectrum( HANDLE_FD_CNG_COM hFdCngCom, @@ -5295,7 +5478,6 @@ void FdCng_exc( Word16 *bwe_exc /* o: LP excitation for BWE */ ); -// trans_direct void direct_transform_fx( const Word32 in32_fx[], Word32 out32_fx[], @@ -5304,7 +5486,6 @@ void direct_transform_fx( Word16 *Q, const Word16 element_mode ); -// trans_inv_fx.c void preecho_sb_fx( const Word32 brate, /* i Q0 : core bit-rate */ Word32 *wtda_audio_fx, /* i q_sig32 : imdct signal */ @@ -5333,7 +5514,6 @@ void Inverse_Transform( const Word16 element_mode /* i : IVAS element mode */ ); -// recovernorm void recovernorm_fx( const Word16 *idxbuf, /* i : reordered quantization indices Q0*/ Word16 *ynrm, /* o : recovered quantization indices Q0*/ @@ -5398,9 +5578,16 @@ void decode_magnitude_usq_fx( ARCODEC *pardec, Word16 size, Word16 npulses, Word void decode_mangitude_tcq_fx( ARCODEC *pardec, Word16 size, Word16 npulses, Word16 nzpos, Word16 *positions, Word16 *out, Word32 *surplus_fx ); void decode_signs_fx( ARCODEC *pardec, Word16 size, Word16 *out ); -Word16 GetScale_fx( Word16 blen, Word32 bits_fx, Word32 *surplus_fx ); +Word16 GetScale_fx( + Word16 blen, + Word32 bits_fx, + Word32 *surplus_fx ); -void srt_vec_ind_fx( const Word32 *linear, Word32 *srt, Word16 *I, Word16 length ); +void srt_vec_ind_fx( + const Word32 *linear, + Word32 *srt, + Word16 *I, + Word16 length ); // fill_spectrum void fill_spectrum_fx( @@ -5487,12 +5674,12 @@ Word16 BitAllocF_fx( const Word16 hqswb_clas, /* i : hq swb class */ const Word16 num_env_bands /* i : Number sub bands to be encoded for HQ_SWB_BWE */ ); -Word16 BitAllocWB_fx( /* o : t Q0*/ - Word16 *y, /* i : norm of sub-vectors Q0*/ - Word16 B, /* i : number of available bits Q0*/ - Word16 N, /* i : number of sub-vectors Q0*/ - Word16 *R, /* o : bit-allocation indicator Q0*/ - Word16 *Rsubband_fx /* o : sub-band bit-allocation vector Q3*/ +Word16 BitAllocWB_fx( + Word16 *y, /* i : norm of sub-vectors Q0*/ + Word16 B, /* i : number of available bits Q0*/ + Word16 N, /* i : number of sub-vectors Q0*/ + Word16 *R, /* o : bit-allocation indicator Q0*/ + Word16 *Rsubband_fx /* o : sub-band bit-allocation vector Q3*/ ); // bitallocsum_fx.c void bitallocsum_fx( @@ -5505,7 +5692,6 @@ void bitallocsum_fx( const Word16 *sfmsize /* i : band length Q0 */ ); - // stab_est_fx.c Word16 stab_est_fx( Word16 etot, /* i : Total energy of the current frame Q8*/ @@ -5575,7 +5761,6 @@ Word16 E_UTIL_enhancer( Word16 L_frame, /* i : frame size */ Word16 Q_new ); - // phase_dispersion_fx.c void phase_dispersion( const Word32 gain_code, /* i : gain of code 15Q16 */ @@ -5673,22 +5858,24 @@ Word16 IGF_MapBitRateToIndex( const Word16 rf_mode /* i : flag to signal the RF mode */ ); -void IGFCommonFuncsCalcSfbEnergyPowerSpec( const Word16 startSfb, /**< in: Q0 | start sfb index */ - const Word16 stopSfb, /**< in: Q0 | stop sfb index */ - const Word16 *swb_offset, /**< in: Q0 | IGF swb offset table */ - Word32 *pPowerSpectrum, /**< in: Q31 | power spectrum */ - Word16 *pPowerSpectrum_exp, /**< in: | Exponent of PowerSpectrum */ - Word32 *sfbEnergy, /**< out:Q31 | SFB energies , will be initialized inside this function */ - Word16 *sfbEnergy_exp /**< out: | Exponent of PowerSpectrum */ +void IGFCommonFuncsCalcSfbEnergyPowerSpec( + const Word16 startSfb, /**< in: Q0 | start sfb index */ + const Word16 stopSfb, /**< in: Q0 | stop sfb index */ + const Word16 *swb_offset, /**< in: Q0 | IGF swb offset table */ + Word32 *pPowerSpectrum, /**< in: Q31 | power spectrum */ + Word16 *pPowerSpectrum_exp, /**< in: | Exponent of PowerSpectrum */ + Word32 *sfbEnergy, /**< out:Q31 | SFB energies , will be initialized inside this function */ + Word16 *sfbEnergy_exp /**< out: | Exponent of PowerSpectrum */ ); -void IGFCommonFuncsMDCTSquareSpec( const Word16 sqrtBgn, /**< in: Q0 | start MDCT subband index */ - const Word16 sqrtEnd, /**< in: Q0 | stop MDCT subband index */ - const Word32 *mdctSpec, /**< in: | MDCT spectrum to square */ - const Word16 mdctSpec_e, /**< in: | exponent of mdctSpectrum */ - Word32 *mdctSquareSpec, /**< out: | MDCT square spectrum */ - Word16 *mdctSquareSpec_e, /**< out: | exponent of mdctSquareSpec */ - Word16 indexOffset /**< in: Q0 | index offset */ +void IGFCommonFuncsMDCTSquareSpec( + const Word16 sqrtBgn, /**< in: Q0 | start MDCT subband index */ + const Word16 sqrtEnd, /**< in: Q0 | stop MDCT subband index */ + const Word32 *mdctSpec, /**< in: | MDCT spectrum to square */ + const Word16 mdctSpec_e, /**< in: | exponent of mdctSpectrum */ + Word32 *mdctSquareSpec, /**< out: | MDCT square spectrum */ + Word16 *mdctSquareSpec_e, /**< out: | exponent of mdctSquareSpec */ + Word16 indexOffset /**< in: Q0 | index offset */ ); void IGFCommonFuncsMDCTSquareSpec_ivas( @@ -5733,16 +5920,26 @@ Word16 IGFCommonFuncsIGFGetCFTables_fx( const Word16 **cf_off_se11 /* o : offsets for CF tables above */ ); // ari_fx.c -Word32 L_multi31x16_X2( Word16 xh, Word16 xl, Word16 y ); +Word32 L_multi31x16_X2( + Word16 xh, + Word16 xl, + Word16 y ); + Word32 mul_sbc_14bits( Word32 r, /* Q0 */ Word16 c /* Q0 */ ); // window.c -void ham_cos_window( Word16 *fh, const Word16 n1, const Word16 n2 ); +void ham_cos_window( + Word16 *fh, + const Word16 n1, + const Word16 n2 ); -void ham_cos_window_ivas( Word16 *fh, const Word16 n1, const Word16 n2 ); +void ham_cos_window_ivas( + Word16 *fh, + const Word16 n1, + const Word16 n2 ); // arith_coder_fx.c Word32 expfp( /* o: Q31 */ @@ -5776,21 +5973,23 @@ void tcx_arith_render_envelope( ); -// gain_inov_fx.c -Word32 calc_gain_inov( /* returns innovation gain Q16 */ - const Word16 *code, /* i : algebraic excitation Q9 */ - const Word16 lcode, /* i : Subframe size Q0 */ - Word32 *dotp, /* o : intermediate result Q31-e */ - Word16 *dotp_e /* o : intermediate result exponent Q0 */ +/* returns innovation gain Q16 */ +Word32 calc_gain_inov( + const Word16 *code, /* i : algebraic excitation Q9 */ + const Word16 lcode, /* i : Subframe size Q0 */ + Word32 *dotp, /* o : intermediate result Q31-e */ + Word16 *dotp_e /* o : intermediate result exponent Q0 */ ); + /////////////////////////////////// /* Lib_dec */ ////////////////////////////////// -// swb_tbe_dec.c + void ResetSHBbuffer_Dec_fx( TD_BWE_DEC_HANDLE hBWE_TD, /* i/o: TD BWE data handle */ const Word16 extl /* i : BWE extension layer */ ); + void wb_tbe_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 coder_type, /* i : coding type */ @@ -5916,6 +6115,7 @@ void v_multc_fixed( Word32 y[], /* o : Output vector that contains c*x */ const Word16 N /* i : Vector length */ ); + void v_multc_fixed_16( const Word32 x[], /* i : Input vector */ const Word16 c, /* i : Constant */ @@ -6040,8 +6240,8 @@ void lsf_end_dec_fx( Word16 *qlsf, /* o : quantized LSFs in the cosine domain Qx2.56*/ Word16 *lpc_param, /* i : LPC parameters Q0*/ Word16 *LSF_Q_prediction, /* o : LSF prediction mode Q0*/ - Word16 *nb_indices /* o : number of indices Q0*/ - , + Word16 *nb_indices, /* o : number of indices Q0*/ + const Word16 tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel Qx*/ ); @@ -6453,7 +6653,6 @@ void Init_post_filter_fx( PFSTAT_HANDLE hPFstat /* i : core decoder parameters */ ); /* i : core decoder parameters */ - void nb_post_filt_fx( const Word16 L_frame, /* i : frame length */ PFSTAT_HANDLE hPFstat, /* i : core decoder parameters */ @@ -6477,6 +6676,7 @@ void formant_post_filt_fx( const Word32 brate, /* (i) : bit-rate */ const Word16 off_flag /* i : off flag */ ); + void Filt_mu_fx( Word16 *sig_in, /* i : signal (beginning at sample -1) */ Word16 *sig_out, /* o : signal with tilt */ @@ -6490,6 +6690,7 @@ void Filt_mu_ivas_fx( Word16 parcor0, /* i : parcor0 (mu = parcor0 * gamma3) */ Word16 L_subfr, /* i : the length of subframe */ const Word16 extl ); + void scale_st_fx( const Word16 *sig_in, /* i : postfilter i signal */ Word16 *sig_out, /* i/o: postfilter o signal */ @@ -6501,6 +6702,7 @@ void blend_subfr2_fx( Word16 *sigIn2, /* i : i signal for fade-in */ Word16 *sigOut /* o : output signal */ ); + void init_tcx_window_cfg_fx( TCX_CONFIG_HANDLE hTcxCfg, /* i : TCX Config handle */ const Word32 sr_core, /* i : SR core */ @@ -6531,8 +6733,6 @@ void init_tcx_cfg_fx( const Word16 MCT_flag /* i : hMCT handle allocated (1) or not (0) */, const Word16 fscaleFB ); -// syn_outp_fx.c - void syn_output_fx( const Word16 codec_mode, /* i : MODE1 or MODE2 */ Word16 *synth, /* i/o: fixed point synthesis signal Q_syn2 */ @@ -6567,6 +6767,7 @@ void bass_psfilter_fx( Word16 Q_syn, Word16 bpf_noise_buf[] /* o : BPF error signal (at int_fs) Qx*/ ); + void addBassPostFilter_fx( const Word16 *harm_timeIn_Fx, /* timeIn_e */ Word32 **rAnalysis_Fx, /* Qx - 5 */ @@ -6798,14 +6999,14 @@ void transf_cdbk_dec_fx( Word16 code_preQ[], /* o : prequantizer excitation (Q8) */ Word16 *unbits /* o : number of AVQ unused bits */ ); -Word16 gain_dequant_fx( /* o: decoded gain */ - Word16 index, /* i: quantization index */ - const Word16 min, /* i: value of lower limit */ - const Word16 max, /* i: value of upper limit */ - const Word16 bits, /* i: number of bits to dequantize */ - Word16 *expg ); -// avq_dec_fx.c +/* o: decoded gain */ +Word16 gain_dequant_fx( + Word16 index, /* i: quantization index */ + const Word16 min, /* i: value of lower limit */ + const Word16 max, /* i: value of upper limit */ + const Word16 bits, /* i: number of bits to dequantize */ + Word16 *expg ); void AVQ_demuxdec_fx( Decoder_State *st, /* i/o: decoder state structure */ @@ -6832,7 +7033,10 @@ void re8_dec_fx( ); // lead_deindexing_fx.c -void re8_decode_base_index_fx( const Word16 n, UWord16 I, Word16 *x ); +void re8_decode_base_index_fx( + const Word16 n, + UWord16 I, + Word16 *x ); // re8_utils_fx.c void re8_k2y_fx( @@ -6870,25 +7074,25 @@ void dec_pit_exc_fx( const Word16 tdm_Pri_pitch_buf[] /* i : primary channel pitch buffer */ ); -// pit_dec_fx.c -Word32 Mode2_pit_decode( /* o: pitch value Q16 */ - const Word16 coder_type, /* i: coding model */ - Word16 i_subfr, /* i: subframe index */ - Word16 L_subfr, - Word16 **pt_indice, /* i/o: quantization indices pointer */ - Word16 *T0, /* i/o: close loop integer pitch Q0 */ - Word16 *T0_frac, /* o: close loop fractional part of the pitch Q0 */ - Word16 *T0_res, /* i/o: pitch resolution Q0 */ - Word16 *T0_min, /* i/o: lower limit for close-loop search Q0 */ - Word16 *T0_min_frac, /* i/o: lower limit for close-loop search Q0 */ - Word16 *T0_max, /* i/o: higher limit for close-loop search Q0 */ - Word16 *T0_max_frac, /* i/o: higher limit for close-loop search Q0 */ - Word16 pit_min, - Word16 pit_fr1, - Word16 pit_fr1b, - Word16 pit_fr2, - Word16 pit_max, - Word16 pit_res_max ); +/* o: pitch value Q16 */ +Word32 Mode2_pit_decode( + const Word16 coder_type, /* i: coding model */ + Word16 i_subfr, /* i: subframe index */ + Word16 L_subfr, + Word16 **pt_indice, /* i/o: quantization indices pointer */ + Word16 *T0, /* i/o: close loop integer pitch Q0 */ + Word16 *T0_frac, /* o: close loop fractional part of the pitch Q0 */ + Word16 *T0_res, /* i/o: pitch resolution Q0 */ + Word16 *T0_min, /* i/o: lower limit for close-loop search Q0 */ + Word16 *T0_min_frac, /* i/o: lower limit for close-loop search Q0 */ + Word16 *T0_max, /* i/o: higher limit for close-loop search Q0 */ + Word16 *T0_max_frac, /* i/o: higher limit for close-loop search Q0 */ + Word16 pit_min, + Word16 pit_fr1, + Word16 pit_fr1b, + Word16 pit_fr2, + Word16 pit_max, + Word16 pit_res_max ); void Mode2_abs_pit_dec( Word16 *T0, /* o: integer pitch lag Q0 */ @@ -6937,9 +7141,8 @@ void pit_Q_dec_fx( Word16 *T0, /* o : integer pitch lag */ Word16 *T0_frac, /* o : pitch fraction */ Word16 *T0_min, /* i/o: delta search min */ - Word16 *T0_max /* i/o: delta search max */ - , - Word16 *BER_detect /* o : BER detect flag */ + Word16 *T0_max, /* i/o: delta search max */ + Word16 *BER_detect /* o : BER detect flag */ ); void pit16k_Q_dec_fx( @@ -6949,9 +7152,8 @@ void pit16k_Q_dec_fx( Word16 *T0, /* o : integer pitch lag */ Word16 *T0_frac, /* o : pitch fraction */ Word16 *T0_min, /* i/o: delta search min */ - Word16 *T0_max /* i/o: delta search max */ - , - Word16 *BER_detect /* o : BER detect flag */ + Word16 *T0_max, /* i/o: delta search max */ + Word16 *BER_detect /* o : BER detect flag */ ); void abs_pit_dec_fx( @@ -7024,15 +7226,18 @@ void inov_decode_ivas_fx( Word16 *code, /* o : algebraic excitation Q12 */ const Word16 L_subfr /* i : subframe length Q0 */ ); -// dec4t64_fx.c + void dec_acelp_4t64_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 nbbits, /* i : number of bits per codebook */ Word16 code[], /* o : algebraic (fixed) codebook excitation Q9*/ const Word16 Opt_AMR_WB ); -void D_ACELP_decode_43bit_fx( UWord16 idxs[], Word16 code[], Word16 *pulsestrack ); -// dec_acelp_fx.c +void D_ACELP_decode_43bit_fx( + UWord16 idxs[], + Word16 code[], + Word16 *pulsestrack ); + void D_ACELP_indexing_fx( Word16 code[], PulseConfig config, @@ -7040,9 +7245,13 @@ void D_ACELP_indexing_fx( Word16 index[], Word16 *BER_detect ); -void fcb_pulse_track_joint_decode_fx( UWord16 *idxs, Word16 wordcnt, UWord32 *index_n, Word16 *pulse_num, Word16 track_num ); +void fcb_pulse_track_joint_decode_fx( + UWord16 *idxs, + Word16 wordcnt, + UWord32 *index_n, + Word16 *pulse_num, + Word16 track_num ); -// dec2t32_fx.c void dec_acelp_2t32_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 code[] /* o: algebraic (fixed) codebook excitation */ @@ -7050,12 +7259,10 @@ void dec_acelp_2t32_fx( void dec_acelp_1t64_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ - Word16 code[] /* o: algebraic (fixed) codebook excitation Q12*/ - , - const Word16 L_subfr /* i : sub frame lenght*/ + Word16 code[], /* o: algebraic (fixed) codebook excitation Q12*/ + const Word16 L_subfr /* i : sub frame lenght*/ ); -// acelp_core_switch)dec_fx.c ivas_error acelp_core_switch_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 *synth_subfr_out, /* o : synthesized ACELP subframe Q_syn*/ @@ -7077,7 +7284,6 @@ ivas_error acelp_core_switch_dec_bfi_ivas_fx( const Word16 coder_type /* i : coder type */ ); -// pred_lt4_fx.c void pred_lt4( const Word16 excI[], /* in : excitation buffer Q_exc*/ Word16 excO[], /* out: excitation buffer Q_exc*/ @@ -7109,7 +7315,6 @@ void pred_lt4_tc_fx( const Word16 i_subfr /* i : subframe index Q0*/ ); -// pvq_cored_dec void pvq_decode_frame_fx( Decoder_State *st_fx, Word16 *coefs_quant, /* o : quantized coefficients */ @@ -7139,7 +7344,6 @@ Word16 pvq_core_dec_fx( Word16 *maxpulse, const Word16 core ); - Word16 ivas_pvq_core_dec_fx( Decoder_State *st_fx, const Word16 *sfm_start, @@ -7167,18 +7371,19 @@ void decode_energies_fx( Word16 dim, const Word16 strict_bits ); -// range_drc_fx.c void rc_dec_init_fx( Decoder_State *st_fx, /* i/o: Decoder State */ PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ Word16 tot_bits /* i : Total bit budget */ ); -UWord32 rc_decode_fx( /* o : Decoded cumulative frequency */ - Word16 *BER_detect, /* o : Bit error detection flag */ - PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ - UWord32 tot /* i : Total cumulative frequency */ +/* o : Decoded cumulative frequency */ +UWord32 rc_decode_fx( + Word16 *BER_detect, /* o : Bit error detection flag */ + PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ + UWord32 tot /* i : Total cumulative frequency */ ); + void rc_dec_update_fx( Decoder_State *st_fx, /* i/o: Decoder State */ PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ @@ -7187,17 +7392,18 @@ void rc_dec_update_fx( UWord32 sym_freq /* i : Symbol frequency */ ); -Word32 rc_dec_bits_fx( /* i : Decoded value */ - Decoder_State *st_fx, /* i/o: Decoder State */ - PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ - Word16 bits /* i : Number of bits */ +/* i : Decoded value */ +Word32 rc_dec_bits_fx( + Decoder_State *st_fx, /* i/o: Decoder State */ + PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ + Word16 bits /* i : Number of bits */ ); -UWord32 rc_dec_uniform_fx( /* i : Decoded value */ - Decoder_State *st_fx, /* i/o: Decoder State */ - PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ - - UWord32 tot /* i : Maximum value */ +/* i : Decoded value */ +UWord32 rc_dec_uniform_fx( + Decoder_State *st_fx, /* i/o: Decoder State */ + PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ + UWord32 tot /* i : Maximum value */ ); void rc_dec_finish_fx( @@ -7263,14 +7469,16 @@ void FEC_lsf2lsp_interp( // fd_cng_dec_fx.c -ivas_error createFdCngDec_fx( HANDLE_FD_CNG_DEC *hFdCngDec ); +ivas_error createFdCngDec_fx( + HANDLE_FD_CNG_DEC *hFdCngDec ); void initFdCngDec_fx( DEC_CORE_HANDLE st, /* i/o: decoder state structure */ Word16 scale ); /* Delete the instance of type FD_CNG */ -void deleteFdCngDec_fx( HANDLE_FD_CNG_DEC *hFdCngDec ); +void deleteFdCngDec_fx( + HANDLE_FD_CNG_DEC *hFdCngDec ); /* Configure CLDFB-CNG */ void configureFdCngDec_fx( @@ -7344,10 +7552,11 @@ void generate_comfort_noise_dec_ivas_fx( const Word16 nchan_out /* i : number of output channels */ ); -void generate_comfort_noise_dec_hf_fx( Word32 **bufferReal, /* o : matrix to real part of i bands */ - Word32 **bufferImag, /* o : matrix to imaginary part of i bands */ - Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of i bands */ - Decoder_State *stdec ); +void generate_comfort_noise_dec_hf_fx( + Word32 **bufferReal, /* o : matrix to real part of i bands */ + Word32 **bufferImag, /* o : matrix to imaginary part of i bands */ + Word16 *bufferScale, /* o : pointer to scalefactor for real and imaginary part of i bands */ + Decoder_State *stdec ); void generate_comfort_noise_dec_hf_ivas_fx( Word32 **bufferReal, /* o : matrix to real part of input bands */ @@ -7358,26 +7567,27 @@ void generate_comfort_noise_dec_hf_ivas_fx( ); /* Generate the comfort noise based on the target noise level */ -void generate_masking_noise_fx( Word16 *timeDomainBuffer, /* i/o: time-domain signal */ - Word16 Q, - HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing all buffers and variables */ - , - Word16 length, - Word16 core ); +void generate_masking_noise_fx( + Word16 *timeDomainBuffer, /* i/o: time-domain signal */ + Word16 Q, + HANDLE_FD_CNG_COM st, /* i/o: FD_CNG structure containing all buffers and variables */ + Word16 length, + Word16 core ); void generate_masking_noise_update_seed_fx( HANDLE_FD_CNG_COM st /* i/o : pointer to FD_CNG_COM structure */ ); -void generate_masking_noise_mdct_fx( Word32 *mdctBuffer, /* i/o: time-domain signal */ - Word16 *mdctBuffer_e, /* i/o: exponent time-domain signal */ - HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing all buffers and variables */ - , - Word16 L_frame ); +void generate_masking_noise_mdct_fx( + Word32 *mdctBuffer, /* i/o: time-domain signal */ + Word16 *mdctBuffer_e, /* i/o: exponent time-domain signal */ + HANDLE_FD_CNG_COM st, /* i/o: FD_CNG structure containing all buffers and variables */ + Word16 L_frame ); -void generate_masking_noise_mdct_ivas_fx( Word32 *mdctBuffer, /* i/o: time-domain signal */ - Word16 *mdctBuffer_e, /* i/o: exponent time-domain signal */ - HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing all buffers and variables */ ); +void generate_masking_noise_mdct_ivas_fx( + Word32 *mdctBuffer, /* i/o: time-domain signal */ + Word16 *mdctBuffer_e, /* i/o: exponent time-domain signal */ + HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing all buffers and variables */ ); // init_dec_fx.c ivas_error init_decoder_fx( @@ -7418,21 +7628,23 @@ Word16 wb_bwe_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 *Qpost ); -Word16 swb_bwe_gain_deq_fx( /* o : BWE class */ - Decoder_State *st_fx, /* i/o: decoder state structure */ - const Word16 core, /* i : core */ - Word16 *SWB_tenv, /* o : Q0, time-domain BWE envelope */ - Word16 *SWB_fenv, /* o : Q1, frequency-domain BWE envelope */ - const Word16 hr_flag, /* i : high rate flag */ - const Word16 hqswb_clas /* i : HQ BWE class */ -); - -Word16 swb_bwe_dec_fx( /*o :Q_syn_hb*/ - Decoder_State *st_fx, /* i/o: decoder state structure */ - Word16 *synth_fx, /* i/o: ACELP core synthesis/final synthesis (might be rescaled inside wtda() ) Q0/Qpost */ - Word16 *hb_synth_fx, /* o : SHB synthesis/final synthesis Q_syn_hb */ - const Word16 output_frame, /* i : frame length */ - Word16 *Qpost ); +/* o : BWE class */ +Word16 swb_bwe_gain_deq_fx( + Decoder_State *st_fx, /* i/o: decoder state structure */ + const Word16 core, /* i : core */ + Word16 *SWB_tenv, /* o : Q0, time-domain BWE envelope */ + Word16 *SWB_fenv, /* o : Q1, frequency-domain BWE envelope */ + const Word16 hr_flag, /* i : high rate flag */ + const Word16 hqswb_clas /* i : HQ BWE class */ +); + +/*o :Q_syn_hb*/ +Word16 swb_bwe_dec_fx( + Decoder_State *st_fx, /* i/o: decoder state structure */ + Word16 *synth_fx, /* i/o: ACELP core synthesis/final synthesis (might be rescaled inside wtda() ) Q0/Qpost */ + Word16 *hb_synth_fx, /* o : SHB synthesis/final synthesis Q_syn_hb */ + const Word16 output_frame, /* i : frame length */ + Word16 *Qpost ); void fd_bwe_dec_init( Decoder_State *st_fx, /* i/o: decoder state structure */ @@ -7464,9 +7676,15 @@ void HQ_nbfec_init_fx( HQ_NBFEC_HANDLE hHQ_nbfec /* i/o: HQ NB FEC data handle */ ); -void GetAttackForTCXDecision_fx( Word32 const *pSubblockNrg, Word32 const *pAccSubblockNrg, Word16 nSubblocks, Word16 nPastSubblocks, Word16 attackRatioThreshold, Word16 *pbIsAttackPresent, Word16 *pAttackIndex ); +void GetAttackForTCXDecision_fx( + Word32 const *pSubblockNrg, + Word32 const *pAccSubblockNrg, + Word16 nSubblocks, + Word16 nPastSubblocks, + Word16 attackRatioThreshold, + Word16 *pbIsAttackPresent, + Word16 *pAttackIndex ); -// FEC_HQ_phase_ecu_fx.c void hq_ecu_fx( const Word16 *prevsynth, /* i : buffer of previously synthesized signal */ Word32 *ecu_rec, /* o : reconstructed frame in tda domain */ @@ -7481,17 +7699,15 @@ void hq_ecu_fx( const Word16 ph_ecu_HqVoicing, Word16 *ph_ecu_active, /* i : Phase ECU active flag */ Word16 *gapsynth, - const Word16 prev_bfi, /* i : indicating burst frame error */ - const Word16 old_is_transient[2], /* i : flags indicating previous transient frames */ - Word16 *mag_chg_1st, /* i/o: per band magnitude modifier for transients*/ - Word16 *Xavg, /* i/o: Frequency group average gain to fade to */ - Word16 *beta_mute, /* o : Factor for long-term mute */ - const Word16 output_frame, /* i : frame length */ - Decoder_State *st_fx /* i/o: decoder state structure */ + const Word16 prev_bfi, /* i : indicating burst frame error */ + const Word16 old_is_transient[2], /* i : flags indicating previous transient frames */ + Word16 *mag_chg_1st, /* i/o: per band magnitude modifier for transients */ + Word16 *Xavg, /* i/o: Frequency group average gain to fade to */ + Word16 *beta_mute, /* o : Factor for long-term mute */ + const Word16 output_frame, /* i : frame length */ + Decoder_State *st_fx /* i/o: decoder state structure */ ); - -// hq_lr_dec_fx.c void hq_lr_dec_fx( Decoder_State *st_fx, /* i/o: : decoder state structure */ Word32 L_yout[], /* o : Q12 : transform-domain output coefs. */ @@ -7500,16 +7716,15 @@ void hq_lr_dec_fx( Word16 *is_transient_fx /* o : Q0 : transient flag */ ); -// gq_env_dec_fx.c -Word16 decode_envelope_indices_fx( /* o : Number of bits Q0*/ - Decoder_State *st_fx, /* i/o: decoder state structure */ - const Word16 start_norm, /* i : starting band index Q0*/ - const Word16 num_sfm, /* i : Number of subbands Q0*/ - const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0*/ - Word16 *difidx, /* o : Diff indices/encoded diff indices Q0*/ - const Word16 flag_HQ2 /* i : indicator of HQ2 core Q0*/ - , - const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0*/ +/* o : Number of bits Q0*/ +Word16 decode_envelope_indices_fx( + Decoder_State *st_fx, /* i/o: decoder state structure */ + const Word16 start_norm, /* i : starting band index Q0*/ + const Word16 num_sfm, /* i : Number of subbands Q0*/ + const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0*/ + Word16 *difidx, /* o : Diff indices/encoded diff indices Q0*/ + const Word16 flag_HQ2, /* i : indicator of HQ2 core Q0*/ + const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0*/ ); void dequantize_norms_fx( @@ -7521,13 +7736,11 @@ void dequantize_norms_fx( Word16 *normqlg2 /* o : Log2 of decoded norms Q0*/ ); -// hdecnrm_fx.c void hdecnrm_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 numNorms, /* (i) number of norms Q0*/ Word16 *index ); /* (o) indices of quantized norms Q0*/ - Word16 decode_huff_context_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 *hufftab, @@ -7641,13 +7854,13 @@ void hq_hr_dec_fx( const Word16 core_switching_flag /* i : Core switching flag Q1 */ ); -// hq_classifier_dec_fx.c -Word16 hq_classifier_dec_fx( /* o : Consumed bits Q0 */ - Decoder_State *st_fx, /* i/o: decoder state structure */ - const Word32 core_brate, /* i : Core bit rate Q0 */ - const Word16 length, /* i : Frame length Q0 */ - Word16 *is_transient, /* o : Transient flag Q0 */ - Word16 *hqswb_clas /* o : HQ class Q0 */ +/* o : Consumed bits */ +Word16 hq_classifier_dec_fx( + Decoder_State *st_fx, /* i/o: decoder state structure */ + const Word32 core_brate, /* i : Core bit rate Q0 */ + const Word16 length, /* i : Frame length Q0 */ + Word16 *is_transient, /* o : Transient flag Q0 */ + Word16 *hqswb_clas /* o : HQ class Q0 */ ); // peak_vq_dec_fx.c @@ -7787,43 +8000,30 @@ void update_decoder_LPD_cng( // FEC_clas_estim_fx void FEC_clas_estim_fx( - Decoder_State *st_fx, /* i/o: decoder state handle */ - const Word16 Opt_AMR_WB, - /* i : flag indicating AMR-WB IO mode */ /*A*/ - const Word16 L_frame, /* i : length of the frame */ - Word16 *clas, /* i/o: frame classification */ - const Word16 coder_type, /* i : coder type */ - const Word16 *pitch, /* i : pitch values for each subframe (Q6) */ - Word16 *syn, /* i : synthesis buffer */ - Word16 *lp_speech, /* i/o: long term active speech energy average Q8 */ - Word16 *decision_hyst, - /* i/o: hysteresis of the music/speech decision */ /*A*/ - Word16 *UV_cnt, - /* i/o: number of consecutives frames classified as UV */ /*A*/ - Word16 *LT_UV_cnt, - /* i/o: long term consecutives frames classified as UV */ /*A*/ - Word16 *Last_ener, - /* i/o: last_energy frame */ /*A*/ - Word16 *locattack, - /* i/o: detection of attack (mainly to localized speech burst) */ /*A*/ - Word16 *lt_diff_etot, - /* i/o: long-term total energy variation */ /*A*/ - Word16 *amr_io_class, - /* i/o: classification for AMR-WB IO mode */ /*A*/ - Word16 Q_syn, /* i : Synthesis scaling */ - Word16 *class_para, - /* o : classification para. fmerit1 */ /*A*/ - Word16 *mem_syn_clas_estim, /* i/o: memory of the synthesis signal for frame class estimation */ - Word16 *Q_mem_syn, - /*i/o : exponent for memory of synthesis signal for frame class estimation */ /*B*/ - Word16 LTP_Gain, - /* i : LTP gain is 0..0.6 or negative Q15*/ /*B*/ - Word16 mode, - /* i : signal classifier mode */ /*B*/ - Word16 bfi, - /* i : bad frame indicator */ /*B*/ - Word32 last_core_brate, /* i : bitrate of previous frame */ - const Word16 FEC_mode /* i : ACELP FEC mode */ + Decoder_State *st_fx, /* i/o: decoder state handle */ + const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode A*/ + const Word16 L_frame, /* i : length of the frame */ + Word16 *clas, /* i/o: frame classification */ + const Word16 coder_type, /* i : coder type */ + const Word16 *pitch, /* i : pitch values for each subframe (Q6) */ + Word16 *syn, /* i : synthesis buffer */ + Word16 *lp_speech, /* i/o: long term active speech energy average Q8 */ + Word16 *decision_hyst, /* i/o: hysteresis of the music/speech decision A*/ + Word16 *UV_cnt, /* i/o: number of consecutives frames classified as UV A*/ + Word16 *LT_UV_cnt, /* i/o: long term consecutives frames classified as UV A*/ + Word16 *Last_ener, /* i/o: last_energy frame A*/ + Word16 *locattack, /* i/o: detection of attack (mainly to localized speech burst) A*/ + Word16 *lt_diff_etot, /* i/o: long-term total energy variation A*/ + Word16 *amr_io_class, /* i/o: classification for AMR-WB IO mode A*/ + Word16 Q_syn, /* i : Synthesis scaling */ + Word16 *class_para, /* o : classification para. fmerit1 A*/ + Word16 *mem_syn_clas_estim, /* i/o: memory of the synthesis signal for frame class estimation */ + Word16 *Q_mem_syn, /*i/o : exponent for memory of synthesis signal for frame class estimation B*/ + Word16 LTP_Gain, /* i : LTP gain is 0..0.6 or negative Q15B*/ + Word16 mode, /* i : signal classifier mode B*/ + Word16 bfi, /* i : bad frame indicator B*/ + Word32 last_core_brate, /* i : bitrate of previous frame */ + const Word16 FEC_mode /* i : ACELP FEC mode */ ); Word16 FEC_pos_dec_fx( @@ -8005,6 +8205,7 @@ ivas_error ppp_voiced_decoder_fx( Word16 *pitch, /* o : floating pitch values for each subframe */ Word16 bfi /* i : Frame error rate */ ); + void sc_vbr_dec_init( SC_VBR_DEC_HANDLE hSC_VBR /* i/o: SC-VBR decoder handle */ ); @@ -8028,6 +8229,7 @@ void open_decoder_LPD_fx( const Word32 total_brate, /* Q0 */ const Word16 bwidth /* Q0 */ ); + void open_decoder_LPD_ivas_fx( Decoder_State *st, /* i/o: decoder state structure */ const Word32 total_brate, /* i : total bitrate Q0*/ @@ -8048,11 +8250,14 @@ void open_decoder_LPD_ivas_fx( void reset_tcx_overl_buf_fx( TCX_DEC_HANDLE hTcxDec /* i/o: TCX decoder handle */ ); + void acelp_plc_mdct_transition_fx( Decoder_State *st /* i/o: Decoder state */ ); + void cldfb_reset_memory_fx( HANDLE_CLDFB_FILTER_BANK hs /* i/o: filter bank handle */ ); + void tcxltp_dec_init_fx( TCX_LTP_DEC_HANDLE hTcxLtpDec, /* Q0 */ const Word16 ini_frame, /* Q0 */ @@ -8062,14 +8267,15 @@ void tcxltp_dec_init_fx( const Word32 sr_core ); /* Q0 */ // swb_bwe_dec_hr_fx.c -Word16 swb_bwe_dec_hr_fx( /* o : Exponent of SHB synthesis */ - Decoder_State *st_fx, /* i/o: decoder state structure */ - const Word16 *syn_12k8_16k_fx, /* i : ACELP core synthesis @16kHz : Q(15 - exp) */ - const Word16 exp, /* i : Exponent of core synthesis */ - Word16 *hb_synth_fx, /* o : SHB synthesis : Q(15 - hb_synth_fx_exp)*/ - const Word16 output_frame, /* i : frame length */ - const Word16 unbits, /* i : number of core unused bits */ - const Word16 pitch_buf[] /* i : pitch buffer : Q6 */ +/* o : Exponent of SHB synthesis */ +Word16 swb_bwe_dec_hr_fx( + Decoder_State *st_fx, /* i/o: decoder state structure */ + const Word16 *syn_12k8_16k_fx, /* i : ACELP core synthesis @16kHz : Q(15 - exp) */ + const Word16 exp, /* i : Exponent of core synthesis */ + Word16 *hb_synth_fx, /* o : SHB synthesis : Q(15 - hb_synth_fx_exp)*/ + const Word16 output_frame, /* i : frame length */ + const Word16 unbits, /* i : number of core unused bits */ + const Word16 pitch_buf[] /* i : pitch buffer : Q6 */ ); void hr_bwe_dec_init( @@ -8148,13 +8354,12 @@ void stat_noise_uv_mod_ivas_fx( // FEC_adao_codebook_fx.c Word16 FEC_SinOnset_fx( - Word16 *exc, /* i/o : exc vector to modify */ - Word16 puls_pos, /* i : last pulse position desired */ - const Word16 T0, /* i : Pitch information of the 1 subfr */ - Word32 enr_q, /* i : energy provide by the encoder */ - Word16 *Aq, /* i : A(z) filter Q12 */ - const Word16 L_frame /* i : frame length */ - , + Word16 *exc, /* i/o : exc vector to modify */ + Word16 puls_pos, /* i : last pulse position desired */ + const Word16 T0, /* i : Pitch information of the 1 subfr */ + Word32 enr_q, /* i : energy provide by the encoder */ + Word16 *Aq, /* i : A(z) filter Q12 */ + const Word16 L_frame, /* i : frame length */ const Word16 Qold ); Word16 FEC_enhACB_fx( @@ -8279,15 +8484,13 @@ Word16 tc_classif_fx( // dec_ppp_fx.c ivas_error decod_ppp_fx( - Decoder_State *st_fx, /* i/o: state structure */ - const Word16 Aq_fx[], /* i : 12k8 Lp coefficient */ - Word16 *pitch_buf_fx, /* i/o: fixed pitch values for each subframe */ - Word16 *exc_fx, /* i/o: current non-enhanced excitation */ - Word16 *exc2_fx, /* i/o: current enhanced excitation */ - Word16 bfi /* i : bad frame indicator */ - , - Word16 *gain_buf /*Q14*/ - , + Decoder_State *st_fx, /* i/o: state structure */ + const Word16 Aq_fx[], /* i : 12k8 Lp coefficient */ + Word16 *pitch_buf_fx, /* i/o: fixed pitch values for each subframe */ + Word16 *exc_fx, /* i/o: current non-enhanced excitation */ + Word16 *exc2_fx, /* i/o: current enhanced excitation */ + Word16 bfi, /* i : bad frame indicator */ + Word16 *gain_buf, /*Q14*/ Word16 *voice_factors, /* o : voicing factors */ Word16 *bwe_exc_fx /* o : excitation for SWB TBE */ ); @@ -8368,17 +8571,16 @@ void mode_switch_decoder_LPD_ivas_fx( Word16 *Q_old_outLB, Word16 *Q_old_Aq_12_8 ); -// ari_hm_dec.c - Word16 DecodeIndex( Decoder_State *st, const Word16 Bandwidth, /* o : NB, 1: (S)WB */ Word16 *PeriodicityIndex ); -Word16 -DecodeIndex_fx( + +Word16 DecodeIndex_fx( Decoder_State *st, const Word16 Bandwidth, Word16 *PeriodicityIndex ); + void tcx_hm_decode( const Word16 L_frame, /* i : number of spectral lines */ Word32 env[], /* i/o: envelope shape (Q16) */ @@ -8398,8 +8600,8 @@ Word16 lsf_msvq_ma_decprm( Word16 lsf_bctcvq_decprm( Decoder_State *st, Word16 *param_lpc /* Q0 */ - ); + Word16 D_lsf_tcxlpc( const Word16 indices[], /* i : VQ indices Q0*/ Word16 lsf_q[], /* o : quantized LSF Q1*/ @@ -8433,7 +8635,6 @@ Word16 lsf_ind_is_active( const Word16 narrowband, const Word16 cdk ); - // IGFSCFDecoder.c void IGFSCFDecoderOpen( IGFSCFDEC_INSTANCE_HANDLE hPublicData, /* i : handle to public data */ @@ -8457,13 +8658,17 @@ void IGFSCFDecoderDecode( ); // ari_dec_fx.c -Word32 ari_decode_overflow_fx( Tastat *s ); +Word32 ari_decode_overflow_fx( + Tastat *s ); void ari_start_decoding_14bits_fx( Decoder_State *st, Tastat *s ); -Word16 ari_start_decoding_14bits_prm_fx( const Word16 *ptr, Word16 bp, Tastat *s ); +Word16 ari_start_decoding_14bits_prm_fx( + const Word16 *ptr, + Word16 bp, + Tastat *s ); Word16 ari_decode_14bits_s17_ext_fx( Decoder_State *st, @@ -8479,9 +8684,20 @@ Word16 ari_decode_14bits_bit_ext_fx( Decoder_State *st, Tastat *s ); -Word16 ari_decode_14bits_pow_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s, Word16 base ); +Word16 ari_decode_14bits_pow_fx( + Word16 *ptr, + Word16 bp, + Word16 bits, + Word16 *res, + Tastat *s, + Word16 base ); -Word16 ari_decode_14bits_sign_fx( Word16 *ptr, Word16 bp, Word16 bits, Word16 *res, Tastat *s ); +Word16 ari_decode_14bits_sign_fx( + Word16 *ptr, + Word16 bp, + Word16 bits, + Word16 *res, + Tastat *s ); // dec_prm_fx.c void getTCXparam_fx( @@ -8495,6 +8711,7 @@ void getTCXparam_fx( Word16 p_param[2], /* o : pointer to parameters for next round of bs reading Q0 */ Word16 nTnsBitsTCX10[2], /*Q0*/ const Word16 pre_past_flag /*Q0*/ ); + void dec_prm_fx( Word16 *coder_type, Word16 param[], /* (o) : decoded parameters */ @@ -8552,22 +8769,25 @@ void tcx_hm_modify_envelope( // tns_base_dec_fx.c Word16 -ReadTnsData( STnsConfig const *pTnsConfig, - Decoder_State *st, - Word16 *pnBits, - Word16 *stream, - Word16 *pnSize ); - -void ReadTnsData_ivas_fx( STnsConfig const *pTnsConfig, - Decoder_State *st, - Word16 *pnBits, - Word16 *stream, - Word16 *pnSize ); - -Word16 DecodeTnsData( STnsConfig const *pTnsConfig, - Word16 const *stream, - Word16 *pnSize, - STnsData *pTnsData ); +ReadTnsData( + STnsConfig const *pTnsConfig, + Decoder_State *st, + Word16 *pnBits, + Word16 *stream, + Word16 *pnSize ); + +void ReadTnsData_ivas_fx( + STnsConfig const *pTnsConfig, + Decoder_State *st, + Word16 *pnBits, + Word16 *stream, + Word16 *pnSize ); + +Word16 DecodeTnsData( + STnsConfig const *pTnsConfig, + Word16 const *stream, + Word16 *pnSize, + STnsData *pTnsData ); Word16 DecodeTnsData_ivas_fx( STnsConfig const *pTnsConfig, @@ -8635,24 +8855,27 @@ void ReadFromBitstream_fx( Decoder_State *st, Word16 **pStream, Word16 *pnSize ); -// igf_dec_fx.c -void IGFDecReadData( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Deccoder */ - Decoder_State *st, /**< in: | decoder state */ - const Word16 igfGridIdx, /**< in: Q0 | in case of CELP->TCX switching, use 1.25 framelength */ - const Word16 isIndepFrame /**< in: Q0 | if 1: arith dec force reset, if 0: no reset */ + +void IGFDecReadData( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Deccoder */ + Decoder_State *st, /**< in: | decoder state */ + const Word16 igfGridIdx, /**< in: Q0 | in case of CELP->TCX switching, use 1.25 framelength */ + const Word16 isIndepFrame /**< in: Q0 | if 1: arith dec force reset, if 0: no reset */ ); -void IGFDecReadLevel( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Deccoder */ - Decoder_State *st, /**< in: | decoder state */ - const Word16 igfGridIdx, /**< in: Q0 | in case of CELP->TCX switching, use 1.25 framelength */ - const Word16 isIndepFrame /**< in: Q0 | if 1: arith dec force reset, if 0: no reset */ +void IGFDecReadLevel( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Deccoder */ + Decoder_State *st, /**< in: | decoder state */ + const Word16 igfGridIdx, /**< in: Q0 | in case of CELP->TCX switching, use 1.25 framelength */ + const Word16 isIndepFrame /**< in: Q0 | if 1: arith dec force reset, if 0: no reset */ ); -void IGFDecApplyMono( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ - Word32 *spectrum, /**< in/out: | MDCT spectrum */ - Word16 *spectrum_e, /**< in/out: | exponent of spectrum */ - const Word16 igfGridIdx, /**< in: | in case of CELP->TCX switching, use 1.25 framelength */ - Word16 bfi /**< in: | frame loss == 1, frame good == 0 */ +void IGFDecApplyMono( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ + Word32 *spectrum, /**< in/out: | MDCT spectrum */ + Word16 *spectrum_e, /**< in/out: | exponent of spectrum */ + const Word16 igfGridIdx, /**< in: | in case of CELP->TCX switching, use 1.25 framelength */ + Word16 bfi /**< in: | frame loss == 1, frame good == 0 */ ); @@ -8697,8 +8920,9 @@ void IGFDecSetMode_ivas_fx( const Word16 rf_mode /* i : flag to signal the RF mode */ ); -void IGFDecUpdateInfo( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ - const Word16 igfGridIdx /**< in: | IGF grid index */ +void IGFDecUpdateInfo( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ + const Word16 igfGridIdx /**< in: | IGF grid index */ ); void IGFDecUpdateInfo_ivas_fx( @@ -8707,10 +8931,11 @@ void IGFDecUpdateInfo_ivas_fx( const Word16 igfGridIdx /* i : IGF grid index */ ); -void IGFDecCopyLPCFlatSpectrum( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ - const Word32 *pSpectrumFlat, /**< in: Q31 | LPC flattend spectrum from TCX dec */ - const Word16 pSpectrumFlat_exp, /**< in: | exponent of pSpectrumFlat */ - const Word16 igfGridIdx /**< in: Q0 | IGF grid index */ +void IGFDecCopyLPCFlatSpectrum( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ + const Word32 *pSpectrumFlat, /**< in: Q31 | LPC flattend spectrum from TCX dec */ + const Word16 pSpectrumFlat_exp, /**< in: | exponent of pSpectrumFlat */ + const Word16 igfGridIdx /**< in: Q0 | IGF grid index */ ); void IGFDecCopyLPCFlatSpectrum_fx( @@ -8720,12 +8945,14 @@ void IGFDecCopyLPCFlatSpectrum_fx( const Word16 igfGridIdx /**< in: Q0 | IGF grid index */ ); -void IGFDecStoreTCX10SubFrameData( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ - const Word16 subFrameIdx /**< in: Q0 | index of subframe */ +void IGFDecStoreTCX10SubFrameData( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ + const Word16 subFrameIdx /**< in: Q0 | index of subframe */ ); -void IGFDecRestoreTCX10SubFrameData( const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ - const Word16 subFrameIdx /**< in: Q0 | index of subframe */ +void IGFDecRestoreTCX10SubFrameData( + const IGF_DEC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Decoder */ + const Word16 subFrameIdx /**< in: Q0 | index of subframe */ ); void IGFDecRestoreTCX10SubFrameData_fx( @@ -8733,7 +8960,6 @@ void IGFDecRestoreTCX10SubFrameData_fx( const Word16 subFrameIdx /* i : index of subframe */ ); - void init_igf_dec( IGF_DEC_INSTANCE_HANDLE hIGFDec /* i/o: IGF decoder handle */ ); @@ -8744,6 +8970,7 @@ Word16 dlpc_avq_fx( Word16 *LSF_Q, /* (o) Quantized LSF vectors */ Word16 numlpc, /* (i) Number of sets of lpc */ Word32 sr_core ); + Word16 decode_lpc_avq_fx( Decoder_State *st, /* i/o: decoder state structure */ const Word16 numlpc, /* i : Number of sets of lpc */ @@ -8751,20 +8978,19 @@ Word16 decode_lpc_avq_fx( ); Word16 decode_lpc_avq_ivas_fx( - Decoder_State *st, /* i/o: decoder state structure */ - const Word16 numlpc, /* i : Number of sets of lpc */ - Word16 *param_lpc /* o : lpc parameters */ - , + Decoder_State *st, /* i/o: decoder state structure */ + const Word16 numlpc, /* i : Number of sets of lpc */ + Word16 *param_lpc, /* o : lpc parameters */ const Word16 ch, /* i : channel */ const Word16 element_mode, /* i : element mode */ const Word16 sns_low_br_mode /* i : SNS low-bitrate mode */ ); + // vlpc_1st_dec_fx.c void vlpc_1st_dec( Word16 index, /* i : codebook index */ Word16 *lsfq ); /* i/o: i:prediction o:quantized lsf */ - // vlpc_2st_dec_fx.c void vlpc_2st_dec( Word16 *lsfq, /* i/o: i:1st stage o:1st+2nd stage */ @@ -8773,13 +8999,12 @@ void vlpc_2st_dec( Word32 sr_core ); // vlpc_2st_com_fx.c -void lsf_weight_2st( const Word16 *lsfq, /* input: quantized lsf coefficients (14Q1*1.28) */ - Word16 *w, /* output: weighting function (0Q15*1.28) */ - const Word16 mode /* input: operational mode Q0 */ +void lsf_weight_2st( + const Word16 *lsfq, /* input: quantized lsf coefficients (14Q1*1.28) */ + Word16 *w, /* output: weighting function (0Q15*1.28) */ + const Word16 mode /* input: operational mode Q0 */ ); -// ACcontextMapping_fx.c - /* Returns: index of next coefficient */ Word16 get_next_coeff_mapped( Word16 ii[2], /* i/o: coefficient indexes Q0*/ @@ -8806,9 +9031,6 @@ Word32 update_mixed_context_ivas_fx( Word16 a /* Q0 */ ); - -// ACcontextMapping_dec_fx.c - typedef Word16 ( *get_next_coeff_function )( Word16 ii[2], /* i/o: coefficient indexes */ Word16 *pp, /* o : peak(1)/hole(0) indicator */ @@ -8824,6 +9046,7 @@ Word16 ACcontextMapping_decode2_no_mem_s17_LC( Word16 resQMaxBits, /* i: residual coding maximum bits*/ CONTEXT_HM_CONFIG *hm_cfg /* i: context-based harmonic model configuration */ ); + Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( Decoder_State *st, /* i/o: decoder state */ Word16 *x, /* o : decoded spectrum */ @@ -8841,6 +9064,7 @@ void reconfig_decoder_LPD_fx( Word32 total_brate, /* i : total bitrate Q0*/ Word16 L_frame_old /* i : frame length Q0*/ ); + void reconfig_decoder_LPD_ivas_fx( Decoder_State *st, /* i/o: decoder state structure */ const Word16 bits_frame, /* i : bit budget Q0*/ @@ -8850,33 +9074,28 @@ void reconfig_decoder_LPD_ivas_fx( ); // er_utils_fx.c -void minimumStatistics_fx( Word16 *noiseLevelMemory, /* Q15, internal state */ - Word16 *noiseLevelIndex, /* Q0, internal state */ - Word16 *currLevelIndex, /* Q0, internal state (circular buffer) */ - Word16 *noiseEstimate, /* Q15, previous estimate of background noise */ - Word16 *lastFrameLevel, /* Q15, level of the last frame */ - Word16 currentFrameLevel, /* Q15, level of the current frame */ - Word16 *noiseLevelMemory_e, /* scaling factor for noiseLevelMemory */ - Word16 const noiseEstimate_e, /* exponent of noiseEstimate */ - Word16 *new_noiseEstimate_e, /* new exponent of noise Estimate*/ - Word16 *const lastFrameLevel_e, /* exponent of lastFrameLevel */ - Word16 currentFrameLevel_e ); /* exponent of currentFrameLevel */ - - -Word16 getLevelSynDeemph_fx( /*10Q5*/ - Word16 h1Init[], - /* i: i value or vector to be processed */ /* Q15 */ - Word16 const A[], - /* i: LPC coefficients */ /* Qx */ - Word16 const lpcorder, - /* i: LPC order */ /* Q0 */ - Word16 const lenLpcExc, - /* i: length of the LPC excitation buffer */ /* Q0 */ - Word16 const preemph_fac, - /* i: preemphasis factor */ /* Q15 */ - Word16 const numLoops, - /* i: number of loops */ /* Q0 */ - Word16 *Exp /* o: exponent of return value Q15 */ +void minimumStatistics_fx( + Word16 *noiseLevelMemory, /* Q15, internal state */ + Word16 *noiseLevelIndex, /* Q0, internal state */ + Word16 *currLevelIndex, /* Q0, internal state (circular buffer) */ + Word16 *noiseEstimate, /* Q15, previous estimate of background noise */ + Word16 *lastFrameLevel, /* Q15, level of the last frame */ + Word16 currentFrameLevel, /* Q15, level of the current frame */ + Word16 *noiseLevelMemory_e, /* scaling factor for noiseLevelMemory */ + Word16 const noiseEstimate_e, /* exponent of noiseEstimate */ + Word16 *new_noiseEstimate_e, /* new exponent of noise Estimate*/ + Word16 *const lastFrameLevel_e, /* exponent of lastFrameLevel */ + Word16 currentFrameLevel_e ); /* exponent of currentFrameLevel */ + +/*10Q5*/ +Word16 getLevelSynDeemph_fx( + Word16 h1Init[], /* i: i value or vector to be processed Q15 */ + Word16 const A[], /* i: LPC coefficients Qx */ + Word16 const lpcorder, /* i: LPC order Q0 */ + Word16 const lenLpcExc, /* i: length of the LPC excitation buffer Q0 */ + Word16 const preemph_fac, /* i: preemphasis factor Q15 */ + Word16 const numLoops, /* i: number of loops Q0 */ + Word16 *Exp /* o: exponent of return value Q15 */ ); void genPlcFiltBWAdap_fx( @@ -8894,7 +9113,8 @@ void highPassFiltering_fx( const Word16 l_fir_fer ); /* i: high pass filter length */ -Word16 GetPLCModeDecision_fx( Decoder_State *st ); +Word16 GetPLCModeDecision_fx( + Decoder_State *st ); // dlpc_stoch_fx.c void lpc_unquantize_fx( @@ -8936,10 +9156,12 @@ void getLookAheadResSig( const Word16 L_frame, /* Q0 */ const Word16 numSubFrame /* Q0 */ ); + void updateLSFForConcealment( PLC_ENC_EVS_HANDLE decState, Word16 *lsf_14Q1 /* 14Q1 */ ); + void getConcealedLP( PLC_ENC_EVS_HANDLE memDecState, Word16 *AqCon, /* 14Q1 */ @@ -8947,6 +9169,7 @@ void getConcealedLP( const Word16 last_good, /* Q0 */ const Word16 L_frame /* Q0 */ ); + void getConcealedLSF( PLC_ENC_EVS_HANDLE memDecState, const Word16 lsfBase[], /* Q1 * 1.28 */ @@ -8969,22 +9192,21 @@ void modify_lsf( const Word16 reset_q /* Q0 */ ); -// er_dec_tcx_fx.c void con_tcx_fx( - Decoder_State *st, /* i/o: coder memory state */ - Word16 synth[] /* i/o: synth[] */ /*Q0 */ + Decoder_State *st, /* i/o: coder memory state */ + Word16 synth[] /* i/o: synth[] Q0 */ ); -// er_scale_sync.c -Word16 Damping_fact_fx( /* o : damping factor */ /*Q14*/ - const Word16 coder_type, /* i : coding type in last good received frame */ - const Word16 nbLostCmpt, /* i : counter of consecutive bfi frames */ - const Word16 last_good, /* i : last good frame class */ - const Word16 stab_fac, - /* i : ISF stability factor */ /*Q15*/ - Word32 *lp_gainp, - /*i/o: damped pitch gain */ /*Q16 Word32!*/ - const Word16 core /* i : current coding mode */ +/* o : damping factor Q14*/ +Word16 Damping_fact_fx( + const Word16 coder_type, /* i : coding type in last good received frame */ + const Word16 nbLostCmpt, /* i : counter of consecutive bfi frames */ + const Word16 last_good, /* i : last good frame class */ + const Word16 stab_fac, + /* i : ISF stability factor */ /*Q15*/ + Word32 *lp_gainp, + /*i/o: damped pitch gain */ /*Q16 Word32!*/ + const Word16 core /* i : current coding mode */ ); // dec_tcx_fx.c @@ -9016,11 +9238,12 @@ void decoder_tcx_ivas_fx( const Word16 frame_cnt, const Word16 sba_dirac_stereo_flag ); -void decoder_tcx_post_fx( Decoder_State *st_fx, - Word16 *synth, - Word16 *synthFB, - Word16 *A, - Word16 bfi ); +void decoder_tcx_post_fx( + Decoder_State *st_fx, + Word16 *synth, + Word16 *synthFB, + Word16 *A, + Word16 bfi ); // arith_coder_dec_fx.c void tcx_arith_decode_envelope_fx( @@ -9037,9 +9260,8 @@ void tcx_arith_decode_envelope_fx( Word16 tcxltp_pitch, /* i: TCX LTP pitch in FD, -1 if n/a*/ Word16 *arith_bits, /* o: bits used for ari. coding */ Word16 *signaling_bits, /* o: bits used for signaling */ - Word16 *nf_seed /* o: noise filling seed Q0 */ - , - Word16 low_complexity /* i: low-complexity flag Q0 */ + Word16 *nf_seed, /* o: noise filling seed Q0 */ + Word16 low_complexity /* i: low-complexity flag Q0 */ ); @@ -9090,8 +9312,7 @@ void con_acelp_fx( const Word16 stab_fac, /*mem_syn >rescaling done */ - , + Word16 *Qf_mem_syn, /*mem_syn >rescaling done */ Word16 *pitch_buffer, Word16 *voice_factors, Word16 *bwe_exc ); @@ -9192,14 +9413,14 @@ void v_add_fx( void v_shr_16( const Word16 x[], /* i : Input vector */ const Word16 shift, /* i : Constant */ - Word16 y[], /* o : Output vector that contains x >> shift */ + Word16 y[], /* o : Output vector that contains x >> shift */ const Word16 N /* i : Vector length */ ); void v_shr( const Word32 x[], /* i : Input vector */ const Word16 shift, /* i : Constant */ - Word32 y[], /* o : Output vector that contains x >> shift */ + Word32 y[], /* o : Output vector that contains x >> shift */ const Word16 N /* i : Vector length */ ); @@ -9210,42 +9431,38 @@ void cldfbAnalysis_ts_fx( const Word16 samplesToProcess, /* i : samples to process */ HANDLE_CLDFB_FILTER_BANK h_cldfb, Word16 *q_cldfb ); -Word16 floor_log_2( Word32 num ); + +Word16 floor_log_2( + Word32 num ); void cldfbAnalysis_ts_fx_var_q( - const Word32 *timeIn_fx, - /* i : time buffer */ // q - Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], - /* o : real value buffer */ // q_cldfb - 5 - Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], - /* o : imag value buffer */ // q_cldfb - 5 - const Word16 samplesToProcess, /* i : samples to process */ - HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i : filterbank state */ + const Word32 *timeIn_fx, /* i : time buffer q */ + Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : real value buffer q_cldfb - 5 */ + Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : imag value buffer q_cldfb - 5 */ + const Word16 samplesToProcess, /* i : samples to process */ + HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i : filterbank state */ Word16 *q_cldfb ); void cldfbAnalysis_ts_fx_fixed_q( - const Word32 *timeIn_fx, - /* i : time buffer */ // q - Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], - /* o : real value buffer */ // q - 5 - Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], - /* o : imag value buffer */ // q - 5 - const Word16 samplesToProcess, /* i : samples to process */ - HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i : filterbank state */ + const Word32 *timeIn_fx, /* i : time buffer q */ + Word32 realBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : real value buffer q - 5 */ + Word32 imagBuffer_fx[CLDFB_NO_CHANNELS_MAX], /* o : imag value buffer q - 5 */ + const Word16 samplesToProcess, /* i : samples to process */ + HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i : filterbank state */ Word16 *q_cldfb ); void configureCldfb_ivas_fx( HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i/o: filter bank handle */ const Word32 sampling_rate /* i : sampling rate */ ); -// dec4t64.c + void dec_acelp_fast_fx( Decoder_State *st, /* i/o: decoder state structure */ const Word16 cdk_index, /* i : codebook index */ Word16 code[], /* o : algebraic (fixed) codebook excitation */ const Word16 L_subfr /* i : subframe length */ ); -// codec_tcx_common.c + void tcx5SpectrumInterleaving_fx( const Word16 tcx5Size, Word32 *spectrum ); @@ -9290,8 +9507,8 @@ void cldfbSynthesis_ivas_fx( Word32 **imagBuffer_fx, /* i : imag values Qx*/ Word32 *timeOut_fx, /* o : output time domain samples Qx - 1*/ const Word16 samplesToProcess, /* i : number of processed samples */ - const Word16 shift, /* i : scale for state buffer */ - const Word16 out_shift, /* i : scale for output buffer */ + const Word16 shift, /* i : scale for state buffer */ + const Word16 out_shift, /* i : scale for output buffer */ HANDLE_CLDFB_FILTER_BANK h_cldfb /* i : filter bank state */ ); @@ -9365,7 +9582,35 @@ void generate_masking_noise_dirac_ivas_fx( Word16 *q_cldfb ); // modif_fs/c -void IMDCT_fx( Word32 *x, Word16 x_e, Word16 *old_syn_overl, Word16 *syn_Overl_TDAC, Word16 *xn_buf, const Word16 *tcx_aldo_window_1, const PWord16 *tcx_aldo_window_1_trunc, const PWord16 *tcx_aldo_window_2, const PWord16 *tcx_mdct_window_half, const PWord16 *tcx_mdct_window_minimum, const PWord16 *tcx_mdct_window_trans, Word16 tcx_mdct_window_half_length, Word16 tcx_mdct_window_min_length, Word16 index, Word16 left_rect, Word16 tcx_offset, Word16 overlap, Word16 L_frame, Word16 L_frameTCX, Word16 L_spec_TCX5, Word16 L_frame_glob, Word16 frame_cnt, Word16 bfi, Word16 *old_out, Word16 *Q_old_wtda, Decoder_State *st, Word16 fullbandScale, Word16 *acelp_zir ); +void IMDCT_fx( + Word32 *x, + Word16 x_e, + Word16 *old_syn_overl, + Word16 *syn_Overl_TDAC, + Word16 *xn_buf, + const Word16 *tcx_aldo_window_1, + const PWord16 *tcx_aldo_window_1_trunc, + const PWord16 *tcx_aldo_window_2, + const PWord16 *tcx_mdct_window_half, + const PWord16 *tcx_mdct_window_minimum, + const PWord16 *tcx_mdct_window_trans, + Word16 tcx_mdct_window_half_length, + Word16 tcx_mdct_window_min_length, + Word16 index, + Word16 left_rect, + Word16 tcx_offset, + Word16 overlap, + Word16 L_frame, + Word16 L_frameTCX, + Word16 L_spec_TCX5, + Word16 L_frame_glob, + Word16 frame_cnt, + Word16 bfi, + Word16 *old_out, + Word16 *Q_old_wtda, + Decoder_State *st, + Word16 fullbandScale, + Word16 *acelp_zir ); void IMDCT_ivas_fx( Word32 *x_fx, @@ -9452,7 +9697,6 @@ Word16 deindex_lvq_ivas_fx( Word16 no_bits /* i : number of bits for lattice */ ); - void deleteCldfb_ivas_fx( HANDLE_CLDFB_FILTER_BANK *h_cldfb /* i/o: filter bank handle */ ); @@ -9482,32 +9726,30 @@ UWord32 mvl2s_r( const Word16 n /* i : vector size */ ); -void decoder_tcx_post_ivas_fx( Decoder_State *st_fx, - Word16 *synth, - Word16 *synthFB, - Word16 Q_syn, - Word16 *A, - Word16 bfi, - Word16 MCT_flag ); +void decoder_tcx_post_ivas_fx( + Decoder_State *st_fx, + Word16 *synth, + Word16 *synthFB, + Word16 Q_syn, + Word16 *A, + Word16 bfi, + Word16 MCT_flag ); void con_tcx_ivas_fx( - Decoder_State *st, /* i/o: coder memory state */ - Word16 synth[], - /* i/o: synth[] */ /*Q0 */ - const Word16 coh, /* i : coherence of stereo signal */ - Word16 *noise_seed, /* i/o: noise seed for stereo */ - const Word16 only_left, /* i : TD-PLC only in left channel */ - const Word16 *A_cng /* i : CNG LP filter coefficients */ + Decoder_State *st, /* i/o: coder memory state */ + Word16 synth[], /* i/o: synth[] Q0 */ + const Word16 coh, /* i : coherence of stereo signal */ + Word16 *noise_seed, /* i/o: noise seed for stereo */ + const Word16 only_left, /* i : TD-PLC only in left channel */ + const Word16 *A_cng /* i : CNG LP filter coefficients */ ); void ivas_mdct_core_reconstruct_fx( - CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ - Word32 *x_fx[][NB_DIV], - /* i/o: synthesis @internal_FS */ // Q(q_x) - Word16 signal_outFB_fx[CPE_CHANNELS][L_FRAME_PLUS], - /* o : synthesis @output_FS */ // e_sig - Word16 fUseTns[CPE_CHANNELS][NB_DIV], /* i : flage TNS enabled */ - const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0)*/ + CPE_DEC_HANDLE hCPE, /* i/o: CPE decoder structure */ + Word32 *x_fx[][NB_DIV], /* i/o: synthesis @internal_FS Q(q_x) */ + Word16 signal_outFB_fx[CPE_CHANNELS][L_FRAME_PLUS], /* o : synthesis @output_FS e_sig */ + Word16 fUseTns[CPE_CHANNELS][NB_DIV], /* i : flage TNS enabled */ + const Word16 MCT_flag, /* i : hMCT handle allocated (1) or not (0)*/ Word16 q_x, Word16 e_sig[CPE_CHANNELS] ); @@ -9536,42 +9778,48 @@ Word16 RCcontextMapping_encode2_estimate_no_mem_s17_LCS_fx( CONTEXT_HM_CONFIG *hm_cfg /* context-based harmonic model configuration */ ); -Word16 usdequant_fx( /* Qx*/ - const Word16 idx, /* i: quantizer index Q0*/ - const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word16 delta /* i: quantization step Qy*/ +/* Qx*/ +Word16 usdequant_fx( + const Word16 idx, /* i: quantizer index Q0*/ + const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word16 delta /* i: quantization step Qy*/ ); -Word32 usdequant32_fx( /* Qx*/ - const Word16 idx, /* i: quantizer index Q0*/ - const Word32 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word32 delta /* i: quantization step Qy*/ +/* Qx*/ +Word32 usdequant32_fx( + const Word16 idx, /* i: quantizer index Q0*/ + const Word32 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word32 delta /* i: quantization step Qy*/ ); -Word16 usquant_fx( /* o: index of the winning codeword */ - const Word16 x, /* i: scalar value to quantize Qx*/ - Word16 *xq, /* o: quantized value Qx*/ - const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ - const Word16 delta, /* i: quantization step Qx-1*/ - const Word16 cbsize /* i: codebook size */ +/* o: index of the winning codeword */ +Word16 usquant_fx( + const Word16 x, /* i: scalar value to quantize Qx*/ + Word16 *xq, /* o: quantized value Qx*/ + const Word16 qlow, /* i: lowest codebook entry (index 0) Qx*/ + const Word16 delta, /* i: quantization step Qx-1*/ + const Word16 cbsize /* i: codebook size */ ); -Word32 Dot_product( /* o : Sum */ - const Word16 x[], /* i : 12bits: x vector */ - const Word16 y[], /* i : 12bits: y vector */ - const Word16 lg /* i : vector length */ +/* o : Sum */ +Word32 Dot_product( + const Word16 x[], /* i : 12bits: x vector */ + const Word16 y[], /* i : 12bits: y vector */ + const Word16 lg /* i : vector length */ ); -Word32 dotp_fx( /* o : dot product of x[] and y[] */ - const Word16 x[], /* i : vector x[] */ - const Word16 y[], /* i : vector y[] */ - const Word16 n, /* i : vector length */ - Word16 *exp /* (o) : exponent of result (0..+30) */ +/* o : dot product of x[] and y[] */ +Word32 dotp_fx( + const Word16 x[], /* i : vector x[] */ + const Word16 y[], /* i : vector y[] */ + const Word16 n, /* i : vector length */ + Word16 *exp /* (o) : exponent of result (0..+30) */ ); -Word32 sum2_fx_mod( /* o : sum of all squared vector elements Q(2x+1)*/ - const Word16 *vec, /* i : i vector Qx*/ - const Word16 lvec /* i : length of i vector */ +/* o : sum of all squared vector elements Q(2x+1)*/ +Word32 sum2_fx_mod( + const Word16 *vec, /* i : i vector Qx*/ + const Word16 lvec /* i : length of i vector */ ); void Copy_Scale_sig( @@ -9615,19 +9863,23 @@ void Random_Fill( Word16 scaling /* i : scaling of values */ ); -Word16 mean_fx( /* o : mean of vector */ - const Word16 *vec_fx, /* i : i vector */ - const Word16 lvec_fx /* i : length of i vector */ +/* o : mean of vector */ +Word16 mean_fx( + const Word16 *vec_fx, /* i : i vector */ + const Word16 lvec_fx /* i : length of i vector */ ); -Word16 mean_no_sat_fx( /* o : mean of vector Qx */ - const Word16 *vec_fx, /* i : input vector Qx */ - const Word16 lvec_fx /* i : length of input vector */ +/* o : mean of vector Qx */ +Word16 mean_no_sat_fx( + const Word16 *vec_fx, /* i : input vector Qx */ + const Word16 lvec_fx /* i : length of input vector */ ); -Word32 mean_no_sat_Word32_fx( /* o : mean of vector Qx */ - const Word32 *vec_fx, /* i : input vector Qx */ - const Word16 lvec_fx, /* i : length of input vector */ - const Word16 gb ); + +/* o : mean of vector Qx */ +Word32 mean_no_sat_Word32_fx( + const Word32 *vec_fx, /* i : input vector Qx */ + const Word16 lvec_fx, /* i : length of input vector */ + const Word16 gb ); void sort( UWord16 *x, /* i/o: Vector to be sorted */ UWord16 len /* i/o: vector length */ @@ -9645,52 +9897,60 @@ void sort_32_fx( const Word16 up /* I : High limit of sorting range */ ); -Word16 minimum_fx( /* o : index of the minimum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word16 *min_fx /* o : minimum value in the input vector */ +/* o : index of the minimum value in the input vector */ +Word16 minimum_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word16 *min_fx /* o : minimum value in the input vector */ ); -Word16 maximum_fx( /* o : index of the maximum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word16 *max_fx /* o : maximum value in the input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word16 *max_fx /* o : maximum value in the input vector */ ); -Word16 maximum_exp_fx( /* o : index of the maximum value in the input vector */ - const Word16 *vec_fx, /* i : input vector */ - const Word16 *exp_vec, /* i : exponents of input vector */ - const Word16 lvec_fx /* i : length of input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_exp_fx( + const Word16 *vec_fx, /* i : input vector */ + const Word16 *exp_vec, /* i : exponents of input vector */ + const Word16 lvec_fx /* i : length of input vector */ ); -Word16 maximum_abs_16_fx( /* o : index of the maximum abs value in the input vector */ - const Word16 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word16 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum abs value in the input vector */ +Word16 maximum_abs_16_fx( + const Word16 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word16 *max_val /* o : maximum value in the input vector */ ); -Word16 minimum_abs32_fx( /* o : index of the minimum value in the input vector */ - const Word32 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word32 *min_fx /* o : minimum value in the input vector */ +/* o : index of the minimum value in the input vector */ +Word16 minimum_abs32_fx( + const Word32 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word32 *min_fx /* o : minimum value in the input vector */ ); -Word16 minimum_32_fx( /* o : index of the minimum value in the input vector */ - const Word32 *vec_fx, /* i : input vector */ - const Word16 lvec_fx, /* i : length of input vector */ - Word32 *min_fx /* o : minimum value in the input vector */ +/* o : index of the minimum value in the input vector */ +Word16 minimum_32_fx( + const Word32 *vec_fx, /* i : input vector */ + const Word16 lvec_fx, /* i : length of input vector */ + Word32 *min_fx /* o : minimum value in the input vector */ ); -Word16 maximum_32_fx( /* o : index of the maximum value in the input vector */ - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_32_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ ); -Word16 maximum_abs_32_fx( /* o : index of the maximum value in the input vector */ - const Word32 *vec, /* i : input vector */ - const Word16 lvec, /* i : length of input vector */ - Word32 *max_val /* o : maximum value in the input vector */ +/* o : index of the maximum value in the input vector */ +Word16 maximum_abs_32_fx( + const Word32 *vec, /* i : input vector */ + const Word16 lvec, /* i : length of input vector */ + Word32 *max_val /* o : maximum value in the input vector */ ); /*! r: index of the maximum value in the input vector */ @@ -9717,41 +9977,50 @@ Word16 Exp32Array( const Word32 *sx /* (i): Data array */ ); -Word32 sum16_32_fx( /* o : sum of all vector elements Qx*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all vector elements Qx*/ +Word32 sum16_32_fx( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ); -Word32 sum32_sat( /* o : sum of all vector elements Qx*/ - const Word32 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all vector elements Qx*/ +Word32 sum32_sat( + const Word32 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ); -Word32 var_fx_32( /* o: variance of vector Qx+16*/ - const Word16 *x, /* i: input vector Qx*/ - const Word16 Qx, - const Word16 len /* i: length of inputvector */ +/* o: variance of vector Qx+16*/ +Word32 var_fx_32( + const Word16 *x, /* i: input vector Qx*/ + const Word16 Qx, + const Word16 len /* i: length of inputvector */ ); -Word32 var_fx_32in_32out( /* o: variance of vector Qx+16*/ - const Word32 *x, /* i: input vector Qx*/ - Word16 *Qx, - const Word16 len, /* i: length of inputvector */ - const Word16 gb ); -Word16 var_fx( /* o: variance of vector Qx*/ - const Word16 *x, /* i: input vector Qx*/ - const Word16 Qx, - const Word16 len /* i: length of inputvector */ + +/* o: variance of vector Qx+16*/ +Word32 var_fx_32in_32out( + const Word32 *x, /* i: input vector Qx*/ + Word16 *Qx, + const Word16 len, /* i: length of inputvector */ + const Word16 gb ); + +/* o: variance of vector Qx*/ +Word16 var_fx( + const Word16 *x, /* i: input vector Qx*/ + const Word16 Qx, + const Word16 len /* i: length of inputvector */ ); -Word16 std_fx( /* o: standard deviation */ - const Word16 x[], /* i: input vector */ - const Word16 len /* i: length of the input vector */ +/* o: variance of vector Qx*/ +Word16 std_fx( + const Word16 x[], /* i: input vector */ + const Word16 len /* i: length of the input vector */ ); -Word32 dot_product_mat_fx( /* o : the dot product x'*A*x */ - const Word16 *x, /* i : vector x Q15 */ - const Word32 *A, /* i : matrix A Q0*/ - const Word16 m /* i : vector & matrix size */ +/* o : the dot product x'*A*x */ +Word32 dot_product_mat_fx( + const Word16 *x, /* i : vector x Q15 */ + const Word32 *A, /* i : matrix A Q0*/ + const Word16 m /* i : vector & matrix size */ ); @@ -9762,22 +10031,24 @@ void Vr_subt( Word16 N /* i : Vector lenght */ ); -Word16 vquant_ivas_fx( /* o: index of the winning codevector */ - Word32 x[], /* i: vector to quantize Q25 */ - const Word32 x_mean[], /* i: vector mean to subtract (0 if none) Q25 */ - Word32 xq[], /* o: quantized vector Q25 */ - const Word32 cb[], /* i: codebook Q25 */ - const Word16 dim, /* i: dimension of codebook vectors */ - const Word16 cbsize /* i: codebook size */ +/* o: index of the winning codevector */ +Word16 vquant_ivas_fx( + Word32 x[], /* i: vector to quantize Q25 */ + const Word32 x_mean[], /* i: vector mean to subtract (0 if none) Q25 */ + Word32 xq[], /* o: quantized vector Q25 */ + const Word32 cb[], /* i: codebook Q25 */ + const Word16 dim, /* i: dimension of codebook vectors */ + const Word16 cbsize /* i: codebook size */ ); -Word16 vquant_fx( /* o: index of the winning codevector */ - Word16 x[], /* i: vector to quantize Q13 */ - const Word16 x_mean[], /* i: vector mean to subtract (0 if none)Q13*/ - Word16 xq[], /* o: quantized vector Q13 */ - const Word16 cb[], /* i: codebook Q13 */ - const Word16 dim, /* i: dimension of codebook vectors */ - const Word16 cbsize /* i: codebook size */ +/* o: index of the winning codevector */ +Word16 vquant_fx( + Word16 x[], /* i: vector to quantize Q13 */ + const Word16 x_mean[], /* i: vector mean to subtract (0 if none)Q13*/ + Word16 xq[], /* o: quantized vector Q13 */ + const Word16 cb[], /* i: codebook Q13 */ + const Word16 dim, /* i: dimension of codebook vectors */ + const Word16 cbsize /* i: codebook size */ ); Word16 w_vquant_fx( @@ -9790,36 +10061,42 @@ Word16 w_vquant_fx( const Word16 rev_vect /* i: reverse codebook vectors */ ); -Word16 emaximum_fx( /* o : return index with max energy value in vector Q0 */ - const Word16 Qvec, /* i : Q of input vector Q0 */ - const Word16 *vec, /* i : input vector Qx */ - const Word16 lvec, /* i : length of input vector Q0 */ - Word32 *ener_max /* o : maximum energy value Q0 */ +/* o : return index with max energy value in vector Q0 */ +Word16 emaximum_fx( + const Word16 Qvec, /* i : Q of input vector Q0 */ + const Word16 *vec, /* i : input vector Qx */ + const Word16 lvec, /* i : length of input vector Q0 */ + Word32 *ener_max /* o : maximum energy value Q0 */ ); -Word16 emaximum_32fx( /* o : return index with max energy value in vector Q0 */ - const Word16 Qvec, /* i : Q of input vector Q0 */ - const Word32 *vec, /* i : input vector Qx */ - const Word16 lvec, /* i : length of input vector Q0 */ - Word32 *ener_max /* o : maximum energy value Q0 */ +/* o : return index with max energy value in vector Q0 */ +Word16 emaximum_32fx( + const Word16 Qvec, /* i : Q of input vector Q0 */ + const Word32 *vec, /* i : input vector Qx */ + const Word16 lvec, /* i : length of input vector Q0 */ + Word32 *ener_max /* o : maximum energy value Q0 */ ); -Word32 Mean32( /* o : mean of the elements of the vector */ - const Word32 in[], /* i : input vector */ - const Word16 L /* i : length of input vector */ +/* o : mean of the elements of the vector */ +Word32 Mean32( + const Word32 in[], /* i : input vector */ + const Word16 L /* i : length of input vector */ ); -Word32 sum32_fx( /* o : sum of all vector elements Qx*/ - const Word32 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all vector elements Qx*/ +Word32 sum32_fx( + const Word32 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ); -Word16 sum16_fx( /* o : sum of all vector elements Qx*/ - const Word16 *vec, /* i : input vector Qx*/ - const Word16 lvec /* i : length of input vector */ +/* o : sum of all vector elements Qx*/ +Word16 sum16_fx( + const Word16 *vec, /* i : input vector Qx*/ + const Word16 lvec /* i : length of input vector */ ); -Word16 own_random2_fx( Word16 seed ); +Word16 own_random2_fx( + Word16 seed ); void iDiv_and_mod_32( const Word32 Numer, /* i : 32 bits numerator */ @@ -9859,15 +10136,15 @@ Word32 root_a_over_b_ivas_fx( Word16 Q_b, Word16 *exp_out ); -void fir_fx( const Word16 x[], /* i : input vector Qx*/ - const Word16 h[], /* i : impulse response of the FIR filter Q12*/ - Word16 y[], /* o : output vector (result of filtering) Qx*/ - Word16 mem[], /* i/o: memory of the input signal (L samples) Qx*/ - const Word16 L, /* i : input vector size */ - const Word16 K, /* i : order of the FIR filter (K+1 coefs.) */ - const Word16 upd /* i : 1 = update the memory, 0 = not */ - , - Word16 shift /* i : difference between Q15 and scaling of h[] */ +void fir_fx( + const Word16 x[], /* i : input vector Qx*/ + const Word16 h[], /* i : impulse response of the FIR filter Q12*/ + Word16 y[], /* o : output vector (result of filtering) Qx*/ + Word16 mem[], /* i/o: memory of the input signal (L samples) Qx*/ + const Word16 L, /* i : input vector size */ + const Word16 K, /* i : order of the FIR filter (K+1 coefs.) */ + const Word16 upd, /* i : 1 = update the memory, 0 = not */ + Word16 shift /* i : difference between Q15 and scaling of h[] */ ); void v_add_32( const Word32 x1[], /* i : Input vector 1 */ @@ -9905,12 +10182,12 @@ void v_sub_16( const Word16 N /* i : Vector length */ ); - -Word16 squant_fx( /* o: index of the winning codeword */ - const Word16 x, /* i: scalar value to quantize */ - Word16 *xq, /* o: quantized value */ - const Word16 cb[], /* i: codebook */ - const Word16 cbsize /* i: codebook size */ +/* o: index of the winning codeword */ +Word16 squant_fx( + const Word16 x, /* i: scalar value to quantize */ + Word16 *xq, /* o: quantized value */ + const Word16 cb[], /* i: codebook */ + const Word16 cbsize /* i: codebook size */ ); Word16 squant_int_fx( @@ -9982,60 +10259,84 @@ void add_vec_fx( const Word16 N /* i : Vector lenght */ ); -Word32 Add_flt32_flt32( /* o: Result (Normalized) */ - Word32 a, /* i: 1st Value */ - Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ - Word32 b, /* i: 2nd Value */ - Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ - Word16 *exp_out /* o: Exponent of Result */ +/* o: Result (Normalized) */ +Word32 Add_flt32_flt32( + Word32 a, /* i: 1st Value */ + Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ + Word32 b, /* i: 2nd Value */ + Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ + Word16 *exp_out /* o: Exponent of Result */ ); -Word32 Mul_flt32_Q15( /* o: Result (Normalized) */ - Word32 value, /* i: Pseudo_float Value */ - Word16 *exp_v, /*i/o: Exponent of Value (Q of Value) */ - Word16 frac /* i: Q15 value */ +/* o: Result (Normalized) */ +Word32 Mul_flt32_Q15( + Word32 value, /* i: Pseudo_float Value */ + Word16 *exp_v, /*i/o: Exponent of Value (Q of Value) */ + Word16 frac /* i: Q15 value */ ); -Word32 Div_flt32_flt32( /* o: Result (Normalized) */ - Word32 a, /* i: 1st Value */ - Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ - Word32 b, /* i: 2nd Value */ - Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ - Word16 *exp_out /* o: Exponent of Result */ +/* o: Result (Normalized) */ +Word32 Div_flt32_flt32( + Word32 a, /* i: 1st Value */ + Word16 exp_a, /* i: Exponent of 1st Value (Q of Value) */ + Word32 b, /* i: 2nd Value */ + Word16 exp_b, /* i: Exponent of 2nd Value (Q of Value) */ + Word16 *exp_out /* o: Exponent of Result */ ); -Word32 Calc_Energy_Autoscaled( /* o: Result (Energy) */ - const Word16 *signal, /* i: Signal */ - Word16 signal_exp, /* i: Exponent of Signal (Q of Signal) */ - Word16 len, /* i: Frame Length */ - Word16 *energy_exp /* o: Exponent of Energy (Q of Energy) */ +/* o: Result (Normalized) */ +Word32 Calc_Energy_Autoscaled( + const Word16 *signal, /* i: Signal */ + Word16 signal_exp, /* i: Exponent of Signal (Q of Signal) */ + Word16 len, /* i: Frame Length */ + Word16 *energy_exp /* o: Exponent of Energy (Q of Energy) */ ); -Word16 Find_Max_Norm16( const Word16 *src, Word16 len ); +Word16 Find_Max_Norm16( + const Word16 *src, + Word16 len ); -Word16 Find_Max_Norm32( const Word32 *src, Word16 len ); +Word16 Find_Max_Norm32( + const Word32 *src, + Word16 len ); -Word32 Sqrt_Ratio32( /* o: Result in Q31 */ - Word32 L_val1, /* i: Mantisa of Val1 */ - Word16 exp1, /* i: Exp of Val1 (>0: Val was Left Shifted, <0:Right Shifted) */ - Word32 L_val2, /* i: Mantisa of Val2 */ - Word16 exp2, /* i: Exp of Val2 (same as exp1) */ - Word16 *exp /* o: Exp of Result (# of 'L_shl' Req to get to Final Value) */ +/* o: Result in Q31 */ +Word32 Sqrt_Ratio32( + Word32 L_val1, /* i: Mantisa of Val1 */ + Word16 exp1, /* i: Exp of Val1 (>0: Val was Left Shifted, <0:Right Shifted) */ + Word32 L_val2, /* i: Mantisa of Val2 */ + Word16 exp2, /* i: Exp of Val2 (same as exp1) */ + Word16 *exp /* o: Exp of Result (# of 'L_shl' Req to get to Final Value) */ ); -Word16 Invert16( /* result in Q'15 + 'exp' */ - Word16 val, - Word16 *exp ); +/* result in Q'15 + 'exp' */ +Word16 Invert16( + Word16 val, + Word16 *exp ); -Word16 find_rem( Word16 n, Word16 m, Word16 *r ); +Word16 find_rem( + Word16 n, + Word16 m, + Word16 *r ); -Word32 find_remd( Word32 n, Word32 m, Word32 *r ); +Word32 find_remd( + Word32 n, + Word32 m, + Word32 *r ); Word16 rint_new_fx( Word32 x /*Q16 */ ); -Word16 erb_diff_search_fx( Word16 *prev_erb, const Word16 *curr_erb, Word16 *dif_erb, Word16 *pow_spec, const Word16 *cb_fx, Word16 cb_size, Word16 cb_dim, Word16 offset ); +Word16 erb_diff_search_fx( + Word16 *prev_erb, + const Word16 *curr_erb, + Word16 *dif_erb, + Word16 *pow_spec, + const Word16 *cb_fx, + Word16 cb_size, + Word16 cb_dim, + Word16 offset ); void Acelp_dec_total_exc( Word16 *exc_fx, /* i/o: adapt. excitation exc */ @@ -10047,11 +10348,18 @@ void Acelp_dec_total_exc( const Word16 L_subfr /* i : Subframne lenght */ ); -UWord32 UL_inverse( const UWord32 UL_val, Word16 *exp ); +UWord32 UL_inverse( + const UWord32 UL_val, + Word16 *exp ); -UWord32 UL_div( const UWord32 UL_num, const UWord32 UL_den ); +UWord32 UL_div( + const UWord32 UL_num, + const UWord32 UL_den ); -Word16 ratio( const Word32 numer, const Word32 denom, Word16 *expo ); +Word16 ratio( + const Word32 numer, + const Word32 denom, + Word16 *expo ); void hp400_12k8_fx( Word16 signal[], /* i/o: input signal / output is divided by 16 */ @@ -10065,9 +10373,19 @@ void hp400_12k8_ivas_fx( Word16 mem[] /* i/o: filter memory [6] */ ); -Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy, Word16 *qo, Word16 len ); +Word16 dot_prod_satcontr( + const Word16 *x, + const Word16 *y, + Word16 qx, + Word16 qy, + Word16 *qo, + Word16 len ); -void E_UTIL_f_convolve( const Word16 x[], const Word16 h[], Word16 y[], const Word16 size ); +void E_UTIL_f_convolve( + const Word16 x[], + const Word16 h[], + Word16 y[], + const Word16 size ); void floating_point_add( Word32 *mx, /* io: mantissa of the addend Q31 */ @@ -10390,11 +10708,11 @@ void updt_enc_common_ivas_fx( const Word16 Q_new /* i : CUrrent frame scaling */ ); -// tools.c -Word32 sum2_f_32_fx( /* o : Q(2x - 31 - gb) */ - const Word32 *vec, /* i : input vector, Qx */ - const Word16 lvec, /* i : length of input vector */ - Word16 gb /* i : guard bits */ +/* o : Q(2x - 31 - gb) */ +Word32 sum2_f_32_fx( + const Word32 *vec, /* i : input vector, Qx */ + const Word16 lvec, /* i : length of input vector */ + Word16 gb /* i : guard bits */ ); Word32 sum2_16_exp_fx( @@ -10434,7 +10752,6 @@ void ProcessStereoIGF_fx( const Word32 element_brate, /* i : element bitrate */ const Word16 mct_on ); -/*igf_enc.c*/ void IGFEncApplyStereo_fx( STEREO_MDCT_ENC_DATA_HANDLE hStereoMdct, /* i/o: MDCT stereo encoder structure */ Word16 ms_mask[2][MAX_SFB], /* i : bandwise MS mask */ @@ -10466,7 +10783,6 @@ Word16 IGFEncWriteBitstream_ivas_fx( const Word16 isIndepFlag /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ ); -/*igf_scf_enc.c*/ Word16 IGFSCFEncoderEncode_ivas_fx( IGFSCFENC_INSTANCE_HANDLE hPublicData, /* i/o: handle to public data or NULL in case there was no instance created */ BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ @@ -10476,7 +10792,6 @@ Word16 IGFSCFEncoderEncode_ivas_fx( const Word16 indepFlag /* i : if 1 frame is independent, 0 = frame is coded with data from previous frame */ ); -/*ari_enc.c*/ Word16 ari_encode_14bits_ext_ivas_fx( Word16 *ptr, /* Q0 */ Word16 bp, /* Q0 */ @@ -10776,7 +11091,6 @@ void core_switching_post_enc_ivas_fx( Word16 A_fx[], /* i : unquant. LP filter coefs. */ Word16 Q_new ); - void residu_ivas_fx( const Word16 *a, /* i : LP filter coefficients Q31-a_exp*/ const Word16 a_exp, @@ -10844,6 +11158,7 @@ void set_zero_fx( Word32 *vec, /* o : input vector */ const Word16 lvec /* i : length of the vector */ ); + void set_zero2_fx( Word32 *vec, /* o : input vector */ const Word32 lvec /* i : length of the vector */ @@ -10906,7 +11221,6 @@ void sort_l( Word16 len /* i/o: vector length */ ); - ivas_error push_indice( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ Word16 id, /* i : ID of the indice */ @@ -11100,10 +11414,11 @@ void flip_and_downmix_generic_fx32( Word16 *phase_state /* i/o: Phase state in case frequency isn't multiple of 50 Hz */ ); -Word16 quant_2p_2N1_fx( /* o: return (2*N)+1 bits */ - const Word16 pos1, /* i: position of the pulse 1 */ - const Word16 pos2, /* i: position of the pulse 2 */ - const Word16 N /* i: number of bits FOR position */ +/* o : Q(2x - 31 - gb) */ +Word16 quant_2p_2N1_fx( + const Word16 pos1, /* i: position of the pulse 1 */ + const Word16 pos2, /* i: position of the pulse 2 */ + const Word16 N /* i: number of bits FOR position */ ); void bands_and_bit_alloc_ivas_fx( @@ -11129,24 +11444,17 @@ void bands_and_bit_alloc_ivas_fx( ); void ivas_find_wsp_fx( - const Word16 L_frame, /* i : length of the frame Q0*/ - const Word16 L_subfr, /* i : length of subframe Q0*/ - const Word16 nb_subfr, /* i : number of subframes Q0*/ - const Word16 *A_fx, - /* i : A(z) filter coefficients */ // Q12 - Word16 *Aw_fx, - /* o : weighted A(z) filter coefficients */ // Q12 - const Word16 *speech_fx, - /* i : pointer to the denoised speech frame */ // Q_new - const Word16 tilt_fact, - /* i : tilt factor */ // Q15 - Word16 *wsp_fx, - /* o : poitnter to the weighted speech frame */ // Q_new - Word16 *mem_wsp_fx, - /* i/o: W(Z) denominator memory */ // Q_new - const Word16 gamma, - /* i : weighting factor */ // Q15 - const Word16 L_look /* i : look-ahead Q0*/ + const Word16 L_frame, /* i : length of the frame Q0*/ + const Word16 L_subfr, /* i : length of subframe Q0*/ + const Word16 nb_subfr, /* i : number of subframes Q0*/ + const Word16 *A_fx, /* i : A(z) filter coefficients Q12 */ + Word16 *Aw_fx, /* o : weighted A(z) filter coefficients Q12 */ + const Word16 *speech_fx, /* i : pointer to the denoised speech frame Q_new */ + const Word16 tilt_fact, /* i : tilt factor Q15 */ + Word16 *wsp_fx, /* o : poitnter to the weighted speech frame Q_new */ + Word16 *mem_wsp_fx, /* i/o: W(Z) denominator memory Q_new */ + const Word16 gamma, /* i : weighting factor Q15 */ + const Word16 L_look /* i : look-ahead Q0*/ ); Word16 RCcontextMapping_encode2_estimate_bandWise_start_fx( @@ -11162,14 +11470,12 @@ Word16 RCcontextMapping_encode2_estimate_bandWise_fx( HANDLE_RC_CONTEXT_MEM hContextMem /* Q0 */ ); - /*! r: Q15 */ Word16 expfp_evs_fx( const Word16 x, /* i : mantissa Q15-e */ const Word16 x_e /* i : exponent Q0 */ ); - void tcx_arith_render_envelope_ivas_fx( const Word16 A_ind[], /* i : LPC coefficients of signal envelope Q12*/ const Word16 L_frame, /* i : number of spectral lines Q0*/ @@ -11197,7 +11503,6 @@ void tcx_arith_decode_envelope_ivas_fx( const Word16 low_complexity /* i : low-complexity flag */ ); - void UnmapIndex_fx( const Word16 PeriodicityIndex, /* Q0 */ const Word16 Bandwidth, /* Q0 */ @@ -11217,7 +11522,6 @@ Word32 tcx_hm_render_fx( Word16 p[] /* o: harmonic model Q13 */ ); - void tcx_hm_modify_envelope_fx( const Word16 gain, /* i: HM gain Q11 */ const Word32 lag, /* i: pitch lag Q0 */ diff --git a/lib_dec/ivas_rom_dec.h b/lib_dec/ivas_rom_dec.h index b2df85c55..28c56fff8 100644 --- a/lib_dec/ivas_rom_dec.h +++ b/lib_dec/ivas_rom_dec.h @@ -64,7 +64,6 @@ extern const Word16 dft_win_8k_fx[70]; extern const Word16 cna_init_bands[CNA_INIT_NBANDS + 1]; - extern const Word16 min_smooth_gains1_fx[SBA_DIRAC_STEREO_NUM_BANDS]; extern const Word16 max_smooth_gains1_fx[SBA_DIRAC_STEREO_NUM_BANDS]; extern const Word16 min_smooth_gains2_fx[SBA_DIRAC_STEREO_NUM_BANDS]; diff --git a/lib_enc/igf_enc_fx.c b/lib_enc/igf_enc_fx.c index 31372c136..12ac6e337 100644 --- a/lib_enc/igf_enc_fx.c +++ b/lib_enc/igf_enc_fx.c @@ -1651,34 +1651,14 @@ return; } -/*-------------------------------------------------------------------* - * IGFEncResetTCX10BitCounter_ivas_fx() - * - * IGF reset bitstream bit counter for TCX10 modes - *-------------------------------------------------------------------*/ - -void IGFEncResetTCX10BitCounter_ivas_fx( - const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ -) -{ - IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; - - hPrivateData = &hIGFEnc->igfData; - hPrivateData->igfBitstreamBits = 0; - hIGFEnc->infoTotalBitsWritten = 0; - move16(); - move16(); - - return; -} - +/**********************************************************************/ /* + IGF write concatenated bitsream for TCX10 modes +**************************************************************************/ -/**********************************************************************/ /* - IGF write concatenated bitsream for TCX10 modes - **************************************************************************/ -Word16 IGFEncWriteConcatenatedBitstream_fx( /**< out: Q0 | total number of bits written */ - const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ - BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ +/**< out: Q0 | total number of bits written */ +Word16 IGFEncWriteConcatenatedBitstream_fx( + const IGF_ENC_INSTANCE_HANDLE hInstance, /**< in: | instance handle of IGF Encoder */ + BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle */ ) { IGF_ENC_PRIVATE_DATA_HANDLE hPrivateData; @@ -4103,12 +4083,12 @@ void IGFEncSetMode_ivas_fx( /*-------------------------------------------------------------------* - * IGFEncResetTCX10BitCounter_ivas_fx() + * IGFEncResetTCX10BitCounter_fx() * * IGF reset bitstream bit counter for TCX10 modes *-------------------------------------------------------------------*/ -void IGFEncResetTCX10BitCounter_ivas_fx( +void IGFEncResetTCX10BitCounter_fx( const IGF_ENC_INSTANCE_HANDLE hIGFEnc /* i : instance handle of IGF Encoder */ ) { diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index a1c09b126..3f515b234 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -62,9 +62,7 @@ ivas_error acelp_core_enc_fx( Word16 *unbits_fx, /* o : number of unused bits Q0*/ STEREO_TD_ENC_DATA_HANDLE hStereoTD, /* i/o: TD stereo encoder handle */ const Word16 Q_new, - const Word16 shift - -); + const Word16 shift ); void analy_lp_fx( const Word16 speech[], /* i :(Q_new) pointer to the speech frame */ @@ -119,6 +117,7 @@ void AVQ_encmux_ivas_fx( Word16 trgtSvPos /* i : target SV for AVQ bit savings */ ); #endif + void bw_detect_fx( Encoder_State *st, /* i/o: Encoder State */ const Word16 signal_in[], /* i : input signal */ @@ -246,37 +245,39 @@ void find_tilt_fx( Word16 Opt_vbr_mode /* Q0 */ ); -Word16 find_uv_ivas_fx( /* o : coding type */ - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word16 *T_op_fr, /* i : pointer to adjusted fractional pitch (4 val.) Q6*/ - const Word16 *voicing_fr, /* i : refined correlation for each subframes Q15*/ - const Word16 *speech, /* i : pointer to speech signal for E computation Q_new*/ - const Word32 *ee, /* i : lf/hf Energy ratio for present frame Q6*/ - Word32 *dE1X, /* o : sudden energy increase for S/M classifier Q13*/ - const Word16 corr_shift, /* i : normalized correlation correction in noise Q15*/ - const Word16 relE, /* i : relative frame energy Q8*/ - const Word16 Etot, /* i : total energy Q8*/ - const Word32 hp_E[], /* i : energy in HF q_hp_E*/ - Word16 *flag_spitch, /* i/o: flag to indicate very short stable pitch and high correlation Q0*/ - const Word16 last_core_orig, /* i : original last core Q0*/ - STEREO_CLASSIF_HANDLE hStereoClassif, /* i/o: stereo classifier structure */ - const Word16 Q_new, - const Word16 q_hp_E ); - -Word16 find_uv_fx( /* o : coding type */ - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word16 *T_op_fr, /* i : pointer to adjusted fractional pitch (4 val.) Q6*/ - const Word16 *voicing_fr, /* i : refined correlation for each subframes Q15*/ - const Word16 *speech, /* i : pointer to speech signal for E computation Q_new*/ - const Word32 *ee, /* i : lf/hf Energy ratio for present frame Q6*/ - const Word16 corr_shift, /* i : normalized correlation correction in noise Q15*/ - const Word16 relE, /* i : relative frame energy Q8*/ - const Word16 Etot, /* i : total energy Q8*/ - const Word32 hp_E[], /* i : energy in HF Q_new + Q_SCALE*/ - const Word16 Q_new, - Word16 *flag_spitch, /* i/o: flag to indicate very short stable pitch and high correlation Q0*/ - const Word16 shift, - const Word16 last_core_orig /* i : original last core Q0*/ +/* o : coding type */ +Word16 find_uv_ivas_fx( + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word16 *T_op_fr, /* i : pointer to adjusted fractional pitch (4 val.) Q6*/ + const Word16 *voicing_fr, /* i : refined correlation for each subframes Q15*/ + const Word16 *speech, /* i : pointer to speech signal for E computation Q_new*/ + const Word32 *ee, /* i : lf/hf Energy ratio for present frame Q6*/ + Word32 *dE1X, /* o : sudden energy increase for S/M classifier Q13*/ + const Word16 corr_shift, /* i : normalized correlation correction in noise Q15*/ + const Word16 relE, /* i : relative frame energy Q8*/ + const Word16 Etot, /* i : total energy Q8*/ + const Word32 hp_E[], /* i : energy in HF q_hp_E*/ + Word16 *flag_spitch, /* i/o: flag to indicate very short stable pitch and high correlation Q0*/ + const Word16 last_core_orig, /* i : original last core Q0*/ + STEREO_CLASSIF_HANDLE hStereoClassif, /* i/o: stereo classifier structure */ + const Word16 Q_new, + const Word16 q_hp_E ); + +/* o : coding type */ +Word16 find_uv_fx( + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word16 *T_op_fr, /* i : pointer to adjusted fractional pitch (4 val.) Q6*/ + const Word16 *voicing_fr, /* i : refined correlation for each subframes Q15*/ + const Word16 *speech, /* i : pointer to speech signal for E computation Q_new*/ + const Word32 *ee, /* i : lf/hf Energy ratio for present frame Q6*/ + const Word16 corr_shift, /* i : normalized correlation correction in noise Q15*/ + const Word16 relE, /* i : relative frame energy Q8*/ + const Word16 Etot, /* i : total energy Q8*/ + const Word32 hp_E[], /* i : energy in HF Q_new + Q_SCALE*/ + const Word16 Q_new, + Word16 *flag_spitch, /* i/o: flag to indicate very short stable pitch and high correlation Q0*/ + const Word16 shift, + const Word16 last_core_orig /* i : original last core Q0*/ ); void fine_gain_quant_fx( @@ -302,6 +303,7 @@ void long_enr_fx( const Word16 Etot, /* i : total channel E (see lib_enc\analy_sp.c) */ const Word16 localVAD_HE_SAD, /* i : HE-SAD flag without hangover */ Word16 high_lpn_flag ); + void ivas_long_enr_fx( Encoder_State *st_fx, /* i/o: state structure */ const Word32 Etot, /* i : total channel E (see lib_enc\analy_sp.c) Q=24*/ @@ -313,12 +315,14 @@ void ivas_long_enr_fx( const Word16 Etot_LR[] /* i : total channel energy LR channels Q=8*/ ); -Word16 mdct_classifier_fx( /* o: MDCT A/B decision */ - const Word16 *Y, /* i: re[0], re[1], ..., re[n/2], im[n/2 - 1], im[n/2 - 2], ..., im[1] */ - Encoder_State *st_fx, /* i/o: Encoder state variable */ - Word32 *cldfbBuf_Ener, - Word16 enerBuffer_exp, - const Word32 brate /* i : current brate, IVAS: nominal bitrate, EVS: st->total_brate */ + +/* o: MDCT A/B decision */ +Word16 mdct_classifier_fx( + const Word16 *Y, /* i: re[0], re[1], ..., re[n/2], im[n/2 - 1], im[n/2 - 2], ..., im[1] */ + Encoder_State *st_fx, /* i/o: Encoder state variable */ + Word32 *cldfbBuf_Ener, + Word16 enerBuffer_exp, + const Word32 brate /* i : current brate, IVAS: nominal bitrate, EVS: st->total_brate */ ); void noise_est_down_fx( @@ -382,6 +386,7 @@ void noise_est_fx( Word16 S_map[], /* o : short-term correlation map Q7 */ const Word16 ini_frame /* i : Frame number (init) */ ); + void noise_est_ivas_fx( Encoder_State *st_fx, /* i/o: state structure */ const Word16 old_pitch1, /* i : previous frame OL pitch[1] */ @@ -414,6 +419,7 @@ void noise_est_ivas_fx( FRONT_VAD_ENC_HANDLE hFrontVad, /* i/o: front-VAD handle */ const Word16 ini_frame /* i : Frame number (init) */ ); + void noise_est_pre_fx( const Word16 Etot, /* i : Energy of current frame */ const Word16 ini_frame_fx, /* i : Frame number (init) */ @@ -435,17 +441,14 @@ void noise_est_pre_32fx( ); void pitch_ol2_fx( - const Word16 pit_min, /* i : minimum pitch value (20 or 29) */ - const Word16 pitch_ol, /* i : pitch to be improved */ - Word16 *pitch_fr_fx, - /* o : adjusted 1/4 fractional pitch */ /*Q7*/ - Word16 *voicing_fr_fx, - /* o : adjusted 1/4 fractional voicing */ /*Q15*/ - const Word16 pos, /* i : position in frame where to calculate the improv. */ - const Word16 *wsp_fx, - /* i : weighted speech for current frame and look-ahead */ /*Q_new-1+shift*/ - const Word16 delta, /* i : delta for pitch search (2 or 7) */ - const Word16 element_mode /* i : EVS or IVAS */ + const Word16 pit_min, /* i : minimum pitch value (20 or 29) */ + const Word16 pitch_ol, /* i : pitch to be improved */ + Word16 *pitch_fr_fx, /* o : adjusted 1/4 fractional pitch Q7*/ + Word16 *voicing_fr_fx, /* o : adjusted 1/4 fractional voicing Q15*/ + const Word16 pos, /* i : position in frame where to calculate the improv. */ + const Word16 *wsp_fx, /* i : weighted speech for current frame and look-ahead Q_new-1+shift*/ + const Word16 delta, /* i : delta for pitch search (2 or 7) */ + const Word16 element_mode /* i : EVS or IVAS */ ); void pitch_ol_ivas_fx( @@ -516,19 +519,20 @@ void Scale_mem_enc( Word16 *last_exc_dct_in, Word16 *old_input_lp ); -Word32 Scale_mem_pre_proc( /* o : Min energy scaled */ - Word16 ini_frame_fx, /* i : Frame number Q0*/ - Word16 Q_exp, /* i : Diff scaling factor */ - Word16 *Q_new, /* i/o: Absolute scaling factor */ - Word16 *old_speech, /* i/o: Speech memory */ - Word16 *mem_wsp, /* i/o: wsp vector memory st->mem_wsp_q*/ - Word32 *enrO, /* i/o: Enr mem q_enrO*/ - Word32 *bckr, /* i/o: Back ground_fx ener mem q_bckr*/ - Word32 *ave_enr, /* i/o: Ave_enr mem Q_new + QSCALE*/ - Word32 *ave_enr2, /* i/o: Ave_enr2 mem Q_new + QSCALE*/ - Word32 *st_fr_bands1, /* i/o: spectrum per critical bands of the previous frame Q_new + QSCALE*/ - Word32 *st_fr_bands2, /* i/o: spectrum per critical bands 2 frames ago Q_new + QSCALE*/ - Word32 *st_Bin_E_old ); +/* o : Min energy scaled */ +Word32 Scale_mem_pre_proc( + Word16 ini_frame_fx, /* i : Frame number Q0*/ + Word16 Q_exp, /* i : Diff scaling factor */ + Word16 *Q_new, /* i/o: Absolute scaling factor */ + Word16 *old_speech, /* i/o: Speech memory */ + Word16 *mem_wsp, /* i/o: wsp vector memory st->mem_wsp_q*/ + Word32 *enrO, /* i/o: Enr mem q_enrO*/ + Word32 *bckr, /* i/o: Back ground_fx ener mem q_bckr*/ + Word32 *ave_enr, /* i/o: Ave_enr mem Q_new + QSCALE*/ + Word32 *ave_enr2, /* i/o: Ave_enr2 mem Q_new + QSCALE*/ + Word32 *st_fr_bands1, /* i/o: spectrum per critical bands of the previous frame Q_new + QSCALE*/ + Word32 *st_fr_bands2, /* i/o: spectrum per critical bands 2 frames ago Q_new + QSCALE*/ + Word32 *st_Bin_E_old ); void Scale_wsp( Word16 *wsp, /* i : Weigthed speech */ @@ -542,22 +546,24 @@ void Scale_wsp( const Word16 Len_p_look /* i : L_frame + look ahead Q0*/ ); -Word16 signal_clas_fx( /* o : classification for current frames */ - Encoder_State *st, /* i/o: encoder state structure */ - const Word16 *speech, /* i : pointer to speech signal for E computation */ - const Word32 *ee, /* i : lf/hf E ration for 2 half-frames */ - const Word16 relE, /* i : frame relative E to the long term average */ - const Word16 L_look, /* i : look-ahead */ - Word16 *uc_clas /* o : temporary classification used in music/speech class*/ +/* o : classification for current frames */ +Word16 signal_clas_fx( + Encoder_State *st, /* i/o: encoder state structure */ + const Word16 *speech, /* i : pointer to speech signal for E computation */ + const Word32 *ee, /* i : lf/hf E ration for 2 half-frames */ + const Word16 relE, /* i : frame relative E to the long term average */ + const Word16 L_look, /* i : look-ahead */ + Word16 *uc_clas /* o : temporary classification used in music/speech class*/ ); -Word16 signal_clas_ivas_fx( /* o : classification for current frames */ - Encoder_State *st, /* i/o: encoder state structure */ - const Word16 *speech, /* i : pointer to speech signal for E computation */ - const Word32 *ee, /* i : lf/hf E ration for 2 half-frames */ - const Word16 relE, /* i : frame relative E to the long term average */ - const Word16 L_look, /* i : look-ahead */ - Word16 *uc_clas /* o : temporary classification used in music/speech class*/ +/* o : classification for current frames */ +Word16 signal_clas_ivas_fx( + Encoder_State *st, /* i/o: encoder state structure */ + const Word16 *speech, /* i : pointer to speech signal for E computation */ + const Word32 *ee, /* i : lf/hf E ration for 2 half-frames */ + const Word16 relE, /* i : frame relative E to the long term average */ + const Word16 L_look, /* i : look-ahead */ + Word16 *uc_clas /* o : temporary classification used in music/speech class*/ ); void speech_music_classif_fx( @@ -647,17 +653,14 @@ void swb_CNG_enc_ivas_fx( ); void swb_pre_proc_fx( - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word16 *input_fx, /* i : original i signal */ - Word16 *new_swb_speech_fx, /* o : original i signal at 32kHz */ - Word16 *shb_speech_fx, /* o : SHB target signal (6-14kHz) at 16kHz */ - Word16 *Q_shb_spch /* o : shb target signal Q factor */ - , - Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* i : real buffer */ - , - Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX] /* i : imag buffer */ - , - const CLDFB_SCALE_FACTOR *cldfbScale /* i : scale data of real and imag CLDFB buffers */ + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word16 *input_fx, /* i : original i signal */ + Word16 *new_swb_speech_fx, /* o : original i signal at 32kHz */ + Word16 *shb_speech_fx, /* o : SHB target signal (6-14kHz) at 16kHz */ + Word16 *Q_shb_spch, /* o : shb target signal Q factor */ + Word32 realBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : real buffer */ + Word32 imagBuffer[CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX], /* i : imag buffer */ + const CLDFB_SCALE_FACTOR *cldfbScale /* i : scale data of real and imag CLDFB buffers */ ); void InitSWBencBufferStates_fx( @@ -704,20 +707,23 @@ Word16 tfaEnc_TBE_fx( const Word16 *pitch_buf, /* Q6 */ const Word16 Q_enr ); -Word32 VAD_Log2( Word32 i_s32Val, - Word16 i_s16Q ); +Word32 VAD_Log2( + Word32 i_s32Val, + Word16 i_s16Q ); -Word32 VAD_L_ADD( Word32 s32Mantissa1, - Word16 i_tExp1, - Word32 s32Mantissa2, - Word16 i_tExp2, - Word16 *s16Exp ); +Word32 VAD_L_ADD( + Word32 s32Mantissa1, + Word16 i_tExp1, + Word32 s32Mantissa2, + Word16 i_tExp2, + Word16 *s16Exp ); -Word32 VAD_L_div( Word32 L_var1, - Word32 L_var2, - Word16 Q_L_var1, - Word16 Q_L_var2, - Word16 *Q_OUT ); +Word32 VAD_L_div( + Word32 L_var1, + Word32 L_var2, + Word16 Q_L_var1, + Word16 Q_L_var2, + Word16 *Q_OUT ); void vad_param_updt_fx( Encoder_State *st_fx, /* i/o: state structure */ @@ -773,7 +779,6 @@ void wb_tbe_enc_ivas_fx( const Word16 pitch_buf[] /* i : pitch for each subframe Q6 */ ); - Word16 wb_vad_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ const Word32 fr_bands[], /* i : per band i energy (contains 2 vectors) Q_new+QSCALE*/ @@ -806,14 +811,15 @@ Word16 wb_vad_ivas_fx( Word16 lp_noise /* i : long term noise energy */ ); -Word32 construct_snr_thresh_fx( Word16 sp_center[], /*(i) spectral center Q10*/ - Word32 snr_flux, /*(i) snr flux Q25*/ - Word32 lt_snr, /*(i) long time time domain snr Q25*/ - Word32 l_snr, /*(i) long time frequency domain snr Q25*/ - Word32 continuous_speech_num, /*(i) amount of continuous speech frames Q0*/ - Word16 continuous_noise_num, /*(i) amount of continuous noise frames Q0*/ - Word32 fg_energy_est_start, /*(i) whether if estimated energy Q0*/ - Word16 bw_index /*(i) band width index Q0*/ +Word32 construct_snr_thresh_fx( + Word16 sp_center[], /*(i) spectral center Q10*/ + Word32 snr_flux, /*(i) snr flux Q25*/ + Word32 lt_snr, /*(i) long time time domain snr Q25*/ + Word32 l_snr, /*(i) long time frequency domain snr Q25*/ + Word32 continuous_speech_num, /*(i) amount of continuous speech frames Q0*/ + Word16 continuous_noise_num, /*(i) amount of continuous noise frames Q0*/ + Word32 fg_energy_est_start, /*(i) whether if estimated energy Q0*/ + Word16 bw_index /*(i) band width index Q0*/ ); void sc_vbr_enc_init_fx( @@ -826,28 +832,42 @@ void updt_enc_common_fx( const Word16 Q_new /* i : CUrrent frame scaling */ ); -void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ); +void attenuateNbSpectrum_fx( + Word16 L_frame, + Word32 *spectrum ); -Word16 corr_xy1_fx( /* o : pitch gain (0..GAIN_PIT_MAX) */ - const Word16 xn_1[], /* i : target signal */ - const Word16 y1_1[], /* i : filtered adaptive codebook excitation */ - Word16 g_corr[], /* o : correlations and -2 */ - const Word16 L_subfr, /* i : vector length */ - const Word16 norm_flag /* i : flag for constraining pitch contribution */ - , - Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ +/* o : pitch gain (0..GAIN_PIT_MAX) */ +Word16 corr_xy1_fx( + const Word16 xn_1[], /* i : target signal */ + const Word16 y1_1[], /* i : filtered adaptive codebook excitation */ + Word16 g_corr[], /* o : correlations and -2 */ + const Word16 L_subfr, /* i : vector length */ + const Word16 norm_flag, /* i : flag for constraining pitch contribution */ + Flag *Overflow_out /* o : propagating the Overflow flag to upper level */ ); -Word16 E_ACELP_indexing_fx( const Word16 code[] /*Q9*/, const PulseConfig *config, Word16 num_tracks /*Q0*/, Word16 prm[] /*Q(shift_bits)*/ ); -void fcb_pulse_track_joint_fx( UWord16 *idxs /*Q0*/, Word16 wordcnt /*Q0*/, UWord32 *index_n /*Q0*/, Word16 *pulse_num /*Q0*/, Word16 track_num /*Q0*/ ); +Word16 E_ACELP_indexing_fx( + const Word16 code[] /*Q9*/, + const PulseConfig *config, + Word16 num_tracks /*Q0*/, + Word16 prm[] /*Q(shift_bits)*/ ); + +void fcb_pulse_track_joint_fx( + UWord16 *idxs /*Q0*/, + Word16 wordcnt /*Q0*/, + UWord32 *index_n /*Q0*/, + Word16 *pulse_num /*Q0*/, + Word16 track_num /*Q0*/ ); + +/* o: quantization index */ +Word16 gain_quant_fx( + Word32 *gain, /* i/o: quantized gain */ + Word16 *gain16, + const Word16 c_min, /* i: log10 of lower limit in Q14 */ + const Word16 c_max, /* i: log10 of upper limit in Q13 */ + const Word16 bits, /* i: number of bits to quantize */ + Word16 *expg ); -Word16 gain_quant_fx( /* o: quantization index */ - Word32 *gain, /* i/o: quantized gain */ - Word16 *gain16, - const Word16 c_min, /* i: log10 of lower limit in Q14 */ - const Word16 c_max, /* i: log10 of upper limit in Q13 */ - const Word16 bits, /* i: number of bits to quantize */ - Word16 *expg ); void gsc_enc_fx( Encoder_State *st_fx, /* i/o: State structure */ Word16 res_dct_in[], /* i : dct of residual signal */ @@ -996,23 +1016,24 @@ void pit16k_Q_enc_ivas_fx( Word16 *T0_max /* o : delta search max_val */ ); #endif -Word16 pitch_fr4_fx( /* o : chosen integer pitch lag */ - const Word16 exc[], /* i : excitation buffer Q_new*/ - const Word16 xn[], /* i : target signal Q_new-1+shift*/ - const Word16 h[], /* i : weighted synthesis filter impulse response Q(14+shift)*/ - const Word16 t0_min, /* i : minimum value in the searched range. Q0*/ - const Word16 t0_max, /* i : maximum value in the searched range. Q0*/ - Word16 *pit_frac, /* o : chosen fraction (0, 1, 2 or 3) */ - const Word16 i_subfr, /* i : flag to first subframe */ - const Word16 limit_flag, /* i : flag for limits (0=restrained, 1=extended) */ - const Word16 t0_fr2, /* i : minimum value for resolution 1/2 */ - const Word16 t0_fr1, /* i : minimum value for resolution 1 */ - const Word16 L_frame, /* i : length of the frame */ - const Word16 L_subfr /* i : size of subframe */ +/* o : chosen integer pitch lag */ +Word16 pitch_fr4_fx( + const Word16 exc[], /* i : excitation buffer Q_new*/ + const Word16 xn[], /* i : target signal Q_new-1+shift*/ + const Word16 h[], /* i : weighted synthesis filter impulse response Q(14+shift)*/ + const Word16 t0_min, /* i : minimum value in the searched range. Q0*/ + const Word16 t0_max, /* i : maximum value in the searched range. Q0*/ + Word16 *pit_frac, /* o : chosen fraction (0, 1, 2 or 3) */ + const Word16 i_subfr, /* i : flag to first subframe */ + const Word16 limit_flag, /* i : flag for limits (0=restrained, 1=extended) */ + const Word16 t0_fr2, /* i : minimum value for resolution 1/2 */ + const Word16 t0_fr1, /* i : minimum value for resolution 1 */ + const Word16 L_frame, /* i : length of the frame */ + const Word16 L_subfr /* i : size of subframe */ #if defined REUSE_EVS_BE_ACELP_PITCH && !defined REUSE_EVS_ACELP_PITCH_NORM_CORR - , - const Word16 element_mode, /* i : mode element */ - const Word16 Q_new /* i : scaling factor */ + , + const Word16 element_mode, /* i : mode element */ + const Word16 Q_new /* i : scaling factor */ #endif ); #ifndef REUSE_EVS_BE_ACELP_PITCH @@ -1032,6 +1053,7 @@ Word16 pitch_fr4_ivas_fx( /* o : chosen integer pitch Word16 Q_new /* i */ ); #endif + void pit_Q_enc_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ @@ -1059,9 +1081,12 @@ void pit_Q_enc_ivas_fx( Word16 *T0_max /* o : delta search max_val */ ); #endif -void PsychAdaptLowFreqEmph_fx( Word32 x[], - const Word16 lpcGains[], - const Word16 lpcGains_e[] ); + +void PsychAdaptLowFreqEmph_fx( + Word32 x[], + const Word16 lpcGains[], + const Word16 lpcGains_e[] ); + void set_bw_fx( const Word16 element_mode, /* i : element mode */ const Word32 element_brate, /* i : element bitrate */ @@ -1073,20 +1098,22 @@ void set_bw_stereo_fx( CPE_ENC_HANDLE hCPE /* i/o: CPE encoder structures */ ); -Word16 WB_BWE_encoding_fx( /* o : classification of wb signal */ - const Word16 coder_type, /* i : coder type */ - const Word16 *yos_fx, /* i : MDCT coefficients of weighted original */ - Word16 *WB_fenv_fx, /* i/o: energy of WB envelope */ - Encoder_State *st_fx, /* i/o: Encoder structure */ - Word16 Q_synth, - Word16 Q_synth_lf ); +/* o : classification of wb signal */ +Word16 WB_BWE_encoding_fx( + const Word16 coder_type, /* i : coder type */ + const Word16 *yos_fx, /* i : MDCT coefficients of weighted original */ + Word16 *WB_fenv_fx, /* i/o: energy of WB envelope */ + Encoder_State *st_fx, /* i/o: Encoder structure */ + Word16 Q_synth, + Word16 Q_synth_lf ); -Word16 WB_BWE_encoding_ivas_fx( /* o : classification of wb signal */ - Encoder_State *st_fx, /* i/o: Encoder structure */ - const Word32 *yos_fx, /* i : MDCT coefficients of weighted original */ - Word16 *WB_fenv_fx, /* i/o: energy of WB envelope */ - Word16 Q_synth, - Word16 Q_synth_lf ); +/* o : classification of wb signal */ +Word16 WB_BWE_encoding_ivas_fx( + Encoder_State *st_fx, /* i/o: Encoder structure */ + const Word32 *yos_fx, /* i : MDCT coefficients of weighted original */ + Word16 *WB_fenv_fx, /* i/o: energy of WB envelope */ + Word16 Q_synth, + Word16 Q_synth_lf ); void calculate_hangover_attenuation_gain_fx( Encoder_State *st, /* i : encoder state structure */ @@ -1102,14 +1129,16 @@ void calculate_hangover_attenuation_gain_fx( * Don't include the delay of the MDCT overlap. * @param pTransientDetection Structure to be initialized. It contains all transient detectors to be used. */ -void InitTransientDetection_fx( Word16 nFrameLength, - Word16 nTCXDelay, - struct TransientDetection *pTransientDetection ); +void InitTransientDetection_fx( + Word16 nFrameLength, + Word16 nTCXDelay, + struct TransientDetection *pTransientDetection ); -void InitTransientDetection_ivas_fx( Word16 nFrameLength, - Word16 nTCXDelay, - TRAN_DET_HANDLE pTransientDetection, - const Word16 ext_mem_flag ); +void InitTransientDetection_ivas_fx( + Word16 nFrameLength, + Word16 nTCXDelay, + TRAN_DET_HANDLE pTransientDetection, + const Word16 ext_mem_flag ); /** Runs transient detection. * Runs all transient detectors defined in pTransientDetection @@ -1118,7 +1147,10 @@ void InitTransientDetection_ivas_fx( Word16 nFrameLength, * @param nSamplesAvailable Number of new i samples available. * @param pTransientDetection Structure that contains transient detectors to be run. */ -void RunTransientDetection_fx( Word16 const *i, Word16 nSamplesAvailable, struct TransientDetection *pTransientDetection ); +void RunTransientDetection_fx( + Word16 const *i, + Word16 nSamplesAvailable, + struct TransientDetection *pTransientDetection ); void RunTransientDetection_ivas_fx( @@ -1135,8 +1167,15 @@ void RunTransientDetection_ivas_fx( * @param nPrevSubblocks Number of subblocks from the previous frames to use for the calculation. * @return average temporal flatness measure with exponent AVG_FLAT_E */ -Word16 GetTCXAvgTemporalFlatnessMeasure_fx( struct TransientDetection const *pTransientDetection, Word16 nCurrentSubblocks, Word16 nPrevSubblocks ); -Word32 GetTCXAvgTemporalFlatnessMeasure_ivas_fx( struct TransientDetection const *pTransientDetection, Word16 nCurrentSubblocks, Word16 nPrevSubblocks ); +Word16 GetTCXAvgTemporalFlatnessMeasure_fx( + struct TransientDetection const *pTransientDetection, + Word16 nCurrentSubblocks, + Word16 nPrevSubblocks ); + +Word32 GetTCXAvgTemporalFlatnessMeasure_ivas_fx( + struct TransientDetection const *pTransientDetection, + Word16 nCurrentSubblocks, + Word16 nPrevSubblocks ); /** Get the maximum energy change using subblock energies aligned with the TCX. * @param pTransientDetection Structure that contains transient detectors to be run. @@ -1145,16 +1184,18 @@ Word32 GetTCXAvgTemporalFlatnessMeasure_ivas_fx( struct TransientDetection const * @param nPrevSubblocks Number of subblocks from the previous frames to use for the calculation. * @param maximum energy change with exponent NRG_CHANGE_E */ -Word16 GetTCXMaxenergyChange_fx( struct TransientDetection const *pTransientDetection, - const Word8 isTCX10, - const Word16 nCurrentSubblocks, - const Word16 nPrevSubblocks ); +Word16 GetTCXMaxenergyChange_fx( + struct TransientDetection const *pTransientDetection, + const Word8 isTCX10, + const Word16 nCurrentSubblocks, + const Word16 nPrevSubblocks ); -Word16 GetTCXMaxenergyChange_ivas_fx( TRAN_DET_HANDLE hTranDet, - const Word8 isTCX10, - const Word16 nCurrentSubblocks, - const Word16 nPrevSubblocks ); +Word16 GetTCXMaxenergyChange_ivas_fx( + TRAN_DET_HANDLE hTranDet, + const Word8 isTCX10, + const Word16 nCurrentSubblocks, + const Word16 nPrevSubblocks ); /** Set TCX window length and overlap configuration * @param prevEnergyHF previous HF energy. Exponent must be the same as for currEnergyHF. @@ -1170,13 +1211,15 @@ void SetTCXModeInfo_ivas_fx( * @param prevEnergyHF previous HF energy. Exponent must be the same as for currEnergyHF. * @param currEnergyHF current HF energy. Exponent must be the same as for prevEnergyHF. */ -void SetTCXModeInfo_fx( Encoder_State *st, - struct TransientDetection const *pTransientDetection, - Word16 *tcxModeOverlap ); +void SetTCXModeInfo_fx( + Encoder_State *st, + struct TransientDetection const *pTransientDetection, + Word16 *tcxModeOverlap ); void GSC_enc_init_fx( GSC_ENC_HANDLE hGSCEnc /* i/o: GSC data handle */ ); + void td_cng_enc_init_fx( TD_CNG_ENC_HANDLE hTdCngEnc, /* i/o: DTX/TD CNG data handle */ const Word16 Opt_DTX_ON, /* i : flag indicating DTX operation Q0*/ @@ -1194,6 +1237,7 @@ void dtx_enc_init_fx( const Word16 var_SID_rate_flag, /* i : flag for variable SID update rate Q0*/ const Word16 interval_SID /* i : interval for SID update Q0*/ ); + void select_TC_fx( const Word16 codec_mode, /* i : codec mode */ const Word16 tc_cnt, /* i : TC frame counter */ @@ -1223,6 +1267,7 @@ void pitchDoubling_det_fx( Word16 *pitch_ol, Word16 *T_op_fr, Word16 *voicing_fr ); + void fd_bwe_enc_init_fx( FD_BWE_ENC_HANDLE hBWE_FD /* i/o: FD BWE data handle */ ); @@ -1265,6 +1310,7 @@ void ProcessIGF_fx( Word16 isTransition, /**< in: flag indicating if the i is the transition from from ACELP to TCX20/TCX10 */ Word16 frameno /**< in: flag indicating index of current subframe */ ); + void AnalyzePowerSpectrum_fx( Encoder_State *st, /* i/o: encoder states */ Word16 L_frame, /* i : frame length */ @@ -1290,35 +1336,40 @@ void AnalyzePowerSpectrum_ivas_fx( Word32 powerSpec[], /* o : Power spectrum. Can point to signal */ Word16 powerSpec_e[] ); -void AdaptLowFreqEmph_fx( Word32 x[], - Word16 x_e, - Word16 xq[], - Word16 invGain, - Word16 invGain_e, - Word16 tcx_lpc_shaped_ari, - Word16 lpcGains[], - Word16 lpcGains_e[], - const Word16 lg ); -Word16 SQ_gain_fx( /* o : SQ gain */ - Word32 x[], /* i : vector to quantize */ - Word16 x_e, /* i : exponent */ - Word16 nbitsSQ, /* i : number of bits targeted */ - Word16 lg, /* i : vector size (2048 max) */ - Word16 *gain_e ); /* o : SQ gain exponent */ - -Word16 SQ_gain_ivas_fx( /* o : SQ gain */ - Word32 x[], /* i : vector to quantize */ - Word16 x_e, /* i : exponent */ - Word16 nbitsSQ, /* i : number of bits targeted */ - Word16 lg, /* i : vector size (2048 max) */ - Word16 *gain_e ); /* o : SQ gain exponent */ - -Word16 SQ_gain_estimate_fx( /* o : SQ gain */ - Word32 x[], /* i : vector to quantize */ - Word16 x_e, /* i : exponent */ - Word16 nbitsSQ, /* i : number of bits targeted */ - Word16 lg, /* i : vector size (2048 max) */ - Word16 *gain_e ); /* o : SQ gain exponent */ +void AdaptLowFreqEmph_fx( + Word32 x[], + Word16 x_e, + Word16 xq[], + Word16 invGain, + Word16 invGain_e, + Word16 tcx_lpc_shaped_ari, + Word16 lpcGains[], + Word16 lpcGains_e[], + const Word16 lg ); + +/* o : SQ gain */ +Word16 SQ_gain_fx( + Word32 x[], /* i : vector to quantize */ + Word16 x_e, /* i : exponent */ + Word16 nbitsSQ, /* i : number of bits targeted */ + Word16 lg, /* i : vector size (2048 max) */ + Word16 *gain_e ); /* o : SQ gain exponent */ + +/* o : SQ gain */ +Word16 SQ_gain_ivas_fx( + Word32 x[], /* i : vector to quantize */ + Word16 x_e, /* i : exponent */ + Word16 nbitsSQ, /* i : number of bits targeted */ + Word16 lg, /* i : vector size (2048 max) */ + Word16 *gain_e ); /* o : SQ gain exponent */ + +/* o : SQ gain */ +Word16 SQ_gain_estimate_fx( + Word32 x[], /* i : vector to quantize */ + Word16 x_e, /* i : exponent */ + Word16 nbitsSQ, /* i : number of bits targeted */ + Word16 lg, /* i : vector size (2048 max) */ + Word16 *gain_e ); /* o : SQ gain exponent */ void tcx_scalar_quantization_fx( Word32 *x, /* i: i coefficients */ @@ -1496,19 +1547,21 @@ Word16 tcx_res_Q_spec_ivas_fx( const Word16 lf_deemph_factors[] ); /* compute noise-measure flags for spectrum filling and quantization (0: tonal, 1: noise-like) */ -void ComputeSpectrumNoiseMeasure_fx( const Word32 *powerSpec, - Word16 L_frame, - Word16 startLine, - Word8 resetMemory, - Word8 *noiseFlags, - Word16 lowpassLine ); +void ComputeSpectrumNoiseMeasure_fx( + const Word32 *powerSpec, + Word16 L_frame, + Word16 startLine, + Word8 resetMemory, + Word8 *noiseFlags, + Word16 lowpassLine ); -void ComputeSpectrumNoiseMeasure_ivas_fx( Word64 *powerSpec, /* Qx */ - Word16 L_frame, /* Q0 */ - Word16 startLine, /* Q0 */ - Word8 resetMemory, /* Q0 */ - Word8 *noiseFlags, /* Q0 */ - Word16 lowpassLine /* Q0 */ +void ComputeSpectrumNoiseMeasure_ivas_fx( + Word64 *powerSpec, /* Qx */ + Word16 L_frame, /* Q0 */ + Word16 startLine, /* Q0 */ + Word8 resetMemory, /* Q0 */ + Word8 *noiseFlags, /* Q0 */ + Word16 lowpassLine /* Q0 */ ); void lpc_quantization_fx( @@ -1564,11 +1617,20 @@ void Mode2_pit_encode_fx( Word16 pit_fr2, Word16 pit_max, Word16 pit_res_max ); + #ifndef REUSE_EVS_BE_ACELP_4T64 void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ); void E_ACELP_4tsearch_ivas_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/ ); #else -void E_ACELP_4tsearch_fx( Word16 dn[] /*Qdn*/, const Word16 cn[] /*Q_xn*/, const Word16 H[] /*Q12*/, Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/, Word16 y[] /*Qy*/, const Word16 element_mode ); +void E_ACELP_4tsearch_fx( + Word16 dn[] /*Qdn*/, + const Word16 cn[] /*Q_xn*/, + const Word16 H[] /*Q12*/, + Word16 code[] /*Q9*/, + const PulseConfig *config, + Word16 ind[] /*Q0*/, + Word16 y[] /*Qy*/, + const Word16 element_mode ); #endif void E_ACELP_4t_fx( Word16 dn[], /* Qdn */ @@ -1647,10 +1709,11 @@ void CalculateTnsFilt_fx( * @param pTnsData TNS data is filled with sensible information. * @return Returns 1 if Tns should be used, otherwise 0. */ -Word16 DetectTnsFilt_fx( STnsConfig const *pTnsConfig, - Word32 const pSpectrum[], - STnsData *pTnsData, - Word16 *predictionGain ); +Word16 DetectTnsFilt_fx( + STnsConfig const *pTnsConfig, + Word32 const pSpectrum[], + STnsData *pTnsData, + Word16 *predictionGain ); /** Detect TNS parameters. * Detects if TNS should be used and fills TNS data in pTnsData. @@ -1661,13 +1724,14 @@ TNS is tested on the spectrum defined by pSpectrum. * @param pTnsData TNS data is filled with sensible information. * @return Returns 1 if Tns should be used, otherwise 0. */ -Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configuration struct */ - Word32 const pSpectrum[], /* i : MDCT spectrum Q=Qx */ - STnsData *pTnsData, /* o : TNS data struct */ - TRAN_DET_HANDLE hTranDet, /* i : transient detection handle */ - Word8 isTCX10, /* i : TCX10 or TCX20? */ - Word16 ltp_gain, /* i : LTP gain Q=15 */ - Word16 *predictionGain /* o : TNS prediction gain Q=7 */ +Word16 DetectTnsFilt_ivas_fx( + STnsConfig const *pTnsConfig, /* i : TNS Configuration struct */ + Word32 const pSpectrum[], /* i : MDCT spectrum Q=Qx */ + STnsData *pTnsData, /* o : TNS data struct */ + TRAN_DET_HANDLE hTranDet, /* i : transient detection handle */ + Word8 isTCX10, /* i : TCX10 or TCX20? */ + Word16 ltp_gain, /* i : LTP gain Q=15 */ + Word16 *predictionGain /* o : TNS prediction gain Q=7 */ ); @@ -1680,11 +1744,12 @@ Word16 DetectTnsFilt_ivas_fx( STnsConfig const *pTnsConfig, /* i : TNS Configur * @param pnBits Set to the number of required. * @return 0 on success, otherwise 1. */ -Word16 EncodeTnsData_fx( STnsConfig const *pTnsConfig, - STnsData const *pTnsData, - Word16 *stream, - Word16 *pnSize, - Word16 *pnBits ); +Word16 EncodeTnsData_fx( + STnsConfig const *pTnsConfig, + STnsData const *pTnsData, + Word16 *stream, + Word16 *pnSize, + Word16 *pnBits ); /** Write TNS data into a bitstream. * Writes TNS data into a bitstream. @@ -1695,17 +1760,19 @@ Word16 EncodeTnsData_fx( STnsConfig const *pTnsConfig, * @param pnBits Set to the number of bits written. * @return 0 on success, otherwise 1. */ -Word16 WriteTnsData_fx( STnsConfig const *pTnsConfig, - Word16 const *stream, - Word16 *pnSize, - Encoder_State *st, - Word16 *pnBits ); - -Word16 WriteTnsData_ivas_fx( STnsConfig const *pTnsConfig, - Word16 const *stream, - Word16 *pnSize, - BSTR_ENC_HANDLE hBstr, - Word16 *pnBits ); +Word16 WriteTnsData_fx( + STnsConfig const *pTnsConfig, + Word16 const *stream, + Word16 *pnSize, + Encoder_State *st, + Word16 *pnBits ); + +Word16 WriteTnsData_ivas_fx( + STnsConfig const *pTnsConfig, + Word16 const *stream, + Word16 *pnSize, + BSTR_ENC_HANDLE hBstr, + Word16 *pnBits ); void subband_FFT_fx( Word32 **Sr, /*(i) real part of the CLDFB*/ @@ -1721,7 +1788,13 @@ Word16 E_ACELP_toeplitz_mul_fx( const Word16 L_subfr, /* Q0 */ const Word16 highrate /* Q0 */ ); -Word16 E_ACELP_code43bit_fx( const Word16 code[], UWord32 *ps, Word16 *p, UWord16 idxs[] ); + +Word16 E_ACELP_code43bit_fx( + const Word16 code[], + UWord32 *ps, + Word16 *p, + UWord16 idxs[] ); + void tc_classif_enc_fx( const Word16 Q_new, /* i : scaling factor */ const Word16 L_frame, /* i : length of the frame */ @@ -1746,6 +1819,7 @@ Word16 gain_enc_uv_fx( Word16 *gain_inov, /*0=rel */ - const Word32 sr_core /* i : internal sampling rate */ +/* o : number of allocated bits */ +Word16 vlpc_2st_cod_fx( + const Word16 *lsf, /* i : normalized vector to quantize */ + Word16 *lsfq, /* i/o: i:1st stage o:1st+2nd stage */ + Word16 *indx, /* o : index[] (4 bits per words) */ + const Word16 mode, /* i : 0=abs, >0=rel */ + const Word32 sr_core /* i : internal sampling rate */ ); Word16 update_decision_fx( @@ -3260,9 +3406,10 @@ void spec_center_fx( const Word16 Q_sb_p /* i : the Scaling of sb_power*/ ); -void spec_flatness_fx( Word32 *spec_amp, /*(i) spectral amplitude*/ - Word32 smooth_spec_amp[], /*(i) smoothed spectral amplitude*/ - Word16 sSFM[SFM_NUM] /*(o) spectral flatness rate*/ +void spec_flatness_fx( + Word32 *spec_amp, /*(i) spectral amplitude*/ + Word32 smooth_spec_amp[], /*(i) smoothed spectral amplitude*/ + Word16 sSFM[SFM_NUM] /*(o) spectral flatness rate*/ ); void SetModeIndex_fx( @@ -3283,6 +3430,7 @@ void MDCT_selector_fx( void MDCT_selector_reset_fx( TCX_ENC_HANDLE hTcxEnc ); + void MDCT_classifier_reset_fx( TCX_ENC_HANDLE hTcxEnc /* i/o: TCX Encoder Handle */ ); @@ -3294,6 +3442,7 @@ void ltd_stable_fx( const Word16 frameloop, /* i : amount of frames*/ const Word16 Q_frames_power /* i : the Scaling of frames_power*/ ); + /* IGFSCFEncoder.c */ void IGFSCFEncoderOpen_fx( IGFSCFENC_INSTANCE_HANDLE hPublicData, /* i/o: handle to public data */ @@ -3359,22 +3508,23 @@ void background_update_fx( ); /* enc_gain.c */ -Word16 E_GAIN_closed_loop_search_fx( Word16 exc[], /*Q_new*/ - Word16 xn[], /*Q_xn*/ - Word16 h[], /* Q14+shift */ - Word16 t0_min, - Word16 t0_min_frac, - Word16 t0_max, - Word16 t0_max_frac, - Word16 t0_min_max_res, - Word16 *pit_frac, - Word16 *pit_res, - Word16 pit_res_max, - Word16 i_subfr, - Word16 pit_min, - Word16 pit_fr2, - Word16 pit_fr1, - Word16 L_subfr ); +Word16 E_GAIN_closed_loop_search_fx( + Word16 exc[], /*Q_new*/ + Word16 xn[], /*Q_xn*/ + Word16 h[], /* Q14+shift */ + Word16 t0_min, + Word16 t0_min_frac, + Word16 t0_max, + Word16 t0_max_frac, + Word16 t0_min_max_res, + Word16 *pit_frac, + Word16 *pit_res, + Word16 pit_res_max, + Word16 i_subfr, + Word16 pit_min, + Word16 pit_fr2, + Word16 pit_fr1, + Word16 L_subfr ); void core_acelp_tcx20_switching_fx( Encoder_State *st, /* i/o: encoder state structure */ @@ -3400,6 +3550,7 @@ Word16 comvad_decision_fx( const Word16 frame_energy_Q, /*(i) the Scaling of current frame energy*/ Word16 *cldfb_addition, /*(o) adjust the harmonized hangover */ const Word16 vada_flag ); + void amr_wb_enc_init_fx( AMRWB_IO_ENC_HANDLE hAmrwb_IO /* i/o: AMR-WB IO encoder handle */ ); @@ -3412,6 +3563,7 @@ void snr_calc( const Word32 frame_energy, /* i : current frame energy sacle_sbpower*/ const Word32 bwidth /* i : audio band width Q0*/ ); + void FEC_encode_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const ACELP_config acelp_cfg, /* i/o: configuration of the ACELP */ @@ -3447,30 +3599,32 @@ void update_average_rate_fx( SC_VBR_ENC_HANDLE hSC_VBR, /* i/o: SC-VBR state structure */ const Word32 core_brate_fx /* i : core bitrate */ ); -Word16 pit_encode_fx( /* o : Fractional pitch for each subframe */ - BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ - const Word16 pitch_bits[], /* i : pitch bits */ - const Word32 core_brate, /* i : core bitrate */ - const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ - const Word16 L_frame, /* i : length of the frame */ - const Word16 coder_type, /* i : coding type */ - Word16 *limit_flag, /* i/o: restrained(0) or extended(1) Q limits */ - const Word16 i_subfr, /* i : subframe index */ - Word16 *exc, /* i/o: pointer to excitation signal frame */ - const Word16 L_subfr, /* i : subframe length */ - const Word16 *T_op, /* i : open loop pitch estimates in current frame */ - Word16 *T0_min, /* i/o: lower limit for close-loop search */ - Word16 *T0_max, /* i/o: higher limit for close-loop search */ - Word16 *T0, /* i/o: close loop integer pitch */ - Word16 *T0_frac, /* i/o: close loop fractional part of the pitch */ - const Word16 *h1, /* i : weighted filter i response */ - const Word16 *xn, /* i : target vector */ - const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ - const Word16 tdm_Pri_pitch_buf[] /* i : primary channel pitch buffer */ + +/* o : Fractional pitch for each subframe */ +Word16 pit_encode_fx( + BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ + const Word16 pitch_bits[], /* i : pitch bits */ + const Word32 core_brate, /* i : core bitrate */ + const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ + const Word16 L_frame, /* i : length of the frame */ + const Word16 coder_type, /* i : coding type */ + Word16 *limit_flag, /* i/o: restrained(0) or extended(1) Q limits */ + const Word16 i_subfr, /* i : subframe index */ + Word16 *exc, /* i/o: pointer to excitation signal frame */ + const Word16 L_subfr, /* i : subframe length */ + const Word16 *T_op, /* i : open loop pitch estimates in current frame */ + Word16 *T0_min, /* i/o: lower limit for close-loop search */ + Word16 *T0_max, /* i/o: higher limit for close-loop search */ + Word16 *T0, /* i/o: close loop integer pitch */ + Word16 *T0_frac, /* i/o: close loop fractional part of the pitch */ + const Word16 *h1, /* i : weighted filter i response */ + const Word16 *xn, /* i : target vector */ + const Word16 tdm_Pitch_reuse_flag, /* i : primary channel pitch reuse flag */ + const Word16 tdm_Pri_pitch_buf[] /* i : primary channel pitch buffer */ #if defined REUSE_EVS_BE_ACELP_PITCH && !defined REUSE_EVS_ACELP_PITCH_NORM_CORR - , - const Word16 element_mode, /* i : mode element */ - const Word16 Q_new /* i : scaling factor */ + , + const Word16 element_mode, /* i : mode element */ + const Word16 Q_new /* i : scaling factor */ #endif ); @@ -3532,6 +3686,7 @@ Word16 lp_filt_exc_enc_ivas_fx( Word16 *lp_flag /* i/o: mode selection Q0 */ ); #endif + Word16 inov_encode_fx( Encoder_State *st_fx, /* i/o: encoder state structure */ const Word32 core_brate, /* i : core bitrate */ @@ -3712,7 +3867,6 @@ void gain_enc_amr_wb_fx( Word16 *past_qua_en /* i/o: gain quantization memory (4 words) Q10*/ ); - void hf_cod_fx( const Word32 core_brate_fx, /* i : core bitrate */ const Word16 *speech16k_fx, /* i : original speech at 16 kHz */ @@ -4221,28 +4375,32 @@ void diffcod_fx( Word16 *difidx /* (o) differential code Q0*/ ); -Word16 hq_classifier_enc_fx( /* o : Consumed bits Q0 */ - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word16 length, /* i : Frame length Q0 */ - const Word32 *coefs, /* i : Spectral coefficients Q12 */ - const Word16 is_transient, /* i : Transient flag Q0 */ - Word16 *Npeaks, /* o : Number of identified peaks Q0 */ - Word16 *peaks, /* o : Peak indices Q0 */ - Word32 *pe_gains, /* o : Peak gains Q12 */ - Word32 *nf_gains, /* o : Noise-fill gains Q12 */ - Word16 *hqswb_clas /* o : HQ class Q0 */ -); -Word16 hq_classifier_enc_ivas_fx( /* o : Consumed bits Q0 */ - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word16 length, /* i : Frame length Q0 */ - const Word32 *coefs, /* i : Spectral coefficients Q12 */ - const Word16 is_transient, /* i : Transient flag Q0 */ - Word16 *Npeaks, /* o : Number of identified peaks Q0 */ - Word16 *peaks, /* o : Peak indices Q0 */ - Word32 *pe_gains, /* o : Peak gains Q12 */ - Word32 *nf_gains, /* o : Noise-fill gains Q12 */ - Word16 *hqswb_clas /* o : HQ class Q0 */ +/* o : Consumed bits Q0 */ +Word16 hq_classifier_enc_fx( + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word16 length, /* i : Frame length Q0 */ + const Word32 *coefs, /* i : Spectral coefficients Q12 */ + const Word16 is_transient, /* i : Transient flag Q0 */ + Word16 *Npeaks, /* o : Number of identified peaks Q0 */ + Word16 *peaks, /* o : Peak indices Q0 */ + Word32 *pe_gains, /* o : Peak gains Q12 */ + Word32 *nf_gains, /* o : Noise-fill gains Q12 */ + Word16 *hqswb_clas /* o : HQ class Q0 */ +); + +/* o : Consumed bits Q0 */ +Word16 hq_classifier_enc_ivas_fx( + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word16 length, /* i : Frame length Q0 */ + const Word32 *coefs, /* i : Spectral coefficients Q12 */ + const Word16 is_transient, /* i : Transient flag Q0 */ + Word16 *Npeaks, /* o : Number of identified peaks Q0 */ + Word16 *peaks, /* o : Peak indices Q0 */ + Word32 *pe_gains, /* o : Peak gains Q12 */ + Word32 *nf_gains, /* o : Noise-fill gains Q12 */ + Word16 *hqswb_clas /* o : HQ class Q0 */ ); + void diff_envelope_coding_fx( const Word16 is_transient, /* i : transient indicator Q0 */ const Word16 num_env_bands, /* i : number of envelope bands to code Q0 */ @@ -4252,16 +4410,17 @@ void diff_envelope_coding_fx( Word16 *difidx /* o : differential code Q0 */ ); -Word16 encode_envelope_indices_ivas_fx( /* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ - BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ - const Word16 num_sfm, /* i : Number of subbands Q0 */ - const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0 */ - Word16 *difidx, /* i/o: Diff indices/encoded diff indices Q0 */ - Word16 *LCmode, /* o : Coding mode if flag_pack=0, i : if flag_pack=1 Q0 */ - const Word16 flag_pack, /* i : indicator of packing or estimating bits Q0 */ - const Word16 flag_HQ2 /* i : indicator of HQ2 core Q0 */ - , - const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0 */ +/* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ +Word16 encode_envelope_indices_ivas_fx( + BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ + const Word16 num_sfm, /* i : Number of subbands Q0 */ + const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0 */ + Word16 *difidx, /* i/o: Diff indices/encoded diff indices Q0 */ + Word16 *LCmode, /* o : Coding mode if flag_pack=0, i : if flag_pack=1 Q0 */ + const Word16 flag_pack, /* i : indicator of packing or estimating bits Q0 */ + const Word16 flag_HQ2 /* i : indicator of HQ2 core Q0 */ + , + const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0 */ ); void hq_generic_encoding_fx( @@ -4281,34 +4440,38 @@ void normalizecoefs_fx( Word16 *coefs_norm /* o : Normalized output vector (Q12) */ ); -Word16 hvq_enc_fx( /* o : Consumed bits */ - Encoder_State *st_fx, /* i/o: encoder state structure */ - const Word32 brate, /* i : Total bit rate */ - const Word16 hvq_bits, /* i : HVQ bit budget */ - const Word16 Npeaks, /* i : Number of peaks */ - const Word16 *ynrm, /* i : Envelope coefficients */ - Word16 *R, /* i/o: Bit allocation/updated bit allocation */ - Word16 *peaks, /* i : Peak pos. / Encoded peak pos. */ - Word32 *nf_gains, /* i/o: Noise fill gains / Quant. nf gains */ - Word16 *noise_level, /* o : Quantized noise level */ - const Word32 *pe_gains, /* i : Peak gains */ - const Word32 *coefs, /* i : spectrum coefficients in Q14 */ - Word32 *coefs_out /* o : encoded spectrum coefficients in Q14 */ -); -Word16 hvq_enc_ivas_fx( /*o : Consumed bits */ - Encoder_State *st_fx, /*i/o: encoder state structure */ - const Word32 core_brate, /*i : Total bit rate */ - const Word16 hvq_bits, /*i : HVQ bit budget */ - const Word16 Npeaks, /*i : Number of peaks */ - const Word16 *ynrm, /* i : Envelope coefficients */ - Word16 *R, /* i/o: Bit allocation/updated bit allocation */ - Word16 *peaks, /* i : Peak pos. / Encoded peak pos. */ - Word32 *nf_gains, /* i/o: Noise fill gains / Quant. nf gains Q12 */ - Word16 *noise_level, /* o : Quantized noise level Q15 */ - const Word32 *pe_gains, /* i : Peak gains */ - const Word32 *coefs, /* i : spectrum coefficients in Q12 */ - Word32 *coefs_out /* o : encoded spectrum coefficients in Q12 */ +/* o : Consumed bits */ +Word16 hvq_enc_fx( + Encoder_State *st_fx, /* i/o: encoder state structure */ + const Word32 brate, /* i : Total bit rate */ + const Word16 hvq_bits, /* i : HVQ bit budget */ + const Word16 Npeaks, /* i : Number of peaks */ + const Word16 *ynrm, /* i : Envelope coefficients */ + Word16 *R, /* i/o: Bit allocation/updated bit allocation */ + Word16 *peaks, /* i : Peak pos. / Encoded peak pos. */ + Word32 *nf_gains, /* i/o: Noise fill gains / Quant. nf gains */ + Word16 *noise_level, /* o : Quantized noise level */ + const Word32 *pe_gains, /* i : Peak gains */ + const Word32 *coefs, /* i : spectrum coefficients in Q14 */ + Word32 *coefs_out /* o : encoded spectrum coefficients in Q14 */ +); + +/* o : Consumed bits */ +Word16 hvq_enc_ivas_fx( + Encoder_State *st_fx, /*i/o: encoder state structure */ + const Word32 core_brate, /*i : Total bit rate */ + const Word16 hvq_bits, /*i : HVQ bit budget */ + const Word16 Npeaks, /*i : Number of peaks */ + const Word16 *ynrm, /* i : Envelope coefficients */ + Word16 *R, /* i/o: Bit allocation/updated bit allocation */ + Word16 *peaks, /* i : Peak pos. / Encoded peak pos. */ + Word32 *nf_gains, /* i/o: Noise fill gains / Quant. nf gains Q12 */ + Word16 *noise_level, /* o : Quantized noise level Q15 */ + const Word32 *pe_gains, /* i : Peak gains */ + const Word32 *coefs, /* i : spectrum coefficients in Q12 */ + Word32 *coefs_out /* o : encoded spectrum coefficients in Q12 */ ); + Word16 pvq_core_enc_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ Word16 coefs_norm[], /* i/o: normalized coefficients to encode */ @@ -4326,14 +4489,17 @@ Word16 pvq_core_enc_fx( const Word16 core /* i : number of bands */ ); -Word16 noise_adjust_fx( /* o : index of noise attenuation Q0 */ - const Word16 *coeffs_norm, /* i : normalized coefficients Qx */ - const Word16 qx, /* i : Q value of coeffs_norm */ - const Word16 *bitalloc, /* i : bit allocation Q0 */ - const Word16 *sfm_start, /* i : band start Q0 */ - const Word16 *sfm_end, /* i : band end Q0 */ - const Word16 core_sfm /* i : index of the end band for core Q0 */ +/* o : index of noise attenuation Q0 */ +Word16 noise_adjust_fx( + const Word16 *coeffs_norm, /* i : normalized coefficients Qx */ + const Word16 qx, /* i : Q value of coeffs_norm */ + const Word16 *bitalloc, /* i : bit allocation Q0 */ + const Word16 *sfm_start, /* i : band start Q0 */ + const Word16 *sfm_end, /* i : band end Q0 */ + const Word16 core_sfm /* i : index of the end band for core Q0 */ ); + + ivas_error tcq_core_LR_enc_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ Word16 inp_vector_fx[], /* x5 */ @@ -4375,17 +4541,18 @@ ivas_error tcq_core_LR_enc_ivas_fx( const Word16 adjustFlag, const Word16 is_transient ); -Word16 encode_envelope_indices_fx( /* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ - BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ - const Word16 num_sfm, /* i : Number of subbands Q0 */ - const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0 */ - Word16 *difidx, /* i/o: Diff indices/encoded diff indices Q0 */ - Word16 *LCmode, /* o : Coding mode if flag_pack=0, i : if flag_pack=1 Q0 */ - const Word16 flag_pack, /* i : indicator of packing or estimating bits Q0 */ - const Word16 flag_HQ2 /* i : indicator of HQ2 core Q0 */ - , - const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0 */ +/* o : Number of bits if flag_pack=0,0 if flag_pack=1 Q0 */ +Word16 encode_envelope_indices_fx( + BSTR_ENC_HANDLE hBstr, /* i : handle to the bitstream Q0 */ + const Word16 num_sfm, /* i : Number of subbands Q0 */ + const Word16 numnrmibits, /* i : Bitrate of fall-back coding mode Q0 */ + Word16 *difidx, /* i/o: Diff indices/encoded diff indices Q0 */ + Word16 *LCmode, /* o : Coding mode if flag_pack=0, i : if flag_pack=1 Q0 */ + const Word16 flag_pack, /* i : indicator of packing or estimating bits Q0 */ + const Word16 flag_HQ2, /* i : indicator of HQ2 core Q0 */ + const Word16 is_transient /* i : indicator of HQ_TRANSIENT Q0 */ ); + void diffcod_lrmdct_fx( const Word16 N, /* i : number of sub-vectors Q0*/ const Word16 be_ref, /* i : band energy reference Q0*/ @@ -4393,6 +4560,7 @@ void diffcod_lrmdct_fx( Word16 *difidx, /* o : differential code Q0*/ const Word16 is_transient /* i : transient flag Q0*/ ); + Word16 peak_vq_enc_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word16 bwidth, /* i : audio bandwidth */ @@ -4406,6 +4574,7 @@ Word16 peak_vq_enc_ivas_fx( Word16 *vq_peak_idx, /* i : Peak index vector */ Word32 *nf_gains /* i : Estimated noise floor gains Q12 */ ); + Word16 peak_vq_enc_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const Word16 bwidth, /* i : audio bandwidth */ @@ -4443,7 +4612,12 @@ void InitSWBencBuffer_ivas_fx( void ResetSHBbuffer_Enc_fx( Encoder_State *st_fx /* i/o: SHB encoder structure */ ); -Word16 E_ACELP_hh_corr( Word16 *x /*Q11*/, Word16 *y /*Qy*/, Word16 L_subfr /*Q0*/, Word16 bits /*Q0*/ ); + +Word16 E_ACELP_hh_corr( + Word16 *x /*Q11*/, + Word16 *y /*Qy*/, + Word16 L_subfr /*Q0*/, + Word16 bits /*Q0*/ ); void acelp_1t64_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ @@ -4453,6 +4627,7 @@ void acelp_1t64_fx( Word16 y[], /* o : filtered fixed codebook excitation */ const Word16 L_subfr /* i : subframe length */ ); + #ifndef REUSE_EVS_BE_ACELP_1t64 void acelp_1t64_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ @@ -4511,6 +4686,7 @@ Word16 acelp_4t64_ivas_fx( const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ Word16 element_mode ); #endif + ivas_error evs_enc_fx( Encoder_State *st, /* i/o: encoder state structure */ const Word16 *data, /* i : input signal Q0*/ @@ -4518,17 +4694,19 @@ ivas_error evs_enc_fx( const Word16 n_samples /* i : number of input samples Q0*/ ); +/* o: Qx y(n) */ /* y(n)(Qx) = alpha(Q15) * x(Qx) + (1.0f-alpha)* y(n-1) (Qx) */ -Word16 noise_est_AR1_Qx( /* o: Qx y(n) */ - Word16 x, /* i : Qx x(n) */ - Word16 y, /* i : Qx y(n-1) */ - Word16 alpha /*i : Q15 scaling of driving x(n) */ +Word16 noise_est_AR1_Qx( + Word16 x, /* i : Qx x(n) */ + Word16 y, /* i : Qx y(n-1) */ + Word16 alpha /*i : Q15 scaling of driving x(n) */ ); -Word32 noise_est_AR1_Qx_32( /* o: Qx y(n) */ - Word32 x, /* i : Qx x(n) */ - Word32 y, /* i : Qx y(n-1) */ - Word32 alpha /*i : Q15 scaling of driving x(n) */ +/*o : Qx y( n ) */ +Word32 noise_est_AR1_Qx_32( + Word32 x, /* i : Qx x(n) */ + Word32 y, /* i : Qx y(n-1) */ + Word32 alpha /*i : Q15 scaling of driving x(n) */ ); void FEC_lsf_estim_enc_fx( @@ -4589,34 +4767,36 @@ Word32 mslvq_fx( Word16 no_scales[][2] ); -Word16 multi_harm_fx( /* o : frame multi-harmonicity (1-harmonic, 0-not) */ - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : i signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ -); - -Word16 multi_harm_ivas_fx( /* o : frame multi-harmonicity (1-harmonic, 0-not) */ - const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ - Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ - Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ - Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ - const Word32 total_brate, /* i : total bitrate Q0 */ - const Word16 bwidth, /* i : i signal bandwidth Q0 */ - Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ - Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ - Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ - Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ - Word16 *sp_floor, /* o: noise floor estimate Q7 */ - Word16 S_map[] /* o : short-term correlation map Q7 */ +/* o : frame multi-harmonicity (1-harmonic, 0-not) */ +Word16 multi_harm_fx( + const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ + Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ + Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ + Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ + const Word32 total_brate, /* i : total bitrate Q0 */ + const Word16 bwidth, /* i : i signal bandwidth Q0 */ + Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ + Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ + Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ + Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ + Word16 *sp_floor, /* o: noise floor estimate Q7 */ + Word16 S_map[] /* o : short-term correlation map Q7 */ +); + +/* o : frame multi-harmonicity (1-harmonic, 0-not) */ +Word16 multi_harm_ivas_fx( + const Word16 Bin_E[], /* i : log-energy spectrum of the current frame Q7 */ + Word16 old_S[], /* i/o: prev. log-energy spectrum w. subtracted floor Q7 */ + Word16 cor_map_LT[], /* i/o: LT correlation map Q15 */ + Word16 *multi_harm_limit, /* i/o: multi harminic threshold Q9 */ + const Word32 total_brate, /* i : total bitrate Q0 */ + const Word16 bwidth, /* i : i signal bandwidth Q0 */ + Word16 *cor_strong_limit, /* i/o: HF correlation indicator Q0 */ + Word16 *st_mean_avr_dyn, /* i/o: long term average dynamic Q7 */ + Word16 *st_last_sw_dyn, /* i/o: last dynamic Q7 */ + Word16 *cor_map_sum, /* i : sum of correlation map Q8 */ + Word16 *sp_floor, /* o: noise floor estimate Q7 */ + Word16 S_map[] /* o : short-term correlation map Q7 */ ); void pvq_encode_frame_fx( @@ -4651,9 +4831,11 @@ void pvq_encode_frame_ivas_fx( const Word16 pvq_bits, /* i : number of bits avaiable */ const Word16 core /* i : core */ ); -Word16 Interpol_4( /*Qx o : interpolated value */ - Word16 *x, /*Qx i : i vector */ - Word16 frac /* i : fraction (-4..+3) */ + +/*Qx o : interpolated value */ +Word16 Interpol_4( + Word16 *x, /*Qx i : i vector */ + Word16 frac /* i : fraction (-4..+3) */ ); void set_ppp_mode_fx( @@ -4680,6 +4862,7 @@ void pvq_encode_fx( const Word16 dim, /* i: Length of vector */ const Word16 neg_gain /* i: - Gain use - negative gain in Q15 0 ..1 */ ); + void pvq_encode_ivas_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ @@ -4691,6 +4874,7 @@ void pvq_encode_ivas_fx( const Word16 dim, /* i: Length of vector */ const Word16 neg_gain /* i: - Gain use - negative gain in Q15 0 ..1 */ ); + void rc_enc_init_fx( PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ Word16 tot_bits /* i : Total bit budget Q0*/ @@ -4700,11 +4884,13 @@ void rc_enc_finish_fx( BSTR_ENC_HANDLE hBstr, /* i/o: Encoder state */ PVQ_ENC_HANDLE hPVQ /* i/o: PVQ encoder handle */ ); + void rc_enc_finish_ivas_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ /* i/o: PVQ encoder handle */ ); + void rc_encode_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ @@ -4712,6 +4898,7 @@ void rc_encode_fx( UWord32 sym_freq, /* i : Symbol probability Q0*/ UWord32 tot /* i : Total cumulative frequency Q0*/ ); + void rc_encode_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ @@ -4719,12 +4906,14 @@ void rc_encode_ivas_fx( UWord32 sym_freq, /* i : Symbol probability Q0*/ UWord32 tot /* i : Total cumulative frequency Q0*/ ); + void rc_enc_uniform_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ UWord32 value, /* i : Value to encode Q0*/ UWord32 tot /* i : Maximum value Q0*/ ); + void rc_enc_uniform_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ @@ -4738,12 +4927,14 @@ void rc_enc_bits_fx( UWord32 value, /* i : Value to encode Q0*/ Word16 bits /* i : Number of bits used Q0*/ ); + void rc_enc_bits_ivas_fx( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ PVQ_ENC_HANDLE hPVQ, /* i/o: PVQ encoder handle */ UWord32 value, /* i : Value to encode Q0*/ Word16 bits /* i : Number of bits used Q0*/ ); + void re8_compute_base_index_fx( const Word16 *x, /* i : Elemen of Q2, Q3 or Q4 */ const Word16 ka, /* i : Identifier of the absolute leader related to x */ @@ -4754,11 +4945,12 @@ void tfaCalcEnv_fx( const Word16 *shb_speech, Word32 *enr ); -Word16 delta_pit_enc_fx( /* o : pitch index */ - const Word16 fr_steps, /* i : fractional resolution steps (2 or 4)*/ - const Word16 T0, /* i : integer pitch lag */ - const Word16 T0_frac, /* i : pitch fraction */ - const Word16 T0_min /* i : delta search min */ +/* o : pitch index */ +Word16 delta_pit_enc_fx( + const Word16 fr_steps, /* i : fractional resolution steps (2 or 4)*/ + const Word16 T0, /* i : integer pitch lag */ + const Word16 T0_frac, /* i : pitch fraction */ + const Word16 T0_min /* i : delta search min */ ); void set_impulse_fx( @@ -4772,11 +4964,12 @@ void set_impulse_fx( Word16 Q_new /* i : Current scaling */ ); -Word16 abs_pit_enc_fx( /* o : pitch index */ - const Word16 fr_steps, /* i : fractional resolution steps (2 or 4) for shortest pitches*/ - const Word16 limit_flag, /* i : restrained(0) or extended(1) limits */ - const Word16 T0, /* i : integer pitch lag */ - const Word16 T0_frac /* i : pitch fraction */ +/* o : pitch index */ +Word16 abs_pit_enc_fx( + const Word16 fr_steps, /* i : fractional resolution steps (2 or 4) for shortest pitches*/ + const Word16 limit_flag, /* i : restrained(0) or extended(1) limits */ + const Word16 T0, /* i : integer pitch lag */ + const Word16 T0_frac /* i : pitch fraction */ ); ivas_error ppp_quarter_encoder_fx( @@ -4854,9 +5047,10 @@ Word16 cng_energy_ivas_fx( const Word16 Q_new /* i : Input scaling */ ); -void generate_comfort_noise_enc_ivas_fx( Encoder_State *stcod, - Word16 Q_new, - Word16 gen_exc ); +void generate_comfort_noise_enc_ivas_fx( + Encoder_State *stcod, + Word16 Q_new, + Word16 gen_exc ); void SynthesisSTFT_enc_ivas_fx( Word32 *fftBuffer, /* i : pointer to FFT bins */ -- GitLab From d3099f280fdac777c4ed097aaa85d389bf3d6ffc Mon Sep 17 00:00:00 2001 From: vaclav Date: Fri, 22 Aug 2025 18:52:45 +0200 Subject: [PATCH 5/6] formatting --- lib_com/prot_fx.h | 251 +++++++++++++--------------------------------- 1 file changed, 69 insertions(+), 182 deletions(-) diff --git a/lib_com/prot_fx.h b/lib_com/prot_fx.h index 6132d36ce..12f3540d6 100644 --- a/lib_com/prot_fx.h +++ b/lib_com/prot_fx.h @@ -5521,7 +5521,6 @@ void recovernorm_fx( const Word16 nb_sfm /* i : number of SFMs Q0*/ ); -// tcq_poition_qeith.c Word32 ar_div( Word32 num, Word32 denum ); void ar_encoder_start_fx( PARCODEC arInst, TCQ_PBITSTREAM bsInst, const Word32 max_bits ); @@ -5589,7 +5588,6 @@ void srt_vec_ind_fx( Word16 *I, Word16 length ); -// fill_spectrum void fill_spectrum_fx( Word16 *coeff, /* i/o: normalized MLT spectrum / nf spectrum Q12 */ Word32 *L_coeff_out, /* i/o: Noisefilled MLT spectrum Q12 */ @@ -5629,7 +5627,6 @@ void fill_spectrum_fx( const Word16 num_env_bands, const Word16 element_mode ); -// hq_bit_allocation_fx.c" void hq_bit_allocation_fx( const Word32 core_brate, /* i : Core bit-rate Q0 */ const Word16 length, /* i : Frame length Q0 */ @@ -5646,14 +5643,12 @@ void hq_bit_allocation_fx( const Word16 num_env_bands /* i : Number sub bands to be encoded for HQ_SWB_BWE Q0 */ ); -// weight_fx.c void map_quant_weight_fx( const Word16 normqlg2[], /* i : quantized norms Q0*/ Word16 wnorm[], /* o : weighted norm Q0*/ const Word16 is_transient /* i : transient flag Q0*/ ); -// bitalloc_fx.c void bitalloc_fx( Word16 *y, /* i : reordered norm of sub-vectors Q0 */ Word16 *idx, /* i : reordered sub-vector indices Q0 */ @@ -5664,6 +5659,7 @@ void bitalloc_fx( const Word16 *sfmsize, /* i : band length Q0 */ const Word16 hqswb_clas /* i : signal classification flag Q0 */ ); + Word16 BitAllocF_fx( Word16 *y, /* i : norm of sub-vectors :Q0 */ Word32 bit_rate, /* i : bitrate :Q0 */ @@ -5674,6 +5670,7 @@ Word16 BitAllocF_fx( const Word16 hqswb_clas, /* i : hq swb class */ const Word16 num_env_bands /* i : Number sub bands to be encoded for HQ_SWB_BWE */ ); + Word16 BitAllocWB_fx( Word16 *y, /* i : norm of sub-vectors Q0*/ Word16 B, /* i : number of available bits Q0*/ @@ -5681,7 +5678,7 @@ Word16 BitAllocWB_fx( Word16 *R, /* o : bit-allocation indicator Q0*/ Word16 *Rsubband_fx /* o : sub-band bit-allocation vector Q3*/ ); -// bitallocsum_fx.c + void bitallocsum_fx( Word16 *R, /* i : bit-allocation vector Q0 */ const Word16 nb_sfm, /* i : number of sub-vectors Q0 */ @@ -5692,7 +5689,6 @@ void bitallocsum_fx( const Word16 *sfmsize /* i : band length Q0 */ ); -// stab_est_fx.c Word16 stab_est_fx( Word16 etot, /* i : Total energy of the current frame Q8*/ Word16 *lt_diff_etot, /* i/o : Long term total energy variation Q8*/ @@ -5704,7 +5700,6 @@ Word16 stab_est_fx( const Word16 vad_flag /* i : VAD flag */ ); -// enhancer_fx.c void enhancer_fx( const Word32 core_brate, /* i : decoder bitrate */ const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ @@ -5761,7 +5756,6 @@ Word16 E_UTIL_enhancer( Word16 L_frame, /* i : frame size */ Word16 Q_new ); -// phase_dispersion_fx.c void phase_dispersion( const Word32 gain_code, /* i : gain of code 15Q16 */ const Word16 gain_pit, /* i : gain of pitch Q14 */ @@ -5774,7 +5768,6 @@ void phase_dispersion( Word16 L_subfr /* i : subframe length [40,64] */ ); -// tcx_ltp_fx.c void tcx_ltp_get_lpc( Word16 *x, /* Qx */ const Word16 L, /* Q0 */ @@ -5845,10 +5838,10 @@ void Inac_switch_ematch_fx( const Word16 element_mode /* i : element mode */ ); -// igf_base_fx.c -Word16 IGF_ApplyTransFac( /**< out: Q0 | multiplication factor */ - const Word16 val, /**< in: Q15 | input value for multiplication, Q15 */ - const Word16 transFac /**< in: Q14 | multiplicator for variable val, Q14: 1.25f=0x5000, 1.0f=0x4000, 0.5f=0x2000 */ +/**< out: Q0 | multiplication factor */ +Word16 IGF_ApplyTransFac( + const Word16 val, /**< in: Q15 | input value for multiplication, Q15 */ + const Word16 transFac /**< in: Q14 | multiplicator for variable val, Q14: 1.25f=0x5000, 1.0f=0x4000, 0.5f=0x2000 */ ); Word16 IGF_MapBitRateToIndex( @@ -5919,7 +5912,7 @@ Word16 IGFCommonFuncsIGFGetCFTables_fx( const UWord16 **cf_se11, /* o : CF tables for t == 1 and f >= 1 */ const Word16 **cf_off_se11 /* o : offsets for CF tables above */ ); -// ari_fx.c + Word32 L_multi31x16_X2( Word16 xh, Word16 xl, @@ -5930,7 +5923,6 @@ Word32 mul_sbc_14bits( Word16 c /* Q0 */ ); -// window.c void ham_cos_window( Word16 *fh, const Word16 n1, @@ -5941,10 +5933,10 @@ void ham_cos_window_ivas( const Word16 n1, const Word16 n2 ); -// arith_coder_fx.c -Word32 expfp( /* o: Q31 */ - const Word16 x, /* i: mantissa Q-e */ - const Word16 x_e ); /* i: exponent Q0 */ +/* o: Q31 */ +Word32 expfp( + const Word16 x, /* i: mantissa Q-e */ + const Word16 x_e ); /* i: exponent Q0 */ void powfp_odd2( const Word16 base, /* Q15 */ @@ -6241,7 +6233,6 @@ void lsf_end_dec_fx( Word16 *lpc_param, /* i : LPC parameters Q0*/ Word16 *LSF_Q_prediction, /* o : LSF prediction mode Q0*/ Word16 *nb_indices, /* o : number of indices Q0*/ - const Word16 tdm_lsfQ_PCh[M] /* i : Q LSFs for primary channel Qx*/ ); @@ -6282,7 +6273,6 @@ void td_cng_dec_init_fx( DEC_CORE_HANDLE st /* i/o: decoder state structure */ ); -// wavadjust_fec_dec_fx.c void set_state( Word16 *state, Word16 num, @@ -6480,7 +6470,6 @@ ivas_error PsychoacousticParameters_Init( const Word16 isWarped, /* i : Flag indicating if the scale is linear or warped */ PsychoacousticParameters *pPsychParams ); -// TonalIMDCTconcealment_fx.c ivas_error TonalMDCTConceal_Init( TonalMDCTConcealPtr self, const Word16 nSamples, @@ -6488,6 +6477,7 @@ ivas_error TonalMDCTConceal_Init( const Word16 nScaleFactors, TCX_CONFIG_HANDLE hTcxCfg /* TCX config */ ); + ivas_error TonalMDCTConceal_Init_ivas_fx( TonalMDCTConcealPtr hTonalMDCTConc, const UWord16 nSamples, @@ -6579,7 +6569,6 @@ void TonalMDCTConceal_SaveTimeSignal_ivas_fx( Word16 q_timeSignal, Word16 nNewSamples ); -// decision_matrix_dec_fx.c void decision_matrix_dec_fx( Decoder_State *st, /* i/o: decoder state structure */ Word16 *sharpFlag, /* o : formant sharpening flag Q0 */ @@ -6587,10 +6576,10 @@ void decision_matrix_dec_fx( Word16 *core_switching_flag /* o : ACELP->HQ switching frame flag Q0 */ ); -// hf_synth_fx.c void hf_synth_init_fx( ZERO_BWE_DEC_HANDLE hBWE_zero /* o : zero BWE decoder handle */ ); + void hf_synth_reset_fx( ZERO_BWE_DEC_HANDLE hBWE_zero /* o : zero BWE decoder handle */ ); @@ -6648,7 +6637,6 @@ void hf_synth_amr_wb_fx( const Word16 Q_out /* i : Q_syn2-1 */ ); -// dec_post_fx void Init_post_filter_fx( PFSTAT_HANDLE hPFstat /* i : core decoder parameters */ ); /* i : core decoder parameters */ @@ -6749,7 +6737,6 @@ void unscale_AGC( const Word16 n /* i: vector size */ ); -// bass_psfilter_fx.c void bass_psfilter_init_fx( BPF_DEC_HANDLE hBPF /* o : BPF data handle */ ); @@ -6780,7 +6767,6 @@ void addBassPostFilter_fx( const Word16 nBandsTotal, /* Q0 */ CLDFB_SCALE_FACTOR *cldfb_scale ); -// FEC_fx.c void FEC_exc_estim_fx( Decoder_State *st_fx, /* i/o: Decoder static memory */ const Word16 L_frame, /* i : length of the frame */ @@ -6796,50 +6782,35 @@ void FEC_exc_estim_fx( Word16 *tmp_noise /* o : long-term noise energy Q0 */ ); -// pitch_extr_fx.c void pitch_pred_linear_fit( - const Word16 /*short*/ bfi_cnt, - /* i: bfi counter */ /*Q0 */ - const Word16 /*short*/ last_good, - /* i: last classification type */ /*Q0 */ - Word32 /*float*/ *old_pitch_buf, - /* i: pitch lag buffer */ /*Q16*/ - Word32 /*float*/ *old_fpitch, - /* i: */ /*Q16*/ - Word32 /*float*/ *T0_out, - /* o: estimated close loop pitch */ /*Q16*/ - Word16 /* int*/ pit_min, - /* i: Minimum pitch lag */ /*Q0 */ - Word16 /* int*/ pit_max, - /* i: Maximum pitch lag */ /*Q0 */ - Word16 /*float*/ *mem_pitch_gain, - /* i: pitch gain [0] is the most recent subfr gain */ /*Q0*/ - Word16 /* int*/ limitation, - Word16 /*short*/ plc_use_future_lag, - /* i: */ /*Q0 */ - Word16 /*short*/ *extrapolationFailed, - /* o: flag if extrap decides not to change the pitch */ /*Q0 */ - Word16 nb_subfr /* i: number of ACELP subframes */ + const Word16 bfi_cnt, /* i: bfi counter Q0 */ + const Word16 last_good, /* i: last classification type Q0 */ + Word32 *old_pitch_buf, /* i: pitch lag buffer Q16*/ + Word32 *old_fpitch, /* i: Q16*/ + Word32 *T0_out, /* o: estimated close loop pitch Q16*/ + Word16 pit_min, /* i: Minimum pitch lag Q0 */ + Word16 pit_max, /* i: Maximum pitch lag Q0 */ + Word16 *mem_pitch_gain, /* i: pitch gain [0] is the most recent subfr gain Q0*/ + Word16 limitation, + Word16 plc_use_future_lag, /* i: Q0 */ + Word16 *extrapolationFailed, /* o: flag if extrap decides not to change the pitch Q0 */ + Word16 nb_subfr /* i: number of ACELP subframes */ ); void get_subframe_pitch( - Word16 nSubframes, - /* i: number of subframes */ /* Q0 */ - Word32 pitchStart, - /* i: starting pitch lag (in subframe -1) */ /*15Q16*/ - Word32 pitchEnd, - /* i: ending pitch lag (in subframe nSubframes-1) */ /*15Q16*/ - Word32 *pitchBuf /* o: interpolated pitch lag per subframe */ /*15Q16*/ + Word16 nSubframes, /* i: number of subframes Q0 */ + Word32 pitchStart, /* i: starting pitch lag (in subframe -1) 15Q16*/ + Word32 pitchEnd, /* i: ending pitch lag (in subframe nSubframes-1) 15Q16*/ + Word32 *pitchBuf /* o: interpolated pitch lag per subframe 15Q16*/ ); -// er_sync_exc_fx.c void PulseResynchronization_fx( - Word16 /*float*/ const *const src_exc, /*i Q15*/ - Word16 /*float*/ *const dst_exc, /*o Q15*/ - Word16 /*int*/ const nFrameLength, /*i Q0 */ - Word16 /*int*/ const nSubframes, /*i Q0 */ - Word32 /*float*/ const pitchStart, /*i Q16*/ - Word32 /*float*/ const pitchEnd /*i Q16*/ + Word16 const *const src_exc, /*i Q15*/ + Word16 *const dst_exc, /*o Q15*/ + Word16 const nFrameLength, /*i Q0 */ + Word16 const nSubframes, /*i Q0 */ + Word32 const pitchStart, /*i Q16*/ + Word32 const pitchEnd /*i Q16*/ ); void decod_audio_fx( @@ -6987,7 +6958,6 @@ void gain_dec_amr_wb_fx( Word32 *norm_gain_code /* o : norm. gain of the codebook excitation */ ); -// dec_higher_acelp_fx.c void transf_cdbk_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 harm_flag_acelp, /* i : harmonic flag for higher rates ACELP */ @@ -7023,8 +6993,6 @@ void AVQ_dec_lpc( Word16 *nvecq, /* output: vector quantized Q0*/ Word16 Nsv ); /* input: number of subvectors (lg=Nsv*8) Q0*/ - -// re8_dec_fx.c void re8_dec_fx( Word16 n, /* i : codebook number (*n is an integer defined in {0,2,3,4,..,n_max}) */ const UWord16 I, /* i : index of c (pointer to unsigned 16-bit word) */ @@ -7032,13 +7000,11 @@ void re8_dec_fx( Word16 y[] /* o : point in RE8 (8-dimensional integer vector) */ ); -// lead_deindexing_fx.c void re8_decode_base_index_fx( const Word16 n, UWord16 I, Word16 *x ); -// re8_utils_fx.c void re8_k2y_fx( const Word16 *k, /* i : Voronoi index k[0..7] Q0*/ const Word16 m, /* i : Voronoi modulo (m = 2^r = 1<=2) Q0*/ @@ -7053,7 +7019,6 @@ void re8_vor_fx( Word16 *ka /* o : identifier of absolute leader (to index c) Q0*/ ); -// re8_PPV_fx.c void re8_PPV_fx( const Word32 x[], /* i : point in R^8 Q15 */ Word16 y[] /* o : point in RE8 (8-dimensional integer vector) Q0 */ @@ -7172,7 +7137,6 @@ void delta_pit_dec_fx( const Word16 T0_min /* i : delta search min */ ); -// limit_t0_fx.c void limit_T0_fx( const Word16 L_frame, /* i : length of the frame */ const Word16 delta, /* i : Half the close-loop searched interval */ @@ -7198,7 +7162,6 @@ void limit_T0_voiced( const Word16 pit_max /* i : Maximum pitch lag */ ); -// inov_dec.c void inov_decode_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word32 core_brate, /* i : core bitrate Q0 */ @@ -7411,7 +7374,6 @@ void rc_dec_finish_fx( PVQ_DEC_HANDLE hPVQ /* i/o: PVQ decoder handle */ ); -// pvq_decode_fx.c void pvq_decode_fx( Decoder_State *st_fx, PVQ_DEC_HANDLE hPVQ, /* i/o: PVQ decoder handle */ @@ -7421,8 +7383,6 @@ void pvq_decode_fx( const Word16 dim, /* i: Length of vector */ const Word16 neg_gain /* i: Gain (negated to fit 1.0 in Q15 as -1.0) */ ); - -// nelp_dec_fx.c void nelp_decoder_fx( Decoder_State *st_fx, /* i/o: decoder static memory */ Word16 *exc_nelp, /* o : adapt. excitation/total exc Q0 */ @@ -7432,8 +7392,6 @@ void nelp_decoder_fx( const Word16 coder_type, /* i : coding type Q0 */ Word16 *gain_buf /* Q14 */ ); - -// dec_nelp_fx.c void decod_nelp_fx( Decoder_State *st_fx, /* i/o: decoder static memory */ Word16 *tmp_noise_fx, /* o : long term temporary noise energy */ @@ -7443,12 +7401,10 @@ void decod_nelp_fx( Word16 *voice_factors, /* o : Voice factor */ Word16 *bwe_exc, Word16 *Q_exc, - Word16 bfi /* i : frame error rate */ - , + Word16 bfi, /* i : frame error rate */ Word16 *gain_buf /*Q14*/ ); -// lp_filt_exc_dec_fx void lp_filt_exc_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 codec_mode, /* i : coder mode */ @@ -7458,7 +7414,6 @@ void lp_filt_exc_dec_fx( Word16 lp_flag, /* i : operation mode signalling */ Word16 *exc ); -// FEC_lsf_estim_fx.c void FEC_lsf2lsp_interp( Decoder_State *st, /* i/o: Decoder static memory */ const Word16 L_frame, /* i : length of the frame */ @@ -7467,8 +7422,6 @@ void FEC_lsf2lsp_interp( Word16 *lsp /* o : estimated LSP vector */ ); - -// fd_cng_dec_fx.c ivas_error createFdCngDec_fx( HANDLE_FD_CNG_DEC *hFdCngDec ); @@ -7523,8 +7476,9 @@ void perform_noise_estimation_dec_ivas_fx( ); /* Decode the CLDFB-CNG bitstream */ -void FdCng_decodeSID_fx( HANDLE_FD_CNG_COM st, /* i/o: FD_CNG structure containing all buffers and variables */ - Decoder_State *corest ); /* i/o: decoder state structure */ +void FdCng_decodeSID_fx( + HANDLE_FD_CNG_COM st, /* i/o: FD_CNG structure containing all buffers and variables */ + Decoder_State *corest ); /* i/o: decoder state structure */ void noisy_speech_detection_fx( HANDLE_FD_CNG_DEC hFdCngDec, /* i/o: FD_CNG structure */ @@ -7589,7 +7543,6 @@ void generate_masking_noise_mdct_ivas_fx( Word16 *mdctBuffer_e, /* i/o: exponent time-domain signal */ HANDLE_FD_CNG_COM st /* i/o: FD_CNG structure containing all buffers and variables */ ); -// init_dec_fx.c ivas_error init_decoder_fx( Decoder_State *st_fx, /* o: Decoder static variables structure */ const Word16 idchan /* i : channel ID */ @@ -7628,7 +7581,7 @@ Word16 wb_bwe_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 *Qpost ); -/* o : BWE class */ +/* o : BWE class */ Word16 swb_bwe_gain_deq_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 core, /* i : core */ @@ -7660,7 +7613,6 @@ void hq_core_enc_ivas_fx( const Word16 vad_hover_flag /* i : VAD hangover flag Q0*/ ); -// hq_core_dec_fx.c void hq_core_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure fx */ Word16 synth[], /* o : output synthesis Q_synth*/ @@ -7776,7 +7728,6 @@ void hdecnrm_tran_fx( Word16 *index /* o : indices of quantized norms Q0*/ ); -// tcq_core_dec_fx.c void tcq_core_LR_dec_fx( Decoder_State *st_fx, Word16 *inp_vector_fx, /*x5 */ @@ -7795,7 +7746,6 @@ void tcq_core_LR_dec_fx( const Word16 *is_transient /*Q0 */ ); -// FEC_HQ_core_fx.c void HQ_FEC_processing_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word32 *t_audio_q_fx, /* o : MDCT coeffs. (for synthesis) Q12 */ @@ -7827,13 +7777,12 @@ void HQ_FEC_Mem_update_fx( void time_domain_FEC_HQ_fx( Decoder_State *st_fx, /* i : Decoder State */ - Word32 *wtda_audio_fx, /* i : i */ + Word32 *wtda_audio_fx, /* i : i */ Word16 *out_fx, /* o : output audio */ Word16 mean_en_high_fx, /* i : transient flag */ const Word16 output_frame, Word16 *Q_synth ); -// hq_hr_dec_fx.c void hq_pred_hb_bws_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 *ynrm, /* i : norm quantization index vector Q0*/ @@ -7863,7 +7812,6 @@ Word16 hq_classifier_dec_fx( Word16 *hqswb_clas /* o : HQ class Q0 */ ); -// peak_vq_dec_fx.c void hvq_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 num_bits, /* i : Number of available bits */ @@ -7890,7 +7838,6 @@ Word16 hvq_pvq_bitalloc_fx( Word16 *n_sel_bands /* Q0 o : No. of selected bands for encoding */ ); -// hq_conf_fec_fx.c void hq_configure_bfi_fx( Word16 *nb_sfm, /* o : Number of sub bands Q0*/ Word16 *num_Sb, /* o : Number of FEC sub bands ? Q0*/ @@ -7900,7 +7847,6 @@ void hq_configure_bfi_fx( const Word16 **sfm_end /* o : Subband end coefficients Q0*/ ); -// core_switching_dec_fx.c void bandwidth_switching_detect_fx( Decoder_State *st_fx /* i/o: encoder state structure */ ); @@ -7948,7 +7894,6 @@ void core_switching_hq_prepare_dec_fx( const Word16 output_frame /* i : output frame length Q0*/ ); -// amr_wb_dec_fx.c ivas_error amr_wb_dec_fx( Word16 output_sp[], /* o : synthesis output */ Decoder_State *st_fx /* o : Decoder static variables structure */ @@ -7958,7 +7903,6 @@ void amr_wb_dec_init_fx( AMRWB_IO_DEC_HANDLE hAmrwb_IO /* i/o: AMR-WB IO data handle */ ); -// updt_dec_fx.c void updt_dec_fx( Decoder_State *st_fx, /* i/o: state structure */ const Word16 *old_exc_fx, /* i : buffer of excitation */ @@ -7968,9 +7912,8 @@ void updt_dec_fx( const Word16 *lsf_new_fx, /* i : current frame LSF vector */ const Word16 *lsp_new_fx, /* i : current frame LSP vector */ const Word16 voice_factors[], /* i : voicing factors */ - const Word16 *old_bwe_exc_fx /* i : buffer of excitation */ - , - const Word16 *gain_buf /*Q14*/ + const Word16 *old_bwe_exc_fx, /* i : buffer of excitation */ + const Word16 *gain_buf /*Q14*/ ); void updt_IO_switch_dec_fx( @@ -7998,7 +7941,6 @@ void update_decoder_LPD_cng( Word16 *A, Word16 *bpf_noise_buf ); -// FEC_clas_estim_fx void FEC_clas_estim_fx( Decoder_State *st_fx, /* i/o: decoder state handle */ const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode A*/ @@ -8033,7 +7975,6 @@ Word16 FEC_pos_dec_fx( const Word16 nBits_es_Pred /* i : number of bits for Es_pred Q */ ); -// post_dec.h void post_decoder( Decoder_State *st, Word16 synth_buf[], /* Q0 */ @@ -8059,7 +8000,6 @@ void cldfb_synth_set_bandsToZero( const Word16 nTimeSlots, const CLDFB_SCALE_FACTOR scaleFactor ); -// FEC_pitch_estim_fx.c void FEC_pitch_estim_fx( const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ const Word16 last_core, /* i : last core */ @@ -8106,7 +8046,6 @@ void FEC_scale_syn_fx( const Word16 force_scaling /* i : force scaling */ ); -// LD_music_post_filter_fx.c void LD_music_post_filter_fx( MUSIC_POSTFILT_HANDLE hMusicPF, /* i/o: LD music postfilter handle */ const Word16 dtc_in[], /* i : i synthesis Qdct */ @@ -8155,7 +8094,6 @@ void music_postfilt_init( MUSIC_POSTFILT_HANDLE hMusicPF /* i/o: LD music postfilter handle */ ); -// gs_dec_amr_wb.c void improv_amr_wb_gs_fx( const Word16 clas, /* i : signal frame class Q0*/ const Word16 coder_type, /* i : coder type Q0*/ @@ -8177,7 +8115,6 @@ void improv_amr_wb_gs_fx( const Word16 last_coder_type /* i : Last coder_type Q0*/ ); -// dec_amr_wb_fx.c void decod_amr_wb_fx( Decoder_State *st_fx, /* i/o: decoder static memory */ const Word16 *Aq_fx, /* i : LP filter coefficients */ @@ -8189,14 +8126,12 @@ void decod_amr_wb_fx( Word16 *gain_buf /* o : floating pitch gain for each subframe Q14 */ ); -// rst_dec_fx.c void CNG_reset_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ Word16 *pitch_buf, /* o : floating pitch for each subframe Q6*/ Word16 *voice_factors /* o : voicing factors Q15*/ ); -// voiced_dec_fx.c ivas_error ppp_voiced_decoder_fx( Decoder_State *st_fx, /* i/o: state structure */ Word16 *out_fx, /* o : residual signal */ @@ -8210,7 +8145,6 @@ void sc_vbr_dec_init( SC_VBR_DEC_HANDLE hSC_VBR /* i/o: SC-VBR decoder handle */ ); -// ppp_dec_fx.c ivas_error ppp_quarter_decoder_fx( DTFS_STRUCTURE *CURRCW_Q_DTFS_FX, /* i/o: Current CW DTFS */ Word16 prevCW_lag_fx, /* i : Previous lag */ @@ -8223,7 +8157,6 @@ ivas_error ppp_quarter_decoder_fx( DTFS_STRUCTURE PREV_CW_D_FX, /* i : Previous DTFS */ Decoder_State *st_fx ); -// core_dec_init_fx.c void open_decoder_LPD_fx( Decoder_State *st, const Word32 total_brate, /* Q0 */ @@ -8265,7 +8198,6 @@ void tcxltp_dec_init_fx( const Word16 element_mode, /* Q0 */ const Word16 pit_max, /* Q0 */ const Word32 sr_core ); /* Q0 */ -// swb_bwe_dec_hr_fx.c /* o : Exponent of SHB synthesis */ Word16 swb_bwe_dec_hr_fx( @@ -8282,7 +8214,6 @@ void hr_bwe_dec_init( HR_BWE_DEC_HANDLE hBWE_FD_HR /* i/o: HR BWE data handle */ ); -// swb_bwe_com_hr_fx.c void swb_hr_noise_fill_fx( const Word16 is_transient, /* i : transient flag */ const Word16 spect_start, /* i : spectrum start point */ @@ -8295,7 +8226,6 @@ void swb_hr_noise_fill_fx( Word16 *t_audio, /* i/o: mdct spectrum Q_audio */ Word16 Q_audio ); -// stat_noise_uv_dec_fx.c void stat_noise_uv_dec_fx( Decoder_State *st_fx, /* i/o: Decoder static memory */ Word16 *lsp_new, /* i : end-frame LSP vector Q15 */ @@ -8305,7 +8235,6 @@ void stat_noise_uv_dec_fx( const Word16 uc_two_stage_flag /* i : flag indicating two-stage UC */ ); -// stat_noise_uv_mod_fx.c void stat_noise_uv_mod_fx( const Word16 coder_type, /* i : Coder type */ Word16 noisiness, /* i : noisiness parameter Q0 */ @@ -8352,7 +8281,6 @@ void stat_noise_uv_mod_ivas_fx( Word16 *Q_stat_noise_ge /* i/o: noise scaling */ ); -// FEC_adao_codebook_fx.c Word16 FEC_SinOnset_fx( Word16 *exc, /* i/o : exc vector to modify */ Word16 puls_pos, /* i : last pulse position desired */ @@ -8371,7 +8299,7 @@ Word16 FEC_enhACB_fx( const Word16 bfi_pitch /* i : Q6 pitch used for concealment */ ); -/*! r: do_WI flag */ +/*! r: do_WI flag */ Word16 FEC_synchro_exc_fx( const Word16 L_frame, /* i : length of the frame */ Word16 *exc, /* i/o: exc vector to modify */ @@ -8394,7 +8322,6 @@ void decod_unvoiced_fx( Word16 *bwe_exc_fx, /* Q_X i/o: excitation for SWB TBE */ Word16 *gain_buf ); -// gaus_dec_fx.c void gaus_dec_fx( Decoder_State *st_fx, /* i/o: decoder static memory */ const Word16 i_subfr, /* i : subframe index */ @@ -8441,7 +8368,6 @@ ivas_error decod_gen_voic_fx( const Word16 tdm_Pri_pitch_buf[] /* i : primary channel pitch buffer */ ); -// dec_tran_fx.c void decod_tran_fx( Decoder_State *st_fx, /* i/o: decoder static memory */ const Word16 L_frame_fx, /* i : length of the frame */ @@ -8458,7 +8384,6 @@ void decod_tran_fx( Word16 *gain_buf /*Q14*/ ); -// transition_dec_fx.c void transition_dec_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word16 Opt_AMR_WB, /* i : flag indicating AMR-WB IO mode */ @@ -8479,10 +8404,9 @@ void transition_dec_fx( Word16 tc_classif_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ - const Word16 L_frame /* i : length of the frame */ + const Word16 L_frame /* i : length of the frame */ ); -// dec_ppp_fx.c ivas_error decod_ppp_fx( Decoder_State *st_fx, /* i/o: state structure */ const Word16 Aq_fx[], /* i : 12k8 Lp coefficient */ @@ -8495,7 +8419,6 @@ ivas_error decod_ppp_fx( Word16 *bwe_exc_fx /* o : excitation for SWB TBE */ ); -// swb_bwe_dec_lr_fx.c void swb_bwe_dec_lr_fx( Decoder_State *st_fx, /* i/o: decoder state structure */ const Word32 L_m_core[], /* i : lowband synthesis : QsL */ @@ -8519,7 +8442,6 @@ void swb_bwe_dec_lr_fx( Word16 *ni_seed_fx /* i/o: random seed : QsL */ ); -// dec_acelp_tck_main_fx.c Word16 dec_acelp_tcx_frame_fx( Decoder_State *st, /* i/o: decoder state structure */ Word16 *concealWholeFrame, /* i/o: concealment flag */ @@ -8531,7 +8453,6 @@ Word16 dec_acelp_tcx_frame_fx( Word16 pitch_buf[] /* o : floating pitch for each subframe */ ); -// dec_LPD_fx.c void decoder_LPD_fx( Word16 signal_out[], /* o : signal with LPD delay (7 subfrs) */ Word16 signal_outFB[], /* o : synthesis @output_FS */ @@ -8546,7 +8467,6 @@ void decoder_LPD_fx( Word16 *ptr_bwe_exc /* o : excitation for SWB TBE */ ); -// core_dec_switch_fx.c void mode_switch_decoder_LPD_fx( Decoder_State *st, /* Q0 */ Word16 bandwidth_in, /* Q0 */ @@ -8591,7 +8511,6 @@ void tcx_hm_decode( Word16 *hm_bits /* o : bit consumption */ ); -// lsf_msvq_ma_dec_fx.c Word16 lsf_msvq_ma_decprm( Decoder_State *st, Word16 *param_lpc /* Q0 */ @@ -8618,7 +8537,6 @@ Word16 dec_lsf_tcxlpc( Word16 cdk /* i : codebook selector Q0*/ ); -// lsf_msvq_ma_fx.c void midlsf_dec( const Word16 qlsf0[], /* i: quantized lsf coefficients (3Q12) */ const Word16 qlsf1[], /* i: quantized lsf coefficients (3Q12) */ @@ -8635,7 +8553,6 @@ Word16 lsf_ind_is_active( const Word16 narrowband, const Word16 cdk ); -// IGFSCFDecoder.c void IGFSCFDecoderOpen( IGFSCFDEC_INSTANCE_HANDLE hPublicData, /* i : handle to public data */ H_IGF_INFO hIgfInfo, /* i : IGF info handle */ @@ -8657,7 +8574,6 @@ void IGFSCFDecoderDecode( if 0 on input the decoder will be forced to encode without a reset */ ); -// ari_dec_fx.c Word32 ari_decode_overflow_fx( Tastat *s ); @@ -8699,7 +8615,6 @@ Word16 ari_decode_14bits_sign_fx( Word16 *res, Tastat *s ); -// dec_prm_fx.c void getTCXparam_fx( Decoder_State *st, /* i/o: Decoder State handle */ Decoder_State *st0, /* i : bitstream */ @@ -8728,7 +8643,6 @@ void getLPCparam_fx( const Word16 ch, /* i : channel Q0 */ const Word16 sns_low_br_mode /* i : SNS low-bitrate mode Q0 */ ); -// ari_hm_fx.c void UnmapIndex( const Word16 PeriodicityIndex, /* Q0 */ @@ -8767,9 +8681,7 @@ void tcx_hm_modify_envelope( Word16 L_frame /* i: number of spectral lines Q0 */ ); -// tns_base_dec_fx.c -Word16 -ReadTnsData( +Word16 ReadTnsData( STnsConfig const *pTnsConfig, Decoder_State *st, Word16 *pnBits, @@ -8795,7 +8707,6 @@ Word16 DecodeTnsData_ivas_fx( Word16 *pnSize, STnsData *pTnsData ); -// parametr_bitmapping.c using ivas void GetParameters( ParamsBitMap const *paramsBitMap, const Word16 nParams, @@ -8876,7 +8787,6 @@ void IGFDecApplyMono( Word16 *spectrum_e, /**< in/out: | exponent of spectrum */ const Word16 igfGridIdx, /**< in: | in case of CELP->TCX switching, use 1.25 framelength */ Word16 bfi /**< in: | frame loss == 1, frame good == 0 */ - ); void IGFDecApplyMono_ivas( @@ -8910,6 +8820,7 @@ void IGFDecSetMode( const Word16 defaultStopLine, /* i : default stop subband index */ const Word16 rf_mode /* i : flag to signal the RF mode */ ); + void IGFDecSetMode_ivas_fx( const IGF_DEC_INSTANCE_HANDLE hIGFDec, /* i : instance handle of IGF Decoder */ const Word32 total_brate, /* i : bitrate */ @@ -8964,7 +8875,6 @@ void init_igf_dec( IGF_DEC_INSTANCE_HANDLE hIGFDec /* i/o: IGF decoder handle */ ); -// dlpc_avq_fx.c Word16 dlpc_avq_fx( Word16 *index, /* (i) Quantization indices */ Word16 *LSF_Q, /* (o) Quantized LSF vectors */ @@ -8986,19 +8896,16 @@ Word16 decode_lpc_avq_ivas_fx( const Word16 sns_low_br_mode /* i : SNS low-bitrate mode */ ); -// vlpc_1st_dec_fx.c void vlpc_1st_dec( - Word16 index, /* i : codebook index */ + Word16 index, /* i : codebook index */ Word16 *lsfq ); /* i/o: i:prediction o:quantized lsf */ -// vlpc_2st_dec_fx.c void vlpc_2st_dec( - Word16 *lsfq, /* i/o: i:1st stage o:1st+2nd stage */ + Word16 *lsfq, /* i/o: i:1st stage o:1st+2nd stage */ Word16 *indx, /* i : index[] (4 bits per words) */ Word16 mode, /* i : 0=abs, >0=rel */ Word32 sr_core ); -// vlpc_2st_com_fx.c void lsf_weight_2st( const Word16 *lsfq, /* input: quantized lsf coefficients (14Q1*1.28) */ Word16 *w, /* output: weighting function (0Q15*1.28) */ @@ -9056,7 +8963,6 @@ Word16 RCcontextMapping_decode2_no_mem_s17_LCS_fx( CONTEXT_HM_CONFIG *hm_cfg /* i : context-based harmonic model configuration*/ ); -// core_dec_reconf_fx.c void reconfig_decoder_LPD_fx( Decoder_State *st, /* i/o: decoder state structure */ Word16 bits_frame, /* i : bit budget Q0*/ @@ -9073,7 +8979,6 @@ void reconfig_decoder_LPD_ivas_fx( const Word16 L_frame_old /* i : frame length Q0*/ ); -// er_utils_fx.c void minimumStatistics_fx( Word16 *noiseLevelMemory, /* Q15, internal state */ Word16 *noiseLevelIndex, /* Q0, internal state */ @@ -9116,7 +9021,6 @@ void highPassFiltering_fx( Word16 GetPLCModeDecision_fx( Decoder_State *st ); -// dlpc_stoch_fx.c void lpc_unquantize_fx( Decoder_State *st, Word16 *lsf, @@ -9129,7 +9033,6 @@ void lpc_unquantize_fx( Word16 *LSF_Q_prediction /* o : LSF prediction mode */ ); -// dlpc_bfi_fx.c void dlpc_bfi( const Word16 L_frame, Word16 *lsf_q, /* o : quantized LSFs */ @@ -9148,7 +9051,6 @@ void dlpc_bfi( const Word16 *lsfBase, /* i : base for differential LSF coding */ Word8 tcxonly ); -// guided_plc_util_fx.c void getLookAheadResSig( Word16 *speechLookAhead, /* Qx */ Word16 *A_3Q12, /* 3Q12 */ @@ -9194,7 +9096,7 @@ void modify_lsf( void con_tcx_fx( Decoder_State *st, /* i/o: coder memory state */ - Word16 synth[] /* i/o: synth[] Q0 */ + Word16 synth[] /* i/o: synth[] Q0 */ ); /* o : damping factor Q14*/ @@ -9202,14 +9104,11 @@ Word16 Damping_fact_fx( const Word16 coder_type, /* i : coding type in last good received frame */ const Word16 nbLostCmpt, /* i : counter of consecutive bfi frames */ const Word16 last_good, /* i : last good frame class */ - const Word16 stab_fac, - /* i : ISF stability factor */ /*Q15*/ - Word32 *lp_gainp, - /*i/o: damped pitch gain */ /*Q16 Word32!*/ - const Word16 core /* i : current coding mode */ + const Word16 stab_fac, /* i : ISF stability factor Q15*/ + Word32 *lp_gainp, /*i/o: damped pitch gain Q16 Word32!*/ + const Word16 core /* i : current coding mode */ ); -// dec_tcx_fx.c void decoder_tcx_fx( TCX_CONFIG_HANDLE hTcxCfg, Word16 prm[], /* i : parameters */ @@ -9245,7 +9144,6 @@ void decoder_tcx_post_fx( Word16 *A, Word16 bfi ); -// arith_coder_dec_fx.c void tcx_arith_decode_envelope_fx( Word32 q_spectrum[], /* o: quantised MDCT coefficients Q31-e */ Word16 *q_spectrum_e, /* o: MDCT exponent Q0 */ @@ -9262,10 +9160,8 @@ void tcx_arith_decode_envelope_fx( Word16 *signaling_bits, /* o: bits used for signaling */ Word16 *nf_seed, /* o: noise filling seed Q0 */ Word16 low_complexity /* i: low-complexity flag Q0 */ - ); -// tcx_utils_dec_fx.c void tcx_decoder_memory_update( Word16 *xn_buf, /* i/o: mdct output buffer used also as temporary buffer : Q0 */ Word16 *synthout, /* o: synth : Q0 */ @@ -9302,7 +9198,6 @@ Word16 tcx_res_invQ_spec( const Word16 lf_deemph_factors[] /*i : LF deemphasis factors Q14*/ ); -// er_dec_acelp_fx.c void con_acelp_fx( const Word16 A[], /* Date: Tue, 26 Aug 2025 17:59:55 +0200 Subject: [PATCH 6/6] clang-format --- lib_enc/prot_fx_enc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib_enc/prot_fx_enc.h b/lib_enc/prot_fx_enc.h index 3f4b25e96..239ea927b 100644 --- a/lib_enc/prot_fx_enc.h +++ b/lib_enc/prot_fx_enc.h @@ -2299,8 +2299,8 @@ void E_ACELP_4tsearchx_fx( Word16 code[] /*Q9*/, const PulseConfig *config, Word16 ind[] /*Q0*/ - , - const Word16 element_mode ); + , + const Word16 element_mode ); void E_ACELP_weighted_code( const Word16 code[], /* i: code Q9*/ -- GitLab