View Full Version : New filter: Ghostbuster (I know, I know...)
SansGrip
9th October 2002, 01:36
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 :p
Guest
9th October 2002, 02:00
@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.
SansGrip
10th October 2002, 16:22
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.
Guest
10th October 2002, 17:29
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. :)
sh0dan
10th October 2002, 19:04
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.
Guest
10th October 2002, 19:20
@sh0dan
Which of your referenced documents describes ISSE? Thank you.
sh0dan
10th October 2002, 19:35
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.
vlad59
10th October 2002, 19:58
The intel docs provide sometimes better examples (graphics) (as I'm sometimes really slow in understanding the use of some opcodes :confused: ).
http://developer.intel.com/design/pentium4/manuals/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 ;)
sh0dan
10th October 2002, 20:07
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
SansGrip
10th October 2002, 21:45
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 :rolleyes:. 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 :)
zyrill
8th March 2003, 16:17
any chance this plugin could be recompiled for 2.5? i'd really appreciate since i'm too dumb to do it myself...
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.
romangal
10th June 2020, 03:14
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...
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.