Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Manjula_Reddy
Beginner
137 Views

Using IJPEG library and IPP

Hi,

Iam using Intel IPP 7.0. I want to use IJPEG library and IntellIPP in my application to compress bmp files to jpeg with less cpu utilization and less image size. For this I downloaded the Intell IPP samples and built a static lib using the source files and header files mentioned in the Image-codec\\ijg\\Doc\\FileList.doc. A static lib is built successfully. But when I include this lib in my application I get linking errors like below:

CBmpToJpg.obj : error LNK2001: unresolved external symbol "void __cdecl jpeg_destroy_compress(struct jpeg_compress_struct *)" (?jpeg_destroy_compress@@YAXPAUjpeg_compress_struct@@@Z)

CBmpToJpg.obj : error LNK2001: unresolved external symbol "void __cdecl jpeg_finish_compress(struct jpeg_compress_struct *)" (?jpeg_finish_compress@@YAXPAUjpeg_compress_struct@@@Z)
.
.
.
I have a question here. While building the static lib I have included ippj.h in header files. The lib is built successfully. Do i need to link libcore.lib and ippj.lib to my application as dependency toippj.hif i need IPP also.
Another question is whether I followed the right way to build the IJPEG library according to FileList.doc.
What else do i need to do.

Please help me in this regard.

Thanks,
Manjula Reddy

0 Kudos
6 Replies
Vladimir_Dudnik
Employee
137 Views

Hi Manjula,

for IPP libjpeg sample you will need to link with ippcore, ipps, ippi, ippj and ippcc libraries regardless how do you link statically or dynamically (note on library names differences for differnt linking models). An important thing to remember when you link with IPP static libraries is to call ippInit() function as the first call to IPP (usually somewhere at the beginning of your application). It will allow IPP static dispatcher to initialize appropriate processor specific optimized path in IPP functions.

Additionally, when you use libjpeg library in C++ project you may need to wrap inclusion oflibjpeg header files with extern "C", like the example below


...
extern "C" {
#include "jpeglib.h"
#include "jinclude.h"
};
...

...

Regards,
Vladimir

Manjula_Reddy
Beginner
137 Views

Hi Vladimir,

Thanks for the information. I will follow your suggestion for IPP usage.

Let me know whether I followed the right way to build IJPEG library using the .c source files and header files in IPPCodes/ijg/Src and IPPCodec/ijg/Include. Why I am facing the liking errors though Iam linking the library to my app.

Is there any libjpg library provided in IPP 7.0.

Thanks,
Manjula Reddy
Vladimir_Dudnik
Employee
137 Views

Yes, we do provide IJG sample with IPP 7.0 (although it is not precompiled). I thought you were based on that sample. Please try to build it with scripts we provide. We do test build and run of all IPP samples based on build scripts which comes with each sample

Vladimir

PaulF_IntelCorp
Employee
137 Views

Hello Manjula,

The samples Vladimir is referring to can be found here:

Free Code Samples

The IJG library sample, which has been modified to include IPP, can be found within the samples here:

.../ipp-samples/image-codecs/ijg

There are build scripts provided with the samples to build the IJG library (libjpeg).

Paul
Manjula_Reddy
Beginner
137 Views

Hi Paul and Vladimir,

Thanks for your confirmation.I have already compiled the library in VS 6.0 using the sample and linked to my successfully. I have linked ippcore.lib,ipps.lib,ippj,lib,ippi.lib and ippcc.lib to my application as vladimir was sayng and also used the repective dlls for the above libraries.

When i run the application and tried to convert a BMP to JPG Iam getting a pop up box JPEG LIbrary Error saying "Caution: quantization tables are too coarse for baseline JPG".

Please let me know regarding this pop up message.

Thanks,
Manjula Reddy
Manjula_Reddy
Beginner
137 Views

Hi,

I resolved the above issue. it need to change a value in the code.

Thanks,
Manjula Reddy
Reply