Boundary processing for adaptive loop filtering

By replacing the unavailable samples outside the boundary in video decoding as the nearest samples within the boundary, calculating the gradient and determining the adaptive loop filter, the problem of unavailable samples near the boundary is solved and the video quality is improved.

CN113557743BActive Publication Date: 2025-02-11QUALCOMM INC
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202080018563.7
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-02-11
Estimated Expiration
2040-03-11

AI Technical Summary

Technical Problem

In video decoding, samples near the boundary are unavailable when performing adaptive loop filtering (ALF), resulting in reduced gradient calculation and filtering accuracy, affecting video quality.

Method used

The gradient values ​​of the sample are calculated by replacing the sample values ​​of the unavailable samples outside the boundary to the sample values ​​of the nearest samples in the gradient direction within the boundary, and the adaptive loop filter is determined based on these gradient values.

Benefits of technology

The subjective and objective quality of the filtered sample block is improved and the accuracy of ALF is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113557743B_ABST
    Figure CN113557743B_ABST
Patent Text Reader

Abstract

The video encoder and / or video decoder is configured to apply an adaptive loop filter to the reconstructed video data block. The video encoder and / or video decoder may be configured to: determine a value of a gradient of a sample in the reconstructed video data block, including performing a gradient calculation for the sample using an unavailable sample other than one of the following: a picture, slice, tile, or tile group including the reconstructed sample block; determine an adaptive loop filter for the reconstructed video data block based at least in part on the value of the gradient of the determined sample; and apply the determined adaptive loop filter to the reconstructed video data block to generate a filtered video data block.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application claims priority to U.S. Application No. 16 / 814,597 filed on March 10, 2020 and U.S. Provisional Application No. 62 / 816,728 filed on March 11, 2019, and the entire contents of each of the above applications are hereby incorporated by reference in their entirety. Technical Field

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

[0003] Digital video capabilities may be incorporated into a wide variety of devices, including digital televisions, digital live broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio telephones (so-called "smart phones"), video teleconferencing devices, video streaming devices, etc. Digital video devices implement video coding techniques (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 such standards). By implementing such video coding techniques, video devices may more efficiently send, receive, encode, decode, and / or store digital video information.

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

[0005] In summary, the present disclosure describes techniques related to filters for users in video decoding. Specifically, when adaptive loop filtering (ALF) is performed on a block of samples near the boundary of a picture, slice, tile, or tile group, not all samples used to perform the ALF are available. In one example, if the samples used to determine the gradient values ​​of samples near the boundary are outside the boundary, these samples may not be available. In another example, the gradient values ​​within a window around the block of samples used to determine the gradient and / or other information for performing ALF on the block may not be available. The present disclosure describes techniques for determining such gradients (or Laplacian values) of samples near the boundary and for determining gradient values ​​within a window outside the boundary, which are adopted in a manner that potentially improves the accuracy of the gradient, directionality, and ALF performed on these samples, thereby potentially improving the subjective and / or objective quality of the filtered sample block.

[0006] In one example, a method for decoding a video includes reconstructing a block of video data to create a reconstructed block of video data. The method also includes determining a value of a gradient of a sample in the reconstructed block of video data, including performing a gradient calculation for the sample using an available sample corresponding to an unavailable sample other than one of the following: a picture, a slice, a tile, or a tile group that includes the reconstructed block of samples. The method also includes determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined value of the gradient of the sample. The method also includes applying the determined adaptive loop filter to the reconstructed block of video data to generate a filtered block of video data.

[0007] In another example, an apparatus includes a memory configured to store a block of video data. The apparatus also includes one or more processors implemented in circuitry in communication with the memory, the one or more processors configured to: reconstruct the block of video data to create a reconstructed block of video data; determine a value of a gradient of samples in the reconstructed block of video data, including performing a gradient calculation for the samples using available samples corresponding to unavailable samples other than one of the following: a picture, slice, tile, or tile group including the reconstructed block of samples; determine an adaptive loop filter for the reconstructed block of video data based at least in part on the determined value of the gradient; and apply the determined adaptive loop filter to the reconstructed block of video data to generate a filtered block of video data.

[0008] In another example, an apparatus configured to decode video data includes: a unit for reconstructing a video data block to create a reconstructed video data block. The apparatus also includes: a unit for determining a value of a gradient of a sample in the reconstructed video data block, including performing a gradient calculation for the sample using an available sample corresponding to an unavailable sample other than one of the following: a picture, a slice, a tile, or a tile group that includes the reconstructed sample block. The apparatus also includes: a unit for determining an adaptive loop filter for the reconstructed video data block based at least in part on the determined value of the gradient of the sample. The apparatus also includes: a unit for applying the determined adaptive loop filter to the reconstructed video data block to generate a filtered video data block.

[0009] In another example, a computer-readable storage medium is encoded with instructions that, when executed, cause one or more processors configured to decode data to: reconstruct a block of video data to create a reconstructed block of video data; determine values ​​of gradients of samples in the reconstructed block of video data, including performing gradient calculations for the samples using available samples corresponding to unavailable samples other than one of: a picture, slice, tile, or tile group that includes the reconstructed block of samples; determine an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of the gradients of the samples; and apply the determined adaptive loop filter to the reconstructed block of video data to generate a filtered block of video data.

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

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

[0012] Figure 2 Examples are shown of samples outside of a picture, slice, tile, or tile group that are not available for performing classification and filtering operations on the samples as part of performing adaptive loop filtering.

[0013] Figure 3A and 3B A technique for gradient computation for adaptive loop filtering using unavailable samples is shown.

[0014] Figures 4A-4H The calculation of the gradient value of a block is shown.

[0015] Figure 5An example adaptive loop filter is shown.

[0016] Figure 6 An example adaptive loop filter is shown.

[0017] Figure 7 is a block diagram illustrating an example video encoder that may perform the techniques of this disclosure.

[0018] Figure 8 is a block diagram illustrating an example video decoder that may perform the techniques of this disclosure.

[0019] Fig. 9 An example implementation of a filter unit for performing the techniques of this disclosure is shown.

[0020] Fig.10 is a flow chart illustrating an example method for decoding a current block.

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

[0022] The present disclosure describes techniques related to filtering operations that can be used in a post-processing stage, as part of loop decoding, or in a prediction stage of video decoding. The techniques of the present disclosure can be implemented into existing video codecs such as HEVC (High Efficiency Video Coding), or can be efficient decoding tools for future video coding standards such as the H.266 standard currently under development.

[0023] Video decoding generally involves predicting a block of video data from a decoded block of video data in the same picture (i.e., intra-frame prediction) or predicting a block of video data from a decoded block of video data in a different picture (i.e., inter-frame prediction). In some cases, the video encoder also calculates residual data by comparing the predicted block to the original block. Thus, the residual data represents the difference between the predicted block and the original block. The video decoder transforms and quantizes the residual data and signals the transformed and quantized residual data in the encoded bitstream. The video decoder adds the residual data to the prediction block to produce a reconstructed video block that more closely matches the original video block than the prediction block alone.

[0024] 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 explicitly signaled in the encoded video bitstream, or may be implicitly determined by the video decoder without explicitly signaling the parameters in the encoded video bitstream. The present disclosure describes techniques related to ALF. ALF may be used in a post-processing stage, or for loop decoding, or in a prediction process.

[0025] The video decoder may perform a classification operation on samples in the video data as part of performing an ALF on the video data. In order to perform such a classification operation on samples in the video data, the video decoder may perform various calculations for each sample in the video data, including calculating a gradient value of the sample in the video data based at least in part on adjacent samples. However, when a sample is located on a boundary of a picture, slice, tile, or tile group, one or more adjacent samples used to calculate the gradient value of the sample may not be available because one or more adjacent samples are located outside the boundary of the picture, slice, tile, or tile group.

[0026] In one example, a video decoder may use techniques such as repeat padding to replace adjacent samples outside the boundaries of a picture, slice, tile, or tile group with the nearest samples within the boundaries. However, these techniques may potentially introduce a loss of subjective and / or objective quality. For example, repeat padding may potentially introduce discontinuities in the reconstructed video data that may not have occurred if actual sample values ​​were used.

[0027] According to various aspects of the present disclosure, a video decoder may calculate the gradient value of a sample on the boundary of a picture, slice, tile, or tile group in a manner that potentially improves the subjective and / or objective quality of the sample after filtering. In one example, a video decoder may calculate the gradient value of a sample on the boundary of a picture, slice, tile, or tile group by replacing one or more adjacent samples outside the boundary of the picture, slice, tile, or tile group with the sample value of the nearest sample along the gradient direction of one or more unavailable samples within the picture, slice, tile, or tile group. By replacing one or more adjacent samples outside the boundary of a picture, slice, tile, or tile group with the sample value of the nearest sample along the gradient direction of one or more unavailable samples within the picture, slice, tile, or tile group, the technology described herein can improve the subjective and / or objective quality of the sample after filtering compared to technologies such as repeated filling, thereby providing a technical solution to the above-mentioned potential technical problems.

[0028] In the present disclosure, the term video decoding generally refers to video encoding or video decoding. Similarly, the term video decoder can generally refer to a video encoder or a video decoder. In addition, certain techniques described in the present disclosure regarding video decoding can also be applied to video encoding, and vice versa. For example, typically, a video encoder and a video decoder are configured to perform the same process or interactive process. In addition, a video encoder typically performs video decoding as part of a process of determining how to encode video data.

[0029] Figure 1 1 is a block diagram illustrating an example video encoding and decoding system 100 that can perform the techniques of the present disclosure. In general, the techniques of the present disclosure relate to decoding (encoding and / or decoding) video data. Generally, video data includes any data used to process video. Thus, video data can include original unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata (e.g., signaling data).

[0030] like Figure 1 As 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 computer-readable medium 110. Source device 102 and destination device 116 may be any of a wide variety of devices, including desktop computers, notebook computers (i.e., laptop computers), tablet computers, set-top boxes, telephone handsets such as smart phones, televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, etc. In some cases, source device 102 and destination device 116 may be equipped for wireless communication and, therefore, may be referred to as wireless communication devices.

[0031] exist Figure 1 In the example of , source device 102 includes video source 104, memory 106, video encoder 200 and output interface 108. Destination device 116 includes input interface 122, video decoder 300, memory 120 and display device 118. According to the present disclosure, the video encoder 200 of source device 102 and the video decoder 300 of destination device 116 can be configured to apply technology for adaptive loop filtering. Therefore, 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, source device and destination device may include other components or arrangements. For example, source device 102 may receive video data from an external video source such as an external camera. Similarly, destination device 116 may be docked with an external display device instead of including an integrated display device.

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

[0033] Typically, video source 104 represents the source of video data (i.e., original, unencoded video data), and a series of pictures (also referred to as "frames") of the order of the video data are provided to video encoder 200, which encodes the data for the pictures. Video source 104 of source device 102 may include a video capture device, such as a video camera, a video archive unit containing previously captured original 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 generate a combination of real-time video, archived video, and computer-generated video. In each case, video encoder 200 may encode captured, pre-captured, or computer-generated video data. Video encoder 200 may rearrange pictures from the received order (sometimes referred to as "display order") into a decoding order for decoding. Video encoder 200 may generate a bitstream comprising encoded video data. Source device 102 may then output the encoded video data onto computer-readable medium 110 via output interface 108 to be received and / or retrieved by, for example, input interface 122 of destination device 116 .

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

[0035] The computer-readable medium 110 may represent any type of medium or device capable of delivering 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 that enables 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 may modulate the transmission signal including the encoded video data according to a communication standard such as a wireless communication protocol, and the input interface 122 may demodulate the received transmission signal according to a communication standard such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, for example, a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include a router, a switch, a base station, or any other device that may be useful for facilitating communication from the source device 102 to the destination device 116.

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

[0037] In some examples, the source device 102 may output the encoded video data to a file server 114 or another intermediate storage device that may store the encoded video generated by the source device 102. The destination device 116 may access the stored video data from the file server 114 via streaming or downloading. The file server 114 may 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 may represent a web server (e.g., for a website), a file transfer protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. The destination device 116 may access the encoded video data from the file server 114 via any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of the two that is suitable for accessing the encoded video data stored on the file server 114. The file server 114 and the input interface 122 may be configured to operate according to the following: a streaming protocol, a download transmission protocol, or a combination thereof.

[0038] Output interface 108 and input interface 122 may represent a wireless transmitter / receiver, a modem, a wired networking component (e.g., an Ethernet card), a wireless communication component that operates according to any of the various IEEE 802.11 standards, or other physical components. In examples where output interface 108 and input interface 122 include wireless components, output interface 108 and input interface 122 may be configured to transmit data (such as encoded video data) according to a cellular communication standard (such as 4G, 4G-LTE (Long Term Evolution), Advanced LTE, 5G, etc.). In some examples where output interface 108 includes a wireless transmitter, output interface 108 and input interface 122 may be configured to transmit data (such as encoded video data) according to other wireless standards (such as IEEE 802.11 specifications, IEEE 802.15 specifications (e.g., ZigBee™), Bluetooth™ standards, etc.). In some examples, source device 102 and / or destination device 116 may include corresponding system-on-chip (SoC) devices. For example, source device 102 may include a SoC device for performing the functions assigned to video encoder 200 and / or output interface 108 , and destination device 116 may include a SoC device for performing the functions assigned to video decoder 300 and / or input interface 122 .

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

[0040] The input interface 122 of the destination device 116 receives the encoded video bitstream from the 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 such as the following syntax elements defined by the video encoder 200 (which are also used by the video decoder 300): the syntax elements have values ​​that describe the characteristics and / or processing of video blocks or other decoding units (e.g., slices, pictures, groups of pictures, sequences, etc.). The display device 118 displays the decoded pictures of the decoded video data to the 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.

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

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

[0043] The video encoder 200 and the video decoder 300 may operate according to a video coding standard, such as the ITU-T H.265 (also known as the High Efficiency Video Coding (HEVC) standard) or an extension thereof, such as a multi-view and / or scalable video coding extension. Alternatively, the video encoder 200 and the video decoder 300 may operate according to other proprietary or industry standards, such as the Joint Exploration Test Model (JEM) or the ITU-T H.266 standard, also known as Versatile Video Coding (VVC). The latest draft of the VVC standard is described in the following document: Bross et al., “Versatile Video Coding (Draft 7)”, Joint Video Experts Group (JVET) of ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11, 16th Meeting: Geneva, Switzerland, October 1-11, 2019, JVET-P2001-v9 (hereinafter referred to as “VVC Draft 7”). However, the techniques of the present disclosure are not limited to any particular coding standard.

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

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

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

[0047] As another example, the video encoder 200 and the video decoder 300 may be configured to operate according to JEM or VVC. According to JEM or VVC, a video decoder (such as the video encoder 200) partitions a picture into a plurality of coding tree units (CTUs). The video encoder 200 may partition the CTU according to a tree structure (such as a quadtree-binary tree (QTBT) structure or a multi-type tree (MTT) structure). The QTBT structure removes the concept of multiple partition types, such as the separation between CU, PU, ​​and TU of HEVC. The QTBT structure includes two levels: a first level partitioned according to quadtree partitioning, and a second level partitioned 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).

[0048] Blocks (e.g., CTUs or CUs) may be grouped in a picture in various ways. As an example, a brick may refer to a rectangular area of ​​a CTU row within a particular tile in a picture. A tile may be a rectangular area of ​​a CTU within a particular tile column and a particular tile row in a picture. A tile column refers to a rectangular area of ​​a CTU having a height equal to the height of the picture and a width specified by a syntax element (e.g., such as in a picture parameter set). A tile row refers to a rectangular area of ​​a CTU having a height specified by a syntax element (e.g., such as in a picture parameter set) and a width equal to the width of the picture.

[0049] In some examples, a tile may be partitioned into multiple bricks, each of which may include one or more CTU rows within the tile. Tiles that are not partitioned into multiple bricks may also be referred to as bricks. However, bricks that are true subsets of tiles may not be referred to as tiles.

[0050] Tiles in a picture can also be arranged in slices. A slice can be an integer number of tiles of a picture that can be uniquely contained in a single network abstraction layer (NAL) unit. In some examples, a slice includes a continuous sequence of multiple complete tiles or only complete tiles of one tile.

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

