private void transdecode_master_selection()
{
/* This is effectively a buffered-image operation. */
m_buffered_image = true;
/* Compute output image dimensions and related values. */
m_inputctl.jpeg_core_output_dimensions();
if (arith_code)
m_entropy = new arith_entropy_decoder(this);
else
m_entropy = new huff_entropy_decoder(this);
/* Always get a full-image coefficient buffer. */
m_coef = new jpeg_d_coef_controller(this, true);
/* Initialize input side of decompressor to consume first scan. */
m_inputctl.start_input_pass();
/* Initialize progress monitoring. */
if (m_progress != null)
{
int nscans = 1;
/* Estimate number of scans to set pass_limit. */
if (m_progressive_mode)
{
/* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
nscans = 2 + 3 * m_num_components;
}
else if (m_inputctl.HasMultipleScans())
{
/* For a nonprogressive multiscan file, estimate 1 scan per component. */
nscans = m_num_components;
}
m_progress.Pass_counter = 0;
m_progress.Pass_limit = m_total_iMCU_rows * nscans;
m_progress.Completed_passes = 0;
m_progress.Total_passes = 1;
}
}