Coefficient coding for transform skip mode in video codecs

By using an interleaving method in video encoding and decoding to encode and decode the coefficient information coefficient by coefficient, and processing the residual information in the second pass, the problem of low encoding and decoding efficiency in the transform skip mode in the existing technology is solved, and the More efficient video data processing.

CN113875258BActive Publication Date: 2024-10-25QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080038230.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-05-28
Filing Date
2020-05-29
Publication Date
2024-10-25
Estimated Expiration
2040-05-29

AI Technical Summary

Technical Problem

Existing video coding and decoding technology is difficult to effectively code and decode coefficient information in transform skip mode, resulting in low coding and decoding efficiency.

Method used

The coefficient information of the video data is encoded and decoded in an interleaved manner, including encoding and decoding the coefficients in the residual block of the current block coefficient by coefficient in the first pass, using the validity flag, parity flag, sign flag and greater than flag , and encode and decode the remaining information in the second pass. This method improves the encoding and decoding efficiency.

Benefits of technology

The encoding and decoding efficiency in the video encoding and decoding process is improved, especially in the transformation skip mode, the encoding and decoding process of coefficient information is optimized, and the transmission and storage performance of video data is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113875258B_ABST
    Figure CN113875258B_ABST
Patent Text Reader

Abstract

Techniques for encoding and decoding coefficients in a residual block are described. A video codec (e.g., a video encoder or a video decoder) may encode and decode (e.g., encode or decode) coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of video data in a first pass, wherein the coefficient information for the coefficient includes one or more of: a significance flag indicating whether the value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is odd or even; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater-than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold; and, after the first pass, encode and decode residual information for the coefficients in the residual block of the current block in a second pass.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to U.S. Application No. 16 / 886,381, filed on May 28, 2020, which claims the benefit of U.S. Provisional Patent Application No. 62 / 855,758, filed on May 31, 2019, U.S. Provisional Patent Application No. 62 / 868,776, filed on June 28, 2019, U.S. Provisional Patent Application No. 62 / 881,913, filed on August 1, 2019, and U.S. Provisional Patent Application No. 62 / 888,954, filed on August 19, 2019, each of which is incorporated by reference in its entirety. Technical Field

[0003] The present disclosure relates to video encoding and video decoding. Background Art

[0004] Digital video capabilities can be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, etc. Digital video devices implement video codec technologies, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10, Advanced Video Codec (AVC), ITU-T H.265 / High Efficiency Video Codec (HEVC), and extensions of these standards. By implementing such video codec technologies, video devices can more efficiently send, receive, encode, decode and / or store digital video information.

[0005] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or eliminate redundancy inherent in video sequences. For block-based video coding, a video slice (e.g., a video picture or a portion of a video picture) may be partitioned into video blocks, which may also be referred to as codec tree units (CTUs), codec units (CUs), and / or codec nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial predictions of reference samples in neighboring blocks in the same picture. Video blocks in an inter-coded (P or B) slice of a picture may use spatial predictions of reference samples in neighboring blocks in the same picture or temporal predictions of reference samples in other reference pictures. Pictures may be referred to as frames, and reference pictures may be referred to as reference frames. Summary of the invention

[0006] In general, this disclosure describes techniques for coefficient encoding and decoding, such as in the example of a transform skip mode. In the transform skip mode, a transform of residual data from one domain to another domain (e.g., a sample domain to a transform domain) is not performed, but the transform is skipped. The residual data may be the difference between a current block and a predicted block. In this case, the coefficient values ​​may be the values ​​of the residual data (e.g., the values ​​of the residual block), possibly with quantization.

[0007] Example techniques described in this disclosure relate to techniques for encoding (e.g., encoding or decoding) coefficients when a transform of residual data is skipped (e.g., a transform skip mode). In some examples, a video codec encodes coefficient information for a coefficient using a level value and sign information. The sign information indicates whether the coefficient value is positive or negative. The level value is combined with a parity value to indicate whether the coefficient value is greater than 0, 1, 2, etc. (as a few non-limiting examples).

[0008] In some examples, in transform skip mode, level values ​​and sign information of adjacent coefficients may be more correlated than in examples where transforms are applied. This disclosure describes example techniques that can exploit correlation between adjacent coefficients as a way to improve codec efficiency. In this way, the example techniques provide practical applications for improving codec efficiency in video codec techniques.

[0009] The present disclosure also describes an example of interleaved coefficient coding. In interleaved coefficient coding, the level value is coded (e.g., encoded or decoded) on a coefficient-by-coefficient basis in the same pass as other coefficient information such as sign information and parity information. Then, in a second pass, the residual value is coded on a coefficient-by-coefficient basis. As described in more detail, using this interleaved coefficient coding, the example technology can promote better use of coding technology. In this way, the example technology provides a technical solution to technical problems in video coding, for example, by providing a practical application of coefficient coding in the video coding process.

[0010] In one example, the present disclosure describes a method for encoding and decoding video data, the method comprising encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of video data in a first pass, wherein the coefficient information of the coefficient comprises one or more of the following: a significance flag indicating whether the value of the coefficient is not zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold value; and after the first pass, encoding and decoding the residual information of the coefficients in the residual block of the current block in a second pass.

[0011] In one example, the present disclosure describes a device for encoding and decoding video data, the device including a memory configured to store video data and a processing circuit, the processing circuit configured to encode and decode coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of video data in a first pass, wherein the coefficient information of the coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is not zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold value; and after the first pass, encoding and decoding the residual information of the coefficients in the residual block of the current block in a second pass.

[0012] In one example, the present disclosure describes a computer-readable storage medium having instructions stored thereon, which, when executed, causes one or more processors to encode and decode coefficient information in an interlaced manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of video data in a first pass, wherein the coefficient information of the coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is not zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold value; and after the first pass, encode and decode the residual information of the coefficients in the residual block of the current block in a second pass.

[0013] In one example, the present disclosure describes a device for encoding and decoding video data, the device including a component for encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of video data in a first pass, wherein the coefficient information of the coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is not zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold value; and a component for encoding and decoding the residual information of the coefficients in the residual block of the current block in a second pass after the first pass.

[0014] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 is a block diagram illustrating an example video encoding and decoding system that may perform the techniques of this disclosure.

[0016] Figure 2A and Figure 2B is a conceptual diagram illustrating an example quadtree binary tree (QTBT) structure and a corresponding codec tree unit (CTU).

[0017] Figure 3 is a conceptual diagram showing an example of encoding and decoding coefficient information of a coefficient.

[0018] Figure 4 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient.

[0019] Figure 5 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient.

[0020] Figure 6 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient.

[0021] Figure 7 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient.

[0022] Figure 8 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient.

[0023] Fig. 9 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.

[0024] Fig.10 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.

[0025] Fig.11 is a flow chart illustrating an example method for encoding and decoding video data. DETAILED DESCRIPTION

[0026] In video coding, a video encoder determines a prediction block for a current block. In some examples, such as in inter prediction, the prediction block may include samples from a reference picture or interpolated samples. In some examples, such as in intra prediction, the prediction block may include samples generated from samples in the same picture as the current block. Intra block copying may be similar to inter prediction, but the prediction block is from the same picture as the current block. The video encoder determines the difference between the prediction block and the current block to generate a residual block for the current block.

[0027] In some techniques, the video encoder performs a transform on the residual block. For example, the samples in the residual block can be considered to be in the pixel domain or sample domain, and the video encoder transforms the samples in the pixel domain to the frequency or transform domain. The result of the transform is a coefficient block that can be quantized and then encoded and decoded.

[0028] In some examples, the video encoder skips the transform step (ie, in transform skip mode). In transform skip mode, the coefficients may be identical to the samples of the residual block. These coefficients may then be quantized and then encoded.

[0029] The example techniques described in this disclosure may relate to ways of processing coefficients for encoding. The term "coefficient" may refer to a coefficient of a residual block of a current block, where a transform is skipped on the residual block or a transform is performed on the residual block. For ease of illustration, the example techniques are described with respect to a transform skip mode. However, these techniques may be applicable to examples where a transform is performed.

[0030] For a video encoder that signals coefficient information, the video encoder may be configured to encode the coefficient information that the video decoder receives to determine the value of the coefficient. Examples of coefficient information include a significance flag (e.g., a flag indicating whether the value of the coefficient is non-zero), a parity flag (e.g., a flag indicating whether the value of the coefficient is odd or even), a sign flag (e.g., a flag indicating whether the value of the coefficient is positive or negative), and one or more greater than flags that, in combination with the parity flag, indicate whether the absolute value of the coefficient is greater than a corresponding threshold.

[0031] The "greater than" flags are called "gt" flags, and each is associated with a threshold. The gt flags themselves may not be sufficient to indicate whether the values ​​of the coefficients are greater than their corresponding thresholds. For example, if the gt2 (e.g., greater than 2) flag is 0, it does not necessarily follow that the value of the coefficient cannot be 3. Instead, the combination of the parity flag and the gt2 flag together can indicate this value.

[0032] For example, if the value of the coefficient is 3, the parity flag is 1, indicating an odd value, the gt1 flag is 1, indicating that the value is greater than one, but the gt2 flag may be 0. In this example, the video decoder may determine that the value is greater than 1 because the gt1 flag is 1, and determine that the value is an odd number because the parity flag is 1. Therefore, because the value is greater than 1 and is an odd number, the value cannot be 2. Therefore, the value may be 3, 5, 7, etc. In addition, the gt2 flag is 0, so based on the combination of the gt2 flag being 0 and the coefficient being an odd number, the video decoder may determine that the value of the coefficient cannot be greater than 3 and is 3. If the coefficient value is 5 instead of 3, the g2 flag should be 1.

[0033] Assuming the last greater than flag is a greater than 5 (eg, gt5) flag, using the level flag and the parity flag, values ​​up to 9 can be represented. For values ​​greater than 9, the video encoder can signal a residual value. The residual value is the residual absolute value of the coefficient.

[0034] In the present disclosure, sig_coeff_flag refers to a validity flag indicating whether the value of a coefficient is non-zero. par_level_flag refers to a parity flag indicating whether the value of a coefficient is odd or even. coeff_sign_flag refers to a sign flag indicating whether the value of a coefficient is positive or negative. abs_level_gtX_flags refers to a flag indicating whether the value of a coefficient value is greater than a specific threshold. For example, abs_level_gtx_flag[n][j] specifies whether the absolute value of the coefficient level (at scan position n) is greater than (j<<1)+1. When abs_level_gtx_flag[n][j] does not exist, it is inferred to be equal to 0. The gtx (or greater than) flag may refer to a flag for a level value. However, the gtx flag itself may not specify whether a value is greater than a threshold. For example, a gt2 value of 0 does not necessarily mean that the value of the coefficient cannot be 3.

[0035] abs_remainder refers to information signaled for the remainder. For example, abs_remainder[n] is the remaining absolute value of the coefficient level that can be encoded with a Golomb-Rice code at scan position n. When abs_remainder[n] does not exist, it is inferred to be equal to 0.

[0036] The video decoder receives various coefficient information (e.g., sig_coeff_flag, par_level_flag, coeff_sign_flag, and all abs_level_gtX_flags and abs_remainder) and determines the coefficient value of the coefficient based on the coefficient information. The video decoder can then perform inverse quantization (if necessary) and inverse transform (if necessary) to generate sample values ​​of the residual block. In one or more examples, the video decoder can skip the inverse transform because the coefficients can be generated by the video encoder in the transform skip mode.

[0037] The video decoder may use the same techniques as the video encoder to determine the prediction block. For example, the video encoder may signal information to the video decoder that allows the video decoder to determine the same prediction block as the video encoder. The video decoder then adds the prediction block and the residual block together to reconstruct the current block.

[0038] In some techniques, the video encoder can signal coefficient information on a bit-plane basis. For example, the video encoder can encode a sig_coeff_flag (e.g., a flag indicating whether the value of the coefficient is non-zero) for each coefficient in a coefficient block, forming a bit-plane of sig_coeff_flag values. The video encoder can then encode a par_level_flag (e.g., a flag indicating whether the value of the coefficient is even or odd) for each coefficient in the coefficient block, forming a bit-plane of par_level_flag values, and so on.

[0039] This disclosure describes example techniques in which a video encoder encodes a plurality of coefficient information coefficient-by-coefficient in a first pass through the coefficients. Then, in subsequent passes, the video encoder may encode any remaining coefficient information on a coefficient-by-coefficient or bit-plane-by-bit basis.

[0040] On the basis of encoding coefficient information coefficient by coefficient, the video encoder may interleave different coefficient information. For example, the video encoder may encode sig_coeff_flag, par_level_flag, coeff_sign_flag, and all abs_level_gtX_flags of the first coefficient. Then, the video encoder may encode sig_coeff_flag, par_level_flag, coeff_sign_flag, and all abs_level_gtX_flags of the second coefficient in the first pass through the coefficients of the residual block of the current block, and so on. In one or more examples, the video encoder may then encode the abs_remainder value on a coefficient by coefficient basis in the second pass through the coefficients. On the basis of encoding the coefficient information bit by bit plane, the video encoder will encode the sig_coeff_flag of the first coefficient, then encode the sig_coeff_flag of the second coefficient, then encode the par_level_flag of the first coefficient, then encode the par_level_flag of the second coefficient, and so on.

