View Full Version : Resizing with separatefields/weave or not on interlaced clip?
Serbianboss
17th July 2006, 22:39
I little work with FitCD and when resize(bilinear resize) it make script like this:
Just to mention that my source is DV avi(interlaced) and want to stay interlaced.
AVISource("C:\Documents and Settings\My Documents\Video 1.avi")
SeparateFields()
LanczosResize(688,208,0,35,720,218)
Weave()
ConvertToYUY2(interlaced=true)
So when resizing interlaced material with (bilinear,bicubic or lanczos resize) does is better to write with separate fields/weave or no?
stickboy
18th July 2006, 00:16
Yes, you should use SeparateFields before resizing. If you don't, scanlines from different fields will be mixed together.
(If you're resizing only in the horizontal direction, it doesn't really matter, though.)
Guest
18th July 2006, 00:30
The separatefields/weave method is better than just plain resizing but it still introduces unnecessary blurring. You have to adjust for the field shift. Here's how to do it properly for TFF (I got this from scharfis_brain):
# interlaced resize the right way
loadplugin("dgdecode.dll")
Global NewHeight=480 # Whatever
Global NewWidth=704 # Whatever else
mpeg2source("nature.d2v")
crop(8, 40, -8, -16)
AssumeTFF()
SeparateFields()
Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 # Field shift correction
Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height())
Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height())
Interleave(Tf, Bf)
Weave()
Serbianboss
18th July 2006, 08:39
thanks for code, but how to do for BFF?
Boulder
18th July 2006, 08:53
The separatefields/weave method is better than just plain resizing but it still introduces unnecessary blurring. You have to adjust for the field shift. Here's how to do it properly for TFF (I got this from scharfis_brain):
[code snipped]
Actually the code is exactly what a plain Bob() does. IanB wrote that in this thread : http://forum.doom9.org/showthread.php?p=594339#post594339
Awatef
18th July 2006, 10:02
For information, it makes little sense to resize interlaced content and keep it interlaced if you're not doing a PAL2NTSC or NTSC2PAL conversion, say 576to480 or 480to576.
Anything else should be deinterlaced.
PS: even for standards conversions, you should deinterlace the source first, resize, then do the framerate conversion (be it from 25p to 60i, or from 30p to 50i). That's to avoid flickering.
foxyshadis
18th July 2006, 10:13
No, you bob and resize, deinterlacing first to do standards conversion is silly.
Guest
18th July 2006, 13:15
Actually the code is exactly what a plain Bob() does. No. Bob() doubles the frame rate.
Awatef
18th July 2006, 14:58
@foxy
I've done extensive tests for a commercial NTSC2PAL transfer, and I wasn't happy with any other method not involving proper deinterlacing, since other methods produce flickering both on TV and monitor (especially on TV)
The method I finally settled on was deinterlacing using TomsMoComp to 30p, do a blending framerate conversion to 50i and resize up to 576.
The result was perfectly smooth on TV with no traces of flickering (blending serves a bit like motion blur btw).
IanB
19th July 2006, 01:22
As I noted at the end in the original thread use of "correct interlaced resizeing" is a performance trick! It will be fast but it is very clearly not the optimum approach.
Using a good motion adaptive smart Bob to extract full frames from the fields and produce a double rate source stream, which you then process and finally reinterlace will give the best results for a genuine interlaced source. For film based sources undoing the telecine to extract the original progressive stream at the original frame rate will yield best results.
Mug Funky
19th July 2006, 04:12
@ Awatef:
i'm with foxy on this...
motion-adaptive deinterlace (keeping the field-rate, ie. 50i deinterlaced to 50p, NOT 25p), then either blend or motion compensate (or both :)), then re-interlace to your target framerate.
single-field deinterlacing (IMHO) is evil and should only be attempted for creative reasons, not mastering ones. that is to say it's the director's choice, not the encode guy. in my opinion it shouldn't even be done for creative reasons, rather it should only be done if you have video that needs to be output to film for cinema playback, or if your destination medium requires it (low bitrate divx, web streams, portable devices, etc).
i, too, have done extensive testing on this matter :)
Serbianboss
19th July 2006, 08:20
So its better to deintrlance clip, add filters(noise,resize...) and than reinterlance.
IanB
19th July 2006, 12:21
So its better to deintrlance clip, add filters(noise,resize...) and than reinterlance.If by "deintrlance" you mean use the smartest Bob available, then yes.
I.e. maintain as much spatial and temporal information as possible during the processing phase and finally reinterlace.
Serbianboss
19th July 2006, 12:22
yes i mean using LeakKernelBob. After deinterlance add filters and than reinterlance.
wuziq
1st August 2007, 17:59
Sorry about bringing up an old thread.. I just didn't want to start yet another one about resizing interlaced content.
I am just wondering whether there is a definitive way to resize interlaced content.
- separatefields, then resize fields, then weave?
- same as above, but account for field shift (as mentioned in this thread)?
- bob, resize, then reinterlace? (how do you "reinterlace", anyway)?
- something else?
Thanks!
Boulder
1st August 2007, 18:03
Smart bob (TDeint, YADIF, MCBob for example), resize and reinterlace.
Guest
1st August 2007, 19:23
how do you "reinterlace", anyway? Starting with bobbed video:
SeparateFields().SelectEvery(4,0,3).Weave()
wuziq
2nd August 2007, 00:24
Awesome, thanks :)
Nikos
5th August 2007, 17:09
Didee and IanB says (http://forum.doom9.org/showthread.php?t=88116&page=2) this is the right script:
Global NewHeight=1234 # Whatever
Global NewWidth=1234 # Whatever else
avisource("blah.avi")
AssumeTFF()
Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 # Field shift correction
SeparateFields()
Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height())
Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height())
Interleave(Tf, Bf)
Weave()
IanB
6th August 2007, 00:48
Note the caveat:- Fastest but not optimal :D
Nikos
6th August 2007, 15:50
Finally which is the right position before or after SeparateFields() ?
Thanks
IanB
7th August 2007, 01:05
Old mistakes coming back to haunt me and I can no longer completly remember.
Off the top of my head, for the case where NewHeight==Height, I think shift should be 0. Thus [Height()/Float(NewHeight/2)] needs to be 1. Thus Height() needs to return 0.5 the input height. Thus the SeparateFields needs to go first.
Now Didée chalanged me on this logic and I did agree at the time that it was wrong, but I am sorry I can no longer see why.
Sorry for the non-answer, I will need to think about this some (a lot) more. I'll post back when (if) I work it out.
squid_80
7th August 2007, 05:05
If NewHeight==Height, who cares if it's interlaced?
IanB
7th August 2007, 13:45
@squid_80, it is a trivial and obvious data point to test a generalized formula against.
@Nikos, The following 2 variants are correctGlobal NewHeight=1234 # Whatever
Global NewWidth=1234 # Whatever else
avisource("blah.avi")
AssumeTFF()
Shift=(Height()/Float(NewHeight)-1.0)*0.25 # Field shift correction
SeparateFields()
Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height())
Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height())
Interleave(Tf, Bf)
Weave()orGlobal NewHeight=1234 # Whatever
Global NewWidth=1234 # Whatever else
avisource("blah.avi")
AssumeTFF()
SeparateFields()
Shift=(Height()/Float(NewHeight/2)-1.0)*0.25 # Field shift correction
Tf=SelectEven().LanczosResize(NewWidth, NewHeight/2, 0, -Shift, Width(), Height())
Bf=SelectOdd().LanczosResize(NewWidth, NewHeight/2, 0, Shift, Width(), Height())
Interleave(Tf, Bf)
Weave()
Nikos
7th August 2007, 15:40
Thank you IanB for the quick and helpful reply.
Now i am not confused :)
:goodpost:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.