Coefficient Decoding for Transformed Skip Mode
By using the correlation of adjacent coefficients in video encoding, determining the context offset of the coefficients for coefficient decoding, the problem of low entropy coding efficiency in transform skip mode is solved, and higher encoding efficiency and quality are achieved.
Patent Information
- Application Number
- CN202080018661.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-03-10
- Filing Date
- 2020-03-11
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2040-03-11
AI Technical Summary
In video encoding, when encoding video data in transform skip mode, the correlation between adjacent coefficients cannot be effectively utilized, resulting in inefficient entropy coding.
By determining the context offset of the coefficient currently being decoded, coefficient coding is performed using the values of the first adjacent coefficient and the second adjacent coefficient, thereby improving the entropy coding efficiency.
This technology improves overall encoding efficiency by reducing the bit overhead required to represent encoded video data without decreasing the quality of decoded video data.
Smart Images

Figure CN113545058B_ABST
Abstract
Description
[0001] This application claims priority to the following applications:
[0002] U.S. Patent Application No. 16 / 814,654, filed on March 10, 2020;
[0003] U.S. Provisional Patent Application No. 62 / 816,745, filed on March 11, 2019; and
[0004] U.S. Provisional Patent Application No. 62 / 850,453, filed on May 20, 2019,
[0005] the entire content of each application is hereby incorporated by reference. Technical Field
[0006] This disclosure relates to video encoding and video decoding. Background Art
[0007] Digital video capabilities can be incorporated into a wide variety 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 wireless telephones, so-called "smart phones", video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video decoding technologies, such as those described in the standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), and extensions of these standards. Video devices can more efficiently transmit, receive, encode, decode, and / or store digital video information by implementing these video decoding technologies.
[0008] Video decoding technologies include spatial (intra) prediction and / or temporal (inter) prediction to reduce or eliminate redundancy inherent in a video sequence. For block-based video decoding, a video segment (e.g., a video picture or a portion of a video picture) can 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 the intra-coded (I) segments of a picture are encoded using spatial prediction relative to reference samples in adjacent blocks in the same picture. Video blocks in the inter-coded (P or B) segments of a picture can use spatial prediction relative to reference samples in adjacent blocks in the same picture, or temporal prediction relative 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. Summary of the Invention
[0009] In some decoding 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. The present disclosure describes techniques for a coefficient decoding scheme for the transform skip mode. The techniques of the present disclosure include an entropy decoding process that converts a binary representation of coefficients into a series of quantized coefficients of non-binary values. A corresponding entropy encoding process, which is generally the inverse of the entropy decoding process, is also part of the present disclosure.
[0010] In one example, a method for decoding video data includes: determining values of first neighboring coefficients for a coefficient currently being decoded for a residual block of the video data encoded using the transform skip mode; determining values of second neighboring coefficients for the coefficient currently being decoded; determining a context offset for the coefficient currently being decoded based on the values of the first neighboring coefficients and the values of the second neighboring coefficients; and decoding the value of the coefficient currently being decoded based on the determined context offset.
[0011] In another example, a method for encoding video data includes: determining values of first neighboring coefficients for a coefficient currently being encoded for a residual block of the video data encoded using the transform skip mode; determining values of second neighboring coefficients for the coefficient currently being encoded; determining a context offset for the coefficient currently being encoded based on the values of the first neighboring coefficients and the values of the second neighboring coefficients; and encoding the value of the coefficient currently being encoded based on the determined context offset.
[0012] In another example, a device for decoding video data includes: a memory configured to store video data, and one or more processors implemented in circuitry and configured to: determine values of first neighboring coefficients for a coefficient currently being decoded for a residual block of the video data encoded using the transform skip mode; determine values of second neighboring coefficients for the coefficient currently being decoded; determine a context offset for the coefficient currently being decoded based on the values of the first neighboring coefficients and the values of the second neighboring coefficients; and decode the value of the coefficient currently being decoded based on the determined context offset.
[0013] 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 circuitry and configured to perform the following operations: for a residual block encoded using a transform skip mode of the video data, determine a value of a first neighboring coefficient for a coefficient currently being encoded; determine a value of a second neighboring coefficient for the coefficient currently being encoded; determine a context offset for the coefficient currently being encoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; and encode a value of the coefficient currently being encoded based on the determined context offset.
[0014] In another example, a device for decoding video data includes: a unit configured to determine a value of a first neighboring coefficient for a coefficient currently being decoded for a residual block encoded using a transform skip mode of the video data; a unit configured to determine a value of a second neighboring coefficient for the coefficient currently being decoded; a unit configured to determine a context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; and a unit configured to decode a value of the coefficient currently being decoded based on the determined context offset.
[0015] In another example, a device for encoding video data includes: a unit configured to determine a value of a first neighboring coefficient for a coefficient currently being encoded for a residual block encoded using a transform skip mode of the video data; a unit configured to determine a value of a second neighboring coefficient for the coefficient currently being encoded; a unit configured to determine a context offset for the coefficient currently being encoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; and a unit configured to encode a value of the coefficient currently being encoded based on the determined context offset.
[0016] In another example, a computer-readable storage medium stores instructions that, when executed by one or more processors, cause the one or more processors to perform the following operations: for a residual block encoded using a transform skip mode of the video data, determine a value of a first neighboring coefficient for a coefficient currently being decoded; determine a value of a second neighboring coefficient for the coefficient currently being decoded; determine a context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; and decode a value of the coefficient currently being decoded based on the determined context offset.
[0017] In another example, a computer-readable storage medium stores instructions that, when executed by one or more processors, cause the one or more processors to perform the following operations: for a residual block encoded using a transform skip mode of video data, determine a value of a first neighboring coefficient for a coefficient currently being encoded; determine a value of a second neighboring coefficient for the coefficient currently being encoded; based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, determine a context offset for the coefficient currently being encoded; and encode the value of the coefficient currently being encoded based on the determined context offset.
[0018] Details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, the drawings, and the claims. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a block diagram illustrating an exemplary video encoding and decoding system that can execute the techniques of the present disclosure.
[0020] Figure 2A and Figure 2B is a conceptual diagram illustrating an exemplary quadtree binary tree (QTBT) structure and corresponding coding tree units (CTUs).
[0021] Figure 3 illustrates examples of neighboring coefficients of a coefficient currently being encoded or decoded.
[0022] Figure 4 is a block diagram illustrating an exemplary video encoder that can execute the techniques of the present disclosure.
[0023] Figure 5 is a block diagram illustrating an exemplary video decoder that can execute the techniques of the present disclosure.
[0024] Figure 6A and Figure 6B is a conceptual diagram illustrating a range update process in binary arithmetic decoding.
[0025] Figure 7 is a conceptual diagram illustrating an output process in binary arithmetic decoding.
[0026] Figure 8 is a block diagram illustrating a context adaptive binary arithmetic coding (CABAC) decoder in a video encoder.
[0027] Figure 9 is a block diagram illustrating a CABAC decoder in a video decoder.
[0028] Figure 10is a flowchart showing a process for encoding video data.
[0029] Figure 11 is a flowchart showing a process for decoding video data.
[0030] Figure 12 is a flowchart showing a process for determining a context for decoding a sign of coefficients of a residual block. DETAILED DESCRIPTION
[0031] Video decoding (e.g., video encoding and / or video decoding) generally involves predicting a video data block (e.g., intra prediction) based on decoded video data blocks in the same picture, or predicting a video data block based on decoded video data blocks in different pictures (e.g., inter prediction). In some cases, a video encoder also calculates residual data by comparing a predicted block with an original block. Thus, the residual data represents the difference between the predicted block and the original block. To reduce the number of bits needed to signal the residual data, the video encoder may transform and quantize the residual data and signal the transformed and quantized residual data in an encoded bitstream. The compression achieved through this transform and quantization process may be lossy, meaning that the transform and quantization process may introduce distortion in the decoded video data.
[0032] A video decoder decodes the residual data and adds the residual data to the predicted block to produce a reconstructed video block that more closely matches the original video block compared to the individual predicted block. Due to the losses introduced by the transform and quantization of the residual data, the first reconstructed block may have distortion or artifacts. A common type of artifact or distortion is called blocking effect, where the boundaries of the blocks used for decoding the video data are visible.
[0033] 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). The parameters for these filtering operations may be determined by the video encoder and signaled explicitly in the encoded video bitstream, or may be determined implicitly by the video decoder without explicitly signaling these parameters in the encoded video bitstream.
[0034] In some decoding scenarios, a video encoder may encode video data in a transform skip mode in which the above-described 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. A residual block of video data encoded using the transform skip mode may also be referred to as an untransformed residual block. The present disclosure describes techniques for a coefficient decoding scheme for the transform skip mode. The techniques of the present disclosure include an entropy decoding process that converts a binary representation into a series of non-binary value quantized coefficients. The corresponding entropy encoding process, which is typically the inverse of the entropy decoding, is also part of the present disclosure. The techniques of the present disclosure can be applied to any existing video codec (e.g., High Efficiency Video Coding (HEVC)), or a standard currently under development (e.g., Versatile Video Coding (VVC), and other future video coding standards).
[0035] The techniques proposed by the present disclosure include, for example, determining a context offset for a currently decoded coefficient based on values for a first neighboring coefficient and values for a second neighboring coefficient, and decoding the value of the currently decoded coefficient based on the determined context offset. Since the coefficient values between neighboring coefficients in a residual block tend to be more correlated for a transform skip block than for a transformed block, the techniques of the present disclosure can result in improved entropy coding, which can improve the 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.
[0036] Figure 1 is a block diagram showing an exemplary video encoding and decoding system 100 in which the techniques of the present disclosure may be performed. The techniques of the present disclosure generally pertain to the decoding (encoding and / or decoding) of video data. Generally, video data includes any data for processing video. Thus, video data may include raw, unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata (e.g., signaling data).
[0037] As Figure 1As shown, in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 can be or include any of a wide range of devices, including desktop computers, notebooks (e.g., laptops), tablet computers, or other mobile devices, set-top boxes, telephone handsets, smart phones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, broadcast receiver devices, and so on. In some cases, source device 102 and destination device 116 can be equipped for wireless communication and thus can be referred to as wireless communication devices.
[0038] In Figure 1 the example shown, source device 102 includes a video source 104, a memory 106, a video encoder 200, and an output interface 108. Destination device 116 includes an input interface 122, a video decoder 300, a memory 120, and a display device 118. In accordance with the present disclosure, video encoder 200 of source device 102 and video decoder 300 of destination device 116 can be configured to apply the techniques for efficient decoding described in the present disclosure. Thus, source device 102 represents an example of a video encoding device, and destination device 116 represents an example of a video decoding device. In other examples, the source device and the destination device can include other components or arrangements. For example, source device 102 can receive video data from an external video source such as an external camera. Similarly, destination device 116 can interface with an external display device rather than include an integrated display device.
[0039] As Figure 1 shown, system 100 is merely an example. In general, any digital video encoding and / or decoding device can perform the techniques for efficient decoding described in the present disclosure. Source device 102 and destination device 116 are merely examples of such decoding devices, where source device 102 generates encoded video data for transmission to destination device 116. The present disclosure refers to a "decoding" device as a device that performs decoding (encoding and / or decoding) of data. Thus, video encoder 200 and video decoder 300 represent examples of decoding devices (specifically, a video encoder and a video decoder), respectively. In some examples, devices 102, 116 can operate in a substantially symmetric manner such that each of devices 102, 116 includes video encoding and decoding components. Thus, system 100 can support one-way or two-way video transmission between video devices 102, 116, e.g., for video streaming, video playback, video broadcast, or video telephony.
[0040] Typically, video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a continuous sequence of pictures (also referred to as “frames”) of the video data to video encoder 200, where video encoder 200 encodes the data of the pictures. The video source 104 of source device 102 may include a video capture device (e.g., a camera), a video archive containing previously captured raw video, and / or a video feed interface for receiving video from a video content provider. As another alternative, video source 104 may generate computer graphics-based data as source video, or a combination of live video, archived video, and computer-generated video. In each case, video encoder 200 encodes the captured, pre-captured, or computer-generated video data. Video encoder 200 may reorder the images from the received order (sometimes referred to as “display order”) into a decoding order for decoding. Video encoder 200 may generate a bitstream including the encoded video data. Then, source device 102 may output the encoded video data to computer-readable medium 110 via output interface 108 for reception and / or retrieval by, for example, input interface 122 of destination device 116.
[0041] The memories 106 of source device 102 and 120 of destination device 116 represent general memories. In some examples, memories 106, 120 may store raw video data, e.g., raw video from video source 104 and raw decoded video data from video decoder 300. Additionally or alternatively, memories 106, 120 may store software instructions that may be executed by, for example, video encoder 200 and video decoder 300, respectively. Although in this example, memories 106 and 120 are shown separately from video encoder 200 and video decoder 300, it should be understood that video encoder 200 and video decoder 300 may also include internal memories to achieve functionally similar or equivalent purposes. Further, memories 106, 120 may store encoded video data (e.g., output from video encoder 200 and input to video decoder 300). In some examples, a portion of memories 106, 120 may be allocated as one or more video buffers, e.g., for storing raw, decoded, and / or encoded video data.
[0042] The computer-readable medium 110 can represent any type of medium or device capable of transmitting the encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium for enabling the source device 102 to directly send the encoded video data to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 can demodulate the transmission signal including the encoded video data according to a wireless communication standard, and the input interface 122 can demodulate the received transmission signal according to a communication standard such as a wireless communication protocol. The communication medium can include any wireless or wired communication medium, such as the radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium can form part of a packet-based network such as a local area network, a wide area network, or a global network (e.g., the Internet). The communication medium can include routers, switches, base stations, or any other device that facilitates communication from the source device 102 to the destination device 116.
[0043] In some examples, the computer-readable medium 110 can include a storage device 112. The source device 102 can output the encoded data from the output interface 108 to the storage device 112. Similarly, the destination device 116 can access the encoded data from the storage device 112 via the input interface 122. The storage device 112 can include any one of a variety of distributed or locally accessible data storage media (e.g., hard disk drives, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory) or any other suitable digital storage media for storing the encoded video data.
[0044] In some examples, the computer-readable medium 110 can include a file server 114 or another intermediate storage device capable of storing the encoded video data generated by the source device 102. The source device 102 can output the encoded video data to the file server 114 or another intermediate storage device that can store the encoded video data generated by the source device 102. The destination device 116 can access the stored video data from the file server 114 via streaming or downloading. The file server 114 can be any type of server device capable of storing the encoded video data and sending the encoded video data to the destination device 116. The file server 114 can 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 can access the encoded video data from the file server 114 via any standard data connection including an Internet connection. This can include a wireless channel (e.g., Wi-Fi connection), a wired connection (e.g., Digital Subscriber Line (DSL), cable modem, etc.), or a combination of both suitable for accessing the encoded video data stored on the file server 114. The file server 114 and the input interface 122 can be configured to operate according to a streaming protocol, a download transfer protocol, or a combination thereof.
[0045] The output interface 108 and the input interface 122 can represent a wireless transmitter / receiver, a modem, a wired network 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 the output interface 108 and the input interface 122 include wireless components, the output interface 108 and the input interface 122 can be configured to transmit data such as the encoded video data according to cellular communication standards such as 4G, 4G-LTE (Long Term Evolution), Advanced LTE, 5G, and so on. In some examples where the output interface 108 includes a wireless transmitter, the output interface 108 and the input interface 122 can be configured to transmit data such as the encoded video data according to other wireless standards (e.g., IEEE802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee TM ), Bluetooth TM standards, etc.). In some examples, the source device 102 and / or the destination device 116 can include respective System-on-Chip (SoC) devices. For example, the source device 102 can include an SoC device to perform the functions attributed to the video encoder 200 and / or the output interface 108, while the destination device 116 can include an SoC device to perform the functions attributed to the video decoder 300 and / or the input interface 122.
[0046] The techniques of the present disclosure may be applied to video coding for supporting any of a variety of multimedia applications such as over-the-air television broadcasting, cable television transmission, satellite television transmission, Internet streaming video transmission (e.g., HTTP-based Dynamic Adaptive Streaming over HTTP (DASH), digital video encoded onto a data storage medium), decoding of digital video stored on a data storage medium, or other applications.
[0047] The 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, etc.). The encoded video bitstream may include signaling information defined by the video encoder 200 and used by the video decoder 300, e.g., syntax elements having values that describe the characteristics and processing of video blocks or other decoding units (e.g., slices, pictures, groups of pictures, sequences, etc.). 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.
[0048] Although not shown in Figure 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 process a multiplexed stream including both audio and video in a common data stream. If applicable, the MUX-DEMUX unit may conform to the ITU H.223 multiplexer protocol or other protocols (e.g., User Datagram Protocol (UDP)).
[0049] Video encoder 200 and 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 any combination thereof. When implementing these techniques partially in software, the device may store instructions for the software in a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the techniques of the present disclosure. Each of video encoder 200 and video decoder 300 may be included in one or more encoders or decoders, and any of the encoders or decoders may be integrated as part of a combined encoder / decoder (CODEC) in a corresponding device. Devices including video encoder 200 and / or video decoder 300 may include integrated circuits, microprocessors, and / or wireless communication devices (e.g., cellular phones).
[0050] Video encoder 200 and video decoder 300 may operate according to a video coding standard such as ITU-T H.265 (also known as High Efficiency Video Coding (HEVC)) or an extension thereof (e.g., multi-view 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 the Joint Exploration Test Model (JEM) or ITU-T H.266 (also known as Versatile Video Coding (VVC)). Drafts of the VVC standard are described in: Bross, et al. “Versatile Video Coding (Draft 4),” Joint Video Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, Meeting 13: January 9-18, 2019, JVET-M1001-v5 in Marrakech, Morocco (hereinafter “VVC Draft 4”). Another draft of the VVC standard is described in: Bross, et al. “Versatile Video Coding (Draft 7),” Joint Video Team (JVET) of ITU-T SG16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, Meeting 16: October 1-11, 2019, JVET-P2001-v14 in Geneva, Switzerland (hereinafter “VVC Draft 7”). However, the techniques of the present disclosure are not limited to any particular coding standard.
[0051] Generally, video encoder 200 and video decoder 300 may perform block-based encoding of pictures. The term "block" generally refers to a structure that includes data to be processed (e.g., in an encoding, decoding, or other manner used during encoding and / or decoding). For example, a block may include a two-dimensional matrix of samples of luminance and / or chrominance data. Generally, video encoder 200 and video decoder 300 may encode video data represented in YUV (e.g., Y, Cb, Cr) format. That is, instead of decoding the red, green, and blue (RGB) data of the samples of a picture, video encoder 200 and video decoder 300 may decode the luminance and chrominance components, where the chrominance components may include red and blue chrominance components. In some examples, video encoder 200 converts the received RGB format data to YUV representation before encoding, and video decoder 300 converts the YUV representation to RGB format. Alternatively, preprocessing and postprocessing units (not shown) may perform these conversions.
[0052] The present disclosure generally may relate to decoding (e.g., encoding and decoding) of pictures to include processes of encoding or decoding data of the pictures. Similarly, the present disclosure may relate to decoding of blocks of pictures to include processes of encoding or decoding data of these blocks (e.g., prediction and / or residual encoding). An encoded video bitstream generally includes a series of values for syntax elements, where these syntax elements represent decoding decisions (e.g., decoding modes) and partitioning of a picture into blocks. Thus, a reference to decoding a picture or a block generally should be understood as decoding values of the syntax elements that form the picture or the block.
[0053] HEVC defines various blocks, which include coding units (CUs), prediction units (PUs), and transform units (TUs). According to HEVC, a video decoder (e.g., video encoder 200) divides a coding tree unit (CTU) into CUs according to a quadtree structure. That is, the video decoder divides the CTU and CUs into four equal, non-overlapping squares, and each node of the quadtree has zero or four child nodes. A node without child nodes may be referred to as a "leaf node", and a CU of such a leaf node may include one or more PUs and / or one or more TUs. The video decoder may further divide the PUs and TUs. For example, in HEVC, a residual quadtree (RQT) represents the partitioning of TUs. In HEVC, a PU represents inter-prediction data, and a TU represents residual data. An intra-prediction CU includes intra-prediction information (e.g., an intra-mode indication).
[0054] As another example, video encoder 200 and video decoder 300 may be configured to operate according to JEM or VVC. According to JEM or VVC, a video coder (e.g., video encoder 200) divides a picture into multiple coding tree units (CTUs). Video encoder 200 may divide a CTU according to a tree structure such as a quadtree-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 the CU, PU, and TU of HEVC. The QTBT structure includes two levels: a first level divided according to quadtree partitioning and a second level divided according to binary tree partitioning. The root node of the QTBT structure corresponds to the CTU. The leaf nodes of the binary tree correspond to coding units (CUs).
[0055] In the MTT partitioning structure, a block may be partitioned using quadtree (QT) splitting, binary tree (BT) splitting, and one or more types of ternary tree (TT) (also referred to as ternary-type tree (TT)) splitting. Ternary tree or ternary-type tree splitting is a partitioning that divides a block into three sub-blocks. In some examples, ternary tree or ternary-type tree splitting divides a block into three sub-blocks without dividing the original block through the center. The partitioning types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.
[0056] 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 the two chrominance components (or two QTBT / MTT structures for the respective chrominance components).
[0057] Video encoder 200 and video decoder 300 may be configured to use the quadtree partitioning, QTBT partitioning, MTT partitioning, or other partitioning structures of each HEVC. For ease of illustration, the description of the technology of the present disclosure is given with respect to QTBT partitioning. However, it should be understood that the technology of the present disclosure may also be applied to video coders configured to use quadtree partitioning or other types of partitioning.
[0058] Blocks (e.g., CTUs or CUs) can be grouped in a picture in various ways. As an example, a brick can refer to a row of CTUs in a particular rectangular region within a particular tile in the picture. A tile can be a rectangular region of CTUs within a particular tile column and a particular tile row in the picture. A tile column is a rectangular region of CTUs that has a height equal to the height of the picture and has a width (e.g., as specified by a syntax element in the picture parameter set). A tile row is a rectangular region of CTUs that has a height (e.g., as given in the picture parameter set) specified by a syntax element and has a width equal to the width of the picture.
[0059] In some examples, a tile can be divided into multiple bricks, and each brick can include one or more rows of CTUs within that tile. A tile that is not divided into multiple bricks can also be referred to as a brick. However, a brick that is a proper subset of a tile cannot be called a tile.
[0060] Bricks in a picture can also be arranged in slices. A slice can be an integer number of bricks in the picture that can be specifically contained within a single network abstraction layer (NAL) unit. In some examples, a slice includes multiple complete tiles, or only includes a contiguous sequence of bricks of a single tile.
[0061] This disclosure can interchangeably use "NxN" and "N times N" in the vertical and horizontal dimensions to refer to the sample size of a block (e.g., a CU or other video block), such as 16x16 samples or 16 times 16 samples. Generally, a 16x16 CU will have 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 can be arranged in rows and columns. Additionally, a CU does not have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU can contain NxM samples, where M does not necessarily equal N.
[0062] Video encoder 200 encodes video data of CUs that represent prediction and / or residual information and other information. The prediction information indicates how a CU will be predicted in order to form a prediction block for that CU. The residual information generally represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.
[0063] To predict a CU, video encoder 200 can generally form a prediction block for the CU through inter - frame prediction or intra - frame prediction. Inter - frame prediction generally refers to predicting a CU from data of previously encoded pictures, while intra - frame prediction generally refers to predicting a CU from previously encoded data of the same picture. To perform inter - frame prediction, video encoder 200 can use one or more motion vectors to generate a prediction block. Video encoder 200 can generally perform a motion search, for example, in terms of the difference between the CU and a reference block, to identify a reference block that closely matches the CU. Video encoder 200 can use the sum of absolute differences (SAD), sum of squared differences (SSD), mean absolute difference (MAD), mean squared difference (MSD), or other such difference calculations to compute a difference metric to determine whether the reference block closely matches the current CU. In some examples, video encoder 200 can use uni - directional prediction or bi - directional prediction to predict the current CU.
[0064] Some examples of JEM and VVC also provide an affine motion compensation mode, which can be considered an inter - frame prediction mode. In the affine motion compensation mode, video encoder 200 can determine two or more motion vectors representing non - translational motion, such as shrinking or magnifying, rotation, perspective motion, or other irregular motion types.
[0065] To perform intra - frame prediction, video encoder 200 can select an intra - frame prediction mode to generate a prediction block. Certain examples of JEM and VVC provide 67 intra - frame prediction modes, which include various directional modes as well as a planar mode and a DC mode. Generally, video encoder 200 selects an intra - frame prediction mode that describes predicting samples of the current block from adjacent samples with respect to the adjacent samples of the current block (e.g., the block of the CU). Assuming video encoder 200 decodes CTUs and CUs in a raster scan order (from left to right, top to bottom), these samples can generally be above, top - left, or to the left of the current block in the same picture as the current block.
[0066] Video encoder 200 encodes data representing the prediction mode of the current block. For example, for an inter - frame prediction mode, video encoder 200 can encode data representing which one of the various available inter - frame prediction modes is used, as well as the motion information for the corresponding mode. For uni - directional or bi - directional inter - frame prediction, for example, video encoder 200 can use advanced motion vector prediction (AMVP) or a merge mode to encode the motion vectors. Video encoder 200 can use a similar mode to encode the motion vectors for the affine motion compensation mode.
[0067] After prediction, such as intra prediction or inter prediction of a block, video encoder 200 may compute residual data for the block. The residual data (e.g., residual block) represents the sample-by-sample difference between the block and a predicted block for the block formed using the corresponding prediction mode. Video encoder 200 may apply one or more transforms to the residual block to produce transformed data in a transform domain rather than in the sample domain. For example, 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, video encoder 200 may apply a secondary transform after the first transform, such as a mode-dependent non-separable secondary transform (MDNSST), a signal-dependent transform, a Karhunen-Loeve transform (KLT), etc. After applying the one or more transforms, video encoder 200 produces transform coefficients.
[0068] Although examples of performing transforms are described above, 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 an example where the transform is skipped, video encoder 200 may output coefficients corresponding to the residual values instead of transform coefficients. In the following description, the term "coefficients" should be interpreted to include coefficients corresponding to the residual values or transform coefficients generated according to the transform result.
[0069] As described above, after any transform or skipping the transform to produce coefficients, video encoder 200 may perform quantization of the coefficients. In some examples, when the transform is skipped, quantization may also be skipped. Quantization generally refers to the process of quantizing the coefficients to possibly reduce the amount of data used to represent these coefficients, thereby providing further compression. By performing the quantization process, video encoder 200 may reduce the bit depth associated with some or all of these coefficients. For example, video encoder 200 may round an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, video encoder 200 may perform a right shift of the value to be quantized by bits.
[0070] After quantization, the video encoder 200 may scan the coefficients (e.g., the coefficients generated according to the result of the transform or due to transform skip), so as to generate a one-dimensional vector according to a two-dimensional matrix including the quantized coefficients. The scan may be designed to place the higher-energy (and thus lower-frequency) coefficients at the front of the vector and the lower-energy (and thus higher-frequency) coefficients at the back of the vector. In the example of transform skip, the result of the scan may not be that the higher-energy coefficients are at the front of the vector and the lower-energy coefficients are at the back of the vector. In some examples, the video encoder 200 may use a predefined scan order to scan the quantized coefficients to generate a serialized vector, and then perform entropy coding on the quantized coefficients of the vector. In other examples, the video encoder 200 may perform adaptive scanning. After scanning the quantized coefficients to form a one-dimensional vector, the video encoder 200 may perform entropy coding on the one-dimensional vector, for example, according to context-adaptive binary arithmetic coding (CABAC). The video encoder 200 may also perform entropy coding on the values of the syntax elements that describe the metadata associated with the encoded video data for use by the video decoder 300 when decoding the video data.
[0071] As described above, the video encoder 200 will encode the residual data in the TU. According to the expected characteristics of the residual data in the TU, the video encoder 200 may encode the TU in different modes (e.g., transform mode or transform skip mode), where different modes utilize different coefficient decoding schemes. Some coefficient decoding schemes use coefficient groups to encode the TU. A coefficient group is typically a subset of the coefficients in the TU. For example, the video encoder 200 may encode a 16x16 TU as four 4x4 coefficient groups.
[0072] To perform CABAC, the video encoder 200 may assign a context within the context model to the symbol to be sent. For example, the context may relate to whether the adjacent value of the symbol is a zero value. Probability determination may be based on the context assigned to the symbol.
[0073] The video encoder 200 may also generate syntax data (e.g., block-based syntax data, picture-based syntax data, and sequence-based syntax data) for the video decoder 300 in, for example, a picture header, a block header, a slice header, or other syntax data (e.g., a sequence parameter set (SPS), a picture parameter set (PPS), or a video parameter set (VPS)). The video decoder 300 may similarly decode such syntax data to determine how to decode the corresponding video data.
[0074] In this way, the video encoder 200 can generate a bitstream including encoded video data, e.g., syntax elements for describing the partitioning of a picture into blocks (e.g., CUs), and syntax elements for prediction and / or residual information of these blocks. Eventually, the video decoder 300 can receive the bitstream and decode the encoded video data.
[0075] Generally, the video decoder 300 performs a process reciprocal to the process performed by the video encoder 200 to decode the encoded video data of the bitstream. For example, the video decoder 300 can use CABAC to decode the values of the syntax elements of the bitstream in a way that is substantially similar (although reciprocal) to the CABAC encoding process of the video encoder 200. The syntax elements can define partitioning information for partitioning a picture into CTUs and for partitioning each CTU according to a corresponding partitioning structure (such as a QTBT structure) to define the CUs of the CTUs. These syntax elements can further specify prediction and residual information for blocks (e.g., CUs) of the video data.
[0076] The residual information can be represented by, e.g., quantized coefficients, where the quantized coefficients represent residual values or transform coefficients. The video decoder 300 can inverse-quantize and inverse-transform the quantized transform coefficients of the block to reproduce the residual block of the block. In an example where the video encoder 200 skips the transform operation (e.g., transform skip mode), the video decoder 300 can skip the inverse-transform operation. The video decoder 300 uses the signalized prediction mode (intra or inter prediction) and the associated prediction information (e.g., motion information for inter prediction) to form a prediction block (i.e., predicted block) for the block. Then, the video decoder 300 can combine the prediction block and the residual block (on a sample-by-sample basis) to reproduce the original block. The video decoder 300 can perform other processing, such as performing deblocking processing to reduce visual artifacts along the boundaries of the blocks.
[0077] According to the techniques of the present disclosure, the video encoder 200 and the video decoder 300 can be configured to: determine a context offset for a currently decoded coefficient based on values for a first neighboring coefficient and values for a second neighboring coefficient, and decode the value of the currently decoded coefficient based on the determined context offset. Since the coefficient values between neighboring coefficients in the residual block are more relevant for transform skip blocks than for transform blocks, the techniques of the present disclosure can result in improved entropy coding, which can improve the overall coding efficiency by, e.g., reducing the bit overhead required to represent the encoded video data without degrading the quality of the decoded video data.
[0078] The present disclosure generally relates to "signaling" certain information (e.g., syntax elements). The term "signaling" generally can refer to transmitting values for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 can signal the values for syntax elements in a bitstream. Generally, signaling refers to generating values in a bitstream. As described above, source device 102 can transmit the bitstream to destination device 116 either substantially in real time or not in real time, such as when storing syntax elements to storage device 112 for later retrieval by destination device 116.
[0079] Figure 2A and Figure 2B is a conceptual diagram showing an exemplary quadtree binary tree (QTBT) structure 130 and corresponding coding tree units (CTUs) 132. Solid lines represent quadtree partitioning, while dashed lines represent binary tree partitioning. In each partitioning (i.e., non-leaf) node of the binary tree, a flag is signaled to indicate which partitioning type (i.e., horizontal or vertical) is used. In this example, 0 represents horizontal partitioning, and 1 represents vertical partitioning. For quadtree partitioning, since a quadtree node partitions a block horizontally and vertically into 4 equal-sized sub-blocks, there is no need to indicate the partitioning type. Thus, video encoder 200 can encode syntax elements (e.g., partitioning information) of the region tree level (i.e., the first level) (i.e., solid lines) of QTBT structure 130 and syntax elements (e.g., partitioning information) of the prediction tree level (i.e., the second level) (i.e., dashed lines) of QTBT structure 130, and video decoder 300 can decode them. Video encoder 200 can encode video data (e.g., prediction and transform data) of the CUs represented by the terminal leaf nodes of QTBT structure 130, and video decoder 300 can decode them.
[0080] Generally speaking, Figure 2B the CTU 132 can be associated with parameters that specify the size of a block, and the size of the block corresponds to the nodes of the QTBT structure 130 at the first level and the second level. These parameters can include the CTU size (which represents the size of CTU 132 in samples), the minimum quadtree size (MinQTSize, which represents the minimum allowable quadtree leaf node size), the maximum binary tree size (MaxBTSize, which represents the maximum allowable binary tree root node size), the maximum binary tree depth (MaxBTDepth, which represents the maximum allowable binary tree depth), and the minimum binary tree size (MinBTSize, which represents the minimum allowable binary tree leaf node size).
[0081] The root node of the QTBT structure corresponding to the CTU can have four child nodes at the first level of the QTBT structure, and each child node can be divided according to the quadtree partitioning. That is, the nodes at the first level are leaf nodes (without child nodes) or have four child nodes. An example of the QTBT structure 130 represents such nodes, for example, including a parent node and child nodes with solid lines for branching. If the nodes at the first level are not greater than the maximum allowed binary tree root node size (MaxBTSize), these nodes can be further divided by the corresponding binary tree. The binary tree splitting of a node can be iterated until the nodes generated by the splitting reach the minimum allowed binary tree leaf node size (MinBTSize) or the maximum allowed binary tree depth (MaxBTDepth). An example of the QTBT structure 130 represents such nodes as having dashed lines for branching. The binary tree leaf nodes are called coding units (CUs), which are used for prediction (e.g., intra-frame or inter-frame prediction) and transformation without any further partitioning. As described above, the CU can also be referred to as a "video block" or a "block".
[0082] In an example of the QTBT partitioning structure, the CTU size is set to 128x128 (luminance samples and two corresponding 64x64 chrominance samples), the MinQTSize is set to 16x16, the MaxBTSize is set to 64x64, the MinBTSize (for both width and height) is set to 4, and the MaxBTDepth is set to 4. First, quadtree partitioning is applied to the CTU to generate quadtree leaf nodes. The size of the quadtree leaf nodes can range from 16x16 (i.e., MinQTSize) to 128x128 (i.e., CTU size). If the quadtree leaf node is 128x128, since this size exceeds the MaxBTSize (i.e., 64x64 in this example), the quadtree leaf node will not be further split by the binary tree. Otherwise, the quadtree leaf node will be further divided by the binary tree. Therefore, the quadtree leaf node is also the root node of the binary tree, and the depth of the binary tree is 0. When the depth of the binary tree reaches the MaxBTDepth (4 in this example), further splitting is not allowed. The width of the binary tree node is equal to the MinBTSize (4 in this example), indicating that no further horizontal splitting is allowed. Similarly, a binary tree node with a height equal to the MinBTSize means that no further vertical splitting is allowed for this binary tree node. As described above, the leaf nodes of the binary tree are called CUs, and they are further processed according to prediction and transformation without further partitioning.
[0083] When encoding blocks of video data in transform skip mode, video encoder 200 skips the transform process for the residual signal before performing the quantization process. Similarly, video decoder 300 skips the inverse transform processing step after performing the dequantization process. The characteristics of the untransformed residual signal are generally quite different from those of the transformed signal. For example, when compared to the coefficients used for the transformed block, the coefficients of the transform skip block tend to be more correlated with their neighboring coefficients. As a result, when compared to the horizontal values and sign information of the transformed blocks of the residual data, the horizontal values and sign information of the neighboring coefficients in the transform skip blocks of the residual data tend to be more correlated.
[0084] The following document proposed a recommended process for performing residual coding on blocks encoded in transform skip mode: 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, Marrakesh, MA, January 2019. In order to efficiently encode the hierarchical and sign information in transform skip mode, the coefficient coding proposed in JVET-M0464 can be modified to utilize the signal characteristics for more efficient coding.
[0085] Figure 3 An example of three coefficients from a transform skip block of residual data is shown. The transform skip block will also include Figure 3 other coefficients not shown in Figure 3 the example. In
[0086] The video encoder 200 and the video decoder 300 may be configured to perform sign decoding on coefficients in a transform skip block. In the technique for transform skip residual decoding described in JVET-M0464, the coefficients are decoded from the first (i.e., top-left) to the last (i.e., bottom-right), rather than from the last to the first as for transform blocks. If the technique of JVET-M0464 is implemented, the video encoder 200 and the video decoder 300 may be configured to perform context decoding on the sign information using the channel type of the residual as context. That is, the video encoder 200 and the video decoder 300 may use one context for the luminance residual and another context for the chrominance residual. The present disclosure describes sign decoding techniques that may be used instead of or in addition to the technique described in JVET-M0464. The following techniques utilize the sign information of the upper adjacent coefficient (e.g., Figure 3 the coefficient 144 therein) and the left adjacent coefficient (e.g., Figure 3 the coefficient 142 therein) to derive the sign decoding context offset of the coefficient currently being decoded (e.g., Figure 3 the coefficient 140 therein).
[0087] Reference Figure 3 , X0 is the left adjacent coefficient value, and X1 is the upper adjacent coefficient value. If both of these adjacent coefficients are zero or are non-zero but have opposite signs, the video encoder 200 and the video decoder 300 may use the context offset 0 (ctxOffset = 0). Otherwise, if both of these adjacent coefficients are non-negative, the video encoder 200 and the video decoder 300 may use the context offset 1 (ctxOffset = 1). For all other cases, the video encoder 200 and the video decoder 300 may use the context offset 2 (ctxOffset = 2). This may be described by the following pseudocode:
[0088]
[0089]
[0090] In some examples, if two adjacent coefficients are both zero or both non-zero but have opposite signs, the video encoder 200 and the video decoder 300 may use a context offset of 0. Otherwise (when both of the two adjacent coefficients are positive, or both of the two adjacent coefficients are negative, or one is 0 and the other is non-zero), the video encoder 200 and the video decoder 300 may use context 1. If context 1 is used, by convention, the sign value of the signaled 0 or 1 will mean that the sign of the coefficient currently being decoded is the same as the sign of one of the non-zero neighbors. This technique can also be extended to the following decoding scenarios: where only the value of the previously decoded non-zero coefficient can be used for context derivation, and where the sign value of 0 or 1 means that the sign of the coefficient is the same as the sign of the non-zero coefficient with a single context that was previously decoded.
[0091] Separate context sets for the luminance and chrominance components can be used in combination with the context offset derivation described above.
[0092] The video encoder 200 and the video decoder 300 can also be configured to perform horizontal mapping. In the transform skip residual decoding of JVET-M0464, the sig_coeff_flag, abs_level_gtX_flags, par_level_flag, and abs_remainder values are used to decode the coefficient absolute level absCoeffLevel to form the final absolute transform coefficient value, where X can be 1,..,5 (or some other critical value C). Thus, the absCoeffLevel value can be constructed as: 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
[0093] Instead of directly representing absCoeffLevel as in JVET-M0464, the video encoder 200 can be configured to map absCoeffLevel to a modified level. The video decoder 300 can be configured to perform the inverse mapping.
[0094] Similar to the sign decoding context offset derivation technique described above, the video encoder 200 and the video decoder 300 can use the absCoeffLevel information of the left adjacent coefficient and the upper adjacent coefficient to encode and decode the absolute coefficient level value. In this example, let X0 represent the left adjacent coefficient of the coefficient (e.g., coefficient 140 in Figure 3 the coefficient 140) that is currently being decoded (e.g.,Figure 3 the absolute coefficient level of the coefficient 142) in, and let X1 represent the coefficient currently being decoded (e.g., Figure 3 the upper adjacent coefficient of the coefficient 140) in (e.g., Figure 3 the absolute coefficient level of the coefficient 144) in. To represent a coefficient with an absolute coefficient level absCoeff, the mapped absCoeffMod can be decoded.
[0095] The operation of video encoder 200 for deriving the value of absCoeffMod can be shown by the following pseudocode:
[0096]
[0097] In some examples, if the absolute value (absCoeff) of the coefficient to be decoded is equal to the maximum adjacent prediction value pred, video encoder 200 sets the modified level absCoeffMod to 1. Otherwise, if absCoeff is less than the prediction value, video encoder 200 increments the value to be decoded by 1. Otherwise, video encoder 200 does not modify the absCoeff value.
[0098] For example, video encoder 200 can determine a predicted level value of the coefficient currently being encoded based on the values of a first adjacent coefficient and a second adjacent coefficient, and in response to the level value of the coefficient currently being encoded being equal to the predicted level value, encode the syntax element to have a value equal to one. In other cases, video encoder 200 can determine a predicted level value of the coefficient currently being encoded based on the values of a first adjacent coefficient and a second adjacent coefficient, and in response to the level value of the coefficient currently being encoded being less than the predicted level value, encode the syntax element to have a value equal to the level value of the coefficient currently being encoded. In other instances, video encoder 200 can determine a predicted level value of the coefficient currently being encoded based on the values of a first adjacent coefficient and a second adjacent coefficient, and in response to the level value of the coefficient currently being encoded being greater than the predicted level value, encode the syntax element to have a value equal to the level value of the coefficient currently being encoded minus one.
[0099] The operation of video decoder 300 for deriving the value of absCoeff can be shown by the following pseudocode:
[0100]
[0101] For example, the video decoder 300 can determine a predicted level value of a coefficient currently being decoded based on values of a first neighboring coefficient and a second neighboring coefficient, receive a syntax element indication, and in response to the syntax element having a value equal to one, determine that the level value of the coefficient currently being decoded is equal to the predicted level value. In other instances, the video decoder 300 can determine a predicted level value of a coefficient currently being decoded based on values of a first neighboring coefficient and a second neighboring coefficient, receive a syntax element indication, and in response to the value of the syntax element being greater than the predicted level value, determine that the level value of the coefficient currently being decoded is equal to the value of the syntax element plus one. In other instances, the video decoder 300 can determine a predicted level value of a coefficient currently being decoded based on values of a first neighboring coefficient and a second neighboring coefficient, receive a syntax element indication, and in response to the value of the syntax element being less than the predicted level value, determine that the level value of the coefficient currently being decoded is equal to the value of the syntax element.
[0102] In some examples, the video encoder 200 and the video decoder 300 determine or derive a context of a syntax element identified herein as abs_level_gt1_flag based on whether a left neighboring coefficient value and an upper neighboring coefficient value are zero. The syntax element abs_level_gt1_flag is a syntax element used to decode a coefficient value. A value of abs_level_gt1_flag equal to 1 can, for example, indicate that an absolute level of the coefficient is greater than 1. A value of abs_level_gt1_flag equal to 0 can, for example, indicate that the absolute level of the coefficient is not greater than 1.
[0103] In one example, the context can be one of multiple (e.g., three) different contexts. For a case where both the left neighboring coefficient and the upper neighboring coefficient have non-zero values, one context can be derived. For a case where only one of the left neighboring coefficient or the upper neighboring coefficient has a non-zero value, another context can be derived. For a case where both the left neighboring coefficient and the upper neighboring coefficient have zero values, a third context can be derived. In one example, this context derivation is only applied to non-BDPCM (block differential pulse code modulation) modes.
[0104] In some examples, for a decoding scenario with non-existent or unavailable neighbor values (e.g., when the coefficient being decoded is on the left boundary of a block and the left neighbor does not exist), the video encoder 200 and the video decoder 300 can be configured to use zero values when deriving the context.
[0105] In some examples, the context derivation can be described as follows:
[0106]
[0107] In such an example, for non-existent / unavailable neighbor values (e.g., the left neighbor of the value on the left boundary of a block), the video encoder 200 and the video decoder 300 may be configured to use a zero value for the unavailable value when deriving the context.
[0108] Figure 4 is a block diagram showing an exemplary video encoder 200 that may implement the techniques of the present disclosure. Provided Figure 4 For purposes of explanation, it should not be considered a limitation of the techniques widely illustrated and described in the present disclosure. For illustrative purposes, the present disclosure describes the video encoder 200 in the context of video coding standards such as the HEVC (H.265) video coding standard and the VVC (H.266) under development. However, the techniques of the present disclosure are not limited to these video coding standards and generally apply to video coding and decoding.
[0109] In Figure 4 the example of, the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filtering unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any one or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filtering unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or in processing circuitry. Additionally, the video encoder 200 may include additional or alternative processors or processing circuitry to perform these and other functions.
[0110] The video data memory 230 may store video data to be encoded by components of the video encoder 200. The video encoder 200 may receive the video data from, for example, a video source 104 ( Figure 1)Receives the video data stored in the video data memory 230. The DPB 218 can act as a reference picture memory that stores reference video data for use by the video encoder 200 in predicting subsequent video data. The video data memory 230 and the DPB 218 can be formed by any one of a variety of storage devices (e.g., dynamic random access memory (DRAM) (which includes synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of storage devices). The video data memory 230 and the DPB 218 can be provided by the same storage device or different storage devices. In various examples, the video data memory 230 can be on-chip with other components of the video encoder 200, as shown, or off-chip relative to those components.
[0111] In the present disclosure, a reference to the video data memory 230 should not be construed as being limited to a memory internal to the video encoder 200 (unless so specifically described), nor should it be construed as being limited to a memory external to the video encoder 200 (unless so specifically described). Rather, a reference to the video data memory 230 should be understood as a reference memory that stores video data, where the video encoder 200 receives the video data (e.g., the video data of the current block to be encoded) for encoding. Figure 1 The memory 106 can also provide temporary storage of the outputs from the various units of the video encoder 200.
[0112] illustrates Figure 4 the various units to aid in understanding the operations performed by the video encoder 200. These units can be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide a specific function and are pre-set in terms of the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in terms of the operations that can be performed. For example, a programmable circuit can execute software or firmware that causes the programmable circuit to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuits can execute software instructions (e.g., for receiving parameters or outputting parameters), but the type of operations performed by fixed-function circuits is generally immutable. In some examples, one or more of these units can be different circuit blocks (fixed-function or programmable), and in some examples, the one or more units can be integrated circuits.
[0113] The video encoder 200 can include an arithmetic logic unit (ALU), a basic function unit (EFU), digital circuits, analog circuits, and / or programmable cores formed by programmable circuits. In examples where software executed by programmable circuits is used to perform the operations of the video encoder 200, the memory 106 (Figure 1 ) It can store the object code of the software received and executed by the video encoder 200, or another memory (not shown) in the video encoder 200 can store such instructions.
[0114] The video data memory 230 is configured to store the received video data. The video encoder 200 can 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 can be the original video data to be encoded.
[0115] 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 other functional units to perform video prediction according to other prediction modes. For example, the mode selection unit 202 may include a palette unit, a 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, and so on.
[0116] The mode selection unit 202 generally coordinates multiple encoding channels to test combinations of encoding parameters and the final rate-distortion values for such combinations. The encoding parameters may include: the partitioning of CTUs into CUs, the prediction mode for the CUs, the transform type for the residual data of the CUs, the quantization parameter for the residual data of the CUs, and so on. The mode selection unit 202 can ultimately select the combination of encoding parameters that has a better rate-distortion value than other tested combinations.
[0117] The video encoder 200 can divide the pictures retrieved from the video data memory 230 into a series of CTUs and encapsulate one or more CTUs in a segment. The mode selection unit 202 can divide the CTUs of the pictures according to a tree structure (e.g., the QTBT structure or the quadtree structure of HEVC described above). As described above, the video encoder 200 can form one or more CUs by dividing the CTUs according to the tree structure. Such CUs are usually also referred to as "video blocks" or "blocks".
[0118] Typically, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a prediction block for a current block (e.g., a current CU, or in HEVC, the overlapping part of a PU and a TU). For inter prediction of the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks in one or more reference pictures (e.g., one or more previously encoded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate values representing how similar a potential reference block is to the current block, for example, according to the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 typically may perform these calculations using the sample-by-sample differences between the current block and the reference block under consideration. The motion estimation unit 222 may identify the reference block having the minimum value resulting from these calculations, which indicates the reference block that most closely matches the current block.
[0119] The motion estimation unit 222 may form one or more motion vectors (MVs), which define the position of the reference block in the reference picture relative to the current block in the current picture. Then, the motion estimation unit 222 may provide the motion vectors to the motion compensation unit 224. For example, for uni-directional inter prediction, the motion estimation unit 222 may provide a single motion vector, and for bi-directional inter prediction, the motion estimation unit 222 may provide two motion vectors. Then, the motion compensation unit 224 may use the motion vectors to generate a prediction block. For example, the motion compensation unit 224 may use the motion vectors to retrieve the data of the reference block. As another example, if the motion vectors have fractional sampling precision, the motion compensation unit 224 may interpolate the values for the prediction block according to one or more interpolation filters. In addition, for bi-directional inter prediction, the motion compensation unit 224 may retrieve the data of the two reference blocks identified by the corresponding motion vectors and combine the retrieved data, for example, by sample-by-sample averaging or weighted averaging.
[0120] As another example, for intra prediction or intra prediction coding, the intra prediction unit 226 may generate a prediction block according to the samples adjacent to the current block. For example, for the directional mode, the intra prediction unit 226 may typically mathematically combine the values of the adjacent samples and fill the current block with these calculated values along a defined direction to produce a prediction block. As another example, for the DC mode, the intra prediction unit 226 may calculate the average value of the adjacent samples of the current block and generate a prediction block to include this resulting average value for each sample of the prediction block.
[0121] The mode selection unit 202 provides a prediction block to the residual generation unit 204. The residual generation unit 204 receives the original unencoded version of the current block from the video data memory 230 and receives the prediction block from the mode selection unit 202. The residual generation unit 204 calculates the sample-by-sample difference between the current block and the prediction block. The resulting sample-by-sample difference defines the residual block of the current block. In some examples, the residual generation unit 204 may also determine the differences between the sample values in the residual block to generate the residual block using residual differential pulse code modulation (RDPCM). In some examples, one or more subtractor circuits that perform binary subtraction may be used to form the residual generation unit 204.
[0122] In an example where the mode selection unit 202 divides a CU into PUs, each PU may be associated with a luminance prediction unit and a corresponding chrominance prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As described above, the size of a CU may refer to the size of the luminance decoding block of the CU, and the size of a PU may refer to the size of the luminance prediction unit of the PU. Assuming that the size of a particular CU is 2Nx2N, the video encoder 200 may support PU sizes of 2Nx2N or NxN for intra prediction and support symmetric PU sizes such as 2Nx2N, 2NxN, Nx2N, NxN, etc. for inter prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitions with PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter prediction.
[0123] In an example where the mode selection unit does not further divide a CU into PUs, each CU may be associated with a luminance decoding block and a corresponding chrominance decoding block. As described above, the size of a CU may refer to the size of the luminance decoding block of the CU. The video encoder 200 and the video decoder 300 may support CU sizes of 2Nx2N, 2NxN, or Nx2N.
[0124] For other video decoding techniques (e.g., intra block copy mode coding, affine mode coding, and linear model (LM) mode coding, to name a few), the mode selection unit 202 generates a prediction block for the current block being encoded via respective units associated with the decoding technique. In some examples (e.g., palette mode coding), the mode selection unit 202 may not generate a prediction block but instead generate syntax elements that indicate the way to reconstruct the block based on the selected palette. In such a mode, the mode selection unit 202 may provide these syntax elements to the entropy coding unit 220 for encoding.
[0125] As described above, the residual generation unit 204 receives the video data of the current block and the corresponding predicted block. Then, the residual generation unit 204 generates a residual block of the current block. To generate the residual block, the residual generation unit 204 calculates the per-sample difference between the predicted block and the current block.
[0126] The 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"). The transform processing unit 206 can apply various transforms to the residual block to form a transform coefficient block. For example, the transform processing unit 206 can 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, the transform processing unit 206 can perform multiple transforms on the residual block (e.g., a primary transform and a secondary transform (such as a rotation transform)). In some examples, the transform processing unit 206 does not apply a transform to the residual block. In such an instance, the transform processing unit 206 can output a coefficient block, where the coefficients correspond to the residual values rather than transform coefficients.
[0127] The quantization unit 208 can quantize the transform coefficients in the transform coefficient block to produce a quantized transform coefficient block. For blocks decoded in transform skip mode, the quantization unit 208 can quantize the coefficients in the coefficient block to produce a quantized coefficient block. The quantization unit 208 can quantize the coefficients or transform coefficients according to the quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) can 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 precision of the quantized coefficients or transform coefficients may be lower than the precision of the original coefficients or transform coefficients generated by the transform processing unit 206.
[0128] The inverse quantization unit 210 and the inverse transform processing unit 212 can apply inverse quantization and inverse transform to the quantized coefficient block, respectively, to reconstruct the residual block according to the coefficient block. The reconstruction unit 214 can generate a reconstructed block corresponding to the current block (although there may be a certain degree of distortion) based on the reconstructed residual block and the predicted block generated by the mode selection unit 202. For example, the reconstruction unit 214 can add the samples of the reconstructed residual block to the corresponding samples in the predicted block generated by the mode selection unit 202 to generate the reconstructed block.
[0129] The filtering unit 216 can perform one or more filtering operations on the reconstructed block. For example, the filtering unit 216 can perform a deblocking operation to reduce blocky artifacts along the edges of the CU. In some examples, the operation of the filtering unit 216 can be skipped.
[0130] Video encoder 200 stores the reconstructed blocks in DPB 218. For example, in an example where the operations of filtering unit 216 are not performed, reconstruction unit 214 may store the reconstructed blocks into DPB 218. In an example where the operations of filtering unit 216 are performed, filtering unit 216 may store the filtered reconstructed blocks into DPB 218. Motion estimation unit 222 and motion compensation unit 224 may retrieve reference pictures from DPB 218, which are formed by the reconstructed (and possibly filtered) blocks, for inter prediction of subsequently encoded pictures. Additionally, intra prediction unit 226 may use the reconstructed blocks in DPB 218 of the current picture to perform intra prediction on other blocks in the current picture.
[0131] Generally, entropy coding unit 220 may perform entropy coding on syntax elements received from other functional components of video encoder 200. For example, entropy coding unit 220 may perform entropy coding on the quantized coefficient blocks from quantization unit 208. As another example, entropy coding unit 220 may perform entropy coding on the prediction syntax elements from mode selection unit 202 (e.g., motion information for inter prediction or intra mode information for intra prediction). Entropy coding unit 220 may perform one or more entropy coding operations on the syntax elements as another example of video data to generate entropy coded data. For example, entropy coding unit 220 may perform context adaptive variable length coding (CAVLC) operations, CABAC operations, variable-to-variable (V2V) length coding operations, syntax-based context adaptive binary arithmetic coding (SBAC) operations, probability interval partitioning entropy (PIPE) coding operations, exponential Golomb coding operations, or another type of entropy coding operation on the data. In some examples, entropy coding unit 220 may operate in a bypass mode where it does not perform entropy coding on the syntax elements.
[0132] Video encoder 200 may output a bitstream that includes the entropy coded syntax elements needed to reconstruct the blocks of a segment or picture. Specifically, entropy coding unit 220 may output the bitstream.
[0133] The operations described above are described with respect to blocks. Such a description should be understood as applying to the operations of the luminance decoding blocks and / or chrominance decoding blocks. As described above, in some examples, the luminance decoding blocks and chrominance decoding blocks are the luminance and chrominance components of a CU. In some examples, the luminance decoding blocks and chrominance decoding blocks are the luminance and chrominance components of a PU.
[0134] In some examples, it is not necessary to repeat the operations performed for a luma coding block for a chroma coding block. For example, it is not necessary to repeat the operations for identifying the motion vector (MV) and reference picture for a luma coding block to identify the MV and reference picture for a chroma block. Instead, the MV used for a luma coding block can be scaled to determine the MV for a chroma block, and the reference picture can be the same. As another example, for both luma coding blocks and chroma coding blocks, the intra prediction processing can be the same.
[0135] Video encoder 200 represents an example of a device for encoding video data, the device including a memory configured to store video data, and one or more processing units implemented in circuitry and configured to perform the following operations: for a residual block encoded using a transform skip mode of the video data, determine the value of a first neighboring coefficient for a coefficient currently being encoded; determine the value of a second neighboring coefficient for the coefficient currently being encoded; based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, determine a context offset for the coefficient currently being encoded; and based on the determined context offset, encode the value of the coefficient currently being encoded. For example, the first neighboring coefficient can be one of the upper neighboring coefficient or the left neighboring coefficient, and the second neighboring coefficient can be the other of the upper neighboring coefficient or the left neighboring coefficient.
[0136] To encode the value of the coefficient currently being encoded based on the determined context offset, video encoder 200 can be configured to: determine a context based on the determined context offset; determine the sign of the coefficient currently being encoded; and based on the determined context, perform context encoding on one or more bins to represent the sign of the coefficient currently being encoded. Video encoder 200 can be configured to: quantize the residual value of a residual block of the video data to determine the value of the coefficient currently being encoded. Video encoder 200 can be configured to: determine a prediction block and compare the prediction block with the original block of the video data to determine the residual block of the video data.
[0137] To determine the context offset of the coefficient currently being encoded based on the values of the first neighboring coefficient and the second neighboring coefficient, video encoder 200 may be configured to: select a context offset from three available context offsets based on the values of the first neighboring coefficient and 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 zero or have opposite signs; a second context offset for when both the first neighboring coefficient and the second neighboring coefficient are positive, or when one of the first neighboring coefficient and the second neighboring coefficient is equal to zero 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 when one of the first neighboring coefficient and the second neighboring coefficient is equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient is negative.
[0138] To determine the context offset of the coefficient currently being encoded based on the values of the first neighboring coefficient and the second neighboring coefficient, video encoder 200 may be configured to: set the context offset value to a first offset value in response to the value of the first neighboring coefficient being equal to zero and the value of the second neighboring coefficient being equal to zero. To determine the context offset of the coefficient currently being encoded based on the values of the first neighboring coefficient and the second neighboring coefficient, video encoder 200 may be configured to: set the context offset value to a first offset value in response to the value of the first neighboring coefficient being one of greater than zero or less than zero, and the value of the second neighboring coefficient being the other of greater than zero or less than zero.
[0139] To determine the context offset of the coefficient currently being encoded based on the values of the first neighboring coefficient and the second neighboring coefficient, video encoder 200 may be configured to: set the context offset value to a first offset value in response to the values of the first neighboring coefficient and the second neighboring coefficient both being non-zero values and having opposite signs. To determine the context offset of the coefficient currently being encoded based on the values of the first neighboring coefficient and the second neighboring coefficient, video encoder 200 may be configured to: set the context offset value to a second offset value in response to the value of the first neighboring coefficient being greater than or equal to zero and the value of the second neighboring coefficient being greater than or equal to zero, where at least one of the value of the first neighboring coefficient or the value of the second neighboring coefficient is greater than or equal to one.
[0140] To determine a context offset for a currently encoded coefficient based on values of a first neighboring coefficient and a second neighboring coefficient, video encoder 200 may be configured to: in response to both the value of the first neighboring coefficient and the value of the second neighboring coefficient being non-negative values, set the context offset value to a second offset value. To determine a context offset for a currently encoded coefficient based on values of a first neighboring coefficient and a second neighboring coefficient, video encoder 200 may be configured to: in response to the value of the first neighboring coefficient being less than or equal to zero and the value of the second neighboring coefficient being less than or equal to zero, set the context offset value to a third offset value, where either the value of the first neighboring coefficient or the value of the second neighboring coefficient is less than or equal to -1. The first offset value, the second offset value, and the third offset value may be, for example, different offset values. The context offset is a value used to determine a context. Thus, the first offset value, the second offset value, and the third offset value may be considered to identify or refer to three different contexts.
[0141] Video encoder 200 also represents an example of a device configured to encode video data, the device including a memory configured to store the video data, and one or more processing units implemented using circuitry, the one or more processing units being configured to: determine an absolute coefficient level of a first neighboring coefficient of a currently encoded coefficient for a residual block encoded using a transform skip mode of the video data; determine an absolute coefficient level of a second neighboring coefficient of the currently encoded coefficient; determine an absolute coefficient level of the currently encoded coefficient; and encode one or more syntax elements indicating the absolute coefficient level of the currently encoded coefficient based on the absolute coefficient level of the first neighboring coefficient and the absolute coefficient level of the second neighboring coefficient. For example, video encoder 200 may quantize residual values of a residual block of the video data to determine the value of the currently encoded coefficient.
[0142] In some examples, video encoder 200 may be configured to: determine a prediction value level based on the absolute coefficient level of the first neighboring coefficient and the absolute coefficient level of the second neighboring coefficient; and encode the syntax element using a first value of a syntax element indicating that the prediction value level is equal to the absolute coefficient level of the currently encoded coefficient, and a second value of a syntax element indicating that the prediction value level is not equal to the absolute coefficient level of the currently encoded coefficient. In some examples, video encoder 200 may be configured to: determine a prediction value level based on the absolute coefficient level of the first neighboring coefficient and the absolute coefficient level of the second neighboring coefficient; determine a value for the syntax element based on the prediction value level and the absolute coefficient level of the currently encoded coefficient; and encode the syntax element. To determine the prediction value level, video encoder 200 may be configured to: set the prediction value level to the larger of the absolute coefficient level of the first neighboring coefficient or the absolute coefficient level of the second neighboring coefficient.
[0143] Figure 5 is a block diagram showing an exemplary video decoder 300 that can perform the techniques of the present disclosure. Provided Figure 5 for purposes of explanation, it should not be considered a limitation of the techniques widely illustrated and described in the present disclosure. For purposes of illustration, the present disclosure describes a video decoder 300 for techniques according to JEM, VVC, and HEVC. However, the techniques of the present disclosure can be performed by a video coding device configured to implement other video coding standards.
[0144] In Figure 5 an example, 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 filtering unit 312, and a decoded picture buffer (DPB) 314. Any one 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 filtering unit 312, and the DPB 314 can be implemented in one or more processors or in processing circuitry. Additionally, the video decoder 300 can include additional or alternative processors or processing circuitry to perform these and other functions.
[0145] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 can include other units for performing prediction according to other prediction modes. By way of example, the prediction processing unit 304 can include a palette unit, a block copy unit (which can form part of the motion compensation unit 316), an affine unit, a linear model (LM) unit, and so on. In other examples, the video decoder 300 can include more, fewer, or different functional components.
[0146] The CPB memory 320 can store video data (e.g., a coded video bitstream) to be decoded by components of the video decoder 300. For example, it can be obtained from a computer-readable medium 110 ( Figure 1)Obtain the video data stored in the CPB memory 320. The CPB memory 320 may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Moreover, the CPB memory 320 may store video data other than the syntax elements of the encoded pictures, such as temporary data representing the outputs of the respective units of the video decoder 300. The DPB 314 generally stores decoded pictures, and the video decoder 300 may output and / or use the decoded pictures 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 of any of various storage devices such as DRAM, SDRAM, MRAM, RRAM, or other types of storage devices. The CPB memory 320 and the DPB 314 may be provided by the same storage device or different storage 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 those components.
[0147] Additionally or alternatively, in some examples, the video decoder 300 may retrieve decoded video data from the memory 120( Figure 1 ). That is, the memory 120 may store data as discussed above with reference to the CPB memory 320. Similarly, when some or all of the functions of the video decoder 300 are implemented using software executed by the processing circuitry of the video decoder 300, the memory 120 may store instructions to be executed by the video decoder 300.
[0148] Illustrates Figure 5 the respective units to assist in understanding the operations performed by the video decoder 300. These units may be implemented as fixed-function circuitry, programmable circuitry, or a combination thereof. Similar to Figure 4 , fixed-function circuitry refers to circuitry that provides a specific function and is pre-set in terms of the operations it can perform. Programmable circuitry refers to circuitry that can be programmed to perform various tasks and provides flexible functionality in terms of the operations it can perform. For example, programmable circuitry may execute software or firmware that causes the programmable circuitry to operate in a manner defined by the instructions of the software or firmware. Fixed-function circuitry may execute software instructions (e.g., for receiving parameters or outputting parameters), but the type of operations performed by the fixed-function circuitry is generally immutable. In some examples, one or more of these units may be different circuit blocks (fixed-function or programmable), and in some examples, the one or more units may be integrated circuits.
[0149] Video decoder 300 may include an ALU, an EFU, digital circuits, analog circuits, and / or programmable cores formed by programmable circuits. In an example where the operations of video decoder 300 are performed by software executed on programmable circuits, on-chip or off-chip memory may store instructions (e.g., object code) of the software that video decoder 300 receives and executes.
[0150] Entropy decoding unit 302 may receive encoded video data from the CPB and perform entropy decoding on the video data to reproduce syntax elements. Prediction processing unit 304, inverse quantization unit 306, inverse transform processing unit 308, reconstruction unit 310, and filtering unit 312 may generate decoded video data based on the syntax elements extracted from the bitstream.
[0151] Generally, video decoder 300 reconstructs pictures on a block-by-block basis. Video decoder 300 may perform a reconstruction operation on each block individually (where the block currently being reconstructed (i.e., decoded) may be referred to as the "current block").
[0152] Entropy decoding unit 302 may perform entropy decoding on the syntax elements that define the quantization coefficients of the quantized coefficient block and transform information such as quantization parameter (QP) and / or transform mode indication. Inverse quantization unit 306 may use the QP associated with the quantized coefficient block to determine the degree of quantization and, similarly, determine the degree of inverse quantization to be applied by inverse quantization unit 306. For example, inverse quantization unit 306 may perform a left shift operation by bits to inverse-quantize the transform coefficients. Inverse quantization unit 306 may thereby form a coefficient block including the coefficients.
[0153] After inverse quantization unit 306 forms a coefficient block for the block that has been transformed, inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, inverse transform processing unit 308 may apply an inverse DCT, inverse integer transform, inverse Karhunen-Loeve transform (KLT), inverse rotation transform, inverse direction transform, or another inverse transform to these transform coefficient blocks. For blocks decoded in transform skip mode, inverse transform processing unit 308 may not perform an inverse transform and, in these decoding scenarios, may be regarded as a pass-through unit that does not process or change the coefficient block.
[0154] In addition, the prediction processing unit 304 generates a prediction block based on the prediction information syntax element entropy decoded by the entropy decoding unit 302. For example, if the prediction information syntax element indicates that the current block is inter prediction, the motion compensation unit 316 can generate a prediction block. In this case, the prediction information syntax element can indicate the reference picture in the DPB 314 from which the reference block is retrieved, and the motion vector that identifies the position of the reference block in the reference picture relative to the current block in the current picture. The motion compensation unit 316 can generally perform the inter prediction processing in a manner substantially similar to the manner described with respect to the motion compensation unit 224 ( Figure 4 ).
[0155] As another example, if the prediction information syntax element indicates that the current block is intra prediction, the intra prediction unit 318 can generate a prediction block according to the intra prediction mode indicated by the prediction information syntax element. Again, the intra prediction unit 318 can generally perform the intra prediction processing in a manner substantially similar to the manner described with respect to the intra prediction unit 226 ( Figure 4 ). The intra prediction unit 318 can retrieve data of adjacent samples of the current block from the DPB 314.
[0156] The reconstruction unit 310 can use the prediction block and the residual block to reconstruct the current block. For example, the reconstruction unit 310 can add the samples of the residual block to the corresponding samples of the prediction block to reconstruct the current block.
[0157] The filtering unit 312 can perform one or more filtering operations on the reconstructed block. For example, the filtering unit 312 can perform a deblocking operation to reduce blocking artifacts along the edges of the reconstructed block. The operation of the filtering unit 312 is not necessarily performed in all examples.
[0158] The video decoder 300 can store the reconstructed block in the DPB 314. For example, in an example where the operation of the filtering unit 312 is not performed, the reconstruction unit 310 can store the reconstructed block in the DPB 314. In an example where the operation of the filtering unit 312 is performed, the filtering unit 312 can store the filtered reconstructed block in the DPB 314. As described above, the DPB 314 can provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 can output the decoded picture from the DPB for subsequent presentation on a display device such as Figure 1 the display device 118.
[0159] Video decoder 300 represents an example of a video decoding device that includes a memory configured to store video data, and one or more processing units implemented in circuitry and configured to perform the following operations: for a residual block encoded using a transform skip mode of the video data, determine a value of a first neighboring coefficient for a coefficient currently being decoded; determine a value of a second neighboring coefficient for the coefficient currently being decoded; determine a context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; and decode the value of the coefficient currently being decoded based on the determined context offset. For example, the first neighboring coefficient can be one of an upper neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient can be the other of the upper neighboring coefficient or the left neighboring coefficient. As described above, for a residual block decoded using a transform skip mode, the coefficient value can correspond to a residual value, e.g., a quantized residual value or a non-quantized residual value.
[0160] To decode the value of the coefficient currently being decoded based on the determined context offset, video decoder 300 can be configured to: determine a context based on the determined context offset; receive one or more bins; and context decode the one or more bins based on the determined context to determine a sign of the coefficient currently being decoded. Video decoder 300 can be configured to: inverse quantize the value of the coefficient currently being decoded to determine a residual value of a residual block of the video data. Video decoder 300 can be configured to: determine a decoded residual block based on the value of the coefficient currently being decoded; add the decoded residual block to a prediction 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.
[0161] To determine the context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, video decoder 300 can be configured to: select a context offset from three available context offsets based on the value of the first neighboring coefficient and the value of the second neighboring coefficient. The three available context offsets can include: a first context offset when both the first neighboring coefficient and the second neighboring coefficient are equal to zero or have opposite signs; a second context offset 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 zero and the other of the first neighboring coefficient and the second neighboring coefficient is positive; and a third context offset 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 zero and the other of the first neighboring coefficient and the second neighboring coefficient is negative.
[0162] To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the value of the first neighboring coefficient being equal to zero and the value of the second neighboring coefficient being equal to zero, set the context offset value to a first offset value. To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the value of the first neighboring coefficient being one of greater than zero or less than zero, and the value of the second neighboring coefficient being the other of greater than zero or less than zero, set the context offset value to a first offset value. To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the values of the first neighboring coefficient and the second neighboring coefficient both being non-zero values and having opposite signs, set the context offset value to a first offset value.
[0163] To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the value of the first neighboring coefficient being greater than or equal to zero and the value of the second neighboring coefficient being greater than or equal to zero, set the context offset value to a second offset value, where at least one of the value of the first neighboring coefficient or the value of the second neighboring coefficient is greater than or equal to one. To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the values of the first neighboring coefficient and the second neighboring coefficient both being non-negative values, set the context offset value to a second offset value. To determine the context offset of the coefficient currently being decoded based on the values of the first neighboring coefficient and the second neighboring coefficient, the video decoder 300 may be configured to: in response to the value of the first neighboring coefficient being less than or equal to zero and the value of the second neighboring coefficient being less than or equal to zero, set the context offset value to a third offset value, where the value of the first neighboring coefficient or the value of the second neighboring coefficient is less than or equal to minus one (-1).
[0164] The video decoder 300 also represents an example of a video decoding device that includes a memory configured to store video data, and one or more processing units implemented using circuitry, the one or more processing units being configured to: for a residual block encoded using a transform skip mode of the video data, determine the absolute coefficient level of the first neighboring coefficient of the coefficient currently being decoded; determine the absolute coefficient level of the second neighboring coefficient of the coefficient currently being decoded; determine the absolute coefficient level of the coefficient currently being decoded based on the absolute coefficient level of the first neighboring coefficient and the absolute coefficient level of the second neighboring coefficient. For example, the video decoder 300 may inverse quantize the coefficient currently being decoded to determine the residual value of the residual block of the video data.
[0165] To determine the absolute coefficient level of the coefficient currently being decoded, video decoder 300 may be configured to: determine a predictor level based on the absolute coefficient levels of a first neighboring coefficient and a second neighboring coefficient; receive a syntax element, wherein a first value for the syntax element indicates that the predictor level is equal to the absolute coefficient level of the coefficient currently being decoded, and a second value for the syntax element indicates that the predictor level is not equal to the absolute coefficient level of the coefficient currently being decoded. To determine the absolute coefficient level of the coefficient currently being decoded, video decoder 300 may be configured to: determine a predictor level based on the absolute coefficient levels of a first neighboring coefficient and a second neighboring coefficient; receive a syntax element; and determine the absolute coefficient level of the coefficient currently being decoded based on the predictor level and the syntax element. To determine the predictor level, video decoder 300 may set the predictor level to the larger of the absolute coefficient levels of the first neighboring coefficient or the second neighboring coefficient.
[0166] Figure 6A and 6B shows an example of the CABAC process at bin n. In Figure 6A example 400, the range at bin n includes RangeMPS and RangeLPS given by the probability (p σ ) of the least probable symbol (LPS) when given a particular context state (σ). Example 400 shows the update of the range at bin n+1 when the value of bin n is equal to the most probable symbol (MPS). In this example, the lower value of the range remains unchanged, but the range value at bin n+1 is reduced to the value of RangeMPS at bin n. Figure 6B Example 402 of
[0167] shows the update of the range at bin n+1 when the value of bin n is not equal to MPS (i.e., equal to LPS). In this example, the lower value of the range moves to the lower range value of RangeLPS at bin n. Additionally, the range value at bin n+1 is reduced to the value of RangeLPS at bin n. Figure 7Shows examples of range - dependent BAC outputs. For example, when the range and the lower value are higher than a certain threshold (e.g., 512), a '1' is output to the bitstream. When the range and the lower value are lower than a certain threshold (e.g., 512), a '0' is output to the bitstream. When the range and the lower value are between specific thresholds, nothing is output to the bitstream. Instead, the BO value is incremented and the next bin is encoded.
[0168] In the CABAC context model of H.264 / AVC and in some examples of HEVC, there are 128 states. There are 64 possible LPS probabilities (represented by state σ), which can range from 0 to 63. Each MPS can be zero or one. Thus, the 128 states are 64 state probabilities multiplied by the 2 possible values of MPS (0 or 1). Therefore, the state can be indexed with 7 bits.
[0169] To reduce the computational complexity of deriving the LPS range (rangeLPS σ ), the results for all cases can be pre - calculated and stored as approximations in a lookup table. Thus, the LPS range can be obtained by using a simple table lookup without any multiplication. Avoiding multiplication can be important for some devices or applications because this operation can cause significant latency in many hardware architectures.
[0170] A 4 - column pre - calculated LPS range table can be used instead of multiplication. The range is divided into four segments. The segment index can be derived by (range>>6)&3. In fact, the segment index is derived by shifting and removing bits from the actual range. Table 1 below shows the possible ranges and their corresponding indices.
[0171] Table 1 - Range Index
[0172] Range 256-319 320-383 384-447 448-511 (range >> 6) & 3 0 1 2 3
[0173] The LPS range table then has 64 entries (one entry for each probability state) multiplied by 4 (one for each range index). Each entry is RangeLPS, which is the value of the range multiplied by the LPS probability. An example of a part of this table is shown in Table 2 below. Table 2 describes probability states 9 - 12. In a proposal for HEVC, the range of probability states can be from 0 to 63.
[0174] Table 2 - RangeLPS
[0175]
[0176] In each segment (i.e., range value), the LPS range for each probability state σ is predefined. In other words, the LPS range for probability state σ is quantized into four values (i.e., one value for each range index). The specific 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 table columns (i.e., the number of possible LPS range values) and the LPS range precision. Generally, more columns result in less quantization error for the LPS range values, but also increase the need to use more memory to store the table. Fewer columns increase the quantization error, but also reduce the memory required to store the table.
[0177] As described above, each LPS probability state has a corresponding probability. The probability p for each state is derived as follows:
[0178] p σ = αp σ-1
[0179] where the 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 / 63 . The probability of state σ = 0 is equal to 0.5 (i.e., p0 = 1 / 2). That is, in context state 0, the probabilities of LPS and MPS are equal. The probability of each successive state is derived by multiplying the previous state by α. Thus, the probability that LPS occurs in context state α = 1 is p0 * 0.9493 (0.5 * 0.9493 =.47465). Therefore, as the state index α increases, the probability of LPS occurring decreases.
[0180] CABAC is adaptive because the probability states are updated to follow the signal statistics (i.e., the values of the previously decoded bins). The update process is as follows. For a given probability state, the update depends on the state index and the value of the coded symbol identified as LPS or MPS. As a result of the update process, a new probability state is derived, which includes a potentially modified LPS probability estimate and a modified MPS value (if needed).
[0181] When the bin value is equal to MPS, the given state index can be incremented by 1. This applies to all states, except when MPS occurs at state index 62, where the LPS probability is already at its minimum value (or equivalently, the maximum MPS probability is reached). In this case, state index 62 remains fixed until an LPS is seen, or until the last bin value is encoded (state 63 is used for the special case of the last bin value). When an LPS occurs, the state index is changed by decrementing it by a certain amount, as shown in the equation below. This rule generally applies to every occurrence of LPS, but with the following exceptions. Suppose an LPS has been encoded in the state at index σ = 0, which corresponds to the equiprobable case. The state index remains fixed, but the MPS value will be switched so that the values of LPS and MPS will be interchanged. In all other cases, regardless of which symbol is encoded, the MPS value does not change. The derivation of the transition rules for the LPS probability is based on the following relationship between the given LPS probability p 旧 and its updated counterpart p 新 :
[0182] If MPS occurs, p 新 = max(αp 旧 , p 62 )
[0183] If LPS occurs, p 新 = (1 - α) + αp 旧
[0184] Regarding the actual implementation of the probability estimation process in CABAC, it is important to note that all transition rules can be implemented with at most two tables, each having 63 6-bit unsigned integer values. In some examples, a single table TransIdxLPS can be used to determine the state transition, where for a given state index σ, the table TransIdxLPS determines the new updated state index TransIdxLPS[σ] upon observing an LPS. The MPS-driven transition can be obtained by simply (saturating) incrementing the state index by a fixed value of 1, resulting in the updated state index min(σ + 1, 62). Table 3 below is an example of a partial TransIdxLPS table.
[0185] Table 3 - TransIdxLPS
[0186] Probability state (σ) New state TransIdxLPS[σ] … … 9 6 10 8 11 8 12 8 … …
[0187] As described above regarding Figure 6A , 6B and Figure 7The described technique represents only an exemplary implementation of CABAC. It should be understood that the techniques of the present disclosure are not limited to the described implementation of CABAC. For example, in older BAC methods (e.g., the BAC method used in H.264 / AVC), the RangeLPS and TransIdxLPS tables were adjusted for low-resolution video (i.e., Common Intermediate Format (CIF) and Quarter CIF (QCIF) video). With HEVC and future codecs (e.g., VVC), a large amount of video content is high definition (HD), and in some cases higher than HD. Video content at HD or higher than HD resolution tends to have different statistics than the 10-year-old QCIF sequences used to develop H.264 / AVC. Thus, the RangeLPS and TransIdxLPS tables from H.264 / AVC may cause adaptation between states in an overly rapid manner. That is, the transitions between probability states (especially when an LPS occurs) may be too large for smoother, higher-resolution HD video content. Therefore, the probability models used according to conventional techniques may not be as accurate for HD and ultra-HD content. Additionally, since HD video content includes a larger range of pixel values, the H.264 / AVC tables do not contain enough entries to account for the more extreme values that may be present in HD content.
[0188] Thus, for HEVC and future coding standards such as VVC, the RangeLPS and TransIdxLPS tables can be modified to account for the characteristics of this new content. Specifically, the BAC process for HEVC and future coding standards can use tables that allow for a slower adaptation process and may account for more extreme cases (i.e., skewed probabilities). Thus, as an example, the RangeLPS and TransIdxLPS tables can be modified to achieve these goals by including more probability states and ranges compared to the probability states and ranges used in BAC with H.264 / AVC or HEVC.
[0189] Figure 8 is, for example, formed as Figure 4Block diagram of an exemplary entropy coding unit 220 of a portion of the video encoder 200 shown in [reference], which may be configured to perform CABAC according to the techniques of the present disclosure. A syntax element 418 is input into the entropy coding unit 220. If the syntax element is already a binary-valued syntax element (i.e., a syntax element with only values 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 binary decision sequence. These binary decisions are typically 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 a certain value. For example, bin 0 (sometimes referred to as the 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, and so on. A unique mapping may be developed for each non-binary-valued syntax element.
[0190] Each bin generated by the binarizer 420 is fed to the binary arithmetic decoding end of the entropy coding unit 220. That is, for a predetermined set of non-binary-valued syntax elements, each bin type (e.g., bin 0) is decoded before the next bin type (e.g., bin 1). Decoding may be performed in a normal mode or a bypass mode. In the bypass mode, the bypass coding engine 426 performs arithmetic coding using a fixed probability model (e.g., using Golomb-Rice or exponential Golomb decoding). The bypass mode is typically used for more predictable syntax elements.
[0191] Encoding in the normal mode involves performing CABAC. Normal mode CABAC is used to decode the bin values, where given the value of a previously decoded bin, the probability of the bin value is predictable. The probability that a bin is an LPS is determined by a context modeler 422. The context modeler 422 outputs the bin value and a context model (e.g., a probability state σ). The context model may be an initial context model for a sequence of bins or may be determined based on the decoded value of a previously decoded bin. As described above, the context modeler may update the state based on whether the previously decoded bin is an MPS or an LPS.
[0192] After the context modeler 422 determines the context model and the probability state σ, the conventional coding engine 424 performs BAC on the bin values. According to the techniques of the present disclosure, the conventional coding engine 424 uses the TransIdxLPS table 430 to perform BAC, where the TransIdxLPS table 430 includes more than 64 probability states σ. In one example, the number of probability states is 128. When the previous bin (bin n) is LPS, the TransIdxLPS is used to determine which probability state to use for the next bin (bin n + 1). Given a particular probability state σ, the conventional coding engine 424 can also use the RangeLPS table 428 to determine the range value of the LPS. However, according to the techniques of the present disclosure, instead of using all possible probability states σ of the TransIdxLPS table 430, the probability state index σ is mapped to a grouped index for use in the RangeLPS table. That is, each index into the RangeLPS table 428 can represent two or more of the total number of probability states. The mapping of the probability state index σ to the grouped index can be linear (e.g., divided by two) or non - linear (e.g., a logarithmic function or a mapping table).
[0193] In other examples of the present disclosure, the difference between consecutive probability states can be made smaller by setting the parameter α to be greater than 0.9493. In one example, α = 0.9689. In another example of the present disclosure, the highest probability (p0) of the LPS occurrence can be set to be less than 0.5. In one example, p0 can be equal to 0.493.
[0194] According to one or more techniques of the present disclosure, as opposed to using the same values of variables (e.g., window size, scaling factor (α), and probability update speed, one or more of them) for updating probability states during the binary arithmetic coding process, the entropy coding unit 220 can use different values of variables for different context models and / or different syntax elements. For example, the entropy coding unit 220 can determine the values of variables used for updating probability states during the binary arithmetic coding process for a context model among multiple context models, and update the probability states based on the determined values.
[0195] Figure 9 is a block diagram of an exemplary entropy decoding unit 302 that is, for example, part of a video decoder 300 as shown in Figure 5 and can be configured to perform CABAC according to the techniques of the present disclosure. Figure 9 The entropy decoding unit 302 of Figure 8Perform CABAC in a manner opposite to that of the entropy encoding unit 220 described in [reference]. Input the decoded bits from the bitstream 448 into the entropy decoding unit 302. Depending on whether the decoded bits are entropy encoded using the bypass mode or the normal mode, feed the decoded bits to the context modeler 450 or the bypass decoding engine 452. If the decoded bits are decoded in the bypass mode, the bypass decoding engine 452 can retrieve the bins of the binary value syntax elements or non-binary syntax elements using, for example, Golomb-Rice or exponential Golomb decoding.
[0196] If the decoded bits are decoded in the normal mode, the context modeler 450 can determine the probability model of the decoded bits, and the normal decoding engine 454 can decode the decoded bits to generate the bins of the non-binary value syntax elements (or the syntax elements themselves if they are binary values). After the context modeler 450 determines the context model and the probability state σ, the normal decoding engine 454 performs BAC on the bin values. According to the techniques of the present disclosure, the normal decoding engine 454 uses the TransIdxLPS table 458 to perform BAC, where the TransIdxLPS table 458 includes more than 64 probability states σ. In one example, the number of probability states is 128, but other numbers of probability states can be defined, which is consistent with the techniques of the present disclosure. When the previous bin (bin n) is LPS, the TransIdxLPS table 458 is used to determine which probability state is used for the next bin (bin n + 1). The normal decoding engine 454 can also use the RangeLPS table 456 to determine the range value of LPS given a specific probability state σ. However, according to the techniques of the present disclosure, instead of using all possible probability states σ of the TransIdxLPS table 458, the probability state index σ is mapped to a grouped index for use in the RangeLPS table 456. That is, each index into the RangeLPS table 456 can represent two or more of the total number of probability states. The mapping of the probability state index σ to the grouped index can be linear (e.g., divided by two) or non-linear (e.g., logarithmic function or mapping table).
[0197] In other examples of the present disclosure, the difference between consecutive probability states can be made smaller by setting the parameter α to be greater than 0.9493. In one example, α = 0.9689. In another example of the present disclosure, the highest probability (p0) of the occurrence of LPS can be set to be less than 0.5. In one example, p0 can be equal to 0.493.
[0198] After the normal decoding engine 454 decodes the bins, the inverse binarizer 460 can perform an inverse mapping to convert the bins back to the values of the non-binary value syntax elements.
[0199] Figure 10 is a flowchart showing an example method for encoding a current block. The current block may include a current CU. Although described with respect to video encoder 200( Figure 1 and 4 ), it should be understood that other devices may be configured to perform methods similar to Figure 10 .
[0200] In this example, video encoder 200 initially predicts the current block (550). For example, video encoder 200 may form a prediction block for the current block. Then, video encoder 200 may calculate a residual block (552) for the current block. To calculate the residual block, video encoder 200 may calculate the difference between the original undecoded block and the prediction block of the current block. Subsequently, video encoder 200 may transform the residual block and quantize the coefficients of the residual block (554). In some decoding modes, such as the transform skip mode, video encoder 200 may skip the transform and only quantize the residual data. Next, video encoder 200 may scan the quantized coefficients of the residual block (556). During or after the scan, video encoder 200 may entropy code the coefficients (558). For example, video encoder 200 may use CAVLC or CABAC to code the coefficients. Then, video encoder 200 may output the entropy-coded data of these coefficients (560).
[0201] Figure 11 is a flowchart showing 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( Figure 1 and 5 ), it should be understood that other devices may be configured to perform methods similar to Figure 11 .
[0202] Video decoder 300 may receive entropy - coded data of a current block (e.g., entropy - coded prediction information and entropy - coded data of coefficients for a residual block corresponding to the current block) (570). Video decoder 300 may entropy - decode the entropy - coded data to determine the prediction information of the current block and reproduce the coefficients of the residual block (572). Video decoder 300 may predict the current block, for example, using an intra - or inter - prediction mode indicated by the prediction information for the current block (574), to calculate a prediction block for the current block. Then, video decoder 300 may inverse - scan the reproduced coefficients (576) to create a block of quantized coefficients. Then, video decoder 300 may inverse - quantize these coefficients and apply an inverse transform to these coefficients to generate a residual block (578). In some decoding modes such as transform - skip mode, video decoder 300 may skip the inverse transform and only inverse - quantize the coefficients. Video decoder 300 may finally decode the current block by combining the prediction block and the residual block (580).
[0203] Figure 12 is a flowchart of an example method for determining a context for decoding (e.g., encoding or decoding) the signs of coefficients of a residual block. For example, the residual block may be a residual block for which the transform is skipped. The techniques will be described with respect to a general video decoder Figure 12 where the general video decoder may correspond to 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 also be configured to perform methods similar to Figure 12 those described.
[0204] The video decoder determines the value (X0) of a first neighboring coefficient of the coefficient currently being decoded (600). The video decoder determines the value (X1) of a second neighboring coefficient of the coefficient currently being decoded (602). In response to both X0 and X1 being equal to 0 (604, yes), the video decoder sets the context for decoding the sign of the coefficient currently being decoded to a first context (606). In response to at least one of X0 or X1 being not equal to zero (604, no), but X0 and X1 having opposite signs (608, yes), the video decoder also sets the context for decoding the sign of the coefficient currently being decoded to the first context (610).
[0205] In response to at least one of X0 or X1 not being equal to zero (604, No), X0 and X1 not having opposite signs (608, No), and one of X0 or X1 being greater than zero (612, Yes), the video decoder sets the context for decoding the sign of the coefficient currently being decoded to a second context different from the first context (614). In response to at least one of X0 or X1 not being equal to zero (604, No), X0 and X1 not having opposite signs (608, No), and neither X0 nor X1 being greater than zero (612, No), the video decoder sets the context for decoding the sign of the coefficient currently being decoded to a third context different from the first context or the second context (616).
[0206] It should be recognized that, according to an example, certain actions or events of any of the techniques described herein may be performed in a different order, may be added, combined, or entirely omitted (e.g., not all described actions or events are necessary to implement the technique). Additionally, in some examples, actions or events may be performed concurrently rather than sequentially by, for example, multithreading, interrupt processing, or multiple processors.
[0207] In one or more examples, the described functionality may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, the functionality may be stored on a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. The computer-readable medium may include a computer-readable storage medium, which corresponds to a tangible medium such as a data storage medium or a communication medium, where the communication medium includes any medium that facilitates, for example, the transfer of a computer program from one place to another according to a communication protocol. In this way, the computer-readable medium generally may correspond to: (1) a non-transitory tangible computer-readable storage medium; or (2) a communication medium such as a signal or a carrier waveform. The data storage medium may be any available medium that one or more computers or one or more processors can access to obtain instructions, code, and / or data structures for implementing the techniques described in the present disclosure. A computer program product may include a computer-readable medium.
[0208] By way of example, and not limitation, such a computer-readable storage medium can include RAM, ROM, EEPROM, CD-ROM, or other optical disk storage, magnetic disk storage, or other magnetic storage devices, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and that can be accessed by a computer. Additionally, any connection can be properly termed a computer-readable medium. By way of example, if the instructions are transmitted using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then 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 transient media, but rather are directed to non-transitory, tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while discs optically reproduce data with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0209] The instructions can 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" can refer to any of the foregoing structures or any other structure suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described herein can be provided in a dedicated hardware and / or software module configured to perform encoding and decoding, or incorporated into a combined codec. Further, these techniques can be fully implemented in one or more circuits or logic elements.
[0210] The techniques of the present disclosure can be implemented using a variety of devices or apparatuses, including using a wireless handheld device, an integrated circuit (IC), or a group of ICs (e.g., a chip set). Various components, modules, or units are described in the present disclosure to emphasize functional aspects of the devices configured to perform the disclosed techniques, but need not necessarily be implemented by different hardware units. Instead, as described above, the various units can be combined in a codec hardware unit, or provided by a collection of cooperating hardware units that include one or more processors as described above, in conjunction with appropriate software and / or firmware.
[0211] Various examples have been described. These and other examples fall within the scope of the appended claims.
Claims
1. A method for decoding video data, the method comprising: Determining a value of a first neighboring coefficient for a coefficient currently being decoded for a residual block encoded using a transform skip mode in the video data; Determining a value of a second neighboring coefficient for the coefficient currently being decoded; Determining a context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, wherein determining the context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient includes: Selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to zero or having opposite signs; Selecting a second context offset in response to both the first neighboring coefficient and the second neighboring coefficient being positive, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being positive; and Selecting a third context offset in response to both the first neighboring coefficient and the second neighboring coefficient being negative, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being negative, wherein the first context offset, the second context offset, and the third context offset are different offset values; and Decoding the sign of the coefficient currently being decoded based on the determined context offset.
2. The method according to claim 1, wherein The first neighboring coefficient includes one of an upper neighboring coefficient or a left neighboring coefficient of the coefficient currently being decoded, and the second neighboring coefficient includes the other of the upper neighboring coefficient or the left neighboring coefficient.
3. The method according to claim 1, wherein, Decoding the sign of the coefficient currently being decoded based on the determined context offset includes: Determining a context based on the determined context offset; Receiving one or more bins; and Performing context decoding on the one or more bins based on the determined context to determine the sign of the coefficient currently being decoded.
4. The method according to claim 3, further comprising: Determining a predicted absolute value for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; Receiving a syntax element; Determining that the absolute value of the coefficient currently being decoded is equal to the predicted absolute value in response to the syntax element having a value equal to one.
5. The method according to claim 3, further comprising: Determining a predicted absolute value for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; Receiving a syntax element; Determining that the absolute value of the coefficient currently being decoded is equal to the value of the syntax element plus one in response to the value of the syntax element being greater than the predicted absolute value.
6. The method according to claim 3, further comprising: Determining a predicted absolute value for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; Receiving a syntax element; In response to the value of the syntax element being less than the predicted absolute value, determine that the absolute value of the coefficient currently being decoded is equal to the value of the syntax element.
7. The method according to claim 1, further comprising: Without performing an inverse transform, inverse quantize the value of the coefficient currently being decoded to determine the residual value of the residual block of the video data.
8. The method according to claim 1, further comprising: Based on the value of the coefficient currently being decoded, determine the decoded residual block; Add the decoded residual block to the prediction block to determine the reconstructed block; Perform one or more filtering operations on the reconstructed block to determine the decoded block of the video data; and Output the decoded picture of the video data including the decoded block of the video data.
9. A method for encoding video data, the method comprising: For a residual block encoded using a transform skip mode of video data, determine the value of a first neighboring coefficient of the coefficient currently being encoded; Determine the value of a second neighboring coefficient of the coefficient currently being encoded; Based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, determine the context offset of the coefficient currently being encoded, wherein determining the context offset of the coefficient currently being encoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient includes: In response to both the first neighboring coefficient and the second neighboring coefficient being equal to zero or having opposite signs, select a first context offset; In response to both the first neighboring coefficient and the second neighboring coefficient being positive, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being positive, select a second context offset; and In response to both the first neighboring coefficient and the second neighboring coefficient being negative, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being negative, select a third context offset, wherein the first context offset, the second context offset, and the third context offset are different offset values; and Based on the determined context offset, encode the sign of the coefficient currently being encoded.
10. The method according to claim 9, wherein, The first neighboring coefficient includes one of an upper neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient includes the other of the upper neighboring coefficient or the left neighboring coefficient.
11. The method according to claim 9, wherein, Encoding the sign of the coefficient currently being encoded based on the determined context offset includes: Determine a context based on the determined context offset; Determine the sign of the coefficient currently being encoded; and Based on the determined context, perform context encoding on one or more bins to represent the sign of the coefficient currently being encoded.
12. The method according to claim 11, further comprising: Based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, determine the predicted absolute value of the coefficient currently being encoded; In response to the absolute value of the coefficient being currently encoded being equal to the predicted absolute value, encode the syntax element as having a value equal to one.
13. The method according to claim 11, further comprising: Determine the predicted absolute value of the coefficient being currently encoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; In response to the absolute value of the coefficient being currently encoded being less than the predicted absolute value, encode the syntax element as having a value equal to the absolute value of the coefficient being currently encoded.
14. The method according to claim 11, further comprising: Determine the predicted absolute value of the coefficient being currently encoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient; In response to the absolute value of the coefficient being currently encoded being greater than the predicted absolute value, encode the syntax element as having a value equal to the absolute value of the coefficient being currently encoded minus one.
15. The method according to claim 9, further comprising: Quantize the residual values of the residual block of the video data to determine the value of the coefficient being currently encoded.
16. The method according to claim 9, further comprising: Determine a prediction block; and Compare the prediction block with the original block of the video data to determine the residual block of the video data.
17. An apparatus for decoding video data, the apparatus comprising: A memory configured to store video data; and One or more processors implemented in circuitry and configured to perform the following operations: For a residual block encoded using a transform skip mode of video data, determine the value of a first neighboring coefficient for a coefficient being currently decoded; Determine the value of a second neighboring coefficient for the coefficient being currently decoded; Determine a context offset for the coefficient being currently decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, wherein, in order to determine the context offset for the coefficient being currently decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, the one or more processors are configured to: In response to both the first neighboring coefficient and the second neighboring coefficient being equal to zero or having opposite signs, select a first context offset; In response to both the first neighboring coefficient and the second neighboring coefficient being positive, or One of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being positive, select a second context offset; and In response to both the first neighboring coefficient and the second neighboring coefficient being negative, or One of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being negative, select a third context offset, wherein the first context offset, the second context offset, and the third context offset are different offset values; and Decode the sign of the coefficient being currently decoded based on the determined context offset.
18. The device according to claim 17, 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.
19. The apparatus according to claim 17, wherein, To decode the sign of the coefficient currently being decoded based on the determined context offset, the one or more processors are further configured to: Determine a context based on the determined context offset; Receive one or more data bins; And Based on the determined context, perform context decoding on the one or more data bins to determine the sign of the coefficient currently being decoded.
20. The apparatus according to claim 17, wherein, The one or more processors are further configured to: Inverse quantize the value of the coefficient currently being decoded to determine the residual value of the residual block of the video data.
21. The device according to claim 17, wherein, The one or more processors are further configured to: Determine a decoded residual block based on the value of the coefficient currently being decoded; Add the decoded residual block to a prediction 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.
22. The apparatus according to claim 17, wherein The device includes a wireless communication device, and the wireless communication device includes a receiver configured to receive encoded video data.
23. The device according to claim 22, wherein, The wireless communication device includes a telephone handset, and wherein the receiver is configured to: demodulate a signal including the encoded video data according to a wireless communication standard.
24. The device according to claim 17, further comprising: A display configured to display decoded video data.
25. The apparatus according to claim 17, wherein The device includes one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.
26. A device for encoding video data, the device comprising: A memory configured to store the video data; And One or more processors implemented in circuitry and configured to perform the following operations: Determine the value of a first adjacent coefficient for a coefficient currently being encoded for a residual block encoded using a transform skip mode of the video data; Determine the value of a second adjacent coefficient for the coefficient currently being encoded; Based on the value of the first adjacent coefficient and the value of the second adjacent coefficient, determine a context offset for the coefficient currently being encoded, wherein, to determine the context offset for the coefficient currently being encoded based on the value of the first adjacent coefficient and the value of the second adjacent coefficient, the one or more processors are configured to: In response to both the first adjacent coefficient and the second adjacent coefficient being equal to zero or having opposite signs, select a first context offset; In response to both the first adjacent coefficient and the second adjacent coefficient being positive, or One of the first adjacent coefficient and the second adjacent coefficient being equal to zero and the other of the first adjacent coefficient and the second adjacent coefficient being positive, select a second context offset; and In response to both the first adjacent coefficient and the second adjacent coefficient being negative, or One of the first neighboring coefficient and the second neighboring coefficient is equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient is negative, select a third context offset, wherein the first context offset, the second context offset, and the third context offset are different offset values; and Based on the determined context offset, encode the sign of the coefficient being currently encoded.
27. The device according to claim 26, wherein, The first neighboring coefficient includes one of an upper neighboring coefficient or a left neighboring coefficient, and the second neighboring coefficient includes the other of the upper neighboring coefficient or the left neighboring coefficient.
28. The apparatus according to claim 26, wherein, To encode the sign of the coefficient being currently encoded based on the determined context offset, the one or more processors are further configured to: Determine a context based on the determined context offset; Determine the sign of the coefficient being currently encoded; And Based on the determined context, perform context encoding on one or more bins to represent the sign of the coefficient being currently encoded.
29. The apparatus according to claim 26, wherein, The one or more processors are further configured to: Quantize the residual value of the residual block of the video data to determine the value of the coefficient being currently encoded.
30. The apparatus according to claim 26, wherein, The one or more processors are further configured to: Determine a prediction block; and Compare the prediction block with the original block of the video data to determine the residual block of the video data.
31. An apparatus for decoding video data, the apparatus includes: A unit for determining the value of a first neighboring coefficient for a coefficient being currently decoded for a residual block encoded using a transform skip mode of video data; A unit for determining the value of a second neighboring coefficient for the coefficient being currently decoded; A unit for determining a context offset for the coefficient being currently decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, wherein the unit for determining the context offset for the coefficient being currently decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient includes: A unit for selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to zero or having opposite signs; A unit for selecting a second context offset in response to both the first neighboring coefficient and the second neighboring coefficient being positive, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being positive; and A unit for selecting a third context offset in response to both the first neighboring coefficient and the second neighboring coefficient being negative, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being negative, wherein the first context offset, the second context offset, and the third context offset are different offset values; and A unit for decoding the sign of the coefficient being currently decoded based on the determined context offset.
32. A non - transitory computer - readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: Determine a value of a first neighboring coefficient for a coefficient currently being decoded for a residual block encoded using a transform skip mode for video data; Determine a value of a second neighboring coefficient for the coefficient currently being decoded; Determine a context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient, wherein, Determining the context offset for the coefficient currently being decoded based on the value of the first neighboring coefficient and the value of the second neighboring coefficient includes: Selecting a first context offset in response to both the first neighboring coefficient and the second neighboring coefficient being equal to zero or having opposite signs; Selecting a second context offset in response to both the first neighboring coefficient and the second neighboring coefficient being positive, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being positive; and Selecting a third context offset in response to both the first neighboring coefficient and the second neighboring coefficient being negative, or one of the first neighboring coefficient and the second neighboring coefficient being equal to zero and the other of the first neighboring coefficient and the second neighboring coefficient being negative, wherein the first context offset, the second context offset, and the third context offset are different offset values; and Decode the sign of the coefficient currently being decoded based on the determined context offset.
Citation Information
Patent Citations
Coding significant coefficient information in transform skip mode
CN103999460A