PDA

View Full Version : MSharpen for Avisynth 2.5


Guest
13th January 2003, 03:48
Here is MSharpen compiled for Avisynth 2.5. It currently supports only RGB and YUY2.

sh0dan
13th January 2003, 14:07
*cough*

(Yes, I've caught a cold) ;)

Guest
13th January 2003, 14:38
I'm such an idiot. Cough.

wotef
13th January 2003, 14:39
nice, nice

neuron2, do you have any plans to resume development of msmooth?

Guest
13th January 2003, 14:41
Originally posted by wotef
do you have any plans to resume development of msmooth? Yes, of course. The YV12 revolution sort of threw a kink in my plans. :)

sh0dan
13th January 2003, 14:56
You could look at ffdshow's msharpen implementation. I attached the source of the sharpen filters. There is a C and assembler version a little down. Look at my warpsharp port, if you'd like to see how the different variables are mapped.

I converted Warpsharp/Xsharpen, but didn't want to release msharpen, since you said you were working on it yourself.

Edit: I should not that the attachment only contains a source file.

Guest
13th January 2003, 15:06
@sh0dan

If you have coded MSharpen for YV12, by all means please send me the code. :)

sh0dan
13th January 2003, 15:28
No - I didn't - the code from ffdshow isn't pretty, but it seems to do the job well. It only processes luma, but for sharpening, that's probably better. There might be some pitch issues, since ffdshow assumes input pitch = output pitch.

Prettz
13th January 2003, 22:17
This concerns the Avisynth 2.0 version so it might be a little off topic, but your msharpen seems to work miracles at reducing edge noise and ringing in Akira :)
keep up the good work!

Guest
13th January 2003, 22:41
Originally posted by Prettz
This concerns the Avisynth 2.0 version so it might be a little off topic, but your msharpen seems to work miracles at reducing edge noise and ringing in Akira :)
keep up the good work! Considering that MSharpen is designed to apply EE and not reduce it, I find this very surprising. But hey, if it does good things for you...I'm happy. :)

Prettz
22nd January 2003, 03:43
Sorry to bump this old thread, but I have another question concerning where in my script I should use the MSharpen filter. Specifically, my question is whether I should use it before or after convolution3d. I just want to be sure that I don't inadvertantly screw up the quality (even if it isn't noticeable, I just want to be on the safe side).
Here's my script:

LoadPlugin("C:\Program Files\GordianKnot\mpeg2dec.dll")
LoadPlugin("C:\Program Files\GordianKnot\Avisynth2\plugins\Decomb.dll")
LoadPlugin("C:\Program Files\GordianKnot\Avisynth2\plugins\MSharpen.dll")
LoadPlugin("C:\Program Files\GordianKnot\Avisynth2\plugins\Convolution3D.dll")
mpeg2source("C:\Akira\akira_part1_init_02.d2v")
FieldDeinterlace()
Convolution3d(preset="animeLQ")
MSharpen(threshold=15)
BicubicResize(512,288)
Like I mentioned earlier, MSharpen is actually greatly reducing edge noise and ringing for this movie, and it only bumped the filesize up by (if I remember correctly) a hundred KB or so for a 430MB clip.

Guest
22nd January 2003, 04:03
I don't like MSharpen after FieldDeinterlace because it amplifies residual combing. Better to do it this way:

SeparateFields()
MSharpen()
Weave()
FieldDeinterlace()
Convolution3d()
BicubicResize()

I think it's OK before Convolution3d() as long as you use a reasonable threshold for MSharpen(). The areas you want Convolution3d() to clean up are the non-edge areas of MSharpen().

Prettz
22nd January 2003, 04:37
Thanks, I'll try that. Although, after using forced-FILM there aren't very many combed frames, and the ones that are are often in such dark and noisy scenes that after resizing, the frame already looks like it was compressed in mpeg4 :)

Guest
22nd January 2003, 13:48
Originally posted by Prettz
Thanks, I'll try that. Although, after using forced-FILM there aren't very many combed frames, and the ones that are are often in such dark and noisy scenes that after resizing, the frame already looks like it was compressed in mpeg4 :) OK. If it is just catching a few strays your method is probably fine.

Guest
5th April 2003, 15:37
Attached is MSharpen version 1.10 beta 1. It adds low-level optimized support for YV12.

This enhancement was contributed by Klaus Post and Milan Cutka. Thank you!

sh0dan
5th April 2003, 17:54
Did you modify it to only sharpen luma in YV12, or is it just a leftover from the older YUY2 documentation:

In YUY2 and YV12 space it sharpens only the luminance channel.

Guest
5th April 2003, 20:26
Originally posted by sh0dan
Did you modify it to only sharpen luma in YV12, or is it just a leftover from the older YUY2 documentation: It's a leftover. I'll correct it.

The new help file also needs to say Version 1.10 also. Did you miss that? :)

Thanks again for submitting this improvement.

jarthel
7th April 2003, 05:02
thanks Donald.

Jayel

FuPP
7th April 2003, 22:34
Hi Neuron,

hmmm... I get a green screen with this one :

