Skip to content

Draft: tests: generate cLUT profiles

Pekka Paalanen requested to merge pq/weston:wip/cluttest into main

This is modified from @vitalyp's !820 (closed). Compared to that:

  • Refactored color_util.c and added more helpers to make color manipulation easier.

  • Rewrote how the cLUT is created: compute cLUT entries directly instead of crafting a cms pipeline to compute them. All numerical range scaling is removed as multiProcessElements pipeline is fully float32, so negative and greater than 1.0 values paas it fine. Only need to be careful with all LUT elements as they clamp their inputs to [0.0, 1.0].

  • Refactor into build_curve_stage(): less code, easier to read, the same result.

  • Reinstated screenshots.

  • Fixed some memory leaks, and set up an lcms error logger in case LittleCMS gets unhappy.

Todo:

  • All commits titled squash: are intended to be squashed into Vitaly's cLUT patch.

  • Incorporate the device→PCS→device roundtrip check from !820 (comment 1379357) .

  • Not all memory leaks are fixed, but somehow ASan does not provide stack traces through liblcms2.so, so finding them is difficult.

  • When 3D LUT output is electrical, meaning we use the relatively sparse 3D LUT to apply inverse-EOTF (known to suffer from precision issues), the color errors become very high. This needs more investigation.

  • Remove the HACK that comments out currently failing tests, either by fixing or removing those test cases.

Merge request reports