Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st December 2013, 06:35   #1  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Improving decomb?

While decomb is much faster than tivtc for a good simple ivtc. Decimate lacks a way to exclude a part of the video which is important in cases like this. y0/y1 for decimate would be very helpful. Also x0/x1 for telecide and decimate would be helpful.

Another thing is when a only a small part of the frame is moving it chooses the wrong frames to keep. Such as a longshot of a car driving through a barren desert. Tivtc handles these situations fine. I think it has to do with block size, which is not configurable in decomb. Could there be some optimizing and/or a configurable block size added?
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650
PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0
turbojet is offline   Reply With Quote
Old 21st December 2013, 19:53   #2  |  Link
tritical
Registered User
 
Join Date: Dec 2003
Location: MO, US
Posts: 999
The main difference between tfm and decomb is the idea of focusing on areas of difference and using pairwise comparisons. Let's assume we have a top field T and two bottom fields A and B. We need to determine which bottom field matches best with T. One approach is to create two frames TA and TB, run our per-pixel combing metric over both frames, accumulate those values over the entire frame, and then make a decision. This will work fine if the combing metric only triggers on real interlacing artifacts. Unfortunately, no metric is perfect, and they will all be susceptible to noise, high vertical frequencies (window blinds for example), etc... So if A and B are very similar except for a small area, think of a static background with a moving object, the difference in metric values from that small area can easily be buried under the accumulated metric values from the rest of the frame. tfm gets around this by first differencing A and B, and then only accumulating the metric values for TA and TB in the areas where A and B are different. To do this, tfm differences A and B using two thresholds, a high threshold and a low threshold (with the idea that the high threshold is less susceptible to noise), if the high threshold gives enough information it uses those values, if not, it uses the values from the low threshold. I'm not saying this is the best way to do it. If I had to rewrite tfm now I would do things a little differently -- probably weight the per-pixel metric values by the difference values (or average difference value from the surrounding local neighborhood) when accumulating instead of using thresholds -- but that is the general idea.

Unfortunately, doing this differencing means extra processing, and it means that to match 3 bottom fields to one top field requires evaluating 2 pairs (A vs B, then winner vs C) instead of just creating 3 frames and calculating the metrics for each. Thus, some amount of slow down is unavoidable. Also, I can't remember how much if any of the processing in tfm is simd optimized so it might be slower than it needs to be. The way I originally implemented it wasn't as simd friendly as it could be with some small changes IIRC.
tritical is offline   Reply With Quote
Old 21st December 2013, 23:04   #3  |  Link
ty2010
Script abuser
 
Join Date: Aug 2012
Location: FWI
Posts: 14
If time and space aren't concerns, I've made multiple passes for such things. I'd use telecide to get the bulk done then a second pass with smartdeinterlace or smartdeinterlace without reduction followed by telecide and/or decimate, sometimes it'll even work all in the same script. By far my most convoluted work was partially blended 29.97i > 25p. I frame doubled, two telecide passes, deinterlace and a final smartdecimate, the whole thing ran in a single script @40fps. The result left 2-3 individual blended fields per second which is all the source was good for.

Another thing, don't be afraid to crank down telecide's window to 10-15% of the picture, ignore chroma, etc., it can reduce the out of order but valid matches allowing decimate to make better selections because the frames are closer to their original order.
ty2010 is offline   Reply With Quote
Old 24th December 2013, 00:12   #4  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
tritical: Thanks for the insight. TFM definitely handles the aforementioned examples much better than telecide.

innocenat seems to be working on tivtc, maybe he finds the potential optimizations you speak of. A few questions for you though:
1. Do you have plans to work on avisynth plugins again?
2. Do you have an idea on what you would have done instead with tfm? Maybe it inspires someone else, if not you.

ty2010: Speed is kind of a concern that's why I'm either looking for decomb, which has the performance, to work well with most sources, or for tivtc, which has the ability to work with said sources, to gain some performance. The other ivtc filters I've tried (smartdecimate, fdecimate, it) all have the performance but lack the ability. Unfortunately no ivtc filters have been updated in years, except decomb earlier this year, to work with avisynth 2.6, which is why I thought it might be the best route, but no word from neuron2 yet.
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650
PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0
turbojet is offline   Reply With Quote
Old 27th December 2013, 23:02   #5  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,340
Quote:
Originally Posted by ty2010 View Post
By far my most convoluted work was partially blended 29.97i > 25p. I frame doubled, two telecide passes, deinterlace and a final smartdecimate, the whole thing ran in a single script @40fps. The result left 2-3 individual blended fields per second which is all the source was good for.
Have you tried SRestore? Might save you a some manual work next time.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:34.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.