Monthly Archive for October, 2010

Too early for 64 bits {on Mac OS X, obviously!}

Today I download Qt 4.7 for Mac. It includes the 64 bits version build on the Cocoa framework and I was really curious to see how it behaved.
Final result: it’s still too early for 64 bits! I had the GUI completely stucked and completely unexpected crashes. It looked like Windows!!! Nightmare!


This Monday I’ve got the first donation since I’ve started to work on this project. It was such a nice surprise, because I didn’t really expect anything from this work. I really want to thanks those who gave me some money to work on this project: they were really appreciated and they are the proof that there were some interest for this project around. For this reason, I’m going continue to improve the code and make Luminance better every release.

For those who don’t want to give money but own (not more needed) books about C++, Advanced programming or Qt library, I will surely accept them.

Thanks all,

Huge Commit!

Just a few minutes ago I made an huge commit changing 75 files! Most of these changes were trivial, but others were really deep and interesting. Let me summarize:

  • Qtpfsgui was born merging different tools in an unique solution. For this reason, some code is duplicated. The first modification was to get rid of pfstmo::Array2D. This class was a duplicate of pfs:Array2D, and infact I’m using this class now. Moreover, pfs::ChannelImpl was another duplicate of pfs::Array2D, so I got rid of this duplication too, removing the old implementation and implementing this class as a composition of Array2D. So, in a shot, I removed two duplications. And this is very most of the modifications came from.
  • Working on images, Luminance works mostly on vectors. So I added a new set of functions to Luminance, tailored to work on vectors using Intel SSE Intrinsics (fully supported by any modern compiler). This modification made a huge different in the processing time of Mantiuk06 (which is the first that I did implement with this new architecture). Unfortunately, being a new set of functions, they are not still free of bugs. So, if you spot any, let me know!
  • Colorspace conversion functions are now friend of pfs::Array2D. This allows to access directly the private data of the class and allows to use the vectorized functions even on these operations, highly increasing the performances. Similar optimizations were made on other functions (copy, cut, rotate), but not yet completed (they will be in the coming commits).
  • I’ve also started a clean up of the code: some files don’t own an header file, forcing a pre-declaration of the function explicitly. Not really a “normal” way of coding effectively.

I’m going to work using these techniques, trying to improve also the HDR creation process, which seems to be a weak point (probably due to the increase in mpixel of the current cameras) and the align function. Eventually, I will work on the GUI too…

OpenMP vs. SSE

Let me say a thing: I’m not against OpenMP! I think it’s a wonderful tool and I did use it in the past for several reasons, but I simply didn’t like how it was used in the Mantiuk06 implementation. In fact, most of the OpenMP directives in the code where just basic stuff, throw in the play just to see what happens. I don’t say that it was useless: there is a reasonable speed up in using OpenMP against a plain implementation, but it was the wrong technology to respond to the demand of better performance. Why? Because OpenMP was used on vectors, where SSE instructions are a tailored solution for this kind of problem and can achieve an higher speed up. So I decided to prove myself this idea and I took a piece of code from Mantiuk06 and I’ve tried to implement it in a couple of different why:

  • Plain implementation: let the compiler achieve the best it can!
  • OpenMP: more or less the plain implementation, but with an omp parallel for (exactly as it was found in Mantiuk06);
  • SSE: vectorized implementation using Intel SSE Intrinsics;
  • Apple Accelerate: basically an SSE implementation made by Apple for Apple Hardware.

The result confirmed my intuition and the SSE implementation was the faster in 3 different scenarios: only simulation running; one other high demanding process competing for the processor; two others high demanding processes competing with the simulation. This is why I disabled OpenMP in Luminance 2.0.1 (removing also annoying faults during Mantiuk06) and why the next version will use SSE. Graphs can be found here.

Luminance HDR 2.0.1: Windows Release

Here it is, the Windows Release of Luminance 2.0.1-1. While I was working at this release, I’ve found a bug in the memory management of Mantiuk (Thanks Franco). Hopefully, it should be fine now.

Download the new release and let me know if it works fine for you. If it doesn’t behave in the correct way, fill a bug in the Tracker showing exactly what you do to raise the problem.

[ Download here ]

Luminance HDR 2.0.1

After a long search, I’ve found what the error in LuminanceHDR was. And I fixed it!
Currently, the new 2.0.1 is just a general fix of the TM operators. This will make the output exactly equivalent to the one we used to have with qtpfsgui 1.9.3 (in some cases, even better).
This release includes the first Mac OS X edition of the 2.0.X branch and I expect a lot of feedback on it! A Windows version will be available soon (hopefully Giuseppe will make it for us soon). Obviously, for the Linux huggers, source code is ready for you to be compiled.

My plan for the future releases is:

  • go thru the bugs still open on the Tracker and try to fix as much as I can;
  • improve the Mac OS X build, using Apple libraries wherever it is possible, in order to improve throughput and overall user experience;
  • improve memory management, in order to avoid unneeded swap and crashes;
  • improve the user interface, trying to make it more understandable for the average user.

I would like to say thank you to Axel Voitier (patch on a critical race in the Mantiuk06 operator) and Elizabeth Oldham (patch that enables or disables UI features). Their help made LuminanceHDR better.

[ Download here ]