[0041] For example, in transform skip mode, it may be beneficial to interleave coefficient coding (e.g., encode multiple coefficient information on a coefficient-by-coefficient basis) rather than encode the coefficient information on a bit-plane-by-bit basis. For example, when coding the coefficient information, context-based coding may be preferred. However, there may be limitations (e.g., referred to as the codec's bin count limit) on how many bins can be context-based coding. An example of a codec's bin count limit is 2*block width of the current block*block height of the current block. Another example of a codec's bin count limit is 1.75*block width of the current block*block height of the current block. In some cases, the video encoder may need to determine on a coefficient-by-coefficient basis how many bins will be used and how many bins will be available after coding the coefficient information of the coefficient. How many bins will be used and how many bins will be available after coding the coefficient information of the coefficient may need to be used to determine quantization parameters, such as in a rate-distortion optimized quantization (RDOQ) process.

[0042] By interleaving coefficient information (e.g., significance information, sign information, parity information, and a greater-than flag) using context-based coding on a coefficient-by-coefficient basis, a video encoder may be able to better track how many bits a coefficient will use compared to examples where coefficient information using context-based coding is encoded on a bit-plane-by-bit basis. For example, on a bit-plane-by-bit basis, the video encoder does not know how many bits a coefficient will require until the video encoder passes through all coefficients.

[0043] In one or more examples described in the present disclosure, after a first pass of coefficient information based on context coding, residual information is coded. The residual information may not be based on context coding (e.g., bypass coding). Because the residual information is bypass coded, the residual information may not affect the number of binary bits required for context-based coding, and therefore, may be separated from context-based coding of context information such as significance information, sign information, parity information, and level value.

[0044] Therefore, in one or more examples, the example techniques described in the present disclosure can improve the coefficient encoding and decoding process. One or more techniques described in the present disclosure provide practical applications for encoding and decoding coefficient information, which can improve the entire video encoding and decoding process, for example, by separating coefficient information that needs to be context-based encoding and decoding from coefficient information that can be bypass-encoded.

[0045] Figure 11 is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of the present disclosure. The techniques of the present disclosure are generally directed to encoding and decoding (encoding and / or decoding) video data. Generally, video data includes any data used to process video. Therefore, video data may include original, unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata such as signaling data.

[0046] like Figure 1 As shown, in this example, the system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, the source device 102 provides the video data to the destination device 116 via a computer-readable medium 110. The source device 102 and the destination device 116 may include any of a variety of devices, including a desktop computer, a notebook (i.e., laptop) computer, a tablet computer, a set-top box, a telephone handset such as a smart phone, a television, a camera, a display device, a digital media player, a video game console, a video streaming device, etc. In some cases, the source device 102 and the destination device 116 may be equipped for wireless communication and may therefore be referred to as wireless communication devices. Accordingly, the source device 102 and the destination device 116 may be one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0047] exist Figure 1 In the example of , the source device 102 includes a video source 104, a memory 106, a video encoder 200, and an output interface 108. The destination device 116 includes an input interface 122, a video decoder 300, a memory 120, and a display device 118. According to the present disclosure, the video encoder 200 of the source device 102 and the video decoder 300 of the destination device 116 can be configured to apply the coefficient encoding and decoding technology of this article. Therefore, the source device 102 represents an example of a video encoding device, and the destination device 116 represents an example of a video decoding device. In other examples, the source device and the destination device may include other components or arrangements. For example, the source device 102 can receive video data from an external video source (e.g., an external camera). Similarly, the destination device 116 can interface with an external display device instead of including an integrated display device.

[0048] Figure 1The system 100 shown is only an example. In general, any digital video encoding and / or decoding device can perform coefficient coding and decoding techniques. The source device 102 and the destination device 116 are only examples of such coding and decoding devices, wherein the source device 102 generates coded and decoded video data for transmission to the destination device 116. The present disclosure refers to a "coding and decoding" device as a device that performs data coding and decoding (coding and / or decoding). Therefore, the video encoder 200 and the video decoder 300 represent examples of coding and decoding devices, specifically, respectively represent video encoders and video decoders. In some examples, the devices 102 and 116 can operate in a substantially symmetrical manner so that each of the devices 102 and 116 includes video coding and decoding components. Therefore, the system 100 can support one-way or two-way video transmission between video devices 102 and 116, for example, for video streaming, video playback, video broadcasting, or video telephony.

[0049] In general, the video source 104 represents the source of video data (i.e., the original, unencoded video data) and provides a series of consecutive pictures (also referred to as "frames") of the video data to the video encoder 200, which encodes the data of the pictures. The video source 104 of the source device 102 may include a video capture device, such as a camera, a video archive containing previously captured original video, and / or a video feed interface that receives video from a video content provider. As a further alternative, the video source 104 may generate computer graphics-based data as the source video, or a combination of live video, archived video, and computer-generated video. In each case, the video encoder 200 encodes the captured, pre-captured, or computer-generated video data. The video encoder 200 may rearrange the images from the receiving order (sometimes referred to as the "display order") into the encoding and decoding order for encoding and decoding. The video encoder 200 may generate a bitstream including the encoded video data. The source device 102 may then output the encoded video data to the computer-readable medium 110 via the output interface 108 for reception or retrieval by, for example, the input interface 122 of the destination device 116.

[0050] The memory 106 of the source device 102 and the memory 120 of the destination device 116 represent general purpose memories. In some examples, the memories 106, 120 can store raw video data, for example, raw video from the video source 104 and raw, decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 can store software instructions that can be executed by, for example, the video encoder 200 and the video decoder 300, respectively. Although shown separately from the video encoder 200 and the video decoder 300 in this example, it should be understood that the video encoder 200 and the video decoder 300 can also include internal memories for functionally similar or equivalent purposes. In addition, the memories 106, 120 can store, for example, encoded video data output from the video encoder 200 and input to the video decoder 300. In some examples, portions of the memories 106, 120 can be allocated as one or more video buffers, for example, to store raw, decoded and / or encoded video data.

[0051] The computer-readable medium 110 may represent any type of medium or device capable of transmitting the encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium to enable the source device 102 to send the encoded video data directly to the destination device 116 in real time (e.g., via a radio frequency network or a computer-based network). The output interface 108 may modulate a transmission signal including the encoded video data, and the input interface 122 may demodulate the received transmission signal according to a communication standard such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include a router, a switch, a base station, or any other device that helps facilitate communication from the source device 102 to the destination device 116.

[0052] In some examples, source device 102 may output the encoded data from output interface 108 to storage device 112. Similarly, destination device 116 may access the encoded data from storage device 112 via input interface 122. Storage device 112 may include any of a variety of distributed or locally accessed data storage media, such as a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium for storing encoded video data.

[0053] In some examples, source device 102 may output encoded video data to file server 114 or another intermediate storage device that may store encoded video generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or downloading. File server 114 may be any type of server device capable of storing encoded video data and sending the encoded video data to destination device 116. File server 114 may represent a network server (e.g., for a website), a file transfer protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. Destination device 116 may access the encoded video data from file server 114 via any standard data connection including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.) suitable for accessing encoded video data stored on file server 114, or a combination of both. File server 114 and input interface 122 may be configured to operate according to a streaming protocol, a downloading transmission protocol, or a combination thereof.

[0054] Output interface 108 and input interface 122 may represent wireless transmitters / receivers, modems, wired network components (e.g., Ethernet cards), wireless communication components that operate according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 may be configured to transmit data, such as encoded video data, according to a cellular communication standard (e.g., 4G, 4G-LTE (Long Term Evolution), LTE Advanced, 5G, etc.). In some examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 may be configured to transmit data, such as encoded video data, according to other wireless standards (e.g., IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee TM ), Bluetooth TM Standards, etc.) to transmit data such as encoded video data. In some examples, source device 102 and / or destination device 116 may include corresponding system-on-chip (SoC) devices. For example, source device 102 may include a SoC device to perform functions belonging to video encoder 200 and / or output interface 108, and destination device 116 may include a SoC device to perform functions belonging to video decoder 300 and / or input interface 122.

[0055] The techniques disclosed herein may be applied to video encoding and decoding to support any of a variety of multimedia applications, such as over-the-air television broadcasting, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video encoded onto a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

