Performs 2:1 horizontal sampling and 1:1 vertical sampling of an image row.
IppStatus ippiSampleDownRowH2V1_Box_JPEG_8u_C1(const Ipp8u* pSrc, int srcWidth, Ipp8u* pDst);
pSrc |
Pointer to the source image row. |
pDst |
Pointer to the destination image row. |
srcWidth |
Width of the source row in pixels. |
The function ippiSampleDownRowH2V1_Box_JPEG is declared in the ippj.h file. This function performs 2:1 horizontal sampling and 1:1 vertical sampling of an image row. Downsampling is performed as a simple “box” filter.
Example “Using the function ippiSampleDownRowH2V1_Box_JPEG” shows how to use the function ippiSampleDownRowH2V1_Box_JPEG_8u_C1.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if one or both of the specified pointers are NULL. |
ippStsSizeErr |
Indicates an error condition if srcWidth has a zero or negative value. |
void func_sampling()
{
Ipp8u pSrc[8*8];
IppiSize srcSize = {8, 8};
int srcStep = 8*sizeof(Ipp8u);
int srcWidth = 8;
Ipp8u pDst[8*8];
ippiImageJaehne_8u_C1R( pSrc, srcStep, srcSize);
for(int r = 0; r < 8; r++)
{
ippiSampleDownRowH2V1_Box_JPEG_8u_C1( &pSrc[8*r], srcWidth, &pDst[4*r]);
}
}
Result:
pSrc (8x8) pDst (8x4)
0 67 165 209 209 165 67 0 34 187 187 33
67 209 255 250 250 255 209 67 138 252 253 138
165 255 226 188 188 226 255 165 210 207 207 210
209 250 188 140 140 188 250 209 230 164 164 229
209 250 188 140 140 188 250 209 230 164 164 229
165 255 226 188 188 226 255 165 210 207 207 210
67 209 255 250 250 255 209 67 138 252 253 138
0 67 165 209 209 165 67 0 34 187 187 33
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.