Computes the differences between input sample and predictor for the first line.
IppStatus ippiDiffPredFirstRow_JPEG_16s_C1(const Ipp16s* pSrc, Ipp16s* pDst, int width, int P, int Pt);
pSrc |
Pointer to the row of samples. |
pDst |
Pointer to the row of calculated differences. |
width |
Row width in elements; has always the same value for all rows. |
P |
Sample precision derived from JPEG frame header, varies from 2 to 16. |
Pt |
Point transformation parameter derived from JPEG scan header; its value should be 0 or a positive integer. |
The function ippiDiffPredFirstRow_JPEG is declared in the ippj.h file. This function operates with the first row of samples pSrc at the start of the scan and at the beginning of each restart interval only. It computes modulo 216 differences between input samples and predictor with the specified sample precision P and performs the point transformation with the specified parameter Pt. The function uses special predictors for the first line.
Example “Using the function ippiDiffPredFirstRow_JPEG” shows how to use the function ippiDiffPredFirstRow_JPEG_16s_C1.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if one of the specified pointers is NULL. |
ippStsSizeErr |
Indicates an error condition if the width parameter has a negative value. |
ippStsBadArgrErr |
Indicates an error condition if P or Pt has an illegal value. |
void func_DiffPredFirstRow()
{
Ipp16s pSrc[4*4] = { 0, 1, 2, 4,
8, 16, 32, 64,
32, 16, 8, 4,
2, 1, 0, 1};
Ipp16s pDst[4*4];
int width = 4;
int P = 8;
int Pt = 2;
int predictor = 2;
ippiDiffPredFirstRow_JPEG_16s_C1(pSrc, pDst, width, P, Pt);
for(int j = 1; j < 4; j++)
{
ippiDiffPredRow_JPEG_16s_C1(pSrc+j*width, pSrc + (j-1)*width,
pDst+j*width, width, predictor);
}
}
Result:
pDst
-32 1 1 2 <- the first row is obtained using ippiDiffPredFirstRow
8 15 30 60 the rest are obtained using ippiDiffPredRow
24 0 -24 -60
-30 -15 -8 -3
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.