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 20th August 2016, 12:49   #21  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
I tried to enlarge the image in a resolution of 584x448 in the preview of VirtualDub. So the Intel HD upscaling is effective.

I just wanted to see



After, I take a screenshot and cut the picture in Paint :



I reduce the size to 292x224 :



Original :



When we compare to the original picture, the enlargement is almost transparent (a bit blurry, but it's very natural, and maybe it's because I started with a resolution of 584x448 and downsized) compared to others filters, don't you think ?

And then, I tried with the same AviSynth script :



I should try directly in resolution 352x270 for the base. The problem is that I can't use this filter to encode videos.

Last edited by SuperLumberjack; 20th August 2016 at 12:52.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 13:12   #22  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
The picture in 352x270 with Intel HD upscaling :



The picture upscaled to 1408x1080 just with Spline16 :



I hoped something better But now I know

So, the best result for the moment is this with the original picture :



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)
So, officially, pixel perfect doesn't exist with digital resize

I will see if I can enhance this.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 13:14   #23  |  Link
Nevilne
Registered User
 
Join Date: Aug 2010
Posts: 134
what are you even trying to do dude
Nevilne is offline   Reply With Quote
Old 20th August 2016, 14:20   #24  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Hello

I want when I see this...



...that it seems natural like this



But it's not easy, I know

