Re: image stream processing
Saturday, February 26, 2005 08:49 AM
I don't think you can do good compression just reading a stream and writing out a stream? because good compression involves going back and forth in the source file, to find common things to compress....
I don't know the details of JPEG file format, but usually in compressed formats there is e.g. some kind of dictionary, probably at the beginning of the file, and you may need to add things to the dictionary, dynamically, as you run across them, even later towards the end of the source file. So you have to go back to the dictionary and rewrite it, at the beginning of the output file, multiple times as you read through the input.