Files
test2/source
Aras Pranckevicius 04cb3c1bbd VSE: Faster Histogram scope calculation
Histogram was calculated by copying the rendered image, transforming it
into display space, and calculating the histogram on that. On large
resolutions, this copy+transform+free of the temporary image was taking
up majority of the time. Especially for default use case when the
display transform is a no-op.

Change the code so that display transform, if needed, is done directly
inside histogram calculation, without needing a full-size temporary image.

Performance of histogram calculation, on Ryzen 5950X (Windows), on
a 4K resolution image, with default color management settings:
- PNG (SDR): 3.9 -> 0.9ms
- EXR (HDR): 41.3 -> 6.3ms

With display colorspace (P3) that is different than the sequencer
colorspace (sRGB):
- PNG (SDR): 25.3 -> 11.3ms
- EXR (HDR): 64.9 -> 10.6ms

It also fixes calculation of histogram on float (HDR) images that have
alpha channel; the histogram was wrongly calculated on premultiplied
color values, which was not consistent with how it was calculated
on the byte images.

Pull Request: https://projects.blender.org/blender/blender/pulls/143175
2025-07-28 18:39:01 +02:00
..