[0056] The input interface 122 of the destination device 116 receives an encoded video bitstream from the computer-readable medium 110 (e.g., the storage device 112, the file server 114, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 (e.g., syntax elements with values ​​describing characteristics and / or processing of video blocks or other codec units (e.g., slices, pictures, groups of pictures, sequences, etc.) and used by the video decoder 300. The display device 118 displays decoded pictures of the decoded video data to a user. The display device 118 may represent any of a variety of display devices, such as a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, an organic light emitting diode display (OLED), or another type of display device.

[0057] although Figure 1 Not shown, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or an audio decoder, and may include appropriate MUX-DEMUX units, or other hardware and / or software, to process a multiplexed stream including both audio and video in a common data stream. If applicable, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol or other protocols such as the User Datagram Protocol (UDP).

[0058] The video encoder 200 and the video decoder 300 can each be implemented as any of a variety of suitable encoder and / or decoder circuits, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, software, hardware, firmware, or any combination thereof. When these techniques are partially implemented in software, the device can store the instructions of the software in a suitable non-temporary computer-readable medium, and use one or more processors to execute the instructions in hardware to perform the techniques of the present disclosure. Each of the video encoder 200 and the video decoder 300 can be included in one or more encoders or decoders, any of which can be integrated as part of a combined encoder / decoder (CODEC) in a corresponding device. The device including the video encoder 200 and / or the video decoder 300 can include an integrated circuit, a microprocessor, and / or a wireless communication device such as a cellular phone.

[0059] The video encoder 200 and the video decoder 300 may operate in accordance with a video codec standard (e.g., ITU-T H.265, also known as High Efficiency Video Codec (HEVC)), or an extension thereof (e.g., a multi-view and / or scalable video codec extension). Alternatively, the video encoder 200 and the video decoder 300 may operate in accordance with other proprietary or industry standards (e.g., ITU-T H.266, also known as Versatile Video Codec (VVC)). A draft of the VVC standard is described in Bross et al., “Versatile Video Codec (Draft 5)”, Joint Video Experts Team (JVET) of ITU-T SG 16WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 14th Meeting: Geneva, Switzerland, March 19-27, 2019, JVET-N1001-v7 (hereinafter referred to as “VVC Draft 5”). Bross et al., "Versatile Video Codec (Draft 9)", Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 18th Meeting: by Teleconference, April 15-24, 2020, JVET-R2001-v8 (hereinafter referred to as "VVC Draft 9") describes the latest draft of the VVC standard. However, the techniques of the present disclosure are not limited to any particular codec standard.

[0060] Typically, the video encoder 200 and the video decoder 300 can perform block-based picture encoding and decoding. The term "block" generally refers to a structure that includes data to be processed (e.g., to be encoded, to be decoded, or otherwise used for encoding and / or decoding processes). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Typically, the video encoder 200 and the video decoder 300 can encode and decode video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, the video encoder 200 and the video decoder 300 can encode and decode luminance and chrominance components instead of encoding and decoding red, green, and blue (RGB) data of samples of a picture, where the chrominance components may include red hue and blue hue chrominance components. In some examples, the video encoder 200 converts the received RGB format data into a YUV representation before encoding, and the video decoder 300 converts the YUV representation into an RGB format. Alternatively, a pre-processing and post-processing unit (not shown) can perform these conversions.

[0061] The present disclosure may generally refer to the encoding and decoding of a picture (e.g., encoding and decoding) to include the process of encoding or decoding the data of a picture. Similarly, the present disclosure may refer to the encoding and decoding of a block of a picture to include the process of encoding or decoding the data of the block (e.g., prediction and / or residual encoding and decoding). The encoded video bitstream generally includes a series of values ​​of syntax elements that represent codec decisions (e.g., codec mode) and the partitioning of the picture into blocks. Therefore, references to encoding and decoding a picture or block should generally be understood as encoding and decoding the values ​​of the syntax elements that form the picture or block.

[0062] HEVC defines various blocks, including codec units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video codec (e.g., video encoder 200) partitions a codec tree unit (CTU) into CUs according to a quadtree structure. That is, the video codec partitions the CTU and CU into four equal, non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without child nodes may be referred to as a "leaf node," and the CU of such a leaf node may include one or more PUs, and / or one or more TUs. The video codec may further partition the PU and TU. For example, in HEVC, the residual quadtree (RQT) represents the partitioning of the TU. In HEVC, PU represents inter-frame prediction data, and TU represents residual data. The intra-predicted CU includes intra-frame prediction information such as an intra-frame mode indication.

[0063] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to VVC. According to VVC, a video codec (e.g., the video encoder 200) partitions a picture into multiple codec tree units (CTUs). The video encoder 200 may partition the CTU according to a tree structure, such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure removes the concept of multiple partition types (e.g., the separation between CU, PU, ​​and TU of HEVC). The QTBT structure includes two levels: a first level for partitioning according to quadtree partitioning, and a second level for partitioning according to binary tree partitioning. The root node of the QTBT structure corresponds to the CTU. The leaf nodes of the binary tree correspond to codec units (CUs).

[0064] In the MTT partitioning structure, blocks can be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of ternary tree (TT) partitioning. A ternary tree partitioning is a partitioning in which a block is divided into three sub-blocks. In some examples, the ternary tree partitioning divides a block into three sub-blocks without dividing the original block by the center. The partitioning types in MTT (e.g., QT, BT, and TT) can be symmetric or asymmetric.

[0065] In some examples, the video encoder 200 and the video decoder 300 may use a single QTBT or MTT structure to represent each of the luma and chroma components, while in other examples, the video encoder 200 and the video decoder 300 may use two or more QTBT or MTT structures, such as one QTBT / MTT structure for the luma component and another QTBT / MTT structure for the two chroma components (or two QTBT / MTT structures for corresponding chroma components).

[0066] The video encoder 200 and the video decoder 300 may be configured to use quadtree segmentation, QTBT segmentation, MTT segmentation, or other segmentation structures in accordance with HEVC. For purposes of explanation, the description of the disclosed technology is presented with respect to QTBT segmentation. However, it should be understood that the disclosed technology may also be applied to a video codec configured to use quadtree segmentation or other types of segmentation.

[0067] The present disclosure may use "N×N" and "N by N" interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in terms of vertical and horizontal dimensions, for example, 16×16 samples or 16 by 16 samples. Typically, a 16×16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an N×N CU typically has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. The samples in a CU may be arranged in rows and columns. In addition, a CU does not necessarily have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include N×M samples, where M is not necessarily equal to N.

[0068] The video encoder 200 encodes the video data of the CU representing the prediction and / or residual information and other information. The prediction information indicates how to predict the CU in order to form the prediction block of the CU. The residual information generally indicates the sample-by-sample difference between the CU sample before encoding and the prediction block.

[0069] In order to predict a CU, the video encoder 200 can generally form a prediction block of the CU by inter-frame prediction or intra-frame prediction. Inter-frame prediction generally refers to predicting a CU from data of a previously coded picture, while intra-frame prediction generally refers to predicting a CU from previously coded data of the same picture. In order to perform inter-frame prediction, the video encoder 200 can use one or more motion vectors to generate a prediction block. The video encoder 200 can generally perform a motion search to identify a reference block that closely matches the CU, for example, with respect to the difference between the CU and the reference block. The video encoder 200 can calculate a difference metric using the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean square difference (MSD), or other such difference calculations to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 can use unidirectional prediction or bidirectional prediction to predict the current CU.

[0070] Some examples of VVC also provide an affine motion compensation mode, which can be considered an inter-frame prediction mode. In the affine motion compensation mode, the video encoder 200 can determine two or more motion vectors representing non-translational motion (e.g., zooming in or out, rotation, perspective motion, or other irregular motion types).

[0071] To perform intra prediction, the video encoder 200 can select an intra prediction mode to generate a prediction block. Some examples of VVC provide sixty-seven intra prediction modes, including various directional modes, as well as a planar mode and a DC mode. Typically, the video encoder 200 selects an intra prediction mode that describes a neighboring sample of a current block (e.g., a block of a CU) from which the sample of the current block is predicted. Assuming that the video encoder 200 encodes and decodes CTUs and CUs in a raster scan order (from left to right, from top to bottom), such samples can typically be above, above left, or to the left of the current block in the same picture as the current block.

[0072] The video encoder 200 encodes data representing the prediction mode of the current block. For example, for the inter-frame prediction mode, the video encoder 200 may encode data representing which of the various available inter-frame prediction modes is used and the motion information of the corresponding mode. For example, for unidirectional or bidirectional inter-frame prediction, the video encoder 200 may encode the motion vector using advanced motion vector prediction (AMVP) or merge mode. The video encoder 200 may use a similar mode to encode the motion vector of the affine motion compensation mode.

[0073] After prediction, such as intra-frame prediction or inter-frame prediction of a block, the video encoder 200 can calculate residual data for the block. The residual data (such as the residual block of the current block being encoded) represents the sample-by-sample difference between the block and the predicted block formed using the corresponding prediction mode of the block. The video encoder 200 can apply one or more transforms to the residual block to produce transformed data in a transform domain rather than a sample domain. For example, the video encoder 200 can apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. In addition, the video encoder 200 can apply a secondary transform after the primary transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc. The video encoder 200 generates transform coefficients after applying one or more transforms.

[0074] Transforming the residual block to produce transform data in the transform domain rather than the sample domain is not necessary in all examples. In some examples, the transform may be skipped (e.g., in a transform skip mode for the current block). In such examples, the video encoder 200 may perform further operations on the residual values ​​(e.g., residual data) of the residual block. For example, the transform data (e.g., where a transform from the sample domain to the transform domain occurs) may produce transform coefficients, and the video encoder may perform operations on the transform coefficients.

[0075] When a transform is skipped, the video encoder 200 may perform operations on the residual values. For example, in the example of skipping a transform, the coefficients may correspond to residual data (e.g., the difference between the samples of the current block and the predicted block). For example, in the case of skipping a transform, the value of the first coefficient may be the first residual value in the residual block, the value of the second coefficient may be the second residual value in the residual block, and so on. In the following description, transform coefficients are described, but rather than using transform coefficients, the technique may utilize coefficient values ​​in the case of skipping a transform. In other words, the example techniques described for transform coefficients may also be applied to coefficient values ​​for skipping a transform.

[0076] As described above, after any transform used to generate the coefficients or after skipping a transform, the video encoder 200 can perform quantization of the coefficients. Quantization generally refers to the process of quantizing the coefficients to minimize the amount of data used to represent the coefficients, thereby providing further compression. By performing the quantization process, the video encoder 200 can reduce the bit depth associated with some or all of the coefficients. For example, the video encoder 200 can round down an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 can perform a bit-by-bit right shift on the value to be quantized.

[0077] In one or more examples, the video encoder 200 may skip quantization. For example, in some examples, the video encoder 200 may skip quantization if transform skip is enabled. In the following description, although quantization is described as occurring, it should be understood that in some examples, quantization may also be skipped.

[0078] After quantization, the video encoder 200 can scan the coefficients to produce a one-dimensional vector from a two-dimensional matrix including the quantized coefficients. The scan can be designed to place coefficients with higher energy (and therefore lower frequency) at the front of the vector and lower energy (and therefore higher frequency) coefficients at the back of the vector. However, in the example of skip transform, the scan may not place the higher energy coefficients at the front of the vector, but place the lower energy coefficients at the back of the vector.

[0079] In some examples, the video encoder 200 may scan the coefficients using a predefined scan order to produce a serialized vector, and then encode the coefficients of the vector. In other examples, the video encoder 200 may perform adaptive scanning. After scanning the coefficients to form a one-dimensional vector, the video encoder 200 may, for example, encode the one-dimensional vector according to context adaptive binary arithmetic coding (CABAC) (e.g., context-based coding) and / or bypass coding (e.g., not context-based coding). The video encoder 200 may also entropy encode the values ​​of the syntax elements describing the metadata associated with the encoded video data for use by the video decoder 300 in decoding the video data.

[0080] To perform CABAC, the video encoder 200 may assign context within a context model to a symbol to be transmitted. For example, the context may relate to, for example, whether the neighboring values ​​of the symbol are zero values. The probability determination may be based on the context assigned to the symbol.

[0081] The video encoder 200 may also generate syntax data (e.g., in a picture header, a block header, a slice header), such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, or other syntax data, such as a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS) to the video decoder 300. The video decoder 300 may also decode such syntax data to determine how to decode the corresponding video data.

[0082] In this way, the video encoder 200 can generate a bitstream that includes the encoded video data, such as syntax elements describing the partitioning of a picture into blocks (e.g., CUs) and prediction and / or residual information of the blocks. Finally, the video decoder 300 can receive the bitstream and decode the encoded video data.

[0083] In general, the video decoder 300 performs a process that is the reverse of the process performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 may use CABAC to decode the values ​​of the syntax elements of the bitstream in a manner substantially similar to but reverse to the CABAC encoding process of the video encoder 200. The syntax elements may define partitioning information of the picture into CTUs, and partitioning of each CTU according to a corresponding partitioning structure (e.g., a QTBT structure) to define CUs of the CTU. The syntax elements may also define prediction and residual information for a block (e.g., a CU) of video data.

[0084] The residual information may be represented by, for example, a quantized transform coefficient (or a quantized coefficient in the case of skipping transform or a coefficient in the case of skipping transform and quantization). For ease of description, in the present disclosure, the term coefficient may include examples in which quantization is skipped, transform is skipped, quantization and transform are skipped, quantization is skipped but transform is performed, or quantization is performed but transform is skipped. In one or more examples, in the techniques described in the present disclosure, these examples may be performed with coefficients in which transform is skipped but quantization may or may not be skipped.

[0085] The video decoder 300 may inverse quantize (if necessary) and inverse transform (if necessary) the quantized transform coefficients of the block to reproduce a residual block for the block. The video decoder 300 uses the signaled prediction mode (intra-frame or inter-frame prediction) and related prediction information (e.g., motion information for inter-frame prediction) to form a prediction block for the block. The video decoder 300 may then combine (e.g., add) the prediction block and the residual block (on a sample-by-sample basis) to reproduce (e.g., reconstruct) the original block. The video decoder 300 may perform additional processing, such as performing a deblocking process to reduce visual artifacts along block boundaries.

[0086] According to the techniques of the present disclosure, a video codec (e.g., video encoder 200 or video decoder 300) may be configured to perform operations in an example in which transform skipping is enabled and encodes (e.g., encodes or decodes) coefficient values. For example, the video codec may determine that transform skipping is enabled and encodes coefficient values ​​of coefficients in a residual block based on one or more coefficient values ​​of one or more neighboring coefficients. In some examples, the video codec may encode and decode one or more syntax elements in an interleaved manner on a coefficient-by-coefficient basis for coefficients in the residual block in a first pass, and, after the first pass, encode and decode the syntax elements on a coefficient-by-coefficient basis for coefficients in the residual block in a second pass.

[0087] In one or more examples, the video codec may encode and decode coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block in a first pass. The coefficient information for a coefficient includes a significance flag indicating whether a value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is odd or even; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether an absolute value of the coefficient is greater than a corresponding threshold.

[0088] Table 1 below shows examples of coefficient values ​​and the corresponding flags signaled for each coefficient. The boxes marked "NA" are used for flags that are not signaled for the corresponding coefficient values. In Table 1, Rem stands for Residual, and it is not signaled as a flag but as a value. In addition, in Table 1, the value is positive, which is why the symbol value is 0.

[0089] Table 1.

[0090]

[0091]

[0092] To encode and decode coefficient information (e.g., a significance flag indicating whether the value of the coefficient is non-zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags) in an interlaced manner, the video encoder 200 may signal such coefficient information for a first coefficient. Then, the video encoder 200 may signal such coefficient information for a second coefficient, and so on. In contrast, in a bit-by-bit plane (e.g., a non-interlaced manner), the video encoder 200 may signal a significance flag for each coefficient in a residual block of a current block, and then signal a parity flag for each coefficient in a residual block of the current block, and so on.

[0093] However, in one or more examples described in the present disclosure, the video encoder 200 may signal the coefficient information in an interleaved manner in a first pass. After the first pass, the video codec may encode and decode the residual information of the coefficients in the residual block of the current block in a second pass (e.g., on a coefficient-by-coefficient basis, but not limited to a coefficient-by-coefficient basis).

[0094] In order to encode and decode in an interlaced manner, the video decoder 300 may parse coefficient information on a coefficient-by-coefficient basis for coefficients in a residual block of a current block in a first pass. For example, the video decoder 300 may parse a significance flag indicating whether the value of the coefficient is not zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags in the first pass. The video decoder 300 may parse the example coefficient information for one coefficient, then parse the example coefficient information for the next coefficient, and so on, thereby parsing the coefficient information in an interlaced manner on a coefficient-by-coefficient basis for the coefficients in the current residual block in the first pass. After the first pass, in order to encode and decode the residual information, the video decoder 300 may parse the residual information of the coefficients in the residual block of the current block in a second pass.

[0095] Not all example coefficient information may be signaled and parsed in all examples. For example, if the coefficient value is 0, the video encoder 200 may signal a validity flag as 0, and the video decoder 300 may parse the validity flag as 0 (e.g., indicating that the value of the coefficient is zero). In this example, the video encoder 200 may not signal, and the video decoder 300 may not receive parity or sign information or any greater than flags. As another example, if the coefficient value is 1.8, the video encoder 200 may signal, and the video decoder 300 may parse the validity flag, parity flag, sign flag, and greater than 1 flag, but the video encoder 200 may not signal, and the video decoder 300 may not parse any other greater than flags.

[0096] It may be beneficial to encode the coefficient information in an interleaved manner in a first pass and the residual information in a second pass. In some cases, context-based coding can be used to encode the coefficient information encoded in an interleaved manner, and bypass coding can be used to encode the residual information. Context-based coding refers to examples in which context is used to determine the probability that a binary bit will be 0 or 1, and the probability is used to encode or decode the value. Examples of context-based coding include CABAC. Bypass coding refers to examples in which context is not used to determine the probability (or the probability is assumed to be 0.5).

[0097] In context-based codecs, there may be a codec bin count limit that sets the maximum number of bins in a residual block that may be decoded based on the context. An example of a codec bin count limit is 2*block width of the current block*block height of the current block, or 1.75*block width of the current block*block height of the current block. However, there may be other examples of codec bin count limits.

[0098] For rate-distortion optimized quantization (RDOQ), the video encoder 200 may need to determine how many bits will be decoded based on context for the current coefficient, and how many bits will remain after the current coefficient (e.g., the cumulative total of bits used for context-based decoding minus the bit count limit of the codec). For RDOQ, the video encoder 200 may determine on a coefficient-by-coefficient basis how many bits will be decoded based on context for the current coefficient, and how many bits will remain after the current coefficient. By encoding and decoding in an interleaved manner, the video encoder 200 is able to determine how many bits will be used for context-based coding for the current coefficient before the video encoder 200 begins to determine how many bits will be used for context-based coding for the next coefficient. By processing bit-plane by bit-plane, the video encoder 200 may not be able to determine how many bits will be used for the current coefficient until the video encoder 200 processes all coefficients, which may negatively affect the speed at which the video encoder 200 can encode and signal the information needed to reconstruct the current block.

[0099] In one or more examples, examples of coefficient information based on context coding include a significance flag indicating whether the value of the coefficient is non-zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold (e.g., abs_level_gtx_flag[n][j] specifies whether the absolute value of the coefficient level is greater than (j<<1)+1). The residual information can be encoded and decoded in bypass mode. Therefore, the residual information can be encoded and decoded in a second pass after the first pass including the coefficient information based on context coding, because the encoding and decoding of the residual information does not affect whether the binary bit count limit of the codec is reached (e.g., because the residual information is bypassed).

[0100] As described above, there may be context bit count limits. Thus, in some examples, to encode and decode in an interlaced manner, the video codec may encode and decode coefficient information in an interlaced manner on a coefficient-by-coefficient basis until the codec bit count limit is reached, and after reaching the codec bit count limit, bypass encode and decode the coefficient information in an interlaced manner on a coefficient-by-coefficient basis. For example, if during encoding and decoding of a coefficient, the video encoder 200 and the video decoder 300 reach the codec bit count limit after encoding and decoding a significance flag, the video encoder 200 and the video decoder 300 may bypass encode and decode the remaining coefficient information for the coefficient and subsequent coefficients.

[0101] In addition, to encode and decode the residual information, the video codec can be configured to encode and decode information indicating the residual absolute value of the coefficient. However, in some examples, if the video codec reaches the binary bit count limit of the codec during the encoding and decoding of a particular coefficient, the video codec can encode and decode the values ​​of the coefficients after the particular coefficient as part of a second pass. For example, instead of encoding and decoding the greater than flag for the coefficient after the particular flag, the video codec can encode and decode the residual information of the coefficient after the particular flag, where the residual information is the actual value of the coefficient or the absolute value of the coefficient minus 1.

[0102] The present disclosure may generally refer to "signaling" certain information such as syntax elements. The term "signaling" may generally refer to the communication of values ​​of syntax elements and / or other data used to decode encoded video data. That is, the video encoder 200 may signal the values ​​of syntax elements in a bitstream. Generally, signaling refers to generating values ​​in a bitstream. As described above, the source device 102 may transmit the bitstream to the destination device 116 in substantially real time, or (such as may occur when the syntax elements are stored to the storage device 112 for later retrieval by the destination device 116) transmit the bitstream to the destination device 116 in non-real time.

[0103] Figure 2A and Figure 2B is a conceptual diagram illustrating an example quadtree binary tree (QTBT) structure 130 and a corresponding codec tree unit (CTU) 132. Solid lines represent quadtree partitions and dashed lines indicate binary tree partitions. At each partition (i.e., non-leaf) node of the binary tree, a flag is signaled to indicate which partition type (i.e., horizontal or vertical) is used, where 0 indicates horizontal partitioning and 1 indicates vertical partitioning in this example. For quadtree partitioning, there is no need to indicate the partition type because the quadtree node divides the block horizontally and vertically into 4 sub-blocks of equal size. Therefore, the video encoder 200 can encode syntax elements (e.g., partition information) for the region tree level (i.e., solid line) of the QTBT structure 130 and syntax elements (e.g., partition information) for the prediction tree level (i.e., dashed line) of the QTBT structure 130, and the video decoder 300 can decode it. The video encoder 200 may encode video data (eg, prediction and transform data) of a CU represented by a terminal leaf node of the QTBT structure 130 , and the video decoder 300 may decode it.

[0104] generally, Figure 2BThe CTU 132 may be associated with parameters defining the size of blocks corresponding to nodes of the QTBT structure 130 at the first level and the second level. These parameters may include a CTU size (indicating the size of the CTU 132 in a sample), a minimum quadtree size (MinQTSize, indicating the minimum allowed quadtree leaf node size), a maximum binary tree size (MaxBTSize, indicating the maximum allowed binary tree root node size), a maximum binary tree depth (MaxBTDepth, indicating the maximum allowed binary tree depth), and a minimum binary tree size (MinBTSize, indicating the minimum allowed binary tree leaf node size).

[0105] The root node of the QTBT structure corresponding to the CTU may have four child nodes at the first level of the QTBT structure, each of which may be segmented according to a quadtree segmentation. That is, the nodes at the first level are either leaf nodes (without child nodes) or have four child nodes. The example of the QTBT structure 130 represents such a node as including a parent node and a child node with a solid line for branching. If the nodes at the first level are not larger than the maximum allowed binary tree root node size (MaxBTSize), the nodes may be further segmented by the corresponding binary tree. The binary tree partitioning of a node may be iterated until the node generated by the partitioning reaches the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example of the QTBT structure 130 represents such a node as having a dotted line for branching. The binary tree leaf node is called a codec unit (CU), which is used for prediction (e.g., intra-picture or inter-picture prediction) and transformation without any further segmentation. As described above, a CU may also be referred to as a "video block" or "block".

[0106] In one example of a QTBT partitioning structure, the CTU size is set to 128×128 (luminance sample and two corresponding 64×64 chrominance samples), MinQTSize is set to 16×16, MaxBTSize is set to 64×64, MinBTSize (for both width and height) is set to 4, and MaxBTDepth is set to 4. Quadtree partitioning is first applied to the CTU to generate quadtree leaf nodes. Quadtree leaf nodes can have sizes from 16×16 (i.e., MinQTSize) to 128×128 (i.e., CTU size). If the leaf quadtree node is 128×128, it will not be further divided by the binary tree because its size exceeds MaxBTSize (i.e., 64×64 in this example). Otherwise, the leaf quadtree node will be further divided by the binary tree. Therefore, the quadtree leaf node is also the root node of the binary tree and has a binary tree depth of 0. When the binary tree depth reaches MaxBTDepth (4 in this case), no further splitting is allowed. When a binary tree node has a width equal to MinBTSize (4 in this case), it means that no further horizontal splitting is allowed. Similarly, a binary tree node with a height equal to MinBTSize means that no further vertical splitting is allowed for the binary tree node. As described above, the leaf nodes of the binary tree are called CUs and are further processed according to prediction and transformation without further segmentation.

[0107] As described above, the example techniques described in the present disclosure relate to coefficient encoding and decoding of transform skip mode. For example, the present disclosure describes an example of a coefficient encoding and decoding method targeting the encoding and decoding of transform skip mode. For example, the present disclosure relates to an entropy decoding process for converting a binary representation into a series of non-binary valued quantized coefficients. The corresponding entropy encoding process (the reverse process of entropy decoding) is also part of the present disclosure. For example, the entropy encoding process can be performed as the reverse process of the decoding process. The techniques described in the present disclosure can be applied to any existing video codec, such as High Efficiency Video Codec (HEVC), or can be a codec tool in a standard currently under development, such as Versatile Video Codec (VVC), and can be applied to other future video codec standards.

[0108] The correlation between transform skip (TS) coefficients is described below. In transform skip mode, the transform process is skipped for the residual signal before the quantization step at the encoder side (e.g., video encoder 200) and before the inverse transform step after the dequantization step at the decoder side (e.g., video decoder 300). The characteristics of the untransformed residual signal are very different from those of the transformed signal.

[0109] In the case of transform skipping, the coefficient is more correlated with its neighboring coefficients. As a result, the level values ​​of adjacent coefficients (e.g., the actual values ​​of the coefficients) and the sign information of the adjacent coefficients are more correlated. The encoding and decoding of level (e.g., greater than flag) and sign information in transform skip (TS) coefficient encoding and decoding is proposed in B. Bross, T. Nguyen, P. Keydel, H. Schwarz, D. Marpe, T. Wiegand, "Non-CE8: Unified transform type signaling and residual coding and decoding for transform skipping", JVET document JVET-M0464, Marrakech, MA, January 2019 (herein JVET-M0464). The present disclosure describes examples of exploiting signal characteristics for more efficient encoding and decoding.

[0110] The following describes the encoding and decoding of transform skip (TS) coefficients. In some techniques, the transform skip residual codec, sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag syntax elements are interleaved and decoded coefficient by coefficient in the first pass. Starting from the second pass, abs_level_gtX_flags (currently up to 5, and corresponding passes), the syntax elements are encoded and decoded bit by bit plane. The following is an example of the definition of the syntax elements.

[0111] sig_coeff_flag[xC][yC] specifies, for a transform coefficient position (xC, yC) within the current transform block, whether the corresponding transform coefficient level at that position (xC, yC) is non-zero.

[0112] abs_level_gtX_flag[n] specifies whether the absolute value of the transform coefficient level (at scan position n) is greater than X. Examples of abs_level_gtX_flag include abs_level_gt1_flag, abs_level_gt2_flag, etc. Another example of abs_level_gtX_flag is: abs_level_gtx_flag[n][j] specifies whether the absolute value of the transform coefficient level (at scan position n) is greater than (j<<1)+1. When abs_level_gtx_flag[n][j] does not exist, it is inferred to be equal to 0.

[0113] par_level_flag[n] specifies the parity (eg, odd or even) of the transform coefficient level at scan position n.

[0114] coeff_sign_flag[n] specifies the sign of the transform coefficient level at scan position n.

[0115] In all passes, if the number of bin count limits of conventional coding is not reached, the syntax element is encoded and decoded as bins of conventional coding. If the bin count limit of conventional coding is reached during the coding of the pass, the rest of the syntax element will be bypassed. In the last pass, the abs_remainder part of the coefficient is encoded and decoded using Rice code. Rice code is an example of bypass coding (e.g., context-based coding is not used). An example definition of abs_remainder is that abs_remainder[n] is the residual absolute value of the transform coefficient level encoded and decoded with Golomb-Rice code at scan position n. There is an upper limit on the number of bins of conventional coding that can be used in a TS block (e.g., a current block encoded in transform skip mode).

[0116] In one example, the present disclosure describes coefficient coding based on level mapping. In the transform skip residual coding of JVET-M0464, the coefficient absolute level absCoeffLevel is coded using sig_coeff_flag, abs_level_gtX_flags, par_level_flag, and abs_remainder values ​​to form the final absolute transform coefficient value, where X can be 1, .., 5 (or some other cutoff value C). In this example, the absCoeffLevel value can be constructed in the following manner: absCoeffLevel = 1 + abs_level_gt1_flag + par_level_flag + 2*(abs_level_gt2_flag + abs_level_gt3_flag + ... + abs_level_gtC_flag) + 2*abs_remainder.

[0117] In one or more examples described in the present disclosure, instead of or in addition to directly representing absCoeffLevel as in JVET-M0464, absCoeffLevel is mapped on the encoder side (e.g., video encoder 200) to a modified level to be encoded and decoded as described below, and is inversely mapped on the decoder side (e.g., video decoder 300) as described below.

[0118] The absCoeffLevel information of the left and above coefficients is used to perform the mapping. In this case, let X0 represent the absolute coefficient level to the left of the current coefficient, and let X1 represent the absolute coefficient level of the above coefficient. In order to represent the coefficient with the absolute coefficient level absCoeffLevel, the mapped absCoeffMod is encoded and decoded as follows:

[0119] For Video Encoder 200:

[0120] pred=min(X0,X1)==0? max(X0,X1):min(X0,X1);

[0121] if(absCoeff == pred)

[0122] {

[0123] absCoeffMod = 1;

[0124] }

[0125] else

[0126] {

[0127] absCoeffMod = (absCoeff <pred)?absCoeff+1:absCoeff;

[0128] }

[0129] In the above pseudocode, if min(X0, X1) = 0, then max(X0, X1) is used as pred; otherwise, min(X0, X1) is used as pred. If the absolute value of the coefficient to be encoded is equal to the predictor pred, the modified level absCoeffMod is set to 1; otherwise, if the absolute value of the coefficient is less than the predictor, the value to be encoded is increased by 1; otherwise, the absCoeff value is not modified.

[0130] For the video decoder 300:

[0131] pred=min(X0,X1)==0? max(X0,X1):min(X0,X1);

[0132] if(absCoeffMod==1&&pred>0)

[0133] {

[0134] absCoeff = pred;

[0135] }

[0136] else

[0137] {

[0138] absCoeff=absCoeffMod–(absCoeffMod<=pred);

[0139] }

[0140] An example of interleaved coefficient coding is described below. In some examples, the video encoder 200 and / or the video decoder 300 may convert all codings of the syntax elements to codings of abs_remainder in an interleaved manner, rather than dividing them into several bit planes. The TS residual coding is changed so that sig_coeff_flag, par_level_flag, coeff_sign_flag, and all abs_level_gtX_flags are coded and decoded in a coefficient-by-coefficient interleaved manner in the first pass. After the first pass, abs_remainder is coded and decoded coefficient by coefficient. In some examples, when the binary bit count limit of the conventional coding is reached, the remaining syntax elements are coded and decoded in bypass mode.

[0141] For example, a video codec (e.g., video encoder 200 and video decoder 300) may encode and decode coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block in a first pass. The coefficient information of a coefficient includes a significance flag (e.g., sig_coeff_flag) indicating whether the value of the coefficient is non-zero, a parity flag (e.g., par_level_flag) indicating whether the value of the coefficient is odd or even, a sign flag (e.g., coeff_sign_flag) indicating whether the value of the coefficient is positive or negative, and one or more greater than flags (e.g., abs_level_gtX_flags). After the first pass, the video codec may encode and decode the residual information (e.g., abs_reminader) of the coefficients in the residual block of the current block in a second pass.

[0142] In some examples, to encode and decode the coefficient information in an interleaved manner, the video codec may perform context-based encoding and decoding of the coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec bit count limit is reached. The video codec may bypass encoding and decoding of the coefficient information in an interleaved manner on a coefficient-by-coefficient basis after the codec bit count limit is reached.

[0143] Figure 3 is a conceptual diagram showing an example of encoding and decoding coefficient information of a coefficient. Figure 3 Coefficient 0 to coefficient N-1 are shown. In this example, in the first pass, the video codec can encode and decode the significance flag, sign flag, gt1 flag, parity flag, and gt2-gt5 flags of coefficient 0 to coefficient N-1 in an interleaved manner. The gt1-gt5 flag is an abbreviation of abs_level_gtX_flags, where X is equal to 1, 2, 3, 4, or 5. gt1-gt5 or abs_level_gtX_flags may also be referred to as "greater than" flags.

[0144] In a first pass through the coefficients, the video codec may encode and decode the significance flag, sign flag, gt1 flag, parity flag, and gt2–gt5 flags of coefficient 0, and then, still in a first pass through the coefficients, the video codec may encode and decode the significance flag, sign flag, gt1 flag, parity flag, and gt2–gt5 flags of coefficient 1, and so on. For example, in a first pass through the coefficients, the video encoder 200 may signal, and the video decoder 300 may parse, the significance flag, sign flag, gt1 flag, parity flag, and gt2–gt5 flags of coefficient 0, followed by the significance flag, sign flag, gt1 flag, parity flag, and gt2–gt5 flags of coefficient 1 as part of a first pass through the coefficients, up to coefficient N−1.

[0145] After the first pass, the video codec may encode and decode the residual information of coefficient 0 to coefficient N-1. For example, in the second pass, the video encoder 200 may signal and the video decoder 300 may parse the residual information of coefficient 0 to coefficient N-1. Figure 3 In the example shown, when performing context-based encoding and decoding of coefficient information in a first pass, the video encoder 200 and the video decoder 300 may not have reached the binary bit count limit of the encoding and decoding.

[0146] Figure 4 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient. Figure 4 In an example of , the video codec may encode and decode all components of a coefficient (including the residual) in an interleaved manner. For example, the video codec may encode and decode coefficient information (e.g., a significance flag (e.g., sig_coeff_flag) indicating whether the value of the coefficient is non-zero, a parity flag (e.g., par_level_flag) indicating whether the value of the coefficient is odd or even, a sign flag (e.g., coeff_sign_flag) indicating whether the value of the coefficient is positive or negative, and one or more greater than flags (e.g., abs_level_gtX_flags)) and residual information in one pass (i.e., in the same pass), rather than encoding and decoding the coefficient information in a first pass and encoding and decoding the residual information in a second pass.

[0147] For example, Figure 4As shown, each coefficient can be divided into sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flags (X=2, 3, 4, 5) and abs_remainder. All syntax elements of a coefficient are coded before coding the next coefficient.

[0148] Figure 5 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient. Figure 5 In the example of , the encoding and decoding of sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, par_level_flag, abs_level_gtX_flags is divided into two passes. In the first pass, sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag are encoded and decoded. In the second pass, abs_level_gtX_flags and par_level_flag are encoded and decoded. par_level_flag can be after all abs_level_gtX_flags and is part of the second pass. In the third pass, as Figure 5 As shown, the video codec can encode and decode the residual information.

[0149] Figure 6 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient. Figure 6 In the example of , the syntax sig_coeff_flag, coeff_sign_flag, abs_level_gt1_flag, and abs_level_gt2_flag of all coefficients in a coefficient group (e.g., a residual block) are interleaved and decoded in the first pass. In the second pass, coefficient information: abs_level_gtX_flags (X=3, 4, 5) and par_level_flag are encoded and decoded. In the second pass, the video codec can encode and decode par_level_flag after all abs_level_gtX_flags. In the last pass (e.g., the third pass), the video codec can encode and decode the residual information (e.g., abs_remainder) of all coefficients in the coefficient group.

[0150] The present disclosure also describes an example of processing bypass codec after reaching a context bin limit (e.g., a bin count limit of a codec). As an example, the bin count limit of the codec is 2*block width*block height. As another example, the bin count limit of the codec is 1.75*block width*block height. In some techniques, if the bin count limit of the codec is reached, the video encoder 200 can separate the absolute value of the coefficient into abs_level_gt1_flag, par_level_flag, abs_level_gtX_flags (X=2, 3, 4, 5), and abs_remainder, and bypass codec each of these coefficient information. However, according to one or more examples described in the present disclosure, the video encoder 200 may encode the corresponding value of the coefficient after the specific coefficient, where the binary bit count limit of the codec is reached during or when the codec is completed, instead of bypassing the codec for each of abs_level_gt1_flag, par_level_flag, abs_level_gtX_flags (X=2, 3, 4, 5), and abs_remainder. As an example, the video encoder 200 may directly bypass the codec for the absolute value abs(coefficient value)−1, instead of bypassing the codec for each of abs_level_gt1_flag, par_level_flag, abs_level_gtX_flags (X=2, 3, 4, 5), and abs_remainder. For the coefficient after the specific coefficient that reaches the binary bit count limit of the codec, the video decoder 300 may bypass the decoding of the coefficient value (e.g., bypass codec based on the coefficient value or abs(coefficient value)−1). For example, the video encoder 200 and the video decoder 300 may utilize the Rice-Golomb codec of abs_remainder to encode and decode the absolute values ​​of coefficients after the bin count limit of the codec is reached and after sig_coeff_flag and coeff_sign_flag are bypassed for codec.

[0151] Rice-Golomb codec is a binarization scheme that converts a value into a series of binary bits that are either 1 or 0. In some examples, context-based codecs may be used when Rice-Golomb codecs are used. However, for the remainder, Rice-Golomb codecs are used and the binary bits are bypassed.

[0152] If the normal bit count is reached before the gt1 flag is encoded (e.g., the bit count limit of the codec), all remaining validity flags and sign flags are bypassed for encoding, and for valid coefficients after the bit count limit of the codec is reached, the remainder is encoded as the absolute value of the coefficient or the absolute value of the coefficient -1, without dividing the coefficient into gt1, par, gt2, ..., gt5 and the corresponding remainder. Therefore, in this example, for coefficients at and after the bit count limit of the codec is reached (e.g., coefficients after a specific coefficient, where the bit count limit of the codec is reached during encoding of the specific coefficient), the video encoder 200 and the video decoder 300 can bypass the codec validity flag and the sign flag, and bypass the codec remainder portion without utilizing the gtX flag and the parity flag. Example techniques for bypassing encoding include Rice-Golomb encoding.

[0153] If the codec's bit count limit is reached after encoding the coefficient's gt1 flag, the video encoder 200 and the video decoder 300 may bypass the remaining gtX and parity flags for the coefficient before switching to encoding the validity flag and the sign flag as bypass and encoding the remainder as a Rice-Golomb code. The example technique may be applied to various schemes that change the encoding and decoding order of the validity, sign, gt1, par, and gtX flags, wherein once the conventional bit count (e.g., the codec's bit count limit) is reached, for the remainder of the coefficient (including the current portion), only the validity flag and the sign flag are bypassed, and the remainder of the coefficient is represented by a Rice-Golomb codec value. Rice-Golomb codec is an example, and other types of binarization with bypass codec techniques, such as unary codecs, may also be used. In the present disclosure, the remainder information may refer to the remaining value after encoding and decoding a greater than flag.

[0154] In some examples, the parameters of the Rice-Golomb codec can be redesigned because it is expected to encode or decode larger values ​​when encoding or decoding the entire abs(coeff)–1 instead of the residual portion of abs(coeff). An example of a change to the Rice-Golomb design is as follows:

[0155] Let posX, posY be the position of the current coefficient, LeftCoeff be the left neighbor of the current coefficient, and AboveCoeff be the above neighbor of the current coefficient.

[0156] Let sum = 0

[0157] if(posX>0)

[0158] {

[0159] sum+=abs(LeftCoeff);

[0160] }

[0161] if(posY>0)

[0162] {

[0163] sum+=abs(AboveCoeff);

[0164] }

[0165] const uint32_t auiGoRicePars

[32] ={1,0,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3};

[0166] Use auiGoRicePars[min(sum,31)] as Rice-Golomb parameters.

[0167] Another example of deriving Rice-Golomb parameters for encoding abs(coeff)–1 uses a different table as auiGoRicePars: const uint32_t auiGoRicePars

[32] = {1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3}.

[0168] The example techniques described in this disclosure can be combined together. For example, Figure 7 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient. Figure 7 In the example of FIG. 1 , the video encoder 200 and the video decoder 300 may perform a process similar to Figure 4 A technique that is a combination of an example in which a coefficient value or a coefficient value −1 is directly bypassed for decoding.

[0169] For example, in Figure 7 In the example shown, all components of each coefficient are encoded and decoded in an interleaved manner, and if one of the coefficients (e.g. Figure 7Coeff 2 in , when encoding or decoding, the binary bits of the conventional encoding and decoding are used up (for example, the binary bit count limit of the codec is reached), then starting from the next coefficient, after encoding or decoding the sig flag (for example, the validity flag) and the sign flag, the residual information (for example, abs(coeff)-1) may not be divided before being encoded and decoded. In other words, for coefficients after Coeff2 (for example, Coeff3 to CoeffN-1), the video encoder 200 and the video decoder 300 can bypass encoding or decoding the validity flag (for example, sig_coeff_flag) and the sign flag (for example, coeff_sign_flag) of each coefficient in an interleaved manner, and for each coefficient, the video encoder 200 and the video decoder 300 can bypass the encoding and decoding residual information.

[0170] Figure 8 is a conceptual diagram showing another example of encoding and decoding coefficient information of a coefficient. Figure 8 In the example of FIG. 1 , the video encoder 200 and the video decoder 300 may perform a process similar to Figure 3 A technique that is a combination of an example in which a coefficient value or a coefficient value −1 is directly bypassed for decoding.

[0171] For example, something like Figure 3 In an example of, the video encoder 200 and the video decoder 300 may encode or decode the coefficients in two passes. For example, before reaching the binary bit count limit of the codec, the video encoder 200 and the video decoder 300 may encode and decode the coefficients in the residual block of the current block in an interleaved manner, coefficient by coefficient, in a first pass, wherein the coefficient information of the coefficient includes a validity flag (e.g., sig_coeff_flag) indicating whether the value of the coefficient is not zero, a parity flag (e.g., par_level_flag) indicating whether the value of the coefficient is odd or even, a sign flag (e.g., coeff_sign_flag) indicating whether the value of the coefficient is positive or negative, and one or more greater than flags (e.g., abs_level_gtX_flags). After the first pass, the video encoder 200 and the video decoder 300 may encode and decode the remainder information (e.g., abs_remainder) of the coefficients in the residual block in a second pass.

[0172] After reaching the context bin limit, for a particular coefficient, if no abs_level_gt1_flag, abs_level_gtX_flags, par_level_flag can be used for the context codec for the particular coefficient (e.g., because the codec count bin limit is reached), the video encoder 200 and the video decoder 300 may not divide the absolute value of the coefficient into abs_level_gt1_flag, abs_level_gtX_flags, par_level_flag, and abs_remainder. Instead, the video encoder 200 and the video decoder 300 may encode or decode the corresponding values ​​of the coefficients after the particular coefficient (e.g., encode or decode abs(coefficient value)−1)) as part of a second pass (e.g., as Rice-Golomb codec).

[0173] For example, Figure 8 As shown, when encoding and decoding Coeff 0 of the current codec group, the video encoder 200 and the video decoder 300 may reach the codec bit count limit, for example, when encoding and decoding GT2 (the first abs_level_gtX_flag (X=2, 3, 4, 5)). Because the codec bit count limit is reached, the video encoder 200 and the video decoder 300 can bypass the remaining codec greater than flags (e.g., greater than 3, greater than 4, and greater than 5), as shown in FIG. Figure 8 As shown, there is (BP) next to the GT3 (greater than 3) flag, the GT4 (greater than 4) and the GT5 (greater than 5) flag, indicating bypass. In this example, starting from Coeff 1, the video encoder 200 and the video decoder 300 may no longer separate the absolute value of each coefficient into abs_level_gt1_flag, abs_level_gtX_flags, par_level_flag and abs_remainder. Instead, the video encoder 200 and the video decoder 300 may bypass the encoding and decoding of the abs (coefficient) -1 value.

[0174] exist Figure 8In the example of , in order to encode and decode the coefficient information in an interlaced manner, the video encoder 200 and the video decoder 300 may perform context-based encoding and decoding of the coefficient information in an interlaced manner on a coefficient-by-coefficient basis until the codec's binary bit count limit is reached. For example, assuming that the codec's binary bit count limit is not reached, the video encoder 200 and the video decoder 300 may perform context-based encoding and decoding of a validity flag (e.g., sig_coeff_flag) indicating whether the value of the coefficient is not zero, a parity flag (e.g., par_level_flag) indicating whether the value of the coefficient is odd or even, a sign flag (e.g., coeff_sign_flag) indicating whether the value of the coefficient is positive or negative, and one or more greater than flags (e.g., abs_level_gtX_flags) indicating whether the absolute value of the coefficient is greater than a corresponding threshold.

[0175] However, in Figure 8 In the example of , the video encoder 200 and the video decoder 300 may have reached the binary bit count limit of the codec after the greater than 2 flag of Coeff0. In this example, the video encoder 200 and the video decoder 300 can then bypass encoding and decoding the remainder flag of Coeff0, and bypass encoding and decoding the validity flag and the sign flag of the coefficient after Coeff0 in the first pass. For example, in order to encode and decode the coefficient information in an interlaced manner, the video encoder 200 and the video decoder 300 can perform context-based encoding and decoding (e.g., encoding or decoding) on ​​the coefficient information in an interlaced manner on a coefficient-by-coefficient basis until the binary bit count limit of the codec is reached, and after reaching the binary bit count limit of the codec, bypass encoding and decoding (e.g., encoding or decoding) on ​​the coefficient information in an interlaced manner on a coefficient-by-coefficient basis.

[0176] exist Figure 8 In the example of , after the first pass, the video encoder 200 and the video decoder 300 may encode and decode the residual information of the coefficients in the residual block of the current block in the second pass. For example, to encode and decode the residual information, the video encoder 200 and the video decoder 300 may encode and decode information indicating the difference between a specific coefficient value and a maximum threshold value associated with the greater than flag (e.g., residual information such as Coeff0). In the process of encoding and decoding a specific coefficient (e.g., in Figure 8In the case where the specific coefficient is Coeff0, the binary bit count limit of the codec may be reached. The video encoder 200 and the video decoder 300 may encode and decode the corresponding value of the coefficient after the specific coefficient. For example, the video encoder 200 and the video decoder 300 may encode and decode information indicating the difference between the absolute value of the corresponding value of the coefficient after the specific coefficient and 1 (e.g., encoding and decoding information indicating the value of abs(Coeff1)–1, encoding and decoding information indicating the value of abs(Coeff2)–1, and so on, until abs(CoeffN-1)–1). In one or more examples, the video encoder 200 and the video decoder 300 may bypass the encoding and decoding of the residual information.

[0177] Fig. 9 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Fig. 9 The above description is provided for the purpose of explanation and should not be considered as limiting the techniques broadly illustrated and described in this disclosure. For the purpose of explanation, this disclosure describes the video encoder 200 in the context of video codec standards such as the H.265 (HEVC) video codec standard and the H.266 (VVC) video codec standard under development. However, the techniques of this disclosure are not limited to these video codec standards and are generally applicable to video encoding and decoding.

[0178] exist Fig. 9 In the example of , the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filter unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or processing circuits. In addition, the video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions.

[0179] Video data memory 230 may store video data to be encoded by components of video encoder 200. Video encoder 200 may receive video data from, for example, video source 104 ( Figure 1) receives the video data stored in the video data memory 230. DPB218 can act as a reference picture memory, which stores reference video data for use when the video encoder 200 predicts subsequent video data. Video data memory 230 and DPB 218 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM) or other types of memory devices. Video data memory 230 and DPB218 can be provided by the same memory device or a separate memory device. In various examples, as shown in the figure, video data memory 230 can be on the chip with other components of the video encoder 200, or off the chip relative to these components.

[0180] In the present disclosure, references to the video data memory 230 should not be interpreted as limited to memory internal to the video encoder 200, unless specifically described as such, or to memory external to the video encoder 200, unless specifically described as such. Instead, references to the video data memory 230 should be understood as references to memory storing video data received by the video encoder 200 for encoding (e.g., video data of a current block to be encoded). Figure 1 The memory 106 may also provide temporary storage of outputs from the various units of the video encoder 200 .

[0181] Fig. 9 Various units are shown to help understand the operations performed by the video encoder 200. These units can be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide specific functions and are preset on operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions in operations that can be performed. For example, a programmable circuit can execute software or firmware so that the programmable circuit operates in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. In some examples, one or more of the units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units may be integrated circuits.

[0182] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary function unit (EFU), a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video encoder 200 is performed using software executed by a programmable circuit, the memory 106 ( Figure 1) may store object code for software received and executed by the video encoder 200, or another memory (not shown) within the video encoder 200 may store such instructions.

[0183] The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve the picture of the video data from the video data memory 230 and provide the video data to the residual generation unit 204 and the mode selection unit 202. The video data in the video data memory 230 may be the original video data to be encoded.

[0184] The mode selection unit 202 includes a motion estimation unit 222, a motion compensation unit 224, and an intra prediction unit 226. The mode selection unit 202 may include additional functional units to perform video prediction according to other prediction modes. As an example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.

[0185] The mode selection unit 202 generally coordinates multiple encoding processes to test combinations of encoding parameters and rate-distortion values ​​of the results of such combinations. The encoding parameters may include the partitioning of CTUs into CUs, the prediction mode of the CUs, the transform type of the residual data of the CUs, the quantization parameter of the residual data of the CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than other tested combinations.

[0186] The video encoder 200 may partition the picture retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs in a slice. The mode selection unit 202 may partition the CTUs of the picture according to a tree structure (e.g., the QTBT structure or quadtree structure of HEVC described above). As described above, the video encoder 200 may form one or more CUs from the partitioned CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks".

[0187] Typically, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a prediction block for the current block (e.g., the current CU, or in HEVC, the overlapping portion of the PU and TU). For inter prediction of the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously encoded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value indicating how similar the potential reference block is to the current block, for example, based on the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 may typically perform these calculations using the sample-by-sample difference between the current block and the reference block being considered. The motion estimation unit 222 may identify the reference block having the lowest value obtained from these calculations, which indicates the reference block that most closely matches the current block.

[0188] The motion estimation unit 222 may form one or more motion vectors (MVs) that define the position of a reference block in a reference picture relative to the position of a current block in a current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, for unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, and for bidirectional inter prediction, the motion estimation unit 222 may provide two motion vectors. The motion compensation unit 224 may then use the motion vectors to generate a prediction block. For example, the motion compensation unit 224 may use the motion vectors to retrieve data for the reference block. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate the values ​​of the prediction block according to one or more interpolation filters. In addition, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by the corresponding motion vectors and combine the retrieved data by, for example, sample-by-sample averaging or weighted averaging.

[0189] As another example, for intra prediction or intra prediction codec, the intra prediction unit 226 can generate a prediction block from samples adjacent to the current block. For example, for directional mode, the intra prediction unit 226 can generally mathematically combine the values ​​of the adjacent samples and pad these calculated values ​​in a defined direction across the current block to produce a prediction block. As another example, for DC mode, the intra prediction unit 226 can calculate the average of the adjacent samples of the current block and generate a prediction block to include the resulting average for each sample of the prediction block.

[0190] The mode selection unit 202 provides the prediction block to the residual generation unit 204. The residual generation unit 204 receives the original, uncoded version of the current block from the video data memory 230 and receives the prediction block from the mode selection unit 202. The residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines a residual block for the current block. In some examples, the residual generation unit 204 may also determine the difference between the sample values ​​in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, the residual generation unit 204 may be formed using one or more subtractor circuits that perform binary subtraction.

[0191] In the example where the mode selection unit 202 partitions the CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As described above, the size of the CU may refer to the size of the luma codec block of the CU, and the size of the PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2N×2N, the video encoder 200 may support PU sizes of 2N×2N or N×N for intra-frame prediction, and symmetric PU sizes of 2N×2N, 2N×N, N×2N, N×N or the like for inter-frame prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning of PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter-frame prediction.

[0192] In an example where the mode selection unit does not further partition the CU into PUs, each CU may be associated with a luma codec block and a corresponding chroma codec block. As described above, the size of a CU may refer to the size of the luma codec block of the CU. The video encoder 200 and the video decoder 300 may support a CU size of 2N×2N, 2N×N, or N×2N.

[0193] For other video codec techniques, such as intra block copy mode codec, affine mode codec, and linear model (LM) mode codec, as a few examples, the mode selection unit 202 generates a prediction block for the current block being encoded via a corresponding unit associated with the codec technique. In some examples, such as palette mode codec, the mode selection unit 202 may not generate a prediction block, but instead generate syntax elements indicating how to reconstruct the block based on the selected palette. In this mode, the mode selection unit 202 may provide these syntax elements to the entropy coding unit 220 for encoding.

[0194] As described above, the residual generation unit 204 receives video data of a current block and a corresponding prediction block. The residual generation unit 204 then generates a residual block for the current block. To generate the residual block, the residual generation unit 204 calculates the sample-by-sample difference between the prediction block and the current block.

[0195] Transform processing unit 206 applies one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). Transform processing unit 206 may apply various transforms to the residual block to form the transform coefficient block. For example, transform processing unit 206 may apply a discrete cosine transform (DCT), a directional transform, a Karl-Lof transform (KLT), or a conceptually similar transform to the residual block. In some examples, transform processing unit 206 may perform multiple transforms on the residual block, such as a primary transform and a secondary transform, such as a rotation transform.

[0196] In some examples, the transform processing unit 206 does not apply a transform to the residual block. For example, in examples where the mode selection unit 202 determines that the transform skip mode is enabled, the operation of the transform processing unit 206 can be skipped. In such examples, the values ​​of the coefficients can be used for the coefficients of the residual block (e.g., the first position in the residual block is for the first coefficient, the residual value in the first position is the value of the first coefficient, the second position in the residual block is for the second coefficient, the residual value in the second position is the value of the second coefficient, and so on).

[0197] The quantization unit 208 may quantize the coefficients in a coefficient block (which may be, for example, a transform coefficient block or a residual block) to produce a quantized coefficient block. In some examples, the operation of the quantization unit 208 may be skipped. The quantization unit 208 may quantize the coefficients of the coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) may adjust the degree of quantization applied to the coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may introduce information loss, and therefore, the quantized transform coefficients may have lower precision than the original transform coefficients produced by the transform processing unit 206.

