Question

Tonight I'm working on Android. I've to decode, modify and then encode a JPG on a bytearray. I'm using NDK. Some people told me to use libjpeg-turbo. But I can't figure out how to add this lib to NDK.

Any help please ?

Was it helpful?

Solution

No doubt, libjpeg-turbo can give you certain performance advantages, but I'd strongly suggest to start with libjpeg, which is preinstalled on all Android devices.

You still need a JNI wrapper to convert the bytearray to uint8_t*. If you don't actually manipulate the bytes in Java, consider using direct ByteBuffer instead, to guarantee most efficient native access.

Here is a short tutorial in Japanese: http://www.usefullcode.net/2011/01/android_ndklibjpeg.html.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top