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

jpeg decode

ramazand
Beginner
502 Views
Hi
I installed ipp library for jpeg decoding.After that I saw two folders at image codec folder.Uic and ijg.I compiled ijg projects using visual studio 2008 and I think jpeg decode performance isn't enough for my project.What are the differences between uic and ijg?How can I compile uic and run a jpeg decode sample for uic on visual studio?I didn't see any sample code jpg to bmp on uic.
0 Kudos
4 Replies
Joseph_S_Intel
Employee
502 Views

Hi
Please take a look at the readme.htm file in the UIC folder for instructions on how to build the UIC samples with MS Visual Studio. The transcoder sample provides an example of how to use the UIC to convert JPEG to BMP as well as other formats. UIC is a set of C++ classes that makes it easier to build transcodersthat support several popular codecs.

0 Kudos
ramazand
Beginner
502 Views
Hi
Thanks for the reply.
I read the readme.htm file.I installed ipp and tbb libraries.I think Qt isn't necessary for compiling uic_transcoder_con application.I created a vs2008 project and add the headers and cpp files.In the codec path I saw dll projects.What is the next step?Compiling the dll projects?
0 Kudos
ramazand
Beginner
502 Views
Hi
I compiled the uic_transcoder_con application and compared with openCV's jpeg decode.I used a test image which size is 90 kb.
After the test I got these results.
Decoding jpeg with ipp takes 8 msec,
Encoding jpeg with ipp takes 19 msec,
Decoding jpeg with openCV takes 21 msec,
Encoding jpeg with openCV takes 39 msec.
Are these results true? Or could I got better results using ipp.
My cpu is intel core i7 2.93 gHz.
I changed the uic_transcoder_application's main function for testing jpeg decode.
My test code:
int main(int argc, char* argv[])
{
int i;
double msec;
double decTime;
double encTime;
Ipp8u* buf;
IM_TYPE fmtIn = IT_JPEG ;
IM_TYPE fmtOut = IT_JPEG ;
ExcStatus res;
CIppImage image;
CommandLine cmdline;
CFormatDetector detector;
BaseStream::TSize cnt;
BaseStream::TSize size;
bool help_flag;
CStdFileInput fi ;
CStdFileOutput fo;
CMemBuffInput mi;
CMemBuffOutput mo;
CmdOptions cmdOptions;
cmdOptions.loops = 1;
ippStaticInit();
copyright_();
cmdline.AddKey("j","jpeg encoder mode: b - BASELINE (8-bit lossy); e - EXTENDED (12-bit lossy); p - PROGRESSIVE (8-bit prgsive); l - LOSSLESS (2-16 bit lossless)",
cmdOptions.jmode, 1, (StringA)"b", IT_JPEG);
cmdOptions.jpg_quality = 85;
IplImage *cvImage ;
CTimer timer;
double elapsed = 0 ;
int aa = 1;
for ( int ii = 0 ; ii < aa ; ii++)
{
timer.Start();
fi.Open ( "uic_test_image.jpg" ) ;
res = DecodeImage(fi, image, cmdOptions, fmtIn, &decTime);
fi.Close();
timer.Stop();
elapsed += timer.GetTime(CTimer::msec);
}
printf("Ipp decode time: %.2f msec\n", elapsed/aa);
elapsed = 0 ;
for ( int ii = 0 ; ii < aa ; ii++)
{
timer.Start();
fo.Open("Ipp_output.jpg");
res = EncodeImage(image, fo, cmdOptions, fmtOut, &encTime);
fo.Close();
timer.Stop();
elapsed += timer.GetTime(CTimer::msec);
}
printf("Ipp encode time: %.2f msec\n", elapsed/aa);
elapsed = 0 ;
for ( int ii = 0 ; ii < aa ; ii++)
{
timer.Start();
cvImage = cvLoadImage("uic_test_image.jpg");
cvReleaseImage(&cvImage);
timer.Stop();
elapsed += timer.GetTime(CTimer::msec);
}
printf("Open CV decode time: %.2f msec\n", elapsed/aa);
elapsed = 0 ;
cvImage = cvLoadImage("uic_test_image.jpg");
for ( int ii = 0 ; ii < aa ; ii++)
{
timer.Start();
cvSaveImage("CV_output.jpg",cvImage);
timer.Stop();
elapsed += timer.GetTime(CTimer::msec);
}
printf("Open CV encode time: %.2f msec\n", elapsed/aa);
return 0;
} // main()


cmdOptions.jpg_quality = 85;


return 0;} // main()
0 Kudos
Thomas_Jensen1
Beginner
502 Views
Since IPP Jpeg is threaded, I think it is better to encode/decode a large Jpeg file, and to verify that all cores are at 100%, while the encoding/decoding is busy.
Alternatively, run the above code multiple times, and check the core load.

If you discover that your quad core cpu is only loaded 25%, then threading is not active, and your could get a great speedup by enabling threading.
0 Kudos
Reply