[0198] The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform (if necessary) to the quantized coefficient block, respectively, to reconstruct a residual block from the coefficient block. The reconstruction unit 214 may generate a reconstructed block corresponding to the current block (although it may have a certain degree of distortion) based on the reconstructed residual block and the prediction block generated by the mode selection unit 202. For example, the reconstruction unit 214 may add samples of the reconstructed residual block to corresponding samples of the prediction block generated by the mode selection unit 202 to generate a reconstructed block.

[0199] Filter unit 216 may perform one or more filtering operations on the reconstructed block. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edge of the CU. In some examples, the operation of filter unit 216 may be skipped.

[0200] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in examples where the operation of the filter unit 216 is not required, the reconstruction unit 214 can store the reconstructed blocks to the DPB 218. In examples where the operation of the filter unit 216 is required, the filter unit 216 can store the filtered reconstructed blocks to the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 can retrieve a reference picture from the DPB 218, which is formed by the reconstructed (and possibly filtered) blocks, to perform inter-frame prediction on blocks of subsequently encoded pictures. In addition, the intra-frame prediction unit 226 can use the reconstructed blocks in the DPB 218 of the current picture to intra-frame predict other blocks in the current picture.

[0201] In general, the entropy coding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy coding unit 220 may entropy encode the quantized coefficient blocks from the quantization unit 208. As another example, the entropy coding unit 220 may entropy encode the prediction syntax elements (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy coding unit 220 may perform one or more entropy coding operations on the syntax elements as another example of video data to generate entropy-coded data. For example, the entropy coding unit 220 may perform a context-adaptive variable length coding (CAVLC) operation, a CABAC operation, a variable to variable (V2V) length coding operation, a syntax-based context-adaptive binary arithmetic coding (SBAC) operation, a probability interval partitioning entropy (PIPE) coding operation, an exponential-Golomb coding operation, or another type of entropy coding operation on the data. In some examples, entropy encoding unit 220 may operate in a bypass mode, where syntax elements are not entropy encoded.

[0202] The video encoder 200 may output a bitstream including entropy-encoded syntax elements required to reconstruct a block of a slice or a picture. Specifically, the entropy encoding unit 220 may output a bitstream.

[0203] The operations described above are described with respect to blocks. Such descriptions should be understood as operations of a luma codec block and / or a chroma codec block. As described above, in some examples, the luma codec block and the chroma codec block are the luma and chroma components of a CU. In some examples, the luma codec block and the chroma codec block are the luma and chroma components of a PU.

[0204] In some examples, operations performed on the luma codec block do not need to be repeated for the chroma codec block. As an example, operations to identify the motion vector (MV) and reference picture of the luma codec block do not need to be repeated for identifying the MV and reference picture of the chroma block. Instead, the MV of the luma codec block can be scaled to determine the MV of the chroma block, and the reference picture can be the same. As another example, the intra prediction process can be the same for the luma codec block and the chroma codec block.

[0205] The video encoder 200 represents an example of a device configured to encode video data, the device including a memory configured to store the video data, and one or more processing units implemented in a circuit, the processing unit configured to determine that transform skipping is enabled, and based on transform skipping being enabled, encode coefficient values ​​of coefficients in a residual block based on one or more coefficient values ​​of one or more neighboring coefficients. The video encoder 200 may also be configured to encode one or more syntax elements in an interleaved manner on a coefficient-by-coefficient basis for coefficients in the residual block in a first pass and after the first pass based on transform skipping being enabled, and encode syntax elements on a coefficient-by-coefficient basis for coefficients in the residual block in a second pass.

[0206] As an example, the mode selection unit 202 may determine that the current block is coded in the transform skip mode, which means that the operation of the transform processing unit 206 may be skipped. In this example, the residual generation unit 204 generates coefficients that are encoded by the entropy encoding unit 220.

[0207] The entropy coding unit 220 may (e.g., when transform skipping is enabled) encode coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in the residual block of the current block in a first pass. For example, the entropy coding unit 220 may determine coefficient information for each coefficient in the residual block. The coefficient information for a coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is non-zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold.

[0208] In this example, to encode and decode the coefficient information in an interleaved manner, the entropy coding unit 220 may perform context-based encoding and decoding (e.g., such as CABAC) on the coefficient information in an interleaved manner on a coefficient-by-coefficient basis until the codec's binary bit count limit is reached. For example, the entropy coding unit 220 may determine the codec's binary bit count limit (e.g., 2*block width*block height or 1.75*block width*block height) and track how many bits of the codec's binary bit count limit are used. When the number of bits reaches (e.g., is greater than or equal to) the codec's binary bit count limit (e.g., after the codec's binary bit count limit is reached), the entropy coding unit 220 may bypass decode the coefficient information in an interleaved manner on a coefficient-by-coefficient basis.

[0209] After the first pass, the entropy encoding unit 220 may encode residual information of coefficients in the residual block of the current block in the second pass. In order to encode the residual information, the entropy encoding unit 220 may bypass encode the residual information.

[0210] In one or more examples, the entropy coding unit 220 may signal coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in the residual block of the current block in a first pass. The entropy coding unit 220 may signal residual information for coefficients in the residual block of the current block in a second pass.

[0211] Fig.10 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Fig.10 It is provided for the purpose of explanation and does not limit the techniques widely illustrated and described in this disclosure. For the purpose of explanation, this disclosure describes a video decoder 300 according to the techniques of VVC and HEVC. However, the techniques of this disclosure can be performed by video codec devices configured for other video codec standards.

[0212] exist Fig.10 In the example of , the video decoder 300 includes a codec picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or processing circuits. In addition, the video decoder 300 may include additional or alternative processors or processing circuits to perform these and other functions.

[0213] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units to perform predictions according to other prediction modes. As an example, the prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, etc. In other examples, the video decoder 300 may include more, fewer, or different functional components.

[0214] The CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by components of the video decoder 300. For example, the video data stored in the CPB memory 320 may be, for example, from the computer-readable medium 110 ( Figure 1 ). The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. In addition, the CPB memory 320 may store video data other than syntax elements of encoded and decoded pictures, such as temporary data representing outputs from various units of the video decoder 300. The DPB 314 typically stores decoded pictures, which may be output and / or used as reference video data when the video decoder 300 decodes subsequent data or pictures of the encoded video bitstream. The CPB memory 320 and the DPB 314 may be formed by any of a variety of memory devices, such as, for example, DRAM (including SDRAM), MRAM, RRAM, or other types of memory devices. The CPB memory 320 and the DPB 314 may be provided by the same memory device or by separate memory devices. In various examples, the CPB memory 320 may be on-chip with other components of the video decoder 300, or off-chip relative to these components.

[0215] Additionally or alternatively, in some examples, video decoder 300 may retrieve the video from memory 120 ( Figure 1 ) retrieves the encoded and decoded video data. That is, the memory 120 may utilize the CPB memory 320 to store data as described above. Similarly, when some or all of the functions of the video decoder 300 are implemented in software to be executed by the processing circuitry of the video decoder 300, the memory 120 may store instructions to be executed by the video decoder 300.

[0216] Fig.10 The various units shown are shown to aid in understanding the operations performed by the video decoder 300. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Fig. 9, fixed-function circuits refer to circuits that provide specific functions and are preset on the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions in the operations that can be performed. For example, a programmable circuit can execute software or firmware so that the programmable circuit operates in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., receive parameters or output parameters), but the type of operation performed by the fixed-function circuit is generally immutable. In some examples, one or more of the units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more units may be integrated circuits.

[0217] The video decoder 300 may include an ALU, an EFU, a digital circuit, an analog circuit, and / or a programmable core formed by a programmable circuit. In an example where the operation of the video decoder 300 is performed by software executed on a programmable circuit, an on-chip or off-chip memory may store instructions (e.g., object code) of the software received and executed by the video decoder 300.

[0218] The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to reproduce the syntax elements. The prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, and the filter unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.

[0219] Typically, the video decoder 300 reconstructs an image on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (where the block currently being reconstructed (ie, decoded) may be referred to as a "current block").

[0220] The entropy decoding unit 302 may entropy decode syntax elements defining quantized transform coefficients of a quantized transform coefficient block, and transform information, such as a quantization parameter (QP) and / or (multiple) transform mode indications. The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine the degree of quantization, and similarly, determine the degree of inverse quantization to be applied by the inverse quantization unit 306. For example, the inverse quantization unit 306 may perform a bitwise left shift operation to inverse quantize the quantized transform coefficients. The inverse quantization unit 306 may thereby form a coefficient block including coefficients (e.g., a coefficient block in which a transform is used or a coefficient block in which a transform is skipped). In some examples, the operation of the inverse quantization unit 306 may be skipped. When a transform is skipped, the coefficient block may be a residual value of a residual block, i.e., such that each coefficient of a position in the residual block is a residual value of the corresponding position.

[0221] After the inverse quantization unit 306 forms the coefficient block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. When the transform skip mode is enabled, the operation of the inverse transform processing unit 308 may be skipped. If desired, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karl-Lof transform (KLT), an inverse rotational transform, an inverse directional transform, or another inverse transform to the coefficient block.

[0222] In addition, prediction processing unit 304 generates a prediction block based on the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter-predicted, motion compensation unit 316 can generate the prediction block. In this case, the prediction information syntax element can indicate a reference picture in DPB 314 from which the reference block is retrieved, and a motion vector that identifies the position of the reference block in the reference picture relative to the position of the current block in the current picture. Motion compensation unit 316 can generally generate a prediction block in a manner substantially similar to that described with respect to motion compensation unit 224 ( Fig. 9 ) describes the method to perform the inter-frame prediction process.

[0223] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 can generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Likewise, the intra-prediction unit 318 can generally generate a prediction block in a manner substantially similar to that described with respect to the intra-prediction unit 226 ( Fig. 9 The intra prediction process is performed in the manner described in ). The intra prediction unit 318 can retrieve the data of the neighboring samples of the current block from the DPB 314.

[0224] The reconstruction unit 310 may reconstruct the current block using the prediction block and the residual block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the prediction block to reconstruct the current block.

[0225] The filter unit 312 may perform one or more filtering operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operations of the filter unit 312 need not be performed in all examples.

[0226] The video decoder 300 may store the reconstructed blocks in the DPB 314. As described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current image for intra-frame prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 may output decoded images from the DPB 314 for subsequent use in, for example, Figure 1 The display device 118 is displayed on the display device.

[0227] In this manner, the video decoder 300 represents an example of a video decoding device that includes a memory configured to store video data, and one or more processing units implemented in a circuit that are configured to determine that transform skip is enabled, and based on transform skip being enabled, decode coefficient values ​​of coefficients in a residual block based on one or more coefficient values ​​of one or more neighboring coefficients. The video decoder 300 may also be configured to decode one or more syntax elements in a first pass in an interleaved manner (e.g., when transform skip is enabled) for coefficients in the residual block, and, after the first pass, decode the syntax elements on a coefficient-by-coefficient basis for coefficients in the residual block in a second pass.

[0228] As an example, the prediction processing unit 304 may determine that the current block is encoded in a transform skip mode (e.g., based on information signaled by the video encoder 200), which means that the operation of the inverse transform processing unit 308 may be skipped. In this example, the reconstruction unit 310 receives the coefficients decoded by the entropy decoding unit 302 (e.g., the residual values ​​obtained due to skipping the inverse transform).

[0229] The entropy decoding unit 302 may decode the coefficient information in an interleaved manner (e.g., based on transform skip being enabled) on a coefficient-by-coefficient basis for the coefficients in the residual block of the current block in a first pass. For example, the entropy decoding unit 302 may determine the coefficient information for each coefficient in the residual block. The coefficient information for the coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is non-zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold.

[0230] In this example, to decode the coefficient information in an interleaved manner (e.g., based on transform skip being enabled), the entropy decoding unit 302 may decode the coefficient information in an interleaved manner based on context (e.g., such as CABAC) on a coefficient-by-coefficient basis until the codec's bin count limit is reached. For example, the entropy decoding unit 302 may determine the codec's bin count limit (e.g., 2*block width*block height or may be signaled by the video encoder 200) and track how many bins of the codec's bin count limit are used. When the number of bins reaches (e.g., is greater than or equal to) the codec's bin count limit (e.g., after the codec's bin count limit is reached), the entropy decoding unit 302 may bypass decode the coefficient information in an interleaved manner on a coefficient-by-coefficient basis.

[0231] After the first pass, the entropy decoding unit 302 may decode the residual information of the coefficients in the residual block of the current block in the second pass. To decode the residual information, the entropy decoding unit 302 may bypass-decode the residual information.

[0232] In one or more examples, the entropy decoding unit 302 may parse coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients of the residual block of the current block in a first pass. The entropy decoding unit 302 may parse residual information of coefficients in the residual block of the current block in a second pass.

[0233] Fig.11 is a flow chart illustrating an example method for encoding and decoding video data. For example, processing circuitry of a video codec (e.g., video encoder 200 or video decoder 300) may determine that a current block of video data is encoded (e.g., encoded or decoded) in a transform skip mode. Based on the current block being encoded (e.g., encoded or decoded) in a transform skip mode, the processing circuitry of the video codec may be configured to perform the example techniques.

[0234] Processing circuitry of a video codec (e.g., such as having entropy encoding unit 220 or entropy decoding unit 302) may encode and decode coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block for a current block of video data in a first pass (400). The coefficient information for a coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is non-zero, a parity flag indicating whether the value of the coefficient is odd or even, a sign flag indicating whether the value of the coefficient is positive or negative, and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold.

[0235] As an example, to encode and decode coefficient information in an interleaved manner, processing circuitry of a video codec (e.g., such as having entropy encoding unit 220 or entropy decoding unit 302) may perform context-based encoding and decoding (e.g., CABAC) on coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec bit count limit is reached. In this example, processing circuitry of a video codec (e.g., such as having entropy encoding unit 220 or entropy decoding unit 302) may bypass encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis after the codec bit count limit is reached.

[0236] After the first pass, processing circuitry of the video codec (e.g., such as having entropy encoding unit 220 or entropy decoding unit 302) may encode and decode residual information of coefficients in a residual block of the current block in a second pass (402). For example, to encode and decode the residual information, the processing circuitry may bypass the encoding and decoding of the residual information.

[0237] As an example, to encode and decode the residual information, the processing circuit of the video codec can be configured to encode and decode the residual information. In this example, the binary bit count limit of the codec is reached during the encoding and decoding of the particular coefficient. The processing circuit of the video codec can be configured to encode and decode the corresponding value of the coefficient after the particular coefficient. As an example, the processing circuit of the video codec can encode and decode information indicating the difference between the absolute value of the corresponding value of the coefficient after the particular coefficient and 1.

[0238] In one or more examples, processing circuitry of a video codec, such as in an example where the video codec is video encoder 200, may signal coefficient information in an interlaced manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block in a first pass, and signal residual information for coefficients in the residual block of the current block in a second pass. In one or more examples, processing circuitry of a video codec, such as in an example where the video codec is video decoder 300, may parse coefficient information in an interlaced manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block in a first pass, and parse residual information for coefficients in the residual block of the current block in a second pass.

[0239] Here are some example techniques that can be used alone or in combination.

[0240] Example 1. A method of encoding and decoding video data, the method comprising determining that transform skip is enabled, and encoding and decoding coefficient values ​​of coefficients in a residual block based on one or more coefficient values ​​of one or more neighboring coefficients.

[0241] Example 2. The method of Example 1, wherein the one or more adjacent coefficients include left coefficients and above coefficients.

[0242] Example 3. The method of any of Examples 1 and 2, wherein encoding and decoding the coefficient value comprises one of: encoding the coefficient value, mapping the coefficient absolute level of the coefficient to the correction value based on one or more coefficient values ​​of one or more adjacent coefficients, or decoding the coefficient value, inversely mapping the correction value to the coefficient absolute level of the coefficient based on one or more coefficient values ​​of one or more adjacent coefficients.

[0243] Example 4. A method of encoding and decoding video data, the method comprising, in a first pass and after the first pass, encoding and decoding one or more syntax elements in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block, and in a second pass, encoding and decoding syntax elements on a coefficient-by-coefficient basis for coefficients in the residual block.

[0244] Example 5. The method of Example 4, wherein the one or more syntax elements encoded in the first pass include one or more of sig_coeff_flag, par_level_flag, coeff_sign_flag, and all abs_level_gtX_flags, examples of which are described in the present disclosure.

[0245] Example 6. The method of any of Examples 4 and 5, wherein the syntax elements encoded in the second pass include abs_remainder, examples of which are described in this disclosure.

[0246] Example 7. The method of any one or combination of Examples 1-6.

[0247] Example 8. The method of any one of Examples 1-6 or a combination thereof, wherein encoding and decoding includes decoding.

[0248] Example 9. The method of any one of Examples 1-6 or a combination thereof, wherein encoding and decoding includes encoding.

[0249] Example 10. A device for encoding and decoding video data, the device comprising a memory configured to store the video data and a video codec comprising fixed-function or programmable circuits, wherein the video codec is configured to perform the method of any one or a combination of Examples 1-6.

[0250] Example 11. The device of Example 10, wherein the video codec comprises a video decoder.

[0251] Example 12. The device of Example 10, wherein the video codec comprises a video encoder.

[0252] Example 13. The apparatus of any of Examples 10-12, further comprising a display configured to display the decoded video data.

[0253] Example 14. The device of any of Examples 10-13, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0254] Example 15. A computer-readable storage medium having instructions stored thereon, which when executed cause one or more processors to perform the method of any one or a combination of Examples 1-6.

[0255] Example 16. A device for encoding and decoding video data, the device comprising means for performing the method of any one or a combination of Examples 1-6.

[0256] It should be appreciated that, depending on the examples, certain actions or events of any of the techniques described herein may be performed in a different order, may be added, combined, or omitted entirely (e.g., not all described actions or events are necessary for the practice of the techniques). In addition, in some examples, actions or events may be performed simultaneously, e.g., by multithreading, interrupt handling, or multiple processors, rather than being performed sequentially.

[0257] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted through a computer-readable medium as one or more instructions or codes and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media corresponding to tangible media such as data storage media, or communication media including any media that facilitates (e.g., according to a communication protocol) transferring a computer program from one place to another. In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures to implement the techniques described in the present disclosure. A computer program product may include a computer-readable medium.

[0258] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage, or other magnetic storage devices, flash memory, or any other medium that can be used to store the desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection is properly referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit instructions from a website, server or other remote source, then the coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave) is included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are directed to non-temporary tangible storage media. The disk and optical disk used herein include compact disc (CD), laser optical disc, optical optical disc, digital versatile disc (DVD), floppy disk and blue-ray disc, wherein the disk usually reproduces data magnetically, and the optical disc reproduces data optically with a laser. The above combination should also be included in the scope of computer-readable media.

