Selur's Little Message Board

Full Version: Custom Filter Queue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I am looking for a way to make a two step resize and apply a filter in between. I have read in your post 
" add most filters multiple times (atm. Deinterlacers, Crop, Rotation, FrameInterpolation, Resize, Letterboxing, AddingSubtitle can only be added once, since I didn't get time to write code for adding them multiple times)" 
but I would argue that there is reasons to add one them the "Resize". Depending on the resolution we apply a filter we have changes in quality and time to process.

Cheers
To keep things manageable, Hybrid does require a fixed order for Crop, Rotate, Resize, Letterbox (Crop < Rotate < Resize < Letterbox).
Allowing multiple free placeable resize steps would (extremly) complicate tons of things regarding the code validation&generation and the ui integration.
So I don't plan to change that.

I probably could add options to the 'Stepped Resize' for additional (specific) filters and maybe even add a way to add custom code between the resize steps.
Would need details what really is needed, before I think about whether this is worth the effort.

If you know your way around Vapoursynth you could also do what you want in a custom section, but you should let Hybrid know if your code changed some of the characteristics, etc.
In custom sections:
Code:
# requires colorformat <colorspace name>
tells Hybrid that the custom section requires the clip to be <colorspace name> for the custom section.
Code:
# requires mod<X>
requires modX.
Code:
# width X
lets Hybrid know that after the custom section the width is always X.
Code:
# Height Y
lets Hybrid know that after the custom section the width is always Y.
Code:
# scantype <progressive/tff/top filed first/bff/bottom field first/telecine>
lets Hybrid know that after the custom section the scan type is changed to a specific value.
Code:
# colorformat <colorspace name>
lets Hybrid know that after the custom section the color format is always as specified.
Code:
# framerate <X>
lets Hybrid know that after the custom section the frame rate is always X.

Cu Selur
From my little programing knowledge I can understand you have
"Crop, Rotate, Resize, Letterbox" in a "programming Loop" how about outside that loop? In a separate step just as you add an other filter.
(Crop < Rotate < Resize (1) < Letterbox)--> Filter --> Resize (2) --> Filter --> Output and easaly choose what we want from Filter Order.
That would require little UI integration since only thing is needed is a second "Picture Resize" in the Crop/Resize" tab.

The filter I am most interested is the BasicSRV++ in "other" tab. Rarely the output resolution is the exact double of the input, NNEDI3 needs
an exact double resolution so that could be in the first step, and second step using an other upscaling method to reach the required resolution.
By the way which is the best upscaler that doesn't need double resolution in your opinion?
Quote:Rarely the output resolution is the exact double of the input, NNEDI3 needs
an exact double resolution so that could be in the first step, and second step using an other upscaling method to reach the required resolution.
All resizers that output multiple of X as output have a 'Resizer'/'Downsizer' option which configures what resizer is used to adjust to the wanted target resolution.
For example when a 640x352 source should be resized to 960x528 and NNEDI3 is selected as (down-/)resizer Hybrid would create something like:
Code:
# resizing using ZNEDI3
# current: 640x352 target: 960x528 -> pow: 2
clip = edi_rpow2.nnedi3_rpow2(clip=clip, rfactor=2) # 1280x704
# adjusting resizing
clip = core.fmtc.resample(clip=clip, w=960, h=528, kernel="spline64", interlaced=False, interlacedd=False)# before YUV420P8 after YUV420P16P16
first resizing with ZNEDI3 and then adjusting to the target resolution using 'spline64' to adjust to the target resolution. ('spline64' was selected as resizer)

So where would you want to apply BasicVSR++ in this example?
Do you want to:
1. resize with NNEDI3
2. use BasicVSR++
3. use 'spline64' resize
, or do you aim for something different?

Side note: I don't really think it is a good idea to 1st upscale and then apply BasicVSR++ unless your video resolution is below SD.

Quote: By the way which is the best upscaler that doesn't need double resolution in your opinion?
You mean an upscaler that doesn't output X-times the output resolution and then needs adjusting?
If for some reason I couldn't use such filters - or I just needed minimal resolution changes, I would either use Lanczos-, Bicubic-, Blackmann- or Point-Resize depending on the source.


Cu Selur
Isn't a waste of processing power and "lossy" for NNEDI3 this double conversion? I haven't seen much of a difference vs Bicubic.
Actually the only model I have seen better results is SwinIR-L x4 any other suggestion?

ok work process input Res 756x432 --> bicubic 900x676 --> BasicVSR++ --> 1440x1080
If you apply VSR at higher res you get better results for small details.. but @ 1440 is slow and @ 756 is missing details...
Quote:Isn't a waste of processing power and "lossy" for NNEDI3 this double conversion? I haven't seen much of a difference vs Bicubic.
If you don't see a difference with your sources, than stick with Bicubic.
If you don't see a difference between these, you probably won't see a difference in the adjustement. (normal resizers are fast, so it should not really make a difference in speed)

Quote:If you apply VSR at higher res you get better results for small details..
Okay, did a quick test (https://imgsli.com/MjUwNzIx, https://imgsli.com/MjUwNzIy).
Adding a sharpener before BasicVSR++ might help more.
That said, I can see that with some sources this might be interessting.
=> I probably could add an option to BasicVSR++ to adjust to a specific width (height gets calculated) before applying.

Cu Selur
Send you a link to a dev version, via pm, which has a 'wanted width' option for BasicVSR++.

Cu Selur