[0052] The video encoder 200 encodes video data representing prediction and / or residual information and other information for a CU. The prediction information indicates how the CU will be predicted in order to form a prediction block for the CU. The residual information typically represents the sample-by-sample difference between the samples of the CU before encoding and the prediction block.

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

[0054] 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, the video encoder 200 can determine two or more motion vectors representing non-translational motion (such as zooming in or out, rotation, perspective motion, or other irregular motion types).

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

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

[0057] After a prediction such as intra prediction or inter prediction of a block, the video encoder 200 may calculate residual data for the block. The residual data (such as a residual block) represents the sample-by-sample difference between the block and a prediction block for the block, which is formed using a corresponding prediction mode. The video encoder 200 may apply one or more transforms to the residual block to produce transformed data in a transform domain rather than in a sample domain. For example, the video encoder 200 may apply a discrete cosine transform (DCT), an integer transform, a wavelet transform, or a conceptually similar transform to the residual video data. In addition, the 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. The video encoder 200 generates transform coefficients after applying one or more transforms.

[0058] As described above, after any transform to produce transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to a process in which the transform coefficients are quantized to potentially reduce the amount of data used to represent the transform coefficients, thereby providing further compression. By performing the quantization process, the video encoder 200 may reduce the bit depth associated with some or all of the transform coefficients. For example, the video encoder 200 may convert the transform coefficients to bits during quantization. n The bit value is rounded down to m The value of the bit, where nGreater than m In some examples, to perform quantization, video encoder 200 may perform a bitwise right shift of the value to be quantized.

[0059] After quantization, the video encoder 200 can scan the transform coefficients to generate a one-dimensional vector from a two-dimensional matrix including the quantized transform coefficients. The scan can be designed to place the transform coefficients of higher energy (and therefore lower frequency) in front of the vector and the transform coefficients of lower energy (and therefore higher frequency) in the back of the vector. In some examples, the video encoder 200 can scan the quantized transform coefficients using a predefined scan order to generate a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, the video encoder 200 can perform adaptive scanning. After scanning the quantized transform coefficients to form a one-dimensional vector, the video encoder 200 can entropy encode the one-dimensional vector, for example, according to context adaptive binary arithmetic coding (CABAC). The video encoder 200 can also entropy encode the values ​​of the syntax elements used to describe the metadata associated with the encoded video data for use by the video decoder 300 when decoding the video data.

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

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

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

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

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

[0065] According to the techniques of the present disclosure, a video encoder and / or a video decoder may be configured to: reconstruct a block of video data to create a reconstructed block of video data; determine values ​​of gradients of samples in the reconstructed block of video data, including performing gradient calculations on the samples using available samples corresponding to unavailable samples other than one of: a picture, slice, tile, or tile group that includes the reconstructed block of samples; determine an adaptive loop filter for the reconstructed block of video data based at least in part on the values ​​of the gradients of the determined samples; and apply the determined adaptive loop filter to the reconstructed block of video data to generate a filtered block of video data.

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

[0067] In the field of video decoding, filtering (e.g., adaptive loop filters) is often applied in order to enhance the quality of a reconstructed and / or decoded video signal. In the context of the present disclosure, a reconstructed video data block may refer to a video data block that has been reconstructed in a reconstruction loop of the video encoder 200, or may refer to a video data block decoded by the video decoder 300. In some examples, the filter may be applied as a post-filter, where the filtered frames are not used to predict future frames, or the filter may be applied as an in-loop filter, where the filtered frames are used to predict future frames. For example, the filter may be designed by minimizing the error between the original signal and the reconstructed / decoded filtered signal. Similar to transform coefficients, the video encoder 200 may be configured to minimize the error between the original signal and the reconstructed / decoded filtered signal by the following formula: (in ) for quantization decoding:

[0068]

[0069] The video encoder 200 may send the decoded quantized coefficients to the video decoder 300. Normalization factor ( ) can be equal to . The larger the value of, the more accurate the quantization is, and the quantized filter coefficients Provides better performance. However, the larger Values ​​that generate coefficients that require more bits to be sent .

[0070] In the video decoder 300, the decoded filter coefficients are converted as follows Applied to reconstructed image / block , as shown below: (1) Among them and are the coordinates of the samples within the frame or block.

[0071] The video encoder 200 and the video decoder 300 may be configured to implement various ALF filtering techniques. Various aspects of these filtering techniques (eg, ALF) will now be described.

[0072] In-loop ALF was evaluated during the HEVC development phase, but was not included in the final version of the HEVC standard. However, VVC adopts in-loop ALF. Example details can be found in the following documents: B. Bross, J. Chen, S. Liu, "JVET-L1001: Versatile Video Coding (Draft 3)", which is a simplified version of the ALF described in the following documents: M. Karczewicz, L. Zhang, W.-J. Chien, X. Li, "EE2.5: Improvements on adaptive loop filter", ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11 Exploration Group (JVET), Doc. JVET-B0060, 2nd Meeting: San Diego, USA, February 20-26, 2016; and M.Karczewicz, L. Zhang, W.-J. Chien, X. Li, "EE2.5: Improvements on adaptive loop filter", ITU-T SG 16 WP 3 and ISO / IEC JTC 1 / SC 29 / WG 11. 11 Joint Vehicle Exploration Team (JVET), Doc. JVET-C0038, 3rd Meeting: Geneva, Switzerland, May 26-June 1, 2016.

[0073] In VVC, for the luma component in a picture, the video encoder 200 and the video decoder 300 may be configured to apply a 7x7 diamond filter to the ALF. In VVC, for the two chroma components (e.g., Cr and Cb) in a picture, the video encoder 200 and the video decoder 300 may be configured to apply a single set of ALF coefficients, such as a 5x5 diamond filter. In some examples, other filter shapes may also be used.

[0074] The video decoder 300 may be configured to decode each sample Filtering is performed, which produces the sample value shown in equation (2) ,in L represents the filter length, represents the filter coefficients, and o Indicates the filter offset. (2)

[0075] in and( In VVC Test Model 3 (VTM3), The bit depth of the representation is set to 8.

[0076] In VVC Test Model 5 (VTM5.0), clipping is introduced in ALF and equation (2) is modified as shown in equation (2*) (2*)

[0077] in is the limiting parameter.

[0078] ALF is adopted in VVC draft 4. A detailed description of ALF classification can be found in U.S. patent application 16 / 427,017 filed on May 30, 2019. In VVC, classification is performed for each 4x4 luma block using subsampled gradient calculation, as described in the following document: "CE2: Subsampled Laplacian calculation (Tests 6.1, 6.2, 6.3, and 6.4)", JVET-L0147, 12th Meeting: Macau, China, October 3-12, 2018. In addition, a 7-tap filter is applied to luma samples and a 5-tap filter is applied to chroma samples. In VVC draft 7, ALF uses seven (7) lines of the buffer to store the additional samples because of the dependency on the deblocking filter and SAO along the horizontal boundaries between CTUs. A detailed description of the use of line buffers can be found in JVET-M0164 and JVET-M0301.

[0079] To reduce or remove the number of lines storing samples from adjacent CTUs, some techniques have been developed, such as JVET-M0164, JVET-M0301, U.S. patent application 16 / 200,197 filed on November 26, 2018, and U.S. Patent 9,641,866 issued on May 2, 2017.

[0080] The techniques in the following apply only to horizontal boundaries between CTUs: "Adaptive loop filter with virtual boundary processing", JVET-M0164, 13th meeting: Marrakech, MD, January 9-18, 2019 (hereinafter referred to as JVET-M0164); "Non-CE: Loop filter line buffer reduction", JVET-M0301, 13th meeting: Marrakech, MD, January 9-18, 2019 (hereinafter referred to as JVET-M0301); U.S. patent application 16 / 200,197; and U.S. Patent 9,641,866. In VVC draft 7, repetition padding is applied at the boundaries of pictures, slices, tiles, or tile groups due to the unavailability of samples outside of the picture, slice, tile, or tile group.

[0081] The video encoder 200 and the video decoder 300 may be configured to determine one of a plurality of ALF categories applied to a block of video data (e.g., a block of luma samples and / or chroma samples). When implementing VTM3, the video encoder 200 and the video decoder 300 are configured to apply classification to each 4x4 luma block. The video encoder 200 and the video decoder 300 may be configured to classify each 4x4 block into one of 25 categories based on the determined directionality and quantization value of the activity of the block. The details are described below.

[0082] The video encoder 200 and the video decoder 300 may be configured to determine the classification of the ALF of the block based on the 1D Laplacian direction of the samples of the block and the 2D Laplacian activity of the samples of the block for each 4x4 luma block. In one example, the video encoder 200 and the video decoder 300 may be configured to calculate the sum of the gradients of each other sample within an 8×8 window covering the 4x4 luma block to determine the gradient value of the block. The video encoder 200 and the video decoder 300 may be configured to calculate four gradient values: g v The vertical gradient value represented by g h The horizontal gradient value represented by g d1 The 135 degree diagonal gradient value represented by g d2 The 45-degree diagonal gradient value represented by . Table 1 below shows the potential directionality values ​​that can be determined from the gradient and their physical meaning with respect to the sample values ​​of the block. For a 4x4 sub-block with top-left coordinates (i, j), the gradient value g v , g h , g d1 and g d2 Defined as:

[0083]

[0084] If k and l are both even numbers or k and l are not even numbers, then ;otherwise, .

[0085]

[0086] If k and l are both even numbers or k and l are not even numbers, then ;otherwise, .

[0087]

[0088] If k and l are both even numbers or k and l are not even numbers, then ;otherwise, .

[0089]

[0090] If k and l are both even numbers or k and l are not even numbers, then ;otherwise, .

[0091]

[0092] To assign directionality D , the video encoder 200 and the video decoder 300 may be configured to convert the ratio of the maximum value to the minimum value of the horizontal and vertical gradient values ​​(given by in the following equation (3) R h,v ) and the ratio of the maximum and minimum values ​​of the two diagonal gradients (in equation (4) represented by R d1,d2 Represents) and two thresholds and Make a comparison.

[0093]

[0094] By comparing the ratios of the detected horizontal / vertical and diagonal gradients, the video encoder 200 and the video decoder 300 may determine five directional modes, ie, D, in the range of [0, 4] (inclusive), as defined in the following equation (5).

[0095] 5)

[0096] The video encoder 200 and the video decoder 300 may convert the activity value of the block into Calculated as: (6)

[0097] The video encoder 200 and the video decoder 300 may further convert the activity value quantized to the range of 0 to 4 (inclusive), and the quantized values ​​are represented as The quantization process is described in detail below.

[0098] An example quantization process is defined as follows:

[0099] avg_var = Clip_post( NUM_ENTRY-1, ( * ScaleFactor)>>shift);

[0100] = ActivityToIndex[avg_var],

[0101] where NUM_ENTRY is set to 16, ScaleFactor is set to 24, the shift is (3 + internal decoding bit depth), ActivityToIndex[NUM_ENTRY] = {0, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4}, and the function Clip_post(a, b) returns the smaller value between a and b.

[0102] Due to the different method of calculating activity values, both ScaleFactor and ActivityToIndex can be modified compared to the ALF design in JEM2.0.

[0103] In an example geometric transform based ALF (GALF) scheme, the video encoder 200 and the video decoder 300 may be configured to be block-based in directionality. D and block activities The quantized values ​​of are used to classify each N×N block into one of the 25 categories (C), as shown below:

[0104] (7)

[0105] In one example, for each column, The value of is set to 0…4, which is based on the variable Act Derived. Mark the new value on the top row Minimum Act (For example, 0, 8192, 16384, 57344, 122880). For example, values ​​in the range [16384, 57344-1] Act will fall on Equals 2.

[0106] For each classification, the video encoder 200 can be configured to signal a set of filter coefficients. In order to better distinguish different orientations of blocks marked with the same category index, four geometric transformations can be used, including no transformation, diagonal, vertical flip and rotation. The formula form of the three additional geometric transformations can be expressed as follows:

[0107]

[0108] in is the filter size, and are the coefficient coordinates such that the position Located in the upper left corner of the block, and position Located at the bottom right corner of the block. Note that when a diamond filter support is used, the coefficients of the filter support extrinsic coordinates can be set to 0. One technique for indicating the geometric transform index is to derive the geometric transform implicitly (e.g., without signaling) in order to avoid additional overhead. In some examples of GALF, the transform is applied to the filter coefficients according to the gradient values ​​calculated for the block. f ( k , l ). The relationship between the transformation and the four gradients is described in Table 2 below. In one or more examples, the transformation is based on which of the two gradients (horizontal and vertical, or 45 degree and 135 degree gradients) is larger. Based on the comparison, more accurate direction information can be extracted. Therefore, different filtering results can be obtained due to the transformation without increasing the overhead of the filter coefficients.

[0109] Table 2. Mapping of gradients and transformations.

[0110]

[0111] As described above, at the boundaries of a picture, slice, tile, or tile group (including both horizontal and vertical boundaries), samples outside these boundaries are not available to the video encoder 200 and the video decoder 300 for the purpose of ALF to perform classification and filtering operations on samples along these boundaries. The boundaries of a picture can be the boundaries of a video data frame, while the boundaries of a slice, tile, or tile group can be the boundaries that separate parts of a single video data frame (such as slices, tiles, and tile groups within the same video data frame), and can also be referred to as virtual boundaries. In some examples, for the purposes of the present disclosure, the boundaries discussed herein do not include or are not CTU boundaries of slice / tile / tile group / picture boundaries.

[0112] Figure 2 Examples of samples outside of a picture, slice, tile, or tile group are shown, which are not available for performing classification and filtering operations on the samples as part of performing adaptive loop filtering. Figure 2 As shown, samples 142A-142D are within the boundary 140 of block 146, where block 146 may be a picture, a slice, a tile, or a tile group, and samples 143A-144D are outside the boundary 140 of block 146. In particular, samples 142A-142D are referred to as being along the boundary 140 because samples 142A-142D are samples at the edge of block 146 such that samples 142A-142D are each adjacent to a sample in samples 143A-144D that is outside the boundary 140 of block 146.

[0113] In some examples, video encoder 200 and video decoder 300 may perform classification and filtering operations on samples 142A-142D of block 146 that require the use of samples 143A-144D outside boundary 140 of block 146. For example, in order to calculate one or more gradient values ​​for sample 142A along boundary 140, video encoder 200 and 300 may require one or more samples in sample 143A to perform the calculation of one or more gradient values. However, because samples 143A-144D are outside boundary 140, samples 143A-144D may not be available for performing classification and filtering operations on samples 142A-142D.

[0114] Therefore, some techniques use the nearest sample within the boundary 140 of the block 146 to replace the sample outside the boundary 140 to perform classification and filtering operations for samples along the boundary 140 (such as samples 142A-142D). One such technique is called repeat padding and can be used for both horizontal and vertical boundaries of the boundary 140. However, these techniques can potentially introduce a loss of subjective and / or objective quality. For example, repeat padding can potentially introduce discontinuities in the reconstructed video data that may not appear if the actual sample values ​​are used.

[0115] Thus, instead of using techniques such as repeated padding or other similar techniques, aspects of the present disclosure describe techniques for determining gradients of samples 142A-142D along a boundary 140 of a block 146 by replacing sample values ​​of one or more of samples 143A-144D outside of the boundary 140 of the block 146 with sample values ​​of samples within the block 146, in a manner that potentially improves the subjective and / or objective quality of the samples after filtering.

[0116] In some aspects, the techniques of this disclosure extend the techniques of JVET-M0164, JVET-M0301, U.S. Patent Application 16 / 200,197, and U.S. Patent 9,641,866 to horizontal and vertical boundaries of pictures, slices, tiles, or tile groups, such as boundary 140 of block 146. The described techniques may be applied alone or together in any combination.

[0117] In one example, the video encoder 200 and the video decoder 300 may perform gradient calculations as part of performing adaptive loop filtering. As described above, samples may be classified into one of twenty-five (25) categories based on the total Laplacian activity and directionality of the block. In one example, in the calculation of a gradient value, if a sample is not in the current picture / slice / tile / tile group, e.g., outside of boundary 140, and is therefore unavailable for calculation of the gradient value, the video encoder 200 and the video decoder 300 may replace the sample value of the unavailable sample with the sample value of the nearest sample along the gradient direction in the unavailable sample in the current picture, slice, tile, or tile group (such as block 146) when performing the gradient calculation.

[0118] Figure 3A and 3B Techniques for gradient calculation for adaptive loop filtering using unavailable samples are shown.As part of performing adaptive loop filtering, video encoder 200 and video decoder 300 may perform classification and filtering operations based on gradient values ​​of calculated samples.

[0119] like Figure 3A As shown, block 148 may be a picture, a slice, a tile, a tile group, etc., where samples outside the boundary of block 148 may not be available for performing gradient calculations for samples within block 148. Block 148 may be defined by, for example, a left boundary 150A (which may be a vertical boundary) and an upper boundary 150B (which may be a horizontal boundary). The term "boundary" is used in the present disclosure to refer to a boundary of a picture or a boundary between two parts of video data, where these parts may be located within the same video block or within different video blocks. Therefore, the term "boundary" should not be interpreted as limited to a boundary separating two video blocks, but may also include a virtual boundary that can separate any two parts of video data. In some examples, the term boundary may not include a CTU boundary that is not a slice / tile / tile group / picture boundary.

[0120] Figure 3A An example of samples along the top and left borders of a picture / slice / tile / tile group is shown. L[y,x] is the luma sample at row y and column x. Thus, Figure 3A In the example of , the samples may be luma samples and are shown as having coordinates of the form L[y,x], where y is the vertical coordinate of the sample and x is the horizontal coordinate of the sample, where L[0,0] represents the sample at the upper left corner of block 148. Thus, samples along upper boundary 150B have a y coordinate of 0, while samples along left boundary 150A of block 148 have an x ​​coordinate of 0.

[0121] For samples within block 148 and along left boundary 150A and upper boundary 150B (for example, assuming that the coordinates of the upper left sample within boundary 150 are (0, 0), the samples with x coordinates of 0 or the samples with y coordinates of 0, respectively), the video decoder (for example, video encoder 200 and video decoder 300) can calculate the gradient value of the sample based on the neighboring samples along the gradient direction to be calculated. For example, the video decoder can calculate the horizontal direction gradient, the vertical direction gradient, the 45-degree diagonal direction gradient, and the 135-degree diagonal direction gradient for the samples within block 148.

[0122] In one example, the video encoder 200 and the video decoder 300 use a 1-D Laplacian to calculate the values ​​of the horizontal gradient, the vertical gradient, and the two diagonal gradients of a sample:

[0123]

[0124]

[0125] In these examples, g v Indicates the vertical gradient value, g h Indicates the horizontal gradient value, g d1 represents a 135 degree diagonal gradient value, and g d2 Indicates the 45-degree diagonal gradient value. In addition, are the coefficient coordinates, and R(k, l) are the samples at coordinates (k, l) of the reconstructed block.

[0126] As can be seen, the video encoder 200 and the video decoder 300 can calculate the gradient value of the sample based at least in part on two neighboring samples of the sample in the same gradient direction as the gradient value being calculated. In particular, the video encoder 200 and the video decoder 300 can calculate the four directional gradient values ​​of the center sample of three (3) consecutive neighboring samples. Therefore, the video encoder 200 and the video decoder 300 can calculate the gradient value of the sample as the center sample of three (3) consecutive neighboring samples along the gradient direction. However, the neighboring samples of the center sample of the three (3) consecutive neighboring samples may not be available for calculating the gradient value of the sample within the block 148, for example, if one of the neighboring samples in the same gradient direction is outside the upper boundary 150B or the left boundary 150A of the block 148, and therefore outside the picture, slice, tile, or tile group (e.g., block 148) defined by the upper boundary 150B and / or the left boundary 150A.

[0127] According to various aspects of the present disclosure, the video encoder 200 and the video decoder 300 may determine whether neighboring samples along the same gradient direction are unavailable for calculating the gradient value of the sample, and if so, the unavailable sample may be replaced with an available neighboring sample along the same gradient direction. In particular, in order to calculate the gradient value of a sample that is a center sample among three (3) consecutive neighboring samples along the gradient direction, the video encoder 200 and the video decoder 300 may determine whether one sample among two non-center samples among the three consecutive neighboring samples is unavailable, and if so, the unavailable sample may be replaced with another non-center sample among the three consecutive neighboring samples (i.e., an available neighboring sample) to calculate the gradient value of the center sample. Replacing the unavailable sample with an available neighboring sample includes replacing the sample value of the unavailable sample with the sample value of the available neighboring sample for the purpose of calculating the gradient value of the center sample.

[0128] For the purpose of calculating the gradient value, replacing the unavailable sample with the available neighboring sample may include: using the sample value of the replacement sample instead of the sample value of the unavailable sample to calculate the gradient value. Therefore, since the available neighboring sample is one of three consecutive neighboring samples used to calculate the gradient value, when calculating the gradient value of the center sample among the three consecutive neighboring samples, the value of the available neighboring sample may be used twice to represent two non-center samples among the three consecutive neighboring samples.

[0129] exist Figure 3A In the example of , if a sample is located above the upper boundary 150B of the block 148, the sample is not available for the purpose of determining the gradient values ​​of the samples along the upper boundary 150B in the block 148. If the video encoder 200 and the video decoder 300 determine that one of the three consecutive neighboring samples used to calculate the gradient values ​​of the samples adjacent to the upper boundary 150B is located above the upper boundary 150B, the video encoder 200 and the video decoder 300 may replace the sample outside the upper boundary 150B with another non-center sample of the three consecutive neighboring samples to calculate the gradient values ​​of the samples adjacent to the upper boundary 150B.

[0130] For example, in order to calculate the vertical gradient value of the sample 152A, the video encoder 200 and the video decoder 300 may use the sample 152A at the position L[0, x] as the center sample of three (3) consecutive samples along the vertical gradient direction. The other two samples of the three consecutive samples along the vertical direction with the sample 152A as the center sample are the adjacent sample 152B at the position L[1, x] immediately below the sample 152A in the vertical gradient direction and the adjacent sample 152C at the position L[-1, x] immediately above the sample 152A in the vertical gradient direction.

[0131] However, as in Figure 3AAs can be seen in FIG. 1 , the adjacent sample 152C immediately above the sample 152A at the position L[-1, x] may not be available because the adjacent sample 152C is outside the upper boundary 150B of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152C is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152C with the sample 152B (which is another non-center sample of the three consecutive adjacent samples 152A-152C along the vertical gradient direction) to determine the vertical gradient value of the sample 152A. Figure 3A As shown, sample 152C is replaced by the sample at position L[1, x], which is sample 152B.

[0132] In another example, in order to calculate the 45-degree diagonal gradient value of the sample 152D, the video encoder 200 and the video decoder 300 may use the sample 152D at the position L[0, x] as the center sample of three (3) consecutive samples along the 45-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 45-degree gradient direction with the sample 152D as the center sample are the adjacent sample 152E at the position L[1, x+1] immediately below and to the right of the sample 152D in the 45-degree diagonal gradient direction and the adjacent sample 152F at the position L[-1, x-1] immediately above and to the left of the sample 152D in the 45-degree diagonal gradient direction.

[0133] However, as in Figure 3A As can be seen in FIG. 1 , the adjacent sample 152F immediately above and to the left of the sample 152D at the position L[-1, x-1] may not be available because it is outside the upper boundary 150B of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152F is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152F with the sample 152E (which is another non-center sample of the three consecutive adjacent samples 152D-152F along the 45-degree diagonal gradient direction) to determine the 45-degree diagonal gradient value of the sample 152D. Figure 3A As shown, sample 152F is replaced by the sample at position L[1, x+1], which is sample 152E.

[0134] In another example, in order to calculate the 135-degree diagonal gradient value of the sample 152G, the video encoder 200 and the video decoder 300 may use the sample 152G at the position L[0, x] as the center sample of three (3) consecutive samples along the 135-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 135-degree gradient direction with the sample 152G as the center sample are the adjacent sample 152H at the position L[1, x-1] immediately below and to the left of the sample 152G in the 135-degree diagonal gradient direction and the adjacent sample 152I at the position L[-1, x+1] immediately above and to the right of the sample 152G in the 135-degree diagonal gradient direction.

[0135] However, as in Figure 3A As can be seen in FIG. 1 , the adjacent sample 152I immediately above and to the right of the sample 152G at the position L[-1, x+1] may not be available because it is outside the upper boundary 150B of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152I is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152I with the sample 152H (which is another non-center sample of the three consecutive adjacent samples 152G-152I along the 135-degree diagonal gradient direction) to determine the 135-degree diagonal gradient value of the sample 152G. Figure 3A As shown, sample 152I is replaced by the sample at position L[1, x-1], which is sample 152H.

[0136] In another example, to calculate the horizontal gradient value of sample 152J, the video encoder 200 and the video decoder 300 may use sample 152J at position L[0, x] as the center sample of three (3) consecutive samples along the horizontal gradient direction. The other two samples of the three consecutive samples along the horizontal direction with sample 152L as the center sample are adjacent sample 152K at position L[0, x+1] immediately to the right of sample 152J in the horizontal gradient direction and adjacent sample 152L at position L[0, x-1] immediately to the left of sample 152J in the horizontal gradient direction. Because samples 152J-152L are all within block 148 and are not outside left boundary 150A or upper boundary 150B, video encoder 200 and video decoder 300 may not have to replace any of samples 152J-152L to calculate the horizontal gradient value of sample 152J.

[0137] Similarly, in Figure 3AIn the example of FIG. 1 , if a sample is located to the left of the left boundary 150A of the block 148, the sample is not available for the purpose of determining the gradient values ​​of the samples along the left boundary 150A in the block 148. If the video encoder 200 and the video decoder 300 determine that one of the three consecutive neighboring samples used to calculate the gradient values ​​of the samples adjacent to the left boundary 150A is located to the left of the left boundary 150A, the video encoder 200 and the video decoder 300 may replace the sample outside the left boundary 150A with another non-center sample of the three consecutive neighboring samples to calculate the gradient values ​​of the samples adjacent to the left boundary 150A.

[0138] For example, in order to calculate the horizontal gradient value of the sample 152M, the video encoder 200 and the video decoder 300 may use the sample 152M at the position L[y, 0] as the center sample of three (3) consecutive samples along the horizontal gradient direction. The other two samples of the three consecutive samples along the vertical direction with the sample 152M as the center sample are the adjacent sample 152N at the position L[y, 1] immediately to the right of the sample 152M in the horizontal gradient direction and the adjacent sample 152O at the position L[y, -1] immediately to the left of the sample 152M in the horizontal gradient direction.

[0139] However, as in Figure 3A As can be seen in FIG. 1 , the adjacent sample 152O immediately to the left of the sample 152M at the position L[y, −1] may not be available because it is outside the left boundary 150A of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152O is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152O with the sample 152N (which is another non-center sample of the three consecutive adjacent samples 152M-152O along the horizontal gradient direction) to determine the horizontal gradient value of the sample 152M. Figure 3A As shown, sample 152O is replaced by the sample at position L[y, 1], which is sample 152N.

[0140] In another example, in order to calculate the 45-degree diagonal gradient value of the sample 152P, the video encoder 200 and the video decoder 300 may use the sample 152P at the position L[y, 0] as the center sample of three (3) consecutive samples along the 45-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 45-degree gradient direction with the sample 152P as the center sample are the adjacent sample 152Q at the position L[y+1, 1] immediately below and to the right of the sample 152P in the 45-degree diagonal gradient direction and the adjacent sample 152R at the position L[y-1, -1] immediately above and to the left of the sample 152P in the 45-degree diagonal gradient direction.

[0141] However, as in Figure 3AAs can be seen in FIG. 1 , the adjacent sample 152R immediately above and to the left of the sample 152P at the position L[y-1, -1] may not be available because it is outside the left boundary 150A of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152R is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152R with the sample 152Q (which is another non-center sample of the three consecutive adjacent samples 152P-152R along the 45-degree diagonal gradient direction) to determine the 45-degree diagonal gradient value of the sample 152P. Figure 3A As shown, sample 152R is replaced by the sample at position L[y+1, 1], which is sample 152Q.

[0142] In another example, in order to calculate the 135-degree diagonal gradient value of the sample 152S, the video encoder 200 and the video decoder 300 may use the sample 152S at the position L[y, 0] as the center sample of three (3) consecutive samples along the 135-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 135-degree gradient direction with the sample 152S as the center sample are the neighboring sample 152U at the position L[y-1, 1] immediately above and to the right of the sample 152S in the 135-degree diagonal gradient direction and the neighboring sample 152T at the position L[y+1, -1] immediately below and to the left of the sample 152S in the 135-degree diagonal gradient direction.

[0143] However, as in Figure 3A As can be seen in FIG. 1 , the adjacent sample 152T immediately below and to the left of the sample 152S at the position L[y+1, −1] may not be available because it is outside the left boundary 150A of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152T is not available, the video encoder 200 and the video decoder 300 may replace the unavailable sample 152T with the sample 152U (which is another non-center sample of the three consecutive adjacent samples 152S-152U along the 135-degree diagonal gradient direction) to determine the 135-degree diagonal gradient value of the sample 152S. Figure 3A As shown, sample 152T is replaced by the sample at position L[y-1, 1], which is sample 152U.

[0144] In another example, to calculate the vertical gradient value of sample 152J, the video encoder 200 and the video decoder 300 may use sample 152V at position L[y, 0] as the center sample of three (3) consecutive samples along the vertical gradient direction. The other two samples of the three consecutive samples along the vertical direction with sample 152V as the center sample are adjacent sample 152W at position L[y+1, 0] immediately below sample 152V in the vertical gradient direction and adjacent sample 152X at position L[y-1, 0] immediately above sample 152V in the vertical gradient direction. Because samples 152V-152X are all within block 148 and are not outside left boundary 150A or upper boundary 150B, video encoder 200 and video decoder 300 may not have to replace any of samples 152V-152X to calculate the vertical gradient value of sample 152V.

[0145] According to some aspects of the present disclosure, for the purpose of calculating gradient values ​​of samples, the video encoder 200 and the video decoder 300 may use mirror padding to replace sample values ​​of unavailable samples outside the boundary with sample values ​​of available neighboring samples, rather than replacing unavailable samples outside the boundary (such as outside the left boundary 150A or the upper boundary 150B) with samples in the same gradient direction. Mirror padding may refer to a process in which the video encoder 200 and the video decoder 300 mirror sample values ​​near the current boundary of the block to replace (i.e., replace) the actual sample values ​​of the unavailable samples.

[0146] If the unavailable sample is adjacent to a horizontal boundary (such as the upper boundary 150B), the video encoder 200 and the video decoder 300 may perform mirror padding to replace the sample value of the unavailable sample with the sample value of the sample on the same column as the unavailable sample and within the horizontal boundary. In particular, the video encoder 200 and the video decoder 300 may determine the vertical distance of the unavailable sample from the sample on the same column adjacent to the horizontal boundary. The video encoder 200 and the video decoder 300 may determine an available sample on the same column as the unavailable sample, which is at the same vertical distance as the sample on the same column adjacent to the horizontal boundary, but in the opposite direction of the sample on the same column adjacent to the horizontal boundary. The video encoder 200 and the video decoder 300 may replace the sample value of the unavailable sample with the sample value of the available sample on the same column, which is at the same vertical distance as the unavailable sample in the other direction from the sample on the same column adjacent to the horizontal boundary.

[0147] exist Figure 3BIn the example of , in the coordinate system L[y, x], given a sample at L[-1, 4] that is outside the upper boundary 150B and is therefore unavailable, the video encoder 200 and the video decoder 300 may determine the vertical distance between the unavailable sample and the sample on the same column adjacent to the upper boundary 150B at L[0, 4] as a vertical distance of 1. The video encoder 200 and the video decoder 300 may determine that the sample at L[1, 4] is a sample on the same column at an equal vertical distance from the sample at L[0, 4] in another direction, and may replace the sample value of the unavailable sample at L[-1, 4] with the sample value of the sample at L[1, 4], thereby performing mirror padding for the unavailable sample at L[-1, 4].

[0148] For example, in order to calculate the vertical gradient value of the sample 152A, the video encoder 200 and the video decoder 300 may use the sample 152A at the position L[0, x] as the center sample of three (3) consecutive samples along the vertical gradient direction. The other two samples of the three consecutive samples along the vertical direction with the sample 152A as the center sample are the adjacent sample 152B at the position L[1, x] immediately below the sample 152A in the vertical gradient direction and the adjacent sample 152C at the position L[-1, x] immediately above the sample 152A in the vertical gradient direction.