[0259] Instructions may be executed by one or more processors, such as one or more DSPs, general-purpose microprocessors, ASICs, FPGAs, or other equivalent integrated or discrete logic circuits. Therefore, the terms "processor" and "processing circuit" used herein may refer to any of the aforementioned structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functions described herein may be provided in dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. In addition, these techniques may be fully implemented in one or more circuits or logic elements.

[0260] The techniques of the present disclosure may be implemented in a variety of devices or apparatuses, including wireless handsets, integrated circuits (ICs), or sets of ICs (e.g., chipsets). Various components, modules, or units are described in the present disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily need to be implemented by different hardware units. Instead, as described above, the various units may be combined in a codec hardware unit, or provided by a collection of interoperable hardware units including one or more processors as described above in combination with appropriate software and / or firmware.

[0261] Various examples have been described. These and other examples are within the scope of the following claims.

Claims

1. A method for encoding and decoding video data, the method comprising: determining that a current block of the video data is encoded and decoded in a transform skip mode, Based on the current block being encoded and decoded in the transform skip mode, in a first pass, for coefficients in a residual block of the current block of the video data, coefficient information is encoded and decoded in an interleaved manner on a coefficient-by-coefficient basis, wherein the coefficient information of the coefficient includes one or more of the following: a significance flag indicating whether a value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater-than flags indicating whether an absolute value of the coefficient is greater than a corresponding threshold value; and wherein encoding and decoding the coefficient information in an interleaved manner further comprises: context-based encoding and decoding the coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec binary bit count limit is reached, wherein the codec binary bit count limit is an upper limit on the number of conventionally encoded binary bits used in the current block encoded in a transform skip mode; and after reaching the codec binary bit count limit, bypass encoding and decoding the coefficient information in an interleaved manner on a coefficient-by-coefficient basis; and encoding and decoding residual information of coefficients in a residual block of the current block in a second pass after the first pass based on the current block being encoded in the transform skip mode, The encoding and decoding of the remainder information comprises: encoding and decoding information indicating a residual absolute value of a specific coefficient, wherein a binary bit count limit of the encoding and decoding is reached during encoding and decoding of the specific coefficient; and encoding and decoding corresponding values ​​of coefficients after the specific coefficient.

