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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 27th September 2015, 13:41   #1  |  Link
Overdrive80
Anime addict
 
Overdrive80's Avatar
 
Join Date: Feb 2009
Location: Spain
Posts: 664
[Solved] Check if porting is proper

Hi, folks. I am porting some functions for beginning to use vapoursynth.

I need convert this function:

Code:
function BrightDfttestMod(clip input, float "sbright", float "smedium", float "sdark", 
 \        int "th_low", int "th_med", int "th_high", int "tbsize", bool "lsb", int "mode")
{


sbright       = default( sbright,  0 ) 
smedium       = default( smedium,  0 )
sdark         = default( sdark,    0 ) 

th_low        = default( th_low,   20 ) 
th_med        = default( th_med,   40 ) 
th_high       = default( th_high, 100 ) 

lsb	      = default( lsb, false )
mode	      = default( mode, 0    )


bright = (sbright > 0 && lsb==false) ? input.dfttest(sigma = sbright,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb):\
 	 (sbright > 0 && lsb==true)  ? input.dfttest(sigma = sbright,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb).ditherpost(mode=mode) : input
medium = (smedium > 0 && lsb==false) ? input.dfttest(sigma = smedium,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb):\
	 (smedium > 0 && lsb==true)  ? input.dfttest(sigma = smedium,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb).ditherpost(mode=mode) : input
dark   = (sdark   > 0 && lsb==false) ? input.dfttest(sigma = sdark,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb)  :\
	 (sdark   > 0 && lsb==true)  ? input.dfttest(sigma = sdark,tbsize=tbsize,sbsize=18,sosize=9,lsb=lsb).ditherpost(mode=mode) : input

mmask = medium.levels(th_med, 1.0, th_high, 255, 0, false)		   
dmask = medium.levels(th_low, 1.0, th_med,  255, 0, false)

output = bright.mt_merge(medium, mmask, U=3, V=3, luma=true) 
         \  .mt_merge(dark, dmask, U=3, V=3, luma=true)

return output
}
Other question is how could test this function, where put this file.py??

Thanks
__________________
Intel i7-6700K + Noctua NH-D15 + Z170A XPower G. Titanium + Kingston HyperX Savage DDR4 2x8GB + Nvidia GTX750 2GB DDR5 + SSD Vertex 4 256 GB + Antec EDG750 80 Plus Gold Mod + Corsair 780T Graphite

Last edited by Overdrive80; 1st October 2015 at 20:16. Reason: Edit code
Overdrive80 is offline   Reply With Quote
 

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:53.


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