Log in

View Full Version : resize TO anamorphic 16:9


plugh
18th July 2007, 01:41
Am down-sizing some square pixel HD material for anamorphic 16:9 encode.

Have been reading about merits of various resizers, but have not seen this specific case discussed.

It occurs to me that perhaps the vertical and horizontal resizers should use differant algorithms. Perhaps sharpening vertically but smoothing horizontally? Or perhaps the opposite?

In principle, in CRT-land, the anamorphic pixels are simply drawn wider; with perhaps a (linear?) gradient between loci.

In digital-land, pixels are processed by video chipset (perhaps bilinear, perhaps bicubic) to generate resampled stream of pixels for square pixel displays.

The latter of the two cases (digital video processing) is probably more prevalent nowadays (even with crt TVs). So factoring all this together, does it make sense to use differant resizing algo's for non-square pixel encodes to 'compliment' the display processing?

Comments?

plugh
20th July 2007, 06:49
Hmmm. An underwhelming response...

Perhaps a simpler question:

Avisynth docs say "AviSynth has completely seperate vertical and horizontal resizers. If the input is the same as the output on one axis, that resizer will be skipped.
Which one is called first, is determined by which one has the smallest downscale ratio. "

Can anyone define 'downscale ratio' ?

Is it Original/Target, or Target/Original ?

Thanks

sh0dan
20th July 2007, 09:09
It chooses the resizer that will give it the largest amount of reduction in pixels.

400x400 -> 380x200, is divided into 400x400 -> 400x200 -> 380x200

400x400 -> 200x380 is 400x400 -> 200x400 -> 200x380.

You can use resizers for each axis, by splitting the resize yourself. As you mentioned, the resize is skipped completely, if there isn't any resolution change in one direction.

1024x768 -> 720x576
lanczosresize(720,768) #Lanczos horizontally
bilinearresize(720,576) #Bilinear vertically

plugh
20th July 2007, 12:57
It chooses the resizer that will give it the largest amount of reduction in pixels.

Wow, did I get that wrong! I interpreted that bit in the docs in exactly the opposite sense. (ie Original/Target where 'smallest ratio' would mean 'least reduction')

So going from 16x9 square-pixels to anamorphic 16x9 'thin-pixels' the horizontal resizer would always be called first.
ie 1280x720 (1:1 PAR) -> 704x720 -> 704x480 (40:33 PAR)

I think I will start with a bit of horizontal sharpening...

Thanks!

sh0dan
20th July 2007, 13:49
The order of resizers are not important, in a simple test, the order made no more than +-1 max deviation , with an average of 0.002 mean abs dev, PSNR at about 59.16. The order choice is simply based on speed.

plugh
20th July 2007, 15:07
Interesting...

I left out the last line in my doc quote above; it says
"Which one is called first, is determined by which one has the smallest downscale ratio. This is done to preserve maximum quality, so the 2nd resizer has the best possible picture to work with."

So your quick test indicates the last sentence isn't actually very significant? That's good to know. Thanks!

plugh
21st July 2007, 23:33
As my curiosity was aroused, I did a series of xvid encodes.

50,000 frames, const quant=2, no B frames
1920x1080 (1:1 PAR) -> 1056x720 (40:33 PAR)
various resize sequences vs file size(KB)
bicubic 2,239,276

bilinear Horz bicubic Vert 2,189,802
bicubic Vert bilinear Horz 2,189,098
bicubic Horz bilinear Vert 2,184,996
bilinear Vert bicubic Horz 2,183,212

bilinear 2,147,850
"Things that make you go hmm"

Not sure what conclusion to draw, but looks interesting...