Project

General

Profile

Bug #12463

Bad interaction between denoise profile non local means + retouch in darkroom

Added by Aurélien PIERRE 9 months ago. Updated 9 months ago.

Status:
Fixed
Priority:
Medium
Assignee:
Category:
Darkroom
Target version:
Start date:
12/13/2018
Due date:
% Done:

100%

Estimated time:
Affected Version:
git master branch
System:
Debian
bitness:
64-bit
hardware architecture:
amd64/x86

Description

Using the provided raw and XMP stack :
1. zoom at 100 % in darkroom
2. enable/disable retouch

NB : denoise profile is set with default params in non-local means.

WITHOUT retouch enabled, denoise profile runs in 0.149 s:

557,524783 [dev] took 0,000 secs (0,000 CPU) to load the image.
557,560674 [dev_pixelpipe] took 0,000 secs (0,001 CPU) initing base buffer [preview]
557,560880 [dev_pixelpipe] took 0,000 secs (0,001 CPU) processed `point noir/blanc raw' on CPU, blended on CPU [preview]
557,561186 [dev_pixelpipe] took 0,000 secs (0,000 CPU) processed `balance des blancs' on CPU, blended on CPU [preview]
557,562894 [dev_pixelpipe] took 0,002 secs (0,008 CPU) processed `reconstruire hautes lumières' on CPU, blended on CPU [preview]
557,570433 [dev_pixelpipe] took 0,008 secs (0,035 CPU) processed `aberrations chromatiques' on CPU, blended on CPU [preview]
557,626757 [dev_pixelpipe] took 0,002 secs (0,009 CPU) initing base buffer [full]
557,629049 [dev_pixelpipe] took 0,002 secs (0,005 CPU) processed `point noir/blanc raw' on CPU, blended on CPU [full]
557,633805 [dev_pixelpipe] took 0,005 secs (0,029 CPU) processed `balance des blancs' on CPU, blended on CPU [full]
557,648064 [dev_pixelpipe] took 0,014 secs (0,110 CPU) processed `reconstruire hautes lumières' on CPU, blended on CPU [full]
557,701311 [dev_pixelpipe] took 0,131 secs (0,770 CPU) processed `dématriçage' on CPU, blended on CPU [preview]
557,709195 [dev_pixelpipe] took 0,061 secs (0,399 CPU) processed `aberrations chromatiques' on CPU, blended on CPU [full]
557,850379 [dev_pixelpipe] took 0,149 secs (1,076 CPU) processed `réduction du bruit (profil)' on CPU, blended on CPU [preview]
557,865247 [dev_pixelpipe] took 0,015 secs (0,113 CPU) processed `exposition' on CPU, blended on CPU [preview]
558,149299 [dev_pixelpipe] took 0,284 secs (2,183 CPU) processed `retouche' on CPU, blended on CPU [preview]
558,152240 [dev_pixelpipe] took 0,003 secs (0,011 CPU) processed `orientation' on CPU, blended on CPU [preview]
558,153567 [dev_pixelpipe] took 0,001 secs (0,014 CPU) processed `recadrer et pivoter' on CPU, blended on CPU [preview]
558,155204 [dev_pixelpipe] took 0,002 secs (0,007 CPU) processed `profil de couleur d'entrée' on CPU, blended on CPU [preview]
558,197819 [dev_pixelpipe] took 0,043 secs (0,288 CPU) processed `profil de couleur de sortie ' on CPU, blended on CPU [preview]
558,199729 [dev_pixelpipe] took 0,002 secs (0,008 CPU) processed `homogénéisation' on CPU, blended on CPU [preview]
558,201123 [dev_pixelpipe] took 0,001 secs (0,011 CPU) processed `gamma' on CPU, blended on CPU [preview]
558,206997 [dev_process_preview] pixel pipeline processing took 0,682 secs (4,612 CPU)

WITH retouch enabled, denoise profile runs in 82 s :

