private bool encode_mcu_DC_refine(JBLOCK[][] MCU_data)
{
/* Emit restart marker if needed */
if (m_cinfo.m_restart_interval != 0)
{
if (m_restarts_to_go == 0)
emit_restart_e(m_next_restart_num);
}
/* Encode the MCU data blocks */
for (int blkn = 0; blkn < m_cinfo.m_blocks_in_MCU; blkn++)
{
/* We simply emit the Al'th bit of the DC coefficient value. */
int temp = MCU_data[blkn][0][0];
emit_bits_e(temp >> m_cinfo.m_Al, 1);
}
/* Update restart-interval state too */
if (m_cinfo.m_restart_interval != 0)
{
if (m_restarts_to_go == 0)
{
m_restarts_to_go = m_cinfo.m_restart_interval;
m_next_restart_num++;
m_next_restart_num &= 7;
}
m_restarts_to_go--;
}
return true;
}