digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   AviSynth resize vs GripFit? (http://www.digitalfaq.com/archives/avisynth/4565-avisynth-resize-vs.html)

NismoSX 07-16-2003 06:32 PM

AviSynth resize vs GripFit?
 
Anyone else noticed that it is way faster to encode with the internal resizing methods in AviSynth, versus using the YV12 version of GripFit. Encodings that before took 3,5 hour to finish, are now over an hour faster when not using GripFit.

Dialhot 07-16-2003 06:41 PM

As Gripfit simply calls internal avs resizing function, the speed is the same for both methods.
(see "resizer" parameter in gripcrop and its use in the code : it's simply a "function pointer", that means a direct call to the original function).

You surely did other thing that slow down your speed (use a convertToYV12() in one case and notin the other preharps ?).

NismoSX 07-16-2003 06:56 PM

Nope, not doing any conversions. I'm really seeing a difference here in speed. Here's my scripts with and without GripFit.

Code:

## DLL Section ##
#
LoadPlugin("C:\DVD\Filters\2.5\MPEG2Dec3.dll")
LoadPlugin("C:\DVD\Filters\2.5\GripFit_YV12.dll")
LoadPlugin("C:\DVD\Filters\2.5\STMedianFilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\asharp.dll")
LoadPlugin("C:\DVD\Filters\2.5\unfilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\undot.dll")
LoadPlugin("C:\DVD\Filters\2.5\DCTFilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\VSFilter.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf =  0 # Current frame.
#
####

## Main section and static filters ###
#
avisource("c:\media\***.avi")
#
undot()
Limiter()
asharp(1, 4)
GripCrop(480, 480)
GripSize(resizer="BicubicResize")
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
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) ")

#
#
#

GripBorders()
TextSub("d:\da1.srt")
Limiter()
DctFilter(1,1,1,1,1,1,.5,0)
LetterBox(0, 0, 16, 16)

#
#
## Functions ###

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

#
####

Code:

## DLL Section ##
#
LoadPlugin("C:\DVD\Filters\2.5\MPEG2Dec3.dll")
LoadPlugin("C:\DVD\Filters\2.5\GripFit_YV12.dll")
LoadPlugin("C:\DVD\Filters\2.5\STMedianFilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\asharp.dll")
LoadPlugin("C:\DVD\Filters\2.5\unfilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\undot.dll")
LoadPlugin("C:\DVD\Filters\2.5\DCTFilter.dll")
LoadPlugin("C:\DVD\Filters\2.5\VSFilter.dll")
#
####

## Defined Variables and Constants ##
#
MaxTreshold = 1.50
nf =  0 # Current frame.
#
####

## Main section and static filters ###
#
avisource("c:\media\***.avi")
#
undot()
Limiter()
asharp(1, 4)
BicubicResize(480, 350, 1/3, 1/3, 11, 0, 554, 304)
STMedianFilter(8, 32, 0, 0 )
MergeChroma(blur(MaxTreshold))
MergeLuma(blur(0.1))
#
#

## Linear Motion Adaptive Filtering ##
#
# ( Portions from AviSynth's manual ) - This will apply temporalsoften to
# very static scenes, and apply variable blur on moving scenes.
# We also assign a variable - and this is why a line break is inserted:

SwitchThreshold = (Width<=352) ? 4 : (Width<=480) ? 3 : 2
ScriptClip("nf = YDifferenceToNext()"+chr(13)+ "nf >= SwitchThreshold ? \
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) ")

#
#
#

AddBorders(0, 65, 0, 65)
TextSub("d:\da1.srt")
Limiter()
DctFilter(1,1,1,1,1,1,.5,0)
LetterBox(0, 0, 16, 16)

#
#
## Functions ###

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

#
####


NismoSX 07-16-2003 07:01 PM

Another thing: Sometimes using GripFit with certain movies causes AviSynth to crash with an error. Especially when running a prediction with Tok. Haven't happened yet using AviSynth resizing.

kwag 07-16-2003 07:03 PM

Maybe GripFit has a function call overhead before it calls the internal resizer, which is not the case when calling BilinearResize directly :!:
Probably on very fast machines, this is not so visible. But on slower machines, it is :idea:
I'll have to run a couple of tests to verify this.

-kwag

Dialhot 07-17-2003 03:37 AM

Sorry but there is a big difference between the two scripts !

The source is an avi, so definetly not anamorphic.

Gripfit is used without the parameter "source_anamorphic=false" and thinks it is anamorphic (the default).

The image area won't be the same in the two methods, and there is were the speed difference is, I think.

Nismo, make a test with "source_anamorphic=false" and give us the result please.

NismoSX 07-17-2003 09:39 AM

I'll do some more testing later when I get home from work.

NismoSX 07-17-2003 05:27 PM

Ok, just tested with the "source_anamorphic=false" option, but no change in encoding speed. Even tried with a DVD rip, and AviSynth resize is still much faster. Weird.... No one else tested this?

kwag 07-17-2003 05:57 PM

Hi NismoSX,

What processor do you have :?: ( CPU?, CPU speed? )

-kwag

NismoSX 07-17-2003 09:07 PM

AMD XP 2000, VIA KT400 chipset, 256 MB PC2700

Should be fast enough. :wink:

kwag 07-17-2003 09:24 PM

Quote:

Originally Posted by NismoSX
AMD XP 2000, VIA KT400 chipset, 256 MB PC2700

Should be fast enough. :wink:

You bet it should :D
But then, maybe GripFit is not optimized to use Athlon's instructions as a P4 using SSE-2, etc. :idea:
So on every frame, GripFit functions are called, which then call BilinearResize functions, and there is the small delay. When added up to the sum of thousands of frames, that could be the reason for the time difference.

-kwag

NismoSX 07-17-2003 09:33 PM

I think it must have something to do with the YV12 version of GripFit. Didn't have this big speed difference before when I was using the old AVS 2.0x script. And I've encoded well over 100 films with that script. :)
Now for instance, if doing a file prediction with ToK using GripFit is taking 15 minutes, the same prediction without GripFit is only taking 7-8 minutes.

kwag 07-17-2003 09:37 PM

Quote:

Originally Posted by NismoSX
Now for instance, if doing a file prediction with ToK using GripFit is taking 15 minutes, the same prediction without GripFit is only taking 7-8 minutes.

Then by all means, drop GripFit :D

-kwag

NismoSX 07-17-2003 10:22 PM

Already done it, for now anyway... :)
Maybe there will be a bugfree GripFit_YV12 version in the future...

