Log in

View Full Version : QTGMC Deinterlacing Script (v3.32)


Pages : [1] 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41

-Vit-
5th August 2010, 03:47
QTGMC is a very high quality deinterlacer for YV12 or YUY2 input, originally developed from TempGaussMC_beta2. It has a range of new features for the highest quality output and a convenient presets system to select processing speed. As well as interlaced input, it can also process progressive material for removal of interlacing or other shimmering artefacts. Extensive instructions on how to use all the settings are provided with the script.

Main Downloads
Thanks to SubJunk for filehost-free mirrors!

QTGMC v3.32 + English Instructions (http://www.mediafire.com/?su7l5jtcobabksk) (mirror1 (http://hotfile.com/dl/152000213/d36acd9/QTGMC-3.32.zip.html) | mirror2 (http://www.spirton.com/uploads/QTGMC/QTGMC-3.32.zip))
Latest: v3.30:Speed-ups (http://forum.doom9.org/showthread.php?p=1485933#post1485933) for many presets and a bug-fix in MVTools. v3.31: A minor bug fix. v3.32: A couple more minor tweaks and fixes (http://forum.doom9.org/showthread.php?p=1498428#post1498428). Used Windows line breaks.

Plugins Package (http://hotfile.com/dl/151999753/8fc2003/QTGMC_32-bit_Plugins.zip.html) (mirror1 (http://www.mediafire.com/?nm188lh2oam487m) | mirror2 (http://www.spirton.com/uploads/QTGMC/QTGMC%2032-bit%20Plugins.zip))
All the required plugin files for the script - follow the instructions inside. Individual plugin / source code links below.

Modded Plugins Package (http://hotfile.com/dl/151999944/9f5eee1/QTGMC_32-bit_Plugins_Vit-Mod.zip.html) (mirror1 (http://www.mediafire.com/?mfs7bp2rprbhp22) | mirror2 (http://www.spirton.com/uploads/QTGMC/QTGMC%2032-bit%20Plugins%20%5BVit-Mod%5D.zip))
Same as above, but these plugins contain threading fixes (http://forum.doom9.org/showpost.php?p=1503034&postcount=691) that can improve stability under MT.

There is also a new plugin pack using the updated Avisynth 2.6 interface (http://forum.doom9.org/showpost.php?p=1568142&postcount=1126) available for testing.

Plugin Notes
For YUY2 input you must use mt_masktools-25.dll. Although not strictly 'correct' mt_masktools-25.dll can be used with SEt's Avisynth 2.6MT for mulithreaded usage.
If you get this error: "There is no function named RemoveGrain" then replace your RemoveGrainSSE2.dll with the version in this zip file (http://home.arcor.de/kassandro/prerelease/RemoveGrain-1.0.rar)
If you use EEDI3 you may need the Visual C++ 2010 Redistributable (http://www.microsoft.com/download/en/details.aspx?id=5555)


Other Downloads

Spanish instructions (v3.32) (http://www.mediafire.com/?1h1r5tf2t9t8rq1) (mirror (http://www.spirton.com/uploads/QTGMC/QTGMC-3.32-Spanish.rar))
Thanks Overdrive80!

Presets Detail (v3.32): Compared to "Faster" (https://spreadsheets.google.com/spreadsheet/ccc?key=0AsftVT5A1FqQdHRKTUdlUXVUaDlxUE43c0NsQ3dFR3c) | Compared to "Medium" (https://spreadsheets.google.com/spreadsheet/ccc?key=0AsftVT5A1FqQdGJ5Rlo3TlJqXzR1Vm1xRV9XMkhNWXc) | Noise Presets (https://spreadsheets.google.com/spreadsheet/ccc?key=0AsftVT5A1FqQdHRnNWhESU92VExfcUpUTnNvUlRXc2c)
Thanks nhope!

Previous Version of QTGMC (v3.25) (http://www.mediafire.com/download.php?1td5o1y2wh4jbch)

________

Basic Usage

Install AviSynth and copy the plugins from the plugin package to the correct locations. Then to use QTGMC, write a script like this:

YourSource("yourfile") # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires
QTGMC( Preset="Slow" )
SelectEven() # Add this line to keep original frame rate, leave it out for smoother doubled frame rate

Save this script with an ".avs" extension. You can now use it as an AVI source for encoding.

The "Preset" used selects sensible settings for a given encoding speed. Choose a preset from:
"Placebo", "Very Slow", "Slower", "Slow", "Medium", "Fast", "Faster", "Very Fast", "Super Fast", "Ultra Fast" & "Draft"
The default preset is "Slower", which is very close to the TempGaussMC_beta2 defaults

Don't be obsessed with running at the slowest possible settings. HD content especially doesn't need that precision and it will be very slow. More modest settings will give good speed and you may not even be able to tell the quality difference.

There are many settings to tweak the behavior of the script, full details are provided in the documentation that comes with the script. For example, to speed up processing and reduce sharpness a little:
QTGMC( Preset="Very Fast", Sharpness=0.75 )

________

Multi-Threaded Usage

QTGMC is very demanding on your system so for best performance try using it multi-threaded:
- Download SEt's latest 2.6MT (http://forum.doom9.org/showthread.php?t=148782) version of avisynth. Do not use other MT versions as they have bugs.
- Copy the avisynth.dll from SEt's package over the one that is already in your SysWOW64 / System32 folder.
- You must also download either the modded plugin pack or the updated-interface plugin pack from the top of this post (*carefully* follow the instructions inside).

You need to tweak multi-threaded scripts to suit your system. Here is a basic template - read and follow the comments carefully and provide the values noted (you cannot use this code just as it is):

SetMemoryMax(M) # Optional line. See below for value M
SetMTMode(3, X) # See below for value X, could try 5 instead of 3 for non-standard source-filter/avisynth combinations
YourSource("yourfile") # DGDecode_mpeg2source, FFVideoSource, AviSource, whatever your source requires
SetMTMode(2)
QTGMC( Preset="Slow", EdiThreads=Y ) # Choose preset based on overall speed/quality you want. See below for value Y
Distributor() # This line may or may not be necessary, try removing it and see if you get more speed

Setting X
- Start at the number of logical cores in your machine (note: with HyperThreading enabled, logical cores = 2x physical cores)
- If it crashes, decrease 1 at a time
- Otherwise increase 1 at a time until CPU usage just reaches 100%, don't go too far or it will slow down.
- On very slow settings you may not be able to reach 100% CPU before running out of memory and getting crashes. You can get round this by splitting your video and running several simultaneous encoding processes each with several threads, you're on your own with that though...

Setting Y
- Start with 1 for stability. In some cases increasing this value can give some speed up - try increasing it gradually. However, this setting has much less effect than X.

Setting M
- Running out of memory is the main problem with multithreaded avisynth so this line is important, especially for HD processing.
- For SD try leaving the line out first as it might just work.
- Then try using the SetMemoryMax line with values of M from 400-1200 or so. The default value is usually 512, so start around 700-900 and experiment from there.
- Don't just set the largest value because you're actually setting a memory balance (between avisynth cache and filter requirements)
- You can use *much* larger values (up to 2000 or more) if your encoding application is "Large Address Aware". So you are strongly advised to try the next step along with larger values of M
- Download this tool (http://www.techpowerup.com/forums/showthread.php?t=112556) to check/set your encoding application as "Large Address Aware". You must point the tool at the exe file of your encoder, e.g. vdub.exe. Be careful since some encoding GUIs call out to other exe files for the actual encoding, for example MeGUI uses x264.exe or ffmpeg.exe from inside its "tools" folder. Some common examples: VirtualDub (vdub.exe) is not large address aware, "ffmpeg.exe" is often not large address aware, "x264.exe" is already large address aware.
- With a large address aware encoder, I often set M in the 1200-1600 range.
- Finally, you can reduce the memory needs of the encode by running 2 passes: in the first pass use QTGMC to encode to a temporary lossless file (I suggest huffyuv), then in the second pass encode your lossless file to your final format (e.g. h264). The temporary file will be huge, 100-200GB per hour for 1080p.

Notes
QTGMC is fine with SetMTMode(...), but the older MT(...) function will cause visual problems so don't use that.
Multi-threading crashes can be frustrating - they're usually due to memory problems (each thread uses more memory). However, most people can find a repeatedly stable memory balance for their system, and then the speed increases can be considerable. So tweak carefully starting with moderate settings.

Speed Guidance
On my i7 930@3.7Ghz I get from 24fps to 210+fps at 720x480 YV12 across the presets ("Placebo" to "Ultra Fast") using tweaked multi-threaded scripts as described below. It's about 7 times slower at 1920x1080. Obviously adding source-match, noise-bypass, motion-blur or other extras will make things slower. If you get poor speeds by comparison then check the instructions above, try tweaking the values. Make sure you're using correct plugins, try a different source filter, or a different encoding GUI. Don't use overkill settings. Upgrade your system.

________

Full Plugin List

This is a full list of all the plugins use by QTGMC. For convenience, you can get all of these in the Plugin Package at the top of this post. The source code for several of the plugins can be found in these links.

Core plugins
- MVTools2 (http://avisynth.org.ru/mvtools/mvtools2.html#download) (2.5.11.2 or above)
- MaskTools v2 (http://forum.doom9.org/showthread.php?p=701539#post701539) (recommend 2.0a48 or above)
- NNEDI3 (http://web.missouri.edu/~kes25c/) (recommend 0.9.4 or above for speed)
- RemoveGrain + Repair (http://home.arcor.de/kassandro/RemoveGrain/RemoveGrain.rar) (extract only the SSE2 versions, some SSE3 versions have a bug and give no real benefit)
- SSE2Tools (http://home.pages.at/kassandro/RemoveGrain/RemoveGrain.zip) for YUY2 support (take only SSE2Tools.dll from this zip - do not take the SSE3 version nor the RemoveGrain or Repair dlls)

Additional plugins depending on settings
- [NNEDI2, NNEDI, EEDI3, EEDI2, TDeInt] (http://web.missouri.edu/~kes25c/) - if selected directly or via a source-match preset
- Yadif (http://avisynth.org.ru/yadif/yadif.html) - for Preset="Ultra Fast" or if selected directly (this plugin cannot be autoloaded, it must be loaded in the calling script)
- VerticalCleaner (http://home.arcor.de/kassandro/prerelease/VerticalCleaner.rar) - for SVThin or lossless modes
- AddGrainC (http://ldesoras.free.fr/src/AddGrainC-1.5.1.7z) (or here (http://www.megaupload.com/?d=9ZWS9HDF)) - for Preset="Placebo" or NoiseDeint="Generate" selected for noise processing
- FFT3DFilter (http://avisynth.org.ru/fft3dfilter/fft3dfilter.html) - if selected for noise processing
- dfttest (http://web.missouri.edu/~kes25c) - if selected for noise processing
** For FFT3DFilter and ddftest you also need the FFTW3 library (main page (http://www.fftw.org/) / windows zips (http://www.fftw.org/install/windows.html)). On Windows the file needed for both is libfftw3f-3.dll. However for FFT3DFilter, it needs to be called FFTW3.dll, so you will need two copies and rename one. On Windows put the files in your System32 or SysWow64 folder (which depends on your OS and the version of AviSynth that you're running)

________

Notes

Comparison with TGMC
The default behaviour of QTGMC is almost identical to TempGaussMC_beta2 with particular settings. All the important defaults are effectively identical (including sharpness). However, some lesser settings have different defaults and some settings operate a little differently. There is a dedicated section on the comparison with TGMCb2 in the instructions.

Finally
Thanks go to Didée for the script from where this began, and to all the plugin scripters/coders involved too...

-Vit-

[The link at the top of the post will work if the attachment below is pending]

Tommy B.
5th August 2010, 06:18
Outstanding!

Thank you very much!

Revgen
5th August 2010, 06:28
Thank You.

bizz & buzz
6th August 2010, 05:26
Impressive, thank you very much for that :)

poisondeathray
6th August 2010, 05:31
Thanks , nice first post ! :D

Blue_MiSfit
6th August 2010, 07:23
Srsly, well done :)

I'd imagine this was done with some help from Didee?

Didée
6th August 2010, 09:59
No, I wasn't involved in any way. I'm as surprised as everyone else. :)

Some comments to come, but first I need to find time.

Terranigma
6th August 2010, 16:38
It provides all the same functionality

-Vit-

I haven't downloaded this script yet, but I was curious if anyone knew if this works with Non-MT avisynth versions.

-Vit-
6th August 2010, 17:29
I haven't downloaded this script yet, but I was curious if anyone knew if this works with Non-MT avisynth versions.
Yes, I've used it non-MT with 2.57 and 2.58 straight from the avisynth wiki page.

Terranigma
6th August 2010, 17:37
Yes, I've used it non-MT with 2.57 and 2.58 straight from the avisynth wiki page.
OK ok, that clears that up. I'll check it out in a bit. :)

Undead Sega
8th August 2010, 04:46
I'm interested to what you said about using TGMC as a stabilizer???

nibus
8th August 2010, 11:17
so awesome, thank you!

-Vit-
8th August 2010, 11:38
I'm interested to what you said about using TGMC as a stabilizer???
I don't mean as a deshaker of course. I use the word stable throughout the script comments to mean an output without shimmer or flicker. I've updated the OP for clarity...

GDAce
9th August 2010, 13:36
http://lookpic.com/d2/i2/2971/oeasbfFj.png

i get this error when use this QTGMC( Preset="Very Fast", Sharpness=0.75 )...i have all filters in place

Didée
9th August 2010, 14:29
You're probably using a too outdated version of MVTools2. Update to a recent version (http://avisynth.org.ru/mvtools/mvtools2.html#download).

(The changelog isn't quite clear about the introduction/functionality of "big" blocksizes. But at least v2.5.8 - almost one year old - already did support 32x32. Most recent is v2.5.10.1.)

-Vit-
9th August 2010, 15:20
i get this error when use this QTGMC( Preset="Very Fast", Sharpness=0.75 )...i have all filters in place

Yes, you need a more recent MVTools2 ("http://avisynth.org.ru/mvtools/mvtools2.html#download). You also need up to date NNEDI3 and EEDI3 (if you use them) as their parameters changed recently. Best to get the latest versions of all plugins because although it's had a few versions, the script is only six weeks old. I've clarified the requirements in the OP...

The larger blocksizes have been used since the beginning as a speed/quality tradeoff.

GDAce
10th August 2010, 06:31
i had mvtools2 latest version in plugins folder...but i had to rename mvtools2.dll to mvtools.dll. it wud be nice if this can use mvtools2.dll as it is(a noob opinion).

-Vit-
10th August 2010, 11:31
i had mvtools2 latest version in plugins folder...but i had to rename mvtools2.dll to mvtools.dll. it wud be nice if this can use mvtools2.dll as it is(a noob opinion).
The filename of the DLLs used is not important to any script. I can rename mvtools2.dll to xxyyzz.dll and everything will still work fine because AviSynth looks "inside" the DLLs to find their content.

Problems occur when your DLLs are not in the correct plugins folder or, more subtly, when you have multiple DLLs with the same content. E.g. If you had an old MVTools2 called mvtools.dll and a new one called mvtools2.dll - that could cause problems when AviSynth comes to load the plugin, but you might not notice until a script used a new MVTools2 feature.

So I imagine there was something else you changed that made things work. Perhaps you removed a previous mvtools.dll to do the rename? Or moved some DLLs between folders? In any case, this script does nothing unusual in its use of MVTools2.

txporter
13th August 2010, 18:23
Haven't had a chance to try out your script yet, but have browsed through it looking at your comments. I see a note about updating the yadif path in order to use some of the faster presets. Is it possible to define a path in the script but also call add a standard loadcplugin call within an avs script? The reason that I ask is that I do some encoding with 32-bit avisynth and some with 64-bit avisynth, so I need to make calls to both plugin directories (plugins and plugins64). Or maybe define pathway for both 32-bit and 64-bit avisynth?

Didée
13th August 2010, 22:02
Yeah, hard-loading a plugin in the script is not nice. For what reason? Because it's a LoadCPlugin/stdcall_plugin? Cmon. Yadif is used a lot, people supposely know how to load it. Kick that out, put Yadif in the list of "required plugins", and good. Buisness as usual.

-Vit-
14th August 2010, 00:46
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.

-Vit-
17th August 2010, 20:00
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.

Bi11
20th August 2010, 09:46
Great work! :goodpost:

Just a few suggestions:


Supply sclip to eedi3 for more accurate interpolation.
For example,
(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,
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
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 )

-Vit-
24th August 2010, 15:58
Great work!
Just a few suggestions:

Thank you, and thanks for the feedback.


Supply sclip to eedi3 for more accurate interpolation

The EdiExt parameter allows you to use any interpolator:
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"...

____

Super-sampled eedi3 after QTGMC removes most residual aliasing

I assume this is an observation rather than a suggestion?

____

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.

____

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.

Bi11
25th August 2010, 14:07
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:
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.

yup
26th August 2010, 12:20
-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.

henryho_hk
26th August 2010, 15:01
Can you add an int parameter "NNEDIthreads" to control the number of threads of nnedi2/3?

yup
26th August 2010, 16:57
I remove
Lossless=1
and now work O'k both version masktools 2.5 and 2.6 with Set Avisynth 2.6 MT build.
yup.

Blue_MiSfit
19th September 2010, 08:52
This script is insanely awesome. I'm so thoroughly impressed with the quality / speed ratio. Wow.

ajp_anton
23rd September 2010, 20:04
In the defaults, I think Overlap is supposed to be Blocksize/2 and not bs/s.

-Vit-
23rd September 2010, 22:54
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).

Hagbard23
9th October 2010, 13:11
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
11th October 2010, 12:17
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? :confused:

aegisofrime
11th October 2010, 13:01
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? :confused:

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.

Didée
11th October 2010, 13:12
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?

:script:

Hagbard23
11th October 2010, 13:20
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
SetMTMode(5)
I worked without multithreading... ;)

-Vit-
19th October 2010, 01:02
I can't run any filters (i've tried warpsharp & fft3dgpu) after QTGMC? ViT do you know anything about it? :confused:
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...

Shon
19th October 2010, 10:49
-Vit-
What should I do to work only deinterlace, but the noise was not removed?

-Vit-
20th October 2010, 13:18
-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:

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:

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)

Shon
22nd October 2010, 04:41
-Vit- I needed a first option. Thank you!

-Vit-
22nd October 2010, 18:10
-Vit- I needed a first option. Thank you!
You're welcome.

BTW, for the best quality noise use the NoiseDeint="Generate" option, for example:
QTGMC( Preset="Slower", NoiseBypass=2, NoiseRestore=0.4, NoiseDeint="Generate" )

This option improves how the noise itself is "deinterlaced". It's only a small improvement, but it might be helpful for you.

-Vit-
26th October 2010, 03:43
I've uploaded a new QTGMC version 2.51 in the first post (http://forum.doom9.org/showthread.php?t=156028)

There are a number of changes:

The default interpolator for almost all presets is now NNEDI3 rather than NNEDI2, so make sure you have it. This improves the quality and speed of most presets, provided you use version 0.9.2 or above of NNEDI3 (http://web.missouri.edu/~kes25c/).
To accommodate this change many presets have had their settings tweaked. Two presets are particularly different:
The "Super Fast" preset now uses NNEDI3 with the fastest possible settings rather than a Yadif variant as before. This improves quality considerably, but it's a tiny bit slower than before
The "Ultra Fast" preset also gives higher quality output. Before it wasn't using any repair mode, which created much motion blur. Now it uses tr2=3. However, this means a ~6% loss in speed. Set tr2=0 for the old faster behavior
There's a new setting "EdiThreads", which allows you to specify how many threads EEDI3 and NNEDI2/3 will use. By default they will use one thread for each (logical) processor in your system. You may get better speeds on some scripts with more or less threads (experiment). Using less threads will also use less memory, which may help some complex/HD scripts, especially when also using MT or SetMTMode. Example:
QTGMC( Preset="Very Slow", EdiThreads=6 )
EdiMode can be set to "EEDI3+NNEDI3", which will use EEDI3 with its sclip parameter created with NNEDI3 - this should give a slightly improved EEDI3 result (but slower). This uses more memory - so be careful not to use too many threads if you're multithreading (EdiThreads or MT). E.g.
QTGMC( Preset="Slower", EdiMode="EEDI3+NNEDI3" )
Another new setting is "LosslessPreset". This is only used in lossless mode to drive the second lossless pass - it works exactly like the Preset setting except the default is "Fast". The quality difference between the lossless presets is minor so you can move towards faster settings here. Note: the LosslessEdi setting overrides the LosslessPreset edi mode setting.
QTGMC( Preset="Very Slow", Lossless=1, LosslessPreset="Faster" )
The output from ShowSettings has been made clearer and a minor bug fixed in that code
Fixed a serious bug when using lossless modes on the higher speed presets
I've tweaked the loading of Yadif again. The default behaviour hasn't changed - the calling script is required to load "Yadif" as normal if using settings that require it. However, now there is a global variable "YadifPath". It's initially empty, but if it is set to point to yadif.dll then it will be "autoloaded"


Thanks to Bi11 and henryho_hk for the suggestions that prompted some of these changes.

dansrfe
26th October 2010, 04:32
I love this function. Thanks for the update -Vit-. Brilliant script and of course kudos to Didée for coming up with TGMC in order for all this to happen! :D

dansrfe
26th October 2010, 04:38
Mediafire link to QTGMC v2.51: http://www.mediafire.com/?qxqp5q9dq2f5iqb

-Vit-
26th October 2010, 11:44
Mediafire link to QTGMC v2.51: http://www.mediafire.com/?qxqp5q9dq2f5iqb
Thanks for the mirror, the link in the OP is now direct to the zip file attachment. I just put it on a filehost temporarily whilst waiting for the attachment to be approved.

Boulotaur2024
26th October 2010, 11:50
Great "wrapper" I've been using it on almost all my projects lately. It's funny because the last changes you brought correspond more or less to what I was doing manually by using the ad-hoc parameters. I still think that maybe the default sharpening settings are a bit high but that may be just me since I usually resize x2 the QTGMC ouput which needs not to be "too sharp".

Thank you again for this function, very well documented too.

dansrfe
27th October 2010, 01:27
How can I use QTGMC to bob & interpolate at decent speeds on an i7 using 2.6 MT?

-Vit-
27th October 2010, 19:18
How can I use QTGMC to bob & interpolate at decent speeds on an i7 using 2.6 MT?
Use a script like this:

SetMTMode(5,8) # 8 threads for this script (the default for most i7s)
# Insert your source command here
SetMTMode(2)
QTGMC( Preset="Slow", EdiThreads=8 ) # 8 threads for NNEDI3 (the default for most i7s)
Distributor()


Change the QTGMC preset as necessary. Also tweak your encoder for the speed you require (e.g. x264 preset).

You can try increasing / decreasing the two threads values for best speed. I find having slightly fewer EdiThreads is best for my machine.

If it's a HD source then you can easily run out of memory with so many threads on a 32-bit system. So go 64-bit (I believe all the appropriate plugins exist now), or reduce the threads considerably and use a SetMemoryMax(xxx) at the start (experiment for best xxx value). Also encode in multiple passes, 1st pass QTGMC to lossless, 2nd pass lossless to x264 or whatever. MeGui pre-render job does exactly that. Will need lots of disk space for the lossless step. QTGMC is very forgiving with HD and you can get away with the quickest presets if you wish.

OC that i7 if you haven't already

dansrfe
27th October 2010, 19:31
Is encoding to lagarith and then sending that to x264 going to work the same way as well?

-Vit-
27th October 2010, 20:04
Is encoding to lagarith and then sending that to x264 going to work the same way as well?
I haven't used lagarith, but it's the same principle. Isn't encoding to huffyuv faster though? I know huffyuv will create larger files, but if you're going to encode to x264 afterwards then it doesn't really matter does it?