ofxTurboJpeg on arm

Hi

Has someone used this addon on a rpi to read/save jpeg?

I would like to try, but i dont know how to create the libs for raspberry, can someone give me a clue?

You may be able to use the version from the package manager. In that case you would set up an addon_config.mk file. An example of this file for doing this on the Raspberry Pi is here:

https://github.com/bakercp/ofxJSON/blob/master/addon_config.mk

In this case, the make file is telling the compiler to ignore the include files that came with the addon and attempt to use the pre-compiled binaries that came from apt-get install ....

out of curiosity I messed around with it for a while.

One strange thing that I ran into is that if I used a turbo loaded image I couldn’t use an ofImage as it would crash. I ran them in 2 seperate apps and these are the results

[verbose] freeImageLoadedImage load result: 355
[verbose] freeImageLoadedImage save result: 331
[verbose] turbo load result: 279
[verbose] turbo save result: 713

Chatting with @bakercp he found this where someone has compiled it and provided a repo you can get it from
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=64725&p=476810&hilit=turbojpeg#p476810

I compiled the lib from the sourceforge trunk. To answer your question of how to do it - there are quite a few nowadays (autoconf, make, Cmake, one that starts with an S that I can’t remember) and it all depends on what the project feels like using. The package manager is usually the easiest route but like this one I just went through the BUILDING.txt (aka the INSTALL file which is like a README)

Overall - I think the RPI’s lack of support for NEON instructions that is available on iOS, other ARM platforms will make this less useful. The RPI does have hardware accelerated image loading via OpenMAX but this would be via another ofxAddon that has yet to be written.

1 Like

Very nice piece of research @jvcleave. I am curious why the turbo save was so much slower. Perhaps that is where the SIMD instruction set would normally give turbojpeg its “turbo” powers (i.e. while encoding uncompressed ofPixels).

hey, thanks for that good info!!!

I was asking because im trying to save jpg frames from the camera as fast as i can, so as per jvcleave finds seems like writing its too slow.

One thing that i tested its to use another sdcard, and doing this write test
(sync; time dd if=/dev/zero of=~/test.tmp bs=500K count=1024; time sync):

  • verbatim 6 class got 8,2 MB/s (i was using that)
  • sandisk class 10 got 18.1 MB/s

So im going to try running the project the fastest card to see if the write speed for the jpeg improve

I have found significant performance improvements with class 10 cards, so I’d definitely second using them for the Pi.

yeah - I was using a class 10 card as well for the tests