Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 4th December 2015, 22:47   #21  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,366
Before and after ResampleHQ. It's better than internal Resize methods, I think:
for one thing, ResampleHQ seems to preserve specular highlights better.



Here are the images at actual size (ie, not 2x size after downscaling, like above)
2x seems to exaggerate my perception of any over-sharpness, putting Lanczos etc at a disadvantage.
Code:
ResampleHQ(wid/2, hgt/2, dither=0>0, kernel="Bicubic", karg1=-1., karg2=0.)
\    .x2.sub("HQ Bicubic(-1, 0)")
# etc...
(the rest of the script is here)

Last edited by raffriff42; 16th March 2017 at 23:51. Reason: (fixed image links)
raffriff42 is offline   Reply With Quote
Old 4th December 2015, 22:51   #22  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
Here are some more comparison with Clown.png

1. NNEDI3(nns=4)
2. SuperRes(Passes=2, Strength=.43), Cubic(1/3,1/3)
3. Cubic(-.6,0), Passes=2, Strength=.43
4. Cubic(-.6,0), Passes=2, Strength=1
5. Cubic(-.6,0), Passes=3, Strength=1



There is still definitely a slight darkening with the current SuperRes implementation and it doesn't happen with Cubic(-.6,0) which definitely looks better and more natural. Passes=3 looks almost identical to Passes=2 but is just very slightly clearer.

Btw, running 3 passes is 21% slower than 2 passes with my implementation.

Last edited by MysteryX; 4th December 2015 at 23:10.
MysteryX is offline   Reply With Quote
Old 5th December 2015, 04:29   #23  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
I tried encoding a noisy video with SuperRes and Cubic(-.6,0).

The current implementation better preserves the textures and details. Some details are lost with this tweak, even with Strength=1. Cubic(-1,0) gives an even softer result.

My recommendation: keep it the way it is.
MysteryX is offline   Reply With Quote
Old 5th December 2015, 19:08   #24  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
Quote:
Originally Posted by raffriff42 View Post
Before and after ResampleHQ. It's better, I think.
You're missing Spline36 which I generally use for downscaling, and Cubic(-.6,0)

These might be the 2 most interesting ones.
MysteryX is offline   Reply With Quote
Old 5th December 2015, 19:24   #25  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
Here are some downscaling tests with a noisy video that has been upscaled with frame quadrupling and is then being scaled down to 720p.

Cubic(1/3,1/3)
Cubic(-1,0)
Cubic(-.6.0)
Cubic(-.6,0) with DitherTools



I like Cubic(-.6,0), it is more accurate while Cubic(-1,0) is definitely sharper but has more distortion.

I'd love to test this Perceptual algorithm.

As a clarification, here I'm not actually testing the final resize. I'm testing it with NNEDI3's subpixel shifting and resize, which then serves as the input for SuperRes.
SuperRes(2, 0.43, 0, """edi_rpow2(2, nns=4, cshift="BicubicResize", a1=-.6, a2=0, lsb=true, fwidth=940, fheight=720, Threads=2).DitherPost()""")

In this case, using DitherTools for downscaling does improve the quality. Currently the output of Dither Resize is converted back to YV12 before serving as input for SuperRes. If I could convert straight from Stack16 format to Shader16 format, it will avoid losing data.

Last edited by MysteryX; 5th December 2015 at 20:16.
MysteryX is offline   Reply With Quote
Old 5th December 2015, 20:44   #26  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
In addition to Cubic(-.6,0), in madVR, it is considered that the best downscaling is with Catmull-Rom. In ResizeX.avsi, I see that Catmull-Rom is defined as Cubic(0, .5)

Here's the screenshot with Catmull-Rom and DitherTools


I prefer Cubic(-.6,0)

Last edited by MysteryX; 5th December 2015 at 20:57.
MysteryX is offline   Reply With Quote
Old 6th December 2015, 21:44   #27  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
There's one thing which "the paper" doesn't tell you, and that is temporal stability. After all we're talking about "video", aren't we. And if some still shots are looking impressive, you don't know if the result on actual video is stable, or if it does introduce some nasty temporal flickering.

Anyway, for a rather typical downscaling scenario, namely resizing 1080p content to 720p, I've found bicubic with ~about~ (-0.5,0.25) fully sufficient. Using FineSharp to re-scale that 720p back to 1080p, the result in many cases is almost indistinguishable from the original source. With carefully chosen settings, I've fooled some friends into believing that the original 1080p vid would be the downscaled-upscaled version, and the (downscaled-upscaled)+FineSharp one would be the original 1080p.

Quite possible that there are better ways to reduce 5000x3000 sources down to 512x384. But then, hey, why would you want to do that.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 6th December 2015, 22:55   #28  |  Link
Shiandow
Registered User
 
Join Date: Dec 2013
Posts: 743
Yeah temporal stability could be a problem, having lots of texture is somewhat meaningless if it becomes more or less random.

That said the method seems to be reasonably robust against small changes to the input image. I don't see anything particularly worrying, though, as far as I can tell a small change of the input should only give a small change to the output. And the similarity measure they're using seems to be reasonably consistent when moving or deforming the image.
Shiandow is offline   Reply With Quote
Old 7th December 2015, 23:36   #29  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,299
Removed all non-relevant posts. Please stay on topic guys.
Wilbert is offline   Reply With Quote
Old 27th January 2016, 22:04   #30  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 334
Quote:
Originally Posted by sqrt(9801) View Post
Or you can just use Shader with Param2 = "-1,0f"

IIRC, VirtualDub's documentation mentions that using B = -0.6 is mathematically more accurate, so that's something you could try out.
Can you point to the part that mentioned it? I can't find it from Virtualdub's help file.
bxyhxyh is offline   Reply With Quote
Old 29th January 2016, 16:03   #31  |  Link
MysteryX
Soul Architect
 
MysteryX's Avatar
 
Join Date: Apr 2014
Posts: 2,015
I found B=0, C=.75 to give similar and slightly better result than B=-.6, C=0

This goes exactly as described in the documentation
http://avisynth.nl/index.php/Resize
MysteryX is offline   Reply With Quote
Old 30th January 2016, 15:59   #32  |  Link
bxyhxyh
Registered User
 
Join Date: Dec 2011
Posts: 334
Quote:
Originally Posted by MysteryX View Post
I found B=0, C=.75 to give similar and slightly better result than B=-.6, C=0

This goes exactly as described in the documentation
http://avisynth.nl/index.php/Resize
Then Lanczos would be better as it written in this page. Eventually we end up choosing Spline36Resize back lol.

Joke aside, I found what I asked.
Quote:
A=-0.6 gives the most consistent results mathematically, but the other modes may produce more visually pleasing results.
It says a=-0.6 not b=-0.6.
Isn't a=-0.6 is just b=0, c=0.6?

For b=-1, c=0, it changed the shape of the certain objects. So it was no option for me.

Then As Didee recommended I tried b+2c=0 values for downscales.
b=-0.6, c=0.3 had too much ring for me.
So I ended up choosing b=-0.52, c=0.26. Looked nice to me.
It was sharper than Spline36Resize and had less ring than b=-0.6, c=0.3 of course.
(Why 0.52 over 0.5? Well, no real reason at all.)
bxyhxyh is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 19:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.