Log in

View Full Version : is there a gpu deinterlacer for an AVI ?


hydra3333
4th December 2011, 09:39
Deinterlacing is great as a precursor for denoising and motion stabilising, re-interlacing gives back "motion fluidity".

Neuron2's NV plugin software uses an nvidia GPU to deliver double-framerate deinterlaced material from .mpgs ... nvidia deinterlacing whichever method it has.

I have long DV camcorder captures - PAL 720x576 16:9 DV type 2 BFF .avi, which I need to delinterlace / motion-stabilize / clean / hdragc / sharpen / reinterlace as input to HC for encoding to DVD.

QTGMC deinterlaces wonderfully with denoising and sharpening, however even with setmtmode(2) I get encodes only at 1.3 fps with QTGMC-delinterlace (preset=Slow) / hdragc / reinterlace (ie even without motion stabilize) :(

PC is Q9450-quad, 8Gb mem, 2x7200-sata2-disks, win7-64 home, nvidia 8800GT.

I naively assume GPU deinterlacing will be a lot quicker (if lesser quality) hence the overall task will be quicker.

So is there a way to do GPU double-framerate deinterlacing ?
(in-GPU denoising "at-the-same-time" would also be handy)

Current script:
SetMTmode(mode=5,threads=4) # start with mode=5 forAVIsource http://forum.doom9.org/showthread.php?p=1067216#post1067216
SetMemoryMax(512)
AviSource("G:\DV\nodeshake\capt.11-12-04_12-04.00.avi", audio=false)
AssumeFPS(25)
AssumeBFF()
SetMTmode(mode=2,threads=4) # mode=2 for temporal multi-threading (interleaved frames)
QTGMC( Preset="Slow", EZDenoise=3, NoisePreset="Slow", Sharpness=1.2, SLMode=1) #double framerate output
#blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
#overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
#dct=0 # use dct=1 for clip with light flicker
#super0 = MSuper(pel=2,chroma=true,sharp=2)
#vect0 = MAnalyse(super0,isb=false, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
### DEPANESTIMATE is the OLD superseded call !!!
#globalmotion = MDepan(vect0, pixaspect=1.094, thSCD1=400, zoom=true, rot=true, range=2) #1.094 for standard PAL
#DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, mirror=15, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
#DepanStabilize(data=globalmotion, rotmax=5, cutoff=0.5, prev=3, next=3, pixaspect=1.094, dxmax=20, dymax=20, method=1) # lower vibration frequency cutoff
########
#--progressive-only MSUPER/MDegrain2 for use with SetMTMode(2)
#blksize=8 # 4, 8 or 16 ( default is 8 ). Larger blocks are less sensitive to noise, are faster, but also less accurate.
#overlap=4 # overlap value (0 to 4 for blksize=8) Must be even and less than block size
#dct=0 # use dct=1 for clip with light flicker
#super = MSuper(pel=2,chroma=true,sharp=2)
#backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=blksize, overlap=overlap, dct=dct, chroma=true)
#MDegrain2(super, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400,plane=4)
# HDRAGC *can't* be used inside MT or AGC will be calculated differently in each slice
SetMTmode(mode=5,threads=4) # # mode=5 for safety including using MT
HDRAGC(coef_gain=0.3, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0) # default. +coef_gain=brighter decrease to limit. +coef_sat=more saturation
SetMTmode(mode=2,threads=4) # mode=2 for temporal multi-threading (interleaved frames)
########
#LimitedSharpenFaster(smode=4,strength=100)
########
AssumeBFF()
SeparateFields().SelectEvery(4,0,3).Weave() #reinterlace progressive into BFF
AssumeBFF()
Converttoyv12()
SetPlanarLegacyAlignment(True)
# Distributor() should only be used when loading the script into applications which talk to avisynth directly
# e.g. HC and MeGUI. If the program opens the .avs file as an avi file (like virtualdub/mod, x264, xvid_encraw etc.)
# then you don't need (and shouldn't have) the distributor call at the end.
# http://forum.doom9.org/showthread.php?p=1136518#post1136518
##### "HC uses custom avisynth routines, you have to add Distributor() to the end of the script."
Distributor() # use this when using HC and SetMTmode, per http://forum.doom9.org/showthread.php?p=1063622#post1063622

-Vit-
4th December 2011, 16:27
Dunno about GPU deinterlacing, but you can speed that QTGMC line up by adding Denoiser="fft3dfilter". You will want to tweak the EZDenoise setting after doing that.
I must change the denoising presets, it reverts to dfttest too early (dfttest is much more accurate, but way slower).

SEt
4th December 2011, 19:35
You have to choice either quality or GPU deinterlacing. Don't use Mode 5: use 3 for source and then chain MT->non-MT scripts. Overclocking helps.

hydra3333
5th December 2011, 10:38
speed that QTGMC line up by adding Denoiser="fft3dfilter". You will want to tweak the EZDenoise setting after doing that.OK thanks.

You have to choice either quality or GPU deinterlacing. OK, how to GPU deinterlace ?

Don't use Mode 5: use 3 for source and then chain MT->non-MT scripts. Overclocking helps. OK, mode 3 of setmtmode (original version of MT) for avisource. suggestions welcomed on how to "chain" scripts to eventually input to HC :)

Didée
5th December 2011, 12:18
OK, how to GPU deinterlace

In a nutshell: just forget about it.

GPU deinterlacing basically is coupled to GPU decoding. AFAIK (but I might be wrong), there is no possibility for "GPU decoding" of DV-type AVI files.


If you want to be fast, use plain yadif or tdeint. Actually, the GPU deinterlacers play "in the same league" as yadif or tdeint. Compared to QTGMC, at least.

Consider: THIS little comparison (http://www.mediafire.com/?i7znn4nfpvr8nwe). (That is: bob-deinterlaced, 200% zoom, @ 0.25 speed)
Is "GPU" any better than yadif/tdeint? No it isn't. Is GPU deint faster than Yadif deint? No it isn't. Does anything stand a chance, result-wise, against (Q)TGMC? Or is it rather unrivaled?


Also, note that you're using the preset "slow" of QTGMC. Does that name of the value tell you something? - Try e.g. preset="fast", which will be, you guess it, much faster. And it's probably still way ahead of what any GPU or elsewhich deinterlacer would be able to produce.


Moreover, you have to consider the possible additional processing steps. Currently, you have MDegrain in your script, but it is deactivated. You probably don't need it actually, because of QTGMC.

A quite possible scenario:

- you swap QTGMC for a faster deinterlacer
- whohoo, now it runs 5 times faster!
- but wait, now there's noise and oddpixels and shimmering and things
=> let's activate mdegrain denoising

- and at THAT point, things get 4 times slower again. Because now you are doing additionally/manually, what otherwise QTGMC would do internally anyway. (Just that the manual way will deal worse with deinterlacing-specific problems, compared to the problem-oriented way that QTGMC does internally.)



Shortly summed-up:

1) Trade speed for quality, or quality for speed

2) You don't ultimately need the slow(er) presets of QTGMC. With the fast(er) presets, it still blows the competitors out of the water.
2a) You'll never get "burst speed" from QTGMC, but you can always have "fair speed", considering the result.

3) For people in a big hurry, ye old bob() is THE bobdeinterlacer to use! :p

SEt
5th December 2011, 19:04
OK, how to GPU deinterlace ?
It's possible but I doubt you'll find tool for that. Also, Didée explained well why it's not a great solution.

OK, mode 3 of setmtmode (original version of MT) for avisource. suggestions welcomed on how to "chain" scripts to eventually input to HC :)
1.avs:
SetMemoryMax(512)
SetMTmode(3)
AviSource("G:\DV\nodeshake\capt.11-12-04_12-04.00.avi", audio=false)
AssumeFPS(25)
AssumeBFF()
SetMTmode(2)
QTGMC(Preset="Slow", EZDenoise=3, NoisePreset="Slow", Sharpness=1.2, SLMode=1)
2.avs:
AviSource("1.avs")
HDRAGC(coef_gain=0.3, min_gain=0.2, max_gain=1.0, coef_sat=1.0, corrector=0.8, reducer=2.0, black_clip=1.0)
AssumeBFF()
SeparateFields().SelectEvery(4,0,3).Weave()
AssumeBFF()
Converttoyv12()
SetPlanarLegacyAlignment(True)