Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fast way to decode JPEG image

I need to decode (unpack into bitmap) pretty small (about 1200 * 1200) JPEG. The problem is I need to do it quickly. I have tried libjpeg, and it's quite slow. I have also tried BitmapFactory.decodeByteArray - it's a bit faster, but still not fast enough. What are another options? A native (C++) library is much preferred.

P.S. My JPEGs are created directly in memory.

P.P.S. I wonder how come libjpeg is slower than BitmapFactory.decodeByteArray.

like image 959
Violet Giraffe Avatar asked Oct 12 '11 16:10

Violet Giraffe


People also ask

What is a JPEG decoder?

The JPEG decoder takes a JPEG image and converts it to a (uncompressed) bitmap using a decoding method called the baseline decoding process. A short introduction to the JPEG decoding process can be found in chapter 2 and appendix of the report "Design and implementation of a JPEG decoder" by Sander Stuijk.

How are JPEG images encoded?

JPEG uses a lossy form of compression based on the discrete cosine transform (DCT). This mathematical operation converts each frame/field of the video source from the spatial (2D) domain into the frequency domain (a.k.a. transform domain).

How do I read a JPEG number?

jpg? The first letter P stands for picture. The second to fourth number/letter represent the date the image is taken. The second number/letter represent month (1-9 for Jan-Sep, ABC for Oct-Dec).

What is JPEG Snoop?

JPEGsnoop is a detailed JPEG image decoder and analysis tool. It reports all image metadata and can even help identify if an image has been edited.


1 Answers

Try Libjpeg Turbo: http://libjpeg-turbo.virtualgl.org/

like image 85
rossb83 Avatar answered Sep 21 '22 12:09

rossb83