Further improved method and apparatus for image compression
The FAST Block Coder addresses the computational complexity of JPEG2000 by dividing the encoding process into three bit streams, achieving up to 10 times faster processing and efficient transcoding, suitable for real-time high-resolution video processing and energy-efficient rendering.
Patent Information
- Application Number
- JP2024108539
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2018-05-03
- Filing Date
- 2024-07-05
- Publication Date
- 2024-10-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The JPEG2000 standard for image compression suffers from high computational complexity, which is a significant limitation for hardware implementations, especially in power-sensitive applications like video processing and mobile devices, where efficient and responsive rendering is required.
A block coding algorithm, known as FAST Block Coder with Optimized Truncation (FBCOT), divides the encoding process into three bit streams - MEL, VLC, and MagSgn - to reduce complexity while maintaining compatibility with JPEG2000 standards, allowing for lossless code conversion and efficient transcoding.
The FAST Block Coder significantly reduces computational complexity, enabling faster encoding and decoding processes, up to 10 times faster than traditional JPEG2000 methods, while retaining compression efficiency and quality scalability, suitable for real-time high-resolution video processing and energy-efficient rendering.
Smart Images

Figure 2024150498000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an improved method and apparatus for image compression, and in particular, but not exclusively, to an improved block coding apparatus and method for image compression. [Background technology]
[0002] Image compression systems are known: JPEG and JPEG2000 are common standards for image compression.
[0003] JPEG2000 offers a rich set of features that find use in many diverse fields. Some of the most important features are: Compression Efficiency Quality Scalability Resolution Scalability Area of interest accessibility Parallel Processing Optimized rate control without the need for repetitive coding Visually relevant optimization goals can be targeted Error resilience Compressed domain (i.e. very low memory) transpose and flip operations You can reorder information at the code block, region, or J2K packet level.
[0004] Most of these features are derived from the use of the EBCOT algorithm (Embedded Block Coding with Optimized Truncation), while the use of the hierarchical Discrete Wavelet Transform (DMT) also plays an important role.
[0005] In addition to these core features, the JPEG 2000 suite of standards provides good support for the following applications: Efficient and Responsive Remote Interactive Viewing of Images (Including Video and Animation) via JPIP. Efficient on-demand rendering of any region from any video source High dynamic range compression using non-linear tone curves and / or custom floating point mapping Extensive metadata annotations Efficient Compression of Hyperspectral and Volumetric Content
[0006] One significant drawback of the JPEG2000 standard is its computational complexity. It is not immediately apparent how significant a limitation this is for hardware implementations, since JPEG2000 offers many modes that can be used to target efficient hardware solutions. Also, software implementations are efficient enough that images of almost any displayable size can be rendered almost instantly on modern platforms, including mobile devices. However, for video applications and especially power-conscious applications, the compression and rendering complexity can be an issue.
[0007] Prior international patent application PCT / AU2017 / 050484 discloses an improved method and apparatus for image compression incorporating a fast block coding algorithm, the disclosure of which is incorporated herein by reference. [Prior art documents] [Patent documents]
[0008] [Patent Document 1] International patent application PCT / AU2017 / 050484 Summary of the Invention [Means for solving the problem]
[0009] According to a first aspect, the present invention provides a method for encoding blocks of subband sample values derived from a still image, a video frame, or related media, comprising three bit streams and partitioning the samples from the block into defined groups, a. a first bit stream (the MEL bit stream) encodes the significance across groups whose causally related neighbors are all non-significant (the AZC group), where samples with non-zero magnitude are identified as significant and samples with zero magnitude are identified as non-significant; b. a second bit stream (the VLC bit stream) encoding the significance of each individual sample within each group that is either a significant AZC group or a non-AZC group; c. the second bit stream (the VLC bit stream) also encodes an unsigned residual value for each significant group which, when added to a set of exponent predictors, gives an upper bound on the magnitude exponent of each significant sample in the group; d. a third bit stream (MagSgn bit stream) provides the sign bits and any additional magnitude bits necessary to represent significant sample values given the corresponding exponent bounds; e. the exponent predictor is calculated using both the exponent bounds and the additional magnitude bits associated with the preceding sample in the block, unless the preceding sample in the block is outside the block bounds; A method is provided.
[0010] According to a second aspect, the present invention provides a method for decoding blocks of subband sample values to produce a still image, a video frame, or related media, wherein such samples are arranged in defined groups and represented using three bit streams: a. a first bit stream (the MEL bit stream) is decoded to find significance across a group (the AZC group) in which all causally related neighboring groups are non-significant, and samples having a non-zero magnitude are identified as significant and samples having a magnitude of zero are identified as non-significant; b. a second bit stream (the VLC bit stream) is decoded to find the significance of individual samples within each group that are either significant AZC groups or not AZC groups; c. the decoding of said second bit stream (the VLC bit stream) is also used to find an unsigned residual value for each significant group which, when added to the set of exponential predictors, gives an upper bound on the magnitude exponent of each significant sample in the group; d. A third bit stream (MagSgn bit stream) is unpacked to discover the sign bit and any additional magnitude bits used to infer the value of each significant sample, given the corresponding exponent bound; e. the exponent predictor is calculated using both an exponent boundary associated with a previously decoded sample in the block and an additional magnitude bit, unless the previous sample in the block is outside the block boundary; A method is provided.
[0011] According to a third aspect, the present invention provides an apparatus for encoding a block of subband sample values, the apparatus comprising a processing device configured to implement the method of the first aspect of the invention.
[0012] In an embodiment, the apparatus may comprise a processor, a memory and an operating system implementing software processes for performing the method of the first aspect of the invention, in another embodiment the apparatus may include hardware for performing the method, or a mixture of hardware and software for performing the method.
[0013] According to a fourth aspect, the present invention provides an apparatus for decoding a block of subband samples, the apparatus comprising a processing device configured to implement the method of the second aspect of the present invention.
[0014] In an embodiment, the apparatus may comprise a processor, a memory and an operating system implementing software processes for performing the method of the second aspect of the invention, in another embodiment the apparatus may comprise hardware for performing the method or a mixture of hardware and software for performing the method.
[0015] According to a fifth aspect, the present invention provides a computer program comprising instructions for controlling a computer to perform a method according to the first aspect of the invention.
[0016] According to a sixth aspect, the present invention provides a non-volatile computer readable medium providing a computer program according to the fifth aspect of the invention.
[0017] According to a seventh aspect, the present invention provides a data signal comprising a computer program according to the fifth aspect of the present invention.
[0018] According to an eighth aspect, the present invention provides a computer program comprising instructions for controlling a computer to perform the method of the second aspect of the invention.
[0019] According to a ninth aspect, the present invention provides a non-volatile computer readable medium providing a computer program according to the eighth aspect of the invention.
[0020] According to a tenth aspect, the present invention provides a data signal comprising a computer program according to the eighth aspect of the present invention.
[0021] Features and advantages of the present invention will become apparent from the following detailed description of embodiments of the invention, given by way of example only and referring to the accompanying drawings, in which: [Brief description of the drawings]
[0022] [Figure 1] FIG. 1 illustrates a FAST coding pass showing codeword segments generated with and without the TERMINATION mode flag according to one embodiment, and an example coding pass that may be generated by an encoder and ultimately emitted into a code stream. [Diagram 2] FIG. 2 illustrates an overview of the FAST Cleanup pass and encoding process according to one embodiment. [Diagram 3] FIG. 2 illustrates an overview of the FAST Cleanup pass decryption process, according to one embodiment. [Figure 4] FIG. 13 illustrates the codeword structure of the cleanup pass of the FAST block coder with three byte streams according to one embodiment. [Diagram 5] FIG. 13 shows a line-interleaved scan order in square 2x2 groups, illustrating a code block with H=3 lines and odd width W. [Figure 6] 10A-10C are diagrams illustrating significance neighborhood information used to form the coding context for 2×2 groups found in non-initial and initial line pairs in a code block, respectively, according to one embodiment. [Figure 7] FIG. 13 illustrates the formation of an exponent predictor in a group row that is not the first, according to one embodiment. [Figure 8] This diagram illustrates the interleaving of VLC bits from a pair of groups. The bit count range is applicable to group rows that are not the first in the code block. The arrows at the bottom of the diagram reveal the decoding dependencies. [Figure 9] FIG. 13 shows the possible coding pass contributions recorded in the JPEG2000 packet header, in which the use of the FAST block coding algorithm is indicated. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0023] One embodiment of the present invention relates to a drop-in replacement for the original JPEG2000 block encoding algorithm described in Annexes C and D of IS15444-1 (JPEG2000 Part 1). Throughout this specification, the terms "J2K-1 block coder" and "J2K-1 algorithm" will be used to identify this block encoding algorithm, which is also central to other JPEG2000 standards, including IS15444-2 (JPEG2000 Part 2), IS15444-3 (Motion JPEG2000), IS15444-6 (Compound Document Compression), and IS15444-9 (JPIP). As a drop-in replacement for the JPK-1 algorithm, the block encoding algorithm described in this embodiment can be used with these other standards to dramatically increase throughput while retaining most of the existing features.
[0024] Importantly, the block coding algorithm described herein allows for completely lossless code conversion to / from code streams that have been generated using the J2K-1 algorithm.
[0025] The dramatic reduction in complexity associated with the block encoding algorithm described herein comes at the cost of a slight reduction in compression efficiency, plus the loss (or near loss) of the quality scalability features of JPEG2000.
[0026] Quality scalability is especially important for interactive viewing applications over JPIP, where quality scalability inherently translates into large savings in communication and / or increased responsiveness of the viewing application. Quality scalability can also be important in distribution systems, providing an elegant solution to the gradual degradation of image / video archives when necessary, and also allowing selective protection and / or encryption of content, all of which are important for many applications. Advantageously, however, the transcoding feature of the proposed algorithm in this embodiment means that quality scalability can be regained or temporarily abandoned at will, by selectively transcoding block bit streams associated with images, video frames, volumes, or individual regions within an image or volume, in order to manage performance and power consumption targets within the media system.
[0027] In this invention, we use the term FBCOT (FAST Block Coder with Optimized Truncation) for the proposed approach, since the "embedded" property of the original EBCOT algorithm is largely (but not completely) lost, but post-compression rate-distortion optimization can still be performed. Throughout this specification, the term FAST is used simply to refer to the block coding algorithm itself, while FBCOT refers to the combination of this algorithm with the rate control algorithm.
[0028] The rate control aspects of the FBCOT algorithm have been covered extensively elsewhere, allowing this specification to focus on a detailed description of the FAST block coder itself.
[0029] The algorithm described in this embodiment represents an evolution from the FBCOT algorithm originally proposed in response to the JPEG-XS CfP, whose target performance, especially at low bit rates, was significantly higher than other approaches. During the JPEG-XS evaluation process, it was decided that the JPEG2000 extensions for high throughput would be best managed through a separate effort known as High Throughput JPEG2000 (HTJ2K), which is expected to become Part 15 of the JPEG2000 family of standards. The motivations behind the FBCOT algorithm, and in particular its FAST block coder, exactly match those of the HTJ2K effort.
[0030] In particular, the goals of this embodiment are to: 1. The HTJ2K block encoding algorithm shall support lossless transcoding to and from the J2K-1 block bit stream. 2. The impact of the technology introduced into JPEG 2000 via HTJ2K shall be limited only to the encoding and decoding of the code block bit stream and shall not affect the code stream syntax, including the packet header syntax, other than the consequent changes required to the code stream / tile part header markers to signal the presence of the new encoding style. 3. The HTJ2K block decoder shall, on average, be at least 10 times faster than the J2K-1 block decoder implementation in the popular commercial Kakadu™ toolkit (footnote 1) over the range of conditions that are important in practical applications, including transcoded content and content directly encoded using HTJ2K. 4. The HTJ2K block encoder shall, on average, be at least 10 times faster than the J2K-1 block encoder implementation in Kakadu™ over the range of conditions that are important in practical applications. 5. The coding efficiency of the HTJ2K block coding algorithm shall, on average, be not more than 15% worse than the J2K-1 block coding algorithm over the range of conditions that are important in practical applications.
[0031] Here we describe three application areas that can benefit from the FBCOT algorithm described herein, all of which can be implemented within the framework anticipated for the HTJ2K standard.
[0032] High Resolution Video Capture Most mobile devices do not have enough CPU power to directly compress the high resolution video streams that their image sensors are capable of producing when the J2K-1 block coding algorithm is used. The FAST block coding option addresses this issue by allowing the compressed stream to be generated in real time and then later transcoded to a J2K-1 representation when quality scalability attributes are important, e.g., for efficient interactive browsing via JPIP. Although transcoding is possible between any two compression formats, the advantages of the FBCOT algorithm described herein are: a) The code conversion can be performed in the converted domain. b) Transcoding is inherently lossless, even if the compression itself is lossy. c) Code conversion can be done selectively, even on a code block basis, as needed.
[0033] Energy-efficient image / video rendering In many applications of JPEG2000, content is rendered multiple times. For example, large images are interactively viewed by resolution or region of interest such that successively rendered views typically contain many code blocks. It is rarely practical to cache fully decompressed code blocks in memory, and the availability of the FAST block encoding option means that an intelligent content cache can choose to transcode repeatedly accessed code blocks into a representation that can be decoded more quickly or with less energy consumption. An advantage of the algorithm described herein is that transcoding from a J2K-1 block bit stream to a FAST block bit stream is both computationally efficient and entirely lossless, accurately preserving all aspects of the original JPEG2000 representation.
[0034] Cloud-based video services JPEG2000 provides an excellent framework as an intermediate distribution format for video content, allowing resolutions (or even regions) of interest close to the delivery point to be efficiently extracted, after which the video content can be transcoded into one of several common streaming video formats. While this use is already feasible and may be favored over other approaches, such applications could further benefit from the availability of lightweight block coders that retain all other relevant functionality.
[0035] A brief overview of the J2K-1 block coding algorithm. The J2K-1 block coder, as described in IS15444-1, processes the subband samples in each code block through a series of coding passes. It is useful to briefly review this in order to explain the different, but still related, coding pass structure of the FAST block coding algorithm in the next section.
[0036] Let X[n] denote the samples within a code block indexed by the position n = (n1, n2), where 0 ≤ n1 < W represents the horizontal position, 0 ≤ n2 < H represents the vertical position, W is the code block width, and H is the code block height. Each coding pass belongs to a bitplane index p ≥ 0, and in relation to it, the quantized magnitude of the sample X[n] is given by the following. [Number] Here, Δ is the quantization step size that does not exist for the reversible coding procedure.
[0037] In this specification, M p When M[n] ≠ 0, the sample X[n] is said to be "significant" with respect to the bitplane p.
[0038] The finest bitplane (highest quality) corresponds to p = 0, while the coarsest quality corresponds to p = K - 1, where K is the maximum number of bitplanes of any code block belonging to a given subband determined by a subband-specific parameter recorded in the code stream header.
[0039] For each code block, the parameter M start is communicated via the associated JPEG2000 packet header, which is interpreted as the number of lost bitplanes within the representation of the code block. The J2K-1 block decoder is allowed to assume that all samples within the code block are not significant within the bitplane p ≥ K - M start The total number of bitplanes that can contain significant samples is given by the following. P = K - M start
[0040] The first J2K-1 coding pass encodes the significance information and sign (for only significant samples) of bitplane p=P-1. This coding pass is identified as the "Cleanup" pass. Importantly, any significant samples coded in this Cleanup pass must have magnitude 1.
[0041] Then for each finer bitplane, three coding passes are generated, identified as "SigProp" (significance propagation) and "MagRef" (magnitude refinement) coding passes. In total, there are then 3P-2 coding passes with the following structure: Cleanup(p=P-1): For all samples, code the significance in bitplane p + the sign of the significant samples. SigProp(p=P−2): Visit the non-significant neighboring samples in plane p of a known significant sample, encoding their significance (and sign). MagRef(p=P-2):M p Encode the least significant bit of [n], visit the samples that were already significant with respect to plane p+1. Cleanup(p=P-2): Code the significance (and sign) in bitplane p of all samples for which the significance has not yet been established. SigProp(p=P-3):… MagRef(p=P-3):… Cleanup(p=P-3):… … Cleanup(p=0):…
[0042] Note that an encoder may remove any number of the most recent coding passes from the information contained in the final codestream, and in fact may not need to generate such coding passes in the first place if the encoder can reasonably expect that such coding passes will be removed.
[0043] All coding passes of the J2K-1 block coder employ a stripe-oriented scanning pattern with four line stripes: each stripe row is visited from left to right and then moves to the next stripe, while inside each stripe row, the four samples of the stripe row are scanned from top to bottom.
[0044] The block coder utilizes arithmetic coding of all symbols in the cleanup pass, but can optionally emit raw (uncoded) bits for certain SigProp and MagRef coding passes. This mode, in which raw bits are emitted for non-cleanup passes, is identified as "arithmetic coder bypass" mode, or simply "BYPASS" mode for short, as identified by bit 0 (LSB) of the Code Block Style field in the associated COD / COC marker segment.
[0045] Overview of the FAST block coding algorithm. Coding Pass Structure The FAST block coder also employs a coding pass structure with Cleanup, SigProp and MagRef coding passes defined for each bitplane p. However, importantly, the Cleanup pass associated with each bitplane p is p M, the sample size for which [n] ≠ 0 p Fully encode [n] and the code. This information fully encompasses that associated with all preceding (greater than p) coding passes, such that there is no point in their emission into the code stream.
[0046] This means that both the first and last coding passes may be deleted (or never generated) by the encoder, as long as the first coding pass emitted is a Cleanup pass. In fact, the encoder is never required to include more than three coding passes for any given code block in the final code stream. Figure 1 shows the coding passes that may be generated by a FAST block encoder and / or emitted into the final code stream.
[0047] From the decoder's point of view, the M start The value is still the bitplane index p=KM associated with the first available coding pass for that code block. start However, since the FAST Cleanup pass can encode multiple magnitude bits for any given sample, M start can no longer be interpreted as the number of leading magnitude bits that are all zero. The encoder start However, care should be taken to ensure that the first emitted coding pass has a non-zero length for each code block.
[0048] NOTE: As confirmed, the FAST Cleanup pass always contains at least 2 bytes. It may be convenient to allow the writer of the code stream to generate packet headers that identify the first coding pass with a length of zero. This is so that these coding passes can be associated with coding passes from J2K-1 encoded code blocks that are being transcoded to use the FAST block coder. This allows the transcoded representation to be transcoded back to the original J2K-1 representation without losing the original relationship between quality tiers and code block truncation points.
[0049] The SigProp and MagRef coding passes produced by a FAST block coder are not dependent on each other; they depend only on the Cleanup pass that immediately precedes them. The SigProp and MagRef coding passes produced by a FAST block coder encode exactly the same information as the corresponding coding passes of a J2K-1 block coder, and as a result, the effective quantization associated with truncation of the representation at the end of a Cleanup, SigProp or MagRef pass is the same whether the FAST block coding algorithm or the J2K-1 algorithm is used.
[0050] All significance and associated sign information from the SigProp pass is emitted as raw binary numbers, and all precision improvement information from the MagRef pass is emitted as raw binary numbers, and these raw bit streams are only subjected to the bit stuffing procedure used by the J2K-1 algorithm to avoid the appearance of false marker codes in the range FF90h - FFFFh (footnote 2).
[0051] The MagRef path taken by the FAST block encoding algorithm is identical to that of the J2K-1 algorithm operating in BYPASS mode, except that the code bits are packed into bytes in little-endian bit order, i.e., the first code bit in a byte appears in its LSB as opposed to its MSB.
[0052] The SigProp coding pass employed by the FAST block-encoding algorithm is also very similar to that of the J2K-1 block coder operating in BYPASS mode, with two differences: 1. While the J2K-1 block coder uses big-endian bit-packing order, the code bits are still packed into bytes of the raw bit stream in little-endian bit order. 2. While the J2K-1 block coder inserts any necessary sign bits immediately following the magnitude bit of the same sample, the significance bits associated with one or more stripe columns are emitted first, followed by the associated sign bits, and then proceeding to the next set of stripe columns.
[0053] Both of these modifications have implementation advantages over the J2K-1 algorithmic approach, especially for software-based implementations. It is noted that the second modification listed above is carefully crafted to allow accelerated decoding based on a modest lookup table.
[0054] Apart from the block coding algorithm itself, the FAST block coder does not affect other JPEG2000 code stream structures or their interpretation. Regions, packets, tiles, transforms, and all other JPEG2000 elements remain unchanged. In particular, the structure of JPEG2000 packets depends on the codeword segments produced by the block coder.
[0055] A codeword segment is a byte sequence whose length is always identified via the packet header. The J2K-1 block coder can pack all coding passes into a single codeword segment (default mode), while in TERMINATION mode, each coding pass is assigned its own codeword segment, while in BYPASS mode without TERMINATION, consecutive SigProp and MagRef coding passes are assigned a single codeword segment.
[0056] The FAST Cleanup pass is always assigned its own codeword segment, so BYPASS mode is not affected, however TERMINATION mode is affected.
[0057] The CAUSAL mode flag also affects the information represented by the SigProp coding pass and is therefore supported by the FAST block coder to ensure fully lossless transcoding to and from the J2K-1 block bit stream.
[0058] The SEGMARK, ERTERM, RESET and BYPASS mode flags are ignored when found in association with a FAST block coder, but all of these flags may be retained to support truly lossless code conversion from code streams based on the J2K-1 block coder to code streams based on the FAST block coder and back again.
[0059] Cleanup pass overview Most of this specification is devoted to the description of the cleanup pass of the FAST block coder. Figures 2 and 3 provide summary block diagrams of the encoding and decoding processes, respectively.
[0060] The storage elements in these figures represent buffers that can store the samples of a code block, as well as some estimated state information. During encoding, the storage elements are populated with subband samples, after which the derived quantities (significance flags and magnitude exponents) can be immediately determined. During decoding, the storage elements are progressively populated with subband samples and derived quantities (significance flags and magnitude exponents) as decoding progresses. The storage elements do not necessarily have to correspond to every sample or derived quantity in the entire code block, but it is easiest to conceptualize things this way.
[0061] An important feature of the Cleanup pass is that its codeword segments actually consist of three byte streams growing in different directions. These separate bit streams are bit stuffed and packed into the three byte streams in a way that avoids the appearance of spurious marker codes in the range FF90h to FFFFh. Care is also taken to combine the byte streams into a single Cleanup codeword segment such that the entire codeword segment is free of spurious marker codes and does not terminate with FFh, which is a fundamental requirement for all JPEG2000 codeword segments.
[0062] This three-bit stream organization has distinct advantages over a single interleaved bit stream. In particular, the three-bit stream organization allows for important separation between the various elements of the encoding and decoding algorithms, allowing these elements to be executed in parallel or in the order that is most beneficial for the implementation platform. In a software environment, the registers and vector processing blocks can be optimized much more aggressively than would be possible without the three-bit stream organization. In a hardware implementation, the three-bit stream organization provides better concurrency and allows the actual amount of local storage to be reduced very aggressively, down to as few as two or three lines of code blocks. Essentially, the optimal ordering of the various elements of the algorithm is different for encoding and decoding, different for hardware and software deployments, and also depends on the vector processing length. A tightly interleaved bit stream cannot accommodate more than two processing orders at all, whereas the three-bit stream organization provides the flexibility necessary to create highly efficient implementations on a wide range of platforms.
[0063] The three bit streams used in the Cleanup pass are known herein as the "MEL Bit Stream" (or simply MEL Stream), the "VLC Bit Stream" (or simply VLC Stream) and the "MagSgn Bit Stream" (or simply MagSgn Stream).
[0064] Detailed description of the FAST Cleanup pass algorithm Significance value, Exponent value, Implicit-1 value and MagSgn value To understand the FAST Cleanup algorithm, we start by giving definitions of the important quantities involved. As already mentioned, a Cleanup pass is associated with a particular bitplane p, and the magnitude of a sample X[n] is understood to be:
number
number
number
[0065] It is observed that a sample is significant if and only if its exponent is nonzero. The FAST Cleanup algorithm explicitly encodes the significance information, and then all that is required is to determine for each significant sample the sign χ[n] and M p All we need to do is encode the value of [n]-1. This information is combined into the so-called "MagSgn" value.
number
[0066] Nonzero exponents are the exponential predictor κ p The residual coding process is coded via a so-called "unsigned residual" over the set [n]. The nature of this residual coding process is that the coding information can only provide bounds on the exponent. U p [n] ≧ E p [n] v p [n]U p The [n] LSBs provide, in particular, a complete description of the sign and magnitude of each significant sample. However, the boundaries are tight (i.e., U p [n]=E p [n]), E p If the decoder knows that [n]>1, then v p [n]U p We know that the most significant bit among the [n] LSBs is implicitly 1, so v p [n]U p It is sufficient to emit only [n]-1 LSBs.
[0067] To understand this, we define the "implicit-1" condition.
number
[0068] Then, the significant samples are packed into the MagSgn bit stream v p The number of LSBs from [n] is given by: m p [n]=U p [n]-i p [n]
[0069] The following subsections provide significance information and U p [n] value is encoded, and implicit-1 condition i p Give a detailed explanation of the method used to derive [n].
[0070] For convenience, and taking into account that it is usually implied by the context, we will drop the subscript p (bitplane index) from the notation developed above, while moving the 2D index n, which identifies the sample position within the code block, to the subscript position. The equivalent notation is: p [n] ≡ M n , E p [n] ≡ E n , U p [n]≡U n , κ p [n]≡κ n , i p [n]≡i n , and v p [n]≡v n .
[0071] Some noteworthy features of the encoding algorithm can now be summarized in advance below: These features can be easily seen in the encoding and decoding block diagrams of Figs. 1. The subband samples in a code block are processed in 2 × 2 groups g, each of which has a 4-bit significance pattern ρ that indicates the significance of each sample in the group. g will be assigned. 2. The significance patterns are coded using a combination of two different techniques: an adaptive MELCODE and a set of non-adaptive VLC codes. 3. Exponential boundary U n is the "unsigned prediction residual" u, which is common to all samples in the 2 × 2 group. g and so that for every position n in group g, U n=f pred (κ n ,u g ) and f pred () is almost always κ n +u g It is a fixed function that returns 4. Predictor κ n is derived from the magnitude exponent of a particular previously coded sample, which itself depends on the MagSgn value of the preceding sample in the code block. 5. Significance pattern of a group ρ g and the unsigned prediction residual u g One of them (CxtVLC code) is adjacent significance context c g Depending on the VLC coding scheme, the two sub-codes are coded together using the VLC coding scheme with two sub-codes, one best suited for a table lookup approach and the other (the U-VLC code) for straightforward computation when needed. The VLC code bits in the 6.2 x 2 group pairs are interleaved to facilitate co-encoding or decoding eight samples at a time, while still allowing four sample groups to be individually encoded or decoded if desired.
[0072] Bit stuffing and packing of byte streams As mentioned, for compatibility with the JPEG2000 code stream structure, the cleanup pass of the FAST block coder generates a single codeword segment whose length is communicated in the associated packet header using existing methods. However, in the FAST block coder, this codeword segment is split into three byte streams, which are derived by bit stuffing and packing bits from the following three bit streams: A. A MagSgn bit stream whose packed bytes grow forward from the beginning of a codeword segment, B. A VLC bitstream whose packed bytes grow backwards from the end of a codeword segment, and C. A MEL bit stream whose packed bytes grow forward from the end of the MagSgn byte stream.
[0073] In this document, the terms bit stream and byte stream are used carefully. Each bit stream consists of a sequence of bits generated by a coding algorithm, while the corresponding byte stream consists of bytes into which those bits are packed, subjected to a bit stuffing algorithm that serves to avoid the appearance of false marker codes in the final codeword segments. The structure of the forward and backward growing byte streams is shown in Figure 4.
[0074] Bit-pack Order and Bit Stuffing Bits from the MagSgn bit stream are packed into bytes of the MagSgn bit stream in little endian order, so that the first bit from the MagSgn bit stream appears in the LSB (bit 0) of the first byte from the MagSgn byte stream. When a byte is full, if the value of the byte is FFh, the MSB (bit 7) of the next byte becomes a stuffing bit with value 0, so that the byte has only 7 bits available and cannot exceed a value of 7Fh. This means that no pair of consecutive bytes can form a 16-bit big endian unsigned integer in the range FF80h - FFFFh, and at most 1 stuffing bit is introduced for every 15 bits packed from the MagSgn bit stream.
[0075] The decoder SHOULD extend the MagSgn byte stream by a FFh byte before unpacking the bits and removing the stuffing bits.
[0076] NOTE: Encoders can, and typically should, discard any terminating FFh that would otherwise be emitted into the MagSgn byte stream.
[0077] Bits from the MEL bit stream are packed into bytes of the MEL byte stream in big endian order, so that the first bit from the MEL bit stream is found in the MSB (bit 7) of the first byte from the MEL byte stream. Once a byte is filled, if the value of the byte is FFh, the MSB (bit 7) of the next byte becomes a stuffing bit with value 0, and the next MEL bit is packed into bit 6 of that byte. Again, this means that no pair of consecutive bytes from the MEL byte stream can form a 16-bit big endian unsigned integer with a value in the range FF80h - FFFFh, and at most 1 stuffing bit is introduced for every 15 bits packed from the MEL bit stream.
[0078] Although the bits from the VLC bit stream are packed into the bytes of the VLC byte stream in little-endian order, the bytes themselves are worked backwards from the end of the codeword segment. The fact that the bytes are emitted and consumed in reverse order means that a different bit-stuffing procedure is required. In particular, cur Let B denote the current byte into which bits are being packed during encoding, or the current byte into which bits are being unpacked during decoding, and prev Let B denote the preceding bytes being emitted during encoding or consumed during decoding. prev >8Fh, B cur If the seven LSBs of are all 1, then B cur The MSB of is a stuffing bit that should be 0. cur In fact, B is written in the FAST Cleanup codeword segment. prevNote that this bit stuffing procedure ensures that no pair of consecutive bytes from the VLC byte stream can form a 16-bit big endian unsigned integer with a value in the range FF90h..FFFFh, which is the range of marker codes that must not appear in JPEG 2000 code streams outside of any marker segment.
[0079] Communication of suffix length S via the Interface Locator Word The length L of a codeword segment for a FAST Cleanup pass is always communicated in the associated JPEG2000 packet header. The portion of this codeword segment that contains the MEL and VLC byte streams is identified as a codeword suffix consisting of S bytes. The value of S is encoded within 12 bits reserved for the Interface Locator Word (ILW), since LS identifies the interface between the MagSgn byte stream portion and the MEL byte stream portion growing forward in the codeword segment.
[0080] The 12 ILW bits correspond to the 8 bits of the last byte in the codeword segment along with the 4 LSBs of the penultimate byte in the codeword segment, and all FAST Cleanup codeword segments should have a length L and suffix length S greater than or equal to 2. The ILW bits are assumed to be in the VLC byte stream itself. The decoder should read the ILW bits, decode the value of S, then include the modified last 2 bytes of the codeword segment in the VLC byte stream from which the VLC bits are extracted, and overwrite the ILW bits with 1, but discard the first 12 such extracted bits. The encoder should pack 12 1's into the VLC byte stream before packing the actual VLC bits, and then the byte stream has been combined into the Cleanup codeword segment, and the 12 ILW bit positions should hold 1's, which should be replaced with the encoding suffix length S. These procedures ensure that the bit stuffing and bit unstuffing procedures associated with the VLC byte stream operate independently of the suffix length itself.
[0081] The actual VLC bit unpacking from the VLC byte stream is done by splitting the bytes (B cur ) with the four LSBs set to 1, and B prev Note that the bit can be FFh, starting from bit 4 of the penultimate byte in the codeword segment.
[0082] The suffix length S is encoded within the 12 ILW bits as follows: S=B L-1 +(B L-2 &0Fh)×255 In the formula, B L-1 is the last byte in the codeword segment, and B L-2 is the penultimate byte, (B L-2 &0Fh) is B L-2 In this representation, B L-1 shall not be equal to FFh.
[0083] Variation 1: The suffix length is the boundary
number
[0084] Termination Procedure The boundary between the forward growing MEL byte stream and the backward growing VLC byte stream is not explicitly signaled. A decoder should consider all S suffix bytes of a FAST Cleanup codeword segment as belonging to both the MEL byte stream and the VLC byte stream when unpacking bits. This means that some bits from the suffix may be unpacked into both bit streams.
[0085] NOTE: The replacement of ILW bits as described above should be done before any MEL or VLC bits are unpacked from the codeword suffix.
[0086] An encoder is free to employ any termination procedure that results in overlaps between the MEL and VLC byte streams, as long as this results in correct decoding. In fact, it is meaningful and relatively simple for an encoder to search for single-byte overlaps between these streams.
[0087] The individual bit stuffing procedures associated with the three byte streams do not guarantee the avoidance of false marker codes at the interface between the byte streams. This must be ensured during the encoder termination. A false marker code is a pair of consecutive bytes that form a 16-bit big-endian unsigned integer in the range FF90h to FFFFh. To avoid false marker codes between the MEL and VLC byte streams, it may be necessary for the encoder to insert an additional byte (e.g. a 00h byte).
[0088] As already mentioned above, because the decoder always synthesizes one final FFh, the encoder should generally eliminate any terminal FFh bytes that would be emitted into the MagSgn byte stream. This approach aids in efficiency and avoids any possibility of false marker codes at the interface between the prefix and suffix of a FAST Cleanup codeword segment.
[0089] Scanning order and 2x2 group structure The samples from a code block of height W and width H are organized into 2x2 groups and processed in the line interleaved fashion seen in Figure 5. Note that to ensure that every 2x2 group contributes four samples to the scan pattern, an extra column is effectively inserted to the right of the code blocks with odd widths, and an extra row is inserted below the code blocks with odd heights. This padding is only applied in the FAST Cleanup coding pass and does not affect other coding passes. The sample values associated with the padded positions are coded but are all non-significant, i.e., M p =0.
[0090] Significance Patterns, Contexts, and AZC Groups Each group g has a binary significance state σ σ , which is 1 if any sample in the group is significant and 0 otherwise. g In addition, group g has a 4-bit significance pattern ρ g where each bit (LSB to MSB in the scan order) is 1 if the corresponding sample in the group is significant. g =0⇔ρ g =0.
[0091] Each group is assigned a coding context c that depends only on the significance information associated with the preceding group visited in the scan order. g This allows the significance to be decoded before the magnitude and sign information, which improves computational throughput, at least in software implementations of both the encoder and decoder, and also allows the SigProp and MagRef coding passes to be encoded and decoded in parallel with the Cleanup pass.
[0092] AZC Group's MEL Adaptive Coding c gGroups g for which σ = 0 are said to be in the All-Zero-Context (AZC) state. In fact, these are groups for which all causally relevant neighbors are non-significant, which explains the term AZC. Adaptive coding reduces the significance of AZC groups, σ g Specifically, the binary symbol σ associated with each AZC group in the sequence is used to encode g are concatenated and encoded in the MEL bit stream into a variable-length binary string σ AZC [i]. The encoding and decoding of this AZC symbol sequence does not need to be synchronized with any other encoding or decoding steps.
[0093] AZC symbol stream σ AZC [i] is the first run length R AZC [j], where each run represents the number of 0s that precede the next 1. Since there is at most one AZC symbol per group of four code block samples, and there cannot be a code block with more than 4096 samples, the maximum run length that needs to be coded is 1024, corresponding to a completely non-significant code block.
[0094] The MEL coding procedure is a variant of the adaptive run-length coding algorithm in the JPEG-LS standard, known as MELCODE. While the MELCODE used in the JPEG-LS standard has 32 states, a different state machine with only 13 state indices k ranging from 0 to 12 is utilized by the FAST block coder. Each state k is associated with an index E MEL [k] and threshold
number
[0095] MEL code is run length R AZC is a type of adaptive Golomb code for [j], with a threshold T MEL [k] plays the role of the Golomb parameter. Ignoring adaptation for the moment, the encoding procedure can be summarized as follows: While R >= T, emit a 1 (a "hit") and subtract T from R Emit a 0 (a "miss"), then emit the E LSBs of R
[0096] The optimal Golomb parameter for an exponentially distributed source is slightly above half its mean value. Thus, a typical run R should be encoded by one hit followed by a miss. This implies that the adaptive state machine should experience one hit and one miss for each run, which is achieved by incrementing the state after each hit and decrementing the state after each miss, as shown in Table 2. The complete MEL encoding algorithm is as follows: Initialize k=0 for each j=0,1,… R to R AZC Set to [j] while R≧T MEL [k] Emit a "1" ("hit") R to RT MEL Update to [k] Update k to min{k+1,12} Emit "0" ("Miss") R's E MEL Emit [k] LSBs Update k to max{k-1,0}
[0097] Note: Although the above algorithm is expressed in terms of run-length encoding, just as binary arithmetic encoding can be recast as a state machine operating on runs, the above algorithm can always be recast as an adaptive state machine operating on individual symbols. As an encoder of individual AZC symbols, the MEL coder cannot generate more than six code bits here, and in many cases does not generate any bits at all. Both the MQ arithmetic coder used by the J2K-1 algorithm and the MEL encoding technique exhibit roughly the same number of state transitions here, but the advantage of the MEL coder is that the state machine is much smaller. In software, it is wise to use small lookup tables to drive the encoding and decoding of the runs, where in most cases a single lookup is sufficient to encode or decode the entire run.
[0098] The bits emitted by the MEL coder constitute the MEL bit stream. If the last AZC symbol in a code block is zero, then the last run is considered to be "open", which means that the coding run value is at least the number of zeros at the end of the AZC symbol sequence, R. last This means that it can have any value that is in the order of magnitude.
[0099] NOTE: Encoders may take advantage of the flexibility of "open" runs to terminate MEL byte streams in a way that maximizes the opportunity for overlap with the growing VLC byte stream backwards.
[0100] Significance and u via CxtVLC code off encoding The non-AZC group and the significant (i.e., σ g =1) For the AZC group, we used a variable length code operating on each individual 2 × 2 group to determine the significance pattern ρ gare coded along with other information. Two types of codes are used, identified herein as CxtVLC codes and U-VLC codes. The resulting code bits are interleaved in groups, pairs, as described below, to form the VLC bit stream for the FAST block coder.
[0101] This section describes the significance pattern ρ g , and the corresponding exponent bound U n A predictor κ whose offsets are associated with samples in group g to obtain n A binary value indicating whether or not
number
number
[0102] A distinction is made between the first line pair in a code block (equivalently, the first line of a 2x2 group) for which there is no context information from the preceding lines, and all non-initial line pairs. Figure 6 shows the significance information used to form the context labels for these two cases. The corresponding context labels are computed from this information as follows: Group rows that are not the first:
number
number
[0103] Variant 2: The context labels now take values from 0 to 7 for both the first and non-first group rows. Since a separate CxtVLC code table is used for each case, it may be preferable to use a smaller set of contexts for the first row of a group, which has less impact on the overall performance of the coder, so as to reduce the footprint of the implementation. In particular, in the present invention the following may be used: First group row (alternative):
number
[0104] Note: The exact definition of these labels is only important for the correct interpretation of the CxtVLC code table. Any substitution of the context labels may be used equally well with the corresponding substitution in the CxtVLC code table.
[0105] CxtVLC codeword length of non-first group row For groups found in non-initial group rows (non-initial line pairs of a code block), the CxtVLC codewords have a maximum length of 7 bits. g each of which represents a 4-bit significance pattern ρ g and binary
number
number
number
number
[0106] Table 3 gives the codeword length for each valid combination of context and codeword. The mapping of codeword lengths to actual codewords is explained later in this section. [Table 3]
[0107] Note: The implementation may be modified to avoid conditional branching. g =0 and ρ g For invalid combinations with , it may be found useful to populate the coding table with zero-length entries.
[0108] Variation 3: The CxtVLC codeword tables provided herein can be subject to further modifications to optimize coding efficiency over a range of video types. In particular, it may be desirable to provide separate codeword tables for different subband orientations.
[0109] Variation m1: Codeword length is less than 7
number
number
number
number
number
number
[0110] This variant constitutes a variable-variable length coding scheme, where both the length of each codeword and the amount of information represented by each codeword are variable. Specifically, in this variant, each codeword in the augmented CxtVLC is
number
number
number
number
[0111] In this example, the FAST block coding algorithm is n But that φ g For each sample whose bit is 1, the implicit-1 value i n but
number
[0112] The augmented CxtVLC described above uses a 4-bit validity mask φ g , which is not valid
number
number
number
number
number
number
[0113] CxtVLC codeword length of first group row For the first row of a group, the encoding of the exponent boundaries is also different for these groups, so
number
[0114] Variant 4: It may be preferable to increase the similarity between the encoding procedure used for the first group row and the encoding procedure used for the non-first group rows, so that then
number
[0115] The actual VLC codeword c associated with each entry in Tables 3 and 4 w is obtained via the McMillan assignment procedure that results in a prefix code for each context. Let l be the length of the codeword with entry w in the above table. w where w=0 is the first valid entry of the context label, w=W-1 is the last entry, and W is the number of valid codewords in that context. The codewords are first sorted from shortest to longest using an index table idx[] as follows: for each w=0,1,…,W-1 for each i=0,1,…,w-1 IF (l w <l idx[i] ) or ((l w =l idx[i] ) and (i mod 2 ≠ 0) idx[i] Move entry i to w-1 to position i+1 to w Exit the loop without advancing i Assign idx[i]=w
[0116] The condition in this sorting procedure (i mod 2 ≠ 0) is not critical and is merely there to be consistent with the procedure used to generate the codewords utilized during the evaluation of the coding efficiency of the FAST block coder.
[0117] Once sorting is complete, each codeword is sorted according to max I bit unsigned integer w was assigned,
number
number
[0118] Finally, the actual codeword c in VLC w but written in big endian order w The top l of w It is formed from c bits. w The first bit of is I w MSB (bit l max -1), while the codeword c w The last bit of I w Bit l max -l w As already mentioned, this is the well-known McMillan allocation. The allocation is unique up to permutations of codewords with the same length, whose order is dictated by the explicit sorting procedure above.
[0119] Predictors, U-bounds and U-VLC codes for non-first group rows This section concerns exclusively the coding of magnitude exponent boundaries of group rows that are not the first. Samples belonging to the first row of a group within a code block are treated somewhat differently, as described below.
[0120] Predictor kappa n is formed for each significant sample based on the magnitude exponents from the preceding group row. Figure 7 identifies the four exponents used to form the predictor of significant samples in group g (footnote 4), with the positional subscript n replaced by the more convenient group-related labels "tl", "bl", "tr" and "br". The decoder will generally need to derive these magnitude exponents from the fully decoded sample values in the second line of the preceding group row.
[0121] The first step in forming the predictor is to estimate the exponent
number
number
number
number
number
number
number
number
number
[0122] The estimated indices are converted to predictors using κ n =max{P n ,1}-Z g In the formula, Z g is the predicted offset of the group g to which position n belongs, which is 1 if all significant samples in the group have estimated exponents greater than or equal to 2, and 0 otherwise. gis effectively u g This allows us to express prediction residuals as small as -1, which can be written formally as
number
[0123] For each significant group g, a single unsigned residual u g ∈{0,1,...,36} are both encoded via CxtVLC and U-VLC codes. In particular, the CxtVLC code is used to communicate the binary value
number
number
[0124] kappa of the group containing position n n and u g From the value, the decoder determines the exponent bound U according to n Derive:
number
[0125] where the binary significance value σ n is U for all non-significant samples. n Force to zero.
[0126] Note: Only U-VLC codes exceed 36 g In special conditions, u g = 36 is required, while κ n can be as small as 1, and the JPEG2000 family of standards provides subband samples whose magnitude exponent can be as large as 38. To address this, ug = 36 forces the significance sample to U g = 38 is treated as an "escape code" to force a maximum exponent bound of 38.
[0127] The encoder is g The value of U g ≧E g It is required to guarantee that σ takes the smallest non-negative value consistent with the requirement
number
number
number
[0128] Note: In the above description, some quantities are
number
number
number
number
[0129] u g The U-VLC code used to represent non-zero values of consists of prefix and suffix components that are designed to be interleaved on a group-pair basis. The prefix, if present, uniquely determines the length of the suffix, and is small enough to allow the prefixes of a pair of groups to be decoded together using a modest table lookup. Table 5 gives all the relevant details of this code. [Table 5]
[0130] For the first line of a group in a code block, there is no magnitude exponent available from the preceding scanline.
[0131] This case can be important in low latency applications where the code block height is usually small, so an alternative mechanism for encoding the exponent boundaries is utilized, including some form of horizontal prediction, which can be achieved without introducing additional latency.
[0132] The alternative mechanism developed in this invention again uses the predictors and the unsigned residual u g , but predictions are fitted group-wise and include baseline values B, which can be interpreted as state variables. g A single exponent bound U with the following values: g is decoded for each group g,
number
number
[0133] If group g has two or more significant samples, then γ g is equal to 1, otherwise γ g Recall that u is equal to 0. For any row group other than the first, this formulation g -2)=36 as a special escape code. g This allows the value to be as large as 38.
[0134] For a continuous set of groups with two or more significant samples, the unsigned residual u g In this case, U g =U g-1 +(u g -2), so U g For a group with only one significant sample, the above relationship can be understood as the offset difference (by 2) between successive values of B gforces to 1, resulting in U g =u g -2 does not depend on the preceding group. B g The special value of =0 is U g Although not strictly significant since it corresponds to a non-significant group whose values are not coded or used, this special value can be used to facilitate efficient implementations based on lookup tables.
[0135] As with the non-first group rows, the encoder calculates U g ≧E n While ensuring that u is consistent with the above formula g The minimum value of should be selected.
[0136] Obviously, u g Some values of should not be allowed, because g The U-VLC code employed in the first group row is reflected in the use of a modified U-VLC code for the baseline variable B g Moreover, here we are conditioned on the value of
number
[0137] The implicit-1 condition on the first row of a group is:
number
[0138] The B-dependent U-VLC (or "BU-VLC") codes used in the first row of the group are specified in Table 6. Since the prefix of a codeword never exceeds 4 bits long, the condition ρ g+1 =0 or M g+14-bit codeword prefix, suffix length (often zero), decoded U g The boundary and the updated B g Along with the value, 2 bits of B g-1 An efficient LUT-based decoding strategy can be developed that is indexed by value. [Table 6]
[0139] Variation 5: The different treatment of the first and non-first group rows as described herein imposes costs, especially for hardware implementations. In most applications, the first group row contributes relatively little to the overall coding efficiency, so it may be preferable to change the approach to be more similar to that used for all non-first group rows. One approach is to scale all estimated exponents to P n = 1, and the binary digits with significance patterns encoded via the CxtVLC code
number
[0140] Variation 6: After the above simplification, a meaningful improvement is to reduce the specific unsigned prediction residual u g Specifically, the AZC symbol stream σ AZC [i] is
number
number
number
number
number
number
number
[0141] Variant k1: In the interest of simplification and further increase in throughput, it makes sense to reduce the number of possible non-AZC symbols associated with variant 6. This variant:
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
number
[0142] Variation m2: The same approach described in variation m1 for incorporating partial msb patterns into the augmented CxtVLC table, which does not result in an increase in the codeword length, can also be used for the first row of a group. In this case, in the first group row,
number
[0143] VLC bitstream organization The VLC bitstream consists of bits from the CxtVLC and U-VLC codes interleaved by group pairs. For code blocks with an odd number of 2x2 groups per group row, each group row is padded with an additional 2x2 group that does not contain a CxtVLC codeword or an AZC symbol and is always non-significant, and therefore does not contain a U-VLC codeword. Thus, each group row is divided, from left to right, into an integer number of group pairs.
[0144] The VLC bit stream is formed by first emitting the significance CxtVLC codeword associated with (possibly from (note 5)) the group pair, then emitting any U-VLC code prefixes for each group in the pair, and finally emitting any U-VLC code suffixes for each group in the pair. All such VLC bits precede those from the next group pair in lexicographical order. This interleaving strategy, along with the associated decoding dependencies, is shown in Figure 8. The interleaving procedure is identical for the first and non-first group rows in the codebook, but the number of bits associated with each interleaving component may be different in the first group row.
[0145] One advantage of interleaving is that pairs of U-VLC prefixes can be decoded together, after which the U-VLC suffix length is known and CxtVLC decoding can begin immediately in the next group pair. A second advantage is that the encoder can generate both CxtVLC and U-VLC bits using a total of only two table lookups per group pair.
[0146] MagSgn bit stream organization and sample-value decoding The MagSgn bit stream is generated by scanning the sample in the order shown in Figure 5, n m from n is formed by concatenating the LSBs of m n =U n -i n v n =χ n +2(M n -1) And χ n is the sign bit of the sample, which is 1 if the sample is negative and 0 otherwise. n For samples where U = 0, n , i n and mn Note that,x,i,are all zero, so no non-significant samples contribute to the MagSgn bit stream.,All significant samples contribute at least one bit to the MagSgn bit stream.
[0147] v n m n The LSBs are packed into the MagSgn bit stream in little endian order, which means that v n The LSB (bit 0) of n -1).
[0148] The decoder extracts these m n Unpack the bits,
number
[0149] As long as enough AZC group significance symbols are decoded from the MEL bit stream, these inter-row dependencies can be resolved by the significance pattern ρ g and the unsigned residual u gIt is worth noting that the MEL decoding procedure does not constrain the order in which the VLC and MagSgn decoding steps are decoded from the VLC bitstream. Moreover, the MEL decoding procedure is totally independent of both the VLC and MagSgn decoding processes. In summary, VLC decoding depends only on MEL decoding, MagSgn decoding depends only on VLC and MEL decoding, while the VLC and MagSgn decoding processes each have an internal dependency on the completion of the preceding VLC and MagSgn decoding steps, respectively.
[0150] Detailed description of the FAST MagRef coding pass The FAST MagRef coding pass is identical to the precision improvement pass of the J2K-1 algorithm when BYPASS mode is used, except that the raw precision improvement bits are packed into bytes in little-endian order as opposed to big-endian order.
[0151] The FAST MagRef pass provides additional bits of precision to improve the precision of the magnitude of significant samples from the preceding FAST Cleanup pass. Let p denote the bitplane associated with that Cleanup pass. The MagRef pass may only be present if p>0. The MagRef pass returns a value for each sample position that is significant with respect to bitplane p, i.e., M p For each position where [n] ≠ 0, r p [n]=(M p-1 [n] mod 2)∈{0,1} Provides a value for
[0152] The FAST MagRef pass skips non-significant positions and subtracts r from all other positions. p It uses the same four-line stripe oriented scan pattern as the J2K-1 block coder, emitting [n] bits into the MagRef bit stream.
[0153] The bits from the MagRef bit stream are packed into bytes in little endian order, starting from the LSB of each byte. When the entire byte is assembled, if the value of that byte is FFh, a stuffing bit (0) is introduced into the MSB (bit 7) of the next byte, which can only accommodate 7 bits from the MagRef bit stream. The decoder extracts bits from the bytes progressively, starting from the LSB of each byte and working towards the MSB, which is skipped if the preceding byte in the MagRef byte stream (if any) had the value FFh.
[0154] The last byte in a FAST MagRef byte stream should not have the value FFh, which means that the encoder must emit a byte including any stuffing bits generated via the procedure described above. Unused bits in the last byte of the MagRef byte stream may take any value, as long as they do not leave the last byte equal to FFh.
[0155] Detailed description of the FAST SigProp coding pass The FAST SigProp coding pass is identical to the significance propagation pass of the J2K-1 algorithm when the BYPASS mode is used, except that the significance bit and sign bit are rearranged and packed into bytes in little-endian order as opposed to big-endian order.
[0156] The FAST SigProp pass provides improved magnitude information for samples that were coded as non-significant in a previous FAST Cleanup pass, as long as they have significant neighboring samples based on information previously coded in either the FAST Cleanup pass or the FAST SigProp pass. Let p denote the bit plane associated with the previous Cleanup pass. A SigProp pass may only be present if p>0. The SigProp pass calculates magnitude bits for each position n. rp [n]=(M p-1 [n] mod 2)∈{0,1} The result is
number
number
number
[0157] Here, N n are all the neighbors of position n present in the codebook, including all eight of its immediate neighbors, unless the CAUSAL mode flag is set in the associated COD / COC marker segment, in which case N n omits any adjacent positions found in the next 4-line stripe (i.e., those following the stripe containing position n).
number
[0158] For a full-height stripe (i.e., one with four actual code blocks in each stripe row), all member positions (i.e.,
number
number
[0159] If a code block ends with an incomplete stripe of height 3, the magnitude and sign bits are also interleaved column-wise within that stripe, but of course there are at most three member positions within each such column.
[0160] If a code block ends with an incomplete stripe of height 2, the magnitude and sign bits are interleaved by column pair within that stripe, which means that the magnitude bits from all members (4 samples) in the first pair of stripe columns are emitted into the SigProp bit stream before the signs of any newly significant members in that stripe column pair, and the same is done for each subsequent stripe column pair in the code block. Only positions that actually exist in the code block can be members.
[0161] If a code block ends with an incomplete stripe of height 1, the magnitude and sign bits are interleaved by column quad, which means that the magnitude bits from all members (4 samples in this case) in a set of 4 columns are emitted into the SigProp bit stream before the sign bits from that set of columns. Again, only positions that are actually present in the code block can be members.
[0162] Note: Interleaving based on columns and columns of magnitude and sign bits can have a great beneficial impact on software implementations, at least for both encoding and (especially) decoding. We now note the special case of stripes with height 2 and height 1, which is important for enabling high throughput in the degenerate cases where code blocks are truncated below their nominal dimensions. This can occur only at the lower boundary of an image or video frame, but can occur much more frequently, especially if images are split into tiles or short and wide region sizes are used to achieve low latency or memory utilization. The overall significance of these special cases is highly application dependent and may justify further consideration.
[0163] Variation 7: It is preferable, especially for hardware implementations, to adopt a more unified treatment of stripes with 1, 2, 3 or 4 lines. One good way to achieve this while retaining high software decoding throughput even for stripes of height 1 and 2 is to interleave the magnitude and sign bits by column quad in all stripes, regardless of height. In this case, the magnitude bits from all members in a set of 4-stripe columns are emitted into the SigProp bit stream before the signs from the newly significant samples in that set of 4-stripe columns. For a full height stripe with 4 lines, this variation results in up to 16 magnitude bits being emitted into the SigProp path, followed by up to 16 sign bits corresponding to the newly significant samples. For stripes of height 1, there is no difference between this variation of the SigProp path and the one described above.
[0164] The bits from the FAST SigProp bit stream are packed into bytes in little endian order and subjected to exactly the same bit stuffing procedure as the FAST MagRef bit stream, resulting in the SigProp byte stream.
[0165] Any FAST SigProp byte stream should start at the beginning of the codeword segment that immediately follows the FAST Cleanup codeword segment. If the TERMINATION mode flag is set in the associated COD / COC marker segment, the SigProp byte stream should occupy its own codeword segment and the last byte of that codeword segment should not be equal to FFh. In this case, the FAST MagRef byte stream (if present) should occupy the following codeword segment and should not be terminated with FFh as explained previously.
[0166] If the TERMINATION mode flag is not set, the SigProp bit stream and the MagRef bit stream (if present) are concatenated and the resulting bit stream is packed into a single byte stream using the little endian convention, resulting in a single codeword segment that again should not end with FFh.
[0167] Variation 8: To allow for simultaneous processing of the SigProp and MagRef coding passes when the TERMINATION flag is not set, a desirable modification to the current approach is to configure the MagSgn byte stream to grow backwards instead of forwards, so that the start of both the SigProp and MagRef byte streams can be immediately identified within the single codeword segment that they share.
[0168] Code Stream Syntax This section describes a small set of changes to the code stream syntax described in IS15444-1 that are required to support the introduction of the FAST block coder. Some of the rationale behind these changes deserves emphasis. 1. Across the JPEG2000 family of standards, it is possible to use the FAST block coder as a drop-in replacement for the J2K-1 block coder. 2. It is possible to transcode a code stream based on J2K-1 to one using the FAST block coder without losing any information about the quantized image samples. This property is essentially already imparted by providing FAST SigProp and MagRef coding passes that encode exactly the same information as their counterparts in the J2K-1 algorithm. 3. Even if the FAST block coder itself is not highly scalable, it is possible to transcode a J2K-1 based code stream with multiple quality layers to one that uses a FAST block coder, while also preserving all the information about the layer boundaries associated with each code block, so that it can be transcoded back to the original fine-grained embedded representation without any loss of information. 4. No changes are made to the JPEG 2000 codestream syntax or to the structure of JPEG 2000 packets, except to the extent that new signaling methods need to be introduced to identify the use of the FAST block encoding algorithm.
[0169] Carriage of FAST block byte stream in JPEG2000 packet As described in Annex B of IS15444-1, code blocks are organized into regions and each region is represented by a sequence of packets, one per quality tier. Each packet has a header that identifies the contribution made to that packet by each code block in the region, and a body that holds the associated coded bytes from the code blocks in the region. The packet header identifies the number of first missing most significant magnitude bitplanes of each contributing code block, along with the number of coding passes and the associated coded length information for each contributing code block.
[0170] Depending on the block coding mode, the coded bytes from each code block are divided into one or more codeword segments. If a code block contributes coding passes from multiple codeword segments to a packet, the packet header contains sufficient length information to identify the boundaries between the codeword segments. In particular, if the TERMINATION mode flag (bit 2 of the Code Block Style field) is set in the associated COD / COC marker segment, each coding pass occupies its own codeword segment, and so the number of lengths communicated by the packet header is identical to the number of coding passes involved. If the BYPASS mode flag (bit 0 of the Code Block Style field) is set, each bypass significance propagation must occur at the beginning of a codeword segment, and each bypass precision improvement pass must occur at the end of a codeword segment, which will be the same codeword segment started by the preceding precision improvement pass, unless the TERMINATION mode flag is set.
[0171] When the FAST block encoding algorithm is used, regardless of whether the BYPASS mode flag is set or not, the FAST Cleanup pass must occupy its own codeword segment, the FAST SigProp pass must appear at the beginning of a codeword segment, and each FAST MagRef pass must appear at the end of a codeword segment.
[0172] NOTE 1: This organization of FAST coding passes into codeword segments is consistent with that used by the J2K-1 block coder when the BYPASS mode flag is set. However, the BYPASS mode flag by itself has no meaning to the FAST block decoder.
[0173] NOTE 2: This allows the BYPASS mode flag to be preserved when transcoding from a code stream based on J2K-1 to one that uses the FAST block coder, so that the original representation can be restored later through a subsequent transcoding operation.
[0174] When the TERMINATION mode flag is set, the FAST SigProp and MagRef coding passes occupy their own codeword segments.
[0175] If the associated COD / COC marker segment identifies that FAST block coder, the coding path contribution recorded in the packet header corresponds to the structure shown in Figure 9.
[0176] In many cases, the first coding pass contribution will be a FAST Cleanup pass. However, it is possible that a FAST Cleanup pass may be preceded by a set of "empty coding passes", identified as all having zero length. These should not be interpreted as FAST coding passes by the decoder, since a FAST Cleanup pass must have at least 2 bytes. The number of empty coding passes, if present, should be 3Z, where Z is a non-negative integer. The bitplane index p associated with the first FAST Cleanup pass is given by, p=KM start -Z-1 where K is the maximum number of magnitude bitplanes associated with a subband, and M start is the number of missing MSBs as signaled in the packet header identifying the first contribution of the code block, and Z is the number of empty triplets in the coding pass identified before the first contribution with nonzero length.
[0177] NOTE 1: The reason for allowing 3Z empty coding passes to precede the first FAST Cleanup pass is to allow a J2K-1 based code stream to be transcoded to use the FAST block coder while still preserving all information related to quality layer boundaries from the original code stream. This information can be used to reconstruct the original code stream that was transcoded.
[0178] NOTE 2: The CAP marker segment is used to advise the decoder as to whether a code block can contribute to an empty coding pass before the first FAST Cleanup pass.
[0179] If Z is nonzero, the codeword segments associated with the 3Z empty coding passes are determined based on the mode flags found in the code block style field of the associated COD / COC marker segment, as if those coding passes were encoded using the J2K-1 block encoding algorithm. In particular, if the BYPASS mode flag is set, empty SigProp passes for which the arithmetic coder has been bypassed appear at the beginning of those codeword segments, and empty MagRef passes for which the arithmetic coder has been bypassed appear at the end of those codeword segments that are the same as the preceding SigProp passes, unless the TERMINATION mode flag is set.
[0180] It is not necessary for a code block to contribute any non-empty coding passes to the code stream, or indeed to any coding passes at all. More than three FAST coding passes can be contributed by a code block, in which case each successive FAST Cleanup pass has a bitplane index p that is a smaller index than the preceding one, thus encoding all of the information embodied by all preceding coding passes.
[0181] NOTE 1: Decoders are RECOMMENDED to process the last available FAST Cleanup pass of a code block, along with any subsequent FAST SigProp passes (if any) and FAST MagRef passes (if any).
[0182] NOTE 2: The CAP marker segment is used to advise the decoder as to whether a code block can contribute to more than three FAST coding passes.
[0183] Carriage of mixed block coding types within JPEG 2000 packets NOTE: It may be useful to encode some code blocks of a tile component using the FAST block encoding algorithm while other code blocks are encoded using the J2K-1 algorithm. This may be necessary in applications where code blocks are transcoded from one representation to another on demand (e.g., when needed to display or communicate a portion of a video), resulting in some code blocks being transcoded while others are not transcoded.
[0184] Mixing of block coding types is only allowed if this is signaled in the associated COD / COC marker segment, as described below. Furthermore, in this case the CAP marker segment is used to advise the decoder of the possibility of mixed coding types, as described in Section 0.
[0185] When the possibility of mixed coding types is thus indicated, the block coding type used for a code block is indirectly identified through signaling length information in the packet header. In all JPEG2000 code streams, the length associated with a code block contribution is signaled using a number of bits that depends on the "Lblock" state variable, which is specific to each code block, and is progressively adjusted during packet header parsing. If the length of the first non-empty contribution to a code block is signaled using an Lblock value that is larger than required, then the FAST block coding algorithm is being used and the structure of all code block contributions will be as shown in Figure 9. Otherwise, if Lblock is less than or equal to the required value, then the J2K-1 block coding algorithm is being used and all contained coding passes of that code block are processed according to the J2K-1 algorithm.
[0186] Signaling the FAST block coder technique via COD / COC markers Code streams that use the FAST block coder include a CAP marker segment in the main header advertising the dependency on Part 15 features. If the FAST block coder is used in a code block belonging to a given tile component, the FAST mode flag (bit 7 of the Code Block Style field) is set (equal to 1) in the associated COD or COC marker.
[0187] Table 7 summarizes the role played by the Code Block Style field in identifying the effect that the FAST block encoding algorithm has on the interpretation of all mode flags. [Table 7]
[0188] If bit 5 of the Scod or Scoc field (as appropriate) of the COD / COC marker segment is set, the COD / COC marker segment also contains a 16-bit SXcod field whose MSB (bit 15) indicates whether the code block can be encoded using the J2K-1 block encoding algorithm. This is the "mixed encoding" mode flag. If the mixed encoding flag is set, the decoder checks whether the "L block" packet parsing state variable used to encode the length of the first contribution with a non-zero length of the code block is larger than is necessary to encode that length. As explained above, if L block is larger than is necessary, the FAST block decoder is utilized to process the code block, otherwise the J2K-1 block decoder is used.
[0189] NOTE: The SXcod field is also used in IS15444-2 / AMD4, and bit 5 of the SXcod field is also used to signal its presence. In IS15444-2 / AMD4, whenever the BYPASS mode flag (bit 0) of the Code Block Style field is set, the two LSBs of the SXcod field encode the value BB, which identifies the number of additional bypassed bitplanes to be used. When BYPASS=1 and BB=01, for both the SigProp and MagRef coding passes, arithmetic coding is bypassed in all bitplanes. When the FAST block coder is used, these two LSBs of the SXcod field have no meaning to the decoder, but may be used to hold the block coder mode that was used in the original J2K-1 based JPEG2000 code stream that has been transcoded to use the FAST block coder.
[0190] If bit 7 of the Code Block Style field is set, but bit 5 of the Scod or Scoc field is not set, then the 16-bit SXcod field is not present in the COD / COC marker segment, and the code blocks of all affected tile components are encoded using only the FAST block encoding algorithm.
[0191] Part 15 Feature Flags We propose to define three bit flags for Part 15 function words within the CAP marker segment as follows: The "Empty Passes" flag indicates that the code stream may contain Z>0 empty coding passes before the FAST Cleanup pass. If this flag is not set (i.e., 0), the first packet contribution from any code block that uses the FAST block encoding algorithm is a FAST Cleanup pass. The "Multiple FAST Cleanup" flag indicates that the code stream may contain more than one FAST Cleanup pass of a code block. If this flag is not set (i.e., 0), then at most one FAST Cleanup pass is contributed by any code block to packets in that region. The "mixed encoding" flag indicates that two or more types of encoding techniques, as indicated above, may be possible for the code block. If this flag is not set (i.e., 0), then all code blocks whose COD / COC marker segments have the FAST mode flag set (bit 7 of the Code Block Style field) are decoded using the FAST block encoding algorithm and either the SXcod field is not present or its "mixed encoding" mode flag is 0.
[0192] If the "mixed encoding" flag is set, then bit 5 may be set in the COD and / or COC marker segments of the code stream, identifying the inclusion of a 16-bit SXcod field, as described above.
[0193] The methods for encoding and decoding using the above embodiments are implemented by a processing device that may be configured by software, a mixture of software and hardware, a programmable gate array (PGA) or FPGA, or any other architecture. The software may be provided in the form of modules. When software is used, routines and subroutines, or any software architecture, implement the embodiments of the present invention. When software is used to implement the present invention, the software may be provided on a computer readable medium such as a disk, or as a data signal over a network such as the Internet, or in any other manner.
[0194] The above embodiments relate to use within the JPEG2000 format. Embodiments of the invention are not so limited. Some embodiments may be used in other image processing formats. Embodiments may find use in other image processing contexts.
[0195] The use of embodiments of the present invention is not limited to images or video frames, but may be used for any other type of media, for example, embodiments may be utilized with multi-view imaging and depth coding of video or any other visual media.
[0196] It will be appreciated by those skilled in the art that numerous modifications and / or variations may be made to the present invention as illustrated in the specific embodiments without departing from the spirit or scope of the invention as broadly described, and the present embodiments are therefore to be considered in all respects as illustrative and not restrictive. footnote 1 http: / / www.kakadusoftware.com - Comparison is with the regular Kakadu distribution as opposed to the Kakadu Speed Pack edition which can be only 50% faster. 2 In practice, bit stuffing in JPEG2000 raw codeword segments avoids the occurrence of byte pairs whose big-endian hexadecimal values are in the range FF80h-FFFFh, but the block encoding algorithm is generally only required to avoid marker codes in the range FF90h-FFFFh. 3 Initial experiments suggest that the typical improvement in coding efficiency resulting from this variant is unlikely to exceed 1.5%. 4 Predictors for non-significant samples within a group can be formed in the same way, but without affecting the encoding or decoding process. 5 "Empty" as used herein refers to non-significant AZC groups for which there are no CxtVLC codewords, and to groups that are added as an afterthought to ensure that each group row has an integer number of group pairs.
[0197] The claims at the time of filing are as follows: [Section 1] 1. A method for encoding a block of subband sample values derived from a still image, a video frame, or related media, comprising: three bit streams; and dividing samples from the block into defined groups; a. a first bit stream (the MEL bit stream) encodes the significance across groups whose causally related neighbors are all non-significant (the AZC group), where samples with non-zero magnitude are identified as significant and samples with zero magnitude are identified as non-significant; b. a second bit stream (the VLC bit stream) encoding the significance of each individual sample within each group that is either a significant AZC group or a non-AZC group; c. the second bit stream (the VLC bit stream) also encodes an unsigned residual value for each significant group which, when added to a set of exponent predictors, provides an upper bound on the magnitude exponent of each significant sample in the group; d. a third bit stream (MagSgn bit stream) provides the sign bits and any additional magnitude bits necessary to represent significant sample values given corresponding exponent bounds; e. The method of claim 1, wherein the exponent predictor is calculated using both an exponent boundary associated with the preceding sample in the block and the additional magnitude bits unless the preceding sample in the block is outside the boundary of the block. [Section 2] Item 2. The method of item 1, wherein the MEL bit stream is formed by an adaptive run-length encoding process applied to a sequence of group significance symbols associated with an AZC group. [Section 3] 3. The method of claim 1 or 2, wherein the causal neighbors of a group correspond to sample positions adjacent to the group that are found to the left of the group and either in the same row of the group or in a preceding row of the group, except for the first row of the group, and the causal neighbors of a group correspond to sample positions found immediately to the left in the group, and neighbors not included in the block are interpreted as non-significant. [Section 4] 4. The method according to claim 1, 2 or 3, wherein the significance of all samples in a group (significance pattern of said group) is jointly coded based on a context label formed from the significance of causally related neighboring groups of said group. [Section 5] 5. The method of claim 4, wherein the encoding of the significance pattern includes the use of a variable length code (CxtVLC code) that depends on the context label. [Section 6] 6. The method according to any one of claims 1 to 5, wherein the coding of the unsigned residual comprises a variable length code (U-VLC code) in which a codeword consists of a prefix component and a suffix component, the length of the suffix being entirely determined by the value of the suffix. [Section 7] 7. The method of both items 5 and 6, wherein an unsigned residual offset value is coded together with the significance pattern of a group using a context-dependent variable length code (CxtVLC code), the unsigned residual offset indicating whether the unsigned residual is non-zero or not, and the U-VLC code is only used to code unsigned residuals that are non-zero. [Section 8] 8. The method of claim 7, wherein the CxtVLC code is augmented to identify magnitude bits of some significant samples for which the unsigned residual offset value associated with a codeword is non-zero, and the magnitude bits are then not included in the MagSgn bit stream. [Section 9] 9. The method of any one of clauses 1 to 8, wherein the exponential predictor is formed using values of samples from preceding rows of a group, except within a first row of the group of blocks. [Section 10] 10. The method of any one of claims 1 to 9, wherein a group has a size of 2x2 and is composed of the samples from pairs of consecutive columns in pairs of consecutive rows in the block. [Section 11] Item 11. The method of item 10, wherein the exponent predictor for a sample in a group that is in a row that is not the first in the group of the block is formed from the maximum of the magnitude exponents of the four samples adjacent to the group that are found on the row of the sample immediately above the group. [Section 12] 12. The method of any one of items 1 to 11, wherein the exponential predictor of a significant sample in a group is forced to 1 if it is the only significant sample in the group. [Section 13] 13. The method of any one of clauses 1 to 12, in conjunction with clause 7, wherein in a first row of the group, the MEL symbol stream is augmented with an additional unsigned residual offset symbol of one of a set of groups, a preferred size of the set being two consecutive groups, and the unsigned residuals of all groups in the set are adjusted based on a common additional unsigned residual offset value before applying a U-VLC code to the adjusted unsigned residuals of the groups only if the unsigned residual offset values encoded with the significance pattern of the group are all non-zero. [Section 14] 14. The method of any one of clauses 1 to 13 in conjunction with clauses 5 and 6, wherein the CxtVLC code bits and the U-VLC code bits are interleaved across a defined set of groups, such that the CxtVLC bits of all groups in the set appear before the U-VLC code bits of the same group and the U-VLC prefix bits of all groups in a set appear before the U-VLC suffix bits of the same group, the set of groups preferably consisting of pairs of horizontally adjacent groups. [Section 15] 15. The method of any one of clauses 1 to 14, wherein the Mel bit stream, the VLC bit stream, and the MagSgn bit stream are each subjected to a bit stuffing procedure and packed into bytes to form a MEL byte stream, a VLC byte stream, and a MagSgn byte stream, wherein the VLC byte stream grows backwards from the end of a single byte string representing a block (codeword segment), while the MagSgn byte stream grows forwards from the beginning of the byte string and the MEL byte stream grows forwards from the end of the MagSgn byte stream, so that only the boundary between the MagSgn byte stream and the MEL byte stream needs to be explicitly given with the byte string. [Section 16] Item 16. The method according to any one of items 1 to 15, wherein the sample values to be coded correspond to quantized subband samples after possible truncation to a precision associated with a given magnitude bitplane (p-value). [Section 17] 17. The method of claim 16, wherein an additional coding pass (SigProp pass) is used to encode the magnitude of certain samples that are non-significant (zero) in the precision associated with the first magnitude bit-plane (p-value) relative to the next finer magnitude bit-plane, and also to encode the sign bits of all said samples that are significant with respect to the finer magnitude bit-planes, following a stripe-oriented scan through the block samples and emitting all relevant magnitude bits from a defined set of stripe columns into the SigProp bit stream, and then emitting sign bits of the samples in the set of stripe columns that are identified as significant based on the magnitude bits being emitted. [Section 18] 18. The method of claim 16 or 17, wherein an additional coding pass (MagRef pass) is used to code the least significant magnitude bits for the next finer magnitude bit-plane of samples that are coded as significant (non-zero) at the precision associated with the first magnitude bit-plane (p-value), following a stripe oriented scan through the block samples and emitting all associated magnitude bits in the MagRef bit stream. [Section 19] 19. The method of claim 17 and 18, wherein the SigProp bit stream and the MagRef bit stream are each subjected to a bit stuffing procedure and packed into a SigProp byte stream and a MagRef byte stream, the SigProp byte stream growing forward from the beginning of the precision improvement code byte sequence and the MagRef byte stream growing backward from the end of the precision improvement code byte sequence. [Section 20] 1. A method for decoding blocks of subband samples to produce a still image, a video frame, or related media, the samples being organized into defined groups and represented using three bit streams; a. a first bit stream (the MEL bit stream) is decoded to find significance across a group (the AZC group) in which all causally related neighboring groups are non-significant, and samples having a non-zero magnitude are identified as significant and samples having a magnitude of zero are identified as non-significant; b. a second bit stream (the VLC bit stream) is decoded to find the significance of individual samples within each group that are either significant AZC groups or not AZC groups; c. the decoding of the second bit stream (the VLC bit stream) is also used to find an unsigned residual value for each significant group which, when added to a set of exponent predictors, provides an upper bound on the magnitude exponent of each significant sample in the group; d. A third bit stream (MagSgn bit stream) is unpacked to discover the sign bit and any additional magnitude bits used to infer the value of each significant sample, given the corresponding exponent bound; e. The method of claim 1, wherein the exponent predictor is calculated using both an exponent boundary and additional magnitude bits associated with previously decoded samples in the block, except when the previous sample in the block is outside the boundary of the block. [Section 21] 21. The method of claim 20, wherein an adaptive run-length decoding process is used to decode the MEL bit stream to generate a sequence of group significance symbols that identify the significance of each AZC group. [Section 22] 22. The method of claim 20 or 21, wherein the causal neighboring groups of a group correspond to sample positions adjacent to the group that are found to the left of the group and either in the same row of the group or in a preceding row of the group, except for the first row of the group, and the significance of the samples has already been decoded; the causal neighboring groups of a group correspond to sample positions found immediately to the left in the group, and the significance of the samples has already been decoded; and neighboring groups not included in the block are interpreted as non-significant. [Section 23] 23. The method according to claim 20, 21 or 22, wherein the significance of all samples in a group (the significance pattern of said group) is jointly decoded using context labels formed from the significance of causally related neighboring groups of said group. [Section 24] 24. The method of claim 23, wherein decoding the significance pattern includes decoding a variable length code (CxtVLC code) that depends on the context label. [Section 25] 25. The method of any one of clauses 20 to 24, wherein the decoding of the unsigned residual comprises decoding a variable length code (U-VLC code) in which a codeword consists of a prefix component and a suffix component, the length of the suffix being entirely determined by the value of the suffix. [Section 26] 26. The method of both of items 24 and 25, wherein an unsigned residual offset value is decoded together with the significance pattern of a group in a process of decoding a context-dependent variable length code (CxtVLC code), the unsigned residual offset indicating whether the unsigned residual is non-zero or not, and decoding of a U-VLC codeword of the group is performed only if the unsigned residual offset value is non-zero, and following said performing, the U-VLC decoding result is added to the unsigned residual offset value. [Section 27] 27. The method of claim 26, wherein in the process of decoding some context-dependent variable length codewords (CxtVLC codes) whose unsigned residual offset values being decoded are non-zero, additional magnitude bits are decoded for some significant coefficients along with the significance pattern and the unsigned residual offset values, and the additional magnitude bits are combined with bits from the MagSgn bit stream to reconstruct the associated sample values. [Section 28] 28. The method of any one of clauses 20 to 27, wherein the exponential predictor is formed using values of samples from previous rows of the group, except in a first row of the group of the block, and the sample values have been previously decoded. [Section 29] 29. The method of any one of clauses 20 to 28, wherein a group has a size of 2x2 and is composed of the samples from pairs of consecutive columns in pairs of consecutive rows in the block. [Section 30] 30. The method of claim 29, wherein the exponent predictor for a sample in a group that is in a row that is not the first of the group of the block is formed from the maximum of the magnitude exponents in four positions adjacent to the group that are found on the row of samples immediately above the group, the magnitude exponent being calculated from previously decoded sample values in the four positions. [Section 31] 31. The method of any one of clauses 20 to 30, wherein the exponential predictor of a significant sample in a group is forced to 1 if it is the only significant sample in the group. [Section 32] The method of any one of clauses 20 to 31 in conjunction with clause 25, wherein for a first row of the group, the augmented MEL symbol stream provides a common additional unsigned residual offset value for a set of groups, a preferred size of the set being two consecutive groups, and the unsigned residuals of all groups in the set are adjusted based on the common additional unsigned residual offset value after decoding of the U-VLC code of the group only if the unsigned residual offset values decoded together with the significance pattern of the group are all non-zero. [Section 33] 33. The method of any one of clauses 20 to 32, in conjunction with clauses 24 and 25, wherein the CxtVLC code bits associated with a given set of groups are found together in the VLC bitstream, such that the CxtVLC codes of the set of groups must be decoded first, followed by the U-VLC prefixes of all groups in the set, then the U-VLC suffixes of all groups in the set, after which decoding can proceed for any subsequent set of groups, the set of groups preferably consisting of pairs of horizontally adjacent groups. [Section 34] 35. The method of any one of clauses 20 to 34, wherein the Mel bit stream, the VLC bit stream, and the MagSgn bit stream are each restored by unpacking bits from the MEL byte stream, the VLC byte stream, and the MagSgn byte stream, respectively, and removing stuffing bits that may have been introduced into the byte streams via a bit stuffing procedure, wherein the VLC byte stream grows backwards from the end of a single byte string representing a block (codeword segment), while the MagSgn byte stream grows forwards from the beginning of the byte string and the MEL byte stream grows forwards from the end of the MagSgn byte stream, and wherein the boundary between the MagSgn byte stream and the MEL byte stream is explicitly identified along with the byte string itself. [Section 35] 35. The method according to any one of clauses 20 to 34, wherein the decoded sample values correspond to quantized subband samples after possible truncation to a precision associated with a given magnitude bitplane (p value). [Section 36] 36. The method of claim 35, wherein an additional decoding pass (SigProp pass) is performed to find the magnitude for the next finer magnitude bit-plane of a particular sample that has been decoded as being non-significant (zero) at the precision associated with a first magnitude bit-plane (p-value) and also to recover the sign bits of all said samples that are found to be significant with respect to the finer magnitude bit-planes, following a stripe-oriented scan through the block samples and retrieving all relevant magnitude bits of a defined set of stripe columns from the SigProp bit stream, and then retrieving the sign bits of the samples in the set of stripe columns that are identified as significant based on the magnitude bits that have been retrieved. [Section 37] The method of claim 35 or 36, wherein an additional decoding pass (MagRef pass) is performed to find the least significant magnitude bit for the next finer magnitude bit plane of a sample that has already been decoded as significant with respect to the first magnitude bit plane (p-value), following a stripe oriented scan through the block samples and retrieving all relevant magnitude bits from the MagRef bit stream. [Section 38] 38. The method of clauses 36 and 37, wherein the SigProp bit stream and the MagRef bit stream are restored by unpacking bits from a forward growing SigProp byte stream and a backward growing MagRef byte stream, respectively, within a single precision improvement code byte sequence and removing stuffing bits that may have been introduced into the byte streams via a bit stuffing procedure. [Section 39] 20. An apparatus for encoding a block of sample values, comprising an encoding device configured to perform the method according to any one of claims 1 to 19. [Section 40] 20. A computer program comprising instructions for controlling a computer to carry out the method according to any one of claims 1 to 19. [Section 41] 41. A non-volatile computer readable medium providing a computer program according to claim 40. [Section 42] 41. A data signal comprising the computer program according to paragraph 40. [Section 43] 39. An apparatus for decoding a block of samples, comprising: a decoder apparatus configured to perform the method of any one of clauses 20 to 38. [Section 44] 39. A computer program comprising instructions for controlling a computer to carry out the method according to any one of paragraphs 20 to 38. [Section 45] 45. A non-volatile computer readable medium providing a computer program according to claim 44. [Section 46] 45. A data signal comprising the computer program according to paragraph 44.
Claims
1. 1. A method for encoding a block of subband sample values derived from a still image, a video frame, or related media, comprising: three bit streams; and dividing samples from the block into defined groups; a. a first bit stream (the MEL bit stream) encodes the significance of an entire group (the AZC group) whose causally related neighbors are all non-significant, where samples with non-zero magnitude are identified as significant and samples with zero magnitude are identified as non-significant; b. A second bit stream (the VLC bit stream) encodes the significance of each individual sample within each group, which is either a significant AZC group or a non-AZC group; c. the second bit stream (VLC bit stream) also encodes an unsigned residual value for each significant group which, when added to a set of exponent predictors, provides an upper bound on the magnitude exponent of each significant sample in the group; d. a third bit stream (MagSgn bit stream) provides the sign bit and any additional magnitude bits necessary to represent significant sample values given the corresponding exponent bounds; e. the exponent predictor is calculated using both an exponent bound associated with the preceding sample in the block and the additional magnitude bits unless the preceding sample in the block is outside the bounds of the block.
2. 2. The method of claim 1, wherein the MEL bit stream is formed by an adaptive run-length encoding process applied to a sequence of group significance symbols associated with an AZC group.
3. 3. The method of claim 1 or 2, wherein the causal neighbors of a group correspond to sample positions adjacent to the group that are found to the left of the group and either in the same row of the group or in a preceding row of the group, except for the first row of the group, and the causal neighbors of a group correspond to sample positions found immediately to the left in the group, and neighbors not included in the block are interpreted as non-significant.
4. 4. The method of claim 1, 2 or 3, wherein the significance of all samples in a group (the significance pattern of the group) is jointly coded based on a context label formed from the significance of its causally related neighboring groups.
5. The method of claim 4 , wherein the encoding of the significance pattern comprises the use of a variable length code (CxtVLC code) that depends on the context label.
6. 6. The method according to claim 1, wherein the coding of the unsigned residual comprises a variable length code (U-VLC code) in which a codeword consists of a prefix component and a suffix component, the length of the suffix being completely determined by the value of the suffix.
7. 7. The method of both claims 5 and 6, wherein an unsigned residual offset value is coded together with the significance pattern of a group using a context-dependent variable length code (CxtVLC code), the unsigned residual offset indicating whether the unsigned residual is non-zero or not, and the U-VLC code is only used to code unsigned residuals that are non-zero.
8. 8. The method of claim 7, wherein the CxtVLC code is augmented to identify magnitude bits of some significant samples for which the unsigned residual offset value associated with a codeword is non-zero, and the magnitude bits are then not included in the MagSgn bit stream.
9. 9. A method according to claim 1, wherein the exponential predictor is formed using values of samples from previous rows of the group, except within a first row of the group of blocks.
10. 10. A method according to claim 1, wherein a group has a size of 2x2 and is made up of the samples from pairs of consecutive columns in pairs of consecutive rows in the block.
11. 11. The method of claim 10, wherein the exponent predictor for a sample in a group that is in a row that is not the first of the group of the block is formed from the maximum of the magnitude exponents of the four samples adjacent to the group that are found on the row of the sample immediately above the group.
12. 12. The method of claim 1, wherein the exponential predictor of a significant sample in a group is forced to 1 if it is the only significant sample in the group.
13. A method according to any one of claims 1 to 12 in conjunction with claim 7, wherein in a first row of the group, the MEL symbol stream is augmented with one additional unsigned residual offset symbol of a set of groups, the preferred size of the set being two consecutive groups, and the unsigned residuals of all groups in the set are adjusted based on a common additional unsigned residual offset value before applying a U-VLC code to the adjusted unsigned residuals of the group only if the unsigned residual offset values encoded with the significance pattern of the group are all non-zero.
14. A method according to any one of claims 1 to 13 in conjunction with claims 5 and 6, wherein the CxtVLC code bits and the U-VLC code bits are interleaved across a defined set of groups, such that the CxtVLC bits of all groups within a set appear before the U-VLC code bits of the same group and the U-VLC prefix bits of all groups within a set appear before the U-VLC suffix bits of the same group, the set of groups preferably consisting of pairs of horizontally adjacent groups.
15. 15. A method according to claim 1, wherein the Mel, VLC and MagSgn bit streams each undergo a bit stuffing procedure and are packed into bytes to form a MEL, VLC and MagSgn byte stream, the VLC byte stream growing backwards from the end of a single byte string representing a block (codeword segment), while the MagSgn byte stream grows forwards from the beginning of the byte string and the MEL byte stream grows forwards from the end of the MagSgn byte stream, so that only the boundary between the MagSgn and MEL byte streams needs to be explicitly provided with the byte string.
16. 16. The method according to claim 1, wherein the sample values to be coded correspond to quantized subband samples after possible truncation to a precision associated with a given magnitude bitplane (p-value).
17. 17. The method of claim 16, wherein an additional coding pass (SigProp pass) is used to encode the magnitude of certain samples that are non-significant (zero) at the precision associated with the first magnitude bitplane (p-value) to the next finer magnitude bitplane, and also to encode the sign bits of all said samples that are significant with respect to the finer magnitude bitplanes, following a stripe-oriented scan through the block samples, emitting all relevant magnitude bits from a defined set of stripe columns into the SigProp bit stream, and then emitting sign bits of said samples in the set of stripe columns that are identified as significant based on the magnitude bits being emitted.
18. 18. A method according to claim 16 or 17, wherein an additional coding pass (MagRef pass) is used to code the least significant magnitude bits for the next finer magnitude bitplane of samples coded as significant (non-zero) at the precision associated with the first magnitude bitplane (p-value), following a stripe-oriented scan through the block samples and emitting all relevant magnitude bits in the MagRef bit stream.
19. 19. The method of claim 17 and 18, wherein the SigProp bit stream and the MagRef bit stream are each subjected to a bit stuffing procedure and packed into a SigProp byte stream and a MagRef byte stream, the SigProp byte stream growing forwards from the beginning of the precision improvement code byte sequence and the MagRef byte stream growing backwards from the end of the precision improvement code byte sequence.
20. 1. A method for decoding blocks of subband samples to produce a still image, a video frame, or related media, the samples being organized into defined groups and represented using three bit streams, comprising: a. a first bit stream (MEL bit stream) is decoded to find the significance of an entire group (AZC group) whose causally related neighboring groups are all non-significant, and samples with non-zero magnitude are identified as significant and samples with zero magnitude are identified as non-significant; b. A second bit stream (the VLC bit stream) is decoded to find the significance of individual samples within each group that are either significant AZC groups or not AZC groups; c. the decoding of said second bit stream (the VLC bit stream) is also used to find an unsigned residual value for each significant group which, when added to a set of exponent predictors, gives an upper bound on the magnitude exponent of each significant sample in said group; d. A third bit stream (MagSgn bit stream) is unpacked to discover the sign bit and any additional magnitude bits used to infer the value of each significant sample, given the corresponding exponent bound; e. The method of claim 1, wherein the exponent predictor is calculated using both an exponent boundary and additional magnitude bits associated with a previously decoded sample in the block, unless the previous sample in the block is outside the boundary of the block.
21. 21. The method of claim 20, wherein an adaptive run-length decoding process is used to decode the MEL bit stream to generate a string of group significance symbols that identify the significance of each AZC group.
22. 22. The method of claim 20 or 21, wherein the causal neighboring groups of a group correspond to sample positions adjacent to the group that are found to the left of the group and either in the same row of the group or in a preceding row of the group, except for the first row of the group, and the significance of the samples has already been decoded; the causal neighboring groups of a group correspond to sample positions found immediately to the left in the group, and the significance of the samples has already been decoded; and neighboring groups not included in the block are interpreted as non-significant.
23. 23. The method of claim 20, 21 or 22, wherein the significance of all samples in a group (the significance pattern of the group) is jointly decoded using context labels formed from the significance of the group's causally related neighboring groups.
24. 24. The method of claim 23, wherein decoding the significance pattern comprises decoding a variable length code (CxtVLC code) that depends on the context label.
25. 25. The method of claim 20, wherein the decoding of the unsigned residual comprises decoding a variable length code (U-VLC code) whose codewords consist of a prefix component and a suffix component, the length of the suffix being entirely determined by the value of the suffix.
26. The method according to both claims 24 and 25, wherein an unsigned residual offset value is decoded together with the significance pattern of a group in a process of decoding a context-dependent variable length code (CxtVLC code), the unsigned residual offset indicating whether the unsigned residual is non-zero or not, and decoding of a U-VLC codeword of the group is performed only if the unsigned residual offset value is non-zero, and following said performing, the U-VLC decoding result is added to the unsigned residual offset value.
27. 27. The method of claim 26, wherein in the process of decoding certain context-dependent variable length codewords (CxtVLC codes) for which the unsigned residual offset value being decoded is non-zero, additional magnitude bits are decoded for certain significant coefficients along with the significance pattern and unsigned residual offset value, and the additional magnitude bits are combined with bits from the MagSgn bit stream to reconstruct the associated sample value.
28. 28. The method of claim 20, wherein the exponential predictor is formed using values of samples from previous rows of the group, except in a first row of the group of blocks, the sample values having been previously decoded.
29. 29. A method according to any one of claims 20 to 28, wherein a group has a size of 2x2 and is made up of the samples from pairs of consecutive columns in pairs of consecutive rows in the block.
30. 30. The method of claim 29, wherein the exponent predictor for a sample in a group in a row that is not the first of the group of the block is formed from the maximum of the magnitude exponents in four positions adjacent to the group found on the row of samples immediately above the group, the magnitude exponent being calculated from previously decoded sample values in the four positions.
31. 31. The method of any one of claims 20 to 30, wherein the exponential predictor of a significant sample in a group is forced to 1 if it is the only significant sample in the group.
32. The method of any one of claims 20 to 31 in conjunction with claim 25, wherein for a first row of the group, the augmented MEL symbol stream provides a common additional unsigned residual offset value for a set of groups, a preferred size of a set is two consecutive groups, and the unsigned residuals of all groups in the set are adjusted based on the common additional unsigned residual offset value after decoding of the U-VLC code of the group only if the unsigned residual offset values decoded together with the significance pattern of the group are all non-zero.
33. A method according to any one of claims 20 to 32, in conjunction with claims 24 and 25, wherein the CxtVLC code bits associated with a defined set of groups are found together in the VLC bit stream, such that the CxtVLC codes of the set of groups have to be decoded first, followed by the U-VLC prefixes of all groups in the set, then the U-VLC suffixes of all groups in the set, after which decoding can proceed for any subsequent set of groups, the set of groups preferably consisting of pairs of horizontally adjacent groups.
34. 35. A method according to any one of claims 20 to 34, wherein the Mel, VLC and MagSgn bit streams are each recovered by unpacking bits from the MEL, VLC and MagSgn byte streams respectively and removing stuffing bits that may have been introduced into the byte streams via a bit stuffing procedure, the VLC byte stream growing backwards from the end of a single byte string representing a block (codeword segment), while the MagSgn byte stream grows forwards from the beginning of the byte string and the MEL byte stream grows forwards from the end of the MagSgn byte stream, and the boundary between the MagSgn and MEL byte streams is explicitly identified along with the byte string itself.
35. 35. A method according to any one of claims 20 to 34, wherein the decoded sample values correspond to quantized subband samples after possible truncation to a precision associated with a given magnitude bitplane (p-value).
36. 36. The method of claim 35, wherein an additional decoding pass (SigProp pass) is performed to find the magnitude for the next finer magnitude bitplane of a particular sample that has been decoded as being non-significant (zero) at the precision associated with a first magnitude bitplane (p-value) and to also recover the sign bits of all said samples that are found to be significant with respect to the finer magnitude bitplanes, following a stripe-oriented scan through said block samples and retrieving all relevant magnitude bits of a prescribed set of stripe columns from the SigProp bit stream, and then retrieving the sign bits of said samples in said set of stripe columns that are identified as significant based on the magnitude bits that have been retrieved.
37. A method according to claim 35 or 36, wherein an additional decoding pass (MagRef pass) is performed to find the least significant magnitude bit for the next finer magnitude bitplane of a sample that has already been decoded as significant with respect to the first magnitude bitplane (p-value), following a stripe-oriented scan through the block samples and retrieving all relevant magnitude bits from the MagRef bitstream.
38. 38. The method of claims 36 and 37, wherein the SigProp and MagRef bit streams are recovered by unpacking bits from a forward growing SigProp byte stream and a backward growing MagRef byte stream, respectively, within a single accuracy improvement code byte sequence and removing stuffing bits that may have been introduced into the byte streams via a bit stuffing procedure.
39. Apparatus for encoding a block of sample values, comprising an encoding device configured to implement a method according to any one of claims 1 to 19.
40. A computer program comprising instructions for controlling a computer to carry out the method according to any one of claims 1 to 19.
41. 41. A non-volatile computer readable medium providing a computer program product as claimed in claim 40.
42. 41. A data signal comprising the computer program of claim 40.
43. 39. Apparatus for decoding a block of samples, comprising: a decoder device configured to perform a method according to any one of claims 20 to 38.
44. A computer program comprising instructions for controlling a computer to carry out a method according to any one of claims 20 to 38.
45. 45. A non-volatile computer readable medium providing a computer program according to claim 44.
46. 45. A data signal comprising the computer program of claim 44.
Citation Information
Patent Citations
A method and apparatus for image compression
WO2017201574A1
