PDA

View Full Version : How to process interlaced and the final result to be interlaced


dplaton
7th December 2004, 13:11
I'm not a native English speaker and I feel that I don't understand correctly, so please help me.
Let's say
SeparateFiels()
Degrain()
Wave()

or

SeparateFields()
odd=SelectOdd.Degrain()
evn=SelectEven.Degrain()
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()


My AviSource is RAW YUV captured from a S-VHS JVC camcorder that
process internaly Digital and record on a S-VHS cassete.

My processor is a Duron 950 MHz

Can I use Convolution3D?

My Duron is not SSE.

Wilbert
7th December 2004, 17:57
DeGrainMedian - Spatio-Temporal Limited Median filter for grain removal
thus second script (also when you use Convolution3d) ...

dplaton
8th December 2004, 09:14
I don't understand the sequence

Weave() [I read that is equivalent to DoubleWeave().SelectEven]
DoubleWeve().SelectOdd()

I found an other script on http://www.afterdawn.com/avisynth_tutorial_page_6.cfm.html

#Functions For Processing Interlaced Video
#By stickboy (James D. Lin)#
# SetParity
function SetParity(clip c, bool parity)
{
return parity ? c.AssumeTFF() : c.AssumeBFF()
}
# UnfoldFieldsVertical
function UnfoldFieldsVertical(clip c, bool "flip")
{
flip = default(flip, false)
oldParity = c.GetParity()
c = c.AssumeTFF().SeparateFields().AssumeFrameBased()
top = c.SelectEven()
bottom = c.SelectOdd()
c = StackVertical(top, flip ? bottom.FlipVertical()
\ : bottom)
return c.SetParity(oldParity)
}
# FoldFieldsVertical
function FoldFieldsVertical(clip c, bool "flip")
{
assert(c.Height() % 2 == 0, "FoldFieldsVertical: unexpected frame height")
flip = default(flip, false)
oldParity = c.GetParity()
originalHeight = c.Height() / 2
evens = c.Crop(0, 0, c.Width(), originalHeight)
odds = c.Crop(0, originalHeight, c.Width(), originalHeight)
odds = flip ? odds.FlipVertical() : odds
c = Interleave(evens, odds).AssumeFieldBased().AssumeTFF().Weave()
return c.SetParity(oldParity)
}
#Stop Copying Here

