1 /*
2 // Copyright 1999-2019 Intel Corporation All Rights Reserved.
3 //
4 // The source code, information and material ("Material") contained herein is
5 // owned by Intel Corporation or its suppliers or licensors, and title
6 // to such Material remains with Intel Corporation or its suppliers or
7 // licensors. The Material contains proprietary information of Intel
8 // or its suppliers and licensors. The Material is protected by worldwide
9 // copyright laws and treaty provisions. No part of the Material may be used,
10 // copied, reproduced, modified, published, uploaded, posted, transmitted,
11 // distributed or disclosed in any way without Intel's prior express written
12 // permission. No license under any patent, copyright or other intellectual
13 // property rights in the Material is granted to or conferred upon you,
14 // either expressly, by implication, inducement, estoppel or otherwise.
15 // Any license under such intellectual property rights must be express and
16 // approved by Intel in writing.
17 //
18 // Unless otherwise agreed by Intel in writing,
19 // you may not remove or alter this notice or any other notice embedded in
20 // Materials by Intel or Intel's suppliers or licensors in any way.
21 //
22 */
23 
24 /*
25 //              Intel(R) Integrated Performance Primitives (Intel(R) IPP)
26 //              Basic Types and Macro Definitions
27 //
28 //
29 */
30 
31 
32 #ifndef __IPPICV_BASE_H__
33 #define __IPPICV_BASE_H__
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #if defined( IPPBASE_H__ )
40 #error "You try to include ippicv_base.h and ippbase.h together. You can't use Intel(R) IPP and ICV libraries together, please use only one and please use header files only for one library"
41 #endif
42 
43 #if defined( _WIN32 ) || defined ( _WIN64 )
44   #define IPP_STDCALL  __stdcall
45   #define IPP_CDECL    __cdecl
46   #define IPP_INT64    __int64
47   #define IPP_UINT64    unsigned __int64
48 #else
49   #define IPP_STDCALL
50   #define IPP_CDECL
51   #define IPP_INT64    long long
52   #define IPP_UINT64    unsigned long long
53 #endif
54 
55 #define IPP_PI    ( 3.14159265358979323846 )  /* ANSI C does not support M_PI */
56 #define IPP_2PI   ( 6.28318530717958647692 )  /* 2*pi                         */
57 #define IPP_PI2   ( 1.57079632679489661923 )  /* pi/2                         */
58 #define IPP_PI4   ( 0.78539816339744830961 )  /* pi/4                         */
59 #define IPP_PI180 ( 0.01745329251994329577 )  /* pi/180                       */
60 #define IPP_RPI   ( 0.31830988618379067154 )  /* 1/pi                         */
61 #define IPP_SQRT2 ( 1.41421356237309504880 )  /* sqrt(2)                      */
62 #define IPP_SQRT3 ( 1.73205080756887729353 )  /* sqrt(3)                      */
63 #define IPP_LN2   ( 0.69314718055994530942 )  /* ln(2)                        */
64 #define IPP_LN3   ( 1.09861228866810969139 )  /* ln(3)                        */
65 #define IPP_E     ( 2.71828182845904523536 )  /* e                            */
66 #define IPP_RE    ( 0.36787944117144232159 )  /* 1/e                          */
67 #define IPP_EPS23 ( 1.19209289e-07f )
68 #define IPP_EPS52 ( 2.2204460492503131e-016 )
69 
70 #define IPP_MAX_8U     ( 0xFF )
71 #define IPP_MAX_16U    ( 0xFFFF )
72 #define IPP_MAX_32U    ( 0xFFFFFFFF )
73 #define IPP_MIN_8U     ( 0 )
74 #define IPP_MIN_16U    ( 0 )
75 #define IPP_MIN_32U    ( 0 )
76 #define IPP_MIN_8S     (-128 )
77 #define IPP_MAX_8S     ( 127 )
78 #define IPP_MIN_16S    (-32768 )
79 #define IPP_MAX_16S    ( 32767 )
80 #define IPP_MIN_32S    (-2147483647 - 1 )
81 #define IPP_MAX_32S    ( 2147483647 )
82 #define IPP_MIN_64U    ( 0 )
83 
84 #if defined( _WIN32 ) || defined ( _WIN64 )
85   #define IPP_MAX_64S  ( 9223372036854775807i64 )
86   #define IPP_MIN_64S  (-9223372036854775807i64 - 1 )
87   #define IPP_MAX_64U  ( 0xffffffffffffffffL ) /* 18446744073709551615 */
88 #else
89   #define IPP_MAX_64S  ( 9223372036854775807LL )
90   #define IPP_MIN_64S  (-9223372036854775807LL - 1 )
91   #define IPP_MAX_64U  ( 0xffffffffffffffffLL ) /* 18446744073709551615 */
92 #endif
93 
94 #define IPP_MINABS_32F ( 1.175494351e-38f )
95 #define IPP_MAXABS_32F ( 3.402823466e+38f )
96 #define IPP_EPS_32F    ( 1.192092890e-07f )
97 #define IPP_MINABS_64F ( 2.2250738585072014e-308 )
98 #define IPP_MAXABS_64F ( 1.7976931348623158e+308 )
99 #define IPP_EPS_64F    ( 2.2204460492503131e-016 )
100 
101 #define IPP_MAX( a, b ) ( ((a) > (b)) ? (a) : (b) )
102 #define IPP_MIN( a, b ) ( ((a) < (b)) ? (a) : (b) )
103 
104 #define IPP_ABS( a ) ( ((a) < 0) ? (-(a)) : (a) )
105 
106 typedef struct {
107     int    major;                     /* e.g. 1                               */
108     int    minor;                     /* e.g. 2                               */
109     int    majorBuild;                /* e.g. 3                               */
110     int    build;                     /* e.g. 10, always >= majorBuild        */
111     char  targetCpu[4];               /* corresponding to Intel(R) processor  */
112     const char* Name;                 /* e.g. "ippsw7"                        */
113     const char* Version;              /* e.g. "v1.2 Beta"                     */
114     const char* BuildDate;            /* e.g. "Jul 20 99"                     */
115 } IppLibraryVersion;
116 
117 typedef unsigned char  Ipp8u;
118 typedef unsigned short Ipp16u;
119 typedef unsigned int   Ipp32u;
120 typedef signed char    Ipp8s;
121 typedef signed short   Ipp16s;
122 typedef signed int     Ipp32s;
123 typedef float          Ipp32f;
124 typedef IPP_INT64        Ipp64s;
125 typedef IPP_UINT64       Ipp64u;
126 typedef double         Ipp64f;
127 typedef Ipp16s         Ipp16f;
128 
129 typedef struct {
130     Ipp8s  re;
131     Ipp8s  im;
132 } Ipp8sc;
133 
134 typedef struct {
135     Ipp16s  re;
136     Ipp16s  im;
137 } Ipp16sc;
138 
139 typedef struct {
140     Ipp16u  re;
141     Ipp16u  im;
142 } Ipp16uc;
143 
144 typedef struct {
145     Ipp32s  re;
146     Ipp32s  im;
147 } Ipp32sc;
148 
149 typedef struct {
150     Ipp32f  re;
151     Ipp32f  im;
152 } Ipp32fc;
153 
154 typedef struct {
155     Ipp64s  re;
156     Ipp64s  im;
157 } Ipp64sc;
158 
159 typedef struct {
160     Ipp64f  re;
161     Ipp64f  im;
162 } Ipp64fc;
163 
164 typedef enum {
165    ippUndef = -1,
166    ipp1u    =  0,
167    ipp8u    =  1,
168    ipp8uc   =  2,
169    ipp8s    =  3,
170    ipp8sc   =  4,
171    ipp16u   =  5,
172    ipp16uc  =  6,
173    ipp16s   =  7,
174    ipp16sc  =  8,
175    ipp32u   =  9,
176    ipp32uc  = 10,
177    ipp32s   = 11,
178    ipp32sc  = 12,
179    ipp32f   = 13,
180    ipp32fc  = 14,
181    ipp64u   = 15,
182    ipp64uc  = 16,
183    ipp64s   = 17,
184    ipp64sc  = 18,
185    ipp64f   = 19,
186    ipp64fc  = 20
187 } IppDataType;
188 
189 typedef enum {
190     ippFalse = 0,
191     ippTrue = 1
192 } IppBool;
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* __IPPICV_BASE_H__ */
199 
200