559,906001 [dev_pixelpipe] took 2,197 secs (13,956 CPU) processed `dématriçage' on CPU, blended on CPU [full]
642,686343 [dev_pixelpipe] took 82,780 secs (620,699 CPU) processed `réduction du bruit (profil)' on CPU, blended on CPU [full]
642,749310 [dev_pixelpipe] took 0,062 secs (0,319 CPU) processed `exposition' on CPU, blended on CPU [full]
645,923529 [dev_pixelpipe] took 3,174 secs (8,095 CPU) processed `retouche' on CPU, blended on CPU [full]
645,931021 [dev_pixelpipe] took 0,007 secs (0,054 CPU) processed `orientation' on CPU, blended on CPU [full]
645,936452 [dev_pixelpipe] took 0,005 secs (0,036 CPU) processed `recadrer et pivoter' on CPU, blended on CPU [full]
645,942685 [dev_pixelpipe] took 0,006 secs (0,029 CPU) processed `profil de couleur d'entrée' on CPU, blended on CPU [full]
646,064276 [dev_pixelpipe] took 0,122 secs (0,932 CPU) processed `profil de couleur de sortie ' on CPU, blended on CPU [full]
646,104009 [dev_pixelpipe] took 0,040 secs (0,074 CPU) processed `homogénéisation' on CPU, blended on CPU [full]
646,106854 [dev_pixelpipe] took 0,003 secs (0,022 CPU) processed `gamma' on CPU, blended on CPU [full]
646,107007 [dev_process_image] pixel pipeline processing took 88,582 secs (645,158 CPU)

That is with and without OpenCL.

System :
  • Debian GNU/Linux buster/sid
  • CPU Intel® Xeon(R) CPU E3-1505M v6 @ 3.00GHz × 8
  • GPU Nvidia Quadro M2200/PCIe/SSE2
  • RAM 32 Go

Deleting the healing spots on the global layer (first on the left) decreases the running time of denoise profile to 37 s.

This is not expected since retouch runs after denoise profile.

patdavid-Mairi_Troisieme.ORF.xmp (25 KB) patdavid-Mairi_Troisieme.ORF.xmp Aurélien PIERRE, 12/13/2018 05:56 PM
patdavid-Mairi_Troisieme.ORF (12.9 MB) patdavid-Mairi_Troisieme.ORF Aurélien PIERRE, 12/13/2018 05:57 PM

Associated revisions

Revision cfe9cecd (diff)
Added by Pascal Obry 9 months ago

retouch: fix computation of roi_in.

for non clone we want the area and not the source area.

Fixes #12463.

History

#1 Updated by Aurélien PIERRE 9 months ago

  • Description updated (diff)

#2 Updated by Aurélien PIERRE 9 months ago

  • Description updated (diff)

#3 Updated by Aurélien PIERRE 9 months ago

Notice that it does not affect zoom values < 100 % and the export.

#4 Updated by rawfiner - 9 months ago

What is the time of export on CPU?
Is it also 82s for denoise profile?
My intuition is that retouch may enlarge the size of the preview image (with modify_roi_in, in order to have all "sources" spots available), which would make non local means execute the preview on a potentially much bigger image.

#5 Updated by Aurélien PIERRE 9 months ago

The times given are on CPU, I didn't time the running on GPU but it's the same issue at the same magnitude on both CPU and GPU.

Retouch comes after denoise profile, so I don't see how both are related. Or modifiy_roi_in applies on the beginning of the pipe ?

#6 Updated by rawfiner - 9 months ago

Here is a great information hanatos gave me on the dev mailing list about the way the pipe works:

1) a pass of modify_roi_out() from raw to screen output is performed.
this is done full resolution, full region of interest, to determine
the hypothetical size of the output image when processed in full.

2) given the size and region of interest of the view window, the
develop module requests a certain input to be able to render the
output. this is done by calling a chain of modify_roi_in() from view
window back to raw image. this is only done on the exact pixels that
are needed on screen right now, i.e. scaled and cropped.

3) process() is called with about exactly the ROI that were computed

So yes, modify_roi_in happens before all the process calls

#7 Updated by Aurélien PIERRE 9 months ago

Ok, but still… from 0.15 to 82 s, surely something can be done. It's beyond usable in this setup.

#8 Updated by Aurélien PIERRE 9 months ago

rawfiner - wrote:

What is the time of export on CPU?

sorry, I missed that. The picture exports in 15-20 s or so (I haven't timed it, but it's far less than the preview rendering).

#9 Updated by rawfiner - 9 months ago

Alright, these 15-20 seconds should be a maximum, so there is surely a bug somewhere. We can try to print the width and height of the picture during the process of denoise profiled to check that it remains smaller than the real width and height of the image. I will do that when I find some time (maybe this week end)

#10 Updated by Aurélien PIERRE 9 months ago

I just timed it : on CPU @ full res, it takes 28 s:

