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

Reply
 
Thread Tools Search this Thread Display Modes
Old 5th September 2015, 13:30   #1  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
mvsfunc-r8

Github | NMM

Examples:
Code:
import mvsfunc as mvf

# Any input depth
clip = mvf.Depth(clip, depth=16)
# 16-bit integer output

# Any input depth
clip = mvf.Depth(clip, depth=32)
# 32-bit float output

# Any input format
clip = mvf.ToYUV(clip, css="420")
# YUV420P output

# Any input format
clip = mvf.ToRGB(clip, depth=8)
# RGB24 output (e.g. for previewing using vsedit)

# Faster way to preview with RGB24 output, for vsedit
clip = mvf.Preview(clip)

# Preview with CompatBGR32 output, for VirtualDub, AvsPmod, etc.
clip = mvf.Preview(clip, compat=True)

# Compare multiple clips, they will be interleaved into one clip
clip = mvf.Preview([clip1, clip2, clip3])

# Any input format
clip = mvf.BM3D(clip, sigma=[3,3,3], radius1=0) # radius1=0 for BM3D, radius1>0 for V-BM3D
# Same as input format
Mainly some wrap functions, with which it's much simpler to use some functions, especially the BM3D denoising filter, with high internal precision and high quality format conversions.
It's written a few months ago, now finally publish it here. (I thought I should merge nnedi3_resample into it but I'm just too lazy to touch that monster...)

Last edited by mawen1250; 31st July 2016 at 14:37. Reason: Update r8
mawen1250 is offline   Reply With Quote
Old 5th September 2015, 21:58   #2  |  Link
feve
Registered User
 
Join Date: Jul 2014
Posts: 2
Thanks for your efforts.
feve is offline   Reply With Quote
Old 26th September 2015, 17:21   #3  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r2

Added utility functions:
Min
Max
Avg
MinFilter
MaxFilter
LimitFilter
ShowAverage

Added frame property functions:
SetColorSpace
AssumeFrame
AssumeTFF
AssumeBFF
AssumeField
AssumeCombed
mawen1250 is offline   Reply With Quote
Old 7th October 2015, 14:34   #4  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r3

ToRGB and ToYUV fix: wrong color space frame property is set
Added Utility function FilterCombed()
Added support for vszimg 2.0 API (still support 1.0 API as well)
mawen1250 is offline   Reply With Quote
Old 9th October 2015, 17:42   #5  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 287
Thank you for making vapoursynth more user friendly to get into :P
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 11th October 2015, 16:37   #6  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r4

Added utility functions:
PlaneStatistics
PlaneCompare
PointPower

Added helper function:
GetPlane
mawen1250 is offline   Reply With Quote
Old 21st November 2015, 04:34   #7  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r5

BM3D: fixed the mistake that bm3d.Basic/bm3d.VBasic is used for final estimate
BM3D: now psample always defaults to 1
ToYUV: fixed error with GRAY input
New category "Runtime functions"
Added runtime function FilterIf()
Added helper function CheckVersion()
mawen1250 is offline   Reply With Quote
Old 26th January 2016, 11:40   #8  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r6

BM3D: fixed format checking for "pre" and "flt"
Support zimg included in VS r29 (core.resize)
Depth, ToRGB, ToYUV, BM3D: Added support for 1-7 bit integer output
Added Helper function PlaneAverage()
mawen1250 is offline   Reply With Quote
Old 12th February 2016, 23:20   #9  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,125
my vapoursynth editor crashes when I do this. The error message said "instruction at 0xe744677c referenced memory at 0x00000020. The memory could not be read".

Code:
clip = mvf.BM3D(clip, sigma=[0,0,0], radius1=1)
lansing is offline   Reply With Quote
Old 14th February 2016, 05:08   #10  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Thanks for your reporting.

Practically, it doesn't make sense when sigma is 0 for all planes (theoretically no processing).
Moreover, for V-BM3D, it probably doesn't have an elegant and efficient way to pass through unprocessed planes.

So for BM3D plugin, I won't do anything to deal with sigma=0.
But for mvf.BM3D, it is easy to skip calling BM3D internally, and here's the fix.

Last edited by mawen1250; 14th February 2016 at 05:10.
mawen1250 is offline   Reply With Quote
Old 9th April 2016, 11:02   #11  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r7

Depth: now prefer fmtc.bitdepth for full range content
Depth, ToRGB, ToYUV, BM3D, zDepth: new argument "prefer_props"
ToRGB: new argument "compat" to support CompatBGR32 output
***EXPERIMENTAL*** Added Utility function CheckMatrix()
Added Utility function postfix2infix()
Added Helper function GrayScale()
Added Helper function Preview()
mawen1250 is offline   Reply With Quote
Old 31st July 2016, 14:39   #12  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Update r8

New Main function VFRSplice()
Preview: Set default dither to "random" to avoid banding
Depth, ToRGB, ToYUV, BM3D: When sample conversion is required but 'depth' is not set, use 16-bit for integer and 32-bit for float
LimitFilter: fixed error when thr>0&brighten_thr<=0 or thr<=0&brighten_thr>0
LimitFilter: fixed brighten_thr is not used when elast<=1
Frame properties related fixes
mawen1250 is offline   Reply With Quote
Old 15th August 2016, 22:15   #13  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,125
Can you add a "show noise" option for BM3D for each plane? I wanted to know how much noise did I remove
lansing is offline   Reply With Quote
Old 16th August 2016, 06:36   #14  |  Link
mawen1250
Registered User
 
Join Date: Aug 2011
Posts: 104
Quote:
Originally Posted by lansing View Post
Can you add a "show noise" option for BM3D for each plane? I wanted to know how much noise did I remove
That should be easy to do with std.MakeDiff and hist.Luma (or write an Expr directly).
However this is not a part of the BM3D procedure itself, so I won't add it to the function.

It's a better choice to have a separate function to do the job.
Since the procedure is quite simple, and there're many ways to adjust the difference clip, I couldn't see the convenience to write a function for it...

Last edited by mawen1250; 24th August 2016 at 19:59.
mawen1250 is offline   Reply With Quote
Old 16th August 2016, 15:11   #15  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,125
Quote:
Originally Posted by mawen1250 View Post
That should be easy to do with std.MakeDiff and hist.Luma (or write an Expr directly).
However this is not a part of the BM3D procedure itself, so I won't add it to the function.

It's a better choice to have a single function to do the job.
Since the procedure is quite simple, and there're many ways to adjust the difference clip, I couldn't see the convenience to write a function for it...
I wanted something that's a simple on/off switch to show the noise. I'm going to use it repeatedly so I don't want to go through the hassle of commenting/uncommenting lines of codes every time to do this.

And it's not uncommon for denoise filter to have a show noise option, most of the denoise filters in virtualdub have had a show noise option built in on the same UI. It's just more convenience.
lansing is offline   Reply With Quote
Old 16th August 2016, 17:03   #16  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 711
Quote:
Originally Posted by lansing View Post
I wanted something that's a simple on/off switch to show the noise. I'm going to use it repeatedly so I don't want to go through the hassle of commenting/uncommenting lines of codes every time to do this.
You could always wrap it into a function with a "show_noise" parameter.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:27.


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