#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, srcYCbCrstep, dstYCbCrstep; Ipp8u *srcRGB, *srcYUV, *dstYUV, *dstRGB, *srcYCbCr, *dstYCbCr; IppiSize smallSize, largeSize; IppiRect srcroi; IppStatus st; srcRGBstep = wSmall * 3; srcRGB = (Ipp8u*)malloc(srcRGBstep * hSmall); srcYUVstep = wSmall * 2; srcYUV = (Ipp8u*)malloc(srcYUVstep * hSmall); dstYUVstep = wLarge * 2; dstYUV = (Ipp8u*)malloc(dstYUVstep * hLarge); dstRGBstep = wLarge * 3; dstRGB = (Ipp8u*)malloc(dstRGBstep * hLarge); srcYCbCrstep = wSmall * 2; srcYCbCr = (Ipp8u*)malloc(srcYCbCrstep * hSmall); dstYCbCrstep = wLarge * 2; dstYCbCr = (Ipp8u*)malloc(dstYCbCrstep * hLarge); smallSize.width = wSmall; smallSize.height = hSmall; largeSize.width = wLarge; largeSize.height = hLarge; srcroi.width = wSmall; srcroi.height = hSmall; srcroi.x = srcroi.y = 0; ippiImageJaehne_8u_C3R(srcRGB, srcRGBstep, smallSize); st = ippiRGBToCbYCr422_8u_C3C2R(srcRGB, srcRGBstep, srcYCbCr, srcYCbCrstep, smallSize); /* Here starts Detlev's case */ ippiCbYCr422ToYCbCr422_8u_C2R(srcYCbCr, srcYCbCrstep, srcYUV, srcYUVstep, smallSize); ippiResizeYUV422_8u_C2R(srcYUV, smallSize, srcYUVstep, srcroi, dstYUV, dstYUVstep, largeSize, (double)wLarge/wSmall, (double)hLarge/hSmall, IPPI_INTER_CUBIC); ippiYCbCr422ToCbYCr422_8u_C2R(dstYUV, dstYUVstep, dstYCbCr, dstYCbCrstep, largeSize); /* End of Detlev's case */ /* Visual check */ ippiYCbCr422ToRGB_8u_C2C3R(dstYCbCr, dstYCbCrstep, 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); } free(srcRGB); free(srcYUV); free(dstYUV); free(dstRGB); return 0; }