PDA

View Full Version : Resize Before Crop or After ?


chilledoutuk
21st January 2004, 12:12
Ok i have only been using avisynth for a few weeks and have been getting good results but one thing i cant ind teh answer for is it better to crop before resizing or is it better to crop after.

heres two scripts i have used recently

LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\MPEGDecoder.dll")
MPEGSource("ga.d2v")
Crop(0,80,0,-80)
LanczosResize(1024,416)

Becuase im only resizing the x axis i thought it would save time writing scripts if i always resized to 1024x576 and then cropped the borders after.

LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\MPEGDecoder.dll")
MPEGSource("ga.d2v")
LanczosResize(1024,576)
Crop(0,80,0,-80)

the most impotant question i have is will there be any difference in quality between the two if so which is better?
Secondly which is the fastest way?

Im going to do a couple of tests to see if i can tell the difference.

But i would be very apreciative if anyone could offer help optomizing my scripts as I am new to avisynth.

cheers

Wilbert
21st January 2004, 13:12
I don't think there is a difference in quality. Your first script should be a little bit faster than the second script.

Bidoche
21st January 2004, 13:15
You can do both at once too, all resizers can crop while resizing.

chilledoutuk
21st January 2004, 14:20
sample script please

Jawor
21st January 2004, 16:39
Here's a sample script:
LoadPlugin("D:\Program Files\AviSynth 2.5\plugins\MPEGDecoder.dll")
MPEGSource("ga.d2v")
LanczosResize(1024,416,0,80,720,416)
(The source is 16:9 anamorphic DVD using a resolution of 720x576)

chilledoutuk
21st January 2004, 17:01
thanks jawor for the script is there any advantage by cropping like this?

sh0dan
21st January 2004, 17:38
Short and simple - No!

1) Script gets harder to read.
2) You can't use negative offsets.
3) It's usually slower.

You can use fractional crop settings, but in general it isn't a good idea.

The "good":

1) You don't have to respect the limitations of the colorspace (mod 2 in YV12). But qualitywise I wouldn't recommend it.

btw - you should just crop before resize - it's the fastest, and cleanest way.

r6d2
22nd January 2004, 04:08
Originally posted by sh0dan
[B]Short and simple - No!

3) It's usually slower.
Uh... News to me. Never tested it. Just believed what www.avisynth.org says:
If you supply the optional source arguments, the result is the same as if you had applied Crop with those arguments to the clip before BilinearResize (except faster).
Thanks for the tip, Sh0dan (actually in FACAR it is done that way). ;)

sh0dan
22nd January 2004, 13:29
The horizontal resizer will be slower in many cases - especially on big crops. The vertical resizer is however at the same speed.

We are however talking small margins.

FredBender
31st January 2004, 11:08
Originally posted by sh0dan
The horizontal resizer will be slower in many cases - especially on big crops. The vertical resizer is however at the same speed.

Can you explain to me why?