Coefficient coding for transform skip mode.

JP7633174B2Active Publication Date: 2025-02-19QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2021551924
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-03-10
Filing Date
2020-03-11
Publication Date
2025-02-19
Estimated Expiration
2040-03-11

Smart Images

  • Figure 0007633174000004
    Figure 0007633174000004
  • Figure 0007633174000005
    Figure 0007633174000005
  • Figure 0007633174000006
    Figure 0007633174000006
Patent Text Reader

Abstract

A device for decoding video data, for a residual block of video data encoded using transform skip mode, determines a value for a first neighboring coefficient of a currently decoded coefficient, determines a value for a second neighboring coefficient of the currently decoded coefficient, determines a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and decodes the value for the currently decoded coefficient based on the determined context offset.
Need to check novelty before this filing date? Find Prior Art

Description

CROSS-REFERENCE TO RELATED APPLICATIONS

[0001]

[0001] This application is U.S. Patent Application No. 16 / 814654, filed March 10, 2020; U.S. Provisional Patent Application No. 62 / 816745, filed March 11, 2019; This application claims the benefit of U.S. Provisional Patent Application No. 62 / 850,453, filed May 20, 2019, the entire contents of each of which are incorporated herein by reference. [Technical field]

[0002]

[0002] This disclosure relates to video encoding and decoding.

[0003]

[0003] Digital video capabilities may 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 "smartphones," video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), and extensions to such standards. Video devices may more efficiently transmit, receive, encode, decode, and / or store digital video information by implementing such video coding techniques.

[0004]

[0004] Video coding techniques include spatial (intra-picture) prediction and / or temporal (inter-picture) prediction to reduce or remove 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 coding tree units (CTUs), coding units (CUs), and / or coding nodes. Video blocks in an intra-coded (I) slice of a picture are encoded using spatial prediction with respect to 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 prediction with respect to reference samples in neighboring blocks in the same picture or temporal prediction with respect to reference samples in other reference pictures. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame. Overview

[0005]

[0005] In some coding scenarios, a video encoder may encode video data in a transform skip mode in which the transform process is not performed, i.e., the transform process is skipped. Thus, for blocks encoded in the transform skip mode, the residual data is not transformed. This disclosure describes techniques for coefficient coding schemes for the transform skip mode. The techniques of this disclosure include an entropy decoding process that converts the binary representation of the coefficients into a series of non-binary-valued quantized coefficients. In general, a corresponding entropy encoding process, which is the inverse process of the entropy decoding, is also part of this disclosure.

[0006]

[0006] In one example, a method for decoding video data includes, for a residual block of video data encoded using a transform skip mode, determining a value for a first neighboring coefficient of a currently decoded coefficient, determining a value for a second neighboring coefficient of the currently decoded coefficient, determining a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and decoding the value for the currently decoded coefficient based on the determined context offset.

[0007]

[0007] In another example, a method of encoding video data includes, for a residual block of the video data encoded using a transform skip mode, determining a value for a first neighboring coefficient of a currently encoded coefficient, determining a value for a second neighboring coefficient of the currently encoded coefficient, determining a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and encoding the value for the currently encoded coefficient based on the determined context offset.

[0008]

[0008] In another example, a device for decoding video data includes a memory configured to store the video data and one or more processors implemented in a circuit, where the one or more processors are configured, for a residual block of the video data encoded using a transform skip mode, to determine a value for a first neighboring coefficient of a currently decoded coefficient, to determine a value for a second neighboring coefficient of the currently decoded coefficient, to determine a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and to decode the value for the currently decoded coefficient based on the determined context offset.

[0009]

[0009] In another example, a device for encoding video data includes a memory configured to store the video data and one or more processors implemented in a circuit, where the one or more processors are configured to, for a residual block of the video data encoded using a transform skip mode, determine a value for a first neighboring coefficient of a currently encoded coefficient, determine a value for a second neighboring coefficient of the currently encoded coefficient, determine a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and encode the value for the currently encoded coefficient based on the determined context offset.

[0010]

[0010] In another example, an apparatus for decoding video data includes, for a residual block of video data encoded using transform skip mode, means for determining a value for a first neighboring coefficient of a currently decoded coefficient, means for determining a value for a second neighboring coefficient of the currently decoded coefficient, means for determining a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and means for decoding the value for the currently decoded coefficient based on the determined context offset.

[0011]

[0011] In another example, an apparatus for encoding video data includes, for a residual block of the video data encoded using a transform skip mode, means for determining a value for a first neighboring coefficient of a currently encoded coefficient, means for determining a value for a second neighboring coefficient of the currently encoded coefficient, means for determining a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and means for encoding the value for the currently encoded coefficient based on the determined context offset.

[0012]

[0012] In another example, a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to determine, for a residual block of video data encoded using transform skip mode, a value for a first neighboring coefficient of a currently decoded coefficient, determine a value for a second neighboring coefficient of the currently decoded coefficient, determine a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and decode the value for the currently decoded coefficient based on the determined context offset.

[0013]

[0013] In another example, a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to determine, for a residual block of video data encoded using transform skip mode, a value for a first neighboring coefficient of a currently encoded coefficient, determine a value for a second neighboring coefficient of the currently encoded coefficient, determine a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and encode the value for the currently encoded coefficient based on the determined context offset.

[0014]

[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 become apparent from the description, drawings, and claims. [Brief description of the drawings]

[0015] [Figure 1] FIG. 1 is a block diagram illustrating an example video encoding and decoding system, which may implement the techniques of this disclosure. [Figure 2A]

[0016] FIG. 2A is a conceptual diagram illustrating an exemplary quaternary tree binary tree (QTBT) structure and a corresponding coding tree unit (CTU). [Figure 2B] FIG. 2B is a conceptual diagram illustrating an exemplary quaternary tree binary tree (QTBT) structure and a corresponding coding tree unit (CTU). [Diagram 3]

[0017] FIG. 3 shows examples of neighboring coefficients of a coefficient currently being encoded or decoded. [Figure 4]

[0018] FIG. 4 is a block diagram illustrating an example video encoder that may implement the techniques of this disclosure. [Diagram 5]

[0019] FIG. 5 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure. [Figure 6A]

[0020] FIG. 6A is a conceptual diagram illustrating the range update process in binary arithmetic coding. [Figure 6B] FIG. 6B is a conceptual diagram illustrating the range update process in binary arithmetic coding. [Figure 7]

[0021] FIG. 7 is a conceptual diagram illustrating the output process in binary arithmetic coding. [Figure 8]

[0022] FIG. 8 is a block diagram illustrating a context-adaptive binary arithmetic coding (CABAC) coder in a video encoder. [Figure 9]

[0023] FIG. 9 is a block diagram illustrating a CABAC coder in a video decoder. [Figure 10]

[0024] FIG. 10 is a flow chart illustrating a process for encoding video data. [Figure 11]

[0025] FIG. 11 is a flow chart illustrating a process for decoding video data. [Figure 12]

[0026] FIG. 12 is a flow chart illustrating a process of determining a context for coding the signs of coefficients of a residual block. Detailed Description

[0016]

[0027] Video coding (e.g., video encoding and / or video decoding) typically involves predicting blocks of video data from either already coded blocks of video data in the same picture (e.g., intra prediction) or already coded blocks of video data in a different picture (e.g., inter prediction). In some instances, the video encoder also calculates residual data by comparing the predicted block to the original block. The residual data thus represents the difference between the predicted block and the original block. To reduce the number of bits required to signal the residual data, the video encoder may transform and quantize the residual data and signal the transformed and quantized residual data in the encoded bitstream. The compression achieved by the transform and quantization process may be lossy, meaning that the transform and quantization process may introduce distortion into the decoded video data.

[0017]

[0028] A video decoder decodes the residual data and adds the residual data to the predictive block to generate a reconstructed video block that more closely matches the original video block than the predictive block alone. Due to losses introduced by transforming and quantizing the residual data, the initial reconstructed block may have distortions or artifacts. One common type of artifact or distortion is called blockiness, which is discernible at the boundaries of the blocks used to code the video data.

[0018]

[0029] To further improve the quality of the decoded video, the video decoder may perform one or more filtering operations on the reconstructed video blocks. Examples of these filtering operations include deblocking filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering (ALF). Parameters for these filtering operations may either be determined by the video encoder and explicitly signaled in the encoded video bitstream, or may be implicitly determined by the video decoder without the parameters having to be explicitly signaled in the encoded video bitstream.

[0019]

[0030] In some coding scenarios, a video encoder may encode video data in a transform skip mode in which the transform process described above is not performed, i.e., the transform process is skipped. Thus, for blocks encoded in the transform skip mode, the residual data is not transformed. Residual blocks of video data encoded using the transform skip mode may also be referred to as untransformed residual blocks. This disclosure describes techniques for coefficient coding schemes for the transform skip mode. The techniques of this disclosure include an entropy decoding process that converts a binary representation into a series of non-binary valued quantized coefficients. A corresponding entropy encoding process, which is generally the inverse process of the entropy decoding, is also part of this disclosure. The techniques of this disclosure may be applied to any of the existing video codecs, such as High Efficiency Video Coding (HEVC), or to standards currently under development, such as Versatile Video Coding (VVC), and other future video coding standards.

[0020]

[0031] This disclosure proposes a technique that includes, for example, determining a context offset for a currently decoded coefficient based on a value for a first adjacent coefficient and a value for a second adjacent coefficient, and decoding the value for the currently decoded coefficient based on the determined context offset. Because coefficient values ​​between adjacent coefficients in a residual block tend to be more correlated for a transform-skipped block than for a transformed block, the techniques of this disclosure result in improved entropy coding, which can improve overall coding efficiency, for example, by reducing the bit overhead required to represent the encoded video data without degrading the quality of the decoded video data.

[0021]

[0032] 1 is a block diagram illustrating an example video encoding and decoding system 100 that may implement the techniques of this disclosure. The techniques of this disclosure are generally directed to coding (encoding and / or decoding) video data. Generally, video data includes some data for processing video. Thus, video data may include raw uncoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata such as signaling data.

[0022]

[0033] As shown in FIG. 1, the system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116, in this example. In particular, 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 be or include any of a wide range of devices, including a desktop computer, a notebook (i.e., laptop) computer, a tablet computer or other mobile device, a set-top box, a telephone handset, a smartphone, a television, a camera, a display device, a digital media player, a video game console, a video streaming device, a broadcast receiver device, or the like. In some cases, the source device 102 and the destination device 116 may be equipped for wireless communication and thus may be referred to as wireless communication devices.

[0023]

[0034] In the example of FIG. 1, source device 102 includes video source 104, memory 106, video encoder 200, and output interface 108. Destination device 116 includes input interface 122, video decoder 300, memory 120, and display device 118. According to this disclosure, video encoder 200 of source device 102 and video decoder 300 of destination device 116 may be configured to apply techniques for coefficient coding described in this disclosure. Thus, source device 102 represents an example of a video encoding device, while destination device 116 represents an example of a video decoding device. In other examples, source device and destination device may include other components or configurations. For example, source device 102 may receive video data from an external video source, such as an external camera. Similarly, destination device 116 may interface with an external display device rather than including an integrated display device.

[0024]

[0035] The system 100 shown in FIG. 1 is only one example. In general, any digital video encoding and / or decoding device may perform the techniques for coefficient coding described in this disclosure. The source device 102 and the destination device 116 are only examples of such coding devices, where the source device 102 generates coded video data for transmission to the destination device 116. This disclosure refers to a "coding" device as a device that performs coding (encoding and / or decoding) of data. Thus, the video encoder 200 and the video decoder 300 represent examples of coding devices, and in particular, video encoders and video decoders, respectively. In some examples, the devices 102, 116 may operate in a substantially symmetrical manner, such that each of the devices 102, 116 includes a video encoding component and a video decoding component. Thus, the system 100 may support one-way or two-way video transmission between the video devices 102, 116, for, for example, video streaming, video playback, video broadcasting, or video telephony.

[0025]

[0036] Generally, the video source 104 represents a source of video data (i.e., raw, uncoded video data) and provides a sequential series of pictures (also referred to as "frames") of the video data to the video encoder 200, which encodes the data for the pictures. The video source 104 of the originating device 102 may include a video capture device such as a video camera, a video archive containing previously captured raw video, and / or a video feed interface for receiving 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, archival, 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 reconstruct the pictures from the order in which they are received (sometimes referred to as "display order") into a coding order for coding. The video encoder 200 may generate a bitstream including the encoded video data. The source device 102 may then output the encoded video data via output interface 108 onto computer-readable medium 110 for receipt and / or retrieval by, for example, an input interface 122 of the destination device 116 .

[0026]

[0037] 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 may store raw video data, e.g., raw video from the video source 104 and raw decoded video data from the video decoder 300. Additionally or alternatively, the memories 106, 120 may store software instructions executable by, e.g., the video encoder 200 and the video decoder 300, respectively. In this example, the memories 106 and 120 are shown separate from the video encoder 200 and the video decoder 300, but it should be understood that the video encoder 200 and the video decoder 300 may also include internal memories for functionally similar or equivalent purposes. Additionally, the memories 106, 120 may store encoded video data, e.g., output from the video encoder 200 and input to the video decoder 300. In some examples, a portion of the memory 106, 120 may be allocated as one or more video buffers, for example, to store raw decoded and / or encoded video data.

[0027]

[0038] The computer-readable medium 110 may represent any type of medium or device capable of transferring 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 that allows the source device 102 to transmit the encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 may modulate a transmission signal including the encoded video data according to a wireless communication standard, and the input interface 122 may demodulate a received transmission signal according to a communication standard such as a wireless communication protocol. The communication medium may comprise 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 routers, switches, base stations, or any other equipment that may be useful in facilitating communication from the source device 102 to the destination device 116.

[0028]

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

[0029]

[0040] In some examples, the computer-readable medium 110 may include a file server 114 or another intermediate storage device that may store the encoded video data generated by the source device 102. The source device 102 may output the encoded video data to the file server 114 or another intermediate storage device that may store the encoded video generated by the source device 102. The destination device 116 may access the stored video data from the file server 114 via streaming or download. The file server 114 may be any type of server device capable of storing the encoded video and transmitting the encoded video to the destination device 116. The file server 114 may represent a web server (e.g., for a website), a file transfer protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. The destination device 116 may access the encoded video data from the file server 114 through 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.), or a combination of both, suitable for accessing encoded video data stored on the file server 114. The file server 114 and the input interface 122 may be configured to operate according to a streaming transmission protocol, a download transmission protocol, or a combination thereof.

