Merge
Demosaicing and pre-processing parameters selectable for each image. Dark frames subtraction and badpixels file support Fast loading in editor.
This commit is contained in:
@@ -31,13 +31,12 @@
|
||||
|
||||
template<class T> void gaussHorizontal3 (T** src, T** dst, T* buffer, int W, int H, const float c0, const float c1, bool multiThread) {
|
||||
|
||||
#pragma omp parallel for if (multiThread)
|
||||
for (int i=0; i<H; i++) {
|
||||
|
||||
#ifdef _OPENMP
|
||||
T* temp = buffer + omp_get_thread_num() * W;
|
||||
#else
|
||||
T* temp = buffer;
|
||||
#pragma omp for
|
||||
#endif
|
||||
for (int i=0; i<H; i++) {
|
||||
T* temp = buffer;
|
||||
for (int j=1; j<W-1; j++)
|
||||
temp[j] = (T)(c1 * (src[i][j-1] + src[i][j+1]) + c0 * src[i][j]);
|
||||
dst[i][0] = src[i][0];
|
||||
@@ -48,13 +47,12 @@ template<class T> void gaussHorizontal3 (T** src, T** dst, T* buffer, int W, int
|
||||
|
||||
template<class T> void gaussVertical3 (T** src, T** dst, T* buffer, int W, int H, const float c0, const float c1, bool multiThread) {
|
||||
|
||||
#pragma omp parallel for if (multiThread)
|
||||
for (int i=0; i<W; i++) {
|
||||
//#pragma omp parallel for if (multiThread)
|
||||
#ifdef _OPENMP
|
||||
T* temp = buffer + omp_get_thread_num() * H;
|
||||
#else
|
||||
T* temp = buffer;
|
||||
#pragma omp for
|
||||
#endif
|
||||
for (int i=0; i<W; i++) {
|
||||
T* temp = buffer;
|
||||
for (int j = 1; j<H-1; j++)
|
||||
temp[j] = (T)(c1 * (src[j-1][i] + src[j+1][i]) + c0 * src[j][i]);
|
||||
dst[0][i] = src[0][i];
|
||||
@@ -114,14 +112,10 @@ template<class T> void gaussHorizontal (T** src, T** dst, AlignedBuffer<double>*
|
||||
for (int i=0; i<3; i++)
|
||||
for (int j=0; j<3; j++)
|
||||
M[i][j] /= (1.0+b1-b2+b3)*(1.0+b2+(b1-b3)*b3);
|
||||
|
||||
#pragma omp parallel for if (multiThread)
|
||||
// if (multiThread)
|
||||
#pragma omp for
|
||||
for (int i=0; i<H; i++) {
|
||||
#ifdef _OPENMP
|
||||
double* temp2 = buffer->data + omp_get_thread_num() * W;
|
||||
#else
|
||||
double* temp2 = buffer->data;
|
||||
#endif
|
||||
temp2[0] = B * src[i][0] + b1*src[i][0] + b2*src[i][0] + b3*src[i][0];
|
||||
temp2[1] = B * src[i][1] + b1*temp2[0] + b2*src[i][0] + b3*src[i][0];
|
||||
temp2[2] = B * src[i][2] + b1*temp2[1] + b2*temp2[0] + b3*src[i][0];
|
||||
@@ -192,14 +186,11 @@ template<class T> void gaussVertical (T** src, T** dst, AlignedBuffer<double>* b
|
||||
for (int i=0; i<3; i++)
|
||||
for (int j=0; j<3; j++)
|
||||
M[i][j] /= (1.0+b1-b2+b3)*(1.0+b2+(b1-b3)*b3);
|
||||
|
||||
#pragma omp parallel for if (multiThread)
|
||||
for (int i=0; i<W; i++) {
|
||||
#ifdef _OPENMP
|
||||
double* temp2 = buffer->data + omp_get_thread_num() * H;
|
||||
#else
|
||||
double* temp2 = buffer->data;
|
||||
#pragma omp for
|
||||
#endif
|
||||
for (int i=0; i<W; i++) {
|
||||
double* temp2 = buffer->data;
|
||||
temp2[0] = B * src[0][i] + b1*src[0][i] + b2*src[0][i] + b3*src[0][i];
|
||||
temp2[1] = B * src[1][i] + b1*temp2[0] + b2*src[0][i] + b3*src[0][i];
|
||||
temp2[2] = B * src[2][i] + b1*temp2[1] + b2*temp2[0] + b3*src[0][i];
|
||||
|
Reference in New Issue
Block a user