PSharpen Refuses To Work
- Melichan923
- Joined: Tue May 30, 2006 8:21 am
- Location: New Hampshire
- Contact:
PSharpen Refuses To Work
After hours of struggling last night, I finally came to the board to ask for help. Scintilla suggested a wonderful filter to me called pSharpen in one of my previous threads, but I cannot get it to load in AviSynth no matter what I try. I get an error that says, "There is no function named pSharpen."
Here are the steps I've taken to try to get this to work:
- I copied the code from here: http://forum.doom9.org/showthread.php?p ... post683344.
- I made an AviSynth file named pSharpen and changed the extension to .avsi, put the code in it, saved it, and put it in my plugins folder.
- I tried adding pSharpen() to my current script and got the error message.
- I then tried making it load manually by using LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avsi") and Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avsi"), but I got an error message both times that said it was unable to load or open.
- I thought maybe a filter I had in the script along with it was conflicting with it, so I removed everything but pSharpen(), but nothing changed.
- Finally, I thought I needed to upgrade AviSynth, but I checked the version and it should work in my version: 2.57
I have no idea what else I can try. I used to be able to get plugins to work when I changed the extension to .avsi, but not anymore. It still says that the file is an "AviSynth Script" and not an "AviSynth Autoload Script" when I click on the file that I changed to .avsi. I don't know if that has anything to do with the problem though. Usually when I download a filter from a ZIP or RAR with the .dll file I can get it to work, but I can't find pSharpen uploaded anywhere. Maybe I need to try updating something?
I know too many files in the plugins folder can cause problems, so if it helps answer any questions, I have 78 files in my plugins folder.
Is there anything else I can try to get this filter to work?
Here are the steps I've taken to try to get this to work:
- I copied the code from here: http://forum.doom9.org/showthread.php?p ... post683344.
- I made an AviSynth file named pSharpen and changed the extension to .avsi, put the code in it, saved it, and put it in my plugins folder.
- I tried adding pSharpen() to my current script and got the error message.
- I then tried making it load manually by using LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avsi") and Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avsi"), but I got an error message both times that said it was unable to load or open.
- I thought maybe a filter I had in the script along with it was conflicting with it, so I removed everything but pSharpen(), but nothing changed.
- Finally, I thought I needed to upgrade AviSynth, but I checked the version and it should work in my version: 2.57
I have no idea what else I can try. I used to be able to get plugins to work when I changed the extension to .avsi, but not anymore. It still says that the file is an "AviSynth Script" and not an "AviSynth Autoload Script" when I click on the file that I changed to .avsi. I don't know if that has anything to do with the problem though. Usually when I download a filter from a ZIP or RAR with the .dll file I can get it to work, but I can't find pSharpen uploaded anywhere. Maybe I need to try updating something?
I know too many files in the plugins folder can cause problems, so if it helps answer any questions, I have 78 files in my plugins folder.
Is there anything else I can try to get this filter to work?
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
What happens if you rename the file to .AVS and load it with:
<b>Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avs")</b>
If even that doesn't work, then you've got serious problems.
Do you have any other filters in .AVSI functions in your plugins directory (LimitedSharpen, mfToon, derainbowers)? Do they still work normally?
And, of course, it never hurts to
<b>Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avs")</b>
If even that doesn't work, then you've got serious problems.
Do you have any other filters in .AVSI functions in your plugins directory (LimitedSharpen, mfToon, derainbowers)? Do they still work normally?
And, of course, it never hurts to

- Melichan923
- Joined: Tue May 30, 2006 8:21 am
- Location: New Hampshire
- Contact:
Yes, I had already tried it and for the heck of it, tried it again just now when you suggested it, no luck.Scintilla wrote:What happens if you rename the file to .AVS and load it with:
<b>Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avs")</b>

I get an error message that says, "Import: Couldn't open 'C:\Program Files\AviSynth 2.5\plugins\pSharpen.avs'"
Scintilla wrote:If even that doesn't work, then you've got serious problems.

Yes, I do. I have four that have .avsi at the end including pSharpen. I just tested them all out. None of them work. The only ones working with that extension have another file next to them with the same name not in that format. Meaning, I probably downloaded them from a zip.Scintilla wrote:Do you have any other filters in .AVSI functions in your plugins directory (LimitedSharpen, mfToon, derainbowers)? Do they still work normally?
I could never get FastLineDarken or DeHalo to work ages ago either. I remember now since I see them in the folder. They are there still not working with their extension changed to .avsi.
True.Scintilla wrote:And, of course, it never hurts to

