PDA

View Full Version : ComplementParity or not ComplementParity when joining 2 fields


leonid_makarovsky
16th December 2004, 17:45
Hi,

I'm a bit confused at what point ComplementParity should be used.

I have PAL AVI (Huffyuv codec - top field first).

A0top/A0bot A1top/A1bot A2top/2Abot

What I want to do is I want to throw away A1bot and A2top and join the rest so it becomes A0top/A0bot A1top/A2bot

So would this code work?
clip =....

joint = Trim(clip, 1, 2)
joint = ComplementParity(joint) # do I need it?
joint = SeparateFields(joint)
joint = Trim(joint, 0, 0) ++ Trim(joint, 3, 3)
joint = Weave(joint)
joint = ComplementParity(joint) # do I need it at this point
return joint

Thanks.

--Leonid

stickboy
16th December 2004, 20:24
If you know what your field-order is, then use AssumeTFF/AssumeBFF instead of ComplementParity. Although it should work in your case--since AviSynth by default assumes clips are BFF--AssumeTFF/AssumeBFF would be clearer.

You don't need the second ComplementParity at all.

The Trim calls don't look right. After SeparateFields, your sequence will be:
A0top A0bot A1top A1bot A2top A2bot
index: 0 1 2 3 4 5
Therefore it should be:
Trim(0, 1) + Trim(3, 0)

leonid_makarovsky
16th December 2004, 20:51
Ah, ok, then
clip = AVISource(...)
clip = AssumeTTF(clip)

#Now for a simple case let's just have
#A0top/A0bot A1top/A1bot

#and I want to have final result as A0top/A1bot
joint = SeparateFields(clip)
#so now joint = A0top A0bot A1top A1bot
#you're saying that selecting A0top and A1bot the following code
#will *NOT* work:
joint = Trim(joint, 0, 0) ++ Trim(joint, 3, 3)

#now after I do this:
joint = Weave(joint)
#should I be calling
joint = AssumeTTF(joint)
?

Thank you.

--Leonid

stickboy
17th December 2004, 04:38
Originally posted by leonid_makarovsky
#and I want to have final result as A0top/A1bot
joint = SeparateFields(clip)
#so now joint = A0top A0bot A1top A1bot
#you're saying that selecting A0top and A1bot the following code
#will *NOT* work:
joint = Trim(joint, 0, 0) ++ Trim(joint, 3, 3)For your simplified case, that will work. For your original case it will not.
#now after I do this:
joint = Weave(joint)
#should I be calling
joint = AssumeTTF(joint)No. Your material still will be TFF.