Home > News > An asynchronous, vector optimized JPEG encoder

An asynchronous, vector optimized JPEG encoder

Thibault Imbert’s post earlier today showed how the use of the new Vector class in Flash Player 10 could significantly speed up the AS3CoreLib JPEGEncoder class. Coincidentally I’m working on a project right now that uses JPEGEncoder to save an image of a web page so naturally I switched the old array version out for the vector version. The images captured are typically around 1000×2880 so I need to be able to prevent any locking up of the flash player and provide progress for the encoding. That being said, I’ve put together a mash-up of the original asynchronous JPEGEncoder class with the new Vector based one.

As with the previous version the actual speed of the asynchronous encoder is dependent on the number of pixels you can crunch per iteration. The higher you set it the faster it will be, but if you set it too high you’ll run into latency issues much like you do with the standard encoder and larger images.

If anyone cares to test the effect the asynchronous addition has on the speed of the vector encoder I’d love to hear the results – but I don’t have time at the moment :)

JPEGAsyncVectorEncoder

(You’ll find a new class under “util” which includes the Vector optimizations)

ian News

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.