Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

range of ippiDCTQuantFwd8x8LS_JPEG

hajo_hoffmann
Beginner
502 Views
hi,

according to the Ippi Manual the ippiDCTQuantFwd8x8LS_JPEG function makes a data conversion from the unsigned Ipp8u range [0..255] to the signed Ipp16s range [-128..127].

I use this function and my output data has values above 127. How is that possible? Could my raw quantization table be the reason?

regards,
Hajo
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
502 Views
Hi,
yes, this functio do level shift for input data, DCT and quantization. You need to apply "formatted" quantization table to this function, not just "raw" quantization tables from bitstream. Please take a look on JPEGView sample to see how you can use this function.
Regards,
Vladimir
0 Kudos
hajo_hoffmann
Beginner
502 Views
We created the quantization table in a very similar way it is done in the JPEGview sample:

-- code ---------------------------------------------

// Initialize quantization table:
Ipp8u quantTableRaw[64] =
{
10, 10, 10, 10, 10, 10, 10, 10,
...
10, 10, 10, 10, 10, 10, 10, 10
}; // a very simple quantTable:

Ipp16u quantFwdTable[64] = {NULL};
ippStat = ippiQuantFwdRawTableInit_JPEG_8u(quantTableRaw, quality);
ippStat = ippiQuantFwdTableInit_JPEG_8u16u(quantTableRaw, quantFwdTable);

-- end of code -------------------------------------

The "quantFwdTable" contains values between (around) -600 and (around) 700 - using a quality of 100.

Could our quantization table be the reason for this?

best regards
Hajo Hoffmann
0 Kudos
Vladimir_Dudnik
Employee
502 Views
Hi,
that's ok, we changed division operation to multiplication for performance reasons. Please see function description in IPP manual.
Description

The function

ippiQuantFwdTableInit_JPEG is declared in the ippj.h file. This function

prepares quantization table in a format that is suitable for fast encoding. Initial raw quantization

tables have zigzag order by definition. This function performs reordering transformation that

converts the zigzag sequence of table elements to conventional order (left-to-right, top-to-bottom). To avoid division during quantization, the function

ippiQuantFwdTableInit_JPEG scales the array by 15 bits. The pointer pQuantRawTable points to the array of 64 elements as is required by [ISO10918], Annex B.2.4.1, Quantization Table Specification Syntax. The pointer pQuantFwdTable points to an array containing 64 values of Ipp16u type.

Regards,
Vladimir
0 Kudos
Reply