Performs level shift, forward DCT and quantization of an 8x8 block.
IppStatus ippiDCTQuantFwd8x8LS_JPEG_8u16s_C1R(const Ipp8u* pSrc, int srcStep, Ipp16s* pDst, const Ipp16u* pQuantFwdTable);
IppStatus ippiDCTQuantFwd8x8LS_JPEG_16u16s_C1R(const Ipp16u* pSrc, int srcStep, Ipp16s* pDst, const Ipp32f* pQuantFwdTable);
pSrc |
Pointer to the 8x8 block in the source image. |
srcStep |
Distance in bytes between starts of consecutive lines in the source image. |
pDst |
Pointer to the destination 8x8 block of the quantized DCT coefficients. |
pQuantFwdTable |
Pointer to the quantization table for the encoder. |
The function ippiDCTQuantFwd8x8LS_JPEG is declared in the ippj.h file. It operates with ROI (see Regions of Interest in Intel IPP).
This function performs a forward DCT, quantization of DCT coefficients, and data conversion. Data from the unsigned Ipp8u range [0..255] are converted to the signed Ipp16s range [-128..127].
The function uses a quantization table suitable for fast encoding. This table must be prepared using the function ippiQuantFwdTableInit_JPEG.
Example “Using Combined DCT Functions” shows how to use the function ippiDCTQuantFwd8x8LS_JPEG_8u16s_C1R.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is NULL. |
Ipp8u pQuantRawTable[64] = { 16, 11, 12, 14, 12, 10, 16, 14,
13, 14, 18, 17, 16, 19, 24, 40,
26, 24, 22, 22, 24, 49, 35, 37,
29, 40, 58, 51, 61, 60, 57, 51,
56, 55, 64, 72, 92, 78, 64, 68,
87, 69, 55, 56, 80, 109, 81, 87,
95, 98, 103, 104, 103, 62, 77, 113,
121, 112, 100, 120, 92, 101, 103, 99};
Ipp8u src[8*8] = { 4, 4, 4, 4, 4, 4, 4, 4,
4, 3, 3, 3, 3, 3, 3, 4,
4, 3, 2, 2, 2, 2, 3, 4,
4, 3, 2, 1, 1, 2, 3, 4,
4, 3, 2, 1, 1, 2, 3, 4,
4, 3, 2, 2, 2, 2, 3, 4,
4, 3, 3, 3, 3, 3, 3, 4,
4, 4, 4, 4, 4, 4, 4, 4};
Ipp16s dst[64];
Ipp16u pQuantFwdTable[64];
int quality = 75;
ippiQuantFwdRawTableInit_JPEG_8u ( pQuantRawTable, quality );
ippiQuantFwdTableInit_JPEG_8u16u ( pQuantRawTable, pQuantFwdTable );
ippiDCTQuantFwd8x8LS_JPEG_8u16s_C1R ( src, 8, dst, pQuantFwdTable );
result:
pQuantRawTable (with quality)
8 6 6 7 6 5 8 7
7 7 9 9 8 0 12 20
13 12 11 11 12 25 18 19
15 20 29 26 31 30 29 26
28 28 32 36 46 39 32 34
44 35 28 28 40 55 41 44
48 49 52 52 52 31 39 57
61 56 50 60 46 51 52 50
pQuantFwdTable
4096 5461 6554 4096 2731 1638 1260 1057
5461 5461 4681 3277 2521 1130 1092 1170
4681 4681 4096 2731 1638 1130 936 1170
4681 3641 2979 2185 1260 745 819 1057
3641 2979 1725 1170 964 596 630 840
2731 1820 1170 1024 799 630 575 712
1311 1024 840 745 630 537 546 643
910 712 683 669 585 655 630 655
dst
-125 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0
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
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.