IPP JPEG on Linux

IPP JPEG on Linux

I have successfully compile the windows port of IJG JPEG library with IPP on Linux.

using compile cjpeg and djpeg works !

now I would like to replace the standard Linux library with it...

first : the structure size is not compatible because of the flag useIPP...

I manage to remove it as i would like a full IPP library.

but now I can't laod the library in binaries compile with the standard one as it needs :

static init of the IPP library if I compile them in static..

or can't load the shared one if I link the IPP in shared version.

Is there a way to have IPP used in a shared library ?

thanks

22 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

great result!
Actually we did not tried IJG on Linux, but I'm sure it should work in the same manner as on Windows.

I can only guess, if you want to replace standard IJG in Linux you probably need to replace header files as well, right? In this case, size of structure should be the same.

I did not understand your problems with loading static or shared versions of lib, could you explainit in more details?

Regards,
Vladimir

Message Edited by vdudnik on 08-23-2005 02:14 PM

Message Edited by vdudnik on 08-23-2005 02:14 PM

Well I finally find what was going wrong : the libtool linker was removing my line with the IPP livrary so the libjpeg.so was not link agaisbt IPP and I was getting unresolved symbol at runtime !

now it works OK without recompiling original applications !

thanks to IPP, I now get two times gain on compress/decompress on all my applications without recompiling them.

I'm very interested in running IPP/IJG on Linux and if the work's been done to port the Makefile (& any additional files) I'd greatly appreciate someone posting them.

many thanks
Alistair

abraidwood wrote:
I'm very interested in running IPP/IJG on Linux and if the work's been done to port the Makefile (& any additional files) I'd greatly appreciate someone posting them.

many thanks
Alistair

well the modify IJG sources (src+makefile) are somethng like 1.2M in tgz format.

where can I put this things for others ?

thanks

There's an attachment facility in this message board, does it have a size limit?

abraidwood wrote:
There's an attachment facility in this message board, does it have a size limit?

well, I try it, let's see if it works !

if it's ok, please give some feedback of your lib usage...

thanks

Thanks for that, I got it working fine but had slight problems in an em64t platform (though that was probably my fault)

The lib seems to work well. I'm just using it in a linux command line app which imports large images and outputs a scaled version. I'm using the Resize function within IPP & it made sense to use an IPP based jpeg codec.

I think Intel should definitely release a Linux IJG lib - even as a sample (quite possibly based on yours).

thanks again,
Alistair

Dear valipp and abraidwood,

From your messages in this topic, I know you can make use of IPP with IJG libjpeg in Linux.

I am using Fedora 2 and I would like to try on it too. I see you have the modified IJG src and makefile but I cannot download it from the link: http://softwareforums.intel.com/attachments/ids/IPP/2444/1/jpeg_src.tgz

Would you mind sending it to my email at jason.yfho@gmail.com?

Excited to see the performance. Thank you very much.

Regards,
Jason

It seems the jpeg_src.tgzis unavailable for download,can you send a copy to my mail sywu@sohu.com?thanks

well to help people having download problems...
I put it on my web site : http://vald70.free.fr/jpeg_src.tgz

hope this will help

Dear valipp,

I downloaded your jpeg_src and complied it. When I reboot andthen run the cjpeg/djpeg, error message says:

-bash-3.00# cjpeg
Can't initialize IPP library
Below is my config & my procedures tosetup the IPP & your code:
- P4 2.4G, Fedora 2.
- I installed the l_ipp_ia32_itanium_pu_4.1.3.001.tar downloaded from Intel.
- Then in your jpeg_src, in Makefile, I added:
IPPROOT = /opt/intel/ipp41/ia32_itanium
- Then I run "make"and then "make install". No error in "make", but error in "make install":

