Log in

View Full Version : cropping inconsistencies in vdub and avisynth


midiguy
30th July 2002, 11:54
ok, I'll get to the point.
I need to crop 9 on the left, 7 on the right, 0 on top and 0 on bottom.

I did this in my AVS (actually, gknot did :D ):
crop(9,0,704,480)
BicubicResize(512,384,0.333,0.333)
I loaded this into virtualdub and copied frame "A" (we'll call it that) and pasted it into paint
then, I took out that crop and resize lines in my AVS, and relaoded the AVS in virtualdub. I cropped and resized in virtualdub with the following filter settings:
resize (512 x 384 precise bicubic -0.60 crop: 9 on left, 7 on right, 0 on top, 0 on bottom)
then, I once again went to frame "A" (same frame as before) and copied the output frame to clipboard (resized + cropped) and pasted it into a different session of paint.
now I have both images pasted into different paint sessions. I was actually looking at the difference between the softest bicubic avisynth resize in comparison to the softest bicubic vdub resize. however, when I did this, I noticed that the frames were not aligned!!
the avisynth resized image was too far to the right (or the vdub one was too far to the left, either way you see it).. then, I changed my crop settings in v duv to 8 on the left and 8 on the right, and pasted that image over the other v dub one. now, both images were aligned perfectly! the avisynth cropped + resized image (9,7) and the vdub cropped + resized (8,8) were aligned perfectly. so, I conclude, cropping 9 on the left and 7 on the right in avisynth is equivalent to cropping 8 on the left and 8 on the right in virtualdub. now, what gives?

BTW: I did this test several times on several frames only to come to the same conclusion. and, I did alt + tab between the two paint sessions to easily get a close up look at the frames.

DJ Bobo
30th July 2002, 15:18
This is an old golden rule you should have known already: always crop with even values.

manono
30th July 2002, 18:39
Hi midiguy-

Interesting test. AviSynth rounds up or rounds down or something when you feed it odd numbers. What did you learn about the difference in the resizers? If I remember correctly, the VDub resizer is supposed to be very slightly softer than the equivalent AviSynth resizer. Neutral for VDub is .6 and for AviSynth is .5. I think that's how it goes.

midiguy
30th July 2002, 18:41
Originally posted by DJ Bobo
This is an old golden rule you should have known already: always crop with even values.

hmmm. I never knew that... but still. how does that explain the inconsistencies between the 2 programs? I am thinking that the crop in avisynth automatically went down to (8,8) while the crop in vdub is less standard and more flexible in that sense?