Skip to content

Commit be97851

Browse files
jenshannoschwalmTurboGit
authored andcommitted
slightly improved demosaic DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU mode
If the demosaicer is in passthru mode we can use the fastest mode which is the bilinear mode of VNG.
1 parent ef593fc commit be97851

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/iop/demosaic.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ static dt_iop_demosaic_qual_flags_t demosaic_qual_flags(const dt_dev_pixelpipe_i
260260

261261
// we check if we can stop at the linear interpolation step in VNG
262262
// instead of going the full way
263-
if((flags & DT_DEMOSAIC_FULL_SCALE) && (roi_out->scale < (is_xtrans ? 0.5f : 0.667f)))
263+
if(((flags & DT_DEMOSAIC_FULL_SCALE) && (roi_out->scale < (is_xtrans ? 0.5f : 0.667f)))
264+
|| piece->pipe->mask_display == DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU)
264265
flags |= DT_DEMOSAIC_ONLY_VNG_LINEAR;
265266

266267
return flags;
@@ -628,7 +629,7 @@ void process(dt_iop_module_t *self,
628629
}
629630
// take care of passthru modes
630631
if(pipe->mask_display == DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU)
631-
demosaicing_method = is_xtrans ? DT_IOP_DEMOSAIC_MARKESTEIJN : DT_IOP_DEMOSAIC_RCD;
632+
demosaicing_method = is_xtrans ? DT_IOP_DEMOSAIC_VNG : DT_IOP_DEMOSAIC_VNG4;
632633
}
633634

634635
float *in = (float *)i;
@@ -785,7 +786,7 @@ int process_cl(dt_iop_module_t *self,
785786
}
786787
// take care of passthru modes
787788
if(pipe->mask_display == DT_DEV_PIXELPIPE_DISPLAY_PASSTHRU)
788-
demosaicing_method = is_xtrans ? DT_IOP_DEMOSAIC_MARKESTEIJN : DT_IOP_DEMOSAIC_RCD;
789+
demosaicing_method = is_xtrans ? DT_IOP_DEMOSAIC_VNG : DT_IOP_DEMOSAIC_VNG4;
789790
}
790791

791792
const int devid = pipe->devid;
@@ -852,7 +853,7 @@ int process_cl(dt_iop_module_t *self,
852853
}
853854
else if(demosaicing_method == DT_IOP_DEMOSAIC_VNG4 || demosaicing_method == DT_IOP_DEMOSAIC_VNG)
854855
{
855-
err = process_vng_cl(self, piece, in_image, out_image, roi_in, FALSE);
856+
err = process_vng_cl(self, piece, in_image, out_image, roi_in, qual_flags & DT_DEMOSAIC_ONLY_VNG_LINEAR);
856857
if(err != CL_SUCCESS) goto finish;
857858
}
858859
else if(base_demosaicing_method == DT_IOP_DEMOSAIC_MARKESTEIJN || base_demosaicing_method == DT_IOP_DEMOSAIC_MARKESTEIJN_3)

0 commit comments

Comments
 (0)