ippbase.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*
  2. * Copyright (C) 2016 Intel Corporation. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. *
  8. * * Redistributions of source code must retain the above copyright
  9. * notice, this list of conditions and the following disclaimer.
  10. * * Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in
  12. * the documentation and/or other materials provided with the
  13. * distribution.
  14. * * Neither the name of Intel Corporation nor the names of its
  15. * contributors may be used to endorse or promote products derived
  16. * from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  24. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  25. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  26. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  27. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  28. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. *
  30. */
  31. #ifndef __IPPBASE_H__
  32. #define __IPPBASE_H__
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36. #if defined( _WIN32 ) || defined ( _WIN64 )
  37. #define __STDCALL __stdcall
  38. #define __CDECL __cdecl
  39. #define __INT64 __int64
  40. #define __UINT64 unsigned __int64
  41. #else
  42. #define __STDCALL
  43. #define __CDECL
  44. #define __INT64 long long
  45. #define __UINT64 unsigned long long
  46. #endif
  47. #define IPP_PI ( 3.14159265358979323846 ) /* ANSI C does not support M_PI */
  48. #define IPP_2PI ( 6.28318530717958647692 ) /* 2*pi */
  49. #define IPP_PI2 ( 1.57079632679489661923 ) /* pi/2 */
  50. #define IPP_PI4 ( 0.78539816339744830961 ) /* pi/4 */
  51. #define IPP_PI180 ( 0.01745329251994329577 ) /* pi/180 */
  52. #define IPP_RPI ( 0.31830988618379067154 ) /* 1/pi */
  53. #define IPP_SQRT2 ( 1.41421356237309504880 ) /* sqrt(2) */
  54. #define IPP_SQRT3 ( 1.73205080756887729353 ) /* sqrt(3) */
  55. #define IPP_LN2 ( 0.69314718055994530942 ) /* ln(2) */
  56. #define IPP_LN3 ( 1.09861228866810969139 ) /* ln(3) */
  57. #define IPP_E ( 2.71828182845904523536 ) /* e */
  58. #define IPP_RE ( 0.36787944117144232159 ) /* 1/e */
  59. #define IPP_EPS23 ( 1.19209289e-07f )
  60. #define IPP_EPS52 ( 2.2204460492503131e-016 )
  61. #define IPP_MAX_8U ( 0xFF )
  62. #define IPP_MAX_16U ( 0xFFFF )
  63. #define IPP_MAX_32U ( 0xFFFFFFFF )
  64. #define IPP_MIN_8U ( 0 )
  65. #define IPP_MIN_16U ( 0 )
  66. #define IPP_MIN_32U ( 0 )
  67. #define IPP_MIN_8S (-128 )
  68. #define IPP_MAX_8S ( 127 )
  69. #define IPP_MIN_16S (-32768 )
  70. #define IPP_MAX_16S ( 32767 )
  71. #define IPP_MIN_32S (-2147483647 - 1 )
  72. #define IPP_MAX_32S ( 2147483647 )
  73. #define IPP_MIN_64U ( 0 )
  74. #if defined( _WIN32 ) || defined ( _WIN64 )
  75. #define IPP_MAX_64S ( 9223372036854775807i64 )
  76. #define IPP_MIN_64S (-9223372036854775807i64 - 1 )
  77. #define IPP_MAX_64U ( 0xffffffffffffffffL ) /* 18446744073709551615 */
  78. #else
  79. #define IPP_MAX_64S ( 9223372036854775807LL )
  80. #define IPP_MIN_64S (-9223372036854775807LL - 1 )
  81. #define IPP_MAX_64U ( 0xffffffffffffffffLL ) /* 18446744073709551615 */
  82. #endif
  83. #define IPP_MINABS_32F ( 1.175494351e-38f )
  84. #define IPP_MAXABS_32F ( 3.402823466e+38f )
  85. #define IPP_EPS_32F ( 1.192092890e-07f )
  86. #define IPP_MINABS_64F ( 2.2250738585072014e-308 )
  87. #define IPP_MAXABS_64F ( 1.7976931348623158e+308 )
  88. #define IPP_EPS_64F ( 2.2204460492503131e-016 )
  89. #define IPP_MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
  90. #define IPP_MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
  91. #define IPP_ABS( a ) ( ((a) < 0) ? (-(a)) : (a) )
  92. typedef struct {
  93. int major; /* e.g. 1 */
  94. int minor; /* e.g. 2 */
  95. int majorBuild; /* e.g. 3 */
  96. int build; /* e.g. 10, always >= majorBuild */
  97. char targetCpu[4]; /* corresponding to Intel(R) processor */
  98. const char* Name; /* e.g. "ippsw7" */
  99. const char* Version; /* e.g. "v1.2 Beta" */
  100. const char* BuildDate; /* e.g. "Jul 20 99" */
  101. } IppLibraryVersion;
  102. typedef unsigned char Ipp8u;
  103. typedef unsigned short Ipp16u;
  104. typedef unsigned int Ipp32u;
  105. typedef signed char Ipp8s;
  106. typedef signed short Ipp16s;
  107. typedef signed int Ipp32s;
  108. typedef float Ipp32f;
  109. typedef __INT64 Ipp64s;
  110. typedef __UINT64 Ipp64u;
  111. typedef double Ipp64f;
  112. typedef Ipp16s Ipp16f;
  113. typedef struct {
  114. Ipp8s re;
  115. Ipp8s im;
  116. } Ipp8sc;
  117. typedef struct {
  118. Ipp16s re;
  119. Ipp16s im;
  120. } Ipp16sc;
  121. typedef struct {
  122. Ipp16u re;
  123. Ipp16u im;
  124. } Ipp16uc;
  125. typedef struct {
  126. Ipp32s re;
  127. Ipp32s im;
  128. } Ipp32sc;
  129. typedef struct {
  130. Ipp32f re;
  131. Ipp32f im;
  132. } Ipp32fc;
  133. typedef struct {
  134. Ipp64s re;
  135. Ipp64s im;
  136. } Ipp64sc;
  137. typedef struct {
  138. Ipp64f re;
  139. Ipp64f im;
  140. } Ipp64fc;
  141. typedef enum {
  142. ippUndef = -1,
  143. ipp1u = 0,
  144. ipp8u = 1,
  145. ipp8uc = 2,
  146. ipp8s = 3,
  147. ipp8sc = 4,
  148. ipp16u = 5,
  149. ipp16uc = 6,
  150. ipp16s = 7,
  151. ipp16sc = 8,
  152. ipp32u = 9,
  153. ipp32uc = 10,
  154. ipp32s = 11,
  155. ipp32sc = 12,
  156. ipp32f = 13,
  157. ipp32fc = 14,
  158. ipp64u = 15,
  159. ipp64uc = 16,
  160. ipp64s = 17,
  161. ipp64sc = 18,
  162. ipp64f = 19,
  163. ipp64fc = 20
  164. } IppDataType;
  165. typedef enum {
  166. ippFalse = 0,
  167. ippTrue = 1
  168. } IppBool;
  169. #ifdef __cplusplus
  170. }
  171. #endif
  172. #endif /* __IPPBASE_H__ */