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. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st August 2019, 12:12 | #21 | Link | |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
Hello,
I have a question. I noticed something interesting. It's about a special scaling algorithm that I don't know It looks like something between PointResize and BilinearResize, but I think it's sharper than a bilinear filter. Here is a screenshot of the game Sonic Mania with the "None" filter (yes, it is a filter) : The native resolution of the game is "424 x 240" and then the picture is scaled to a resolution of "1920 x 1080". I thought that this filter was equivalent to this script : Quote:
But it's a bit different as you can see here : Strange no ? It looks sharper than the bilinear filter, but it's not a nearest neighbor filter. So what could it be ? Here is the source image : It's funny, because some days ago, I wanted to ask if it's possible to have something between PointResize and BilinearResize, long before I have noticed this ! So, I wanted someting that it's pefectly egal to PoinResize if I upscale a picture 2X, 3X, etc., but with interpolation (but nos as blurry as a bilinear filter and without ringing) if it's for example 2,5X or 4,8X or anything else. So, a kind of linear point resizer... I was wondering if it's possible. And now, I noticed this ! Strange coincidence ! Thanks for your help ! Edit : You can see better the difference here ! The picture in-game zoomed to 800% : My reproduction : A GIF animation to compare : So, how does it work ? Last edited by SuperLumberjack; 21st August 2019 at 13:39. |
|
21st August 2019, 15:06 | #22 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
The other strange thing is with the fullscreen mode in 720p for example.
In windowed mode with a window size of 3X, the resolution is 1272 x 720 : So in fullscreen mode, we get a resolution of 1280 x 720. We could have expected that the picture is simply stretched with a bilinear filter. But it isn't exactly the case as you can see here : Comparison : They used another technic to keep a natural image I think, instead of only using a horizontal interpolation. I really don't know how they did ! The source image if you have an idea : Some persons noticed the same thing too : https://www.reddit.com/r/gamedev/com...s_like_shovel/ https://www.reddit.com/r/gamedev/com...caling_shader/ Edit : It seams that is an association of the Nearest Neighbor filter and the Bilinear filter, as I tried, but it's strange, because the Bilinear filter is different ! And I don't understand the capture of the game in fullscreen mode in 720p, because apparently, there is a horizontal interpolation, but a vertical interpolation too. Edit 2 : I understood for the 720p in fullscreen. The source image is scaled 4x with Nearest Neighbor (1696 x 960) and then downscaled to the resolution of 1280 x 720. But the bilinear filter still looks different... ! Thanks for your help ! Last edited by SuperLumberjack; 21st August 2019 at 15:46. |
21st August 2019, 16:14 | #23 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
So my only question now is : why are these two Bilinear algorithms different ?
It seems that some pixels are shifted differently in fact. Shouldn't they be exactly identical ? Because bilinear is... linear no ? So what is the most correct bilinear filter ? I'm curious to know ! Thanks for your answer ! |
22nd August 2019, 19:29 | #25 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
I still have a question !
Is there a way to get the exact same bilinear filter than my GPUs use ? Because apparently, my GPU scaling is exactly the same for the Nvidia GPU of my laptop and the AMD GPU of my desktop computer. But with the bilinear filter of AviSynth, the blended pixels seems juste shifted with the opposite coordinates trough the X and the Y axes |
22nd August 2019, 20:05 | #26 | Link |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
|
What?
__________________
madVR options explained |
22nd August 2019, 20:53 | #27 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,493
|
Try:
Code:
PointResize(1696, 960) BilinearResize(1920, 1080, src_top = 0.5, src_left = 0.5) Though really I think you might be on a fool's errand. There's so little difference between any of these. One sprite when rescaled may already look exactly the same on both, if it happens to occupy a different position on screen at the time. |
22nd August 2019, 21:11 | #28 | Link | |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
Yes, it's a bit hard to explain !
Maybe you will understand better with these 2 images : The 2nd is a animated GIF : Quote:
Yes, I know it's a bit absurd. But it's for the quality of the reproduction. The depth looks a bit different. |
|
22nd August 2019, 21:36 | #29 | Link | |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
It's almost (minor differences with the RGB values of the interpolated pixels) that with :
Quote:
But why are they these differences between bilinear algorithms ? I would like to understand. Which filter is correct ? |
|
22nd August 2019, 22:11 | #31 | Link | |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
OK. Thank you for these informations !
In fact, I found the (almost) good values with : Quote:
But apparently, Nvidia and AMD chose something very close. So I think it's not very important which values for the bilinear filter ! But I'm glad to have learned something ! Thank you everybody ! Last edited by SuperLumberjack; 22nd August 2019 at 22:14. |
|
23rd August 2019, 00:04 | #32 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
However, the only thing that surprises me is the fact that Nvidia (or Intel, because maybe the scaling is done by the Intel IGP on my laptop) and AMD, which are rival, decided to use the exact same bilinear algorithm for the scaling...
Do you really think that it is a coincidence ? Because when I change the values for "src_top" and "src_left", the RGB values can change considerably for the pixels which are impacted, whereas the non interpolated pixels of the image keep the same values as the source. And so, even if it looks subtle, I personally find that it's the entire depth of the picture which can change. Shouldn't there be a standard which can be the same for everybody ? But Nvidia (or Intel) and AMD agree about the values to be used for the bilinear algorithm Maybe for some of you it's insignificant, but recognize that it's a bit strange ! |
23rd August 2019, 10:08 | #33 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
Hello
I compared some bilinear resizers to see if they are different or not, and yes, they are different I just tested with Photoshop and XnView. It seems that the bilinear filter of AviSynth is exactly the same as Photoshop (same RGB values too). But with XnView it's different from my GPU scaling and Photoshop. So I didn't try with other softwares. I have my answer ! I know I'm a bit crazy Thank you very much ! |
23rd August 2019, 11:19 | #34 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
Just a question please !
I often asked myself the question : « If I double a picture with PointResize and then I must convert it from the YV24 colorspace to YV12, why isn't the picture identical ? » Of course I'm missing something, but in my logic, if I double a picture with PointResize, after having converted the colorspace from YV24 (which is almost identical to RGB24) to YV12 with PointResize for the chroma resampling, the chroma should be identical no ? But maybe it's because the YUV colorspace doesn't work like the RGB colorspace. Am I wrong ? But how ? Edit : No. Excuse me ! I should have talked about the YUV 4:2:2 colorspace instead of YUV 4:2:0. But even here it's not identical. Why ? Last edited by SuperLumberjack; 23rd August 2019 at 11:37. |
23rd August 2019, 19:53 | #35 | Link | |
Registered User
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
|
The resampling during the conversion is using a wider radius bicubic kernel, try setting it to bilinear.
Use chromaresample="bilinear" or even "point" in the ConvertTo. Edit: Quote:
Edit2: How different are they? You cannot do a lossless conversion from RGB to YV24 to RGB (at least when using the same bit depth at each step), there will always be minor differences in the final RGB values.
__________________
madVR options explained Last edited by Asmodian; 23rd August 2019 at 19:59. |
|
23rd August 2019, 21:00 | #36 | Link |
French Registered User
Join Date: Aug 2016
Location: France
Posts: 333
|
OK. So it's a question of chroma placement. Yes, I found strange that the chroma wasn't aligned with the luma. I will explore this settings. Thank you !
And what algorithm do you recommend for the conversion of the colorspace for classic videos (no pixel art) ? Because I suppose that something smoother than PointResize is better in this case. Have you ever tried the "UtVideo YUV420 BT.709 VCM" ? I always use this codec for the conversion and because it's lossless. But if I compare the conversion of the colorspace with it, it's less clean than the conversion by default with AviSynth, but it's more natural I find. It's strange, because I don't know how the chroma is subsampled with this codec. It doesn't match with any of the existant algorithms. Last edited by SuperLumberjack; 23rd August 2019 at 21:03. |
Thread Tools | Search this Thread |
Display Modes | |
|
|