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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th September 2015, 17:54   #261  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by HolyWu
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
Quote:
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).
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th September 2015, 18:02   #262  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
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
feisty2 is offline   Reply With Quote
Old 15th September 2015, 18:15   #263  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 15th September 2015, 18:21   #264  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
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
feisty2 is offline   Reply With Quote
Old 15th September 2015, 18:29   #265  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
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.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 17th September 2015, 04:31   #266  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th September 2015, 07:06   #267  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Thanks!
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 17th September 2015, 11:24   #268  |  Link
cybersharky
Registered User
 
Join Date: Jul 2008
Posts: 131
Please can someone help with writing this function in python?

PHP Code:
function McDegrainSharp(clip cint "frames"float "bblur"float "csharp"bool "bsrch")
# Based on MCDegrain By Didee, [url]http://forum.doom9.org/showthread.php?t=161594[/url]
  # Also based on DiDee observations in this thread: [url]http://forum.doom9.org/showthread.php?t=161580[/url] 
  # "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(frames2)
    
bblur  = default(bblur0.6)
    
csharp = default(csharp0.6)
    
bsrch  = default(bsrchtrue)
    
bs = (c.width>960) ? 16 8
    
    c2 
c.blur(bblur)
    
super bsrch c2.MSuper(pel=2sharp=1) : c.MSuper(pel=2sharp=1)
    
super_rend     c.sharpen(csharp).MSuper(pel=2sharp=1,levels=1)
    
backward_vec3 MAnalyse(superisb truedelta 3blksize=bsoverlap=bs/2)
    
backward_vec2 MAnalyse(superisb truedelta 2blksize=bsoverlap=bs/2)
    
backward_vec1 MAnalyse(superisb truedelta 1blksize=bsoverlap=bs/2)
    
forward_vec1 MAnalyse(superisb falsedelta 1blksize=bsoverlap=bs/2)
    
forward_vec2 MAnalyse(superisb falsedelta 2blksize=bsoverlap=bs/2)
    
forward_vec3 MAnalyse(superisb falsedelta 3blksize=bsoverlap=bs/2)    
    (
frames<=0) ? :\
    (
frames==1) ? c2.MDegrain1(super_rendbackward_vec1,forward_vec1,thSAD=400) :\
    (
frames==2) ? c2.MDegrain2(super_rendbackward_vec1,forward_vec1,backward_vec2,forward_vec2,thSAD=400) :\
              
c2.MDegrain3(super_rendbackward_vec1,forward_vec1,backward_vec2,forward_vec2,backward_vec3,forward_vec3,thSAD=400)
    return(
last)

cybersharky is offline   Reply With Quote
Old 17th September 2015, 12:50   #269  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
I'm not sure it's working correctly because I can't test it, but here you have it anyway. mcdegrainsharp.py
Are_ is offline   Reply With Quote
Old 19th September 2015, 18:39   #270  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by jackoneill View Post
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?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 19th September 2015, 22:11   #271  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Boulder View Post
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.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 20th September 2015, 11:38   #272  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 23rd September 2015, 15:58   #273  |  Link
Tarutaru
A deadly Taru!
 
Tarutaru's Avatar
 
Join Date: Jun 2008
Location: San d'Oria, Vana'diel
Posts: 22
Quote:
Originally Posted by Are_ View Post
I'm not sure it's working correctly because I can't test it, but here you have it anyway. mcdegrainsharp.py
Thanks, but when I apply this function, the color is changed...
Code:
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....
__________________
Don'taru push me!!
Tarutaru is offline   Reply With Quote
Old 23rd September 2015, 22:33   #274  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 321
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.
Are_ is offline   Reply With Quote
Old 24th September 2015, 15:27   #275  |  Link
Tarutaru
A deadly Taru!
 
Tarutaru's Avatar
 
Join Date: Jun 2008
Location: San d'Oria, Vana'diel
Posts: 22
Quote:
Originally Posted by Are_ View Post
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
Original:
https://na.cx/i/Rj64wd.png
Output:
https://na.cx/i/52ag3Z.png
__________________
Don'taru push me!!
Tarutaru is offline   Reply With Quote
Old 28th September 2015, 11:18   #276  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
Quote:
Originally Posted by Boulder View Post
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?
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 28th September 2015, 12:26   #277  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Boulder View Post
What about this question?
If shifting is needed in Avisynth, then it's needed here too.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 3rd January 2016, 17:16   #278  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,733
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.

Code:
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/0Bze...ew?usp=sharing
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 3rd January 2016, 22:27   #279  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by Boulder View Post
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.)
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 4th January 2016, 13:21   #280  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by Boulder View Post
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.

Code:
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/0Bze...ew?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 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.