Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Compress /Encode Raw Image to JPEG?

jwmcfar
Beginner
700 Views
With the IJL Library being retired, can anyone provide a link to documentation on how to do a simple JPEG quality encode with the IPP library?

Maybe I'm missing it, but there doesn't seem to be a simple way like there was in IJL.
0 Kudos
7 Replies
Vladimir_Dudnik
Employee
700 Views

Hi,

did you looked at IPP samples? We have big bunch of different samples which demonstrates how to use IPP to build various media codecs,including JPEG andJPEG2000

Regards,
Vladimir

0 Kudos
jwmcfar
Beginner
700 Views
Well, the IPP IJL sample seems like it will work.

However, is Intel still improving the IJL lib, or is it basically just a pass-through interface to the IPP dlls now?
0 Kudos
Vladimir_Dudnik
Employee
700 Views

You can see three different JPEG samples on IPP main page.

1) IJL, for those customers who still use this old interface. It demostrates how you can implement IJL interface with using IPP functions. It will not be improved or extended.
2) IJG, this sample demonstrates how you can speedup well-know JPEG codec with using IPP
3) JPEGView sample contains simple codec, but this codec supports JPEG lossless mode, is able to extract Exif metadata, decoder is threaded with using OpenMP. We plan to continue improve this codec.

Regards,
Vladimir

0 Kudos
jwmcfar
Beginner
700 Views
I'm currently getting an access violation while attempting to compress a JPEG.

I've got the following code:

Everything works OK until

IJLERR err;
JPEG_CORE_PROPERTIES image;
err = ijlInit(ℑ);
ZeroMemory(ℑ, sizeof(JPEG_CORE_PROPERTIES));

if (err != IJL_OK)
{
return false;
}
if (bmiHeader.biBitCount != 24)
{
//Unsupported format
return false;
}


//Resize output buffer
OutputBuffer.resize(bmiHeader.biWidth * bmiHeader.biHeight * 3);

//DIB
image.DIBWidth = bmiHeader.biWidth;//
image.DIBHeight = bmiHeader.biHeight;//
image.DIBBytes = ImageBuffer;//


//Setup JPEG
char saveto[] = "C://imagetest.jpg";
image.JPGFile = saveto;
image.JPGWidth = bmiHeader.biWidth;//
image.JPGHeight = bmiHeader.biHeight;//
image.JPGBytes = NULL;//

image.DIBChannels = 3; //
image.DIBColor = IJL_BGR; //
image.DIBPadBytes = IJL_DIB_PAD_BYTES(bmiHeader.biWidth, 3);




image.JPGSizeBytes = NULL;//

image.JPGColor = IJL_YCBCR; //
image.JPGChannels = 3; //
image.JPGSubsampling = IJL_411; //
image.jquality = 50;

bool returnval = true;
err =ijlWrite(ℑ, IJL_JBUFF_WRITEWHOLEIMAGE);

if (err != IJL_OK)
{
returnval = false;
}
OutputBuffer.resize(image.JPGSizeBytes);
if (ijlFree(ℑ) != IJL_OK)
{
TRACE("Can't free JPEG Library ");
}
return returnval;

ijlWrite is returning IJL_EXCEPTION_DETECTED.

Do you have any clue why?

Thanks,
Josh McFarlane
0 Kudos
jwmcfar
Beginner
700 Views
It's always the little things that get you.

Zero before Init, not after.
0 Kudos
support2
Beginner
700 Views
IJL 1.5x, IJL-IPP based and IPP-Codec can also be presented with same basic API ( based on IJL 1.5x like API) for memory or file compress/decompress. This allows fast switching between each version ( from application point of view) and also easier performance comparison.
Starting with Intel IPP 4.x DLL project for IJL-IPP it is not too difficult to build the solution.
SRSR
0 Kudos
Vladimir_Dudnik
Employee
700 Views

Seems you solved your issue? So, what is your feeling about IJL implementation in IPP v5.0?

BTW, did you try JPEG codec in JPEGView sample? This codec supports lossless JPEG, it also threaded and is able to retrieve Exif metadata.

Regards,
Vladimir

0 Kudos
Reply