[0030]

[0041] Output interface 108 and input interface 122 may represent a wireless transmitter / receiver, a modem, a wired networking component (e.g., an Ethernet card), a wireless communication component operating according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 comprise wireless components, output interface 108 and input interface 122 may be configured to transfer data, such as video data, encoded according to a cellular communication standard, such as 4G, 4G-LTE (Long Term Evolution), LTE Advanced, 5G, or the like. In some examples where output interface 108 comprises a wireless transmitter, output interface 108 and input interface 122 may be configured to transfer data, such as video data, encoded according to other wireless standards, such as the IEEE 802.11 specification, the IEEE 802.15 specification (e.g., ZigBee™), the Bluetooth™ standard, or the like. In some examples, source device 102 and / or destination device 116 may include respective system-on-chip (SoC) devices. For example, source device 102 may include an SoC device that performs functionality provided by video encoder 200 and / or output interface 108, and destination device 116 may include an SoC device that performs functionality provided by video decoder 300 and / or input interface 122.

[0031]

[0042] The techniques of this disclosure may be applied to video coding to support any of a variety of multimedia applications, such as over-the-air television broadcast, cable television transmission, satellite television transmission, Internet streaming video transmission such as Dynamic Adaptive Streaming over HTTP (DASH), digital video encoded on a data storage medium, decoding of digital video stored on a data storage medium, or other applications.

[0032]

[0043] An input interface 122 of the destination device 116 receives an encoded video bitstream from a computer-readable medium 110 (e.g., a communication medium, a storage device 112, a file server 114, or the like). The encoded video bitstream may include signaling information defined by the video encoder 200 and also used by the video decoder 300, such as syntax elements having values ​​that describe characteristics and / or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, or the like). A 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 (OLED) display, or another type of display device.

[0033]

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

[0034]

[0045] The video encoder 200 and the video decoder 300 may 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 combinations thereof. When the techniques are implemented partially in software, the device may store instructions for the software in a suitable, non-transitory computer-readable medium and may use one or more processors to execute the instructions in hardware to perform the techniques of this disclosure. Each of the video encoder 200 and the video decoder 300 may be included in one or more encoders or decoders, and either the encoder or the decoder may be integrated as part of a combined encoder / decoder (CODEC) in the respective device. The device including the video encoder 200 and / or the video decoder 300 may comprise an integrated circuit, a microprocessor, and / or a wireless communication device, such as a cellular telephone.

[0035]

[0046] Video encoder 200 and video decoder 300 may operate according to a video coding standard such as ITU-T H.265, also referred to as High Efficiency Video Coding (HEVC), or extensions to the video coding standard, such as multiview and / or scalable video coding extensions. Alternatively, video encoder 200 and video decoder 300 may operate according to other proprietary or industry standards, such as ITU-T H.266, also referred to as Joint Exploration Test Model (JEM) or Versatile Video Coding (VVC). A draft of the VVC standard is described in "Versatile Video Coding (Draft 4)" in Bross et al., Joint Video Experts Team (JVET) of ITU-T SG16WP3 and ISO / IEC JTC1 / SC29 / WG11, 13th Meeting: Marrakesh, Massachusetts, January 9-18, 2019, JVET-M1001-v5 (hereinafter "VVC Draft 4"). Another draft of the VVC standard is described in "Versatile Video Coding (Draft 7)" in Bross et al., Joint Video Experts Team (JVET) of ITU-T SG16WP3 and ISO / IEC JTC1 / SC29 / WG11, 16th Meeting: Geneva, CH, October 1-11, 2019, JVET-P2001-v14 (hereinafter "VVC Draft 7"). However, the techniques of this disclosure are not limited to any particular coding standard.

[0036]

[0047] Generally, the video encoder 200 and the video decoder 300 may perform block-based coding of pictures. The term “block” generally refers to a structure that includes data to be processed (e.g., encoded, decoded, or otherwise used in the encoding and / or decoding process). For example, a block may include a two-dimensional matrix of samples of luminance data and / or chrominance data. Generally, the video encoder 200 and the video decoder 300 may code video data represented in a YUV (e.g., Y, Cb, Cr) format. That is, rather than coding red, green, and blue (RGB) data for samples of a picture, the video encoder 200 and the video decoder 300 may code luminance and chrominance components, where the chrominance components may include both red and blue hues of chrominance components. In some examples, the video encoder 200 converts received RGB formatted data to a YUV representation prior to encoding, and the video decoder 300 converts the YUV representation to an RGB format. Alternatively, pre-processing and post-processing units (not shown) may perform these transformations.

[0037]

[0048] This disclosure may generally refer to coding (e.g., encoding and decoding) a picture to include processes for encoding or decoding data for a picture. Similarly, this disclosure may refer to coding a block of a picture to include processes for encoding or decoding data for a block, e.g., predictive and / or residual coding. An encoded video bitstream generally includes a set of values ​​for syntax elements that represent coding decisions (e.g., coding modes) and partitioning of a picture into blocks. Thus, references to coding a picture or a block should generally be understood as coding values ​​for the syntax elements that form the picture or block.

[0038]

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

[0039]

[0050] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to JEM or VVC. According to JEM or VVC, a video coder (such as the video encoder 200) partitions a picture into multiple coding tree units (CTUs). The video encoder 200 may partition the CTUs according to a tree structure, such as a quaternary tree-binary tree (QTBT) structure or a multi-type tree (MTT) structure. The QTBT structure eliminates the concept of multiple partition types, such as the separation between CUs, PUs, and TUs in HEVC. The QTBT structure includes two levels, a first level partitioned according to a quaternary tree partition, and a second level partitioned according to a binary tree partition. The root node of the QTBT structure corresponds to a CTU. The leaf nodes of the binary tree correspond to coding units (CUs).

[0040]

[0051] In an MTT partition structure, blocks may be partitioned using one or more types of quaternary tree (QT) partitions, bipartite tree (BT) partitions, and ternary tree (TT) partitions (also called ternary trees (TT)). A ternary or ternary tree partition is a partition in which a block is divided into three sub-blocks. In some examples, a ternary or ternary tree partition divides a block into three sub-blocks without dividing the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.

[0041]

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

[0042]

[0053] Video encoder 200 and video decoder 300 may be configured to use HEVC-specific quad-tree partitioning, QTBT partitioning, MTT partitioning, or other partitioning structures. For purposes of illustration, the description of the techniques of this disclosure is presented with respect to QTBT partitioning. However, it should be understood that the techniques of this disclosure may also be applied to video coders configured to use quad-tree partitioning or other types of partitioning as well.

[0043]

[0054] Blocks (e.g., CTUs or CUs) may be grouped in a picture in various ways. As one example, a brick may refer to a rectangular region of a CTU row in a particular tile in a picture. A tile may be a rectangular region of a CTU in a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular region of a CTU with a height equal to the height of the picture and a width specified by a syntax element (e.g., in a picture parameter set). A tile row refers to a rectangular region of a CTU with a height specified by a syntax element (e.g., in a picture parameter set) and a width equal to the width of the picture.

[0044]

[0055] In some instances, a tile may be partitioned into multiple bricks, each of which may contain one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. However, a brick that is a true subset of a tile may not be referred to as a tile.

[0045]

[0056] The bricks in a picture may also be arranged into slices. A slice may be an integer number of bricks of a picture that may be contained exclusively in a single Network Abstraction Layer (NAL) unit. In some examples, a slice contains either a number of complete tiles or only a continuous sequence of complete bricks of one tile.

[0046]

[0057] This disclosure may use "NxN" 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, e.g., 16x16 samples or 16 by 16 samples. Generally, a 16x16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an NxN CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. Samples in a CU may be arranged in rows and columns. Furthermore, a CU does not necessarily have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may comprise NxM samples, where M is not necessarily equal to N.

[0047]

[0058] Video encoder 200 encodes video data for a CU that represents prediction and / or residual information as well as other information. The prediction information indicates how the CU should be predicted to form a predictive block for the CU. The residual information generally represents sample-by-sample differences between samples of the CU before encoding and the predictive block.

[0048]

[0059] To predict a CU, the video encoder 200 may form a predictive block for the CU, typically through inter prediction or intra prediction. Inter prediction generally refers to predicting a CU from data of a previously coded picture, while intra prediction generally refers to predicting a CU from previously coded data of the same picture. To perform inter prediction, the video encoder 200 may generate a predictive block using one or more motion vectors. The video encoder 200 may generally perform a motion search to identify a reference block that closely matches the CU, e.g., with respect to the difference between the CU and the reference block. The video encoder 200 may calculate a difference metric using a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), or other such difference calculation to determine whether the reference block closely matches the current CU. In some examples, the video encoder 200 may predict the current CU using unidirectional prediction or bidirectional prediction.

[0049]

[0060] Some instances of JEM and VVC also provide an affine motion compensation mode, which may be considered an inter prediction mode. In an affine motion compensation mode, video encoder 200 may determine two or more motion vectors that represent non-translational motion, such as zoom-in or zoom-out, rotation, perspective motion, or other irregular motion types.

[0050]

[0061] To perform intra prediction, the video encoder 200 may select an intra prediction mode to generate a prediction block. Some examples of JEM and VVC provide 67 intra prediction modes, including planar and DC modes, along with various directional modes. In general, the video encoder 200 selects an intra prediction mode that describes samples neighboring a current block (e.g., a block of a CU) that predict samples of the current block. Assuming that the video encoder 200 codes the CTUs and CUs in raster scan order (left to right, top to bottom), such samples may generally be above, to the left, or to the left of the current block in the same picture as the current block.

[0051]

[0062] The video encoder 200 encodes data representing a prediction mode for the current block. For example, for an inter prediction mode, the video encoder 200 may encode motion information for the corresponding mode along with data representing which of various available inter prediction modes is used. For unidirectional or bidirectional inter prediction, for example, the video encoder 200 may encode motion vectors using advanced motion vector prediction (AMVP) or merge mode. The video encoder 200 may encode motion vectors for an affine motion compensation mode using an analogous mode.

[0052]

[0063] Following prediction, such as intra-prediction or inter-prediction, of a block, the video encoder 200 may compute residual data for the block. The residual data, such as a residual block, represents sample-by-sample differences between the block and a prediction block for the block formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to generate transformed data in a transform domain instead of the sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. Additionally, the video encoder 200 may apply a secondary transform subsequent to the first transform, such as a mode-dependent non-separable quadratic transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), or the like. The video encoder 200 generates transform coefficients following application of the one or more transforms.

[0053]

[0064] Although the above describes examples in which a transform is performed, in some examples, the transform may be skipped. For example, video encoder 200 may implement a transform skip mode in which the transform operation is skipped. In examples in which the transform is skipped, video encoder 200 may output coefficients corresponding to residual values ​​instead of transform coefficients. In the following description, the term "coefficients" should be interpreted to include either coefficients corresponding to residual values ​​or transform coefficients generated as a result of the transform.

[0054]

[0065] As described above, following any transformation to generate the coefficients or the transformation being skipped, the video encoder 200 may perform quantization of the coefficients. In some examples, when the transformation is skipped, the quantization may also be skipped. Quantization generally refers to a process in which coefficients are quantized to potentially reduce the amount of data used to represent the coefficients and provide further compression. By performing a quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the coefficients. For example, the video encoder 200 may truncate an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform the quantization, the video encoder 200 may perform a bitwise right shift of the value to be quantized.

[0055]

[0066] Following quantization, the video encoder 200 may scan the coefficients (e.g., generated from the result of a transform or due to a transform skip) to generate a one-dimensional vector from a two-dimensional matrix including the quantized coefficients. The scan may be designed to place coefficients with higher energy (and therefore lower frequency) at the front of the vector and coefficients with lower energy (and therefore higher frequency) at the rear of the vector. In examples where the transform is skipped, the scan may not result in higher energy coefficients being placed at the front of the vector and lower energy coefficients being placed at the rear of the vector. In some examples, the video encoder 200 may utilize a predefined scan order to scan the quantized coefficients to generate a serialized vector and then entropy encode the quantized coefficients of the vector. In other examples, the video encoder 200 may perform an adaptive scan. After scanning the quantized coefficients to form a one-dimensional vector, the video encoder 200 may entropy encode the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). Video encoder 200 may also entropy encode values ​​for syntax elements that describe metadata related to the encoded video data for use by video decoder 300 in decoding the video data.

[0056]

[0067] As introduced above, video encoder 200 encodes the residual data into TUs. Depending on the expected characteristics of the residual data in the TUs, video encoder 200 may encode the TUs in different modes, such as transform mode or transform skip mode, where different modes utilize different coefficient coding schemes. Some coefficient coding schemes encode the TUs using coefficient groups. A coefficient group is generally a subset of the coefficients in a TU. For example, video encoder 200 may encode a 16×16 TU as four 4×4 coefficient groups.

[0057]

[0068] To perform CABAC, the video encoder 200 may assign a context in a context model to a symbol to be transmitted. The context may relate, for example, to whether neighboring values ​​of the symbol are zeroed or not. A probability determination may be based on the context assigned to the symbol.

[0058]

[0069] Video encoder 200 may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, for example, in a picture header, in a block header, in a slice header, or in other syntax data, such as a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS), to video decoder 300. Video decoder 300 may similarly decode such syntax data to determine how to decode the corresponding video data.

[0059]

[0070] In this manner, the video encoder 200 may generate a bitstream containing the encoded video data, e.g., including syntax elements describing partitions of a picture into blocks (e.g., CUs) and prediction and / or residual information for the blocks. Finally, the video decoder 300 may receive the bitstream and decode the encoded video data.

[0060]

[0071] In general, video decoder 300 performs a process that is the inverse of that performed by video encoder 200 to decode encoded video data of the bitstream. For example, video decoder 300 may decode values ​​for syntax elements of the bitstream using CABAC in a manner that is substantially similar, albeit inverse, to the CABAC encoding process of video encoder 200. The syntax elements may specify partitioning information of a picture into CTUs and partitioning each CTU according to a corresponding partitioning structure, such as a QTBT structure, to specify CUs of the CTUs. The syntax elements may further specify prediction and residual information for blocks (e.g., CUs) of video data.

[0061]

[0072] The residual information may be represented, for example, by quantized coefficients representing either residual values ​​or transform coefficients. The video decoder 300 may inverse quantize and inverse transform the quantized transform coefficients of the block to reconstruct a residual block for the block. In an example where the video encoder 200 skipped a transform operation (e.g., transform skip mode), the video coder 300 may skip the inverse transform operation. The video decoder 300 may form a predictive block (i.e., a predictive block) for the block using the signaled prediction mode (intra prediction or inter prediction) and associated prediction information (e.g., motion information for inter prediction). The video decoder 300 may then combine the predictive block and the residual block (on a sample-by-sample basis) to 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.

[0062]

[0073] According to the techniques of this disclosure, the video encoder 200 and the video decoder 300 may be configured to determine a context offset for a currently decoded coefficient based on a value for a first neighboring coefficient and a value for a second neighboring coefficient, and decode the value for the currently decoded coefficient based on the determined context offset. Because coefficient values ​​between adjacent coefficients in a residual block tend to be more correlated in a transform-skipped block than in a transformed block, the techniques of this disclosure may result in improved entropy coding, which can improve overall coding efficiency, for example, by reducing the bit overhead required to represent the encoded video data without degrading the quality of the decoded video data.

[0063]

[0074] This disclosure may generally relate to "signaling" certain information, such as syntax elements. The term "signaling" may generally relate to communication of values ​​for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values ​​for syntax elements in a bitstream. Generally, signaling refers to causing a value to occur in the bitstream. As mentioned above, source device 102 may forward the bitstream to destination device 116 in substantially real-time or not in real-time, such as may occur when storing syntax elements in storage device 112 for later retrieval by destination device 116.

[0064]

[0075] 2A and 2B are conceptual diagrams illustrating an exemplary quaternary bipartite tree (QTBT) structure 130 and corresponding coding tree unit (CTU) 132. Solid lines represent quaternary tree splits, and dotted lines represent bipartite tree splits. At each split (i.e., non-leaf) node of the bipartite tree, one flag is signaled to indicate which split type (i.e., horizontal or vertical) is used. In this example, 0 indicates horizontal split and 1 indicates vertical split. For quaternary tree splits, the quaternary tree node does not need to indicate the split type since it splits a block horizontally and vertically into four sub-blocks with equal size. Thus, video encoder 200 may encode, and video decoder 300 may decode, syntax elements (such as partitioning information) for the region tree level (i.e., first level) of QTBT structure 130 (i.e., solid lines) and syntax elements (such as partitioning information) for the prediction tree level (i.e., second level) of QTBT structure 130 (i.e., dashed lines). Video encoder 200 may encode, and video decoder 300 may decode, video data such as prediction data and transform data for CUs represented by terminal leaf nodes of QTBT structure 130.

[0065]

[0076] 2B may be associated with parameters that define the sizes of blocks corresponding to nodes of the QTBT structure 130 at the first and second levels. These parameters may include a CTU size (representing the size of the CTU 132 in the sample), a minimum quaternary tree size (MinQTSize, representing the minimum allowable quaternary tree leaf node size), a maximum bipartite tree size (MaxBTSize, representing the maximum allowable bipartite tree root node size), a maximum bipartite tree depth (MaxBTDepth, representing the maximum allowable bipartite tree depth), and a minimum bipartite tree size (MinBTSize, representing the minimum allowable bipartite tree leaf node size).

[0066]

[0077] 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 partitioned according to a quaternary tree partition. That is, the nodes at the first level may be leaf nodes (without child nodes) or may have four child nodes. The example QTBT structure 130 represents a node that includes a parent node and a child node with a solid line for the branch. If the node at the first level is not larger than the maximum allowed binary tree root node size (MaxBTSize), the node may be further partitioned according to the respective binary tree. The binary tree partitioning of one node may be repeated until the node obtained by the partitioning reaches the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). The example QTBT structure 130 represents a node with a dashed line for the branch. The binary tree leaf nodes are referred to as coding units (CUs), which are used for prediction (e.g., intra-picture or inter-picture prediction) and transformation without any further partitioning. As explained above, a CU may also be referred to as a "video block" or a "block."

[0067]

[0078] In one example of a QTBT partitioning structure, the CTU size is set as 128×128 (luma samples and two corresponding 64×64 chroma samples), MinQTSize is set as 16×16, MaxBTSize is set as 64×64, MinBTSize is set as 4 (for both width and height), and MaxBTDepth is set as 4. First, quaternary tree partitioning is applied to the CTU to generate quaternary tree leaf nodes. The quaternary tree leaf nodes may have sizes from 16×16 (i.e., MinQTSize) to 128×128 (i.e., CTU size). If the quaternary tree leaf node is 128×128, it will not be further partitioned by the bipartite tree since the size exceeds MaxBTSize (i.e., 64×64 in this example). Otherwise, the quaternary tree leaf node will be further partitioned by the bipartite tree. Therefore, the quaternary tree leaf node is also the root node for the binary tree and has the binary tree depth as 0. When the binary tree depth reaches MaxBTDepth (4 in this example), no further splits are allowed. A binary tree node with a width equal to MinBTSize (4 in this example) means that no further horizontal splits are allowed. Similarly, a binary tree node with a height equal to MinBTSize means that no further vertical splits are allowed for that binary tree node. As mentioned above, the leaf nodes of the binary tree are called CUs and are further processed according to prediction and transformation without further partitioning.

[0068]

[0079] When a block of video data is coded in transform skip mode, the video encoder 200 skips the transform process on the residual signal before performing the quantization process. The video decoder 300 similarly skips the inverse transform process step after performing the inverse quantization process. The characteristics of the non-transformed residual signal are typically quite different from the characteristics of the transformed signal. For example, coefficients for a transform skipped block tend to be more correlated with their neighboring coefficients when compared to coefficients for a transformed block. As a result, the level values ​​and sign information for neighboring coefficients in a transform skipped block of residual data tend to be more correlated when compared to the level values ​​and sign information for a transformed block of residual data.

[0069]

[0080] B. Bross, T. Nguyen, P. Keydel, H. Schwarz, D. Marpe, T. Wiegand, "Non-CE8: Unified Transform Type Signaling and Residual Coding for Transform Skip", JVET document JVET-M0464, Marrakech, MA, January 2019, describes a proposed process for performing residual coding for blocks coded in transform skip mode. For efficient coding of level and sign information in transform skip mode, the coefficient coding proposed in JVET-M0464 is modified to exploit signal characteristics for more efficient coding.

[0070]

[0081] Figure 3 shows an example of three coefficients from a transform-skipped block of residual data. The transform-skipped block may also include additional coefficients not shown in Figure 3. In the example of Figure 3, coefficient value X represents the value of coefficient 140, which represents the coefficient currently being coded. Coefficient value X0 represents the value of coefficient 142, which is the left neighboring coefficient of coefficient 140. Coefficient value X1 represents the value of coefficient 144, which is the top neighboring coefficient of coefficient 140. In this disclosure, the top neighbor is sometimes referred to as the upper neighbor.

[0071]

[0082] The video encoder 200 and the video decoder 300 may be configured to perform sign coding on the coefficients in the transform skip block. In the techniques for transform skip residual coding described in JVET-M0464, the coefficients are coded from first (i.e., top left) to last (i.e., bottom right) instead of last to first as is done for transformed blocks. When implementing the techniques of JVET-M0464, the video encoder 200 and the video decoder 300 may be configured to use CABAC to context code sign information using the channel type of the residual as a context. That is, the video encoder 200 and the video decoder 300 may use one context for the luma residual and another context for the chroma residual. This disclosure describes sign coding techniques that may be used instead of or in addition to the techniques described in JVET-M0464. The following technique utilizes the sign information of the above-neighboring coefficient (e.g., coefficient 144 in FIG. 3) and the left-neighboring coefficient (e.g., coefficient 142 in FIG. 3) to derive a sign coding context offset for the currently coded coefficient (e.g., coefficient 140 in FIG. 3).

[0072]

[0083] Referring to Figure 3, X0 is the left adjacent coefficient value and X1 is the top adjacent coefficient value. If both adjacent coefficients are zero or both are non-zero but have opposite signs, the video encoder 200 and the video decoder 300 may use context offset 0 (ctxOffset = 0). Otherwise, if both are non-negative, the video encoder 200 and the video decoder 300 may use context offset 1 (ctxOffset = 1). For all other cases, the video encoder 200 and the video decoder 300 may use context offset 2 (ctxOffset = 2). This can be described by the following pseudocode: if((X0==0&&X1==0)||((X0*X1)<0)) { ctxOffset=0; } else if(X0>=0&&X1>=0) { ctxOffset=1; } else { ctxOffset=2; }

[0073]

[0084] In some examples, if both neighboring coefficients are zero or both are non-zero but have opposite signs, the video encoder 200 and the video decoder 300 may use context offset 0. Otherwise (when both are positive or both are negative or one is zero and the other is non-zero), the video encoder 200 and the video decoder 300 may use context 1. If context 1 is used, a signaled code value of 0 or 1 will mean, depending on the convention, that the code for the currently coded coefficient is the same as the code of one of the non-zero neighbors. This technique can also be extended to coding scenarios where only values ​​of previously coded non-zero coefficients may be used for context derivation, and a code value of 0 or 1 indicates that the sign of the coefficient is the same sign as the previously coded non-zero coefficient code with a single context.

[0074]

[0085] In combination with the context offset derivation described above, separate context sets can be used for the luma and chroma components.

[0075]

[0086] Video encoder 200 and video decoder 300 may also be configured to perform level mapping. In 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). Therefore, absCoeffLevel may be constructed by 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.

[0076]

[0087] Instead of directly representing absCoeffLevel as in JVET-M0464, video encoder 200 may be configured to map absCoeffLevel to a modified level. Video decoder 300 may be configured to perform the inverse mapping.

[0077]

[0088] Similar to the code coding context offset derivation technique described above, the video encoder 200 and the video decoder 300 may use the absCoeffLevel information of the left and above neighboring coefficients to encode and decode absolute coefficient level values. In this example, X0 indicates the absolute coefficient level of the left neighboring coefficient (e.g., coefficient 142 in FIG. 3) relative to the currently coded coefficient (e.g., coefficient 140 in FIG. 3), and X1 indicates the absolute coefficient level of the above neighboring coefficient (e.g., coefficient 144 in FIG. 3) relative to the currently coded coefficient (e.g., coefficient 140 in FIG. 3). The mapped absCoeffMod may be coded to represent the coefficients with absolute coefficient level absCoeff.

[0078]