/usr/bin/install -c -m 644 ./cjpeg.1 /usr/local/man/man1/cjpeg.1
/usr/bin/install: cannot stat `./cjpeg.1': No such file or directory
make: *** [install] Error 1
- Then I set "export LD_LIBRARY_PATH=/opt/intel/ipp41/ia32_itanium/sharedlib:$LD_LIBRARY_PATH"

Which procedures I did wrongly or I missed?

Thank you very much!

Jason

Hi Jason,

it looks like you use IPP v4.1 sample. Please note, there was typo in sample's code, namely, for cjpeg and djpeg utils you need to change one line:
cjpeg.c, line 488
if(ippStsNoErr != ippStaticInitBest())
{
fprintf(stderr,"Can't initialize IPP library
");
exit(EXIT_FAILURE);
}
should be changed to
if(ippStsNoErr > ippStaticInit())
{
fprintf(stderr,"Can't initialize IPP library
");
exit(EXIT_FAILURE);
}
the same for djpeg.c

Or, you can download IPP v5.0 beta samples

Regards,
Vladimir

Hi Vladimir,

Thank you! I changed the code as you mentioned and the cjpeg & djpeg can work probably. But I haven't tested the speed yet. I think it should be much quicker.

However, when I start my apache (apachectl start), an error occur due to the libjpeg:

Syntax error on line 232 of /var/www/conf/httpd.conf:
Cannot load /var/www/modules/libphp5.so into server: /usr/local/lib/libjpeg.so.62: undefined symbol: ippiDecodeHuffmanSpecInit_JPEG_8u

I checked that the /usr/local/lib/libjpeg.so.62 's date is today. i.e. just created.

Could you help? Thank you.

Best Regards,
Jason

H-m-m, it might be because of IPP shared libraries not in the search path? Did you make them accessible through LD_LIBRARY_PATH variable?

Vladimir

I already set the LD_LIBRARY_PATH as following:
export LD_LIBRARY_PATH=/opt/intel/ipp41/ia32_itanium/sharedlib:$LD_LIBRARY_PATH

Then I built the jpeg_src again. But the same error occur.

I searched the jpeg_src source code, ippiDecodeHuffmanSpecInit_JPEG_8u only appear in jpegipp.h and seems no one call this function. I tried to comment this line in the .h and rebuild. Everything alright (e.g. cjpeg, djpeg) except when I start apache, the sample error occur:

Syntax error on line 232 of /var/www/conf/httpd.conf:
Cannot load /var/www/modules/libphp5.so into server: /usr/local/lib/libjpeg.so.62: undefined symbol: ippiDecodeHuffmanSpecInit_JPEG_8u
Regards,
Jason

This function is called from jdhuff.c file, line 334. By the way, you can selectively choose which operation in IJG code will be replaced with IPP functions, please take a look on jconfig.h file, line 30.To turn off all IPP huffman functions youcan comment line with IPPJ_HUFF

#ifdef USE_IPP
#define IPPI_COPY
#define IPPS_ZERO
#define IPPJ_CC
#define IPPJ_SS
#define IPPJ_DCT_QNT
#define IPPJ_HUFF
#endif
Note, I assume you have IPP sample downloaded from Intel web site.

Regards,
Vladimir

When I configure php,checked config.log, I found that my libjpeg.so cannot reference to all functions defined in jpegipp.h:

/usr/local/lib/libjpeg.so: undefined reference to `ippiDecodeHuffmanSpecInit_JPE
G_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffmanStateGetBufS
ize_JPEG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiCMYKToYCCK_JPEG_8u_C4P4R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiYCCKToCMYK_JPEG_8u_P4C4R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffman8x8_JPEG_16s
1u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleDownRowH2V2_Box_JPE
G_8u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleUpRowH2V2_Triangle_
JPEG_8u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDecodeHuffmanStateInit_JP
EG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDCTQuantFwd8x8LS_JPEG_8u1
6s_C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDCTQuantInv8x8LS_JPEG_16s
8u_C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiGetHuffmanStatistics8x8_J
PEG_16s_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffmanSpecGetBufSi
ze_JPEG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiRGBToY_JPEG_8u_C3C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleUpRowH2V1_Triangle_
JPEG_8u_C1'
and more ........

Rgds,
Jason

It might be issue with your build of libjpeg.so, could you douoble check that it compiles without errors?

Hi,

thank you a lot, I see people are trying to use it.

From my side I would like to say that we have plan to release Linux version of IJG-IPP sample in the next time.

Regards,
Vladimir

I still do not have any idea on the errors.I have checked the libjpeg.so have been compiled correctly ,and the compilation do not have any warning or error.

What I havechangedare only 3 documents
1.Makefile of the jpeg_src
AddedIPPROOT = /opt/intel/ipp41/ia32_itanium (something like that)

2.cjpeg.c
Changed if(ippStsNoErr != ippStaticInitBest()) to if(ippStsNoErr > ippStaticInit())

3.djpeg.c
Changed if(ippStsNoErr != ippStaticInitBest()) to if(ippStsNoErr > ippStaticInit())

and then I make and make install,and the libjpeg.so have been correctly put in the /usr/local/lib/

When I reconfigure the PHP, the errors still exist,
config.log of the PHP

/usr/local/lib/libjpeg.so: undefined reference to `ippiDecodeHuffmanSpecInit_JPE
G_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffmanStateGetBufS
ize_JPEG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiCMYKToYCCK_JPEG_8u_C4P4R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiYCCKToCMYK_JPEG_8u_P4C4R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffman8x8_JPEG_16s
1u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleDownRowH2V2_Box_JPE
G_8u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleUpRowH2V2_Triangle_
JPEG_8u_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDecodeHuffmanStateInit_JP
EG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDCTQuantFwd8x8LS_JPEG_8u1
6s_C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiDCTQuantInv8x8LS_JPEG_16s
8u_C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiGetHuffmanStatistics8x8_J
PEG_16s_C1'
/usr/local/lib/libjpeg.so: undefined reference to `ippiEncodeHuffmanSpecGetBufSi
ze_JPEG_8u'
/usr/local/lib/libjpeg.so: undefined reference to `ippiRGBToY_JPEG_8u_C3C1R'
/usr/local/lib/libjpeg.so: undefined reference to `ippiSampleUpRowH2V1_Triangle_
JPEG_8u_C1'

Any Suggestion are welcome.
Thanks.

Message Edited by jason.yfho@gmail.com on 08-24-2005 01:57 AM

Yes, this is something strange. So you are sure that /usr/lib/libjpeg.so contains IPP functions, but when application tried to load this library the functions can't be found?

Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today