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

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 15th February 2009, 03:35   #1  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Resizing (Upscaling) is Removing Details?!...

At first, when I noticed the problem by comparing it to the original, I thought it was one of my grain/noise removing/reducing filters. I went through all of them and the problem didn't seem to go away. I stripped it down to just the 720p resize that I had and the problem was still there.

After that, I tried it with just the mpeg2stream identifying line and the problem was gone. I then tried the Bicubic resize that VirtualDubMod has and the problem wasn't as prominent. I don't really understand how the resizing affects anything at all but I captured frames for comparison. In the pictures, notice the details on the sticking out roof above the bottom-left window, and how they mostly disappear when resized with AVISynth. I recommend that it is viewed by opening the pictures in separate tabs, maximizing them, scrolling to the bottom left, and switching between them. Maybe somebody can sort out the issue?

Original VOB


Encoded without any filters to h264 using the x264 codec at 3000 kbps - Single Pass


VirtualDubMod Bicubic Resize


AVISynth Lanczos4/Lanczos/Bicubic Resize (All gave the same negative effect - at least in the area that I pointed out)


-Thanks in advance for any of your responses.


UPDATE: When using the resizing method real-time, using FFDShow, the details don't disappear. It could be a combination of what happens with the x264 codec/with VirtualDubMod/some other reasons... The problem isn't in the AVISynth resizing methods themselves (though this was probably obvious to most).

Last edited by Typhoon859; 18th February 2009 at 14:05.
Typhoon859 is offline  
Old 15th February 2009, 04:59   #2  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
This is from a DVD? If so that means it's encoded @ 720x480. Sounds like you're upsizing, and since you are, you're trying to create detail that was never present in the 720x480 frame. Resizing doesn't "remove" details at all. Unless you're downsizing, in which case you are removing details. But upsizing, you're just interpolating data that never existed in the first place.

Try NNEDI for animated content:
Code:
NNEDI(1, dh=true).TurnLeft().NNEDI(1, dh=true).TurnRight()
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.
Sagekilla is offline  
Old 15th February 2009, 05:47   #3  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Sagekilla View Post
This is from a DVD? If so that means it's encoded @ 720x480. Sounds like you're upsizing, and since you are, you're trying to create detail that was never present in the 720x480 frame. Resizing doesn't "remove" details at all. Unless you're downsizing, in which case you are removing details. But upsizing, you're just interpolating data that never existed in the first place.

Try NNEDI for animated content:
Code:
NNEDI(1, dh=true).TurnLeft().NNEDI(1, dh=true).TurnRight()
Yeah. This is from a DVD - 720x480. And as I said, I'm resizing to 720p. And that's exactly what I'm saying - data shouldn't be lost but it is. Look at the comparisons at the place that I mentioned in the post. I'll try that code you gave me. Where should I put it (though I doubt it'll help)?

Last edited by Typhoon859; 15th February 2009 at 05:54.
Typhoon859 is offline  
Old 15th February 2009, 09:42   #4  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,691
Those details are barely there in the first place. However, resizing, either up or down, will cause you to lose video information and thus quality. So, yes, when you resize, small details will disappear. The better a resizer you use, the less details you lose.

And encoding to a lossy format just compounds the problems.

In short, this is exactly what's supposed to happen. DVD's weren't made to be upsized. Resize algorithms are only so good. And lossy video compression works by throwing away details.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline  
Old 15th February 2009, 10:04   #5  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Merlin7777 View Post
Those details are barely there in the first place. However, resizing, either up or down, will cause you to lose video information and thus quality. So, yes, when you resize, small details will disappear. The better a resizer you use, the less details you lose.

And encoding to a lossy format just compounds the problems.

In short, this is exactly what's supposed to happen. DVD's weren't made to be upsized. Resize algorithms are only so good. And lossy video compression works by throwing away details.
See, here's the thing... The x264 codec barely effects those details. The second picture is of exactly that. The loss happens after the resize. Now, you say that the resizer is supposed to do that - that resizers end up getting rid of minor details. Okay, I dunno if that's true but if it is, how come the bicubic resizer in VirtualDubMod works so much better than the bicubic resizer used in the AVS script? It's the same algorithm, no? Besides that, if you're saying it's the resizer, how come there isn't any loss in details when I put the script in FFDShow to process the video?.. To top that off, a guy named Triforce made an encode of this same thing from the same exact VOB, also upscaling to 720p, not to mention that he used much more cleaning filters, and the details were still there.

In any case, h264 is the best compression out there in terms of quality. In many respects, it's better than the MPEG-2 compression. The only thing left would be to go uncompressed but then that defeats the whole purpose of an encode, unless it's for video editing.

I think those are enough points to justify that the reason for the loss in quality is something else - something that doesn't quite make sense, to me anyway...

