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

*.mp4 guy
23rd March 2011, 09:23
It seems that Yadif indeed is similar to HW deinterlacing. Or vice versa.

You might want to have a look at this little comparison (http://forum.doom9.org/showpost.php?p=1433847&postcount=2589).

Beware - this is the RED pill to take. :)

...I've never seen TGMC used to remove dotcrawl before, but clearly it works pretty well.

Didée
23rd March 2011, 11:26
Well, that's a side-effect of the temporal processing. (There often is a positive effect on dotcrawl, but it's not a specialised feature --> "YMMV").
The main point of that small comparison is instability & flickering of the actual detail.

Just yesterday I played with a DVB cap of a 50i TV show, and compared TGMC with HW-deinterlacing via DGDecNV. No need to mention that TGMC was stable and NV-Bobbing was flickering. But another point was the encoded filesizes:

x264 @ CRF 18:

TGMC-bob: ~5100 kbps
NV-bob: ~9500 kbps

That is, HW deinterlacing required almost double the bitrate to encode something with noticeable lower quality.

*.mp4 guy
23rd March 2011, 18:23
But another point was the encoded filesizes:

x264 @ CRF 18:

TGMC-bob: ~5100 kbps
NV-bob: ~9500 kbps

That is, HW deinterlacing required almost double the bitrate to encode something with noticeable lower quality.

Based on what it did to the dotcrawl, which can be quite expensive to encode and the massive boost to over-all temporal stability from TGMC, I would be much more surprised if there wasn't a large difference in file size.

A more apples to apples comparison might be denoising the other bobbers with mvtools and then checking their file sizes, though that isn't a very realistic usage scenario, pretty much everyone would just use TGMC in such a situation (or rather, they should). I suppose for speed purposes actual usage might look like hardwarebob->fft3dGPU, which is no longer directly analogous to TGMC qualitatively (almost purely spatial vs almost purely temporal processing, everyone knows how that ends).

Didée
23rd March 2011, 23:35
Well, it'll never be apples to apples. Because of the different technics, there will always be some flavour of peas and bananas.

For reviewing, a 15sec sample ...

x264 --crf 18 --tune filme

CUDA-bob, direct: 8530 kb/s +86%

CUDA-bob + MDegrain2: 6422 kb/s +40%

TGMC: 4585 kb/s [ref]

