From 6fc5b7fafbd6ec27e81d9a81f7386d9bde2f76bc Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 15 Mar 2019 23:10:32 +0200
Subject: [PATCH] Cut 1/8th from dsi time

---
 cv-node/src/rtcensus.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cv-node/src/rtcensus.cpp b/cv-node/src/rtcensus.cpp
index 61f3df199..91b2e78e3 100644
--- a/cv-node/src/rtcensus.cpp
+++ b/cv-node/src/rtcensus.cpp
@@ -54,10 +54,11 @@ static vector<uint16_t> dsi_ca(vector<uint64_t> &census_R, vector<uint64_t> &cen
 	auto ds = d_stop - d_start;
 	vector<uint16_t> result(census_R.size()*ds, 0);
 
+	const size_t eu = (sign>0) ? w-2-ds : w-2;
 
 
 		for (size_t v=2; v<h-2; v++) {
-		for (size_t u=2; u<w-2; u++) {
+		for (size_t u=(sign>0)?2:ds+2; u<eu; u++) {
 			const size_t ix = v*w*ds+u*ds;
 			for (int n=-2; n<=2; n++) {
 			const auto u_ = u + n;
@@ -66,7 +67,7 @@ static vector<uint16_t> dsi_ca(vector<uint64_t> &census_R, vector<uint64_t> &cen
 			
 				for (size_t d=0; d<ds; d++) {
 				const auto d_ = d * sign;
-				if (u_+d_ < 0 || u_+d_ >= w) continue;
+				//if (u_+d_ < 0 || u_+d_ >= w) continue;
 				const auto v_ = (v + m)*w;
 				auto r = census_R[u_+v_];
 				auto l = census_L[v_+(u_+d_)];
-- 
GitLab