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 Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th August 2016, 14:28   #1  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
I want to upscale a Super Nes video in HD

Hello

I'm new on this forum and I'm French. I try to upscale video captured with a Super Nes emulator (Snes9x) which are in a resolution of 256x224, in a resolution of 1408x1080.

[with Higan Emulator, the output resolution is 584x448 (or 584x480 with black bars), and it is known to be the more accurate emulator, so I took a proportional resolution]


My principal problem is this :

Quote:
Pixel Aspect Ratio and Sampling

Analogue RGB signals from retro consoles use composite video or composite sync in addition to the color information. This type of sync doesn't contain information about the horizontal pixels. This is commonly called RGBS as opposed to RGBHV, where H and V stand for the horizontal and vertical sync. RGBHV is used in more modern devices for VGA for example. On CRTs it doesn't matter that there is no horizontal sync information, because each line of the picture is drawn across the whole screen. On LCD screens and for capture this is a problem. In the process of creating a digital version of the signal the picture lines are sampled and pushed into a mask of pixels. The number of pixels is fixed and doesn't take the original console into account. Usually there are 720 or 640 horizontal pixels after the sampling step.
sampling



240p signal with non-square pixels sampled and linedoubled to 720x480 pixel.

Retro consoles usually only have a low amount of pixels in the horizontal resolution. These pixels are stretched to fill a whole line on the screen. In the case of the SNES there are 256 pixels horizontally in each line on the console. To fill the screen the pixels are slightly stretched, resulting in pixels that are wider than tall. The actual pixel ascept ratio (PAR) for the SNES is 11:10. On a PC each pixel has the same width and height, or in other words a pixel aspect ratio of 1:1. In the sampled version of the signal each non-square pixel from the console influences the color of 1 or 2 horizontally adjacent square pixels making it slightly blurry on the horizontal axis.
(source : https://blz.la/rgb/)


Do you see what I mean ?

When I do an enlargement oh the image with classic resize filter, it becomes inaccurate horizontaly.

The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors

Have you an idea for this ?

We can took this picture to begin :




Thanks for your help !

Last edited by SuperLumberjack; 19th August 2016 at 18:39.
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 18:58   #2  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 2,493
Quote:
The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors
You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:

Code:
r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)
(not tested)
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 19th August 2016, 19:28   #3  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Quote:
Originally Posted by davidhorman View Post
You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:

Code:
r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)
(not tested)
In the same moment ! Thanks for the answer

Yes, someone told me for the SimpleResize with YV24 color format (it was better than with RGB24, because it was directly in YV24)

Last edited by SuperLumberjack; 19th August 2016 at 19:34.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 14:22   #4  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by davidhorman View Post
Quote:
The best I tried is the SimpleResize, but the YV24 and RGB24 color formats aren't supported, so I have a loss of accuracy for the colors
You can always take the three RGB channels, convert them to separate clips, and use simpleresize on each one. Something like this:

Code:
r=clip.showred.converttoyv12
g=clip.showgreen.converttoyv12
b=clip.showblue.converttoyv12

r2=r.simpleresize(... , ...)
g2=g.simpleresize(... , ...)
b2=b.simpleresize(... , ...)

mergergb(r2,g2,b2)
ShowRed().ConvertToYV12() is not lossless, ShowRed("YV12") is.

Code:
r=clip.ShowRed("YV12")
g=clip.ShowGreen("YV12")
b=clip.ShowBlue("YV12")

r2=r.SimpleResize(... , ...)
g2=g.SimpleResize(... , ...)
b2=b.SimpleResize(... , ...)

MergeRGB(r2,g2,b2)
Reel.Deel is offline   Reply With Quote
Old 20th August 2016, 14:36   #5  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Yes, I noticed Thansk for the confirmation

It's why I choose YV24
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 15:08   #6  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,664
Quote:
Originally Posted by SuperLumberjack View Post
Yes, I noticed Thansk for the confirmation

It's why I choose YV24
If you're source is RGB then you're better off sticking with RGB. Then again I'm not really sure what you're doing. I see you're resampling 3 times? Why no just once to your final resolution? There's also no good reason to be using SimpleResize
Reel.Deel is offline   Reply With Quote
Old 20th August 2016, 15:43   #7  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Quote:
Originally Posted by Reel.Deel View Post
I see you're resampling 3 times? Why no just once to your final resolution? There's also no good reason to be using SimpleResize
It's because, as you see, I'm a complicated person No, seriously, I know it's a bit complicated to understand, but I want to get a natural image.

I want that the result remembers me the era where I played Super Nintendo games on a CRT I'm just talking about the feeling. I don't want scanlines and others things like that

It's complicated to have an enhanced image and to preserve this old feeling proper to these old games. I search the good balance. I tried with just one step and many filters, but I don't get this special thing

Quote:
Originally Posted by Reel.Deel View Post
If you're source is RGB then you're better off sticking with RGB. Then again I'm not really sure what you're doing.
I just convert to YV24 for the SimpleResize.

YV24 is equivalent to RGB24 no ?

But, yes, if I don't need to convert to YV24, I prefer to stay with RGB24
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 18:59   #8  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
I tried the SimpleResize with this base of code :

