private bool emit_restart_s(savable_state state, int restart_num)
{
if (!flush_bits_s(state))
return false;
if (!emit_byte_s(0xFF))
return false;
if (!emit_byte_s((int)(JPEG_MARKER.RST0 + restart_num)))
return false;
/* Re-initialize DC predictions to 0 */
for (int ci = 0; ci < m_cinfo.m_comps_in_scan; ci++)
state.last_dc_val[ci] = 0;
/* The restart counter is not updated until we successfully write the MCU. */
return true;
}