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

UYVY Resize

David_S_13
Beginner
298 Views
I am attempting to resize a UYVY frame using the code snippet below. I do not get an error, but my output is slightly blurry and I get vertical red and blue color bands. I thought this might be an error related to the step (stride) value, but the value looks to be calculated as (width * nChannels) or in this case (width*2).

Any thoughts on what I could be doing wrong int his situation?
Thanks.

------
IppStatus status = ippiResizeGetBufSize(srcROI, dstROI, 1,IPPI_INTER_NN, &iBufferSize);
if (status == ippStsNoErr)
{ //resize
IppiSize srcSize = {iInWidth,iInHeight};
IppiSize dstSize = {rctOutput.width,rctOutput.height};
Ipp8u* pResize = ippiMalloc_8u_C2(rctOutput.width,rctOutput.height, &iStep);
pSrcData = (PBYTE) pSrcPin->m_InputFrame.GetDataPtr();
status = ippiResizeYUV422_8u_C2R(pSrcData,
inROI,
iInStep,
srcROI,
pResize,
iOutStep,
outROI,
dblXFactor,
dblYFactor,
IPPI_INTER_NN);
...
ippiFree(pResize);
}
0 Kudos
1 Reply
Ying_H_Intel
Employee
298 Views
Hello
You may check if your src UYVY framehave patch at edge or thedst stepshould be iStep (32 byte aligned if ippiMalloc ) , not width*2.


Here is a code snippet from umc_video_resizing.cpp in IPP sample
if (cFormat == YUY2) {
// YUY2 format defined in VideoData with WidthDiv = 2
srcPlane.m_ippSize.width *= 2;
dstPlane.m_ippSize.width *= 2;
RectSrc.width *= 2;
ippiResizeYUV422_8u_C2R((const Ipp8u *)srcPlane.m_pPlane,
srcPlane.m_ippSize,
(int)srcPlane.m_nPitch,
RectSrc,
(Ipp8u *)dstPlane.m_pPlane,
(int)dstPlane.m_nPitch,
dstPlane.m_ippSize,
xRatio,
yRatio,
mInterpolation);
return UMC_OK;
}

Best Regards,
Ying
0 Kudos
Reply