Boulder
8th December 2004, 09:49
Try this (you'll need TomsMoComp) :


AssumeTFF() or AssumeBFF() depending on your input clip's field order
TMCBob()
Degrain()
AssumeTFF() or AssumeBFF() depending on your input clip's field order
SeparateFields()
SelectEvery(4,0,3)
Weave()

function TMCbob(clip c)
{ ord = getparity(c) ? 1 : 0
c = c.SeparateFields.TomsMoComp(1,-1,0)
c = stackvertical(c.crop(0,0,0,1-c.height),c,c.crop(0,c.height-1,0,0))
evn = c.SelectEven
odd = c.SelectOdd
evn = (ord == 0) ? evn : evn.crop(0,1,0,0).addborders(0,0,0,1)
odd = (ord == 1) ? odd : odd.crop(0,1,0,0).addborders(0,0,0,1)
interleave(evn,odd).crop(0,0,0,-2).assumeframebased()
}


If you don't know how to determine the field order, use a simple script like this:


AVISource("path\clip.avi")
AssumeTFF()
SeparateFields()


Open it in VDub and seek to a scene with motion. If the motion is smooth, your clip is top field first. If it jerks back and forth, it's bottom field first. You can verify this by using AssumeBFF() and doing the same test.

dplaton
8th December 2004, 10:17
You lost me!
Let's take easy please.

1. AssumeTTF() - the correct order

2. TMCBob() - deinterlace and re-interlace correct???

3. Degrain() - grain removal

4. AssumeTTF() - once again the correct order

5. SeparateFields() - once again separate the fields

6. SelectEvery(4,0,3) - select frames I don't know

7. Wave() - that means to SelectEven()

As far as I can understand it seems to me that I apply Degrain() to an
interlaced clip. I understand correct???

Boulder
8th December 2004, 10:37
Originally posted by dplaton
1. AssumeTTF() - the correct order

To ensure that TMCBob() has the field order correct. It's AssumeTFF() btw.

2. TMCBob() - deinterlace and re-interlace correct???

Bob-deinterlace to make the clip progressive for filtering.

3. Degrain() - grain removal

Could be any filter, resizing, whatever. All processing should happen between TMCBob() and AssumeTFF()

4. AssumeTTF() - once again the correct order

To make sure the field order we get from the next three lines is correct.

5. SeparateFields() - once again separate the fields
6. SelectEvery(4,0,3) - select frames I don't know
7. Wave() - that means to SelectEven()

It's Weave ;) Those three lines will reinterlace the clip. SelectEvery(4,0,3) keeps the field order, SelectEvery(4,1,2) would change it. So if there's AssumeTFF(), the output field order would be TFF.


As far as I can understand it seems to me that I apply Degrain() to an
interlaced clip. I understand correct??? [/B]

Yes.

dplaton
8th December 2004, 10:53
Thank you for your time.

What does Interleave(), I didn't understand.
Please say it in simple English.
I represented Interleave() as combining 2 fiels in one frame,
but that is not true.

Why I try to understand how to process interlaced clips?
I made some hours of deinterlaced home captures and it was
painfully slow 1fps (even the grass was clear).

Now I think that deinterlacing is not at all needed for my home
videos.
If the target is MPEG2 on a TV set or on a PC via DVDplayer interlaced is just fine.
If the target is MPEG4 just SeparateFields and everything is OK, even on my 950 MHz Duron.

The Doom9 guide tells how to deinterlace, once again for me I think I don't need, but says allmost nothing on how to treat interlaced video.

Once again thank you.

Boulder
8th December 2004, 11:05
Originally posted by dplaton
[B]Thank you for your time.

What does Interleave(), I didn't understand.
Please say it in simple English.
I represented Interleave() as combining 2 fiels in one frame,
but that is not true.

Interleave(a,b,c,...) (the Avisynth function) places frames of the clips a,b,c,.. so that they appear in the output video like this: a1,b1,c1,a2,b2,c2,a3,b3,c3 and so on. a1 means the first frame of clip a, b1 the first frame of clip b etc.

Why I try to understand how to process interlaced clips?
I made some hours of deinterlaced home captures and it was
painfully slow 1fps (even the grass was clear).

Unfortunately I have to reveal that processing material as interlaced is even slower.

If the target is MPEG2 on a TV set or on a PC via DVDplayer interlaced is just fine.

True.

If the target is MPEG4 just SeparateFields and everything is OK, even on my 950 MHz Duron.

I would rather use KernelDeint() or TDeint() for deinterlacing.

dplaton
8th December 2004, 11:20
My first attempts to process interlaced was quite simple

AsumeTTF() - frame order established via VirtualDub
SeparateFields()
Degrain()
resize
Wave() - without Interleave() the references for Interleave
were not clear to me.

The quality and speed were just fine.
I used Degrain() because I filmed on poor light conditions,
and Degrain() did a good job for me.

Boulder
8th December 2004, 11:44
If you use SeparateFields and then use a temporal filter (or a spatio-temporal filter), you can mess things up easily as you are filtering the two scanlines from the same frame against each other. And that's a big no-no.

If you don't want to do a bob-then-reinterlace, I suggest you check stickboy's functions.

http://www.avisynth.org/stickboy/

What you are looking for are JDL_UnfoldFieldsVertical and JDL_FoldFieldsVertical.

dplaton
8th December 2004, 11:50
Degrain() is just a spatial filter and this is why I used.
I think if I want to use a spatial filter I had to make 2 clips
from the original one, apply the temporal filter to each and after that
I have to recombine the 2 clips in just 1.
But is too complex for my knowledge.

Boulder
10th December 2004, 18:08
You can use stickboy's JDL_UnFoldFields function to get the fields separate but displayed on the same frame. Then use JDL_FoldFields to get them back as they were.

JDL_UnFoldFieldsVertical(flip=true)
DeGrainMedian()
JDL_FoldFieldsVertical(flip=true)


Download this : http://www.avisynth.org/stickboy/jdl-interlace.avsi and save it to your Avisynth 2.5 plugins folder. By default it is C:\Program Files\Avisynth 2.5\plugins . That way it will be auto-loaded when needed. Then try that script, if you don't know what it does, comment out (by placing a # in front of the line you comment out) line by line and you'll see what happens. No need for separating fields, weaving etc.

dplaton
13th December 2004, 10:49
Thanks,

I allready see James D. Lin (stickboy) AVIS, but I didn't tested yet.
I found also a thread about spliting the RAW avi into 2 field avi to apply Dust(), and recombining the 2 avi into a interlaced file.

cweb
15th December 2004, 23:14
Originally posted by Boulder
If you use SeparateFields and then use a temporal filter (or a spatio-temporal filter), you can mess things up easily as you are filtering the two scanlines from the same frame against each other. And that's a big no-no

Actually other posts in this forum (which I searched for) have said you can apply the same temporal filter to the two separated fields (selectodd and selecteven). I tried with pal DV and the result looks good. Does anyone have any other ideas pro/con temporal filtering in this kind of situation.

scharfis_brain
16th December 2004, 00:12
the best solution for filtering interlaced video is this:


avisource("video.avi")
assume?ff() #set the correct fieldorder!
bob() # or use any other bobbing deinterlacer you like

#maybe with converttoyv12(interlaced=false), if needed
yourfilterchainhere()

converttoyuy2(interlaced=false)
assume?ff() #set the fieldorder again (the same as above!)
separatefields().selectevery(4,0,3).weave()

stickboy
16th December 2004, 04:09
Originally posted by cweb
Actually other posts in this forum (which I searched for) have said you can apply the same temporal filter to the two separated fields (selectodd and selecteven). For purely temporal filters, you don't need to use SeparateFields at all, so SelectOdd and SelectEven aren't necessary.

scharfis_brain
16th December 2004, 06:13
separatefields().temporalfilter().weave()

results in vertical misalignement!

wich further leads to bobbing denoised static backgrounds on TV!

because of this I recommend my method.

dplaton
16th December 2004, 08:47
the best solution for filtering interlaced video is this:


avisource("video.avi")
assume?ff() #set the correct fieldorder!
bob() # or use any other bobbing deinterlacer you like

#maybe with converttoyv12(interlaced=false), if needed
yourfilterchainhere()

converttoyuy2(interlaced=false)
assume?ff() #set the fieldorder again (the same as above!)
separatefields().selectevery(4,0,3).weave()


Pease explain this script, as far as I understand>

1. bob()
Frame based interlaced material -> field material
frame 0 that consist in 2 fields -> frame 0 and 1 from each field

2. separatefields() ???

3. selectevery(4,0,3)

frames selected 0,3,4,7,8,11,12,15

Is that a correct understanding?

4. Wave()

Frames 0 and 3, 4 and 7, 8 and 11, 12 and 15 are combinated in
frame 0 1 2 3

I clearly don't understand

stickboy
16th December 2004, 11:44
Originally posted by scharfis_brain
separatefields().temporalfilter().weave()

results in vertical misalignement!

wich further leads to bobbing denoised static backgrounds on TV!Yes, exactly; that's why I said not to use SeparateFields...
Originally posted by dplaton
Pease explain this script, as far as I understandscharfis_brain's script bob-deinterlaces the clip, applies the filters, and finally interlaces it back.

So let's say your frames look like this:A C E G I (field 0)
b d f h j (field 1)(Each column represents a frame; time progresses going from left to right.) After the bob-deinterlace step, the frame count is doubled:

A B' C D' E F' G H' I J' (field 0)
a' b c' d e' f g' h i' j (field 1)
[Edit: Bob interpolates the missing scanlines to make progressive frames. a' represents scanlines that Bob interpolated from A.]

and you then filter.

After the SeparateFields step, it looks like (assuming TFF):A a' B' b C c' D' d E e' F' f G g' H' h I i' J' jand SelectEvery(4, 0, 3) selects the first and last frame of each group of four:A b C d E f G h I jand then Weave reconstructs frames from the separated fields:A C E G I (field 0)
b d f h j (field 1)which is what you started with, but which is now filtered.

[Edit: Tweaked the way I named the fields for clarity (hopefully).]

dplaton
16th December 2004, 12:44
I belived that bob() transform a field based clip in a frame based clip that have as frame a single enlarged field.

Now I understand that bob() transform a field based clip with 2 different fields per frame in a field based clip with 2 identical
fields in a frame.

It is that right?

Wilbert
16th December 2004, 13:04
Now I understand that bob() transform a field based clip with 2 different fields per frame in a field based clip with 2 identical fields in a frame.

It is that right?
field and frame based clip have a special meaning in AviSynth. bob takes a frame based clip, spits out the corresponding fields and enlarges those fields to match the size of the original clip. Thus the resulting clip has twice the number of frames as the original clip. More info http://www.avisynth.org/Bob.

bsr
16th December 2004, 17:14
[i]So let's say your frames look like this:A C E G I (field 0)
b d f h j (field 1)(Each column represents a frame; time progresses going from left to right.) After the bob-deinterlace step, the frame count is doubled:
A B C D E F G H I J (field 0)
a b c d e f g h i j (field 1)and you then filter.
[/B]

I finally understand what scharfis_brain's filter is doing. Thanks for the detailed explanation.

But I have a question:
Lets look at the pixels at location d.
Ideally I would think you would want to temperal filter it against b and f.
But after bob() it will be filtered against c and e which are both originally from field 0.(not the same position of the picture)

Does this sound correct?
I see this would be good for spatial filtering, but wasn't sure about temperal filtering.

Maybe this prevents overfiltering, and prevents motion blur because the fields being filtered are closer to each other in time.
It looks like this would also take 2x longer to encode. Not that I have an issue with it, I am more than willing to wait for something that is going to give better quality.
Have used jdl_unfoldfields and seperatefields selectodd etc and they both seem to make a lot of sense to me.
Just trying to understand the advantages of each.

Thanks,
Great thread by the way.

Wilbert
16th December 2004, 17:50
But after bob() it will be filtered against c and e which are both originally from field 0.
Yup.

(not the same position of the picture)
Nope. Bob corrects the position. I advice you to read the link I gave. I quote

When applying bob: The top fields are nudged up a little bit compared with the bottom fields, so the picture will not actually appear to bob up and down.

bsr
16th December 2004, 19:29
Actually,.. I did read it and didn't quite get it. :(

Just read it again, but very slowly. :D
I finally got it when this part sunk in "by interpolating between the lines."

Now it makes sense to me, I think.:rolleyes: :D

The opposing field of each orginal frame after the seperation, either even or odd, is actually an interpretation of what the bob filter thinks should be there to reconstruct a full frame.

It's like using "seperatefields" and keeping full resolution by interpretating the missing fields.

The new frames are completed from the interpolation which is the bob() filter educatedly guessing where the pixels should be between the 2 fields).

Maybe I can't explain it well, but I think I get it now.
So now I can see how this can be very good for being used to setup interlaced for filtering.

Would you also have to increase some of your temperal filter strength because of the now doubled fps as opposed to 29.97(NTSC)?
I would assume yes.
:thanks:

EDIT -
For anyone else reading and not quite sure.
c & e I mentioned above are not the same as C & E. They are interpretations of what bob calculates should be there to complete the full frame. This is what screwed me up.

stickboy
16th December 2004, 20:15
Originally posted by dplaton:
Now I understand that bob() transform a field based clip with 2 different fields per frame in a field based clip with 2 identical
fields in a frame.No. Sorry, I didn't mean to imply that the fields are duplicated. The field "a" is generated from "A", but it is not a copy.Originally posted by bsr
Would you also have to increase some of your temperal filter strength because of the now doubled fps as opposed to 29.97(NTSC)?
I would assume yes.Yes.
For anyone else reading and not quite sure.
c & e I mentioned above are not the same as C & E. They are interpretations of what bob calculates should be there to complete the full frame. This is what screwed me up.Oops, right. I should have made that clearer in my post (I've retroactively edited it a bit now).

dplaton
17th December 2004, 09:04
My simply ideea was to don't unnecessarily process a clip.

But now I'm bob() deinterlacing (constructing, resizing, multipling the fields)
select from duplicate constructed and enlarged fields,
and deconstruct the enlarged fields and combining them in an interlaced
clip.

I think that is quite unnecessarly processing.

I was looking for a simple way, something like VirtualDub view and unview fields, and inserting between the filterchain.
I don't know if this ideea is a good one.

In poor light condition the camera records poor, obviously.
I found that degrainmedian do the proper job for me, but
the question was a general one.

Nice to answer me.

Boulder
17th December 2004, 09:28
Originally posted by dplaton

I was looking for a simple way, something like VirtualDub view and unview fields, and inserting between the filterchain.
I don't know if this ideea is a good one.


That's the UnFold/FoldFields function.

I don't know how good an idea it is, it does create some blurring but I guess that can be compensated by reducing the filtering strength. However, with analogue material it might even be the better choice because of that.

dplaton
17th December 2004, 09:35
Sorry, I was not shure if view and unview are available under Avisynth.
I just cheked after posting, and I found that I have allready downloaded them.

scharfis_brain
17th December 2004, 12:38
hey! Stickyboy's explantation is far the best one I've seen so far.
I would like to see his post as Sticky and/or within the AVIsynth-help (html/wiki), cause for filtering interlaced contents we are getting asked very often.

btw. using Tdeint(mode=1) instead of plain bob() will immensively increase the quality, especially, when doing resizings.

cweb
17th December 2004, 19:39
Originally posted by stickboy
For purely temporal filters, you don't need to use SeparateFields at all, so SelectOdd and SelectEven aren't necessary.

I think I was referring also to the DV forum, see the FAQ there too...
But DV may be a different case due to the field order...

cweb
17th December 2004, 23:51
My experience with temporal filtering of an interlaced clip was
recently with PAL DV (keeping the result interlaced, for encoding on DVD as a kdvd). Here's what I meant, taken from Doom9's guide...

"If you want to process interlaced video (thus leaving it interlaced), you should remember the following issue. When using only a spatial smoother, it is sufficient to use:

SeparateFields()
Filter(...)
Weave()

But when using a spatio-temporal smoother (or just a temporal smoother), this produces incorrect results. The reason is that the temporal smoothing occurs over two fields from the same frame (this happens for half the number of frames). To avoid this, you should put them in different clips:

SeparateFields()
even = SelectEven(last).Filter(...)
odd = SelectOdd(last).Filter(...)
Interleave(even, odd)
Weave()
"

So temporal filtering on an interlaced clip is ok if you put the fields in different clips i.e. using selecteven and selectodd.

Also the "standard script" suggested by the DV to DVD faq in the DV forum is:
"AviSource("C:\MyDVFiles\DV_type2_file.avi")
SeparateFields()
odd=SelectOdd.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
evn=SelectEven.Convolution3D(1, 6, 10, 6, 8, 2.8, 0)
Interleave(evn,odd)
Weave()
DoubleWeave.SelectOdd()
"

The doubleweave is there to change the clip from BFF (remember this is a DV source) to TFF (though this can be removed if one has the facility to encode BFF in the encoder being used).

stickboy
18th December 2004, 03:43
Originally posted by cweb
So temporal filtering on an interlaced clip is ok if you put the fields in different clips i.e. using selecteven and selectodd.No, temporal filtering is always okay on a non-field-separated clip. You'd only need to use SeparateFields + SelectEven + SelectOdd if you do spatial filtering too.

Spatial filter only:
SeparateFields, then filter, then Weave.

Temporal filter only:
Just filter.

Spatial-temporal filter:
One of the following:
A. SeparateFields, SelectEven/SelectOdd, filter, Weave
B. JDL_UnfoldFieldsVertical, filter, JDL_FoldFieldsVertical
C. scharfis_brain's Bob, filter, SeparateFields, SelectEvery, Weave method

scharfis_brain
18th December 2004, 04:13
@Stickyboy: I am solely filtering with the bob() -> reinterlace() method.
Even if it comes to temporal only filtering.

this helps denoising a LOT, cause
- one has twice the frames to smooth the motion on
- has ghosting as half as long as with the odd/even (viewfields) method.
- the temporal radius is halved by two, while leaving the denoising factor the same.

the only kind of source, I do the selectodd / selecteven denoising if fieldblended stuff. (bad FILM-NTSC-PAL conversions)

but ONLY in this case...

stickboy
18th December 2004, 05:18
Come on, now, I spelled your username right... :p

scharfis_brain
18th December 2004, 08:44
really? did you? :D

whoops! :cool:

cweb
19th December 2004, 15:36
scharfis_brain, which method (to keep interlacing) would you choose for the best quality, given a PAL interlaced DV source (to create a DVD) ?

I'm using the "SeparateFields, SelectEven/SelectOdd, filter, Weave" method and I change the field order afterwards...

dplaton
20th December 2004, 08:59
Again, my intention was a simple one: no unnecessary processing.

So my first script was a simple one:

SeparateFields()
filterchain
Wave()

The results were satisfactory.

The remarque was that SeparateFields give missaligniament, and
2 alternative methods were listed (stikboy & scharfis_brain).

The scharfis_brain method contains a lot of unnecessarily processing,
but it is suposed to be the better.

I did 4 tests:

1) dummy test the filterchain applied to the interlaced material
2) View-UnView test the filterchain between View and UnView filds
3) Stikboy test the filterchain between Fold and UnFold
4) scharfis_brain test (see above)

