Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / cpu_x86_sse42 / ie_preprocess_gapi_kernels_sse42.hpp
1 // Copyright (C) 2018-2019 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                  const Size & inSz,
77                  const Size & outSz,
78                        int    lpi);
79
80 //----------------------------------------------------------------------
81
82 void mergeRow_8UC2(const uint8_t in0[],
83                    const uint8_t in1[],
84                          uint8_t out[],
85                              int length);
86
87 void mergeRow_8UC3(const uint8_t in0[],
88                    const uint8_t in1[],
89                    const uint8_t in2[],
90                          uint8_t out[],
91                              int length);
92
93 void mergeRow_8UC4(const uint8_t in0[],
94                    const uint8_t in1[],
95                    const uint8_t in2[],
96                    const uint8_t in3[],
97                          uint8_t out[],
98                              int length);
99
100 void mergeRow_32FC2(const float in0[],
101                     const float in1[],
102                           float out[],
103                             int length);
104
105 void mergeRow_32FC3(const float in0[],
106                     const float in1[],
107                     const float in2[],
108                           float out[],
109                             int length);
110
111 void mergeRow_32FC4(const float in0[],
112                     const float in1[],
113                     const float in2[],
114                     const float in3[],
115                           float out[],
116                             int length);
117
118 void splitRow_8UC2(const uint8_t in[],
119                          uint8_t out0[],
120                          uint8_t out1[],
121                              int length);
122
123 void splitRow_8UC3(const uint8_t in[],
124                          uint8_t out0[],
125                          uint8_t out1[],
126                          uint8_t out2[],
127                              int length);
128
129 void splitRow_8UC4(const uint8_t in[],
130                          uint8_t out0[],
131                          uint8_t out1[],
132                          uint8_t out2[],
133                          uint8_t out3[],
134                              int length);
135
136 void splitRow_32FC2(const float in[],
137                           float out0[],
138                           float out1[],
139                             int length);
140
141 void splitRow_32FC3(const float in[],
142                           float out0[],
143                           float out1[],
144                           float out2[],
145                             int length);
146
147 void splitRow_32FC4(const float in[],
148                           float out0[],
149                           float out1[],
150                           float out2[],
151                           float out3[],
152                             int length);
153
154 }  // namespace kernels
155 }  // namespace gapi
156 }  // namespace InferenceEngine