Patent ID: 8898337

Claim:
A method for recompressing previously compressed data, comprising: separating, by a processor, a Joint Photographic Experts Group (JPEG) data stream into a plurality of data blocks including a JPEG header, the plurality of data blocks including an order and following the JPEG header; deriving compression scheme information and block-image synchronization information from the JPEG header; accessing the plurality of data blocks; storing the derived compression scheme information and block-image synchronization information in each of the plurality of data blocks; recompressing the plurality of data blocks utilizing compression scheme information and block-image synchronization information, wherein: each subsequent input data block includes the compression scheme information and the block-image synchronization information from a previous input block, and access to the block-image synchronization information is initialized by the compression scheme information to generate a recompressed plurality of output data blocks; storing the recompressed plurality of output data blocks; accessing, in a random order, each stored recompressed plurality of output data blocks such that the plurality of output data blocks are not accessed in a natural sequence of the JPEG data stream; decompressing each randomly accessed recompressed plurality of output data blocks to generate a subsequent plurality of output data blocks; and arranging each decompressed data block in the subsequent plurality of output data blocks in an order to re-establish the natural sequence of the JPEG data stream, wherein the order is re-established utilizing the compression scheme information and the block-image synchronization information from each respective previous input block.