VSE: make Gamma Cross effect 4x faster #115801

Merged
Aras Pranckevicius merged 1 commits from aras_p/blender:vse-gammacross-opt into main 2023-12-06 19:37:11 +01:00

Gamma Cross code seems to be coming from year 2005 or earlier, with complex table based machinery to approximate "raise to power" calculations. Which, for Gamma Cross, have always been hardcoded to 2.0 "since forever". So simplify all that, i.e. replace all the table lookup/interpolation things with just x*x and sqrt(x).

Applying Gamma Cross on 4K UHD resolution, Windows Ryzen 5950X machine: 36.2ms -> 8.1ms

Gamma Cross code seems to be coming from year 2005 or earlier, with complex table based machinery to approximate "raise to power" calculations. Which, for Gamma Cross, have always been hardcoded to 2.0 "since forever". So simplify all that, i.e. replace all the table lookup/interpolation things with just `x*x` and `sqrt(x)`. Applying Gamma Cross on 4K UHD resolution, Windows Ryzen 5950X machine: 36.2ms -> 8.1ms
Aras Pranckevicius added 1 commit 2023-12-05 14:42:48 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
8a5bbb7967
VSE: speedup Gamma Cross effect
Gamma Cross code seems to be coming from year 2005 or earlier, with
complex table based machinery to approximate "raise to power"
calculations. Which, for Gamma Cross, have always been hardcoded to
2.0 "since forever". Which is either just "x*x" or "sqrt(x)".

So just do that. Applying Gamma Cross on 4K UHD resolution, Windows
Ryzen 5950X machine: 36.2ms -> 8.1ms
Author
Member

@blender-bot build

@blender-bot build
Aras Pranckevicius requested review from Richard Antalik 2023-12-05 16:29:42 +01:00
Aras Pranckevicius added this to the Video Sequencer project 2023-12-05 16:30:15 +01:00
Aras Pranckevicius changed title from VSE: speedup Gamma Cross effect to VSE: make Gamma Cross effect 4x faster 2023-12-06 08:52:19 +01:00
Richard Antalik approved these changes 2023-12-06 18:56:57 +01:00
Richard Antalik left a comment
Member

Nice simplification! I have hard time imagining the original code was faster even in 2005.

Nice simplification! I have hard time imagining the original code was faster even in 2005.
Author
Member

I have hard time imagining the original code was faster even in 2005

Around 2005 it was seemingly re-added from some other place. If it was written in 1999 or so, back when doing a square root was "unimaginable cost", then I could imagine an interpolating table lookup being faster :)

> I have hard time imagining the original code was faster even in 2005 Around 2005 it was seemingly re-added from some other place. If it was written in 1999 or so, back when doing a square root was "unimaginable cost", then I could imagine an interpolating table lookup being faster :)
Aras Pranckevicius merged commit 9cbc96194e into main 2023-12-06 19:37:11 +01:00
Aras Pranckevicius deleted branch vse-gammacross-opt 2023-12-06 19:37:13 +01:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#115801
No description provided.