简体   繁体   中英

Extract decompression part from jpeglib

I am trying to extract the part of decompression in the libjpeg to add it to embedded project so i should take the minimum size of code , but i think the code is very complex, do you have any idea how to exclude this part from the library ? and is there another way , i want to decompress the jpeg photo the return form camera to make pattern recognition on it. any ideas ???

libjpeg is a pretty well-optimized library, it is ported to a number of architectures.

if this library takes too much resources, I would recommend you to take a look at others similar libraries:

https://code.google.com/p/picojpeg/

picojpeg is a public domain JPEG decompressor written in plain C in a single source file picojpeg.c and a single header picojpeg.h. It has several fairly unique properties that make it useful on small 8/16-bit embedded devices or in very memory constrained environments:

http://sourceforge.net/projects/libjpeg-turbo/

libjpeg-turbo is a derivative of libjpeg that uses MMX, SSE, SSE2, and NEON SIMD instructions to accelerate baseline JPEG compression/decompression by about 2-4x on x86, x86-64, and ARM platforms. It is based on libjpeg/SIMD but has numerous enhancements.

Hope it helps !

Tearing apart a library like that to trim it down is a noble effort, the sort of project fork which would make a... say... minimalized jpeg library. minjpeglib. Or smaller. Let's go nano . Yeah, the thing is that this has been done. Quite a lot. You may have some issues with them as they probably don't contain all the features that the jpeg format is capable of. So some images may not load, and some images may not load quite right.

If you want full support, well, there's a reason that jpeglib is so large and complex.

If you really want to tear into jpeglib, I really don't know where to begin but I can give some broad advice. Comb through it for some specific function you want. Trace it's dependencies. What all structures it uses, what helper functions, and what headers. Copy over the portions to a new folder adding bits until you have a program that compiles and runs. Unfortunately, I have no guarantee that it won't include most or all of the original jpeglib.

Ack! Beat out by Mr. Wizzard!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM