Maybe I'm missing it, but there doesn't seem to be a simple way like there was in IJL.
链接已复制
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
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
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
