Unstable output w/ same PP3 and RAW CA auto-correction when image height % 2 == 1, fixes #3258
This commit is contained in:
@@ -197,7 +197,7 @@ void RawImageSource::CA_correct_RT(const double cared, const double cablue, cons
|
|||||||
|
|
||||||
// assign working space
|
// assign working space
|
||||||
constexpr int buffersize = 3 * sizeof(float) * ts * ts + 6 * sizeof(float) * ts * tsh + 8 * 64 + 63;
|
constexpr int buffersize = 3 * sizeof(float) * ts * ts + 6 * sizeof(float) * ts * tsh + 8 * 64 + 63;
|
||||||
char *buffer = (char *) calloc(buffersize, 1);
|
char *buffer = (char *) malloc(buffersize);
|
||||||
char *data = (char*)( ( uintptr_t(buffer) + uintptr_t(63)) / 64 * 64);
|
char *data = (char*)( ( uintptr_t(buffer) + uintptr_t(63)) / 64 * 64);
|
||||||
|
|
||||||
// shift the beginning of all arrays but the first by 64 bytes to avoid cache miss conflicts on CPUs which have <=4-way associative L1-Cache
|
// shift the beginning of all arrays but the first by 64 bytes to avoid cache miss conflicts on CPUs which have <=4-way associative L1-Cache
|
||||||
@@ -231,6 +231,7 @@ void RawImageSource::CA_correct_RT(const double cared, const double cablue, cons
|
|||||||
#pragma omp for collapse(2) schedule(dynamic) nowait
|
#pragma omp for collapse(2) schedule(dynamic) nowait
|
||||||
for (int top = -border ; top < height; top += ts - border2)
|
for (int top = -border ; top < height; top += ts - border2)
|
||||||
for (int left = -border; left < width; left += ts - border2) {
|
for (int left = -border; left < width; left += ts - border2) {
|
||||||
|
memset(buffer, 0, buffersize);
|
||||||
const int vblock = ((top + border) / (ts - border2)) + 1;
|
const int vblock = ((top + border) / (ts - border2)) + 1;
|
||||||
const int hblock = ((left + border) / (ts - border2)) + 1;
|
const int hblock = ((left + border) / (ts - border2)) + 1;
|
||||||
const int bottom = min(top + ts, height + border);
|
const int bottom = min(top + ts, height + border);
|
||||||
@@ -730,6 +731,7 @@ void RawImageSource::CA_correct_RT(const double cared, const double cablue, cons
|
|||||||
|
|
||||||
for (int top = -border; top < height; top += ts - border2)
|
for (int top = -border; top < height; top += ts - border2)
|
||||||
for (int left = -border; left < width; left += ts - border2) {
|
for (int left = -border; left < width; left += ts - border2) {
|
||||||
|
memset(buffer, 0, buffersize);
|
||||||
float lblockshifts[2][2];
|
float lblockshifts[2][2];
|
||||||
const int vblock = ((top + border) / (ts - border2)) + 1;
|
const int vblock = ((top + border) / (ts - border2)) + 1;
|
||||||
const int hblock = ((left + border) / (ts - border2)) + 1;
|
const int hblock = ((left + border) / (ts - border2)) + 1;
|
||||||
|
Reference in New Issue
Block a user