#include #include "opencv2/imgproc/imgproc_c.h" #include "opencv2/highgui/highgui_c.h" const int wSmall = 352, hSmall = 288; const int wLarge = 800, hLarge = 600; int main() { int srcRGBstep, srcYUVstep, dstYUVstep, dstRGBstep; Ipp8u *srcRGB, *srcYUV, *dstYUV, *dstRGB; IppiSize smallSize, largeSize; IppiRect srcroi; srcRGB = ippiMalloc_8u_C3(wSmall, hSmall, &srcRGBstep); srcYUV = ippiMalloc_8u_C2(wSmall, hSmall, &srcYUVstep); dstYUV = ippiMalloc_8u_C2(wLarge, hLarge, &dstYUVstep); dstRGB = ippiMalloc_8u_C3(wLarge, hLarge, &dstRGBstep); smallSize.width = wSmall; smallSize.height = hSmall; largeSize.width = wLarge; largeSize.height = hLarge; ippiImageJaehne_8u_C3R(srcRGB, srcRGBstep, smallSize); ippiRGBToYUV422_8u_C3C2R(srcRGB, srcRGBstep, srcYUV, srcYUVstep, smallSize); srcroi.width = wSmall; srcroi.height = hSmall; srcroi.x = srcroi.y = 0; ippiResizeYUV422_8u_C2R(srcYUV, smallSize, srcYUVstep, srcroi, dstYUV, dstYUVstep, largeSize, (double)wLarge/wSmall, (double)hLarge/hSmall, IPPI_INTER_CUBIC); /* Visually check */ ippiYUV422ToRGB_8u_C2C3R(dstYUV, dstYUVstep, dstRGB, dstRGBstep, largeSize); { IplImage *img = cvCreateImage(cvSize(wLarge, hLarge), IPL_DEPTH_8U, 3); ippiCopy_8u_C3R(dstRGB, dstRGBstep, (Ipp8u*)img->imageData, img->widthStep, largeSize); cvNamedWindow("dst", 1); cvShowImage("dst", img); cvWaitKey(0); cvReleaseImage(&img); } ippiFree(srcRGB); ippiFree(srcYUV); ippiFree(dstYUV); ippiFree(dstRGB); return 0; }