Results:
1) nothing (obviously)
2) nothing
3) nothing
4) filterchain works

Back to my simply ideea. Why enlarge?, why Select ?, and so on.

If SeparateFields gives missaligniament (I think it can be fixed by adding a row) and Bob() does the job right, let's use Bob()

So I made an other test (in fact 2)

use bob() just to separate fields

bob(height= 1/2 full size)
filterchain
AsumeFieldBased()
Wave()

The result was better (less blur) than scharfis_brain method.

I tested my script against scharfis_brain without filterchain.
IMO the result is clearly better as picture.

Because I eliminated a lot of unnecessary processing the speed inproved by 50%.

Thank you all again

stickboy
20th December 2004, 09:51
Originally posted by dplaton
The remarque was that SeparateFields give missaligniament, and
2 alternative methods were listed (stikboy & scharfis_brain).(How many more ways can people misspell my username in this thread? Sigh.)I did 4 tests:

1) dummy test the filterchain applied to the interlaced material
2) View-UnView test the filterchain between View and UnView filds
3) Stikboy test the filterchain between Fold and UnFold
4) scharfis_brain test (see above)

Results:
1) nothing (obviously)
2) nothing
3) nothing
4) filterchain worksWhat does "nothing" mean? Does that mean methods 1-3 didn't work? Avisynth rejected the scripts? The filters had no visible effect? I don't understand.

BTW, my JDL_UnfoldFieldsVertical/JDL_FoldFieldsVertical are conceptually the same as ViewFields/UnviewFields. Are they both unsatisfactory to you? If so, why?If SeparateFields gives missaligniament (I think it can be fixed by adding a row)Not at all.

Suppose you have frames:A B C D E (top field)
a b c d e (bottom field)When you call SeparateFields, your sequence looks like (assuming TFF):A a B b C c D d E eIf you apply a temporal filter, you will smooth top fields into bottom fields. Adding rows to shift fields up or down won't change this fact.
and Bob() does the job right, let's use Bob()Isn't that what scharfis_brain is saying?
So I made an other test (in fact 2)

use bob() just to separate fields

bob(height= 1/2 full size)
filterchain
AsumeFieldBased()
Wave()Sounds to me like you're throwing away half of the data.

dplaton
20th December 2004, 10:27
Stickboy thank you for your posting, and please accept my apologise for wrong writting your name.

I know that Fold-UnFold is quite the same that View-UnView.
I know that the dummy test is in a way meaningless.
I just wanted to test.
Nothing means that the result is like no filterchain was applied.
The View-UnView script was faster than Fold-UnFold script.

My simply ideea was why to enlarge by 2 the bob () constructed field,
when I can prevent this useless processing in the next steps.
So I presumed that height=1/2 full size will do no resize at all.
The speed gain makes me belive that was happent.

If I have no fields as appling bob 1/2 full size there is no need
to SeparateFields().

If I have no extra frames is no need to decimate (SelectEvery)

So (maybe wrong) I considered the resulted clip as a field based one,
so let's tell to AviSynth what I belive

AsumeField Based()

Now put the fields in frames

Wave()

That is the story untill now.

All the best,
Dan

stickboy
20th December 2004, 10:46
Originally posted by dplaton
I know that Fold-UnFold is quite the same that View-UnView.
I know that the dummy test is in a way meaningless.
I just wanted to test.
Nothing means that the result is like no filterchain was applied.
The View-UnView script was faster than Fold-UnFold script.If Unfold, filter, Fold shows no improvement, then either your script is wrong or your testing methodology is.

It's certainly suspicious that your case 1 shows no effect (and no, this should not be "obviously" the case), because that means your filter chain does nothing.

dplaton
20th December 2004, 11:43
My Internet conexion works poor.

FilterChain is just simply DeGrainMedian and that explains the results.

My test scripts were just basic

AviSource
fold or view or bob
DeGrainMedian (strenght = constant for all test)
Unfold or UnView or separate.select.wave

Maybe my scripts are wrong.
Somehow scharfis_brain script, and mine worked in the wanted way.

--------

What I intended to say regarding SeparateFields missaligniament.

I'm representing the <<fields>> as a full frame picture with
a row of image information, a <<blank>> row, and so on
the second field is another full frame picture but with the first
row <<blank>>, 2-nd row with image information, and so on.

This 2 pictures <<fields>> can coexist in the same frame because
of this row lag.

I supose that SeparateFields align top the 2-nd field and that
generates the wave missaligniament.

I presumed that bob() prevent somehow that.


Again, maybe I'm wrong, but I havent find a clear explain on this subject.

cweb
28th December 2004, 17:37
Any ideas/opinions/etc on using subtitle() within an interlaced script and keeping the interlace..

Seems to me like it's ok to use this (don't need to put it in the separatefields...weave section i.e) on an interlaced clip. I haven't tested the results on my tv yet..

stickboy
28th December 2004, 19:22
Originally posted by cweb
Any ideas/opinions/etc on using subtitle() within an interlaced script and keeping the interlace..

Seems to me like it's ok to use this (don't need to put it in the separatefields...weave section i.e) on an interlaced clip. I haven't tested the results on my tv yet..It should be fine. It's just a static area.

cweb
28th December 2004, 20:36
In fact it looks fine on my PC so far. Thanks.

stickboy
29th December 2004, 07:34
Originally posted by dplaton
FilterChain is just simply DeGrainMedian and that explains the results.Not at all. Again, how do you explain why case 1 showed no effect? It doesn't make any sense.

