View Full Version : SuperRes for AviSynth?


MysteryX
16th May 2015, 07:40
Media Player Dot Net, and now also madVR, have a scaling feature called SuperRes. It does a pretty good job! Is there an equivalent of SuperRes in AviSynth?

LumaSharpen is also nice, is there an equivalent?

Mounir
16th May 2015, 18:33
i always liked this software (http://www.infognition.com/VideoEnhancer/) for upscaling

otherwise in avisynth i don't know exactly but imagine a mix of antialiasing and splineresize and motion compensation filters

SEt
16th May 2015, 22:30
Without some algorithm description or at least screenshots it doesn't tell as much.

chainik_svp
16th May 2015, 23:53
SEt
http://forum.doom9.org/showpost.php?p=1685124&postcount=120

foxyshadis
17th May 2015, 01:20
This is the SuperRes code (https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Shiandow.SuperRes.cs), and this is the shader component (https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/SuperRes/SuperRes.hlsl).

Bloax
17th May 2015, 01:37
This is the SuperRes code (https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Shiandow.SuperRes.cs), and this is the shader (https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Shiandow.SuperRes.cs).
Are the two links supposed to be duplicates?

Reel.Deel
17th May 2015, 03:31
How feasible would it be to have an AviSynth plugin to be able to use these (and possibly other) shaders?

MysteryX
17th May 2015, 03:35
Thanks! Is there a compiled version of the code?

MysteryX
17th May 2015, 03:49
In madVR, I found it worthwhile to use a less demanding upscaling algorithm so that I can use SuperRes for at least 1 pass. The picture is much sharper without being noisy.

I'd love to add that into my SD to HD video converter!

burfadel
17th May 2015, 04:25
How feasible would it be to have an AviSynth plugin to be able to use these (and possibly other) shaders?

There was this:
http://forum.doom9.org/showthread.php?t=87295

Probably doesn't work with the latest Avisynth since it's ancient, and certainly not the x64 versions. Still, it shows it's not only possible, but has been done before :).

A standalone optimised plugin for 32-bit and 64-bit avisynth would be very much preferable though. I wouldn't suggesting converting DVD resolution stuff to bluray resolutions, but it would be useful going from say, 480P to 720P. It would also be better even without changing the resolution due to the nature of it. Remember when you encode you are also encoding the artifacts present in the original in addition to creating any new artifacts with the compression. So, even keeping the same resolution the output will still be better quality with using this.

MysteryX
17th May 2015, 05:24
Are you sure AviShader is the same thing as SuperRes?

I was re-encoding VCD videos from 288p to 720p using EEDI3 + NNEDI3, or NNEDI3 + NNEDI3, with denoising and sharpening. It does a GREAT job with very low quality videos.

With SuperRes, however... by upscaling from 288p to 1080p using simple Bicubic and SuperRes with a single pass, I couldn't say for sure which version is best between re-encoded and original + madVR! The 720 re-encoded with NNEDI3 is more blurry while the original with SuperRes looks sharper.

I still think I prefer the re-encoded version but there's definitely something to explore here. Adding 2 passes of SuperRes on high quality setting on top of NNEDI3 would look bad-ass.

burfadel
17th May 2015, 08:35
I've never tried Avishader, but from what the (now very old) post description says, it enables the use of shaders directly inside of avisynth. So, in theory, you could use the SuperRes shader with avisynth. Ideally though it would be a proper filter. I wouldn't suggest upsampling 288P material to 1080P, then encoding it, as that would mean a buttload (the censored form of f***load) of wasted bitrate. It would be good though to maybe go from 288P to 480P. As I said previously, you are encoding any artifacts (including aliasing), by having a 'cleaner' source the encode will be better and you probably won't be using too much more bitrate for 288P-->480P for example, because you aren't encoding the aliasing and pixellation etc.

foxyshadis
17th May 2015, 08:54
Are the two links supposed to be duplicates?

I r teh dumn. I meant to edit in the other link and copied the same one; corrected now.

Mounir
17th May 2015, 09:42
do you have a video of your vcd ? I'd like to try something

SEt
17th May 2015, 14:46
Thanks for the links, I'll take a look when I have time (unlikely soon, though).

MysteryX
17th May 2015, 17:37
Here's a 288p VCD video
https://mega.co.nz/#!eYIBVT7B!SEPfYYrcbSFMdpNuArn0tMqqhiui3G5bzkGa7DMEMbQ

In comparison, here's the 720p re-encoded version
https://mega.co.nz/#!6EhU2ArI!GyIjNkuFdEiqQKfI4zVEv0ZXRaekOiMU6Jl_KCkOTTE

Because it is very noisy, what worked best is Denoise + EEDI3 + NNEDI3 + Sharpen. Note that this re-encoded version is much larger because it is extremely animated, but most other re-encoded videos keep a similar file size.

You have to consider that MPEG2 compresses twice better than MPEG1, and MP4 compresses twice better than MPEG1, so simply by re-encoding, I already have ~4x better usage of bits.

Mounir
17th May 2015, 19:17
supersolution with mvtools: http://forum.doom9.org/showthread.php?t=142704&highlight=upsize
i haven't tried it so i can't vouch for that method...

burfadel
17th May 2015, 19:23
Here's a 288p VCD video
[url]You have to consider that MPEG2 compresses twice better than MPEG1, and MP4 compresses twice better than MPEG1, so simply by re-encoding, I already have ~4x better usage of bits.

It doesn't work like that :). Even if it did though, when you re-encode you are re-encoding the artifacts as well, and artifacts can actually take a big chunk of bitrate. This is because the artifacts are seen as detail by the encoder.

Going from 288P to 720P is still wasteful, it would be much more efficient bitrate wise going to say, 480P and doing the upsizing on decode.

MysteryX
17th May 2015, 19:35
It doesn't work like that :). Even if it did though, when you re-encode you are re-encoding the artifacts as well, and artifacts can actually take a big chunk of bitrate. This is because the artifacts are seen as detail by the encoder.

Going from 288P to 720P is still wasteful, it would be much more efficient bitrate wise going to say, 480P and doing the upsizing on decode.

Then it couldn't be uploaded on YouTube with good quality :)

But you're right, in videos having massive artifacts like the one posted above, the resulting file size is considerably larger. On most videos, however, artifacts can be neutralized pretty effectively.

There is *1* VCD I have that has such ridiculously huge artifacts in a highly animated background that I couldn't do anything to improve it. There are no intelligible patterns in the background and artifacts, so I left it as it is.

MysteryX
2nd June 2015, 21:29
So I guess this won't be possible anytime soon until someone decides to make it happen?

Mounir
3rd June 2015, 09:17
Try neat video version 4 for your vcd

This would be useful aswell for upscaling a vcd i believe : http://www.compression.ru/video/super_resolution/super_precision_en.html

MysteryX
4th June 2015, 17:35
I already have good noise reduction in my script.

The filter at this link doesn't nearly do as much as SuperRes, which does anti-aliasing, anti-ringing and sharpening. It considerably modifies the output.

My script is already doing a good job, but if I could replace the slight sharpening at the end with SuperRes, it would give a considerably better output.

MysteryX
4th June 2015, 18:17
I found a way to further improve the result.

Instead of doing Denoise+EEDI3+NNEDI3+Downscale+Sharpen, if I add InterFrame at the end to increase the output to 60fps, it further reduces the noise, and thus there is less noise to encode. BUT Sharpen has to be AFTER InterFrame.

I tried with one file. The first way generated 86.3mb, this new sequence at 60fps generates 83.6mb (with fixed quality encoding). Even though there are twice more frames, the output is smaller.

And then, I would LOVE to replace the final Sharpen with 3 passes of SuperRes. This would considerably improve the end result.

If someone would find a way to get SuperRes usable here, it would be worth re-encoding all my videos with these changes.

MysteryX
15th June 2015, 20:03
For AviShader, this is the thread where there is more development information about it. It seems it supports a few shaders, but not this one.
http://forum.doom9.org/showthread.php?t=86793

Still no SuperRes, but I found a way to improve my videos.

First, adding InterFrame smooths out the noise between the images and makes the result easier to encode.

Second, instead of adding SuperRes, by adding Sharpen after doubling the image, and again at the end, I get a result with sharper details. For some sources with NNEDI3 quadrupling, I'll apply Sharpen .1 after double and .1 again at the end. For other noisier source, I'll do EEDI3, Sharpen .1, NNEDI3 then Sharpen .25

I still do think SuperRes would give a better result, but it's already a great improvement.

Madshi who is developing madVR is going to be testing SuperRes soon to see what settings work best, and most importantly, whether it truly gives a better result than good sharpening.

I wouldn't suggesting converting DVD resolution stuff to bluray resolutions, but it would be useful going from say, 480P to 720P.
I tried encoding to 480p. I get better results by leaving it at 720p.