jpeg SIMD (MMX) success!

Support and queries relating to all previous versions of ZoneMinder
Locked
dbosso
Posts: 23
Joined: Thu Jul 21, 2005 8:21 pm
Location: Goleta, California

jpeg SIMD (MMX) success!

Post by dbosso »

Howdy,

I spent several days a few months back trying to get the MJPEG project's jpeg-mmx package to work with ZM. I came to the realization that it is incomplete and unworkable. I even took a look at Intel's IPP package, but the licensing was restrictive, and the packaging was yucky.

Then, a couple of days ago I stumbled accross this:
http://cetus.sakura.ne.jp/softlab/jpeg- ... gsimd.html

an IJG JPEG library with x86 SIMD extensions. It's not AMD64 ready yet (but maybe soon!), so I spent the morning getting it set up on my home machine with a single camera attached.

And, it works! At least it seems to so far. I'm getting video, no crashes, and performance is excellent. The zmc process is now taking 21% cpu on top instead of 45%, and load is down by half.

So give it a shot, and if someone knows japanese, thank the author for me.

-David
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

very very interseting mate. Very well done. I hav ebeen hoping for mmx option as i dont think it can be there by default due to arch issues, but bloody well done mate. Dont suppose you fancy documenting what you did?
Pretty please

James
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
dbosso
Posts: 23
Joined: Thu Jul 21, 2005 8:21 pm
Location: Goleta, California

Post by dbosso »

It's a drop in replacement for the standard IJG libs. I'm using Gentoo, so I created an ebuild that used the SIMD source instead of the standard source.

The ebuild is pretty hacky right now, so I'm not going to release it, but I'll try and clean it up when I get back from vacation next week.

You should be able to just compile the SIMD source and drop the resulting libs over your existing ones.

-David
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

ok i will try thankyou v. much
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Excellent find. Keep us informed how it pans out over the next few days and weeks.
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

ok then slightl;y out my depth here i think!!!
Downloaded source
./configure --enable-shared
make
make test
make install

Now i assume i have a shared jpeg lib
How do i make the system use the new library?

Cheers again
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
dbosso
Posts: 23
Joined: Thu Jul 21, 2005 8:21 pm
Location: Goleta, California

Post by dbosso »

Well, if make install copied them over your previous libraries then all you'd need to do is run ldconfig and restart ZM.

Does anyone on this board speak Japanese? I've emailed the author on the status of the AMD64 source, but received no response. I'd love it if someone would email or post to the support forum he has in Japanese to find out what the status is.

-David
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

it didnt but i copied them over my old libs and wow what a difference on a celeron 3.2 gig went form 29% idle to 54% idle

Well done on the find and the share mate!!

Cheers
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
sugacapra
Posts: 48
Joined: Wed Jan 18, 2006 9:20 am
Location: Firenze, Italy

Post by sugacapra »

using babelfish i obtain a (good?) english translation and maybe we can rewrite him using the babelfish again...

but my question is:
can i use this to speed up my Zoneminder using the via epia motherboard ?
is the cyrix mmx compatible?
:)
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

i would have thought so, wasnt the original cyrix (m1) pin compatible with a p1mmx
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
sugacapra
Posts: 48
Joined: Wed Jan 18, 2006 9:20 am
Location: Firenze, Italy

Post by sugacapra »

jameswilson wrote:i would have thought so, wasnt the original cyrix (m1) pin compatible with a p1mmx

ok, that help my mind, i will try and maybe it work.. otherwise ... :cry:
unclerichy
Posts: 74
Joined: Wed Feb 25, 2004 5:06 pm

Post by unclerichy »

I've successfully built it on my Lex board which runs an M10000 Nehemiah. ZM has successfully come back up but I haven't had time to make any performance comparisons.
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

just tested thins on my big test rig
1 megapixel 1280x1024 running at 10 fps + 6 x 640x480 at 2 fps on an fx60

55%% user 4.6%user 37.9% idle (ish)

Had 3% idle before mmx library.
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

So am I to take it that this replacement library has been an unequivocal succes?
Phil
jameswilson
Posts: 5111
Joined: Wed Jun 08, 2005 8:07 pm
Location: Midlands UK

Post by jameswilson »

has with me on amd x2, celeron, and p4. Have yet to test a sempron and a pentiumd
James Wilson

Disclaimer: The above is pure theory and may work on a good day with the wind behind it. etc etc.
http://www.securitywarehouse.co.uk
Locked