Publishing R5 content (#72)
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / cpu_x86_sse42 / ie_preprocess_gapi_kernels_sse42.hpp
1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include "ie_preprocess_gapi_kernels.hpp"
8 #include "ie_preprocess_gapi_kernels_impl.hpp"
9
10 namespace InferenceEngine {
11 namespace gapi {
12 namespace kernels {
13
14 //----------------------------------------------------------------------
15
16 typedef MapperUnit<float,   int> MapperUnit32F;
17 typedef MapperUnit<Q0_16, short> MapperUnit8U;
18
19 void calcRowArea_8U(uchar dst[], const uchar *src[], const Size &inSz, const Size &outSz,
20     Q0_16 yalpha, const MapperUnit8U& ymap, int xmaxdf, const short xindex[], const Q0_16 xalpha[],
21     Q8_8 vbuf[]);
22
23 void calcRowArea_32F(float dst[], const float *src[], const Size &inSz, const Size &outSz,
24     float yalpha, const MapperUnit32F& ymap, int xmaxdf, const int xindex[], const float xalpha[],
25     float vbuf[]);
26
27 #if USE_CVKL
28 void calcRowArea_CVKL_U8_SSE42(const uchar  * src[],
29                                      uchar    dst[],
30                                const Size   & inSz,
31                                const Size   & outSz,
32                                      int      y,
33                                const uint16_t xsi[],
34                                const uint16_t ysi[],
35                                const uint16_t xalpha[],
36                                const uint16_t yalpha[],
37                                      int      x_max_count,
38                                      int      y_max_count,
39                                      uint16_t vert_sum[]);
40 #endif
41
42 //----------------------------------------------------------------------
43
44 // Resize (bi-linear, 8U)
45 void calcRowLinear_8U(uint8_t *dst[],
46                 const uint8_t *src0[],
47                 const uint8_t *src1[],
48                 const short    alpha[],
49                 const short    clone[],
50                 const short    mapsx[],
51                 const short    beta[],
52                       uint8_t  tmp[],
53                 const Size   & inSz,
54                 const Size   & outSz,
55                       int      lpi);
56
57 void calcRowLinear_8UC3(std::array<std::array<uint8_t*, 4>, 3> &dst,
58                   const uint8_t *src0[],
59                   const uint8_t *src1[],
60                   const short    alpha[],
61                   const short    clone[],
62                   const short    mapsx[],
63                   const short    beta[],
64                         uint8_t  tmp[],
65                   const Size    &inSz,
66                   const Size    &outSz,
67                         int      lpi);
68
69 // Resize (bi-linear, 32F)
70 void calcRowLinear_32F(float *dst[],
71                  const float *src0[],
72                  const float *src1[],
73                  const float  alpha[],
74                  const int    mapsx[],
75                  const float  beta[],
76                        float  tmp[],
77                  const Size & inSz,
78                  const Size & outSz,
79                        int    lpi);
80
81 //----------------------------------------------------------------------
82
83 void mergeRow_8UC2(const uint8_t in0[],
84                    const uint8_t in1[],
85                          uint8_t out[],
86                              int length);
87
88 void mergeRow_8UC3(const uint8_t in0[],
89                    const uint8_t in1[],
90                    const uint8_t in2[],
91                          uint8_t out[],
92                              int length);
93
94 void mergeRow_8UC4(const uint8_t in0[],
95                    const uint8_t in1[],
96                    const uint8_t in2[],
97                    const uint8_t in3[],
98                          uint8_t out[],
99                              int length);
100
101 void mergeRow_32FC2(const float in0[],
102                     const float in1[],
103                           float out[],
104                             int length);
105
106 void mergeRow_32FC3(const float in0[],
107                     const float in1[],
108                     const float in2[],
109                           float out[],
110                             int length);
111
112 void mergeRow_32FC4(const float in0[],
113                     const float in1[],
114                     const float in2[],
115                     const float in3[],
116                           float out[],
117                             int length);
118
119 void splitRow_8UC2(const uint8_t in[],
120                          uint8_t out0[],
121                          uint8_t out1[],
122                              int length);
123
124 void splitRow_8UC3(const uint8_t in[],
125                          uint8_t out0[],
126                          uint8_t out1[],
127                          uint8_t out2[],
128                              int length);
129
130 void splitRow_8UC4(const uint8_t in[],
131                          uint8_t out0[],
132                          uint8_t out1[],
133                          uint8_t out2[],
134                          uint8_t out3[],
135                              int length);
136
137 void splitRow_32FC2(const float in[],
138                           float out0[],
139                           float out1[],
140                             int length);
141
142 void splitRow_32FC3(const float in[],
143                           float out0[],
144                           float out1[],
145                           float out2[],
146                             int length);
147
148 void splitRow_32FC4(const float in[],
149                           float out0[],
150                           float out1[],
151                           float out2[],
152                           float out3[],
153                             int length);
154
155 }  // namespace kernels
156 }  // namespace gapi
157 }  // namespace InferenceEngine