-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use noncustom kernel when possible in bicubic and bilinear
`descale.Decustom` init is slow and AFAICT it's only being used for symmetry with `resize2.Custom`, which itself was introduced to enable setting `blur` (am I missing something else?). If that's the case, then everything is being made slower just for the (probably) few cases of blur usage. This hurts the native-res plugin especially. With this change, things work like so: 1. If descaling, always use `descale.Debicubic`/`descale.Debilinear`. They support `blur` so there should be no need for custom kernels. 2. If scaling/resampling, use `resize2.Bicubic`/`resize2.Bilinear` if `blur` is not set to the default of 1.0. This isn't here to speed anything up, rather it just seems like a good idea to use the plugin's available filters when possible instead of custom ones. 3. Otherwise, use the slower custom kernels since blur is needed and not provided by the plugin. This only targets bicubic and bilinear since these are the most popular descale kernels. With this, native-res execution (height [502, 999], step size 1, Catrom) goes from ~3 minutes to ~30 seconds. If we like this approach and it works well then we can bring it to the other kernels.
- Loading branch information
Showing
2 changed files
with
55 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters