Log in

View Full Version : Calibrating TFM


Katie Boundary
12th March 2017, 10:31
Today, I decided to make some Birds of Prey encodes. Birds of Prey has a LOT of natively 60 hz content, which makes it perfect for stress-testing TFM. The results were pretty extreme. Some visibly interlaced field-matches were not detected as interlaced until I cranked cthresh all the way down to 2. Mthresh likewise had to be pushed all the way down to 2 in order to detect all visible combing.

huhn
12th March 2017, 12:53
what's the point of running TFM on a hybrid source?

it doesn't make sense to use IVTC on an interlanced source.

Katie Boundary
12th March 2017, 22:48
what's the point of running TFM on a hybrid source?

it doesn't make sense to use IVTC on an interlanced source.

It's not hybrid. It's 100% hard (but non-native) NTSC. The point of running TFM on this material is to probe TFM's capabilities and determine what settings are actually ideal. And I'm not doing IVTC; I'm converting to 60 fps progressive. But that's not the important part. The important part is that if you want TFM to detect all visibly combed frames for post-processing, you have to set cthresh waaaay below the default value.

FranceBB
13th March 2017, 01:44
@huhn... well, even if it was hybrid telecined and interlaced, there's always the progressive VFR encode option, I think. (23.976 ~ 29.970)

@katie... combed frames? You said that the source is hard NTSC but wasn't native NTSC. If it's not telecined, then the original source wasn't 23.976, and if it's not native NTSC then it's not 29.970, and there are combed frames; maybe it was a PAL 25 with blended frames to reach 29.970 (NTSC 30i 60Hz)?
You are basically trying to get rid of the blended frames and then bring everything to 60fps via motion interpolation (I think)?
What's your full script?

ndjamena
13th March 2017, 02:05
I think she's just trying to point out that combing detection sucks.

Back when I bothered doing such things I discovered that in order to make sure all of the combed sections were decombed I wound up having to set it so sensitive that I might as well have just deinterlaced the whole thing properly anyway.

There's a trade-off between making sure it deinterlaces the interlaced sections and trying not to unnecessarily deinterlace the progressive sections. She seems to think TFMs defaults are too in favour of avoiding unnecessary deinterlacing.

johnmeyer
13th March 2017, 02:15
Combing detection works fine, but you have to use the correct modes and parameters. But of course we'll never see her script, so we'll never know what she's doing wrong.

Sharc
13th March 2017, 08:35
"chroma" detection disabled, perhaps?

huhn
13th March 2017, 08:53
@huhn... well, even if it was hybrid telecined and interlaced, there's always the progressive VFR encode option, I think. (23.976 ~ 29.970)

of cause it is possible to create a 23p-59p VFR encode but what has TFM todo with that?

manono
13th March 2017, 09:34
And since we'll never get a sample of the parts presenting the problems, why even bother trying to help?

We have to take her word for what's going on and I, for one, am not prepared to do that.

Katie Boundary
13th March 2017, 18:43
@katie... combed frames? You said that the source is hard NTSC but wasn't native NTSC. If it's not telecined, then the original source wasn't 23.976, and if it's not native NTSC then it's not 29.970, and there are combed frames; maybe it was a PAL 25 with blended frames to reach 29.970 (NTSC 30i 60Hz)?
You are basically trying to get rid of the blended frames and then bring everything to 60fps via motion interpolation (I think)?


uh, no. Birds of Prey is a mix of

(a) hard-telecined Film content
(b) 30 FPS CGI
(c) stuff that was originally shot at 24 FPS but then sped up to 48 or 60 fps
(d) Cross-fades and other effects that are done at 60 hz
(e) probably some other stuff that I haven't noticed yet

There's no frame-blending except during the cross-fades. There were no improper frame rate conversions. Not that it matters, as this thread is about TFM, not Birds of Prey.

What's your full script?



mpeg2source("475179.d2v")

loadcplugin("c:\yadif.dll")

C=Yadif(mode=1).selecteven()
D=Yadif(mode=1).selectodd()

A=Tfm(field=1,mode=0,cthresh=2,mthresh=2,micmatching=0,clip2=C)
B=Tfm(field=0,cthresh=2,mthresh=2,micmatching=0,clip2=D)

Interleave(A,B).crop(0,58,-0,-62).arearesize(624,352)


(it's letterboxed, which is the reason for the cropping)

I think she's just trying to point out that combing detection sucks.

It doesn't "suck". The default settings are just too high.

Back when I bothered doing such things I discovered that in order to make sure all of the combed sections were decombed I wound up having to set it so sensitive that I might as well have just deinterlaced the whole thing properly anyway.

When I was testing with Andromeda, I did see a very high false positive rate when pushing the cthresh this low. However, that's what motion-adaptive settings are for :)

She seems to think TFMs defaults are too in favour of avoiding unnecessary deinterlacing.

Well, they are.

But of course we'll never see her script

Wrong as usual :)

"chroma" detection disabled, perhaps?

Yes. Chroma interlacing happens but it seems to occur in 2-pixel-tall bars as a result of the MPEG-2 colorspace, so I didn't expect chroma-based combing-detection to be of much help.

And since we'll never get a sample of the parts presenting the problems, why even bother trying to help?

What problems? And what do you think I need help with? I'm offering help here, not asking for it. I have the scripts that I want and they work beautifully.

TheFluff
14th March 2017, 00:47
uh, no. Birds of Prey is a mix of

