Log in

View Full Version : Merging YV12 interlaced to YV12 progressive?


unplugged
16th March 2003, 22:37
Is there any procedure or filter combo to produce a merge (not deinterlacing) of YV12 interlaced data to YV12 progressive?

It should be helpful for anyone want flask to XviD, since lot of PAL movies have interlaced MPEG-2 frames despite the content itself is progressive and not combed.
(apart chroma line assignment 1-3 2-4 5-7 6-8 ... )

# example of not perfect output, chroma remains interlaced
# with wrong displacement order for VirtualDub or AVI application
...
LoadPlugin("C:\App\Media\Avisynth\MPEGDecoderYV12.DLL")
mpegsource("E:\movie\movie.d2v")
...

# example of trick to fix chroma displacement
# although not very funny (a bit of blur)
...
LoadPlugin("C:\App\Media\Avisynth\MPEGDecoderYV12.DLL")
mpegsource("E:\movie\movie.d2v")
ConvertToYUY2(interlaced=true)
ConvertToYV12()
...

Guessing there should be one more elegant solution ;), word goes to Avisynth masters (or who have just a nice idea).

thanks,
unplugged

DJ Bobo
17th March 2003, 01:47
What about

AssumeFrameBased()

?

unplugged
17th March 2003, 10:13
No, I think it makes only an assumption, activate a flag and sure will be visible only within the script.
Instead, I need to physically change chroma ordering (resampling), some processing routine like ConvertInterlacedYV12toYV12()

source Chroma: 1-3 2-4 5-7 6-8 ...
resampled to : 1-2 3-4 5-6 7-8 ...

sh0dan
17th March 2003, 13:20
Oh - that's what you're requesting.

For now ConvertToYUY2(Interlaced=true).ConvertToYV12(interlaced=false) should do the trick.

unplugged
17th March 2003, 14:00
:D

Wilbert
17th March 2003, 14:23
lol

How do you recognize that problem in PAL movies? Can you make some pics? What happens with the old mpeg2dec (which outputs to YUY2), is that also treaten incorrectly?

unplugged
17th March 2003, 16:10
Originally posted by Wilbert
How do you recognize that problem in PAL movies?
It's hard to see in normal frames, and unless you find that sporadic combed frames in one of this movies you hardly notice the chroma wrongly combed (caused by simple avisynth script).
Ok, it's not easy to see, but the displacement error is there, and guess we are perfectionist.

Although, don't really think that placing ConvertToYUY2(interlaced=true) give you more detail, the advantage is the right assumption that chroma displacement is different, so at least, we can reduce too much blur/shifting errors.

Really, you will obtain only these two things:
less error and a more precise balanced area blur (this time not shifted anymore, but we must accept lot of blur anyway; the fact is that YV12-interlaced-layout is REALLY devastating for progressive content :( )

For example, italian Matrix DVD is mastered as interlaced, despite the content itself is "perfect" and have NOT 1 combed frame.

But if you pass that YV12 source to the YV12 encoder that assume progressive layout...

Originally posted by Wilbert
Can you make some pics? What happens with the old mpeg2dec (which outputs to YUY2), is that also treaten incorrectly?
Can't give a try to MPEG2DEC.DLL or MPEG2DEC2.DLL, they don't load anymore on my machine insisting with that unresolved "Unexpected exception" (or something like...)
I have tried Nic's latest MPEGDecoder.DLL for YUY2 (AVS 2.08) and it fails for the chroma displacement, it makes progressive job anyway when performing YV12->YUY2.