SansGrip 07-20-2003 10:41 AM

Quote:

Originally Posted by NismoSX
Already done it, for now anyway... :)
Maybe there will be a bugfree GripFit_YV12 version in the future...

Maybe when I get a DVD burner, since regular KVCDs now look kinda blah on my HDTV :mrgreen:.

ak47 07-20-2003 01:04 PM

Holly crap, SansGrip we haven't heard from you in a while. Nice to see you again (and I think I speak for everyone).

rendalunit 07-20-2003 03:23 PM

Quote:

Originally Posted by SansGrip
Maybe when I get a DVD burner, since regular KVCDs now look kinda blah on my HDTV

hey SansGrip!

Do kvcd 2 cd movies look ok on the HD tv?

I've been putting all my movies onto two cds and they look great on my 27" standard tv (i'm poor :roll: ) Others here have said though that they look great on their HDTVs.

Well maybe by the time I get an hdtv I'll also have a dvd burner and I'll be 79 yrs old :lol:

ren

kwag 07-21-2003 03:16 AM

Hey, SansGrip showed up :lol:
Glad to see you around :cool:
Take a look at the new Motion Adaptive script :idea:
Most of my KVCDx3 encodes look sweet on my HDTV, when processed through that script :mrgreen:

-kwag

SansGrip 07-21-2003 12:56 PM

Quote:

Originally Posted by ak47
Nice to see you again

heheh thanks :).

SansGrip 07-21-2003 01:00 PM

Quote:

Originally Posted by rendalunit
Do kvcd 2 cd movies look ok on the HD tv?

The only 2-disc burn I had lying around was, ahem, a very long movie. I'm going to try putting a shorter movie on 2 discs and see how it looks...

Quote:

I've been putting all my movies onto two cds and they look great on my 27" standard tv (i'm poor :roll: )
My encodes looked fantastic on my standard-definition TV. It's amazing what a difference watching them on an HDTV makes... I can see the mosquito noise and DCT blocks in any source, and digital cable is so highly compressed that some channels are barely watchable.

Quote:

Well maybe by the time I get an hdtv I'll also have a dvd burner and I'll be 79 yrs old :lol:
heheh yeah, that's when I think I'll have enough money for a DVD burner, too ;).


All times are GMT -5. The time now is 11:40 AM  —  vBulletin © Jelsoft Enterprises Ltd

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