News for hackers. Stuff that matters.
Re:I accidentally Blender VSE by unwind on Thursday February 08, 2024 @03:56PM (#39307574)
Very impressive, and it's of course quite clear that the OP didn't just walk off the street into Blender HQ. Many years of experience at Unity is probably quite helpful when it comes to knowing the domain. :)

This change [1] was my favorite, optimizing an image processing step by removing lots (and I do mean lots) of table-based "optimizations" and replacing them with just straight up floating point calculation, and making it ~4X faster on the OP's machine. Fantastic!

[1]: https://projects.blender.org/blender/blender/pulls/115801/fi...

Re:I accidentally Blender VSE by celegans25 on Thursday February 08, 2024 @07:09PM (#39309609)
> and replacing them with just straight up floating point calculation Not only that, the diff replaces 100-150 lines of code with 3. That's the kind of pull request I can only dream of making
Re:I accidentally Blender VSE by mwkaufma on Friday February 09, 2024 @01:30AM (#39312033)
Hardcoding gamma=2 is doing the heavy lifting, though.
Re:I accidentally Blender VSE by olddustytrail on Friday February 09, 2024 @04:13PM (#39320617)
Gamma always equals 2, so it's a natural optimization. Assuming of course you are 0 indexing the alphabet.
Re:I accidentally Blender VSE by nnevatie on Friday February 09, 2024 @01:36AM (#39312077)
Yeah a nice optimization, but is "return c * c;" really a good approximation of sRGB gamma?
Re:I accidentally Blender VSE by aras_p on Friday February 09, 2024 @02:58AM (#39312540)
No it's not. But, the previous code was already effectively doing "c * c" for the last 15 years. So for now, just keep doing that, a bit faster.

A more proper way would be to do proper color-space aware luma calculation. Which under default settings is sRGB indeed, but not necessarily so (VSE can be set to operate in some other color space). Someday!

Re:I accidentally Blender VSE by nnevatie on Friday February 09, 2024 @04:51AM (#39313218)
Yes, it's weird they used 2.0 in the original code too. Doing proper gamma for any regular space (sRGB, YUV Rec.705, etc.) isn't actually that heavy (even without LUTs).
Re:I accidentally Blender VSE by aras_p on Friday February 09, 2024 @04:56AM (#39313252)
My guess is that the code was written by someone in 1995 back when no one understood color spaces, or something (it's hard to track down who and when wrote it exactly due to all file moves and refactors etc.)