PDA

View Full Version : Help multithreading FastDegrain


Ranguvar
27th July 2008, 18:28
Hello,

I'm trying to find a fast, high quality degrain method. I don't need to remove a lot of grain, just most. I have a quad-core CPU (Q6600) and a fairly fast videocard (GeForce 9600GT 512MB).

My best speed compared to quality so far has been with FastDegrain. Since by default it uses MT(), which will lower quality because it splits frames spatially, I removed the lines that do that and am attempting to just use SetMTMode() to do it.

No matter what I do, I get errors... crashes, not AviSynth errors. So, it's definitely because of the multithreading.

LoadPlugin("C:\AVSplugins\MT.dll")
LoadPlugin("C:\AVSplugins\DGDecode.dll")
LoadPlugin("C:\AVSplugins\ColorMatrix.dll")
LoadPlugin("C:\AVSplugins\Decomb.dll")
LoadPlugin("C:\AVSplugins\mvtools.dll")
Import("C:\AVSplugins\FastDegrain.avsi")

SetMTMode(2, 0)
MPEG2Source("C:\OUTPOST\Vid.d2v", info=3)
ColorMatrix(hints=true, interlaced=true)
Telecide(guide=1, back=1)
Decimate()
FastDegrain(degrain=1, ov=2)
Crop(0, 58, -2, -64).BicubicResize(944, 400)

This seems to work in MPC-HC, but x264 crashes... I believe the error is usually in mvtools.dll. If I SetMTMode(3) before the FastDegrain, I just get runtime errors.

Thanks for any help... I don't care whether I end up using FastDegrain or not, like I said, I just want a fast, effective degrain method. So if anyone has alternatives that are tested to work well with SetMTMode, that's great too.

Thanks.

Fizick
27th July 2008, 22:26
everybody "just want a fast, effective degrain method...." :)

Ranguvar
27th July 2008, 22:50
everybody "just want a fast, effective degrain method...." :)
If a little detail gets killed, that's fine by me - I will be encoding this video in x264 to around 1,200kb/s anyways, and any detail that is degrained will most likely be removed by encoding anyways. And I don't need every last bit of grain gone either. In a nutshell, I'm looking either for a way to fully temporally multithread MVDegrain with one MVAnalyse motion vector. Or, if someone else has a better suggestion for a solution that's easier to multithread and will provide similar quality. :)

foxyshadis
28th July 2008, 01:16
Do you have the absolute latest mvtools from the mvtools thread? They're also posted as public betas on fizick's site, and include several multithreading fixes.

Ranguvar
28th July 2008, 01:56
Yes, public beta v1.9.5.7, SHA-1 hash starting with 882A.

Ranguvar
28th July 2008, 03:40
Problem solved! Or so it seems.

The problem was actually with either Telecide or Decimate. I'm now using TFM and TDecimate, and everything's working great with just a simple SetMTMode(2, 0). Faster, too.

Zach
28th July 2008, 04:24
I always refrain from asking this -- don't know why, maybe like it's an invasion of privacy or something :p -- but could you post your entire "fixed" script like you did in your OP?

I've had a dual-core processor for over a year now, and I have a feeling your script would help me "get into the game," so to speak. (Learning by example is a good starting point.)

If you prefer not to, then that's fine. :)

Ranguvar
28th July 2008, 05:01
Sure :) But I'm now using TemporalDegrain, as I've found I can get it up to about 3/5 the speed of FastDegrain with much better quality. Just ask if you want the FastDegrain version. If you need more speed, drop ov to 2 and/or degrain to 1. I modified TemoralDegrain very slightly - I replaced FFT3DFilter with FFT3DGPU, since I have a fast videocard. I think that's all I did.

LoadPlugin("C:\AVSplugins\MT.dll")
LoadPlugin("C:\AVSplugins\DGDecode.dll")
LoadPlugin("C:\AVSplugins\ColorMatrix.dll")
LoadPlugin("C:\AVSplugins\TIVTC.dll")
LoadPlugin("C:\AVSplugins\mvtools.dll")
LoadPlugin("C:\AVSplugins\mt_masktools-26.dll")
LoadPlugin("C:\AVSplugins\FFT3DGPU.dll")
LoadPlugin("C:\AVSplugins\RemoveGrainSSE2.dll")
LoadPlugin("C:\AVSplugins\RepairSSE2.dll")
LoadPlugin("C:\AVSplugins\HQDn3D.dll")
Import("C:\AVSplugins\TemporalDegrain.avsi")

SetMTMode(2, 0)
MPEG2Source("C:\OUTPOST\Vid.d2v", info=3)
ColorMatrix(hints=true, interlaced=true)
TFM(d2v="C:\OUTPOST\Vid.d2v", mode=0)
TDecimate()
TemporalDegrain(blksize=16, pel=1, ov=4)
Crop(0, 58, -2, -64).BicubicResize(864, 368)

Zach
28th July 2008, 07:05
First, thanks!

Second, that's all there is to it? :cool: Just call "SetMTMode" and the rest is all done under the hood? I always thought one had to make explicit calls like MT( "function1(parm1,...)", "function2(parm1,...)",...) and one had to manually state out what was to be done in parallel, be it separate functions or the same function but on separate frame blocks. :confused:

Too simple. :) Again, thanks!!