[0089] The operation of video encoder 200 to derive a value for absCoeffMod may be illustrated in the following pseudocode: pred = max(X0,X1); if(absCoeff==pred { absCoeffMod=1; } else { absCoeffMod=(absCoeff <pred)?absCoeff+1:absCoeff; }

[0079]

[0090] In some examples, if the absolute value of the coefficient to be coded (absCoeff) is equal to the maximum neighboring predictor pred, then the video encoder 200 sets the modified level absCoeffMod to 1. Otherwise, if absCoeff is less than the predictor, then the video encoder 200 increments the value to be coded by 1. Otherwise, the video encoder 200 does not modify the absCoeff value.

[0080]

[0091] For example, the video encoder 200 may determine a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, and in response to the level value of the currently encoded coefficient being equal to the predicted level value, encode the syntax element with a value equal to one. In other cases, the video encoder 200 may determine a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, and in response to the level value of the currently encoded coefficient being less than the predicted level value, encode the syntax element with a value equal to the level value of the currently encoded coefficient minus one. In other cases, the video encoder 200 may determine a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, and in response to the level value of the currently encoded coefficient being greater than the predicted level value, encode the syntax element with a value equal to the level value of the currently encoded coefficient minus one.

[0081]

[0092] The operation of the video decoder 300 to derive the value of absCoeff can be illustrated by the following pseudocode: pred = max(X0,X1); if(absCoeffMod==1&&pred>0) { absCoeff=pred; } else { absCoeff=absCoeffMod-(absCoeffMod<=pred); }

[0082]

[0093] For example, the video decoder 300 may receive a syntax element indicating determining a predicted level value for a currently decoded coefficient based on a value for a first neighboring coefficient and a value for a second neighboring coefficient, and determine that the level value of the currently decoded coefficient is equal to the predicted level value in response to the syntax element having a value equal to 1. In other cases, the video decoder 300 may receive a syntax element indicating determining a predicted level value for a currently decoded coefficient based on a value for a first neighboring coefficient and a value for a second neighboring coefficient, and determine that the level value of the currently decoded coefficient is equal to the value for the syntax element plus 1 in response to the value for the syntax element being greater than the predicted level value. In other cases, the video decoder 300 may receive a syntax element indicating a predicted level value for a currently decoded coefficient based on a value for a first neighboring coefficient and a value for a second neighboring coefficient, and in response to the value for the syntax element being less than the predicted level value, determine that the level value of the currently decoded coefficient is equal to the value for the syntax element.

[0083]

[0094] In some examples, the video encoder 200 and the video decoder 300 determine or derive a context for a syntax element identified herein as abs_level_gt1_flag based on whether the left-neighboring coefficient value and the top-neighboring coefficient value are zero. The syntax element abs_level_gt1_flag is a syntax element used to code the coefficient value. A value of abs_level_gt1_flag equal to 1 may, for example, mean that the absolute level of the coefficient is greater than 1. A value of abs_level_gt1_flag equal to 0 may, for example, mean that the absolute level of the coefficient is not greater than 1.

[0084]

[0095] In one example, the context may be one of multiple, e.g., three different contexts. One context may be derived for the case where both the left adjacent coefficient and the above adjacent coefficient have a non-zero value. Another context may be derived for the case where only one of the left adjacent coefficient or the above adjacent coefficient has a non-zero value. A third context may be derived for the case where both the left adjacent coefficient and the above adjacent coefficient have a zero value. In one example, this context derivation applies only to non-BDPCM (Block Differential Pulse Code Modulation) modes.

[0085]

[0096] In some examples, for coding scenarios with non-existent or unavailable neighboring values, such as when the coefficient being coded is on the left boundary of a block and there is no left neighbor, video encoder 200 and video decoder 300 may be configured to use zero values ​​when deriving the context.

[0086]

[0097] In some examples, the context derivation can be described as follows: ctxOffset=0; if(Exist(left_neighbor)&&non-0(left_neighbor)) { ctxOffset+=1; } else if(Exist(above_neighbor)&&non-0(above_neighbor)) { ctxOffset+=1; } In such an example, for a non-existent / unavailable neighboring value (e.g., a left neighbor of a value on the left boundary of a block), video encoder 200 and video decoder 300 may be configured to use a zero value for the unavailable value when deriving the context.

[0087]

[0098] 4 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. FIG. 4 is provided for purposes of explanation and should not be considered a limitation of the techniques as broadly illustrated and described in this disclosure. For purposes of explanation, this disclosure describes video encoder 200 in the context of video coding standards, such as the developing HEVC (H.265) video coding standard and the VVC (H.266) video coding standard. However, the techniques of this disclosure are not limited to these video coding standards and are generally applicable to video encoding and decoding.

[0088]

[0099] 4, 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 (DBP) 218, and an entropy encoding 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, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a DBP 218, and an entropy encoding unit 220 may be implemented in one or more processors or processing circuits. Additionally, the video encoder 200 may include additional or alternative processors or processing circuits to perform these or other functions.

[0089]

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

[0090]

[0101] In this disclosure, references to video data memory 230 should not be construed as limited to memory that is internal to video encoder 200, unless specifically described as such, or to memory that is external to video encoder 200, unless specifically described as such. Rather, references to video data memory 230 should be understood as a reference memory that stores video data that video encoder 200 receives for encoding (e.g., video data for a current block to be encoded). Memory 106 of FIG. 1 may also provide temporary storage of outputs from various units of video encoder 200.

[0091]

[0102] The various units in FIG. 4 are illustrated to aid in understanding the operations performed by the video encoder 200. The units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Fixed function circuits refer to circuits that provide specific functionality and are preconfigured for the operations they can perform. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations they can perform. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. Although a fixed function circuit may execute software instructions (e.g., to receive parameters or output parameters), the types of operations the fixed function circuit performs are generally unchanged. In some examples, one or more of the units may be separate circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.

[0092]

[0103] The video encoder 200 may include an arithmetic logic unit (ALU), an elementary functional unit (EFU), digital circuits, analog circuits, and / or a programmable core formed from programmable circuits. In examples in which the operations of the video encoder 200 are implemented using software executed by programmable circuits, the memory 106 (FIG. 1) may store object code for the software that the video encoder 200 receives and executes, or another memory (not shown) within the video encoder 200 may store such instructions.

[0093]

[0104] The video data memory 230 is configured to store the received video data. The video encoder 200 may retrieve pictures 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 raw video data to be encoded.

[0094]

[0105] 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 for performing video prediction according to other prediction modes. By way of 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, or the like.

[0095]

[0106] The mode selection unit 202 typically adjusts multiple encoding passes to test combinations of encoding parameters and results in rate-distortion values ​​for such combinations. The encoding parameters may include partitioning of CTUs into CUs, prediction modes for CUs, transform types for residual data of CUs, quantization parameters for residual data of CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than the other tested combinations.

[0096]

[0107] Video encoder 200 may partition a picture retrieved from video data memory 230 into a series of CTUs and encapsulate one or more CTUs within a slice. Mode selection unit 202 may partition the CTUs of a picture according to a tree structure, such as the QTBT structure or the HEVC quad-tree structure described above. As described above, video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such CUs may also be generally referred to as "video blocks" or "blocks."

[0097]

[0108] In general, 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 a current block (e.g., a current CU, or, in HEVC, the overlapping portion of a PU and a TU). For inter prediction of a 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 coded pictures stored in the DPB 218). In particular, the motion estimation unit 222 may calculate a value representing how similar a potential reference block is to the current block, for example, according to a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), or the like. The motion estimation unit 222 may generally perform these calculations using a sample-by-sample difference between the current block and the reference block under consideration. Motion estimation unit 222 may identify the reference block having the lowest value resulting from these calculations, which indicates the reference block that most closely matches the current block.

[0098]

[0109] The motion estimation unit 222 may form one or more motion vectors (MVs) that specify the location of a reference block in the reference picture relative to the location of the current block in the 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, while 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 blocks. As another example, if the motion vectors have fractional sample precision, the motion compensation unit 224 may interpolate values ​​for the prediction block according to one or more interpolation filters. Furthermore, for bidirectional inter prediction, the motion compensation unit 224 may retrieve data for the two reference blocks identified by the respective motion vectors and combine the retrieved data, for example, through sample-wise averaging or weighted averaging.

[0099]

[0110] As another example, for intra prediction or intra predictive coding, intra prediction unit 226 may generate a predictive block from samples neighboring the current block. For example, for a directional mode, intra prediction unit 226 may generally mathematically combine values ​​of neighboring samples and store these calculated values ​​in a prescribed direction across the current block to generate a predictive block. As another example, for a DC mode, intra prediction unit 226 may calculate an average of neighboring samples for the current block and generate a predictive block to include this resulting average for each sample of the predictive block.

[0100]

[0111] The mode selection unit 202 provides the prediction block to a residual generation unit 204. The residual generation unit 204 receives a raw 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 sample-by-sample differences between the current block and the prediction block. The resulting sample-by-sample differences define a residual block for the current block. In some examples, the residual generation unit 204 may also determine differences between 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.

[0101]

[0112] In an example where the mode selection unit 202 partitions a 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 having various sizes. As indicated above, the size of a CU may refer to the size of the luma coding block of the CU, and the size of a 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 a PU size of 2N×2N or N×N for intra prediction, and a symmetric PU size of 2N×2N, 2N×N, N×2N, N×N, or the like for inter prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2N×nU, 2N×nD, nL×2N, and nR×2N for inter prediction.

[0102]

[0113] In examples where the mode select unit 202 does not further partition the CUs into PUs, each CU may be associated with a luma coding block and a corresponding chroma coding block. As described above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2N×2N, 2N×N, or N×2N.

[0103]

[0114] For other video coding techniques, such as intra block copy mode coding, affine mode coding, and linear model (LM) mode coding, in some examples, the mode select unit 202 generates a prediction block for the current block being encoded via a respective unit related to the coding technique. In some examples, such as palette mode coding, the mode select unit 202 may not generate a prediction block, but instead generate syntax elements that indicate how to reconstruct the block based on a selected palette. In such modes, the mode select unit 202 may provide these syntax elements to the entropy encoding unit 220 to be encoded.

[0104]

[0115] As described above, the residual generation unit 204 receives video data for a current block and a corresponding predictive 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 sample-by-sample differences between the predictive block and the current block.

[0105]

[0116] 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 Karhunen-Loeve 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, e.g., a linear transform and a secondary transform, such as a rotation transform. In some examples, transform processing unit 206 does not apply a transform to the residual block. In such cases, transform processing unit 206 may output a block of coefficients, where the coefficients correspond to residual values ​​instead of transform coefficients.

[0106]

[0117] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to generate a quantized transform coefficient block. For a block coded in transform skip mode, the quantization unit 208 may quantize the coefficients in the coefficient block to generate a quantized coefficient block. The quantization unit 208 may quantize the coefficients or transform coefficients 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 by adjusting the QP value associated with the CU. Quantization may result in loss of information, and thus the quantized transform coefficients or transform coefficients may have lower precision than the original coefficients or transform coefficients generated by the transform processing unit 206.

[0107]

[0118] The inverse quantization unit 210 and the inverse transform processing unit 212 may apply inverse quantization and inverse transform, respectively, to the quantized transform coefficient block to reconstruct a residual block from the transform coefficient block. The reconstruction unit 214 may generate a reconstructed block that corresponds to the current block (potentially with some distortion) based on the reconstructed residual block and the predictive 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 from the predictive block generated by the mode selection unit 202 to generate the reconstructed block.

[0108]

[0119] Filter unit 216 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along edges of a CU. In some examples, operations of filter unit 216 may be skipped.

[0109]

[0120] The video encoder 200 stores the reconstructed blocks in the DPB 218. For example, in examples where the operations of the filter unit 216 are not performed, the reconstruction unit 214 may store the reconstructed blocks in the DPB 218. In examples where the operations of the filter unit 216 are performed, the filter unit 216 may store the reconstructed and filtered blocks in the DPB 218. The motion estimation unit 222 and the motion compensation unit 224 may retrieve reference pictures formed from the reconstructed (and potentially filtered) blocks from the DPB 218 to inter predict blocks of a picture to be subsequently encoded. In addition, the intra prediction unit 226 may intra predict other blocks in the current picture using the reconstructed blocks in the DPB 218 of the current picture.

[0110]

[0121] In general, the entropy encoding unit 220 may entropy encode syntax elements received from other functional components of the video encoder 200. For example, the entropy encoding unit 220 may entropy encode quantized transform coefficient blocks from the quantization unit 208. As another example, the entropy encoding unit 220 may entropy encode predictive syntax elements (e.g., motion information for inter prediction or intra mode information for intra prediction) from the mode selection unit 202. The entropy encoding unit 220 may perform one or more entropy encoding operations on syntax elements, which are other examples of video data, to generate entropy encoded data. For example, entropy encoding 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 encoding operation, or another type of entropy encoding operation on the data. In some examples, entropy encoding unit 220 may operate in a bypass mode in which syntax elements are not entropy encoded.

[0111]

[0122] The video encoder 200 may output a bitstream that includes entropy encoded syntax elements needed to reconstruct blocks of a slice or picture. In particular, the entropy encoding unit 220 may output the bitstream.

[0112]

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

[0113]

[0124] In some examples, operations performed with respect to luma coding blocks do not need to be repeated for chroma coding blocks. As one example, operations identifying motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated to identify MVs and reference pictures for chroma blocks. Rather, the MVs for luma coding blocks may be scaled to determine MVs for chroma blocks, and the reference pictures may be the same. As another example, the intra prediction process may be the same for luma coding blocks and chroma coding blocks.

[0114]

[0125] The video encoder 200 represents an example of a device for encoding video data including a memory configured to store video data and one or more processing units implemented in a circuit configured to determine, for a residual block of video data encoded using a transform skip mode, a value for a first neighboring coefficient of a currently encoded coefficient, determine a value for a second neighboring coefficient of the currently encoded coefficient, determine a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and encode the value for the currently encoded coefficient based on the determined context offset. The first neighboring coefficient may be, for example, one of a top neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient may be the other of a top neighboring coefficient or a left neighboring coefficient.

[0115]

[0126] To encode a value for the currently encoded coefficient based on the determined context offset, the video encoder 200 may be configured to determine a context based on the determined context offset, determine a sign for the currently encoded coefficient, and context encode one or more bins of data based on the determined context to represent the sign for the currently encoded coefficient. The video encoder 200 may be configured to quantize residual values ​​for a residual block of the video data to determine the value for the currently encoded coefficient. The video encoder 200 may be configured to determine a predictive block and compare the predictive block to an original block of the video data to determine the residual block of the video data.

[0116]