(it's not the same aspect ratio)
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 14:22   #25  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,084
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   #26  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
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   #27  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,084
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   #28  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
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 20th August 2016, 16:13   #29  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,084
Quote:
Originally Posted by SuperLumberjack View Post
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
I just don't see how resizing 3 times helps maintain a natural image. But hey, to each is own

Quote:
Originally Posted by SuperLumberjack View Post
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
To an extent, both YV24 and RGB are not subsampled but YV24 is a different color space than RGB. To avoid these unnecessary color space conversions use the example in post #25.
Reel.Deel is offline   Reply With Quote
Old 20th August 2016, 17:34   #30  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Yeah, I know that it's completely subjective

I just try to find the good alchemy visually

I tried this, and its not so bad !



The original :



Quote:
AviSource()
ConvertToYV24()
Spline16Resize(1234, 1080)
## Last=YV24
YToUV(
\ UToY.SimpleResize(2816, 2160)
\ , VToY.SimpleResize(2816, 2160)
\ , Last.SimpleResize(2816, 2160)
\ )
ConvertToRGB24()
BicubicResize(b=0, c=0.5, 1408, 1080)
But it's in movement and full screen that we see really if it's natural or not.

For the conversion RGB24 to YV24, as I said, it's just for the filters that don't support RGB24
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 17:54   #31  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,084
Quote:
Originally Posted by SuperLumberjack View Post
For the conversion RGB24 to YV24, as I said, it's just for the filters that don't support RGB24
I don't think you understand what I'm saying.

Code:
AviSource() # RGB  source

Spline16Resize(1234, 1080)

r = ShowRed("YV12").SimpleResize(2816, 2160)
g = ShowGreen("YV12").SimpleResize(2816, 2160)
b = ShowBlue("YV12").SimpleResize(2816, 2160)

MergeRGB(r,g,b)

BicubicResize(b=0, c=0.5, 1408, 1080)
No color space conversion.
Reel.Deel is offline   Reply With Quote
Old 20th August 2016, 18:08   #32  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
I understand, but the reason of the conversion with SimpleResize is that with this

Quote:
## Last=YV24
YToUV(
\ UToY.SimpleResize(w, h)
\ , VToY.SimpleResize(w, h)
\ , Last.SimpleResize(w, h)
\ )
I get better quality than this :

Quote:
## Last=RGB24
MergeRGB(
\ ShowRed ("YV12").SimpleResize(w, h)
\ , ShowGreen("YV12").SimpleResize(w, h)
\ , ShowBlue ("YV12").SimpleResize(w, h)
\ )
You can try. It's more blurry with RGB I don't know why. I thought maybe there is a conversion RGB24 to YV12 and YV12 to RGB24. So there is a loss of definition for the chroma. Isn't it that ?
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 18:24   #33  |  Link
Reel.Deel
Registered User
 
Join Date: Mar 2012
Location: Texas
Posts: 1,084
Quote:
Originally Posted by SuperLumberjack View Post
You can try. It's more blurry with RGB I don't know why. I thought maybe there is a conversion RGB24 to YV12 and YV12 to RGB24. So there is a loss of definition for the chroma. Isn't it that ?
No there is no RGB to YV12 conversion happening. I tried it with both methods and I do not see any visual difference. Although the suggested method is a bit more accurate since there's no RGB --> YUV --> RGB conversion. Anyways, Groucho2004 gave you solid advice in another thread. Use AviSynth's internal resizers instead! There's no reason to be using SimpleResize(). Good luck

Last edited by Reel.Deel; 20th August 2016 at 18:28.
Reel.Deel is offline   Reply With Quote
Old 20th August 2016, 20:16   #34  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Thanks !

But with the internal resizers only, I didn't get what I research.

It's in the movement that there is a big difference.

I'm doing a video that I will upload on YouTube to show you differents resultats of the scripts I already did the other days.
SuperLumberjack is offline   Reply With Quote
Old 20th August 2016, 20:24   #35  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,377
Quote:
Originally Posted by SuperLumberjack View Post
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
Well I'm gonna suggest scanlines anyway, because AFAIK there is no filter for "feeling."
http://forum.doom9.org/showthread.php?t=170732
(cropped to save bandwidth because the image is not very compressible)
Code:
LoadPlugin(pathBase + "MaskTools2\tp7masktools\masktools2.dll")
Import(pathBase + "Dither\v1.27.1\dither.avsi") 
Import(pathBase + "crt_display\crt_display.avsi")

ImageSource("SuperNES-originale-basse-definition.png", pixel_type="RGB32")

par = 8.0 / 7.0  ## Pixel Aspect Ratio
crt_display(4*par, 4, ppp=2*par, maskpp=2, blurh=1.1, 
\   vcs=0.071, cromaclear=1, scandist=1.5, glowgain=0.5, 
\   glowh=2, glowv=0.5, halgain=0.03, cutoff=0.9)
return Last
More on CRT artifacts:
http://bogost.com/games/a_television_simulator/

Last edited by raffriff42; 16th March 2017 at 23:00. Reason: (fixed image link)
raffriff42 is offline   Reply With Quote
Old 20th August 2016, 20:33   #36  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Whaou ! It's strong !

Thanks raffriff42 Maybe I will try, juste for fun !
SuperLumberjack is offline   Reply With Quote
Old 21st August 2016, 00:21   #37  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Here is a video to show you what are the sensations in movement :

https://youtu.be/-Q6fyxXDTJU

For each script, a different feeling !

But the purest feeling is with the original resolution. It's what I try to retrieve in HD.
SuperLumberjack is offline   Reply With Quote
Old 21st August 2016, 10:06   #38  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Do you like ?

What script ? One in particular ? All ? Nothing ?
SuperLumberjack is offline   Reply With Quote
Old 21st August 2016, 13:17   #39  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 5,655
SuperLumberjack, I'm not sure what you want either, no idea how you measure this 'feeling' thing.

But curious to know what does the below plugin 'feel' like ?
(~40KB)
http://www.mediafire.com/download/1d...l_20160329.zip

Plug was hacked up some time ago (will be quite slow), to try and bring out some detail from a car number plate, (burglar driver),
dont bother with the r,g,b modification stuff, just resizing arg SZ.

Doc supplied in zip (zip incl source)

Code:
Rgb_Test(clip c, Int "SZ",float "Rr"=1.0,Float "Rg"=0.0,Float "Rb"=0.0,
    \ float "Gr"=0.0,Float "Gg"=1.0,Float "Gb"=0.0,float "Br"=0.0,Float "Bg"=0.0,Float "Bb"=1.0)

Filter to both upsize clip and modify R,G,B, RGB24 ONLY, null audio.

    Output frame is c.Width*SZ x c.Height*SZ pixels, RGB24. 
    Views source frame as a c.Width*SZ x c.Height*SZ frame of micropixels where each source pixel is SZxSZ micro pixels.
    Each output pixel is result of summing SZxSZ source micropixels.
    The R,G and B channels are modified via the other arguments, 
    eg red component comes from Int((rSum * Rr + gSum * Rg + bSum * Rb) / (SZ*SZ) + 0.5)    # Range 0 -> 255.0 if Rr+Rg+Rb sum to 1.0)
      The result pixel Red channel is then limited to range 0->255.
      Same for the other channels.   

Defaults:
    
    SZ = 5, output clip 5x5 size of input clip. Range ODD ONLY, 1 -> 9. (1=No resize)

	Rr = 1.0    Rg = 0.0    Rb = 0.0       Should sum to 1.0 (valid -3.0 to 3.0)
	Gr = 0.0    Gg = 1.0    Gb = 0.0       Should sum to 1.0 (valid -3.0 to 3.0)
	Br = 0.0    Bg = 0.0    Bb = 1.0       Should sum to 1.0 (valid -3.0 to 3.0)
Suggest something like RGB_Test(5) # or RGB_Test() as SZ=5 is default.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 21st August 2016 at 13:40.
StainlessS is offline   Reply With Quote
Old 21st August 2016, 13:48   #40  |  Link
SuperLumberjack
French Registered User
 
SuperLumberjack's Avatar
 
Join Date: Aug 2016
Location: France
Posts: 195
Thanks !

But I didn't understand everything

Have you an exemple with an output resolution of 1408x1080 please ?
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 07:04.


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