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 Usage
Register FAQ Calendar Today's Posts Search

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 14th August 2010, 00:46   #21  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Didée View Post
Yeah, hard-loading a plugin in the script is not nice.
Fair point. I wanted to avoid requirements on the calling script, but I see that leads to other problems. Happy to get rid of that bit of ugly really.
I've put an updated version in the OP that doesn't explicitly load Yadif.

Last edited by -Vit-; 14th August 2010 at 01:00.
-Vit- is offline  
Old 17th August 2010, 20:00   #22  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Found a reproducible MT instability when using Super Fast and Ultra Fast presets, with mt_average throwing an exception. Couldn't say if the problem originated in mt_average or not because the particular setup was complex and unusual. However, replacing mt_average with merge remedied the situation. A quick test seems to show merge to be faster in any case. Updated version in the OP.

Last edited by -Vit-; 17th August 2010 at 20:04.
-Vit- is offline  
Old 20th August 2010, 09:46   #23  |  Link
Bi11
Architect
 
Bi11's Avatar
 
Join Date: May 2010
Posts: 57
Great work!

Just a few suggestions:
  • Supply sclip to eedi3 for more accurate interpolation.
    For example,
    Code:
    (EdiMode == "EEDI3")    ? ediInput.EEDI3(sclip=ediInput.NNEDI3(field=-2, nsize=NNSize, nns=NNeurons, qual=EdiQual), field=-2, mdis=EdiMaxD) : \
  • Super-sampled eedi3 after QTGMC removes most residual aliasing.
    For example,
    Code:
    QTGMC(EdiMode="eedi3", Blocksize=8, Overlap=4, Search=5, SearchParam=4).SelectEven()
    
    w=width h=height
    lanczosresize(w*2,h*2,taps=8).eedi3().lanczosresize(w,h,taps=8)
  • RestoreLossless is called with only some parameters in the script. Why not pass all parameters it expects?

  • IMHO the ShowSettings output could be more spaced apart, like
    Code:
    		addNoise.Subtitle( "tr0=" + string(tr0) + " | tr1=" + string(tr1) + " | tr2=" + string(tr2) + " | rep0=" + string(rep0) + " | rep1=" +  string(rep1) + \
    		" | rep2=" + string(rep2) + "\nEdiMode='" + EdiMode + "' | NNSize=" + string(NNSize) + " | NNeurons=" + string(NNeurons) + " | EdiQual=" + \
    		string(EdiQual) + " | EdiMaxD=" + string(EdiMaxD) + "\nSharpness=" + string(Sharpness, "%.2f") + " | SMode=" + string(SMode) + " | SLMode=" + \
    		string(SLMode) + " | SLRad=" + string(SLRad) + " | SOvs=" +  string(SOvs) + " | SVThin=" +  string(SVThin, "%.2f") + " | Sbb=" + string(Sbb) + \
    		"\nSrchClipPP=" + string(SrchClipPP) + " | SubPel=" + string(SubPel) + " | SubPelInterp=" + string(SubPelInterp) + " | BlockSize=" + string(BlockSize) + \
    		" | Overlap=" + string(Overlap) + "\nSearch=" + string(Search) + " | SearchParam=" + string(SearchParam) + " | PelSearch=" + string(PelSearch) + \
    		" | TrueMotion=" + string(TrueMotion) + "\nLambda=" + string(Lambda) + " | LSAD=" + string(LSAD) + " | PNew=" + string(PNew) + " | PLevel=" + string(PLevel) + \
    		" | GlobalMotion=" + string(GlobalMotion) + " | DCT=" + string(DCT) + "\nLossless=" + string(Lossless) + " | LosslessTR=" + string(LosslessTR) + \
    		" | LosslessEdi='" + LosslessEdi + "'\nNoiseBypass=" + string(NoiseBypass) + " | NoiseRemove=" + string(NoiseRemove, "%.2f") + " | NoiseRestore=" + \
    		string(NoiseRestore, "%.2f") + "\nNoiseDeint='" + NoiseDeint + "' | Sigma=" + string(Sigma, "%.2f") + " | BT=" + string(BT) + "\nBorder=" + \
    		string(Border) + " | Precise=" + string(Precise) + " | SafeMode=" + string(SafeMode) + "\nPreset='" + Preset + "' | Tuning='" + Tuning + "'", \
    		font="Lucida Console", size=11, lsp=12 )