[0149] However, as in Figure 3B As can be seen in FIG. 1 , the adjacent sample 152C immediately above the sample 152A at the position L[-1, x] may not be available because the adjacent sample 152C is outside the upper boundary 150B of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152C is not available, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152C. In particular, the video encoder 200 and the video decoder 300 may determine that the sample 152B at the position L[-1, x] is a sample within the upper boundary 150B, which is on the same column as the unavailable sample 152B, and is at the same vertical distance as the unavailable sample 152C in the other direction from the sample 152A at the position L[0, x] on the same column adjacent to the upper boundary 150B. Therefore, the sample 152C is replaced by the sample at the position L[1, x], which is the sample 152B.

[0150] In another example, in order to calculate the 45-degree diagonal gradient value of the sample 152D, the video encoder 200 and the video decoder 300 may use the sample 152D at the position L[0, x] as the center sample of three (3) consecutive samples along the 45-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 45-degree gradient direction with the sample 152D as the center sample are the adjacent sample 152E at the position L[1, x+1] immediately below and to the right of the sample 152D in the 45-degree diagonal gradient direction and the adjacent sample 152F at the position L[-1, x-1] immediately above and to the left of the sample 152D in the 45-degree diagonal gradient direction.

[0151] However, as in Figure 3B As can be seen in FIG. 1 , the adjacent sample 152F immediately above and to the left of sample 152D at position L[-1, x-1] may be unavailable because it is outside the upper boundary 150B of block 148. According to aspects of the present disclosure, in response to determining that sample 152F is unavailable, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152F. In particular, the video encoder 200 and the video decoder 300 may determine that sample 153A at position L[1, x-1] is a sample within the upper boundary 150B, which is on the same column as the unavailable sample 152F, and is at the same vertical distance from the sample at position L[0, x-1] on the same column adjacent to the upper boundary 150B as the unavailable sample 152F in the other direction. Therefore, sample 152F is replaced with the sample at position L[1, x-1], which is sample 153A.

[0152] In another example, in order to calculate the 135-degree diagonal gradient value of the sample 152G, the video encoder 200 and the video decoder 300 may use the sample 152G at the position L[0, x] as the center sample of three (3) consecutive samples along the 135-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 135-degree gradient direction with the sample 152G as the center sample are the adjacent sample 152H at the position L[1, x-1] immediately below and to the left of the sample 152G in the 135-degree diagonal gradient direction and the adjacent sample 152I at the position L[-1, x+1] immediately above and to the right of the sample 152G in the 135-degree diagonal gradient direction.

[0153] However, as in Figure 3BAs can be seen in FIG. 1 , the adjacent sample 152I immediately above and to the right of sample 152G at position L[-1, x+1] may be unavailable because it is outside the upper boundary 150B of block 148. According to aspects of the present disclosure, in response to determining that sample 152I is unavailable, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152I. In particular, the video encoder 200 and the video decoder 300 may determine that sample 153B at position L[1, x+1] is a sample within the upper boundary 150B, which is on the same column as the unavailable sample 152I, and is at the same vertical distance from the sample at position L[0, x+1] on the same column adjacent to the upper boundary 150B as the unavailable sample 152I in the other direction. Therefore, sample 152I is replaced with a sample at position L[1, x+1], which is sample 153B.

[0154] In another example, to calculate the horizontal gradient value of sample 152J, the video encoder 200 and the video decoder 300 may use sample 152J at position L[0, x] as the center sample of three (3) consecutive samples along the horizontal gradient direction. The other two samples of the three consecutive samples along the horizontal direction with sample 152L as the center sample are adjacent sample 152K at position L[1, x+1] located immediately to the right of sample 152J in the horizontal gradient direction and adjacent sample 152L at position L[0, x-1] located immediately to the left of sample 152J in the horizontal gradient direction. Because samples 152J-152L are all within block 148 and are not outside left boundary 150A or upper boundary 150B, video encoder 200 and video decoder 300 may not have to replace any of samples 152J-152L to calculate the horizontal gradient value of sample 152J.

[0155] Similarly, if the unavailable sample is adjacent to a vertical boundary (such as the left boundary 150A), the video encoder 200 and the video decoder 300 may perform mirror padding to replace the sample value of the unavailable sample with the sample value of the sample in the same row as the unavailable sample and within the vertical boundary. In particular, the video encoder 200 and the video decoder 300 may determine the horizontal distance of the unavailable sample from the sample on the same row adjacent to the vertical boundary. The video encoder 200 and the video decoder 300 may determine the sample on the same row as the unavailable sample, which is the same horizontal distance from the sample on the same row adjacent to the vertical boundary, but in the opposite direction of the sample on the same row adjacent to the vertical boundary. The video encoder 200 and the video decoder 300 may replace the sample value of the unavailable sample with the sample value of the available sample on the same row, which is the same horizontal distance from the unavailable sample in the other direction as the sample on the same column adjacent to the vertical boundary in the other direction.

[0156] exist Figure 3B In the example of , in the coordinate system L[y, x], given a sample at L[y, -1] that is outside the left boundary 150A and is therefore unavailable, the video encoder 200 and the video decoder 300 may determine the horizontal distance between the unavailable sample and the sample on the same row adjacent to the left boundary 150A at L[y, 0] to be a horizontal distance of 1. The video encoder 200 and the video decoder 300 may determine that the sample at L[y, 1] is a sample on the same row at an equal horizontal distance from the sample at L[y, 0] in another direction, and may replace the sample value of the unavailable sample at L[y, -1] with the sample value of the sample at L[y, 1], thereby performing mirror padding for the unavailable sample at L[y, -1].

[0157] For example, in order to calculate the horizontal gradient value of the sample 152M, the video encoder 200 and the video decoder 300 may use the sample 152M at the position L[y, 0] as the center sample of three (3) consecutive samples along the horizontal gradient direction. The other two samples of the three consecutive samples along the horizontal direction with the sample 150M as the center sample are the adjacent sample 152N at the position L[y, 1] immediately to the right of the sample 152M in the horizontal gradient direction and the adjacent sample 152O at the position L[y, -1] immediately to the left of the sample 152M in the horizontal gradient direction.

[0158] However, as in Figure 3B As can be seen in FIG. 1 , the adjacent sample 152O immediately to the left of the sample 152M at the position L[y, −1] may not be available because the adjacent sample 152O is outside the left boundary 150A of the block 148. According to aspects of the present disclosure, in response to determining that the sample 152O is not available, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152O. In particular, the video encoder 200 and the video decoder 300 may determine that the sample 152N at the position L[y, 1] is a sample within the left boundary 150A, which is on the same row as the unavailable sample 152O and is at the same vertical distance from the sample at the position L[y, 0] on the same row adjacent to the left boundary 150A as the unavailable sample 152I in the other direction. Therefore, the sample 152O is replaced by the sample at the position L[y, 1], which is the sample 152N.

[0159] In another example, in order to calculate the 45-degree diagonal gradient value of the sample 152P, the video encoder 200 and the video decoder 300 may use the sample 152P at the position L[y, 0] as the center sample of three (3) consecutive samples along the 45-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 45-degree gradient direction with the sample 152P as the center sample are the adjacent sample 152Q at the position L[y+1, 1] immediately below and to the right of the sample 152P in the 45-degree diagonal gradient direction and the adjacent sample 152R at the position L[y-1, -1] immediately above and to the left of the sample 152P in the 45-degree diagonal gradient direction.

[0160] However, as in Figure 3B As can be seen in FIG. 1 , the adjacent sample 152R immediately above and to the left of sample 152P at position L[y-1, -1] may be unavailable because it is outside the left boundary 150A of block 148. According to aspects of the present disclosure, in response to determining that sample 152R is unavailable, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152R. In particular, the video encoder 200 and the video decoder 300 may determine that sample 154C at position L[y-1, 1] is a sample within the left boundary 150A, which is on the same row as the unavailable sample 152R and is at the same vertical distance as the unavailable sample 152R in the other direction from the sample at position L[y-1, 0] on the same row adjacent to the left boundary 150A. Therefore, sample 152R is replaced with the sample at position L[y-1, 1], which is sample 154C.

[0161] In another example, in order to calculate the 135-degree diagonal gradient value of the sample 152S, the video encoder 200 and the video decoder 300 may use the sample 152S at the position L[y, 0] as the center sample of three (3) consecutive samples along the 135-degree diagonal gradient direction. The other two samples of the three consecutive samples along the 135-degree gradient direction with the sample 152S as the center sample are the neighboring sample 152U at the position L[y-1, 1] immediately above and to the right of the sample 152S in the 135-degree diagonal gradient direction and the neighboring sample 152T at the position L[y+1, -1] immediately below and to the left of the sample 152S in the 135-degree diagonal gradient direction.

[0162] However, as in Figure 3BAs can be seen in FIG. 1 , the adjacent sample 152T immediately below and to the left of sample 152S at position L[y+1, −1] may be unavailable because it is outside the left boundary 150A of block 148. According to aspects of the present disclosure, in response to determining that sample 152T is unavailable, the video encoder 200 and the video decoder 300 may perform mirror padding to replace the unavailable sample 152T. In particular, the video encoder 200 and the video decoder 300 may determine that sample 154D at position L[y+1, 1] is a sample within the left boundary 150A, which is on the same row as the unavailable sample 152T, and is at the same vertical distance as the unavailable sample 152T in the other direction from the sample at position L[y+1, 0] on the same row adjacent to the left boundary 150A. Therefore, sample 152T is replaced with the sample at position L[y+1, 1], which is sample 154D.

[0163] In another example, to calculate the vertical gradient value of sample 152J, the video encoder 200 and the video decoder 300 may use sample 152V at position L[y, 0] as the center sample of three (3) consecutive samples along the vertical gradient direction. The other two samples of the three consecutive samples along the vertical direction with sample 152V as the center sample are adjacent sample 152W at position L[y+1, 0] immediately below sample 152V in the vertical gradient direction and adjacent sample 152X at position L[y-1, 0] immediately above sample 152V in the vertical gradient direction. Because samples 152V-152X are all within block 148 and are not outside left boundary 150A or upper boundary 150B, video encoder 200 and video decoder 300 may not have to replace any of samples 152V-152X to calculate the vertical gradient value of sample 152V.

[0164] In some examples, as described above, to perform ALF, video encoder 200 and video decoder 300 may determine a classification of a sample based at least in part on a gradient value of the sample, e.g., using Figure 3A and 3B In particular, the video encoder 200 and the video decoder 300 may be configured to determine one of a plurality of categories of ALF to be applied to a block of video data (e.g., a block of luma samples and / or chroma samples) based on a gradient value. In some examples, the video encoder 200 and the video decoder 300 are configured to apply the classification to each 4x4 luma block. The video encoder 200 and the video decoder 300 may be configured to classify each 4x4 block into one of 25 categories based on a determined directionality and quantization value of the activity of the block in order to select an adaptive loop filter for each block. The details are described below.

[0165] The video encoder 200 and the video decoder 300 may be configured to determine the classification of the ALF of the block based on the 1D Laplacian direction of the samples of the block and the 2D Laplacian activity of the samples of the block for each 4x4 luma block. In one example, the video encoder 200 and the video decoder 300 may be configured to calculate the sum of the gradients of each other sample within an 8×8 window covering the 4x4 luma block to determine the gradient value of the block. The video encoder 200 and the video decoder 300 may be configured to calculate four gradient values: g v The vertical gradient value represented by g h The horizontal gradient value represented by g d1 The 135 degree diagonal gradient value represented by g d2 Represents a 45 degree diagonal gradient value.