81,776687 [export] creating pixelpipe took 0,014 secs (0,037 CPU)
81,858739 [dev_pixelpipe] took 0,004 secs (0,022 CPU) initing base buffer [export]
81,863179 [dev_pixelpipe] took 0,004 secs (0,022 CPU) processed `point noir/blanc raw' on CPU, blended on CPU [export]
81,867608 [dev_pixelpipe] took 0,004 secs (0,025 CPU) processed `balance des blancs' on CPU, blended on CPU [export]
81,888093 [dev_pixelpipe] took 0,020 secs (0,157 CPU) processed `reconstruire hautes lumières' on CPU, blended on CPU [export]
81,962108 [dev_pixelpipe] took 0,074 secs (0,449 CPU) processed `aberrations chromatiques' on CPU, blended on CPU [export]
82,965932 [dev_pixelpipe] took 1,004 secs (6,161 CPU) processed `dématriçage' on CPU, blended on CPU [export]
84,443711 [dev_pixelpipe] took 1,478 secs (9,467 CPU) processed `réduction du bruit (profil)' on CPU, blended on CPU [export]
100,278028 [dev_pixelpipe] took 15,834 secs (120,220 CPU) processed `réduction du bruit (profil)' on CPU, blended on CPU [export]
100,299646 [dev_pixelpipe] took 0,022 secs (0,151 CPU) processed `exposition' on CPU, blended on CPU [export]
101,734669 [dev_pixelpipe] took 1,435 secs (3,564 CPU) processed `retouche' on CPU, blended on CPU [export]
102,234528 [dev_pixelpipe] took 0,500 secs (3,696 CPU) processed `correction des objectifs' on CPU, blended on CPU [export]
102,265339 [dev_pixelpipe] took 0,031 secs (0,220 CPU) processed `orientation' on CPU, blended on CPU [export]
102,284753 [dev_pixelpipe] took 0,019 secs (0,146 CPU) processed `recadrer et pivoter' on CPU, blended on CPU [export]
102,301080 [dev_pixelpipe] took 0,016 secs (0,113 CPU) processed `profil de couleur d'entrée' on CPU, blended on CPU [export]
102,375494 [dev_pixelpipe] took 0,074 secs (0,562 CPU) processed `balance couleur' on CPU, blended on CPU [export]
104,403594 [dev_pixelpipe] took 2,028 secs (9,987 CPU) processed `balance couleur 1' on CPU, blended on CPU [export]
106,487741 [dev_pixelpipe] took 2,084 secs (10,061 CPU) processed `balance couleur 2' on CPU, blended on CPU [export]
107,972488 [dev_pixelpipe] took 1,485 secs (11,603 CPU) processed `égaliseur' on CPU, blended on CPU [export]
108,953235 [dev_pixelpipe] took 0,981 secs (5,470 CPU) processed `contraste local' on CPU, blended on CPU [export]
109,079741 [dev_pixelpipe] took 0,126 secs (0,856 CPU) processed `filmique' on CPU, blended on CPU [export]
109,126085 [dev_pixelpipe] took 0,046 secs (0,285 CPU) processed `courbe des tonalités' on CPU, blended on CPU [export]
109,172032 [dev_pixelpipe] took 0,046 secs (0,332 CPU) processed `renforcer la netteté' on CPU, blended on CPU [export]
109,932702 [dev_pixelpipe] took 0,761 secs (1,148 CPU) processed `filtre passe-haut' on CPU, blended on CPU [export]
110,519533 [dev_pixelpipe] took 0,587 secs (4,607 CPU) processed `profil de couleur de sortie ' on CPU, blended on CPU [export]
110,665832 [dev_pixelpipe] took 0,146 secs (0,275 CPU) processed `homogénéisation' on CPU, blended on CPU [export]
110,676328 [dev_pixelpipe] took 0,010 secs (0,081 CPU) processed `gamma' on CPU, blended on CPU [export]
110,676388 [dev_process_export] pixel pipeline processing took 28,900 secs (189,881 CPU)
[export_job] exported to `/home/aurelien/Téléchargements/patdavid-Mairi_Troisieme_09.jpg'

#11 Updated by Pascal Obry 9 months ago

  • Priority changed from Low to Medium
  • Assignee set to Pascal Obry
  • Category set to Darkroom

Can you test this: https://github.com/darktable-org/darktable/pull/1901

I'd like to include it in RC2 if possible.

#12 Updated by Anonymous 9 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Fixed

Also available in: Atom PDF

Go to top