Bi11 is offline  
Old 24th August 2010, 15:58   #24  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Bi11 View Post
Great work!
Just a few suggestions:
Thank you, and thanks for the feedback.

Quote:
Originally Posted by Bi11 View Post
Supply sclip to eedi3 for more accurate interpolation
The EdiExt parameter allows you to use any interpolator:
Code:
clip.QTGMC( Preset="Slow", EdiExt=clip.EEDI3(sclip=clip.NNEDI3(field=-2), field=-2) )
I work with naturalistic sources, so I almost exclusively use NNEDI2/3. So when it came to adding EEDI3, I just followed the style that TempGaussMC had used for EEDI2. I didn't think to use the new sclip parameter. The EdiMode strings are just shortcuts for the most common use cases. Bearing that in mind, do you think I should update EdiMode="EEDI3" to use "sclip" or add a new EdiMode="EEDI3x"...

____
Quote:
Originally Posted by Bi11 View Post
Super-sampled eedi3 after QTGMC removes most residual aliasing
I assume this is an observation rather than a suggestion?

____
Quote:
Originally Posted by Bi11 View Post
RestoreLossless is called with only some parameters in the script. Why not pass all parameters it expects?
The lossless code is a second simpler deinterlacing pass on the difference between the initial TGMC output and the source. As such it has some similar parameters to the main deinterlacing script. However, I'm not necessarily convinced that the same parameter values would be the most effective. I'm not unconvinced either, I just haven't had the time to test in detail.

The difference image is quite different in nature to the original source. It's largely gray (the origin, i.e. no difference, is at 128), with the edges made prominent (due to changes from the blur->resharpen tgmc process) and areas of noise (that removed by tgmc). One observation is that interpolator choice is slightly different here. NNEDI2 works OK, but even for naturalistic sources I found EEDI3 to work well, probably because of the prominence of edges in this difference image. Then again changes made to the lossless deinterlacing parameters are much less noticable than in the main script as it is working with small values.

I added the parameters to the lossless function out of good practice / coding habit. However, I don't think I want to add so many more parameters to the script itself as I'm reaching the limit. So if necessary I may add a boolean "LosslessDefaults" or similar, which determines whether to use the main deinterlacing parameters for the lossless step too, or whether to use the default lossless settings instead (as it does now). One reason to favor the defaults would be to speed up lossless scripts using high quality settings, which would be overkill if passed to the lossless step. Memory use is currently high when using lossless (especially MT), another reason to use simpler settings on that step.

____
Quote:
Originally Posted by Bi11 View Post
IMHO the ShowSettings output could be more spaced apart, like...
I like it, thanks. I will update to something like this in the next revision.

Last edited by -Vit-; 24th August 2010 at 16:01.
-Vit- is offline  
Old 25th August 2010, 14:07   #25  |  Link
Bi11
Architect
 
Bi11's Avatar
 
Join Date: May 2010
Posts: 57
Quote:
Originally Posted by -Vit- View Post
The EdiExt parameter allows you to use any interpolator
Yes, I've noticed.

Because my live sources are usually crappy quality, I usually use QTGMC like so:
Code:
edi=eedi3(sclip=nnedi3(field=-2,nsize=3,qual=2),field=-2,vcheck=3).raa()
QTGMC(ediext=edi,blocksize=8,overlap=4,search=5,searchparam=4).selecteven()

# Residual Anti-Aliasing
function RAA (clip input) {
w=input.width()
h=input.height()

input.spline64resize(w*2,h*2).eedi3(vcheck=3).spline64resize(w,h)
}
It's fairly aggressive at connecting straight lines, giving smooth lines and curves with little or no flickering.

