Log in

View Full Version : Super xBR upscaler


luquinhas0021
29th December 2015, 19:59
What are the parameters of this algorithm? How I choose the number of taps? This thread was created for discussing this method.

MysteryX
29th December 2015, 21:19
Look within the super-xbr.avsi (https://github.com/mysteryx93/AviSynthShader/blob/master/Shaders/Super-xBR/super-xbr.avsi) file to see how the parameters work, or read the documentation (https://github.com/mysteryx93/AviSynthShader/blob/master/Release/ReadMe.txt).

Or you can also try it with Media Player .NET or madVR during live playback as it is integrated in those.

Hyllian
31st December 2015, 14:45
What are the parameters of this algorithm? How I choose the number of taps? This thread was created for discussing this method.
The number of taps can't be changed in current implementation. It uses 2-taps, though it isn't limited to it, so if you wanna improve it, you can tweak the code to use more taps.

Anyway, I wrote a small text (https://drive.google.com/file/d/0B_yrhrCRtu8GYkxreElSaktxS3M/view?usp=sharing) very friendly trying to explain the concepts behind Super-xBR a while ago.

MysteryX
31st December 2015, 16:12
There's also something wrong with the current implementation. Compared to MPDN, it is slightly shifted to the right and slightly stretched vertically. Not sure what's wrong.

http://s20.postimg.org/6dnyr49g9/xbr_MPDN.jpg (http://postimg.org/image/6dnyr49g9/) http://s20.postimg.org/amxqqej15/xbr_Avi_Synth.jpg (http://postimg.org/image/amxqqej15/)

Current implementation is here (https://github.com/mysteryx93/AviSynthShader/tree/master/Shaders/Super-xBR)

Hyllian
31st December 2015, 17:32
There's also something wrong with the current implementation. Compared to MPDN, it is slightly shifted to the right and slightly stretched vertically. Not sure what's wrong.

Current implementation is here (https://github.com/mysteryx93/AviSynthShader/tree/master/Shaders/Super-xBR)

Madshi has fixed it before and I forgot to update my own implementation. To solve it, you have to add a line at the third pass after these two lines:


float2 g1 = float2(1.0/IN.texture_size.x, 0.0);
float2 g2 = float2(0.0, 1.0/IN.texture_size.y);
VAR.texCoord -= 1.0/IN.texture_size; // Add this!


I don't know how you'll do this at the MPDN implementation as I'm not aware of it.

It can't be fixed for the 2-pass version, though. So, I think Super-xBR works much better by using 3-passes.

MysteryX
31st December 2015, 18:00
Why is MPDN's version working then?

I'm not finding those lines
https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Super-xBR/super-xbr.hlsl

Edit: oh, it appears my version is outdated!
https://github.com/mysteryx93/AviSynthShader/blob/master/Shaders/Super-xBR/src/super-xbr.hlsl

MysteryX
31st December 2015, 18:18
Oh shit... this latest update seems to be PixelShader model 5!

but MPDN, as well as madVR, can run either on DX9 or DX11. How do they run these on DX9?

Hyllian
31st December 2015, 18:44
I have fixed it in my implementation: https://github.com/libretro/common-shaders/tree/master/xbr/shaders/super-xbr

You need to find the main texel coordinates and subtract a pixel_size of the texture being filtered. That's what that line do. It fix the pixel shift. I don't know how you can do this in these other implementations.

MysteryX
31st December 2015, 19:31
His implementation looks about the same as yours, but he split the passes to be compiled separately.

Either way, it's Shader Model 5 which requires DirectX 11

luquinhas0021
31st December 2015, 23:53
Why worry about pixel shift, and have the work of update the MPDN Super-xBR, if the shift difference between MPDN Super-xBR and AviSynth Super-xBR is so little, but... Avisynth Super-xBR is notorious sharper than MPDN super-xBR?

sqrt(9801)
1st January 2016, 01:45
Edit: oh, it appears my version is outdated!

It isn't. I was using the current version from MPDN when I made my AVS script.

I am not sure where the shift/stretch come from, though. I am fairly certain they were not there when I made my tests (with third pass enabled), although I've only tried the shader on RGB32 clips.

MysteryX
1st January 2016, 02:26
It isn't. I was using the current version from MPDN when I made my AVS script.
This is the current version in MPDN, which was updated on June 27th. Not sure where you got the PS3 version from.
https://github.com/zachsaw/MPDN_Extensions/blob/master/Extensions/RenderScripts/Super-xBR/super-xbr.hlsl

My version is a bit sharper simply because the settings were slightly different in both screenshots.

Updating the code to work with DirectX 11 wouldn't be difficult. I just need to figure out whether DX11 supports Shader Model 3. Then the hardest part would be to change the way parameters are being configured.

sqrt(9801)
1st January 2016, 20:33
It's the same file. I've just removed the structs and the vertex shader code.

MysteryX
1st January 2016, 23:21
It's the same file. I've just removed the structs and the vertex shader code.
Oh, so you ported it. Would you be able to port the fix; or port a version that is actually working well?