[0127] To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to select a context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient. The three available context offsets may include a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs, a second context offset for when both the first neighboring coefficient and the second neighboring coefficient are positive or one of the first neighboring coefficient and the second neighboring coefficient is equal to 0 and the other of the first neighboring coefficient and the second neighboring coefficient is positive, and a third context offset for when both the first neighboring coefficient and the second neighboring coefficient are negative or one of the first neighboring coefficient and the second neighboring coefficient is equal to 0 and the other of the first neighboring coefficient and the second neighboring coefficient is negative.

[0117]

[0128] To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to the first offset value in response to the value for the first neighboring coefficient being equal to 0 and the value for the second neighboring coefficient being equal to 0. To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to the first offset value in response to the value for the first neighboring coefficient being one of greater than 0 or less than 0 and the value for the second neighboring coefficient being the other of greater than 0 or less than 0.

[0118]

[0129] To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to a first offset value in response to both the value for the first neighboring coefficient and the value for the second neighboring coefficient being non-zero and having opposite signs. To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to a second offset value in response to the value for the first neighboring coefficient being greater than or equal to 0, the value for the second neighboring coefficient being greater than or equal to 0, and at least one of the value for the first neighboring coefficient or the value for the second neighboring coefficient being greater than or equal to 1.

[0119]

[0130] To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to a second offset value in response to both the value for the first neighboring coefficient and the value for the second neighboring coefficient being non-negative values. To determine a context offset for a currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video encoder 200 may be configured to set the context offset value to a third offset value in response to the value for the first neighboring coefficient being less than or equal to 0, the value for the second neighboring coefficient being less than or equal to 0, and the value for the first neighboring coefficient or the value for the second neighboring coefficient being less than or equal to -1. The first, second, and third offset values ​​may be, for example, different offset values. The context offset is a value for determining a context. Thus, the first, second, and third offset values ​​may be considered to identify or refer to three different contexts.

[0120]

[0131] The video encoder 200 also represents an example of a device configured to encode video data including a memory configured to store the video data and one or more processing units implemented in a circuit, the one or more processing units configured to determine, for a residual block of the video data encoded using a transform skip mode, an absolute coefficient level for a first neighboring coefficient of a currently encoded coefficient, determine an absolute coefficient level for a second neighboring coefficient of the currently encoded coefficient, determine an absolute coefficient level for the currently encoded coefficient, and encode one or more syntax elements indicative of an absolute coefficient level for the currently encoded coefficient based on the absolute coefficient level for the first neighboring coefficient and the absolute coefficient level for the second neighboring coefficient. The video encoder 200 may, for example, quantize residual values ​​for the residual block of the video data to determine a value for the currently encoded coefficient.

[0121]

[0132] In some examples, the video encoder 200 may be configured to encode a syntax element to determine a predictor level based on an absolute coefficient level for a first neighboring coefficient and an absolute coefficient level for a second neighboring coefficient, with a first value for the syntax element indicating that the predictor level is equal to the absolute coefficient level for the currently encoded coefficient, and a second value for the syntax element indicating that the predictor level is not equal to the absolute coefficient level for the currently encoded coefficient. In some examples, the video encoder 200 may be configured to encode a syntax element to determine a predictor level based on an absolute coefficient level for a first neighboring coefficient and an absolute coefficient level for a second neighboring coefficient, and to determine a value for the syntax element based on the predictor level and the absolute coefficient level for the currently encoded coefficient. To determine the predictor level, the video encoder 200 may be configured to set the predictor level equal to the greater of the absolute coefficient level for the first neighboring coefficient or the absolute coefficient level for the second neighboring coefficient.

[0122]

[0133] 5 is a block diagram illustrating an example video decoder 300 that may utilize techniques of this disclosure. FIG. 5 is provided for illustrative purposes and is not limited to the techniques as broadly illustrated and described in this disclosure. For illustrative purposes, this disclosure describes a video decoder 300 in accordance with JEM, VVC, and HEVC techniques. However, the techniques of this disclosure may be performed by video coding devices configured for other video coding standards.

[0123]

[0134] 5, the video decoder 300 includes a coded 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. Additionally, the video decoder 300 may include additional or alternative processors or processing circuits to perform these or other functions.

[0124]

[0135] Prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. Prediction processing unit 304 may include additional units for performing prediction according to other prediction modes. By way of example, prediction processing unit 304 may include a palette unit, an intra block copy unit (which may form part of motion compensation unit 316), an affine unit, a linear model (LM) unit, or the like. In other examples, video decoder 300 may include more, fewer, or different functional components.

[0125]

[0136] The CPB memory 320 may store video data, such as an encoded video bitstream, to be decoded by the components of the video decoder 300. The video data stored in the CPB memory 320 may be obtained, for example, from the computer-readable medium 110 (FIG. 1). The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from the encoded video bitstream. The CPB memory 320 may also store video data other than syntax elements of coded pictures, such as temporary data representing output from various units of the video decoder 300. The DPB 314 generally stores a decoded picture that the video decoder 300 may output and / or use as reference video data when decoding 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 DRAM, 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 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.

[0126]

[0137] Additionally or alternatively, in some examples, the video decoder 300 may retrieve the coded video data from memory 120 (FIG. 1). That is, memory 120 may store data as described above using CPB memory 320. Similarly, when some or all of the functionality of the video decoder 300 is implemented in software executed by processing circuitry of the video decoder 300, memory 120 may store instructions to be executed by the video decoder 300.

[0127]

[0138] The various units shown in FIG. 5 are illustrated to aid in understanding the operations performed by the video decoder 300. The units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. As with FIG. 4, fixed function circuits refer to circuits that provide specific functionality and are preconfigured for the operations they can perform. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations they can perform. For example, a programmable circuit may execute software or firmware that causes the programmable circuit to operate in a manner defined by the software or firmware instructions. Although a fixed function circuit may execute software instructions (e.g., to receive parameters or output parameters), the types of operations the fixed function circuit performs are generally immutable. In some examples, one or more of the units may be separate circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be integrated circuits.

[0128]

[0139] The video decoder 300 may include a programmable core formed of ALUs, EFUs, digital circuits, analog circuits, and / or programmable circuits. In examples in which the operations of the video decoder 300 are performed by software executing on programmable circuits, on-chip or off-chip memory may store instructions of the software (e.g., object code) that the video decoder 300 receives and executes.

[0129]

[0140] The entropy decoding unit 302 may receive the encoded video data from the CPB and entropy decode the video data to recover 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.

[0130]

[0141] Generally, the video decoder 300 reconstructs a picture on a block-by-block basis. The video decoder 300 may perform a reconstruction operation on each block individually (the block currently being reconstructed, i.e., decoded, may be referred to as the "current block").

[0131]

[0142] The entropy decoding unit 302 may entropy decode transform information, such as a quantization parameter (QP) and / or a transform mode indication, along with syntax elements that define the quantized coefficients of the quantized coefficient block. The inverse quantization unit 306 may use the QP associated with the quantized coefficient block to determine the degree of quantization, and similarly, the degree of inverse quantization that the inverse quantization unit 306 applies. The inverse quantization unit 306 may inverse quantize the transform coefficients, for example, by performing a bitwise left shift operation. The inverse quantization unit 306 may thereby form a coefficient block including the coefficients.

[0132]

[0143] After the inverse quantization unit 306 forms coefficient blocks for a transformed block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient blocks to generate residual blocks related to the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve transform (KLT), an inverse rotational transform, an inverse transform, or another inverse transform to the transform coefficient blocks. For blocks coded in transform skip mode, the inverse transform processing unit 308 may not perform an inverse transform and, in these coding scenarios, may be viewed as a pass-through unit that does not process or modify blocks of coefficients.

[0133]

[0144] Further, prediction processing unit 304 generates a prediction block according to the prediction information syntax element entropy decoded by entropy decoding unit 302. For example, motion compensation unit 316 may generate a prediction block if the prediction information syntax element indicates that the current block is inter predicted. In this case, the prediction information syntax element may indicate a reference picture in DPB 314 from which the reference block should be retrieved, as well as a motion vector that identifies the location of the reference block in the reference picture relative to the location of the current block in the current picture. Motion compensation unit 316 may generally perform an inter prediction process in a manner substantially similar to that described with respect to motion compensation unit 224 (FIG. 4).

[0134]

[0145] As another example, if the prediction information syntax element indicates that the current block is intra predicted, then the intra prediction unit 318 may generate a prediction block according to the intra prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 may generally perform an intra prediction process in a manner substantially similar to that described with respect to the intra prediction unit 226 (FIG. 4). The intra prediction unit 318 may retrieve data of neighboring samples for the current block from the DPB 314.

[0135]

[0146] The reconstruction unit 310 may use the predictive block and the residual block to reconstruct the current block. For example, the reconstruction unit 310 may add samples of the residual block to corresponding samples of the predictive block to reconstruct the current block.

[0136]

[0147] Filter unit 312 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 312 may perform a deblocking operation to reduce blockiness artifacts along edges of the reconstructed blocks. The operations of filter unit 312 need not be performed in all instances.

[0137]

[0148] The video decoder 300 may store the reconstructed blocks in the DPB 314. For example, in examples where the operations of the filter unit 312 are not performed, the reconstruction unit 310 may store the reconstructed blocks in the DPB 314. In examples where the operations of the filter unit 312 are performed, the filter unit 312 may store the reconstructed and filtered blocks in the DPB 314. As described above, the DPB 314 may provide reference information, such as samples of a current picture for intra prediction and previously decoded pictures for subsequent motion compensation, to the prediction processing unit 304. Additionally, the video decoder 300 may output the decoded pictures from the DPB 314 for subsequent presentation on a display device, such as the display device 118 of FIG. 1.

[0138]

[0149] The video decoder 300 represents an example of a video decoding device including a memory configured to store video data and one or more processing units implemented in a circuit, the one or more processing units being configured to, for a residual block of video data encoded using transform skip mode, determine a value for a first neighboring coefficient of a currently decoded coefficient, determine a value for a second neighboring coefficient of the currently decoded coefficient, determine a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, and decode the value for the currently decoded coefficient based on the determined context offset. The first neighboring coefficient may be, for example, one of a top neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient may be the other of a top neighboring coefficient or a left neighboring coefficient. As described above, for a residual block coded in transform skip mode, the coefficient values ​​may correspond to residual values, such as quantized residual values ​​or unquantized residual values.

[0139]

[0150] To decode a value for a currently decoded coefficient based on the determined context offset, the video decoder 300 may be configured to determine a context based on the determined context offset, receive one or more bins of data, and context decode the one or more bins of data based on the determined context to determine a sign for the currently decoded coefficient. The video decoder 300 may be configured to dequantize the value for the currently decoded coefficient to determine a residual value for a residual block of the video data. The video decoder 300 may be configured to determine a decoded residual block based on the value for the currently decoded coefficient, add the decoded residual block to a predictive block to determine a reconstructed block, perform one or more filtering operations on the reconstructed block to determine a decoded block of the video data, and output a decoded picture of the video data including the decoded block of the video data.

[0140]

[0151] To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to select a context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient. The three available context offsets may include a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs, a second context offset for when both the first neighboring coefficient and the second neighboring coefficient are positive or one of the first neighboring coefficient and the second neighboring coefficient is equal to 0 and the other of the first neighboring coefficient and the second neighboring coefficient is positive, and a third context offset for when both the first neighboring coefficient and the second neighboring coefficient are negative or one of the first neighboring coefficient and the second neighboring coefficient is equal to 0 and the other of the first neighboring coefficient and the second neighboring coefficient is negative.

[0141]

[0152] To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to the first offset value in response to the value for the first neighboring coefficient being equal to 0 and the value for the second neighboring coefficient being equal to 0. To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to the first offset value in response to the value for the first neighboring coefficient being one of greater than 0 or less than 0 and the value for the second neighboring coefficient being the other of greater than 0 or less than 0. To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to the first offset value in response to both the value for the first neighboring coefficient and the value for the second neighboring coefficient being non-zero values ​​and having opposite signs.

[0142]

[0153] To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to the second offset value in response to the value for the first neighboring coefficient being greater than or equal to 0, the value for the second neighboring coefficient being greater than or equal to 0, and at least one of the value for the first neighboring coefficient or the value for the second neighboring coefficient being greater than or equal to 1. To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to the second offset value in response to both the value for the first neighboring coefficient and the value for the second neighboring coefficient being non-negative values. To determine a context offset for a currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient, the video decoder 300 may be configured to set the context offset value to a third offset value in response to the value for the first neighboring coefficient being less than or equal to 0, the value for the second neighboring coefficient being less than or equal to 0, and either the value for the first neighboring coefficient or the value for the second neighboring coefficient being less than or equal to −1.

[0143]

[0154] The video decoder 300 also represents an example of a video decoding device including a memory configured to store video data and one or more processing units implemented in a circuit, the one or more processing units configured to determine, for a residual block of the video data encoded using a transform skip mode, an absolute coefficient level for a first neighboring coefficient of a currently decoded coefficient, determine an absolute coefficient level for a second neighboring coefficient of the currently decoded coefficient, and determine an absolute coefficient level for the currently decoded coefficient based on the absolute coefficient level for the first neighboring coefficient and the absolute coefficient level for the second neighboring coefficient. The video decoder 300 may, for example, inverse quantize the currently decoded coefficient to determine a residual value for the residual block of the video data.

[0144]

