<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://avisynth.nl/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=SharpenComplex2_source</id>
		<title>SharpenComplex2 source - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://avisynth.nl/index.php?action=history&amp;feed=atom&amp;title=SharpenComplex2_source"/>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;action=history"/>
		<updated>2026-04-07T12:31:01Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.24</generator>

	<entry>
		<id>http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=10843&amp;oldid=prev</id>
		<title>Brainiac at 17:41, 14 January 2020</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=10843&amp;oldid=prev"/>
				<updated>2020-01-14T17:41:43Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 17:41, 14 January 2020&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# edgethr is the threshold for an edge on an arbitrary scale, default 0.2&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# edgethr is the threshold for an edge on an arbitrary scale, default 0.2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# if debug is true, then the edge mask is returned instead&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# if debug is true, then the edge mask is returned instead&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# for the stacked 16-bit version, there's no debug parameter&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# for the stacked 16-bit version, there's no debug parameter&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# lsb_in if true treats the input as a stacked 16-bit clip, default true&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# lsb_in if true treats the input as a stacked 16-bit clip, default true&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# (output is the same format as the input by default)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# (output is the same format as the input by default)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# mode is for the DitherPost mode, default 0 (see Dither docs)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# mode is for the DitherPost mode, default 0 (see Dither docs)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# recommendation: just use a regular unsharp filter, don't bother with this&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# recommendation: just use a regular unsharp filter, don't bother with this&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# unless you're going to set the unsharp amount/kernels (in which case this&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# unless you're going to set the unsharp amount/kernels (in which case this&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# though, if the source is banding-prone or with non-default unsharp&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# though, if the source is banding-prone or with non-default unsharp&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# amounts/kernels.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# amounts/kernels.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# requirements: MaskTools v2 (for both the regular and 16-bit functions)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;# requirements: MaskTools v2 (for both the regular and 16-bit functions)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  Dither package (16-bit only)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;#&amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160; &amp;#160;  Dither package (16-bit only)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Brainiac</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7427&amp;oldid=prev</id>
		<title>Raffriff42: Category:Script_Source-&gt;Scripts</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7427&amp;oldid=prev"/>
				<updated>2015-12-13T23:04:23Z</updated>
		
		<summary type="html">&lt;p&gt;Category:Script_Source-&amp;gt;Scripts&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 23:04, 13 December 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Script_source&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[[Category:&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Scripts&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;source: http://pastebin.com/bYCeusjT&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;source: http://pastebin.com/bYCeusjT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7129&amp;oldid=prev</id>
		<title>Raffriff42: added category</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7129&amp;oldid=prev"/>
				<updated>2015-11-12T07:38:27Z</updated>
		
		<summary type="html">&lt;p&gt;added category&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr valign='top'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 07:38, 12 November 2015&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Script_source]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;source: http://pastebin.com/bYCeusjT&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;source: http://pastebin.com/bYCeusjT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	<entry>
		<id>http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7112&amp;oldid=prev</id>
		<title>Raffriff42: source, from pastebin.com</title>
		<link rel="alternate" type="text/html" href="http://avisynth.nl/index.php?title=SharpenComplex2_source&amp;diff=7112&amp;oldid=prev"/>
				<updated>2015-11-12T06:48:43Z</updated>
		
		<summary type="html">&lt;p&gt;source, from pastebin.com&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;source: http://pastebin.com/bYCeusjT&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# [insert rant about how I can't register on Doom9]&lt;br /&gt;
# port of MPC-HC's Sharpen Complex 2 to Avisynth&lt;br /&gt;
# http://forum.doom9.org/showthread.php?t=158385&lt;br /&gt;
# (I'm assuming it works correctly because MPC-HC refuses to run in Wine)&lt;br /&gt;
# previous version: http://pastebin.com/gamRgbgD&lt;br /&gt;
# only processes luma&lt;br /&gt;
# str0 is the non-edge unsharp amount, default 2.0&lt;br /&gt;
# str1 is the edge unsharp amount, default 1.125&lt;br /&gt;
# k0 is the non-edge blur kernel, default &amp;quot;3 14 3&amp;quot;&lt;br /&gt;
# k1 is the edge blur kernel, default &amp;quot;1 1 1&amp;quot;&lt;br /&gt;
# the kernels must have odd lengths (as required by mt_convolution)&lt;br /&gt;
# edgethr is the threshold for an edge on an arbitrary scale, default 0.2&lt;br /&gt;
# if debug is true, then the edge mask is returned instead&lt;br /&gt;
&lt;br /&gt;
# for the stacked 16-bit version, there's no debug parameter&lt;br /&gt;
# lsb_in if true treats the input as a stacked 16-bit clip, default true&lt;br /&gt;
# lsb if true leaves the output as stacked 16-bit, otherwise it's dithered&lt;br /&gt;
# (output is the same format as the input by default)&lt;br /&gt;
# mode is for the DitherPost mode, default 0 (see Dither docs)&lt;br /&gt;
&lt;br /&gt;
# recommendation: just use a regular unsharp filter, don't bother with this&lt;br /&gt;
# unless you're going to set the unsharp amount/kernels (in which case this&lt;br /&gt;
# script actually becomes useful; the default edge/non-edge filters are&lt;br /&gt;
# sufficiently similar to be pointless). the 16-bit version is an extra serving&lt;br /&gt;
# of pointlessness because it's almost visually identical to the 8-bit version&lt;br /&gt;
# with the default settings and it's significantly slower; it might be useful&lt;br /&gt;
# though, if the source is banding-prone or with non-default unsharp&lt;br /&gt;
# amounts/kernels.&lt;br /&gt;
&lt;br /&gt;
# requirements: MaskTools v2 (for both the regular and 16-bit functions)&lt;br /&gt;
#               Dither package (16-bit only)&lt;br /&gt;
&lt;br /&gt;
function SharpenComplex2(clip src,float &amp;quot;str0&amp;quot;,float &amp;quot;str1&amp;quot;,string &amp;quot;k0&amp;quot;,string &amp;quot;k1&amp;quot;,float &amp;quot;edgethr&amp;quot;,bool &amp;quot;debug&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
str0=default(str0,2.0)   # corresponds to CoefFlou&lt;br /&gt;
str1=default(str1,1.125) # corresponds to Sharpen_val1 * 9&lt;br /&gt;
&lt;br /&gt;
k0=default(k0,&amp;quot;3 14 3&amp;quot;) # ~ Gaussian blur with sigma^2=0.3&lt;br /&gt;
k1=default(k1,&amp;quot;1 1 1&amp;quot;)  # ~ Gaussian blur with sigma^2=1/3=0.333...&lt;br /&gt;
#the 3 14 3 kernel is derived from assuming linear interpolation in the original&lt;br /&gt;
#code; you can set it to other kernels based on other interpolators, but bear in&lt;br /&gt;
#mind that blurrier interpolators lead to more sharpening&lt;br /&gt;
&lt;br /&gt;
edgethr=default(edgethr,0.2) # corresponds to SharpenEdge&lt;br /&gt;
&lt;br /&gt;
src&lt;br /&gt;
&lt;br /&gt;
unsharp0=mt_lutxy(src,mt_convolution(k0,k0),&amp;quot;x x y - &amp;quot;+string(str0)+&amp;quot; * +&amp;quot;,chroma=&amp;quot;copy&amp;quot;)&lt;br /&gt;
unsharp1=mt_lutxy(src,mt_convolution(k1,k1),&amp;quot;x x y - &amp;quot;+string(str1)+&amp;quot; * +&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
sobelh=mt_convolution(&amp;quot;-1 0 1&amp;quot;,&amp;quot;1 2 1&amp;quot;,saturate=false,total=1.)&lt;br /&gt;
sobelv=mt_convolution(&amp;quot;1 2 1&amp;quot;,&amp;quot;-1 0 1&amp;quot;,saturate=false,total=1.)&lt;br /&gt;
edgemask=mt_lutxy(sobelh,sobelv,&amp;quot;x x * y y * + 0.5 ^ 255 / &amp;quot;+string(edgethr)+&amp;quot; &amp;gt; 255 0 ?&amp;quot;)&lt;br /&gt;
default(debug,false) ? edgemask.grayscale : mt_merge(unsharp0,unsharp1,edgemask)&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function SharpenComplex2_16(clip src,float &amp;quot;str0&amp;quot;,float &amp;quot;str1&amp;quot;,string &amp;quot;k0&amp;quot;,string &amp;quot;k1&amp;quot;,float &amp;quot;edgethr&amp;quot;,bool &amp;quot;lsb_in&amp;quot;,bool &amp;quot;lsb&amp;quot;,int &amp;quot;mode&amp;quot;)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
str0=default(str0,2.0)&lt;br /&gt;
str1=default(str1,1.125)&lt;br /&gt;
&lt;br /&gt;
k0=&amp;quot;impulse &amp;quot;+default(k0,&amp;quot;3 14 3&amp;quot;)&lt;br /&gt;
k1=&amp;quot;impulse &amp;quot;+default(k1,&amp;quot;1 1 1&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
edgethr=default(edgethr,0.2)&lt;br /&gt;
&lt;br /&gt;
lsb_in=default(lsb_in,true)&lt;br /&gt;
lsb=default(lsb,lsb_in)&lt;br /&gt;
&lt;br /&gt;
mode=default(mode,0)&lt;br /&gt;
&lt;br /&gt;
lsb_in ? src : src.Dither_convert_8_to_16&lt;br /&gt;
&lt;br /&gt;
o=last&lt;br /&gt;
&lt;br /&gt;
w=width()&lt;br /&gt;
h=height()/2&lt;br /&gt;
&lt;br /&gt;
blur0=Dither_resize16(w,h,kernel=k0,fh=-1,fv=-1,center=false,u=1,v=1)&lt;br /&gt;
blur1=Dither_resize16(w,h,kernel=k1,fh=-1,fv=-1,center=false,u=1,v=1)&lt;br /&gt;
unsharp0=Dither_add16(last,Dither_lut16(Dither_add16(last,Dither_lut16(blur0,&amp;quot;65535 x -&amp;quot;),dif=true),string(str0)+&amp;quot; x 32767 - * 32768 +&amp;quot;),dif=true)&lt;br /&gt;
unsharp1=Dither_add16(last,Dither_lut16(Dither_add16(last,Dither_lut16(blur1,&amp;quot;65535 x -&amp;quot;),dif=true),string(str1)+&amp;quot; x 32767 - * 32768 +&amp;quot;),dif=true)&lt;br /&gt;
#this is why Dither needs subtraction and multiplication utility functions&lt;br /&gt;
&lt;br /&gt;
#edge mask computation doesn't require higher precision&lt;br /&gt;
#(more like there's no lutxy for 16-bit)&lt;br /&gt;
lsb_in?src.DitherPost(mode=-1):src&lt;br /&gt;
sobelh=mt_convolution(&amp;quot;-1 0 1&amp;quot;,&amp;quot;1 2 1&amp;quot;,saturate=false,total=1.)&lt;br /&gt;
sobelv=mt_convolution(&amp;quot;1 2 1&amp;quot;,&amp;quot;-1 0 1&amp;quot;,saturate=false,total=1.)&lt;br /&gt;
edgemask=mt_lutxy(sobelh,sobelv,&amp;quot;x x * y y * + 0.5 ^ 255 / &amp;quot;+string(edgethr)+&amp;quot; &amp;gt; 255 0 ?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
Dither_merge16_8(unsharp0,unsharp1,edgemask)&lt;br /&gt;
MergeLuma(o,last)&lt;br /&gt;
&lt;br /&gt;
lsb ? last : DitherPost(mode=mode)&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Raffriff42</name></author>	</entry>

	</feed>