From 6094768ba8e07dd971bf9092a3af184386f69a6e Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Mon, 2 Dec 2024 12:07:34 +0530 Subject: [PATCH] Float code cleanup across modules --- apps/decoder.c | 18 +- apps/encoder.c | 9 - lib_com/cnst.h | 4 +- lib_com/count.h | 50 -- lib_com/enhUL32.c | 52 -- lib_com/fft_cldfb_fx.c | 11 - lib_com/fft_fx.c | 37 -- lib_com/float_to_fix_ops.c | 8 - lib_com/frame_ener.c | 4 - lib_com/rom_com.c | 545 +------------------ lib_com/swb_tbe_com_fx.c | 3 - lib_com/tcx_utils_fx.c | 47 -- lib_com/tools_fx.c | 25 - lib_dec/dec_tcx_fx.c | 4 - lib_dec/gs_dec_fx.c | 10 - lib_dec/hq_hr_dec_fx.c | 8 - lib_dec/ivas_mc_param_dec.c | 41 -- lib_dec/ivas_svd_dec.c | 57 +- lib_dec/stat_dec.h | 7 - lib_enc/acelp_core_enc.c | 1 + lib_enc/cng_enc_fx.c | 8 +- lib_enc/decision_matrix_enc_fx.c | 6 - lib_enc/dtx_fx.c | 5 - lib_enc/enc_uv_fx.c | 28 - lib_enc/eval_pit_contr_fx.c | 19 - lib_enc/find_tilt.c | 4 +- lib_enc/find_wsp.c | 3 + lib_enc/frame_spec_dif_cor_rate.c | 2 + lib_enc/gain_enc.c | 5 +- lib_enc/gs_enc_fx.c | 4 - lib_enc/hf_cod_amrwb.c | 2 + lib_enc/hq_classifier_enc.c | 2 + lib_enc/hq_env_enc.c | 2 + lib_enc/hvq_enc.c | 2 + lib_enc/igf_enc.c | 58 --- lib_enc/init_enc_fx.c | 8 - lib_enc/ivas_core_pre_proc.c | 27 - lib_enc/ivas_cpe_enc.c | 1 + lib_enc/ivas_front_vad.c | 4 +- lib_enc/ivas_ism_enc.c | 7 + lib_enc/ivas_mcmasa_enc.c | 8 + lib_enc/ivas_mdct_core_enc.c | 13 +- lib_enc/ivas_rom_enc.c | 97 ---- lib_enc/ivas_sce_enc.c | 5 + lib_enc/ivas_spar_encoder.c | 13 - lib_enc/ivas_stereo_switching_enc.c | 4 + lib_enc/ivas_stereo_td_enc.c | 4 + lib_enc/lsf_enc_fx.c | 19 - lib_enc/pit_enc_fx.c | 3 - lib_enc/sig_clas_fx.c | 21 - lib_enc/speech_music_classif_fx.c | 35 -- lib_enc/stat_enc.h | 6 - lib_enc/swb_pre_proc.c | 18 +- lib_enc/tcx_utils_enc_fx.c | 66 --- lib_util/test_fft.c | 781 ---------------------------- lib_util/test_mdct.c | 185 ------- 56 files changed, 72 insertions(+), 2344 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 0155a305a..851732f09 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -134,10 +134,7 @@ static bool parseCmdlIVAS_dec( int16_t argc, char **argv, DecArguments *arg ); static void usage_dec( void ); static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec, int16_t *pcmBuf ); static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); -#if 0 -void run_fft_unit_test( void ); -void run_mdct_unit_test( void ); -#endif + /*------------------------------------------------------------------------------------------* * main() @@ -165,9 +162,6 @@ int main( RenderConfigReader *renderConfigReader = NULL; int16_t *pcmBuf = NULL; IVAS_RENDER_FRAMESIZE asked_frame_size; -#if 0 - int16_t run_unit_tests = 0; -#endif #ifdef WMOPS reset_wmops(); @@ -180,16 +174,6 @@ int main( IVAS_DEC_PrintDisclaimer(); -#if 0 - if ( run_unit_tests ) - { - run_fft_unit_test(); - run_mdct_unit_test(); - return 0; - } - -#endif - if ( !parseCmdlIVAS_dec( (int16_t) argc, argv, &arg ) ) { /* Error printout done in parseCmdlIVAS_dec() */ diff --git a/apps/encoder.c b/apps/encoder.c index adf7a88af..6d34f7758 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -371,21 +371,12 @@ int main( } break; case IVAS_ENC_INPUT_SBA: -#if 0 - if ((error = IVAS_ENC_ConfigureForAmbisonics_fx(hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, - arg.pca)) != IVAS_ERR_OK) - { - fprintf(stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage(error)); - goto cleanup; - } -#else if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.pca ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; } -#endif break; case IVAS_ENC_INPUT_MASA: if ( ( error = IVAS_ENC_ConfigureForMasa( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masaVariant ) ) != IVAS_ERR_OK ) diff --git a/lib_com/cnst.h b/lib_com/cnst.h index 718ee3ac5..7ee29ab3d 100644 --- a/lib_com/cnst.h +++ b/lib_com/cnst.h @@ -3068,9 +3068,7 @@ enum #define DEGREE_180 (Word32)(180.0 *ONE_IN_Q23) #define DEGREE_360 (Word32)(360.0 *ONE_IN_Q23) extern const Word16 Idx2Freq_Tbl[]; -#if 0 -//TO do add in rom_com -#endif + #define chk_fs(fs) /* 'x' is converted to Q6, 'Freq_Tbl'/1000 in Q9 */ /* only works for 'fs' = [8000,12800,16000,25600,32000,48000] (unpredictable otherwise) */ diff --git a/lib_com/count.h b/lib_com/count.h index 10e96e44f..03eb7034b 100644 --- a/lib_com/count.h +++ b/lib_com/count.h @@ -487,56 +487,6 @@ void WMOPS_output_all_std( Word16 dtx_mode ); * free all allocated counter memory */ void WMOPS_destroy( void ); -#if 0 -/* - * Example of how count.h could be used. - * - * In the example below it is assumed that the init_OBJECT functions - * does not use any calls to counter.h or basic_op.h. If this is the case - * a call to the function Reset_WMOPS_counter() must be done after each call - * to init_OBJECT if these operations is not to be included in the statistics. - */ - -int main () { - int spe1Id, spe2Id, cheId; - - /* initiate counters and objects */ - spe1Id = getCounterId ("Spe 5k8"); - setCounter (spe1Id); - Init_WMOPS_counter (); - init_spe1 ( ...); - - spe2Id = getCounterId ("Spe 12k2"); - setCounter (spe2Id); - Init_WMOPS_counter (); - init_spe2 ( ...); - - cheId = getCounterId ("Channel encoder"); - setCounter (cheId); - Init_WMOPS_counter (); - init_che ( ...); - ... while (data) { - test (); /* Note this call to test(); */ - if (useSpe1) - setCounter (spe1Id); - else - setCounter (spe2Id); - Reset_WMOPS_counter (); - speEncode ( ...); - WMOPS_output (0); /* Normal routine for displaying WMOPS info */ - - setCounter (cheId); - Reset_WMOPS_counter (); - preChannelInter ( ...); - fwc (); /* Note the call to fwc() for each part */ - convolve ( ...); - fwc (); /* of the channel encoder. */ - interleave ( ...); - fwc (); - WMOPS_output (0); /* Normal routine for displaying WMOPS info */ - } -} -#endif /* #if 0 */ /* jdr 20120117: add FLC similar functions */ /* mul 20130729: set BASOP_COUNT_SUBROUTINES to count on a per-BASOP_sub_start()/BASOP_sub_end() base; diff --git a/lib_com/enhUL32.c b/lib_com/enhUL32.c index 0fe4c304b..1fb529104 100644 --- a/lib_com/enhUL32.c +++ b/lib_com/enhUL32.c @@ -69,59 +69,7 @@ UWord32 UL_deposit_l( UWord16 uvar ) #endif return ( UL_result ); } -#if 0 -/*_____________________________________________________________________________ - | | - | Function Name : norm_ul_float | - | | - | Purpose : | - | | - | Produces the number of left shifts needed to normalize the 32 bit varia- | - | ble UL_var1 for positive values on the interval with minimum of | - | 0 and maximum of 0xffffffff, ; in order to normalize the | - | result, the following operation must be done : | - | | - | norm_UL_var1 = UL_lshl(UL_var1, norm_ul_float(UL_var1)). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | UL_var1 | - | 32 bit long unsigned integer (UWord32) whose value falls in the | - | range : 0x0000 0000 <= var1 <= 0xffff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x0000 001f. (0..31d) | - |_____________________________________________________________________________| -*/ -Word16 norm_ul_float (UWord32 UL_var1) { - Word16 var_out; - - if (UL_var1 == 0) { - var_out = 0; - } - else { - /* simply test shift up until highest bit is set */ - for (var_out = 0; UL_var1 < (UWord32) 0x80000000U; var_out++) { - UL_var1 <<= 1; - } - } -#ifdef WMOPS - multiCounter[currCounter].norm_ul_float++; -#endif - - return (var_out); -} -#endif /*___________________________________________________________________________ | | | Function Name : UL_addNs | diff --git a/lib_com/fft_cldfb_fx.c b/lib_com/fft_cldfb_fx.c index b4dbcc095..80e643362 100644 --- a/lib_com/fft_cldfb_fx.c +++ b/lib_com/fft_cldfb_fx.c @@ -79,16 +79,6 @@ void fft16_with_cmplx_data( cmplx *pInp, Word16 bsacle ); -#if 0 -#define SCALEFACTOR5 ( 4 ) -#define SCALEFACTOR8 ( 4 ) -#define SCALEFACTOR10 ( 5 ) -#define SCALEFACTOR16 ( 5 ) -#define SCALEFACTOR20 ( 5 ) -#define SCALEFACTOR30 ( 6 ) -#define SCALEFACTOR30_1 ( 5 ) -#define SCALEFACTOR30_2 ( 1 ) -#else #undef SCALEFACTOR5 #undef SCALEFACTOR8 #undef SCALEFACTOR10 @@ -106,7 +96,6 @@ void fft16_with_cmplx_data( cmplx *pInp, Word16 bsacle ); #define SCALEFACTOR30 ( 0 ) #define SCALEFACTOR30_1 ( 0 ) #define SCALEFACTOR30_2 ( 0 ) -#endif cmplx CL_scale_t( cmplx x, Word16 y ); cmplx CL_dscale_t( cmplx x, Word16 y1, Word16 y2 ); diff --git a/lib_com/fft_fx.c b/lib_com/fft_fx.c index 6b8b49bd2..64a4c8be2 100644 --- a/lib_com/fft_fx.c +++ b/lib_com/fft_fx.c @@ -94,43 +94,6 @@ #define SCALEFACTOR16 ( 0 ) #define SCALEFACTOR20 ( 0 ) -#if 0 -#define SCALEFACTORN2 ( 3 ) -#define SCALEFACTOR2 ( 2 ) -#define SCALEFACTOR3 ( 3 ) -#define SCALEFACTOR4 ( 3 ) -#define SCALEFACTOR5 ( 4 ) -#define SCALEFACTOR8 ( 4 ) -#define SCALEFACTOR10 ( 5 ) -#define SCALEFACTOR12 ( 5 ) -#define SCALEFACTOR15 ( 5 ) -#define SCALEFACTOR16 ( 0 ) -#define SCALEFACTOR20 ( 0 ) -#define SCALEFACTOR24 ( 6 ) -#define SCALEFACTOR30 ( 6 ) -#define SCALEFACTOR30_1 ( 5 ) -#define SCALEFACTOR30_2 ( 1 ) -#define SCALEFACTOR32 ( 6 ) -#define SCALEFACTOR32_1 ( 5 ) -#define SCALEFACTOR32_2 ( 1 ) -#define SCALEFACTOR40 ( 7 ) -#define SCALEFACTOR60 ( 7 ) -#define SCALEFACTOR64 ( 7 ) -#define SCALEFACTOR80 ( 8 ) -#define SCALEFACTOR100 ( 10 ) -#define SCALEFACTOR120 ( 8 ) -#define SCALEFACTOR128 ( 8 ) -#define SCALEFACTOR160 ( 8 ) -#define SCALEFACTOR192 ( 10 ) -#define SCALEFACTOR200 ( 10 ) -#define SCALEFACTOR240 ( 9 ) -#define SCALEFACTOR256 ( 9 ) -#define SCALEFACTOR320 ( 10 ) -#define SCALEFACTOR400 ( 10 ) -#define SCALEFACTOR480 ( 11 ) -#define SCALEFACTOR600 ( 10 ) - -#endif /*-----------------------------------------------------------------* * Local function prototypes *-----------------------------------------------------------------*/ diff --git a/lib_com/float_to_fix_ops.c b/lib_com/float_to_fix_ops.c index ff8e6fd4f..c12984f73 100644 --- a/lib_com/float_to_fix_ops.c +++ b/lib_com/float_to_fix_ops.c @@ -37,9 +37,6 @@ void floatToFixed_arrL( float *f, Word32 *i, Word16 Q, Word16 l ) { for ( int j = 0; j < l; j++ ) { -#if 0 - i[j] = floatToFixed(f[j], Q); -#else Word64 i64_val = floatToFixed( f[j], Q ); IF( i64_val > MAX_32 ) { @@ -50,7 +47,6 @@ void floatToFixed_arrL( float *f, Word32 *i, Word16 Q, Word16 l ) i64_val = MIN_32; } i[j] = (Word32) i64_val; -#endif } } void floatToFixed_arr16( float *f, Word16 *i, Word16 Q, Word16 l ) @@ -158,9 +154,6 @@ void floatToFixed_arr( float *f, Word16 *i, Word16 Q, Word16 l ) { for ( int j = 0; j < l; j++ ) { -#if 0 - i[j] = (Word16)floatToFixed(f[j], Q); -#else Word32 i32_val = floatToFixed( f[j], Q ); IF( i32_val > MAX_16 ) { @@ -171,7 +164,6 @@ void floatToFixed_arr( float *f, Word16 *i, Word16 Q, Word16 l ) i32_val = MIN_16; } i[j] = (Word16) i32_val; -#endif } } void fixedToFloat_arrL( Word32 *i, float *f, Word16 Q, Word16 l ) diff --git a/lib_com/frame_ener.c b/lib_com/frame_ener.c index cd2eb4418..bf6249814 100644 --- a/lib_com/frame_ener.c +++ b/lib_com/frame_ener.c @@ -186,10 +186,6 @@ float frame_energy( } #endif - -#if 0 -//TO do rename to common name -#endif /*----------------------------------------------------------------------------------* * frame_ener() * diff --git a/lib_com/rom_com.c b/lib_com/rom_com.c index cec1af1e9..c2c92f2f4 100644 --- a/lib_com/rom_com.c +++ b/lib_com/rom_com.c @@ -10362,450 +10362,7 @@ const Word16 CLDFB80_30[] =//Q.5 0, 18, -223, -7348, 682, 0, 32, -249, -7947, 282 }; -#if 0// Not used anywhere -const Word16 LDQMF_10_enc_fx[] = -{ - 2, -21, 79, -1890, 8640, - 1, -35, -5, -3186, 7299, - -1, -49, -126, -4597, 5995, - -3, -62, -285, -6085, 4767, - -5, -74, -484, -7607, 3646, - -6, -84, -721, -9114, 2656, - -7, -92, -989, -10557, 1815, - -7, -99, -1279, -11885, 1125, - -8, -104, -1579, -13052, 583, - -10, -108, -1869, -14017, 175, - -15, -112, -2129, -14742, -104, - -21, -117, -2336, -15204, -267, - -27, -123, -2462, -15389, -354, - -31, -132, -2482, -15293, -380, - -33, -144, -2370, -14926, -359, - -32, -156, -2104, -14306, -304, - -27, -166, -1668, -13461, -230, - -18, -169, -1049, -12429, -152, - -7, -160, -246, -11250, -82, - 6, -132, 739, -9972, -31 -}; - -const Word16 LDQMF_16_enc_fx[] = -{ - 2, -18, 91, -1662, 8892, - 2, -27, 46, -2441, 8051, - 1, -36, -12, -3271, 7216, - 0, -45, -84, -4146, 6396, - -2, -53, -171, -5056, 5602, - -3, -61, -274, -5991, 4841, - -5, -69, -392, -6940, 4121, - -6, -76, -526, -7892, 3449, - -6, -82, -674, -8835, 2831, - -7, -88, -835, -9756, 2270, - -7, -93, -1007, -10643, 1767, - -7, -97, -1187, -11485, 1324, - -7, -101, -1373, -12269, 941, - -8, -104, -1560, -12985, 613, - -9, -106, -1744, -13622, 338, - -11, -109, -1921, -14172, 111, - -14, -111, -2084, -14626, -64, - -17, -114, -2228, -14977, -185, - -21, -117, -2346, -15223, -274, - -25, -121, -2433, -15361, -334, - -28, -126, -2481, -15389, -368, - -31, -132, -2484, -15307, -380, - -33, -139, -2436, -15119, -373, - -33, -146, -2332, -14828, -350, - -32, -154, -2167, -14440, -316, - -30, -161, -1935, -13962, -273, - -26, -166, -1635, -13402, -225, - -21, -169, -1263, -12769, -176, - -15, -168, -818, -12074, -128, - -8, -161, -301, -11328, -86, - 0, -147, 286, -10541, -50, - 9, -124, 942, -9725, -23 -}; - -const Word16 LDQMF_20_enc_fx[] = -{ - 2, -17, 95, -1588, 8976, - 2, -24, 61, -2202, 8303, - 1, -32, 19, -2850, 7632, - 1, -39, -32, -3530, 6968, - 0, -46, -92, -4236, 6316, - -2, -53, -162, -4964, 5680, - -3, -59, -241, -5708, 5065, - -4, -65, -331, -6464, 4475, - -5, -71, -431, -7226, 3914, - -6, -76, -540, -7987, 3385, - -6, -81, -658, -8741, 2890, - -7, -86, -785, -9482, 2432, - -7, -90, -919, -10205, 2011, - -7, -94, -1060, -10901, 1628, - -7, -97, -1205, -11566, 1283, - -7, -100, -1354, -12194, 976, - -7, -103, -1504, -12778, 706, - -8, -105, -1653, -13314, 470, - -9, -107, -1798, -13797, 266, - -11, -109, -1938, -14222, 90, - -14, -111, -2068, -14585, -49, - -16, -113, -2187, -14883, -153, - -19, -115, -2290, -15114, -234, - -22, -118, -2376, -15276, -295, - -25, -121, -2439, -15369, -338, - -28, -125, -2478, -15391, -365, - -30, -130, -2488, -15343, -378, - -32, -135, -2467, -15226, -378, - -33, -141, -2411, -15042, -368, - -33, -147, -2319, -14794, -347, - -32, -153, -2186, -14483, -320, - -31, -159, -2012, -14114, -286, - -28, -164, -1794, -13691, -249, - -25, -167, -1531, -13219, -210, - -21, -169, -1221, -12702, -171, - -16, -168, -866, -12146, -133, - -10, -164, -464, -11556, -98, - -4, -155, -16, -10938, -67, - 3, -141, 476, -10298, -41, - 9, -121, 1012, -9642, -21, -}; -const Word16 LDQMF_30_enc_fx[] = -{ - 2, -16, 100, -1489, 9088, - 2, -21, 79, -1890, 8640, - 2, -26, 55, -2307, 8191, - 2, -30, 27, -2740, 7744, - 1, -35, -5, -3186, 7299, - 0, -40, -41, -3646, 6858, - 0, -45, -81, -4116, 6423, - -1, -49, -126, -4597, 5995, - -2, -54, -174, -5087, 5576, - -3, -58, -227, -5583, 5166, - -3, -62, -285, -6085, 4767, - -4, -66, -347, -6591, 4380, - -5, -70, -413, -7099, 4006, - -5, -74, -484, -7607, 3646, - -6, -77, -559, -8113, 3300, - -6, -81, -638, -8616, 2970, - -6, -84, -721, -9114, 2656, - -7, -87, -807, -9604, 2359, - -7, -89, -896, -10086, 2078, - -7, -92, -989, -10557, 1815, - -7, -94, -1084, -11015, 1568, - -7, -97, -1181, -11458, 1338, - -7, -99, -1279, -11885, 1125, - -7, -101, -1379, -12294, 929, - -7, -102, -1479, -12684, 748, - -8, -104, -1579, -13052, 583, - -8, -105, -1677, -13398, 433, - -9, -107, -1774, -13720, 297, - -10, -108, -1869, -14017, 175, - -11, -109, -1960, -14287, 63, - -13, -110, -2047, -14529, -30, - -15, -112, -2129, -14742, -104, - -17, -113, -2205, -14926, -168, - -19, -115, -2274, -15080, -222, - -21, -117, -2336, -15204, -267, - -23, -118, -2388, -15296, -303, - -25, -121, -2430, -15358, -332, - -27, -123, -2462, -15389, -354, - -28, -126, -2482, -15388, -369, - -30, -129, -2489, -15356, -377, - -31, -132, -2482, -15293, -380, - -32, -136, -2460, -15200, -377, - -33, -140, -2423, -15078, -370, - -33, -144, -2370, -14926, -359, - -33, -148, -2299, -14746, -343, - -33, -152, -2211, -14539, -325, - -32, -156, -2104, -14306, -304, - -31, -160, -1979, -14047, -281, - -29, -163, -1833, -13765, -256, - -27, -166, -1668, -13461, -230, - -24, -168, -1482, -13136, -204, - -22, -169, -1276, -12791, -177, - -18, -169, -1049, -12429, -152, - -15, -168, -802, -12050, -127, - -11, -165, -534, -11657, -103, - -7, -160, -246, -11250, -82, - -3, -153, 63, -10833, -62, - 1, -144, 391, -10406, -45, - 6, -132, 739, -9972, -31, - 11, -117, 1105, -9532, -17 -}; - -const Word16 LDQMF_32_enc_fx[] = -{ - 2, -16, 101, -1477, 9102, - 2, -20, 81, -1852, 8682, - 2, -25, 59, -2241, 8261, - 2, -29, 33, -2644, 7841, - 1, -34, 4, -3059, 7424, - 1, -38, -28, -3486, 7009, - 0, -43, -64, -3924, 6599, - -1, -47, -104, -4371, 6195, - -1, -51, -148, -4826, 5798, - -2, -55, -195, -5288, 5408, - -3, -59, -247, -5755, 5027, - -4, -63, -302, -6227, 4657, - -4, -67, -361, -6702, 4297, - -5, -71, -424, -7178, 3948, - -5, -74, -491, -7654, 3613, - -6, -77, -561, -8129, 3290, - -6, -80, -635, -8600, 2980, - -6, -83, -713, -9067, 2685, - -7, -86, -793, -9528, 2404, - -7, -89, -877, -9981, 2138, - -7, -91, -963, -10425, 1887, - -7, -94, -1051, -10859, 1651, - -7, -96, -1141, -11280, 1430, - -7, -98, -1233, -11687, 1223, - -7, -100, -1326, -12079, 1031, - -7, -101, -1420, -12455, 854, - -7, -103, -1513, -12813, 690, - -8, -104, -1606, -13152, 540, - -9, -106, -1699, -13471, 402, - -9, -107, -1789, -13768, 277, - -10, -108, -1878, -14043, 164, - -12, -109, -1963, -14295, 60, - -13, -110, -2045, -14522, -27, - -15, -112, -2122, -14724, -97, - -17, -113, -2194, -14899, -158, - -18, -114, -2260, -15049, -211, - -20, -116, -2319, -15172, -255, - -22, -118, -2371, -15268, -292, - -24, -120, -2414, -15337, -321, - -26, -122, -2449, -15378, -344, - -27, -124, -2473, -15392, -361, - -29, -127, -2486, -15379, -373, - -30, -130, -2488, -15338, -379, - -31, -133, -2477, -15270, -380, - -32, -137, -2453, -15176, -376, - -33, -140, -2416, -15056, -369, - -33, -144, -2364, -14910, -357, - -33, -148, -2297, -14740, -343, - -33, -152, -2214, -14546, -325, - -32, -156, -2115, -14329, -306, - -31, -159, -1999, -14089, -284, - -29, -162, -1867, -13829, -261, - -27, -165, -1716, -13549, -237, - -25, -167, -1548, -13250, -213, - -23, -169, -1362, -12933, -188, - -20, -169, -1158, -12601, -164, - -17, -169, -936, -12253, -140, - -13, -167, -696, -11892, -117, - -10, -163, -437, -11518, -96, - -6, -158, -161, -11134, -76, - -2, -151, 133, -10741, -58, - 2, -142, 444, -10339, -43, - 6, -131, 772, -9931, -29, - 11, -117, 1117, -9518, -17 -}; - -const Word16 LDQMF_40_enc_fx[] = -{ - 2, -15, 102, -1440, 9144, - 2, -19, 87, -1738, 8808, - 2, -22, 70, -2045, 8472, - 2, -26, 51, -2361, 8135, - 2, -30, 30, -2685, 7800, - 1, -33, 7, -3017, 7465, - 1, -37, -18, -3357, 7133, - 0, -41, -46, -3704, 6804, - 0, -44, -76, -4057, 6477, - -1, -48, -108, -4416, 6155, - -1, -51, -143, -4780, 5837, - -2, -54, -181, -5148, 5524, - -3, -57, -220, -5521, 5216, - -3, -61, -263, -5896, 4915, - -4, -64, -308, -6274, 4620, - -4, -67, -355, -6654, 4332, - -5, -69, -405, -7035, 4052, - -5, -72, -457, -7416, 3779, - -6, -75, -512, -7797, 3514, - -6, -78, -569, -8176, 3258, - -6, -80, -628, -8553, 3011, - -6, -83, -689, -8928, 2772, - -6, -85, -753, -9299, 2543, - -7, -87, -818, -9665, 2323, - -7, -89, -885, -10026, 2113, - -7, -91, -954, -10381, 1912, - -7, -93, -1024, -10730, 1720, - -7, -95, -1096, -11071, 1538, - -7, -96, -1169, -11403, 1366, - -7, -98, -1242, -11727, 1203, - -7, -99, -1317, -12041, 1050, - -7, -101, -1391, -12344, 905, - -7, -102, -1466, -12636, 770, - -8, -103, -1541, -12917, 644, - -8, -104, -1616, -13185, 526, - -8, -106, -1690, -13440, 416, - -9, -107, -1762, -13681, 314, - -10, -107, -1834, -13909, 219, - -11, -108, -1904, -14121, 132, - -12, -109, -1971, -14319, 50, - -13, -110, -2037, -14501, -20, - -14, -111, -2099, -14666, -77, - -16, -112, -2158, -14815, -129, - -17, -113, -2214, -14947, -175, - -19, -115, -2266, -15063, -215, - -20, -116, -2314, -15161, -251, - -22, -117, -2356, -15242, -281, - -23, -119, -2394, -15306, -307, - -25, -120, -2426, -15352, -329, - -26, -122, -2451, -15381, -346, - -27, -124, -2471, -15392, -360, - -29, -126, -2483, -15386, -370, - -30, -129, -2488, -15362, -376, - -31, -131, -2486, -15320, -379, - -32, -134, -2475, -15262, -379, - -32, -136, -2456, -15187, -377, - -33, -139, -2429, -15095, -371, - -33, -142, -2392, -14986, -363, - -33, -145, -2345, -14862, -353, - -33, -148, -2289, -14722, -341, - -33, -151, -2223, -14566, -327, - -32, -154, -2147, -14396, -312, - -31, -157, -2059, -14212, -295, - -30, -160, -1961, -14013, -277, - -29, -163, -1852, -13802, -259, - -28, -165, -1732, -13578, -240, - -26, -167, -1601, -13342, -220, - -24, -168, -1458, -13094, -200, - -22, -169, -1303, -12835, -181, - -20, -169, -1137, -12567, -161, - -17, -169, -959, -12288, -142, - -14, -167, -770, -12002, -124, - -12, -165, -569, -11707, -106, - -9, -162, -356, -11404, -90, - -6, -158, -132, -11095, -74, - -2, -152, 103, -10780, -60, - 1, -145, 349, -10460, -47, - 4, -137, 606, -10136, -36, - 8, -127, 874, -9808, -26, - 11, -115, 1152, -9476, -15 -}; - -const Word16 LDQMF_60_enc_fx[] = -{ - 2, -14, 105, -1391, 9200, - 2, -17, 95, -1588, 8976, - 2, -19, 85, -1788, 8752, - 2, -22, 73, -1993, 8528, - 2, -24, 61, -2202, 8303, - 2, -27, 48, -2414, 8079, - 2, -29, 34, -2630, 7855, - 1, -32, 19, -2850, 7632, - 1, -34, 3, -3073, 7410, - 1, -36, -14, -3300, 7188, - 1, -39, -32, -3530, 6968, - 0, -41, -51, -3762, 6749, - 0, -44, -71, -3998, 6531, - 0, -46, -92, -4236, 6316, - -1, -48, -114, -4476, 6102, - -1, -50, -137, -4719, 5890, - -2, -53, -162, -4964, 5680, - -2, -55, -187, -5210, 5472, - -2, -57, -214, -5458, 5267, - -3, -59, -241, -5708, 5065, - -3, -61, -270, -5959, 4865, - -4, -63, -300, -6211, 4669, - -4, -65, -331, -6464, 4475, - -4, -67, -363, -6718, 4285, - -5, -69, -396, -6972, 4098, - -5, -71, -431, -7226, 3914, - -5, -73, -466, -7480, 3734, - -5, -75, -502, -7733, 3558, - -6, -76, -540, -7987, 3385, - -6, -78, -578, -8239, 3216, - -6, -80, -618, -8491, 3051, - -6, -81, -658, -8741, 2890, - -6, -83, -700, -8990, 2733, - -6, -84, -742, -9237, 2581, - -7, -86, -785, -9482, 2432, - -7, -87, -829, -9726, 2287, - -7, -89, -874, -9966, 2147, - -7, -90, -919, -10205, 2011, - -7, -91, -966, -10440, 1879, - -7, -93, -1012, -10672, 1751, - -7, -94, -1060, -10901, 1628, - -7, -95, -1108, -11127, 1509, - -7, -96, -1156, -11349, 1394, - -7, -97, -1205, -11566, 1283, - -7, -98, -1255, -11780, 1177, - -7, -99, -1304, -11989, 1075, - -7, -100, -1354, -12194, 976, - -7, -101, -1404, -12394, 882, - -7, -102, -1454, -12589, 792, - -7, -103, -1504, -12778, 706, - -8, -104, -1554, -12962, 623, - -8, -104, -1603, -13141, 545, - -8, -105, -1653, -13314, 470, - -9, -106, -1702, -13481, 398, - -9, -106, -1750, -13642, 330, - -9, -107, -1798, -13797, 266, - -10, -108, -1845, -13945, 204, - -11, -108, -1892, -14087, 146, - -11, -109, -1938, -14222, 90, - -12, -110, -1982, -14351, 38, - -13, -110, -2026, -14472, -9, - -14, -111, -2068, -14585, -49, - -14, -111, -2109, -14692, -86, - -15, -112, -2149, -14791, -121, - -16, -113, -2187, -14883, -153, - -17, -114, -2223, -14967, -182, - -18, -114, -2258, -15044, -209, - -19, -115, -2290, -15114, -234, - -20, -116, -2321, -15176, -256, - -21, -117, -2350, -15230, -277, - -22, -118, -2376, -15276, -295, - -23, -119, -2399, -15315, -311, - -24, -120, -2421, -15346, -326, - -25, -121, -2439, -15369, -338, - -26, -123, -2455, -15384, -349, - -27, -124, -2468, -15391, -358, - -28, -125, -2478, -15391, -365, - -29, -127, -2485, -15383, -371, - -30, -128, -2488, -15367, -375, - -30, -130, -2488, -15343, -378, - -31, -132, -2485, -15312, -380, - -31, -133, -2478, -15273, -380, - -32, -135, -2467, -15226, -378, - -32, -137, -2452, -15172, -376, - -33, -139, -2434, -15111, -372, - -33, -141, -2411, -15042, -368, - -33, -143, -2385, -14967, -362, - -33, -145, -2354, -14884, -355, - -33, -147, -2319, -14794, -347, - -33, -149, -2279, -14697, -339, - -33, -151, -2235, -14593, -330, - -32, -153, -2186, -14483, -320, - -32, -155, -2133, -14366, -309, - -32, -157, -2075, -14243, -298, - -31, -159, -2012, -14114, -286, - -30, -161, -1944, -13979, -274, - -29, -162, -1871, -13838, -262, - -28, -164, -1794, -13691, -249, - -27, -165, -1711, -13539, -236, - -26, -166, -1623, -13382, -223, - -25, -167, -1531, -13219, -210, - -24, -168, -1433, -13051, -197, - -22, -169, -1330, -12879, -184, - -21, -169, -1221, -12702, -171, - -19, -169, -1108, -12521, -158, - -18, -169, -990, -12335, -145, - -16, -168, -866, -12146, -133, - -14, -167, -737, -11953, -121, - -12, -166, -603, -11756, -109, - -10, -164, -464, -11556, -98, - -8, -161, -320, -11353, -87, - -6, -158, -170, -11147, -77, - -4, -155, -16, -10938, -67, - -2, -151, 143, -10727, -58, - 0, -146, 307, -10514, -49, - 3, -141, 476, -10298, -41, - 5, -135, 650, -10081, -34, - 7, -129, 829, -9862, -27, - 9, -121, 1012, -9642, -21, - 12, -113, 1199, -9421, -13 -}; -#endif + /*! * \brief CLDFB rRotVectr * @@ -11021,12 +10578,7 @@ const Word16 *cldfb_protoFilter_2_5ms[] = { CLDFB80_10, CLDFB80_16, CLDFB80_20, CLDFB80_32, CLDFB80_40, CLDFB80_60, CLDFB80_30 }; -#if 0 //def IVAS_FLOAT_FIXED not used anywhere -const Word16 *cldfb_protoFilter_5_0ms[] = -{ - LDQMF_10_enc_fx, LDQMF_16_enc_fx, LDQMF_20_enc_fx, LDQMF_32_enc_fx, LDQMF_40_enc_fx, LDQMF_60_enc_fx, LDQMF_30_enc_fx -}; -#endif + const Word16 cldfb_scale_2_5ms[7] = { 22603/*88.293854 Q8*/, /* 10 bands */ @@ -11704,9 +11256,6 @@ const SCALE_SETUP scaleTableStereo[SIZE_SCALE_TABLE_STEREO] = { 2, 24400, 32000, /*-0.25f,*/ -32/*-0.25f Q7*/, -32 }, { 2, 32000,512001, /* 0.0f ,*/ 0/* 0.0f Q7*/, 0 } }; -#if 0 -//scaleTableStereo recheck extended from scaleTableMono -#endif const SCALE_SETUP scaleTableMono[SIZE_SCALE_TABLE_MONO] = { { 0, 0, 8000, /* -5.5f,*/ -704/*-5.5f Q7*/, -704 }, @@ -11757,9 +11306,7 @@ const SCALE_SETUP scaleTable_cn_only[SIZE_SCALE_TABLE_CN] = { 2, 24400, 32000, /* 0.0f,*/ 0/*0.0000000000 Q14*/ /* 0.0f*/, 0 }, { 2, 32000,128001, /* 0.0f,*/ 0/*0.0000000000 Q14*/ /* 0.0f*/, 0 } }; -#if 0 - //scaleTable_cn_dirac recheck extended from scaleTable_cn_only -#endif + const SCALE_SETUP scaleTable_cn_dirac[15] = { { 0, 0, 13200, /*-3.0f,*/ 16306/*0.9952622652 Q14*/ /*-3.0f*/, 16306 }, @@ -40590,92 +40137,6 @@ const Word16 cos_diff_table[512] =//Q15 }; -#if 0 -const Word16 sincos_t_ext_fx[ 641 ] = { - SHC( 0x0000 ), SHC( 0x00c9 ), SHC( 0x0192 ), SHC( 0x025b ), SHC( 0x0324 ), SHC( 0x03ed ), SHC( 0x04b6 ), SHC( 0x057f ), - SHC( 0x0647 ), SHC( 0x0710 ), SHC( 0x07d9 ), SHC( 0x08a2 ), SHC( 0x096a ), SHC( 0x0a33 ), SHC( 0x0afb ), SHC( 0x0bc3 ), - SHC( 0x0c8b ), SHC( 0x0d53 ), SHC( 0x0e1b ), SHC( 0x0ee3 ), SHC( 0x0fab ), SHC( 0x1072 ), SHC( 0x1139 ), SHC( 0x1201 ), - SHC( 0x12c8 ), SHC( 0x138e ), SHC( 0x1455 ), SHC( 0x151b ), SHC( 0x15e2 ), SHC( 0x16a8 ), SHC( 0x176d ), SHC( 0x1833 ), - SHC( 0x18f8 ), SHC( 0x19bd ), SHC( 0x1a82 ), SHC( 0x1b47 ), SHC( 0x1c0b ), SHC( 0x1ccf ), SHC( 0x1d93 ), SHC( 0x1e56 ), - SHC( 0x1f19 ), SHC( 0x1fdc ), SHC( 0x209f ), SHC( 0x2161 ), SHC( 0x2223 ), SHC( 0x22e5 ), SHC( 0x23a6 ), SHC( 0x2467 ), - SHC( 0x2528 ), SHC( 0x25e8 ), SHC( 0x26a8 ), SHC( 0x2767 ), SHC( 0x2826 ), SHC( 0x28e5 ), SHC( 0x29a3 ), SHC( 0x2a61 ), - SHC( 0x2b1f ), SHC( 0x2bdc ), SHC( 0x2c98 ), SHC( 0x2d55 ), SHC( 0x2e11 ), SHC( 0x2ecc ), SHC( 0x2f87 ), SHC( 0x3041 ), - SHC( 0x30fb ), SHC( 0x31b5 ), SHC( 0x326e ), SHC( 0x3326 ), SHC( 0x33de ), SHC( 0x3496 ), SHC( 0x354d ), SHC( 0x3604 ), - SHC( 0x36ba ), SHC( 0x376f ), SHC( 0x3824 ), SHC( 0x38d8 ), SHC( 0x398c ), SHC( 0x3a40 ), SHC( 0x3af2 ), SHC( 0x3ba5 ), - SHC( 0x3c56 ), SHC( 0x3d07 ), SHC( 0x3db8 ), SHC( 0x3e68 ), SHC( 0x3f17 ), SHC( 0x3fc5 ), SHC( 0x4073 ), SHC( 0x4121 ), - SHC( 0x41ce ), SHC( 0x427a ), SHC( 0x4325 ), SHC( 0x43d0 ), SHC( 0x447a ), SHC( 0x4524 ), SHC( 0x45cd ), SHC( 0x4675 ), - SHC( 0x471c ), SHC( 0x47c3 ), SHC( 0x4869 ), SHC( 0x490f ), SHC( 0x49b4 ), SHC( 0x4a58 ), SHC( 0x4afb ), SHC( 0x4b9e ), - SHC( 0x4c3f ), SHC( 0x4ce1 ), SHC( 0x4d81 ), SHC( 0x4e21 ), SHC( 0x4ebf ), SHC( 0x4f5e ), SHC( 0x4ffb ), SHC( 0x5097 ), - SHC( 0x5133 ), SHC( 0x51ce ), SHC( 0x5269 ), SHC( 0x5302 ), SHC( 0x539b ), SHC( 0x5433 ), SHC( 0x54ca ), SHC( 0x5560 ), - SHC( 0x55f5 ), SHC( 0x568a ), SHC( 0x571d ), SHC( 0x57b0 ), SHC( 0x5842 ), SHC( 0x58d4 ), SHC( 0x5964 ), SHC( 0x59f3 ), - SHC( 0x5a82 ), SHC( 0x5b10 ), SHC( 0x5b9d ), SHC( 0x5c29 ), SHC( 0x5cb4 ), SHC( 0x5d3e ), SHC( 0x5dc7 ), SHC( 0x5e50 ), - SHC( 0x5ed7 ), SHC( 0x5f5e ), SHC( 0x5fe3 ), SHC( 0x6068 ), SHC( 0x60ec ), SHC( 0x616f ), SHC( 0x61f1 ), SHC( 0x6271 ), - SHC( 0x62f2 ), SHC( 0x6371 ), SHC( 0x63ef ), SHC( 0x646c ), SHC( 0x64e8 ), SHC( 0x6563 ), SHC( 0x65dd ), SHC( 0x6657 ), - SHC( 0x66cf ), SHC( 0x6746 ), SHC( 0x67bd ), SHC( 0x6832 ), SHC( 0x68a6 ), SHC( 0x6919 ), SHC( 0x698c ), SHC( 0x69fd ), - SHC( 0x6a6d ), SHC( 0x6adc ), SHC( 0x6b4a ), SHC( 0x6bb8 ), SHC( 0x6c24 ), SHC( 0x6c8f ), SHC( 0x6cf9 ), SHC( 0x6d62 ), - SHC( 0x6dca ), SHC( 0x6e30 ), SHC( 0x6e96 ), SHC( 0x6efb ), SHC( 0x6f5f ), SHC( 0x6fc1 ), SHC( 0x7023 ), SHC( 0x7083 ), - SHC( 0x70e2 ), SHC( 0x7141 ), SHC( 0x719e ), SHC( 0x71fa ), SHC( 0x7255 ), SHC( 0x72af ), SHC( 0x7307 ), SHC( 0x735f ), - SHC( 0x73b5 ), SHC( 0x740b ), SHC( 0x745f ), SHC( 0x74b2 ), SHC( 0x7504 ), SHC( 0x7555 ), SHC( 0x75a5 ), SHC( 0x75f4 ), - SHC( 0x7641 ), SHC( 0x768e ), SHC( 0x76d9 ), SHC( 0x7723 ), SHC( 0x776c ), SHC( 0x77b4 ), SHC( 0x77fa ), SHC( 0x7840 ), - SHC( 0x7884 ), SHC( 0x78c7 ), SHC( 0x7909 ), SHC( 0x794a ), SHC( 0x798a ), SHC( 0x79c8 ), SHC( 0x7a05 ), SHC( 0x7a42 ), - SHC( 0x7a7d ), SHC( 0x7ab6 ), SHC( 0x7aef ), SHC( 0x7b26 ), SHC( 0x7b5d ), SHC( 0x7b92 ), SHC( 0x7bc5 ), SHC( 0x7bf8 ), - SHC( 0x7c29 ), SHC( 0x7c5a ), SHC( 0x7c89 ), SHC( 0x7cb7 ), SHC( 0x7ce3 ), SHC( 0x7d0f ), SHC( 0x7d39 ), SHC( 0x7d62 ), - SHC( 0x7d8a ), SHC( 0x7db0 ), SHC( 0x7dd6 ), SHC( 0x7dfa ), SHC( 0x7e1d ), SHC( 0x7e3f ), SHC( 0x7e5f ), SHC( 0x7e7f ), - SHC( 0x7e9d ), SHC( 0x7eba ), SHC( 0x7ed5 ), SHC( 0x7ef0 ), SHC( 0x7f09 ), SHC( 0x7f21 ), SHC( 0x7f38 ), SHC( 0x7f4d ), - SHC( 0x7f62 ), SHC( 0x7f75 ), SHC( 0x7f87 ), SHC( 0x7f97 ), SHC( 0x7fa7 ), SHC( 0x7fb5 ), SHC( 0x7fc2 ), SHC( 0x7fce ), - SHC( 0x7fd8 ), SHC( 0x7fe1 ), SHC( 0x7fe9 ), SHC( 0x7ff0 ), SHC( 0x7ff6 ), SHC( 0x7ffa ), SHC( 0x7ffd ), SHC( 0x7fff ), - SHC( 0x7fff ), SHC( 0x7fff ), SHC( 0x7ffd ), SHC( 0x7ffa ), SHC( 0x7ff6 ), SHC( 0x7ff0 ), SHC( 0x7fe9 ), SHC( 0x7fe1 ), - SHC( 0x7fd8 ), SHC( 0x7fce ), SHC( 0x7fc2 ), SHC( 0x7fb5 ), SHC( 0x7fa7 ), SHC( 0x7f97 ), SHC( 0x7f87 ), SHC( 0x7f75 ), - SHC( 0x7f62 ), SHC( 0x7f4d ), SHC( 0x7f38 ), SHC( 0x7f21 ), SHC( 0x7f09 ), SHC( 0x7ef0 ), SHC( 0x7ed5 ), SHC( 0x7eba ), - SHC( 0x7e9d ), SHC( 0x7e7f ), SHC( 0x7e5f ), SHC( 0x7e3f ), SHC( 0x7e1d ), SHC( 0x7dfa ), SHC( 0x7dd6 ), SHC( 0x7db0 ), - SHC( 0x7d8a ), SHC( 0x7d62 ), SHC( 0x7d39 ), SHC( 0x7d0f ), SHC( 0x7ce3 ), SHC( 0x7cb7 ), SHC( 0x7c89 ), SHC( 0x7c5a ), - SHC( 0x7c29 ), SHC( 0x7bf8 ), SHC( 0x7bc5 ), SHC( 0x7b92 ), SHC( 0x7b5d ), SHC( 0x7b26 ), SHC( 0x7aef ), SHC( 0x7ab6 ), - SHC( 0x7a7d ), SHC( 0x7a42 ), SHC( 0x7a05 ), SHC( 0x79c8 ), SHC( 0x798a ), SHC( 0x794a ), SHC( 0x7909 ), SHC( 0x78c7 ), - SHC( 0x7884 ), SHC( 0x7840 ), SHC( 0x77fa ), SHC( 0x77b4 ), SHC( 0x776c ), SHC( 0x7723 ), SHC( 0x76d9 ), SHC( 0x768e ), - SHC( 0x7641 ), SHC( 0x75f4 ), SHC( 0x75a5 ), SHC( 0x7555 ), SHC( 0x7504 ), SHC( 0x74b2 ), SHC( 0x745f ), SHC( 0x740b ), - SHC( 0x73b5 ), SHC( 0x735f ), SHC( 0x7307 ), SHC( 0x72af ), SHC( 0x7255 ), SHC( 0x71fa ), SHC( 0x719e ), SHC( 0x7141 ), - SHC( 0x70e2 ), SHC( 0x7083 ), SHC( 0x7023 ), SHC( 0x6fc1 ), SHC( 0x6f5f ), SHC( 0x6efb ), SHC( 0x6e96 ), SHC( 0x6e30 ), - SHC( 0x6dca ), SHC( 0x6d62 ), SHC( 0x6cf9 ), SHC( 0x6c8f ), SHC( 0x6c24 ), SHC( 0x6bb8 ), SHC( 0x6b4a ), SHC( 0x6adc ), - SHC( 0x6a6d ), SHC( 0x69fd ), SHC( 0x698c ), SHC( 0x6919 ), SHC( 0x68a6 ), SHC( 0x6832 ), SHC( 0x67bd ), SHC( 0x6746 ), - SHC( 0x66cf ), SHC( 0x6657 ), SHC( 0x65dd ), SHC( 0x6563 ), SHC( 0x64e8 ), SHC( 0x646c ), SHC( 0x63ef ), SHC( 0x6371 ), - SHC( 0x62f2 ), SHC( 0x6271 ), SHC( 0x61f1 ), SHC( 0x616f ), SHC( 0x60ec ), SHC( 0x6068 ), SHC( 0x5fe3 ), SHC( 0x5f5e ), - SHC( 0x5ed7 ), SHC( 0x5e50 ), SHC( 0x5dc7 ), SHC( 0x5d3e ), SHC( 0x5cb4 ), SHC( 0x5c29 ), SHC( 0x5b9d ), SHC( 0x5b10 ), - SHC( 0x5a82 ), SHC( 0x59f3 ), SHC( 0x5964 ), SHC( 0x58d4 ), SHC( 0x5842 ), SHC( 0x57b0 ), SHC( 0x571d ), SHC( 0x568a ), - SHC( 0x55f5 ), SHC( 0x5560 ), SHC( 0x54ca ), SHC( 0x5433 ), SHC( 0x539b ), SHC( 0x5302 ), SHC( 0x5269 ), SHC( 0x51ce ), - SHC( 0x5133 ), SHC( 0x5097 ), SHC( 0x4ffb ), SHC( 0x4f5e ), SHC( 0x4ebf ), SHC( 0x4e21 ), SHC( 0x4d81 ), SHC( 0x4ce1 ), - SHC( 0x4c3f ), SHC( 0x4b9e ), SHC( 0x4afb ), SHC( 0x4a58 ), SHC( 0x49b4 ), SHC( 0x490f ), SHC( 0x4869 ), SHC( 0x47c3 ), - SHC( 0x471c ), SHC( 0x4675 ), SHC( 0x45cd ), SHC( 0x4524 ), SHC( 0x447a ), SHC( 0x43d0 ), SHC( 0x4325 ), SHC( 0x427a ), - SHC( 0x41ce ), SHC( 0x4121 ), SHC( 0x4073 ), SHC( 0x3fc5 ), SHC( 0x3f17 ), SHC( 0x3e68 ), SHC( 0x3db8 ), SHC( 0x3d07 ), - SHC( 0x3c56 ), SHC( 0x3ba5 ), SHC( 0x3af2 ), SHC( 0x3a40 ), SHC( 0x398c ), SHC( 0x38d8 ), SHC( 0x3824 ), SHC( 0x376f ), - SHC( 0x36ba ), SHC( 0x3604 ), SHC( 0x354d ), SHC( 0x3496 ), SHC( 0x33de ), SHC( 0x3326 ), SHC( 0x326e ), SHC( 0x31b5 ), - SHC( 0x30fb ), SHC( 0x3041 ), SHC( 0x2f87 ), SHC( 0x2ecc ), SHC( 0x2e11 ), SHC( 0x2d55 ), SHC( 0x2c98 ), SHC( 0x2bdc ), - SHC( 0x2b1f ), SHC( 0x2a61 ), SHC( 0x29a3 ), SHC( 0x28e5 ), SHC( 0x2826 ), SHC( 0x2767 ), SHC( 0x26a8 ), SHC( 0x25e8 ), - SHC( 0x2528 ), SHC( 0x2467 ), SHC( 0x23a6 ), SHC( 0x22e5 ), SHC( 0x2223 ), SHC( 0x2161 ), SHC( 0x209f ), SHC( 0x1fdc ), - SHC( 0x1f19 ), SHC( 0x1e56 ), SHC( 0x1d93 ), SHC( 0x1ccf ), SHC( 0x1c0b ), SHC( 0x1b47 ), SHC( 0x1a82 ), SHC( 0x19bd ), - SHC( 0x18f8 ), SHC( 0x1833 ), SHC( 0x176d ), SHC( 0x16a8 ), SHC( 0x15e2 ), SHC( 0x151b ), SHC( 0x1455 ), SHC( 0x138e ), - SHC( 0x12c8 ), SHC( 0x1201 ), SHC( 0x1139 ), SHC( 0x1072 ), SHC( 0x0fab ), SHC( 0x0ee3 ), SHC( 0x0e1b ), SHC( 0x0d53 ), - SHC( 0x0c8b ), SHC( 0x0bc3 ), SHC( 0x0afb ), SHC( 0x0a33 ), SHC( 0x096a ), SHC( 0x08a2 ), SHC( 0x07d9 ), SHC( 0x0710 ), - SHC( 0x0647 ), SHC( 0x057f ), SHC( 0x04b6 ), SHC( 0x03ed ), SHC( 0x0324 ), SHC( 0x025b ), SHC( 0x0192 ), SHC( 0x00c9 ), - SHC( 0x0000 ), SHC( 0xff37 ), SHC( 0xfe6e ), SHC( 0xfda5 ), SHC( 0xfcdc ), SHC( 0xfc13 ), SHC( 0xfb4a ), SHC( 0xfa81 ), - SHC( 0xf9b9 ), SHC( 0xf8f0 ), SHC( 0xf827 ), SHC( 0xf75e ), SHC( 0xf696 ), SHC( 0xf5cd ), SHC( 0xf505 ), SHC( 0xf43d ), - SHC( 0xf375 ), SHC( 0xf2ad ), SHC( 0xf1e5 ), SHC( 0xf11d ), SHC( 0xf055 ), SHC( 0xef8e ), SHC( 0xeec7 ), SHC( 0xedff ), - SHC( 0xed38 ), SHC( 0xec72 ), SHC( 0xebab ), SHC( 0xeae5 ), SHC( 0xea1e ), SHC( 0xe958 ), SHC( 0xe893 ), SHC( 0xe7cd ), - SHC( 0xe708 ), SHC( 0xe643 ), SHC( 0xe57e ), SHC( 0xe4b9 ), SHC( 0xe3f5 ), SHC( 0xe331 ), SHC( 0xe26d ), SHC( 0xe1aa ), - SHC( 0xe0e7 ), SHC( 0xe024 ), SHC( 0xdf61 ), SHC( 0xde9f ), SHC( 0xdddd ), SHC( 0xdd1b ), SHC( 0xdc5a ), SHC( 0xdb99 ), - SHC( 0xdad8 ), SHC( 0xda18 ), SHC( 0xd958 ), SHC( 0xd899 ), SHC( 0xd7da ), SHC( 0xd71b ), SHC( 0xd65d ), SHC( 0xd59f ), - SHC( 0xd4e1 ), SHC( 0xd424 ), SHC( 0xd368 ), SHC( 0xd2ab ), SHC( 0xd1ef ), SHC( 0xd134 ), SHC( 0xd079 ), SHC( 0xcfbf ), - SHC( 0xcf05 ), SHC( 0xce4b ), SHC( 0xcd92 ), SHC( 0xccda ), SHC( 0xcc22 ), SHC( 0xcb6a ), SHC( 0xcab3 ), SHC( 0xc9fc ), - SHC( 0xc946 ), SHC( 0xc891 ), SHC( 0xc7dc ), SHC( 0xc728 ), SHC( 0xc674 ), SHC( 0xc5c0 ), SHC( 0xc50e ), SHC( 0xc45b ), - SHC( 0xc3aa ), SHC( 0xc2f9 ), SHC( 0xc248 ), SHC( 0xc198 ), SHC( 0xc0e9 ), SHC( 0xc03b ), SHC( 0xbf8d ), SHC( 0xbedf ), - SHC( 0xbe32 ), SHC( 0xbd86 ), SHC( 0xbcdb ), SHC( 0xbc30 ), SHC( 0xbb86 ), SHC( 0xbadc ), SHC( 0xba33 ), SHC( 0xb98b ), - SHC( 0xb8e4 ), SHC( 0xb83d ), SHC( 0xb797 ), SHC( 0xb6f1 ), SHC( 0xb64c ), SHC( 0xb5a8 ), SHC( 0xb505 ), SHC( 0xb462 ), - SHC( 0xb3c1 ), SHC( 0xb31f ), SHC( 0xb27f ), SHC( 0xb1df ), SHC( 0xb141 ), SHC( 0xb0a2 ), SHC( 0xb005 ), SHC( 0xaf69 ), - SHC( 0xaecd ), SHC( 0xae32 ), SHC( 0xad97 ), SHC( 0xacfe ), SHC( 0xac65 ), SHC( 0xabcd ), SHC( 0xab36 ), SHC( 0xaaa0 ), - SHC( 0xaa0b ), SHC( 0xa976 ), SHC( 0xa8e3 ), SHC( 0xa850 ), SHC( 0xa7be ), SHC( 0xa72c ), SHC( 0xa69c ), SHC( 0xa60d ), - SHC( 0xa57e ), -}; -#endif - const Word16 fftSineTab640_fx[ 321 ] = {//Q15 SHC( 0x0000 ), SHC( 0x0141 ), SHC( 0x0283 ), SHC( 0x03c4 ), SHC( 0x0506 ), SHC( 0x0647 ), SHC( 0x0789 ), SHC( 0x08ca ), diff --git a/lib_com/swb_tbe_com_fx.c b/lib_com/swb_tbe_com_fx.c index a8c2e28bd..de8dfc459 100644 --- a/lib_com/swb_tbe_com_fx.c +++ b/lib_com/swb_tbe_com_fx.c @@ -7801,9 +7801,6 @@ void prep_tbe_exc_ivas_fx( Word32 L_tmp, Ltemp1, Ltemp2; Word32 tempQ31; Word16 tempQ15; -#if 0 // ndef ADD_IVAS_TBE_CODE - Word16 L_subfr = L_SUBFR; -#endif #ifdef BASOP_NOGLOB_DECLARE_LOCAL Flag Overflow = 0; move32(); diff --git a/lib_com/tcx_utils_fx.c b/lib_com/tcx_utils_fx.c index 7f961f74c..05607f1c2 100644 --- a/lib_com/tcx_utils_fx.c +++ b/lib_com/tcx_utils_fx.c @@ -2199,53 +2199,6 @@ void tcx_get_gain( move16(); } } -#if 0 -void init_TCX_config_dec( /* TEMPORARY */ - TCX_CONFIG_HANDLE hTcxCfg, - Word16 L_frame, - Word16 fscale - , Word16 L_frameTCX - , Word16 fscaleFB -) -{ - /* Initialize the TCX MDCT windows */ - hTcxCfg->tcx_mdct_window_length = extract_l(L_shr(L_mult0(L_LOOK_12k8, fscale), LD_FSCALE_DENOM)); - hTcxCfg->tcx_mdct_window_delay = hTcxCfg->tcx_mdct_window_length; - move16(); - - hTcxCfg->tcx_mdct_window_half_length = extract_l(L_shr(L_mult0(L_LOOK_12k8 - NS2SA(12800, 5000000L), fscale), LD_FSCALE_DENOM)); - - hTcxCfg->tcx_mdct_window_min_length = shr(L_frame, 4); /* 1.25ms */ - hTcxCfg->tcx_mdct_window_trans_length = shr(L_frame, 4); /* 1.25ms */ - - hTcxCfg->tcx5Size = shr(L_frame, 2); /* 5ms */ - - hTcxCfg->tcx_mdct_window_lengthFB = extract_l(L_shr(L_mult0(L_LOOK_12k8, fscaleFB), LD_FSCALE_DENOM)); - hTcxCfg->tcx_mdct_window_delayFB = hTcxCfg->tcx_mdct_window_lengthFB; - move16(); - - hTcxCfg->tcx_mdct_window_half_lengthFB = extract_l(L_shr(L_mult0(L_LOOK_12k8 - NS2SA(12800, 5000000L), fscaleFB), LD_FSCALE_DENOM)); - - hTcxCfg->tcx_mdct_window_min_lengthFB = shr(L_frameTCX, 4); /* 1.25ms */ - hTcxCfg->tcx_mdct_window_trans_lengthFB = shr(L_frameTCX, 4); /* 1.25ms */ - - hTcxCfg->tcx5SizeFB = shr(L_frameTCX, 2); /* 5ms */ - - mdct_window_sine(hTcxCfg->tcx_mdct_window, hTcxCfg->tcx_mdct_window_length); - mdct_window_sine(hTcxCfg->tcx_mdct_window_half, hTcxCfg->tcx_mdct_window_half_length); - mdct_window_sine(hTcxCfg->tcx_mdct_window_minimum, hTcxCfg->tcx_mdct_window_min_length); - mdct_window_sine(hTcxCfg->tcx_mdct_window_trans, hTcxCfg->tcx_mdct_window_trans_length); - - mdct_window_sine(hTcxCfg->tcx_mdct_windowFB, hTcxCfg->tcx_mdct_window_lengthFB); - mdct_window_sine(hTcxCfg->tcx_mdct_window_halfFB, hTcxCfg->tcx_mdct_window_half_lengthFB); - mdct_window_sine(hTcxCfg->tcx_mdct_window_minimumFB, hTcxCfg->tcx_mdct_window_min_lengthFB); - mdct_window_sine(hTcxCfg->tcx_mdct_window_transFB, hTcxCfg->tcx_mdct_window_trans_lengthFB); - - /*ALDO windows for MODE2*/ - mdct_window_aldo(hTcxCfg->tcx_aldo_window_1, hTcxCfg->tcx_aldo_window_1_trunc, hTcxCfg->tcx_aldo_window_2, L_frame); - mdct_window_aldo(hTcxCfg->tcx_aldo_window_1_FB, hTcxCfg->tcx_aldo_window_1_FB_trunc, hTcxCfg->tcx_aldo_window_2_FB, L_frameTCX); -} -#endif void init_TCX_config( TCX_CONFIG_HANDLE hTcxCfg, Word16 L_frame, /*Q0*/ diff --git a/lib_com/tools_fx.c b/lib_com/tools_fx.c index 3580e632e..fdff0ea7b 100644 --- a/lib_com/tools_fx.c +++ b/lib_com/tools_fx.c @@ -3928,7 +3928,6 @@ void hp400_12k8_fx( } #ifndef FIX_805_VERIFICATION -#if 0 void hp400_12k8_ivas_fx( Word16 signal[], /* i/o: input signal / output is divided by 16 */ const Word16 lg, /* i : lenght of signal */ @@ -4004,7 +4003,6 @@ void hp400_12k8_ivas_fx( return; } #endif -#endif Word16 dot_prod_satcontr( const Word16 *x, const Word16 *y, Word16 qx, Word16 qy, Word16 *qo, Word16 len ) { @@ -4232,29 +4230,6 @@ void v_add_fx( } Word16 floor_log_2( Word32 num ) { -#if 0 - return num < 2 ? 0 : num < 4 ? 1 - : num < 8 ? 2 - : num < 16 ? 3 - : num < 32 ? 4 - : num < 64 ? 5 - : num < 128 ? 6 - : num < 256 ? 7 - : num < 512 ? 8 - : num < 1024 ? 9 - : num < 2048 ? 10 - : num < 4096 ? 11 - : num < 8192 ? 12 - : num < 16384 ? 13 - : num < 32768 ? 14 - : num < 65536 ? 15 - : num < 131072 ? 16 - : num < 262144 ? 17 - : num < 524288 ? 18 - : num < 1048576 ? 19 - : num < 2097152 ? 20 - : 21; -#endif IF( num == 0 ) { diff --git a/lib_dec/dec_tcx_fx.c b/lib_dec/dec_tcx_fx.c index 100b49de8..29d4b5e1f 100644 --- a/lib_dec/dec_tcx_fx.c +++ b/lib_dec/dec_tcx_fx.c @@ -767,10 +767,6 @@ void decoder_tcx_fx( pInfoTCXNoise = NULL; if ( st->igf ) { -#if 0 - //pointer changed from 8bit to 16bit -#endif - pInfoTCXNoise = st->hIGFDec->infoTCXNoise_evs; } tcx_noise_filling( x, x_e, tmp1 /* seed */, firstLine, noiseFillingSize, noiseTransWidth, L_frame, noiseTiltFactor, diff --git a/lib_dec/gs_dec_fx.c b/lib_dec/gs_dec_fx.c index 7af4b5c40..2d92427cc 100644 --- a/lib_dec/gs_dec_fx.c +++ b/lib_dec/gs_dec_fx.c @@ -204,12 +204,6 @@ void decod_audio_fx( } } } -#if 0 - if (st_fx->L_frame == L_FRAME16k && nb_subfr == NB_SUBFR) - { - nb_subfr = NB_SUBFR16k; - } -#endif /*---------------------------------------------------------------* * Decode the last band where the adaptive (pitch) contribution is significant *---------------------------------------------------------------*/ @@ -584,9 +578,6 @@ void decod_audio_ivas_fx( /* decode GSC SWB speech flag */ test(); -#if 0 // !defined ADD_LRTD - IF(NE_16(st_fx->coder_type, INACTIVE) && GE_32(st_fx->total_brate, ACELP_13k20)) -#else test(); test(); test(); @@ -595,7 +586,6 @@ void decod_audio_ivas_fx( test(); IF( GE_16( st_fx->GSC_IVAS_mode, 1 ) || ( st_fx->coder_type != INACTIVE && ( ( st_fx->element_mode == EVS_MONO && GE_32( st_fx->total_brate, ACELP_13k20 ) ) || ( st_fx->element_mode > EVS_MONO && GT_32( st_fx->total_brate, MIN_BRATE_GSC_NOISY_FLAG ) && GE_16( st_fx->bwidth, SWB ) && !st_fx->flag_ACELP16k ) ) ) ) -#endif { st_fx->GSC_noisy_speech = (Word16) get_next_indice_fx( st_fx, 1 ); /* Q0 */ move16(); diff --git a/lib_dec/hq_hr_dec_fx.c b/lib_dec/hq_hr_dec_fx.c index 556006121..0b18d677f 100644 --- a/lib_dec/hq_hr_dec_fx.c +++ b/lib_dec/hq_hr_dec_fx.c @@ -374,9 +374,6 @@ void ivas_hq_hr_dec_fx( test(); test(); -#if 0 - IF ( NE_16(*hqswb_clas, HQ_HARMONIC)||NE_16(*hqswb_clas,HQ_HVQ)||flag_dis==0) // TV2VE -> always reset in floating point code, is it OK -#endif { hHQ_core->prev_frm_hfe2 = 0; /*reset*/ move16(); @@ -641,11 +638,6 @@ void hq_hr_dec_fx( move16(); } -#if 0 - test(); - test(); - IF ( NE_16(*hqswb_clas, HQ_HARMONIC)||NE_16(*hqswb_clas,HQ_HVQ)||flag_dis==0) // TV2VE -> always reset in floating point code, is it OK -#endif { hHQ_core->prev_frm_hfe2 = 0; /*reset*/ move16(); diff --git a/lib_dec/ivas_mc_param_dec.c b/lib_dec/ivas_mc_param_dec.c index b9e9137a1..3db20e090 100644 --- a/lib_dec/ivas_mc_param_dec.c +++ b/lib_dec/ivas_mc_param_dec.c @@ -4367,47 +4367,6 @@ void ivas_param_mc_dec_render( } #endif - -/*------------------------------------------------------------------------- - * ivas_param_mc_dec() - * - * Parametric MC decoding process - *------------------------------------------------------------------------*/ - -#if 0 // NO Calling location -void ivas_param_mc_dec( - Decoder_Struct *st_ivas, /* i/o: IVAS decoder handle */ - float *output_f[] /* i/o: synthesized core-coder transport channels/DirAC output */ -) -{ - PARAM_MC_DEC_HANDLE hParamMC; - float Cldfb_RealBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - float Cldfb_ImagBuffer_in[PARAM_MC_MAX_TRANSPORT_CHANS * PARAM_MC_MAX_NSLOTS * CLDFB_NO_CHANNELS_MAX]; - uint16_t nSamplesAsked, nSamplesAvailableNext, nSamplesRendered; - - hParamMC = st_ivas->hParamMC; - assert( hParamMC ); - push_wmops( "param_mc_dec" ); - - /* set some handle pointers to the stack buffers */ - hParamMC->Cldfb_RealBuffer_tc = Cldfb_RealBuffer_in; - hParamMC->Cldfb_ImagBuffer_tc = Cldfb_ImagBuffer_in; - - nSamplesAsked = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / FRAMES_PER_SEC ); - - ivas_param_mc_dec_digest_tc( st_ivas, DEFAULT_JBM_CLDFB_TIMESLOTS, output_f ); - ivas_param_mc_dec_render( st_ivas, nSamplesAsked, &nSamplesRendered, &nSamplesAvailableNext, output_f ); - - /* set handle pointers back to NULL */ - hParamMC->Cldfb_RealBuffer_tc = NULL; - hParamMC->Cldfb_ImagBuffer_tc = NULL; - - pop_wmops(); - return; -} -#endif - - /*------------------------------------------------------------------------- * param_mc_dec_init() * diff --git a/lib_dec/ivas_svd_dec.c b/lib_dec/ivas_svd_dec.c index 801bb9e2b..35ff45986 100644 --- a/lib_dec/ivas_svd_dec.c +++ b/lib_dec/ivas_svd_dec.c @@ -154,17 +154,6 @@ static Word32 maxWithSign_fx( const Word32 a /* Qx */ ); -#if 0 -static void flushToZeroArray_fx( - Word32 arr[MAX_OUTPUT_CHANNELS], - const Word16 length); - -static void flushToZeroMat_fx( - Word32 mat[][MAX_OUTPUT_CHANNELS], - const Word16 m, - const Word16 n ); -#endif - static Word16 BidagonalDiagonalisation_fx( Word32 singularVectors_Left_fx[][MAX_OUTPUT_CHANNELS], /* i/o: left singular vectors (U) singularValues_fx_e*/ Word32 singularValues_fx[MAX_OUTPUT_CHANNELS], /* i/o: singular values vector (S) singularValues_fx_e*/ @@ -2253,26 +2242,7 @@ static float maxWithSign( * *-------------------------------------------------------------------------*/ -#ifdef IVAS_FLOAT_FIXED -#if 0 -static void flushToZeroArray_fx( - Word32 arr[MAX_OUTPUT_CHANNELS], - const Word16 length ) -{ - Word16 i; - - FOR ( i = 0; i < length; ++i ) - { - IF( LT_32(L_abs( arr[i] ), SVD_ZERO_FLUSH_THRESHOLD_FX )) - { - arr[i] = 0; - } - } - - return; -} -#endif -#else +#ifndef IVAS_FLOAT_FIXED static void flushToZeroArray( float arr[MAX_OUTPUT_CHANNELS], const int16_t length ) @@ -2297,30 +2267,7 @@ static void flushToZeroArray( * *-------------------------------------------------------------------------*/ -#ifdef IVAS_FLOAT_FIXED -#if 0 -static void flushToZeroMat_fx( - Word32 mat[][MAX_OUTPUT_CHANNELS], - const Word16 m, - const Word16 n ) -{ - Word16 i, j; - - FOR( i = 0; i < m; ++i ) - { - FOR( j = 0; j < n; ++j ) - { - IF( LT_32( L_abs( mat[i][j] ), SVD_ZERO_FLUSH_THRESHOLD_FX ) ) - { - mat[i][j] = 0; - } - } - } - - return; -} -#endif -#else +#ifndef IVAS_FLOAT_FIXED static void flushToZeroMat( float mat[][MAX_OUTPUT_CHANNELS], const int16_t m, diff --git a/lib_dec/stat_dec.h b/lib_dec/stat_dec.h index 509051c18..19ad7dfae 100644 --- a/lib_dec/stat_dec.h +++ b/lib_dec/stat_dec.h @@ -438,9 +438,6 @@ typedef struct tonalmdctconceal float nFramesLost_float; #endif Word16 nFramesLost; -#if 0 - //Memory ovelap issue -#endif TonalComponentsInfo *pTCI; #ifndef IVAS_FLOAT_FIXED TonalComponentsInfo pTCI1; @@ -2918,10 +2915,6 @@ typedef struct Decoder_State Word16 tec_flag; Word16 tfa_flag; TEC_DEC_HANDLE hTECDec; -#if 0 - //not needed above structure has same variable - TEMPORAL_ENVELOPE_CODING_DECODER_FX tecDec_fx; -#endif /*----------------------------------------------------------------------------------* * IVAS parameters *----------------------------------------------------------------------------------*/ diff --git a/lib_enc/acelp_core_enc.c b/lib_enc/acelp_core_enc.c index 3c47c0e62..b6717e682 100644 --- a/lib_enc/acelp_core_enc.c +++ b/lib_enc/acelp_core_enc.c @@ -117,6 +117,7 @@ ivas_error acelp_core_enc( set16_fx( old_bwe_exc_fx, 0, ( PIT16k_MAX + ( L_FRAME16k + 1 ) + L_SUBFR16k ) * 2 ); set16_fx( old_exc_fx, 0, L_EXC ); set16_fx( Aq, 0, NB_SUBFR16k * ( M + 1 ) ); + set16_fx( syn_fx, 0, L_FRAME16k ); #endif Word16 tilt_code_bck_fx; diff --git a/lib_enc/cng_enc_fx.c b/lib_enc/cng_enc_fx.c index aaede46be..8a6dcee84 100644 --- a/lib_enc/cng_enc_fx.c +++ b/lib_enc/cng_enc_fx.c @@ -2498,9 +2498,6 @@ static void shb_CNG_encod_fx( { /*idx_ener = (int16_t)(0.7f * (0.1f * st->hTdCngEnc->mov_shb_cng_ener / (float)log10(2.0f) + 6.0f) + 0.5f);*/ // PMT("shb_CNG_encod_fx quantization in missing") -#if 0 - idx_ener_fx = shr(add(mult(hTdCngEnc->mov_shb_cng_ener_fx, 9797), 1510), 8); /* Q0 */ -#endif } if ( LT_16( st_fx->bwidth, SWB ) ) @@ -2649,11 +2646,8 @@ static Word16 shb_DTX_fx( att = 0; move16(); // PMT("apply_scale is not implemented") -#if 0 - apply_scale(&att, st->hFdCngEnc->hFdCngCom->CngBandwidth, st->hFdCngEnc->hFdCngCom->CngBitrate, scaleTableStereo, SIZE_SCALE_TABLE_STEREO); -#endif } - else + ELSE { att = 1664; /*6.5 in Q8*/ move16(); diff --git a/lib_enc/decision_matrix_enc_fx.c b/lib_enc/decision_matrix_enc_fx.c index 517a5e2af..10288131a 100644 --- a/lib_enc/decision_matrix_enc_fx.c +++ b/lib_enc/decision_matrix_enc_fx.c @@ -607,11 +607,6 @@ void signalling_enc_fx( move16(); /* retrieve the signalling index */ -#if 0 - start_idx = ++idx; - k = SIG2IND_fx(st_fx->coder_type, st_fx->bwidth, st_fx->sharpFlag, st_fx->rf_mode); - WHILE( NE_32(acelp_sig_tbl[idx], k)) -#else start_idx = ++idx; move16(); IF( EQ_16( st_fx->element_mode, IVAS_CPE_TD ) && EQ_16( st_fx->bwidth, SWB ) && LE_32( st_fx->total_brate, ACELP_9k60 ) ) @@ -625,7 +620,6 @@ void signalling_enc_fx( } WHILE( NE_16( (Word16) acelp_sig_tbl[idx], sig ) ) -#endif { idx++; } diff --git a/lib_enc/dtx_fx.c b/lib_enc/dtx_fx.c index 0797bd032..a052a1196 100644 --- a/lib_enc/dtx_fx.c +++ b/lib_enc/dtx_fx.c @@ -205,14 +205,9 @@ void dtx_ivas_fx( test(); test(); test(); -#if 0 - br_dtx_flag = LE_32( st_fx->total_brate, ACELP_24k40 ) || LT_16( st_fx->lp_noise_fx, LP_NOISE_LV * 256 ) || ( EQ_16( st_fx->element_mode, IVAS_SCE ) && LE_32( st_fx->total_brate, ACELP_32k ) ) || - EQ_16( st_fx->element_mode, IVAS_CPE_DFT ) || ( EQ_16( st_fx->element_mode, IVAS_CPE_MDCT ) && ( LE_32( st_fx->element_brate, IVAS_64k ) || LT_16( st_fx->lp_noise_fx, 15 * 256 ) ) ); -#else br_dtx_flag = ( ( st_fx->element_mode == EVS_MONO ) && LE_32( st_fx->total_brate, MAX_BRATE_DTX_EVS ) ) || ( ( st_fx->element_mode != EVS_MONO ) && LE_32( ivas_total_brate, MAX_BRATE_DTX_IVAS ) ) || LT_16( st_fx->lp_noise_fx, 3840 /*15 in Q8*/ ); -#endif } test(); test(); diff --git a/lib_enc/enc_uv_fx.c b/lib_enc/enc_uv_fx.c index 22e0b8b40..ea88f28b5 100644 --- a/lib_enc/enc_uv_fx.c +++ b/lib_enc/enc_uv_fx.c @@ -53,13 +53,8 @@ void encod_unvoiced_fx( ACELP_CbkCorr g_corr; Word32 gain_code2; Word32 gain_code_vect[2], Ltmp, Ltmp2; -#if 0 - Word16 i_subfr, clip_gain, Q_xn, Q_new_p5, tmp2, j, i; - Word16 exc2[L_SUBFR], index, i_subfr_idx; -#else Word16 i_subfr, Q_xn, Q_new_p5, tmp2, j, i; Word16 index, i_subfr_idx; -#endif acelp_cfg = &( st_fx->acelp_cfg ); SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR; LPD_state_HANDLE hLPDmem = st_fx->hLPDmem; @@ -128,11 +123,7 @@ void encod_unvoiced_fx( * Gain clipping test to avoid unstable synthesis on frame erasure * or in case of floating point encoder & fixed p. decoder *-----------------------------------------------------------------*/ -#if 0 - clip_gain = Mode2_gp_clip(st_fx->voicing_fx, i_subfr, st_fx->coder_type, xn_fx, st_fx->clip_var_fx, L_SUBFR, Q_xn); -#else Mode2_gp_clip( st_fx->voicing_fx, i_subfr, st_fx->coder_type, xn_fx, st_fx->clip_var_fx, L_SUBFR, Q_xn ); -#endif *pt_pitch_fx = L_SUBFR; move16(); /*----------------------------------------------------------------------* @@ -214,11 +205,6 @@ void encod_unvoiced_fx( Ltmp = Mpy_32_16_1( gain_code2, code2[i] ); Ltmp = L_shl( Ltmp, Q_new_p5 ); Ltmp = L_mac( Ltmp, gain_pit_fx, exc_fx[i + i_subfr] ); -#if 0 - BASOP_SATURATE_WARNING_OFF_EVS - exc2[i] = round_fx(L_shl(Ltmp, 1)); - BASOP_SATURATE_WARNING_ON_EVS -#endif Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); Ltmp2 = L_shl( Ltmp2, Q_new_p5 ); Ltmp = L_add( Ltmp, Ltmp2 ); @@ -301,14 +287,9 @@ void encod_unvoiced_ivas_fx( ACELP_CbkCorr g_corr; Word32 gain_code2; Word32 gain_code_vect[2], Ltmp, Ltmp2; -#if 0 - Word16 i_subfr, clip_gain, Q_xn, Q_new_p5, tmp2, j, i; - Word16 exc2[L_SUBFR], index, i_subfr_idx; -#else Word16 i_subfr, Q_xn, Q_new_p5, tmp2, j, i; Word16 index, i_subfr_idx; Word16 unbits_PI; -#endif acelp_cfg = &( st_fx->acelp_cfg ); SC_VBR_ENC_HANDLE hSC_VBR = st_fx->hSC_VBR; LPD_state_HANDLE hLPDmem = st_fx->hLPDmem; @@ -377,11 +358,7 @@ void encod_unvoiced_ivas_fx( * Gain clipping test to avoid unstable synthesis on frame erasure * or in case of floating point encoder & fixed p. decoder *-----------------------------------------------------------------*/ -#if 0 - clip_gain = Mode2_gp_clip(st_fx->voicing_fx, i_subfr, st_fx->coder_type, xn_fx, st_fx->clip_var_fx, L_SUBFR, Q_xn); -#else Mode2_gp_clip( st_fx->voicing_fx, i_subfr, st_fx->coder_type, xn_fx, st_fx->clip_var_fx, L_SUBFR, Q_xn ); -#endif *pt_pitch_fx = L_SUBFR << 6; move16(); /*----------------------------------------------------------------------* @@ -476,11 +453,6 @@ void encod_unvoiced_ivas_fx( #else Ltmp = L_shl( Ltmp, Q_new_p5 ); Ltmp = L_mac( Ltmp, gain_pit_fx, exc_fx[i + i_subfr] ); -#endif -#if 0 - BASOP_SATURATE_WARNING_OFF_EVS - exc2[i] = round_fx(L_shl(Ltmp, 1)); - BASOP_SATURATE_WARNING_ON_EVS #endif Ltmp2 = Mpy_32_16_1( gain_code_vect[j], code_fx[i] ); #ifdef BASOP_NOGLOB diff --git a/lib_enc/eval_pit_contr_fx.c b/lib_enc/eval_pit_contr_fx.c index f295e1736..f557f65bd 100644 --- a/lib_enc/eval_pit_contr_fx.c +++ b/lib_enc/eval_pit_contr_fx.c @@ -763,28 +763,9 @@ Word16 Pit_exc_contribution_len_ivas_fx( /* o : bin wher /* pitch contribution useless - delete all previously written indices belonging to pitch contribution */ FOR( i = TAG_ACELP_SUBFR_LOOP_START; i < TAG_ACELP_SUBFR_LOOP_END; i++ ) { -#if 0 // ndef IVAS_CODE_BITSTREAM - IF( hBstr->ind_list[i].nb_bits != -1 ) - { - hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[i].nb_bits ); - hBstr->ind_list[i].nb_bits = -1; - move16(); - } -#else delete_indice( hBstr, i ); -#endif } - -#if 0 // ndef IVAS_CODE_BITSTREAM - IF( hBstr->ind_list[IND_ES_PRED].nb_bits != -1 ) - { - hBstr->nb_bits_tot = sub( hBstr->nb_bits_tot, hBstr->ind_list[IND_ES_PRED].nb_bits ); - hBstr->ind_list[IND_ES_PRED].nb_bits = -1; - move16(); - } -#else delete_indice( hBstr, i ); -#endif } IF( LT_32( st_fx->core_brate, CFREQ_BITRATE ) ) { diff --git a/lib_enc/find_tilt.c b/lib_enc/find_tilt.c index cb8af8bab..1c6083f5a 100644 --- a/lib_enc/find_tilt.c +++ b/lib_enc/find_tilt.c @@ -329,8 +329,7 @@ void find_tilt_ivas_fx( return; } -#endif // IVAS_FLOAT_FIXED - +#else void find_tilt( const float fr_bands[], /* i : energy in frequency bands */ const float bckr[], /* i : per band background noise energy estimate */ @@ -486,3 +485,4 @@ void find_tilt( return; } +#endif diff --git a/lib_enc/find_wsp.c b/lib_enc/find_wsp.c index 9e1db65a5..2bacbfe6f 100644 --- a/lib_enc/find_wsp.c +++ b/lib_enc/find_wsp.c @@ -45,6 +45,7 @@ * * Compute weighted speech used in open-loop pitch search *-------------------------------------------------------------------*/ +#ifndef IVAS_FLOAT_FIXED void find_wsp( const int16_t L_frame, /* i : length of the frame */ const int16_t L_subfr, /* i : length of subframe */ @@ -92,6 +93,7 @@ void find_wsp( return; } +#else void ivas_find_wsp( const Word16 L_frame, /* i : length of the frame */ const Word16 L_subfr, /* i : length of subframe */ @@ -143,3 +145,4 @@ void ivas_find_wsp( deemph_fx( &wsp_fx[L_frame], tilt_fact, L_look, &tmp_fx ); return; } +#endif diff --git a/lib_enc/frame_spec_dif_cor_rate.c b/lib_enc/frame_spec_dif_cor_rate.c index 0d8c391f4..ba235ad05 100644 --- a/lib_enc/frame_spec_dif_cor_rate.c +++ b/lib_enc/frame_spec_dif_cor_rate.c @@ -46,6 +46,7 @@ * *-------------------------------------------------------------------*/ +#ifndef IVAS_FLOAT_FIXED void frame_spec_dif_cor_rate( float spec_amp[], /* i : spectral amplitude */ float pre_spec_low_dif[], /* i/o: low spectrum different */ @@ -94,3 +95,4 @@ void frame_spec_dif_cor_rate( return; } +#endif diff --git a/lib_enc/gain_enc.c b/lib_enc/gain_enc.c index 02113735a..6cae37364 100644 --- a/lib_enc/gain_enc.c +++ b/lib_enc/gain_enc.c @@ -54,6 +54,7 @@ * Calculation and quantization of average predicted innovation energy to be *---------------------------------------------------------------------*/ +#ifndef IVAS_FLOAT_FIXED void Es_pred_enc( float *Es_pred, /* o : predicited scaled innovation energy */ int16_t *Es_pred_indice, /* o : indice corresponding to above parameter */ @@ -158,7 +159,6 @@ void Es_pred_enc( } -#ifndef IVAS_FLOAT_FIXED /*-------------------------------------------------------------------* * gain_enc_amr_wb() * @@ -297,7 +297,7 @@ void gain_enc_amr_wb( return; } -#endif + /*---------------------------------------------------------------------* * gain_enc_mless() @@ -1045,3 +1045,4 @@ void gain_enc_lbr( return; } +#endif diff --git a/lib_enc/gs_enc_fx.c b/lib_enc/gs_enc_fx.c index 6fd9ae3d8..6c7fc4d1f 100644 --- a/lib_enc/gs_enc_fx.c +++ b/lib_enc/gs_enc_fx.c @@ -837,9 +837,6 @@ void gsc_enc_fx( /*--------------------------------------------------------------------------------------* * Gain quantizaion *--------------------------------------------------------------------------------------*/ -#if 0 - mean_gain = gsc_gainQ_fx(hBstr, Ener_per_bd_iQ, Ener_per_bd_iQ, st_fx->core_brate, st_fx->coder_type, st_fx->bwidth ); -#else i = 0; move16(); WHILE( LT_16( i, SIZE_BRATE_INTERMED_TBL ) ) @@ -858,7 +855,6 @@ void gsc_enc_fx( mean_gain = gsc_gainQ_fx( hBstr, /*st_fX->element_mode, st_fx->idchan,IVAS_CODE*/ Ener_per_bd_iQ, Ener_per_bd_iQ, brate_intermed_tbl[i], st_fx->coder_type, st_fx->bwidth /*, st_fx->L_frame, st_fx->tdm_LRTD_flag, st_fx->core_brate*/ ); -#endif *tmp_noise = mult_r( 320, mean_gain ); /*10 in Q5 lp_gainc in Q3 */ /*--------------------------------------------------------------------------------------* diff --git a/lib_enc/hf_cod_amrwb.c b/lib_enc/hf_cod_amrwb.c index eb4301e5e..03cbad6e3 100644 --- a/lib_enc/hf_cod_amrwb.c +++ b/lib_enc/hf_cod_amrwb.c @@ -42,6 +42,7 @@ #include "rom_com.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*---------------------------------------------------------------------* * Local function prototypes *---------------------------------------------------------------------*/ @@ -338,3 +339,4 @@ static void filt_6k_8k( return; } +#endif diff --git a/lib_enc/hq_classifier_enc.c b/lib_enc/hq_classifier_enc.c index 219e61208..08db72620 100644 --- a/lib_enc/hq_classifier_enc.c +++ b/lib_enc/hq_classifier_enc.c @@ -145,6 +145,7 @@ int16_t hq_classifier_enc( return bits; } #endif +#ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------------------* * peak_avrg_ratio() * @@ -237,6 +238,7 @@ int16_t peak_avrg_ratio( return hqswb_clas; } +#endif #ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------------------* diff --git a/lib_enc/hq_env_enc.c b/lib_enc/hq_env_enc.c index 8c9aa4fa7..2f43d38da 100644 --- a/lib_enc/hq_env_enc.c +++ b/lib_enc/hq_env_enc.c @@ -41,6 +41,7 @@ #include "rom_enc.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------------------------------* * encode_envelope_indices() * @@ -559,3 +560,4 @@ void diff_envelope_coding( return; } +#endif diff --git a/lib_enc/hvq_enc.c b/lib_enc/hvq_enc.c index 5d3ab93bc..a1caa95a8 100644 --- a/lib_enc/hvq_enc.c +++ b/lib_enc/hvq_enc.c @@ -43,6 +43,7 @@ #include "rom_com.h" #include "wmc_auto.h" +#ifndef IVAS_FLOAT_FIXED /*--------------------------------------------------------------------------* * hvq_enc() * @@ -151,3 +152,4 @@ int16_t hvq_enc( return bits_used; } +#endif diff --git a/lib_enc/igf_enc.c b/lib_enc/igf_enc.c index 4b2e2d80b..7d9825db8 100644 --- a/lib_enc/igf_enc.c +++ b/lib_enc/igf_enc.c @@ -354,64 +354,6 @@ static float IGF_getSFM_new( *-------------------------------------------------------------------*/ /*! r: spectral tilt value */ -#if 0 -#ifdef IVAS_FLOAT_FIXED -static Word16 IGF_getTilt_fx( - const Word32 *powerSpectrum, /* i : energies */ - const Word16 start, /* i : start subband index */ - const Word16 stop, /* i : stop subband index */ - Word16 q_powerSpectrum, /*Stores q reated to powerSpectrum*/ - Word16 *slope_e /*stores the exponent of returned slope value*/ -) -{ - Word16 i; - Word16 x; - Word16 width; - Word32 y; - Word32 mean_x, mean_y, mean_xy, mean_x2; - Word32 max_mean_x_e; - Word16 mean_x_e, mean_y_e, mean_xy_e, mean_x2_e; - Word16 slope; - Word16 slope_e; - - x = 1; - mean_x = mean_y = mean_xy = mean_x2 = 0; - move16(); - move32(); - move32(); - move32(); - move32(); - - width = sub( stop, start ); - for ( i = start; i < stop; i++ ) - { - mean_x = L_add( mean_x, x ); /*Q0*/ - mean_x2 = L_add( mean_x2, L_mult0( x, x ) ); /*Q0*/ - y = imult3216( Mult_32_16( L_add( BASOP_Util_Log2( L_max( L_shl( 1, q_powerSpectrum ), powerSpectrum[i] ) ), L_shl( sub( 31, q_powerSpectrum ), Q25 ) ) /*Q25*/, INV_Log2_10_Q15 ) /*Q25*/, 20 ); /*Q25*/ - mean_y = L_add( mean_y, y ); /*Q25*/ - mean_xy = L_add( mean_xy, Mult_32_16( y, x ) ); /*Q25+0-Q15=>Q10*/ - - x = add( x, 1 ); /*Q0*/ - } - mean_y = BASOP_Util_Divide3216_Scale( mean_y, width, &mean_y_e ); - mean_y_e = add( mean_y_e, -9 ) /*6 -15*/; - mean_x = BASOP_Util_Divide3216_Scale( mean_x, width, &mean_x_e ); - mean_x_e = add( mean_x_e, 16 ) /*31 -15*/; - mean_xy = BASOP_Util_Divide3216_Scale( mean_xy, width, mean_xy_e ); - mean_xy_e = add( mean_xy_e, 6 ) /*21 -15*/; - mean_x2 = BASOP_Util_Divide3216_Scale( mean_x2, width, mean_x2_e ); - mean_x2_e = add( mean_x2_e, 16 ) /*31 -15*/; - max_mean_x_e = s_max( mean_x_e, s_max( mean_xy_e, mean_x2_e ) ); - mean_x = shr( mean_x, sub( mean_x_e, max_mean_x_e ) ); /*mean_x_e=max_mean_x_e*/ - mean_xy = shr( mean_xy, sub( mean_xy_e, max_mean_x_e ) ); /*mean_xy_e=max_mean_x_e*/ - mean_x2 = shr( mean_x2, sub( mean_x2_e, max_mean_x_e ) ); /*mean_x2_e=mean_x2_e*/ - slope = BASOP_Util_Divide3232_Scale( L_mult0( extract_l( L_sub( mean_xy, mean_x ) ), extract_l( mean_y ) ) /*max_mean_x_e+mean_y_e*/, L_mult0( extract_l( L_sub( mean_x2, mean_x ) ), extract_l( mean_x ) ) /*2*max_mean_x_e*/, slope_e ); /*q_powerSpectrum-15*/ - *slope_e = add( *slope_e, sub( mean_y_e, max_mean_x_e ) ); - move16(); - return slope; -} -#endif -#endif #ifndef IVAS_FLOAT_FIXED static float IGF_getTilt( const float *powerSpectrum, /* i : energies */ diff --git a/lib_enc/init_enc_fx.c b/lib_enc/init_enc_fx.c index a7b6b402f..73cade783 100644 --- a/lib_enc/init_enc_fx.c +++ b/lib_enc/init_enc_fx.c @@ -968,9 +968,6 @@ void LPDmem_enc_init_fx( move16(); hLPDmem->gc_threshold = 0; move32(); -#if 0 - //set16_fx(hLPDmem->dispMem, 0, 8); -#else hLPDmem->dm_fx.prev_state = 0; move16(); /* This corresponds to st_fx->dispMem in FLP */ hLPDmem->dm_fx.prev_gain_code = 0; @@ -981,7 +978,6 @@ void LPDmem_enc_init_fx( hLPDmem->dm_fx.prev_gain_pit[i - 2] = 0; move16(); } -#endif return; } @@ -1008,9 +1004,6 @@ void LPDmem_enc_init_ivas_fx( move32(); hLPDmem->q_mem_syn = Q15; move16(); -#if 0 - //set16_fx(hLPDmem->dispMem, 0, 8); -#else hLPDmem->dm_fx.prev_state = 0; move16(); /* This corresponds to st_fx->dispMem in FLP */ hLPDmem->dm_fx.prev_gain_code = 0; @@ -1021,7 +1014,6 @@ void LPDmem_enc_init_ivas_fx( hLPDmem->dm_fx.prev_gain_pit[i - 2] = 0; move16(); } -#endif hLPDmem->q_lpd_syn = Q15; move16(); diff --git a/lib_enc/ivas_core_pre_proc.c b/lib_enc/ivas_core_pre_proc.c index de029bdc4..65362dd66 100644 --- a/lib_enc/ivas_core_pre_proc.c +++ b/lib_enc/ivas_core_pre_proc.c @@ -1474,34 +1474,7 @@ ivas_error ivas_compute_core_buffers_fx( Copy_Scale_sig32_16( sig_out, preemp_start_idx, preemp_len, *Q_new ); -#if 0 - Q_exp = sub(*Q_new, st->Q_old); - st->prev_Q_old = st->Q_old; - move16(); - st->Q_old = *Q_new; - move16(); - - /*------------------------------------------------------------------* - * Scaling of memories - *-----------------------------------------------------------------*/ - - Le_min_scaled = Scale_mem_pre_proc(st->ini_frame, Q_exp, Q_new, old_inp_12k8, &(st->mem_wsp_fx), hNoiseEst->enrO_fx, hNoiseEst->bckr_fx, - hNoiseEst->ave_enr_fx, hNoiseEst->ave_enr2_fx, hNoiseEst->fr_bands1_fx, hNoiseEst->fr_bands2_fx, st->Bin_E_old_fx); -#else - // Q_exp = sub(*Q_new, st->prev_Q_new); - // move16(); - // Q_wsp_exp = add(Q_exp, shift_exp); - Scale_sig( old_inp_16k_fx, (Word16) ( preemp_start_idx - old_inp_16k_fx ), *Q_new ); - /*if (st->hLPDmem) { - Scale_mem_enc(Q_exp, old_inp_16k_fx, st->hLPDmem->old_exc, st->hBWE_TD == NULL ? NULL : st->hBWE_TD->old_bwe_exc_fx, &(st->hLPDmem->mem_w0), st->hLPDmem->mem_syn, - st->hLPDmem->mem_syn2, &st->mem_deemp_preQ_fx, st->hGSCEnc == NULL ? NULL : st->hGSCEnc->last_exc_dct_in_fx, st->hBWE_FD == NULL ? NULL : st->hBWE_FD->old_input_lp_fx); - } - else { - Scale_mem_enc(Q_exp, old_inp_16k_fx, NULL, st->hBWE_TD == NULL ? NULL : st->hBWE_TD->old_bwe_exc_fx, NULL, NULL, - NULL, &st->mem_deemp_preQ_fx, st->hGSCEnc == NULL ? NULL : st->hGSCEnc->last_exc_dct_in_fx, st->hBWE_FD == NULL ? NULL : st->hBWE_FD->old_input_lp_fx); - }*/ -#endif } ELSE IF( GT_32( input_Fs, 8000 ) ) /* keep memory up-to-date in case of bitrate switching */ { diff --git a/lib_enc/ivas_cpe_enc.c b/lib_enc/ivas_cpe_enc.c index 5bcf2df8c..6798a87bb 100644 --- a/lib_enc/ivas_cpe_enc.c +++ b/lib_enc/ivas_cpe_enc.c @@ -180,6 +180,7 @@ ivas_error ivas_cpe_enc_fx( set16_zero_fx( fft_buff_fx[i], 2 * L_FFT ); set16_zero_fx( old_inp_16k_16fx[i], L_INP ); set_zero_fx( old_inp_16k_fx[i], L_INP ); + set16_zero_fx( old_inp_12k8_16fx[i], L_INP_12k8 ); } #endif /*------------------------------------------------------------------* diff --git a/lib_enc/ivas_front_vad.c b/lib_enc/ivas_front_vad.c index 5a9496d77..98da900f8 100644 --- a/lib_enc/ivas_front_vad.c +++ b/lib_enc/ivas_front_vad.c @@ -545,7 +545,7 @@ ivas_error front_vad_create( set16_fx( hFrontVad->mem_decim_fx, 0, shl( L_FILT_MAX, 1 ) ); set16_fx( hFrontVad->buffer_12k8_fx, 0, i_mult( 3, shr( L_FRAME, 1 ) ) ); hFrontVad->mem_preemph_fx = 0; - hFrontVad->q_mem_preemph_fx = 0; + hFrontVad->q_mem_preemph_fx = Q15; hFrontVad->q_buffer_12k8 = Q31; hFrontVad->q_mem_decim = Q31; #else @@ -617,6 +617,8 @@ ivas_error front_vad_create_fx( set16_fx( hFrontVad->buffer_12k8_fx, 0, i_mult( 3, shr( L_FRAME, 1 ) ) ); hFrontVad->mem_preemph_fx = 0; move16(); + hFrontVad->q_mem_preemph_fx = Q15; + move16(); hFrontVad->ini_frame = 0; move16(); hFrontVad->hVAD->vad_flag = 1; diff --git a/lib_enc/ivas_ism_enc.c b/lib_enc/ivas_ism_enc.c index 219bab4a5..32b0e9936 100644 --- a/lib_enc/ivas_ism_enc.c +++ b/lib_enc/ivas_ism_enc.c @@ -482,6 +482,13 @@ ivas_error ivas_ism_enc_fx( error = IVAS_ERR_OK; move32(); +#ifdef MSAN_FIX + FOR( i = 0; i < MAX_NUM_OBJECTS; i++ ) + { + set16_zero_fx( old_inp_12k8_fx[i][0], L_INP_12k8 ); + } +#endif + set16_fx( q_re_im_buf, 0, MAX_NUM_OBJECTS ); dtx_flag = 0; diff --git a/lib_enc/ivas_mcmasa_enc.c b/lib_enc/ivas_mcmasa_enc.c index 92ceb710a..48895fdec 100644 --- a/lib_enc/ivas_mcmasa_enc.c +++ b/lib_enc/ivas_mcmasa_enc.c @@ -1621,6 +1621,14 @@ void ivas_mcmasa_param_est_enc_fx( Word16 surroundingCoherence_e[MAX_PARAM_SPATIAL_SUBFRAMES][MASA_FREQUENCY_BANDS]; Word16 numAnalysisChannels; +#ifdef MSAN_FIX + FOR( i = 0; i < MCMASA_MAX_ANA_CHANS; i++ ) + { + set_zero_fx( Chnl_RealBuffer_fx[i], DIRAC_NO_FB_BANDS_MAX ); + set_zero_fx( Chnl_ImagBuffer_fx[i], DIRAC_NO_FB_BANDS_MAX ); + } +#endif + num_freq_bins = idiv1616( input_frame, MDFT_NO_COL_MAX ); num_freq_bands = hMcMasa->nbands; move16(); diff --git a/lib_enc/ivas_mdct_core_enc.c b/lib_enc/ivas_mdct_core_enc.c index 7394e92e0..ad16ade84 100644 --- a/lib_enc/ivas_mdct_core_enc.c +++ b/lib_enc/ivas_mdct_core_enc.c @@ -606,10 +606,17 @@ static void kernel_switch_update_transforms_fx( Word32 factor; n = extract_l( Mpy_32_32( s, 603979776 /* N_ZERO_MDCT_NS / FRAME_SIZE_NS in Q31 */ ) ); - Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), -Q1 ); // Q0 -> Q-1 +#ifdef MSAN_FIX + Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), -Q1 ); // Q0 -> Q-1 +#else + Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), -Q1 ); // Q0 -> Q-1 +#endif wtda_ext_fx( tcxTimeSignal, windowedTimeSignal_16, extract_l( windowedTimeSignal[0] ), extract_l( windowedTimeSignal[1] ), s, kernelType ); // Q-1 - Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), Q1 ); // Q-1 -> Q0 - +#ifdef MSAN_FIX + Scale_sig( &tcxTimeSignal[n - s], add( sub( shl( s, 1 ), n ), 1 ), Q1 ); // Q-1 -> Q0 +#else + Scale_sig( &tcxTimeSignal[n - s], shl( s, 1 ), Q1 ); // Q-1 -> Q0 +#endif Copy_Scale_sig_16_32_no_sat( windowedTimeSignal_16, windowedTimeSignal, s, Q16 ); // Q15 scale_sig32( windowedTimeSignal, s, -Q8 /* guard bits */ ); // Q7 edxt_fx( windowedTimeSignal, sigR, s, kernelType, FALSE ); diff --git a/lib_enc/ivas_rom_enc.c b/lib_enc/ivas_rom_enc.c index 1b222e5ed..ee6fc5bf0 100644 --- a/lib_enc/ivas_rom_enc.c +++ b/lib_enc/ivas_rom_enc.c @@ -380,103 +380,6 @@ const float win_ana_48k[STEREO_DFT_OVL_MAX] = { 0.9993626f, 0.9994536f, 0.9995375f, 0.9996144f, 0.9996844f, 0.9997473f, 0.9998033f, 0.9998523f, 0.9998942f, 0.9999292f, 0.9999572f, 0.9999781f, 0.9999921f, 0.9999991f }; -#if 0 -const Word32 win_ana_8k_fx[STEREO_DFT_OVL_8k] = { - 227468560, 393953952, 508506944, 601521984, 681832704, 753477952, 818704064, 878911808, 935043776, 987769024, 1037582080, 1084861312, 1129901952, 1172940800, - 1214170112, 1253748608, 1291809152, 1328463616, 1363808000, 1397923968, 1430883328, 1462748160, 1493572736, 1523405312, 1552288384, 1580259968, 1607353984, - 1633600512, 1659026944, 1683658112, 1707516160, 1730621440, 1752992000, 1774644864, 1795595264, 1815857024, 1835442688, 1854364416, 1872632832, 1890257664, - 1907248128, 1923612288, 1939358336, 1954493184, 1969022976, 1982954624, 1996292864, 2009043584, 2021211008, 2032799616, 2043813632, 2054256640, 2064132352, - 2073443840, 2082193664, 2090384896, 2098019840, 2105100672, 2111629440, 2117608320, 2123038464, 2127921536, 2132258816, 2136051456, 2139300608, 2142006912, - 2144171136, 2145793792, 2146875264, 2147416064 -}; - -const Word32 win_ana_12k8_fx[STEREO_DFT_OVL_12k8] = { - 179830704, 311465888, 402074208, 475693824, 539315392, 596138048, 647942656, 695842240, 740586368, 782707968, 822602432, 860572480, 896855296, 931641344, 965086016, - 997318016, 1028445376, 1058559552, 1087739136, 1116051968, 1143556992, 1170305792, 1196344064, 1221712512, 1246446976, 1270579968, 1294140160, 1317154176, - 1339645440, 1361635584, 1383144576, 1404190208, 1424788864, 1444955648, 1464704768, 1484048896, 1502999936, 1521569024, 1539766400, 1557601408, 1575083008, - 1592219776, 1609018880, 1625487744, 1641633152, 1657461376, 1672978432, 1688189696, 1703100800, 1717716352, 1732040960, 1746078976, 1759834880, 1773312384, - 1786515072, 1799446400, 1812109568, 1824508160, 1836644608, 1848522112, 1860142976, 1871509888, 1882625280, 1893491328, 1904110208, 1914484096, 1924614528, - 1934503680, 1944153216, 1953565056, 1962740096, 1971680768, 1980387712, 1988862720, 1997106944, 2005121792, 2012908160, 2020467456, 2027800576, 2034908288, - 2041792000, 2048452480, 2054890624, 2061106944, 2067102720, 2072878080, 2078434560, 2083771904, 2088891520, 2093793536, 2098478464, 2102947456, 2107200256, - 2111237504, 2115060096, 2118668032, 2122061952, 2125241984, 2128208512, 2130961920, 2133502464, 2135830272, 2137945984, 2139849344, 2141540736, 2143020288, - 2144288384, 2145344768, 2146189824, 2146823552, 2147246080, 2147457280 -}; - -const Word32 win_ana_16k_fx[STEREO_DFT_OVL_16k] = { - 160845664, 278587264, 359639520, 425504352, 482436064, 533297280, 579682048, 622587072, 662683200, 700448576, 736237504, 770321280, 802913024, 834183808, 864273280, - 893297152, 921352704, 948522688, 974877696, 1000478720, 1025379648, 1049626688, 1073261632, 1096321152, 1118837888, 1140841216, 1162357504, 1183411072, 1204023168, - 1224213888, 1244001152, 1263401344, 1282429952, 1301100672, 1319426432, 1337419136, 1355090048, 1372449024, 1389506048, 1406269824, 1422748544, 1438950016, - 1454881536, 1470549760, 1485961344, 1501122176, 1516037760, 1530713472, 1545154432, 1559365376, 1573350656, 1587114496, 1600660864, 1613993728, 1627116544, - 1640032896, 1652745728, 1665258496, 1677573632, 1689694208, 1701623040, 1713362304, 1724914688, 1736282240, 1747467392, 1758471936, 1769298048, 1779947776, - 1790422656, 1800724736, 1810855296, 1820816128, 1830608896, 1840235008, 1849695744, 1858992384, 1868126336, 1877098880, 1885911168, 1894564352, 1903059456, - 1911397504, 1919579520, 1927606400, 1935479296, 1943199104, 1950766208, 1958182144, 1965447040, 1972561920, 1979527424, 1986344576, 1993013632, 1999535616, - 2005910528, 2012139776, 2018223360, 2024162048, 2029956352, 2035606784, 2041113856, 2046477824, 2051699200, 2056778624, 2061716352, 2066513024, 2071168512, - 2075683584, 2080058624, 2084293760, 2088389248, 2092345728, 2096163072, 2099841920, 2103382272, 2106784512, 2110048896, 2113175680, 2116165120, 2119017216, - 2121732352, 2124310400, 2126751872, 2129056896, 2131225472, 2133258112, 2135154304, 2136914816, 2138539136, 2140028032, 2141381120, 2142598784, 2143680896, - 2144627456, 2145438848, 2146114816, 2146655616, 2147061248, 2147331584, 2147466624 -}; - -const Word32 win_ana_32k_fx[STEREO_DFT_OVL_32k] = { - 113735456, 196994480, 254315968, 300906048, 341188128, 377187904, 410033440, 440430432, 468854304, 495643936, 521050624, 545266688, 568444096, 590704256, 612146432, - 632853120, 652893888, 672327552, 691204736, 709569408, 727459456, 744909056, 761947584, 778601792, 794894912, 810848576, 826481856, 841811904, 856854784, 871624960, - 886135488, 900398464, 914424960, 928225344, 941809216, 955185280, 968361792, 981346368, 994146176, 1006767808, 1019217408, 1031501056, 1043623808, 1055591296, - 1067408256, 1079079168, 1090608384, 1101999872, 1113257856, 1124385664, 1135387008, 1146264960, 1157022720, 1167663488, 1178189824, 1188604672, 1198910464, - 1209109760, 1219204864, 1229197952, 1239091200, 1248886912, 1258586752, 1268192768, 1277706752, 1287130624, 1296465792, 1305713920, 1314876544, 1323955456, - 1332951680, 1341866752, 1350701952, 1359458688, 1368137984, 1376741504, 1385269760, 1393724160, 1402105856, 1410415872, 1418655232, 1426824704, 1434925184, - 1442957824, 1450923520, 1458823040, 1466657024, 1474426624, 1482132224, 1489774848, 1497355136, 1504873856, 1512331648, 1519729024, 1527066880, 1534345728, - 1541565952, 1548728704, 1555834112, 1562882816, 1569875200, 1576812160, 1583694080, 1590521344, 1597294464, 1604013952, 1610680320, 1617293952, 1623855360, - 1630365056, 1636823040, 1643229952, 1649586560, 1655892608, 1662148864, 1668355584, 1674513280, 1680621952, 1686682240, 1692694528, 1698658688, 1704575488, - 1710445184, 1716267904, 1722043904, 1727773824, 1733457664, 1739095552, 1744688128, 1750235264, 1755737472, 1761195136, 1766608256, 1771976960, 1777301888, - 1782582784, 1787820288, 1793014400, 1798165376, 1803273344, 1808338688, 1813361408, 1818341888, 1823280128, 1828176512, 1833031040, 1837843968, 1842615680, - 1847345920, 1852035200, 1856683392, 1861291136, 1865858176, 1870384640, 1874870912, 1879317120, 1883723008, 1888089344, 1892415872, 1896702848, 1900950400, - 1905158528, 1909327744, 1913457536, 1917548544, 1921600768, 1925614208, 1929589248, 1933525504, 1937423616, 1941283328, 1945105024, 1948888704, 1952634496, - 1956342144, 1960012416, 1963644928, 1967239808, 1970797056, 1974317184, 1977800064, 1981245696, 1984654080, 1988025728, 1991360256, 1994657920, 1997918720, - 2001142912, 2004330624, 2007481728, 2010596224, 2013674368, 2016716032, 2019721728, 2022691072, 2025624320, 2028521472, 2031382528, 2034207744, 2036996864, - 2039750400, 2042468096, 2045150080, 2047796352, 2050407296, 2052982400, 2055522176, 2058026368, 2060495360, 2062928896, 2065327104, 2067689984, 2070017920, - 2072310528, 2074567936, 2076790656, 2078978048, 2081130496, 2083248128, 2085330688, 2087378432, 2089391360, 2091369728, 2093312896, 2095221888, 2097095680, - 2098935296, 2100739968, 2102510208, 2104245760, 2105947008, 2107613696, 2109245824, 2110843520, 2112406912, 2113935872, 2115430528, 2116891008, 2118316928, - 2119708800, 2121066368, 2122389632, 2123678592, 2124933504, 2126154368, 2127340928, 2128493440, 2129611904, 2130696064, 2131746432, 2132762624, 2133744896, - 2134692992, 2135607168, 2136487296, 2137333504, 2138145792, 2138924160, 2139668480, 2140378880, 2141055616, 2141698304, 2142307200, 2142882048, 2143422976, - 2143930240, 2144403456, 2144843136, 2145248768, 2145620480, 2145958528, 2146262784, 2146533120, 2146769792, 2146972544, 2147141504, 2147276672, 2147378048, - 2147445632, 2147479296 -}; - -const Word32 win_ana_48k_fx[STEREO_DFT_OVL_MAX] = { - 92864496, 160845664, 207650080, 245693168, 278587264, 307986080, 334811584, 359639520, 382858336, 404744832, 425504352, 445294272, 464238496, 482436064, 499968544, - 516903392, 533297280, 549198336, 564648000, 579682048, 594332224, 608625856, 622587072, 636237760, 649597248, 662683200, 675511168, 688095232, 700448576, 712582976, - 724509248, 736237504, 747776576, 759135232, 770321280, 781341760, 792203520, 802913024, 813475840, 823897792, 834183808, 844338624, 854367104, 864273280, 874061056, - 883734592, 893297152, 902752320, 912103104, 921352704, 930504256, 939559936, 948522688, 957395008, 966179328, 974877696, 983492352, 992025344, 1000478720, - 1008854528, 1017154112, 1025379648, 1033532352, 1041614400, 1049626688, 1057571264, 1065449088, 1073261632, 1081010432, 1088696448, 1096321152, 1103885440, - 1111390592, 1118837888, 1126228096, 1133562112, 1140841216, 1148066176, 1155238016, 1162357504, 1169425792, 1176443264, 1183411072, 1190329728, 1197200256, - 1204023168, 1210799360, 1217529344, 1224213888, 1230853632, 1237449216, 1244001152, 1250510208, 1256976768, 1263401344, 1269784960, 1276127616, 1282429952, - 1288692736, 1294916096, 1301100672, 1307246976, 1313355520, 1319426432, 1325460352, 1331457920, 1337419136, 1343344640, 1349234816, 1355090048, 1360910592, - 1366696832, 1372449024, 1378168064, 1383853440, 1389506048, 1395126272, 1400713984, 1406269824, 1411793920, 1417286784, 1422748544, 1428179456, 1433579776, - 1438950016, 1444290176, 1449600640, 1454881536, 1460133248, 1465355904, 1470549760, 1475715328, 1480852352, 1485961344, 1491042560, 1496096000, 1501122176, - 1506120960, 1511092736, 1516037760, 1520956160, 1525847936, 1530713472, 1535553024, 1540366592, 1545154432, 1549916928, 1554653568, 1559365376, 1564052096, - 1568713600, 1573350656, 1577963008, 1582550912, 1587114496, 1591653888, 1596169344, 1600660864, 1605128704, 1609573120, 1613993728, 1618391296, 1622765568, - 1627116544, 1631444864, 1635750272, 1640032896, 1644292992, 1648530688, 1652745728, 1656938880, 1661109504, 1665258496, 1669385344, 1673490432, 1677573632, - 1681635328, 1685675648, 1689694208, 1693691776, 1697668096, 1701623040, 1705557120, 1709470208, 1713362304, 1717233792, 1721084416, 1724914688, 1728724352, - 1732513408, 1736282240, 1740030848, 1743759104, 1747467392, 1751155456, 1754823552, 1758471936, 1762100352, 1765709184, 1769298048, 1772867584, 1776417408, - 1779947776, 1783458816, 1786950400, 1790422656, 1793875712, 1797309824, 1800724736, 1804120576, 1807497216, 1810855296, 1814194432, 1817514624, 1820816128, - 1824099072, 1827363456, 1830608896, 1833836160, 1837044736, 1840235008, 1843406848, 1846560384, 1849695744, 1852812800, 1855911680, 1858992384, 1862055168, - 1865099648, 1868126336, 1871135104, 1874125952, 1877098880, 1880054016, 1882991616, 1885911168, 1888813184, 1891697536, 1894564352, 1897413504, 1900245120, - 1903059456, 1905856128, 1908635520, 1911397504, 1914142208, 1916869504, 1919579520, 1922272256, 1924948096, 1927606400, 1930247808, 1932872064, 1935479296, - 1938069632, 1940642688, 1943199104, 1945738240, 1948260736, 1950766208, 1953254912, 1955726848, 1958182144, 1960620416, 1963042048, 1965447040, 1967835264, - 1970206976, 1972561920, 1974900224, 1977222144, 1979527424, 1981816192, 1984088704, 1986344576, 1988584064, 1990807168, 1993013632, 1995203840, 1997377792, - 1999535616, 2001676800, 2003801984, 2005910528, 2008003328, 2010079744, 2012139776, 2014183808, 2016211584, 2018223360, 2020219008, 2022198656, 2024162048, - 2026109568, 2028041088, 2029956352, 2031855872, 2033739392, 2035606784, 2037458432, 2039294080, 2041113856, 2042917504, 2044705536, 2046477824, 2048233984, - 2049974528, 2051699200, 2053408128, 2055101312, 2056778624, 2058440448, 2060086272, 2061716352, 2063331072, 2064929920, 2066513024, 2068080384, 2069632384, - 2071168512, 2072689152, 2074194304, 2075683584, 2077157632, 2078615808, 2080058624, 2081485952, 2082897408, 2084293760, 2085674368, 2087039488, 2088389248, - 2089723392, 2091042432, 2092345728, 2093633536, 2094905984, 2096163072, 2097404800, 2098630912, 2099841920, 2101037440, 2102217472, 2103382272, 2104531840, - 2105665920, 2106784512, 2107888128, 2108976256, 2110048896, 2111106560, 2112148736, 2113175680, 2114187520, 2115184000, 2116165120, 2117131136, 2118081792, - 2119017216, 2119937408, 2120842368, 2121732352, 2122606720, 2123466240, 2124310400, 2125139456, 2125953152, 2126751872, 2127535488, 2128303872, 2129056896, - 2129795072, 2130517888, 2131225472, 2131918208, 2132595584, 2133258112, 2133905280, 2134537344, 2135154304, 2135756288, 2136342912, 2136914816, 2137471232, - 2138012800, 2138539136, 2139050496, 2139546752, 2140028032, 2140494208, 2140945152, 2141381120, 2141802112, 2142207872, 2142598784, 2142974592, 2143335168, - 2143680896, 2144011392, 2144327040, 2144627456, 2144913152, 2145183488, 2145438848, 2145679360, 2145904640, 2146114816, 2146310272, 2146490496, 2146655616, - 2146805888, 2146940928, 2147061248, 2147166464, 2147256448, 2147331584, 2147391744, 2147436672, 2147466624, 2147481728 -}; -#endif - const Word16 win_ana_8k_fx[STEREO_DFT_OVL_8k] = { 3471, 6011, 7759, 9178, 10404, 11497, 12492, 13411, 14268, 15072, 15832, 16554, 17241, 17898, 18527, 19131, 19711, 20271, 20810, 21331, 21834, 22320, 22790, 23245, 23686, 24113, 24526, 24927, 25315, 25691, 26055, 26407, 26749, 27079, 27399, diff --git a/lib_enc/ivas_sce_enc.c b/lib_enc/ivas_sce_enc.c index fb4c88fe1..7f760cdc9 100644 --- a/lib_enc/ivas_sce_enc.c +++ b/lib_enc/ivas_sce_enc.c @@ -122,6 +122,11 @@ ivas_error ivas_sce_enc_fx( /*------------------------------------------------------------------* * Initialization - general *-----------------------------------------------------------------*/ + +#ifdef MSAN_FIX + set16_zero_fx( old_inp_12k8_fx[0], L_INP_12k8 ); +#endif + Copy32( data_fx, st->input32_fx, input_frame ); // Q(q_data_fx) q_input = sub( add( L_norm_arr( st->input32_fx, input_frame ), q_data_fx ), 16 ); diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index 3f668f8df..60704d0d7 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -54,19 +54,6 @@ *--------------------------------------------------------------------*/ static ivas_error ivas_spar_enc_process_fx( Encoder_Struct *st_ivas, const ENCODER_CONFIG_HANDLE hEncoderConfig, BSTR_ENC_HANDLE hMetaData, const Word16 front_vad_flag, Word32 *data_fx[], const Word16 q_data ); -#if 0 -static Word16 Q_factor_L_abs( float x ); -#endif - -#if 0 -Word16 Q_factor_L_abs( float x ) -{ - Word16 Q = 31; - if ( x >= 1 || x <= -1 ) - Q = norm_l( L_abs( (Word32) x ) ); - return Q; -} -#endif /*------------------------------------------------------------------------- * ivas_spar_enc_open() diff --git a/lib_enc/ivas_stereo_switching_enc.c b/lib_enc/ivas_stereo_switching_enc.c index 5f00f3e35..7b30c3f87 100644 --- a/lib_enc/ivas_stereo_switching_enc.c +++ b/lib_enc/ivas_stereo_switching_enc.c @@ -599,6 +599,10 @@ ivas_error stereo_memory_enc_fx( } fd_bwe_enc_init_fx( st->hBWE_FD ); +#ifdef MSAN_FIX + st->Q_old_wtda = 0; + move16(); +#endif } /* allocate stereo CNG structure */ diff --git a/lib_enc/ivas_stereo_td_enc.c b/lib_enc/ivas_stereo_td_enc.c index a17403e3f..d80e2bf6f 100644 --- a/lib_enc/ivas_stereo_td_enc.c +++ b/lib_enc/ivas_stereo_td_enc.c @@ -425,6 +425,10 @@ ivas_error stereo_set_tdm_fx( } fd_bwe_enc_init_fx( st->hBWE_FD ); +#ifdef MSAN_FIX + st->Q_old_wtda = 0; + move16(); +#endif } } diff --git a/lib_enc/lsf_enc_fx.c b/lib_enc/lsf_enc_fx.c index 8cc57eb2d..af1dbd1bd 100644 --- a/lib_enc/lsf_enc_fx.c +++ b/lib_enc/lsf_enc_fx.c @@ -81,9 +81,6 @@ void lsf_enc_fx( Word16 int_fs; Word16 force_sf = 0; Word16 fec_lsf[M], stab, i; -#if 0 - Word16 no_param_lpc; -#endif #ifdef REMOVE_IVAS_UNUSED_PARAMETERS_WARNING (void) tdm_low_rate_mode; #endif @@ -112,9 +109,6 @@ void lsf_enc_fx( move16(); } -#if 0 - no_param_lpc = 0; -#endif move16(); IF( st_fx->Opt_SC_VBR ) @@ -133,19 +127,9 @@ void lsf_enc_fx( } /* initialize */ -#if 0 - int_fs = INT_FS_16k_FX; - move16(); - if( EQ_16(L_frame, L_FRAME)) - { - int_fs = INT_FS_FX; - move16(); - } -#else assert( st_fx->sr_core <= 32000 ); int_fs = extract_l( st_fx->sr_core ); move32(); -#endif /* convert LSPs to LSFs */ lsp2lsf_fx( lsp_new, lsf_new, M, int_fs ); @@ -3686,9 +3670,6 @@ static void lsf_mid_enc_ivas_fx( Word16 lsf[M], qlsf[M], qlsf1[M], qlsf0[M], wghts[M]; Word32 err, err_min; Word16 j, k, idx, size = 0; -#if 0 - Word32 Bin_Ener_mid[L_FFT/2]; -#endif Word32 L_tmp; Word16 tmp, k1; const Word16 *ratio = NULL; diff --git a/lib_enc/pit_enc_fx.c b/lib_enc/pit_enc_fx.c index 609e24343..6c5403343 100644 --- a/lib_enc/pit_enc_fx.c +++ b/lib_enc/pit_enc_fx.c @@ -500,9 +500,6 @@ Word16 pit_encode_ivas_fx( /* o : Fractional Word16 pit_flag, delta, mult_Top, nBits; Word16 L_sufr_sft; Word16 T_op[2]; /* values for two half-frames */ -#if 0 // def REMOVE_IVAS_UNUSED_PARAMETERS_WARNING - (void) tdm_Pitch_reuse_flag; -#endif L_sufr_sft = 6; move16(); diff --git a/lib_enc/sig_clas_fx.c b/lib_enc/sig_clas_fx.c index 96d244783..5bed2d3c9 100644 --- a/lib_enc/sig_clas_fx.c +++ b/lib_enc/sig_clas_fx.c @@ -247,27 +247,6 @@ Word16 signal_clas_fx( /* o : classification for current BREAK; } } -#if 0 - /* set flag for unvoiced class, it will be used in sp/mus classifier */ - * uc_clas = clas; - move16(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - test(); - if (((EQ_16(*coder_type, UNVOICED)) || - (NE_16(st->input_bwidth, NB) && LT_16(fmerit1, 13435) && GT_16(st->mold_corr_fx, 21299)) || /* WB case */ - (EQ_16(st->input_bwidth, NB) && LT_16(mult_r(fmerit1, 28836), 13435) && GT_16(st->mold_corr_fx, 18022))) && /* NB case */ - GT_16(relE, -3840) && LT_16(st->lt_dec_thres_fx, 768)) /* to compute unvoiced on frame that tends to speech */ - { - *uc_clas = UNVOICED_CLAS; - move16(); - } -#endif /* Onset classification */ /* tc_cnt == -1: frame after TC frame in continuous block of GC/VC frames */ diff --git a/lib_enc/speech_music_classif_fx.c b/lib_enc/speech_music_classif_fx.c index 89aacf215..9ce07aff1 100644 --- a/lib_enc/speech_music_classif_fx.c +++ b/lib_enc/speech_music_classif_fx.c @@ -247,41 +247,6 @@ void speech_music_clas_init_fx( move16(); -#if 0 /*IVAS_CODE*/ - set_f(hSpMusClas->FV_st, 0.0f, N_SMC_FEATURES); //?? - for (i = 0; i < N_SMC_FEATURES; i++) - { - hSpMusClas->prev_FV[i] = 0.5f * hout_intervals[2 * i] + 0.5f * hout_intervals[2 * i + 1]; - } - hSpMusClas->past_epsP = 0; - hSpMusClas->wrise = 0.0f; - hSpMusClas->wdlp_xtalk = 0.0f; - //float past_dlp_mean_ST[HANG_LEN - 1]; /* Speech/music classifier - buffer of past non-binary decisions (with ST smoothing) */ - hSpMusClas->dlp_mean_ST = 0.0f; - hSpMusClas->flag_spitch_cnt = 0; - hSpMusClas->dlp_mean_LT = 0.0f; - hSpMusClas->dlp_var_LT = 0.0f; - hSpMusClas->relE_attack_cnt = 0; - hSpMusClas->prev_relE = 0.0f; - hSpMusClas->prev_Etot = 0.0f; - hSpMusClas->prev_vad = 0; - hSpMusClas->vad_0_1_cnt = 0; - hSpMusClas->relE_attack_sum = 0; - - set_f(hSpMusClas->finc_prev, 0.0f, ATT_NSEG); - hSpMusClas->lt_finc = 0.0f; - hSpMusClas->last_strong_attack = 0; - set_f(hSpMusClas->tod_lt_Bin_E, 0.0f, TOD_NSPEC); - set_f(hSpMusClas->tod_S_map_lt, 0.0f, TOD_NSPEC); - hSpMusClas->tod_thr_lt = TOD_THR_MASS; - hSpMusClas->tod_weight = 0.0f; - hSpMusClas->tod_S_mass_prev = 0.0f; - hSpMusClas->tod_S_mass_lt = 0.0f; - hSpMusClas->tdm_lt_Etot = 0.01f; - hSpMusClas->lpn = 0.0f; -#endif - - return; } diff --git a/lib_enc/stat_enc.h b/lib_enc/stat_enc.h index dcc876400..e61931e49 100644 --- a/lib_enc/stat_enc.h +++ b/lib_enc/stat_enc.h @@ -1371,9 +1371,6 @@ typedef struct sc_vbr_enc_structure int16_t vbr_generic_ho; int16_t Local_VAD; int16_t last_7k2_coder_type; -#if 0 - Word16 frame_cnt_ratewin_fx; /* keep count of how many ratewin (600) windows. global_frame_cnt is used instead */ -#endif } SC_VBR_ENC_DATA, *SC_VBR_ENC_HANDLE; @@ -1449,9 +1446,6 @@ typedef struct td_bwe_enc_structure Word16 prev_enr_EnvSHBres_e; Word16 prev_shb_env_tilt_fx; /* tilt of the residual SHB envelope from the previous frame Q(prev_Q_shb) */ Word16 prev_Q_shb; -#if 0 - Word16 prev_pow_exc16kWhtnd_fx; /* power of the LB excitation signal in the previous frame */ -#endif Word32 prev_pow_exc16kWhtnd_fx32; /* Use this power of the LB excitation signal in the previous frame Q0 */ Word16 prev_mix_factor_fx; /* mixing factor in the previous frame Q15 */ Word16 prev_Env_error_fx; /* error in SHB envelope modelling Q0 */ diff --git a/lib_enc/swb_pre_proc.c b/lib_enc/swb_pre_proc.c index b30150ead..ce5a27452 100644 --- a/lib_enc/swb_pre_proc.c +++ b/lib_enc/swb_pre_proc.c @@ -621,18 +621,12 @@ void swb_pre_proc_ivas_fx( CldfbHB_fx = EPSILON_FX; move32(); } - CldfbHB_fx = L_shl( CldfbHB_fx, exp ); /* CldfbHB_ener = CldfbHB_fl*2^(exp) */ -#if 0 - Cldfbtemp1 = ( Log2_norm_lc( CldfbHB_fx ) ); - Cldfbtemp1 = add( shr( Cldfbtemp1, 6 ), shl( sub( 30, sub( exp, 2 ) ), 9 ) ); /* Log2_norm_lc(CldfbHB_ener) = 2^15*(log2(CldfbHB_ener/2^30)) = 2^15*(log2(CldfbHB_fl*(2^-2)*2^exp/2^30)) = 2^15*(log2(CldfbHB_fl) + exp-2-30) => 2^(-6)*l2nc + 2^9(20-(exp-2)) = 2^9*log2(CldfbHB_fl), Q9 */ - CldfbHB_fx = L_mult( sub( Cldfbtemp1, 1741 /*3.401 Q9*/ ), 3495 ); /* 3495 = Q19 log10(2)*0.1/log10(32768), Q = 19+9+1 = 29 */ -#else + CldfbHB_fx = L_shl( CldfbHB_fx, exp ); /* CldfbHB_ener = CldfbHB_fl*2^(exp) */ Cldfbtemp1 = Log2_norm_lc( CldfbHB_fx ); /* Log2_norm_lc(t) = 2^15*(log2(t/2^30)) */ Cldfbtemp1 = sub( shr( Cldfbtemp1, 6 ), shl( add( sub( Q31 - Q30, CldfbHB_fx_e ), exp ), 9 ) ); CldfbHB_fx = L_mult( Cldfbtemp1, 9864 ); /* Q9 + Q15 + Q1 = Q25 */ CldfbHB_fx = Mpy_32_16_1( L_sub( CldfbHB_fx, 1 << Q25 ), 11611 /* 0.1 * 0.221462 in Q19 */ ); /* Resulting Q = Q25 + Q19 - Q15 = Q29 */ -#endif hBWE_TD->cldfbHBLT = mac_r( CldfbHB_fx, 29491 /*0.9 Q15*/, hBWE_TD->cldfbHBLT ); /* cldfbHBLT is in Q13 */ move16(); @@ -720,18 +714,12 @@ void swb_pre_proc_ivas_fx( } CldfbHB_fx_e = sub( Q31, shl( sub( q_reImBuffer, Q16 ), 1 ) ); exp = norm_l( CldfbHB_fx ); - CldfbHB_fx = L_shl( CldfbHB_fx, exp ); /* CldfbHB_ener = CldfbHB_fl*2^(exp) */ -#if 0 - Cldfbtemp1 = ( Log2_norm_lc( CldfbHB_fx ) ); - Cldfbtemp1 = add( shr( Cldfbtemp1, 6 ), shl( sub( 30, sub( exp, 2 ) ), 9 ) ); /* Log2_norm_lc(CldfbHB_ener) = 2^15*(log2(CldfbHB_ener/2^30)) = 2^15*(log2(CldfbHB_fl*(2^-2)*2^exp/2^30)) = 2^15*(log2(CldfbHB_fl) + exp-2-30) => 2^(-6)*l2nc + 2^9(20-(exp-2)) = 2^9*log2(CldfbHB_fl), Q9 */ - CldfbHB_fx = L_mult( sub( Cldfbtemp1, 1741 /*3.401 Q9*/ ), 3495 ); /* 3495 = Q19 log10(2)*0.1/log10(32768), Q = 19+9+1 = 29 */ -#else - Cldfbtemp1 = Log2_norm_lc( CldfbHB_fx ); /* Log2_norm_lc(t) = 2^15*(log2(t/2^30)) */ + CldfbHB_fx = L_shl( CldfbHB_fx, exp ); /* CldfbHB_ener = CldfbHB_fl*2^(exp) */ + Cldfbtemp1 = Log2_norm_lc( CldfbHB_fx ); /* Log2_norm_lc(t) = 2^15*(log2(t/2^30)) */ Cldfbtemp1 = sub( shr( Cldfbtemp1, 6 ), shl( add( sub( Q31 - Q30, CldfbHB_fx_e ), exp ), 9 ) ); CldfbHB_fx = L_mult( Cldfbtemp1, 9864 ); /* Q9 + Q15 + Q1 = Q25 */ CldfbHB_fx = Mpy_32_16_1( L_sub( CldfbHB_fx, 1 << Q25 ), 11611 /* 0.1 * 0.221462 in Q19 */ ); /* Resulting Q = Q25 + Q19 - Q15 = Q29 */ -#endif hBWE_TD->cldfbHBLT = mac_r( CldfbHB_fx, 29491 /*0.9 Q15*/, hBWE_TD->cldfbHBLT ); /* cldfbHBLT is in Q13 */ move32(); diff --git a/lib_enc/tcx_utils_enc_fx.c b/lib_enc/tcx_utils_enc_fx.c index ee08dd9ad..5f29f02fd 100644 --- a/lib_enc/tcx_utils_enc_fx.c +++ b/lib_enc/tcx_utils_enc_fx.c @@ -3612,69 +3612,3 @@ void attenuateNbSpectrum_fx( Word16 L_frame, Word32 *spectrum ) att = mult_r( att, att ); } } - -#if 0 -void mdct_preShaping_fx( - Word16 x[], - const Word16 lg, - const Word16 gains[] ) -{ - Word16 i, j, k, l; - Word16 g; - Word16 m, n, k1, k2; - - j = 0; /* not counted, is included in ptr init */ - /* FDNS_NPTS = 64 !!! */ - k = idiv1616( lg, FDNS_NPTS ); - m = lg % FDNS_NPTS; - move16(); - IF( m ) - { - IF( LE_16( m, ( FDNS_NPTS / 2 ) ) ) - { - n = idiv1616( FDNS_NPTS, m ); - k1 = k; - move16(); - k2 = add( k, 1 ); - } - ELSE - { - n = idiv1616( FDNS_NPTS, sub( FDNS_NPTS, m ) ); - k1 = add( k, 1 ); - k2 = k; - } - FOR( i = 0; i < lg; ) - { - IF( j % n ) - { - k = k1; - } - ELSE - { - k = k2; - } - g = 1.f / gains[j++]; // Q15 - - /* Limit number of loops, if end is reached */ - k = min( k, lg - i ); - FOR( l = 0; l < k; l++ ) - { - x[i++] = mult( x[i++], g ); - } - } - } - ELSE - { - FOR( i = 0; i < lg; ) - { - g = 1.f / gains[j++]; // Q15 - FOR( l = 0; l < k; l++ ) - { - x[i++] = mult( x[i++], g ); - } - } - } - - return; -} -#endif diff --git a/lib_util/test_fft.c b/lib_util/test_fft.c index 51c824a1b..5c0e2b33f 100644 --- a/lib_util/test_fft.c +++ b/lib_util/test_fft.c @@ -49,784 +49,3 @@ #ifndef max #define max( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) ) #endif - -#if 0 -extern const float fftSineTab640[321]; - -void DoFFT_fx( - Word32 *re2, - Word32 *im2, - const Word16 length ); - -void DoFFT( - float *re2, - float *im2, - const int16_t length ); - -void fft_fx( - Word32 *re, /* i/o: real part */ - Word32 *im, /* i/o: imag part */ - const int16_t length, /* i : length of fft */ - const int16_t s /* i : sign */ -); - -void fft( - float *re, /* i/o: real part */ - float *im, /* i/o: imag part */ - const int16_t length, /* i : length of fft */ - const int16_t s /* i : sign */ -); - -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 */ -); - -void ifft_rel( - float x[], /* i/o: input/output vector */ - const int16_t n, /* i : vector length */ - const int16_t m /* i : log2 of vector length */ -); - -void fft_rel_fx( - Word16 x[], /* i/o: input/output vector */ - const Word16 n, /* i : vector length */ - const Word16 m /* i : log2 of vector length */ -); - -void fft3_fx_ivas( - const Word32 X[], - Word32 Y[], - const Word16 n ); - -void fft3( - const float X[], - float Y[], - const int16_t n ); - -void ifft3_fx_ivas( - const Word32 X[], - Word32 Y[], - const Word16 n ); - -void ifft3( - const float X[], /* i : input frame */ - float Y[], /* o : iDFT of input frame */ - const int16_t n /* i : block length (must be radix 3) */ -); - -void run_fft_unit_test( void ); - -extern const Word16 fftSineTab640_fx[321]; - -void fft_rel_fx32( - Word32 x[], /* i/o: input/output vector */ - const Word16 n, /* i : vector length */ - const Word16 m /* i : log2 of vector length */ -); - -void fft_rel_fx32( - Word32 *x, /* i/o: input/output vector */ - const Word16 n, /* i : vector length */ - const Word16 m /* i : log2 of vector length */ -); -void ifft_rel_fx32( - Word32 x[], /* i/o: input/output vector */ - const Word16 n, /* i : vector length */ - const Word16 m /* i : log2 of vector length */ -); - -void fft_cldfb( - float *data, /* i/o: input/output vector */ - const int16_t size /* size of fft operation */ -); - -void fft_cldfb_fx( - Word32 *data, /* i/o: input/output vector */ - const int16_t size /* size of fft operation */ -); - -int16_t RFFTN( - float *afftData, - const float *trigPtr, - const int16_t len, - const int16_t isign ); - -int16_t RFFTN_fx( - Word32 *data, - const Word16 *sine_table, - const Word16 len, - const Word16 sign ); - -void BASOP_cfft( - float *re, /* i/o: real part */ - float *im, /* i/o: imag part */ - Word16 s, /* i : stride real and imag part */ - Word16 *scale /* i : scalefactor */ -); - -void BASOP_cfft_fx( - Word32 *re, /* i/o: real part */ - Word32 *im, /* i/o: imag part */ - Word16 s, /* i : stride real and imag part */ - Word16 *scale /* i : scalefactor */ -); - -void populate_input_interleave( Word32 *in32, float *fIn, Word16 N ); -void populate_input_interleave_16( Word16 *in16, float *fIn, Word16 N ); - -#define print_output( fRe, fIm, iRe, iIm ) \ - printf( "Real = %.2f %d Imag = %.2f %d\n", fRe, iRe, fIm, iIm ) - -#define TYPE_DoFFT ( 0 ) -#define TYPE_fft ( 1 ) -#define TYPE_fft_rel ( 2 ) -#define TYPE_fft_rel32 ( 3 ) -#define TYPE_ifft_rel32 ( 4 ) -#define TYPE_fft_cldfb ( 5 ) -#define TYPE_fft_RFFTN ( 6 ) -#define TYPE_fft_fft3 ( 7 ) -#define TYPE_fft_ifft3 ( 8 ) -#define TYPE_BASOP_cfft ( 9 ) - -static Word16 find_guarded_bits_fx( Word32 n ) -{ - return n <= 1 ? 0 : n <= 2 ? 1 - : n <= 4 ? 2 - : n <= 8 ? 3 - : n <= 16 ? 4 - : n <= 32 ? 5 - : n <= 64 ? 6 - : n <= 128 ? 7 - : n <= 256 ? 8 - : n <= 512 ? 9 - : n <= 1024 ? 10 - : 11; -} - -static Word16 L_norm_arr( Word32 *arr, int size ) -{ - Word16 q = 31; - for ( int i = 0; i < size; i++ ) - if ( arr[i] != 0 ) - { - q = min( q, norm_l( arr[i] ) ); - } - return q; -} - -static Word16 norm_arr( Word16 *arr, int size ) -{ - Word16 q = 15; - for ( int i = 0; i < size; i++ ) - if ( arr[i] != 0 ) - { - q = min( q, norm_s( arr[i] ) ); - } - return q; -} - - -void populate_input_interleave( Word32 *in32, float *fIn, Word16 N ) -{ - Word32 max_val_in = 0; - Word16 r_shift, l_shift; - do - { - srand( N ); - for ( int i = 0; i < N; i++ ) - { - in32[2 * i + 0] = rand(); - in32[2 * i + 1] = rand(); - if ( max_val_in < abs( in32[2 * i + 0] ) ) - max_val_in = abs( in32[2 * i + 0] ); - if ( max_val_in < abs( in32[2 * i + 1] ) ) - max_val_in = abs( in32[2 * i + 1] ); - fIn[2 * i + 0] = (float) in32[2 * i + 0]; - fIn[2 * i + 1] = (float) in32[2 * i + 1]; - } - } while ( max_val_in == 0 ); - r_shift = find_guarded_bits_fx( 2 * N ); - l_shift = L_norm_arr( in32, 2 * N ); - if ( l_shift > r_shift ) - { - Word16 shift_val = l_shift - r_shift; - for ( int i = 0; i < N; i++ ) - { - in32[2 * i + 0] = in32[2 * i + 0] << shift_val; - fIn[2 * i + 0] = (float) in32[2 * i + 0]; - in32[2 * i + 1] = in32[2 * i + 1] << shift_val; - fIn[2 * i + 1] = (float) in32[2 * i + 1]; - } - } - if ( l_shift < r_shift ) - { - Word16 shift_val = r_shift - l_shift; - for ( int i = 0; i < N; i++ ) - { - in32[2 * i + 0] = in32[2 * i + 0] >> shift_val; - fIn[2 * i + 0] = (float) in32[2 * i + 0]; - in32[2 * i + 1] = in32[2 * i + 1] >> shift_val; - fIn[2 * i + 1] = (float) in32[2 * i + 1]; - } - } -} - -void populate_input_interleave_16( Word16 *in16, float *fIn, Word16 N ) -{ - Word16 max_val_in = 0; - Word16 r_shift, l_shift; - do - { - srand( N ); - for ( int i = 0; i < N; i++ ) - { - in16[2 * i + 0] = (Word16) rand(); - in16[2 * i + 1] = (Word16) rand(); - if ( max_val_in < abs( in16[2 * i + 0] ) ) - max_val_in = (Word16) abs( in16[2 * i + 0] ); - if ( max_val_in < abs( in16[2 * i + 1] ) ) - max_val_in = (Word16) abs( in16[2 * i + 1] ); - fIn[2 * i + 0] = (float) in16[2 * i + 0]; - fIn[2 * i + 1] = (float) in16[2 * i + 1]; - } - } while ( max_val_in == 0 ); - - r_shift = find_guarded_bits_fx( 2 * N ); - l_shift = norm_arr( in16, 2 * N ); - if ( l_shift > r_shift ) - { - Word16 shift_val = l_shift - r_shift; - for ( int i = 0; i < N; i++ ) - { - in16[2 * i + 0] = in16[2 * i + 0] << shift_val; - fIn[2 * i + 0] = (float) in16[2 * i + 0]; - in16[2 * i + 1] = in16[2 * i + 1] << shift_val; - fIn[2 * i + 1] = (float) in16[2 * i + 1]; - } - } - if ( l_shift < r_shift ) - { - Word16 shift_val = r_shift - l_shift; - for ( int i = 0; i < N; i++ ) - { - in16[2 * i + 0] = in16[2 * i + 0] >> shift_val; - fIn[2 * i + 0] = (float) in16[2 * i + 0]; - in16[2 * i + 1] = in16[2 * i + 1] >> shift_val; - fIn[2 * i + 1] = (float) in16[2 * i + 1]; - } - } -} - -static void populate_input_deinterleave( Word32 *iRe, Word32 *iIm, float *fRe, float *fIm, Word16 N ) -{ - Word32 max_val_in = 0; - Word16 r_shift, l_shift; - do - { - srand( N ); - for ( int i = 0; i < N; i++ ) - { - iRe[i] = rand(); - iIm[i] = rand(); - if ( max_val_in < abs( iRe[i] ) ) - max_val_in = abs( iRe[i] ); - if ( max_val_in < abs( iIm[i] ) ) - max_val_in = abs( iIm[i] ); - fRe[i] = (float) iRe[i]; - fIm[i] = (float) iIm[i]; - } - } while ( max_val_in == 0 ); - r_shift = find_guarded_bits_fx( 2 * N ); - l_shift = L_norm_arr( iRe, N ); - l_shift = min( L_norm_arr( iIm, N ), l_shift ); - if ( l_shift > r_shift ) - { - Word16 shift_val = l_shift - r_shift; - for ( int i = 0; i < N; i++ ) - { - iRe[i] = iRe[i] << shift_val; - fRe[i] = (float) iRe[i]; - iIm[i] = iIm[i] << shift_val; - fIm[i] = (float) iIm[i]; - } - } - if ( l_shift < r_shift ) - { - Word16 shift_val = r_shift - l_shift; - for ( int i = 0; i < N; i++ ) - { - iRe[i] = iRe[i] >> shift_val; - fRe[i] = (float) iRe[i]; - iIm[i] = iIm[i] >> shift_val; - fIm[i] = (float) iIm[i]; - } - } -} - -static float test_fixed_fft( Word16 N, Word32 test_type ) -{ - float max_deviation = 0.0f; - Word32 max_val_out = 0; - - switch ( test_type ) - { - case TYPE_DoFFT: - { - Word32 *iRe = calloc( N, sizeof( iRe[0] ) ); - Word32 *iIm = calloc( N, sizeof( iIm[0] ) ); - float *fRe = calloc( N, sizeof( fRe[0] ) ); - float *fIm = calloc( N, sizeof( fIm[0] ) ); - if ( ( iRe == NULL ) || ( iIm == NULL ) || ( fRe == NULL ) || ( fIm == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_deinterleave( iRe, iIm, fRe, fIm, N ); - } - DoFFT( fRe, fIm, N ); - DoFFT_fx( iRe, iIm, N ); - - for ( int i = 0; i < N; i++ ) - { - float OutRe = fRe[i]; - float OutIm = fIm[i]; - float dev_val_real = (float) ( fabs( OutRe - (float) iRe[i] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) iIm[i] ) ); - if ( max_val_out < iRe[i] ) - max_val_out = iRe[i]; - if ( max_val_out < iIm[i] ) - max_val_out = iIm[i]; - if ( dev_val_real > max_deviation ) - max_deviation = dev_val_real; - if ( dev_val_imag > max_deviation ) - max_deviation = dev_val_imag; - } - free( iRe ); - free( iIm ); - free( fRe ); - free( fIm ); - break; - } - case TYPE_fft: - { - Word32 *iRe = calloc( N, sizeof( iRe[0] ) ); - Word32 *iIm = calloc( N, sizeof( iIm[0] ) ); - float *fRe = calloc( N, sizeof( fRe[0] ) ); - float *fIm = calloc( N, sizeof( fIm[0] ) ); - if ( ( iRe == NULL ) || ( iIm == NULL ) || ( fRe == NULL ) || ( fIm == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_deinterleave( iRe, iIm, fRe, fIm, N ); - } - fft( fRe, fIm, N, 1 ); - fft_fx( iRe, iIm, N, 1 ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fRe[i]; - float OutIm = fIm[i]; - float dev_val_real = (float) ( fabs( OutRe - (float) iRe[i] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) iIm[i] ) ); - if ( max_val_out < iRe[i] ) - max_val_out = iRe[i]; - if ( max_val_out < iIm[i] ) - max_val_out = iIm[i]; - if ( dev_val_real > max_deviation ) - max_deviation = dev_val_real; - if ( dev_val_imag > max_deviation ) - max_deviation = dev_val_imag; - } - free( iRe ); - free( iIm ); - free( fRe ); - free( fIm ); - break; - } - case TYPE_fft_rel: - { - Word16 *in16 = calloc( 2 * N, sizeof( in16[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - Word16 guard_bits = 9; - if ( N == 256 ) - { - guard_bits = 8; - } - else if ( N == 128 ) - { - guard_bits = 7; - } - else if ( N != 512 ) - { - assert( !"Unsupported length for fft_rel!" ); - } - if ( ( in16 == NULL ) || ( fIn == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave_16( in16, fIn, N ); - } - fft_rel( fIn, N, guard_bits ); - fft_rel_fx( in16, N, guard_bits ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fIn[2 * i + 0]; - float OutIm = fIn[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) in16[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) in16[2 * i + 1] ) ); - if ( max_val_out < abs( in16[2 * i + 0] ) ) - max_val_out = abs( in16[2 * i + 0] ); - if ( max_val_out < abs( in16[2 * i + 1] ) ) - max_val_out = abs( in16[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - max_deviation = dev_val_real; - if ( dev_val_imag > max_deviation ) - max_deviation = dev_val_imag; - } - free( in16 ); - free( fIn ); - break; - } - case TYPE_fft_rel32: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - Word16 guard_bits = 9; - if ( N == 256 ) - { - guard_bits = 8; - } - else if ( N == 128 ) - { - guard_bits = 7; - } - else if ( N != 512 ) - { - assert( !"Unsupported length for fft_rel!" ); - } - if ( ( in32 == NULL ) || ( fIn == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - fft_rel( fIn, N, guard_bits ); - fft_rel_fx32( in32, N, guard_bits ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fIn[2 * i + 0]; - float OutIm = fIn[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) in32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) in32[2 * i + 1] ) ); - if ( max_val_out < abs( in32[2 * i + 0] ) ) - max_val_out = abs( in32[2 * i + 0] ); - if ( max_val_out < abs( in32[2 * i + 1] ) ) - max_val_out = abs( in32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - { - max_deviation = dev_val_real; - } - if ( dev_val_imag > max_deviation ) - { - max_deviation = dev_val_imag; - } - } - free( in32 ); - free( fIn ); - break; - } - case TYPE_ifft_rel32: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - Word16 guard_bits = 9; - if ( N == 256 ) - { - guard_bits = 8; - } - else if ( N == 128 ) - { - guard_bits = 7; - } - else if ( N != 512 ) - { - assert( !"Unsupported length for fft_rel!" ); - } - if ( ( in32 == NULL ) || ( fIn == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - ifft_rel( fIn, N, guard_bits ); - ifft_rel_fx32( in32, N, guard_bits ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fIn[2 * i + 0]; - float OutIm = fIn[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) in32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) in32[2 * i + 1] ) ); - if ( max_val_out < abs( in32[2 * i + 0] ) ) - max_val_out = abs( in32[2 * i + 0] ); - if ( max_val_out < abs( in32[2 * i + 1] ) ) - max_val_out = abs( in32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - { - max_deviation = dev_val_real; - } - if ( dev_val_imag > max_deviation ) - { - max_deviation = dev_val_imag; - } - } - free( in32 ); - free( fIn ); - break; - } - case TYPE_fft_fft3: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - Word32 *out32 = calloc( 2 * N, sizeof( out32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - float *fOut = calloc( 2 * N, sizeof( fOut[0] ) ); - if ( ( in32 == NULL ) || ( fIn == NULL ) || ( out32 == NULL ) || ( fOut == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - fft3( fIn, fOut, N ); - fft3_fx_ivas( in32, out32, N ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fOut[2 * i + 0]; - float OutIm = fOut[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) out32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) out32[2 * i + 1] ) ); - if ( max_val_out < abs( out32[2 * i + 0] ) ) - max_val_out = abs( out32[2 * i + 0] ); - if ( max_val_out < abs( out32[2 * i + 1] ) ) - max_val_out = abs( out32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - { - max_deviation = dev_val_real; - } - if ( dev_val_imag > max_deviation ) - { - max_deviation = dev_val_imag; - } - } - free( in32 ); - free( fIn ); - free( out32 ); - free( fOut ); - break; - } - case TYPE_fft_ifft3: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - Word32 *out32 = calloc( 2 * N, sizeof( out32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - float *fOut = calloc( 2 * N, sizeof( fOut[0] ) ); - if ( ( in32 == NULL ) || ( fIn == NULL ) || ( out32 == NULL ) || ( fOut == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - ifft3( fIn, fOut, N ); - ifft3_fx_ivas( in32, out32, N ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fOut[2 * i + 0]; - float OutIm = fOut[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) out32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) out32[2 * i + 1] ) ); - if ( max_val_out < abs( out32[2 * i + 0] ) ) - max_val_out = abs( out32[2 * i + 0] ); - if ( max_val_out < abs( out32[2 * i + 1] ) ) - max_val_out = abs( out32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - { - max_deviation = dev_val_real; - } - if ( dev_val_imag > max_deviation ) - { - max_deviation = dev_val_imag; - } - } - free( in32 ); - free( fIn ); - free( out32 ); - free( fOut ); - break; - } - case TYPE_fft_cldfb: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - if ( ( in32 == NULL ) || ( fIn == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - fft_cldfb( fIn, N ); - fft_cldfb_fx( in32, N ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fIn[2 * i + 0]; - float OutIm = fIn[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) in32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) in32[2 * i + 1] ) ); - if ( max_val_out < abs( in32[2 * i + 0] ) ) - max_val_out = abs( in32[2 * i + 0] ); - if ( max_val_out < abs( in32[2 * i + 1] ) ) - max_val_out = abs( in32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - max_deviation = dev_val_real; - if ( dev_val_imag > max_deviation ) - max_deviation = dev_val_imag; - } - free( fIn ); - free( in32 ); - break; - } - case TYPE_fft_RFFTN: - { - Word32 *in32 = calloc( 2 * N, sizeof( in32[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - if ( ( in32 == NULL ) || ( fIn == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - else - { - populate_input_interleave( in32, fIn, N ); - } - RFFTN( fIn, fftSineTab640, N, 1 ); - RFFTN_fx( in32, fftSineTab640_fx, N, 1 ); - for ( int i = 0; i < N; i++ ) - { - float OutRe = fIn[2 * i + 0]; - float OutIm = fIn[2 * i + 1]; - float dev_val_real = (float) ( fabs( OutRe - (float) in32[2 * i + 0] ) ); - float dev_val_imag = (float) ( fabs( OutIm - (float) in32[2 * i + 1] ) ); - if ( max_val_out < abs( in32[2 * i + 0] ) ) - max_val_out = abs( in32[2 * i + 0] ); - if ( max_val_out < abs( in32[2 * i + 1] ) ) - max_val_out = abs( in32[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - { - max_deviation = dev_val_real; - } - if ( dev_val_imag > max_deviation ) - { - max_deviation = dev_val_imag; - } - } - free( in32 ); - free( fIn ); - break; - } - } - - - return ( ( max_deviation / max_val_out ) * 100 ); -} - -static void test_main( Word16 *fft_lengths, Word16 num_lengths, Word16 test_type ) -{ - char *test_name[] = { "DoFFT", "fft", "fft_rel", "fft_rel32", "ifft_rel32", "fft_cldfb", "fft_RFFTN", "fft_fft3", "fft_ifft3" }; - Word32 num_tests = 0, num_passed = 0, num_failed = 0; - printf( "\033[0;33m" ); - printf( "============== Starting %s tests ================\n", test_name[test_type] ); - for ( int i = num_lengths - 1; i >= 0; i-- ) - { - float max_deviation = test_fixed_fft( fft_lengths[i], test_type ); - num_tests++; - if ( max_deviation < ALLOWED_DEVIATION ) - { - printf( "\033[0;32m" ); - printf( "[PASSED] %s test of length %d\n", test_name[test_type], fft_lengths[i] ); - num_passed++; - } - else - { - printf( "\033[0;31m" ); - printf( "[FAILED] %s test of length %d Max_deviation = %.6f\n", test_name[test_type], fft_lengths[i], max_deviation ); - num_failed++; - } - } - printf( "\033[0;33m" ); - printf( "============== Completed %s tests ================\n\n", test_name[test_type] ); - printf( "Summary of %s unit tests:\n", test_name[test_type] ); - printf( "--------------------------\n" ); - printf( "Total tests: %d\n", num_tests ); - printf( "Passed: %d\n", num_passed ); - printf( "\033[0;31m" ); - printf( "Failed: %d\n\n", num_failed ); - printf( "\033[0m" ); -} - -void run_fft_unit_test( void ) -{ - Word16 DoFFT_lengths[] = { - 600, - 480, - 400, - 320, - 256, - 240, - 200, - 160, - 128, - 120, - 100, - 80, - 64, - 40, - 20, - }; - Word16 fft_lengths[] = { 960, 640, 600, 480, 400, 320, 256, 240, 200, 160, 128, 120, 100, 80, 64, 40, 20 }; - Word16 fft_rel_lengths[] = { 128, 256, 512 }; - Word16 fft_cldfb_lengths[] = { 5, 8, 10, 16, 20, 30 }; - Word16 fft_RFFTN_lengths[] = { 640, 512 }; - Word16 fft_fft3_lengths[] = { 1536, 384 }; - test_main( &DoFFT_lengths[0], sizeof( DoFFT_lengths ) / sizeof( DoFFT_lengths[0] ), TYPE_DoFFT ); - test_main( &fft_lengths[0], sizeof( fft_lengths ) / sizeof( fft_lengths[0] ), TYPE_fft ); - test_main( &fft_rel_lengths[0], sizeof( fft_rel_lengths ) / sizeof( fft_rel_lengths[0] ), TYPE_fft_rel ); - test_main( &fft_rel_lengths[0], sizeof( fft_rel_lengths ) / sizeof( fft_rel_lengths[0] ), TYPE_fft_rel32 ); - test_main( &fft_rel_lengths[0], sizeof( fft_rel_lengths ) / sizeof( fft_rel_lengths[0] ), TYPE_ifft_rel32 ); - test_main( &fft_cldfb_lengths[0], sizeof( fft_cldfb_lengths ) / sizeof( fft_cldfb_lengths[0] ), TYPE_fft_cldfb ); - test_main( &fft_RFFTN_lengths[0], sizeof( fft_RFFTN_lengths ) / sizeof( fft_RFFTN_lengths[0] ), TYPE_fft_RFFTN ); - test_main( &fft_fft3_lengths[0], sizeof( fft_fft3_lengths ) / sizeof( fft_fft3_lengths[0] ), TYPE_fft_fft3 ); - test_main( &fft_fft3_lengths[0], sizeof( fft_fft3_lengths ) / sizeof( fft_fft3_lengths[0] ), TYPE_fft_ifft3 ); - return; -} -#endif diff --git a/lib_util/test_mdct.c b/lib_util/test_mdct.c index 339681819..91095df38 100644 --- a/lib_util/test_mdct.c +++ b/lib_util/test_mdct.c @@ -48,188 +48,3 @@ typedef short int16_t; #define ALLOWED_DEVIATION ( 0.05 ) #define Q31 ( 2147483647.0f ) - -#if 0 -extern const int16_t ip_edct2_64[6]; -extern const float w_edct2_64[80]; -extern const Word16 w_edct2_64_fx[80]; - -void edct2( - const int16_t n, - const int16_t isgn, - float *in, - float *a, - const int16_t *ip, - const float *w ); - -void edct2_fx( - const Word16 n, - const Word16 isgn, - Word16 *in, - Word32 *a, - Word16 *q, - const Word16 *ip, - const Word16 *w ); - -void ivas_mdct( - const float *pIn, - float *pOut, - const int16_t length ); - -void ivas_mdct_fx( - const Word32 *pIn, - Word32 *pOut, - const Word16 length, - Word16 *q_out ); - -void ivas_imdct( - const float *pIn, - float *pOut, - const int16_t length ); - -void ivas_imdct_fx( - const Word32 *pIn, - Word32 *pOut, - const Word16 length, - Word16 *q_out ); - -void run_mdct_unit_test( void ); - -void populate_input_interleave( Word32 *in32, float *fIn, Word16 N ); -void populate_input_interleave_16( Word16 *in16, float *fIn, Word16 N ); - -static float test_ivas_mdct_imdct( Word16 N, Word32 test_type ) -{ - Word32 *in = calloc( 2 * N, sizeof( in[0] ) ); - Word16 *in16 = calloc( 2 * N, sizeof( in16[0] ) ); - float *fIn = calloc( 2 * N, sizeof( fIn[0] ) ); - Word32 *out = calloc( 2 * N, sizeof( out[0] ) ); - float *fOut = calloc( 2 * N, sizeof( fOut[0] ) ); - float max_deviation = 0.0f; - Word32 max_val_out = 0; - Word16 q_out = 0; - float div_fac = 1.0f; - - if ( ( in == NULL ) || ( fIn == NULL ) || ( out == NULL ) || ( fOut == NULL ) ) - { - printf( "!!!!Malloc failed!!!!" ); - exit( 1 ); - } - - switch ( test_type ) - { - case ( TYPE_MDCT ): - { - populate_input_interleave( in, fIn, N ); - ivas_mdct( fIn, fOut, N ); - ivas_mdct_fx( in, out, N, &q_out ); - break; - } - case ( TYPE_IMDCT ): - { - populate_input_interleave( in, fIn, N ); - ivas_imdct( fIn, fOut, N ); - ivas_imdct_fx( in, out, N, &q_out ); - break; - } - case ( TYPE_EDCT2 ): - { - populate_input_interleave_16( in16, fIn, N ); - edct2( 64, 1, fIn, fOut, ip_edct2_64, w_edct2_64 ); - edct2_fx( 64, 1, in16, out, &q_out, ip_edct2_64, w_edct2_64_fx ); - break; - } - case ( TYPE_NEG_EDCT2 ): - { - populate_input_interleave_16( in16, fIn, N ); - edct2( 64, -1, fIn, fOut, ip_edct2_64, w_edct2_64 ); - edct2_fx( 64, -1, in16, out, &q_out, ip_edct2_64, w_edct2_64_fx ); - break; - } - } - if ( q_out >= 0 ) - { - div_fac = (float) 1.0f / (float) ( 1 << q_out ); - } - else - { - div_fac = (float) ( 1 << ( -q_out ) ); - } - - for ( int i = 0; i < ( N >> 1 ); i++ ) - { - float OutRe = fOut[2 * i + 0]; - float OutIm = fOut[2 * i + 1]; - float dev_val_real = (float) ( fabs( ( OutRe / div_fac ) - (float) ( out[2 * i + 0] ) ) ); - float dev_val_imag = (float) ( fabs( ( OutIm / div_fac ) - (float) ( out[2 * i + 1] ) ) ); - if ( max_val_out < abs( out[2 * i + 0] ) ) - max_val_out = abs( out[2 * i + 0] ); - if ( max_val_out < abs( out[2 * i + 1] ) ) - max_val_out = abs( out[2 * i + 1] ); - if ( dev_val_real > max_deviation ) - max_deviation = dev_val_real; - if ( dev_val_imag > max_deviation ) - max_deviation = dev_val_imag; - } - free( in ); - free( fIn ); - free( out ); - free( fOut ); - return ( ( max_deviation / max_val_out ) * 100 ); -} - -static void test_main( Word16 *imdct_lengths, Word16 num_lengths, Word16 test_type ) -{ - char *test_name[] = { "IVAS MDCT", "IVAS IMDCT", "IVAS EDCT2", "IVAS NEG_EDCT2" }; - Word32 num_tests = 0, num_passed = 0, num_failed = 0; - printf( "\033[0;33m" ); - printf( "============== Starting %s tests ================\n", test_name[test_type] ); - for ( int i = num_lengths - 1; i >= 0; i-- ) - { - float max_deviation = test_ivas_mdct_imdct( imdct_lengths[i], test_type ); - num_tests++; - if ( max_deviation < ALLOWED_DEVIATION ) - { - printf( "\033[0;32m" ); - printf( "[PASSED] %s test of length %d\n", test_name[test_type], imdct_lengths[i] ); - num_passed++; - } - else - { - printf( "\033[0;31m" ); - printf( "[FAILED] %s test of length %d Max_deviation = %.6f\n", test_name[test_type], imdct_lengths[i], max_deviation ); - num_failed++; - } - } - printf( "\033[0;33m" ); - printf( "============== Completed %s tests ================\n\n", test_name[test_type] ); - printf( "Summary of %s unit tests:\n", test_name[test_type] ); - printf( "--------------------------\n" ); - printf( "Total tests: %d\n", num_tests ); - printf( "Passed: %d\n", num_passed ); - printf( "\033[0;31m" ); - printf( "Failed: %d\n\n", num_failed ); - printf( "\033[0m" ); -} - -void run_mdct_unit_test( void ) -{ - Word16 ivas_mdct_lengths[] = { - 480, - 320, - 160, - }; - Word16 ivas_imdct_lengths[] = { - 480, - 320, - 160, - 80, - }; - Word16 edct2_lengths[] = { 64 }; - test_main( &ivas_mdct_lengths[0], sizeof( ivas_mdct_lengths ) / sizeof( ivas_mdct_lengths[0] ), TYPE_MDCT ); - test_main( &ivas_imdct_lengths[0], sizeof( ivas_imdct_lengths ) / sizeof( ivas_imdct_lengths[0] ), TYPE_IMDCT ); - test_main( &edct2_lengths[0], 1, TYPE_EDCT2 ); - test_main( &edct2_lengths[0], 1, TYPE_NEG_EDCT2 ); - return; -} -#endif -- GitLab