LoadPlugin("C:\video\avsfilters\yv12\MPEG2Dec3.dll")
LoadPlugin("C:\video\avsfilters\yv12\msharpen.dll")
mpeg2source("F:\tests\vts_01.d2v",cpu=0,idct=2)
Crop(26,76,668,424)
MSharpen()
BicubicResize(448,320,0,0.5)
AddBorders(16,128,16,128)

Something with cropping values I guess ?

Regards,
FuPP.

Using avs 2.51 build 04/04

Guest
7th April 2003, 23:49
Did you try anything to isolate the problem? :)

Comment out the Crop, BicubicResize, and AddBorders and tell me what happens.

FuPP
8th April 2003, 08:46
All I can say for now is that it works when Msharpen is after resizing. If you need more, I'm afraid you will have to wait a little bit as I can't do any test at this moment.

Cheers,
FuPP

sh0dan
8th April 2003, 09:01
@FuPP: Interesting! (in the annoying kind of way). Seems to be a rather complex matter, where the resizer is somehow forgetting about the UV planes - strange - strange...


Simplest filter to reproduce:
avisource("br-dk2.avi")
MSharpen()
BicubicResize(320,320)

Source is 720x576. It seems like I made something stupid somewhere. ;)

N_F
8th April 2003, 09:15
Do Bicubicresize have some default values for b and c (you imply it by leaving those values out in your script)? In that case, which?

Wilbert
8th April 2003, 09:45
http://www.avisynth.org/index.php?page=Resize

N_F
8th April 2003, 10:59
Heh... I spent two minutes reading through that before I made the post and another two minutes just now before I found it.

Thanks.

sh0dan
8th April 2003, 15:39
Donald: would you kindly insert an "__asm {emms}" before it returns from the YV12 routines? :rolleyes:

(Now I'll just go and kill myself :sly: )

Guest
8th April 2003, 20:09
Originally posted by sh0dan
Donald: would you kindly insert an "__asm {emms}" before it returns from the YV12 routines? :rolleyes:

(Now I'll just go and kill myself :sly: ) Sure, I'll release it tonight.

Don't kill yourself. I need you to explain some of your Decomb changes.

BTW, have you some aligned malloc/free routines laying about so I won't need the platform SDK to build Decomb?

FuPP
8th April 2003, 20:31
Originally posted by sh0dan
Donald: would you kindly insert an "__asm {emms}" before it returns from the YV12 routines?
Do I still need to do some tests ?...

FuPP.

Guest
8th April 2003, 20:53
Originally posted by FuPP
Do I still need to do some tests? Yes please, Sir. But please wait for a fixed version to be released in about 3 hours from now. Thank you for your assistance.

@sh0dan

I stole the aligned routines from trbarry's mpeg2dec3 (which came from DVD2AVI). Are you happy with those?

Guest
9th April 2003, 00:07
Here is the fixed version. Get the source code from my web site if desired.

FuPP
9th April 2003, 07:53
Seems much better now :)... except using mask=true ;)

Regards,
FuPP

sh0dan
9th April 2003, 10:13
It also shows the chroma mask now. Use greyscale().Limiter() to get the same output as YUY2.

ok - my first missing "emms" had to come sometime. :rolleyes:

[Edit] @donald: Have you updated you HP - I don't seem to be able to find the newest version there..?

Guest
9th April 2003, 13:29
@sh0dan

What is my "HP"?

Wilbert
9th April 2003, 15:30
HomePage ...

Guest
9th April 2003, 16:26
Oh.

Well it's right there.

http://shelob.mordor.net/dgraft/msharpen/msharpen.html

FuPP
9th April 2003, 22:30
@Donald

Have you any plan to replace the standard sharpen kernel with the same kernel used in Xsharpen ? Looks better to my eyes (less "EE effect" for same amount of sharpening effect)

Regards
FuPP

Guest
9th April 2003, 22:58
Originally posted by FuPP
Have you any plan to replace the standard sharpen kernel with the same kernel used in Xsharpen? Looks better to my eyes (less "EE effect" for same amount of sharpening effect)
I don't have any plans in that regard, but you could cobble something up using mask=true together with Layer(). :)

Speaking of XSharpen, I have some ideas for improving the rank-order sharpening and may release an Avisynth version of my own (first XSharpen was my VirtualDub version; some chap ported it to Avisynth).

FuPP
9th April 2003, 23:15
Originally posted by neuron2
I don't have any plans in that regard, but you could cobble something up using mask=true together with Layer().

I will try that :D

Speaking of XSharpen, I have some ideas for improving the rank-order sharpening and may release an Avisynth version of my own

Sounds great !

FuPP

pieter1976
19th May 2004, 14:31
I have been doing some image processing in Delphi and came with the folowing code.

It is used for sharpening:

code (http://home.zonnet.nl/pieterboots/code.htm)

It gave some good results.
Have a look.

Didée
19th May 2004, 15:02
Take this AviSynth script (http://forum.doom9.org/showthread.php?s=&postid=482736#post482736), code a plugin based on it, be done.

If anyone is searching for alternate aspects of sharpening, s/he perhaps might find some in the same thread (http://forum.doom9.org/showthread.php?s=&threadid=74900).

;) Didée