I haven't tried eedi3/nnedi2, but from my observations eedi3/nnedi3 always gives more accurate interpolation and less artifacts than eedi3 alone when used for deinterlacing. So IMO sclip=nnedi3 should be the default.
I use vcheck=3 instead of the default vcheck=2 because it gives a bit less artifacts imo.

I use blocksize=8 and overlap=4 because from my observations it gives noticeably better quality than the defaults 16/8.
search=5 and searchparam=4 gives slightly more accurate motion vector search.

raa() is the super-sampled eedi3, which I use just after deinterlacing to smoothen any remaining jagged edges. raa() could be an optional feature, which could be included in some of the slower presets.

With regard to the lossless parameters, I understand now that higher quality settings may not be worthwhile. If anything, you could have a LosslessPreset option, which takes one of the preset values already defined, and uses the parameters it requires from that preset. But is there really a big difference in overall speed if lossless settings are the same as the preset settings, considering it's a difference clip that's being interpolated?

On a related note, I would like for a possible way to keep the EdiMode and LosslessEdi values in sync. Currently, if I specify LosslessEdi="nnedi3" then the script still tries to use nnedi2, which is not in my plugin directory.
One possible solution is to have LosslessEdi default to EdiMode, and a different LosslessEdi value can be explicitly specified if needed.
Bi11 is offline  
Old 26th August 2010, 12:20   #26  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
-Vit-!
Which version I could use wit SET 2.6 Avisynth mt_masktools-25.dll or mt_masktools-26.dll.
I get constantly crash.
yup.
yup is offline  
Old 26th August 2010, 15:01   #27  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
Can you add an int parameter "NNEDIthreads" to control the number of threads of nnedi2/3?
henryho_hk is offline  
Old 26th August 2010, 16:57   #28  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
I remove
Code:
 Lossless=1
and now work O'k both version masktools 2.5 and 2.6 with Set Avisynth 2.6 MT build.
yup.
yup is offline  
Old 19th September 2010, 08:52   #29  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
This script is insanely awesome. I'm so thoroughly impressed with the quality / speed ratio. Wow.
__________________
These are all my personal statements, not those of my employer :)
Blue_MiSfit is offline  
Old 23rd September 2010, 20:04   #30  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
In the defaults, I think Overlap is supposed to be Blocksize/2 and not bs/s.
ajp_anton is offline  
Old 23rd September 2010, 22:54   #31  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by ajp_anton View Post
In the defaults, I think Overlap is supposed to be Blocksize/2 and not bs/s.
Well spotted, thanks. If you provided an explicit blocksize but left the default overlap then it would mistakenly base the overlap on the default blocksize. I've upped a fixed version in the first post.
____

I've been a bit busy of late but I have noted the suggestions that people have been making. I will be upping a new version relatively soon - just need to find the time to test. I mainly want to update the use of EEDI3 / NNEDI3 (particularly now NNEDI3 is faster).

Last edited by -Vit-; 23rd September 2010 at 22:59.
-Vit- is offline  
Old 9th October 2010, 13:11   #32  |  Link
Hagbard23
23sKiDdOo!
 
Hagbard23's Avatar
 
Join Date: May 2010
Location: Germany
Posts: 182
Quote:
This script is insanely awesome. I'm so thoroughly impressed with the quality / speed ratio. Wow.
so true...

I've tried it with my old futurama PAL Discs. This Plugin is so f***ing good - it blasts me off the chair. OK Speed is no issue here... . I used it successfully with needi3 and preset "slower" and the result was perfect "placebo" pure progressive output.

Didee and ViT: Please keep up the good work - we strongly needed those two (tgmc / qtgmc) plugins.
Hagbard23 is offline  
Old 11th October 2010, 12:17   #33  |  Link
Hagbard23
23sKiDdOo!
 
Hagbard23's Avatar
 
Join Date: May 2010
Location: Germany
Posts: 182
Nah...after tweaking for hours i found a "bug" now...:

I can't run any filters (i've tried warpsharp & fft3dgpu) after QTGMC? ViT do you know anything about it?
Hagbard23 is offline  
Old 11th October 2010, 13:01   #34  |  Link
aegisofrime
Registered User
 
Join Date: Apr 2009
Posts: 478
Quote:
Originally Posted by Hagbard23 View Post
Nah...after tweaking for hours i found a "bug" now...:

I can't run any filters (i've tried warpsharp & fft3dgpu) after QTGMC? ViT do you know anything about it?
FFT3DGPU works fine here. You have to SetMTMode(5), but that's not specific to QTGMC since you have to do that in any multithreaded script.
aegisofrime is offline  
Old 11th October 2010, 13:12   #35  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,391
What's the actual problem? Does the additional filter simply have no effect, or does the script crash? If so, what's the error message?

__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline  
Old 11th October 2010, 13:20   #36  |  Link
Hagbard23
23sKiDdOo!
 
Hagbard23's Avatar
 
Join Date: May 2010
Location: Germany
Posts: 182
Quote:
dgsource("E:\blah\VTS_01_1c.dgi")
assumetff()
QTGMC(EdiMode="NNEDI3")
awarpsharp2()
FFT3dGPU()
crop(12,2,-10,-0)
spline36resize(720,544)
That was the script..

(meanwhile i returned to TGMCBeta2, (w. NNEDI2). This worked just fine.)

With that script Virtual Dub crashed with some AccessViolation Error - sometimes i got "AviSynth Failure - Unknown Exception" when i seeked around in the video...

@aegisofrime
Quote:
SetMTMode(5)
I worked without multithreading...

Last edited by Hagbard23; 12th October 2010 at 17:06.
Hagbard23 is offline  
Old 19th October 2010, 01:02   #37  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Hagbard23 View Post
I can't run any filters (i've tried warpsharp & fft3dgpu) after QTGMC? ViT do you know anything about it?
I've used many different filters both before and after QTGMC without problem. Both single and multi-threaded. Unfortunately, the error message isn't very specific. Do you get the same effect if you use "NNEDI2" in QTGMC? Do you get errors in anything other than VirtualDub?

Only thing that I can think of is memory use. The script shouldn't use more memory than tgmc-b2 when using the "Slower" preset, but I don't know about NNEDI3's memory usage - it's a long shot but maybe that just tipped things over the edge. Try adding a SetMemoryMax at the start of the script...
-Vit- is offline  
Old 19th October 2010, 10:49   #38  |  Link
Shon
Registered User
 
Join Date: Nov 2008
Posts: 10
-Vit-
What should I do to work only deinterlace, but the noise was not removed?
Shon is offline  
Old 20th October 2010, 13:18   #39  |  Link
-Vit-
Registered User
 
Join Date: Jul 2010
Posts: 448
Quote:
Originally Posted by Shon View Post
-Vit-
What should I do to work only deinterlace, but the noise was not removed?
I'm not sure I understand. Are you asking how to keep the noise from the source? Or how to remove it? Here are both solutions...

Keep noise:
Code:
QTGMC( Preset="Slower", NoiseBypass=1, NoiseRestore=1.0 ) # Mode 1: Remove noise before, add back after. Medium effect

#or

QTGMC( Preset="Slower", NoiseBypass=2, NoiseRestore=0.4 ) # Mode 2: Get noise at start but don't remove it, add back after
                                                          # Stronger effect. Increase NoiseRestore for an even stronger
                                                          # effect (>1 for a very strong effect)

#or

QTGMC( Preset="Slower", Lossless=1, LosslessTR=3 ) # Lossless modes also retain noise. Combine with noise bypass if you want
Remove noise:
Code:
QTGMC( Preset="Slower", NoiseBypass=1, NoiseRestore=0.0 )

#or 

QTGMC( Preset="Slower", Sigma=2.5, NoiseBypass=1, NoiseRestore=0.0 ) # Increase Sigma for noisier source (default is 2.0)

Last edited by -Vit-; 20th October 2010 at 13:23.
-Vit- is offline  
Old 22nd October 2010, 04:41   #40  |  Link
Shon
Registered User
 
Join Date: Nov 2008
Posts: 10
-Vit- I needed a first option. Thank you!
Shon is offline  
Closed Thread


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 06:15.


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