View Full Version : unsharpHQ
list
21st February 2011, 22:47
UnsharpHQ , v05 (updated)
This is a very strong and fast unsharp mask with some new features.
This version is the optimization of the last v03 (also more accurate).
UnsharpHQ is a video plugin for Avisytnh 2.5x.
REQUIRES
* YV12 colorspace input.
* SSE3 capable CPU.
USAGE
UnsharpHQ(int THRESHOLD,float SHARPSTR,float SMOOTH,bool SHOW)
PARAMETERS
(All parameters are optional).
* THRESHOLD: (Default = 20) The value to determine whether or not to sharp a pixel based on the luminance change between their neighbors. Any value >0 can be used.
* SHARPSTR : (Default = 4.0) The sharp strength for the pixels to be sharped. Values from 2 to 10 are recommended.
* SMOOTH : (Default = 0.5) The smooth strength to pixels not sharped. Use this with 0 if you don't want any smooth, or just leave it with default.
* SHOW : (Default = false) The debug or not parameter. Set this to true will show a green video showing the zones to be sharped or not, this is useful to adjust your threshold to your right value.
EXAMPLES
Unsharphq() #All by default, this is useful in most cases.
Unsharphq(20,15.0) #Very strong sharp.
Unsharphq(debug=true) #Run in debug mode.
x86 binary and source -> https://www.mediafire.com/download/1v31aoia38fr06x/UnsharpHQ_v05.zip
leeperry
22nd February 2011, 00:12
I wanna play, can you put it on mediafire.com please?
list
22nd February 2011, 00:16
I wanna play, can you put it on mediafire.com please?
sure, here it is http://www.mediafire.com/download.php?26622393msbo69v
Didée
22nd February 2011, 01:05
So, the HQ mode is using either some sort of edge-masking, or it surpresses very-small differences. I noticed that some "holes" can appear with HQ .... when there is a very thin line at a shallow angle, then some single pixels don't get sharpened, but their neighbors do.
On a sample that intentionally was blurred very strongly, the most pleasing result (for a given strength setting) to my eyes was
Merge( unsharpHQ(str=50,HQ=false), unsharpHQ(str=50,HQ=true) )
list
22nd February 2011, 02:18
I noticed that some "holes" can appear with HQ .... when there is a very thin line at a shallow angle, then some single pixels don't get sharpened, but their neighbors do.)
can you give some image sample? so i can improve it.
henryho_hk
22nd February 2011, 03:01
A 64bit version would be a big plus. ^__^
list
22nd February 2011, 05:14
thaks Didee, i could fix all these "holes" problem and improve the quality a lot. :D
now it's getting a real HQ filter
here is the version 3
Vitaliy Gorbatenko
22nd February 2011, 05:50
Put on mediafire.com please!
list
22nd February 2011, 11:56
Put on mediafire.com please!
ok, link updated, see above
does the doom9 file server work? it works for me. If it doesn't for you, i will stop using it.
kypec
24th February 2011, 10:13
does the doom9 file server work? it works for me. If it doesn't for you, i will stop using it.
Doom9's attachments work fine but sometimes (more often than not) it takes veeeery long time until they're approved by moderator -> thus made available for download to other users :(
list
26th February 2011, 14:02
the optimized version is out =) , see above.
naoan
12th June 2011, 20:11
I really like this sharpener but there's seem to be slight distortion on the right and left most frame when this filter is used, more noticeably on sd material. Any plan to fix this?
list
13th June 2011, 22:49
I really like this sharpener but there's seem to be slight distortion on the right and left most frame when this filter is used, more noticeably on sd material. Any plan to fix this?
thanks, i made a new improved version , but with a different behavior and new parameters, so a will release it in a new filter soon
Mounir
15th June 2011, 18:05
Trying the V0.4 now, getting an error
Merge( unsharpHQ(str=50,HQ=false), unsharpHQ(str=50,HQ=true) ) >>> UnsharpHQ does not have a named argument "HQ"
Nice eh ? Solution please
list
16th June 2011, 21:42
Trying the V0.4 now, getting an error
Merge( unsharpHQ(str=50,HQ=false), unsharpHQ(str=50,HQ=true) ) >>> UnsharpHQ does not have a named argument "HQ"
as i wrote: v0.4 Usage: unsharpHQ(float STR = 5.0)
it does not have a HQ argument :rolleyes:
list
27th January 2014, 22:25
Version 05 released with source.
Francois76l
18th July 2014, 16:23
Hello list!
Thanks for this great update!
I remarked a small bug with this new version. On the image frame, there is "double contour" on the horizontal lower part. I tried with a very small sharp but the problem is still present.
If you could correct this, it would be amazing!
Thanks!
list
18th July 2014, 22:03
Hello list!
Thanks for this great update!
I remarked a small bug with this new version. On the image frame, there is "double contour" on the horizontal lower part. I tried with a very small sharp but the problem is still present.
If you could correct this, it would be amazing!
Thanks!
Hi Francois. Thanks for reporting the bug. I am aware of it.
I can not give a new release right now. Anyway you can manually fix it adding borders. An example script adding overlap in the left and right side would look like this:
#right overlay
AddBorders(2,0,0,0)
overlay(last,x=-1)overlay(last,x=-1)
#left overlay
AddBorders(0,0,2,0)
overlay(last,x=1)overlay(last,x=1)
#apply the filter
UnsharpHQ(20,99,0)
#cut off borders
crop(2,0,-2,0)
I hope this helps you.
Francois76l
18th July 2014, 23:23
OK great!
Does it mean you are aware of this problem?
++
Reel.Deel
6th March 2021, 21:19
If it's not a lot of trouble, can someone compile a 64-bit version of UnsharpHQmod (https://github.com/299792458m/UnsharpHQmod)? I opened an issue on GitHub (https://github.com/299792458m/UnsharpHQmod/issues) but it may be the author is no longer active.
Here's some of the info that is on GitHub but translated:
Added and changed parameters
MODE:
0 - default(equivalent to previous mode)
1 - addded in mod(threshold, sharpstr, smooth parameter effects are little bit changed in this mode), at this mode, SMOOTH=0 is good choice!
SHOW:
may not work... I don't know how to use it properly, so HBD doesn't support it properly, only when opt=1.
OPT:
optimization - 0=auto, 1=C, 2:SSE2, 3:AVX2
Changelog (translated)
mod 200816
Changed to Avisynth2.6+.
HBD (8-16 YUV only) support + AVX2 optimization, opt added to parameters.
Intrinsic asm.
mod 190119
Fixed loop range.
Changed correction weights from 4 to 8 (this will slightly change the output even in mode0)
Modify correction weights in mode1 so that they become 1 when the difference between the center point and the neighborhood of 8 is THRESHOLD.
mod 181224
Added MODE=1, which modifies something that seems to be wrong (MODE=0 is compatible with the previous version).
Note that MODE1 is not parameter compatible with the previous version.
Don't worry about errors related to MODE, as I didn't do it properly.
Also, I just rebuilt it with VS2017 and it's 10% faster for some reason.
real.finder
8th March 2021, 14:53
seems it has missing some asm functions so I couldn't build it
Reel.Deel
9th March 2021, 05:14
seems it has missing some asm functions so I couldn't build it
Thanks for trying. Today Asd built the binaries and put them up on http://avisynth.nl/index.php/AviSynth%2B_x64_plugins
:thanks: Asd :)
pinterf
10th March 2021, 09:15
How did you come to know about it?
tormento
10th March 2021, 16:13
Thanks for trying. Today Asd built the binaries and put them up on
Is the UnsharpHQmod filter? I can't find any other.
Reel.Deel
10th March 2021, 18:39
How did you come to know about it?
About the plugin or the binaries that Asd uploaded?
Is the UnsharpHQmod filter? I can't find any other.
Yes, UnsharpHQmod is the filter.
StainlessS
10th March 2021, 20:49
Hopefully of use to someone. I did a google translate of a couple of files from the zip.
unsharpHQmod.txt
/*
UnsharpHQ ver 0.5
Copyright (c) 2011-2014, Lucas De Lio (lucasdelio@gmail.com).
mod by 299792458m
This file is part of UnsharpHQ.
UnsharpHQ is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
UnsharpHQ is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with UnsharpHQ. If not, see <http://www.gnu.org/licenses/>.
*/
UnsharpHQ is a video plugin for Avisytnh 2.5x.
REQUIRES
* YUV colorspace input.
* optimize for SSE2/AVX capable CPU.
USAGE
UnsharpHQ(int THRESHOLD,float SHARPSTR,float SMOOTH,bool SHOW)
PARAMETERS
(All parameters are optional).
* THRESHOLD: (Default = 20) The value to determine whether or not to sharp a pixel based on the luminance change between their neighbors. Any value >0 can be used.
* SHARPSTR : (Default = 4.0) The sharp strength for the pixels to be sharped. Values from 2 to 10 are recommended.
* SMOOTH : (Default = 0.5) The smooth strength to pixels not sharped. Use this with 0 if you don't want any smooth, or just leave it with default.
* SHOW : (Default = false) The debug or not parameter. Set this to true will show a green video showing the zones to be sharped or not, this is useful to adjust your threshold to your right value.
EXAMPLES
Unsharphq() #All by default, this is useful in most cases.
Unsharphq(20,15.0) #Very strong sharp.
Unsharphq(debug=true) #Run in debug mode.
--------------------------------------------------------------------------
mod by 299792458m
mod 181224 いろいろ
mod 190119 ループの範囲を修正
補正重みを4→8に(これによりmode0でも出力が微妙に変更される)
mode1での補正重みを中央点と8近傍の差分がTHRESHOLDの時に1になるように修正
mod 200816 Avisynth2.6+化
HBD(8-16 YUVのみ)対応+AVX2最適化
HBD時のshowを無効化
asmのintrinsic化
modのメモ
* MODE :0(従来相当のはず)
:1 mod版で追加 パラメータの効果が変わるので分けてる
* SHOW :いまいち使い方がわからないのでHBDではちゃんとした対応をしていない
* OPT :0=auto 1=compiler optimazation 2:SSE2 3:AVX2
元々の仕様説明
■8近傍点からフィルタをかける
- - i - -
- j - k -
l - X - m
- n - o -
- - p - -
dst=org + funcion[diff] *(org-avr)/ocho;
(より正確にはdst=( org*(ocho + funcion[diff]) - avr*funcion[diff]) )/ocho;)
ocho:重み 内部で4が使われている→8に変更(以前のバージョンでは16だったらしい)
diff=sum(|X-y|) y=i,j,k,..p
avr=sum(y)/8 y=i,j,k,..p
■funcion[]という差分→係数の変換テーブルを持っている
funcion[i]=A*atan((i-giro)/curv)+S; i=0..255
giro=thresh(フィルタオプションの)
curv=30(内部係数)
A,S:(atanMIN,atanMAX) →(MIN,MAX)の線形写像の係数
MIN= -SMOOTH-1;
MAX= SHARPSTR+1;
>>>>>>>>>>>>>>>>>>>>>>>>>>> Translate
mod by 299792458m
mod 181224 Various
mod 190119 Fixed loop range
Correction weight changed from 4 to 8 (this causes the output to change slightly even in mode0)
Corrected the correction weight in mode1 so that the difference between the center point and the vicinity of 8 becomes 1 when THRESHOLD.
mod 200816 Avisynth 2.6+
HBD (8-16 YUV only) compatible + AVX2 optimization
Disable show during HBD
asm intrinsic
mod notes
* MODE: 0 (should be equivalent to conventional)
The effect of the additional parameters changes in the 1 mod version, so they are separated.
* SHOW: I don't know how to use it, so HBD doesn't support it properly.
* OPT: 0 = auto 1 = compiler optimazation 2: SSE2 3: AVX2
.
Original specification description
■ 8 Filter from nearby points
- - i - -
- j - k -
l - X - m
- n - o -
- - p - -
dst = org + funcion [diff] * (org-avr) / ocho ;
(More precisely, dst = (org * (ocho + funcion [diff]) --avr * funcion [diff])) / ocho;)
ocho: 4 is used inside the weight → changed to 8 (it seems that it was 16 in the previous version)
diff = sum (| X-y |) y = i, j, k, ..p
avr = sum (y) / 8 y = i, j, k, ..p
■ It has a conversion table of difference → coefficient called funcion []
funcion [i] = A * atan ((i-giro) / curv) + S; i = 0.255
giro = thresh (filter option)
curv = 30 (internal coefficient)
A, S: (atanMIN, atanMAX) → (MIN, MAX) linear map coefficient
MIN = -SMOOTH-1;
MAX = SHARPSTR + 1;
EDIT: Fixed formatting in above like so [Spaces had been converted to hyphens by translate]
■ 8 Filter from nearby points
- - i - -
- j - k -
l - X - m
- n - o -
- - p - -
README.md [ Edit: I dont know that *.md (markup description, maybe), It may not display correctly in md viewer ]
# UnsharpHQmod
a fork of list's UnsharpHQ
UnsharpHQ is a video plugin for Avisynth
## PARAMETERS
(All parameters are optional).
* THRESHOLD: (Default = 20) The value to determine whether or not to sharp a pixel based on the luminance change between their neighbors. Any value >0 can be used.
* SHARPSTR : (Default = 4.0) The sharp strength for the pixels to be sharped. Values from 2 to 10 are recommended.
* SMOOTH : (Default = 0.5) The smooth strength to pixels not sharped. Use this with 0 if you don't want any smooth, or just leave it with default.
EXAMPLES
Unsharphq() #All by default, this is useful in most cases.
Unsharphq(20,15.0) #Very strong sharp.
--------------------------------------------------------------------------
### modのメモ
UnsharpHQ(THRESHOLD=64,SHARPSTR=2.5,SMOOTH=0,mode=1) #weak sharp I use like this
#### added and changed parameters
* MODE :0 default(従来相当)
:1 addded in mod(threshold, sharpstr,smooth parameter effects are little bit changed in this mode)
at this mode, SMOOTH=0 is good choice!
mod版で追加 パラメータの効果が変わるので分けてる
* SHOW :may not work... いまいち使い方がわからないのでHBDではちゃんとした対応をしていない opt=1の時のみ対応
* OPT :optimization 最適化 0=auto 1=C 2:SSE2 3:AVX2
### 変更履歴 mod by 299792458m
- mod 200816
- Avisynth2.6+化
- HBD(8-16 YUVのみ)対応+AVX2最適化、パラメータにopt追加
- asmのintrinsic化
- mod 190119
- ループの範囲を修正
- 補正重みを4→8に(これによりmode0でも出力が微妙に変更される)
- Mode1での補正重みを中央点と8近傍の差分がTHRESHOLDの時に1になるように修正
- mod 181224 いろいろ
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Translation
### mod notes
UnsharpHQ (THRESHOLD = 64, SHARPSTR = 2.5, SMOOTH = 0, mode = 1) #weak sharp I use like this
#### added and changed parameters
* MODE: 0 default (conventional equivalent)
1 addedded in mod (threshold, sharpstr, smooth parameter effects are little bit changed in this mode)
at this mode, SMOOTH = 0 is good choice!
Since the effect of the additional parameter changes in the mod version, it is divided
* SHOW: may not work ... I don't know how to use it, so HBD doesn't support it properly. Only when opt = 1.
* OPT: optimization optimization 0 = auto 1 = C 2: SSE2 3: AVX2
### Change history mod by 299792458m
--mod 200816
--Avisynth 2.6+ conversion
--HBD (8-16 YUV only) compatible + AVX2 optimization, opt added to parameters
--asm intrinsic
--mod 190119
--Fixed loop range
--Correction weight changed from 4 to 8 (This slightly changes the output even in mode0)
--Corrected the correction weight in Mode 1 so that the difference between the center point and the vicinity of 8 becomes 1 when THRESHOLD.
--mod 181224 Various
EDIT: Method:- https://forum.doom9.org/showthread.php?p=1899507#post1899507
pinterf
10th March 2021, 21:11
About the plugin or the binaries that Asd uploaded?.
About the fact that he took care of it. Though yes, one can check Asd's repo if it's ready yet. Luckily Asd is very a productive developer.
Reel.Deel
10th March 2021, 22:25
About the fact that he took care of it. Though yes, one can check Asd's repo if it's ready yet. Luckily Asd is very a productive developer.
Asd has updated a few plugins that are not on GitHub. I just happen to be fixing a few links on the wiki earlier and checked recent changes and saw that he added a link to UnsharpHQmod on the x64 page. Asd updated the link once again, now UnsharpHQmod passes frame properties :).
Side note: Asd also compiled an updated Deblock from 299792458m (https://github.com/299792458m/Avisynth-Deblock) that includes optimized code for 8-16bit input. Link to download is on the the wiki x64 plugins page.
pinterf
10th March 2021, 23:16
Asd has updated a few plugins that are not on GitHub. I just happen to be fixing a few links on the wiki earlier and checked recent changes and saw that he added a link to UnsharpHQmod on the x64 page. Asd updated the link once again, now UnsharpHQmod passes frame properties :).
Side note: Asd also compiled an updated Deblock from 299792458m (https://github.com/299792458m/Avisynth-Deblock) that includes optimized code for 8-16bit input. Link to download is on the the wiki x64 plugins page.
I remember 299792458m who added some interesting SIMD parts to TIVTC which I did not have time to backport and reorganize a bit and test. Eventually, I forgot about it. Now I have put it in the queue for myself. The repo has been shown to me before probably by you?
Reel.Deel
11th March 2021, 02:57
I remember 299792458m who added some interesting SIMD parts to TIVTC which I did not have time to backport and reorganize a bit and test. Eventually, I forgot about it. Now I have put it in the queue for myself. The repo has been shown to me before probably by you?
Yep, back in April 2019.
I used to find a lot of the Japanese authors on 2ch, back when I started the x64 page on the wiki, a handful of plugins I found on 2ch, MVTools, NNEDI3, AWarpSharp2, etc.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.