2. The method according to claim 1, wherein: In the transform skip mode, transform of the coefficients in the residual block from one domain to another is skipped.

3. The method according to claim 1, wherein: Encoding the respective values ​​of the coefficients includes encoding information indicating respective differences between absolute values ​​of the respective values ​​of the coefficients following the particular coefficient and 1.

4. The method according to claim 1, wherein: Encoding and decoding the residual information includes bypass encoding and decoding the residual information.

5. The method according to claim 1, further comprising: determining that the current block is encoded and decoded in a transform skip mode, The encoding and decoding in an interleaved manner and encoding and decoding the residual information include encoding and decoding in an interleaved manner and encoding and decoding the residual information based on the current block being encoded and decoded in a transform skip mode.

6. The method according to claim 1, in, Encoding and decoding in an interleaved manner includes parsing the coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of the current block in the first pass, and The encoding and decoding of the residual information includes parsing residual information of coefficients in a residual block of the current block in the second pass.

7. The method according to claim 1, in, Encoding in an interleaved manner comprises signaling, in the first pass, for coefficients in a residual block of the current block, the coefficient information in an interleaved manner on a coefficient-by-coefficient basis, and The encoding and decoding of the residual information comprises signaling, in the second pass, residual information of coefficients in the residual block of the current block.

8. A device for encoding and decoding video data, the device comprising: a memory configured to store video data; as well as The processing circuit is configured to: determining that a current block of the video data is encoded and decoded in a transform skip mode, Based on the current block being encoded and decoded in the transform skip mode, in a first pass, for coefficients in a residual block of the current block of the video data, encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis, wherein the coefficient information of the coefficients includes one or more of the following: a significance flag indicating whether a value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is an odd number or an even number; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater-than flags indicating whether an absolute value of the coefficient is greater than a corresponding threshold value; and wherein, in order to encode and decode the coefficient information in an interleaved manner, the processing circuit is configured to: perform context-based encoding and decoding of the coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec binary bit count limit is reached, wherein the codec binary bit count limit is an upper limit on the number of conventionally encoded binary bits used in the current block encoded and decoded in a transform skip mode; and after reaching the codec binary bit count limit, bypass encode and decode the coefficient information in an interleaved manner on a coefficient-by-coefficient basis; and based on the current block being encoded and decoded in the transform skip mode, after the first pass, encode and decode residual information of coefficients in a residual block of the current block in a second pass, In which, in order to encode and decode the residual information, the processing circuit is configured to: encode and decode information indicating the remaining absolute value of a specific coefficient, wherein the binary bit count limit of the encoding and decoding is reached during the encoding and decoding of the specific coefficient; and encode and decode the corresponding value of the coefficient after the specific coefficient.

