Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/common/ai/restore_raw_linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ int dt_restore_raw_linear_preview_piped(dt_restore_context_t *ctx,
}
const size_t pix = (size_t)sr_raw * raw_w + sc_raw;

if(is_linear)
if(is_linear && mip_channels >= 3)
{
// float mipmaps are already in [0, 1]; uint16 needs un-prepare
for(int c = 0; c < 3; c++)
Expand All @@ -1136,6 +1136,12 @@ int dt_restore_raw_linear_preview_piped(dt_restore_context_t *ctx,
}
}
}
else if(is_linear)
Comment thread
andriiryzhkov marked this conversation as resolved.
{
// 4BAYER (CYGM/RGBE) classified as LINEAR but has mip_channels==1.
// no canonical RGB→CYGM/RGBE mapping; leave the original mosaic
// pixel untouched (already in `patched` from the memcpy above)
}
else
{
// X-Trans: re-mosaic
Expand Down
10 changes: 7 additions & 3 deletions src/libs/neural_restore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,10 @@ static int _process_raw_denoise_one(dt_neural_job_t *j,
// most LINEAR-class inputs are computational raws (Apple
// ProRAW, Google HDR+, etc.) that have already been denoised
// on-device; the model will run but adds little; Canon/Nikon
// sRAW is the exception; warn once per job and proceed
if(!j->linear_warned)
// sRAW is the exception; warn once per job and proceed.
// 4BAYER (CYGM/RGBE) piggybacks on LINEAR class but isn't a
// computational raw — skip the misleading toast
if(!j->linear_warned && !(flags & DT_IMAGE_4BAYER))
{
j->linear_warned = TRUE;
dt_control_log(_("raw denoise: this image is already pre-demosaiced "
Expand Down Expand Up @@ -2720,8 +2722,10 @@ static gpointer _preview_thread_raw(gpointer data)

// same caveat as the batch path: LINEAR is usually a computational
// raw that's already been denoised on-device. warn once per imgid
// so picking a different patch doesn't re-toast
// so picking a different patch doesn't re-toast. 4BAYER piggybacks
// on LINEAR class but isn't computational — skip the toast for it
if(cls == DT_RESTORE_SENSOR_CLASS_LINEAR
&& !(img_meta.flags & DT_IMAGE_4BAYER)
&& d->preview_linear_warned_imgid != pd->imgid)
{
d->preview_linear_warned_imgid = pd->imgid;
Expand Down
Loading