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. |
![]() |
#21 | Link |
Registered User
Join Date: May 2008
Posts: 1,840
|
Are these shaders recommend as all pre-resize? I'm getting some pretty nasty artifacts at times if that's the case.
Can these be consolidated into less shaders?
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650 PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0 |
![]() |
![]() |
![]() |
#22 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
You could probably avoid using the "pre" and "post" shaders. You can get a similar result by changing: Code:
#define Value(xy) (tex2D(s0,tex+float2(px,py)*(xy))[0]) Code:
#define Value(xy) (dot(tex2D(s0,tex+float2(px,py)*(xy)).rgb,1/3.0)) Code:
return float4(c,c0.gba); Code:
return c0-Value(0)+c; |
|
![]() |
![]() |
![]() |
#23 | Link |
Registered User
Join Date: May 2008
Posts: 1,840
|
Thanks and both 1 and 2 should be enabled at the same time? They look pretty similar, are these passes?
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650 PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0 |
![]() |
![]() |
![]() |
#24 | Link |
Registered User
Join Date: Dec 2013
Posts: 753
|
Yes, it will basically fill in the pixels in the following pattern:
Code:
o . o . o . x . x . o . o . o . x . x . o . o . o |
![]() |
![]() |
![]() |
#25 | Link |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
One thing this might be good for is chroma upsampling. Instead of using the neighbor pixels to create the interpolation weights, the algorithm could use the luma channel (or both the luma and chroma channels). This way the luma channel would guide the chroma upsampling. This makes a lot of sense because in most cases both luma and chroma change at the same time, and the luma channel already has 4 times the resolution. Of course the algorithm would have to do some safety checks to make sure that nothing bad happens if luma and chroma channels happen to be not related in some rare situations. But I think this could be a *really* good algorithm. I've had this idea for a long time, but never actually got around trying/implementing it yet. @Shiandow, maybe you'd have fun trying your luck with that? FWIW, one big problem with my idea is that sometimes the chroma channel was created with incorrect filtering (e.g. nearest neighbor) or sometimes the chroma channel is offset slightly. One additional thing a good chroma upsampling algorithm could do is to downscale the luma channel to chroma resolution and then check whether the chroma channel likely has a wrong offset or not.
(I had asked tritical at one point whether he'd consider making a special NNEDI3 version for chroma upsampling which takes the luma channel into account, but he was busy with other things, sadly.) |
![]() |
![]() |
![]() |
#26 | Link | |||
Kid for Today
Join Date: Aug 2004
Posts: 3,494
|
Quote:
Quote:
Quote:
Most of the time, I personally find NNEDI3 too sharp for chroma and if we could get off the hiccupy OpenCL train then far more GPU's could be useful to mVR than just the GCN and Maxwell architectures. Last edited by leeperry; 6th June 2014 at 20:23. |
|||
![]() |
![]() |
![]() |
#27 | Link |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Maybe the artifacts are worse with 4x upscales, but they're still there with 2x upscaling, too. IMHO NEDI in its current form is not suitable for a general purpose video upscaling algorithm, as I said before. Of course that's only my personal opinion, but unless I see evidence that suggests that I'm wrong, I won't add NEDI image/luma upscaling to madVR.
|
![]() |
![]() |
![]() |
#28 | Link |
Registered User
Join Date: Dec 2013
Posts: 753
|
Well, it seems that using NEDI for chroma doubling indeed does work quite well. I did have some trouble with aligning the luma and chroma grid, but I sort of succeeded with the following result:
NEDI chroma doubling. Jinc3AR chroma doubling. The NEDI method could probably be made a bit sharper since I'm currently using a simple box filter to shift it 1/2 a pixel, which could be replaced by something better (in fact you could just use NEDI again). I'm also completely ignoring the chroma channel which may backfire on some images, but does seem to produce the best results. Even better, doing so seems to hide some source artifacts when these don't occur in the luma channel. Edit: I've just confirmed that only processing the chroma channel indeed does backfire sometimes, I've simultaneously confirmed that using NEDI to interpolate the chroma channel is capable of actually reconstructing the original values, which I find quite impressive, unfortunately it does get it wrong sometimes. Hopefully it's possible to prevent this by checking if the chroma and luma channels actually correlate. Last edited by Shiandow; 6th June 2014 at 23:51. |
![]() |
![]() |
![]() |
#29 | Link | |
Registered User
Join Date: May 2009
Posts: 212
|
Quote:
|
|
![]() |
![]() |
![]() |
#30 | Link |
Registered User
Join Date: Dec 2013
Posts: 753
|
Using NEDI to shift the image, instead of a box filter, improves it quite a bit: http://i.imgur.com/DhbOS34.png.
|
![]() |
![]() |
![]() |
#31 | Link | |
Registered User
Join Date: May 2009
Posts: 212
|
Quote:
![]() Here is my subjective visual experience opinions: [High-frequency signal preservation] NEDI v2 > Jinc3AR >> NEDI v1 [Low-frequency signal preservation] Jinc3AR > NEDI v2 >> NEDI v1 [Angled Object edge smoothness] NEDI v1 >= NEDI v2 > Jinc3AR [Ring-effect artifact issue] NEDI v2 > Jinc3 AR >> NEDI v1 [Shaded? Text clarity] Jinc3AR > NEDI v1 > NEDI v2 |
|
![]() |
![]() |
![]() |
#32 | Link | |
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
FWIW, here are two samples which are good candidates for chroma tests: red fonts chroma test Btw, if you create an empty file named "YCbCr" in the madVR folder, madVR will output YCbCr instead of RGB. This might allow you to test better because color conversion to RGB is simply skipped completely. |
|
![]() |
![]() |
![]() |
#34 | Link | |
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Anyway, I've more or less finished with implementing the NEDI (4:2:0) chroma upscaling algorithm. For some images it noticeably improves the picture quality. There are some cases where it behaves differently from bicubic, but it's usually hard to tell whether the result is worse or better. In any case these situation could probably be avoided by downscaling the chroma again and comparing it to the original. Here is an example, taken from the Sintel film, where it is not only different but clearly better: Bicubic75AR chromaNEDI In both cases it was followed by a single NNEDI3 (16 neurons) pass, to make the differences more obvious. Incidentally this is also one of the cases where NEDI image doubling looks better than NNEDI3: chroma+luma NEDI In fact I think you might want to try watching Sintel using NEDI, if that doesn't convince you that using NEDI is worth the amount of artefacts it causes then I don't know what will. I'll update the first post to include both the chroma NEDI code and a version of NEDI which is suitable for video playback. |
|
![]() |
![]() |
![]() |
#35 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,373
|
Thats what "chroma upscaling" always refers to in the madVR context, so thats safe to assume.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
![]() |
![]() |
![]() |
#37 | Link | |||
Registered Developer
Join Date: Sep 2006
Posts: 9,140
|
Quote:
Quote:
Quote:
May I use your chroma upscaling shaders for madVR? Maybe I'll find a way to improve them further. If so, I'd post my changes here. |
|||
![]() |
![]() |
![]() |
#40 | Link | |||
Registered User
Join Date: Dec 2013
Posts: 753
|
Quote:
Quote:
Quote:
Here are some possible improvements that I couldn't implement because I was restricted to using a simple shader:
|
|||
![]() |
![]() |
![]() |
Tags |
chromanedi, nedi, shader, superres, upscaling |
Thread Tools | Search this Thread |
Display Modes | |
|
|