Optimized for performance.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guillermo Rodriguez Garcia
1999-12-08 11:59:43 +00:00
parent 842d6c94bd
commit 8708a10fa6

View File

@@ -282,10 +282,14 @@ int wxGIFDecoder::getcode(int bits, int ab_fin)
code = ab_fin;
break;
}
/* prefetch data */
m_f->Read((void *) m_buffer, m_restbyte);
m_bufp = m_buffer;
}
/* read next byte and isolate the bits we need */
m_lastbyte = (unsigned char)m_f->GetC();
m_lastbyte = (unsigned char) (*m_bufp++);
mask = (1 << (bits - m_restbits)) - 1;
code = code + ((m_lastbyte & mask) << m_restbits);
m_restbyte--;
@@ -335,7 +339,7 @@ int wxGIFDecoder::dgif(IMAGEN *img, int interl, int bits)
pass = 1;
pos = x = y = 0;
/* reset static globals */
/* reset decoder vars */
m_restbits = 0;
m_restbyte = 0;
m_lastbyte = 0;