How to speed up jpeg compression

I use OpenCV to compress binary images from the camera:

vector<int> p;

p.push_back(CV_IMWRITE_JPEG_QUALITY);

p.push_back(75); // JPG quality

vector<unsigned char> jpegBuf;

cv::imencode(".jpg", fIplImageHeader, jpegBuf, p);

The code above compresses the RGB binary image stored in the fIplImageHeader file into a JPEG image. For an image of 640 * 480, it takes about 0.25 seconds to complete the five lines above.

Is there any way to make this faster? I really need to repeat the compression more than 4 times per second.

+3
source share
2 answers

Try using libjpeg-turboinstead libjpeg, it has MMX and SSE optimizations.

+4
source

- Intel Performance Primitives - . AMD Framewave, API- - . BTW - JPEG

+1

Source: https://habr.com/ru/post/1782269/


All Articles