diff options
| author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
| commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
| tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/benchmarks/sift/src | |
| parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (diff) | |
Squashed commit of the sb-vbs branch.
Includes the SD-VBS benchmarks modified to:
- Use libextra to loop as realtime jobs
- Preallocate memory before starting their main computation
- Accept input via stdin instead of via argc
Does not include the SD-VBS matlab code.
Fixes libextra execution in LITMUS^RT.
Diffstat (limited to 'SD-VBS/benchmarks/sift/src')
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/diffss.c | 53 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/doubleSize.c | 55 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/filterBoundaryPoints.c | 61 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/gaussianss.c | 185 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/halveSize.c | 35 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/imsmooth.c | 104 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/script_sift.c | 83 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/sift.c | 314 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/sift.h | 27 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/siftlocalmax.c | 247 | ||||
| -rw-r--r-- | SD-VBS/benchmarks/sift/src/c/siftrefinemx.c | 196 |
11 files changed, 1360 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/sift/src/c/diffss.c b/SD-VBS/benchmarks/sift/src/c/diffss.c new file mode 100644 index 0000000..683cbe7 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/diffss.c | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include "sift.h" | ||
| 6 | |||
| 7 | /** | ||
| 8 | DIFFSS Difference of scale space | ||
| 9 | Returns a scale space DSS obtained by subtracting | ||
| 10 | consecutive levels of the scale space SS. | ||
| 11 | |||
| 12 | In SIFT, this function is used to compute the difference of | ||
| 13 | Gaussian scale space from the Gaussian scale space of an image. | ||
| 14 | **/ | ||
| 15 | |||
| 16 | F2D** diffss(F2D** ss, int num, int intervals) | ||
| 17 | { | ||
| 18 | F2D** dss; | ||
| 19 | int o, sizeM, sizeN, s, i, j; | ||
| 20 | F2D *current, *in1, *in2; | ||
| 21 | |||
| 22 | dss = malloc(num*intervals*sizeof(F2D*)); | ||
| 23 | |||
| 24 | for(o=0; o<num; o++) | ||
| 25 | { | ||
| 26 | for(s=0; s<(intervals-1); s++) | ||
| 27 | { | ||
| 28 | sizeM = ss[o*intervals+s]->height; | ||
| 29 | sizeN = ss[o*intervals+s]->width; | ||
| 30 | |||
| 31 | dss[o*intervals+s] = fMallocHandle(sizeM, sizeN); | ||
| 32 | |||
| 33 | current = dss[o*intervals+s]; | ||
| 34 | in1 = ss[o*intervals+s+1]; | ||
| 35 | in2 = ss[o*intervals+s]; | ||
| 36 | |||
| 37 | for(i=0; i<sizeM; i++) | ||
| 38 | { | ||
| 39 | for(j=0; j<sizeN; j++) | ||
| 40 | { | ||
| 41 | subsref(current,i,j) = subsref(in1,i,j) - subsref(in2,i,j); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | return dss; | ||
| 48 | |||
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
diff --git a/SD-VBS/benchmarks/sift/src/c/doubleSize.c b/SD-VBS/benchmarks/sift/src/c/doubleSize.c new file mode 100644 index 0000000..dd17f77 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/doubleSize.c | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include "sift.h" | ||
| 6 | |||
| 7 | F2D* doubleSize(F2D* I) | ||
| 8 | { | ||
| 9 | F2D *J; | ||
| 10 | int M, N, i, j; | ||
| 11 | |||
| 12 | M = I->height; | ||
| 13 | N = I->width; | ||
| 14 | J = fSetArray(2*M, 2*N, 0); | ||
| 15 | |||
| 16 | for(i=0; i<M; i++) | ||
| 17 | { | ||
| 18 | for(j=0; j<N; j++) | ||
| 19 | { | ||
| 20 | subsref(J,2*i,j*2) = subsref(I,i,j); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | |||
| 24 | for(i=0; i<M-1; i++) | ||
| 25 | { | ||
| 26 | for(j=0; j<N-1; j++) | ||
| 27 | { | ||
| 28 | subsref(J,i*2+1,j*2+1) = (0.25 * (subsref(I,i,j) + subsref(I,i+1,j) + subsref(I,i,j+1) + subsref(I,(i+1),j+1))); | ||
| 29 | } | ||
| 30 | } | ||
| 31 | |||
| 32 | for(i=0; i<M-1; i++) | ||
| 33 | { | ||
| 34 | for(j=0; j<N; j++) | ||
| 35 | { | ||
| 36 | subsref(J,i*2+1,j*2) = (0.5 * (subsref(I,i,j) + subsref(I,i+1,j))); | ||
| 37 | } | ||
| 38 | } | ||
| 39 | |||
| 40 | for(i=0; i<M; i++) | ||
| 41 | { | ||
| 42 | for(j=0; j<N-1; j++) | ||
| 43 | { | ||
| 44 | subsref(J,i*2,j*2+1) = (0.5 * (subsref(I,i,j) + subsref(I,i,j+1))); | ||
| 45 | } | ||
| 46 | } | ||
| 47 | |||
| 48 | return J; | ||
| 49 | } | ||
| 50 | |||
| 51 | |||
| 52 | |||
| 53 | |||
| 54 | |||
| 55 | |||
diff --git a/SD-VBS/benchmarks/sift/src/c/filterBoundaryPoints.c b/SD-VBS/benchmarks/sift/src/c/filterBoundaryPoints.c new file mode 100644 index 0000000..c68e717 --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/filterBoundaryPoints.c | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | #include "sift.h" | ||
| 2 | |||
| 3 | /** | ||
| 4 | Filter out points on the boundaries. | ||
| 5 | The function returns oframes, which | ||
| 6 | contains the row, col and the interval number | ||
| 7 | **/ | ||
| 8 | |||
| 9 | F2D* filterBoundaryPoints(int M, int N, F2D* oframes) | ||
| 10 | { | ||
| 11 | int i, k=0, m=0; | ||
| 12 | int cnt; | ||
| 13 | I2D* sel; | ||
| 14 | F2D *ret; | ||
| 15 | |||
| 16 | cnt = 0; | ||
| 17 | for(i=0; i<oframes->width; i++) | ||
| 18 | { | ||
| 19 | if(asubsref(oframes,i)>3 && asubsref(oframes,i)<(N-3) && | ||
| 20 | subsref(oframes,1,i)>3 && subsref(oframes,1,i)<(M-3)) | ||
| 21 | { | ||
| 22 | cnt++; | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | sel = iSetArray(cnt, 1, 0); | ||
| 27 | for(i=0; i<oframes->width; i++) | ||
| 28 | { | ||
| 29 | if(asubsref(oframes,i)>3 && asubsref(oframes,i)<(N-3) && | ||
| 30 | subsref(oframes,1,i)>3 && subsref(oframes,1,i)<(M-3)) | ||
| 31 | { | ||
| 32 | asubsref(sel,k) = i; | ||
| 33 | k++; | ||
| 34 | } | ||
| 35 | m++; | ||
| 36 | } | ||
| 37 | |||
| 38 | if( sel->height > 0) | ||
| 39 | { | ||
| 40 | ret = fSetArray(oframes->height, sel->height, 0); | ||
| 41 | { | ||
| 42 | for(i=0; i<sel->height; i++) | ||
| 43 | { | ||
| 44 | subsref(ret,0,i) = subsref(oframes,0,asubsref(sel,i)); | ||
| 45 | subsref(ret,1,i) = subsref(oframes,1,asubsref(sel,i)); | ||
| 46 | subsref(ret,2,i) = subsref(oframes,2,asubsref(sel,i)); | ||
| 47 | } | ||
| 48 | } | ||
| 49 | } | ||
| 50 | else | ||
| 51 | ret = fSetArray(1,1,0); | ||
| 52 | |||
| 53 | iFreeHandle(sel); | ||
| 54 | return ret; | ||
| 55 | } | ||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | |||
| 61 | |||
diff --git a/SD-VBS/benchmarks/sift/src/c/gaussianss.c b/SD-VBS/benchmarks/sift/src/c/gaussianss.c new file mode 100644 index 0000000..52dd95b --- /dev/null +++ b/SD-VBS/benchmarks/sift/src/c/gaussianss.c | |||
| @@ -0,0 +1,185 @@ | |||
| 1 | /******************************** | ||
| 2 | Author: Sravanthi Kota Venkata | ||
| 3 | ********************************/ | ||
| 4 | |||
| 5 | #include "sift.h" | ||
| 6 | |||
