Log in

View Full Version : Chroma ghosting on deinterlaced animation


bilditup1
9th June 2016, 01:47
Difficult to see at native resolution/size, but when made full screen or viewed frame by frame, I'm experiencing some chroma ghosting when processing a particular interlaced NTSC animation source. This persists across a few different deinterlacers; per this post (http://forum.doom9.org/showthread.php?p=1713587#post1713587), after trying QTGMC (at both 'slow' and 'slower'), I used other deinterlacers - TDeint, EEDI2+TDeint, Yadifmod2 - but they all exhibit the same problem, besides being not nearly as smooth as QTGMC is.

Here's are few clips containing the first two minutes of the episode using each method (all at 'double rate' - tried with single-rate as well but results didn't look encouraging enough to try an encode) without audio.

QTGMC (Preset="Slow",SourceMatch=3,EdiThreads=4,ShowSettings=False) (https://mega.nz/#!fFBWWSIA!tYTKZK9huiNneluDDyqWM9DIa9KcA2YDLQg899HTTa0)
TDeint (mode=1) (https://mega.nz/#!CF5lxTiI!Y9HU95O_lHsJhOK32p8FyYI4bIoMc-tkNgRkNpdOyfk)
TDeint (mode=1,edeint=eedi2ed) (https://mega.nz/#!LAAXTQIQ!6ON0zBHfz85A4WV5hbjhkShji8oEVAgfFOnZN41SDrI)
yadifmod2 (order=1,mode=1) (https://mega.nz/#!vNBVBAoD!ithu-gBDuN4aEApUU7xpPZ1D0dJO3Q-mcRokKw0NJ4w)

Here is the original source for the above clips (https://mega.nz/#!7Eh2UILQ!yF_xajbaxOYXzYK20F_udOed8dkjTvLEV32dV1I8xZs) (only the last minute's worth, but that should be enough).

So, I'm not sure if I'm using the latter filters wrong, or if there is some kind of anti-ghosting solution available. There are some (http://forum.doom9.org/showthread.php?p=1176552#post1176552) listed (http://forum.doom9.org/showthread.php?t=35339) at the wiki (http://avisynth.nl/index.php/External_filters#Ghost_RemovalAVS) but Ghostbuster doesn't process chroma and LGhost seems completely opaque.

I'm not sure to proceed or if anybody has 'solved' this issue, since there doesn't seem to be much information about it.

manono
9th June 2016, 11:43
None of those are untouched from the source, right? You should include a sample that hasn't been reencoded.

bilditup1
9th June 2016, 17:41
None of those are untouched from the source, right? You should include a sample that hasn't been reencoded.

Do you mean, uncompressed but processed by AviSynth? Or just the original source file plus scripts? Or either? Or neither?

StainlessS
9th June 2016, 17:47
original source files,
cut with eg DGIndex, mark using '[' and ']', then 'Save Project' and supply result m2v.

Choose section with some motion (about 20-30 secs should be enough).

manono
9th June 2016, 20:19
original source files,
cut with eg DGIndex, mark using '[' and ']', then 'Save Project' and supply result m2v.

I think you mean to say 'Save Project and Demux Video'. But, yes, a piece from the DVD, if that's what's being used as a source.

StainlessS
9th June 2016, 20:33
Yep, guess I shoulda checked name in DGIndex, good job we got you to keep me on the right path :)

bilditup1
9th June 2016, 20:54
OK, here it is (https://mega.nz/#!7Eh2UILQ!yF_xajbaxOYXzYK20F_udOed8dkjTvLEV32dV1I8xZs) (actually it's the last minute of the above encoded videos, since I think the first minute won't tell us too much, being mostly black and white and all.)
I will also add it to the OP.

I can also reencode this or recut the original files I put up, if you propose to try to do a frame-by-frame comparison or something.

bilditup1
9th June 2016, 23:09
Actually...did I misidentify this part of the video as interlaced? Damn it.

bilditup1
9th June 2016, 23:12
This is happening throughout though, not just with the titles. Oh dear...

manono
9th June 2016, 23:45
My thoughts:

It shouldn't be encoded at 59.94fps as that just accentuates the chroma blending and is the wrong framerate anyway. It's been telecined (the sample was) and the correct framerate is 23.976fps. You'll never be able to remove that chroma mess automatically as there's just too much of it. Since most of it seems to occur with duplicate frames, manual work after the IVTC will get rid of most of it. About all I was able to do was:

TFM(Clip2=Nnedi3,chroma=true)###or set up SRestore as the deinterlacer
Tdecimate()

Others might have better ideas about what to do. Also, it was made by idiots. Not only is the chroma blending a serious issue, but it was encoded as progressive (the sample, anyway) which means most of the DVD players around won't even deinterlace it so you'll see all the interlacing.

Motenai Yoda
10th June 2016, 00:01
I was trying with upconv=1,icc=true in mpeg2source and telecide()
but still there is some chroma blending coz a chroma plane, I think U, isn't linked to the luma and sometimes anticipate or posticipate of one field.

bilditup1
10th June 2016, 00:53
My thoughts:

It shouldn't be encoded at 59.94fps as that just accentuates the chroma blending and is the wrong framerate anyway. It's been telecined (the sample was) and the correct framerate is 23.976fps.

OK, the MeGUI analyser had 'hybrid film/interlaced; mostly interlaced'. I thought I saw a pattern there before but deferred...which looks like the exact wrong move. I was double-checking it as well as the rest of this just now, and saw the pattern again but it appears to be 4, then 1, not 3, then 2 (?) Plus a lot of frames that look like straight duplicates. Basically I'm totally confused...which probably means I fundamentally misunderstood something.

You'll never be able to remove that chroma mess automatically as there's just too much of it. Since most of it seems to occur with duplicate frames, manual work after the IVTC will get rid of most of it. About all I was able to do was:

TFM(Clip2=Nnedi3,chroma=true)###or set up SRestore as the deinterlacer
Tdecimate()

Others might have better ideas about what to do.


Can you comment on how to set up NNEDI3() properly as part of an IVTC operation? I've never actually used it for this purpose or even called it directly (as opposed to via a complex script like QTGMC).

I was experimenting with TFM's internal deinterlace modes before, but this resulted in combing in addition to color ghosting. Specifying chroma=true helped but - because of course it did - it left behind, as you said, an awful chroma mess. Specifying a very low cthresh of 2 or 3 + chroma = false almost completely got rid of the combing and chroma mess some of the time (not perfect but still harder to see), but not nearly often enough.

Also, it was made by idiots. Not only is the chroma blending a serious issue, but it was encoded as progressive (the sample, anyway) which means most of the DVD players around won't even deinterlace it so you'll see all the interlacing.

Freaking brilliant. There's always something, isn't there? Le sigh. I often wonder why it isn't the people here running the show at the authoring firms.

Anyway. Thanks for chiming in! I look forward to taming this beast.

bilditup1
10th June 2016, 00:56
I was trying with upconv=1,icc=true in mpeg2source and telecide()
but still there is some chroma blending coz a chroma plane, I think U, isn't linked to the luma and sometimes anticipate or posticipate of one field.

*goes to wiki*
Interesting...I'm going to try that and see what it looks like.

manono
10th June 2016, 01:08
Can you comment on how to set up NNEDI3()
I don't understand. Except for having to get NNEDI3 if you don't already have it, that's the exact script to use.

It can't be done properly without some serious manual work of replacing the remaining chroma-blended frames with 'clean' versions. Just bob it and have a look - you can go 3 and sometimes 4 frames of blending in a row. There's no way a field-matcher can handle that. Even bob/srestore can't. And it did a poorer job than did field-matching.

But, as I said, maybe others can see things to do that I don't know. I don't work with cartoons much.

bilditup1
10th June 2016, 01:38
I don't understand. Except for having to get NNEDI3 if you don't already have it, that's the exact script to use.

I misunderstood, I thought that that nnedi3 had to be called separately somewhere else, and that you just assigned the result of that operation to a new variable also called nnedi3, and then passed that in to the Clip2 parameter. But I see now that just putting TFM(Clip2=Nnedi3,chroma=true) is sufficient.


It can't be done properly without some serious manual work of replacing the remaining chroma-blended frames with 'clean' versions.

What is the best way to do such frame substitutions with AviSynth? Lots of trims?

Just bob it and have a look - you can go 3 and sometimes 4 frames of blending in a row.
I just did that

AssumeTFF()
Bob()

and definitely see those 4 blended frames in a row. Damn. But practically speaking what does this tell me, other than 'bobbing doesn't fix it'? I'll still have to manually replace the bad frames, right?

But, as I said, maybe others can see things to do that I don't know. I don't work with cartoons much.
OK, so I guess I'll hope that happens, too. Thanks again for all your comments/starting to put me on the right track.

GMJCZP
10th June 2016, 02:15
Read this:

Here (http://forum.doom9.org/showthread.php?t=167194&highlight=Chroma+bleeding+x265/)

It's about Chroma Bleeding.

EDIT: read the post #13.

manono
10th June 2016, 03:50
But practically speaking what does this tell me, other than 'bobbing doesn't fix it'?
It tells you neither field matching nor unblending will work to get rid of it all. Which is why I mentioned having to do a lot of manual work. Maybe GMJCZP's link will help.
What is the best way to do such frame substitutions with AviSynth? Lots of trims?
FreezeFrame, maybe. But it's probably not worth it to do a freezeframe every 4 frames or so. jagabo over at videohelp.com has a function he made that streamlines all the typing you have to do for freezeframe, but it'll still be a lot of boring work.

bilditup1
10th June 2016, 04:00
EDIT: read the post #13.

Yup, I was about to say, that post leads to this:

http://forum.doom9.org/showthread.php?p=1582950#post1582950

And that script by sp00kyfox is made for *exactly* this problem, for animation DVDs from *exactly* the same period, by the *exact* same studio even. Brilliant! Let's try it!

Combing appears to be gone, ghosting appears to be gone. Everything looks...slightly less sharp maybe? And kinda jerky? But I could be imagining that. There is definitely...some 'rainbowing'. I don't know the proper term. And there's some weird...not gridding, I don't know how to describe it. But it was in the source, and it's for another thread, I think.

Anyway, comparison clips, again (no sharpening, cropping, degraining or anything like that)

TFM(clip2=nnedi3,mode=2,chroma=true).TDecimate(mode=1) (https://mega.nz/#!aZ50TKQT!xUb66p3OzSj6DPC6C5OfS8KH-ShCpvEC0TUyqQUjLAI)
Sp00kyfox's script (https://mega.nz/#!iQRzUAYJ!ehFl6rKECXAjfnq_JKMIf2SJSJ9uUeRB4sL2iAf7Nj0)

Note: script only appears to work with the old versions of Srestore and Average, at least for me just now.

From the code comments, it appears that what it does is use tfm to process luma and vinverse+srestore to process chroma, then compares the two, builds a mask with masktools, and combines them on the basis of this mask.

I wish I understood exactly how masktools works and what this script is really doing though, because it's pretty amazing.

Anyway. Thanks for pointing this out GMJCZP. Wow. This thing should be stickied on the AVS wiki. And perhaps people smarter than I can even help improve it?

bilditup1
10th June 2016, 04:07
It tells you neither field matching nor unblending will work to get rid of it all. Which is why I mentioned having to do a lot of manual work. Maybe GMJCZP's link will help.

FreezeFrame, maybe. But it's probably not worth it to do a freezeframe every 4 frames or so. jagabo over at videohelp.com has a function he made that streamlines all the typing you have to do for freezeframe, but it'll still be a lot of boring work.

I will keep this in mind since the solution I just posted about isn't 100% 'perfect'.

bilditup1
10th June 2016, 04:35
It seems like I jumped the gun a bit. There is some combing still...but it's much harder to catch than before. Anybody want to take a look?

GMJCZP
10th June 2016, 04:44
The user stickboy has several tools that could be used for manual labor. Maybe my script RescueFrame can help.
About rainbows look DeRainbow.

EDIT: more problems with chroma: Here. (http://forum.doom9.org/showthread.php?t=163363/)

bilditup1
10th June 2016, 23:15
The user stickboy has several tools that could be used for manual labor. Maybe my script RescueFrame can help.
About rainbows look DeRainbow.

EDIT: more problems with chroma: Here. (http://forum.doom9.org/showthread.php?t=163363/)

Yeah I began looking for derainbowing tools right after, they seem to help greatly. I noticed though that interlacing artifacts are not completely dealt with by sp00kyfox's script, though they are much harder to catch. See here (https://mega.nz/#!mdgQ1SpL!JxEQvL-EesegNWLClFR_Y_CvRNRWIvIeKDvhPnnT_Os) for example - look particularly at the edges of the letters.

ED: Sorry, I didn't process the first sentence there. I'll look into those as well.
I also found this (http://avisynth.org.ru/badframes/badframes.html). So I have a lot to keep in mind between your recommendations and manono's. Thanks again! Though if you have any more specific ideas than manually replacing the remaining bad frames, I'd be happy to here those as well.

ED2: Your script looks useful if I had to manually fix a frame and reinsert it but I don't think I'll have to do that? Hopefully I could just use the preceding artifact-free frame in most cases.

ED3: So natch it's not that easy. Sometimes it's the first frame, sometimes it's the second. Brilliant.

GMJCZP
11th June 2016, 01:40
Badframes is interesting, but is other "no pain-no gain" tool because lack of a threshold option for automatize the job.

Take a look, other home remedy: Here. (http://avisynth.nl/index.php/FRebuild)

EDIT: links not working, somebody will have frebuild.avsi?
EDIT2: seems a fake tool (?).

bilditup1
11th June 2016, 03:36
Badframes is interesting, but is other "no pain-no gain" tool because lack of a threshold option for automatize the job.

Take a look, other home remedy: Here. (http://avisynth.nl/index.php/FRebuild)

EDIT: links not working, somebody will have frebuild.avsi?
EDIT2: seems a fake tool (?).

Yeah I saw that before but wasn't sure if it was relevant, and the forum link just went to the main page, so I didn't find out anything else about it :/

Reel.Deel
11th June 2016, 04:12
Take a look, other home remedy: Here. (http://avisynth.nl/index.php/FRebuild)

EDIT: links not working, somebody will have frebuild.avsi?
EDIT2: seems a fake tool (?).

FRebuild script was never published. I forgot to add a note to the wiki. Here's the back story:
The story is: when I had made that script, the Wiki allowed me to edit the page, but not to upload the script, but would'nt tell me why. Later, I learned from wilbert that I should try to do ten edits so the system would upgrade my account. But then I had already found some flaws and re-invented the idea from a better starting point. So I actually never published it and later also didn't judge it worth being published any more. Instead, I published the successor script FSubstitute in the forum (http://forum.doom9.org/showthread.php?t=166446).

GMJCZP
11th June 2016, 16:24
Thanks, Reel.Deel.
This history is very weird :confused: .

bilditup1
13th June 2016, 00:27
FRebuild script was never published. I forgot to add a note to the wiki. Here's the back story

Thanks for the heads-up on this; I'm going to look into FSubstitute and see what it can do.