README.Trimedia 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. ################# REMOVE warnings on trimedia compiler ##############################
  2. ################# Not critical to compilation ##############################
  3. 1. Change the following statements to remove warning for constant expression
  4. (i) mdf.c [if(0) --> #if 0]
  5. (ii) ltp.c [if(1) --> #if 1]
  6. (iii) preprocess.c [if(1) --> #if 1]
  7. (iv) sb_celp.c [if (SPEEX_SET_VBR_MAX_BITRATE<1) --> #if (SPEEX_SET_VBR_MAX_BITRATE<1)]
  8. 2. add REMARK_ON macro to remove warning on not reference variable
  9. -- uses (void)<variable> to remove warning on not referenced variable
  10. -- #define REMARK_ON
  11. -- (void)<variable>
  12. -- #endif
  13. -- search for REMARK_ON on the following files
  14. (i) jitter.c
  15. (ii) lsp.c
  16. (iii) ltp.c
  17. (iv) mdf.c
  18. (v) filters.c
  19. (vi) filterbank.c
  20. (vii) cb_search.c
  21. (viii) vq.c
  22. (ix) vbr.c
  23. (x) stereo.c
  24. (xi) speex_callbacks.c
  25. (xii) preprocess.c
  26. 3. commented out the following in pseudofloat.h for unused variable
  27. //static const spx_float_t FLOAT_HALF = {16384,-15};
  28. 4. commented out unused variable in nb_celp.c
  29. //spx_word16_t *sp; ***unused variable***
  30. //sp=out+offset; ***unused variable***
  31. //int submode; ***unused variable***
  32. // ***unused variable***
  33. // advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
  34. advance = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
  35. // ***unused variable***
  36. //advance = submode = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
  37. advance = speex_bits_unpack_unsigned(bits, SB_SUBMODE_BITS);
  38. // spx_word16_t *exc; ***unused variable***
  39. // exc=st->exc+offset; ***unused variable***
  40. 5. commented out unused variable in vbr.c
  41. //int va; ***unused variable***
  42. //va = 0; ***unused variable***
  43. //va = 1; ***unused variable***
  44. 6. added HAVE_CONFIG into medfilter.c
  45. ################# Patches for trimedia compiler ##############################
  46. ################# Critical to compilation ##############################
  47. -- change the following in modes.c and speex.h as compiler does not support const * const...
  48. (i) modes.c
  49. #ifdef __TCS__
  50. const SpeexMode * speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
  51. #else
  52. const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
  53. #endif
  54. (ii) speex.h
  55. #ifdef __TCS__
  56. extern const SpeexMode * speex_mode_list[SPEEX_NB_MODES];
  57. #else
  58. extern const SpeexMode * const speex_mode_list[SPEEX_NB_MODES];
  59. #endif
  60. -- added the #elif defined (TM_ASM) to the following files for optimized codes
  61. (1) arch.h
  62. (2) cb_search.c
  63. (3) fftwrap.c
  64. (4) filterbank.c
  65. (5) filters.c
  66. (6) kiss_fft.c
  67. (7) kiss_fftr.c
  68. (8) lpc.c
  69. (9) lsp.c
  70. (10) ltp.c
  71. (11) mdf.c
  72. (12) misc.c
  73. (13) preprocess.c
  74. (14) quant_lsp.c
  75. (15) vq.c
  76. -- reorder macro definitions in quant_lsp.c
  77. #ifdef FIXED_POINT
  78. #define LSP_LINEAR(i) (SHL16(i+1,11))
  79. #define LSP_LINEAR_HIGH(i) (ADD16(MULT16_16_16(i,2560),6144))
  80. #define LSP_DIV_256(x) (SHL16((spx_word16_t)x, 5))
  81. #define LSP_DIV_512(x) (SHL16((spx_word16_t)x, 4))
  82. #define LSP_DIV_1024(x) (SHL16((spx_word16_t)x, 3))
  83. #define LSP_PI 25736
  84. #else
  85. #define LSP_LINEAR(i) (.25*(i)+.25)
  86. #define LSP_LINEAR_HIGH(i) (.3125*(i)+.75)
  87. #define LSP_SCALE 256.
  88. #define LSP_DIV_256(x) (0.0039062*(x))
  89. #define LSP_DIV_512(x) (0.0019531*(x))
  90. #define LSP_DIV_1024(x) (0.00097656*(x))
  91. #define LSP_PI M_PI
  92. #endif
  93. #ifdef BFIN_ASM
  94. #include "quant_lsp_bfin.h"
  95. #elif defined (TM_ASM)
  96. #include "quant_lsp_tm.h"
  97. #endif
  98. -- added macro PREPROCESS_MDF_FLOAT to allow using of floating point
  99. -- in mdf and preprocess while keeping fixed point in encoder/decoder
  100. -- This is due to the fact that preprocess/mdf run faster on floating
  101. -- point on trimedia
  102. -- added the following 3 lines to the files below
  103. #ifdef PREPROCESS_MDF_FLOAT
  104. #undef FIXED_POINT
  105. #endif
  106. (1) mdf.c
  107. (2) preprocess.c
  108. (3) filterbank.c
  109. (4) fftwrap.c
  110. (5) kiss_fft.c
  111. (6) kiss_fftr.c
  112. -- created a new USE_COMPACT_KISS_FFT for fftwrap.c and shifted definition
  113. -- to config file so that user configure the usage of fft on config.h
  114. -- TOEXPLORE:is it possible to share table between mdf/preprocess?
  115. -- Introducing this macro made the following changes in C code
  116. -- New macro to facilitate integration
  117. (grouping real/complex for dc and nyquist frequency seems to require a large
  118. amount of memory for mdf, therefore did not made the changes for that)
  119. (1) modify preprocess.c on init and destroy
  120. (2) modify mdf.c on init and destroy
  121. (3) shifted power_spectrum to fftwrap.c to share optimised code between
  122. preprocess.c and mdf.c
  123. ################# NOTES ##############################
  124. (1) fixed point encoding/decoding is tested on narrowband
  125. - some of the QX fractions are packed together to
  126. (frac1 * a + frac2 * a) >> X (should be more accurate in rounding)
  127. instead of
  128. ((frac1 * a) >> X) + ((frac2 * a) >> X)
  129. will cause some different between optimized and unoptimized code.
  130. tried decoding/encoding optimized code on some audio files retains
  131. the clearity of the word
  132. - wideband/ultrawideband is not heavily tested yet
  133. (2) optimized fixed point code requires memory alignment
  134. - used config to debug on functions where memory is not align
  135. (3) floating point optimization for preprocess/mdf is tested
  136. fixed point is not tested yet (except fft/filterbank)
  137. Note (1) also applies to sround in fft for fixed point
  138. some optimization is provided for fixed point as it requires lesser
  139. memory compared to floating point.
  140. (4) unroll configurations provided to reduce code size if required
  141. (5) use profile options only if compiler profiling fails to work
  142. (6) can't include the makefile as it is close proprietary
  143. ################# TODO:For Trimedia ##############################
  144. (1) Possible add TSSA wrapper for codec but don't think this can be open source.
  145. (2) Optimizations for fixed point in mdf/preprocess
  146. ################# Added Files ##############################
  147. - _kiss_fft_guts_tm.h
  148. - cb_search_tm.h
  149. - fftwrap_tm.h
  150. - filterbank_tm.h
  151. - filters_tm.h
  152. - fixed_tm.h
  153. - kiss_fft_tm.h
  154. - kiss_fftr_tm.h
  155. - lpc_tm.h
  156. - lsp_tm.h
  157. - ltp_tm.h
  158. - mdf_tm.h
  159. - misc_tm.h
  160. - preprocess_tm.h
  161. - profile_tm.h
  162. - quant_lsp_tm.h
  163. - vq_tm.h
  164. - config.h
  165. - speex_config_types.h