9. The device according to claim 8, wherein: The processing circuitry is configured in the transform skip mode to skip transforming the coefficients in the residual block from one domain to another domain.

10. The device according to claim 8, wherein: In order to encode and decode the respective values ​​of the coefficients, the processing circuit is configured to encode and decode information indicating respective differences between an absolute value of the respective values ​​of the coefficients following the particular coefficient and 1.

11. The device according to claim 8, wherein: To encode and decode the headroom information, the processing circuit is configured to bypass encode and decode the headroom information.

12. The device according to claim 8, wherein: The processing circuit is configured to: determining that the current block is encoded and decoded in a transform skip mode, In order to perform encoding and decoding and to encode and decode the residual information in an interleaved manner, the processing circuit is configured to perform encoding and decoding and to encode and decode the residual information in an interleaved manner based on that the current block is being encoded and decoded in a transform skip mode.

13. The device according to claim 8, in, The processing circuit includes a video decoder, wherein, for encoding and decoding in an interleaved manner, the processing circuit is configured to parse the coefficient information in an interleaved manner on a coefficient-by-coefficient basis for the coefficients in the residual block of the current block in the first pass, and In order to encode and decode the residual information, the processing circuit is configured to parse the residual information of the coefficients in the residual block of the current block in the second pass.

14. The device according to claim 8, in, The processing circuit includes a video encoder, wherein, for encoding and decoding in an interleaved manner, the processing circuit is configured to signal the coefficient information in an interleaved manner on a coefficient-by-coefficient basis for the coefficients in the residual block of the current block in the first pass, and In order to encode and decode the residual information, the processing circuit is configured to signal the residual information of the coefficients in the residual block of the current block in the second pass.

