Progressive JPEG Decoder Memory Optimization
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Decoding progressive JPEG images is a memory-intensive process, often exceeding the memory capacity of client devices, leading to some images being unable to be opened due to memory constraints.
Innovation Solution
A method that decodes progressive JPEG images by sequentially accessing and decompressing 50% of the rows of each scan into a DCT memory buffer, with the remaining rows stored in smaller memory buffers, iteratively freeing up space to minimize memory requirements, allowing for decoding with minimal additional memory beyond the decoded image size.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Quantity of substance
If progressive JPEG images are decoded using traditional methods, then image quality is maintained, but memory usage increases excessively (e.g., 337 MB for a 1.36 MB image)
Solution Approach 1:
The patent divides the JPEG image into multiple scans, where each scan contains multiple rows of compressed data. The decoder processes these scans sequentially, decoding only the necessary portion (50% of rows) at a time rather than loading the entire image into memory. This segmentation allows the system to maintain image quality while significantly reducing peak memory requirements from 337 MB to 113 MB.
Solution Approach 2:
The patent implements a two-pass decoding process where the first pass decodes 50% of the rows in each scan to create a preliminary decoded image. This preliminary action allows the system to display or process the image partially while using minimal memory. The second pass then decodes the remaining rows and merges them with the preliminary decoded data, achieving complete image decoding without requiring full memory capacity simultaneously.
2Quantity of substance
If all rows of each scan are decoded simultaneously, then decoding completeness is achieved, but memory requirements exceed device capacity
Solution Approach 1:
Instead of decoding all rows of each scan simultaneously (excessive action), the patent decodes only 50% of the rows in each scan during the first pass (partial action). This partial decoding is sufficient to create a viewable preliminary image and maintains decoding productivity. The remaining rows are decoded in a second pass, achieving complete decoding without the memory burden of processing everything at once.
3Ease of operation
If progressive JPEG decoding is implemented, then image can be viewed before complete reception, but memory intensity increases
Solution Approach 1:
The patent implements a dynamic decoding strategy where the memory buffer size is adjusted based on the decoding progress. During the first pass, only 50% of rows are decoded, requiring a smaller memory buffer. As decoding progresses to the second pass, the buffer dynamically expands to accommodate the remaining rows. This dynamic approach enables progressive image viewing while minimizing peak memory consumption from 337 MB to 113 MB.
Data Source
AI summary
A computer implemented method and apparatus for a memory efficient approach for decoding progressive JPEG images. The method comprises (a) accessing a progressive JPEG image, wherein the progressive JPEG image comprises a plurality of compressed scans and wherein each scan in the plurality of scans comprises a plurality of compressed rows of image data; (b) decompressing not more than half of the compressed rows of each scan in the plurality of scans into a memory buffer; (c) copying a remaining plurality of compressed rows of each scan in the plurality of scans into a plurality of small memory buffers; (d) decoding, in place, the decompressed rows in the memory buffer; and (e) repeating steps (b)-(d) until a predefined number of rows are remaining in the plurality of small memory buffers, at which time the remaining rows are decompressed and decoded.