[0166] like Figure 4A As shown, the video encoder 200 and the video decoder 300 can calculate the gradient value for the samples in the 8x8 area (in Figure 4A Calculating the gradient value of the sample may include calculating the value of each of the vertical gradient, the horizontal gradient, the 45-degree diagonal gradient, and the 135-degree diagonal gradient in the same manner.

[0167] In some examples, the video encoder and video decoder 300 may calculate gradient values ​​for all samples in the 8x8 region or for less than all samples in the 8x8 region. For example, to calculate gradient values ​​for less than all samples in the 8x8 region, the video encoder 200 and video decoder 300 may calculate gradient values ​​for every other sample in the 8x8 region, such as Figure 4A As shown, instead of calculating a gradient value for every sample in the 8x8 region, a gradient value is calculated for every sample in the 8x8 region. In some examples, determining a gradient value for less than all samples in the 8x8 region (e.g., for every other sample) as opposed to determining a gradient value for every sample in the 8x8 region can be referred to as "subsampling," and gradient values ​​determined for less than all samples in the 8x8 region can be referred to as "subsampled gradients."

[0168] In current VVC, 4x4 blocks (such as in Figure 4A The subsampled gradients are accumulated in an 8x8 surrounding window (such as region 172) as shown in FIG. Figure 4A170 is shown as not shaded. In one example, the video encoder 200 and the video decoder 300 determine the activity of the block 170 as the sum of the vertical gradient and the horizontal gradient on the region 172. The video encoder 200 and the video decoder 300 quantize the value to produce five activity values. In addition, the video encoder 200 and the video decoder 300 determine the main gradient direction in the block 170 by comparing the directional gradients, and determine the directional strength in addition, which gives five directional values. These two features together produce 25 categories.

[0169] However, the portion of region 172 outside block 170 may also exceed the horizontal boundary or vertical boundary of block 170, and thus the gradient outside the horizontal boundary or vertical boundary of block 170 may not be available for determining the sum of gradients over region 172. For example, the portion of region 172 outside block 170 on the other side of the horizontal boundary or vertical boundary of block 170 exceeds the horizontal boundary or vertical boundary. Examples of horizontal boundaries and vertical boundaries may include picture boundaries, slice boundaries, tile boundaries, tile group boundaries, etc., as discussed throughout this disclosure. Therefore, aspects of the present disclosure are applicable to non-CTU boundaries, such as picture boundaries (i.e., boundaries of video data frames) or virtual boundaries.

[0170] One technique for potentially overcoming this problem involves using padding samples to determine the gradient of unavailable samples. For example, for the current sample A in block 170, if the video encoder 200 and the video decoder 300 need a sample B located on the other side of the horizontal or vertical boundary relative to sample A, the video encoder 200 and the video decoder 300 can replace the value of sample B with the nearest sample of sample B on the side of sample A in block 170. Such replacement samples can be referred to as padding samples. However, these techniques may potentially introduce a loss of subjective and / or objective quality. For example, padding may potentially introduce discontinuities in the reconstructed video data that may not appear if actual sample values ​​are used.

[0171] According to various aspects of the present disclosure, instead of replacing gradients outside the boundaries of a picture, slice, tile, or tile group with padding samples, these gradients are replaced with gradients within the boundaries of the picture, slice, tile, or tile group. In some examples, gradients outside the boundaries can be replaced with gradients within the boundaries, even if the gradients within the boundaries are outside the 4x4 block 170.

[0172] like Figure 4BAs shown, if the gradient is outside the horizontal boundary 174 of the picture, slice, tile, or tile group, the nearest gradient on the same column of the picture, slice, tile, or tile group is used. In particular, samples 160A-160H are outside the horizontal boundary 174 because samples 160A-160H are on the other side of the horizontal boundary 174 of the block 170. Therefore, the gradients of samples 160A-160H are not available for classifying the block 170 based at least in part on accumulating the subsampled gradients in the 8x8 surrounding area 172 of the block 170.

[0173] According to various aspects of the present disclosure, video encoder 200 and video decoder 300 may replace the gradient in region 172 outside horizontal boundary 174 with the nearest gradient in the same column in region 172 within horizontal boundary 174 (i.e., on the same side of horizontal boundary 174 as block 170). Figure 4B In the example of , the video encoder 200 and the video decoder 300 may replace the gradient of the sample 160A outside the horizontal boundary 174 with the gradient of the sample 160I inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 160I to the sample 160A. The video encoder 200 and the video decoder 300 may replace the gradient of the sample 160E outside the horizontal boundary 174 with the gradient of the sample 160K inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 160K to the sample 160E.

[0174] The video encoder 200 and the video decoder 300 may replace the gradient of the sample 160B outside the horizontal boundary 174 with the gradient of the sample 162A inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 162A to the sample 160B. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160F outside the horizontal boundary 174 with the gradient of the sample 162C inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 162C to the sample 160F. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160C outside the horizontal boundary 174 with the gradient of the sample 162B inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 162B to the sample 160C. Video encoder 200 and video decoder 300 may also replace the gradient of sample 160G outside horizontal boundary 174 with the gradient of sample 162D within horizontal boundary 174 , as indicated by the arrow pointing from sample 162D to sample 160G.

[0175] The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160D outside the horizontal boundary 174 with the gradient of the sample 160J inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 160J to the sample 160D. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160H outside the horizontal boundary 174 with the gradient of the sample 160L inside the horizontal boundary 174, as indicated by the arrow pointing from the sample 160L to the sample 160H.

[0176] like Figure 4C As shown, if the gradient is outside of vertical boundary 176, the nearest gradient on the same row in the picture, slice, tile, or tile group defined by vertical boundary 176 is used. In particular, sample 160A, sample 160E, sample 160I, sample 160K, sample 160M, sample 160O, sample 160Q, and sample 160U are outside of vertical boundary 176 because sample 160A, sample 160E, sample 160I, sample 160K, sample 160M, sample 160O, sample 160Q, and sample 160U are on the other side of vertical boundary 176 of block 170. Therefore, the gradients of sample 160A, sample 160E, sample 160I, sample 160K, sample 160M, sample 160O, sample 160Q, and sample 160U are not available for classifying block 170 based at least in part on accumulating subsampled gradients in 8x8 surrounding region 172 of block 170.

[0177] According to various aspects of the present disclosure, video encoder 200 and video decoder 300 may replace the gradient in region 172 outside vertical boundary 176 with the nearest gradient in the same row in region 172 inside vertical boundary 176 (i.e., on the same side of vertical boundary 176 as box 170). Figure 4C In the example of , the video encoder 200 and the video decoder 300 may replace the gradient of the sample 160A outside the vertical boundary 176 with the gradient of the sample 160B inside the vertical boundary 176, as represented by the arrow pointing from the sample 160B to the sample 160A. The video encoder 200 and the video decoder 300 may replace the gradient of the sample 160E outside the vertical boundary 176 with the gradient of the sample 160F inside the vertical boundary 176, as represented by the arrow pointing from the sample 160F to the sample 160E.

[0178] The video encoder 200 and the video decoder 300 may replace the gradient of the sample 160I outside the vertical boundary 176 with the gradient of the sample 162A inside the vertical boundary 176, as indicated by the arrow pointing from the sample 162A to the sample 160I. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160K outside the vertical boundary 176 with the gradient of the sample 162C inside the vertical boundary 176, as indicated by the arrow pointing from the sample 162C to the sample 160K. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160M outside the vertical boundary 176 with the gradient of the sample 162E inside the vertical boundary 176, as indicated by the arrow pointing from the sample 162E to the sample 160M. Video encoder 200 and video decoder 300 may also replace the gradient of sample 160O outside vertical boundary 176 with the gradient of sample 162G within vertical boundary 176 , as represented by the arrow pointing from sample 162G to sample 160O.

[0179] The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160Q outside the vertical boundary 176 with the gradient of the sample 160R inside the vertical boundary 176, as indicated by the arrow pointing from the sample 160R to the sample 160Q. The video encoder 200 and the video decoder 300 may also replace the gradient of the sample 160U outside the vertical boundary 176 with the gradient of the sample 160V inside the vertical boundary 176, as indicated by the arrow pointing from the sample 160V to the sample 160U.

[0180] In another example, the video encoder 200 and the video decoder 300 may calculate additional gradients in a picture, slice, tile, or tile group to replace unavailable gradients outside of the picture, slice, tile, or tile group. As described above, the video encoder 200 and the video decoder 300 may calculate gradients for every other sample in the 8x8 region 172, including calculating gradients for every other sample in the block 170, thereby calculating gradients for eight of the sixteen samples in the block 170. In addition, as Figure 4B and 4C As shown, horizontal boundary 174 and vertical boundary 176 may each cause eight gradients in region 172 outside horizontal boundary 174 or vertical boundary 176 to be unavailable. Therefore, video encoder 200 and video decoder 300 may replace the eight unavailable gradients by calculating eight additional gradients for eight additional samples in block 170.

[0181] like Figure 4DAs shown, samples 160A-160H are outside horizontal boundary 174 because samples 160A-160H are on the other side of horizontal boundary 174 of block 170. Therefore, the gradients of samples 160A-160H are not available for classifying block 170 based at least in part on accumulating subsampled gradients in 8x8 surrounding region 172 of block 170.

[0182] According to various aspects of the present disclosure, when calculating subsampled gradient values, the video encoder 200 and the video decoder 300 may replace unavailable gradients by calculating eight additional gradients for eight samples in the block 170. For example, the video encoder 200 and the video decoder 300 may calculate gradients for samples 162I-162P within the block 170, and may use the gradients of samples 162I-162P to replace unavailable gradients of samples 160A-160H to perform classification of the block 170.

[0183] Similarly, if Figure 4E As shown, samples 160A, 160E, 160I, 160K, 160M, 160O, 160Q, and 160U are outside vertical boundary 176 because samples 160A, 160E, 160I, 160K, 160M, 160O, 160Q, and 160U are on the other side of vertical boundary 176 of block 170. Therefore, the gradients of samples 160A, 160E, 160I, 160K, 160M, 160O, 160Q, and 160U are not available for classifying block 170 based at least in part on accumulating subsampled gradients in an 8x8 surrounding region 172 of block 170.

[0184] According to various aspects of the present disclosure, when calculating subsampled gradient values, the video encoder 200 and the video decoder 300 may replace unavailable gradients by calculating eight additional gradients for eight samples in the block 170. For example, the video encoder 200 and the video decoder 300 may calculate gradients for samples 162I-162P within the block 170, and may use the gradients of samples 162I-162P to replace unavailable gradients of samples 160A, 160E, 160I, 160K, 160M, 160O, 160Q, and 160U to perform classification of the block 170.

[0185] In another example, if the gradient is outside the boundary, the nearest gradient in the same gradient direction in the picture, slice, tile, or tile group is used. This can apply to horizontal gradients, vertical gradients, and diagonal gradients.

[0186] like Figure 4FAs shown, region 172 may include a 135 degree diagonal gradient, denoted as “D1.” Thus, gradients outside of the boundary may be replaced with the nearest gradient in the same 135 degree diagonal direction.

[0187] exist Figure 4F , for region 172 having horizontal boundary 174, samples 160A-160H are outside horizontal boundary 174 because samples 160A-160H are on the other side of horizontal boundary 174 of block 170. Therefore, the gradients of samples 160A-160H are not available for classifying block 170 based at least in part on accumulating subsampled gradients in 8x8 surrounding region 172 of block 170.

[0188] According to various aspects of the present disclosure, video encoder 200 and video decoder 300 may replace the gradient in region 172 outside horizontal boundary 174 with the nearest gradient in the same gradient direction in region 172 within horizontal boundary 174 (i.e., on the same side of horizontal boundary 174 as block 170).

[0189] because Figure 4F Region 172 is shown as having 135 degree diagonal gradients (each gradient represented by “D1”), so each unavailable gradient of samples 160A-160H is a 135 degree diagonal gradient, and video encoder 200 and video decoder 300 can replace each unavailable gradient of samples 160A-160H with the nearest available gradient along the 135 degree diagonal gradient.

[0190] Sample 162A is along the same 135 degree diagonal direction as samples 160A and 160E. Thus, the 135 degree diagonal gradient of both samples 160A and 160E can be replaced by the 135 degree diagonal gradient of sample 162A, as indicated by the arrow pointing from sample 162A to samples 160A and 160E.

[0191] Sample 162B is along the same 135 degree diagonal direction as samples 160B and 160F. Thus, the 135 degree diagonal gradient of both sample 160B and sample 160F can be replaced with the 135 degree diagonal gradient of sample 162B, as indicated by the arrow pointing from sample 162B to samples 160B and 160F.

[0192] Sample 160J is along the same 135 degree diagonal direction as samples 160C and 160G. Therefore, the 135 degree diagonal gradient of both samples 160C and 160G can be replaced by the 135 degree diagonal gradient of sample 160J, as indicated by the arrows pointing from sample 160J to samples 160C and 160G.

[0193] like Figure 4GAs shown, region 172 may also include a 45 degree diagonal gradient, denoted as “D2.” Thus, the gradient outside of the boundary may be replaced with the nearest gradient in the same 45 degree diagonal direction.

[0194] exist Figure 4G , for region 172 having horizontal boundary 174, samples 160A-160H are outside horizontal boundary 174 because samples 160A-160H are on the other side of horizontal boundary 174 of block 170. Therefore, the gradients of samples 160A-160H are not available for classifying block 170 based at least in part on accumulating subsampled gradients in 8x8 surrounding region 172 of block 170.

[0195] According to various aspects of the present disclosure, video encoder 200 and video decoder 300 may replace the gradient in region 172 outside horizontal boundary 174 with the nearest gradient in the same gradient direction in region 172 within horizontal boundary 174 (i.e., on the same side of horizontal boundary 174 as block 170).

[0196] because Figure 4G Region 172 is shown as having 45 degree diagonal gradients (each gradient represented by “D2”), so each unavailable gradient of samples 160A-160H is a 45 degree diagonal gradient, and video encoder 200 and video decoder 300 can replace each unavailable gradient of samples 160A-160H with the nearest available gradient along the 45 degree diagonal gradient.

[0197] Sample 160I is along the same 45 degree diagonal direction as samples 160B and 160E. Thus, the 45 degree diagonal gradient of both samples 160B and 160E may be replaced with the 45 degree diagonal gradient of sample 160I, as indicated by the arrows pointing from sample 160I to samples 160B and 160E.

[0198] Sample 162A is along the same 45 degree diagonal direction as samples 160C and 160F. Thus, the 45 degree diagonal gradient of both samples 160C and 160F may be replaced with the 45 degree diagonal gradient of sample 162A, as indicated by the arrows pointing from sample 162A to samples 160C and 160F.

[0199] Sample 162B is along the same 45 degree diagonal direction as samples 160D and 160G. Thus, the 45 degree diagonal gradient of both samples 160D and 160G may be replaced with the 45 degree diagonal gradient of sample 162B, as indicated by the arrow pointing from sample 162B to samples 160D and 160G.

[0200] Sample 160J is along the same 135 degree diagonal direction as sample 160H. Thus, the 45 degree diagonal gradient of sample 160H may be replaced with the 45 degree diagonal gradient of sample 160J, as indicated by the arrow pointing from sample 160J to sample 160H.

[0201] In another example, the video encoder 200 and the video decoder 300 may avoid computing gradients outside of the picture / slice / tile / tile group. Alternatively, the video encoder 200 and the video decoder 300 may use less than all of the subsampled gradients in the region 172 to perform classification of the block 170 .

[0202] like Figure 4H As shown, for the region 172 having the horizontal boundary 174, the samples 160A-160H are outside the horizontal boundary 174 because the samples 160A-160H are on the other side of the horizontal boundary 174 of the block 170. Therefore, the gradients of the samples 160A-160H are not available for classifying the block 170 based at least in part on accumulating the subsampled gradients in the 8x8 surrounding region 172 of the block 170. Therefore, the video encoder 200 and the video decoder 300 can avoid determining the gradients of the samples 160A-160H. Instead, the video encoder 200 and the video decoder 300 can calculate the gradients of the samples 160I-160X and the samples 162A-162H to classify the block 170.

[0203] Since the number of gradients is changed, the video encoder 200 and the video decoder 300 can renormalize the activity and classification calculations. In particular, because Figure 4H The video encoder 200 and the video decoder 300 in the example of do not calculate the gradients of the unavailable eight samples, so the video encoder 200 and the video decoder 300 can calculate the gradients of 24 samples in the region 172 instead of the gradients of 32 samples.

[0204] In one example, to determine the gradient value ( g ), the video encoder 200 and the video decoder 300 may be configured to determine the vertical gradient (g v ), horizontal gradient ( g h )、135 degree diagonal gradient( g d1 ) and a 45-degree diagonal gradient ( g d2 ). In addition, in order to scale the gradient value based on the scaling factor ( g ) to produce a scaled gradient value ( g’ ), the video encoder 200 and the video decoder 300 may scale the gradient value using the following equation ( g ): g' = g / num_available_samples * num_ full_samples , where num_available_samples represents the number of unfilled samples in the window (e.g., the number of available samples in the window that are on the same side of the virtual boundary as the reconstructed block), and num_full_sample represents the total number of samples in the window. Figure 4H In the example where gradients for 8 samples are not available, num_available_samples may be 24 and num_full_samples may be 32.

[0205] As described above, video encoder 200 and video decoder 300 may determine an adaptive loop filter for a reconstructed block of video data, such as block 170, based on subsampled gradients calculated in a surrounding window, such as region 172, such as with respect to Figures 4A-4H In one example, the video encoder 200 and the video decoder 300 may determine a directionality and an activity index of a block based on sub-sampled gradients calculated in a surrounding window, and may determine an adaptive loop filter for the block based on the directionality and activity index of the block.

[0206] Figure 5 An example adaptive loop filter is shown. For example, the video encoder 200 and the video decoder 300 may be based on the video data block (such as Figure 5 170A) of the block 170A shown in the figure, filter 184 can be a symmetric filter, such as a 7x7 diamond filter. In other examples, the technology can be equally applicable to any other symmetric filter, such as a 5x5 diamond filter, a 9x9 diamond filter, etc., including a rectangular filter, an octagonal filter, a cross filter, an X-shaped filter, a T-shaped filter, or any other symmetric filter. Filter support 180A of filter 184 corresponds to samples within horizontal boundary 182 and can therefore be available, while filter support 180B of filter 184 corresponds to samples outside horizontal boundary 182 and can therefore be unavailable.

[0207] In one example, the video encoder 200 and the video decoder 300 may use an asymmetric partial filter to filter samples of the reconstructed video data block. In this case, the video encoder 200 and the video decoder 300 may filter only the taps corresponding to the available samples to filter the samples, thereby skipping the filter taps whose corresponding samples are unavailable. As described below, the video encoder 200 and the video decoder 300 may perform renormalization due to skipping the filter taps whose corresponding samples are unavailable.

[0208] According to various aspects of the present disclosure, a video encoder can use the available filter support 180A of the filter 184 as an asymmetric partial filter, and as part of performing ALF, the video encoder 200 and the video decoder 300 can apply the asymmetric partial filter to the reconstructed samples to generate filtered samples. By using the available filter support 180A of the filter 184, the video encoder 200 and the video decoder 300 can skip the filter taps whose corresponding samples are not available, such as in the filter support 180B. A partial filter is a filter that does not use one or more filter coefficients that are typically used in the filtering process. In this way, a filter can be generated from the available samples of the filter while skipping the filter taps whose corresponding samples are not available. The video encoder 200 and the video decoder 300 can renormalize the asymmetric partial filter.

[0209] Typically, the sum of the filter coefficients of the selected filter is one (meaning that the filter coefficients are normalized) so that video data is not added or removed by applying the filter. By skipping or removing the filter coefficients of the selected filter to determine the partial filter (because one or more filter coefficients are removed from the initially selected filter, it is again referred to as a "partial" filter), the resulting partial filter becomes non-normalized (meaning that the sum of the filter coefficients of the partial filter is not one). Therefore, the video encoder 200 and the video decoder 300 can renormalize the multiple filter coefficients included in the partial filter so that the sum of the filter coefficients is one, for example, by scaling each filter coefficient in the partial filter. Then, the video encoder 200 and the video decoder 300 can apply the renormalized partial filter near the boundary of the first block of video data to generate the first block of filtered video data. The video encoder 200 and the video decoder 300 can store the first block of filtered video data for use as reference video data when reconstructing other blocks of video data. The video encoder 200 and the video decoder 300 can apply the generated filter to samples in, for example, a reconstructed video data block (such as in block 170) to generate filtered samples.

[0210] In one example, the video encoder 200 and the video decoder 300 may use mirror sample padding to replace filter coefficients corresponding to unavailable samples with filter coefficients corresponding to available samples. In mirror padding, the filter support of the filter corresponding to the unavailable samples (e.g., having the same size and the same shape when flipped) may be replaced with the corresponding filter support of the filter corresponding to the available samples. Figure 5In the example of , the video encoder 200 and the video decoder 300 can generate a symmetric filter by performing mirror padding to replace the filter support 180B with, for example, the filter support 180C of the filter 184 corresponding to the available samples, so that the filter coefficients in the filter support 180C are used instead of the filter coefficients of the filter support 180B. The video encoder 200 and the video decoder 300 can apply the generated filter to samples in, for example, a reconstructed video data block (such as in block 170) to generate filtered samples.

[0211] In another example, the video encoder 200 and the video decoder 300 may use a symmetric partial filter to filter the video data block. In this case, the video encoder 200 and the video decoder 300 may not only skip the filter taps whose corresponding samples are unavailable, but the video encoder 200 and the video decoder 300 may also skip one or more filter taps corresponding to available samples to generate a symmetric partial filter. As described above, the video encoder 200 and the video decoder 300 may perform renormalization due to skipping filter taps.

[0212] Figure 6 An example adaptive loop filter is shown. Figure 6 As shown, filter support 190A of filter 194 is within horizontal boundary 192, while filter support 190B of filter 194 is outside horizontal boundary 192 and, therefore, may be unavailable. According to various aspects of the present disclosure, a video decoder may use available filter support 190A of filter 194 to generate a symmetric partial filter. In particular, the video decoder may determine a symmetric portion 190C of available filter support 190A of filter 194 as a symmetric partial filter, e.g., by truncating filter support 190D of available filter support 190A from filter 194, where filter support 190D of filter 194 corresponds to (e.g., has the same size and the same shape when flipped) unavailable filter support 190B of filter 194. For example, in Figure 6 , each sample in 190B and 190D is replaced by the most recent sample in 190C. The sample at C1 is replaced by the sample at C5, the samples at C0 and C2 are replaced by the sample at C6, and the sample at C3 is replaced by the sample at C7.

[0213] In this manner, the video encoder 200 and the video decoder 300 can generate a filter from available samples of the filter while skipping filter taps whose corresponding samples are unavailable. The video encoder 200 and the video decoder 300 can renormalize the symmetric partial filter so that, for example, the sum of the filter coefficients of the symmetric partial filter is unity. The video encoder 200 and the video decoder 300 can apply the generated filter to samples in, for example, a reconstructed block of video data (such as in block 170) to generate filtered samples.

[0214] In some examples, the video encoder 200 and the video decoder 300 may perform filtering of the video data including weighted summation. In particular, the weighted summation is a weighted average process added after the filtering process for those samples that use one or more unavailable samples during filtering (e.g., samples in a picture / slice / tile / tile group, as described throughout the present disclosure). The final ALF output sample is a weighted average of the filtered sample and the ALF input sample (e.g., samples after the ALF and samples of the reconstructed video data block before the ALF, respectively). The video encoder 200 and the video decoder 300 may apply (i.e., multiply) a first weight to the sample value of the sample of the reconstructed video data block before the ALF, and may apply (i.e., multiply) a second weight to the sample value of the sample after the ALF, wherein the sum of the two weights is one. The video encoder 200 and the video decoder 300 may add the two weighted samples and divide the sum by two to determine the weighted average of the sample.

[0215] In one example, the weights of the filtered samples may be fixed for all samples. For example, when the first weight is fixed to a first value and the second weight is fixed to a second value for all samples, and when the sum of the two weights is one, the video encoder 200 and the video decoder 300 may apply the first weight to the sample value of the sample before the ALF and the second weight to the sample value of the sample after the ALF for each sample, add the two weighted samples, and divide the sum by two to generate a final value for the sample.

[0216] In another example, the weights of the filtered samples may depend on the number of unavailable samples used during the filtering process. The greater the number of unavailable samples used during the filtering process, the greater the weight applied to the samples of the reconstructed video data block before the ALF (compared to the weight applied to the same samples after the ALF). For example, if no unavailable samples were used during the filtering process of the samples during the ALF, the first weight applied to the samples before the ALF may be zero, and the second weight applied to the samples after the ALF may be one. On the other hand, the first weight may be increased according to the number of unavailable samples used during the filtering process of the samples, and the second weight may be correspondingly reduced according to the number of unavailable samples used during the filtering process.

[0217] In another example, the weights of the filtered samples may be adaptively signaled, such as at a sequence / picture / slice / tile / tile group / CTU level. For example, the encoder 200 may adaptively signal both the first weight and the second weight to the decoder 300, such as at a sequence / picture / slice / tile / tile group / CTU level.

[0218] In some examples, the video encoder 200 and the video decoder 300 can conditionally disable filtering for samples that are filtered using unavailable samples (e.g., samples in a picture, slice, tile, or tile group). In one example, for a current sample to be filtered, if the absolute sum of the coefficients corresponding to the unavailable samples is greater than a threshold multiplied by the absolute sum of the coefficients corresponding to the available samples, the video encoder 200 and the video decoder 300 can disable the filter for the current sample. The threshold can be fixed, adaptively determined, or signaled (e.g., in a bitstream sent by the video encoder 200 to the video decoder 300). Examples of the threshold include 0.6 or can be any suitable value, such as between 0 and 1.

[0219] Figure 7 is a block diagram illustrating an example video encoder 200 that may perform the techniques of this disclosure. Figure 7 The above description is provided for the purpose of explanation and should not be considered to limit the techniques generally exemplified and described in this disclosure. For the purpose of explanation, this disclosure describes a video encoder 200 according to the techniques of JEM, VVC (ITU-T H.266 under development), and HEVC (ITU-T H.265). However, the techniques of this disclosure may be performed by a video encoding device configured for other video coding standards.

[0220] exist Figure 7In the example of , the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any 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 filter unit 216, the DPB 218, and the entropy coding unit 220 can be implemented in one or more processors or in processing circuits. For example, the units of the video encoder 200 can be implemented as one or more circuits or logic elements, as part of a hardware circuit, or as part of a processor, ASIC, or FPGA. In addition, the video encoder 200 may include additional or alternative processors or processing circuits to perform these and other functions. In some examples, video encoder 200 may be part of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0221] Video data memory 230 may store video data to be encoded by components of video encoder 200. Video encoder 200 may receive video data from, for example, video source 104 ( Figure 1 ) receives 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 when subsequent video data is predicted by the video encoder 200. The video data memory 230 and the DPB 218 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM)), magnetoresistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. The video data memory 230 and the DPB 218 can be provided by the same memory device or a separate memory device. 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.

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

