Avoid divisions creating sample points in the float cube LUT builder
commit5bc47112d6be524ab82b8f9afc0b67a832e32380
authornoel <noel@chromium.org>
Tue, 3 Feb 2015 22:58:43 +0000 (3 14:58 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 3 Feb 2015 23:01:01 +0000 (3 23:01 +0000)
treefba528d0cabcd2692fcc07583decdb46d0bfd628
parent31a6f70b8a22930cc749a67a90c6e7e3778f8466
Avoid divisions creating sample points in the float cube LUT builder

Cube samplers create input sample points in some order. Document the QCMS
order (x,y,z) which is the same as OSX ColorSync and cube LUT interchange
standards such as the Adobe Cube LUT Specification 1.0, 2013. The samples
are RGB order with R changing the slowest, B the fastest.

Hoist the division out of the sample point creation loop: takes 0.0003939
seconds on MacAir for 32^3 sample points, 0.0001619 with hoisting. That's
fine, but small beans compared to the overall costs of cube creation. The
majorty of the work is in qcms_chain_transform (8ms) where floating-point
is used to maintain transform precision.

The output ColorCube LUT produced by qcms_chain_transform is indexed into
transform in RGB order (time cost ~0). Add comments about order.

BUG=443863

Review URL: https://codereview.chromium.org/863233003

Cr-Commit-Position: refs/heads/master@{#314425}
third_party/qcms/README.chromium
third_party/qcms/src/transform.c