Quote:
w=<new width, integer>
h=<new height, integer>


## Last=YV24
YToUV(
\ UToY.SimpleResize(w, h)
\ , VToY.SimpleResize(w, h)
\ , Last.SimpleResize(w, h)
\ )
But, it's not perfect.

http://forum.doom9.org/showthread.ph...01#post1777501

Strangly, I noticed on my notebook (with Intel HD4600 chipset), that in VirtualDub a upscaling was effective with previews.

See the picture in fullscreen. The upscaling by the Intel HD is effective in the left window. In the right window, I upscaled the image 4X with Nearest Neighbor filter.



This upscaling is effective in other programs (like ACDSee) too.



Intel HD upscaling vs. Bicubic

But it's enough impressive, because when we enlarge a picture, it's almost transparent. It's like stretching chewing-gum



Here is the image in ACDSee, when I zoom at 1000% :



Zoom 2000% :



Zoom 5000% :



Zoom 10000% :



Where can I find a filter like this for AviSynth ?

It could be the solution for this problem



Thanks for your help !

Last edited by SuperLumberjack; 19th August 2016 at 19:48.
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 19:40   #9  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
How can I reduce the size of the images on this thread please ? It's too big

Last edited by SuperLumberjack; 19th August 2016 at 19:55.
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 19:45   #10  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Tried pointresize(1024,896) ? (basically 256*4x224*4)
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 19th August 2016, 19:53   #11  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Yeah ! But it's ugly

In reality, the output resolution must be proportional to : 584x448.

It's the Higan (the Super Nes emulator known as the more accuracy) resolution.

So, I need to change the aspect ratio

I want 1408x1080 for the output resolution.
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 20:01   #12  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
I see, well then my idea is of course completely useless
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 19th August 2016, 20:04   #13  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
No, because I tried with PointResize and others filters too

I tried many things
SuperLumberjack is offline   Reply With Quote
Old 19th August 2016, 20:09   #14  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Take a look at HQx
feisty2 is offline   Reply With Quote
Old 19th August 2016, 20:10   #15  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
https://en.wikipedia.org/wiki/Hqx
feisty2 is offline   Reply With Quote
Old 19th August 2016, 20:15   #16  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
http://avisynth.nl/index.php/PointSize
a collection of specialized resizers for pixel-art and other low resolution graphics (e.g. old or portable video game captures).
(including HQx)
raffriff42 is offline   Reply With Quote
Old 19th August 2016, 20:46   #17  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Thanks !

But I don't like HQx and emulator filters

For me, the biggest problem is to get a transparency change of the aspect ratio. So the problem is this :



But for the upscaling, I prefer maybe Spline16 or Bicubic. A filter which doesn't cause this around the objects :

http://www.repaire.net/forums/attach...ing-png.34435/

Spline36, Lanczos, Blackman, Sinc, etc., it's bad for me !

Or I need to begin with Spline16 and Bicubic, and after continue with an other filter.

But I think I must change the aspect ratio in the end. It would be the best with a filter like the Intel HD upscaling. It's amazing when we enlarge a picture
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 06:28   #18  |  Link
trip_let
Registered User
 
Join Date: Sep 2012
Posts: 47
But it can't be transparent, at least as long as the display device has square pixels. Either it's going to have to be interpolated and stretched by some resampler now or on playback, if you want the displayed aspect ratio correct.

Isn't the preview you're looking at just with some bilinear upsize or something like that?

Just a quick check of a couple things:
bilinear, convert to YUV444
nnedi3 doubled three times to 2048x1792, then Catmull-Rom (bicubic b=0, c=1/2) down to target and convert to YUV444
trip_let is offline   Reply With Quote
Old 20th August 2016, 09:40   #19  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Hello. Thanks for your answer !

Bilinear, it's a bit too sweet.

I tried with Nnedi3 too. But with this filter in first position, we have some deformations of straight lignes.

See here :

http://image.noelshack.com/fichiers/...atmull-rom.png

Quote:
AviSource()
ConvertToYV24()
nnedi3_rpow2(rfactor=4, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(b=0, c=0.5, 1408, 1080)
I noticed, when we begin with a filter like Bicubic or Spline16, we haven't this problem.

See here :

http://image.noelshack.com/fichiers/...atmull-rom.png

Quote:
AviSource()
ConvertToYV24()
Spline16Resize(512, 448)
nnedi3_rpow2(rfactor=2, nsize=0, nns=4, qual=1, etype=0, pscrn=2, threads=0, opt=0, fapprox=0)
BicubicResize(b=0, c=0.5, 1408, 1080)
I know, I'm too perfectionist

But it's not only for Super Nes videos. I want to use this for others low resolution videos later.

I search for a natural renderer. But not too sweet (and not too sharp). It's why I want to upscale my videos

For the transparency of the enlargement, I exactly find that it's not so bad with the upscaling of Intel HD chipset. But I don't know where I can find a similar thing.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 09:47   #20  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Code:
xbrz(6)
xbrz(6)
BicubicResize(1408, 1080,b=-1,c=0)
feisty2 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 01:27.


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