Decomb vthresh Clarification

Support for my Avisynth filters
Post Reply
Aleron Ives
Distinguished Member
Distinguished Member
Posts: 113
Joined: Fri May 31, 2013 8:36 pm

Decomb vthresh Clarification

Post by Aleron Ives » Sat Jun 01, 2013 6:52 pm

I'm trying to IVTC DVD content, but I'm having trouble understanding the best way to set the vthresh value. From what I can tell by taking screenshot comparisons and using post=3 and show=true, it's necessary to select a high enough vthresh value to detect all combed frames, as a value that's too low will allow some combed frames to slip through into the output file. Most of the time, it's sufficient to use vthresh values in the 30-60 range (which is near the default setting of 50), but I've seen some frames with a "chosen" vmetric > 180 at times, which would require using a pretty high vthresh value.

If the vmetric can vary so widely, and as the manual says, "It's better to catch some progressive frames than to miss some combed ones," my question is: why isn't the vthresh value just set at the maximum of 255 all the time, rather than defined as a user-controlled parameter? Is it just because setting a high vthresh value results in slower processing, or is there some sort of quality degradation that occurs from catching all of the progressive frames by using a high vthresh to ensure that no combed frames remain in the output?

The manual also says that you can define "zones" where vthresh values can differ between different points in the same clip, so I assume that feature exists because there is some drawback to using a high vthresh value for the entire clip "just to be sure", so to speak. Is it possible to reduce the range of possible vmetric values by tweaking another parameter, or would that yield essentially the same result as using a high vthresh?

Note: I'm working with anime content, if that is important. The ??? IVTC guide says it is one of the most difficult things to process, which I suppose means I've chosen an arduous task. Thanks for any advice you might be able to provide.

User avatar
admin
Site Admin
Posts: 4266
Joined: Thu Sep 09, 2010 3:08 pm

Re: Decomb vthresh Clarification

Post by admin » Sun Jun 02, 2013 8:35 am

Aleron Ives wrote:I'm trying to IVTC DVD content, but I'm having trouble understanding the best way to set the vthresh value. From what I can tell by taking screenshot comparisons and using post=3 and show=true, it's necessary to select a high enough vthresh value to detect all combed frames, as a value that's too low will allow some combed frames to slip through into the output file.
That's exactly opposite. The higher the vthresh, the more combed frames will pass through.
Most of the time, it's sufficient to use vthresh values in the 30-60 range (which is near the default setting of 50), but I've seen some frames with a "chosen" vmetric > 180 at times, which would require using a pretty high vthresh value.
Please provide an unprocessed source sample that I can use to duplicate that.
If the vmetric can vary so widely, and as the manual says, "It's better to catch some progressive frames than to miss some combed ones," my question is: why isn't the vthresh value just set at the maximum of 255 all the time, rather than defined as a user-controlled parameter?
You have everything backwards and I suppose that is the source of your confusion.
Is it just because setting a high vthresh value results in slower processing, or is there some sort of quality degradation that occurs from catching all of the progressive frames by using a high vthresh to ensure that no combed frames remain in the output?
If you deinterlace a progressive frame there will be degradation because some areas will surely appear to have the spatial frequency of combing and will be deinterlaced. So vthresh allows the user to make his personal tradeoff of residual combed frames versus degradation of progressive frames.
The manual also says that you can define "zones" where vthresh values can differ between different points in the same clip, so I assume that feature exists because there is some drawback to using a high vthresh value for the entire clip "just to be sure", so to speak. Is it possible to reduce the range of possible vmetric values by tweaking another parameter, or would that yield essentially the same result as using a high vthresh?
I am not aware of any zones parameter. Please point me to the part of the manual you are talking about.

Aleron Ives
Distinguished Member
Distinguished Member
Posts: 113
Joined: Fri May 31, 2013 8:36 pm

Re: Decomb vthresh Clarification

Post by Aleron Ives » Sun Jun 02, 2013 4:03 pm

