-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.cpp
50 lines (43 loc) · 1.03 KB
/
test.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
#include "test.h"
#include <vector>
#include "demosaic.h"
#include "Timer.h"
struct Pixel
{
uint16_t x;
uint16_t y;
uint16_t value;
};
void test(size_t width, size_t height, const uint16_t* image)
{
//std::vector<uint16_t> work0(width * (height + 2));
//uint16_t* pWork = &work0[0];
//float scales[] = {
// 10.3566284,
// 4.44606495,
// 5.27747297,
// 4.44606495,
//};
//for (size_t i=0; i<height; ++i) {
// for (size_t j=0; j<width; ++j) {
// int tmp = image[i*width+j] - 1023;
// int scale_idx = ((i & 1) * 2) + (j & 1);
// tmp *= scales[scale_idx];
// pWork[i*width+j] = tmp;
// }
//}
{
std::vector<uint32_t> work(width * height);
uint32_t* pColor = &work[0];
printf("%d %d %p\n", width, height, pColor);
#if 0
Timer t;
demosaic_grbg(image+width, width, height, pColor);
printf("Elapsed %f\n", t.ElapsedSecond());
#else
cuda_demosaic_grbg(image+width, width, height-1, pColor);
#endif
printf("%d %d %p\n", width, height, pColor);
int hoge = 0;
}
}