[0155] To determine the absolute coefficient level for the currently decoded coefficient, the video decoder 300 may be configured to receive a syntax element to determine a predictor level based on an absolute coefficient level for a first neighboring coefficient and an absolute coefficient level for a second neighboring coefficient, where a first value for the syntax element indicates that the predictor level is equal to the absolute coefficient level for the currently decoded coefficient and a second value for the syntax element indicates that the predictor level is not equal to the absolute coefficient level for the currently decoded coefficient. To determine the absolute coefficient level for the currently decoded coefficient, the video decoder 300 may be configured to receive a syntax element to determine a predictor level based on an absolute coefficient level for the first neighboring coefficient and an absolute coefficient level for the second neighboring coefficient, and to determine an absolute coefficient level for the currently decoded coefficient based on the prediction level element and the syntax element. To determine the predictor level, the video decoder 300 may set the predictor level equal to the greater of the absolute coefficient for the first neighboring coefficient or the absolute coefficient for the second neighboring coefficient.

[0145]

[0156] 6A and 6B show an example of a CABAC process in bin n. In the example 400 of FIG. 6A, the range in bin n is the probability (p σ ), and RangeMPS and RangeLPS, given by: RangeMPS=RangeMPS+RangeLPS. Example 400 illustrates a range update in bin n+1 when the value of bin n is equal to a Most Probable Symbol (MPS). In this example, the low value of the range remains the same, but the range value in bin n+1 is reduced to the value of RangeMPS in bin n. Example 402 in FIG. 6B illustrates a range update in bin n+1 when the value of bin n is not equal to MPS (i.e., it is equal to LPS). In this example, the low value of the range moves to the lower range value of RangeLPS in bin n. In addition, the range value in bin n+1 is reduced to the value of RangeLPS in bin n.

[0146]

[0157] In one example of the HEVC video coding process, the range is represented by 9 bits and the low value is represented by 10 bits. To maintain the range and low values ​​with sufficient accuracy, there is a renormalization process. Renormalization occurs whenever the range is smaller than 256. Thus, after renormalization, the range is always greater than or equal to 256. Depending on the range and low values, the binary arithmetic coder (BAC) outputs a "0" or a "1" to the bitstream, or updates an internal variable (called the bit outstanding BO) to hold future outputs. Figure 7 shows an example of a range-dependent BAC output. For example, when the range and low values ​​are above a certain threshold (e.g., 512), a "1" is output to the bitstream. When the range and low values ​​are below a certain threshold (e.g., 512), a "0" is output to the bitstream. When the range and low values ​​are between certain thresholds, nothing is output to the bitstream. Instead, the BO value is incremented and the next bin is encoded.

[0147]

[0158] In the CABAC context model for H.264 / AVC, in some instances for HEVC, there are 128 states. There are 64 possible LPS probabilities (denoted by state σ) that can be between 0 and 63. Each MPS can be 0 or 1. Thus, the 128 states are the 64 state probabilities times two possible values ​​for the MPS (0 or 1). Thus, the states can be indexed with 7 bits.

[0148]

[0159] LPS range σ To reduce the computation of deriving LPS, the results for all cases may be precomputed and stored as approximations in a lookup table. Thus, by using a simple table lookup, the LPS range can be obtained without any multiplications. Avoiding multiplications may be important for some devices or applications because this operation may cause significant latency in many hardware architectures.

[0149]

[0160] Instead of multiplication, a 4-column precomputed LPS range table may be used. The range is divided into 4 segments. The segment index can be derived by the query (range>>6)&3. In practice, the segment index is derived by shifting and dropping bits from the actual range. Table 1 below shows the possible ranges and their corresponding indexes.

[0150] [Table 1]

[0151]

[0161] Thus, the LPS range table has 64 entries (one for each probability state) times 4 (one for each range index). Each entry is a RangeLPS, i.e., a range multiplied by the LPS probability. An example of a portion of this table is shown below in Table 2. Table 2 shows probability states 9 to 12. In one proposal for HEVC, the probability states may range from 0 to 63.

[0152] [Table 2]

[0153]

[0162] In each segment (i.e., range value), the LPS range for each probability state σ is predefined. In other words, the LPS range for a probability state σ is quantized to four values ​​(i.e., one value for each range index). The particular LPS range used at a given point depends on the range to which the segment belongs. The number of possible LPS ranges used in the table is a trade-off between the number of columns in the table (i.e., the number of possible LPS range values) and the LPS range accuracy. Generally speaking, the more columns there are, the smaller the quantization error of the LPS range values, but the more memory is required to store the table. The fewer columns there are, the larger the quantization error, but the less memory is required to store the table.

[0154]

[0163] As explained above, each LPS probability state has a corresponding probability. The probability p for each state is derived as follows: p σ =αp σ-1 Here, state σ ranges from 0 to 63. The constant α represents the amount of probability change between each context state. In one example, α = 0.9493, or more precisely, α = (0.01875 / 0.5) 1 / 63The probability at state σ=0 is 0.5 (i.e., p0=1 / 2). That is, at context state 0, LPS and MPS are equally likely. The probability at each successive state is derived by multiplying the previous state by α. Thus, the probability of LPS occurring at context state α=1 is p0*0.9493 (0.5*0.9493=0.47465). Thus, as the index of state α increases, the probability of LPS occurring decreases.

[0155]

[0164] CABAC is adaptive because the probability states are updated to follow the signal statistics (i.e., the values ​​of previously coded bins). The update process is as follows: For a given probability state, the update depends on the state index and the values ​​of the encoded symbols identified as either LPS or MPS. As a result of the update process, a new probability state is derived, consisting of potentially revised LPS probability estimates and, if necessary, revised MPS values.

[0156]

[0165] If the bin value is equal to the MPS, then the given state index may be incremented by one. This is for all states except when the MPS occurs at state index 62 where the LPS probability is already at its minimum (or, in the same sense, the maximum MPS probability is reached). In this case, the state index 62 remains fixed until the LPS is seen or until the last bin value is encoded (for the special case of the last bin value, state 63 is used). When the LPS occurs, the state index is changed by decrementing the state index by an amount as shown in the equation below. This rule generally applies to each occurrence of the LPS, with the following exceptions: If we assume that the LPS is encoded in a state with index σ=0, which corresponds to the equal probability case, then the state index remains fixed, but the MPS value is toggled such that the values ​​of the LPS and MPS are swapped. In all other cases, the MPS value is unchanged, regardless of which symbol is encoded. The derivation of the transition rule for the LPS probability is as follows: for a given LPS probability p old and its updated counterpart p new It is based on the following relationship between: If MPS occurs, p new =max(αp old ,p 62 ) If LPS is produced, p new =(1-α)+αp old .

[0157]

[0166] Regarding the practical implementation of the probability estimation process in CABAC, it is important to note that all transition rules may be realized by at most two tables, each with 63 entries of 6-bit unsigned integer values. In some examples, state transitions may be determined by a single table TransIdxLPS, which determines a new updated state index TransIdxLPS[σ] in case LPS is observed for a given state index σ. MPS-driven transitions can be obtained by a simple (saturated) increment of the state index by a fixed value of 1, resulting in an updated state index min(σ+1,62). Table 3 below is an example of a partial TransIdxLPS table.

[0158] [Table 3]

[0159]

[0167] The technique described above with respect to Figures 6A, 6B, and 7 represents only one exemplary implementation of CABAC. It should be understood that the techniques of this disclosure are not limited to only this described implementation of CABAC. For example, in older BAC approaches (e.g., the BAC approach used in H.264 / AVC), the tables RangeLPS and TransIdxLPS were tuned for low-resolution video (i.e., Common Intermediate Format (CIF) and Quota CIF (QCIF) video). With future codecs such as HEVC and VVC, a large amount of video content is high definition (HD) and in some cases finer than HD. Video content that is HD or finer than HD resolution tends to have different statistics than the 10-year-old QCIF sequences used to develop H.264 / AVC. As such, the tables RangeLPS and TransIdxLPS from H.264 / AVC may cause adaptation between states in a too-fast manner. That is, the transitions between probability states, especially when LPS occurs, may be too large for the smoother, higher resolution content of HD video. Thus, the probability models used according to conventional techniques may not be accurate for HD and extra HD content. In addition, because HD video content includes a larger range of pixel values, the H.264 / AVC tables do not contain enough entries to accommodate the more extreme values ​​that may be present in HD content.

[0160]

[0168] As such, for HEVC, and for future coding standards such as VVC, the RangeLPS and TransIdxLPS tables may be modified to address this new content characteristics. In particular, the BAC process for HEVC and future coding standards may use tables that allow for a slower adaptation process and may address more extreme cases (i.e., skewed probabilities). Thus, as one example, the RangeLPS and TransIdxLPS tables may be modified to achieve these goals by including more probability states and ranges than are used in BAC with H.264 / AVC or HEVC.

[0161]

[0169] FIG. 8 is a block diagram of an example entropy encoding unit 220, which may be configured to perform CABAC according to the techniques of this disclosure, for example forming part of the video encoder 200 shown in FIG. 4. A syntax element 418 is input to the entropy encoding unit 220. If the syntax element is already a binary-valued syntax element (i.e., a syntax element having only values ​​of 0 and 1), the binarization step may be skipped. If the syntax element is a non-binary-valued syntax element (e.g., a syntax element represented by multiple bits such as a coefficient level), the non-binary-valued syntax element is binarized by a binarizer 420. The binarizer 420 performs a mapping of the non-binary-valued syntax element to a sequence of binary decisions. These binary decisions are often referred to as "bins". For example, for a coefficient level, the value of the level may be decomposed into successive bins, each bin indicating whether the absolute value of the coefficient level is greater than some value or not. For example, bin 0 (sometimes called a significance flag) indicates whether the absolute value of the coefficient level is greater than 0; bin 1 indicates whether the absolute value of the coefficient level is greater than 1; etc. A unique mapping may be developed for each non-binary valued syntax element.

[0162]

[0170] Each bin generated by the binarizer 420 is fed to the binary arithmetic coding side of the entropy encoding unit 220. That is, for a predetermined set of non-binary-valued syntax elements, each bin type (e.g., bin 0) is coded before the next bin type (e.g., bin 1). The coding may be performed in either normal mode or bypass mode. In bypass mode, the bypass encoding engine 426 performs arithmetic coding using a fixed probability model, for example, using Golomb-Rice or Exponential-Golomb coding. The bypass mode is typically used for more predictable syntax elements.

[0163]

[0171] Coding in normal mode involves performing CABAC. Normal mode CABAC is for coding bin values ​​where the probability of the bin's value is predictable given previously coded bin values. The probability of a bin being an LPS is determined by the context modeller 422. The context modeller 422 outputs the bin value and a context model (e.g., probability state σ). The context model may be an initial context model for the set of bins or may be determined based on coded values ​​of previously coded bins. As mentioned above, the context modeller may update the state based on whether the previously coded bin was an MPS or an LPS.

[0164]

[0172] After the context model and probability states σ are determined by the context modeler 422, the normal encoding engine 424 performs BAC on the bin values. In accordance with the techniques of this disclosure, the normal encoding engine 424 performs BAC using a TransIdxLPS table 430 that contains more than 64 probability states σ. In one example, the number of probability states is 128. TransIdxLPS is used to determine which probability state is used for the next bin (bin n+1) when the previous bin (bin n) is an LPS. The normal encoding engine 424 may also use a RangeLPS table 428 to determine the range value for an LPS given a particular probability state σ. However, in accordance with the techniques of this disclosure, rather than using all possible probability states σ in the TransIdxLPS table 430, the probability state index σ is mapped to a grouping index for use in the TransIdxLPS table. That is, each index into the RangeLPS table 428 may represent two or more of the total number of probability states. The mapping of the probability state index σ to the grouped index may be linear (eg, by dividing by 2) or may be non-linear (eg, a logarithmic function or a mapping table).

[0165]

[0173] In another example of the present disclosure, the parameter α may be set to be greater than 0.9493 to provide a smaller difference between successive probability states. In one example, α=0.9689. In another example of the present disclosure, the highest probability of an LPS occurring (p0) may be set to be less than 0.5. In one example, p0 may be equal to 0.493.

[0166]

[0174] In accordance with one or more techniques of this disclosure, in contrast to using the same values ​​of variables used to update the probability states in the binary arithmetic coding process (e.g., one or more of the window size, the scaling factor (α), and the probability update rate), the entropy encoding unit 220 may use different values ​​of the variables for different context models and / or different syntax elements. For example, the entropy encoding unit 220 may determine values ​​of variables used to update the probability states in the binary arithmetic coding process for a context model of a plurality of context models and update the probability states based on the determined values.

[0167]

[0175] FIG. 9 is a block diagram of an example entropy decoding unit 302, e.g., forming part of the video decoder 300 shown in FIG. 5, that may be configured to perform CABAC in accordance with the techniques of this disclosure. The entropy decoding unit 302 of FIG. 9 performs CABAC in an inverse manner to that of the entropy encoding unit 220 described in FIG. 8. Coded bits from a bitstream 448 are input to the entropy decoding unit 302. Based on whether the coded bits were entropy coded using a bypass mode or a normal mode, the coded bits are provided to either a context modeler 450 or a bypass decoding engine 452. If the coded bits were coded in a bypass mode, the bypass decoding engine 452 may extract the bins of the binary-valued syntax elements or non-binary syntax elements using, e.g., Golomb-Rice decoding or exponential-Golomb decoding.

[0168]