15. The apparatus according to claim 8, wherein: The device includes one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

16. A computer-readable storage medium having stored thereon instructions which, when executed, cause one or more processors to: determining that a current block of video data is encoded and decoded in a transform skip mode, Based on the current block being encoded and decoded in the transform skip mode, in a first pass, for coefficients in a residual block of the current block of the video data, coefficient information is encoded and decoded in an interleaved manner on a coefficient-by-coefficient basis, wherein The coefficient information of a coefficient includes one or more of the following: a significance flag indicating whether the value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is odd or even; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater than flags indicating whether the absolute value of the coefficient is greater than a corresponding threshold value; and wherein the instructions causing the one or more processors to encode and decode the coefficient information in an interleaved manner include instructions causing the one or more processors to execute the following instructions: context-based encoding and decoding of the coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec binary bit count limit is reached, wherein the codec binary bit count limit is an upper limit on the number of conventionally encoded binary bits used in the current block encoded in a transform skip mode; and after reaching the codec binary bit count limit, bypass encoding and decoding the coefficient information in an interleaved manner on a coefficient-by-coefficient basis; and based on the current block being encoded in the transform skip mode, after the first pass, encoding and decoding residual information of coefficients in a residual block of the current block in a second pass, Among them, the instructions that cause the one or more processors to encode and decode the residual information include instructions that cause the one or more processors to execute the following: encode and decode information indicating the remaining absolute value of a specific coefficient, wherein a binary bit count limit of the encoding and decoding is reached during the encoding and decoding of the specific coefficient; and encode and decode the corresponding value of the coefficient after the specific coefficient.

17. The computer-readable storage medium of claim 16, wherein: The instructions cause the one or more processors to skip transforming the coefficients in the residual block from one domain to another domain in the transform skip mode.

18. The computer-readable storage medium of claim 16, wherein: The instructions to cause the one or more processors to encode respective values ​​of coefficients include instructions to cause the one or more processors to encode information indicating respective differences between absolute values ​​of respective values ​​of coefficients subsequent to the particular coefficient and 1.

19. The computer-readable storage medium of claim 16, wherein: The instructions that cause the one or more processors to encode and decode the headroom information include instructions that cause the one or more processors to bypass encode and decode the headroom information.

20. The computer-readable storage medium of claim 16, further comprising instructions for causing the one or more processors to: determining that the current block is encoded and decoded in a transform skip mode, The instructions causing the one or more processors to encode and decode in an interleaved manner and to encode the residual information include instructions causing the one or more processors to encode and decode in an interleaved manner and to encode and decode the residual information based on the current block being encoded in a transform skip mode.

21. The computer-readable storage medium of claim 16, wherein the instructions for causing the one or more processors to encode and decode in an interleaved manner include instructions for causing the one or more processors to parse the coefficient information in an interleaved manner on a coefficient-by-coefficient basis for the coefficients in the residual block of the current block in the first pass, and The instructions for causing the one or more processors to encode and decode the residual information include instructions for causing the one or more processors to parse the residual information of coefficients in the residual block of the current block in the second pass.

22. The computer-readable storage medium of claim 16, wherein the instructions for causing the one or more processors to perform encoding and decoding in an interleaved manner include instructions for causing the one or more processors to signal coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of the current block in the first pass, and The instructions for causing the one or more processors to encode and decode the residual information include instructions for causing the one or more processors to signal residual information of coefficients in a residual block of the current block in the second pass.

23. A device for encoding and decoding video data, the device comprising: means for determining that a current block of said video data is encoded and decoded in a transform skip mode, means for encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of a current block of the video data in a first pass based on the current block being encoded and decoded in the transform skip mode, wherein the coefficient information for a coefficient comprises one or more of: a significance flag indicating whether a value of the coefficient is non-zero; a parity flag indicating whether the value of the coefficient is odd or even; a sign flag indicating whether the value of the coefficient is positive or negative; and one or more greater-than flags indicating whether an absolute value of the coefficient is greater than a corresponding threshold; and The means for encoding and decoding coefficient information in an interleaved manner comprises: a means for performing context-based encoding and decoding of coefficient information in an interleaved manner on a coefficient-by-coefficient basis until a codec binary bit count limit is reached, wherein the codec binary bit count limit is an upper limit on the number of conventionally encoded binary bits used in the current block encoded and decoded in a transform skip mode; and a means for bypass encoding and decoding coefficient information in an interleaved manner on a coefficient-by-coefficient basis after reaching the codec binary bit count limit; and a means for encoding and decoding residual information of coefficients in a residual block of the current block in a second pass after the first pass based on the current block being encoded and decoded in the transform skip mode, Among them, the component for encoding and decoding the residual information includes: a component for encoding and decoding information indicating the remaining absolute value of a specific coefficient, wherein the binary bit count limit of the encoding and decoding is reached during the encoding and decoding of the specific coefficient; and a component for encoding and decoding the corresponding value of the coefficient after the specific coefficient.

24. The apparatus of claim 23, wherein: In the transform skip mode, transform of the coefficients in the residual block from one domain to another is skipped.

25. The apparatus according to claim 23, in, The means for encoding and decoding in an interleaved manner comprises means for parsing the coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of the current block in the first pass, and The means for encoding and decoding the residual information comprises means for parsing the residual information of the coefficients in the residual block of the current block in the second pass.

26. The device according to claim 23, in, The means for encoding and decoding in an interleaved manner comprises means for signaling, in said first pass, coefficient information in an interleaved manner on a coefficient-by-coefficient basis for coefficients in a residual block of said current block, and The means for encoding and decoding the residual information comprises means for signaling residual information of coefficients in a residual block of the current block in the second pass.