Commit 31555875 authored by Andrey Filippov's avatar Andrey Filippov

Fixed races in DttRad2 initialization in Correlation2d

parent b5dc98c9
...@@ -1666,7 +1666,7 @@ public class Corr2dLMA { ...@@ -1666,7 +1666,7 @@ public class Corr2dLMA {
if (Double.isNaN(maxmin_amp[tile][0])) { if (Double.isNaN(maxmin_amp[tile][0])) {
continue; continue;
} }
double avg = 0.5*(maxmin_amp[tile][0]+maxmin_amp[tile][1]); double avg = 0.50*(maxmin_amp[tile][0]+maxmin_amp[tile][1]);
double rrms = rms[tile]/avg; double rrms = rms[tile]/avg;
if (((lma_max_rel_rms > 0.0) && (rrms > lma_max_rel_rms)) || if (((lma_max_rel_rms > 0.0) && (rrms > lma_max_rel_rms)) ||
(Math.max(abc[tile][0], abc[tile][2]) < lma_min_max_ac) (Math.max(abc[tile][0], abc[tile][2]) < lma_min_max_ac)
......
...@@ -753,6 +753,7 @@ public class Correlation2d { ...@@ -753,6 +753,7 @@ public class Correlation2d {
this.numSensors = numSensors; this.numSensors = numSensors;
this.monochrome = monochrome; this.monochrome = monochrome;
this.dtt = new DttRad2(transform_size); this.dtt = new DttRad2(transform_size);
this.dtt.setup_CSIIe(transform_size); // common for multiple threads, initializing on demand fails
this.transform_size = transform_size; this.transform_size = transform_size;
this.transform_len = transform_size * transform_size; this.transform_len = transform_size * transform_size;
this.corr_size = transform_size * 2 -1; this.corr_size = transform_size * 2 -1;
...@@ -799,6 +800,7 @@ public class Correlation2d { ...@@ -799,6 +800,7 @@ public class Correlation2d {
this.numSensors = numSensors; this.numSensors = numSensors;
this.monochrome = monochrome; this.monochrome = monochrome;
this.dtt = new DttRad2(transform_size); this.dtt = new DttRad2(transform_size);
this.dtt.setup_CSIIe(transform_size); // common for multiple threads, initializing on demand fails
this.transform_size = transform_size; this.transform_size = transform_size;
this.transform_len = transform_size * transform_size; this.transform_len = transform_size * transform_size;
this.corr_size = transform_size * 2 -1; this.corr_size = transform_size * 2 -1;
......
...@@ -1135,6 +1135,10 @@ public class DttRad2 { ...@@ -1135,6 +1135,10 @@ public class DttRad2 {
} }
} }
public void setup_CSIIe(int maxN){
setup_CIIe(maxN);
setup_SIIe(maxN);
}
private void setup_SIIe(int maxN){ private void setup_SIIe(int maxN){
if (maxN > N) setup_arrays(maxN); if (maxN > N) setup_arrays(maxN);
int l = ilog2(N); int l = ilog2(N);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment