Log in

View Full Version : Doubling of scanlines


Cary Knoop
8th August 2020, 03:21
I don't seem to be able to get this, I am trying to double the scanlines using eedi3, but there seems to be something wrong:


even = core.std.SelectEvery(c, 2,[0])
even = core.eedi3.eedi3(even, field=0,dh=True)
odd = core.std.SelectEvery(c, 2,[1])
odd = core.eedi3.eedi3(odd, field=1,dh=True)

c = core.std.Interleave([even, odd])


Does anyone see what is wrong with it?

poisondeathray
8th August 2020, 03:41
Did you separate the fields first?

c = core.std.SeparateFields(c, tff=1) #TFF
.
.
.

Cary Knoop
8th August 2020, 03:50
Yes, before the doubling attempt I run:

c = core.std.SeparateFields(c, tff=Source['TFF'])

and then afterwards I run:

c = core.std.DoubleWeave(c, tff=Source['TFF'])[::2]

*Souce['TFF'] is a dictionary entry defining if the clip is TFF or not.

poisondeathray
8th August 2020, 04:00
You don't need DoubleWeave, unless I'm misunderstanding what you're trying to do for "double the scanlines"

After Interleave, it will be 59.94p (ie. double rate deinterlaced) when starting with a 29.97i source (or 50p from 25i source)

Cary Knoop
8th August 2020, 04:06
You don't need DoubleWeave, unless I'm misunderstanding what you're trying to do for "double the scanlines"

After Interleave, it will be 59.94p (ie. double rate deinterlaced) when starting with a 29.97i source (or 50p from 25i source)
I am not trying to deinterlace, I only want to double the scanlines, so that the video becomes double height and interlaced with double scanlines.

poisondeathray
8th August 2020, 04:13
I am not trying to deinterlace, I only want to double the scanlines, so that the video becomes double height and interlaced with double scanlines.

Then add DoubleWeave

What is the problem ? What is "something seems to be wrong" ?

Cary Knoop
8th August 2020, 04:15
Then add DoubleWeave

What is the problem ? What is "something seems to be wrong" ?
There is a vertical offset.

I wonder if this one is correct, as there is no vertical offset unlike in the code above?


c = core.std.SeparateFields(c, tff=Source['TFF'])
c = core.fmtc.bitdepth(c, bits=8)
even = core.std.SelectEvery(c, 2,[0])
even = core.eedi3.eedi3(even, field=1,dh=True)
odd = core.std.SelectEvery(c, 2,[1])
odd = core.eedi3.eedi3(odd, field=0,dh=True)
c = core.std.Interleave([even, odd])
c = core.std.DoubleWeave(c, tff=Source['TFF'])[::2]

poisondeathray
8th August 2020, 04:19
There is a vertical offset.


The vertical offset is normal and expected when using nnedi3/eedi3 by themselves . Each even/odd field is offset to begin with.

"Smart" bobbers (scanline interpolaters if you want) correct for the field offset . e.g. qtgmc, yadifmod+nnedi3 .

_Al_
8th August 2020, 04:28
I only want to double the scanlines, so that the video becomes double height and interlaced with double scanlines.
interleave = core.std.Interleave(clips =[c, c] )
clip = core.std.DoubleWeave(interleave, tff = False)[::2]

Cary Knoop
8th August 2020, 04:46
interleave = core.std.Interleave(clips =[c, c] )
clip = core.std.DoubleWeave(interleave, tff = False)[::2]
That looks like a better starting point for further processing.

I need to go back to the drawing board with this.

poisondeathray
8th August 2020, 04:59
I wonder if this one is correct, as there is no vertical offset unlike in the code above?


c = core.std.SeparateFields(c, tff=Source['TFF'])
c = core.fmtc.bitdepth(c, bits=8)
even = core.std.SelectEvery(c, 2,[0])
even = core.eedi3.eedi3(even, field=1,dh=True)
odd = core.std.SelectEvery(c, 2,[1])
odd = core.eedi3.eedi3(odd, field=0,dh=True)
c = core.std.Interleave([even, odd])
c = core.std.DoubleWeave(c, tff=Source['TFF'])[::2]




RE: field offset -

I guess it depends on why/how you are doing this. Do you want "correct" interlace ?

A correct interlaced file should have a field offset. Even/odd scanlines.

If you take an real interlaced file, and separate the fields, step through you should see up/down motion from the field offset

If you switch the eedi3 fields, there is no offset when you examine it by applying SeparateFields on the DoubleWeave[:2] output

_Al_
8th August 2020, 05:08
... starting point for further processing.I don't think it even matters if original c clip is tff or bff or how it is flagged in doubleweave, using those lines