[0176] If the coded bits were coded in normal mode, the context modeler 450 may determine a probability model for the coded bits, and the normal decoding engine 454 may decode the coded bits to generate the bins of the non-binary-valued syntax element (or the syntax element itself, if binary-valued). After the context model and the probability states σ are determined by the context modeler 450, the normal decoding engine 454 performs BAC on the bin values. In accordance with the techniques of this disclosure, the normal decoding engine 454 performs BAC using a TransIdxLPS table 458 that includes more than 64 probability states σ. In one example, the number of probability states is 128, although other numbers of probability states can be defined consistent with the techniques of this disclosure. The TransIdxLPS table 458 is used to determine which probability state is used for the next bin (bin n+1) when the previous bin (bin n) is an LPS. The regular decoding engine 454 may also use the RangeLPS table 456 to determine the range value for the LPS given a particular probability state σ. However, in accordance with the techniques of this disclosure, rather than using all possible probability states σ in the TransIdxLPS table 458, the probability state index σ is mapped to a grouping index for use in the RangeLPS table 456. That is, each index into the RangeLPS table 456 may represent two or more of the total number of probability states. The mapping of the probability state index σ to the grouping index may be linear (e.g., by dividing by two) or non-linear (e.g., a logarithmic function or a mapping table).

[0169]

[0177] In another example of the present disclosure, the parameter α may be set to be greater than 0.9493 to provide a smaller difference between successive probability states. In one example, α=0.9689. In another example of the present disclosure, the highest probability of an LPS occurring (p0) may be set to be less than 0.5. In one example, p0 may be equal to 0.493.

[0170]

[0178] After the bins are decoded by regular decoding engine 454, inverse binarizer 460 may perform an inverse mapping to convert the bins back to values ​​of non-binary-valued syntax elements.

[0171]

[0179] 10 is a flow chart illustrating an example of an exemplary method for encoding a current block. The current block may include a current CU. Although described with respect to video encoder 200 (FIGS. 1 and 4), it should be understood that other devices may be configured to perform a method similar to that of FIG.

[0172]

[0180] In this example, video encoder 200 may first predict a current block (550). For example, video encoder 200 may form a predictive block for the current block. Video encoder 200 may then calculate a residual block for the current block (552). To calculate the residual block, video encoder 200 may calculate a difference between an original uncoded block and the predictive block for the current block. Video encoder 200 may then transform and quantize coefficients of the residual block (554). In some coding modes, such as a transform skip mode, video encoder 200 may skip the transform and only quantize the residual data. Video encoder 200 may then scan the quantized coefficients of the residual block (556). During or following the scan, video encoder 200 may entropy encode the coefficients (558). For example, video encoder 200 may encode the coefficients using CAVLC or CABAC. The video encoder 200 may then output the entropy coded data for the coefficients (560).

[0173]

[0181] 11 is a flow chart illustrating an example method for decoding a current block of video data. The current block may include a current CU. Although described with respect to video decoder 300 (FIGS. 1 and 5), it should be understood that other devices may be configured to perform a method similar to that of FIG.

[0174]

[0182] The video decoder 300 may receive entropy coded data for the current block, such as entropy coded prediction information and entropy coded data for transform coefficients of the residual block that corresponds to the current block (570). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and reconstruct the coefficients of the residual block (572). The video decoder 300 may predict the current block using, for example, the intra-prediction mode or inter-prediction mode indicated by the prediction information for the current block to compute a prediction block for the current block (574). The video decoder 300 may then inverse scan the reconstructed coefficients to produce a block of quantized coefficients (576). The video decoder 300 may then inverse quantize and inverse transform the coefficients to produce the residual block (578). In some coding modes, such as a transform skip mode, the video decoder 300 may skip the inverse transform and only quantize the coefficients. Video decoder 300 may finally decode the current block by combining the predictive block and the residual block (580).

[0175]

[0183] 12 is a flow chart illustrating an example method for determining a context for coding (e.g., encoding or decoding) signs of coefficients of a residual block. The residual block may be, for example, a transform-skipped residual block. The technique of FIG. 12 is described with respect to a general video coder, which may correspond to either a video encoder such as video encoder 200 or a video decoder such as video decoder 300. However, it should be understood that other devices may be configured to perform a method similar to that of FIG. 12.

[0176]

[0184] The video coder determines a value (X0) for a first neighboring coefficient of a currently coded coefficient (600). The video coder determines a value (X1) for a second neighboring coefficient of a currently coded coefficient (602). In response to both X0 and X1 being equal to 0 (604, yes), the video coder sets a context for coding the sign of the currently coded coefficient to the first context (606). In response to at least one of X0 or X1 not being equal to 0 (604, no) but X0 and X1 having opposite signs (608, yes), the video coder also sets a context for coding the sign of the currently coded coefficient to the first context (610).

[0177]

[0185] In response to at least one of X0 or X1 not being equal to 0 (604, no), X0 and X1 not having opposite signs (608, no), and one of X0 or X1 being greater than 0 (612, yes), the video coder sets a context for coding the sign of the currently coded coefficient to a second context different from the first context (614). In response to at least one of X0 or X1 not being equal to 0 (604, no), X0 and X1 not having opposite signs (608, no), and none of X0 or X1 being greater than 0 (612, no), the video coder sets a context for coding the sign of the currently coded coefficient to a third context different from the first or second context (616).

[0178]

[0186] It should be appreciated that, depending on the example, certain acts or events of any of the techniques described herein may be performed in a different sequence, may be added, merged, or may be omitted entirely (e.g., not all of the acts or events described may be required for the practice of the techniques). Furthermore, in some examples, acts or events may be performed simultaneously rather than sequentially, for example, through multithreading, interrupt processing, or multiple processors.

[0179]

[0187] 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 over a computer-readable medium as one or more instructions or code and executed by a hardware-based processing unit. Computer-readable media may also include computer-readable storage media, which corresponds to a tangible medium, such as a data storage medium, or a communication medium, which includes any medium that facilitates transfer of a computer program from one place to another, for example according to a communication protocol. Thus, computer-readable media may generally correspond to (1) a tangible computer-readable storage medium, or (2) a communication medium, such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to retrieve instructions, code, and / or data structures for implementing the techniques described in this disclosure. A computer program product may include a computer-readable medium.

[0180]

[0188] By way of example and not limitation, such computer readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage media, magnetic disk storage media or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and accessed by a computer. Also, any connection is properly referred to as a computer readable medium. For example, if the instructions are transmitted from a website, from a server, or from other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are 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 transitory media, but are instead directed to non-transitory, tangible storage media. Disk and disc as used herein include compact discs (CDs), laser discs, optical disks, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, although typically disks reproduce data magnetically while discs reproduce data optically with a laser. Combinations of the above should also be included within the scope of computer readable media.

[0181]

[0189] The instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, as used herein, the terms "processor" and "processing circuitry" may refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. In addition, in some aspects, the functionality described herein may be provided in dedicated hardware and / or software modules configured to encode and decode, or may be incorporated in a combined codec. Also, the techniques may be fully implemented in one or more circuits or logic elements.

[0182]

[0190] The techniques of this disclosure may be implemented in a wide 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 herein to highlight functional aspects of devices configured to perform the disclosed techniques, but they do not necessarily require realization by different hardware units. Rather, 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, along with appropriate software and / or firmware.

[0183]

[0191] Various examples have been described. These and other examples are within the scope of the following claims. The invention as originally claimed in the present application is set forth below. [1] A method for decoding video data, comprising: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; and decoding a value for the currently decoded coefficient based on the determined context offset. [2] The method of [1], wherein the first adjacent coefficient includes one of an upper adjacent coefficient or a left adjacent coefficient to the currently decoded coefficient, and the second adjacent coefficient includes the other of the upper adjacent coefficient or the left adjacent coefficient. decoding a value for the currently decoded coefficient based on the determined context offset; determining a context based on the determined context offset; receiving one or more bins of data; and context decoding one or more bins of the data based on the determined context to determine a sign for the currently decoded coefficient. [4] decoding a value for the currently decoded coefficient based on the determined context offset; determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; receiving the indicated syntax element; and in response to the syntax element having a value equal to 1, determining that the level value of the currently decoded coefficient is equal to the predicted level value. [5] decoding a value for the currently decoded coefficient based on the determined context offset, determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; receiving the indicated syntax element; and in response to the value for the syntax element being greater than the predicted level value, determining that the level value of the currently decoded coefficient is equal to the value for the syntax element plus one. [6] decoding a value for the currently decoded coefficient based on the determined context offset; determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; receiving the indicated syntax element; and in response to the value for the syntax element being less than the predicted level value, determining that the level value of the currently decoded coefficient is equal to the value for the syntax element. [7] determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient includes selecting the context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient; The three available context offsets are: a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs; and a second context offset for when both the first adjacent coefficient and the second adjacent coefficient are positive, or one of the first adjacent coefficient and the second adjacent coefficient is equal to 0 and the other of the first adjacent coefficient and the second adjacent coefficient is positive; and a third context offset for when both the first neighboring coefficient and the second neighboring coefficient are negative, or when one of the first neighboring coefficient and the second neighboring coefficient is equal to 0 and the other of the first neighboring coefficient and the second neighboring coefficient is negative. [8] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being equal to 0 and the value for the second adjacent coefficient being equal to 0. [9] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being one of greater than 0 or less than 0 and the value for the second adjacent coefficient being the other of greater than 0 or less than 0.

[10] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a particular offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-zero values ​​and having opposite signs.

[11] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being greater than or equal to 0, the value for the second adjacent coefficient being greater than or equal to 0, and at least one of the value for the first adjacent coefficient or the value for the second adjacent coefficient being greater than or equal to 1.

[12] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-negative values.

[13] The method of [1], wherein determining a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being less than or equal to 0, the value for the second adjacent coefficient being less than or equal to 0, and either the value for the first adjacent coefficient or the value for the second adjacent coefficient being less than or equal to -1.

[14] The method of [1], further comprising: inverse quantizing values ​​for the currently decoded coefficients without inverse transforming to determine residual values ​​for a residual block of the video data. determining a decoded residual block based on values ​​for the currently decoded coefficients; adding the decoded residual block to a prediction block to determine a reconstructed block; performing one or more filtering operations on the reconstructed blocks to determine decoded blocks of video data; and and outputting a decoded picture of the video data including the decoded block of video data.

[16] A method for encoding video data, comprising: determining a value for a first neighboring coefficient of a currently encoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently encoded coefficient; determining a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient; and encoding a value for the currently encoded coefficient based on the determined context offset.

[17] The method of

[16] , wherein the first neighboring coefficients include one of the top neighboring coefficients or the left neighboring coefficients, and the second neighboring coefficients include the other of the top neighboring coefficients or the left neighboring coefficients.

[18] encoding a value for the currently encoded coefficient based on the determined context offset, determining a context based on the determined context offset; determining a sign for the currently encoded coefficient; and context encoding one or more bins of data based on the determined context to represent a sign for the currently encoded coefficient.

[19] encoding a value for the currently encoded coefficient based on the determined context offset, determining a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; and encoding a syntax element with a value equal to 1 in response to the level value of the currently encoded coefficient being equal to the predicted level value.

[20] encoding a value for the currently encoded coefficient based on the determined context offset, determining a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient;

[18] The method of claim 18, further comprising: in response to the level value of the currently encoded coefficient being less than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient.

[21] encoding a value for the currently encoded coefficient based on the determined context offset, determining a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient;

[18] The method of claim 1, further comprising: in response to the level value of the currently encoded coefficient being greater than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient minus 1.

[22] Determining a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient includes selecting the context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient; The three available context offsets are: a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs; and a second context offset for when both the first adjacent coefficient and the second adjacent coefficient are positive, or one of the first adjacent coefficient and the second adjacent coefficient is equal to 0 and the other of the first adjacent coefficient and the second adjacent coefficient is positive; and a third context offset for when both the first and second neighboring coefficients are negative, or when one of the first and second neighboring coefficients is equal to 0 and the other of the first and second neighboring coefficients is negative.

[23] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being equal to 0 and the value for the second adjacent coefficient being equal to 0.

[24] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being one of greater than 0 or less than 0 and the value for the second adjacent coefficient being the other of greater than 0 or less than 0.

[25] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a particular offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-zero values ​​and having opposite signs.

[26] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being greater than or equal to 0, the value for the second adjacent coefficient being greater than or equal to 0, and at least one of the value for the first adjacent coefficient or the value for the second adjacent coefficient being greater than or equal to 1.

[27] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-negative values.

[28] The method of

[16] , wherein determining a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient includes setting the context offset value to a specific offset value in response to the value for the first adjacent coefficient being less than or equal to 0, the value for the second adjacent coefficient being less than or equal to 0, and either the value for the first adjacent coefficient or the value for the second adjacent coefficient being less than or equal to -1.

[29] The method of

[16] , further comprising quantizing residual values ​​for a residual block of the video data to determine a value for the currently encoded coefficient.

[30] determining a prediction block; and

[16] The method of claim 15, further comprising: comparing the predicted block with an original block of video data to determine a residual block of the video data.

[31] In a device that decodes video data, a memory configured to store video data; one or more processors implemented in circuitry; the one or more processors: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using a transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; and determining a context offset for the currently decoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient. A device configured to decode a value for the currently decoded coefficient based on the determined context offset.

[32] The device of

[31] , wherein the first adjacent coefficient includes one of an upper adjacent coefficient or a left adjacent coefficient, and the second adjacent coefficient includes the other of the upper adjacent coefficient or the left adjacent coefficient.

[33] To decode a value for the currently decoded coefficient based on the determined context offset, the one or more processors further determining a context based on the determined context offset; To receive one or more bins of data, 32. The device of claim 31, further configured to context decode one or more bins of the data based on the determined context to determine a sign for the currently decoded coefficient.