[0223] Shows Figure 7 The various units of the video encoder 200 are provided to help understand the operations performed by the video encoder 200. These units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide specific functions and are pre-set with respect to the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions with the operations that can be performed. For example, a programmable circuit may 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 may execute software instructions (e.g., to receive parameters or output parameters), but the types of operations performed by fixed-function circuits are generally immutable. In some examples, one or more of these units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more of these units may be integrated circuits.

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

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

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

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

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

[0229] 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 an overlapping portion of a PU and a TU in HEVC). In order to inter-predict 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 decoded pictures stored in the DPB 218). Specifically, the motion estimation unit 222 may calculate a value representing how similar a potential reference block will be to the current block, for example, based on the sum of absolute differences (SAD), the sum of squared differences (SSD), the mean absolute difference (MAD), the mean squared difference (MSD), etc. The motion estimation unit 222 may typically perform these calculations using the sample-by-sample difference between the current block and the reference block under consideration. The motion estimation unit 222 may identify the reference block with the lowest value resulting from these calculations, which indicates the reference block that most closely matches the current block.

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

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

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

[0233] In an example where the mode selection unit 202 partitions the CU into PUs, each PU may be associated with a luma prediction unit and a corresponding chroma prediction unit. The video encoder 200 and the video decoder 300 may support PUs of various sizes. As noted above, the size of the CU may refer to the size of the luma coding block of the CU, and the size of the PU may refer to the size of the luma prediction unit of the PU. Assuming that the size of a particular CU is 2Nx2N, the video encoder 200 may support PU sizes of 2Nx2N or NxN for intra-frame prediction, and 2Nx2N, 2NxN, Nx2N, NxN or similar symmetrical PU sizes for inter-frame prediction. The video encoder 200 and the video decoder 300 may also support asymmetric partitioning for PU sizes of 2NxnU, 2NxnD, nLx2N, and nRx2N for inter-frame prediction.

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

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

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

[0237] 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, for example, 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.

[0238] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to produce a quantized transform coefficient block. The quantization unit 208 may quantize the transform coefficients of the transform coefficient block according to a quantization parameter (QP) value associated with the current block. The video encoder 200 (e.g., via the mode selection unit 202) may adjust the degree of quantization applied to the transform coefficient block associated with the current block by adjusting the QP value associated with the CU. Quantization may cause a loss of information, and therefore, the quantized transform coefficients may have a lower precision than the original transform coefficients produced by the transform processing unit 206.

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

[0240] Filter unit 216 may perform one or more SAO, GALF, ALF, and / or deblocking operations on the reconstructed coding blocks associated with the CU. For example, filter unit 216 may perform a deblocking operation to reduce blocking artifacts along the edges of the CU. In some examples, the operation of filter unit 216 may be skipped.

[0241] In particular, the filter unit 216 may be configured to perform the ALF and GALF techniques of the present disclosure described above. For example, the filter unit 216 may be configured to determine the value of the gradient of the samples in the reconstructed coding block, including performing gradient calculations on the samples using unavailable samples other than one of the following: a picture, slice, tile, or tile group including the reconstructed sample block; determining an adaptive loop filter for the reconstructed coding block based at least in part on the value of the gradient of the determined samples; and applying the determined adaptive loop filter to the reconstructed coding block to generate a filtered video data block.

[0242] In some examples, filter unit 216 can be configured to: determine a gradient value of a window covering a reconstructed coding block, the window including samples of the reconstructed video data block and samples surrounding the reconstructed video data block, including using unavailable samples to perform gradient calculations, for example, according to the techniques of the present disclosure; and determine an adaptive loop filter for the reconstructed coding block based at least in part on the determined gradient value of the window. This can, for example, include replacing unavailable gradient values ​​of samples within the window outside the boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary, wherein one of the picture, a slice, a tile, or a tile group includes the reconstructed coding block, for example, according to the techniques of the present disclosure.

[0243] In some examples, filter unit 216 may be configured to avoid including in the gradient value of the window an unavailable gradient value of a sample within the window outside a boundary of one of a picture, a slice, a tile, or a tile group, wherein one of the picture, the slice, the tile, or the tile group includes the reconstructed video data block. Since the unavailable gradient value of the sample within the window is not included in the gradient value of the window, filter unit 216 may normalize the gradient value of the window.

[0244] In some examples, the filter unit 216 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, determine the partial filter according to the adaptive loop filter that does not use the filter support corresponding to the unavailable sample, wherein the partial filter includes one of an asymmetric partial filter or a symmetric partial filter. In other examples, the filter unit 216 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, perform mirror padding to replace the filter support corresponding to the unavailable sample.

[0245] In some examples, filter unit 216 can be configured to conditionally disable filtering of particular samples of the reconstructed coding block based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether gradient values ​​for a window covering the reconstructed video data block includes determining one or more gradient values ​​for one or more samples within the window outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed video data block is within the boundary.

[0246] In some examples, filter unit 216 can be configured to determine a weighted average of samples of a particular sample in the reconstructed block and the filtered block of video data based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether gradient values ​​for a window covering the reconstructed block of video data includes determining one or more gradient values ​​for one or more samples within the window outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data is within the boundary.

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

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

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

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

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

[0252] The video encoder 200 represents an example of a device configured to encode video data, the device comprising: a memory configured to store the video data; and one or more processing units implemented in circuits and configured to: reconstruct a block of video data to create a reconstructed block of video data; determine values ​​of gradients of samples in the reconstructed block of video data, including performing gradient calculations for samples using unavailable samples other than one of the following: a picture, slice, tile, or tile group that includes the reconstructed block of samples; determine an adaptive loop filter for the reconstructed block of video data based at least in part on the values ​​of the gradients of the determined samples; and apply the determined adaptive loop filter to the reconstructed block of video data to generate a filtered block of video data.

[0253] Figure 8 is a block diagram illustrating an example video decoder 300 that may perform the techniques of this disclosure. Figure 8 It is provided for purposes of explanation and not limitation of the techniques broadly illustrated and described in this disclosure.

[0254] In the example of FIG. 4 , the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any 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 filter unit 312, and the DPB 314 may be implemented in one or more processors or in a processing circuit. For example, the units of the video decoder 300 may be implemented as one or more circuits or logic elements as part of a hardware circuit, or as part of a processor, ASIC, or FPGA. In addition, the video decoder 300 may include additional or alternative processors or processing circuits to perform these and other functions. In some examples, the video decoder 300 may be part of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

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

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

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

[0258] Shows Figure 8 The various units shown in FIG. 3 are used to help understand the operations performed by the video decoder 300. These units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. Figure 7, fixed-function circuits refer to circuits that provide specific functions and are pre-set with respect to the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functions with respect to 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., to receive parameters or output parameters), but the types of operations performed by fixed-function circuits are generally immutable. In some examples, one or more of these units may be different circuit blocks (fixed-function or programmable), and in some examples, one or more of these units may be integrated circuits.

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

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

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

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

[0263] After the inverse quantization unit 306 forms the transform coefficient block, the inverse transform processing unit 308 may apply one or more inverse transforms to the transform coefficient block to generate a residual block associated with the current block. For example, the inverse transform processing unit 308 may apply an inverse DCT, an inverse integer transform, an inverse Karhunen-Loeve transform (KLT), an inverse rotational transform, an inverse directional transform, or another inverse transform to the transform coefficient block.

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

