-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpool.cpp
54 lines (49 loc) · 850 Bytes
/
pool.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "param.h"
void pool1(f_32 in[28][28][6], f_32 out[14][14][6])
{
for (int i = 0; i < 14; i++)
{
for (int j = 0; j < 14; j++)
{
for (int k = 0; k < 6; k++)
{
f_32 max = 0;
for (int x = 0; x < 2; x++)
{
for (int y = 0; y < 2; y++)
{
if (in[2*i+x][2*j+y][k]>max) //²½³¤Îª2
{
max = in[2 * i + x][2 * j + y][k];
}
}
}
out[i][j][k] = max;
}
}
}
}
void pool2(f_32 in[10][10][16], f_32 out[5][5][16])
{
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
for (int k = 0; k < 16; k++)
{
f_32 max = 0;
for (int x = 0; x < 2; x++)
{
for (int y = 0; y < 2; y++)
{
if (in[2 * i + x][2 * j + y][k] > max) //²½³¤Îª2
{
max = in[2 * i + x][2 * j + y][k];
}
}
}
out[i][j][k] = max;
}
}
}
}