Log in

View Full Version : Chroma bug


~SimpleX~
27th January 2012, 03:19
Hello everyone!

Could you please help me fix this? I've never dealt with the chroma bugs like this, so I don't know how it's called.

Source (http://www.mediafire.com/?xiyq51p9clf2u16)

It seems top fields contain luma from current frame and chroma from next frame and bottom fields contain luma from next and chroma from current.

http://i.imgur.com/ptrsv.png


Thanks!

librarian
27th January 2012, 12:43
I'm not qualified to help you, but before a true expert posts here you can search for chroma lag or chroma swap. See also this (http://forum.doom9.org/showthread.php?p=1467591#post1467591).

Mounir
27th January 2012, 16:17
It's called blends i believe when there is motion there are 2 good frames and 2 blended frames. I'm not sure how to solve that though, wait for answers.

librarian
27th January 2012, 18:15
I got the sample. It seems ordinary telecined video, no blends. As to chroma lag (or whatever described by OP) I cannot judge (not too good eyes and monitor).

Didée
27th January 2012, 20:46
What has happened is this:

- while the video already was in 3:2 hard pulldown stage, the chroma fields have been blended together (wrong handling of interlaced YV12)

- after that, chroma has been delayed by 1 frame.

~SimpleX~
27th January 2012, 21:31
Thanks for your reply, Didée! So is there any way to fix it?

Didée
27th January 2012, 22:06
# Loadplugin
# DGDecode.dll
# mt_masktools.dll
# Average.dll
# RemoveGrainSSE2.dll
# tivtc.dll
# Corrector.dll

# import
# FixBlendIVTC.avsi

mpeg2source(...)
o=last

a1 = o.TFM(chroma=false).greyscale()
a2 = a1.trim(1,0)

fixed = o.blur(0,1).FixBlendIVTC()

x0 = fixed.mt_lut("0")
x1 = mt_lutxy(a1,fixed,"x y - abs 2 *")
x2 = mt_lutxy(a2,fixed,"x y - abs 2 *")
x1 = mt_lutf(x1,x1,mode="average",expr="x")
x2 = mt_lutf(x2,x2,mode="average",expr="x")

fixed.greyscale()
corrector(x0,last,x1,x2,a1,a2,mode=1,th=255).mergechroma(fixed)
tdecimate()

return(last)
(corrected to not fix an error which isn't even present)

~SimpleX~
27th January 2012, 22:26
Thanks!

Could you please share Corrector.dll? Can't find it anywhere and avisynth.org.ru is dead.

Didée
27th January 2012, 22:55
http://www.64k.it/andres/dettaglio.php?sez=avisynth

~SimpleX~
27th January 2012, 23:46
Thanks again! But, well, it didn't help.

Didée
28th January 2012, 00:47
What did not help in what way? The script is written as to fix your sample. Result: fixed output (http://www.mediafire.com/?3q5vle785986c8h). What else?

poisondeathray
28th January 2012, 01:01
Is it possible certain versions of filters can produce different results? I'm seeing something different too when trying out that script, making sure to check linearly from beginning to end

~SimpleX~
28th January 2012, 02:31
Sorry, you're right. Didn't explain anything.

So, our outputs really differ:
Yours and mine
http://i.imgur.com/MeNGD.jpg (http://i.imgur.com/zooZL.jpg) http://i.imgur.com/IJxC1.jpg (http://i.imgur.com/IaxaB.jpg)

And there's some healthy frames chroma replacement. Not such a big problem, though.
578, 572 and 654
http://i.imgur.com/Z7dNz.jpg (http://i.imgur.com/2c6dy.jpg) http://i.imgur.com/HXgMM.jpg (http://i.imgur.com/b42NR.png) http://i.imgur.com/IytOH.jpg (http://i.imgur.com/Ki6Wc.jpg)

Emulgator
28th January 2012, 16:06
Didée's repair results are stunning, but I get the same results as SimpleX here, unfortunately.

Let's compare versions:
Here : avisynth.dll 2.6.0.2, dgdecode.dll 1.5.8.0, mt_masktools-26.dll 2.0.48.0, tivtc.dll 1.0.5.0
on WinXP32 SP3.

P.S. I guess my version of FixBlendIVTC
## version: - v0.9b - 20.12.2006
gives faulty output.

If I change the last line of Didée's script to return(fixed)
I get some blended, blurred, combed frames.
Might be arguments missing ?

Didée
28th January 2012, 18:08
I had stepped in a self-digged trap, and didn't realize. In fact there is "only" chroma top/bottom field blending, but there is NOT a 1-frame delay. The latter was caused by a debug line in my script that I had forgotten to #comment out ... :o

Script edited to work correctly now.
(And in the same breath, the uploaded video result for tfm.tdecimate is not correct - it shows the chroma delay that isn't there to start with.)

Somehow, I feel the script still is too laborious. The idea simply is to perform FixBlendIVTC on chroma because that's what chroma actually needs, and use standard TFM.tdecimate on luma, because luma does not have any problem. However, the problem is that the two videos:
a) FixBlendIVTC.tdecimate
b) TFM.tdecimate

are not truly in sync, there is some phase-shifted offset going on. That's why I fiddled that small funky frame-matching replacer (as in: from frame N and N-1 of video A, use that frame that's more similar to frame N of video B.) I didn't want to use Scriptclip et al., because FixBlendIVTC already works in conditional environment, and I didn't feel like exploring whether-or-not it is safe to plug another conditional-something into the script.

If someone knows a better way (or an existing filter) to do that, or a better/simpler strategy altogether, he's welcome.

Maybe one could simply use replacing based on SelectEvery(), but that requires a constant fixed pattern. It would probably work for the sample, but full-length sources often tell another story. More often than not, probably.

Emulgator
29th January 2012, 00:57
Ah, this works beautifully.

~SimpleX~
29th January 2012, 03:34
Emulgator, would be. But FixBlendIVTC's output isn't perfect, so there're still some buggy frames. Look at 578 or 654 (eyes).

librarian
29th January 2012, 12:10
May this (http://www.2shared.com/video/lIaswpC1/Chromaswap.html) be acceptable?

Emulgator
29th January 2012, 13:38
SimpleX: True, well spotted.
What abut AIVTC 2.10 then ? Try this one:

Mpeg2source("D:\_VID\Chroma-fieldblend+delay\Chroma-fieldblend+delay.d2v")
#SimpleX:But FixBlendIVTC's output isn't perfect, so there're still some buggy frames. Look at 578 or 654 (eyes).
#Emulgator: What about AnimeIVTC 2.10 then ? The mentioned frames 578 and 654 come out perfect here.
AIVTC="23.976" # Use AIVTC 2.10 with the new TGMCmod from http://forum.doom9.org/showthread.php?p=1553265#post1553265
AnimeIVTC(mode=2, aa=4, edimode="NNEDI3", precision=3, killcomb=0, cache=15, normconv=Value(LeftStr(AIVTC, 6)), chrfix=false\
, bbob=4, omode=1, dark=0.2, thin=10, sharp=150, smooth=-1, stabilize=false, aablk=8, aaov=4, aatype="Sangnom")
#And for kicks:
LSFmod(strength=400, Smode=3, edgemode=2, kernel=11)# Smode=1+2 harmonisch, 1+2 kann Schatten fleckig machen, 4+5 oily, edgemode2: alles außer edges !

The result MPEG-2 (720x480@23.976p, not pulldowned) is here:
http://dvd-manufactur.de/files/Emulgator's Chroma-fieldblend+delay fixed.m2v