153a5a1b3Sopenharmony_ci################# REMOVE warnings on trimedia compiler ############################## 253a5a1b3Sopenharmony_ci################# Not critical to compilation ############################## 353a5a1b3Sopenharmony_ci 453a5a1b3Sopenharmony_ci1. Change the following statements to remove warning for constant expression 553a5a1b3Sopenharmony_ci(i) mdf.c [if(0) --> #if 0] 653a5a1b3Sopenharmony_ci(ii) preprocess.c [if(1) --> #if 1] 753a5a1b3Sopenharmony_ci 853a5a1b3Sopenharmony_ci2. add REMARK_ON macro to remove warning on not reference variable 953a5a1b3Sopenharmony_ci-- uses (void)<variable> to remove warning on not referenced variable 1053a5a1b3Sopenharmony_ci-- #define REMARK_ON 1153a5a1b3Sopenharmony_ci-- (void)<variable> 1253a5a1b3Sopenharmony_ci-- #endif 1353a5a1b3Sopenharmony_ci-- search for REMARK_ON on the following files 1453a5a1b3Sopenharmony_ci(i) jitter.c 1553a5a1b3Sopenharmony_ci(ii) mdf.c 1653a5a1b3Sopenharmony_ci(iii) filterbank.c 1753a5a1b3Sopenharmony_ci(iv) preprocess.c 1853a5a1b3Sopenharmony_ci 1953a5a1b3Sopenharmony_ci3. commented out the following in pseudofloat.h for unused variable 2053a5a1b3Sopenharmony_ci//static const spx_float_t FLOAT_HALF = {16384,-15}; 2153a5a1b3Sopenharmony_ci 2253a5a1b3Sopenharmony_ci################# Patches for trimedia compiler ############################## 2353a5a1b3Sopenharmony_ci################# Critical to compilation ############################## 2453a5a1b3Sopenharmony_ci 2553a5a1b3Sopenharmony_ci-- added the #elif defined (TM_ASM) to the following files for optimized codes 2653a5a1b3Sopenharmony_ci(1) arch.h 2753a5a1b3Sopenharmony_ci(2) fftwrap.c 2853a5a1b3Sopenharmony_ci(3) filterbank.c 2953a5a1b3Sopenharmony_ci(4) kiss_fft.c 3053a5a1b3Sopenharmony_ci(5) kiss_fftr.c 3153a5a1b3Sopenharmony_ci(6) mdf.c 3253a5a1b3Sopenharmony_ci(7) preprocess.c 3353a5a1b3Sopenharmony_ci 3453a5a1b3Sopenharmony_ci-- added macro PREPROCESS_MDF_FLOAT to allow using of floating point 3553a5a1b3Sopenharmony_ci-- in mdf and preprocess while keeping fixed point in encoder/decoder 3653a5a1b3Sopenharmony_ci-- This is due to the fact that preprocess/mdf run faster on floating 3753a5a1b3Sopenharmony_ci-- point on trimedia 3853a5a1b3Sopenharmony_ci-- added the following 3 lines to the files below 3953a5a1b3Sopenharmony_ci#ifdef PREPROCESS_MDF_FLOAT 4053a5a1b3Sopenharmony_ci#undef FIXED_POINT 4153a5a1b3Sopenharmony_ci#endif 4253a5a1b3Sopenharmony_ci(1) mdf.c 4353a5a1b3Sopenharmony_ci(2) preprocess.c 4453a5a1b3Sopenharmony_ci(3) filterbank.c 4553a5a1b3Sopenharmony_ci(4) fftwrap.c 4653a5a1b3Sopenharmony_ci(5) kiss_fft.c 4753a5a1b3Sopenharmony_ci(6) kiss_fftr.c 4853a5a1b3Sopenharmony_ci 4953a5a1b3Sopenharmony_ci-- created a new USE_COMPACT_KISS_FFT for fftwrap.c and shifted defination 5053a5a1b3Sopenharmony_ci-- to config file so that user configure the usage of fft on config.h 5153a5a1b3Sopenharmony_ci-- TOEXPLORE:is it possible to share table between mdf/preprocess? 5253a5a1b3Sopenharmony_ci-- Introducing this macro made the following changes in C code 5353a5a1b3Sopenharmony_ci-- New macro to facilitate integration 5453a5a1b3Sopenharmony_ci(grouping real/complex for dc and nyquist frequency seems to require a large 5553a5a1b3Sopenharmony_ciamount of memory for mdf, therefore did not made the changes for that) 5653a5a1b3Sopenharmony_ci(1) modify preprocess.c on init and destroy 5753a5a1b3Sopenharmony_ci(2) modify mdf.c on init and destroy 5853a5a1b3Sopenharmony_ci(3) shifted power_spectrum to fftwrap.c to share optimised code between 5953a5a1b3Sopenharmony_ci preprocess.c and mdf.c 6053a5a1b3Sopenharmony_ci 6153a5a1b3Sopenharmony_ci################# NOTES ############################## 6253a5a1b3Sopenharmony_ci(1) fixed point encoding/decoding is tested on narrowband 6353a5a1b3Sopenharmony_ci - some of the QX fractions are packed together to 6453a5a1b3Sopenharmony_ci (frac1 * a + frac2 * a) >> X (should be more accurate in rounding) 6553a5a1b3Sopenharmony_ci instead of 6653a5a1b3Sopenharmony_ci ((frac1 * a) >> X) + ((frac2 * a) >> X) 6753a5a1b3Sopenharmony_ci will cause some different between optimized and unoptimized code. 6853a5a1b3Sopenharmony_ci tried decoding/encoding optimized code on some audio files retains 6953a5a1b3Sopenharmony_ci the clearity of the word 7053a5a1b3Sopenharmony_ci 7153a5a1b3Sopenharmony_ci - wideband/ultrawideband is not heavily tested yet 7253a5a1b3Sopenharmony_ci 7353a5a1b3Sopenharmony_ci(2) optimized fixed point code requires memory alignment 7453a5a1b3Sopenharmony_ci - used config to debug on functions where memory is not align 7553a5a1b3Sopenharmony_ci 7653a5a1b3Sopenharmony_ci(3) floating point optimization for preprocess/mdf is tested 7753a5a1b3Sopenharmony_ci fixed point is not tested yet (except fft/filterbank) 7853a5a1b3Sopenharmony_ci Note (1) also applies to sround in fft for fixed point 7953a5a1b3Sopenharmony_ci some optimization is provided for fixed point as it requires lesser 8053a5a1b3Sopenharmony_ci memory compared to floating point. 8153a5a1b3Sopenharmony_ci 8253a5a1b3Sopenharmony_ci(4) unroll configurations provided to reduce code size if required 8353a5a1b3Sopenharmony_ci 8453a5a1b3Sopenharmony_ci(5) use profile options only if compiler profiling fails to work 8553a5a1b3Sopenharmony_ci 8653a5a1b3Sopenharmony_ci(6) can't include the makefile as it is close proprietary 8753a5a1b3Sopenharmony_ci 8853a5a1b3Sopenharmony_ci################# TODO:For Trimedia ############################## 8953a5a1b3Sopenharmony_ci(1) Optimizations for fixed point in mdf/preprocess 9053a5a1b3Sopenharmony_ci 9153a5a1b3Sopenharmony_ci################# Added Files ############################## 9253a5a1b3Sopenharmony_ci- _kiss_fft_guts_tm.h 9353a5a1b3Sopenharmony_ci- fftwrap_tm.h 9453a5a1b3Sopenharmony_ci- filterbank_tm.h 9553a5a1b3Sopenharmony_ci- filters_tm.h 9653a5a1b3Sopenharmony_ci- fixed_tm.h 9753a5a1b3Sopenharmony_ci- kiss_fft_tm.h 9853a5a1b3Sopenharmony_ci- kiss_fftr_tm.h 9953a5a1b3Sopenharmony_ci- mdf_tm.h 10053a5a1b3Sopenharmony_ci- misc_tm.h 10153a5a1b3Sopenharmony_ci- preprocess_tm.h 10253a5a1b3Sopenharmony_ci- config.h 10353a5a1b3Sopenharmony_ci- speex_config_types.h 104