VSE: add Bicubic filtering option, and optimize bicubic performance #117100

Merged
Aras Pranckevicius merged 4 commits from aras_p/blender:vse_bicubic into main 2024-01-15 16:38:49 +01:00

Part of overall "improve filtering situation" (#116980) task:

  • Add Bicubic filtering option to strip Transform "Filter" setting. Previously this option only existed in Transform Effect "Interpolation" setting.
    • With this addition, it feels like the transform effect could possibly be marked as legacy/deprecated, since the regular Transform that is on all strips can do everything that Transform Effect did? I think.
  • Speed up bicubic filtering (used now in VSE, but also in CPU Compositor, image paint, etc.) by slightly simplifying the code and using some SIMD. Upscaling 96x54 image to 3840x2160 resolution, using Bicubic filtering:
    • Windows (VS2022, Ryzen 5950X): 35.5ms -> 15.1ms
    • Mac (clang 15, M1 Max): 29.6ms -> 24.4ms
  • Add gtest coverage for bicubic functionality.

Filtering look comparison, Nearest, Bilinear and (new) Bicubic. As expected, Bicubic is most useful when scaling images up.

The actual Bicubic filter kind was not changed, i.e. it's the same math that already existed in the code (as well as Cycles and Eevee). Turns out it's the "slightly blurry" kind, i.e. a Mitchell-Netrevali filter with B=1 C=0 parameters which is in the "stuff's blurry!" area, instead of B=C=1/3 as recommended by literature normally. But that's a question/topic for some other day.

Part of overall "improve filtering situation" (#116980) task: - Add Bicubic filtering option to strip Transform "Filter" setting. Previously this option only existed in Transform Effect "Interpolation" setting. - With this addition, it feels like the transform effect could possibly be marked as legacy/deprecated, since the regular Transform that is on all strips can do everything that Transform Effect did? I think. - Speed up bicubic filtering (used now in VSE, but also in CPU Compositor, image paint, etc.) by slightly simplifying the code and using some SIMD. Upscaling 96x54 image to 3840x2160 resolution, using Bicubic filtering: - Windows (VS2022, Ryzen 5950X): 35.5ms -> 15.1ms - Mac (clang 15, M1 Max): 29.6ms -> 24.4ms - Add gtest coverage for bicubic functionality. Filtering look comparison, Nearest, Bilinear and (new) Bicubic. As expected, Bicubic is most useful when scaling images up. ![](/attachments/f0b546bc-71b9-4516-911d-c4a17366e9bc) The actual Bicubic filter kind was not changed, i.e. it's the same math that already existed in the code (as well as Cycles and Eevee). Turns out it's the "slightly blurry" kind, i.e. a Mitchell-Netrevali filter with B=1 C=0 parameters which is in the "stuff's blurry!" area, instead of B=C=1/3 as recommended by literature normally. But that's a question/topic for some other day.
Author
Member

@blender-bot build

@blender-bot build
Aras Pranckevicius changed title from WIP: VSE: add Bicubic filtering option, and optimize bicubic performance to VSE: add Bicubic filtering option, and optimize bicubic performance 2024-01-13 22:17:37 +01:00
Aras Pranckevicius added this to the Video Sequencer project 2024-01-13 22:17:53 +01:00
Aras Pranckevicius requested review from Sergey Sharybin 2024-01-13 22:18:04 +01:00

Thanks for looking into this!

For the development processes purposes such things are typically split into several incremental steps, for the ease of review, presentation, and possible re-iteration if something fishy is found out later on. In this case it would be much better to have the following commits:

  • Conversion from C to C++ (for which you don't really need a review, just ensure no warnings are introduced on different platforms)
  • Optimization of the existing code
  • Addition of Bicubic filtering in VSE

Is such a split something you'd have time for, or would you rather us to take care of it?

Thanks for looking into this! For the development processes purposes such things are typically split into several incremental steps, for the ease of review, presentation, and possible re-iteration if something fishy is found out later on. In this case it would be much better to have the following commits: - Conversion from C to C++ (for which you don't really need a review, just ensure no warnings are introduced on different platforms) - Optimization of the existing code - Addition of Bicubic filtering in VSE Is such a split something you'd have time for, or would you rather us to take care of it?
Author
Member

@Sergey by "commits", you mean submit these steps as separate PRs? (since this PR does have multiple commits already, quite similar to your steps)

@Sergey by "commits", you mean submit these steps as separate PRs? (since this PR does have multiple commits already, quite similar to your steps)

@aras_p I'd be fine if those are different commits in the single PR. At the end of the day it's probably will be me revieweing them anyway.

The commits are indeed organized almost like this. It feels that:

  • The PR description contains more interesting details. For example, it references the design task for the VSE part
  • The gcc fix seems need to be squished into the optimization commit
  • The cleanup commits needs to be squished to the commit which added detailed description of what bicubic means exactly

So easy janitorial to make git history cleaner and more readable, and easier to bisect.

@aras_p I'd be fine if those are different commits in the single PR. At the end of the day it's probably will be me revieweing them anyway. The commits are indeed organized almost like this. It feels that: - The PR description contains more interesting details. For example, it references the design task for the VSE part - The gcc fix seems need to be squished into the optimization commit - The cleanup commits needs to be squished to the commit which added detailed description of what bicubic means exactly So easy janitorial to make git history cleaner and more readable, and easier to bisect.
Aras Pranckevicius force-pushed vse_bicubic from e2c40fdc5f to 1aba34e24e 2024-01-15 14:17:40 +01:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Sergey Sharybin approved these changes 2024-01-15 15:30:11 +01:00
Sergey Sharybin left a comment
Owner

Thanks for taking care of squishing the commits!

Thanks for taking care of squishing the commits!
Aras Pranckevicius merged commit 709b00179f into main 2024-01-15 16:38:49 +01:00
Aras Pranckevicius deleted branch vse_bicubic 2024-01-15 16:38:51 +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#117100
No description provided.