Log in

View Full Version : Interlaced resize


RB
16th January 2003, 12:36
Hi,

I want to resize some interlaced PAL material to SVCD resolution and keep it interlaced. Is the following approach correct?


SeparateFields()
BicubicResize(480,288,0,0.6)
Weave()


Or should I better use trbarry's InterlacedResize plugin? I'm only sampling down and want the best quality.

Thanks!

hakko504
16th January 2003, 12:52
What do you start with? If you resize from a PAL-DVD then you will be able to use BicubicResize(480,576) as the resize functions will only work in one direction at the time, so if you don't change size in one direction then nothing will happen. If you don't resize from PAL-DVD then it is correct

RB
16th January 2003, 13:02
Yes, source is a PAL DVD. Thanks for clearing this up.

RB
16th January 2003, 13:21
Sorry, just another question: when cropping and resizing (so the dimensions change in both directions) interlaced stuff, should I crop before or after SeparateFields? I think it doesn't really matter, right?

hakko504
16th January 2003, 13:26
Nope, that shouldn't matter, as long as you halve the heights when cropping after separatefields, i.e. Crop(8,2,-8,-16).separatefields() is equal to separatefields().Crop(8,1,-8,-8)

RB
16th January 2003, 20:48
Thanks. But I was just thinking about something... when I do the cropping before SeparateFields and then do some resizing, Weave and then AddBorders, I think I should

[list=1]
Make sure that the height after cropping is a multiple of 2
When adding borders at top/bottom after Weave, make sure I don't screw up the field order
[/list=1]

Right? But hmm, I feel like I'm missing something...

hakko504
16th January 2003, 20:57
This is only necessary if you have YV12 data (A2.5a). The point is that you need to have the same number of lines in both fields. Yep, and usually this is accomplished by making sure the add border command also have all even numbers.

trbarry
16th January 2003, 21:14
Like Hakko suggests, InterlacedResize is only needed when you are going to vertically resize interlaced material. Using it makes the picture slightly softer due to interpolation, quite similar to what happens to chroma in a yv12->yuy2 conversion. But so will resizing separated fields.

- Tom

bb
9th April 2003, 17:11
Originally posted by trbarry
Like Hakko suggests, InterlacedResize is only needed when you are going to vertically resize interlaced material.
The (bilinear) spatial resizer averages pixels from the horizontal and vertical neighbourhood. Thus I think you'd have a temporal effect, because every other line is from two different points in time, and you'd "melt" them together, which is probably not what you want. May have strange effects on scene changes, too.

Clearly, using SimpleResize on an interlaced source is not the same as separating the fields, applying the filter on both fields separately, and weaving them back together.

If you ask me, for processing interlaced material using multiple filters you should always separate first, then filter, then weave. Otherwise you'd mess up the temporal information.

Please correct me if I'm wrong.

bb

trbarry
10th April 2003, 15:27
bb -

If you use the InterlacedResize() function it will interpolate the values for top fields only from top fields, same for bottom.

This avoids getting wrong temporal info but means the results are not as precise as progressive resize.

And in any event, InterlacedResize() is not supported for YV12 yet.

- Tom

bb
11th April 2003, 12:51
Hi Tom,

so you agree with me that it's not a good idea to use (progressive) SimpleResize for interlaced sources? (I guess that's why you implemented InterlacedResize.)

And would you agree with me if I said you should use InterlacedResize on ("truely") interlaced sources even if you are resizing horizontally only?

bb

trbarry
11th April 2003, 16:45
so you agree with me that it's not a good idea to use (progressive) SimpleResize for interlaced sources? (I guess that's why you implemented InterlacedResize.)

Yep. ;)


And would you agree with me if I said you should use InterlacedResize on ("truely") interlaced sources even if you are resizing horizontally only?

AFAIK it doesn't matter if you resize only horizontally. They all work.

- Tom

bb
14th April 2003, 14:34
Thanks, Tom.

Originally posted by trbarry
AFAIK it doesn't matter if you resize only horizontally. They all work.
Sorry if I insist on this, but do they work correctly in this case? Maybe you won't see it (very much), but I think you'd get a vertical averaging that shouldn't be done (pixels from different points in time).

bb

sh0dan
14th April 2003, 16:15
Resizing is always done separately for each dimension, and if one dimension isn't resized it isn't touched. The horizontal resizer only interpolates horizotally for instance.

bb
15th April 2003, 07:19
Thanks, sh0dan. I've always wanted to know that...

bb