Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

JPEG dct quantization funciotn...

networkcare
Beginner
629 Views
i wana program a quantization function.
ippiDCTQuantFwd8x8LS_JPEG_8u16s_C1R(src,src_step,block,qtbl)
-->
ippiDCT8x8FwdLS_8u16s_C1R(src,src_step,block, -128)
ippiQuantFwd8x8_JPEG_16s_C1I(block,qtbl)
spilted functions
when i print on the screen,...
==================================
40965461655440962731163812601057
54615461468132772521113010921170
4681468140962731163811309361170
468136412979218512607458191057
3641297917251170964596630840
2731182011701024799630575712
13111024840745630537546643
910712683669585655630655
==================================
i don't understand the data.
how can i program the quantization code ?
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
629 Views
Hi,
could you please provide more details? Which platform do you use IPP on? Is it IA32? What was your expectation for output data? Which source data do you use?
Did you look on IPP JPEG samples?
Regards,
Vladimir
0 Kudos
networkcare
Beginner
629 Views
thanks for your pleasure.
os : windows xp, windows 2000
ipp version : 4.0.005
file : w_ipp-JPEGView_p_4.0.005.zip
1. extract the file,
2. edit the build.bat file
3. open an image file
4. save as jpeg file, you can see 4 result txt file
and You can see the code (write the quantization table).
how can i program the quantization function using the quantiation table(quantization table pointer qtblin the source).
w_ipp-JPEGView_p_4.0.005ipp_sampleJPEGViewjpegcodecencoder.cpp
line number : 2295 --> quantization table zigzag ordered
line number : 2287 --> quantization function.
it willl create 4 files(enc_block.txt, enc_qtbl.txt, enc_quantizedBlock.txt, enc_raw.txt), enc_qtbl.txt and enc_raw.txt are quantization table file. enc_qtbl is maybe zigzag ordered, enc_raw is not zigzag ordered.
if i use the enc_raw( " m_qtbl[m_comp->m_q_selector]->m_raw[bi] " in the source), i must implement the zigzag scan code.
if i use the enc_qtbl( " qtbl pointer " ), i program simply the quantization code.
but i don't understand the qtbl.
ex)
int index[64] = {
0, 1, 5, 6, 14, 15, 27, 28,
2, 4, 7, 13, 16, 26, 29, 42,
3, 8, 12, 17, 25, 30, 41, 43,
9, 11, 18, 24, 31, 40, 44, 53,
10, 19, 23, 32, 39, 45, 52, 54,
20, 22, 33, 38, 46, 51, 55, 60,
21, 34, 37, 47, 50, 56, 59, 61,
35, 36, 48, 49, 57, 58, 62, 63
};


for ( int i = 0 ; i < 64; i++ )
{
customQuantize(blk+i , raw+index);
}
void customQuantize( Ipp16s* blk, const Ipp8u* raw)
{
*blk = *blk / *raw;
};
0 Kudos
Vladimir_Dudnik
Employee
629 Views
Hi,
ok, I see your point. We use pre-multiplication when build quant table from raw quant table elements to avoid integer dividing at quantization stage because it isrelatevly slow operation. So,pre-multiplication is done inippiQuantFwdTableInit_JPEG_8u16u() function and inippiQuantFwd8x8_JPEG_16s_C1I() function we use multiplication and scalinginstead of dividing.
BTW, I see you use IPP v4.0 sample but we already have IPP v4.1.
Regards,
Vladimir
0 Kudos
Reply