diff options
| author | leochanj105 <leochanj@live.unc.edu> | 2020-10-19 23:09:30 -0400 |
|---|---|---|
| committer | leochanj105 <leochanj@live.unc.edu> | 2020-10-20 02:40:39 -0400 |
| commit | f618466c25d43f3bae9e40920273bf77de1e1149 (patch) | |
| tree | 460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/benchmarks/sift/src/c/halveSize.c | |
| parent | 47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff) | |
initial sd-vbs
initial sd-vbs
add sd-vbs
sd-vbs
Diffstat (limited to 'SD-VBS/benchmarks/sift/src/c/halveSize.c')
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/halveSize.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/sift/src/c/halveSize.c b/SD-VBS/benchmarks/sift/src/c/halveSize.c new file mode 100644 index 0000000..fe1e536 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/halveSize.c | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include <stdio.h> | ||
| 6 | #include <stdlib.h> | ||
| 7 | #include "sift.h" | ||
| 8 | |||
| 9 | F2D* halveSize(F2D* I) | ||
| 10 | { | ||
| 11 | F2D *J; | ||
| 12 | int i, j, k; | ||
| 13 | int hM, hN; | ||
| 14 | int M, N; | ||
| 15 | |||
| 16 | M = I->height; | ||
| 17 | N = I->width; | ||
| 18 | |||
| 19 | hM = (M+1)/2; | ||
| 20 | hN = (N+1)/2; | ||
| 21 | |||
| 22 | J = fSetArray(hM, hN, 0.0); | ||
| 23 | |||
| 24 | k = 0; | ||
| 25 | for(i=0; i<M; i+=2) | ||
| 26 | { | ||
| 27 | for(j=0; j<N; j+=2) | ||
| 28 | { | ||
| 29 | asubsref(J,k++) = subsref(I,i,j); | ||
| 30 | } | ||
| 31 | } | ||
| 32 | |||
| 33 | return J; | ||
| 34 | } | ||
| 35 | |||
