Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.

ippiResizeYUV420Super_8u_P2R crash

Pratibha_P_Intel
Employee
195 Views

Hi!

I am trying to use IPP functionality to resize/downsizeYuv image using ippiResizeYUV420Super_8u_P2R API.

I did use ippiResizeYUV420GetSize, allocated memory for pSpec and pBuffer as per output of this API using malloc,  called ippiResizeYUV420SuperInit followed by ippiResizeYUV420GetBufferSize.

Everything is fine so far and all of these APIs return status 0, but when I actually use ippiResizeYUV420Super_8u_P2R, my application crashes at I9_ownSS1_8u.

Any advice? Also, I am not sure what  should be my destination offset in ippiResizeYUV420Super_8u_P2R and how to calculate that.

Please note that I am using this API for downsizing my image.

Is there any sample code for this?

Thanks,

Pratibha

0 Kudos
3 Replies
Tatyana_B_Intel
Employee
195 Views

Hello,

Could you please provide your source code example in order to check the issue?

Thanks,

Tatyana

Pratibha_P_Intel
Employee
195 Views

Please find the code below:

 

IppiResizeYUV420Spec *pSpec ;
Ipp32s SpecSize;
Ipp32s InitBufSize;
IppiSize srcSize, dstSize;
srcSize.width = _inputFrame->width;
srcSize.height = _inputFrame->height;
dstSize.width = _outputFrame->width;
dstSize.height = _outputFrame->height;
IppStatus status;
//IppStatus status =ippiResizeYUV420LanczosInit();
IppiInterpolationType interpolType = ippSuper;
//status = ippInit();
uint32_t actualInputFrameHeight = ( _inputFrame->height * 2 ) / 3;
uint32_t actualOutputFrameHeight = ( _outputFrame->height * 2 ) / 3;
unsigned char * __restrict inputYPlane = ( unsigned char * __restrict )_inputFrame->imageData[0];
unsigned char * __restrict inputUvPlane = ( unsigned char * __restrict )( _inputFrame->imageData[0] + ( _inputFrame->pitch *  actualInputFrameHeight ));
unsigned char * __restrict outputYPlane = ( unsigned char * __restrict )_outputFrame->imageData[0];
unsigned char * __restrict outputUvPlane = ( unsigned char * __restrict )( _outputFrame->imageData[0] + ( _outputFrame->pitch *  actualOutputFrameHeight ));
IppiPoint dstOffset;
dstOffset.x = 0;
dstOffset.y = 0;
status = ippiResizeYUV420GetSize(srcSize,
dstSize, interpolType,
0,&SpecSize, &InitBufSize);
 
pSpec = (IppiResizeYUV420Spec*)malloc(SpecSize);
 
 
status = ippiResizeYUV420SuperInit(srcSize,
dstSize,pSpec);
 
status = ippiResizeYUV420GetBufferSize(pSpec,dstSize, &InitBufSize);
Ipp8u* pBuffer =  (Ipp8u*)malloc(InitBufSize);
//status = ippiResizeYUV420LanczosInit(srcSize, dstSize, 2, pSpec, pBuffer);
//status = ippiResizeYUV420LinearInit( srcSize,  dstSize,pSpec);
ippiResizeYUV420Super_8u_P2R(inputYPlane, _inputFrame->pitch, inputUvPlane, _inputFrame->pitch, 
outputYPlane, _outputFrame->pitch, outputUvPlane, _outputFrame->pitch,  dstOffset, dstSize, 
pSpec,  pBuffer);
free(pSpec);
free(pBuffer);
 
Pratibha_P_Intel
Employee
195 Views

Hi Tatyana,

 

I figured out that I was passing wrong image sizes to the API and its working without crash after that.

 

Thanks,

Pratibha

Reply