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

Jpeg quantization tables with Ijl/UIC

pandeleflorin
Beginner
607 Views
Does anyone know eactly how to reuse the quantization table of a jpeg after processing (and reencoding)the image in it?
For example decode->Rotate->encode.
I know that IJL can set the Quantization table but what about Geting it?
How about UIC?
I know about jpegtran too - its toooo slooooow. Unless someone can help me intelify it:)
I am restricted to IPP 6.0 and limited knoledge of the Jpeg encoding/decoding
Thank you
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
607 Views

Hello,

Starting from IPP 6.1 UIC JPEG encoder and decoder have got an API to use external quantization and huffman tables. Please checkuic_jpeg_dec.h and uic_jpeg_enc.h files

ExcStatus InitHuffmanTable(Ipp8u bits[16], Ipp8u vals[256], int tbl_id, HTBL_CLASS tbl_class);
ExcStatus InitQuantTable(Ipp8u qnt[64], int tbl_id);
ExcStatus InitQuantTable(Ipp16u qnt[64], int tbl_id);

ExcStatus AttachHuffmanTable(int tbl_id, HTBL_CLASS tbl_class, int comp_no);
ExcStatus AttachQuantTable(int tbl_id, int comp_no);

here, by InitQuantTable call you prepare quantization table with particlar id (luminance anr chrominance table) and then you may attach certain quantization table to particular color component with AttachQuantTable call.

We still do not have an API toexpose quantization or huffman tables to the user, although they are read and kept internally.

We will consider that as a feature request for future versions of UIC JPEG implementation.

Regards,
Vladimir

View solution in original post

0 Kudos
2 Replies
Vladimir_Dudnik
Employee
608 Views

Hello,

Starting from IPP 6.1 UIC JPEG encoder and decoder have got an API to use external quantization and huffman tables. Please checkuic_jpeg_dec.h and uic_jpeg_enc.h files

ExcStatus InitHuffmanTable(Ipp8u bits[16], Ipp8u vals[256], int tbl_id, HTBL_CLASS tbl_class);
ExcStatus InitQuantTable(Ipp8u qnt[64], int tbl_id);
ExcStatus InitQuantTable(Ipp16u qnt[64], int tbl_id);

ExcStatus AttachHuffmanTable(int tbl_id, HTBL_CLASS tbl_class, int comp_no);
ExcStatus AttachQuantTable(int tbl_id, int comp_no);

here, by InitQuantTable call you prepare quantization table with particlar id (luminance anr chrominance table) and then you may attach certain quantization table to particular color component with AttachQuantTable call.

We still do not have an API toexpose quantization or huffman tables to the user, although they are read and kept internally.

We will consider that as a feature request for future versions of UIC JPEG implementation.

Regards,
Vladimir

0 Kudos
pandeleflorin
Beginner
607 Views
Thank you Vladimir
for the well documented answer( as always)
0 Kudos
Reply