Converts an RGB image to the YCbCr color model and creates 422 MCU.
IppStatus ippiRGBToYCbCr422LS_MCU_8u16s_C3P3R(const Ipp8u* pSrcRGB, int srcStep, Ipp16s* pDstMCU[3]);
pSrcRGB |
Pointer to the source image ROI. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
pDstMCU |
Array of 3 pointers to the destination image blocks. |
The function ippiRGBToYCbCr422LS_MCU is declared in the ippj.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function converts an RGB image to the YCbCr image using the same formulas as the ippiRGBToYCbCr_JPEG function for computing Y, Cb, and Cr component values.
Additionally, this function converts source data from unsigned Ipp8u range [0..255] to the signed Ipp16s range [-128..127] performing level shift operation (by subtracting 128) and creates 422 MCU (see Figure “MCU Structure for Different JPEG Sampling Formats”).
Downsampling is performed by plain averaging.
Example “Using the function ippiRGBToYCbCr422LS_MCU” shows how to use the function ippiRGBToYCbCr422LS_MCU_8u16s_C3P3R.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is NULL. |
ippStsStepErr |
Indicates an error condition if srcStep has a zero or negative value. |
int k=0;
int buf;
Ipp8u SrcRGB[48*8];
for(int i = 0; i < 48*8; i++){
if(k==48) k=0;
SrcRGB[i] = k++;
}
Ipp16s* DstMCU[3];
DstMCU[0] = ippiMalloc_16s_C1(16,8,&buf); // no control on return value
DstMCU[1] = ippiMalloc_16s_C1(8,8,&buf);
DstMCU[2] = ippiMalloc_16s_C1(8,8,&buf);
ippiRGBToYCbCr422LS_MCU_8u16s_C3P3R(SrcRGB, 48, DstMCU);
result:
DstMCU[0]
-128 -125 -122 -119 -116 -113 -110 -107 -128 -125 -122 -119 -116 -113 -110 -107
-128 -125 -122 -119 -116 -113 -110 -107 -128 -125 -122 -119 -116 -113 -110 -107
-128 -125 -122 -119 -116 -113 -110 -107 -128 -125 -122 -119 -116 -113 -110 -107
-128 -125 -122 -119 -116 -113 -110 -107 -128 -125 -122 -119 -116 -113 -110 -107
-104 -101 -98 -95 -92 -89 -86 -83 -104 -101 -98 -95 -92 -89 -86 -83
-104 -101 -98 -95 -92 -89 -86 -83 -104 -101 -98 -95 -92 -89 -86 -83
-104 -101 -98 -95 -92 -89 -86 -83 -104 -101 -98 -95 -92 -89 -86 -83
-104 -101 -98 -95 -92 -89 -86 -83 -104 -101 -98 -95 -92 -89 -86 -83
DstMCU[1]
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
DstMCU[2]
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
-1 -1 -1 -1 -1 -1 -1 -1
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.