All three samples: clickme (http://www.mediafire.com/?f98alr9ojnp6lt5) (MediaFire, ~35 MB)

- Plain CUDA bob is not good at deinterlacing, forces very big bitrate, but at least it is fast.

- CUDA with MDegrain2 is same bad at deinterlacing, still requires much bitrate, and it is not fast anymore.

- TGMC is TGMC.

All in all, this is too much noise about something very simple: HW deinterlacing can be an option for live viewing, but for encoding it is not a good choice. (Well okay, maybe for "burst encodings" ... in any case it's beyond me how someone with functionable eyes could rate this as "good quality" ...)

*.mp4 guy
24th March 2011, 03:06
All in all, this is too much noise about something very simple: HW deinterlacing can be an option for live viewing, but for encoding it is not a good choice. (Well okay, maybe for "burst encodings" ... in any case it's beyond me how someone with functionable eyes could rate this as "good quality" ...)

I think I may have been unclear, my intention wasn't to indicate that your conclusions were wrong. TBH I have always completely agreed with your conclusions regarding hardware bobbers, I just felt there was a bit of sloppiness in demonstrating it, so I played a bit of devils advocate. No harm meant.

FlaShow
26th March 2011, 17:20
Hello,

I want to run this code:

AVISource("Kids_16.avi")

QTGMC(Preset="Slower",ChromaNoise=True,denoiser="dfttest",DenoiseMC=True)
dfttest()
deen("a3d",4,8,9)
aWarpSharp(depth=12,blurlevel=4,thresh=0.2,cm=1)
nnedi3_rpow2(2)
LanczosResize(1024,600)


But it said there is no function named "QTGMC". I have download the latest version of QTGMC plugin and all the requirements but not work.
What should i do ?!!

-Vit-
26th March 2011, 19:03
Make sure you have installed avisynth properly. You must put the QTGMC.avsi script in your Avisynth plugins folder.

I have added a zip of all the required plugins in the first post (http://forum.doom9.org/showthread.php?t=156028). It contains instructions where to put everything.

johnmeyer
26th March 2011, 19:52
You have to use the "import" statement to use the script:

Import("E:\Documents\My Videos\AVISynth Scripts\QTGMC3.11.avsi")

-Vit-
26th March 2011, 20:27
Using 'import' is an option that some might prefer. However, Avisynth will autoload any '.avsi' files in the plugins folder, which is often more convenient. Downside being that you get problems if you end up with multiple versions of the same plugin in the autoload folder.

Edit @FlaShow: those QTGMC settings will not do any noise processing. Please read the manual:
Important: You must use a non-zero value in one of EZDenoise, EZKeepGrain or NoiseProcess or no noise processing will occur

FlaShow
27th March 2011, 10:20
thanks guys but it did not work :(

Taurus
27th March 2011, 11:47
thanks guys but it did not work :(
What did not work?

Fizick
27th March 2011, 14:48
I have added a zip of all the required plugins in the first post (http://forum.doom9.org/showthread.php?t=156028). It contains instructions where to put everything.

You forget GPL license terms - do not distribute binaries without source codes.

pio_fawad
27th March 2011, 17:15
hi,
thanx 4 script can u please tell if i leave script as

QTGMC( Preset="Slow" )
SelectEven()

should this remove any artefacts or grain automatically, if source is normal and i want to compress it???

THanx please tell

Robert Martens
27th March 2011, 17:25
Nevermind this! Everyone reading this, please see the next few posts before bothering with the files I mention here.

Just a quick note, I see in the OP that you're offering an older release of RemoveGrain 1.0, with the SSE3 issues; there's actually a newer version available (binaries (http://home.arcor.de/kassandro/prerelease/RemoveGrain-1.0.rar) and source (http://home.arcor.de/kassandro/prerelease/RemoveGrain-src-1.0.rar)), as per the final post in this thread (http://videoprocessing.11.forumer.com/viewtopic.php?t=97) on kassandro's forum. Apparently it was a problem with the Intel compiler he had used at the time, but the bugs have been addressed with these 2007 releases.

I've been using the SSE3 libraries from those archives for some time now, and have had no problems beyond what one expects when trying to multithread (Q)TGMC.

-Vit-
27th March 2011, 17:29
Fizick: The plugin package only contains unmodified binaries, so I only need link-to / offer the original source. I'll add a text file to the zip.

Robert Martens: Thanks, I'll check that out. I knew about the SSE3 problems - the plugin package contains the SSE2 version. But this might make things simpler. Although I recall that there's very, very little SSE3 code in it in any case...

pio_fawad: I assume you are deinterlacing, and want to remove some grain and other artefacts at the same time? Well QTGMC with those settings will help, you could add "TR2=2" or "TR2=3" for more smoothing/degrain. Or "EZDenoise=X" to remove noise, where X is a value that depends on how noisy your source is (anywhere from 0.5 to 40). However, there are many other specialized plugins that might be more effective at the clean-up.

pio_fawad
27th March 2011, 17:41
hi,
thanx 4 script can u please tell if i leave script as



should this remove any artefacts or grain automatically, if source is normal and i want to compress it???

THanx please tell

please @Vit Answer waiting thanx

-Vit-
27th March 2011, 17:50
pio_fawad: I have already edited the post above

Didée
27th March 2011, 18:05
The situation with RemoveGrain package is tricky.

Basically, I agree that the "official" v1.0 version should be preferred over the older pre-v1.0 versions. But then, how it comes that e.g. a certain Mr. Didée is regularly recommending the old pre-v1 version?

- v1.0 final is only backwards-compatible with pre-v1 in regards to the spatial filters.

- v1.0 final is backwards-incompatible in regards to the temporal filters. Namely, clense().

In effect, when v1.0 is getting used, then 99% of all scripts/functions that are using clense will not work anymore.

Of course the older scripts can be adapted accordingly. But it'll be a long way to go, with dozens or hundreds of mini-scriptlets out there that people might pick up from here, there, or elsewhere.


And, the final showstopper:

RemoveGrain v1.0 final is not documented. There are substantial changes that cause backwards incompatibility, and there is no documentation how to use v1.0 correctly.

That's a problem.


Staying with the old version might be somewhat unsatisfactory, but the situation is so that it avoids lots of problems.
The other way round, there's actually not much to "gain" from switching to the v1.0.final version. People crying for the SSE3 filters simply are clueless. The potential speed gain is practically irrelevant.

Robert Martens
27th March 2011, 18:21
I must admit to being a bit confused with the various RemoveGrain packages; I was under the impression the only difference between the version Vit has been offering in the first post and the one I just linked to was that the newer release fixed a problem with SSE3 instructions.

I'm not terribly concerned about using said instruction set, and can easily imagine there's minimal performance gain, but if it's a choice between recommending and distributing a broken release and one that's been fixed, I thought the latter would be preferred.

Of course, as you explain, that's apparently not all that's changed from one version to the next.

If I could bug you to clarify something, however, what do you mean by "1.0 final"? The file I mentioned is listed as "1.0 prerelease" on the wiki (http://avisynth.org/mediawiki/Removegrain). Do you recommend using what that page labels "1.0b" instead? That is to say, Vit's got nothing to change in his recommendations and I will instead need to modify mine?

-Vit-
27th March 2011, 18:41
Robert: I thought you were referring to a version of RemoveGrain I hadn't seen (I haven't really explored Kassandro's forum), but this is one that I deliberately avoided using after reading Didée's points above in an earlier thread.

There are three versions:
- v0.9 is the only one to contain SSE3Tools, which I need for YUY2 support. But it doesn't contain some newer modes which QTGMC uses. So I link to that one in the OP but indicate to take only SSE3Tools
- v1.0b (beta) contains all the modes, has source code and documentation, but doesn't contain SSE3Tools. It also has an SSE3 bug, but no real SSE3 code. I link to that in the OP and indicate to take the SSE2 versions
- v1.0 (pre-release) contains the SSE3 fix, but also some other undocumented changes and no source code. I cannot recommend that one.

I have noticed that the html documentation needs to be updated on these points though.

Robert Martens
27th March 2011, 18:49
Beautiful, thanks for the rundown! I'll update myself accordingly.

-Vit-
27th March 2011, 19:07
The plugins package in the OP now adheres to the terms of the GNU GPL v2. Please advise of any issues with respect to that.

Fizick
28th March 2011, 17:33
"written offer" 2b) clause ? :confused:
-Vit-, do you really want to send CD with source codes?
Why not upload the (separate) full source code package?
http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html#UnchangedJustBinary

and please do not forget GPL inself (with binaries too).
http://www.gnu.org/licenses/old-licenses/gpl-2.0-faq.html#WhyMustIInclude

Boulder
28th March 2011, 18:55
Is using "noiseprocess=0", "tr2=0" and "smode=0" the way to minimize both the denoising and sharpening effect of QTGMC? I'm looking to output high quality smart bobbed video and then do the denoising and sharpening using different tools on the result.

-Vit-
28th March 2011, 19:47
Fizick: The final paragraph of clause 3 clearly sets out that there only needs to be equivalency of distribution channel between binary and source. So whilst a product distributed physically would require a physical source distribution, in this case I only need an offer of equivalent access, i.e. internet distribution. [The v3 FAQ alludes to this distinction (http://www.gnu.org/licenses/gpl-faq.html#DistributeWithSourceOnInternet) for v2 - note the reference to distribution on physical media]. Furthermore, as long as the OP has a link to the source code that is valid and synchronized then I am offering access to the dll and source from the same place, which essentially meets the stipulations of clause 3 anyway. The text in the zip is just for good measure. I have added the GPL text to the zip.

Boulder: I do this all the time. You want SourceMatch and EZKeepGrain for that. Something like this is near transparent. It will be slow:
QTGMC( "Slow", SourceMatch=2, Lossless=2, EZKeepGrain=0.4, Sharpness=0.1 )

Boulder
28th March 2011, 19:57
Thanks, I will try those settings out :)

hydra3333
28th March 2011, 23:39
Using MT 2.5.7 and x264.exe crashes randomly with this script (a tad disconcerting 6 hours into an encode)...
SetMTmode(mode=5,threads=4) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216
SetMemoryMax(384)
LoadPlugin("C:\SOFTWARE\DGindex\DGDecodeNV.dll")
LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Yadifmod.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\DePan.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AGC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Cnr2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dctfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\fft3dfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\degrainmedian.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Convolution3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\despot.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\WarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\aWarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mt_masktools-25-broke-backward-compatibility.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mvtools2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Unfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AddgrainC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\hqdn3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Colormatrix.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VerticalCleanerSSE3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dfttest.dll")
# -------------------------------------------------------------------------------------
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VariableBlur.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\FFTQuiver.dll")
# -------------------------------------------------------------------------------------
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveGrain.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveGrainSSE2.dll")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Repair.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RepairSSE2.dll")
#LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveDirt.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveDirtSSE2.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\LimitedSharpenFaster.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\Deblock_QED_MT2.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\QTGMC-3.31.avsi")
MPEG2Source("G:\HDTV\the-file.d2v",info=0,ipp=true,cpu=4)
AssumeTFF()
Assumefps(25)
changefps(last,last,true) # http://forum.doom9.org/showthread.php?p=1473445#post1473445
SetMTmode(mode=2,threads=4)
QTGMC(Preset="Fast",EdiThreads=2,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlace it later
Lanczos4resize(720,576)
# Re-Interlace and halve framerate
AssumeTFF() #choose the SAME field order like before deinterlacing
SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.
#
ColorMatrix(interlaced=true,mode="Rec.709->Rec.601")
AssumeTFF() #choose the SAME field order like before deinterlacing
AssumeFPS(25)
SetPlanarLegacyAlignment(True)
Distributor()
Remove the MT components and it works fine.
Suggestions appreciated.

Gavino
28th March 2011, 23:58
Remove the MT components and it works fine.
Suggestions appreciated.
Looks like you have the solution right there.
:) only half-joking

-Vit-
29th March 2011, 00:18
I could never get stability from 2.57MT. I have only heard a couple of reports from those who could. Try one of SEt's builds, 2.58MT or 2.6MT.

hydra3333
29th March 2011, 03:32
OK ... now I'm off to locate and research "SEt's builds, 2.58MT or 2.6MT" (for known bugs, limitations) ... I recall looking at them some months ago and thought they appeared too fragile then; hope things have improved.

edit: Seems to me like "choose your poison" as all versions crash ...

Not so good for 2.5.8 MT -
a) Where TGMC + SetMTmode(2,4~6) would crash occasionally in Avisynth 2.5.8.5.MT, it seems rock stable in Avisynth 2.6 (SEt's 09-19 build).
b) in Avisynth 2.5.8.5.MT, QTGMC + SetMTmode(2,4~6) crashes more often for me than TGMC does. Can't tell why, it just is like that.

Not so good for 2.6 MT either -
Well, I can now happily report that I have completely resolved my bizarre KERNELBASE and unknown exception crashes with Avisynth 2.6. It occurred to me to go back and check to make sure that there weren't any memory access issues since this is 32-bit softwares. I found Avisynth crashing with these errors after running up to 1.6GB of RAM used. At first I didn't get it because previously I had tested my script with SetMemoryMax and had gotten the same errors. But I thought I'd test again with a very low limit at 1.2GB and when I did it worked flawlessly, zero crashes. I tested different values and got it up as far as 1500MB without crashing. I took a look at the script with which I had previously tested SetMemoryMax (I kept a record of all the scripts I had been testing) and found that the lowest I had gone in setting the memory limit was 1600MB.

I find that YToUV() with YUY2 do not work for Set 2.6 build. VirtualDub try show half horizontal size frame and crash. This reason why do not work nnedi3_rpow2().
SEt's avisynth.dll 32 MT Build 2.6.0 2009 09 19 in sysWOW64 on a Win7U64.
CPU i7920XM, 8GB RAM, SetMemoryMax=1536
...
Renders 50 frames in VirtualDub 1.9.10, then raises unknown exception.
No matter if script uses SetMTMode or not. Lowering SetMemoryMax to 768 did not help.
...
The same script on same engine, same system
with straight avisynth.dll 2.5.8.5 non-MT in sysWOW64 :
Both MemoryMax values run properly.
VirtualDub uses ~600MB.

jpsdr
29th March 2011, 08:28
@hydra3333

Just out of curiosity, have you tried the 2.5.8MT you can find here (http://xhmikosr.1f0.de/index.php) ?
I'm interested on what could the results be. These versions are updated regularly, so, maybe they could have fixes and could be more stable.

-Vit-
29th March 2011, 08:50
That all versions of Avisynth crash is a given, the Avisynth multithreading code is buggy and could do with a rewrite. However, SEt did fix some bugs in his version, which makes them slightly less prone. However, each system is different in which version suits best. You cannot search for the answer to this dilemma, you must practically try each version and see which works best for you.

There are no code fixes in xhmikosr's builds, in fact I see no code changes over SEt's 2.58MT. The fact that it's a clean VS2010 build might help a little, so worth a try.

Boulder
29th March 2011, 09:42
It looks like Avisynth 2.6 with MT support is not going to be here anytime soon.. IanB has said that he's not going to go the SetMTMode way so that means that MT code will basically have to be written from scratch. And as Avisynth 2.6.0 hasn't seen an official alpha release in over a year and a half, things are probably not going to process too fast :( Too bad since MT-capable CPUs have become very common items.

-Vit-, did you ever notice any improvements regarding stability by using customized plugins you mentioned earlier in this thread (the correct header files)?

hydra3333
29th March 2011, 10:44
On another tack, I am attempting to do a "high quality" size reduction from PAL 1440x1088i "HDTV" to 720x576i to burn a DVD.

The capture is a fast-movement sports action clip. Here is a 3Mb sample from the HDTV capture. http://www.mediafire.com/?awxorf6fo8q3520

I must be doing something wrong. I'd thought QTGMC would give me a very high quality "smooth movement" double-framerate deinterlaced result without shimmers etc which I could re-interlace to preserve "fluidity" of fast movement.

However, the result with this script ... well, look at the "50m arc" white line it jaggies and shimmers.
http://imagengratis.org/images/clipboardre4qr.jpg

Maybe nothing can be done, it just "is" ? Suggestions appreciated.
SetMemoryMax(384)
LoadPlugin("C:\SOFTWARE\DGindex\DGDecode.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Yadifmod.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\DePan.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AGC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Cnr2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dctfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\fft3dfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\degrainmedian.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Convolution3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\despot.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\WarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\aWarpSharp.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mt_masktools-25-broke-backward-compatibility.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\mvtools2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Unfilter.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\AddgrainC.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\hqdn3d.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\Colormatrix.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\NNEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\EEDI3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VerticalCleanerSSE3.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\dfttest.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\VariableBlur.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\FFTQuiver.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveGrainSSE2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RepairSSE2.dll")
LoadPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins-zzz\RemoveDirtSSE2.dll")
Import("C:\Program Files (x86)\AviSynth 2.5\LimitedSharpenFaster.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\Deblock_QED_MT2.avs")
Import("C:\Program Files (x86)\AviSynth 2.5\QTGMC-3.31.avsi")
MPEG2Source("G:\HDTV\AFL\MP4\2\test.d2v",info=0,ipp=true,cpu=4)
#
QTGMC(Preset="Slow",EdiThreads=2,Sharpness=1.2,SLMode=1) # result is double framerate progressive, so re-interlate it later
Lanczos4resize(720,576)
AssumeTFF() #choose the SAME field order like before deinterlacing
SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.
ColorMatrix(interlaced=true,mode="Rec.709->Rec.601")
AssumeTFF() #choose the SAME field order like before deinterlacing
AssumeFPS(25)
SetPlanarLegacyAlignment(True)

Didée
29th March 2011, 11:05
Try SLmode=2 instead of SLmode=1.

Can't predict if that's the culprit here, but generally, the (spatial) limiting of SLmode=1|3 can cause shimmering on sharp/thin detail.

hydra3333
29th March 2011, 11:11
SLmode=2 yields almost identical result. I guess it must be a function of (re)interlacing. The larger-scale interlaced source appears to have very minor similar issues. The double-framerate progressive before re-interlacing looks very reasonable.

I do wish the PAL DVD spec included 576p50 :)

Didée
29th March 2011, 11:29
Ah, so you're talking about playback of the re-interlaced 576i stream.

You're probably missing the vertical lowpass. Are you watching this on a PC, or on a LCD TV set, or on an old-school tube TV?

Lanczos4resize(720,576)
AssumeTFF() #choose the SAME field order like before deinterlacing
Blur(0,1).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.

-Vit-
29th March 2011, 11:39
Boulder: I always use my own mods of all the plugins which include SEt's fixes and a nasty hack of my own. They do help, but I haven't had a chance to thoroughly test in order to release. As they have all been converted to VS2010/Intel builds so there is scope for problems - I already get enough support queries on QTGMC...

hydra3333: Just run the QTGMC line from your script and the result is clean and shimmer free. It's the rest of the script that is the problem - <snip> ah... already other answers coming in...

Didée
29th March 2011, 11:53
Yes, seems that hydra3333 is fighting the basic technical shortcomings of interlacing.

Have a B/W photo (mpeg source), color it up with a nifty colorizer (QTGMC), then print it out on a B/W laser printer (reinterlacing).

Hey, it's only grey! Why are the final colors bad again?

hydra3333
29th March 2011, 12:42
Ah, so you're talking about playback of the re-interlaced 576i stream.

You're probably missing the vertical lowpass. Are you watching this on a PC, or on a LCD TV set, or on an old-school tube TV?

Lanczos4resize(720,576)
AssumeTFF() #choose the SAME field order like before deinterlacing
Blur(0,1).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.

LCD TV and PC LCD. Appears on all. Yes it seems I do not understand the technical limitations of interlacing ... I had thought the issues would have been less visible. Blur(0,1) coming up.

edit: as an aside, the reduced-size 576p50 in a .mp4 from x264 looks very nice indeed from a WDTVlive on a 32"LCD TV... almost better than the original 1440x1080i ! No good for a DVD though :(

Boulder
29th March 2011, 15:49
Boulder: I always use my own mods of all the plugins which include SEt's fixes and a nasty hack of my own. They do help, but I haven't had a chance to thoroughly test in order to release. As they have all been converted to VS2010/Intel builds so there is scope for problems - I already get enough support queries on QTGMC...

Any chance you could release masktools-25.dll or -26.dll for testing? It seems that most of my crashes in VDub point to that dll.

Gavino
29th March 2011, 16:30
Lanczos4resize(720,576)
AssumeTFF() #choose the SAME field order like before deinterlacing
Blur(0,1).SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace.
Would there be any advantage (or disadvantage) in doing the Blur before the resize?

Given you have to vertically blur the results, is there in fact any point in using (Q)TGMC for deinterlacing just in order to do an re-interlaced downsize? Would an 'inferior' but faster deinterlacer give equally good results, or do you still gain something from the temporal processing of (Q)TGMC?

Any chance you could release masktools-25.dll or -26.dll for testing? It seems that most of my crashes in VDub point to that dll.
I suspect that is simply because most of the time in QTGMC is spent inside masktools, so that's usually where it is when it runs out of memory or gets a bad pointer from the Avisynth cache. However, it is important to use the right version (25 or 26) to match your Avisynth.

-Vit-
29th March 2011, 18:16
This is a modded MaskTools 2.0a46 for Avisynth 2.5x which might be more stable with multithreading:

VS2010 (http://www.mediafire.com/download.php?o1apu584422a3ka) | Intel C++ 2011 (http://www.mediafire.com/download.php?vp9xpjg8p0whsdi) | Source (http://www.mediafire.com/download.php?0zkh6ueityoqmsk)

I believe the VS2010 version is more stable (hard to tell really). It is a bit slower though. [each Visual Studio compiler since around VS2005 generates slower code than the one before - what's that about? Profile-guided optimization doesn't help...]

All plugins started from a clean build and had all known bug fixes added (SEt's). The nasty hack: I removed the exception caused when the plugin finds that the frame it was about to work on is already in use. Instead the thread sleeps for a while and tries again ... it tries several times until the frame is free... and if that fails it just processes the frame anyway. Very ugly, I know. I can give you no guarantees at all that this will help you. You will still get out of memory conditions if you run too many threads or overburden the Avisynth cache.

Boulder
29th March 2011, 18:26
Thanks, I'll test the file as soon as my next crash occurs. I've been trying to bob Queen Live at the Wembley for at least fifteen times this evening, and having a long video with lots of motion doesn't help at all..

hydra3333
30th March 2011, 12:43
1. Would there be any advantage (or disadvantage) in doing the Blur before the resize?

2. Given you have to vertically blur the results, is there in fact any point in using (Q)TGMC for deinterlacing just in order to do an re-interlaced downsize? Would an 'inferior' but faster deinterlacer give equally good results, or do you still gain something from the temporal processing of (Q)TGMC?
I'd be interested in knowing 'expert' the answers to these questions too. I suspect with 1, it might be a lot slower but I'm not sure of the gain.

Also interestingly, this much faster Brute-Force approach doesn't suffer from the QTGMC jaggies and looks "reasonable".
I really should compare the QTGMC-blur with this brute-force, side by side...
# BRUTE-FORCE PURE VERSION PER http://forum.doom9.org/showthread.php?p=1185790#post1185790
Global NewHeight=576
Global NewWidth=720
SeparateFields()
Shift = (GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0)
E = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0, Shift)
O = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -Shift)
Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0, 2*Shift)
Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift)
Interleave(E, O)
IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last
Weave()
AssumeTFF()
edit: Compared with stackhorizontal and frame-by-frame - the QTGMC-noblur looks nicest and sharpest in places with no motion however in places of motion with lines it is striking in how the jaggies stand out. The QTGMC-blur and Brute-Force appear almost identical to most intents and purposes (relatively clean 1440x1080i source). So... in this instance with this type of source with the intent of an interlaced size reduction from HDi to SDi, I can attain circa 20x the speed by abandoning QTGMC and going brute-force. Obvious I suppose, but as a dummy I'd thought "yeah, I want quality, just knock it about with QTGMC to get a great deinterlaced image for size-reduction and reinterlacing".

sadie
30th March 2011, 14:16
Just thought I'd pop in and let you know that after opening v. 3.31 for the first time I'm getting a 'script error: there is no function name "interleaved2planar" ' referencing line 351. Both in Vdub and avidemux. I'm still using DirectShowsource. Thanks

Fizick
30th March 2011, 15:32
I only have the dll and can't provide source code for the changes at the moment, but thankfully masktools is license-free.


You are not correct with GPL again.

See readme.txt in masktools-v2.0a48.zip :
The source code is released as gpl.
gpl.txt (v2) is included too.

-Vit-
30th March 2011, 16:17
sadie: You must have YUY2 input, which is why Interleaved2Planar is required. Looks like you are missing SSE3Tools. Look in the OP and either download the plugins package from the top of the post, or get the individual SSE3Tools plugin from the list further down.

hydra3333: "QTGMC jaggies", grrrr... The problem was with your original reinterlacing script. The second script you're using does a better job of downscaled reinterlacing. However, it assumes an interlaced source. If you want to start from a progressive source (e.g. including one that you've bobbed) just replace the "SeparateFields()" line with "SeparateFields().SelectEvery(4,0,3)"

I.e. If you want to deinterlace first (for some temporal processing perhaps?) then your second script starts thus:

QTGMC(...settings...) #Or whatever bobber
SeparateFields().SelectEvery(4,0,3)
# rest of that second script

Probably there's a simplification to be made to the remainder of the script in the progressive case, but it will do...

Fizick: :sigh: Done.
I did look, but missed it - that reference is tucked away, and omitted from many places where you would expect it (the source code doesn't mention it). That would affect enforceability for certain cases.

Fizick
30th March 2011, 17:40
-Vit-, I ask you to distribute plugins archives "as is", with source codes and documentation (it is useful for end user and contains copyright).

sadie
30th March 2011, 18:18
Thanks, Vit, but alright, now that's done I merely get a "mt-makediff: unsupported color space, masktools only supports planar YUV color spaces..." error. Evidently, YUY has finally crept in after all these years. Mediainfo though still tells me I've got an indeterminate 'YUV'. Oddly, the same error now occurs with my earlier project of several weeks ago that like all the projects I've done since the beginning of time were discreetly processing at YV12. We're still talking about a simple DV import by the way. It shouldn't be YUY AT ALL, should it? OK, since my last project I'd removed my older NLE for an upgrade of the same brand, and have also replaced an earlier version of ffdshow tryouts for the latest official ffdshow (in order to make a stab at their little makeavis.exe... which didn't work either of course). I think a new DV codec filter has slipped into MP Player classic as well. I know this problem is at the edge of this thread's topic but if someone has a generalist's intuition as to what might have entropied my configuration I'd be mighty appreciative.