Last edited by Typhoon859; 15th February 2009 at 10:06.
Typhoon859 is offline  
Old 15th February 2009, 13:44   #6  |  Link
@Tron@
Registered User
 
Join Date: Nov 2008
Posts: 24
What is the best way (script or plugin) for Upscaling to 720 and 1080 ??????? In fact, there are different scripts and a variety of Resizing as a better way???
@Tron@ is offline  
Old 15th February 2009, 13:55   #7  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,350
Interpolation does inevitably remove some information from the source, but that is not what is causing problems here. What is happening is that, X264 is removing some details from the source, and it is more obvious on the interpolated-then-encoded stream, because x264 had to apply more compression to that stream then the uninterpolated one.
*.mp4 guy is offline  
Old 15th February 2009, 13:56   #8  |  Link
Fizick
AviSynth plugger
 
Fizick's Avatar
 
Join Date: Nov 2003
Location: Russia
Posts: 2,183
there is no BEST way (beside dont upscaling it ).
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick
I usually do not provide a technical support in private messages.
Fizick is offline  
Old 15th February 2009, 14:31   #9  |  Link
@Tron@
Registered User
 
Join Date: Nov 2008
Posts: 24
Quote:
Originally Posted by Fizick View Post
there is no BEST way (beside dont upscaling it ).


Then reformulated the question - what the script (plugin, Resiz ...) better than another??? Indeed, the difference is and I just want to know how best to use and all ... I hope all the same to get an answer )))))))
@Tron@ is offline  
Old 15th February 2009, 14:58   #10  |  Link
Jeremy Duncan
Didée Fan
 
Jeremy Duncan's Avatar
 
Join Date: Feb 2006
Location: Canada
Posts: 1,079
Sharpener
Resizer

limitedsharpenfaster()
Spline64resize(1920,1080)

Resizing before sharpenign ruins the effect.
Jeremy Duncan is offline  
Old 15th February 2009, 15:18   #11  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally Posted by @Tron@ View Post
What is the best way
Please read and obey forum rule 12.
Guest is offline  
Old 15th February 2009, 20:08   #12  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Jeremy Duncan View Post
Sharpener
Resizer

limitedsharpenfaster()
Spline64resize(1920,1080)

Resizing before sharpenign ruins the effect.
Well, I've tried resizing after and the same thing happens. I think the resize should be done before because then, all the other applied filters work on the full 720p picture. The sharpness looks better that way. I haven't tried Spline64resize so I'll try that and see what happens.\

EDIT: I tried it and the same thing happens.

Last edited by Typhoon859; 15th February 2009 at 21:09.
Typhoon859 is offline  
Old 15th February 2009, 20:11   #13  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by *.mp4 guy View Post
Interpolation does inevitably remove some information from the source, but that is not what is causing problems here. What is happening is that, X264 is removing some details from the source, and it is more obvious on the interpolated-then-encoded stream, because x264 had to apply more compression to that stream then the uninterpolated one.
But as I've mentioned, a fellow encoder is able to do this without the loss in quality. In fact, I'll post his result.. This was also upscaled to 720p.
Typhoon859 is offline  
Old 15th February 2009, 20:28   #14  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
There's no way that "just resizing" in Avisynth would lead to that kind of softening which you're showing.

You need to give us the *exact* way how the source was loaded, which filters were used, etc. Most probably there's some filter acting in the background that you're not aware of.

Quickly guessing for an explanation, it could be you're loading the VOB source with DGDecode (or a variant) with activated deblocking ("PP=1/2/4/6", or something). The deblocking could easily lead to detail loss like seen e.g. on those roofs.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)

Last edited by Didée; 15th February 2009 at 20:30.
Didée is offline  
Old 15th February 2009, 20:34   #15  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Didée View Post
There's no way that "just resizing" in Avisynth would lead to that kind of softening which you're showing.

You need to give us the *exact* way how the source was loaded, which filters were used, etc. Most probably there's some filter acting in the background that you're not aware of.

Quickly guessing for an explanation, it could be you're loading the VOB source with DGDecode (or a variant) with activated deblocking ("PP=1/2/4/6", or something). The deblocking could easily lead to detail loss like seen e.g. on those roofs.
Nope. I'm not doing that. I just index the VOB with DGIndex, include that as the mpeg2source in the AVS script and encode it.

Yeah, I know that wasn't achieved with just resizing. Of course - there are many added filters. The point is that resizing is one of them and it didn't cause that effect. I put softening, noise, and grain filters in mine as well but no matter what, the filters aren't going to give you any added details which were or will be lost by the resize...
Typhoon859 is offline  
Old 15th February 2009, 20:45   #16  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
I'm not referring to the picture two posts above. That obviously used much of filtering (one of them being [a]WarpSharp, look at the rounded shingles on the big roof.)