The point to all of this special interlaced processing is not to make the filters work, it's to prevent the filters from creating artifacts.

If your control case looks exactly the same as your original clip, then your experiment is flawed.My test scripts were just basic

AviSource
fold or view or bob
DeGrainMedian (strenght = constant for all test)
Unfold or UnView or separate.select.wave

Maybe my scripts are wrong.
Somehow scharfis_brain script, and mine worked in the wanted way.The fact that you used the same filter strength in all cases makes even less sense; scharfis_brain's method effectively should reduce the filter strength since temporal blurs would be spread out across more frames.

What bob deinterlacer are you using?

Are you sure whatever smoothing you see isn't simply caused by blurring from your bob filter?

Incidentally, DegrainMedian has an interlaced parameter, so you really should be using that instead.
What I intended to say regarding SeparateFields missaligniament.

I'm representing the <<fields>> as a full frame picture with
a row of image information, a <<blank>> row, and so on
the second field is another full frame picture but with the first
row <<blank>>, 2-nd row with image information, and so on.

This 2 pictures <<fields>> can coexist in the same frame because
of this row lag.

I supose that SeparateFields align top the 2-nd field and that
generates the wave missaligniament.

I presumed that bob() prevent somehow that.I still don't understand.frame 0:

A A A A A A A (scanline 0)
x x x x x x x (scanline 1)
A A A A A A A (scanline 2)
x x x x x x x .
A A A A A A A .
x x x x x x x .