(a) hard-telecined Film content
(b) 30 FPS CGI
(c) stuff that was originally shot at 24 FPS but then sped up to 48 or 60 fps
(d) Cross-fades and other effects that are done at 60 hz
(e) probably some other stuff that I haven't noticed yet

There's no frame-blending except during the cross-fades. There were no improper frame rate conversions. Not that it matters, as this thread is about TFM, not Birds of Prey.

That's the definition of hybrid content: it's a mix of different sources with different frame rates and coding types. Using the correct terminology is important.

mpeg2source("475179.d2v")

loadcplugin("c:\yadif.dll")

C=Yadif(mode=1).selecteven()
D=Yadif(mode=1).selectodd()

A=Tfm(field=1,mode=0,cthresh=2,mthresh=2,micmatching=0,clip2=C)
B=Tfm(field=0,cthresh=2,mthresh=2,micmatching=0,clip2=D)

Interleave(A,B).crop(0,58,-0,-62).arearesize(624,352)

You should probably crop before ivtc (or field matching like you're doing here), especially if it's letterboxed, because having huge blank areas with no motion and no combing has some potential to mess with the detection thresholds, and there's not much point to spending cpu cycles on filtering black borders you're going to immediately throw away anyways. Also, mthresh has nothing to do with marking frames as combed/not combed for the purposes of field matching, it's only used for determining which pixels should be deinterlaced. Especially on low resolution content it may be worth messing a bit with blockx/blocky/MI if you find cthresh to be too crude of a tool to tune TFM to exactly the precision you want, but really, if you care that much about false positives/false negatives you should be using something like YATTA and do it the hard way. That also goes double for all sorts of hybrid content - it will never look really good unless you bite the bullet and wrangle some stuff manually.

Katie Boundary
15th March 2017, 04:39
That's the definition of hybrid content: it's a mix of different sources with different frame rates and coding types. Using the correct terminology is important.

I was under the impression that it referred specifically to DVDs that mixed soft-telecined Film content with hard NTSC

You should probably crop before ivtc (or field matching like you're doing here), especially if it's letterboxed, because having huge blank areas with no motion and no combing has some potential to mess with the detection thresholds, and there's not much point to spending cpu cycles on filtering black borders you're going to immediately throw away anyways.

You're correct. The only reason why the cropping comes later in the script is because I added it later.

Also, mthresh has nothing to do with marking frames as combed/not combed for the purposes of field matching, it's only used for determining which pixels should be deinterlaced.

I was already quite aware of that.

it may be worth messing a bit with blockx/blocky/MI if you find cthresh to be too crude of a tool to tune TFM to exactly the precision you want

The subtle combing that's forcing me to set cthresh and mthresh so low occurs all over the screen. Messing with those stats wouldn't help. The fact is that a cthresh of 3 or higher is too high to detect all visible combing.

but really, if you care that much about false positives/false negatives

I care about false negatives, but false positives are extremely acceptable due to the motion-adaptive options.

TheFluff
15th March 2017, 20:38
I was under the impression that it referred specifically to DVDs that mixed soft-telecined Film content with hard NTSC
If I'm reading you correctly, that's just a subset of the definition I mentioned. Loosely speaking you could even call a mix of hard and soft telecine hybrid, and it kinda is, since it mixes two different coding types (progressive and interlaced), but on the other hand the source framerate and ideal playback rate is the same and constant. I find the term "hybrid" to be more practically useful if it is used to refer to a mix of different source coding types and/or "proper" playback framerates.


The subtle combing that's forcing me to set cthresh and mthresh so low occurs all over the screen. Messing with those stats wouldn't help. The fact is that a cthresh of 3 or higher is too high to detect all visible combing.

That sounds bizarre but I'll take your word for it.

I care about false negatives, but false positives are extremely acceptable due to the motion-adaptive options.
If you don't care much about false positives at all I can't help but wonder why you seem to be making efforts to tune the detection thresholds. And what is this thread even for? You claimed you're offering help, but simply posting your TFM settings with neither context nor a sample of the source helps absolutely nobody.

johnmeyer
16th March 2017, 05:48
And what is this thread even for? You claimed you're offering help, but simply posting your TFM settings with neither context nor a sample of the source helps absolutely nobody.You just wrote this lady's epitaph.

Katie Boundary
18th March 2017, 03:03
A little bit of extra testing has shown that an mthresh of 2 won't quite eliminate all visible combing - it'll just smear it a little bit, to the point where you can't really be sure that what you're looking at is leftover combing. I found one such frame in a 40-minute episode, so most people should find this an acceptable level of residual combing.

If you don't care much about false positives at all I can't help but wonder why you seem to be making efforts to tune the detection thresholds.

Tuning the detection thresholds is necessary to eliminate false negatives.

And what is this thread even for? You claimed you're offering help, but simply posting your TFM settings with neither context nor a sample of the source helps absolutely nobody.

Mmmkay. I'll see if I can get around to posting some examples later.


EDIT: Well, I just ran into something unexpected. Behold the following shot from Tekwar:

http://img.photobucket.com/albums/v415/DWJohnson/false%20positives_zpsn2baenmv.png

Do you see those lines on the pink wall? Those aren't scanlines. The wall is physically made out of corduroy or some crap like that. However, the camera distance and angle are just right for tricking TFM into thinking that those are scanlines, and so TFM will blur this wall to hell and back. Aside from this one really weird shot of this one really weird wall, I'm not having a significant problem with false positives.

However, I've noticed that 60 hz fades to/from black can often produce "patchy" combing. Setting MI between 40 and 60 will catch it.