- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
}
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page