[34] To determine a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, the one or more processors are further configured to select the context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient; The three available context offsets are: a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs; and a second context offset for when both the first adjacent coefficient and the second adjacent coefficient are positive, or one of the first adjacent coefficient and the second adjacent coefficient is equal to 0 and the other of the first adjacent coefficient and the second adjacent coefficient is positive; and a third context offset for when both the first and second adjacent coefficients are negative, or when one of the first and second adjacent coefficients is equal to 0 and the other of the first and second adjacent coefficients is negative.

[35] The device of

[31] , further configured to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being equal to 0 and the value for the second adjacent coefficient being equal to 0.

[36] The device of

[31] , further configured to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being one of greater than 0 or less than 0 and the value for the second adjacent coefficient being the other of greater than 0 or less than 0.

[37] The device of

[31] , wherein to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors are further configured to set the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-zero values ​​and having opposite signs.

[38] The device of

[31] , further configured to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to: set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being greater than or equal to 0, the value for the second adjacent coefficient being greater than or equal to 0, and at least one of the value for the first adjacent coefficient or the value for the second adjacent coefficient being greater than or equal to 1.

[39] The device of

[31] , wherein to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors are further configured to set the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-negative values.

[40] The device of

[31] , wherein to determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors are further configured to: set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being less than or equal to 0, the value for the second adjacent coefficient being less than or equal to 0, and either the value for the first adjacent coefficient or the value for the second adjacent coefficient being less than or equal to -1.

[41] The one or more processors: 32. The device of claim 31, further configured to inverse quantize values ​​for the currently decoded coefficients to determine residual values ​​for a residual block of the video data.

[42] The one or more processors: determining a decoded residual block based on a value for the currently decoded coefficient; adding the decoded residual block to a prediction block to determine a reconstructed block; performing one or more filtering operations on the reconstructed blocks to determine decoded blocks of video data; 32. The device of claim 31, further configured to output a decoded picture of the video data comprising the decoded block of the video data.

[43] The device of

[31] , wherein the device comprises a wireless communication device, the wireless communication device including a receiver configured to receive encoded video data.

[44] The device of

[43] , wherein the wireless communication device comprises a telephone handset and the receiver is configured to demodulate a signal containing the encoded video data in accordance with a wireless communication standard.

[45] The device of

[31] , further comprising a display configured to display the decoded video data.

[46] The device of

[31] , wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[47] In a device that encodes video data, a memory configured to store video data; one or more processors implemented in circuitry; the one or more processors: determining, for a residual block of video data encoded using a transform skip mode, a value for a first neighboring coefficient of a currently encoded coefficient; determining a value for a second neighboring coefficient of the currently encoded coefficient; and determining a context offset for the currently encoded coefficient based on the value for the first neighboring coefficient and the value for the second neighboring coefficient. A device configured to encode a value for the currently encoded coefficient based on the determined context offset.

[48] ​​The device of

[47] , wherein the first adjacent coefficient includes one of an upper adjacent coefficient or a left adjacent coefficient, and the second adjacent coefficient includes the other of the upper adjacent coefficient or the left adjacent coefficient.

[49] To encode a value for the currently encoded coefficient based on the determined context offset, the one or more processors further: determining a context based on the determined context offset; determining a sign for the currently encoded coefficient;

[47] The device of claim 47, further configured to context encode one or more bins of data based on the determined context to represent a sign for the currently encoded coefficient.

[50] To determine a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, the one or more processors are further configured to select the context offset from three available context offsets based on the value for the first neighboring coefficient and the value for the second neighboring coefficient; The three available context offsets are: a first context offset for when both the first neighboring coefficient and the second neighboring coefficient are equal to 0 or have opposite signs; and a second context offset for when both the first adjacent coefficient and the second adjacent coefficient are positive, or one of the first adjacent coefficient and the second adjacent coefficient is equal to 0 and the other of the first adjacent coefficient and the second adjacent coefficient is positive; and a third context offset for when both the first and second adjacent coefficients are negative, or when one of the first and second adjacent coefficients is equal to 0 and the other of the first and second adjacent coefficients is negative.

[51] The device of

[47] , further configured to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being equal to 0 and the value for the second adjacent coefficient being equal to 0.

[52] The device of

[47] , further configured to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being one of greater than 0 or less than 0 and the value for the second adjacent coefficient being the other of greater than 0 or less than 0.

[53] The device of

[47] , wherein to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors are further configured to set the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-zero values ​​and having opposite signs.

[54] The device of

[47] , further configured to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors being further configured to: set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being greater than or equal to 0, the value for the second adjacent coefficient being greater than or equal to 0, and at least one of the value for the first adjacent coefficient or the value for the second adjacent coefficient being greater than or equal to 1.

[55] The device of

[47] , wherein the one or more processors are further configured to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, and to set the context offset value to a specific offset value in response to both the value for the first adjacent coefficient and the value for the second adjacent coefficient being non-negative values.

[56] The device of

[47] , wherein to determine a context offset for the currently encoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient, the one or more processors are further configured to: set the context offset value to a specific offset value in response to the value for the first adjacent coefficient being less than or equal to 0, the value for the second adjacent coefficient being less than or equal to 0, and either the value for the first adjacent coefficient or the value for the second adjacent coefficient being less than or equal to -1.

[57] wherein the one or more processors: 5. The device of claim 47, further configured to quantize residual values ​​for a residual block of the video data to determine a value for the currently encoded coefficient.

[58] The one or more processors: To determine the predicted block,

[47] The device of claim 47, further configured to compare the predicted block with an original block of video data to determine a residual block of the video data.

[59] An apparatus for decoding video data, means for determining, for a residual block of video data encoded using transform skip mode, a value for a first neighboring coefficient of a currently decoded coefficient; means for determining a value for a second neighboring coefficient of the currently decoded coefficient; means for determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; and means for decoding a value for the currently decoded coefficient based on the determined context offset.

[60] A computer-readable storage medium having instructions stored thereon, The instructions, when executed by one or more processors, cause the one or more processors to: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using a transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; A computer-readable storage medium for decoding a value for the currently decoded coefficient based on the determined context offset.

Claims

1. 1. A method for decoding video data, comprising: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; wherein determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient comprises: selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to 0 or having opposite signs; selecting a second context offset in response to both the first and second adjacent coefficients being positive, or one of the first and second adjacent coefficients being equal to zero and the other of the first and second adjacent coefficients being positive; selecting a third context offset in response to both the first and second neighboring coefficients being negative, or one of the first and second neighboring coefficients being equal to zero and the other of the first and second neighboring coefficients being negative. decoding a value for the currently decoded coefficient based on the determined context offset; and Equipped with Decoding a value for the currently decoded coefficient based on the determined context offset comprises: determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; Receiving a syntax element; determining, in response to the syntax element having a value equal to one, that a level value of the currently decoded coefficient is equal to the predicted level value; determining, in response to the value for the syntax element being greater than the predicted level value, that a level value of the currently decoded coefficient is equal to the value for the syntax element plus one; determining that a level value of the currently decoded coefficient is equal to the value for the syntax element in response to the value for the syntax element being less than the predicted level value; A method comprising:

2. 2. The method of claim 1 , wherein the first neighboring coefficient comprises one of a top neighboring coefficient or a left neighboring coefficient to the currently decoded coefficient, and the second neighboring coefficient comprises the other of the top neighboring coefficient or the left neighboring coefficient.

3. Decoding a value for the currently decoded coefficient based on the determined context offset comprises: determining a context based on the determined context offset; receiving one or more bins of data; Context decoding one or more bins of the data based on the determined context to determine a sign for the currently decoded coefficient; The method of claim 1 , comprising:

4. and / or further comprising: dequantizing values ​​for the currently decoded coefficients without inverse transforming to determine residual values ​​for a residual block of the video data. determining a decoded residual block based on values ​​for the currently decoded coefficients; adding the decoded residual block to a prediction block to determine a reconstructed block; performing one or more filtering operations on the reconstructed blocks to determine decoded blocks of video data; outputting a decoded picture of the video data including the decoded block of video data; and The method of claim 1 further comprising:

5. 1. A method for encoding video data, comprising: determining a value for a first neighboring coefficient of a currently encoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently encoded coefficient; determining a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; wherein determining a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient comprises: selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to 0 or having opposite signs; selecting a second context offset in response to both the first and second adjacent coefficients being positive, or one of the first and second adjacent coefficients being equal to zero and the other of the first and second adjacent coefficients being positive; selecting a third context offset in response to both the first and second neighboring coefficients being negative, or one of the first and second neighboring coefficients being equal to zero and the other of the first and second neighboring coefficients being negative. encoding a value for the currently encoded coefficient based on the determined context offset; Equipped with encoding a value for the currently encoded coefficient based on the determined context offset, determining a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; encoding a syntax element with a value equal to one in response to the level value of the currently encoded coefficient being equal to the predicted level value; in response to the level value of the currently encoded coefficient being less than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient; in response to the level value of the currently encoded coefficient being greater than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient minus one; A method comprising:

6. The method of claim 5 , wherein the first neighboring coefficient comprises one of a top neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient comprises the other of the top neighboring coefficient or the left neighboring coefficient.

7. encoding a value for the currently encoded coefficient based on the determined context offset, determining a context based on the determined context offset; determining a sign for the currently encoded coefficient; Context encoding one or more bins of data based on the determined context to represent a sign for the currently encoded coefficient; The method of claim 5 , comprising:

8. quantizing residual values ​​for a residual block of the video data to determine values ​​for the currently encoded coefficients; and / or determining a predicted block; comparing the predicted block with an original block of video data to determine a residual block of the video data; The method of claim 5 further comprising:

9. In a device that decodes video data, a memory configured to store video data; one or more processors; The one or more processors: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; wherein to determine a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, the one or more processors: selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to 0 or having opposite signs; selecting a second context offset in response to both the first and second adjacent coefficients being positive, or one of the first and second adjacent coefficients being equal to zero and the other of the first and second adjacent coefficients being positive; selecting a third context offset in response to both the first and second neighboring coefficients being negative, or one of the first and second neighboring coefficients being equal to zero and the other of the first and second neighboring coefficients being negative. decoding a value for the currently decoded coefficient based on the determined context offset; and, wherein decoding the value for the currently decoded coefficient based on the determined context offset comprises: determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; Receiving a syntax element; determining, in response to the syntax element having a value equal to one, that a level value of the currently decoded coefficient is equal to the predicted level value; determining, in response to the value for the syntax element being greater than the predicted level value, that a level value of the currently decoded coefficient is equal to the value for the syntax element plus one; determining that a level value of the currently decoded coefficient is equal to the value for the syntax element in response to the value for the syntax element being less than the predicted level value; Equipped with The device is configured to:

10. The device of claim 9 , wherein the one or more processors are further configured to perform the method of any one of claims 2 to 4 .

11. In a device that encodes video data, a memory configured to store video data; one or more processors; The one or more processors: determining a value for a first neighboring coefficient of a currently encoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently encoded coefficient; determining a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; wherein to determine a context offset for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient, the one or more processors: selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to 0 or having opposite signs; selecting a second context offset in response to both the first and second adjacent coefficients being positive, or one of the first and second adjacent coefficients being equal to zero and the other of the first and second adjacent coefficients being positive; selecting a third context offset in response to both the first and second neighboring coefficients being negative, or one of the first and second neighboring coefficients being equal to zero and the other of the first and second neighboring coefficients being negative; configured to: encoding a value for the currently encoded coefficient based on the determined context offset; and, wherein encoding the value for the currently encoded coefficient based on the determined context offset comprises: determining a predicted level value for the currently encoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; encoding a syntax element with a value equal to one in response to the level value of the currently encoded coefficient being equal to the predicted level value; in response to the level value of the currently encoded coefficient being less than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient; in response to the level value of the currently encoded coefficient being greater than the predicted level value, encoding a syntax element with a value equal to the level value of the currently encoded coefficient minus one; Equipped with The device is configured to:

12. The device of claim 11 , wherein the one or more processors are further configured to perform the method of any one of claims 6 to 8 .

13. A non-transitory computer readable storage medium having instructions stored thereon, comprising: The instructions, when executed by one or more processors, cause the one or more processors to: determining a value for a first neighboring coefficient of a currently decoded coefficient for a residual block of video data encoded using transform skip mode; determining a value for a second neighboring coefficient of the currently decoded coefficient; determining a context offset for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; wherein the instructions cause the one or more processors to: determine a context offset for the currently decoded coefficient based on a value for the first adjacent coefficient and a value for the second adjacent coefficient; selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to 0 or having opposite signs; selecting a second context offset in response to both the first and second adjacent coefficients being positive, or one of the first and second adjacent coefficients being equal to zero and the other of the first and second adjacent coefficients being positive; selecting a third context offset in response to both the first and second neighboring coefficients being negative, or one of the first and second neighboring coefficients being equal to zero and the other of the first and second neighboring coefficients being negative. decoding a value for the currently decoded coefficient based on the determined context offset; and, wherein decoding the value for the currently decoded coefficient based on the determined context offset comprises: determining a predicted level value for the currently decoded coefficient based on a value for the first neighboring coefficient and a value for the second neighboring coefficient; Receiving a syntax element; determining, in response to the syntax element having a value equal to one, that a level value of the currently decoded coefficient is equal to the predicted level value; determining, in response to the value for the syntax element being greater than the predicted level value, that a level value of the currently decoded coefficient is equal to the value for the syntax element plus one; determining that a level value of the currently decoded coefficient is equal to the value for the syntax element in response to the value for the syntax element being less than the predicted level value; Equipped with A non-transitory computer-readable storage medium for causing