problem with x64 ippiCopy YV12 image ROI

problem with x64 ippiCopy YV12 image ROI

Imagen de shadowwolfx

I have an image that I am copying into another image using ROI. Format is YV12.  The code I am using is from the intel sample Image,cpp: BOOL Image::CopyDataP_ROI(void** ppData, int* step, IppiSize roiSize) { if (!(m_InitFlag & initAlloc)) return FALSE;
     if (!ppData) return FALSE;
     if (!m_plane) return FALSE;
     roiSize.width *= ItemSize();
     for (int c=0; c < Channels(); c++) {

          IppiSize size = roiSize;
          ippiCopy_8u_C1R((Ipp8u*)ppData[c], step[c], (Ipp8u*)GetRoiPtrP(c), StepP(c), size);     
     m_Updated = TRUE;
     return TRUE;

If I have a 640x480 image that I copy into a 640x480 ROI, it appears correct.
If I have a 320x240 image that I copy into a 640x480 image, the image appears as shown int he attached image.

The image appears stretched vertically and repeated four times.  
If I have a 640x480 source and resize it to 320x240 and place it within a 320x240 ROI in the destination 640x480 image,  it appears correctly.  It seems that everything works correctly if the source image resolution is the same as the destination resolution.  
The same exact code compiled for 32-bit does not have this issue at all.  Not sure why but could it have something to do with the x64 pointers to the planar data or perhaps the ptr math (common errors when converting to x64).
Has anyone else run into this issue or can perhaps point me int he right direction?  Thanks.

publicaciones de 4 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.
Imagen de Igor Astakhov (Intel)


I don't see anything attached. BTW - do you use correct srcStep and dstStep? Do they match source and destination?

regards, Igor

Imagen de shadowwolfx

Here is the image I tried to attach in the original post:

Imagen de Sergey Khlystov (Intel)

Hi shadowwolfx,

It may happen, that this function erroneously changes CImage resolution data, like m_width. Check CImage.Step() before and after calling of CopyDataP_ROI.

This class might work good on interleaved (RGB) images, but I'm not sure if we use planar images, especially with different sampling like YV12. We haven't checked this sample for several years.

Use debugger to step into this function and to look what's happening with image attributes.


Regards, Sergey

Inicie sesión para dejar un comentario.