In the OP you present a pic "original VOB" (which isn't original, since it's already resized), and two pics "VirtualDub resized" and "Avisynth resized", both of which show detail loss that *can not* be caused by the standard resizing algorithms, but could be caused e.g. by the deblocking filter of mpeg2source(), if activated.

To find the cause, I asked you to post your exact settings, most importantly the *exact script*.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline  
Old 15th February 2009, 21:06   #17  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Didée View Post
I'm not referring to the picture two posts above. That obviously used much of filtering (one of them being [a]WarpSharp, look at the rounded shingles on the big roof.)

In the OP you present a pic "original VOB" (which isn't original, since it's already resized), and two pics "VirtualDub resized" and "Avisynth resized", both of which show detail loss that *can not* be caused by the standard resizing algorithms, but could be caused e.g. by the deblocking filter of mpeg2source(), if activated.

To find the cause, I asked you to post your exact settings, most importantly the *exact script*.
Oh. Actually, the script is just the resize. What I did was do a Print Screen of the frame fullscreen for each one. They're all decoded by FFDShow with none of its filters applied. It's not FFDShow that's creating the issue.
Typhoon859 is offline  
Old 15th February 2009, 21:23   #18  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,393
You sound contradicting.

Quote:
Originally Posted by Typhoon859 View Post
Nope [...] I just index the VOB with DGIndex, include that as the mpeg2source in the AVS script and encode it.
vs.

Quote:
Originally Posted by Typhoon859 View Post
They're all decoded by FFDShow with none of its filters applied.
Unclear to me. [Decoded by mpeg2source] isn't the same as [decoded by ffdshow].

In case of doubt, feel free to upload a small sample of your source. It will be easy to show that Avisynth's resizers are not the cause of that detail loss.
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline  
Old 15th February 2009, 21:31   #19  |  Link
Typhoon859
Banned
 
Join Date: Feb 2009
Posts: 136
Quote:
Originally Posted by Didée View Post
You sound contradicting.


vs.



Unclear to me. [Decoded by mpeg2source] isn't the same as [decoded by ffdshow].

In case of doubt, feel free to upload a small sample of your source. It will be easy to show that Avisynth's resizers are not the cause of that detail loss.
No.. I mean, lol.. The VOB is the MPEG-2 Source. So the last three pictures are h264 encodes, encoded in VirtualDubMod by importing the following AVS script - which I then played back in MPC with FFDShow as the decoder for the stream. The original wasn't encoded but rather was the original VOB that I just opened in MPC, also decoded by FFDShow.

LoadPlugin("C:\Program Files (x86)\DGMPGDec 1.5.2\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\Warpsharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\UnDot.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\MaskTools.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ColorMatrix.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\hqdn3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\FluxSmooth.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\RemoveGrain.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\TCPDeliver.dll")

mpeg2source("C:\Users\Typhoon859\Desktop\Dragon Ball Z - Movies 7 & 9 Double Feature Remastered Trailer.d2v")

Lanczos4Resize(1280,720)


-The loading of the plugins doesn't really do anything...

EDIT: Oh, well actually, yeah, the plugins are necessary for the filters I plan to use to work and for the mpeg2source to be able to be decoded. Yeah, you were right - DGDecode. But, as I showed, without the resize in place, with purely the h264 encode, the problem isn't as prominent and just as much is removed as in the encode of the other guy that I showed. The little bit removed by the h264 isn't the problem.

Last edited by Typhoon859; 15th February 2009 at 21:36.
Typhoon859 is offline  
Old 15th February 2009, 21:56   #20  |  Link
Sagekilla
x264aholic
 
Join Date: Jul 2007
Location: New York
Posts: 1,752
If you want to upscale it to 720p without it looking like complete crap you need to do a couple of things:

1) Darken those lines up a bit (Toon or fastlinedarken)
2) Denoise it
3) do edge enhancement (LSF with it's edge-only mode)
4) Use NNEDI to upscale to 1440x960, then scale down to 1280x720 with Spline16Resize or something like that.

My try with a generic script I had for an anime encode I did a long time ago:


Script for attempt #3:
Code:
# Disclaimer: Absurdly slow.
Imagereader("original.png")
ConvertToYV12()
Spline16Resize(720,480)


Toon(0.25)
dfttest(sigma=1.6, tbsize=3)
AAA(chroma=true)
NNEDI(1,dh=true).TurnLeft().NNEDI(1,dh=true).TurnRight()
aWarpSharp(24,4,0.3,1)
LimitedSharpenfaster(edgemode=1,strength=200,ss_x=1,ss_y=1)
spline36Resize(1360,768)
Tweak(sat=1.1)
Only difference between this image and my attempt #3 script is this one didn't have Tweak(sat=1.1) applied.
__________________
You can't call your encoding speed slow until you start measuring in seconds per frame.

Last edited by Sagekilla; 15th February 2009 at 22:10.
Sagekilla is offline  
Closed Thread

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 23:41.


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