Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
18th November 2016, 21:02 | #421 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
satd is yet again broken..
broken like not even activated Code:
import vapoursynth as vs core = vs.get_core() clp = rule6 clp = core.fmtc.bitdepth(clp,bits=16,fulls=False,fulld=True) clp = core.std.ShufflePlanes(clp,0,vs.GRAY) sup = core.mv.Super(clp) bv1a = core.mv.Analyse(sup,delta=1,blksize=32,overlap=16,search=3,dct=5,isb=True) bv2a = core.mv.Analyse(sup,delta=2,blksize=32,overlap=16,search=3,dct=5,isb=True) bv3a = core.mv.Analyse(sup,delta=3,blksize=32,overlap=16,search=3,dct=5,isb=True) fv1a = core.mv.Analyse(sup,delta=1,blksize=32,overlap=16,search=3,dct=5,isb=False) fv2a = core.mv.Analyse(sup,delta=2,blksize=32,overlap=16,search=3,dct=5,isb=False) fv3a = core.mv.Analyse(sup,delta=3,blksize=32,overlap=16,search=3,dct=5,isb=False) bv1b = core.mv.Analyse(sup,delta=1,blksize=32,overlap=16,search=3,dct=0,isb=True) bv2b = core.mv.Analyse(sup,delta=2,blksize=32,overlap=16,search=3,dct=0,isb=True) bv3b = core.mv.Analyse(sup,delta=3,blksize=32,overlap=16,search=3,dct=0,isb=True) fv1b = core.mv.Analyse(sup,delta=1,blksize=32,overlap=16,search=3,dct=0,isb=False) fv2b = core.mv.Analyse(sup,delta=2,blksize=32,overlap=16,search=3,dct=0,isb=False) fv3b = core.mv.Analyse(sup,delta=3,blksize=32,overlap=16,search=3,dct=0,isb=False) clpa = core.mv.Degrain3(clp, sup, bv1a, fv1a, bv2a, fv2a, bv3a, fv3a,thscd1=16320,thsad=2000) clpb = core.mv.Degrain3(clp, sup, bv1b, fv1b, bv2b, fv2b, bv3b, fv3b,thscd1=16320,thsad=2000) clp = core.std.Expr([clpa,clpb],"x y - abs 10000 *") clp.set_output() |
9th February 2017, 10:01 | #422 | Link |
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
I added floating point support to MMask, you can back-port it to your branch and make your version of MMask work on higher precision if you want to.
https://github.com/IFeelBloated/vapo...src/MVMask.cpp Last edited by feisty2; 9th February 2017 at 10:21. |
15th February 2017, 17:21 | #423 | Link |
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
I've been trying to track a weird problem in which VapourSynth Editor will slowly use up all the memory after refreshing the script enough times. I use a custom denoising function to process the videos.
I was able to find out that feeding an external clip to mv.Super causes a memory leak: Code:
Core freed but 12 filter instances still exist Core freed but 12 filter instances still exist Core freed but 458496000 bytes still allocated in framebuffers Core freed but 458496000 bytes still allocated in framebuffers Code:
prefilt = core.dfttest.DFTTest(feed, tbsize=1, sigma=5, sigma2=5, sbsize=16, sosize=8) pelmdg = core.fmtc.resample(clip=clp, scale=2, kernel='spline64', center=False) pelprefilt = core.fmtc.resample(clip=prefilt, scale=2, kernel='spline64', center=False) superanalyse = core.mv.Super(clp, pel=2, chroma=True, rfilter=4, pelclip=pelprefilt) supermdg = core.mv.Super(clp, pel=2, chroma=True, rfilter=4, levels=1, pelclip=pelmdg)
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
15th February 2017, 17:55 | #424 | Link | ||
I'm Siri
Join Date: Oct 2012
Location: void
Posts: 2,633
|
Quote:
Code:
superanalyse = core.mv.Super(prefilt, pel=2, chroma=True, rfilter=4, pelclip=pelprefilt) Quote:
|
||
15th February 2017, 18:40 | #425 | Link | ||
Pig on the wing
Join Date: Mar 2002
Location: Finland
Posts: 5,718
|
Quote:
Quote:
__________________
And if the band you're in starts playing different tunes I'll see you on the dark side of the Moon... |
||
15th February 2017, 20:41 | #426 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
__________________
Buy me a "coffee" and/or hire me to write code! |
|
12th April 2017, 22:57 | #428 | Link |
Registered User
Join Date: Jun 2006
Posts: 452
|
jackoneill : the fixed libmvtools.dll (fixed mem-leak) has some unwanted dependencies like libgcc_s_seh1.dll and libstdc++6.dll.
Because I don't know what the fix is for the mem-leak and on github ( https://github.com/dubhater/vapoursynth-mvtools ) I do not see any fix for the mem-leak either, recompiling from the unfixed same source would not make much sense. Could you please make a fixed (no-mem-leak) version for it ? Last edited by Pat357; 12th April 2017 at 23:20. |
14th April 2017, 14:41 | #429 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
Here is v18. Code:
* Super: Fix memory leak when pelclip is used.
__________________
Buy me a "coffee" and/or hire me to write code! |
|
24th April 2017, 22:21 | #430 | Link |
Registered User
Join Date: Jun 2006
Posts: 452
|
In the MVtools doc is:
"Block sizes of 64x32, 64x64, 128x64, and 128x128 are supported." Are smaller specified blksizes (like blksize=16) just ignored ? ..as I get no error. Why only supporting the bigger blocks ? Would you consider supporting also blksizes=16x16, 32x16, 32x32 or even 8x8, 16x8 ? |
24th April 2017, 22:30 | #431 | Link | |
Registered User
Join Date: Aug 2012
Posts: 203
|
Quote:
|
|
5th June 2017, 21:16 | #432 | Link | |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
Quote:
__________________
Buy me a "coffee" and/or hire me to write code! |
|
7th June 2017, 20:37 | #433 | Link |
unsigned int
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
|
v19 is here.
Code:
* Super: Fix small bug in SSE2 code used with rfilter=3 and 8 bit input. * Super: Fix bug in SSE2 code used with sharp=0 and 8 bit input. * Analyse, Recalculate: Fix bug that made dct=5..10 behave like dct=0 (bug introduced in v17). * Store SAD in 64 bit integers instead of 32 bit integers. This is required because YUV444P16 video with 128x128 blocks could produce SADs too large for 32 bit integers. Motion vectors produced by v18 or older will not work with this version. Only users who stored the motion vectors from Analyse/Recalculate on disk have to worry about this. * Degrains: Put an upper limit on the legal values of thsad/thsadc to avoid an overflow. The exact value of the limit depends on bit depth, subsampling, and block size. It's probably fairly high.
__________________
Buy me a "coffee" and/or hire me to write code! |
14th June 2017, 21:07 | #434 | Link |
Registered User
Join Date: Aug 2012
Posts: 203
|
Hi, using a script like that
Code:
import vapoursynth as vs import nnedi3_resample as edi import havsfunc as has core = vs.get_core() def Denoise2(src, denoise, blksize, fast, truemotion): overlap = int(blksize / 2) pad = blksize + overlap src = core.fmtc.resample(src, src.width+pad, src.height+pad, sw=src.width+pad, sh=src.height+pad, kernel="point") super = core.mv.Super(src) rep = has.DitherLumaRebuild(src, s0=1) superRep = core.mv.Super(rep) bvec2 = core.mv.Analyse(superRep, isb = True, delta = 2, blksize=blksize, overlap=overlap, truemotion=truemotion) bvec1 = core.mv.Analyse(superRep, isb = True, delta = 1, blksize=blksize, overlap=overlap, truemotion=truemotion) fvec1 = core.mv.Analyse(superRep, isb = False, delta = 1, blksize=blksize, overlap=overlap, truemotion=truemotion) fvec2 = core.mv.Analyse(superRep, isb = False, delta = 2, blksize=blksize, overlap=overlap, truemotion=truemotion) fin = core.mv.Degrain2(src, super, bvec1,fvec1,bvec2,fvec2, denoise) fin = core.std.CropRel(fin, 0, pad, 0, pad) return fin src = core.lsmas.LWLibavSource("").fmtc.bitdepth(bits=16) den = Denoise2(src, 200, blksize=16, fast=False, truemotion=False) den.set_output() Code:
res = edi.nnedi3_resample(src, src.width ,src.height, sigmoid=True, invks=True, csp=vs.YUV444P16, curves="709") Is this a "known issue" or am i doing something wrong? |
15th June 2017, 01:26 | #435 | Link |
Registered User
Join Date: Jan 2016
Posts: 98
|
It is most probably related to the luma:chroma SAD ratio weighting.
Pinterf explained it in this mvtools for avisynth forum post. He also recently released a version (2.7.18.22 – 2017-05-12) of mvtools for avisynth with a new parameter "scaleCSAD" to fine tune this ratio. See this forum post Both in avisynth and vapoursynth, instead of converting to 444, you could filter (mdegrain, etc) planes separately, and then combine them together again with ShufflePlanes. |
15th June 2017, 18:40 | #436 | Link | ||
Registered User
Join Date: Aug 2012
Posts: 203
|
Quote:
Quote:
I should also mention that i'm talking about the luma plane, chroma planes, afaik are ok. EDIT: i'll send a sample asap |
||
16th June 2017, 03:31 | #437 | Link | |
Registered User
Join Date: Jan 2016
Posts: 98
|
Quote:
I saw three ways to improve your script:
Like this: Code:
def Denoise2(src, denoise, blksize, fast, truemotion): overlap = int(blksize / 2) pad = blksize #+ overlap #src = core.fmtc.resample(src, src.width+pad, src.height+pad, sw=src.width+pad, sh=src.height+pad, kernel="point") super = core.mv.Super(src, hpad=pad, vpad=pad) #rep = has.DitherLumaRebuild(src, s0=1) # Optional - Some other prefilter: rep = core.dfttest.DFTTest(clip=src, tbsize=1, sigma=2.0) superRep = core.mv.Super(rep, hpad=pad, vpad=pad) bvec2 = core.mv.Analyse(superRep, isb = True, delta = 2, blksize=blksize, overlap=overlap, truemotion=truemotion) bvec1 = core.mv.Analyse(superRep, isb = True, delta = 1, blksize=blksize, overlap=overlap, truemotion=truemotion) fvec1 = core.mv.Analyse(superRep, isb = False, delta = 1, blksize=blksize, overlap=overlap, truemotion=truemotion) fvec2 = core.mv.Analyse(superRep, isb = False, delta = 2, blksize=blksize, overlap=overlap, truemotion=truemotion) fin = core.mv.Degrain2(src, super, bvec1,fvec1,bvec2,fvec2, denoise) #fin = core.std.CropRel(fin, 0, pad, 0, pad) return fin src = core.lsmas.LWLibavSource("").fmtc.bitdepth(bits=16) den = Denoise2(src, 400, blksize=16, fast=False, truemotion=False) den.set_output() Last edited by VS_Fan; 16th June 2017 at 03:39. |
|
16th June 2017, 22:39 | #438 | Link |
Registered User
Join Date: Aug 2012
Posts: 203
|
So, if i understand correctly, those weighting are using during the analyze function to search for the proper motion vector, doing the analysis in 444 change some values and "improve" the denoising on the luma plane, am i correct?
Regarding your suggestion: I usually use thsad around 150 up to 500 to obtaining different level of denoising, 200 for me is for a low-to-mid denoising. i'm not resizing the clip, i'm simply padding it as I, when i did extensive test some years ago, noticed bad denoising on the bottom and right edge, even with padding, so i've started to pad my clip by myself, this method achieved very nice results. AFAIK DitherLumaRebuild is commonly used for prefiltering the clip before doing motion analysis, i found this trick in one of cretindesalpes post and on vs QTGMC port. Anyway i think you are right suggesting to use a stronger denoising, using 400 on the 420 clip it obtain similar result in those areas with weak denoising, but i would prefere to avoid using such strong, in my opinion, thsad. |
17th June 2017, 18:33 | #439 | Link | |||
Registered User
Join Date: Jan 2016
Posts: 98
|
Quote:
From the mvtools doc at avisynth’s site: At analysis stage plugin divides frames by small blocks and try to find for every block in current frame the most similar (matching) block in second frame (previous or next). The relative shift of these blocks is motion vector. The main measure of block similarity is sum of absolute differences (SAD) of all pixels of these two blocks compared. SAD is a value which says how good the motion estimation was. Quote:
Quote:
You could try mdegrain1, which will risk a lot less detail destruction while you use larger values for thsad. |
|||
19th June 2017, 22:16 | #440 | Link |
Registered User
Join Date: Aug 2012
Posts: 203
|
So what may be happening is this: Upscaling the chroma planes mvtools think that less of the image is changed because we have 2*2 chroma pixel that are very similar, so the same thsad result in more similar blocks and so more strong denoise, am i right?
|
Thread Tools | Search this Thread |
Display Modes | |
|
|