neuron2 wrote:That's exactly opposite. The higher the vthresh, the more combed frames will pass through.
That would explain the frame defects I was seeing when using a low vthresh value, then. They were the result of incorrectly decombing some progressive frames, which didn't happen when the vthresh was high.
neuron2 wrote:Please provide an unprocessed source sample that I can use to duplicate that.
I went through to check the same trouble spots again, and I must conclude that the problem of excessively high vmetric values was something you already fixed in the latest version. Using Avisynth 2.5.8 and Decomb 5.2.2 was producing serious errors in the output file (strange green and red blinking bars at the bottom of many frames), so I upgraded to Avisynth 2.6 and Decomb 5.2.4 in an attempt to solve the problem without needing to post here. It would appear that doing so also fixed the high chosen values, as frames that used to register as 180 are now registering as 80, instead.
neuron2 wrote:If you deinterlace a progressive frame there will be degradation because some areas will surely appear to have the spatial frequency of combing and will be deinterlaced. So vthresh allows the user to make his personal tradeoff of residual combed frames versus degradation of progressive frames.
Now that I understand the purpose of vthresh, it would seem that all of the defects I was seeing were the result of incorrectly deinterlacing combed frames, rather than interlaced frames that were missed. As such, I guess I should actually be using post=0, because I'm not seeing any residual combing, and disabling postprocessing is faster than setting a high vthresh value.
neuron2 wrote:I am not aware of any zones parameter. Please point me to the part of the manual you are talking about.
I was referring to this line in the "Overriding Decomb Decisions" section of the reference manual:
Reference Manual wrote:You can set different vthresh values for different parts of your clip. For example, to set vthresh to 25 for frames 200 through 500, use:
200,500 v 25
In the interest of perhaps preventing others from sharing in my confusion, this is the part of the documentation that I found ambiguous:
Tutorial wrote:Any vmetric value greater than vthresh defines the frame as interlaced. You want to find the vthresh value that correctly distinguishes combed frames from non-combed frames for your clip. You'll easily be able to identify the frames thought to be combed because a) the vmetric value will be greater than vthresh, b) the progressive/interlaced indicator will say interlaced, and c) the frame will have a white deinterlacing motion map overlayed on it. There's no way you'll miss them!

Your chosen vthresh may not be perfect and if it is not you should err on the side of caution. It's better to catch some progressive frames than to miss some combed ones.
Based on this description, I thought that the image defects I was seeing with a low vthresh value meant that I was not properly deinterlacing everything, so I needed to increase the vthresh to catch all of the combed frames. In reality, the defects I was seeing were the result of incorrectly deinterlacing progressive frames, because vthresh needed to be higher to not catch them.

For what it's worth, if you decide to update the documentation whenever you release a new version, I would suggest changing:

Any vmetric value greater than vthresh defines the frame as interlaced. You want to find the vthresh value that correctly distinguishes combed frames from non-combed frames for your clip.

to something along the lines of:

"Any vmetric value greater than vthresh means Decomb thinks the progressive output frame has residual interlacing artifacts. You want to find the vthresh value that correctly distinguishes combed frames from non-combed frames for your clip. If frames with interlacing artifacts are being missed, you need to decrease the vthresh value. If frames without interlacing artifacts are being incorrectly detected as interlaced, you need to increase the vthresh value."

I hope I've got everything straight now. If so, thank you very much for your help.

User avatar
admin
Site Admin
Posts: 4266
Joined: Thu Sep 09, 2010 3:08 pm

Re: Decomb vthresh Clarification

Post by admin » Mon Jun 03, 2013 6:30 am

neuron2 wrote:Please provide an unprocessed source sample that I can use to duplicate that.
I went through to check the same trouble spots again, and I must conclude that the problem of excessively high vmetric values was something you already fixed in the latest version. Using Avisynth 2.5.8 and Decomb 5.2.2 was producing serious errors in the output file (strange green and red blinking bars at the bottom of many frames), so I upgraded to Avisynth 2.6 and Decomb 5.2.4 in an attempt to solve the problem without needing to post here. It would appear that doing so also fixed the high chosen values, as frames that used to register as 180 are now registering as 80, instead.
I can't comment on that without a sample as I requested.
I guess I should actually be using post=0, because I'm not seeing any residual combing, and disabling postprocessing is faster than setting a high vthresh value.
Well sure, if your fields are being matched perfectly, then you can use post=0. But for safety you can enable postprocessing but set a high vthresh. Otherwise you'll not be sure some field match has not failed unless you inspect every output frame.
You can set different vthresh values for different parts of your clip. For example, to set vthresh to 25 for frames 200 through 500, use: 200,500 v 25
Ah yes, I forgot about the override file functionality.

Post Reply