View Full Version : MVTools, Depan, DepanEstimate for VapourSynth
Pages :
1
2
3
4
5
[
6]
7
8
9
10
YAFU
7th September 2015, 13:30
Hello. I've been doing some experiments.
Apparently what mainly produces banding is this line at end in the original script:
ret = core.fft3dfilter.FFT3DFilter(ret,sigma=2.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.7)
http://www.pasteall.org/60466
I have understood that this line is to reduce fine grain noise, right?
I found a good way for those banding are not very noticeable. Basically, create a lossless video with the original script, but without that line.
Then apply the script to the resulting video, but in superF1 replacing with the values of that line that was removed:
import vapoursynth as vs
core = vs.get_core()
##
##ffmpeg with ffms2
core.std.LoadPlugin('/usr/lib/x86_64-linux-gnu/libffms2.so.3')
ret = core.ffms2.Source(source='/PATH_TO_VIDEO_HERE/encoded.mkv')
##
input = core.fmtc.bitdepth (clip=ret, bits=8)
superF1 = core.fft3dfilter.FFT3DFilter(input,sigma=2.5, bt=5, bw=32, bh=32, ow=16, oh=16, sharpen=0.7)
superF2 = core.mv.Super(superF1, pel=2, sharp=1)
super = core.mv.Super(input)
mvbw3 = core.mv.Analyse(superF2, isb=True, delta=3, overlap=4)
mvbw2 = core.mv.Analyse(superF2, isb=True, delta=2, overlap=4)
mvbw = core.mv.Analyse(superF2, isb=True, delta=1, overlap=4)
mvfw = core.mv.Analyse(superF2, isb=False, delta=1, overlap=4)
mvfw2 = core.mv.Analyse(superF2, isb=False, delta=2, overlap=4)
mvfw3 = core.mv.Analyse(superF2, isb=False, delta=3, overlap=4)
ret = core.mv.Degrain3(clip=input, super=super, mvbw=mvbw, mvfw=mvfw, mvbw2=mvbw2, mvfw2=mvfw2, mvbw3=mvbw3, mvfw3=mvfw3, thsad=400)
ret.set_output()
Then the noise reduction is similar to original script, but with less banding.
I guess that I've done it can be done from a single script without the intermediate step by creating these first video, but I have no idea about how to create this script. How could I do it?
The noise reduction in the kind of noise that renders from Blender 3D generate using this method/script is amazing.
It is a pity that Fft3d not support 16 bits because the result could be even better. Do you know if that filter is still under development and whether it plans to support 16-bit?
YAFU
7th September 2015, 16:41
Hello HolyWu.
It seems that in the HAvsFunc thread there are no instructions for Linux. Where should I copy havsfunc.py in Linux?
Regarding suggestions of MonoS, I was able to build this script with parts of code from his different messages, I do not know if I have done well:
http://www.pasteall.org/61017
For now I get better noise reduction with the original script using FFT3DFilter.
YAFU
7th September 2015, 19:24
Just in case this is useful to someone else, I explain:
I have installed at least three versions of python (I guess they have been left of different system updates). So I have different paths to "/pythonX.Y/site-packages" both in "/usr/local/lib" and "/usr/lib". So from linux terminal:
whereis vapoursynth
And you get "/usr/local/lib/vapoursynth" or "/usr/lib/vapoursynth" depending on where you've installed it. Generally if you have compiled without specified path, default it is installed in "/usr/local/lib/", and if you installed from a distribution package generally is installed in "/usr/lib". So depending on that copy "havsfunc.py" to "/usr/local/lib/pythonX.Y/site-packages" or "/usr/lib/pythonX.Y/site-packages". "X.Y" should be the highest version of python you had when you installed vapoursynth. In my case I have copied it to "/usr/local/lib/python3.4/site-packages". In the same path there were two files, "vapoursynth.la" and "vapoursynth.so".
I will study this little script and do some testing with these images that I have shared in previous posts in this thread.
Are_
7th September 2015, 20:00
If you don't want to deal with root access every time you want to update/install a new module:
# echo "/home/your-user/some-path-to-a-directory-with-all-your-modules" > /usr/local/lib/python3.4/site-packages/vapoursynth_modules.pth
YAFU
7th September 2015, 23:37
Ok Are_, I'll try that
MonoS
8th September 2015, 19:03
If someone don't come up with some suggestion, this is my "final suggestion"
The video outputted is this one http://www.mediafire.com/watch/mws7c9hgwwrsqjm/test.mkv
The script used this [i wrote some comments for you]
import vapoursynth as vs
import havsfunc as has
core = vs.get_core()
#Load imwri
core.std.LoadPlugin("C:/Program Files (x86)/VapourSynth/plugins64/imwri/imwri.dll")
#Read images
src = core.imwri.Read("C:/Users/MonoS/Desktop/BlenderCycles-VapourSynth/images/%04d.png", firstnum=50)
#converting input RGB images to YUV444
input = core.fmtc.bitdepth(src, flt=True).fmtc.matrix(mat="601", col_fam=vs.YUV).fmtc.bitdepth(bits=16, dmode=7)
#This should improve motion estimation for darken zones
superF1 = has.DitherLumaRebuild(input, s0=1)
superF2 = core.mv.Super(superF1, pel=2, sharp=1)
super = core.mv.Super(input)
#Do motion compesated denoising
mvbw2 = core.mv.Analyse(superF2, isb=True, delta=2, overlap=4)
mvbw = core.mv.Analyse(superF2, isb=True, delta=1, overlap=4)
mvfw = core.mv.Analyse(superF2, isb=False, delta=1, overlap=4)
mvfw2 = core.mv.Analyse(superF2, isb=False, delta=2, overlap=4)
deno = core.mv.Degrain2(clip=input, super=super, mvbw=mvbw, mvfw=mvfw, mvbw2=mvbw2, mvfw2=mvfw2, thsad=400)
#After first denoising stage the majority of the grain is on the darker zone, create a mask of only the dark zones
def f(x):
if x < 12000:
return 65535
else:
return 0
maskY = core.std.Lut(deno, [0,1,2], function=f).std.ShufflePlanes([0], vs.GRAY)
mask = core.std.ShufflePlanes([maskY, maskY, maskY], [0,0,0], vs.YUV)
#Do a second pass of spatial denoising only on the masked zones
ret = core.std.MaskedMerge(deno,core.dfttest.DFTTest(deno, sigma=2.5), mask)
#Delete # below to output a 8bit clip
#ret = core.fmtc.bitdepth(bits=8, dmode=7)
ret.set_output()
#Delete # below to output a video showing the difference between the the first and second denoise pass
#core.std.Interleave([deno, ret]).set_output()
#Delete # below to output the mask
#mask.set_output()
I also suggest a moderator to move all this discussion about removing ray tracing noise artifact into a new thread, we went a bit to OT imho
EDIT: i've thrown inside the script the jpg you sent us at the beginning, FAAAAR better result if you ask me
http://www.mediafire.com/watch/ypwrf9qv5ad6lfy/testjpg.mkv
YAFU
8th September 2015, 21:01
@MonoS, Thank you very much for your scripts and suggestions. I had not tasted much your scripts because I did not know how to create a functional script from what you said in each message, I really know very little about these issues and I am learning. With time I'm going to analyze what each filter do and learning how it works.
Edit: The comments you made into the last script are really helpful to learn, thanks.
In the BlenderArtists forum, "brothermechanic" has done new tests and he found a way to minimize banding:
http://www.blenderartists.org/forum/showthread.php?378736-Cycles-noise-reduction-with-VapourSynth&p=2933482&viewfull=1#post2933482
For now we are stuck with "fft3dfilter", it seems to be the best handling this kind of noise generated by Blender/Cycles. But I will continue testing to find the best 16 bits solution.
You see the example with "hard-denoise" filter. Similar that way should look material in cubes if they have no noise in render. However, in other situations it would be necessary to preserve details, without much noise reduction.
Thanks.
Boulder
14th September 2015, 04:04
Is there any possibility to get the functionality of MShow included? I use it quite often to adjust thscd1 and thscd2 to match the source better.
EDIT: Also, is it OK to simply resize to double the dimensions of the clip fed to Super as pelclip? In Avisynth 2.6, you need to do some shifting.
Boulder
15th September 2015, 16:54
OK, I got some more odd behaviour. It could be MVTools acting up but it's still quite interesting.
This one works properly, that is, Degrain1 does what it is supposed to do:
import vapoursynth as vs
import havsfunc as has
core = vs.get_core()
core.avs.LoadPlugin(r'c:/program files (x86)/avisynth/plugins/dgdecodenv.dll')
clp = core.avs.DGSource('c:/x265/hotfuzztest.dgi')
#clp = core.fmtc.bitdepth(clp, bits=16)
feed = has.DitherLumaRebuild(clp)
pelmdg = core.resize.Spline(clp,width=clp.width*2,height=clp.height*2)
pelprefilt = core.resize.Spline(feed,width=clp.width*2,height=clp.height*2)
superanalyse = core.mv.Super(feed,pel=2,chroma=True,rfilter=4, pelclip=pelprefilt)
supermdg = core.mv.Super(clp,pel=2,chroma=True,rfilter=4,levels=1, pelclip=pelmdg)
bv1 = core.mv.Analyse(superanalyse, dct=5, blksize=16, overlap=8, isb=True)
fv1 = core.mv.Analyse(superanalyse, dct=5, blksize=16, overlap=8)
finalclip = core.mv.Degrain1(clp, supermdg, bv1, fv1, thsad=400, thsadc=400, limit=5, limitc=6)
org = clp
final = core.std.Interleave(clips=[org,finalclip])
final.set_output()
If you uncomment the line "clp = core.fmtc.bitdepth(clp, bits=16)", Degrain1 doesn't seem to do anything.
feisty2
15th September 2015, 17:08
all 10 modes of dct are broken in the current binary, dct 5-10 have been fixed in the source code, but no binary available yet, dct 1-4 are just broken
I fixed all dct stuff in my floating point branch tho, if u wanna try it
Boulder
15th September 2015, 17:54
Because the "limit" and "limitc" parameters do not scale internally to the bit depth of the input clip, hence it can't really do anything for so low limits on 16-bit input. The range becomes 0 to 65535 for 16-bit clips.
Damn, I really start feeling like a newbie once more :)
all 10 modes of dct are broken in the current binary, dct 5-10 have been fixed in the source code, but no binary available yet, dct 1-4 are just broken
I fixed all dct stuff in my floating point branch tho, if u wanna try it
I was wondering why dct=5 is dead slow so it being broken that's probably the reason. Your binary seems to be for x64 so that's out of the question for the moment (because of DGDecodeNV.dll which cannot be loaded in VSx64).
feisty2
15th September 2015, 18:02
weird... Is it worth it? Stay on x86 just for a source filter.... That's new
Well, just replace that with ffms or lsmash, both got x64 binaries
Boulder
15th September 2015, 18:15
And both have their issues :) Besides, DG's product is much more convenient for my usage so I'll stick to x86 for the time being. Maybe I'll get around to building MVTools but there's no rush, I'll progress slowly anyway.
feisty2
15th September 2015, 18:21
And besides, there's avsreader... So, use dg whatever under avisynth x64, and avsreader will link to avisynth and output the avisynth script as a regular video clip
jackoneill
15th September 2015, 18:29
dct > 0 isn't slow because it's broken, it's just slow.
Does limit(c) even do anything? When I tested that, it barely had any effect.
MShow probably won't be added for a long time.
Boulder
17th September 2015, 04:31
Are the other options in MVTools functions scaled for 16-bit input (thsad etc.) or will they need to be scaled according to the input bit depth as well?
Boulder
17th September 2015, 07:06
Thanks!
cybersharky
17th September 2015, 11:24
Please can someone help with writing this function in python?
function McDegrainSharp(clip c, int "frames", float "bblur", float "csharp", bool "bsrch")
{ # Based on MCDegrain By Didee, http://forum.doom9.org/showthread.php?t=161594
# Also based on DiDee observations in this thread: http://forum.doom9.org/showthread.php?t=161580
# "Denoise with MDegrainX, do slight sharpening where motionmatch is good, do slight blurring where motionmatch is bad"
# In areas where MAnalyse cannot find good matches, the blur() will be dominant.
# In areas where good matches are found, the sharpen()'ed pixels will overweight the blur()'ed pixels
# when the pixel averaging is performed.
frames = default(frames, 2)
bblur = default(bblur, 0.6)
csharp = default(csharp, 0.6)
bsrch = default(bsrch, true)
bs = (c.width>960) ? 16 : 8
c2 = c.blur(bblur)
super = bsrch ? c2.MSuper(pel=2, sharp=1) : c.MSuper(pel=2, sharp=1)
super_rend = c.sharpen(csharp).MSuper(pel=2, sharp=1,levels=1)
backward_vec3 = MAnalyse(super, isb = true, delta = 3, blksize=bs, overlap=bs/2)
backward_vec2 = MAnalyse(super, isb = true, delta = 2, blksize=bs, overlap=bs/2)
backward_vec1 = MAnalyse(super, isb = true, delta = 1, blksize=bs, overlap=bs/2)
forward_vec1 = MAnalyse(super, isb = false, delta = 1, blksize=bs, overlap=bs/2)
forward_vec2 = MAnalyse(super, isb = false, delta = 2, blksize=bs, overlap=bs/2)
forward_vec3 = MAnalyse(super, isb = false, delta = 3, blksize=bs, overlap=bs/2)
(frames<=0) ? c :\
(frames==1) ? c2.MDegrain1(super_rend, backward_vec1,forward_vec1,thSAD=400) :\
(frames==2) ? c2.MDegrain2(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) :\
c2.MDegrain3(super_rend, backward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400)
return(last)
}
Are_
17th September 2015, 12:50
I'm not sure it's working correctly because I can't test it, but here you have it anyway. mcdegrainsharp.py (https://gist.github.com/4re/b5399b1801072458fc80)
Boulder
19th September 2015, 18:39
dct > 0 isn't slow because it's broken, it's just slow.The difference in performance between dct=0 and dct=5 is much less drastic in the Avisynth plugin. Is there any room for improvement (totally unoptimized code or something) or is it about as good as it gets?
jackoneill
19th September 2015, 22:11
The difference in performance between dct=0 and dct=5 is much less drastic in the Avisynth plugin. Is there any room for improvement (totally unoptimized code or something) or is it about as good as it gets?
If it's slower than the Avisynth plugin then yes, there is room for improvement. I don't know what makes it slower in this case.
Boulder
20th September 2015, 11:38
I made a quick test with 8-bit clips. The scripts are naturally not exactly the same but the operations are quite close to each other.
1.68 fps, Vapoursynth with dct=5
3.70 fps, Vapoursynth with dct=0
2.79 fps, Avisynth with dct=5
2.99 fps, Avisynth with dct=0
Tarutaru
23rd September 2015, 15:58
I'm not sure it's working correctly because I can't test it, but here you have it anyway. mcdegrainsharp.py (https://gist.github.com/4re/b5399b1801072458fc80)
Thanks, but when I apply this function, the color is changed...
import vapoursynth as vs
import mcdegrainsharp as mcds
core = vs.get_core()
ret = core.ffms2.Source(source='/foo/bar.mkv')
ret1 = mcds.mcdegrainsharp(ret)
ret = core.std.Interleave([ret,ret1])
ret.set_output()
Original:
https://na.cx/i/FbQhF3.png
Output:
https://na.cx/i/0d1JvY.png
Look at the grass between Lipton and the other tropper, they are not as green as the original....
Are_
23rd September 2015, 22:33
Yeah, indeed. Looks like generic.Blur is bugged when input is 8bit? Try again with the latest version please, keep in mind the weights for ssharp and bblur behave differently now.
Tarutaru
24th September 2015, 15:27
Yeah, indeed. Looks like generic.Blur is bugged when input is 8bit? Try again with the latest version please, keep in mind the weights for ssharp and bblur behave differently now.
It looks good with the new version:thanks:
Original:
https://na.cx/i/Rj64wd.png
Output:
https://na.cx/i/52ag3Z.png
Boulder
28th September 2015, 11:18
is it OK to simply resize to double the dimensions of the clip fed to Super as pelclip (if pel=2)? In Avisynth 2.6, you need to do some shifting.What about this question?
jackoneill
28th September 2015, 12:26
What about this question?
If shifting is needed in Avisynth, then it's needed here too.
Boulder
3rd January 2016, 17:16
I found a bug in the latest release. This code will crash MVTools, I'm getting a crash around frame 15. Sometimes frame 7 also causes it. You can also see that there's a lot of artifacts around the coloured area in several frames.
The crash doesn't occur if the line feed = has.DitherLumaRebuild(clp) is replaced by feed = clp.
The crash and artifacts disappear if the conversion to 16 bits is removed, or if you remove the last two lines with mv.Recalculate.
import vapoursynth as vs
import havsfunc as has
core = vs.get_core()
clp = core.ffms2.Source(r'u:\test-002.264')
clp = core.fmtc.bitdepth(clp, bits=16)
feed = has.DitherLumaRebuild(clp)
superanalyse = core.mv.Super(feed, pel=2, rfilter=4)
supermdg = core.mv.Super(clp, pel=2, rfilter=4, levels=1)
bv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=True)
fv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=False)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=8, overlap=4, search=3)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=8, overlap=4, search=3)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=4, overlap=2, search=3)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=4, overlap=2, search=3)
finalclip = core.mv.Degrain1(clp, supermdg, bv1, fv1, thscd1=300, thscd2=80)
output = finalclip
output.set_output()
Here's the sample clip to use to test and debug:
https://drive.google.com/file/d/0BzeF_1syecQwQjJZTFNhUFVXVk0/view?usp=sharing
jackoneill
3rd January 2016, 22:27
I found a bug in the latest release. This code will crash MVTools, I'm getting a crash around frame 15. Sometimes frame 7 also causes it. You can also see that there's a lot of artifacts around the coloured area in several frames.
I can reproduce this. Some integer variable probably overflows, because MVTools wasn't written with 16 bit input in mind. (Something similar has happened before.)
feisty2
4th January 2016, 13:21
I found a bug in the latest release. This code will crash MVTools, I'm getting a crash around frame 15. Sometimes frame 7 also causes it. You can also see that there's a lot of artifacts around the coloured area in several frames.
The crash doesn't occur if the line feed = has.DitherLumaRebuild(clp) is replaced by feed = clp.
The crash and artifacts disappear if the conversion to 16 bits is removed, or if you remove the last two lines with mv.Recalculate.
import vapoursynth as vs
import havsfunc as has
core = vs.get_core()
clp = core.ffms2.Source(r'u:\test-002.264')
clp = core.fmtc.bitdepth(clp, bits=16)
feed = has.DitherLumaRebuild(clp)
superanalyse = core.mv.Super(feed, pel=2, rfilter=4)
supermdg = core.mv.Super(clp, pel=2, rfilter=4, levels=1)
bv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=True)
fv1 = core.mv.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=False)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=8, overlap=4, search=3)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=8, overlap=4, search=3)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=4, overlap=2, search=3)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=4, overlap=2, search=3)
finalclip = core.mv.Degrain1(clp, supermdg, bv1, fv1, thscd1=300, thscd2=80)
output = finalclip
output.set_output()
Here's the sample clip to use to test and debug:
https://drive.google.com/file/d/0BzeF_1syecQwQjJZTFNhUFVXVk0/view?usp=sharing
tested your script (removed chroma and changed bitdepth to 32) on my floating point branch and didn't see any crash or artifacts...
weird, cuz my branch was forked from this master branch and should have suffered the same issue...
feisty2
4th January 2016, 13:39
import vapoursynth as vs
import havsfunc as has
core = vs.get_core()
clp = core.ffms2.Source("test-002.264")
feed = core.fmtc.bitdepth(has.DitherLumaRebuild(core.fmtc.bitdepth(clp, bits=16)), bits=32)
clp = core.fmtc.bitdepth(clp, bits=32)
y1 = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
u1 = core.std.Expr(core.std.ShufflePlanes(clp, planes=1, colorfamily=vs.GRAY),"x 0.5 +")
v1 = core.std.Expr(core.std.ShufflePlanes(clp, planes=2, colorfamily=vs.GRAY),"x 0.5 +")
y2 = core.std.ShufflePlanes(feed, planes=0, colorfamily=vs.GRAY)
u2 = core.std.Expr(core.std.ShufflePlanes(feed, planes=1, colorfamily=vs.GRAY),"x 0.5 +")
v2 = core.std.Expr(core.std.ShufflePlanes(feed, planes=2, colorfamily=vs.GRAY),"x 0.5 +")
clp = core.std.ShufflePlanes([y1,u1,v1], planes=[0,0,0], colorfamily=vs.YUV)
feed = core.std.ShufflePlanes([y2,u2,v2], planes=[0,0,0], colorfamily=vs.YUV)
superanalyse = core.mvsf.Super(feed, pel=2, rfilter=4)
supermdg = core.mvsf.Super(clp, pel=2, rfilter=4, levels=1)
bv1 = core.mvsf.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=True)
fv1 = core.mvsf.Analyse(superanalyse, dct=0, blksize=16, overlap=8, isb=False)
bv1 = core.mvsf.Recalculate(superanalyse, bv1, thsad=100, blksize=8, overlap=4, search=3)
fv1 = core.mvsf.Recalculate(superanalyse, fv1, thsad=100, blksize=8, overlap=4, search=3)
bv1 = core.mvsf.Recalculate(superanalyse, bv1, thsad=100, blksize=4, overlap=2, search=3)
fv1 = core.mvsf.Recalculate(superanalyse, fv1, thsad=100, blksize=4, overlap=2, search=3)
finalclip = core.mvsf.Degrain1(clp, supermdg, bv1, fv1, thscd1=300, thscd2=80)
y = core.std.ShufflePlanes(finalclip, planes=0, colorfamily=vs.GRAY)
u = core.std.Expr(core.std.ShufflePlanes(finalclip, planes=1, colorfamily=vs.GRAY),"x 0.5 -")
v = core.std.Expr(core.std.ShufflePlanes(finalclip, planes=2, colorfamily=vs.GRAY),"x 0.5 -")
output = core.std.ShufflePlanes([y,u,v], planes=[0,0,0], colorfamily=vs.YUV)
output.set_output()
now with chroma, still no crash or artifacts...
jackoneill
4th January 2016, 14:33
tested your script (removed chroma and changed bitdepth to 32) on my floating point branch and didn't see any crash or artifacts...
weird, cuz my branch was forked from this master branch and should have suffered the same issue...
It turned out to be a bug introduced by me, in the 16 bit SAD functions. You don't use those.
Why I'm fixing bugs, can I have a piece of that video you used to show that dct=1 is broken, please? That particular frame, plus the five before and five after should do.
feisty2
4th January 2016, 15:11
https://mega.nz/#!ShFRRIpD!uf3IRi-Hg7PPnBVVgQhd1z34-VNZccj9keuW1yJbrKw
jackoneill
4th January 2016, 17:04
That one was integer overflow, and had nothing to do with the dct parameter.
Boulder
16th January 2016, 11:00
Were you able to reproduce and fix the issue?
jackoneill
16th January 2016, 12:52
Were you able to reproduce and fix the issue?
Yes. I'll tag v10 later if nothing else pops up.
jackoneill
18th January 2016, 13:07
This is v10. (https://github.com/dubhater/vapoursynth-mvtools/releases/tag/v10)
* Fix crash in BlockFPS with Gray input.
* Fix unspecified bug in the 8x8 and 16x16 SATD functions (fix by feisty2).
* Fix crash in Analyse/Recalculate due to a bug in the 2x2 and 2x4 16 bit SAD functions.
* Fix integer overflow in Degrain when thsad is large enough, which turned it into a very slow no-op.
Boulder
18th January 2016, 13:13
Thanks, will put it to test soon :)
Is it now safe to try dct=5?
jackoneill
18th January 2016, 13:20
Thanks, will put it to test soon :)
Is it now safe to try dct=5?
Wasn't it always safe?
Boulder
18th January 2016, 13:26
Wasn't it always safe?
http://forum.doom9.org/showthread.php?p=1738746#post1738746
Apparently it's fixed now. I recalled that there was some discussion earlier..
I'll have to test the performance, earlier it was much slower than in Avisynth.
jackoneill
18th January 2016, 13:50
http://forum.doom9.org/showthread.php?p=1738746#post1738746
Apparently it's fixed now. I recalled that there was some discussion earlier..
I'll have to test the performance, earlier it was much slower than in Avisynth.
Ah, yes. feisty2 also tried that with dct=5. The problem wasn't the dct parameter, it was that integer overflow with large thsad.
feisty2
18th January 2016, 14:10
Ah, yes. feisty2 also tried that with dct=5. The problem wasn't the dct parameter, it was that integer overflow with large thsad.
dct 5-10 are good now, dct 1-4 (fftw related modes) are still broken in v10...
Boulder
18th January 2016, 14:53
Ah, yes. feisty2 also tried that with dct=5. The problem wasn't the dct parameter, it was that integer overflow with large thsad.My thsad values usually max at 400 so I don't think that has been the case.
These were the results of my old test on an 8-bit clip:
1.68 fps, Vapoursynth with dct=5
3.70 fps, Vapoursynth with dct=0
2.79 fps, Avisynth with dct=5
2.99 fps, Avisynth with dct=0
But as I said, I'll try to run a new test soon.
jackoneill
18th January 2016, 15:11
dct 5-10 are good now, dct 1-4 (fftw related modes) are still broken in v10...
Broken how? That frame you showed was coming out of Degrain pretty much untouched, but it shouldn't anymore.
feisty2
18th January 2016, 15:26
Broken how? That frame you showed was coming out of Degrain pretty much untouched, but it shouldn't anymore.
that's the exact problem...
it should not but still looks pretty much untouched at thsad=2000
source
http://i.imgur.com/LOwbBO9.png
import vapoursynth as vs
core = vs.get_core()
clp = rule6
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=16)
superanalyse = core.mv.Super(clp, pel=2, rfilter=4)
supermdg = core.mv.Super(clp, pel=2, rfilter=4, levels=1)
bv1 = core.mv.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=True)
fv1 = core.mv.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=False)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=8, overlap=4, search=3, dct=1)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=8, overlap=4, search=3, dct=1)
bv1 = core.mv.Recalculate(superanalyse, bv1, thsad=100, blksize=4, overlap=2, search=3, dct=1)
fv1 = core.mv.Recalculate(superanalyse, fv1, thsad=100, blksize=4, overlap=2, search=3, dct=1)
bv2 = core.mv.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=True, delta=2)
fv2 = core.mv.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=False, delta=2)
bv2 = core.mv.Recalculate(superanalyse, bv2, thsad=100, blksize=8, overlap=4, search=3, dct=1)
fv2 = core.mv.Recalculate(superanalyse, fv2, thsad=100, blksize=8, overlap=4, search=3, dct=1)
bv2 = core.mv.Recalculate(superanalyse, bv2, thsad=100, blksize=4, overlap=2, search=3, dct=1)
fv2 = core.mv.Recalculate(superanalyse, fv2, thsad=100, blksize=4, overlap=2, search=3, dct=1)
clp = core.mv.Degrain2(clp, supermdg, bv1, fv1, bv2, fv2, thsad=2000)
clp.set_output ()
http://i.imgur.com/XVWZNgh.png
import vapoursynth as vs
core = vs.get_core()
clp = rule6
clp = core.std.ShufflePlanes(clp, planes=0, colorfamily=vs.GRAY)
clp = core.fmtc.bitdepth(clp, fulls=False, fulld=True, bits=32)
superanalyse = core.mvsf.Super(clp, pel=2, rfilter=4)
supermdg = core.mvsf.Super(clp, pel=2, rfilter=4, levels=1)
bv1 = core.mvsf.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=True)
fv1 = core.mvsf.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=False)
bv1 = core.mvsf.Recalculate(superanalyse, bv1, thsad=100, blksize=8, overlap=4, search=3, dct=1)
fv1 = core.mvsf.Recalculate(superanalyse, fv1, thsad=100, blksize=8, overlap=4, search=3, dct=1)
bv1 = core.mvsf.Recalculate(superanalyse, bv1, thsad=100, blksize=4, overlap=2, search=3, dct=1)
fv1 = core.mvsf.Recalculate(superanalyse, fv1, thsad=100, blksize=4, overlap=2, search=3, dct=1)
bv2 = core.mvsf.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=True, delta=2)
fv2 = core.mvsf.Analyse(superanalyse, dct=1, blksize=16, overlap=8, isb=False, delta=2)
bv2 = core.mvsf.Recalculate(superanalyse, bv2, thsad=100, blksize=8, overlap=4, search=3, dct=1)
fv2 = core.mvsf.Recalculate(superanalyse, fv2, thsad=100, blksize=8, overlap=4, search=3, dct=1)
bv2 = core.mvsf.Recalculate(superanalyse, bv2, thsad=100, blksize=4, overlap=2, search=3, dct=1)
fv2 = core.mvsf.Recalculate(superanalyse, fv2, thsad=100, blksize=4, overlap=2, search=3, dct=1)
clp = core.mvsf.Degrain2(clp, supermdg, bv1, fv1, bv2, fv2, thsad=2000)
clp.set_output ()
http://i.imgur.com/iFXJCRm.png
Boulder
18th January 2016, 17:06
Has something changed in this release regarding the usage of the plugin?
I got this error: "AttributeError: There is no attribute or namespace named mv". Release 9 works fine.
Myrsloik
18th January 2016, 17:07
Has something changed in this release regarding the usage of the plugin?
I got this error: "AttributeError: There is no attribute or namespace named mv". Release 9 works fine.
It probably requires the R30 rc to be installed.
feisty2
18th January 2016, 17:08
Has something changed in this release regarding the usage of the plugin?
I got this error: "AttributeError: There is no attribute or namespace named mv". Release 9 works fine.
update your vaporsynth to R30
EDIT: oops... too slow
Boulder
18th January 2016, 17:09
It probably requires the R30 rc to be installed.OK, thought so. I still haven't upgraded my production environment since there's been no need to do that.
jackoneill
18th January 2016, 17:13
Has something changed in this release regarding the usage of the plugin?
I got this error: "AttributeError: There is no attribute or namespace named mv". Release 9 works fine.
I'll recompile with an older VapourSynth.h.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.