How to create YCbCr data external to IPP that can be used in IPP

How to create YCbCr data external to IPP that can be used in IPP

 

My application needs to create image buffers outside of IPP,  and use them within IPP.

I need to process YCbCr, YCbCrA, RGB and RGBA data with 8 and 16 bit sample sizes.

I've managed to get a basic blur filter working in my environment - I had to carefully avoid the edges of my image to make it work. Having complete control over how I define and build the images external to IPP, I'd love to understand how the memory is laid out inside of IPP so I can replicate it.

Specifically, being able to use the YCbCr functions would be super awesome. I need to know the memory layout for these images and, being in the body rather than header files precludes me from getting the info from the source code available to me.

I'd like to accommodate up to 16x16 kernels over my image data, so what I'm thinking of doing for planar YCbCr is...

  • allocate "overscan" areas outside the active image area - 8 rows and 8 columns both before and after the active image.
  • use ptr + 8 * width + 8, to point to the top left / first pixel in the active image
  • use width + 16 as the stride (multiplied by whatever the size of the sample type is)
  • align every start of line (starting with the overscan) to 64 byte boundaries and pad with zeros at the end of the line

My assumption is that, for planar images, the Cb data starts lumaSamples above the Luma data, and the Cr data starts chromaSamples above the Cb data. Where lumaSamples = (width + 16) x (height x 16) and chromaSamples = (width / 2 + 8) x (height + 16).

Does this have a decent chance of working? If not, how should I tweak it?

 

 

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

I forgot to specify that it's YCbCr 4:2:2  - i.e. the chroma is horizontally sub-sampled by a factor of 2.

I would say, read the 

Intel® Integrated Performance

Primitives

Reference Manual, Volume 2: Image Processing

Regards,

Adriaan van Os

 

 

Gee thanks!

I’d NEVER have thought to read the docs! 

Kindly point out the part where they specify the memory layout of the various image formats in sufficient detail to answer my questions. 

 

Leave a Comment

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