In imageioJPEG.c, we read one scanline at a time, then copy the decoded data into a temporary buffer before stuffing it into the destination raster. That intermediate copy step is currently not as efficient as possible since it copies one byte at a time, but in the common case (where jpeg_read_scanlines() produces 3ByteRgb data) the component data is already ordered, so we could simply use memcpy() instead.
|