Motion - Lib Jpeg Mmx

libjpeg-mmx patch


I use motion for a webcam streaming server only with 3 cam's on an old Pentium 233 MMX with 3 frames per second

(one usb [pwc] and two video tv-cards [bttv and saa7134]).

The cpu uses nearly 90% according to top (20% system). Yes it's working i get 3 frames for each cam but with 4 frames frown, sad smile

Most of cpu time is used by jpeg encoding, so i searched for a way to get more performance and found libjpeg-mmx.

Now my cpu uses nearly 53% according to top (20% system).

Description of Patch

Reduce radical cpu time for jpeg handling (encode/decode).

Installation of Patch


unpack MMX Jpeg from to a subdir of motion (ex. jpeg-mmx)

motion/jpeg-mmx$ ./configure

motion$ autoconf
motion$ ./configure --with-jpeg-mmx=./jpeg-mmx

or for debian apt-get libjpeg-mmx-dev (this is an older Version but woks for me)

motion$ ./configure --with-jpeg-mmx

Change History of Patch

  • motion-3.2.1-libjpegmmx-1 , 2 Jul 2005
    • Initial Release against motion-3.2.1
  • motion-3.2.1-libjpegmmx-2 , 3 Jul 2005
    • cosmetic cleanup - patch against motion-3.2.1/motion-3.2.2_snap4
  • motion-3.2.1-libjpegmmx-3 , 17 Jul 2005
    • Patch again last snapshot motion-3.2.2_snap6
    • Added autodetection feature and some cosmetic changes.
    • Option to skip to use it ( to build RPM/DEB packages ).

Discussion and Comments

Interesting patch. Very interesting.

The configure change you have made - how well does it cope with machine without this library?

Is the libjpeg-mmx available as RPMs and debs?

The libjpeg-mmx seems to be not a mature release version. Is it still in active development? Is it available for FC4 for example?

If I unstall your patch can I still make an RPM for distribution that does not require this library?

-- KennethLavrsen - 09 Jul 2005

Just to show that we do not ignore this patch smile,Sun&sel=8#l4

-- KennethLavrsen - 10 Jul 2005

Patch finished as we discussed in above url. Now motion accepts the parameter --with-jpeg-mmx=DIR .

  • If this parameter is not passed to configure or is empty , tries to autodetect libjpeg-mmx in /usr/lib and /usr/local/lib if not found follows the old behaviour trying to find libjpeg.
  • If this parameter is passed motion search the library in DIR.
  • To skip use libjpeg-mmx --with-jpeg-mmx=no have to be passed to configure ( to build RPM / DEB i.ex ).

-- AngelCarpintero - 17 Jul 2005
Thanks Angel. That is great smile

Small question: Will --without-jpeg-mmx also work like the other options?

-- KennethLavrsen - 17 Jul 2005

Yes Kenneth , it works like --with-ffmpeg so --without-jpeg-mmx and --with-jpeg-mmx=no are equivalent.

-- AngelCarpintero - 17 Jul 2005

Will be in snap7

-- KennethLavrsen - 17 Jul 2005
Topic revision: r11 - 13 Aug 2005, KennethLavrsen
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Please do not email Kenneth for support questions (read why). Use the Support Requests page or join the Mailing List.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.