digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Mpeg 2 Interlaced encoding and scripts? (http://www.digitalfaq.com/archives/avisynth/5599-avisynth-mpeg-interlaced.html)

m0rdant 09-15-2003 12:33 AM

Avisynth: Mpeg 2 Interlaced encoding and scripts?
 
I'm mostly working with mpeg 2 encoding (SKVCD and KDVD) and want to keep the encodes interlaced. I've been reading a little about the fact that the fields should be filtered sepperately because of the way smoothing and denoising filters work. What parts of the optimal script would this effect, and what changes would need to be made.

I'm thinking that the fields have to be sepperated, filtered on their own, and then put back together...or maybe I'm way off.

If someone knows and give some examples that would be appreciated. I think most people here do mpeg1 so it hasn't come up for them.

Thanks for any feedback.

jorel 09-15-2003 04:43 AM

try this:

Mpeg2Source("Your_D2V_Source_Here")
SeparateFields()
...
#the sharpen filters...
#the resize line...
#the filters lines...
...
Weave()
AddBorders(x,x,x,x) #or gripborders with MA script!

do a sample for test!
:wink:

vmesquita 09-15-2003 08:41 AM

I have found out yesterday a much better way to do this. The problem with Jorel solution is that fields are not aligned, one field is shifted up and the other down, so temporal filtering won't work right. What this funcition below does is put odd fields in the left side and even fields on the right side of each frame, apply filters and interlace fields back. It's a much better approach! A interlaced frame like this:

AAAAAAAAAAAAAA - Frame 1
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 2
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 3
BBBBBBBBBBBBBB

Becomes:

AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 1
AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 2
AAAAAAAAAAAAAABBBBBBBBBBBBBB - Frame 3

Then you apply the filters and get back to:

AAAAAAAAAAAAAA - Frame 1
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 2
BBBBBBBBBBBBBB

AAAAAAAAAAAAAA - Frame 3
BBBBBBBBBBBBBB

Check it out:

http://forum.doom9.org/showthread.php?threadid=59029

[]'s
VMesquita

GFR 10-10-2003 11:10 AM

I thougth that this subject deserved a small summary so that people in this forum get the idea.

quoting "stickboy":
Quote:

Well, for purely temporal smoothers, there's nothing special you need to do for interlaced material. Scanline #n always gets smoothed against scanline #n from another frame, so you never smooth scanlines from one field against scanlines from another.

For purely spatial smoothers, you only need to call SeparateFields beforehand and Weave afterward, but that's it.

Spatial-temporal smoothers are the ones that are tricky.
And:
http://forum.doom9.org/showthread.ph...AND+interlaced

stickboy
Quote:

If you don't use SeparateFields, the spatial component to Convolution 3D will smooth scanlines from different fields together.

If you do use SeparateFields, the temporal component will smooth scanlines from different fields together.

Tooting my own horn, I recommend using UnfoldFieldsVertical/FoldFieldsVertical when using spatial-temporal smoothers on interlaced material:

Code:

UnfoldFieldsVertical(true)
Convolution3D(preset="movieHQ")
FoldFieldsVertical(true)


One drawback is that the lower border of the "top" field and the upper border of the "bottom" field will get "blended" by spatial smoothing but that shouldn't be noticeable.

vmesquita:
Quote:

This is what I use to do Convolution3D on interlaced material:

a=AVISource("1.avi")
a=a.Converttoyuy2()

a.SeparateFields()
even=SelectEven(a).Convolution3d(0, 10, 17, 10, 13, 2.8, 0)
odd=SelectOdd(a).Convolution3d(0, 10, 17, 10, 13, 2.8, 0)
a=Interleave(even,odd).weave()
return(a)
This doesn't work with Dust, for example, since you can't have two instances of Dust in the same script.


All times are GMT -5. The time now is 04:01 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.