ippbase.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /*############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################*/
  16. /*
  17. // Intel(R) Integrated Performance Primitives
  18. // Basic Types and Macro Definitions
  19. //
  20. //
  21. */
  22. #ifndef __IPPBASE_H__
  23. #define __IPPBASE_H__
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #if defined( _WIN32 ) || defined ( _WIN64 )
  28. #define __STDCALL __stdcall
  29. #define __CDECL __cdecl
  30. #define __INT64 __int64
  31. #define __UINT64 unsigned __int64
  32. #else
  33. #define __STDCALL
  34. #define __CDECL
  35. #define __INT64 long long
  36. #define __UINT64 unsigned long long
  37. #endif
  38. #define IPP_PI ( 3.14159265358979323846 ) /* ANSI C does not support M_PI */
  39. #define IPP_2PI ( 6.28318530717958647692 ) /* 2*pi */
  40. #define IPP_PI2 ( 1.57079632679489661923 ) /* pi/2 */
  41. #define IPP_PI4 ( 0.78539816339744830961 ) /* pi/4 */
  42. #define IPP_PI180 ( 0.01745329251994329577 ) /* pi/180 */
  43. #define IPP_RPI ( 0.31830988618379067154 ) /* 1/pi */
  44. #define IPP_SQRT2 ( 1.41421356237309504880 ) /* sqrt(2) */
  45. #define IPP_SQRT3 ( 1.73205080756887729353 ) /* sqrt(3) */
  46. #define IPP_LN2 ( 0.69314718055994530942 ) /* ln(2) */
  47. #define IPP_LN3 ( 1.09861228866810969139 ) /* ln(3) */
  48. #define IPP_E ( 2.71828182845904523536 ) /* e */
  49. #define IPP_RE ( 0.36787944117144232159 ) /* 1/e */
  50. #define IPP_EPS23 ( 1.19209289e-07f )
  51. #define IPP_EPS52 ( 2.2204460492503131e-016 )
  52. #define IPP_MAX_8U ( 0xFF )
  53. #define IPP_MAX_16U ( 0xFFFF )
  54. #define IPP_MAX_32U ( 0xFFFFFFFF )
  55. #define IPP_MIN_8U ( 0 )
  56. #define IPP_MIN_16U ( 0 )
  57. #define IPP_MIN_32U ( 0 )
  58. #define IPP_MIN_8S (-128 )
  59. #define IPP_MAX_8S ( 127 )
  60. #define IPP_MIN_16S (-32768 )
  61. #define IPP_MAX_16S ( 32767 )
  62. #define IPP_MIN_32S (-2147483647 - 1 )
  63. #define IPP_MAX_32S ( 2147483647 )
  64. #define IPP_MIN_64U ( 0 )
  65. #if defined( _WIN32 ) || defined ( _WIN64 )
  66. #define IPP_MAX_64S ( 9223372036854775807i64 )
  67. #define IPP_MIN_64S (-9223372036854775807i64 - 1 )
  68. #define IPP_MAX_64U ( 0xffffffffffffffffL ) /* 18446744073709551615 */
  69. #else
  70. #define IPP_MAX_64S ( 9223372036854775807LL )
  71. #define IPP_MIN_64S (-9223372036854775807LL - 1 )
  72. #define IPP_MAX_64U ( 0xffffffffffffffffLL ) /* 18446744073709551615 */
  73. #endif
  74. #define IPP_MINABS_32F ( 1.175494351e-38f )
  75. #define IPP_MAXABS_32F ( 3.402823466e+38f )
  76. #define IPP_EPS_32F ( 1.192092890e-07f )
  77. #define IPP_MINABS_64F ( 2.2250738585072014e-308 )
  78. #define IPP_MAXABS_64F ( 1.7976931348623158e+308 )
  79. #define IPP_EPS_64F ( 2.2204460492503131e-016 )
  80. #define IPP_MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
  81. #define IPP_MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
  82. #define IPP_ABS( a ) ( ((a) < 0) ? (-(a)) : (a) )
  83. typedef struct {
  84. int major; /* e.g. 1 */
  85. int minor; /* e.g. 2 */
  86. int majorBuild; /* e.g. 3 */
  87. int build; /* e.g. 10, always >= majorBuild */
  88. char targetCpu[4]; /* corresponding to Intel(R) processor */
  89. const char* Name; /* e.g. "ippsw7" */
  90. const char* Version; /* e.g. "v1.2 Beta" */
  91. const char* BuildDate; /* e.g. "Jul 20 99" */
  92. } IppLibraryVersion;
  93. typedef unsigned char Ipp8u;
  94. typedef unsigned short Ipp16u;
  95. typedef unsigned int Ipp32u;
  96. typedef signed char Ipp8s;
  97. typedef signed short Ipp16s;
  98. typedef signed int Ipp32s;
  99. typedef float Ipp32f;
  100. typedef __INT64 Ipp64s;
  101. typedef __UINT64 Ipp64u;
  102. typedef double Ipp64f;
  103. typedef Ipp16s Ipp16f;
  104. typedef struct {
  105. Ipp8s re;
  106. Ipp8s im;
  107. } Ipp8sc;
  108. typedef struct {
  109. Ipp16s re;
  110. Ipp16s im;
  111. } Ipp16sc;
  112. typedef struct {
  113. Ipp16u re;
  114. Ipp16u im;
  115. } Ipp16uc;
  116. typedef struct {
  117. Ipp32s re;
  118. Ipp32s im;
  119. } Ipp32sc;
  120. typedef struct {
  121. Ipp32f re;
  122. Ipp32f im;
  123. } Ipp32fc;
  124. typedef struct {
  125. Ipp64s re;
  126. Ipp64s im;
  127. } Ipp64sc;
  128. typedef struct {
  129. Ipp64f re;
  130. Ipp64f im;
  131. } Ipp64fc;
  132. typedef enum {
  133. ippUndef = -1,
  134. ipp1u = 0,
  135. ipp8u = 1,
  136. ipp8uc = 2,
  137. ipp8s = 3,
  138. ipp8sc = 4,
  139. ipp16u = 5,
  140. ipp16uc = 6,
  141. ipp16s = 7,
  142. ipp16sc = 8,
  143. ipp32u = 9,
  144. ipp32uc = 10,
  145. ipp32s = 11,
  146. ipp32sc = 12,
  147. ipp32f = 13,
  148. ipp32fc = 14,
  149. ipp64u = 15,
  150. ipp64uc = 16,
  151. ipp64s = 17,
  152. ipp64sc = 18,
  153. ipp64f = 19,
  154. ipp64fc = 20
  155. } IppDataType;
  156. typedef enum {
  157. ippFalse = 0,
  158. ippTrue = 1
  159. } IppBool;
  160. #ifdef __cplusplus
  161. }
  162. #endif
  163. #endif /* __IPPBASE_H__ */