From 97f8ec4b601d80a5e1e3fb57d8393f44f47d0a11 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 20 Mar 2010 22:38:53 +0000 Subject: [PATCH] I'm not sure why, but this was necessary in order to return the 32-bit performance to the 0.0.90 baseline git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@165 632fc199-4ca6-4c93-a231-07263d6284db --- jdhuff.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jdhuff.c b/jdhuff.c index 05511799..9710142b 100644 --- a/jdhuff.c +++ b/jdhuff.c @@ -765,21 +765,25 @@ METHODDEF(boolean) decode_mcu (j_decompress_ptr cinfo, JBLOCKROW *MCU_data) { huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy; + int usefast = 1; /* Process restart marker if needed; may have to suspend */ if (cinfo->restart_interval) { if (entropy->restarts_to_go == 0) if (! process_restart(cinfo)) return FALSE; + usefast = 0; } + if (cinfo->src->bytes_in_buffer < BUFSIZE * cinfo->blocks_in_MCU) + usefast = 0; + /* If we've run out of data, just leave the MCU set to zeroes. * This way, we return uniform gray for the remainder of the segment. */ if (! entropy->pub.insufficient_data) { - if (cinfo->src->bytes_in_buffer >= BUFSIZE * cinfo->blocks_in_MCU - && !cinfo->restart_interval) { + if (usefast) { if (!decode_mcu_fast(cinfo, MCU_data)) return FALSE; } else {