Skip to content

Commit

Permalink
Merge pull request #79 from arjun024/devel
Browse files Browse the repository at this point in the history
more logical flow of control if trellis_quant enabled
  • Loading branch information
fbossen committed Jul 25, 2014
2 parents 5901802 + cca53c9 commit 0533b31
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions jcmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,11 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
else
master->total_passes = cinfo->num_scans;

if (cinfo->trellis_quant)
master->total_passes += ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
master->pass_number_scan_opt_base = 0;
if (cinfo->trellis_quant) {
master->pass_number_scan_opt_base = ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
master->total_passes += master->pass_number_scan_opt_base;
}

if (cinfo->optimize_scans) {
int i;
Expand All @@ -943,9 +946,4 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
for (i = 0; i < cinfo->num_scans; i++)
master->scan_buffer[i] = NULL;
}

if (cinfo->trellis_quant)
master->pass_number_scan_opt_base = ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
else
master->pass_number_scan_opt_base = 0;
}

0 comments on commit 0533b31

Please sign in to comment.