diff --git a/rtengine/vng4_demosaic_RT.cc b/rtengine/vng4_demosaic_RT.cc index 0e7d8e0f9..500590b04 100644 --- a/rtengine/vng4_demosaic_RT.cc +++ b/rtengine/vng4_demosaic_RT.cc @@ -210,9 +210,7 @@ void RawImageSource::vng4_demosaic (const array2D &rawData, array2D &rawData, array2D &rawData, array2D &rawData, array2D &rawData, array2D firstRow) { - interpolate_row_rb_mul_pp (rawData, red[row - 1], blue[row - 1], green[row - 2], green[row - 1], green[row], row - 1, 1.0, 1.0, 1.0, 0, W, 1); + interpolate_row_rb_mul_pp(rawData, red[row - 1], blue[row - 1], green[row - 2], green[row - 1], green[row], row - 1, 1.0, 1.0, 1.0, 0, W, 1); } if(plistenerActive) { @@ -314,22 +306,24 @@ void RawImageSource::vng4_demosaic (const array2D &rawData, array2D 2 && firstRow < H - 3) { - interpolate_row_rb_mul_pp (rawData, red[firstRow], blue[firstRow], green[firstRow - 1], green[firstRow], green[firstRow + 1], firstRow, 1.0, 1.0, 1.0, 0, W, 1); + interpolate_row_rb_mul_pp(rawData, red[firstRow], blue[firstRow], green[firstRow - 1], green[firstRow], green[firstRow + 1], firstRow, 1.0, 1.0, 1.0, 0, W, 1); } if (lastRow > 2 && lastRow < H - 3) { - interpolate_row_rb_mul_pp (rawData, red[lastRow], blue[lastRow], green[lastRow - 1], green[lastRow], green[lastRow + 1], lastRow, 1.0, 1.0, 1.0, 0, W, 1); + interpolate_row_rb_mul_pp(rawData, red[lastRow], blue[lastRow], green[lastRow - 1], green[lastRow], green[lastRow + 1], lastRow, 1.0, 1.0, 1.0, 0, W, 1); + } +#ifdef _OPENMP + #pragma omp single +#endif + { + // let the first thread, which is out of work, do the border interpolation + border_interpolate2(W, H, 3, rawData, red, green, blue); } } + free (code[0][0]); free (image); - if(plistenerActive) { - plistener->setProgress (0.98); - } - - border_interpolate2(W, H, 3, rawData, red, green, blue); - if(plistenerActive) { plistener->setProgress (1.0); }