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

Compress to JPEG 411 from YUV422

jbrossais
Beginner
985 Views
I have a problem to compress image to Jpeg YCbCr411. In fact, I have a camera which gives images in YUV422 (YCbCr422). I would to compress it to Jpeg YCbCr411 but IJL2 (with ipp4) and sample jpegview wouldn't compress the image. If i put the image in BGR24 or in YUV444 it's Ok but not in YUV411.In my case i must compress more than 300 images per second so the time of the compression is very important.

Thanks
0 Kudos
6 Replies
Vladimir_Dudnik
Employee
985 Views
Hi,
you actually ask about resampling from 422 to 411. We do not provide such possibility in our sample. I recommend you to take a look on JPEGView sample, which contains JPEG codec which faster than IJL because it is simple. By the way, what performance you have with IJL? What images sizes do you use?
Regards,
Vladimir
0 Kudos
support2
Beginner
985 Views
Using IJL v2 it is possible to directly use YUY2 format as source for the compressor. In this scheme and with P4 3Ghz HT we have validated real time compression for more than 100 Mo/sec. Anyway as previously said in another post, codec from JpegView is even faster than IJL v2.
I'm not sure that conversion to 4:1:1 is the best way to achieve global performance as, as far as I know, only 4:2:2 can be directly used by IJL. Correct me if this is not true.
SRSR
0 Kudos
jbrossais
Beginner
985 Views
But IJL2 are build with ipp4.
Pictures are in CIF (384*244). On a Prescoot 3GHz the compress time is lower than to 2ms to compress from RGB24 to Jpeg YCbCr 411 (quality 75). I made different test and I find that IJL2 are faster than the jpeg sample (around 0.3ms between ijl2 and jpegview) but maybe i don't use this example perfectly.
With IJl I couldn't compress from 422 to 411 but only from 422 to 422. But in this case the final file is bigger.
I don't understand why the time is the same if I compress from RGB24 or from YUV422. In fact the algorithm of JPEG convert RGB to YUV so if I give an YUV file to the encoder it will encode faster??

Thanks
0 Kudos
Vladimir_Dudnik
Employee
985 Views
Hi,
there was typo in JPEGView sample at encoding side. It writes resulting JPEG file with the same size as input BMP. Of course, it compress data, just odd bytes added at the end. It is simple to correct, you need to insertone line to the end of SaveAsJPEG() function in JPGViewDoc.cpp file:
Code:
  jpeg.Open(lpszPathName,CFile::modeCreate|CFile::modeWrite|CFile::typeBinary);

  JPEGSize = encoder.m_dst.currPos; // insert this line to create JPEG file with correct size

  jpeg.Write(pJPEG,JPEGSize);
You can easely add the possibility to work with YCbCr data to this sample by yourself. In that case performance of encoding will be even better.
Note, we will add possibility to decompress YCbCr422 JPEG data to YUY2 format in the next version of sample, which will be available soon.
Regards,
Vladimir
0 Kudos
jbrossais
Beginner
985 Views
Hi,

Thanks for your previous answer.
But I have a new problem with ipp and IJL2. In fact I must compress to JPEG from YUV420 planar. In all examples the image comes in interleave not in planar. So in my case I must convert from planar to interleaved so it's not very performant. For this conversion I use the fonction ippiCopy_8u_P3C3R to convert from planar to interleaved but before I must convert YUV422 to YUV444 so I must resize U and V plans.
So my question is: Does IJL2 (based on ipp4) or Ipp4 support encoding from YUV420 planar?

Regards,
0 Kudos
Vladimir_Dudnik
Employee
985 Views
Hi,
currently we do not support planar YUV420 format. You can submit this as feature request, so we can consider adding such functionality into future versions of JPEG sample.
Regards,
Vladimir
0 Kudos
Reply