aws / dcv-color-primitives

DCV Color Primitives Library
MIT No Attribution
30 stars 22 forks source link

rgb to yuv full-range improvements #75

Closed fabiosky closed 1 year ago

fabiosky commented 1 year ago

Issue #, if available:

Description of changes: The patch improves the rgb to yuv conversion when using full-range mode. In particular, conversion weights are adjusted to avoid integer overflow when converting the color space. This allows to make such conversions functionally equivalent to the narrow-range ones.

The weight generator script has been adjusted to account for overflow and at the same time minimize max conversion error. That error is printed while executing the script.

In order to provide a more stable platform for further improvements, the benchmark has been completely rewritten and takes into account:

Additionally on Linux the benchmark can output consumed CPU cycles instead of elapsed time.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

pbor commented 1 year ago

can you amend the "Improve rgb to yuv full-range performance" commit and include in the git commit message an explanation of the optimization?

If you are rebasing you can also squash the clippy commits in one, but that is less important

fabiosky commented 1 year ago

Changes addressed.