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 9th October 2002, 01:36   #1  |  Link
SansGrip
Noise is your friend
 
Join Date: Sep 2002
Location: Ontario, Canada
Posts: 554
New filter: Ghostbuster (I know, I know...)

After a fruitless search to find an Avisynth (and YUY2) version of Exorcist, I decided to use the information in the Exorcist documentation to implement my own. Unfortunately "Ghostbuster" was the best name I could come up with

I've attached a zip containing release and debug DLLs, source code, and a sample pic.

From my brief play it seems to produce pretty much identical results to Exorcist.

Pros:

- Pretty fast, even though it's totally unoptimized. Since I don't know ASM that's almost certainly how it's going to stay unless someone else does it

- Works with odd offset distances (not perfectly, but it works - if anyone can suggest a better way of doing it, I'd be very grateful. Does my way of handling this introduce any bugs/artifacts?)

- *Should* be parameter-compatible with Exorcist. More testing is needed to verify this

Cons:

- Works only in luma, so can leave a slight "colour ghost" (there's a purple one in the sample pic, along the guy's left arm). My attempt (commented-out with "// ???") to adjust the chroma led to colour distortions. I think I'm misunderstanding how the U and V components interact. Anyone fancy taking a look at the code and telling me what I'm missing?

- Introduces an overall brightness change. Any ideas how to reduce this, if it's even possible?

Usage:

Ghostbuster(clip, offset, strength)

A positive offset indicates that many pixels to the right; a negative, that many to the left. The strength can also be either negative or positive. See the Exorcist docs for more information.

Well, it's raw and rough and alpha. Any feedback (negative or positive ) would be gratefully received.

EDIT: Uploaded new version (0.1a) containing instructions. I always forget not everyone can read source code

Last edited by SansGrip; 10th October 2002 at 16:12.
SansGrip is offline   Reply With Quote
Old 9th October 2002, 02:00   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
@SansGrip

You seem to have forgotten the helpfile/readme.

Not everyone has or knows about Exorcist. Please include a complete help file. Yes, I know you posted syntax usage, but as this zip starts flowing around the world, it will become disassociated from your posting.

As I've said before, a major factor in the success of a project, and hence your reputation , is the quality of your help file.

Thank you for your work.

Last edited by Guest; 9th October 2002 at 02:05.
Guest is offline   Reply With Quote
Old 10th October 2002, 16:22   #3  |  Link
SansGrip
Noise is your friend
 
Join Date: Sep 2002
Location: Ontario, Canada
Posts: 554
neuron2: As I've said before, a major factor in the success of a project, and hence your reputation , is the quality of your help file.

Couldn't agree more. Documentation has yet to become an automatic step in my development process, unfortunately. It's a bad habit I've picked up over many years of coding for myself.

As an OT plug-for-other-thread, I've searched for information on general filter optimization but couldn't find much. I decided to ask you as you're one of the acknowledged experts on this topic (or at least that seems to be the opinion of the majority ), but thought the Development forum might be the best venue. I'd be very grateful if you could take a look there for my questions.

Thanks.
SansGrip is offline   Reply With Quote
Old 10th October 2002, 17:29   #4  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Quote:
Originally posted by SansGrip
As an OT plug-for-other-thread, I've searched for information on general filter optimization but couldn't find much. I decided to ask you as you're one of the acknowledged experts on this topic (or at least that seems to be the opinion of the majority ), but thought the Development forum might be the best venue. I'd be very grateful if you could take a look there for my questions.
I took a look but didn't see anything there. Am I blind or have you not yet posted there?

As far as expertness in "general filter optimization" is concerned, I appreciate your kind words. I can hold my own in the regime of algorithmic level optimizations, but my low-level skills are limited to fairly primitive MMX coding. I'm sure that people like trbarry, vlad, sh0dan, and dividee (and surely others) leave me in the dust in the low-level regime. Still, I'll do my best to help.
Guest is offline   Reply With Quote
Old 10th October 2002, 19:04   #5  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Assembler is not that hard to learn - it just takes much time to figure out a good algorithm, and then actually do it. Try downloading the AviSynth source, Donalds Tweak filter, Xvid, ffdshow - there are lots of assembler in them, most of it not easy to understand, but enough to get you started.

Basicly, you just need to know how MMX/ISSE works - this is probably what you'll be needing the most for filters. Try to keep everything else as simple as possible (looping, etc).

I have put up a lot of documentation on optimizations on the CVS-bin site (see sig.) - also some explanations on how MMX works.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 10th October 2002, 19:20   #6  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
@sh0dan

Which of your referenced documents describes ISSE? Thank you.
Guest is offline   Reply With Quote
Old 10th October 2002, 19:35   #7  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
I used "AMD_3dnow+MMX instructions.pdf", which describes all ISSE commands quite good. Look at the last section "Extensions to the
MMX™ Instruction Set", which is dscribing ISSE. (You gotta love PSHUFW, PMIN*/PMAX*, PAVGBW - not much of the rest is useful. PSADBW is useful sometimes (perhaps it could be _very_ useful for you Duplicate Detection filter).

PEXTRW / PINSRW / PMOVMSKB are slow as ****, and should be avoided at all costs.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 10th October 2002, 19:58   #8  |  Link
vlad59
Vlad, the Buffy slayer
 
vlad59's Avatar
 
Join Date: Oct 2001
Location: France
Posts: 445
The intel docs provide sometimes better examples (graphics) (as I'm sometimes really slow in understanding the use of some opcodes ).

http://developer.intel.com/design/pe...als/245471.htm

But with this Intel doc it's harder to know the instruction set of an opcode !!!

@Sh0dan
A little OT : I spend almost 4 or 5 hours reading, testing, sreaming around pshufw (after your PM) before understanding its use. I'm really slow and dumb sometimes
__________________
Vlad59
Convolution3D for avisynth 2.0X : http://www.hellninjacommando.com/con3d
Convolution3D for avisynth 2.5 : http://www.hellninjacommando.com/con3d/beta
vlad59 is offline   Reply With Quote
Old 10th October 2002, 20:07   #9  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Trust me - pshufw took me hours to understand too - it's really great, once you get to know it. I also found out that instead of using the windows calculator to convert binary -> hex, I could just enter it as binary. I think it is:

pshufw mm1,mm0, 10110001b // Swap upper/lower word of both dwords. Would take a ton of instructions using mmx.

btw, I think the documents you refer to are in my list, just renamed them to something more meaningfull than 394875349534678.pdf
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 10th October 2002 at 20:10.
sh0dan is offline   Reply With Quote
Old 10th October 2002, 21:45   #10  |  Link
SansGrip
Noise is your friend
 
Join Date: Sep 2002
Location: Ontario, Canada
Posts: 554
I took a look but didn't see anything there. Am I blind or have you not yet posted there?

I went off to run coax cable through my basement without hitting the "Submit" button . The good (?) news is I'm now ready to enter the wonderful world of TV capture, and all of its related noise problems . But I'm hoping it'll be easier to denoise than VHS tape, which is what I've been capturing from up to now.

I can hold my own in the regime of algorithmic level optimizations

This is an area in which I'd like to become more knowledgable, but I have a dreadful feeling it'll involve MATH
SansGrip is offline   Reply With Quote
Old 8th March 2003, 16:17   #11  |  Link
zyrill
Registered User
 
Join Date: Jan 2002
Location: Germany
Posts: 83
any chance this plugin could be recompiled for 2.5? i'd really appreciate since i'm too dumb to do it myself...
zyrill is offline   Reply With Quote
Old 2nd March 2012, 09:59   #12  |  Link
ajk
Registered User
 
Join Date: Jan 2006
Location: Finland
Posts: 134
Ghostbuster v0.2

Hi,

I don't know if someone has already done this previously but here's a quick new compile of the filter. I grabbed a newer header, MSVC++ 2010, and managed to compile a working version.

I did have a couple of improvements in mind, eg. allowing float parameters (at least for the strength) and some kind of compensation for the overall brightness change. But for now, nothing in the functionality has changed.
Attached Files
File Type: zip Ghostbuster-0.2.zip (7.1 KB, 2377 views)
File Type: zip Ghostbuster-0.2_src.zip (18.2 KB, 221 views)
ajk is offline   Reply With Quote
Old 10th June 2020, 03:14   #13  |  Link
romangal
Registered User
 
Join Date: Aug 2019
Posts: 18
Nice filter. But i suppose that LGhost is still the best. It has all the modes to remove halos and ghosts. Probably ghostbuster is a little more effective in removing shades, but it also has strange bugs when using negative values if you call twice or more times, i cant exactly remember...

Last edited by romangal; 10th June 2020 at 03:17.
romangal 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 01:54.


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