Log in

View Full Version : CPU usage and CCE speed difference between similar scripts


Venom_IL
4th November 2006, 16:40
Hi

As I am not very knowledgable in Avisynth, I would appreciate a little explanation on this phenomenon. I am encoding the same AVI (~1.2 GB, XVID(QPEL), Mp3-VBR) , one time with TheFilmMachine (TFM) and one time with DVD2SVCD+D2SRoBa.

TFM's avs file is

# 16:9 encoding
Import("C:\Programs\The FilmMachine\AviSynth\ResampleAudio.avs")
LoadPlugin("C:\Programs\The FilmMachine\VSFilter.dll")
AviSource("F:\0TO ENCODE\test.avi", false)
ConvertToYUY2()
FadeIn(50)
Lanczos4Resize(720,412,0.0,0.6)
AddBorders(0,82,0,82)
TextSub("F:\0Encoding\TFM\TFM_Subtitle_File1.ssa")
ResampleAudio(44100)

and D2sRoba's avs file is

LoadPlugin("C:\Programs\DVD2SVCD\AVISYN~1.5PL\Mpeg2dec\MPEG2D~1.DLL")
LoadPlugin("C:\Programs\DVD2SVCD\AVISYN~1.5PL\AVISYN~2.DLL")
AVISource("F:\0TOENC~1\test.AVI",audio=false)
ConvertToYUY2()
Import("C:\Programs\DVD2SVCD\Tylo\RoBaConditional.avs")
LanczosResize(0+0+720,310)
AddBorders(0,133,0,133)
AvisynthSubtitler("F:\0ENCOD~1\D2S\subs\","permsubs.txt")
Import("F:\0Encoding\D2S\ResampleAudio.avs")
ResampleAudio(44100)


TFM gives me 100% cpu usage, about 30% of which is tfm.exe and the other CCE. the speed is about 2.5 RT

D2SRoBa gives me 70% CPU usage, almost all of it is CCE, and the speed is about 3.5 RT

The main difference i see is Lanzcos vs. Lanzcos4 and avisynthsubtitler vs. textsub
would they account for this difference ?

Thanks in advance

IanB
5th November 2006, 07:46
Lanczos(3) is faster than Lanczos4, the first is a order 3 resizer the second an order 4 so does more work per pixel. Both are quite fast. More important is the output size for each resizer, the height is 412 for the Lz4 and only 310 for the Lz3, so the slightly faster resizer also has 25% less height to process.

Painting text on a frame can be quite slow, there are many tricks to minimise the overhead. AvisynthSubtitler() seems to have a slight edge. Try using the ShowFrameNumber() filter in a script, the slowdown is quite dramatic.

And lastly the D2sRoba image has bigger black borders (133 vrs 82) which means CCE doesn't have to work as hard.

So you are not really comparing the same thing, even if everything else was the same, I would expect the TFM way to be slower simple because it is doing a lot more.

The real question to ask yourself is for the material you are processing is the extra time spent giving significantly better quality, and then the kilobits/second available for the encode could spoil all the extra work anyway.

Venom_IL
5th November 2006, 18:30
Im always pleased with the results I get from D2S+D2SRoBa (I still prefer it to TFM and DIKO for several reasons)

So I guess that answers my question

many thanks !