Log in

View Full Version : Optimise Script to use MMX, SSE, SSE2 and for Number of threads for my processor


hannah
6th August 2010, 22:43
Hi All,
I have this desktop machine where I run avisynth script (AviSynth 2.58, build: Dec 22 2008) through to meGUI. Raw video data is in 1920 x 1080 size.
I think I need to optimize my avisynth script to make use of MMX, SSE, SSE2 and for Number of threads for my processor.


This is my avisynth script:

SetMemoryMax(256)

LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGAVCDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\NicAudio.dll")


A=AVCSource("C:\Park.dga")
B=NicAc3Source("C:\Park PID 1100 3_2ch 448Kbps DELAY -221ms.ac3").DelayAudio(-0.221)
AudioDub(A,B)

LeakKernelDeint(order=1,sharp=true,threshold=4, forceCPU=5)
LanczosResize(960,540)
When I encode it in x264, I get generally 3-4 fps. Please note that I am reducing the size.

Below is the information re: my processor.
Instructions sets MMX, SSE, SSE2
Number of processors 1
Number of threads 2
Processor 1 ID = 0
Number of cores 1 (max 1)
Number of threads 2 (max 2)
Name Intel Pentium 4
Codename Northwood
Specification Intel(R) Pentium(R) 4 CPU 2.80GHz
L1 Data cache 8 KBytes, 4-way set associative, 64-byte line size
Trace cache 12 Kuops, 8-way set associative
L2 cache 512 KBytes, 8-way set associative, 64-byte line size
Memory Size 768 MBytes
Windows Version Microsoft Windows XP Professional Service Pack 3 (Build 2600)
DirectX Version 9.0c

Please help.
Many thanks.

Gser
6th August 2010, 23:30
Avisynth is a scripting language, not a programming language. Hence the CPU optimations are dependent on the filters themselves and not the scripting language.

The advantages of hyper-threading are listed as: improved support for multi-threaded code, allowing multiple threads to run simultaneously, improved reaction and response time.

According to Intel the first implementation only used 5% more die area than the comparable non-hyperthreaded processor, but the performance was 15–30% better.

Intel claims up to a 30% performance improvement compared with an otherwise identical, non-simultaneous multithreading Pentium 4. Tomshardware.com states "In Some Cases a P4 running at 3.0 GHz with HT on can even beat a P4 running at 3.6 GHz without HT turned on". Intel also claims significant performance improvements with a hyper-threading-enabled Pentium 4 processor in some artificial intelligence algorithms. The performance improvement seen is very application-dependent, however when running two programs that require full attention of the processor it can actually seem like one or both of the programs slows down slightly when Hyper Threading Technology is turned on. This is due to the replay system of the Pentium 4 tying up valuable execution resources, equalizing the processor resources between the two programs which adds a varying amount of execution time. (The Pentium 4 Prescott core gained a replay queue, which reduces execution time needed for the replay system. This is enough to completely overcome that performance hit.)

I doubt you will benefit much from it. Seeing as x264 uses the most processing power in this case and it is already is multi-threaded and due to your morbidly slow cpu.

hannah
6th August 2010, 23:51
Thanks for clearing a lot of air here. Wonder if other experts have the same opinion as well. BTW is there a newer version of LeakKernelDeint where one can force it to use SSE2. My current version is 1.5.4.0.

Cheers

Blue_MiSfit
7th August 2010, 08:31
Using AVCSource is a fairly bad idea, since it has been officially withdrawn by its author.

I'd suggest using FFMS2 (aka ffmpegsource) instead. Take a peek.

Finally, try something other than leakkerneldeint. YADIF is VERY fast, and produces pretty good results - especially given its speed.

Long story short, get a faster CPU. a 2.8 GHz Northwood P4 is many, many times slower than even a very modest Core i3 or Athlon II these days.

Derek

hannah
9th August 2010, 10:45
ok I will try YADIF. And yes my computer is slow as but then I bought it for $70. Cannot complain