pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
304 stars 53 forks source link

Improve rotation performance by putting later in the decoding pipeline #7

Closed runfalk closed 7 years ago

runfalk commented 7 years ago

It now operates on 3 rather than 4 channels.

pedrocr commented 7 years ago

I see only a very slight performance improvement from this. 10ms in total perhaps. It still makes sense to do it though. I did have a suspicion that this allowed an extra optimization which was to replace buf.colors with 3 in src/imageops/transform.rs now that we know that the buffer is always 3 channels. That's about an 80ms speedup, want to add that commit to this PR?

runfalk commented 7 years ago

Since a rewrite of rotate_buffer is in the works I'd prefer to just merge this as it is.

pedrocr commented 7 years ago

Sounds good then. Just remember on the rewrite that you can assume buf.colors == 3. The optimizer likes to know those things :)