The IJG (the Independent JPEG Group) JPEG decoder offers, besides JPEG decoding, basic scaling (factors n*2) and an option to implement different memory management backends.
http://www.ijg.org/