My script:
Code: Select all
Import("C:\Program Files\AviSynth 2.5\plugins\pSharpen.avs")
MPEG2Source("C:\Documents and Settings\Desktop\dvdone.d2v", cpu=6)
BiFrost()
deint = TDeint(mode=2, mtnmode=3, blim=100)
TFM(cthresh=4, slow=2, clip2=deint)
TDecimate(mode=1)
Crop(4,0,-4,-0)
Lanczos4Resize(640,480)
ttempsmooth(maxr=5, lthresh=7, cthresh=8, lmdiff=4, cmdiff=6, strength=5, fp=true, vis_blur=0)
undot()
pSharpen()
Converttorgb32()
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
- Melichan923
- Joined: Tue May 30, 2006 8:21 am
- Location: New Hampshire
- Contact:
Yes, Notepad. I'm really hoping it's just something that's outdated and will fix when I re-install something.Scintilla wrote:Well, that's sure troubling. Just to be sure, you did save the AVSI file with a plain text editor such as Notepad, and not something like MS Word, right?

Not sure if this will help any, but this is the exact code I am putting into the .avsi file:
Code: Select all
function pSharpen (clip clp,
\int "strength", int "threshold",
\float "ss_x", float "ss_y",
\float "dest_x", float "dest_y")
{
# getting the input image size
ox = clp.width
oy = clp.height
# parsing the input values
strength = default(strength, 25)
threshold = default(threshold, 75)
ss_x = default(ss_x, 1.0)
ss_y = default(ss_y, 1.0)
dest_x = default(dest_x, ox)
dest_y = default(dest_y, oy)
strength = strength<0>100? 100 : strength
threshold = threshold<0>100? 100 : threshold
ss_x = ss_x<1.0? 1.0 : ss_x
ss_y = ss_y<1.0? 1.0 : ss_y
# oversampling
clp = ss_x!=1.0 || ss_y!=1.0 ?
\clp.lanczosresize(round(ox*ss_x/8)*8,round(oy*ss_y/8)*8) :
\clp
# val is initialized with the input luma value
val = clp.greyscale()
# calculating the max and min in every 3*3 square
max = val.expand()
min = val.inpand()
# normalizing max and val to values from 0 to (max-min)
nmax = yv12subtract(max,min,0,false)
nval = yv12subtract(val,min,0,false)
# initializing the strings used to obtain the output luma value
s = string(strength/100.0)
t = string(threshold/100.0)
x0 = string((threshold/100.0)*(1.0-strength/100.0)/(1.0-(1.0-threshold/100.0)*(1.0-strength/100.0)))
expr = \
"x y / 2 * 1 - abs "+x0+" < " +\
s+" 1 = " +\
"x y 2 / = 0 y 2 / ? " +\
"x y / 2 * 1 - abs 1 "+s+" - / " +\
"? " +\
"x y / 2 * 1 - abs 1 "+t+" - * "+t+" + " +\
"? " +\
"x y 2 / > 1 -1 ? * 1 + y * 2 /"
# calculates the new luma value pushing it towards min or max
nval = yv12lutxy(nval,nmax,expr)
# normalizing val to values from min to max
val = yv12lutxy(nval,min,"x y +")
# applying the new luma value to the original clip
clp = clp.mergeluma(val)
# resizing the image to the output values
clp = ss_x!=1.0 || ss_y!=1.0 || dest_x!=ox || dest_y!=oy ? clp.lanczosresize(dest_x,dest_y) : clp
return clp
}
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
- Melichan923
- Joined: Tue May 30, 2006 8:21 am
- Location: New Hampshire
- Contact:
Yes. However, I think something is starting to kick in when I tried it again this morning. I did as I usually do but instead of getting the normal error message when trying to view it I got this:Scintilla wrote:And when you save the file, the "Encoding" option in the Save dialog box is set to "ANSI"?
" Script Error: There is no function named 'expand.' "
And it's pointing to the line that pSharpen is on. Any ideas?
- Kariudo
- Twilight prince
- Joined: Fri Jul 15, 2005 11:08 pm
- Status: 1924 bots banned and counting!
- Location: Los taquitos unidos
- Contact:
- Melichan923
- Joined: Tue May 30, 2006 8:21 am
- Location: New Hampshire
- Contact:
- Scintilla
- (for EXTREME)
- Joined: Mon Mar 31, 2003 8:47 pm
- Status: Quo
- Location: New Jersey
- Contact:
Then you'll need MaskTools 1.5.8 as well, which can be found here:
http://manao4.free.fr/MaskTools-v1.5.8.zip
Funny that it suddenly started working again...
http://manao4.free.fr/MaskTools-v1.5.8.zip
Funny that it suddenly started working again...