Coding the last significant coefficient flag
By employing coordinate systems and entropy coding techniques to encode the position of the last non-zero coefficient in transform blocks, the method addresses inefficiencies in video encoding, improving compression efficiency and reducing resource usage.
Patent Information
- Application Number
- JP2022015616
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2017-09-18
- Filing Date
- 2022-02-03
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2038-05-08
AI Technical Summary
Existing video encoding techniques are inefficient in encoding the position of the last non-zero coefficient in transform blocks, leading to suboptimal compression and increased computational resources for video data processing, transmission, and storage.
A method and apparatus for encoding and decoding the position of the last non-zero coefficient in a transform block using a combination of Cartesian, Cartesian grouped, and polar coordinate systems, reducing the number of bits required by encoding the position of the last non-zero coefficient based on its column and row values, and utilizing entropy coding techniques to improve efficiency.
This approach reduces the number of bits needed to represent video data, enhancing compression efficiency and reducing computational resources for video processing, transmission, and storage by optimizing the encoding of the last non-zero coefficient in transform blocks.
Smart Images

Figure 0007617051000004 
Figure 0007617051000005 
Figure 0007617051000006
Abstract
Description
[Technical field]
[0001] A digital video stream may represent a video using a series of frames or still images. Digital video can be used for a variety of applications, such as video conferencing, high-definition video entertainment, video advertising, or sharing user-generated videos. Digital video streams contain large amounts of data and consume large amounts of computing or communication resources of computing devices to process, transmit, or store the video data. Various techniques have been proposed to reduce the amount of data in video streams, including compression and other encoding techniques.
[0002] Encoding based on motion estimation and compensation may be performed by dividing a frame or image into blocks that are predicted based on one or more predictive blocks of a reference frame. The difference between the block and the predictive block (i.e., the residual error) is compressed and coded in the bitstream. A decoder uses the difference and the reference frame to reconstruct the frame or image. Summary of the Invention
[0003] One aspect is a method for encoding a position of a last non-zero coefficient of a transform block of coefficients in an encoded bitstream, the method comprising the steps of determining a position of the last non-zero coefficient; and encoding a non-zero coefficient of a transform block of coefficients, the non-zero coefficients including a column value and a row value. The non-zero coefficients are in a coefficient column and a coefficient row of the transform block. The method includes, in response to a determination that the non-zero coefficient is the first non-zero coefficient to be encoded in the coefficient column, encoding whether the coefficient column is equal to the column value of the last non-zero coefficient, and in response to a determination that the non-zero coefficient is not the first non-zero coefficient to be encoded in the coefficient column, skipping encoding whether the coefficient column is equal to the column value of the last non-zero coefficient. The method includes, in response to a determination that the non-zero coefficient is the first non-zero coefficient to be encoded in the coefficient row, encoding whether the coefficient row is equal to the row value of the last non-zero coefficient, and in response to a determination that the non-zero coefficient is not the first non-zero coefficient to be encoded in the coefficient row, skipping encoding whether the coefficient row is equal to the row value of the last non-zero coefficient.
[0004] Another aspect is a method of encoding a position of a last non-zero coefficient of a transform block of coefficients in an encoded bitstream, the method including the steps of determining a position of the last non-zero coefficient, the position including a column value and a row value, encoding one or more non-zero coefficients of the transform block of coefficients with respect to a scan order, each of the one or more non-zero coefficients being in a respective coefficient column and a respective coefficient row of the transform block, and in response to determining that a non-zero coefficient of the one or more non-zero coefficients is the first non-zero coefficient to be encoded in a column equal to the column value of the last non-zero coefficient, encoding that the coefficient column of the non-zero coefficient is equal to the column value of the last non-zero coefficient, and in response to determining that a non-zero coefficient of the one or more non-zero coefficients is the first non-zero coefficient to be encoded in a row equal to the row value of the last non-zero coefficient, encoding that the coefficient row of the non-zero coefficient is equal to the column value of the last non-zero coefficient.
[0005] Another aspect is an apparatus for encoding, in a coded bitstream, a position of a last non-zero coefficient of a transform block of coefficients. The apparatus includes a memory and a processor configured to execute instructions stored in the memory to determine a location of a last nonzero coefficient, the location including a column value and a row value, to encode one or more nonzero coefficients of a transform block of coefficients, each nonzero coefficient being in a respective coefficient column and a respective coefficient row of the transform block, and for each of the one or more nonzero coefficients, either (i) in response to a determination that the nonzero coefficient is the first nonzero coefficient to be encoded in the coefficient column, to either encode whether the coefficient column is equal to the column value of the last nonzero coefficient, or (ii) in response to a determination that the nonzero coefficient is the first nonzero coefficient to be encoded in the coefficient row, to either encode whether the coefficient row is equal to the row value of the last nonzero coefficient, or (ii) in response to a determination that the nonzero coefficient is not the first nonzero coefficient to be encoded in the coefficient row, to either
[0006] Another aspect is an apparatus for decoding a location of a last non-zero coefficient of a transform block, the apparatus including a memory and a processor, the processor being configured to execute instructions stored in the memory to decode, from the encoded bitstream, whether a first coefficient of the transform block is non-zero, in response to determining that the first coefficient is non-zero and in response to determining that the first coefficient is a first non-zero coefficient to be decoded with respect to the first value of the first dimension, decode, from the encoded bitstream, a first syntax element indicating whether the first value of the first dimension indicates an end of block coefficient, and in response to the first syntax element indicating an end of block coefficient, determine a location of the last non-zero coefficient using the first value.
[0007] Another aspect is a method for decoding the position of the last non-zero coefficient of a transform block of coefficients. The method includes mapping coefficients of a transform block to a coefficient group coordinate system having a first dimension and a second dimension, the first dimension corresponding to a group of transform coefficients and the second dimension corresponding to an offset position within one of the groups of coefficients. The method includes determining, from an encoded bitstream, a coefficient group including a last non-zero coefficient, determining, from the encoded bitstream, an offset position of a last non-zero coefficient in the coefficient group for the last non-zero coefficient, and decoding coefficients from the encoded bitstream up to the coefficient corresponding to the coefficient group and the offset position.
[0008] These and other aspects of the present disclosure are described in further detail in the following detailed description of the embodiments, the appended claims and the accompanying drawings. [Brief description of the drawings]
[0009] This description refers to the accompanying drawings, in which like reference numerals refer to like features throughout the several views. [Figure 1] 1 is a schematic diagram of a video encoding and decoding system. [Diagram 2] 1 is a block diagram of an example of a computing device in which a transmitting station or a receiving station may be implemented. [Diagram 3] FIG. 1 is a diagram of a video stream that is encoded and subsequently decoded. [Figure 4] FIG. 2 is a block diagram of an encoder according to an embodiment of the present disclosure. [Diagram 5] FIG. 2 is a block diagram of a decoder according to an embodiment of the present disclosure. [Figure 6] FIG. 4 illustrates quantized transform coefficients according to an embodiment of the present disclosure. [Figure 7] FIG. 2 is a diagram of a coefficient token tree that may be used to entropy code a transform block, according to an embodiment of the present disclosure. [Figure 8] FIG. 2 is a diagram of an example tree for binarizing EOB positions according to an embodiment of the present disclosure. [Figure 9] FIG. 4 is a flowchart diagram of a process for encoding the position of the last non-zero coefficient of a transform block of coefficients according to an embodiment of this disclosure. [Figure 10] FIG. 2 is a diagram of an example of scan order and blocks according to an embodiment of the present disclosure. [Figure 11] FIG. 11 is a flowchart diagram of a process for coding the position of the last non-zero coefficient of a transform block of coefficients using a Cartesian coordinate system according to one embodiment of this disclosure. [Figure 12] FIG. 11 is a flowchart diagram of a process for coding the position of the last non-zero coefficient of a transform block of coefficients using a Cartesian grouping coordinate system according to one embodiment of the present disclosure. [Figure 13] FIG. 11 is a flowchart diagram of a process for coding the position of the last non-zero coefficient of a transform block of coefficients using a polar coordinate system according to an embodiment of the present disclosure. [Figure 14] FIG. 11 is a flowchart diagram of a process for coding the position of the last non-zero coefficient of a transform block of coefficients using a coefficient group coordinate system according to an embodiment of this disclosure. [Figure 15] FIG. 2 illustrates an example of a polar coordinate system according to an embodiment of the present disclosure. [Figure 16] FIG. 2 illustrates an example of a coefficient group coordinate system according to an embodiment of the present disclosure. [Figure 17] FIG. 4 is a flowchart diagram of a process for decoding the position of the last non-zero coefficient of a transform block according to an embodiment of the present disclosure. [Figure 18] FIG. 11 is a flowchart diagram of another process for decoding the position of the last non-zero coefficient of a transform block according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0010] As previously mentioned, compression schemes associated with coding video streams involve dividing an image into blocks and using one or more techniques to generate a digital video output bitstream to limit the information contained in the output. The received coded bitstream can then be decoded to recreate the blocks and the source image from the limited information. Encoding a video stream or a portion thereof (such as a frame or block) may use temporal or spatial similarities in the video stream to improve coding efficiency. For example, a current block of a video stream may be encoded based on identifying differences (residuals) between previously coded pixel values and pixel values in the current block. In this method, only the residuals and the parameters used to generate the residuals need to be added to the encoded bitstream. The residuals may be encoded using a lossy quantization step.
[0011] As described further below, the residual block is in the pixel domain. The residual block is transformed into the frequency domain to obtain a transform block of transform coefficients. The transform coefficients are quantized to obtain a quantized transform block of quantized transform coefficients. The quantized coefficients are entropy coded and appended to an encoded bitstream. A decoder can receive the encoded bitstream and entropy decode the quantized transform coefficients to reconstruct the original video frame.
[0012] Entropy coding is a technique for "lossless" coding that relies on a probability model that models the distribution of values that occur in the encoded video bitstream. By using a probability model based on a measured or estimated distribution of values, entropy coding can reduce the number of bits required to represent the video data to close to a theoretical minimum. In practice, the actual reduction in the number of bits required to represent the video data can be a function of the precision of the probability model, the number of bits over which the coding is performed, and the computational precision of the fixed-point arithmetic used to perform the coding.
[0013] In an encoded video bitstream, many of the bits are used for one of two things: content prediction (e.g., inter-mode / motion vector coding, intra-prediction mode coding, etc.) or residual coding (e.g., transform coefficients). The encoder can use techniques to reduce the number / amount of bits spent on coefficient coding. For example, a coefficient token tree (which may also be called a binary token tree) specifies a range of values with forward adaptive probabilities for each branch in the token tree. The token-based value is subtracted from the value to be coded to form a residual, and then the block is coded with a fixed probability. Similar schemes with slight variations, including backward adaptivity, are also possible. Adaptive techniques can change the probability model to adapt to changes in the characteristics of the data as the video stream is coded. In any case, the decoder is informed (or has access to) the probability model used to code the entropy coded video bitstream in order to decode the video bitstream.
[0014] The quantized transform block may include zero quantized transform coefficients and non-zero quantized transform coefficients. The non-zero coefficients are also referred to herein as significant coefficients. The encoding and decoding of the quantized transform block may include encoding and decoding transform coefficients of the transform block according to a scan order. The encoding and decoding of the quantized transform block may include encoding and decoding information about a significant coefficient that is the last non-zero quantized transform coefficient (i.e., the last significant coefficient) in the transform block. This is referred to as coding an end of block (EOB) position. Which transform coefficient is designated as the last non-zero transform coefficient is determined based on the scan order.
[0015] In some coding systems, the Cartesian coordinates (i.e., the column and row within the quantized transform block) of the last non-zero coefficient are coded, which is referred to herein as the Cartesian coordinate approach to coding the EOB position.
[0016] In other coding systems, as each quantized transform coefficient is accessed (i.e., to be coded or decoded) according to the scan order, information about whether the transform coefficient is the last non-zero coefficient or not is coded. For this reason, the EOB position is coded in an interleaving manner together with the significant coefficient position. This is referred to herein as the interleaving approach to coding the EOB position.
[0017] As will be further explained below, the Cartesian coordinate approach is more efficient when the transform block is dense. A dense transform block is one in which the number of non-zero coefficients (i.e., significant coefficients) is relatively large. On the other hand, the interleaving approach is more efficient when the transform block is sparse. A sparse coefficient block is one in which the number of non-zero coefficients is relatively small.
[0018] Embodiments according to the present disclosure can combine the advantages of the Cartesian coordinate approach and the interleaving approach to reduce the number of bits required to represent video data by coding the EOB position. Coding of the EOB position according to the teachings herein can perform well (e.g., in terms of the bits required to code the EOB position) for both dense and sparse transform blocks.
[0019] The embodiments according to the present disclosure map the transform coefficients of a transform block into a coordinate system having dimensions. Some of the values of the dimension include significant (i.e., non-zero) transform coefficients. For example, in a Cartesian coordinate system (described below), the dimension may be a column dimension. With reference to block 1050 (which is a transform block) of FIG. 10, dimension value 6 (i.e., column index 6) includes significant coefficients, i.e., coefficient 1052 and coefficient 1056, while dimension value 3 (i.e., column index 3) does not include a non-zero coefficient. For dimension values that include significant coefficients, the number of bits required to code the EOB position can be reduced by coding only once whether the dimension value includes or does not include the last non-zero coefficient. Examples of coordinate systems include a Cartesian coordinate system, a polar coordinate system, a Cartesian grouping coordinate system, and a coefficient grouping coordinate system. Other coordinate systems are possible according to the embodiments of the present disclosure. In the coordinate systems described herein, two dimensions are described for the coordinate system. However, the coordinate system may include more than two dimensions.
[0020] As mentioned above, the coordinate system can be a Cartesian coordinate system, and the dimensions can be the columns and rows of the transform block. The coordinate system can be a polar coordinate system, which can be centered on the DC coefficient (i.e., block position (0,0) of the transform block) and the distance from the center can be measured using anti-diagonal lines. The anti-diagonal can be the first dimension and the position on the anti-diagonal can be the second dimension. The coordinate system is a grouping system where the transform coefficients are grouped into numbered groups, the first dimension is the group index and the second dimension is the offset position of the transform coefficient within the group. Other coordinate systems are possible.
[0021] Improved coding of last significant coefficient flags in video compression is first described herein with reference to a system in which the teachings may be incorporated. Figure 1 is a schematic diagram of a video encoding and decoding system 100. The transmitting station 102 can be, for example, a computer having a hardware internal configuration as described in Figure 2. However, other suitable embodiments of the transmitting station 102 are possible. For example, the processing of the transmitting station 102 can be distributed among multiple devices.
[0022] The network 104 can connect the transmitting station 102 and the receiving station 106 for encoding and decoding the video stream. The video stream may be encoded at transmitting station 102 and the encoded video stream may be decoded at receiving station 106. Network 104 may be, for example, the Internet. Network 104 may be a local area network (LAN), a wide area network (WAN), a virtual private network (VPN), a cellular network, or any other means of transferring the video stream from transmitting station 102, in this example, to receiving station 106.
[0023] The receiving station 106 may, in one example, be a computer having an internal hardware configuration as depicted in Figure 2. However, other suitable embodiments of the receiving station 106 are possible. For example, the processing of the receiving station 106 may be distributed across multiple devices.
[0024] Other embodiments of the video encoding and decoding system 100 are possible. For example, an embodiment may omit the network 104. In another embodiment, the video stream may be encoded and stored for later transmission to the receiving station 106 or any other device having memory. In one embodiment, the receiving station 106 receives the encoded video stream (e.g., via the network 104, a computer bus, and / or some other communication path) and stores the video stream for later decoding. In one embodiment, a real-time transport protocol (RTP) is used to transmit the encoded video over the network 104. In another embodiment, a transport protocol other than RTP may be used, such as, for example, a Hypertext Transfer Protocol (HTTP)-based video streaming protocol.
[0025] When used in a videoconferencing system, for example, the transmitting station 102 and / or the receiving station 106 may include the capability to encode and decode video streams, as described below. For example, the receiving station 106 may be a videoconference participant that receives an encoded video bitstream from a videoconference server (e.g., the transmitting station 102) for decoding and viewing, and then encodes and transmits the video bitstream to the videoconference server for decoding and viewing by other participants.
[0026] 2 is a block diagram of an example of a computing device 200 capable of implementing a transmitting station or a receiving station. For example, the computing device 200 may implement one or both of the transmitting station 102 and the receiving station 106 of FIG. 1. The computing device 200 may be in the form of a computing system including multiple computing devices or in the form of a single computing device, such as, for example, a mobile phone, a tablet computer, a laptop computer, a notebook computer, a desktop computer, or the like.
[0027] CPU 202 in computing device 200 may be a central processing unit. Alternatively, CPU 202 may be any other type of device or devices, now existing or later developed, that can manipulate or process information. Although the disclosed embodiments may be implemented with a single processor, such as CPU 202, as shown, multiple processors may be used to achieve advantages of speed and efficiency.
[0028] The memory 204 in the computing device 200 may be a read-only memory (ROM) device or a random access memory (RAM) device in an embodiment. Any other suitable type of storage device may be used as the memory 204. The memory 204 may include code and data 206 that the CPU 202 accesses using the bus 212. The memory 204 may include an operating system 208 and applications. The computing device 200 may further include a secondary storage 214, which may be, for example, a memory card used with a computing device 200 that is mobile. Because video communication sessions may include a significant amount of information, they may be stored in whole or in part in the secondary storage 214 and loaded into the memory 204 as needed for processing.
[0029] Computing device 200 may also include one or more output devices, such as a display 218. Display 218 may, in one example, be a touch-sensitive display that combines a display with a touch-sensitive element operable to sense touch input. Display 218 may be connected to CPU 202 via bus 212. Other output devices that enable a user to program or otherwise use computing device 200 may be provided in addition to or instead of display 218. When an output device is or includes a display, the display may be implemented in a variety of ways, including a liquid crystal display (LCD), a cathode ray tube (CRT) display, or a light emitting diode (LED) display, such as an organic LED (OLED) display.
[0030] Computing device 200 may include or communicate with imaging device 220, such as a camera, or any other imaging device 220 developed now or in the future, that can detect images, such as an image of a user operating computing device 200. Imaging device 220 may be positioned to be pointed toward a user operating computing device 200. In one example, the position and optical axis of imaging device 220 may be configured such that the field of view includes the area immediately adjacent to display 218 from which display 218 is viewable.
[0031] Computing device 200 may include or communicate with a voice sensing device 222, such as, for example, a microphone, or any other voice sensing device now or later developed, that can sense sounds near computing device 200. Voice sensing device 222 may be pointed towards a user operating computing device 200 and configured to receive, for example, voice, other utterances made by the user while the user is operating computing device 200.
[0032] 2 shows the CPU 202 and memory 204 of computing device 200 integrated into a single unit, other configurations may be utilized. The operations of CPU 202 may be distributed across multiple machines (each machine having one or more processors) that may be connected directly or through a local area network or other network. Memory 204 may be distributed across multiple machines, such as a network-based memory, or may be memory in multiple machines that perform the operations of computing device 200. Although shown herein as a single bus, bus 212 of computing device 200 may be comprised of multiple buses. Additionally, secondary storage 214 may be directly connected to other components of computing device 200 or may be accessed over a network. The computing device 200 may be implemented in a wide variety of configurations, and may include a single integrated unit, such as a memory card, or multiple units, such as multiple memory cards.
[0033] FIG. 3 is a diagram of an example of a video stream 300 that is encoded and subsequently decoded. The video stream 300 includes a video sequence 302. In the next stage, the video sequence 302 includes several adjacent frames 304. Although three frames are shown as adjacent frames 304, the video sequence 302 can include any number of adjacent frames 304. The adjacent frames 304 can be further subdivided into individual frames, for example frame 306. In the next stage, the frame 306 can be divided into a series of segments 308 or planes. The segments 308 can be, for example, subsets of frames that allow parallel processing. The segments 308 can be subsets of frames that allow the video data to be separated into separate colors. For example, a frame 306 of color video data can include a luminance plane and two chrominance planes. The segments 308 can be sampled at different resolutions.
[0034] Regardless of whether the frame 306 is divided into segments 308, the frame 306 may be further subdivided into blocks 310, which may contain data corresponding to, for example, 16x16 pixels within the frame 306. The blocks 310 are configured to contain data from the pixel data of one or more segments 308. The blocks 310 may be any other suitable size, such as 4x4 pixels, 8x8 pixels, 16x8 pixels, 8x16 pixels, 16x16 pixels, or more.
[0035] 4 is a block diagram of an encoder 400 according to an embodiment of the present disclosure. The encoder 400 may be implemented within the transmitting station 102 as described above, for example, by providing a computer software program stored in a memory, such as the memory 204. The computer software program may include machine instructions that, when executed by a processor, such as the CPU 202, cause the transmitting station 102 to encode video data in the manner described herein. The encoder 400 may also be implemented as dedicated hardware included in the transmitting station 102, for example. The encoder 400 has an intra-prediction / inter-prediction stage 402, a transform stage 404, a quantization stage 406, and an entropy coding stage 408 that use the video stream 300 as input and perform various functions in a forward path (shown by solid connecting lines) to generate an encoded or compressed bitstream 420. The encoder 400 also includes a reconstruction path (shown by dotted connecting lines) that reconstructs frames for encoding of future blocks. 4, the encoder 400 has the following stages that perform various functions in the reconstruction path: an inverse quantization stage 410, an inverse transform stage 412, a reconstruction stage 414, and a loop filtering stage 416. Other structural variations of the encoder 400 can be used to encode the video stream 300.
[0036] When the video stream 300 is presented for encoding, the frames 306 may be processed in units of blocks. In the intra / inter prediction stage 402, the blocks may be encoded using intra-frame prediction (also called intra-prediction) or inter-frame prediction (also called inter-prediction), or a combination of both. In either case, a predictive block may be formed. In the case of intra-prediction, all or part of the predictive block may be formed from samples in a current frame that have been previously encoded and reconstructed. In the case of inter-prediction, all or part of the predictive block may be formed from samples in one or more previously constructed reference frames determined using motion vectors.
[0037] Next, still referring to FIG. 4, the prediction block is subtracted from the current block in the intra / inter prediction stage 402 to generate a residual block (also called a residual). The transform stage 404 transforms the residual into transform coefficients, for example, in the frequency domain, using a block-based transform. Such block-based transforms include, for example, the Discrete Cosine Transform (DCT) and the Asymmetric Discrete Sine Transform (ADST). Other block-based transforms are possible. Furthermore, a combination of different transforms can be applied to a single residual. In one example of applying a transform, the DCT transforms the residual block into the frequency domain, where the transform coefficient values are based on spatial frequency: the lowest frequency (DC) coefficient in the top left of the matrix, and the highest frequency coefficient in the bottom right of the matrix. It is worth noting that the size of the prediction block, and therefore the resulting residual block, may differ from the size of the transform block. For example, the prediction block may be divided into small blocks to which separate transforms are applied.
[0038] The quantization stage 406 converts the transform coefficients into discrete quantum values, called quantized transform coefficients, using a quantization value or quantization level. For example, the transform coefficients may be divided by the quantization value and truncated. The quantized transform coefficients are then entropy coded by the entropy coding stage 408. Entropy coding may be performed using any number of techniques, including token trees and binary trees. The entropy coded coefficients, along with other information used to decode the block, which may include, for example, the type of prediction used, the transform type, motion vectors, and quantization values, are output to a compressed bitstream 420. The information for decoding the block may be entropy coded into block, frame, slice, and / or section headers in the compressed bitstream 420. The compressed bitstream 420 may also be referred to as a coded video stream or coded video bitstream, and these terms are used interchangeably herein.
[0039] To ensure that both the encoder 400 and the decoder 500 (described below) use the same reference frame to decode the compressed bitstream 420, a reconstruction path (indicated by the dotted connecting line) in FIG. 4 is used. The reconstruction path performs functions similar to those performed during the decoding process described in more detail below, including inverse quantization of the quantized transform coefficients in the inverse quantization stage 410 and inverse transforming the inverse quantized transform coefficients in the inverse transform stage 412 to generate a differential residual block (also referred to as a differential residual). In the reconstruction stage 414, a predictive block predicted in the intra / inter prediction stage 402 is added to the differential residual to create a reconstructed block. To reduce distortions such as blocking artifacts, a loop filtering stage 416 is applied to the reconstructed block.
[0040] Other variations of the encoder 400 can be used to encode the compressed bitstream 420. For example, a non-transform-based encoder 400 can directly quantize the residual signal for a block or frame without using a transform stage 404. In another embodiment, the encoder 400 can combine the quantization stage 406 and the inverse quantization stage 410 into a single stage.
[0041] 5 is a block diagram of a decoder 500 according to an embodiment of the present disclosure. The decoder 500 may be implemented in the receiving station 106, for example, by providing a computer software program stored in the memory 204. The computer software program includes machine instructions that, when executed by a processor such as the CPU 202, cause the receiving station 106 to decode video data in the manner described below in FIGS. 8 and 9. The decoder 500 may be implemented in hardware included in the transmitting station 102 or the receiving station 106, for example. Similar to the reconstruction path of the encoder 400 described above, the decoder 500 includes, in one example, the following stages for performing various functions to generate an output video stream 516 from the compressed bitstream 420: an entropy decoding stage 502, an inverse quantization stage 504, an inverse transform stage 506, an intra / inter prediction stage 508, a reconstruction stage 510, a loop filtering stage 512, and a deblocking filtering stage 514. Other structural variations of the decoder 500 can be used to decode the compressed bitstream 420.
[0042] When the compressed bitstream 420 is presented for decoding, data elements in the compressed bitstream 420 are decoded by an entropy decoding stage 502 to generate a set of quantized transform coefficients. An inverse quantization stage 504 inverse quantizes the quantized transform coefficients (e.g., by multiplying the quantized transform coefficients by a quantization value), and an inverse transform stage 506 inverse transforms the inverse quantized transform coefficients using a selected transform type to generate a differential residual that is identical to that generated by the inverse transform stage 412 in the encoder 400. Using the header information decoded from the compressed bitstream 420, the decoder 500 creates a prediction block, using an intra / inter prediction stage 508, that is the same as that generated in the encoder 400, for example, in the intra / inter prediction stage 402. In a reconstruction stage 510, the prediction block is added to the differential residual to create a reconstructed block. A loop filtering stage 512 is applied to the reconstructed block to reduce blocking artifacts. Other filtering can be applied to the reconstructed block. In one example, a deblocking filtering stage 514 is applied to the reconstructed blocks to reduce blocking artifacts, and the result is output as an output video stream 516. The output video stream 516 is also referred to as a decoded video stream, and the terms are used interchangeably herein.
[0043] Other variations of the decoder 500 can be used to decode the compressed bitstream 420. For example, the decoder 500 can generate the output video stream 516 without a deblocking filtering stage 514. In some embodiments of the decoder 500, the deblocking filtering stage 514 is applied before the loop filtering stage 512. Additionally or alternatively, the encoder 400 includes a deblocking filtering stage in addition to the loop filtering stage 416.
[0044] FIG. 6 is a diagram 600 illustrating quantized transform coefficients according to an embodiment of the present disclosure. Diagram 600 illustrates a current block 620, a scan order 602, a quantized transform block 604, a non-zero map 606, an end-of-block map 622, and a sign map 626. The current block 620 is illustrated as a 4x4 block. However, any block size is possible. For example, the current block may have a size (i.e., dimensions) of 4x4, 8x8, 16x8, 8x16, 32x32, or any other square or rectangular block size. The current block 620 may be a block of the current frame. In another example, the current frame may be divided into segments (such as segment 308 of FIG. 3), tiles, or the like, which include a collection of blocks, and the current block is a block of the partition.
[0045] The quantized transform block 604 may be a block of a size similar to the size of the current block 620. The quantized transform block 604 includes non-zero coefficients (e.g., coefficient 608) and zero coefficients (e.g., coefficient 610). As described above, the quantized transform block 604 is a quantized representation of the residual block that corresponds to the current block 620. 4. Also, as described above, the quantized transform coefficients are entropy coded by an entropy coding phase, such as entropy coding stage 408 of FIG.
[0046] Entropy coding the quantized transform coefficients may include selecting a context model (also referred to as a probability context model, probability model, model, and context) that provides an estimate of a conditional probability for coding a binary symbol of the binarized transform coefficient, as described below with respect to FIG. 7. When entropy coding the quantized transform coefficients, additional information may be used as context for selecting the context model. For example, the magnitude of previously coded transform coefficients may be used at least in part to determine the probability model.
[0047] To code a transform block, a video coding system may traverse the transform block in a scan order and code (e.g., entropy code) the quantized transform coefficients as they are individually traversed (i.e., accessed). In a zigzag scan order, such as scan order 602, the top left corner of the transform block (also called the DC coefficient) is traversed and coded first, and then the next coefficient in the scan order (i.e., the transform coefficient corresponding to the position labeled "1") is traversed and coded. In a zigzag scan order (i.e., scan order 602), the several quantized transform coefficients above and to the left of the current quantized transform coefficient (e.g., the transform coefficient to be coded) are traversed first. Other scan orders are possible. A one-dimensional structure (e.g., an array) of quantized transform coefficients may result from traversing a two-dimensional quantized transform block using the scan order.
[0048] Encoding the quantized transform block 604 may include determining a non-zero map 606 that indicates which quantized transform coefficients of the quantized transform block 604 are zero and which are non-zero. Non-zero and zero coefficients may be indicated in the non-zero map by values one and zero (0), respectively. For example, the non-zero map 606 includes a non-zero 607 at Cartesian location (0,0) that corresponds to coefficient 608 and a zero 608 at Cartesian location (2,0) that corresponds to coefficient 610.
[0049] Encoding the quantized transform block 604 may include generating an end of block map 622 and encoding the end of block map 622. The end of block map indicates whether a non-zero quantized transform coefficient of the quantized transform block 604 is the last non-zero coefficient with respect to any scan order. If a non-zero coefficient is not the last non-zero coefficient in the transform block, it may be indicated by a binary bit 0 (zero) in the end of block map. On the other hand, if a non-zero coefficient is the last non-zero coefficient in the transform block, it may be indicated by a binary value 1 in the end of block map. For example, since the quantized transform coefficient corresponding to scan position 11 (i.e., the last non-zero quantized transform coefficient 628) is the last non-zero coefficient of the quantized transform block 604, it is indicated by an end of block value 624 of 1, and all other non-zero transform coefficients are indicated by zero.
[0050] Encoding the quantized transform block 604 may include generating a sign map 626 and encoding the sign map 626. The sign map 626 indicates which non-zero quantized transform coefficients of the quantized transform block 604 have positive values and which non-zero quantized transform coefficients have negative values. Zero transform coefficients need not be indicated in the sign map. The sign map 626 illustrates a sign map for the quantized transform block 604. In the sign map 626, negative quantized In this example, positive quantized transform coefficients may be denoted by zero (0) and positive quantized transform coefficients may be denoted by one (1).
[0051] As mentioned above, some coding systems may use an interleaving technique to encode and / or decode the EOB position of the last non-zero quantized transform coefficient 628. One example of an interleaving technique is as follows:
[0052] In an interleaving technique, a flag (such as syntax element sig_coef_flag) may be used to indicate whether a coefficient being coded or decoded is significant or not. For transform coefficients, the syntax element sig_coef_flag answers the question of whether the transform coefficient is zero or non-zero. For example, if the syntax element sig_coef_flag is zero (0), the current transform coefficient is zero, and if sig_coef_flag is 1, the current transform coefficient is non-zero.
[0053] In an interleaving approach, another flag may be a syntax element called last_sig_flag that indicates whether the coefficient being coded (i.e., encoded or decoded) is the last significant coefficient of a transform block given a scan order, such as scan order 602. For non-zero transform coefficients, the syntax element last_sig_flag answers the question of whether the transform coefficient is the last non-zero coefficient. A value of zero (0) indicates that the transform coefficient is not the last non-zero coefficient, and a value of one indicates that the transform coefficient is the last non-zero coefficient. The syntax element last_sig_flag may be coded and decoded for each significant coefficient of a transform block.
[0054] Thus, when a syntax element sig_coef_flag indicating that the current coefficient is non-zero (i.e., sig_coef_flag with a value of 1) is coded or decoded, the corresponding syntax element last_sig_flag indicates whether the current non-zero coefficient is the last significant coefficient in the current block (e.g., last_sig_flag=1) or not (e.g., last_sig_flag=0). Thus, when a set flag last_sig_flag (e.g., last_sig_flag=1) is coded or decoded, the EOB position of the current block is determined.
[0055] The interleaving approach for coding the EOB position in an NxN transform block can be summarized as follows. In step 1, initialize scan position i to zero (i=0). Scan position i corresponds to a scan order position. In step 2, encode / decode the syntax element sig_coef_flag at scan order position i. In step 3, determine whether the syntax element sig_coef_flag is set (e.g., sig_coef_flag=1), and if so, encode / decode the syntax element last_sig_flag at scan order position i. In step 4, increment i (i=i+1). Then, repeat steps 2-4 until the EOB position is encoded / decoded (i.e., last_sig_flag=1) or the end of the block is reached (i.e., i reaches the value N*N). In step 3, if the end of the block is reached (i.e., i=N*N-1), the syntax element last_sig_flag at position i is not encoded / decoded. In such cases, the last coefficient of the transform block (ie, the transform coefficient in the last scan order position) is assumed to be the EOB.
[0056] In a variation of the above scheme, the syntax element last_sig_flag indicates that all remaining coefficients in the current block, including the one at the current position, are zero. The syntax element eob_flag can be replaced by eob_flag. In that case, the syntax element eob_flag is coded (encoded / decoded) immediately after the set sig_coef_flag, i.e. if sig_coef_flag is set at position i, the eob flag is coded at position i+1.
[0057] Another example of a coding system using an interleaving technique is shown with respect to Figure 7. In the example of Figure 7, a coefficient binary tree is used. 7 is a diagram of a coefficient token tree 700 that can be used to entropy code a transform block, according to an embodiment of this disclosure. The coefficient token tree 700 is referred to as a binary tree because at each node of the tree, one of two branches must be taken (i.e., traversed). The coefficient token tree 700 includes a root node 701 and a node 703 that correspond to the nodes labeled A and B, respectively.
[0058] 6, when an end-of-block (EOB) token is detected for a block, the coding of the coefficients of the current block ends and the remaining coefficients in the block are presumed to be zero. For this reason, coding of the EOB position becomes an important part of the coding of coefficients in a video coding system.
[0059] The coefficient token tree 700 is used to generate a binary sequence for the quantized coefficients (eg, coefficients 608, 610 in FIG. 6) of a quantized transform block (eg, quantized transform block 604 in FIG. 6).
[0060] In one example, the quantized coefficients within an N×N block (e.g., the quantized transform block 604) are arranged into a 1D (one-dimensional) array (here, array u) according to a predetermined scan order (e.g., the scan order 602 of FIG. 6). N can be 4, 8, 16, 32, or any other value. The quantized coefficient at the i-th position of the 1D array is referred to as u[i]. Here, i = 0, …, N*N−1. The starting position of the last consecutive zeros in u[i], …, u[N*N−1] can be represented as eob. If the last position of the 1D array (i.e., u[N*N−1]) is not zero, eob can be set to the value N*N. That is, if the last coefficient of the 1D array u is not zero, eob can be set to the last position of the 1D array (i.e., eob is set to the value N*N). Using the example of FIG. 6, the 1D array u can have the following entries u[] = [−6, 0, −1, 0, 2, 4, 1, 0, 0, 1, 0, −1, 0, 0, 0, 0]. The value at each of u[i] is a quantized transform coefficient. In this specification, the quantized transform coefficients of the 1D array u may also be simply referred to as “coefficients” or “transform coefficients”. The coefficient at position i = 0 (i.e., u[0] = −6) corresponds to the DC coefficient. In the example of FIG. 6, since there are no non-zero coefficients after the zero coefficient at position 12 of the 1D array u, eob is equal to 12.
[0061] To encode and decode the coefficients u[i], …, u[N*N−1] for i = 0 to N*N−1, tokens t[i] are generated at each position i <= eob. For i < eob, the token t[i] can indicate the size and / or size range of the corresponding quantized transform coefficient in u[i]. The token for the quantized transform coefficient at eob can be EOB_TOKEN. EOB_TOKEN is a token indicating that the 1D array u does not (inclusively) contain non-zero coefficients following the eob position. That is, t[eob] = EOB_TOKEN indicates the EOB position of the current block. Table I below provides examples of token values excluding EOB_TOKEN, and a list of their values and corresponding names according to embodiments of the present disclosure.
[0062] [Table 1] In one example, the quantized coefficient values are considered to be signed 12-bit integers. To represent the quantized coefficient values, the 12-bit signed value range may be divided into 11 tokens (tokens 0-10 in Table I) and an end-of-block token (EOB_TOKEN). To generate the tokens to represent the quantized coefficient values, the coefficient token tree 700 may be traversed. The results of traversing the tree (i.e., a string of bits) may be encoded into a bitstream (such as bitstream 420 of FIG. 4) by an encoder as described with respect to entropy encoding stage 408 of FIG. 4.
[0063] The coefficient token tree 700 includes the following tokens: EOB_TOKEN (token 702), ZERO_TOKEN (token 704), ONE_TOKEN (token 706), TWO_TOKEN (token 708), THREE_TOKEN (token 710), FOUR_TOKEN (token 712), CAT1 (token 714 which is DCT_VAL_CAT1 from Table I), CAT2 (token 716 which is DCT_VAL_CAT2 from Table I), CAT3 (token 718 which is DCT_VAL_CAT3 from Table I), CAT4 (token 720 which is DCT_VAL_CAT4 from Table I), CAT5 (token 722 which is DCT_VAL_CAT5 from Table I), and CAT6 (token 724 which is DCT_VAL_CAT6 from Table I). As can be seen above, the coefficient token tree maps a single quantized coefficient value to a single token, such as one of tokens 704, 706, 708, 710, and 712. Other tokens, such as tokens 714, 716, 718, 720, 722, and 724, represent ranges of quantized coefficient values. For example, a quantized transform coefficient having a value of 37 may be represented by the token DCT_VAL_CAT5 (token 722 in FIG. 7).
[0064] The base value for a token is defined as the minimum value of its range. For example, the base value of token 720 is 19. Entropy coding can identify a token for each quantized coefficient and, if the token represents a range, form a residual by subtracting the base value from the quantized coefficient. For example, a quantized transform coefficient having a value of 20 is represented in the encoded video bitstream by a residual value of 1 (i.e., 20 minus 19) by being included in token 720 so that a decoder can reconstruct the original quantized transform coefficient. The end of block token (i.e., token 702) signals that no more nonzero quantized coefficients remain in the transformed block data.
[0065] The coefficient token tree 700 can be used to encode or decode the token t[i] by using a binary arithmetic coding engine (such as by the entropy coding stage 408 of FIG. 4). The coefficient token tree 700 is traversed starting from the root node 701 (i.e., the node labeled A). Traversing the coefficient token tree produces a bit string (a codeword) that is encoded into a bitstream, for example, using binary arithmetic coding. The bit string is a representation of the current coefficient (i.e., the quantized transform coefficient being coded).
[0066] If the current coefficient is zero and there are no non-zero values in the remaining transform coefficients, then a token 702 (i.e., EOB_TOKEN) is added to the bitstream. This is the case, for example, for the transform coefficient at position 11 in the scan order of FIG. 6. On the other hand, if the current coefficient is non-zero or if there are non-zero values in the remaining coefficients of the current block, then a "1" bit is added to the codeword and the traversal proceeds to node 703 (i.e., the node labeled B). At node B, the current coefficient is tested to see if it is equal to zero. If the current coefficient is equal to zero, then the left branch is taken and a token 704 representing the value ZERO_TOKEN and a bit "0" is added to the codeword. If the current coefficient is not equal to zero, then a bit "1" is added to the codeword and the traversal proceeds through node C. At node C, the current coefficient is tested to see if it is greater than one. If the current coefficient is equal to 1, the left branch is taken and a token 706 representing the value ONE_TOKEN is added to the bitstream (i.e., a "0" bit is added to the codeword). If the current coefficient is greater than 1, the traversal proceeds to node D to check the value of the current coefficient against the value 4. If the current coefficient is less than or equal to 4, the traversal proceeds to node E and a "0" bit is added to the codeword. At node E a test may be made for equality to the value "2". If true, a token 706 representing the value "2" is added to the bitstream (i.e., a bit "0" is added to the codeword). If not true, at node F it is tested whether the current coefficient is value "3" or value "4", and whether token 710 (i.e., a bit "0" is added to the codeword) or token 712 (i.e., a bit "1" is added to the codeword) as appropriate for the bitstream, etc.
[0067] Essentially, a "0" bit is added to the codeword when traversing to the left child node, and a "1" bit is added to the codeword when traversing to the right child node. A similar process is performed by the decoder when decoding a codeword from a compressed bitstream. The decoder reads a bit from the bitstream. If the bit is a "1", the coefficient token tree is traversed to the right, and if the bit is a "0", the tree is traversed to the left. The decoder reads the next bit and repeats the process until the traversal of the tree reaches a leaf node (i.e., a token). As an example, to encode token t[i]=THREE_TOKEN, starting from the root node (i.e., root node 701), the binary string 111010 is encoded. As another example, decoding the codeword 11100 produces the token TWO_TOKEN.
[0068] It should be noted that the correspondence between "0" and "1" bits to left and right child nodes is merely a convention used to describe the encoding and decoding process. In some embodiments, a different convention can be used, such as, for example, a convention where "1" corresponds to a left child node and "0" corresponds to a right child node. As long as both the encoder and decoder implement the same convention, the process described herein applies.
[0069] Because an EOB_TOKEN is only possible after a non-zero coefficient, if u[i-1] is zero (i.e., the quantized transform coefficient at position i-1 of the 1D array u is equal to zero), the decoder can infer that the first bit must be 1. When traversing the tree, for a transform coefficient (e.g., a transform coefficient at position 2 in the zigzag scan order of FIG. 6) that follows a zero transform coefficient (e.g., a transform coefficient at position 1 in the zigzag scan order of FIG. 6), the first bit must be 1 because the traversal necessarily moves from the root node 701 to node 703.
[0070] Therefore, the binary flag checkEob can be used to instruct the encoder and decoder to skip encoding and decoding of the first bit starting from the root node in the coefficient token tree 700. In practice, if the binary flag checkEob is 0 (i.e., indicating that the root node should not be checked), the root node 701 of the coefficient token tree 700 is skipped and node 703 is the first node of the coefficient token tree 700 accessed for traversal. That is, when the root node 701 is skipped, the encoder can skip encoding and the decoder can skip decoding to infer the first bit (i.e., the binary bit "1") of the encoded string.
[0071] At the start of encoding or decoding a block, a binary flag checkEob can be initialized to 1 (i.e., indicating that the root node needs to be checked). The following steps show an example of a process for decoding quantized transform coefficients in an NxN block.
[0072] In step 1, the binary flag checkEob is set to zero (ie, checkEob=0) and the index is also set to zero (ie, i=0). In step 2, token t[i] is 1) use the entire coefficient token tree (i.e., starting from the root node 701 of the coefficient token tree 700) if the binary flag checkEob is equal to 1, or 2) If checkEob is equal to 0, then the EOB_TOKEN is decrypted either by using a skipped subtree (eg, starting from node 703).
[0073] In step 3, if token t[i]=EOB_TOKEN, then the quantized transform coefficients u[i],....,u[N*N-1] are set to all 0 and the decoding process terminates. Otherwise, additional bits are decoded as necessary (i.e., if t[i] is not equal to ZERO_TOKEN) to reconstruct u[i].
[0074] In step 4, if u[i] is equal to zero, then the binary flag checkEob is set to 1, otherwise checkEob is set to 0. That is, checkEob can be set to the value (u[i] != 0).
[0075] In step 5, the index i is incremented (ie, i=i+1). In step 6, steps 2 to 5 are repeated until all quantized transform coefficients are decoded (ie, until index i=N*N) or until the EOB_TOKEN is decoded.
[0076] In step 2 above, decoding the token t[i] may include determining a context ctx, determining a binary probability distribution (i.e., a model) from the context ctx, and decoding a path from the root node to a leaf node of the coefficient token tree 700 using a Boolean arithmetic code by using the determined probability distribution. The context ctx may be determined using a method of context derivation. The method of text derivation may use one or more of the block size, plane type (i.e., luma or chroma), position i, and previously decoded tokens t[0],...,t[i-1] to determine the context ctx. Other criteria may be used to determine the context ctx. A binary probability distribution may be determined for any internal node of the coefficient token tree 700, starting from the root node 701 if checkEOB=1, or from node 703 if checkEOB=0.
[0077] In some coding systems, the probability used to encode or decode a token t[i] given a context ctx may be fixed and not adaptive across pictures (i.e., frames). For example, the probability may be a default value defined for any context ctx, or the probability may be coded (i.e., signaled) as part of the frame header for that frame. When coding a frame, coding the probabilities for all contexts is costly. For this reason, the encoder may analyze, for each context, whether it is beneficial to code the probability associated with the context in the frame header and signal the decision to the decoder using a binary flag. Furthermore, coding the probabilities for a context may use prediction to reduce the cost (e.g., in bitrate). The prediction may be derived from the probability of the same context in a previously decoded frame. In some coding systems, the probability given a context ctx may be adapted across pictures (i.e., frames) when a new symbol is decoded or coded. Various adaptation methods may be used. Examples of adaptive methods include Laplace estimators, Krichevsky-Trofimov estimators, Good-Turing estimators, IIR (Infinite Impulse Response) filter-based estimators, and finite state machine-based estimators.
[0078] FIG. 8 is a diagram of an example of a tree 800 for binarizing an EOB position, according to an embodiment of the present disclosure. The tree 800 can be used by a coding system implementing a Cartesian coordinate approach to coding the EOB position. In the Cartesian coordinate approach, the EOB position can be coded as a block position. Thus, unlike the interleaving approach described above, the coding of the EOB position is independent of the scan order. Since the size of the current block is NxN, according to the scan order of the current block, the last significant coefficient is at block position (eob_x, eob_y), where eob_x indicates the column number and eob_y indicates the row number. For example, referring to FIG. 6, the last non-zero quantized transform coefficient 628 is at block position (2, 2). In the interleaving approach, once the EOB block position (eob_x, eob_y) is identified, the coding of the column number eob_x and row number eob_y is independent of any scan order used with respect to other aspects of the coding process.
[0079] The tree 800 can be used by a video coding system that employs steps of binarization, context modeling, and binary arithmetic coding for encoding and decoding of quantized transform coefficients. This process may be referred to as context-adaptive binary arithmetic coding (CABAC). For example, to encode a quantized transform coefficient x, the coding system may perform the following steps: The quantized transform coefficient x may be any coefficient (e.g., coefficient 608) of the quantized transform block 604 of FIG. 6.
[0080] The following steps are performed for both column number eob_x and row number eob_y in the same way. For simplicity, only the steps for column number eob_x are described. .
[0081] In the binarization step, a column number eob_x of the EOB coefficients is first binarized into a binary string using tree 800. The binary tree 800 is traversed to generate a binary string prefix corresponding to the column number eob_x. For example, if the column number eob_x is 3, the prefix generated by traversing the binary tree 800 is 1110, which corresponds to node 802. As another example, if the column number eob_x is 4 or 5, the prefix generated is 11110, which corresponds to node 804. For node 804, a suffix is also generated to indicate whether the column number eob_x is 4 (i.e., a suffix of 0) or 5 (i.e., a suffix of 1). Thus, if the column number eob_x is 4, the binary string 111100 is coded, and if the column number eob_x is 5, the binary string 111101 is coded.
[0082] In the context derivation step, a context is derived for each bin to be coded. The context may be derived from information such as the block size, the plane type (i.e., luma or chroma), the block position of the coefficient x, and one or more of previously decoded coefficients (e.g., neighboring coefficients to the left and / or above, if possible). Other, more, or less information may be used to derive the context.
[0083] In the binary arithmetic coding step, given a context, the bins are coded into binary codewords along with probability values associated with the context, for example by using a binary arithmetic coding engine.
[0084] As mentioned above, the Cartesian coordinate method and the interleaving method use different methods for coding the EOB position. The Cartesian coordinate method codes the block position (eob_x, eob_y) directly. The interleaving method interleaves the coding of last_sig_flag (indicating whether the significant coefficient is the last significant coefficient) with sig_flag_coding (indicating whether the coefficient is a significant coefficient or not).
[0085] The interleaving approach is more efficient when the transform block is sparse with relatively few non-zero coefficients. For example, if the transform block contains only one non-zero coefficient at block position (4, 5), the interleaving approach will correctly code and decode one last_sig_flag. On the other hand, the Cartesian coordinate approach will code and decode 12 bins (i.e., binary decisions). The 12 bins correspond to the coding of the binary sequences 111100 (i.e., eob_x=4) and 111101 (i.e., eob_y=5), as described with respect to FIG. 8 above.
[0086] On the other hand, if a block contains a relatively large number of non-zero coefficients, the Cartesian coordinate approach is more efficient. For example, in the maximum case (i.e., when all coefficients of the block are non-zero), for a 16x16 block, the number of last_sig_flags coded using the interleaving approach is 255. On the other hand, by using the Cartesian coordinate approach, the number of bins coded for the eob position in the 16x16 block is the number of bins corresponding to block position (15,14) or (14,15). Note that, as mentioned above, when the EOB is at (15,15), there is no need to code last_sig_flag. The values 14 and 15 are binarized using the tree 800 into prefix sequence 11111110 and suffixes 10 and 11, or binary sequences 1111111010 and 1111111011, respectively. This results in a total of 20 bins being coded. Thus, in the maximum case, the Cartesian coordinate approach is The coordinate approach is computationally less intensive than the interleaving approach.
[0087] 9 is a flow chart diagram of a process 900 for encoding the position of the last non-zero coefficient of a transform block of coefficients according to an embodiment of the present disclosure. The process 900 may encode the coefficients of the transform block according to the scan order. Alternatively, the process 900 may be called by or embedded in another process that encodes the coefficients of the transform block. The process 900 encodes information about the EOB position.
[0088] Process 900 may be implemented in an encoder, such as encoder 400 of Figure 4. Process 900 may be implemented as a software program that may be executed by a computing device, such as, for example, transmitting station 102. The software program may include machine-readable instructions stored in a memory, such as memory 204 or secondary storage 214, that, when executed by a processor, such as CPU 202, causes the computing device to perform process 900. In at least some embodiments, process 900 is performed in whole or in part by entropy encoding stage 408 of encoder 400 of Figure 4.
[0089] The process 900 is described with reference to Figure 10. Figure 10 is an example of a scan order 1000 and a block 1050 according to an embodiment of the present disclosure. The block 1050 is a block of quantized transform coefficients.
[0090] Scan order 1000 is as described with respect to scan order 602 of Figure 6. For example, scan index 1002 indicates that coefficient 1052 of block 1050 (i.e., the coefficient at location (6,0)) is at scan index value 21, scan index 1004 indicates that coefficient 1054 of block 1050 (i.e., the coefficient at location (2,2)) is at scan index value 12, and scan index 1006 indicates that coefficient 1056 of block 1050 (i.e., the coefficient at location (6,2)) is at scan index value 37. Coefficient 1056 is the last non-zero coefficient of block 1050 given scan order 1000. That is, the coefficient corresponding to scan index 1006 (i.e., scan index value 37) is the last non-zero coefficient.
[0091] At 902, the process 900 determines the location of the last non-zero coefficient. As used in this disclosure, "determine" means to select, construct, determine, specify, identify, receive, or make any other decision in any manner. The location of the last non-zero coefficient is as described above with respect to block position (eob_x, eob_y). Thus, the location includes a column value (e.g., eob_x indicating the column number of the EOB coefficient). The location includes a row value (e.g., eob_y indicating the row number of the EOB coefficient). As used herein, the column value and the column number are used interchangeably. The row value and the row number are used interchangeably.
[0092] In one example, the process 900 may scan coefficients of a block (e.g., block 1050) according to a scan order (e.g., scan order 1000) to determine the last nonzero coefficient. Once the last nonzero coefficient is identified, the location of the last nonzero coefficient is determined. In another example, the process 900 may determine the location of the last nonzero coefficient by receiving the location from another module, coding stage, process, etc.
[0093] At 904, the process 900 encodes non-zero coefficients of a transform block of coefficients. The non-zero coefficients are present in coefficient columns and coefficient rows of the transform block. 00 may simply receive the coefficient column and the coefficient row without encoding the non-zero coefficients. "Receive" may mean to generate, determine, or receive in any manner. For example, after or before a coefficient (e.g., the coefficient at scan order value 23) is encoded, process 900 receives a coefficient column (i.e., 4) and a coefficient row (i.e., 2).
[0094] At 906 (further described below with respect to sequence 1118-1126 of FIG. 11), in response to determining that the nonzero coefficient is the first nonzero coefficient to be coded in the coefficient sequence, the process 900 codes whether the coefficient sequence is equal to the sequence value of the last nonzero coefficient. At 908 (further described below with respect to block 1118 of FIG. 11), in response to determining that the nonzero coefficient is not the first nonzero coefficient to be coded in the coefficient sequence, the process 900 skips coding whether the coefficient sequence is equal to the sequence value of the last nonzero coefficient.
[0095] At 910 (further described below with respect to sequence 1128-1136 of FIG. 11), in response to determining that the nonzero coefficient is the first nonzero coefficient to be coded in the coefficient row, the process 900 codes whether the coefficient row is equal to the row value of the last nonzero coefficient. At 912 (further described below with respect to block 1128 of FIG. 11), in response to determining that the nonzero coefficient is not the first nonzero coefficient to be coded in the coefficient row, the process 900 skips coding whether the coefficient row is equal to the row value of the last nonzero coefficient.
[0096] In one example of the process 900, the transform block of coefficients is a transform block of a residual block predicted using intra prediction, i.e., the process 900 can be used for intra predicted blocks but not for inter predicted blocks. In one example, the transform block of coefficients is a transform block of a block of luma color components, i.e., the process can be used for luma blocks but not for chroma. In one example, the process 900 can be used with one block size but not with another block size. For example, the process 900 can be used for a transform block of size 4x4 but not for a transform block of a larger size.
[0097] Other embodiments are available that refine the coding of the last significant coefficient flag as shown in Figure 9. Embodiments may add additional elements, combine certain elements, and / or remove certain elements that refine the coding of the last significant coefficient flag.
[0098] 11 is a flow chart diagram of a process 1100 for coding the position of the last non-zero coefficient of a transform block of coefficients using a Cartesian coordinate system according to one embodiment of the present disclosure. The process 1100 codes (i.e., encodes or decodes) only once whether a column containing a non-zero transform coefficient is the column containing the last non-zero coefficient. The process 1100 codes (i.e., encodes or decodes) only once whether a row containing a non-zero transform coefficient is the row containing the last non-zero coefficient. The process 1100 can be used by or in combination with a process for coding coefficients of a transform block according to a scan order.
[0099] The Cartesian coordinate system of the process 1100 may have an origin at the DC coefficient of a transform block. The dimensions of the Cartesian coordinate system are rows and columns. The transform coefficients of a transform block are arranged along row and column values. For example, in transform block 1050, the rows have row values 0-7 and the columns have values 0-7. Coefficient 1054 is at column value 2 and row value 2. There is. The location of the last nonzero coefficient (e.g., coefficient 1056 in FIG. 10) includes a column value (e.g., column value 6) and a row value (e.g., row value 2). As noted above, the last nonzero coefficient may be determined with respect to the scan order. That is, if the coefficients of the transform block 1050 are scanned according to the scan order 1000, then coefficient 1056 is the last nonzero coefficient. For example, if a scan order other than the scan order 1000 is used, then a different coefficient (i.e., other than coefficient 1056) may be identified as the last nonzero coefficient.
[0100] Process 1100 may be implemented in an encoder, such as encoder 400 of Figure 4. Process 1100 may be implemented as a software program that may be executed by a computing device, such as transmitting station 102, for example. The software program may include machine-readable instructions stored in a memory, such as memory 204 or secondary storage 214, that are executed by a processor, such as CPU 202, to cause the computing device to perform process 1100. In at least some embodiments, process 1100 is performed in whole or in part by entropy encoding stage 408 of encoder 400 of Figure 4.
[0101] The process 1100 may be implemented in a decoder, such as the decoder 500 of FIG. 5. The process 1100 may be implemented as a software program that may be executed by a computing device, such as the receiving station 106, for example. The software program may include machine-readable instructions stored in a memory, such as the memory 204 or the secondary storage 214, that are executed by a processor, such as the CPU 202, to cause the computing device to perform the process 1100. In at least some embodiments, the process 1100 may be performed in whole or in part by the entropy decoding stage 502 of the decoder 500 of FIG. 5.
[0102] When performed by an encoder, "coding" refers to encoding in an encoded bitstream, such as compressed bitstream 420 of Figure 4. When performed by a decoder, "coding" refers to decoding from an encoded bitstream, such as compressed bitstream 420 of Figure 5.
[0103] In the following description, a block of size N×N (e.g., transform block 1050) is assumed. However, the block may also be a rectangular block of size M×N (M and N are not equal). The one-dimensional array u is as described in connection with FIG. 6. Thus, u[i] denotes the transform coefficient at the i-th scan position according to an arbitrary scan order (e.g., scan order 1000 in FIG. 10). For example, u
[21] (i.e., the value of the coefficient at scan position 21 (i.e., scan index 1002)) is the coefficient value −1 (i.e., coefficient 1052).
[0104] For a scan index (i.e., a value in the scan order 1000), an array scan can provide the corresponding column and row numbers in the block 1050. Thus, scan[i] denotes a mapping from scan position i to a block position. A block position can be a tuple containing the column and row numbers of a coefficient (i.e., (ci , r i ),c i indicates the column number or value, and r i indicates a row number or row value). For example, scan
[37] could provide the tuple (6, 2). The mapping from scan index to block location can be provided by means other than a scan array. For example, a function (or similar) that takes a scan index as input could provide (e.g., return) the location of the block.
[0105] The tuple (eob_c, eob_r) indicates the block position (i.e., column and row values) of the last significant coefficient in the current block according to an arbitrary scan order. For this reason, see Figure 10. For comparison, (eob_c, eob_r) is given by the tuple (6, 2).
[0106] At 1102, the process 1100 initializes a row set R to an empty set and a column set C to an empty set. The row set R keeps track of rows (i.e., row values) that have already been accessed by the process 1100. The column set C keeps track of columns (i.e., column values) that have already been accessed by the process 1100. In this context, a visited row means that another nonzero coefficient in the same row as the current nonzero coefficient has already been determined when the current nonzero coefficient is accessed in any scan order. In this context, a visited column means that another nonzero coefficient in the same column as the current nonzero coefficient has already been determined when the current nonzero coefficient is accessed in any scan order. For example, in the scan order 1000, when scan index 1010 (i.e., scan index value 3) is processed (i.e., corresponds to coefficient 1060), it is determined that row 0 has been accessed (i.e., row set R includes row 0). This is because another non-zero coefficient (i.e., coefficient 1058 corresponding to scan index 1008) has already been determined to be in the same row (i.e., row 0), coefficients 1058 and 1060 are both in the same row 0, and coefficient 1058 is processed before coefficient 1060 in the scan order.
[0107] At 1104, the scan position i is initialized to zero, and the flags EOB_C_FOUND and EOB_R_FOUND are set to false (i.e., a value of zero). The scan position i is used as an index into the one-dimensional array u. The flag EOB_C_FOUND indicates whether a transform coefficient in the same column as the block end coefficient has been processed (i.e., accessed according to scan order). The flag EOB_R_FOUND indicates whether a transform coefficient in the same row as the block end coefficient has been processed.
[0108] At 1106, the process 1100 may set sig[i] to code whether the coefficient corresponding to the scan index u[i] is a zero or non-zero coefficient. The sig data structure (e.g., an array, a flag, etc.) indicates whether the coefficient at the scan index i is zero or not. In this example, a non-zero coefficient is indicated by a value of 1 (i.e., sig[i]=1). However, other values are possible. As described above, when implemented in an encoder, coding whether the coefficient corresponding to the scan index u[i] is zero or non-zero means outputting a syntax element (e.g., 0 or 1 bit) indicating whether the coefficient is zero or non-zero into the encoded bitstream. When implemented in a decoder, coding whether the coefficient corresponding to the scan index u[i] is zero or non-zero means reading a syntax element (e.g., 0 or 1 bit) indicating whether the coefficient is zero or non-zero from the encoded bitstream.
[0109] At 1108, if the coefficient is not a non-zero coefficient (i.e., sig[i]=1), then the process 1100 proceeds to 1110, otherwise the process 1100 proceeds to 1116. In other words, if the coefficient at scan index i is zero, then the process 1100 determines whether to process the next coefficient at 1110, otherwise the process 1100 further processes the current coefficient.
[0110] In 1110, if all coefficients of the transform block have been processed (i.e., scan position i=N*N-1) or if the current coefficient is the end of block coefficient (i.e., c i = eob_c and r i = eob_r), the process 1100 ends, otherwise the process continues at 1112. At 1112, the process 1100 increments the scan position i to process the next coefficient.
[0111] At 1116, the process 1100 calculates the column value of the transform coefficient at scan position i (i.e., c i ) and row values (i.e., r i ) is determined. The column and row values can be determined using the array scan described above. Thus, in 1116, the tuple (c i , r i ) is determined. At 1117, the process 1100 processes two branches given by sequences 1118-1126 and 1128-1136. In one example, the two branches can be processed sequentially. In another example, the two branches can be processed in parallel.
[0112] At 1118, if the last non-zero coefficient sequence has not yet been found (i.e., EOB_C_FOUND=0) and the current coefficient sequence (i.e., sequence value c i ) has not yet been accessed (i.e., column value c i is not included in column set C), the process 1100 proceeds to 1120, otherwise the sequence 1118-1126 is skipped.
[0113] At 1120, the process 1100 may code a flag LAST_EOB_C_FLAG. The flag LAST_EOB_C_FLAG indicates whether the current sequence of non-zero coefficients is the last sequence of non-zero coefficients. For example, when implemented by an encoder, the process 1100 may code a value c i = eob_c. Therefore, the Boolean value c i= eob_c. When implemented in a decoder, the process 1100 can decode a syntax element that can set the flag LAST_EOB_C_FLAG. If the current sequence of coefficients is not the same as the sequence of the last non-zero coefficient, a zero (0) can be coded, otherwise a one is coded. To repeat, as mentioned above, when implemented by an encoder, coding means encoding into a coded bitstream, and when implemented by a decoder, coding means decoding from a coded bitstream.
[0114] In 1122, column value c i column value c to indicate that i is added to column set C, and column value c i If another non-zero transform coefficient having the column value c i In one embodiment, it is possible to skip coding a separate value indicating whether contains the last non-zero transform coefficient of the block.
[0115] In 1124, column value c i If c is equal to the column value of the last nonzero coefficient (i.e., i = eob_c, or equivalently, if LAST_EOB_C_FLAG=1, then the process 1100 sets (at 1126) the flag EOB_C_FOUND to true (e.g., EOB_C_FOUND=1). When implemented by a decoder, the process 1100 at 1126 calculates the sequence value c i It may also be recorded that eob_c is the column value of the last non-zero coefficient (i.e., eob_c). The process 1100 then proceeds to 1110 upon completion of the two branches of 1117.
[0116] In sequence 1128-1136, process 1100 performs steps similar to those in branches 1118-1136. Block 1128 returns EOB_C_FOUND, column value c i , and column set C instead, EOB_R_FOUND, row value r i , and row set R are used, respectively. Block 1130 may be the same as block 1120, except that instead of coding LAST_EOB_C_FLAG, process 1100 codes a LAST_EOB_R_FLAG that indicates whether the current row of nonzero coefficients is the last row of nonzero coefficients. Block 1132 codes a column set C and column values c i Instead of a row set R and row values r i Block 1134 may be the same as block 1122, except that column value c i Instead of comparing with eob_c , row value r i Block 1136 may be the same as block 1124, except that eob_r is compared to the row value of the last non-zero coefficient, eob_r. Block 1136 may be implemented by a decoder where, instead of setting the EOB_C_FOUND flag, the EOB_R_FOUND flag is set, and the process 1100 compares the row value r i This may be the same as block 1126, except that it may record that eob_r is the row value of the last non-zero coefficient (i.e., eob_r).
[0117] The process 1100 can alternatively be described as follows. Step 1: Initialize two empty sets R and C. Additionally, initialize i=0, EOB_C_FOUND=0, and EOB_R_FOUND=0.
[0118] Step 2: (u[i]!=0), i.e., encode or decode significant_coef_flag sig[i] at scan position i. Step 3: If sig[i]=1, then (ci ,r i ) = scan[i] and do the following:
[0119] a.EOB_C_FOUND=0, and c i If \∈C, then (eob c =c i ) or not, and C = C ∪ {c i}. eob c C i If it is equal to (i.e., LAST_EOB_C_FLAG=1), set EOB_C_FOUND=1 and c Record (at the decoder).
[0120] b.EOB_R_FOUND=0, and r i If \∈R, then (eob r =r i ) or not, and R = R ∪ {r i}. eob r is i If it is equal to (i.e., LAST_EOB_R_FLAG=1), set EOB_R_FOUND=1 and r Record (at the decoder).
[0121] Step 4: Increment i by 1. Step 5: Repeat steps 2-4 until one of the following two conditions is met:
[0122] I=N*N, or eob c =c i -1, and eob r =r i -1 for both. Table 1 below shows the results of processing the non-zero coefficients of block 1050 according to scan order 1000, according to branch 1117 of process 1100. As noted above, the last non-zero coefficient given scan order 1000 is coefficient 1056.
[0123] [Table 2] Using scan order 1000, the one-dimensional array u contains the values u[0-37]={8,2,3,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,-1,2,1,0,0,0,0,0,0,0,0,0,1,1,0,0,1}. The values u[0-37] are the subset of the u array that includes up to and including the last nonzero coefficient (i.e., coefficient 1056). The values u[0-37] include 11 nonzero coefficients. As can be seen from Table 1, LAST_EOB_C_FLAG is coded 4 times and LAST_EOB_R_FLAG is coded 4 times. In contrast, a system implementing an interleaving technique codes 11 times whether a nonzero coefficient is the last nonzero coefficient. A system implementing the Cartesian coordinate approach would code 7 bins of 1111100 (ie, column value 6) and 3 bins of 110 (ie, row value 2) using context-based coding.
[0124] In one embodiment, process 1100 may skip coding the flag LAST_EOB_C_FLAG at 1120 if column set C contains N-2 elements (i.e., the cardinality |C| of column set C is equal to N-1). If column set C contains N-1 elements and process 1100 is at block 1120, it must be the case that none of the N-1 column values in column set C contains the last non-zero coefficient. Depending on the scan order, the column indexes in column set C may not necessarily be added in order. That is, depending on the scan order, larger indices may be added before smaller indices. Furthermore, since process 1100 is at 1120, it may be the case that the column value c icontains at least one nonzero coefficient (because sig[i]=1 in block 1108). Thus, it can be inferred that the current column, which is also the last remaining column outside column set C, contains the last nonzero coefficient of the block. Thus, the coding of LAST_EOB_C_FLAG can be skipped. Similarly, process 1100 can skip coding the flag LAST_EOB_R_FLAG in 1130 if row set R contains N-1 elements (i.e., the cardinality |R| of row set R is equal to N-1).
[0125] If all coefficients of an NxN block are non-zero coefficients, then the embodiment according to the present disclosure codes (encodes and / or decodes) N-1 LAST_EOB_C_FLAGs (i.e., one flag per column) and N-1 LAST_EOB_R_FLAGs (i.e., one flag per row). In contrast, the interleaving approach codes N*N-1 LAST_SIG_FLAGs (i.e., one flag per non-zero coefficient). The Cartesian coordinate approach codes 6 bins (3 bins for each column and row value) for N=4, 12 bins for N=8, 18 bins for N=16, and 24 bins for N=32. Table 2 below summarizes the maximum amount of processing (i.e., number of values) for various values of N.
[0126] [Table 3] As shown in Table 2, embodiments according to the present disclosure can improve the interleaving technique in terms of maximum throughput measured in the maximum number of bins encoded and decoded within an NxN block.
[0127] As mentioned above, Table 2 shows that the difference between the embodiment according to the present disclosure and the interleaving technique at maximum throughput increases as the block size increases. Furthermore, as mentioned above, the interleaving technique works more effectively for sparse transform blocks. Thus, the embodiment according to the present disclosure can selectively select the coding technique (i.e., between the technique disclosed herein and the interleaving technique). For example, for small blocks (e.g., 4x4 blocks), the interleaving technique can be used to code (i.e., encode and / or decode) the eob position, and the technique disclosed herein can be used for larger blocks (e.g., 8x8 blocks or larger). In another example, the selection of the technique to be used can depend on the color components. For example, the technique disclosed herein can be used for luma blocks, and the Cartesian coordinate technique or the interleaving technique can be used for chroma blocks (which are usually sparse). In yet another example, the selection can depend on the picture type and / or coding mode. For example, the techniques disclosed herein can be used for intra-coded blocks, while Cartesian coordinate techniques or interleaving techniques can be used for inter-coded blocks. In another example, the selection can depend on statistics from previously decoded blocks that adapt the selection to the data itself. In a further example, the selection can be signaled in the picture / frame header, and for blocks within the picture / frame, the signaled selection for those blocks can be used.
[0128] 12 is a flow chart diagram of a process 1200 for coding the location of the last non-zero coefficient of a transform block of coefficients using a Cartesian grouping coordinate system according to one embodiment of the disclosure. In the Cartesian grouping coordinate system, the column values of the transform block are grouped into column groups and the row values of the transform block are grouped into row groups. The process 1200 may code the column value of the last non-zero coefficient by indicating a column group that includes a column value and an index within the group of column values. The process 1200 codes whether the column group that includes a non-zero transform coefficient includes a non-zero transform coefficient.
[0129] Process 1200 may share aspects of process 1100. Descriptions of blocks in process 1200 numbered as blocks of process 1100 will be omitted.
[0130] In one example, the process 1200 may be implemented in a case where a transform block includes a relatively large number of non-zero transform coefficients. In one example, the process 1200 may be performed to code the position of the last non-zero coefficient of the transform block when the number of non-zero transform coefficients in the block exceeds a predetermined threshold, otherwise the process 1100, or another process disclosed herein, may be performed. Alternatively, an embodiment may incorporate the processes 1100 and 1200. Thus, a specific aspect of the process 1200 may be performed when the number of non-zero transform coefficients exceeds a predetermined threshold, otherwise the specific aspect of the process 1100 may be performed.
[0131] Process 1200 can provide coding improvements over process 1100 for dense transform blocks. Process 1200 can match or approach the performance of the Cartesian approach in terms of maximum throughput (as described above).
[0132] To illustrate column and row groups, for a block of size NxN, let P denote a mapping from numbers {0, ..., N-1} to group numbers {0, 1, ..., G-1}, where G is the number of groups. In one example, a first mapping can be defined for column values and a second mapping can be defined for row values. In an example where N≦32, the mapping P is given as follows:
[0133] If P(i)=ii<4 P(i)=4 when 4≦i<6 P(i)=5 6≦i<8 When P(i)=6 8≦i<12 P(i)=7 12≦i<16 P(i)=8 16≦i<24 P(i)=9 24≦i<32 Using the above mapping, column value 15 (i.e., 12≦i<16) can be mapped to column group number 7 (i.e., P(15)=7), and row value 3 (i.e., i<4) can be mapped to row group number 3 (i.e., P(3)=3). More or fewer groups can be utilized. The number of groups depends on the block size. In the N=64 example, the above mapping can be expanded to include the following:
[0134] When P(i)=1032≦i<48 When P(i)=11 48≦i<64 Using the above mapping, coefficient 1056 in FIG. 10 is mapped to column group number 5 and is in the 0th column within column group number 5. Column group number 5 includes columns 6 and 7 of block 1050. Various mappings are available. Different mappings may result in different maximum throughput amounts in terms of the number of times syntax elements associated with the clock end coefficients are coded.
[0135] The difference between process 1200 and process 1100 is as follows. Although not shown in FIG. 12, process 1200 uses the last non-zero coefficient column group eob c and row group eob r can be determined.
[0136] At 1202, the process 1200 initializes a column group set C to an empty set and a row group set R to an empty set. The column group set C keeps track of the column groups that process 1200 has already visited. In this context, a visited column group is one that is not accessed by another nonzero coefficient that is in the same column group as the current nonzero coefficient when the current nonzero coefficient is accessed in any scan order. This means that the coefficient has already been determined. For example, in scan order 1000, when scan index value 23 (i.e., corresponding to coefficient value 1 in block location (4,2)) is processed, it is determined that column group number 4 was accessed (i.e., column group set C includes column group number 4) because another non-zero coefficient (i.e., the coefficient at block location (5,1) corresponding to scan index value 22) has already been determined to be in the same column group (i.e., column group 4).
[0137] The row group set R keeps track of row groups that have already been visited by process 1200. In this context, a visited row group means that another nonzero coefficient in the same row group as the current nonzero coefficient has already been determined when the current nonzero coefficient is accessed in any scan order.
[0138] After block 1116 of FIG. 12, process 1200 proceeds to 1217. At 1217, process 1200 processes two branches given by sequences 1218-1227 and 1228-1237. In one example, the two branches can be processed sequentially. In another example, the two branches can be processed in parallel.
[0139] In 1218, if the column group of the last non-zero coefficient has not yet been found (i.e., EOB_C_FOUND=0) and the column group that contains the column value of the current coefficient (i.e., column group P(c i )) has not yet been accessed (i.e., if the column group value P(c i ) is not included in column group set C), the process 1200 proceeds to 1120. Otherwise, the sequence 1220 to 1127 is skipped.
[0140] At 1220, the process 1200 may code a flag LAST_EOB_C_FLAG. The flag LAST_EOB_C_FLAG indicates whether the current column group of non-zero coefficients is the column group containing the last non-zero coefficient. For example, when implemented by an encoder, the process 1200 may code a value P(c i )=P(eob c ) may be coded. When implemented in a decoder, the process 1100 may decode a syntax element that may set the flag LAST_EOB_C_FLAG. If the column group of the current coefficient is not the same as the column group of the last non-zero coefficient, a zero (0) may be coded, otherwise a one is coded. To repeat, as mentioned above, when implemented by an encoder, coding means encoding into a coded bitstream, and when implemented by a decoder, coding means decoding from a coded bitstream.
[0141] In 1222, column group P(c i ) was accessed, the column group value P(c i ) is added to column set C and the column group value P(c i If another transform coefficient having the same length as the column group P(c) is accessed, the process 1200 may skip the sequence 1220-1227, so that (at 1220) the column group P(c i) contains the last non-zero transform coefficient of the block.
[0142] In 1224, the column group value P(c i ) is equal to the column group value of the last non-zero coefficient (i.e., P(c i If LAST_EOB_C_FLAG=1), then the process 1200 sets (at 1226) the flag EOB_C_FOUND to true (e.g., EOB_C_FOUND=1). When implemented by a decoder, the process 1200 also sets (at 1226) the column group value P(c i ) is the column group value of the last non-zero coefficient (i.e. P(eob c At 1227, the process 1200 may record that the last non-zero coefficient eob c Re-enter the column To construct, P(c i )≧4, process 1200 may code an additional bit (e.g., a value of zero) since the last non-zero coefficient (i.e., coefficient 1056) is in column group number 5 (which contains column values 6 and 7 according to the mapping above) and is the first column in the group. The additional bit coded at 1227 depends on the number of columns in the group. Once the two branches of 1217 are completed, process 1200 proceeds to 1110.
[0143] In sequence 1228-1237, process 1200 performs steps similar to those of branches 1218-1237. Block 1228 returns EOB_C_FOUND, column group P(c i ), and column group set C, instead of EOB_R_FOUND, row group P(r i), and row group set R are used. Block 1230 may be the same as block 1220, except that instead of coding LAST_EOB_C_FLAG, process 1220 codes a LAST_EOB_R_FLAG to indicate whether the current non-zero coefficient row group is the last non-zero coefficient row group. Block 1232 codes a column group set C and a column group value P(c i ), we use a row group set R and row group values P(r i Block 1234 may be the same as block 1222, except that column group values P(c i ) to the column group value of the last non-zero coefficient (P(eob c ), instead of comparing it to the column group values P(r i ) is the last non-zero coefficient (P(eob r Block 1236 may be the same as block 1226 except for the flag EOB_R_FOUND instead of the flag EOB_C_FOUND. Block 1237 may be the same as block 1227 except for additional bits are coded to reconstruct the row of the last nonzero coefficient.
[0144] 13 is a flow chart diagram of a process 1300 for coding the position of the last non-zero coefficient of a transform block of coefficients using a polar coordinate system according to an embodiment of the present disclosure. The process 1300 is similar to the processes 1100 and 1200 described above. However, the process 1300 uses a polar coordinate system. The polar coordinate system of the process 1300 is further described with respect to FIG. 15 and block 1050 of FIG. 10.
[0145] Figure 15 is an example of a polar coordinate system 1500 according to an embodiment of the present disclosure. Figure 15 is a replica of the scan order 1000 of Figure 10. The polar coordinate system 1500 can be characterized by an origin and a diagonal. In one example, the origin can be the DC coefficient of block 1050 (i.e., coefficient 1058). That is, the origin can correspond to scan index value 0 (i.e., scan index 1504).
[0146] As mentioned above, each coefficient of block 1050 in Figure 10 is located at a Cartesian location (column, row). For example, coefficient 1056 is at Cartesian location (6, 2). The anti-diagonals of polar coordinate system 1500 may be lines such that coefficients of block 1050 having the same value (column + row) are considered to be on the same anti-diagonal.
[0147] For example, anti-diagonal 1502 contains the coefficient with column + row = 1. Thus, coefficients corresponding to scan index value 1 (corresponding to the coefficient at block location (0,1)) and scan index value 2 (corresponding to the coefficient at block location (1,0)) are on the same anti-diagonal (i.e., anti-diagonal 1502).
[0148] As another example, anti-diagonal 1506 includes coefficients for block 1050 having column+row=4. That is, anti-diagonal 1506 includes coefficients for Cartesian positions (4,0), (3,1), (2,2), ( 15 includes coefficients at scan locations 10, 11, 12, 13, and 14, which correspond to the coefficients at Cartesian locations (7,1), (6,2), (5,3), (4,4), (3,5), (2,6), and (1,7), respectively. Similarly, anti-diagonal 1508 includes coefficients for block 1050 having column+row=8. That is, anti-diagonal 1508 includes coefficients at scan locations 36, 37, 38, 39, 40, 41, and 42, which correspond to coefficients at Cartesian locations (7,1), (6,2), (5,3), (4,4), (3,5), (2,6), and (1,7), respectively.
[0149] In the polar coordinate system 1500, the coefficients are described by an anti-diagonal, which includes the coefficient and the position of the coefficient on the diagonal. That is, the coefficients can be described by the tuple (anti-diagonal, position). In one example, the position can be specified by the row number of the coefficient. In another example, the position can be specified by the column number of the coefficient. Other options for describing the position are available.
[0150] Therefore, the location of the last non-zero coefficient in a transform block (e.g., coefficient 1056 corresponding to scan index 1006 in FIG. 10) is the tuple (eob d ,eob a ) The anti-diagonal of coefficient 1056 is eob d =6+2=8. The column number of the coefficient is at position eob a , coefficient 1056 can be described by the tuple (8, 6). The row number of the coefficient is at position eob a , coefficient 1056 can be described by the tuple (8, 2). In the following description, it is assumed that the position along the anti-diagonal is given by the row number of the coefficient. With the DC position as the origin, polar coordinate system 1500 can be considered as a discrete version of the polar coordinate system. Although not shown in FIG. 13, process 1300 also calculates the anti-diagonal eob of the last non-zero coefficient. d and position eob a can be determined.
[0151] Process 1300 codes once whether the anti-diagonal containing a non-zero coefficient is the anti-diagonal containing the last non-zero coefficient of any block in scan order. For a current non-zero coefficient on the anti-diagonal containing the last non-zero coefficient, process 1300 codes (or can infer) whether the current non-zero coefficient is the last non-zero coefficient. Process 1300 includes some of the same blocks as process 1100 of FIG. 11. For simplicity, the description of the same numbered blocks is omitted.
[0152] At 1302, the process 1300 initializes a diagonal set D to an empty set. The diagonal set D keeps track of the anti-diagonals already accessed by the process 1300. In this situation, the anti-diagonal accessed means that when the current non-zero coefficient is accessed in any scan order, another non-zero coefficient has already been determined to be included in the same anti-diagonal as the current non-zero coefficient. For example, in the scan order 1000, when the scan index value 2 (i.e., corresponding to the coefficient value 3 at the block position (1,0)) is processed, the anti-diagonal 1 (i.e., 1+0) is determined to be accessed (i.e., the diagonal set D includes the anti-diagonal having value 2). This is because another non-zero coefficient (i.e., the coefficient at the block position (0,1) corresponding to the scan index value 1) has already been determined to be included in the anti-diagonal (i.e., anti-diagonal value 1).
[0153] At 1304, the scan position i is initialized to zero, and the flags EOB_D_FOUND and EOB_A_FOUND are each set to false (e.g., a value of zero). The scan position i is used as an index into the one-dimensional array u. The flag EOB_D_FOUND indicates whether a transform coefficient on the same anti-diagonal as the block end coefficient has been processed (i.e., accessed according to scan order). The flag EOB_A_FOUND indicates whether the position of the current transform coefficient on the anti-diagonal of the last non-zero coefficient is the position of the last non-zero coefficient.
[0154] At 1317, the process 1300 calculates the anti-diagonal value for the current coefficient. The current coefficient is the coefficient of the transform block corresponding to the scan index value of the scan position i. i ) and row values (i.e., r i ), the process 1300 calculates the current anti-diagonal d i d i =c i +r i Calculate as follows.
[0155] In 1318, the process 1300 determines that the antidiagonal containing the last nonzero coefficient has not been determined (i.e., flag EOB_D_FOUND=0) and the current antidiagonal d i is not accessed (i.e., value d i is not in set D), then process 1300 proceeds to 1320; otherwise, process 1300 proceeds to 1328.
[0156] At 1320, the process 1300 codes a flag LAST_EOB_D_FLAG. The flag LAST_EOB_D_FLAG indicates whether the antidiagonal of the current nonzero coefficient is the antidiagonal of the last nonzero coefficient. For example, when implemented by an encoder, the process 1300 codes a value d i =eob d When implemented in a decoder, the process 1300 may decode a syntax element that may set a flag LAST_EOB_D_FLAG. If the antidiagonal of the current coefficient is not the same as the antidiagonal of the last non-zero coefficient, a zero (0) may be coded, otherwise a one is coded. To reiterate, as mentioned above, when implemented by an encoder, coding means encoding into an encoded bitstream, and when implemented by a decoder, coding means decoding from an encoded bitstream.
[0157] In 1322, the opposite angle value d i To indicate that the current coefficient's antidiagonal value d i is added to the anti-diagonal set D, and the same anti-diagonal d i If / when another transform coefficient having the opposite angle value d i This allows the user to skip coding a separate value indicating whether contains the last non-zero transform coefficient of the block.
[0158] At 1324, the anti-diagonal value d i If d is equal to the antidiagonal value of the last nonzero coefficient (i.e., d i =eob d If so, or equivalently, if LAST_EOB_D_FLAG=1, then the process 1300 sets (1326) the EOB_D_FOUND flag to true (e.g., EOB_D_FOUND=1), otherwise the process 1300 proceeds to 1328. If implemented by a decoder, in 1326 the process 1300 calculates the anti-diagonal value d i is the last non-zero coefficient (i.e., eob d ) may also be recorded as the anti-diagonal value. Then, process 1300 proceeds to 1328.
[0159] If, at 1328, the process 1300 determines that EOB_D_FOUND is set (i.e., EOB_D_FOUND=1), the process 1300 proceeds to 1330; otherwise, the process 1300 proceeds to 1112. In sequence 1330-1338, the process 1300 codes or infers whether the position of the current non-zero coefficient on the anti-diagonal is the position of the last non-zero coefficient. If, at 1328, the flag EOB_D_FOUND is set, the anti-diagonal value d i is the last non-zero coefficient (i.e., eob d ) is the antidiagonal value of the next antidiagonal. It also means that the subsequent antidiagonal contains only zero coefficients because the current antidiagonal contains the last nonzero coefficient. The antidiagonal of a subsequence is the antidiagonal value of any antidiagonal d i+k where k is greater than zero (0).
[0160] At 1330, the process 1300 selects the current coefficient position (c i , r i ) is the opposite diagonal d i If it is not the last position, the process proceeds to step 1334. If so, at 1332, the process 1300 continues to find the last non-zero coefficient (i.e., eob a ) is the same as the row value of the current coefficient. a is i In one example, the process 1330 may estimate that for all k>0, i+k d i By determining that the current coefficient position (c i , r i ) is the opposite diagonal d i The process 1300 then proceeds to 1112.
[0161] At 1334, the process 1300 codes a flag LAST_EOB_A_FLAG. The flag LAST_EOB_A_FLAG indicates whether the anti-diagonal position of the current non-zero coefficient is the position of the last non-zero coefficient. For example, when implemented by an encoder, the process 1300 codes a value r i =eob a When implemented in a decoder, the process 1300 may decode a syntax element that may set the flag LAST_EOB_A_FLAG. If the anti-diagonal position of the current coefficient is not the same as the anti-diagonal position of the last non-zero coefficient, a zero (0) may be coded, otherwise a one is coded.
[0162] At 1336, the process 1300 calculates the position value r i is the antidiagonal of the last nonzero coefficient d i Whether it is equal to the value in the position above (i.e., r i =eob rIf not, the process 1300 proceeds to 1112. If so, the process 1300 sets (at 1338) a flag EOB_A_FOUND to true (e.g., EOB_A_FOUND=1). If implemented by a decoder, the process 1300 determines (at 1338) whether the row value r i is the last non-zero coefficient (i.e. eob r ) along the anti-diagonal of the line 1300. Next, the process 1300 proceeds to 1112.
[0163] At 1312, if all coefficients of the transform block have been processed (i.e., scan position i=N*N) or if the anti-diagonal of the last non-zero transform coefficient has been accessed (i.e., EOB_D_FOUND=1) and the location of the last non-zero position on the anti-diagonal has been found (i.e., EOB_A_FOUND=1), then process 1300 ends; otherwise, the process continues at 1106.
[0164] As described above, the process 1300 starts when EOB_D_FOUND=1 (i.e., the current antidiagonal is the antidiagonal containing the last nonzero coefficient) and the current coefficient position (c i , r i ) is the last position of the anti-diagonal, it can be inferred (instead of encoding by the encoder or decoding by the decoder) that the current coefficient is a non-zero coefficient. Thus, the process 1300 can save the cost of encoding or decoding the value sig[i].
[0165] FIG. 14 is a flow chart diagram of a process 1400 for coding the location of the last non-zero coefficient of a transform block of coefficients using a coefficient group coordinate system according to an embodiment of this disclosure. The coefficient group coordinate system divides the transform block into groups of transform coefficients. The first dimension of the coefficient group coordinate system may be the group of quantized transform coefficients and the second dimension may be the position within the group. The coefficient group coordinate system organizes all scan positions {0, ..., N*N-1} into multiple non-overlapping groups {G0, ..., G K}, where K is a positive integer less than N*N-1. In the following description, stating that a group contains a coefficient is the same as stating that the group contains the scan index of the coefficient. Similarly, the group number of a nonzero coefficient is the same as the group number that contains the scan index of the nonzero coefficient.
[0166] Coefficient groups {G0,...,G K}, the position eob of the last nonzero coefficient in the transform block is given by (eob g ,eob a ), and eob g is a group G containing block end coefficients k Denotes the index k of eob a Group G k Indicates the offset position within the a eob a =eob-G k,0 That is, the offset position eob can be determined as a is the scan index position of the block end coefficient minus the first scan index of the group containing the block end coefficient.
[0167] 16 is an example of a coefficient group coordinate system 1600 according to an embodiment of the present disclosure. The coefficient group coordinate system 1600 divides scan positions into groups G, ... k That is, each group Gk is made up of 16 consecutive scan positions. Thus, coefficient group coordinate system 1600 includes four groups: Group G1 (i.e., group 1602) includes scan positions {0, 1, ..., 15}; Group G2 (i.e., group 1604) includes scan positions {16, 17, ..., 31}; Group G3 (i.e., group 1606) includes scan positions {31, 32, ..., 47}; and Group G4 (i.e., group 1608) includes scan positions {48, 49, ..., 63}.
[0168] Other coefficient groups are possible. For example, we can define the scan positions as groups G0={0}, G1={1}, G2={2,3}, G3={4,5,6,7}, G4={8,...,15}, G5={16,...,31}, G6={32,...,63}, G7={64,...,127}, G8={128,...,255}, G9={256,511}, G 10 ={512,...,1023}. As another example, the coefficient group G k For G0={0}, G1={1}, G2={2,3}, G3={4,5,6,7}, G4={8,...,15}, G5={16,...,31}, k≧6, G k =32+16(k-6),...,47+16(k-6)}.
[0169] The process 1400 performs the steps of the coefficient group and end of block (eob g ,eob a 1 is an example of coding a position offset of a pixel in a pixel ...
[0170] At 1402, process 1400 initializes a group set G to an empty set. The group set G keeps track of groups that have already been visited by process 1400. In this context, a visited group means that another nonzero coefficient that is in the same group as the current nonzero coefficient has already been determined when the current nonzero coefficient is accessed in any scan order.
[0171] At 1404, the scan position i is initialized to zero, the flag EOB_G_FOUND is set to false (e.g., a value of zero), and the flag EOB_A_FOUND is set to false. The scan position i is used as an index into the one-dimensional array u. The flag EOB_G_FOUND indicates whether a scan position of a transform coefficient in the same group as the scan position of the block end coefficient is being processed (i.e., accessed in scan order). The flag EOB_A_FOUND indicates whether the position offset of the current transform coefficient in the group containing the last nonzero coefficient is the position offset of the last nonzero coefficient.
[0172] At 1416, process 1400 determines the group number to which the current coefficient belongs. Similarly, process 1400 determines the current group number of the group to which the scan position of the current coefficient belongs. Process 1400 starts when scan position i is in group G ki Located within Thus, the current group number k at scan position i (i.e., scan position i) i can be determined.
[0173] In 1418, the process 1400 determines that the group containing the last non-zero coefficient has not been determined (i.e., flag EOB_G_FOUND=0) and the current group number k i has not been accessed (i.e., value k i does not exist in set G), then process 1400 proceeds to 1420; otherwise, process 1400 proceeds to 1428.
[0174] In 1420, the process 1400 codes a flag LAST_EOB_G_FLAG. The flag LAST_EOB_G_FLAG is the last bit of the current group number k. i is the group number of the last non-zero coefficient. For example, when implemented by an encoder, the process 1400 may include i =eob g When implemented by a decoder, the process 1400 may decode a syntax element that may set a flag LAST_EOB_G_FLAG. If the current group number is not the same as the group number of the last non-zero coefficient, a zero (0) may be coded, otherwise a one is coded.
[0175] In 1422, group number k i To indicate that the current group number k has been accessed, i If group number k is added to group set G and another non-zero transformation in the same group is accessed, process 1400 skips sequence 1420-1426, so that (at 1420) group number k i This allows the user to skip coding a separate value indicating whether contains the last non-zero transform coefficient of the block.
[0176] In 1424, the current group number k i If k is equal to the group number of the last nonzero coefficient (i.e., i =eob g (or equivalently, if LAST_EOB_G_FLAG=1), the process 1400 sets (at 1426) the flag EOB_G_FOUND to true (e.g., EOB_G_FOUND=1), otherwise the process 1400 proceeds to 1428. When implemented by a decoder, the process 1400 may, at 1426, i is the last non-zero coefficient (i.e., eob g) in the group. Then, the process 1400 proceeds to 1428.
[0177] If the process 1400 determines in 1428 that EOB_G_FOUND is set (i.e., EOB_G_FOUND=1), the process 1400 proceeds to 1430, otherwise the process 1400 proceeds to 1112. In sequence 1430-1438, the process 1400 codes or infers whether the position offset of the nonzero coefficient in the group containing the last nonzero coefficient is the position of the last nonzero coefficient. If the flag EOB_G_FOUND is set in 1428, k i The current group, numbered ,is the last non-zero coefficient (i.e. eob g ) scan index.
[0178] At 1430, if scan position i is the last position in the group, then process 1400 proceeds to 1432; otherwise, process 1400 proceeds to 1434. In one example, process 1400 can determine if scan position i is the last position in the group by testing whether the value of the next scan position (i.e., i+1) is outside the group. Referring to FIG. 16 for illustration, to determine if scan index 15 is the last position in group G1 (i.e., group 1602), process 1400 tests whether scan index i+1=16 is in group G1. As discussed above, group G2 (i.e., group 1604) is the group that contains scan position 16. Thus, scan position i is the last position in group G1, since (i+1) does not exist in G1.
[0179] At 1432, the process 1400 determines (instead of encoding by the encoder or decoding by the decoder) the last non-zero coefficient (i.e., eob a) is the same as the offset of the last non-zero coefficient. a iG ki,0 That is, the offset position of the last nonzero coefficient is equal to the current scan index (i) minus the first scan index of the group that contains scan index i. For example, using the groups of FIG. 16, given a current scan position i=39, the first scan position of the group that contains scan position i is 32. This is because the group that contains scan position 39 is group 1604, and the first scan position of group 1604 is scan position 32.
[0180] At 1434, the process 1400 codes a flag LAST_EOB_A_FLAG. The flag LAST_EOB_A_FLAG indicates whether the position offset of the current non-zero coefficient in the group is the position offset of the last non-zero coefficient. For example, when implemented by an encoder, the process 1400 codes a value (iG ki,0 =eob a ) may be coded. When implemented in a decoder, the process 1400 may decode a syntax element that may set the flag LAST_EOB_A_FLAG. If the position offset within the group of the current coefficient is not the same as the position offset of the last non-zero coefficient, a zero (0) may be coded, otherwise a one is coded.
[0181] At 1436, the process 1400 ki,0 =eob a ) or, equivalently, whether LAST_EOB_A_FLAG=1. If not, the process 1400 proceeds to 1112. If yes, the process 1400 sets (at 1438) the flag EOB_A_FOUND to true (e.g., EOB_A_FOUND=1). If implemented by a decoder, the process 1400 determines (at 1438) whether the value iGki,0 is the position offset of the last non-zero coefficient (eob a ) Then, the process 1400 proceeds to 1112.
[0182] At 1412, if all coefficients of the transform block have been processed (i.e., scan position i=N*N) or if the last group of non-zero transform coefficients has been accessed (i.e., EOB_G_FOUND=1) and the position offset of the last non-zero position in the group has been found (i.e., EOB_A_FOUND=1), then process 1400 ends; otherwise, the process continues at 1106.
[0183] In one embodiment, the process 1400 performs a step 1106 if EOB_G_FOUND=1 (i.e., the current group is the group containing the last non-zero coefficient) and the current scan position i is the last offset position of the group (i.e., i is G ki (i is the last position of i), then it can be inferred (instead of encoding by the encoder or decoding by the decoder) that the current coefficient is a non-zero coefficient. Thus, the process 1400 can save the cost of encoding or decoding the value sig[i].
[0184] FIG. 17 is a flow chart diagram of a process 1700 for decoding the position of the last non-zero coefficient of a transform block according to an embodiment of the present disclosure. The process 1700 may be implemented in a decoder, such as the decoder 500. The process 1700 may be implemented by a receiving station. The process 1700 may be implemented as a software program that may be executed by a computing device, for example. The software program may include machine-readable instructions stored in a memory, such as memory 204 or secondary storage 214, that are executed by a processor, such as CPU 202, to cause a computing device to perform process 1700. Process 1700 may be implemented using specialized hardware or firmware. Some computing devices may have multiple memories, multiple processors, or both. Steps or operations of process 1700 may be distributed using different processors, memories, or both. Use of the singular "processor" or "memory" herein encompasses computing devices with only one processor or one memory that may be used to perform some or all of the steps described, as well as devices with multiple processors or multiple memories.
[0185] At 1702, process 1700 decodes whether a first coefficient of a transform block is non-zero from an encoded bitstream, such as compressed bitstream 420 of Figure 5. In one example, block 1702 is as described with respect to block 1108 of Figures 11-14.
[0186] At 1704, the process 1700 determines whether the first coefficient is non-zero and whether the first coefficient is the first non-zero coefficient to be decoded for the first value of the first dimension. If so, the process 1700 proceeds to 1706; otherwise, the process ends.
[0187] In one example, the first value of the first dimension can be a column value for a column dimension of the Cartesian coordinate system described with respect to FIG. 11 and the determining can be as described with respect to block 1118. In one example, the first value of the first dimension can be a row value for a row dimension of the Cartesian coordinate system described with respect to FIG. 11 and the determining can be as described with respect to block 1128. In one example, the first value of the first dimension can be a column group value for a column group dimension of the Cartesian grouping coordinate system described with respect to FIG. 12 and the determining can be as described with respect to block 1218. In one example, the first value of the first dimension can be a row group value for a row group dimension of the Cartesian grouping coordinate system described with respect to FIG. 12 and the determining can be as described with respect to block 1228. In one example, the first value of the first dimension can be an anti-diagonal value for an anti-diagonal dimension of the polar coordinate system described with respect to FIG. 13 and the determining can be as described with respect to block 1318. In one example, the first value of the first dimension may be a coefficient group value for a coefficient group dimension of the coefficient group coordinate system described with respect to FIG. 14, and the determination may be as described with respect to block 1418.
[0188] At 1706, the process 1700 decodes from the encoded bitstream a first syntax element indicating whether a first value of a first dimension indicates a block end coefficient. The decoding depends on the coordinate system used. In one example, the decoding can be as described with respect to 1120 or 1130 of FIG. 11. In one example, the decoding can be as described with respect to 1220 or 1230 of FIG. 12. In one example, the decoding can be as described with respect to 1320 of FIG. 13. In one example, the decoding can be as described with respect to 1420 of FIG. 14.
[0189] At 1708, in response to a first syntax element indicating a block end coefficient, the process 1700 uses the first value to determine the location of the last non-zero coefficient. In one example, the block may be as described with respect to sequences 1124-1126 of FIG. 11. In one example, the block may be as described with respect to sequences 1134-1136 of FIG. 11. In one example, the block may be as described with respect to sequences 1224-1226 of FIG. 12. 1127. In one example, the blocks may be as described with respect to sequences 1234-1237 of FIG. 12. In one example, the blocks may be as described with respect to sequences 1324-1326 of FIG. 13. In one example, the blocks may be as described with respect to sequences 1424-1426 of FIG.
[0190] In one embodiment, the process 1700 may include, in response to determining that the first transform coefficient is the first non-zero coefficient to be decoded with respect to the second value of the second dimension, decoding from the encoded bitstream a second syntax element indicating whether the second value of the second dimension indicates a block end coefficient, and, in response to the second syntax element indicating a block end coefficient, determining a position of the last non-zero coefficient using the second value.
[0191] The first and second dimensions may be dimensions in a coordinate system that includes columns and rows of the transform block. The coordinate system may be as described with respect to the Cartesian coordinate system of FIG.
[0192] In one embodiment, the first and second dimensions are dimensions in a polar coordinate system. The polar coordinate system may be as described with respect to FIG. 7. The polar coordinate system may be centered on a DC coefficient of the transform block. The first dimension may correspond to an anti-diagonal of a scan order used to code the transform block, and the second dimension may correspond to a position on the anti-diagonal of the first dimension.
[0193] The first and second dimensions may be dimensions in a coefficient group coordinate system. The coefficient group coordinate system is as described with respect to FIG. 14. In one example, the coefficient group coordinate system may divide a scan position of a scan order into groups of scan positions, the first dimension may correspond to a group of scan positions, and the second dimension may correspond to an offset position of a scan index within the group. In one example, the coefficient group coordinate system may divide a transform block into groups of transform coefficients, the first dimension may correspond to a group of transform coefficients, and the second dimension may correspond to a position within the group.
[0194] In an embodiment of the coefficient group coordinate system, the groups may contain an equal number of scan positions. For example, the equal number of scan positions may be 16. In an embodiment of the process 1700, the first dimension and the second dimension are dimensions in a Cartesian grouping coordinate system, as described in Figure 12. The first dimension may correspond to a group of columns of the transform block, and the second dimension may correspond to a group of rows of the transform block.
[0195] The transform block of coefficients may be a transform block of a residual block predicted using intra prediction. The transform coefficients may be transform coefficients for a block of luma and chrominance components.
[0196] 18 is a flow chart diagram of another process 1800 for decoding the position of the last non-zero coefficient of a transform block according to an embodiment of the present disclosure. The process 1800 may be implemented in a decoder, such as the decoder 500 of FIG. 5. The process 1800 may be implemented as a software program that may be executed by a computing device, such as the receiving station 106, for example. The software program is machine-readable instructions stored in a memory, such as the memory 204 or the secondary storage 214, that are executed by a processor, such as the CPU 202, to cause the computing device to generate the program. 5. In at least some embodiments, the process 1100 may be performed in whole or in part by the entropy decoding stage 502 of the decoder 500 of FIG.
[0197] At 1802, the process 1800 maps coefficients of a transform block to a coefficient group coordinate system. The coefficient group coordinate system may have a first dimension and a second dimension. The first dimension may correspond to a group of transform coefficients. The second dimension may correspond to an offset position within one of the multiple coefficient groups. In one example, some groups may contain unequal numbers of coefficients.
[0198] At 1804, the process 1800 determines from the encoded bitstream a coefficient group that contains the last non-zero coefficient. For example, as described with respect to Figures 14 and 16, the process may determine the coefficient group that contains the last non-zero coefficient by decoding a syntax element or flag indicating group 1606, as described with respect to 1420.
[0199] At 1806, the process 1800 determines, from the encoded bitstream, an offset position of the last non-zero coefficient in the coefficient group for the last non-zero coefficient. For example, the process may determine the offset position as described with respect to FIG.
[0200] At 1808, the process 1800 decodes coefficients from the encoded bitstream up to the coefficient corresponding to the coefficient group and offset position. In one example, the coefficients may be decoded as described with respect to 1412 and 1106 of FIG.
[0201] In an embodiment of the process 1800, determining the offset position may include decoding a syntax element indicating the offset position from the encoded bitstream, for example, as described with respect to 1434 of FIG.
[0202] In an embodiment of process 1800, determining the offset position may include inferring that the offset position of the last non-zero coefficient is the last offset position in response to determining that the current coefficient being decoded is at the last offset position of the group of coefficients. In one example, the offset position may be inferred as described with respect to 1430 and 1432 of FIG.
[0203] In an embodiment of process 1800, decoding coefficients up to a coefficient corresponding to the coefficient group and offset position may include inferring that the current coefficient being decoded is a non-zero coefficient in response to determining that the current coefficient being decoded is at the last offset position within the coefficient group. This process may infer that the current coefficient is a non-zero coefficient as described with respect to 1106 of FIG.
[0204] Yet another process for decoding the location of the last non-zero coefficient of a transform block of coefficients according to one embodiment is disclosed herein. The process includes mapping the coefficients of the transform block to a coordinate system having a first dimension and a second dimension. The first one or more coefficients are placed in the coordinate system at a first value of the first dimension, and the second one or more coefficients are placed in the coordinate system at a second value of the second dimension. The process also includes decoding from the encoded bitstream only once for a first value as to whether the first value of the first dimension includes the last non-zero coefficient, decoding from the encoded bitstream only once for a second value as to whether the second value of the second dimension includes the last non-zero coefficient, and using the decoded third value of the first dimension and the decoded fourth value of the second dimension to determine the location of the last non-zero coefficient. A value of 3 and a decoded fourth value may indicate the last non-zero coefficient.
[0205] For example, in the case of a polar coordinate system, the first dimension may be the anti-diagonal and the second dimension may be the position on the diagonal. Thus, an example of decoding only once for a first value as to whether the first value of the first dimension contains the last non-zero coefficient can be decoded only once for whether the anti-diagonal 1502 (i.e., corresponding to row+column=0+1=1+0=1) of FIG. 15 contains the last non-zero coefficient. In this case, the anti-diagonal 1502 (i.e., the first value) of the anti-diagonal dimension (i.e., the first dimension) does not contain the last non-zero coefficient.
[0206] In one embodiment, decoding the fourth value may mean inferring the fourth value. For example, in a Cartesian coordinate system, the fourth value may be inferred as described with respect to 1120 of FIG. 11. For example, in a polar coordinate system, the fourth value may be inferred as described with respect to 1332 of FIG. 13. For example, in a coefficient group coordinate system, the fourth value may be inferred as described with respect to 1432 of FIG. 14. For example, if the first dimension contains only one element, the fourth value may be inferred to be one value. For example, if a group in the group coordinate system contains only one scan position (e.g., G0={0}, G1={1}), the fourth value may be inferred to be one scan position of the group. For example, in a polar coordinate system, the fourth value may be inferred if the determined anti-diagonal is the anti-diagonal containing the DC coefficient (i.e., the anti-diagonal corresponding to row+column=0+0=0).
[0207] The encoding and decoding aspects described above illustrate some examples of encoding and decoding techniques, however, it should be understood that encoding and decoding, as these terms are used in the claims, may mean compressing, decompressing, converting, or any other processing or modification of data.
[0208] The term "example" or "embodiment" is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as an "example" or "embodiment" should not necessarily be construed as preferred or advantageous over other aspects or designs. Rather, use of the term "example" or "embodiment" is intended to express a concept in a concrete manner. As used in this application, the term "or" is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X includes A or B" is intended to mean any natural inclusive permutations. That is, "X includes A or B" is satisfied in any of the following cases: X includes A, X includes B, or X includes both A and B. Furthermore, the articles "a" and "an" used in this application and the appended claims should generally be construed to mean "one or more", unless otherwise specified or clear from the context directed to the singular form. Furthermore, use of the term "embodiment" or "one embodiment" is not intended to refer to the same embodiment or implementation unless so stated.
[0209] The embodiments of the transmitting station 102 and / or the receiving station 106 (as well as the algorithms, methods, instructions, etc. contained in, stored on, and / or executed by the encoder 400 and the decoder 500) may be realized in hardware, software, or any combination thereof. Hardware may be, for example, a computer, an intellectual property (IP) core, an application-specific integrated circuit (ASIC), a programmable logic array, an optical processor, a programmable logic controller, microcode, a microcontroller, etc. , a server, a microprocessor, a digital signal processor, or other suitable circuitry. In the claims, the term "processor" should be understood to include any of the above hardware, alone or in combination. The terms "signal" and "data" are used interchangeably. Furthermore, portions of the transmitting station 102 and the receiving station 106 need not necessarily be implemented in the same way.
[0210] Further, in one aspect, for example, the transmitting station 102 or the receiving station 106 may be implemented using a general purpose computer or processor with a computer program that, when executed, executes any of the individual methods, algorithms, and / or instructions described herein. Additionally or alternatively, a special purpose computer / processor may be utilized that may include, for example, other hardware for executing any of the methods, algorithms, or instructions described herein.
[0211] The transmitting station 102 and the receiving station 106 may be implemented on a computer, for example, in a video conferencing system. Alternatively, the transmitting station 102 may be implemented on a server and the receiving station 106 may be implemented on a device separate from the server, such as a handheld communication device. In this case, the transmitting station 102 may encode content into an encoded video signal using the encoder 400 and transmit the encoded video signal to the communication device. The communication device may decode the encoded video signal using the decoder 500. Alternatively, the communication device may decode content stored locally on the communication device, for example, content that was not transmitted by the transmitting station 102. Other transmitting station 102 and receiving station 106 implementation schemes are available. For example, the receiving station 106 may be a generally fixed personal computer rather than a portable communication device, and / or the device including the encoder 400 may include the decoder 500.
[0212] Furthermore, all or part of the embodiments of the present disclosure may take the form of a computer program product, for example accessible from a tangible computer usable or computer readable medium. The computer usable or computer readable medium may be any device that can tangibly contain, store, communicate, or transport a program for use by or in connection with any processor, for example. The medium may be, for example, an electronic, magnetic, optical, electromagnetic, or semiconductor device. Other suitable media may also be utilized.
[0213] The above-mentioned embodiments, examples and aspects are described to facilitate the understanding of the present disclosure, and are not intended to limit the present disclosure. The present disclosure is intended to encompass various modifications and equivalent structures within the scope of the appended claims, and the scope of the claims is to be accorded the broadest interpretation so as to encompass all modifications and equivalent structures as permitted by law.
Claims
1. 1. An apparatus for decoding a transform block, the transform block being decoded using a scan order, the apparatus comprising: decoding, from the encoded bitstream, a first syntax element indicating a group of consecutive scan positions in the scan order, the scan order being a one-dimensional structure that specifies an order for traversing coefficients of the transform block, the group of consecutive scan positions including a scan position of a last non-zero coefficient; determining an offset within the group of consecutive scan positions of the last non-zero coefficient, the offset indicating a distance from a first scan position of the group of consecutive scan positions; Decoding coefficients from the encoded bitstream up to the last non-zero coefficient of the transform block.
16. An apparatus comprising: a processor configured to:
2. Determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: decoding from the encoded bitstream an index of a second syntax element of the offset within the group of consecutive scan positions; The apparatus of claim 1 , comprising:
3. Determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: estimating the offset within the group of consecutive scan positions based on determining that a scan position of the group of consecutive scan positions is a last position of the group of consecutive scan positions; The apparatus of claim 1 , comprising:
4. The processor, decoding, from the encoded bitstream, a sign map indicating individual signs of the non-zero coefficients of the coefficients up to the last non-zero coefficient of the transform block; The apparatus of claim 1 , further configured to:
5. Decoding the coefficients from the encoded bitstream up to the last non-zero coefficient of the transform block comprises: decoding non-zero coefficients between and including a DC coefficient and the last non-zero coefficient; The apparatus of claim 1 , comprising:
6. Decoding the coefficients from the encoded bitstream up to the last non-zero coefficient of the transform block comprises: Decoding each of the coefficients using a coefficient token tree. The apparatus of claim 1 , comprising:
7. 7. The apparatus of claim 6, wherein at least one node of the coefficient token tree maps a value of a coefficient to a token.
8. 7. The apparatus of claim 6, wherein at least one node of the coefficient token tree maps values of multiple coefficients to a single token.
9. 1. A method for decoding a transform block, the transform block being decoded using a scan order, the method comprising: Decoding a block end position, comprising: decoding, from the encoded bitstream, a first syntax element indicating a group of consecutive scan positions in the scan order, the scan order being a one-dimensional structure that specifies an order for traversing coefficients of the transform block, the group of consecutive scan positions including a scan position of a last non-zero coefficient; determining an offset within the group of consecutive scan positions of the last non-zero coefficient, the offset indicating a distance from a first scan position of the group of consecutive scan positions; using at least one of the groups of consecutive scan orders in the scan order and the offset to determine the block end location; decoding the block end position according to decoding a signature map from the encoded bitstream; decoding coefficients from the encoded bitstream up to and including the last non-zero coefficient; A method comprising:
10. The step of determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: decoding from the encoded bitstream an index of a second syntax element of the offset within the group of consecutive scan positions; 10. The method of claim 9, comprising:
11. The step of determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: estimating the offset within the group of consecutive scan positions based on determining that a scan position of the group of consecutive scan positions is a last position of the group of consecutive scan positions.
10. The method of claim 9, comprising:
12. The method of claim 9 , wherein the sign map indicates the individual signs of non-zero coefficients of the coefficients up to the last non-zero coefficient of the transform block.
13. Decoding the coefficients from the encoded bitstream up to and including the last non-zero coefficient comprises: decoding non-zero coefficients between and including a DC coefficient and the last non-zero coefficient; 10. The method of claim 9, comprising:
14. Decoding the coefficients from the encoded bitstream up to the last non-zero coefficient of the transform block comprises: Decoding each of the coefficients using a coefficient token tree.
10. The method of claim 9, comprising:
15. 11. A computer-readable storage medium comprising executable instructions that, when executed by a processor, facilitate performance of operations for decoding a transform block using a scan order, the operations comprising: Decoding a block end position, comprising: decoding, from the encoded bitstream, a first syntax element indicating a group of consecutive scan positions in the scan order, the scan order being a one-dimensional structure that specifies an order for traversing coefficients of the transform block, the group of consecutive scan positions including a scan position of a last non-zero coefficient; determining an offset within said group of consecutive scan positions of said last non-zero coefficient; using at least one of the group of consecutive scan sequences and the offset in the scan sequence to determine the block end location. Decoding the block end position by the operation of decoding a signature map from the encoded bitstream; and Decoding coefficients from the encoded bitstream up to and including the last non-zero coefficient. A computer-readable storage medium comprising:
16. Determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: decoding from the encoded bitstream an index of a second syntax element of the offset within the group of consecutive scan positions; 16. The computer-readable storage medium of claim 15, comprising:
17. Determining the offset within the group of consecutive scan positions of the last non-zero coefficient comprises: estimating the offset within the group of consecutive scan positions based on determining that a scan position of the group of consecutive scan positions is a last position of the group of consecutive scan positions; 16. The computer-readable storage medium of claim 15, comprising:
18. 16. The computer-readable storage medium of claim 15, wherein the sign map indicates individual signs of non-zero coefficients of the coefficients up to the last non-zero coefficient of the transform block.
19. Decoding the coefficients from the encoded bitstream up to and including the last non-zero coefficient comprises: decoding non-zero coefficients between and including a DC coefficient and the last non-zero coefficient; 16. The computer-readable storage medium of claim 15, comprising:
20. Decoding the coefficients from the encoded bitstream up to the last non-zero coefficient of the transform block comprises: Decoding each of the coefficients using a coefficient token tree.
16. The computer-readable storage medium of claim 15, comprising: