KleidiCV Coverage Report


Directory: ./
File: kleidicv/src/filters/median_blur_sorting_network_7x7.h
Date: 2025-11-25 17:23:32
Exec Total Coverage
Lines: 290 290 100.0%
Functions: 28 28 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 // SPDX-FileCopyrightText: 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 #ifndef KLEIDICV_MEDIAN_BLUR_SORTING_NETWORK_7X7_H
6 #define KLEIDICV_MEDIAN_BLUR_SORTING_NETWORK_7X7_H
7
8 #include <algorithm>
9
10 #include "kleidicv/kleidicv.h"
11 #include "kleidicv/traits.h"
12
13 namespace KLEIDICV_TARGET_NAMESPACE {
14 // A. Adams, "Fast Median Filters using Separable Sorting Networks,"
15 // available at: https://andrew.adams.pub/fast_median_filters.pdf
16 template <class Comparator, typename KernelWindowFunctor, typename T,
17 typename ContextType>
18 245840 void sorting_network7x7(KernelWindowFunctor& KernelWindow, T& output_vec,
19 ContextType& context) KLEIDICV_STREAMING {
20 245840 Comparator::compare_and_swap(KernelWindow(0, 0), KernelWindow(6, 0), context);
21 245840 Comparator::compare_and_swap(KernelWindow(2, 0), KernelWindow(3, 0), context);
22 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(5, 0), context);
23 245840 Comparator::compare_and_swap(KernelWindow(0, 0), KernelWindow(2, 0), context);
24 245840 Comparator::compare_and_swap(KernelWindow(1, 0), KernelWindow(4, 0), context);
25 245840 Comparator::compare_and_swap(KernelWindow(3, 0), KernelWindow(6, 0), context);
26 245840 Comparator::compare_and_swap(KernelWindow(0, 0), KernelWindow(1, 0), context);
27 245840 Comparator::compare_and_swap(KernelWindow(2, 0), KernelWindow(5, 0), context);
28 245840 Comparator::compare_and_swap(KernelWindow(3, 0), KernelWindow(4, 0), context);
29 245840 Comparator::compare_and_swap(KernelWindow(1, 0), KernelWindow(2, 0), context);
30 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(6, 0), context);
31 245840 Comparator::compare_and_swap(KernelWindow(2, 0), KernelWindow(3, 0), context);
32 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(5, 0), context);
33 245840 Comparator::compare_and_swap(KernelWindow(1, 0), KernelWindow(2, 0), context);
34 245840 Comparator::compare_and_swap(KernelWindow(3, 0), KernelWindow(4, 0), context);
35 245840 Comparator::compare_and_swap(KernelWindow(5, 0), KernelWindow(6, 0), context);
36
37 245840 Comparator::compare_and_swap(KernelWindow(0, 1), KernelWindow(6, 1), context);
38 245840 Comparator::compare_and_swap(KernelWindow(2, 1), KernelWindow(3, 1), context);
39 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(5, 1), context);
40 245840 Comparator::compare_and_swap(KernelWindow(0, 1), KernelWindow(2, 1), context);
41 245840 Comparator::compare_and_swap(KernelWindow(1, 1), KernelWindow(4, 1), context);
42 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(6, 1), context);
43 245840 Comparator::compare_and_swap(KernelWindow(0, 1), KernelWindow(1, 1), context);
44 245840 Comparator::compare_and_swap(KernelWindow(2, 1), KernelWindow(5, 1), context);
45 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(4, 1), context);
46 245840 Comparator::compare_and_swap(KernelWindow(1, 1), KernelWindow(2, 1), context);
47 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(6, 1), context);
48 245840 Comparator::compare_and_swap(KernelWindow(2, 1), KernelWindow(3, 1), context);
49 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(5, 1), context);
50 245840 Comparator::compare_and_swap(KernelWindow(1, 1), KernelWindow(2, 1), context);
51 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(4, 1), context);
52 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(6, 1), context);
53
54 245840 Comparator::compare_and_swap(KernelWindow(0, 2), KernelWindow(6, 2), context);
55 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(3, 2), context);
56 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(5, 2), context);
57 245840 Comparator::compare_and_swap(KernelWindow(0, 2), KernelWindow(2, 2), context);
58 245840 Comparator::compare_and_swap(KernelWindow(1, 2), KernelWindow(4, 2), context);
59 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(6, 2), context);
60 245840 Comparator::compare_and_swap(KernelWindow(0, 2), KernelWindow(1, 2), context);
61 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(5, 2), context);
62 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(4, 2), context);
63 245840 Comparator::compare_and_swap(KernelWindow(1, 2), KernelWindow(2, 2), context);
64 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(6, 2), context);
65 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(3, 2), context);
66 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(5, 2), context);
67 245840 Comparator::compare_and_swap(KernelWindow(1, 2), KernelWindow(2, 2), context);
68 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(4, 2), context);
69 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(6, 2), context);
70
71 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(6, 3), context);
72 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(3, 3), context);
73 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(5, 3), context);
74 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(2, 3), context);
75 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(4, 3), context);
76 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(6, 3), context);
77 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(1, 3), context);
78 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(5, 3), context);
79 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(4, 3), context);
80 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(2, 3), context);
81 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(6, 3), context);
82 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(3, 3), context);
83 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(5, 3), context);
84 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(2, 3), context);
85 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(4, 3), context);
86 245840 Comparator::compare_and_swap(KernelWindow(5, 3), KernelWindow(6, 3), context);
87
88 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(6, 4), context);
89 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(3, 4), context);
90 245840 Comparator::compare_and_swap(KernelWindow(4, 4), KernelWindow(5, 4), context);
91 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(2, 4), context);
92 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(4, 4), context);
93 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(6, 4), context);
94 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(1, 4), context);
95 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(5, 4), context);
96 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(4, 4), context);
97 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(2, 4), context);
98 245840 Comparator::compare_and_swap(KernelWindow(4, 4), KernelWindow(6, 4), context);
99 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(3, 4), context);
100 245840 Comparator::compare_and_swap(KernelWindow(4, 4), KernelWindow(5, 4), context);
101 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(2, 4), context);
102 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(4, 4), context);
103 245840 Comparator::compare_and_swap(KernelWindow(5, 4), KernelWindow(6, 4), context);
104
105 245840 Comparator::compare_and_swap(KernelWindow(0, 5), KernelWindow(6, 5), context);
106 245840 Comparator::compare_and_swap(KernelWindow(2, 5), KernelWindow(3, 5), context);
107 245840 Comparator::compare_and_swap(KernelWindow(4, 5), KernelWindow(5, 5), context);
108 245840 Comparator::compare_and_swap(KernelWindow(0, 5), KernelWindow(2, 5), context);
109 245840 Comparator::compare_and_swap(KernelWindow(1, 5), KernelWindow(4, 5), context);
110 245840 Comparator::compare_and_swap(KernelWindow(3, 5), KernelWindow(6, 5), context);
111 245840 Comparator::compare_and_swap(KernelWindow(0, 5), KernelWindow(1, 5), context);
112 245840 Comparator::compare_and_swap(KernelWindow(2, 5), KernelWindow(5, 5), context);
113 245840 Comparator::compare_and_swap(KernelWindow(3, 5), KernelWindow(4, 5), context);
114 245840 Comparator::compare_and_swap(KernelWindow(1, 5), KernelWindow(2, 5), context);
115 245840 Comparator::compare_and_swap(KernelWindow(4, 5), KernelWindow(6, 5), context);
116 245840 Comparator::compare_and_swap(KernelWindow(2, 5), KernelWindow(3, 5), context);
117 245840 Comparator::compare_and_swap(KernelWindow(4, 5), KernelWindow(5, 5), context);
118 245840 Comparator::compare_and_swap(KernelWindow(1, 5), KernelWindow(2, 5), context);
119 245840 Comparator::compare_and_swap(KernelWindow(3, 5), KernelWindow(4, 5), context);
120 245840 Comparator::compare_and_swap(KernelWindow(5, 5), KernelWindow(6, 5), context);
121
122 245840 Comparator::compare_and_swap(KernelWindow(0, 6), KernelWindow(6, 6), context);
123 245840 Comparator::compare_and_swap(KernelWindow(2, 6), KernelWindow(3, 6), context);
124 245840 Comparator::compare_and_swap(KernelWindow(4, 6), KernelWindow(5, 6), context);
125 245840 Comparator::compare_and_swap(KernelWindow(0, 6), KernelWindow(2, 6), context);
126 245840 Comparator::compare_and_swap(KernelWindow(1, 6), KernelWindow(4, 6), context);
127 245840 Comparator::compare_and_swap(KernelWindow(3, 6), KernelWindow(6, 6), context);
128 245840 Comparator::compare_and_swap(KernelWindow(0, 6), KernelWindow(1, 6), context);
129 245840 Comparator::compare_and_swap(KernelWindow(2, 6), KernelWindow(5, 6), context);
130 245840 Comparator::compare_and_swap(KernelWindow(3, 6), KernelWindow(4, 6), context);
131 245840 Comparator::compare_and_swap(KernelWindow(1, 6), KernelWindow(2, 6), context);
132 245840 Comparator::compare_and_swap(KernelWindow(4, 6), KernelWindow(6, 6), context);
133 245840 Comparator::compare_and_swap(KernelWindow(2, 6), KernelWindow(3, 6), context);
134 245840 Comparator::compare_and_swap(KernelWindow(4, 6), KernelWindow(5, 6), context);
135 245840 Comparator::compare_and_swap(KernelWindow(1, 6), KernelWindow(2, 6), context);
136 245840 Comparator::compare_and_swap(KernelWindow(3, 6), KernelWindow(4, 6), context);
137 245840 Comparator::compare_and_swap(KernelWindow(5, 6), KernelWindow(6, 6), context);
138
139 // sort row 0 for element 4, 5, 6
140 245840 Comparator::compare_and_swap(KernelWindow(0, 0), KernelWindow(0, 6), context);
141 245840 Comparator::compare_and_swap(KernelWindow(0, 2), KernelWindow(0, 3), context);
142 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(0, 5), context);
143 245840 Comparator::compare_and_swap(KernelWindow(0, 0), KernelWindow(0, 2), context);
144 245840 Comparator::compare_and_swap(KernelWindow(0, 1), KernelWindow(0, 4), context);
145 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(0, 6), context);
146 245840 Comparator::max(KernelWindow(0, 0), KernelWindow(0, 1), context);
147 245840 Comparator::compare_and_swap(KernelWindow(0, 2), KernelWindow(0, 5), context);
148 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(0, 4), context);
149 245840 Comparator::max(KernelWindow(0, 1), KernelWindow(0, 2), context);
150 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(0, 6), context);
151 245840 Comparator::max(KernelWindow(0, 2), KernelWindow(0, 3), context);
152 245840 Comparator::compare_and_swap(KernelWindow(0, 4), KernelWindow(0, 5), context);
153 245840 Comparator::compare_and_swap(KernelWindow(0, 3), KernelWindow(0, 4), context);
154 245840 Comparator::compare_and_swap(KernelWindow(0, 5), KernelWindow(0, 6), context);
155 // sort row 1 for element 3, 4, 5, 6
156 245840 Comparator::compare_and_swap(KernelWindow(1, 0), KernelWindow(1, 6), context);
157 245840 Comparator::compare_and_swap(KernelWindow(1, 2), KernelWindow(1, 3), context);
158 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(1, 5), context);
159 245840 Comparator::compare_and_swap(KernelWindow(1, 1), KernelWindow(1, 4), context);
160 245840 Comparator::compare_and_swap(KernelWindow(1, 0), KernelWindow(1, 2), context);
161 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(1, 6), context);
162 245840 Comparator::max(KernelWindow(1, 0), KernelWindow(1, 1), context);
163 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(1, 4), context);
164 245840 Comparator::compare_and_swap(KernelWindow(1, 2), KernelWindow(1, 5), context);
165 245840 Comparator::max(KernelWindow(1, 1), KernelWindow(1, 2), context);
166 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(1, 6), context);
167 245840 Comparator::max(KernelWindow(1, 2), KernelWindow(1, 3), context);
168 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(1, 5), context);
169 245840 Comparator::compare_and_swap(KernelWindow(1, 3), KernelWindow(1, 4), context);
170 245840 Comparator::compare_and_swap(KernelWindow(1, 5), KernelWindow(1, 6), context);
171 // sort row 2 for element 2, 3, 4, 5, 6
172 245840 Comparator::compare_and_swap(KernelWindow(2, 0), KernelWindow(2, 6), context);
173 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(2, 3), context);
174 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(2, 5), context);
175 245840 Comparator::compare_and_swap(KernelWindow(2, 1), KernelWindow(2, 4), context);
176 245840 Comparator::compare_and_swap(KernelWindow(2, 0), KernelWindow(2, 2), context);
177 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(2, 6), context);
178 245840 Comparator::max(KernelWindow(2, 0), KernelWindow(2, 1), context);
179 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(2, 4), context);
180 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(2, 5), context);
181 245840 Comparator::compare_and_swap(KernelWindow(2, 1), KernelWindow(2, 2), context);
182 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(2, 6), context);
183 245840 Comparator::compare_and_swap(KernelWindow(2, 2), KernelWindow(2, 3), context);
184 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(2, 5), context);
185 245840 Comparator::max(KernelWindow(2, 1), KernelWindow(2, 2), context);
186 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(2, 4), context);
187 245840 Comparator::compare_and_swap(KernelWindow(2, 5), KernelWindow(2, 6), context);
188 // sort row 3 for element 1, 2, 3, 4, 5
189 245840 Comparator::compare_and_swap(KernelWindow(3, 0), KernelWindow(3, 6), context);
190 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(3, 3), context);
191 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(3, 5), context);
192 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(3, 4), context);
193 245840 Comparator::compare_and_swap(KernelWindow(3, 0), KernelWindow(3, 2), context);
194 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(3, 6), context);
195 245840 Comparator::max(KernelWindow(3, 0), KernelWindow(3, 1), context);
196 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(3, 4), context);
197 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(3, 5), context);
198 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(3, 2), context);
199 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(3, 6), context);
200 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(3, 3), context);
201 245840 Comparator::compare_and_swap(KernelWindow(3, 4), KernelWindow(3, 5), context);
202 245840 Comparator::compare_and_swap(KernelWindow(3, 1), KernelWindow(3, 2), context);
203 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(3, 4), context);
204 245840 Comparator::min(KernelWindow(3, 5), KernelWindow(3, 6), context);
205 // sort row 4 for element 0, 1, 2, 3, 4
206 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(4, 6), context);
207 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(4, 3), context);
208 245840 Comparator::compare_and_swap(KernelWindow(4, 4), KernelWindow(4, 5), context);
209 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(4, 4), context);
210 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(4, 2), context);
211 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(4, 6), context);
212 245840 Comparator::compare_and_swap(KernelWindow(4, 0), KernelWindow(4, 1), context);
213 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(4, 4), context);
214 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(4, 5), context);
215 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(4, 2), context);
216 245840 Comparator::min(KernelWindow(4, 4), KernelWindow(4, 6), context);
217 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(4, 3), context);
218 245840 Comparator::min(KernelWindow(4, 4), KernelWindow(4, 5), context);
219 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(4, 2), context);
220 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(4, 4), context);
221 // sort row 5 for element 0, 1, 2, 3
222 245840 Comparator::compare_and_swap(KernelWindow(5, 0), KernelWindow(5, 6), context);
223 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(5, 3), context);
224 245840 Comparator::compare_and_swap(KernelWindow(5, 4), KernelWindow(5, 5), context);
225 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(5, 4), context);
226 245840 Comparator::compare_and_swap(KernelWindow(5, 0), KernelWindow(5, 2), context);
227 245840 Comparator::compare_and_swap(KernelWindow(5, 3), KernelWindow(5, 6), context);
228 245840 Comparator::compare_and_swap(KernelWindow(5, 0), KernelWindow(5, 1), context);
229 245840 Comparator::compare_and_swap(KernelWindow(5, 3), KernelWindow(5, 4), context);
230 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(5, 5), context);
231 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(5, 2), context);
232 245840 Comparator::min(KernelWindow(5, 4), KernelWindow(5, 6), context);
233 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(5, 3), context);
234 245840 Comparator::min(KernelWindow(5, 4), KernelWindow(5, 5), context);
235 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(5, 2), context);
236 245840 Comparator::min(KernelWindow(5, 3), KernelWindow(5, 4), context);
237 // sort row 6 for element 0, 1, 2
238 245840 Comparator::compare_and_swap(KernelWindow(6, 0), KernelWindow(6, 6), context);
239 245840 Comparator::compare_and_swap(KernelWindow(6, 2), KernelWindow(6, 3), context);
240 245840 Comparator::compare_and_swap(KernelWindow(6, 4), KernelWindow(6, 5), context);
241 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(6, 4), context);
242 245840 Comparator::compare_and_swap(KernelWindow(6, 0), KernelWindow(6, 2), context);
243 245840 Comparator::min(KernelWindow(6, 3), KernelWindow(6, 6), context);
244 245840 Comparator::compare_and_swap(KernelWindow(6, 0), KernelWindow(6, 1), context);
245 245840 Comparator::min(KernelWindow(6, 3), KernelWindow(6, 4), context);
246 245840 Comparator::min(KernelWindow(6, 2), KernelWindow(6, 5), context);
247 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(6, 2), context);
248 245840 Comparator::min(KernelWindow(6, 2), KernelWindow(6, 3), context);
249 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(6, 2), context);
250
251 // sort digonal 0
252 245840 Comparator::max(KernelWindow(1, 3), KernelWindow(2, 2), context);
253 245840 Comparator::max(KernelWindow(3, 1), KernelWindow(4, 0), context);
254 245840 Comparator::max(KernelWindow(2, 2), KernelWindow(4, 0), context);
255 245840 Comparator::max(KernelWindow(4, 0), KernelWindow(0, 4), context);
256 // sort digonal 1
257 245840 Comparator::compare_and_swap(KernelWindow(4, 1), KernelWindow(2, 3), context);
258 245840 Comparator::compare_and_swap(KernelWindow(5, 0), KernelWindow(0, 5), context);
259 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(1, 4), context);
260 245840 Comparator::max(KernelWindow(4, 1), KernelWindow(3, 2), context);
261 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(1, 4), context);
262 245840 Comparator::max(KernelWindow(5, 0), KernelWindow(2, 3), context);
263 245840 Comparator::compare_and_swap(KernelWindow(3, 2), KernelWindow(0, 5), context);
264 245840 Comparator::max(KernelWindow(3, 2), KernelWindow(2, 3), context);
265 245840 Comparator::compare_and_swap(KernelWindow(1, 4), KernelWindow(0, 5), context);
266 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(1, 4), context);
267 // sort digonal 2
268 245840 Comparator::compare_and_swap(KernelWindow(6, 0), KernelWindow(0, 6), context);
269 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(3, 3), context);
270 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(1, 5), context);
271 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(2, 4), context);
272 245840 Comparator::compare_and_swap(KernelWindow(6, 0), KernelWindow(4, 2), context);
273 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(0, 6), context);
274 245840 Comparator::max(KernelWindow(6, 0), KernelWindow(5, 1), context);
275 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(2, 4), context);
276 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(1, 5), context);
277 245840 Comparator::compare_and_swap(KernelWindow(5, 1), KernelWindow(4, 2), context);
278 245840 Comparator::min(KernelWindow(2, 4), KernelWindow(0, 6), context);
279 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(3, 3), context);
280 245840 Comparator::min(KernelWindow(2, 4), KernelWindow(1, 5), context);
281 245840 Comparator::max(KernelWindow(5, 1), KernelWindow(4, 2), context);
282 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(2, 4), context);
283 // sort digonal 3
284 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(3, 4), context);
285 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(1, 6), context);
286 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(2, 5), context);
287 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(4, 3), context);
288 245840 Comparator::min(KernelWindow(3, 4), KernelWindow(2, 5), context);
289 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(3, 4), context);
290 245840 Comparator::min(KernelWindow(4, 3), KernelWindow(1, 6), context);
291 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(5, 2), context);
292 245840 Comparator::min(KernelWindow(4, 3), KernelWindow(3, 4), context);
293 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(4, 3), context);
294 // sort digonal 4
295 245840 Comparator::min(KernelWindow(5, 3), KernelWindow(4, 4), context);
296 245840 Comparator::min(KernelWindow(3, 5), KernelWindow(2, 6), context);
297 245840 Comparator::min(KernelWindow(5, 3), KernelWindow(3, 5), context);
298 245840 Comparator::min(KernelWindow(6, 2), KernelWindow(5, 3), context);
299
300 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(0, 4), context);
301 245840 Comparator::compare_and_swap(KernelWindow(6, 2), KernelWindow(2, 3), context);
302 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(4, 3), context);
303 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(2, 4), context);
304 245840 Comparator::compare_and_swap(KernelWindow(3, 3), KernelWindow(1, 4), context);
305 245840 Comparator::compare_and_swap(KernelWindow(6, 1), KernelWindow(6, 2), context);
306 245840 Comparator::compare_and_swap(KernelWindow(4, 2), KernelWindow(3, 3), context);
307 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(0, 5), context);
308 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(0, 4), context);
309 245840 Comparator::compare_and_swap(KernelWindow(2, 4), KernelWindow(1, 4), context);
310 245840 Comparator::compare_and_swap(KernelWindow(6, 2), KernelWindow(4, 2), context);
311 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(3, 3), context);
312 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(2, 4), context);
313 245840 Comparator::min(KernelWindow(1, 4), KernelWindow(0, 5), context);
314 245840 Comparator::max(KernelWindow(6, 1), KernelWindow(4, 3), context);
315 245840 Comparator::compare_and_swap(KernelWindow(6, 2), KernelWindow(5, 2), context);
316 245840 Comparator::max(KernelWindow(4, 2), KernelWindow(2, 4), context);
317 245840 Comparator::min(KernelWindow(3, 3), KernelWindow(0, 4), context);
318 245840 Comparator::compare_and_swap(KernelWindow(2, 3), KernelWindow(1, 4), context);
319 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(2, 3), context);
320 245840 Comparator::compare_and_swap(KernelWindow(4, 3), KernelWindow(3, 3), context);
321 245840 Comparator::min(KernelWindow(2, 4), KernelWindow(1, 4), context);
322 245840 Comparator::compare_and_swap(KernelWindow(5, 2), KernelWindow(4, 3), context);
323 245840 Comparator::max(KernelWindow(4, 2), KernelWindow(2, 3), context);
324 245840 Comparator::min(KernelWindow(3, 3), KernelWindow(2, 4), context);
325 245840 Comparator::max(KernelWindow(4, 2), KernelWindow(4, 3), context);
326 245840 Comparator::min(KernelWindow(3, 3), KernelWindow(2, 3), context);
327 245840 Comparator::max(KernelWindow(4, 3), KernelWindow(3, 3), context);
328
329 245840 output_vec = KernelWindow(3, 3);
330 245840 }
331 } // namespace KLEIDICV_TARGET_NAMESPACE
332
333 #endif // KLEIDICV_MEDIAN_BLUR_SORTING_NETWORK_7X7_H
334