Converts 4:2:2 CbYCr image to 4:2:0 YCbCr image with rotation.
IppStatus ippiCbYCr422ToYCbCr420_Rotate_8u_C2P3R(const Ipp8u* pSrc, int srcStep, IppiSize srcRoi, Ipp8u* pDst[3], int dstStep[3], int rotation);
IppStatus ippiCbYCr422ToYCbCr420_Rotate_8u_P3R(const Ipp8u* pSrc[3], int srcStep[3], IppiSize srcRoi, Ipp8u* pDst[3], int dstStep[3], int rotation);
pSrc |
Pointer to the source image for pixel-order data. Array of pointers to the separate source image planes for planar data. |
srcStep |
Distance in bytes between starts of the consecutive lines in the source image. Array of such values in bytes through the source image. |
srcRoi |
ROI of the source image, in pixels. The ROI of the destination image is calculated by user. |
pDst |
Array of pointers to the destination image planes. |
dstStep |
Distance in bytes between starts of the consecutive lines in the destination image. Array of such values through the destination image planes . |
rotation |
Rotation control parameter. Possible values: |
IPPVC_ROTATE_DISABLE no rotation |
|
IPPVC_ROTATE_90CCW rotating by 90o counterclockwise |
|
IPPVC_ROTATE_90CW rotating by 90o clockwise |
|
IPPVC_ROTATE_180 rotating by 180o |
|
See the corresponding enumerator in the introduction to the General Functions. |
The function ippiCbYCr422ToYCbCr420_Rotate is declared in the ippvc.h file. This function converts 4:2:2 two-channel or three-plane CbYCr image pSrc to the 4:2:0 YCbCr three-plane image pDst. The two-channel source image has the following sequence of samples: Cb0, Y0, Cr0, Y1, Cb1, Y2, Cr1, Y3, Cb2, .... Three-plane source image has the following order of pointers: Cb-plane, Y-plane, Cr-plane. The destination image has the following order of pointers: Y-plane, Cb-plane, Cr-plane (see Table “Pixel-Order Image Formats” and Table “Planar Image Formats” ).
The function additionally rotates or flips an image in accordance with the value of the parameter rotation.
Example “Call of ippiCbYCr422ToYCbCr420_Rotate_8u_C2P3R” shows how to call ippiCbYCr422ToYCbCr420_Rotate_8u_C2P3R.
#define ROTATE IPPVC_ROTATE_90CCW { Ipp8u* pSrcIm; Ipp8u* pDstIm[3]; int stepSrc; int stepDst[3]; IppiSize srcRoi = {32,32}; IppiSize dstRoi; switch( ROTATE ) { case IPPVC_ROTATE_DISABLE: case IPPVC_ROTATE_180: dstRoi.width = srcRoi.width ; dstRoi.height = srcRoi.height; break; case IPPVC_ROTATE_90CCW: case IPPVC_ROTATE_90CW: dstRoi.width = srcRoi.height; dstRoi.height = srcRoi.width ; break; } pSrcIm = ippiMalloc_8u_C2(srcRoi.width, srcRoi.height, &stepSrc); pDstIm[0] = ippiMalloc_8u_C1(dstRoi.width, dstRoi.height, &(stepDst[0])); pDstIm[1] = ippiMalloc_8u_C1(dstRoi.width/2, dstRoi.height/2, &(stepDst[1])); pDstIm[2] = ippiMalloc_8u_C1(dstRoi.width/2, dstRoi.height/2, &(stepDst[2])); ippiCbYCr422ToYCbCr420_Rotate_8u_C2P3R(pSrcIm, stepSrc, srcRoi, pDstIm, stepDst, ROTATE); ippiFree(pDstIm[0]); ippiFree(pDstIm[1]); ippiFree(pDstIm[2]); ippiFree(pSrcIm); }
ippStsNoErr |
Indicates no error. Any other value indicates an error. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is null. |
ippStsSizeErr |
Indicates an error condition if any field of the srcRoi is less than 2. |
ippStsDoubleSize |
Indicates the condition when the values srcRoi.width and srcRoi.height are not multiples of 2. The function reduces their original values to the nearest multiples of 2 and continues operation. |
If srcRoi.width and srcRoi.height are not multiples of 2, the function reduces the values to the nearest multiples of 2. For example, if the size value is 7, the function approximates this value to 6.
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.