From d17b33131c14864bd1eae275f49a3f148e21cf29 Mon Sep 17 00:00:00 2001 From: Leo Chan Date: Thu, 22 Oct 2020 01:53:21 -0400 Subject: 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. --- .../tracking/src/c/getInterpolatePatch.c | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c (limited to 'SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c') diff --git a/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c b/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c new file mode 100644 index 0000000..99e95f9 --- /dev/null +++ b/SD-VBS/benchmarks/tracking/src/c/getInterpolatePatch.c @@ -0,0 +1,43 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "tracking.h" + +/** Perform simple interpolation around 2*winSize*2*winSize neighbourhood **/ +F2D* getInterpolatePatch(F2D* src, int cols, float centerX, float centerY, int winSize) +{ + F2D *dst; + float a, b, a11, a12, a21, a22; + int i, j, k, srcIdx, dstIdx; + int srcIdxx, dstIdxx; + + a = centerX - floor(centerX); + b = centerY - floor(centerY); + + a11 = (1-a)*(1-b); + a12 = a*(1-b); + a21 = (1-a)*b; + a22 = a*b; + + dst = fSetArray(1,2*winSize*2*winSize, 0); + + + for(i=-winSize; i