I don't know what I'm doing wrong:
I call:
ippiDecodeHuffman8x8_JPEG_1u16s_C1( m_inptr, len, &pos, block, &comp->dc_pred, &pMarker, huff_dc, huff_ac, m_huff_state );
It decodes image correctly up to first RST marker. It correctly returns pMarker = 0xd0 and ippStsNoErr. Now I call:
if ( m_restart_interval && n_left_to_restart == 0 )
{
m_comp[0].dc_pred = 0;
m_comp[1].dc_pred = 0;
m_comp[2].dc_pred = 0;
ippiDecodeHuffmanStateInit_JPEG_8u( m_huff_state );
n_left_to_restart = m_restart_interval;
}
But all next calls to ippiDecodeHuffman8x8_JPEG_1u16s_C1 return ippStsJPEGOutOfBufErr. JPEGs with no RST markers are decoded correctly. I'm using IPP4.1.
Am I missing something ?
Please help,
Kamil
I call:
ippiDecodeHuffman8x8_JPEG_1u16s_C1( m_inptr, len, &pos, block, &comp->dc_pred, &pMarker, huff_dc, huff_ac, m_huff_state );
It decodes image correctly up to first RST marker. It correctly returns pMarker = 0xd0 and ippStsNoErr. Now I call:
if ( m_restart_interval && n_left_to_restart == 0 )
{
m_comp[0].dc_pred = 0;
m_comp[1].dc_pred = 0;
m_comp[2].dc_pred = 0;
ippiDecodeHuffmanStateInit_JPEG_8u( m_huff_state );
n_left_to_restart = m_restart_interval;
}
But all next calls to ippiDecodeHuffman8x8_JPEG_1u16s_C1 return ippStsJPEGOutOfBufErr. JPEGs with no RST markers are decoded correctly. I'm using IPP4.1.
Am I missing something ?
Please help,
Kamil
链接已复制
2 回复数
Hi Kamil,
I can guess that you did not clear variable pointed by pMarker before decoding next restart interval. Note, that is input/output parameter for function ippiDecodeHuffman8x8.
You can refer to IPP JPEGView sample for details how to implement JPEG codec with IPP functions.
Regards,
Vladimir
