-Nick
More about JPEG file format
You would store the image uncompressed in a surface. Therefore, figuring out how much memory must be used is easy -- 640 * 480 * 2 (2 bytes = 16 bits) = 614400 bytes of memory.
doesn't it take more processing power to load compressed images as opposed to uncompressed images?
It would probably take less to load them, because you are not reading in as much data, but then you'd have to decompress the image, which is likely going to be more processor intensive than just loading an uncompressed image.
August 25, 1999 12:05 PM
It depends on the method used to decompress. Most of the decent compression algorithms are pretty CPU-intensive, so you end up losing any time gained by reading less data from disk.
How much memory would a 640x480x16b jpg file take up if it is loaded into a DDraw Surface?
Assuming the file size is 100k, but I don't think the file size has anything to do with this question.
Assuming the file size is 100k, but I don't think the file size has anything to do with this question.
Hmmm - Possibly. The slowest process in any computer is I/O - so reading to and from disk will be the slowest operation (about 1000 times slower than memory reading if I can remember) So this is the major overhead. Except thatthis will probably only be an initial overhead as the OS (or your code) should read a large chunk of file into memory so unless you are reading n seperate files (open, read, close) rather than merge them you will have the data cached into memory anyway.
In general I would guess RLE is better - faster load on average from disk, smaller to download/upload/distribute and the processing power needed to decode is very minimal
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement