Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.91k stars 323 forks source link

ICC cam profile speedups and cleanups #1313

Closed Beep6581 closed 9 years ago

Beep6581 commented 9 years ago

Originally reported on Google Code with ID 1329

Since we internally discussed to improve the communication about our work on patches,
I'll start off and announce I'm working on the above issues. As I already centralized
the conversion once it should not disturb other devs, and I guess noone has a problem
with speedups.

Reported by oduis@hotmail.com on 2012-04-18 07:08:52

Beep6581 commented 9 years ago
Great to hear, Olli, most welcome issue!

Reported by michaelezra000 on 2012-04-19 13:10:27

Beep6581 commented 9 years ago
Thanks Michael, here we go...

Reported by oduis@hotmail.com on 2012-04-19 14:47:50

Beep6581 commented 9 years ago
Olli, I tried the patch but could not measure the speed difference - I tried D700 NEF
conversion with neutral profile and working space and output space set to ProPhoto
into TIF-16 w/o compression.

Reported by michaelezra000 on 2012-04-19 21:34:39

Beep6581 commented 9 years ago
It just increases speed when using ICC camera profiles (e.g. the Nikon ones, or the
old ones), on my machine it was around 100ms. To measure, Search for ExecCMSTrans,
include "windows.h", and then

DWORD start=GetTickCount();

[.. code to measire]
printf("It took %i ms", GetTickCount()-start);

Reported by oduis@hotmail.com on 2012-04-20 05:32:09

Beep6581 commented 9 years ago
Just measured again: the specific milliseconds gain depends on profile and image of
course, but the relative gain is constant around -33% processing time on my setup.
But I just got 2 cores, your I5 should will probably see more relative gains.

Reported by oduis@hotmail.com on 2012-04-20 11:24:04

Beep6581 commented 9 years ago
Ok i did not use input icc profilre i mytest.
Do you think a similar approach can be used for conversions into working space and
also from working space to output space? 

Reported by michaelezra000 on 2012-04-20 12:47:26

Beep6581 commented 9 years ago
Good question, I already optimized the other calls of LCMS before. However there was
one position where it wasn't worth the effort (output profile), since it's a faster
transformation and it's not used in the critical preview mode. But since the parallelization
is now centralized, it's easy to reused there, so here it is.

Reported by oduis@hotmail.com on 2012-04-20 14:23:38

Beep6581 commented 9 years ago
Hi Olli, my results with the last patch, now I also used input ICC profile. Top is before
patch, bottom is after. Great improvement!

Reported by michaelezra000 on 2012-04-20 15:38:11

Beep6581 commented 9 years ago
Nice, thanks for testing! However I wonder why it improved so much. That's really just
one conversion? Or a batch queue folder?

Reported by oduis@hotmail.com on 2012-04-20 15:58:05

Beep6581 commented 9 years ago
just One. I will redo a bit later today in a cleaner environment (I had live meeting
running on background, although did not see that it was using much resources at all)

Reported by michaelezra000 on 2012-04-20 19:37:19

Beep6581 commented 9 years ago
No problem, no need to measure more detailed, I guess it's enough you made sure it's
faster. Though it's tested and the core didn't change for a day, I'll leave it here
till tomorrow to be sure.

Reported by oduis@hotmail.com on 2012-04-20 20:00:25

Beep6581 commented 9 years ago
Ok. To answer your prev question - that was test for a single nef saved via queue.

Reported by michaelezra000 on 2012-04-20 20:13:05

Beep6581 commented 9 years ago
Thanks for testing, committed to DEFAULT.

Reported by oduis@hotmail.com on 2012-04-21 07:16:21

Beep6581 commented 9 years ago
Michael, could you delete the images? Storage quota exceeded...

Reported by oduis@hotmail.com on 2012-04-21 21:00:37