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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st December 2003, 20:04   #1  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
Partially debugged version of the MaskTools : 1.5.6

I corrected the issue with functions Inpand / Expand ( and normally also Inflate / Deflate, but I didn't check these ones ).

There were in fact several issues, one of them being the MMX version of these functions, so for the moment, you can't have these 4 functions mmxed.

Please report any bugs / slowdown you may encounter with this version. Especially slowdown in fact, since I'm clearly no expert with VC++ ( first time I used it ). I only checked speed with Binarize, it was as fast as with the former version ( 1.4.1 ), so I hope it'll the same with other functions.

Finally, I didn't ask Kurosu the permission to do that ( no mail adress in his readme ), so I hope he won't mind.

You'll find the new version here

Edit : Inflate and deflate work too.

Last edited by Manao; 3rd January 2005 at 07:39.
Manao is offline   Reply With Quote
Old 21st December 2003, 21:41   #2  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Would it be possible to add YUY2 support?
Chainmax is offline   Reply With Quote
Old 21st December 2003, 22:03   #3  |  Link
K-Dash
nooblar
 
K-Dash's Avatar
 
Join Date: Jan 2003
Location: Norway
Posts: 54
Link broken.
K-Dash is offline   Reply With Quote
Old 21st December 2003, 22:19   #4  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
Chainmax : it would be possible, with a lot of time. But I don't really think it's useful, since most of the filters are working in YV12 ( except Dust ). So it's not one of my priorities yet. For what purpose would you have the use of an YUY2 version ?

K-Dash : link is working, I'll make myself clearer : right click on the link, do 'copy adress', paste it in your adress bar, it'll work ( at least it's working for me ). I emphasised that sentence in my first post.

@all : I'll be away from my computer for 2 weeks soon, so I'll cope with the most obvious bugs first ( and there are plenty ). Another version should be up for tomorrow, correcting the multiple use of a same function with different mode. ( right now, except for expand / inpand / deflate / inflate, using more than once a function with a different mode always applies the function with the same mode ).

Edit : oups, my bad, only the 4 I corrected were subject to this bug. I should have read the changelog

Last edited by Manao; 21st December 2003 at 22:26.
Manao is offline   Reply With Quote
Old 22nd December 2003, 02:33   #5  |  Link
K-Dash
nooblar
 
K-Dash's Avatar
 
Join Date: Jan 2003
Location: Norway
Posts: 54
It works, my bad
K-Dash is offline   Reply With Quote
Old 23rd December 2003, 18:39   #6  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Originally posted by Manao:
Chainmax : it would be possible, with a lot of time. But I don't really think it's useful, since most of the filters are working in YV12 ( except Dust ). So it's not one of my priorities yet. For what purpose would you have the use of an YUY2 version ?

Well, one of the best de-rainbowers out there (sh0dan's script) uses MaskTools. It would be awesome to be able to use it on TV captures without having to make an extra colorspace conversion. I don't know what MaskTools functions it uses, though.
Chainmax is offline   Reply With Quote
Old 23rd December 2003, 18:43   #7  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Just use AVISynth's plane exchanging functions and process as Y.
mf is offline   Reply With Quote
Old 24th December 2003, 00:28   #8  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
Huh?
Chainmax is offline   Reply With Quote
Old 24th December 2003, 09:21   #9  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Quote:
Originally posted by Chainmax
Well, one of the best de-rainbowers out there (sh0dan's script) uses MaskTools. It would be awesome to be able to use it on TV captures without having to make an extra colorspace conversion. I don't know what MaskTools functions it uses, though.
I wrote a YUY2 version, that doesn't subsample chroma, so you don't loose anything but a bit of speed.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 24th December 2003, 13:08   #10  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Chainmax
Huh?
http://www.avisynth.org/index.php?page=Swap
mf is offline   Reply With Quote
Old 24th December 2003, 17:47   #11  |  Link
Chainmax
Huh?
 
Chainmax's Avatar
 
Join Date: Sep 2003
Location: Uruguay
Posts: 3,103
sh0dan: does that version perform as good as the "30% faster" YV12 one? I don't mind a little less speed if the results regarding IQ are the same.

mf: thanks for the link, but I don't understand how that can help me use a YV12 filter on a YUY2 source without having to make a colorspace conversion.
Chainmax is offline   Reply With Quote
Old 24th December 2003, 21:45   #12  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Quote:
Originally posted by Chainmax
mf: thanks for the link, but I don't understand how that can help me use a YV12 filter on a YUY2 source without having to make a colorspace conversion.
Not without conversion, but without loss of image anyway.
input = last
input.Greyscale().ConvertToYV12()
y = last
input.UToY().ConvertToYV12()
u = last
input.VToY().ConvertToYV12()
v = last

y.Sh0dansl33tscript().ConvertToYUY2()
yprocessed = last
u.Sh0dansl33tscript().ConvertToYUY2()
uprocessed = last
v.Sh0dansl33tscript().ConvertToYUY2()
vprocessed = last

YToUV(uprocessed, vprocessed, yprocessed)


Seeing what you want is rainbow removal, you can probably leave out the processing of the luma channel (y).
mf is offline   Reply With Quote
Old 25th December 2003, 00:15   #13  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Exactly. However the rainbow tool requires luma and chroma to be reliable as they are interdependant. The YUY2 script in this thread does however account for this and it filters YUY2 chroma without affecting chroma resolution, by using an approach like mf's suggestion.

I don't think the speed is much lower than YV12 anyway.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 4th January 2004, 16:52   #14  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
New version, correcting some bugs ( 3DNow intructions should have been removed, some optimizations have been disabled because they gave a different output than the non optimized one ), and optimizing Binarize and Invert ( they were the simplest ).

Get it here ( copy & paste, as usual )

There should be bugs, so I'm waiting the bug report.
Manao is offline   Reply With Quote
Old 5th January 2004, 18:46   #15  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
mf, kurosu and the others : since AviSynth 2.54 alpha, there is an 'overlay' filter inside AviSynth which works in YV12 and do the job of MaskedMerge, YV12Layer and YV12Substract ( and more )

I'm wondering whether to let these filters in the next release, as soon as AviSynth 2.54 is out.

What do you think of it ?
Manao is offline   Reply With Quote
Old 5th January 2004, 19:53   #16  |  Link
mf
·
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Well, as long as Overlay is C only I'm not using it. I was already relieved the change to YV12 gave a speed boost (although not on my PC - the same old 3fps), and I'm not going to make it slow just to keep it to internal AVS filters.
mf is offline   Reply With Quote
Old 5th January 2004, 21:07   #17  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
I looked more closely to the source code, Overlay do use MMX optimizations. However, I didn't see Overlay was converting YV12 to YUY2, so using it is not an option yet. So I'll let these functions inside the MaskTools.

I tested MMX optimizations in MaskedMerge ( they are currently disabled ), there are not very effective, at least for me. So I'll try to improve them ( though I'm not sure I'll succeed ).

Edited : Damn, I was wrong one more time. Optimizations _are _ effective with MaskedMerge, I did forget to enable them

I'll test them and make another build available soon.

Edited 2 : Build available, with optimizations back for MaskedMerge. The optimized filters are : MaskedMerge, YV12Layer, YV12Subtract, Binarize, Invert, EdgeMask ( Robert, Special, Sobel, Cartoon only ) and FastFitPlane. I modified optimizations for Binarize only, and there will be problems if these optimizations are used with an offset, so I added a usemmx parameter, defaulted to true, which allows to disable mmx for Binarize. Unless there are bugs report, there should not be any other version for a moment, at least from me.

Last edited by Manao; 5th January 2004 at 22:54.
Manao is offline   Reply With Quote
Old 10th January 2004, 12:48   #18  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
OK, new version, with a new filter : MotionDetection. It builds the mask of the moving pixels.

Here is the changelog :

1.4.5
- Added MotionDetection filter, no MMX / assembler optimizations for it yet. It takes the idea of Sansgrip's filter (NoMoSmooth) and outputs the motion mask directly in the correct colorspace for the MaskTools.

So basically it's an adaptation of NoMoSmooth to YV12 with giving the choice to the user of the spatial filter he wants to use. But since I only took the algorithm of SansGrip, not his code, bugs are waiting to be discovered.

Optimizations will come later.

I updated the link on the first page.
Manao is offline   Reply With Quote
Old 10th January 2004, 12:56   #19  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Great work Manano - should I move this to Usage?
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 10th January 2004, 13:15   #20  |  Link
Manao
Registered User
 
Join Date: Jan 2002
Location: France
Posts: 2,856
Yes, thank you.
Manao is offline   Reply With Quote
Reply

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 22:28.


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