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, 18:59   #3  |  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:28   #4  |  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 19th August 2016, 19:40   #5  |  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   #6  |  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   #7  |  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   #8  |  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   #9  |  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   #10  |  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   #11  |  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   #12  |  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   #13  |  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   #14  |  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   #15  |  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   #16  |  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
Old 20th August 2016, 10:09   #17  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
No sorry, it's too ugly !

As I said, I don't like filters like emulators filters.

I low pixel art, but I don't want neither it's like Nearest Neighbor

I want to find the good balance. I will show you an example after
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 10:24   #18  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
This is sweet, but is a good compromise :



Quote:
AviSource()
ConvertToYV24()
BicubicResize(b=0, c=0.5, 512, 448)
## Last=YV24
YToUV(
\ UToY.SimpleResize(1408, 1080)
\ , VToY.SimpleResize(1408, 1080)
\ , Last.SimpleResize(1408, 1080)
\ )
ConvertToRGB24()
But it's not perfect !

As I said, the pincipal problem is to get a change of the aspect ratio which is looking natural

Like on the CRT-screen, when horizontal resolution wasn't a problem.

All the difficulty comes from the nature of the image, because it's pixel art. When we enlarge an image, we can see the loss.

It's why this upscaling Intel thing seems to be interesting (up on the thread)

In fact, I want to preserve the essence of the pixel art, but enhance it to a HD resolution.

It's important that in movement, it remembers the sensations of the era (especially, this real 2D effect).

Last edited by SuperLumberjack; 20th August 2016 at 10:37.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 10:48   #19  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
A little change :



Quote:
AviSource()
ConvertToYV24()
BicubicResize(b=0, c=0.5, 584, 448)
## Last=YV24
YToUV(
\ UToY.SimpleResize(1408, 1080)
\ , VToY.SimpleResize(1408, 1080)
\ , Last.SimpleResize(1408, 1080)
\ )
ConvertToRGB24()
It's look more pixel perfect, but there is still a little thing which looks unatural in the relief.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 11:18   #20  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 333
Do you see what I mean by (almost) natural ?



Quote:
AviSource()
ConvertToYV24()
Spline16Resize(1168, 896)
## Last=YV24
YToUV(
\ UToY.SimpleResize(2816, 2160)
\ , VToY.SimpleResize(2816, 2160)
\ , Last.SimpleResize(2816, 2160)
\ )
ConvertToRGB24()
BicubicResize(b=0, c=0.5, 1408, 1080)
Original picture :



It remembers me the original picture, but the immersion isn't perfect. It's why I need something more transparent for the change of the aspect ratio.

If somebody knows if I can find a filter like the Intel upscaling (see up in the thread). The enlargement looks almost transparent I find.

Last edited by SuperLumberjack; 20th August 2016 at 11:26.
SuperLumberjack 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 16:57.


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