Forums [Archives] Forums [Archives] (
-   Avisynth Scripting (
-   -   Avisynth: STMedianFilter slowdown? (

scrappy 01-13-2006 01:25 PM

Avisynth: STMedianFilter slowdown?

This is more than likely another daft question but...

If I use the MA script as it stands with STMedianFilter the encoding speed is crippled. HCE for instance can run through at 40+ fps with that line commented out, if I leave it in it drops to ~3 fps which is a hugh drop. It also effects CCE which ends up with encoding times that make TMPGEnc look positively incredible, speed wise.

I used to do encoding on an Athlon 2600+ and I do not recall this happening but I recently ditched that PC and replaced it with a Opteron box, memory isn't an issue (2gb) in case thats relevant, though just to make sure it wasn't an AMD thing I also tried this out on a spare 3ghz P4 Prescott PC and the same thing happens on that.

Any ideas?

For reference the version of the filter I have is

Dialhot 01-13-2006 04:27 PM

You probably have the memory alignement problem already reported.
Update your avisynth version (lastest is 2.5.6a) and if this does not work, add the parameter ",true" at the end of the crop line (do you have a crop line in your script ?)

scrappy 01-13-2006 05:25 PM

The version of Avisynth is 2.5.6a, the dll reports its version as 2.5.6 but I just re-downloaded and re-installed it to make sure, no change.

The script I'm using is the one below. It's essentially the MA script with the GripFit stuff removed and replaced with values obtained from PARanoia for a resizer and the borders. I've left the STMedianFilter line in place but commented out, as it stands this runs pretty quickly, if I uncomment the line.. slow becomes an understatement.


LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\dgdecode.dll")


asharp(1, 4)
#STMedianFilter(3, 3, 1, 1 )

ScriptClip(" nf = YDifferenceToNext()" +chr(13)+ \
  "unfilter( -(fmin(round(nf)*2, 100)), \
  -(fmin(round(nf)*2, 100)) ).TemporalSoften( fmin( round(2/nf), 6), \
  round(1/nf) , round(3/nf) , 1, 1)  ")


function fmin( int f1, int f2) {
  return ( f1<f2 ) ? f1 : f2

EDIT: Just been reading up on this memory alignment bug you mentioned and I now understand what you meant by having a crop line in the script. Having just added that right after the mpeg2source line it appears to have fixed it :D

Thanks for the nudge in the right direction, much obliged to you :)

Dialhot 01-13-2006 07:21 PM

You're welcome :)

supermule 01-25-2006 10:48 PM

Btw, what does STMedian filter does in layman terms ???

gamma 01-26-2006 04:51 AM


Originally Posted by supermule
Btw, what does STMedian filter does in layman terms ???

STMedianFilter is a (slightly motion compensated) spatial/temporal median filter.

scrappy 01-30-2006 02:49 PM

Probably shouldn't just followup this but anyway...

Anybody know of a decent alternative to STMedianFilter ?

supermule 01-31-2006 01:08 AM

degrainmedian() by fizik, although I found it to be slightly slower than the STmedian.

gamma 01-31-2006 04:27 AM


Originally Posted by scrappy
Probably shouldn't just followup this but anyway...

Anybody know of a decent alternative to STMedianFilter ?

I suggest looking into LRemovedust(), in your case this will replace both undot() and stmedian. You'll have to use it before the asharp line (assuming you use the MA script as you posted earlier)

scrappy 01-31-2006 01:41 PM

Thankyou, I'll have a go with both :)

All times are GMT -5. The time now is 08:57 AM  —  vBulletin Jelsoft Enterprises Ltd

Site design, images and content © 2002-2021 The Digital FAQ,
Forum Software by vBulletin · Copyright © 2021 Jelsoft Enterprises Ltd.