r8bconf.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. //$ nobt
  2. //$ nocpp
  3. /**
  4. * @file r8bconf.h
  5. *
  6. * @brief The "configuration" inclusion file you can modify.
  7. *
  8. * This is the "configuration" inclusion file for the "r8brain-free-src"
  9. * sample rate converter. You may redefine the macros here as you see fit.
  10. *
  11. * r8brain-free-src Copyright (c) 2013-2021 Aleksey Vaneev
  12. * See the "LICENSE" file for license.
  13. */
  14. #ifndef R8BCONF_INCLUDED
  15. #define R8BCONF_INCLUDED
  16. #if !defined( R8B_IPP )
  17. /**
  18. * Set the R8B_IPP macro definition to 1 to enable the use of Intel IPP's
  19. * fast Fourier transform functions. Also uncomment and correct the IPP
  20. * header inclusion macros.
  21. *
  22. * Do not forget to call the ippInit() function at the start of the
  23. * application, before using this library's functions.
  24. */
  25. #define R8B_IPP 0
  26. // #include <ippcore.h>
  27. // #include <ipps.h>
  28. #endif // !defined( R8B_IPP )
  29. #if !defined( R8BASSERT )
  30. /**
  31. * Assertion macro used to check for certain run-time conditions. By
  32. * default no action is taken if assertion fails.
  33. *
  34. * @param e Expression to check.
  35. */
  36. #define R8BASSERT( e )
  37. #endif // !defined( R8BASSERT )
  38. #if !defined( R8BCONSOLE )
  39. /**
  40. * Console output macro, used to output various resampler status strings,
  41. * including filter design parameters, convolver parameters.
  42. *
  43. * @param e Expression to send to the console, usually consists of a
  44. * standard "printf" format string followed by several parameters
  45. * (__VA_ARGS__).
  46. */
  47. #define R8BCONSOLE( ... )
  48. #endif // !defined( R8BCONSOLE )
  49. #if !defined( R8B_BASECLASS )
  50. /**
  51. * Macro defines the name of the class from which all classes that are
  52. * designed to be created on heap are derived. The default
  53. * r8b::CStdClassAllocator class uses "stdlib" memory allocation
  54. * functions.
  55. *
  56. * The classes that are best placed on stack or as class members are not
  57. * derived from any class.
  58. */
  59. #define R8B_BASECLASS :: r8b :: CStdClassAllocator
  60. #endif // !defined( R8B_BASECLASS )
  61. #if !defined( R8B_MEMALLOCCLASS )
  62. /**
  63. * Macro defines the name of the class that implements raw memory
  64. * allocation functions, see the r8b::CStdMemAllocator class for details.
  65. */
  66. #define R8B_MEMALLOCCLASS :: r8b :: CStdMemAllocator
  67. #endif // !defined( R8B_MEMALLOCCLASS )
  68. #if !defined( R8B_FILTER_CACHE_MAX )
  69. /**
  70. * This macro specifies the number of filters kept in the cache at most.
  71. * The actual number can be higher if many different filters are in use at
  72. * the same time.
  73. */
  74. #define R8B_FILTER_CACHE_MAX 96
  75. #endif // !defined( R8B_FILTER_CACHE_MAX )
  76. #if !defined( R8B_FRACBANK_CACHE_MAX )
  77. /**
  78. * This macro specifies the number of whole-number stepping fractional
  79. * delay filter banks kept in the cache at most. The actual number can be
  80. * higher if many different filter banks are in use at the same time. As
  81. * filter banks are usually big objects, it is advisable to keep this
  82. * cache size small.
  83. */
  84. #define R8B_FRACBANK_CACHE_MAX 12
  85. #endif // !defined( R8B_FRACBANK_CACHE_MAX )
  86. #if !defined( R8B_FLTTEST )
  87. /**
  88. * This macro, when equal to 1, enables fractional delay filter bank
  89. * testing: in this mode the filter bank becomes a dynamic member of the
  90. * CDSPFracInterpolator object instead of being a global static object.
  91. */
  92. #define R8B_FLTTEST 0
  93. #endif // !defined( R8B_FLTTEST )
  94. #if !defined( R8B_FASTTIMING )
  95. /**
  96. * This macro, when equal to 1, enables a fast interpolation sample
  97. * timing technique. This technique improves interpolation performance
  98. * (by around 10%) at the expense of a minor sample timing drift which is
  99. * on the order of 1e-6 samples per 10 billion output samples. This
  100. * setting does not apply to whole-number stepping, if it is in use, as
  101. * this stepping provides zero timing error without performance impact.
  102. * Also does not apply to the cases when a whole-numbered (2X, 3X, etc.)
  103. * resampling is in the actual use.
  104. */
  105. #define R8B_FASTTIMING 0
  106. #endif // !defined( R8B_FASTTIMING )
  107. #if !defined( R8B_EXTFFT )
  108. /**
  109. * This macro, when equal to 1, extends length of low-pass filters' FFT
  110. * block by a factor of 2, by zero-padding it. This usually improves the
  111. * overall time performance of the resampler at the expense of a higher
  112. * overall latency (initial processing delay). If such delay is not an
  113. * issue, setting this macro to 1 is preferrable. This macro can only have
  114. * a value of 0 or 1.
  115. */
  116. #define R8B_EXTFFT 0
  117. #endif // !defined( R8B_EXTFFT )
  118. #if !defined( R8B_PFFFT )
  119. /**
  120. * When defined as 1, enables PFFFT routines which are fast, but which
  121. * are limited to 24-bit precision. May be a good choice for time-series
  122. * interpolation, when stop-band attenuation higher than 120 dB is not
  123. * required.
  124. */
  125. #define R8B_PFFFT 0
  126. #endif // !defined( R8B_PFFFT )
  127. #if R8B_PFFFT
  128. #define R8B_FLOATFFT 1
  129. #endif // R8B_PFFFT
  130. #if !defined( R8B_PFFFT_DOUBLE )
  131. /**
  132. * When defined as 1, enables PFFFT "double" routines which are fast, and
  133. * which provide the highest precision.
  134. */
  135. #define R8B_PFFFT_DOUBLE 0
  136. #endif // !defined( R8B_PFFFT_DOUBLE )
  137. #if !defined( R8B_FLOATFFT )
  138. /**
  139. * The R8B_FLOATFFT definition enables double-to-float buffer conversions
  140. * for FFT operations, for algorithms that work with "float" values. This
  141. * macro should not be changed from the default "0" here.
  142. */
  143. #define R8B_FLOATFFT 0
  144. #endif // !defined( R8B_FLOATFFT )
  145. #endif // R8BCONF_INCLUDED