[0265] As another example, if the prediction information syntax element indicates that the current block is intra-predicted, the intra-prediction unit 318 may generate a prediction block according to the intra-prediction mode indicated by the prediction information syntax element. Again, the intra-prediction unit 318 may generally generate a prediction block in the same manner as described with respect to the intra-prediction unit 226 ( Figure 7 The intra prediction process is performed in a manner substantially similar to that described in the foregoing. The intra prediction unit 318 may retrieve data of neighboring samples of the current block from the DPB 314.

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

[0267] The filter unit 312 may perform one or more filter operations on the reconstructed block. For example, the filter unit 312 may perform a deblocking operation to reduce block artifacts along the edges of the reconstructed block. The operation of the filter unit 312 may not necessarily be performed in all examples. In particular, the filter unit 312 may be configured to perform the ALF and GALF techniques of the present disclosure described above. For example, the filter unit 312 may be configured to determine the value of the gradient of the sample in the reconstructed decoding block, including using unavailable samples other than one of the following items to perform gradient calculations on the sample: a picture, slice, tile, or tile group including the reconstructed sample block; determining an adaptive loop filter for the reconstructed decoding block based at least in part on the value of the gradient of the determined sample; and applying the determined adaptive loop filter to the reconstructed decoding block to generate a filtered video data block.

[0268] In some examples, the filter unit 312 can be configured to: determine a gradient value of a window covering the reconstructed coding block, the window including samples of the reconstructed video data block and samples surrounding the reconstructed video data block, including using unavailable samples to perform gradient calculations, for example, according to the techniques of the present disclosure; and determine an adaptive loop filter for the reconstructed coding block based at least in part on the determined gradient value of the window. This can, for example, include replacing unavailable gradient values ​​of samples within the window outside the boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary, wherein one of the picture, a slice, a tile, or a tile group includes the reconstructed coding block, for example, according to the techniques of the present disclosure.

[0269] In some examples, filter unit 312 may be configured to avoid including in the gradient value of the window unavailable gradient values ​​of samples within the window outside the boundary of one of the picture, slice, tile, or tile group, wherein one of the picture, slice, tile, or tile group includes the reconstructed video data block. Since unavailable gradient values ​​of samples within the window are not included in the gradient value of the window, filter unit 216 may normalize the gradient value of the window.

[0270] In some examples, the filter unit 312 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, determine the partial filter according to the adaptive loop filter that does not use the filter support corresponding to the unavailable sample, wherein the partial filter includes one of an asymmetric partial filter or a symmetric partial filter. In other examples, the filter unit 216 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, perform mirror padding to replace the filter support corresponding to the unavailable sample.

[0271] In some examples, the filter unit 312 can be configured to conditionally disable filtering of particular samples of the reconstructed coding block based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether the gradient value of a window covering the reconstructed video data block includes determining one or more gradient values ​​for one or more samples within the window outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed video data block is within the boundary.

[0272] In some examples, the filter unit 312 can be configured to determine a weighted average of samples of a particular sample in the reconstructed block and the filtered block of video data based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether the gradient value of a window covering the reconstructed block of video data includes determining one or more gradient values ​​of one or more samples within the window outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data is within the boundary.

[0273] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in examples where the operation of the filter unit 312 is not performed, the reconstruction unit 310 may store the reconstructed block in the DPB 314. In examples where the operation of the filter unit 312 is performed, the filter unit 312 may store the filtered reconstructed block in the DPB 314. As discussed above, the DPB 314 may provide reference information (such as samples of the current picture for intra-frame prediction and previously decoded pictures for subsequent motion compensation) to the prediction processing unit 304. In addition, the video decoder 300 may output a decoded picture (e.g., a decoded video) from the DPB 314 for use in, for example, Figure 1 Subsequent presentation on a display device such as display device 118.

[0274] In this way, the video decoder 300 represents an example of a video decoding device that includes: a memory configured to store video data; and one or more processing units implemented in circuits and configured to: reconstruct a video data block to create a reconstructed video data block; determine values ​​of gradients of samples in the reconstructed video data block, including performing gradient calculations on samples using unavailable samples other than one of the following: a picture, slice, tile, or tile group that includes the reconstructed sample block; determine an adaptive loop filter for the reconstructed video data block based at least in part on the values ​​of the gradients of the determined samples; and apply the determined adaptive loop filter to the reconstructed video data block to generate a filtered video data block.

[0275] Fig. 9 An example implementation of a filter unit for performing techniques of the present disclosure is shown. Filter units 216 and 312 may perform techniques of the present disclosure, possibly in conjunction with other components of video encoder 200 or video decoder 300. Fig. 9 In the example of , filter unit 216 and filter unit 312 include a deblocking filter 342, an SAO filter 344, and an ALF / GLAF filter 346. The SAO filter 344 may, for example, be configured to determine offset values ​​for samples of a block.

[0276] Filter unit 216 and filter unit 312 may include fewer filters and / or may include additional filters. Fig. 9 The specific filters shown in can be implemented in a different order. Other loop filters (either in the decoding loop or after the decoding loop) can also be used to smooth sample transitions or otherwise improve video quality.

[0277] The deblocking filter 342 may be configured to perform deblocking filtering on the reconstructed video data block. The SAO filter 344 may be configured to perform SAO filtering on the deblocked reconstructed video data block output by the deblocking filter 342. The ALF / GALF filter 346 may be configured to perform ALF or GALF on the deblocked and SAO filtered reconstructed video data block output by the SAO filter 344.

[0278] In particular, the ALF / GALF filter 346 may be configured to determine values ​​of gradients of samples in a deblocked and SAO filtered reconstructed block of video data, including performing gradient calculations on samples using unavailable samples other than one of: a picture, slice, tile, or tile group that includes the reconstructed block of samples; determine an adaptive loop filter for the deblocked and SAO filtered reconstructed block of video data based at least in part on the values ​​of the gradients of the determined samples; and apply the determined adaptive loop filter to the deblocked and SAO filtered reconstructed block of video data to generate a filtered block of video data.

[0279] In some examples, the ALG / GALF filter 346 can be configured to: determine a gradient value of a window covering the deblocked and SAO filtered reconstructed video data block, the window including samples of the reconstructed video data block and samples surrounding the reconstructed video data block, including using unavailable samples to perform gradient calculations, e.g., according to the techniques of the present disclosure; and determine an adaptive loop filter for the deblocked and SAO filtered reconstructed video data block based at least in part on the determined gradient value of the window. This can, for example, include replacing unavailable gradient values ​​of samples within the window outside the boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary, wherein one of the picture, a slice, a tile, or a tile group includes the deblocked and SAO filtered reconstructed video data block, e.g., according to the techniques of the present disclosure.

[0280] In some examples, the ALG / GALF filter 346 can be configured to avoid including in the gradient value of the window an unavailable gradient value of a sample within the window outside the boundary of one of a picture, a slice, a tile, or a tile group, wherein one of the picture, a slice, a tile, or a tile group includes a reconstructed video data block. Since the unavailable gradient value of the sample within the window is not included in the gradient value of the window, the ALG / GALF filter 346 can normalize the gradient value of the window.

[0281] In some examples, the ALG / GALF filter 346 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, determine a partial filter according to the adaptive loop filter that does not use the filter support corresponding to the unavailable sample, wherein the partial filter includes one of an asymmetric partial filter or a symmetric partial filter. In other examples, the ALG / GALF filter 346 may be configured to: in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable sample, perform mirror padding to replace the filter support corresponding to the unavailable sample.

[0282] In some examples, the ALG / GALF filter 346 can be configured to conditionally disable filtering of particular samples of the deblocked and SAO filtered reconstructed block of video data based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether gradient values ​​for a window covering the reconstructed block of video data includes determining one or more gradient values ​​for one or more samples within the window outside a boundary of one of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data is within the boundary.

[0283] In some examples, the ALG / GALF filter 346 can be configured to determine a weighted average of samples of a particular sample in the reconstructed block and the filtered block of video data based at least in part on at least one of determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or determining whether gradient values ​​for a window covering the reconstructed block of video data includes determining one or more gradient values ​​for one or more samples within the window outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data is within the boundary.

[0284] The decoded video blocks in a given frame or picture are then stored in DPB 314, which stores reference pictures for subsequent motion compensation. DPB 314 may be a storage device that stores decoded video for later viewing on a display device such as Figure 1 The memory may be part of or separate from the additional memory presented on the display device 118 .

[0285] Fig.10 is a flowchart illustrating an example method for decoding a current block of video data. The current block may include a current CU. Although with respect to the video decoder 300 ( Figure 1 and 8 ), but it should be understood that other devices may be configured to perform the same Fig.10 A similar approach to the one used in this paper.

[0286] The video decoder 300 may receive entropy-encoded data for a current block (e.g., entropy-encoded prediction information and entropy-encoded data for coefficients of a residual block corresponding to the current block) (370). The video decoder 300 may entropy decode the entropy-encoded data to determine prediction information for the current block and reproduce coefficients of the residual block (372). The video decoder 300 may predict the current block (374), for example, using an intra-frame or inter-frame prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. The video decoder 300 may then inverse scan the reproduced coefficients (376) to create a block of quantized transform coefficients. The video decoder 300 may then inverse quantize and inverse transform the transform coefficients to produce a residual block (378). Finally, the video decoder 300 may decode the current block by combining the prediction block and the residual block (380).

[0287] In some examples, the video decoder 300 may perform filtering on the decoded block, such as deblocking filtering, SAO filtering, and ALF filtering. For example, as part of performing ALF filtering, the video decoder 300 may determine a value of a gradient of a sample in a reconstructed coding block, including performing a gradient calculation for the sample using an available sample corresponding to an unavailable sample other than one of the following: a picture, slice, tile, or tile group including the reconstructed sample block; determining an adaptive loop filter for the reconstructed coding block based at least in part on the value of the gradient of the determined sample; and applying the determined adaptive loop filter to the reconstructed coding block to generate a filtered video data block.

[0288] In some examples, as part of performing ALF filtering, the video decoder 300 may determine a gradient value of a window covering the reconstructed coding block, the window including samples of the reconstructed video data block and samples surrounding the reconstructed video data block, including using unavailable samples to perform gradient calculations, for example, according to the techniques of the present disclosure; and determine an adaptive loop filter for the reconstructed coding block based at least in part on the determined gradient value of the window. This may, for example, include replacing unavailable gradient values ​​of samples within the window outside the boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary, wherein one of the picture, a slice, a tile, or a tile group includes the reconstructed coding block, for example, according to the techniques of the present disclosure.

[0289] Fig.11 is a flowchart illustrating an example method for decoding video data. The method may be performed by a video encoder 200 ( Figure 1 and 7 ) and / or the video decoder 300 ( Figure 1 and 8Although described with respect to the video encoder 200 and the video decoder 300, it should be understood that other devices may be configured to perform the same Fig.11 In some examples, Fig.11 The technology can be Figure 7 The filter unit 216 and / or Figure 8 In other examples, Fig.11 The techniques may be performed by one or more other structural units of the video encoder 200 and / or the video decoder 300.

[0290] exist Fig.11 In the example of , the video encoder 200 and / or the video decoder 300 may reconstruct the video data block to create the reconstructed video data block 170 (400). For example, the video encoder 200 and / or the video decoder 300 may perform deblocking or SAO filtering on the reconstructed video data block before performing ALF on the reconstructed video data block.

[0291] The video encoder 200 and / or the video decoder 300 may determine values ​​of gradients for samples in the reconstructed block of video data 170, including performing gradient calculations for the samples using available samples corresponding to unavailable samples other than one of: a picture, a slice, a tile, or a tile group that includes the reconstructed block of sample data 170 (402).

[0292] In some examples, video encoder 200 and / or video decoder 300 may use available neighboring samples along the gradient direction of the gradient of the sample to replace the unavailable samples to perform gradient calculations for the samples. In some examples, video encoder 200 and / or video decoder 300 may perform mirror filling to determine available neighboring samples corresponding to the unavailable neighboring samples, and may use the available neighboring samples to perform gradient calculations for the samples.

[0293] In some examples, video encoder 200 and / or video decoder 300 may determine a gradient value for a window 172 covering reconstructed block of video data 170 , the window including samples of reconstructed block of video data 170 and samples surrounding reconstructed block of video data 170 .

[0294] Video encoder 200 and / or video decoder 300 may determine an adaptive loop filter for reconstructed block of video data 170 based at least in part on the value of the determined gradient ( 404 ).

[0295] In some examples, video encoder 200 and / or video decoder 300 may determine an adaptive loop filter for reconstructed block of video data 170 based at least in part on the determined gradient value of the window.

[0296] In some examples, video encoder 200 and / or video decoder 300 may replace unavailable gradient values ​​for samples within window 172 outside the boundaries of one or more of a picture, a slice, a tile, or a tile group, where one or more of the pictures, slices, tiles, or tile groups include reconstructed video data block 170, with one or more gradient values ​​within the boundaries.

[0297] In some examples, the boundary includes a horizontal boundary 174, and the video encoder 200 and / or the video decoder 300 may determine the gradient value of a sample within the window 172 and outside the horizontal boundary 174 as the nearest gradient value of a sample within the horizontal boundary 174 that is on the same column as the sample within the window 172 and outside the horizontal boundary 174.

[0298] In some examples, the boundary includes a vertical boundary 176, and the video encoder 200 and / or the video decoder 300 may determine the gradient value of a sample within the window 172 and outside the vertical boundary 176 as the nearest gradient value of a sample within the vertical boundary 176 that is on the same row as the sample within the window 172 and outside the vertical boundary 176.

[0299] In some examples, video encoder 200 and / or video decoder 300 may determine the diagonal gradient value of a sample within window 172 and outside the boundary as the nearest diagonal gradient value of the sample within the boundary that is in the same gradient direction as the diagonal gradient value of the sample within window 172 and outside the boundary.

[0300] In some examples, video encoder 200 and / or video decoder 300 may determine additional gradient values ​​for additional samples within reconstructed block of video data 170 to replace unavailable gradient values ​​for samples within window 172 outside of the boundaries.

[0301] In some examples, the video encoder 200 and / or the video decoder 300 can avoid including in the gradient values ​​of the window 172 unavailable gradient values ​​for samples within the window 172 outside the boundaries of a picture, a slice, a tile, or a tile group, where the picture, the slice, the tile, or the tile group includes the reconstructed video data block 170; and the gradient values ​​of the window 172 can be normalized.

[0302] The video encoder 200 and / or the video decoder 300 may apply the determined adaptive loop filter to the reconstructed block of video data 170 to generate a filtered block of video data ( 406 ).

[0303] In some examples, the video encoder 200 and / or the video decoder 300 may determine a partial filter based on an adaptive loop filter that does not use the filter support corresponding to the unavailable samples in response to the adaptive loop filter utilizing the filter support corresponding to the unavailable samples, wherein the partial filter comprises one of an asymmetric partial filter or a symmetric partial filter.

[0304] In some examples, video encoder 200 and / or video decoder 300 may, in response to the adaptive loop filter utilizing filter support corresponding to the unavailable samples, perform mirror padding to replace the filter support corresponding to the unavailable samples.

[0305] In some examples, the video encoder 200 and / or the video decoder 300 may conditionally disable filtering of a sample of the reconstructed block of video data 170 based at least in part on at least one of: determining whether a gradient value for the sample includes performing a gradient calculation using an unavailable sample, or determining whether a gradient value for a window 172 covering the reconstructed block of video data 170 includes determining one or more gradient values ​​for one or more samples within the window 172 that are outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data 170 is within the boundary.

[0306] In some examples, the video encoder 200 and / or the video decoder 300 may determine a weighted average of samples in the reconstructed block and samples of the filtered block of video data based at least in part on at least one of: determining a gradient value for the sample includes performing a gradient calculation using an unavailable sample, or determining a gradient value for a window 172 covering the reconstructed block of video data 170 includes determining one or more gradient values ​​for one or more samples within the window 172 that are outside a boundary of a picture, a slice, a tile, or a tile group, wherein the reconstructed block of video data 170 is within the boundary.

[0307] In some examples, video encoder 200 encodes the video data and may store the filtered blocks of video data in decoded picture buffer 218. In some examples, video encoder 200 may utilize a camera to capture a picture including the blocks of video data.

[0308] In some examples, video decoder 300 may decode the video data and may store the filtered block of video data in decoded picture buffer 314. In some examples, video decoder 300 may display a picture including the filtered block of video data.

[0309] Illustrative examples of the present disclosure include:

[0310] Example 1: A method of decoding video data, the method comprising: obtaining a block of samples; determining a gradient of a current sample of the block of samples; and determining a filter for the sample based on the determined gradient.

[0311] Example 2: The method of Example 1, wherein determining the gradient of the current sample comprises: performing gradient calculation using unavailable samples.

[0312] Example 3: The method of example 1, wherein the unavailable samples include samples outside the boundary of one or more of a picture, a slice, a tile, or a tile group that includes the sample block.

[0313] Example 4: The method according to Example 2 or 3 further includes: determining the value of the unavailable sample based on the value of the available sample in the sample block.

[0314] Example 5: The method of Example 4, wherein determining the values ​​of unavailable samples based on the values ​​of available samples in the sample block comprises determining the available samples to be used based on the direction of the gradient of the current sample.

[0315] Example 6: The method of Example 5, wherein the direction includes a 45 degree direction.

[0316] Example 7: The method of Example 5, wherein the direction includes a 135 degree direction.

[0317] Example 8: The method of Example 5, wherein the direction includes a 90 degree direction.

[0318] Example 9: The method of Example 5, wherein the direction includes a 0 degree direction.

[0319] Example 10: The method of any one of Examples 1-9, wherein the sample is adjacent to a vertical boundary of a picture, a slice, a tile, or a tile group.

[0320] Example 11: A method according to any of Examples 1-9, wherein the sample is adjacent to a horizontal boundary of a picture, a slice, a tile, or a tile group.

[0321] Example 12: The method of any one of Examples 1-11, wherein the sample is a sample of a sub-block, and determining the gradient of the sample comprises: determining the gradient of the sub-block.

[0322] Example 13: A method according to Example 12, wherein the sub-block includes a 4x4 block.

[0323] Example 14: A method according to any of Examples 1-13, wherein the samples include brightness samples.

[0324] Example 15: The method according to any one of Examples 1-14 further includes: selecting a filter for the current sample based on the determined gradient; in response to the selected filter utilizing filter support corresponding to the unavailable sample, using a partial filter to filter the current sample.

[0325] Example 16: A method according to Example 15, wherein the partial filter includes a symmetric partial filter.

[0326] Example 17: The method of Example 15, wherein the partial filter comprises an asymmetric partial filter.

[0327] Example 18: The method of any one of Examples 1-17, further comprising: filtering the samples using the determined filter.

[0328] Example 19: A method according to any one of Examples 1-15, wherein the decoding method is performed as part of a video encoding process.

[0329] Example 20: A device for decoding video data, the device comprising: a memory configured to store the video data; and one or more processors configured to decode the video data using any of the techniques described in Examples 1-18 and / or any of the techniques described in the present disclosure.

[0330] Example 21: The device of Example 20, wherein the device comprises a wireless communication device and further comprises a receiver configured to receive the encoded video data.

[0331] Example 22: The device of Example 21, wherein the wireless communication device comprises a telephone handset, and wherein the receiver is configured to demodulate the signal comprising the encoded video data according to a wireless communication standard.

[0332] Example 23: A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to decode video data using any of the techniques described in Examples 1-19 and / or any of the techniques described in this disclosure.

[0333] Example 24: A device for decoding video data, the device comprising: a unit for decoding the video data using any of the techniques described in Examples 1-19; and / or a unit for decoding the video data using any of the techniques described in the present disclosure.

[0334] Example 25: A device for encoding video data, the device comprising: a memory configured to store the video data; and one or more processors configured to encode the video data using any of the techniques described in Examples 1-19 and / or any of the techniques described in the present disclosure.

[0335] Example 26: The device of Example 25, wherein the device comprises a wireless communication device and further comprises a transmitter configured to transmit the encoded video data.

[0336] Example 27: The device of Example 26, wherein the wireless communication device comprises a telephone handset, and wherein the transmitter is configured to modulate the signal comprising the encoded video data in accordance with a wireless communication standard.

[0337] Example 28: A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to encode video data using any of the techniques described in Examples 1-19 and / or any of the techniques described in this disclosure.

[0338] Example 29: An apparatus for decoding video data, the apparatus comprising:

[0339] A means for encoding video data using any of the techniques described in Examples 1-19; and / or a means for encoding video data using any of the techniques described in this disclosure.

[0340] For purposes of illustration, certain aspects of the present disclosure have been described with respect to HEVC, extensions of HEVC, and the developing VVC standard. However, the techniques described in this disclosure may be used for other video coding processes, including other standards or proprietary video coding processes that have not yet been developed.

[0341] As described in the present disclosure, a video decoder may refer to a video encoder or a video decoder. Similarly, a video decoding unit may refer to a video encoder or a video decoder. Likewise, video decoding may refer to video encoding or video decoding (as applicable). In the present disclosure, the phrase "based on" may indicate based only on, at least partially on, or based on in some way. The present disclosure may use the term "video unit" or "video block" or "block" to refer to one or more sample blocks and syntax structures for decoding samples of one or more sample blocks. Example types of video units may include CTUs, CUs, PUs, transform units (TUs), macroblocks, macroblock partitions, etc. In some contexts, the discussion of PUs may be interchangeable with the discussion of macroblocks or macroblock partitions. Example types of video blocks may include coding tree blocks, coding blocks, and other types of video data blocks.

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

[0343] It is to be appreciated that, according to examples, certain actions or events of any of the techniques described herein may be performed in a different order, may be added, combined, or omitted entirely (e.g., not all described actions or events are necessary to implement the techniques). In addition, in some examples, actions or events may be performed concurrently rather than sequentially, such as through multithreading, interrupt handling, or multiple processors.

[0344] In one or more examples, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted through a computer-readable medium as one or more instructions or codes and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media such as data storage media or communication media, including, for example, any media that facilitates the transfer of a computer program from one place to another according to a communication protocol. In this manner, computer-readable media may generally correspond to (1) a non-transitory tangible computer-readable storage medium, or (2) a communication medium such as a signal or carrier wave. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to obtain instructions, codes, and / or data structures for implementing the techniques described in the present disclosure. A computer program product may include a computer-readable medium.

[0345] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program codes in the form of instructions or data structures and can be accessed by a computer. In addition, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technology (e.g., infrared, radio and microwave) is used to transmit instructions from a website, server or other remote source, then coaxial cable, optical fiber cable, twisted pair, DSL or wireless technology (e.g., infrared, radio and microwave) is included in the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are instead directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical disks, digital versatile disks (DVDs), floppy disks and blue-ray disks, wherein disks usually copy data magnetically, and optical disks use lasers to optically copy data. Combinations of the above should also be included within the scope of computer-readable media.

[0346] The functions described in the present disclosure may be performed by fixed-function and / or programmable processing circuits. For example, instructions may be performed by fixed-function and / or programmable processing circuits. Instructions may be performed 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 circuits. Therefore, the terms "processor" and "processing circuit" as used herein may refer to any of the aforementioned structures or any other structure suitable for implementing the technology described herein. In addition, in some aspects, the functions described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a combined codec. In addition, the technology may be fully implemented in one or more circuits or logic elements. In addition, the technology may be fully implemented in one or more circuits or logic elements. The processing circuit may be coupled to other components in various ways. For example, the processing circuit may be coupled to other components via internal device interconnection, wired or wireless network connection.

[0347] The techniques of the present disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in the present disclosure to emphasize functional aspects of devices configured to perform the disclosed techniques, but do not necessarily need to be implemented by different hardware units. Specifically, as described above, the various units may be combined in a codec hardware unit, or provided by a collection of interoperable hardware units (including one or more processors as described above) in conjunction with appropriate software and / or firmware.

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

Claims

1. A method for decoding video data, the method comprising: reconstructing the video data block to create a reconstructed video data block; Determining a value of a gradient of samples in the reconstructed video data block comprises determining a gradient value of a window covering the reconstructed video data block, the window comprising samples of the reconstructed video data block and samples surrounding the reconstructed video data block, wherein determining the gradient value of the window covering the reconstructed video data block comprises: replacing unavailable samples outside a vertical boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said vertical boundary; and replacing unavailable samples outside a horizontal boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said horizontal boundary; determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of gradients of samples in the reconstructed block of video data; and The determined adaptive loop filter is applied to the reconstructed block of video data to generate a filtered block of video data.

2. The method of claim 1 , further comprising performing gradient calculations on samples in the reconstructed video data block, wherein: Gradient computation for the sample is performed using the nearest sample within the boundaries of one of: a picture, a slice, a tile, or a tile group.

3. The method according to claim 1, wherein: Determining the adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of the gradients of samples in the reconstructed block of video data includes determining the adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of the gradients of the window.

4. The method according to claim 3, wherein: Determining the gradient value of the window covering the reconstructed block of video data comprises: avoiding including in the gradient value of the window unavailable gradient values ​​for samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group; and The gradient value of the window is normalized.

5. The method according to claim 3, wherein: Determining the adaptive loop filter for the reconstructed block of video data based at least in part on the determined gradient value of the window comprises: In response to the adaptive loop filter utilizing a filter support corresponding to an unavailable sample, determining a partial filter from the adaptive loop filter without using the filter support corresponding to the unavailable sample, wherein the partial filter comprises one of an asymmetric partial filter or a symmetric partial filter.

6. The method according to claim 3, wherein: Determining the adaptive loop filter for the reconstructed block of video data based at least in part on the determined gradient value of the window comprises: In response to the adaptive loop filter utilizing a filter support corresponding to an unavailable sample, mirror padding is performed to replace the filter support corresponding to the unavailable sample.

7. The method according to claim 3, wherein: Applying the determined adaptive loop filter to the reconstructed video data block to generate the filtered video data block further comprises: Conditionally disabling filtering of specific samples of the reconstructed block of video data based at least in part on at least one of: determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or Determining whether the gradient value of the window covering the reconstructed block of video data includes determining one or more gradient values ​​of one or more samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group, wherein the reconstructed block of video data is within the boundary.

8. The method according to claim 3, wherein: Applying the determined adaptive loop filter to the reconstructed video data block to generate the filtered video data block further comprises: Determining a weighted average of particular samples in the reconstructed block of video data and samples of the filtered block of video data based at least in part on at least one of: determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or Determining whether the gradient value of the window covering the reconstructed block of video data includes determining one or more gradient values ​​of one or more samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group, wherein the reconstructed block of video data is within the boundary.

9. A method for decoding video data, the method comprising: reconstructing the video data block to create a reconstructed video data block; determining values ​​of gradients of samples in the reconstructed block of video data, comprising determining gradient values ​​of a window covering the reconstructed block of video data, the window including samples of the reconstructed block of video data and samples surrounding the reconstructed block of video data, wherein determining the gradient values ​​of the window covering the reconstructed block of video data comprises replacing unavailable gradient values ​​of samples within the window outside a boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary; determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of gradients of samples in the reconstructed block of video data; and The determined adaptive loop filter is applied to the reconstructed block of video data to generate a filtered block of video data.

10. The method according to claim 9, wherein: The boundary comprises a horizontal boundary, and wherein replacing the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary comprises: The gradient value of the sample within the window and outside the horizontal boundary is determined as the nearest gradient value of the sample within the horizontal boundary, and the sample within the horizontal boundary is on the same column as the sample within the window and outside the horizontal boundary.

11. The method according to claim 9, wherein: The boundary comprises a vertical boundary, and wherein replacing the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary comprises: The gradient value of the sample within the window and outside the vertical boundary is determined as the nearest gradient value of the sample within the vertical boundary, the sample within the vertical boundary being on the same row as the sample within the window and outside the vertical boundary.

12. The method according to claim 9, wherein: Replacing the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary comprises: The diagonal gradient value of the sample within the window and outside the boundary is determined as the nearest diagonal gradient value of the sample within the boundary, the nearest diagonal gradient value and the diagonal gradient value of the sample within the window and outside the boundary are in the same gradient direction.

13. The method according to claim 9, wherein: Replacing the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary comprises: Additional gradient values ​​are determined for additional samples within the reconstructed block of video data to replace the unavailable gradient values ​​for the samples within the window outside the boundary.

14. An apparatus configured to decode video data, the apparatus comprising: a memory configured to store video data blocks; as well as one or more processors coupled to the memory, the one or more processors being configured to cause the apparatus to: reconstructing the block of video data to create a reconstructed block of video data; Determining a value of a gradient of samples in the reconstructed video data block comprises determining a gradient value of a window covering the reconstructed video data block, the window comprising samples of the reconstructed video data block and samples surrounding the reconstructed video data block, wherein determining the gradient value of the window covering the reconstructed video data block comprises: replacing unavailable samples outside a vertical boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said vertical boundary; and replacing unavailable samples outside a horizontal boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said horizontal boundary; determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of gradients of samples in the reconstructed block of video data; and The determined adaptive loop filter is applied to the reconstructed block of video data to generate a filtered block of video data.

15. The device according to claim 14, wherein: The one or more processors are further configured to cause the apparatus to perform gradient calculations on samples in the reconstructed video data, wherein the gradient calculations on the samples are performed using the nearest sample within a boundary of one of: a picture, a slice, a tile, or a tile group.

16. The device according to claim 14, wherein: In order to determine the adaptive loop filter for the reconstructed video data block based at least in part on the determined value of the gradient of samples in the reconstructed video data block, the one or more processors are further configured to cause the device to determine the adaptive loop filter for the reconstructed video data block based at least in part on the determined gradient value of the window.

17. The device according to claim 16, wherein: To determine the gradient value of the window covering the reconstructed block of video data, the one or more processors are further configured to cause the apparatus to: avoiding including in the gradient value of the window unavailable gradient values ​​for samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group; and The gradient value of the window is normalized.

18. The device according to claim 16, wherein: To determine the adaptive loop filter for the reconstructed block of video data based at least in part on the determined gradient value of the window, the one or more processors are further configured to cause the apparatus to: In response to the adaptive loop filter utilizing a filter support corresponding to an unavailable sample, determining a partial filter from the adaptive loop filter without using the filter support corresponding to the unavailable sample, wherein the partial filter comprises one of an asymmetric partial filter or a symmetric partial filter.

19. The device according to claim 16, wherein: To determine the adaptive loop filter for the reconstructed block of video data based at least in part on the determined gradient value of the window, the one or more processors are further configured to cause the apparatus to: In response to the adaptive loop filter utilizing a filter support corresponding to an unavailable sample, mirror padding is performed to replace the filter support corresponding to the unavailable sample.

20. The device according to claim 16, wherein: To apply the determined adaptive loop filter to the reconstructed video data block to generate the filtered video data block, the one or more processors are further configured to cause the apparatus to: Conditionally disabling filtering of specific samples of the reconstructed block of video data based at least in part on at least one of: determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or Determining whether the gradient value of the window covering the reconstructed block of video data includes determining one or more gradient values ​​of one or more samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group, wherein the reconstructed block of video data is within the boundary.

21. The device according to claim 16, wherein: To apply the determined adaptive loop filter to the reconstructed video data block to generate the filtered video data block, the one or more processors are further configured to cause the apparatus to: Determining a weighted average of particular samples in the reconstructed block of video data and samples of the filtered block of video data based at least in part on at least one of: determining whether one or more gradient values ​​for the particular sample includes performing one or more gradient calculations for the particular sample using one or more unavailable samples, or Determining whether the gradient value of the window covering the reconstructed block of video data includes determining one or more gradient values ​​of one or more samples within the window outside a boundary of one of the picture, the slice, the tile, or the tile group, wherein the reconstructed block of video data is within the boundary.

22. The device according to claim 14, wherein: The device includes one or more of a camera, a computer, or a set-top box.

23. The device according to claim 14, wherein: The apparatus comprises one or more of a mobile device or a broadcast receiver device.

24. An apparatus configured to decode video data, the apparatus comprising: a memory configured to store video data blocks; as well as one or more processors coupled to the memory, the one or more processors being configured to cause the apparatus to: reconstructing the block of video data to create a reconstructed block of video data; determining values ​​of gradients of samples in the reconstructed block of video data, comprising determining gradient values ​​of a window covering the reconstructed block of video data, the window including samples of the reconstructed block of video data and samples surrounding the reconstructed block of video data, wherein determining the gradient values ​​of the window covering the reconstructed block of video data comprises replacing unavailable gradient values ​​of samples within the window outside a boundary of one of a picture, a slice, a tile, or a tile group with one or more gradient values ​​within the boundary; determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of gradients of samples in the reconstructed block of video data; and The determined adaptive loop filter is applied to the reconstructed block of video data to generate a filtered block of video data.

25. The device according to claim 24, wherein: The boundary comprises a horizontal boundary, and wherein, in order to replace the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary, the one or more processors are further configured to cause the apparatus to: The gradient value of the sample within the window and outside the horizontal boundary is determined as the nearest gradient value of the sample within the horizontal boundary, and the sample within the horizontal boundary is on the same column as the sample within the window and outside the horizontal boundary.

26. The device according to claim 24, wherein: The boundary comprises a vertical boundary, and wherein, in order to replace the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary, the one or more processors are further configured to cause the apparatus to: The gradient value of the sample within the window and outside the vertical boundary is determined as the nearest gradient value of the sample within the vertical boundary, the sample within the vertical boundary being on the same row as the sample within the window and outside the vertical boundary.

27. The device according to claim 24, wherein: To replace the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary, the one or more processors are further configured to cause the apparatus to: The diagonal gradient value of the sample within the window and outside the boundary is determined as the nearest diagonal gradient value of the sample within the boundary, the nearest diagonal gradient value and the diagonal gradient value of the sample within the window and outside the boundary are in the same gradient direction.

28. The device according to claim 24, wherein: To replace the unavailable gradient values ​​of the samples within the window outside the boundary with the one or more gradient values ​​within the boundary, the one or more processors are further configured to cause the apparatus to: Additional gradient values ​​are determined for additional samples within the reconstructed block of video data to replace the unavailable gradient values ​​for the samples within the window outside the boundary.

29. A non-transitory computer-readable storage medium storing instructions that, when executed, cause one or more processors configured to decode video data to: reconstructing the video data block to create a reconstructed video data block; Determining a value of a gradient of samples in the reconstructed video data block comprises determining a value of a gradient of a window covering the reconstructed video data block, the window including samples of the reconstructed video data block and samples surrounding the reconstructed video data block, wherein Determining a gradient value of a window covering the reconstructed block of video data comprises: replacing unavailable samples outside a vertical boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said vertical boundary; and replacing unavailable samples outside a horizontal boundary of one of the following: a picture, a slice, a tile or a tile group, with available samples within said horizontal boundary; determining an adaptive loop filter for the reconstructed block of video data based at least in part on the determined values ​​of gradients of samples in the reconstructed block of video data; as well as The determined adaptive loop filter is applied to the reconstructed block of video data to generate a filtered block of video data.

Citation Information

Patent Citations

  • Line buffer reduction for adaptive loop filtering in video coding

    US20190166363A1

  • Block-based adaptive loop filter (ALF) design and signaling

    US20190373258A1

  • Applying partition-based filters

    US9641866B2