From cca53c920d8085c58e9f985af655e93af6b239a1 Mon Sep 17 00:00:00 2001 From: Arjun Sreedharan Date: Fri, 25 Jul 2014 17:33:35 +0530 Subject: [PATCH] more logical flow of control if trellis_quant enabled if trellis_quant is enabled, increment total number of passes by optimization beginning pass number. Signed-off-by: Arjun Sreedharan --- jcmaster.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/jcmaster.c b/jcmaster.c index 6dd64dce..724e146b 100644 --- a/jcmaster.c +++ b/jcmaster.c @@ -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; @@ -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; }