JPEG2000: An Introduction Part II
MQ Arithmetic Coding
Basic Arithmetic Coding MPS: more probable symbol with probability P e LPS: less probable symbol with probability Q e If M is encoded, current interval is the P e part, else, it is the Q e part (bottom). The length is kept in variable A. Code string C points to the base of the current interval. 1.0 P e Q e M M L M 0.0
Encoding of the Sequence MMLM if MPS is encoded C C+Qe A A-Qe else(lps is encoded) A Qe end if A < 0.75 Renormalize A and C; Update Qe; Context: A(the current interval) Qe Qe Qe M M L M Qe C(the pointer of code string) 0 A(0) Interval A is kept between 0.75 and 1.5. Binary 0x8000 is used to represent 0.75 to make comparison easy. Each time A is doubled, so does C. The higher order byte of C register is overflowed to an external buffer (compressed code stream).
Decoding of the sequence MMLM If C>=Qe( MPS is decoded) C <- C-Qe A <- A-Qe else(lps is decoded) A <- Qe end if A<0.75 Renormalize A and C; A(the current interval) Qe Qe Qe Update Qe; Qe 0 Context: M M L M C(the pointer of code string) A(0)
JPEG2000 Arithmetic Codec Uncompressed data compressed data Context model Context (CX) Decision (D) Probability estimator MPS Qe Arithmetic encoder Arithmetic decoder MPS Qe Probability estimator Context (CX) Context model Decision (D) compressed data Uncompressed data
Two Tiered Coding All the complexity is concentrated in the lowlevel block coding engine, T1, which generates embedded block bitstreams. The second tier, T2, plays a vital role in efficiently representing the individually coded blocks in a full-featured bit-stream. ISO/IEC JTC 1/SC 29/WG 1 N1422
Illustration of Layered Coding Illustration of block contributions to bit-stream layers. Only five layers are shown with seven code blocks, for simplicity. Notice that not all code blocks need contribute to every layer and that the number of bytes contributed by blocks to any given layer is generally highly variable. Notice also that the block coding operation proceeds vertically through each code block independently, whereas the layered bit-stream organization is horizontal, distributing the embedded bit-streams for each block throughout the bit-stream.
Embedded Block Bit Stream P i p,k : k-th pass of i-th block, p-th bit plane (1 p M i -1) Scanning order: for i = 1, 2, for p = 1, 2, M i -1 for k = 1, 2, 3 Three passes process: Significant Propagation Pass (P i p,1 ) Magnitude Refinement Pass (P i p,2 ) Clean up Pass (P i p,3 )
Second Tier Coding Scenario Rate-Distortion Optimization Considered as an extension in the standard (Part 2) Optimization is done in the first tier along with arithmetic coding Post processing is to find the correct Rate-Distortion Slope Threshold to form the final bit stream.
Layers Bit-stream is a succession of layers. Layer contains the contributions from each code block. The block truncation associated with each layer are optimal in rate-distortion sense. Single layer can achieve progressive in resolution Multiple layers can achieve progressive in SNR
Scalability in resolution Scalability in resolution means that the image code is a continuous code stream which gives the possibility to decode only part of it and get a certain level of resolution ; if you continue decoding the code stream, you get more resolution and you can display or create in printing a larger image. The same image file is therefore usable for different application types.
Multi-layer resolution progressive bitstream organisation = 0,1,2,...,L
Scalability in quality Quality may be a matter of resolution, but it may also be a matter of quantification of the values of the pixel depth. A file scalable in quality can be decoded progressively to the best quality, including totally lossless result if such encoded.
Multi-layer SNR progressive bit-stream organisation 1 λ Λ
Region of Interests Coding An ROI is a part of an image that is coded at a higher quality than the rest of the image (the background). The coding is also done in such a way that the information associated with the ROI precedes the information associated with the background. The method used is the Maxshift method. ROI allows certain parts of the image to be coded in better quality
Encoding 1. Generate ROI mask, M(x,y). MaxShift Method M(x,y) = 1, wavelet coefficient (x,y) is needed for ROI M(x,y) = 0, wavelet coefficient (x,y) belong to background pixels and can be sacrificed w/o affecting ROI. 2. Find the scaling value, s and scale up all ROI wavelet coefficients by s bits so that ROI coefficients > 2 s > background coefficient 3. Write the scaling value, s, into code stream using the RGN marker Decoding 1. Get s from RGN marker 2. Scale background wavelet coefficients by 2 s
ROI Mask Computation Must track wavelet coefficients that will contribute to ROI region pixels. C. Christopoulos, A. Skodras, T. Ebrahimi, JPEG2000 (online tutorial)
Scale Operation C. Christopoulos, A. Skodras, T. Ebrahimi, JPEG2000 (online tutorial)
Advantages of Maxshift method Support for arbitrary shaped ROI s with minimal complexity No need to send shape information No need for shape encoder and decoder No need for ROI mask at decoder side Decoder as simple as non-roi capable decoder Can decide in which sub band the ROI will begin therefore it can give similar results to the general scaling method
Entropy coding level Code-blocks Error Resilience Termination of arithmetic coding and reset of context Selective arithmetic coding bypass Packet level Short packet format (packet header is moved to either the main header to the tile header) Resynchronization markers
Visual Frequency Weighting Allows system designers to take advantage of visual perception Utilize knowledge of the visual system s varying sensitivity to spatial frequencies as measured in the contrast sensitivity function (CSF) CSF is determined by the visual frequency of the transform coefficients; One CSF weight per sub-band Design of CSF weights is an encoder issue; depends on viewing condition of decoded image Fixed visualweighting (FVW) vs. Progressive visual coding (PVC): FVW: CSF are chosen according to the final viewing condition PVC: Visual weights are changed during the embedded process
Visual Masking Nonlinearity: ϕ I : neighborhood size a = (10000/2^bit_depth-1 ) β : quantized neighboring coefficients
JP2 file format.jp2 file extension is reserved for JPEG2000 coded images that satisfy part I (normative) requirement. specifies a binary container for both image and metadata specifies a mechanism to indicate image properties, such as the tone scale or color space of the image specifies a mechanism by which readers may recognize the existence of intellectual property rights information in the file specifies a mechanism by which metadata (including vendor specific information) can be included in files
Conclusion JPEG2000 is an emerging image coding standard for the next generation of digital imaging. No IPR (intellectual property right) on part I of the standard (free licensing) More complex than JPEG but designed with hardware implementation in mind. Many companies are working to incorporate JP2 into the next generation of digital camera and scanners.