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 24th April 2020, 11:26   #1  |  Link
Damiano
Registered User
 
Join Date: Dec 2011
Posts: 1
Crop() or resizer's crop?

Hi.

This is probably one of those really old questions, which have been asked countless of times before , but I did my research and I found very little information related to this particular subject or perhaps I was using wrong queries. I'm also still pretty new to re-encoding and obviously don't know all ins and outs of this business to know what it is exactly I'm looking for.

What I want to know is how really different is cropping using crop() function and any resizer's built-in cropping feature in terms of output quality? I'm re-encoding this cartoon show from a DVD source using VirtualDubMod and AviSynth and have to crop the source and then resize it.

You see, I'm a little OCD about overcropping and don't want to lose any healthy pixels and would rather be a little more specific and use odd parameters. However, I heard it may affect the quality of the output in a minor way, meaning I may not see it but it's probably there, which I'm also a bit OCD about.

So, I'm facing a dilemma here: crop with crop() and lose some pixels for the sake of quality or use resizer's cropping feature and deteriorate the output in a way not visible to the naked eye? I've done tests using both but I can't say I noticed any real difference (placebo doesn't count, of course). It also didn't affect the bitrate in any wise.

So what do I do? Does the presumed quality loss depend on a resizer at all? The only thing I found is this (avisynth.nl):

Quote:
Crop any hard borders or noise; Resize cropping may propagate the noise into the output.
May? I'm not sure I understand. There was also someone on another forum who said it may "blur the chroma channels a little bit", which made little sense to me, but whatever the case I just want to know how bad the damage really is in my situation. Any input would be appreciated.

Last edited by Damiano; 24th April 2020 at 11:29.
Damiano is offline   Reply With Quote
Old 24th April 2020, 16:09   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
It means the resizers aren't restricted from using pixels outside of the "cropped picture" for their resizing calculations, so if the area to be cropped isn't picture, it can still propagate some of the black/crud into the edges of the resized image when you crop it with a resizer. If everything's picture you can just use resizer cropping, but given you're obviously cropping black/crud, it'd be technically better to use the crop function to remove it all, and then use resizer cropping for any additional cropping required to prevent aspect error. Resizer cropping isn't restricted to whole pixels, because it really just specifies the picture area to be used for the resized image, but if you crop black with it, I think about the worst that'll happen is the edges won't be quite as sharp.

For example, to crop 4 pixels of crud from the sides of a 1920x1080 image and resize to 1280x720.

Crop(4,0,-4,0)
Spline36Resize(1280,720, 0, 2.25, 0, -2.25)

It can often be hard to avoid cropping some picture to prevent aspect error when resizing. The example above crops 2.25 good pixels top and bottom to prevent aspect error. You could reduce that by resizing to something like 1276x720 instead, but it depends what you want the output to be. I don't stress about cropping a little picture. I usually crop a bit when DVDs are close to 16:9 or 4:3 after cropping the black, but not quite 16:9 or 4:3 (I'm more OCD about a bunch of related encodes such as episodes of a TV show having the same dimensions). For an example such as the one above, I'd definitely crop a few extra pixels and resize to 1280x720, but that's just me. Of course if you're not resizing, you can only use Crop().

Not to mention that the amount of black around the edges of a DVD picture can often change from scene to scene, so unless you want to adjust the cropping for different sections of the video, you have to pick a "compromise" cropping. Unless it changes dramatically, I look for the area with the most black and apply the necessary cropping to remove it. For sections of the video with less black, some picture gets cropped. And DVDs were meant to be displayed on a CRT, so even if the edges of the frames aren't black, they contain picture that wouldn't have been seen due to over-scanning. That's why when you watched DVDs on a CRT display, you never saw the black.

To automate it a little you could try this function. The CSplit argument controls how the cropping is split between the Crop function and the resizer. By default, Crop() does as much of the cropping as possible, but if you set CSplit=2, Crop() only does the specified cropping, and the resizer crops the rest. CSplit=3 does all the cropping with the resizer. When CSplit=2, for a YV12 source if you specified a cropping of 3 pixels, Crop() would crop 2 and the resizer would crop 1 pixel, assuming there's no additional cropping applied.

The above equivalent would be
CropResize(1280,720, 4,0,-4,0, CSplit=2, Info=true)
with Info enabled to tell you how much extra cropping the script is doing.

Last edited by hello_hello; 25th April 2020 at 16:38.
hello_hello 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 14:17.


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