Skip to content

Commit e3b46e6

Browse files
committed
first non working pixelshift debayer candidate
1 parent 9d83edd commit e3b46e6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/develop/pixelpipe_hb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ static int dt_dev_pixelpipe_process_rec(dt_dev_pixelpipe_t *pipe, dt_develop_t *
13181318
{
13191319
#ifdef _OPENMP
13201320
#pragma omp parallel for default(none) \
1321-
dt_omp_firstprivate(bpp, cp_height, cp_width, in_x, in_y) \
1321+
dt_omp_firstprivate(bpp, cp_height, cp_width, in_x, in_y, frames) \
13221322
shared(pipe, roi_out, roi_in, output) \
13231323
schedule(static)
13241324
#endif

src/iop/demosaic.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2951,7 +2951,7 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29512951
for(int f = 0; f < 4; ++f)
29522952
{
29532953
frames_in[f] = in + (f * roi_in->width * roi_in->height);
2954-
fprintf(stderr, "frame %i: %p\n", f, frames_in[f]);
2954+
//fprintf(stderr, "frame %i: %p\n", f, frames_in[f]);
29552955
}
29562956

29572957
if(piece->dsc_out.channels != 4)
@@ -2972,30 +2972,33 @@ void process_pixelshift(dt_dev_pixelpipe_iop_t *piece, const float *const in, fl
29722972
//const size_t ox = roi_in->x;
29732973
//const size_t oy = roi_in->y;
29742974

2975+
const size_t col_offset = 1;
2976+
const size_t row_offset = roi_out->width;
2977+
29752978
size_t pout = 0;
29762979
//size_t pin = 0;
29772980
size_t pin3 = 0;
2978-
for(size_t j = 0; j < roi_out->height; j++)
2981+
for(size_t j = 1; j < roi_out->height-1; j++)
29792982
{
2980-
for(size_t i = 0; i < roi_out->width; i++)
2983+
for(size_t i = 1; i < roi_out->width-1; i++)
29812984
{
29822985
pout = (size_t)4 * (((size_t)roi_out->width * j) + i);
29832986
//pin = (roi_in->width * (j + oy)) + ox + i;
29842987
///TODO why do i ignore offset of input roi?
29852988
pin3 = (roi_in->width * j) + i;
29862989

2987-
if(pout+3 >= ((size_t)4*((size_t)roi_out->height*roi_out->width)))
29882990
{
2989-
fprintf(stderr,"output overflow\n");
2991+
out[pout+0] = frames_in[0][pin3];
2992+
out[pout+1] = (frames_in[1][pin3-col_offset] + frames_in[2][pin3-col_offset-row_offset])/2.0f;
2993+
out[pout+2] = frames_in[3][pin3-row_offset];
29902994
}
29912995

2992-
for(size_t c=0;c<3;++c)
2996+
/*for(size_t c=0;c<3;++c)
29932997
{
2994-
out[pout+c] = (frames_in[2])[pin3];
2995-
}
2998+
out[pout+c] = (frames_in[c])[pin3];
2999+
}*/
29963000
}
29973001
}
2998-
//fprintf(stderr,"pout: %lu\n", pout+4);
29993002
}
30003003

30013004

0 commit comments

Comments
 (0)