frame 1:

x x x x x x x (scanline 0)
B B B B B B B (scanline 1)
x x x x x x x (scanline 2)
B B B B B B B .
x x x x x x x .
B B B B B B B .('x's represent "blank" rows.) If you apply either a spatial or a temporal smoother to this, you'd blend real rows into blank rows, which is wrong.

If this isn't what you mean, please draw a picture.Again, maybe I'm wrong, but I havent find a clear explain on this subject.If you tell me exactly what you want explained, I'll try to explain it for you.

dplaton
29th December 2004, 11:20
I was caught in separatefields and I didn't notice that the filter has an interlace option.

My simply representation about <<fields>> is

frame 0

field1Row1 field1Row1 field1Row1 .....
field2Row1 field2Row1 field2Row1 .....
field1Row2 field1Row2 field1Row2 .....
field2Row2 field2Row2 field2Row2 .....

I presume that SeparateFields transform frame0 in frame0 and frame1

frame0

field1Row1 field1Row1 field1Row1 .....
field1Row2 field1Row2 field1Row2 .....

frame1

field2Row1 field2Row1 field2Row1 .....
field2Row2 field2Row2 field2Row2 .....

This is the way I explain the half picture size.
Regarding the Wave missaligniament I don't figure why this can happent, because if the frame0 and frame1 are put together without
placing the field2 one row down it will result a completly mess, and that wasn't happent on my very first try.

Thanks and Merry Christmas everybody

stickboy
29th December 2004, 11:44
The "field misalignment" problem is about applying temporal filters to field-separated video. It has nothing to do with Weave.

So using your example, if you call SeparateFields, you are correct, it would produce:Frame 0:
field1row1 (drawn to scanline 0)
field1row2 (drawn to scanline 2)
field1row3 (drawn to scanline 4)
...

Frame 1:
field2row1 (drawn to scanline 1)
field2row2 (drawn to scanline 3)
field2row3 (drawn to scanline 5)
...But simply applying a temporal filter to this would blend field1row1 with field2row1, which is problematic because they represent different scanlines. That is the misalignment problem. (Field 1 and field 2 represent both different points in time and in space.)

Video Dude
14th January 2005, 03:42
Originally posted by stickboy
Spatial filter only:
SeparateFields, then filter, then Weave.

Temporal filter only:
Just filter.

Spatial-temporal filter:
One of the following:
A. SeparateFields, SelectEven/SelectOdd, filter, Weave
B. JDL_UnfoldFieldsVertical, filter, JDL_FoldFieldsVertical
C. scharfis_brain's Bob, filter, SeparateFields, SelectEvery, Weave method
:goodpost:

North2Polaris
15th January 2005, 15:10
@stickboy,

I downloaded http://www.avisynth.org/stickboy/jdl-interlace.avsi

But when I try using:

JDL_UnFoldFieldsVertical(flip=true)
PixieDust(5)
JDL_FoldFieldsVertical(flip=true)

I get the following error message: Script error; there is no function named "SetParity" (line 110).

Is there a problem with the script or am I using it incorrectly?

Thanks.

North

Boulder
15th January 2005, 15:24
What's your Avisynth version?

North2Polaris
15th January 2005, 16:37
Originally posted by Boulder
What's your Avisynth version?

Avisynth 2.55; Build Sep 1, 2004 [16:49;49]

Boulder
15th January 2005, 17:43
First I recalled that SetParity is an Avisynth internal function, but it isn't. Download and copy jdl-util.avsi to the plugins folder. It contains the needed function.

North2Polaris
16th January 2005, 00:17
Thanks. It does help to go to the site:

http://www.avisynth.org/stickboy/

jdl-util.avsi

"General-purpose, utility functions. My other scripts are dependent on this file."