Page 1 of 1

[RESOLVED] 2036 cropping issue

Posted: Thu Nov 04, 2010 3:39 pm
by ZooStation
Tried on an HD source and reproduced in the attached example. Cropping 6 6 6 6 results in 4 lines cropped top and left, and 8 bottom and right. Windows 7 x64.
Cheers

Re: 2036 cropping issue

Posted: Thu Nov 04, 2010 4:33 pm
by admin
Cr*p. I only tested DGIndexNV which simulates the GPU cropping, and it appears that the GPU cropping must be mod 4. I am confirming this with Nvidia, but if true, it means I have to back out the mod 2 change.

Thanks for alerting me to this.

Re: 2036 cropping issue

Posted: Thu Nov 04, 2010 4:56 pm
by Didée
There is a good reason for this mod4 restriction - think about e.g. interlaced mpeg2 :evil:

This restriction can be loosened in several cases (horizontal-only cropping, progressive content, ...), but not universally. So, the easiest way to prevent the user from doing silly things is to impose a general mod4 restriction. Everything is good.

Re: 2036 cropping issue

Posted: Thu Nov 04, 2010 6:59 pm
by admin
Yes, I'm aware of all those cases. But it's quite valid to say "I have progressively sampled video; there's no reason to deny me a mod 2 top crop". So my idea was to allow it, just as Avisynth does. A warning is always useful, just as in the Avisynth documentation.

My basic position is that it's not my responsibility to stop users from being stupid. If I took that on as a mandate, things would become ridiculous very fast. Why penalize valid applications because there are stupid people out there?

Re: 2036 cropping issue

Posted: Thu Nov 04, 2010 7:40 pm
by Didée
Perhaps it wasn't quite clear ... my comment wasn't targeting you, but only Nvidia. I perfectly understand them to allow only mod4, in order to avoid potential problems.

And after all, this is an Avisynth filter. A script has to be made anyway, and writing a crop() command manually is not a big deal. Is it?

Re: 2036 cropping issue

Posted: Thu Nov 04, 2010 8:04 pm
by admin
Well, it's a big deal, because the crop usually comes before the resize, so if you want the resize done on the GPU, the crop must be done there too.

I know you can calculate things backwards but it's more difficult and unintuitive. And the resize coming first unnecessarily acts on more pixels, though that may be moot on the GPU.