home .. forth .. colorforth mail list archive ..

[colorforth] jpeg decoder


Hello,
  I have updated my jpeg decoder [1]. It now handles multiple huffman
tables per dht marker, multiple quanization tables per dqt marker, and
restart markers. What might be considered proper handling of restart
markers is not implemented currently. I just skip over them. Progressive
images are not implemented, however I have encounered these on the
web. Eventually they should be implemented.

  In this release I also spent a little time on optimization. I achieved
an 18% speed improvement overall. Simple optimizations I did was to
replace scaled multiplication by multiplication and shifting where
possible. Power of 2 arithemetic was replaced by shifts. I simplified
color conversion which produced an improvement as well. I find the
colorForth environment ideal for optimization. The instant compile allows
you to try many variations and see immediately the results.

  I've also copied the object code, and run it through a disassembler. One
pattern I saw frequently in the code was the following:

  lea esi,[esi+0x4]
  lea esi,[esi-0x4]

  These instructions cancel each other and can be eliminated. I didn't
implement this optimization, so I don't know what kind of improvement can
be achieved.

  Further improvement of the code I believe requires the context of
application. Perahps a web browser and it's heavy use of images would be
the ideal test.

Mark

[1] http://www.oakland.edu/~maslicke/colorforth/jpeg/

------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com