Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th March 2008, 07:17   #1  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
deinterlacing BFF/TFF - which SelectEvery setting ?

Can someone please clarify which "SelectEvery" settings to use for each of TFF and BFF interlaced input sources to re-interlace a clip back to the same type as the source.

I've seen both "SelectEvery(4,0,3)" and "SelectEvery(4,1,2)" used in different settings with different comments, and am left unsure as to the "proper" setting to turn the progressive result back into the same interlacing type as the source.

eg per http://forum.doom9.org/showthread.ph...00#post1110600 which setting to use ?

1. BFF input (usually from an older DV camera)
Code:
AVISource("somevideo.avi")
ConvertToYV12(interlaced=true)
AssumeBFF()
TDeint(mode=1,order=0)      # mode=0=deinterlace mode=1=doubleframerate, order=0=BFF order=1=TFF 
# progressive-based denoising in here
AssumeBFF().SeparateFields().SelectEvery(??,??,??).Weave() # 4,0,3 for BFF ??
2. TFF input (usually form TV capture)
Code:
AVISource("somevideo.avi")
ConvertToYV12(interlaced=true)
AssumeTFF()
TDeint(mode=1,order=1)      # mode=0=deinterlace mode=1=doubleframerate, order=0=BFF order=1=TFF 
# progressive-based denoising in here
AssumeTFF().SeparateFields().SelectEvery(??,??,??).Weave() # 4,0,3 for TFF ??
halsboss is offline   Reply With Quote
Old 10th March 2008, 08:28   #2  |  Link
stickboy
AviSynth Enthusiast
 
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Reason it out.

Suppose your source material is TFF, for example. Then after you call SeparateFields(), your frames will be:

Code:
T B T B T B T B ... (T = Top field, B = Bottom)
0 1 2 3 4 5 6 7 (Frame numbers)
If you then call SelectEvery(4, 0, 3), you'll end up with a top field followed by a bottom field. Therefore it preserves the original field dominance.

If instead you called SelectEvery(4, 1, 2), you'd end up with a bottom field followed by a top field. Therefore it reverses the field dominance.
stickboy is offline   Reply With Quote
Old 10th March 2008, 08:38   #3  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,168
It is always 4,0,3 when using
Code:
Assume?FF().SeparateFields().SelectEvery(4, 0,3).Weave()
the 4,1,2 option is for inverting the field dominance.

1. E.g. Take a TFF source :-
[TB],[TB],[TB],...
Bob it
[Tb],[tB],[Tb],[tB],[Tb],[tB],... - Lowercase is interpolated fields
4,0,3 selects
[TB],[TB],[TB],...
4,1,2 selects
[bt],[bt],[bt],...

2. E.g. Take a BFF source :-
[BT],[BT],[BT],...
Bob it
[Bt],[bT],[Bt],[bT],[Bt],[bT],... - Lowercase interpolated fields
4,0,3 selects
[BT],[BT],[BT],...
4,1,2 selects
[tb],[tb],[tb],...
IanB is offline   Reply With Quote
Old 10th March 2008, 09:01   #4  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Great. Thanks.

<snip>

Last edited by halsboss; 10th March 2008 at 09:52. Reason: removed dummy thought
halsboss is offline   Reply With Quote
Old 10th March 2008, 09:11   #5  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Oh I think I'd got mixed up. The TDEINT doco says "mode=1 - double rate output (bobbing)" = 50fps progressive, and IanB says "bob it", so may I assume that mode=1 is indeed bobbing it ... and
Code:
AssumeBFF().SeparateFields().SelectEvery(4,0,3).Weave()
is right for TDEINT(mode=1).

For TDEINT(mode=0) =25fps progressive, for both TFF and BFF after denoising it's ?
Code:
AssumeTFF().SeparateFields().Weave() # TFF or
AssumeBFF().SeparateFields().Weave() # BFF

Last edited by halsboss; 10th March 2008 at 13:42.
halsboss is offline   Reply With Quote
Old 10th March 2008, 10:39   #6  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
I guess this isn't right then http://forum.doom9.org/showthread.ph...75#post1046675 ?
Quote:
Originally Posted by R3Z View Post
Easiest way i know is to dumb bob (without Motion compensation);
Bob(0,0.5)
Apply filters
Then re-interlace;
SeparateFields().SelectEvery(4,0,3).Weave() # bff
or
SeparateFields().SelectEvery(4,1,2).Weave() # tff

Thanks go to Didee for teaching me this.
and this ? http://forum.doom9.org/showthread.ph...17#post1105717 which mentions "SelectEvery(4,1,2)".

Last edited by halsboss; 10th March 2008 at 10:58.
halsboss is offline   Reply With Quote
Old 10th March 2008, 12:15   #7  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,607
long story short:

AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -> TFF
AssumeBFF().SeparateFields().SelectEvery(4, 0, 3).Weave() -> BFF
AssumeTFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -> BFF
AssumeBFF().SeparateFields().SelectEvery(4, 1, 2).Weave() -> TFF
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 10th March 2008, 12:25   #8  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,390
Addendum: Bob() flags the output always as BFF, even if the input is TFF.

Hence: The quoted code of R3Z basically would/should be wrong for the "TFF" case. However in this particular case, the result is correct, because the wrong code corrects the behaviour of Bob().
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 10th March 2008, 15:01   #9  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi folks!
Very interesting. Please advice this script right or wrong?
Code:
Avisource("test.avi")#TFF source with BFF flag
AssumeTFF()
nnedi(field=-2)#using nnedi as bobber
some filters
SeparateFields()
SelectEvery(4,0,3)
Weave()# result will be TFF?
With kind regards yup.
yup is offline   Reply With Quote
Old 10th March 2008, 15:07   #10  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,923
Quote:
Originally Posted by yup View Post
Please advice this script right or wrong?
Read scharfi's post again and then engage your cerebral cortex. It's not rocket science.
Guest is offline   Reply With Quote
Old 29th November 2008, 08:56   #11  |  Link
Alex_ander
Registered User
 
Alex_ander's Avatar
 
Join Date: Apr 2008
Location: St. Petersburg, Russia
Posts: 334
Quote:
Originally Posted by yup View Post
Code:
Avisource("test.avi")#TFF source with BFF flag
AssumeTFF()
nnedi(field=-2)#using nnedi as bobber
some filters
SeparateFields()
SelectEvery(4,0,3)
Weave()# result will be TFF?
The resulting field order here will by default coincide with that on 'some filters' output. If you want to independently set TFF for output, use AssumeTFF() just before SeparateFields().
Alex_ander is offline   Reply With Quote
Old 29th November 2008, 09:41   #12  |  Link
Alex_ander
Registered User
 
Alex_ander's Avatar
 
Join Date: Apr 2008
Location: St. Petersburg, Russia
Posts: 334
BTW, there's also a shorter (without field separation) equivalent of <SeparateFields().SelectEvery(4,1,2).Weave()>, which also inverts field dominance:

Code:
DoubleWeave().SelectEvery(4,1)
or 
AssumeBFF().DoubleWeave().SelectEvery(4,1)#TFF output
or 
AssumeTFF().DoubleWeave().SelectEvery(4,1)#BFF output
Alex_ander is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:00.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.