An adaptive loop filter having samples before the deblocking filter and samples before the sample adaptation offset

JP2025509129A5Pending Publication Date: 2026-02-20QUALCOMM INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024550808
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-09
Filing Date
2023-03-10
Publication Date
2026-02-20

AI Technical Summary

Technical Problem

It is difficult for existing video encoding technologies to effectively improve encoding efficiency while maintaining video quality during the filtering process of video data.

Method used

By using adaptive loop filtering (ALF) technology during video encoding and decoding, the sample values ​​that have been filtered and SAO filtered are adjusted, and filtered based on the difference between the sample values ​​and adjacent sample values ​​to improve encoding efficiency.

Benefits of technology

The effect of improving video encoding efficiency without decreasing the quality of the decoded video is achieved, and ALF processing is performed by using high-frequency pre-deblocking video data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The device for decoding video data is further configured to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, and to apply the ALF to the filtered reconstructed block, the device is further configured to determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample, apply a filter to the difference value to determine a sample correction value, and determine a final filtered sample value based on the sample correction value.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001]

[0001] This application claims priority to U.S. Patent Application No. 18 / 181,359, filed March 9, 2023, and U.S. Provisional Patent Application No. 63 / 269,207, filed March 11, 2022, the entire contents of each of which are incorporated herein by reference. U.S. Patent Application No. 18 / 181,359 also claims the benefit of U.S. Provisional Patent Application No. 63 / 269,207.

[0002]

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

[0003]

[0003] Digital video capabilities may be incorporated into a wide range of devices, including digital televisions, digital direct broadcast systems, wireless broadcast systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video gaming devices, video game consoles, cellular or satellite wireless telephones, so-called "smartphones," video teleconferencing devices, video streaming devices, and the like. Digital video devices implement video coding techniques such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), ITU-T H.265 / High Efficiency Video Coding (HEVC), ITU-T H.266 / Versatile Video Coding (VVC), and extensions to such standards, as well as proprietary video codecs / formats such as AOMedia Video1 (AV1) developed by the Alliance for Open Media. Video devices may implement such video coding techniques to more efficiently transmit, receive, encode, decode, and / or store digital video information.

[0004]

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

[0005]

[0005] The present disclosure describes techniques related to filtering reconstructed video data in a video encoding and / or video decoding process, and more particularly, the present disclosure describes techniques related to ALF. However, the described techniques can potentially be applied to other filtering schemes. According to the techniques of the present disclosure, the ALF can be configured to adjust a current sample value, such as a deblocking filtered and SAO filtered reconstructed sample, based on a difference between a value of the current sample and a value of an adjacent sample before filtering. By taking such a difference into account, the ALF according to the techniques of the present disclosure can improve coding efficiency without degrading the quality of the decoded video data. The deblocking filtering removes high frequency data from the decoded video data, which can improve the visual quality of the decoded video data by removing blocking artifacts. However, such high frequency data can improve the quality of the ALF. Thus, the techniques of the present disclosure can improve coding efficiency without degrading the video quality by using high frequency pre-deblocked video data in the ALF process while still outputting deblocking filtered video data.

[0006]

[0006] According to one example of the present disclosure, a method for decoding video data includes determining an unfiltered reconstructed block of the video data, applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, and applying an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, wherein applying the ALF to the filtered reconstructed block includes determining a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent sample before filtering, applying a filter to the difference value to determine a sample correction value, and determining a final filtered sample value based on the sample correction value.

[0007]

[0007] According to one example of the present disclosure, a device for decoding video data comprises a memory configured to store the video data and one or more processors implemented in a circuit, wherein the one or more processors are configured to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, and apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, and to apply the ALF to the filtered reconstructed block, the one or more processors are further configured to determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent sample before filtering, apply a filter to the difference value to determine a sample correction value, and determine a final filtered sample value based on the sample correction value.

[0008]

[0008] According to one embodiment of the present disclosure, a computer-readable storage medium stores instructions that, when executed by one or more processors, cause the one or more processors to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample, apply a filter to the difference value to determine a sample correction value, and determine a final filtered sample value based on the sample correction value.

[0009]

[0009] The details of one or more examples are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will become apparent from the description, drawings, and claims. [Brief description of the drawings]

[0010] [Figure 1]

[0010] FIG. 1 is a block diagram illustrating an example video encoding and decoding system in which techniques of this disclosure may be implemented. [Figure 2A]

[0011] FIG. 1 is a conceptual diagram illustrating an example adaptive loop filter (ALF) shape that may be used in accordance with the techniques of this disclosure. [Figure 2B] FIG. 1 is a conceptual diagram illustrating an example adaptive loop filter (ALF) shape that may be used in accordance with the techniques of this disclosure. [Diagram 3]

[0012] FIG. 1 is a conceptual diagram illustrating example subsampled Laplacian values ​​for 4×4 sub-block ALF classification that may be used in accordance with the techniques of this disclosure. [Figure 4]

[0013] 4 is a conceptual diagram illustrating example Laplacian values ​​for luma samples that may be used in accordance with the techniques of this disclosure. [Diagram 5]

[0014] FIG. 1 is a conceptual diagram illustrating an example of ALF class merging that may be used in accordance with the techniques of this disclosure. [Figure 6]

[0015] A conceptual diagram illustrating an example geometric transformation of a 7x7 diamond filter shape that may be used in accordance with the techniques of this disclosure. [Figure 7A]

[0016] 1 illustrates an example of symmetric sample padding in ALF that may be used in accordance with the techniques of this disclosure. [Figure 7B] 1 illustrates an example of symmetric sample padding in ALF that may be used in accordance with the techniques of this disclosure. [Figure 7C] 1 illustrates an example of symmetric sample padding in ALF that may be used in accordance with the techniques of this disclosure. [Figure 8]

[0017] 1 illustrates an example of ALF4×4 sub-block classification that may be used in accordance with the techniques of this disclosure. [Figure 9]

[0018] 1 illustrates an exemplary ALF framework that uses multiple classifiers. [Figure 10]

[0019] 1 shows an exemplary ALF framework with three classifiers. [Figure 11]

[0020] 1 illustrates an exemplary ALF framework. [Figure 12]

[0021] 1 illustrates an example ALF framework in accordance with techniques of this disclosure. [Figure 13] 1 illustrates an example ALF framework in accordance with techniques of this disclosure. [Figure 14] 1 illustrates an example ALF framework in accordance with techniques of this disclosure. [Figure 15A]

[0022] 13 shows examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15B] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15C] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15D] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15E] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15F] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15G] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 15H] 1 illustrates examples of filter taps that may be used for samples before deblocking filtering (DBF) and / or sample adaptive offset (SAO). [Figure 16A]

[0023] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16B] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16C]13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16D] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16E] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16F] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16G] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16H] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 16I] 13 shows an example of a filter that may be used on pre-DBF and / or pre-SAO samples, with coefficients that are centrally symmetric. [Figure 17]

[0024] 1 is a block diagram illustrating an example video encoder that may implement the techniques of this disclosure. [Figure 18]

[0025] 1 is a block diagram illustrating an example video decoder that may implement the techniques of this disclosure. [Figure 19]

[0026] FIG. 2 is a block diagram illustrating an example filter for implementing the techniques of this disclosure. [Figure 20]

[0027] 11 is a flowchart illustrating an example process for encoding a current block in accordance with techniques of this disclosure. [Figure 21]

[0028] 10 is a flowchart illustrating an example process for decoding a current block in accordance with techniques of this disclosure. [Figure 22]

[0029] 11 is a flowchart illustrating an example process for decoding a current block of video data in accordance with techniques of this disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011]

[0030] Video coding (e.g., video encoding and / or video decoding) typically involves predicting a block of video data from either an already coded block of video data in the same picture (i.e., intra prediction) or an already coded block of video data in a different picture (i.e., inter prediction). In some instances, the video encoder also calculates residual data by comparing the predictive block to the original block. The residual data thus represents the difference between the predictive block and the original block. The video encoder 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 predictive block to generate a reconstructed video block that matches the original video block more closely than the predictive block alone. To further improve the quality of the decoded video, the video decoder may perform one or more filtering operations on the reconstructed video block. Examples of these filtering operations include deblock filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering (ALF). The parameters for these filtering operations may either be determined by the video encoder and explicitly signaled in the encoded video bitstream, or the parameters may be implicitly determined by the video decoder without having to be explicitly signaled in the encoded video bitstream.

[0012]

[0031] This disclosure describes techniques related to filtering reconstructed video data in a video encoding and / or video decoding process, and more particularly, this disclosure describes techniques related to ALF. However, the described techniques can potentially be applied to other filtering schemes. According to the techniques of this disclosure, the ALF may be configured to adjust a current sample value, such as a deblock filtered and SAO filtered reconstructed sample, based on a difference between a value of the current sample and a value of an adjacent sample before filtering. By taking such a difference into account, the ALF according to the techniques of this disclosure may improve coding efficiency without degrading the quality of the decoded video data. Deblock filtering removes high frequency data from the decoded video data, which may improve the visual quality of the decoded video data by removing blocking artifacts. However, such high frequency data may improve the quality of the ALF. Thus, the techniques of this disclosure may improve coding efficiency without degrading the video quality by using high frequency pre-deblocked video data in the ALF process while still outputting deblock filtered video data.

[0013]

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

[0014]

[0033] 1, in this example, system 100 includes a source device 102 that provides encoded video data to be decoded and displayed by a destination device 116. Specifically, source device 102 provides the video data to destination device 116 via a computer-readable medium 110. Source device 102 and destination device 116 may include any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, mobile devices, tablet computers, set-top boxes, telephone handsets such as smartphones, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming devices, broadcast receiver devices, and the like. In some cases, source device 102 and destination device 116 may be capable of wireless communication and thus may be referred to as wireless communication devices.

[0015]

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

[0016]

[0035] The system 100 as shown in FIG. 1 is merely an example. In general, any digital video encoding and / or decoding device may implement the techniques for filtering described herein. The source device 102 and the destination device 116 are merely examples of coding devices that generate the coded video data that the source device 102 transmits to the destination device 116. This disclosure refers to devices that perform coding (encoding and / or decoding) of data as “coding” devices. Thus, the video encoder 200 and the video decoder 300 represent examples of coding devices, specifically, video encoders and video decoders, respectively. In some examples, the source device 102 and the destination device 116 may operate in a substantially symmetrical manner, such that each of the source device 102 and the destination device 116 includes video encoding and decoding components. Thus, the system 100 may support one-way or two-way video transmission between the source device 102 and the destination device 116, for example, video streaming, video playback, video broadcasting, or video telephony.

[0017]

[0036] Generally, the video source 104 represents a source of video data (i.e., raw, unencoded video data) and provides a continuous series of pictures (also called "frames") of the video data to the video encoder 200, which encodes the picture data. The video source 104 of the source device 102 may include a video capture device such as a video camera, a video archive containing previously captured raw video, and / or a video feed interface that receives video from a video content provider. As a further alternative, the video source 104 may generate computer graphics-based data as the source video, or a combination of live video, archived video, and computer-generated video. In each case, the video encoder 200 encodes the captured video data, pre-captured video data, or computer-generated video data. The video encoder 200 may reorder the pictures from the order in which they are received (sometimes called the "display order") to a coding order for coding. The video encoder 200 may generate a bitstream that includes the encoded video data. Source device 102 may then output the encoded video data via output interface 108 to computer-readable medium 110, for receipt and / or retrieval by input interface 122 of destination device 116, for example.

[0018]

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

[0019]

[0038] The computer-readable medium 110 may represent any type of medium or device capable of transferring encoded video data from the source device 102 to the destination device 116. In one example, the computer-readable medium 110 represents a communication medium that allows the source device 102 to transmit encoded video data directly to the destination device 116 in real time, for example, via a radio frequency network or a computer-based network. The output interface 108 may modulate a transmission signal including the encoded video data, and the input interface 122 may demodulate a received transmission signal according to a communication standard, such as a wireless communication protocol. The communication medium may include any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful to facilitate communication from the source device 102 to the destination device 116.

[0020]

[0039] 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, a Blu-ray disc, a DVD, a CD-ROM, flash memory, volatile or non-volatile memory, or any other suitable digital storage medium that stores encoded video data.

[0021]

[0040] In some examples, source device 102 may output the encoded video data to a file server 114 or another intermediate storage device, which may store the encoded video data generated by source device 102. Destination device 116 may access the stored video data from file server 114 via streaming or download.

[0022]

[0041] File server 114 may be any type of server device capable of storing encoded video data and transmitting the encoded video data to destination device 116. File server 114 may represent a web server (e.g., for a website), a server configured to provide file transfer protocol services (such as File Transfer Protocol (FTP) or File Delivery over Unidirectional Transport (FLUTE) protocol), a content delivery network (CDN) device, a hypertext transfer protocol (HTTP) server, a Multimedia Broadcast Multicast Service (MBMS) or Enhanced MBMS (eMBMS) server, and / or a network attached storage (NAS) device. The file server 114 may additionally or alternatively implement one or more HTTP streaming protocols, such as Dynamic Adaptive Streaming over HTTP (DASH), HTTP Live Streaming (HLS), Real Time Streaming Protocol (RTSP), HTTP Dynamic Streaming, etc.

[0023]

[0042] Destination device 116 may access the encoded video data from file server 114 through any standard data connection, including an Internet connection. This may include a wireless channel (e.g., a Wi-Fi connection), a wired connection (e.g., a digital subscriber line (DSL), a cable modem, etc.), or a combination of both suitable for accessing the encoded video data stored on file server 114. Input interface 122 may be configured to operate according to any one or more of the various protocols mentioned above to retrieve or receive media data from file server 114, or other such protocols to retrieve media data.

[0024]

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

[0025]

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

[0026]

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

[0027]

[0046] Although not shown in FIG. 1, in some examples, the video encoder 200 and the video decoder 300 may each be integrated with an audio encoder and / or audio decoder and may include appropriate MUX-DEMUX units or other hardware and / or software to handle multiplexed streams containing both audio and video in a common data stream.

[0028]

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

[0029]

[0048] The video encoder 200 and the video decoder 300 may operate according to a video coding standard such as ITU-T H.265, also referred to as High Efficiency Video Coding (HEVC), or an extension standard thereof, such as multiview and / or scalable video coding extensions. Alternatively, the video encoder 200 and the video decoder 300 may operate according to other proprietary or industry standards, such as ITU-T H.266, also referred to as Generic Video Coding (VVC). In other examples, the video encoder 200 and the video decoder 300 may operate according to a proprietary video codec / format, such as AOMedia Video1 (AV1), an extension of AV1, and / or a successor version of AV1 (e.g., AV2). In other examples, the video encoder 200 and the video decoder 300 may operate according to other proprietary formats or industry standards. However, the techniques of this disclosure are not limited to any particular coding standard or format. In general, video encoder 200 and video decoder 300 may be configured to implement the techniques of this disclosure in conjunction with any video coding technique that uses loop filtering.

[0030]

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

[0031]

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

[0032]

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

[0033]

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

[0034]

[0053] In the MTT partitioning structure, blocks may be partitioned using quadtree (QT) partitioning, binary tree (BT) partitioning, and one or more types of triple tree (TT) (also called ternary tree (TT)) partitioning. A triple tree partitioning or ternary tree partitioning is a partitioning in which a block is divided into three subblocks. In some examples, a triple tree partitioning or ternary tree partitioning divides a block into three subblocks without splitting the original block through the center. The partition types in MTT (e.g., QT, BT, and TT) may be symmetric or asymmetric.

[0035]

[0054] When operating according to the AV1 codec, the video encoder 200 and the video decoder 300 may be configured to code video data in blocks. In AV1, the largest coding block that may be processed is called a superblock. In AV1, a superblock may be either 128×128 luma samples or 64×64 luma samples. However, in successor video coding formats (e.g., AV2), a superblock may be defined by a different (e.g., larger) luma sample size. In some examples, a superblock is the top level of a block quadtree. The video encoder 200 may further partition the superblock into smaller coding blocks. The video encoder 200 may partition the superblock and other coding blocks into smaller blocks using square or non-square partitioning. The non-square blocks may include N / 2×N, N×N / 2, N / 4×N, and N×N / 4 blocks. The video encoder 200 and the video decoder 300 may perform a separate prediction and transformation process for each of the coding blocks.

[0036]

[0055] AV1 also defines tiles of video data. A tile is a rectangular array of superblocks that may be coded independently of other tiles. That is, video encoder 200 and video decoder 300 may encode and decode coding blocks within a tile, respectively, without using video data from other tiles. However, video encoder 200 and video decoder 300 may perform filtering across tile boundaries. Tiles may be uniform or non-uniform in size. Tile-based coding may enable parallel processing and / or multi-threading for encoder and decoder implementations.

[0037]

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

[0038]

[0057] Video encoder 200 and video decoder 300 may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, superblock partitioning, or other partitioning structures.

[0039]

[0058] In some examples, the CTU includes a coding tree block (CTB) of luma samples, two corresponding CTBs of chroma samples for a picture with three sample arrays, or a CTB of samples for a picture coded using three separate color planes and syntax structures used to code a monochrome picture or sample. The CTB may be an N×N block of samples for some value of N that partitions to split the components into CTBs. A component is an array or a single sample from one of the three arrays (luma and two chroma) that make up a picture in 4:2:0, 4:2:2, or 4:4:4 color format, or a single sample of an array or arrays that make up a picture in monochrome format. In some examples, the coding block is an M×N block of samples for some value of M and N that partitions to split the CTB into coding blocks.

[0040]

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

[0041]

[0060] In some examples, a tile may be partitioned into multiple bricks, each of which may include one or more CTU rows within the tile. A tile that is not partitioned into multiple bricks may also be referred to as a brick. However, a brick that is a true subset of a tile may not be referred to as a tile. Bricks within a picture may also be arranged as slices. A slice may be an integer number of bricks of a picture that may be contained exclusively within a single network abstraction layer (NAL) unit. In some examples, a slice includes either several complete tiles or only a continuous sequence of complete bricks of one tile.

[0042]

[0061] This disclosure may use "NxN" and "N by N", e.g., 16x16 samples or 16 by 16 samples, interchangeably to refer to the sample dimensions of a block (such as a CU or other video block) in the vertical and horizontal dimensions. In general, a 16x16 CU has 16 samples in the vertical direction (y=16) and 16 samples in the horizontal direction (x=16). Similarly, an NxN CU generally has N samples in the vertical direction and N samples in the horizontal direction, where N represents a non-negative integer value. Samples within a CU may be arranged in rows and columns. Moreover, a CU does not necessarily have to have the same number of samples in the horizontal direction as in the vertical direction. For example, a CU may include NxM samples, where M is not necessarily equal to N.

[0043]

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

[0044]

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

[0045]

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

[0046]

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

[0047]

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

[0048]

[0067] AV1 includes two general techniques for encoding and decoding coding blocks of video data. The two general techniques are intra-prediction (e.g., intra-frame prediction or spatial prediction) and inter-prediction (e.g., inter-frame prediction or temporal prediction). In the context of AV1, when predicting a block of a current frame of video data using an intra-prediction mode, the video encoder 200 and the video decoder 300 do not use video data from other frames of the video data. In most intra-prediction modes, the video encoder 200 encodes a block of the current frame based on a difference between a sample value in the current block and a predicted value generated from a reference sample in the same frame. The video encoder 200 determines a predicted value generated from a reference sample based on the intra-prediction mode.

[0049]

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

[0050]

[0069] As mentioned above, following any transformation that generates transform coefficients, the video encoder 200 may perform quantization of the transform coefficients. Quantization generally refers to a process in which transform coefficients are quantized to possibly reduce the amount of data used to represent the transform coefficients, providing further compression. By performing a 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 truncate an n-bit value to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, the video encoder 200 may perform a bitwise right shift of the value to be quantized.

[0051]

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

[0052]

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

[0053]

[0072] Video encoder 200 may further generate syntax data, such as block-based syntax data, picture-based syntax data, and sequence-based syntax data, for video decoder 300, for example within 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). Video decoder 300 may similarly decode such syntax data to determine how to decode the corresponding video data.

[0054]

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

[0055]

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

[0056]

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

[0057]

[0076] This disclosure may generally refer to "signaling" some information, such as a syntax element. The term "signaling" may generally refer to communication of values ​​for syntax elements and / or other data used to decode encoded video data. That is, video encoder 200 may signal values ​​for syntax elements in a bitstream. In general, signaling refers to generating values ​​in a bitstream. As mentioned above, source device 102 may forward the bitstream to destination device 116 in substantially real-time or non-real-time, which may occur, for example, when storing syntax elements in storage device 112 for later retrieval by destination device 116.

[0058]

[0077] In video coding, such as the H.266 / VVC standard, the ALF is applied to minimize the mean square error between the filtered samples and the original samples. The ALF, as implemented in H.266 / VVC, utilizes only samples after the SAO filter process. That is, the input samples for the ALF may be, for example, the output samples of the SAO. The output samples of the ALF may be stored in a decoded picture buffer (DPB) or output as a visible picture. The filter shapes for the ALF adopted in the joint exploration model (JEM) software were 5×5, 7×7, and 9×9 diamond shapes. The filter shapes may be selected and signaled at the picture level in the JEM. To obtain a better tradeoff between coding efficiency and filter complexity, only the 7×7 diamond shape and the 5×5 diamond shape are supported in VVC for the luma and chroma components, respectively.

[0059]

[0078] 2A shows an example filter 140 that is a 7×7 diamond shaped filter. FIG 2B shows an example filter 142 that is a 5×5 diamond shaped filter. In each of filters 140 and 142, the integer coefficients c i is represented with 7-bit fractional precision. i The absolute value of is coded using a zeroth order exponential-Golomb code followed by the sign bit of the non-zero coefficient. In Figures 2A and 2B, each square corresponds to a luma or chroma sample, and the central square corresponds to the current sample to be filtered. To reduce the overhead of the transmission coefficients and the number of multiplications, the filter shapes in Figures 2A and 2B are point-symmetric. Furthermore, as shown in equation (1), the sum of all filter coefficients is set equal to 128, which is a fixed-point representation of 1.0 with 7-bit fractional precision.

[0060]

number

[0061]

[0079] In equation (1), N is the number of coefficients, and N is equal to 13 and 7 for the 7×7 and 5×5 filter shapes, respectively.

[0062]

[0080] In VVC, nonlinearity is introduced into the ALF. A simple clipping function is applied to reduce the influence of adjacent sample values ​​when the difference between the adjacent sample values ​​and the current sample value to be filtered is too large. To filter samples, the ALF can be implemented as follows:

[0063]

number

[0064] where R(x,y) is the sample value after SAO.

[0065]

[0081] The nonlinear function is defined in terms of the clipping function as follows: f i,j =min(bi ,max(-b i ,R(x+x i,j ,y+y i,j )-R(x,y))) (3) where j is equal to 0 or 1, (x i,j ,y i,j ) is the i-th coefficient c i are the filter tap position offsets of

[0066]

[0082] In VVC version 1, the coefficient c i Clipping parameter b i is the clipping index d i where BD is the internal bit depth.

[0067]

number

[0068]

[0083] For filters, both the number of coefficients signaled and the number of clipping indexes signaled are N-1. Each coefficient is restricted to the range [-128, 127], which is equivalent to [-1.0, 1.0] with 7-bit fractional precision. Each clipping index d i can be 0, 1, 2, or 3 and is signaled by using a 2-bit fixed-length code. To simplify the clipping operation, the clipping parameter b i The values ​​of may be restricted to only powers of 2. Thus, bitwise logical operations can be applied as clipping operations.

[0069]

[0084] The video encoder 200 and the video decoder 300 may be configured to perform sub-block level filter adaptation. In VVC version 1, ALF follows the same luma classification framework as ALF in JEM-7.0. To obtain a better trade-off between coding efficiency and computational complexity, the block size for classification may be increased from 2×2 samples to 4×4 samples. To determine the class index of a 4×4 block, a surrounding window with 8×8 luma samples is adopted to derive the direction and activity information. In this 8×8 luma sample window, four gradient values ​​of every other sample are first calculated, as shown in FIG. 3. FIG. 3 shows the subsampled Laplacian values ​​of a 4×4 sub-block 150 for ALF classification. The gradient values ​​of the samples marked with dots are calculated. The gradient values ​​of the other samples are set to 0.

[0070]

[0085] 4 shows four gradient values ​​for each sample with coordinates (k,l). The dots represent the samples for which the gradients are being calculated. Block 160 shows the horizontal gradient (H) and block 162 shows the vertical gradient (V). Block 164 shows the 135 degree gradient (D1) and block 166 shows the 45 degree gradient (D2). H, V, D1, and D2 are derived as follows: H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)| V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)| D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)| D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)| (5)

[0071]

[0086] The variables i and j may refer to the coordinates of the top-left sample of a 4x4 block. H , the vertical gradient g V , 135 degree gradient g D1, 45 degree gradient g D2 The sum of is calculated as follows:

[0072]

number

[0073]

[0087] R H,V The ratio of the maximum and minimum horizontal and vertical gradients, R D1,D2 The ratio of the maximum and minimum values ​​of the two diagonal gradients, denoted by, is calculated as shown in equation (7). R H,V =max(g H ,g V ) / min(g H ,g V ) R D1,D2 =max(g D1 ,g D2 ) / min(g D1 ,g D2 ) (7)

[0074]

[0088] Next, R H,V and R D1,D2 are compared with each other using two thresholds t1=2 and t2=4.5 to derive the directionality D. Step 1: R H,V ≦t1 and R D1,D2 If ≦t1, then D is set to 0 (Texture), else continue to step 2. Step 2: R D1,D2 >R H,V If so, continue to step 3, else continue to step 4. Step 3: R D1,D2 If ≦t2, then D is set to 1 (weak diagonal), else D is set to 2 (strong diagonal). Step 4: R H,V If ≦t2 then D is set to 3 (weak horizontal / vertical), else D is set to 4 (strong horizontal / vertical).

[0075]

[0089] The activity value A is calculated as follows:

[0076]

number

[0077]

[0090] FIG. 5 shows an example of merging 25 luma classes into 7 merged classes (0 to 6), where each square represents D and

[0078]

number

[0079] A represents a class based on the value of A. The 5x5 grid 170 represents the 25 classes, and the numbers in each box of the 5x5 grid 170 represent the merged classes from 0 to 6. Each class, i.e., each square in the 5x5 grid 170, can have an index from 0 to 24 inclusive. A is mapped to the range 0 to 4 inclusive, and the quantized value is

[0080]

number

[0081] Therefore, each 4x4 block is classified into one of 25 classes as follows:

[0082]

number

[0083]

[0091] The luma filter set includes 25 filters. However, to reduce the number of bits required to represent the filter coefficients while maintaining coding efficiency, different classes can be merged, with the merged classes using the same filter. A merging table is signaled. In the merging table, the filter index of each class is signaled, for example, using a fixed-length code. In the example filter set of FIG. 5, 7 luma filters are signaled. For each class, a filter index (0-6 in this example) is signaled in the ALF_APS.

[0084]

[0092] After determining a filter from the luma filter set based on the class index C of the 4x4 block and the merging table, a geometric transformation may be applied to the filter depending on the gradient value calculated for the 4x4 block, as shown in Table 1, before filtering the samples of the 4x4 block.

[0085] [Table 1]

[0086]

[0093] Figure 6 shows an example of a geometric transformation of filter 140 of Figure 2A. As can be seen in Figure 6, filter 180 corresponds to a diagonal flip of filter 140. Filter 182 corresponds to a vertical flip of filter 140, and filter 184 corresponds to a right rotation of filter 140.

[0087]

[0094] The video encoder 200 and the video decoder 300 may be configured to perform coding tree block level adaptation. In JEM-7.0, only one luma filter set is applied to all luma CTBs of a slice, and only one chroma filter is applied to all chroma CTBs of a slice. However, there are two potential drawbacks. First, using the same filter or filter set for all CTBs of a color component when the statistics between the CTBs differ by a certain amount may limit the coding efficiency of ALF, especially for high-resolution sequences and mixed-content video sequences. Second, when deriving a filter for a slice, the filter cannot be calculated until the statistics of the entire slice are collected. This multi-pass coding is not suitable for low-delay applications. To address this issue, one solution is to use statistics from previous coded slices. However, this may result in some performance loss.

[0088]

[0095] In addition to luma 4x4 block level filter adaptation, VVC supports CTB level filter adaptation. In a slice, different luma CTBs are allowed to use different luma filter sets, and different chroma CTBs can use different chroma filters. CTBs with similar statistics may use the same filters. This CTB level filter adaptation improves coding efficiency, especially for low-latency applications. Furthermore, VVC Version 1 allows filters from previously coded pictures to be used for the CTB. This temporal filter reuse mechanism can reduce the overhead of filter coefficient signaling. In VVC Version 1, up to 7 signaled luma filter sets and 8 signaled chroma filters may be applied to a slice. When no signaled filters exist, one of 16 fixed filter sets may be applied to the luma CTB. When ALF is enabled, a filter set index, either a fixed filter set or a signaled luma filter set, is signaled for the luma CTB. The filter indexes of the signaled chroma filters are signaled for the chroma CTB. When encoding the current CTU in a low-delay application by using the signaled filters from the previously coded picture and the fixed filters, the three CTU level on / off flags and the filter / filter set indexes can be determined by using only the statistics of the current CTU. Thus, the encoded bitstream of each CTU can be generated on the fly, without waiting for the statistics of the entire picture to be available.

[0089]

[0096] The video encoder 200 and the video decoder 300 may be configured to implement a technique for line buffer reduction. As shown in FIG. 2A and FIG. 2B, in the vertical direction, the filter shape has 7 taps and 5 taps for the luma and chroma components, respectively. As a result, in the VVC Test Model 2.0 (VTM-2.0), when decoding a row of a CTU, 7 luma lines and 4 chroma lines of the upper CTU row must be stored in the line buffer for ALF due to the delay of the deblocking filter and the SAO filter. However, the additional line buffer requires a large chip area, especially for high-definition (HD) and ultra-high-definition (UHD) video sequences.

[0090]

[0097] To make ALF hardware-friendly (e.g., by reducing line buffer requirements), a concept of a virtual boundary (VB) may be applied to remove all line buffer overhead for ALF. Considering the deblocking filter and SAO filter in VVC version 1, the location of the VB is four luma samples and two chroma samples above the horizontal CTU boundary. When one sample on one side of the VB is filtered, the sample on the other side of the VB cannot be utilized, and a modified filtering process with symmetric sample padding may be applied.

[0091]

[0098] 7A-7C show examples of symmetric sample padding for luma ALF filtering in ALF VB. In the examples of FIG. 7A-7C, the center square of filter 190 is the location of the current sample to be filtered, and the bold line is the location of VB (VB192). In FIG. 7A-7C, the dashed filter tap positions are padded. FIG. 7A shows an example where one filter tap position of filter 190 is above or below VB192. In this example, one filter tap position is padded. FIG. 7B shows an example where four filter tap positions of filter 190 are above or below VB192. In this example, four filter tap positions are padded.

[0092]

[0099] However, as shown in FIG. 7C, when the sample is located in the nearest row on each side of the VB 192, the 2D filter is equivalent to a horizontal filter. This may introduce visual artifacts. To address this issue, the filter strength can be compensated when the current sample to be filtered is located in the nearest row on each side of the VB, as shown in Equation (10). Comparing Equation (10) with Equation (2), it can be seen that there is an additional 3-bit right shift.

[0093]

number

[0094]

[0100] When VB processing is applied, the classification of the 4x4 blocks may also be modified: when calculating the class index of a 4x4 block on one side of the VB, the gradients and samples on the other side of the VB may not be used, as shown in Figure 8.

[0095]

[0101] FIG. 8 shows an example of ALF 4×4 subblock classification in ALF VB. When calculating the gradient values ​​of samples adjacent to the VB, the samples on the other side of the VB cannot be utilized. Therefore, as shown in FIG. 8, the boundary samples on the current side are iteratively extended. That is, the boundary samples on the current side of the VB are mirrored to the other side of the VB. As the number of available gradient values ​​decreases, the activity derivation in equation (8) is rescaled as follows:

[0096]

number

[0097]

[0102] Video encoder 200 and video decoder 300 may be configured to implement filter coefficient signaling. In VVC version 1, ALF coefficients are signaled in an ALF adaptation parameter set (APS). One APS may include one set of luma filters with up to 25 filters, up to 8 chroma filters, and up to 8 cross-component ALF (CC-ALF) filters. Each set of luma filters supports applying ALF to 25 classes of luma. In VVC version 1, up to 8 ALF_APS are supported.

[0098]

[0103] Table 2 below shows an example syntax signal table for signaling filter coefficients in accordance with the techniques of this disclosure.

[0099] [Table 2-1]

[0100] [Table 2-2]

[0101]

[0104] The video encoder 200 and the video decoder 300 may be configured to implement ALF using multiple classifiers. In VVC, when filtering a sample, only one classifier and one filter may be applied. To improve the performance of ALF on top of VVC, an ALF framework based on multiple classifiers has been proposed. An exemplary implementation of such a framework is shown in FIG. 9. When filtering a sample, multiple classifiers are applied as shown in FIG. 9. A filter is applied to the sample corresponding to the classifier. In FIG. 9, there are two stages. First (first stage 540), the pre-filtering stage is a filter set F(f,i) (i=0...N f -1) and the classifier C(f,i) for the i-th fixed filter set (i=0...N f -1). Secondly (second stage 542), the final filtering stage includes the signaled filter or predefined filter set F' and the corresponding classifier C'.

[0102]

[0105] FIG. 10 illustrates an exemplary ALF framework with three classifiers. In this regard, the ALF framework of FIG. 10 represents a specific implementation of the generalized ALF framework described with respect to FIG. 9. In the example of FIG. 10 employed in ECM-1.0, N f = 2. In FIG. 10, there are two stages. First (first stage 544), the pre-filtering stage selects a filter set F(f,i) (i = 0...N f -1) and the classifier C(f,i) for the i-th fixed filter set (i=0...N f -1). Second (second stage 546), the final filtering stage includes the signaled filter or predefined filter set F' and the corresponding classifier C'.

[0103]

[0106] In ECM-1.0, in classifier C(f,i), where i=0 or 1, activity and direction values ​​may be determined based on the 2D Laplacian value. The classifier may be applied to each sample or block. When the classifier is applied to a block, all samples in the block have the same class index and the same transposition type. i denotes the width of the block, and h i Let (x,y) denote the height of the block, and (x,y) denote the coordinates of the top-left sample of the block.

[0104]

[0107] For a sample with coordinates (k,l), four Laplacian (gradient) values, namely the horizontal gradient H, the vertical gradient V, the 135 degree gradient D1, and the 45 degree gradient D2, may be derived as follows: H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)| V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)| D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)| D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)| (12)

[0105]

[0108] As with VVC, the activity value A i can be derived by using the vertical and horizontal gradients as follows:

[0106]

number

[0107] In the formula, a i and b i are the horizontal and vertical window sizes of the classifier C(f,i), respectively.

[0108] A i is between 0 and M inclusive A,i The quantized value is then further quantized to the range -1.

[0109]

number

[0110] It is shown that:

[0111] In one example M A,i =16,A i =min(192,(mult i A i )≫(9+bitdepth)) and

[0112]

number

[0113] During the ceremony Q

[0193] ={0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9, 9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11, 11,11,11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,13,13,13,13,13,1 3,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,14,14,14,14,14,14,14,14,14,14,14,14,14 ,14 ... bitdepth is the bit depth of R(x,y), and mult i is the window size (a i ,b i ) depends on mult i is equal to

[0114] [Table 3]

[0115]

[0109] The direction can be calculated by using the horizontal gradient H, the vertical gradient V, the 135 degree gradient D1, and the 45 degree gradient D2.

[0116] First, the horizontal gradient g i,H , the vertical gradient g i,V , as well as the two diagonal gradients g i,D1 and g i,D2 The value of is calculated as follows:

[0117]

number

[0118]

[0111] Direction D i To assign the gradient, the maximum and minimum of the horizontal and vertical gradients, and the maximum and minimum of the two diagonal gradients are derived as follows:

[0119]

number

[0120]

[0112] Horizontal / Vertical Edge Strength (ES i,HV ) is a ratio

[0121]

number

[0122] The thresholds are calculated by comparing them with the array of thresholds (Th). The size of the array of thresholds is S, and the thresholds are sorted in ascending order. The number of directions is M D,i =(S+1) * (S+2). Step 1. m=0 and ES i,HV = Initialize to 0. Step 2. If m is equal to S, stop. Otherwise, go to step 3. Step 3.

[0123]

number

[0124] And ES i,HV =ES i,HV If it is +1, go to step 2. If not, stop.

[0125] Diagonal direction (E i,D ) is calculated in the same way as Step 1. m=0 and E i,D = Initialize to 0. Step 2. If m is equal to S, stop. Otherwise, go to step 3. Step 3.

[0126]

number

[0127] And E i,D =E i,D If it is +1, go to step 2. If not, stop.

[0128] An example array of thresholds is Th=[1.25, 1.5, 2, 3, 4.5, 8] and S=6.

[0129]

[0114] Main Edge Strength (ES M ) and minor edge strength (ES S ) can be determined as follows:

[0130]

number

[0131] Then, ES M ES HV It is set as ES S ES D Otherwise, it is set as ES M ES D It is set as ES S ES HV is set as: ES S ES M If greater, D i is set to 0. Otherwise,

[0132]

number

[0133] Then, D i =ES M * (ES M +1) / 2+ES S , otherwise, D i =ES M * (ES M +1) / 2+ES S +M D,i / 2. Class Index C i teeth,

[0134]

number

[0135] It may be derived as: C i Based on this, a filter from C(f,i) is selected.

[0136] Second Phase

[0115] In the second stage, F' is a signaled filter or a predefined filter set, and C' is the corresponding classifier. The intermediate filtered result can be further filtered using the current sample and / or its neighboring samples. C' can be used to determine which filter of F' is applied and how to transpose the coefficients.

[0137] C' may use R and / or R' to determine a filter index for a filter set F' by computing the activity and direction as a first step. When applying F', a transpose operation may be applied.

[0138]

[0117] In one example, for a sample having coordinates (k, l), four Laplacian (gradient) values, namely, horizontal gradient H, vertical gradient V, 135 degree gradient D1, and 45 degree gradient D2, may be derived as follows: H k,l =|2R(k,l)-R(k-1,l)-R(k+1,l)| V k,l =|2R(k,l)-R(k,l-1)-R(k,l+1)| D1 k,l =|2R(k,l)-R(k-1,l-1)-R(k+1,l+1)| D2 k,l =|2R(k,l)-R(k-1,l+1)-R(k+1,l-1)| (16)

[0139]

[0118] Similar to VVC, the activity value A can be derived by using the vertical and horizontal gradients as follows:

[0140]

number

[0141] where a and b are the horizontal and vertical window sizes of the classifier C', respectively, and w and h are the width and height of a block in which all samples have the same classification index and the same transposition index.

[0142]

[0119] A is 0 to M inclusive. A The quantized value is then further quantized to the range -1.

[0143]

number

[0144] For example, when the channel raster=100 kHz and the reference RB bandwidth=180 kHz, and the value of the multiplication factor "K" is set to a value of 2,

[0145]

number

[0146] [Table 4]

[0147]

[0120] Filtering: After obtaining the class index of the samples from C', a filter from the filter set F' is selected based on the class index. The filtering may be applied as follows:

[0148]

number

[0149] In the above equation, the filtering process is divided into two parts. Filter part 1:

[0150]

number

[0151] Filtering by using neighboring samples, geometric transformations can be applied, where N0 is the number of coefficients and can be a 5x5, 7x7, 9x9, 11x11, or 13x13 diamond filter, as shown in FIG. Filter part 2:

[0152]

number

[0153] Filtering by using intermediate filtered samples, geometric transformations can be applied, N1 is the number of coefficients.

[0154] Function f i,j (j=0 or 1) can be defined using a clipping function as follows: f i,j =f i,j (R(x+x i,j ,y+y i,j ),R(x,y))=min(b i ,max(-b i ,R(x+x i,j ),y+y i,j )-R(x,y))) (20)

[0155] Function g i may be defined using a clipping function as follows: g i =g i (R'(x,y,i-N0),R(x,y)) = min(b i ,max(-b i ,R'(x,y,i-N0)-R(x,y))) (21) b i is the coefficient c i are the corresponding clipping parameters. In ECM-1.0, N1=2.

[0156]

[0122] The video encoder 200 and the video decoder 300 may be configured to use a signaled ALF with multiple classifiers. In ECM-1.0, C' is a Laplacian-based classifier. To improve the performance of the ALF, a multiple classifier-based ALF is proposed in 63 / 217067, filed June 30, 2021, which is incorporated herein by reference, and a band-based classifier is adopted in ECM-3.0 as shown in FIG. 11. In FIG. 11, when the signaled filter is used to filter the current sample, the classifier is selected between C2 and C3 based on the signaled flag. The class index is used to select a filter F2 from the set of signaled filters. C2 is a Laplacian-based classifier used in ECM-1.0. C3 is a band-based classifier. Similar to C2, C3 is applied to each non-overlapping 2x2 luma block, and the class index is determined as follows: (sum * num_classes)>>(2+bit_depth) where sum is the sum of the luma sample values ​​of a 2x2 luma block, num_classes is equal to 25, and bit_depth is the bit depth of the luma samples.

[0157]

[0123] Figure 11 shows an example ALF framework according to ECM-4.0. As seen in the example of Figure 11, only post-SAO samples are used for ALF. However, pre-SAO and pre-deblocking filter (DBF) samples can also be used. This disclosure describes techniques for using pre-SAO (post-DBF) samples and / or pre-DBF samples for the ALF process. When pre-DBF samples or pre-SAO samples are used for ALF, these samples can be used for classification and / or filtering.

[0158] When the pre-DBF samples and the pre-SAO samples are used for ALF filtering, equation (19) can be rewritten as follows:

[0159]

number

[0160]

[0125] Function d i may be defined using a clipping function as follows: d i =d i (R d (x+x i ,y+y i ),R(x,y))=min(b i ,max(-b i ,R d (x+x i ,y+y i )-R(x,y))) (23) In the formula, R d (x+x i ,y+y i ) is the adjacent sample before DBF, and (x i ,y i ) is the coordinate offset for the current sample R(x,y).

[0161]

[0126] Function s i may be defined using a clipping function as follows: s i =s i (R s (x+x i ,y+y i ),R(x,y))=min(b i ,max(-b i ,R s (x+x i ,y+y i )-R(x,y))) (24) In the formula, R s (x+x i ,y+y i ) is the adjacent sample before SAO, and (x i ,y i) is the coordinate offset for the current sample R(x,y).

[0162] In formula (22), N d and N s are the numbers of taps applied to the pre-DBF and pre-SAO samples, respectively.

[0163]

[0128] In one example, the pre-DBF sample 602 may be used for the ALF, as shown in Figure 12. In this case, equation (22) becomes:

[0164]

number

[0165]

[0129] In another example, the pre-SAO samples 604 may be used for ALF, as shown in Figure 13. In this case, equation (22) becomes:

[0166]

number

[0167]

[0130] In another example, as shown in FIG. 14, a pre-SAO sample 606 and a pre-DBF sample 608 are used in an ALF process.

[0168] In the examples of equations (25) and (26), the coefficient C i may be signaled and selected based on a classifier, as described above.

[0169]

[0132] According to the techniques of this disclosure, the video decoder 300 may be configured to determine an unfiltered reconstructed block of the video data and apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block. The video decoder 300 applies the ALF to the filtered reconstructed block to determine a final filtered reconstructed block. To apply the ALF to the filtered reconstructed block, the video decoder 300 determines a difference value (e.g., d(i) in Equation 23) based on a difference between a value of a current sample of the filtered reconstructed block (e.g., R above) and a value of an adjacent sample before filtering (e.g., Rd above), and applies a sample correction value (e.g., term

[0170]

number

[0171] or Equation 26

[0172]

number

[0173] ) is determined by using a filter (e.g., c i ) to the difference value (e.g., d in Eq. 25) i or s in Eq. 26 i ) and based on the sample correction values, the final filtered sample values ​​(e.g.,

[0174]

number

[0175] ) based on the difference between the value of the current sample (R) and the value of the adjacent sample before filtering (Rd). To determine the difference value (d(i) in Equation 23) based on the difference between the value of the current sample (R) and the value of the adjacent sample before filtering (Rd), the video decoder 300 may, for example, set the difference value equal to the difference (i.e., perform no clipping) or set the difference value equal to a maximum value (i.e., perform clipping) in response to the difference between the value of the current sample (R) and the value of the adjacent sample before filtering (Rd) being greater than the maximum value. That is, the video decoder 300 may set the difference value to a minimum or maximum value of the actual difference.

[0176]

[0133] Figures 15A-15H show examples of filter taps that may be used on samples before deblocking filtering (DBF) and / or before SAO. In Figures 15A-15H, when the taps are applied to samples before DBF, x = N0 in equations (22) and (26). When the taps are applied to samples before DBF, x = N0 + N d , and x=N0 in equation (26). The center tap may be applied to the sample before DBF / SAO at the coordinate of the current sample. FIG. 15A shows one tap (C x ) filter 702. FIG. 15B shows a filter 702 with four taps (C x -C x+4 ) filter 704. FIG. 15C shows a filter 704 that includes 13 taps (C x -C x+12 ) filter 706. FIG. 15D shows a filter 706 with nine taps (C x -C x+8 ) filter 708. FIG. 15E shows a filter 708 with 13 taps (C x -C x+13 ) filter 710. FIG. 15F shows a filter 710 with 17 taps (C x -C x+16 ) filter 712. FIG. 15G shows a filter 712 that includes 17 taps (C x -C x+17 ) filter 714. FIG. 15H shows a filter 714 with 21 taps (C x -C x+207 shows a filter 716 including

[0177] 16A-16I show examples of filters that may be used on pre-DBF and / or pre-SAO samples with coefficients that are centrally symmetric. In FIG. 16A-16I, when the taps are applied to pre-DBF samples, x=N0 in equations (22) and (26). When the taps are applied to pre-DBF samples, x=N0+N d , and x=N0 in equation (26). The center tap may be applied to the pre-DBF / SAO sample at the coordinate of the current sample.

[0178] FIG. 16A shows three unique coefficients (C x -C x+2 ) filter 720. FIG. 16B shows a filter 720 that includes five taps with seven unique coefficients (C x -C x+6 ) filter 722. FIG. 16C shows a filter 722 that includes 13 taps with 13 unique coefficients (C x -C x+12 ) filter 724. FIG. 16D shows a filter 724 that includes 25 taps with 21 unique coefficients (C x -C x+20 ) filter 726. FIG. 16E shows a filter 726 that includes 41 taps with five unique coefficients (C x -C x+4 ) filter 728. FIG. 16F shows a filter 728 that includes nine taps with seven unique coefficients (C x -C x+6 ) filter 730. FIG. 16G shows a filter 730 with 13 taps, with 9 unique coefficients (C x -C x+8 ) filter 732. FIG. 16H shows a filter 732 that includes 17 taps with 9 unique coefficients (C x -C x+8 ) filter 734. FIG. 16I shows a filter 734 that includes 17 taps with 11 unique coefficients (C x -C x+10 ) is shown as a 21-tap filter 736.

[0179]

[0136] When a pre-DBF sample is used for the ALF, the filter length applied to the pre-DBF sample may depend on the length of the DBF applied to the current sample.

[0180] A flag may be signaled to indicate whether pre-DBF samples and / or pre-SAO samples are used for ALF. For example, the flag may be signaled per filter / per filter set (e.g., in an adaptation parameter set (APS)). In another example, the flag may be signaled at a sequence / picture / sub-picture / slice / CTU / block level.

[0181] In one example, a flag may be signaled at the filter / filter set / APS / sequence / picture / subpicture / slice / CTU / block level to indicate whether the coefficients for the samples before DBF are signaled (c in Equation (22)). i (i=N0..N0+N d -1), and in equation (25), c i (i=N0..N0+N d −1). If not signaled, the values ​​of these coefficients may be equal to 0, which is equivalent to not using pre-DBF samples for the ALF.

[0182] In another example, a flag may be signaled at the filter / filter set / APS / sequence / picture / subpicture / slice / CTU / block level to indicate whether the coefficients for the pre-SAO samples are signaled (c in Equation (22)). i (i=N0+N d ....N0+N d +N s -1, and in equation (26), c i (i=N0....N0+N s -1). If not signaled, the values ​​of these coefficients may be equal to 0, which is equivalent to not using pre-SAO samples for ALF.

[0183]

[0140] A geometric transposition may be applied to the filter shape corresponding to the pre-DBF sample (respectively, the pre-SAO sample). For example, the same transposition process derived in the ALF classifier (C2 or C3) may be applied to the pre-DBF sample (respectively, the pre-SAO sample). In another example, the pre-DBF sample (respectively, the pre-SAO sample) is used to determine the transposition to be applied to the pre-DBF sample (respectively, the pre-SAO sample).

[0184]

[0141] If DBF is not applied to the current sample, the sample before DBF may not be used for the ALF of the current sample. If SAO is not applied to the current sample, the sample before SAO may not be used for the ALF of the current sample.

[0185] All coefficients applied to samples before DBF (respectively SAO) may be coded using the same process, e.g., fixed length coding, unary coding, k-th order Exponential-Golomb coding where k is signaled or fixed (e.g., the absolute value is coded with an Exponential-Golomb code and the sign is coded with another bit).

[0186]

[0143] In equations (22), (25) and (26), the coefficients applied to the center tap of the filter shape (e.g., the center tap of the shapes shown in Figures 11 and 12) and the coefficients (R') applied to the samples derived from the fixed filter may be signaled by using the same coding technique. In one example, a first order exponential-Golomb code is used. (e.g., the absolute value is coded with the exponential-Golomb code and the sign is coded in another bit). This order may be signaled in the bitstream or may be fixed. In another example, these coefficients may be coded by using a fixed length code having the same length, and the length may be fixed or signaled.

[0187]

[0144] In another example, the coefficients applied to adjacent samples in equations (22), (25) and (26) may be signaled using the same coding technique. In one example, a second order exponential-Golomb code is used. (e.g., the absolute value is coded with an exponential-Golomb code and the sign is coded in another bit). This order may be signaled in the bitstream or may be fixed. In another example, the coefficients may be coded using a fixed length code having the same length, and the length may be fixed or signaled.

[0188]

[0145] Aspects of boundary processing are discussed next. First, in the case of slice / tile / picture / virtual boundary, when performing ALF on the current sample, a sample before DBF / SAO may be required and is located on a different side of the slice / tile / picture / virtual boundary other than the same side of the current sample. For example, a neighboring sample is located in a neighboring CTU beyond the slice / tile boundary. When the use of a sample beyond the boundary is disabled, that sample before DBF / SAO may not be accessible and may be replaced by the closest sample on the same side of the boundary as the current sample.

[0189]

[0146] For an L-shaped raster scan slice boundary, when doing ALF on a current sample, its above and left CTUs are in the same slice as the current CTU, but the top-left CTU is in a different slice. The pre-DBF / SAO sample from the top-left CTU is required and is not allowed to be used across slice boundaries. For that sample, the closest sample from the CTU above or to the left of the current sample may be used.

[0190] When performing ALF on the current sample, the right and bottom CTUs may be in the same slice as the current CTU, but the bottom-right CTU may be in a different slice. The pre-DBF / SAO sample from the bottom-right CTU is required and is not allowed to be used across slice boundaries. For that sample, the closest sample from the CTU to the right or below the current sample may be used.

[0191]

[0148] In the case of an ALF virtual boundary (e.g., an ALF line buffer boundary), when performing ALF on the current sample, an ALF virtual boundary, such as four luma lines and two chroma lines above the horizontal CTU boundary in VVC, is used to reduce hardware storage load. When a sample before DBF / SAO may be needed and is located on a different side of the ALF virtual boundary other than the same side of the current sample, that sample before DBF / SAO may not be accessible and may be replaced by the closest sample on the same side of the boundary as the current sample. In another example, symmetric padding may be used to replace the unavailable sample.

[0192]

[0149] Figure 17 is a block diagram illustrating an example video encoder 200 that may implement the techniques of this disclosure. Figure 17 is provided for illustrative purposes and should not be considered as limiting the techniques broadly illustrated and described in this disclosure. For illustrative purposes, this disclosure describes a video encoder 200 according to VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be implemented by video encoding devices configured for other video coding standards and video coding formats, such as AV1 and successors of the AV1 video coding format.

[0193] 17, the video encoder 200 includes a video data memory 230, a mode selection unit 202, a residual generation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a filter unit 216, a decoded picture buffer (DPB) 218, and an entropy coding unit 220. Any or all of the video data memory 230, the mode selection unit 202, the residual generation unit 204, the transform processing unit 206, the quantization unit 208, the inverse quantization unit 210, the inverse transform processing unit 212, the reconstruction unit 214, the filter unit 216, the DPB 218, and the entropy coding unit 220 may be implemented in one or more processors or processing circuits. For example, the units of the video encoder 200 may be implemented as one or more circuits or logic elements as part of a hardware circuit, or as part of a processor, an ASIC, or an FPGA. Moreover, video encoder 200 may include additional or alternative processors or processing circuitry that perform these and other functions.

[0194]

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

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

[0196]

[0153] The various units in FIG. 17 are shown to aid in understanding the operations performed by the video encoder 200. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. A fixed-function circuit refers to a circuit that provides a specific function, and the operations that may be performed are predefined. A programmable circuit refers to a circuit that may be programmed to perform various tasks, and provides flexible functionality in the operations that may 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 software or firmware instructions. Although a fixed-function circuit may execute software instructions (e.g., receive a parameter or output a parameter), the type of operation that the fixed-function circuit performs is generally invariant. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be an integrated circuit.

[0197]

[0154] The video encoder 200 may include arithmetic logic units (ALUs), elementary function units (EFUs), digital circuits, analog circuits, and / or a programmable core formed from programmable circuits. In examples in which the operations of the video encoder 200 are implemented using software executed by programmable circuits, the memory 106 (FIG. 1) may store software instructions (e.g., object code) that the video encoder 200 receives and executes, or another memory (not shown) within the video encoder 200 may store such instructions.

[0198]

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

[0199]

[0156] 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. By way of example, the mode selection unit 202 may include a palette unit, an intra block copy unit (which may be part of the motion estimation unit 222 and / or the motion compensation unit 224), an affine unit, a linear model (LM) unit, etc.

[0200]

[0157] The mode selection unit 202 generally 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 CTUs into CUs, prediction modes for CUs, transform types for residual data of CUs, quantization parameters for residual data of CUs, etc. The mode selection unit 202 may ultimately select a combination of encoding parameters that has a better rate-distortion value than the other tested combinations.

[0201]

[0158] The video encoder 200 may partition a 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 above-mentioned MTT structure, QTBT structure, superblock structure, or quadtree structure. As described above, the video encoder 200 may form one or more CUs from partitioning the CTUs according to the tree structure. Such a CU may also be generally referred to as a "video block" or a "block."

[0202]

[0159] In general, the mode selection unit 202 also controls its components (e.g., the motion estimation unit 222, the motion compensation unit 224, and the intra prediction unit 226) to generate a prediction block for a current block (e.g., a current CU, or in HEVC, an overlapping portion of a PU and a TU). In the case of inter prediction of the current block, the motion estimation unit 222 may perform a motion search to identify one or more closely matching reference blocks among one or more reference pictures (e.g., one or more previously coded pictures stored in the DPB 218). In particular, the motion estimation unit 222 may calculate a value representing how similar a possible reference block is to the current block according to, for example, a sum of absolute differences (SAD), a sum of squared differences (SSD), a mean absolute difference (MAD), a mean squared difference (MSD), etc. The motion estimation unit 222 may generally perform these calculations using a sample-by-sample difference between the current block and the reference block under consideration. Motion estimation unit 222 may identify the reference block having the lowest value resulting from these calculations, indicating the reference block that most closely matches the current block.

[0203]

[0160] The motion estimation unit 222 may form one or more motion vectors (MVs) that define the position of a reference block in a reference picture relative to the position of a current block in a current picture. The motion estimation unit 222 may then provide the motion vectors to the motion compensation unit 224. For example, in the case of unidirectional inter prediction, the motion estimation unit 222 may provide a single motion vector, while in the case of 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 predictive block. For example, the motion compensation unit 224 may use the motion vectors to retrieve data of a reference block. As another example, if the motion vector has fractional sample precision, the motion compensation unit 224 may interpolate values ​​for the predictive block according to one or more interpolation filters. Moreover, in the case of bidirectional inter prediction, the motion compensation unit 224 may retrieve data for two reference blocks identified by the respective motion vectors and combine the retrieved data, for example, through a sample-wise average or weighted average.

[0204]

[0161] When operating according to the AV1 video coding format, the motion estimation unit 222 and the motion compensation unit 224 may be configured to encode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, overlapped block motion compensation (OBMC), and / or synthetic inter-intra prediction.

[0205]

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

[0206] When operating according to the AV1 video coding format, the intra prediction unit 226 may be configured to encode coding blocks of video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, chroma-from-luma (CFL) prediction, intra block copy (IBC), and / or color palette modes. The mode selection unit 202 may include additional functional units that perform video prediction according to other prediction modes.

[0207]

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

[0208]

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

[0209]

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

[0210]

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

[0211]

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

[0212]

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

[0213]

[0170] When operating according to AV1, transform processing unit 206 may apply one or more transforms to the residual block to generate a block of transform coefficients (referred to herein as a "transform coefficient block"). Transform processing unit 206 may apply various transforms to the residual block to form the transform coefficient block. For example, transform processing unit 206 may apply a horizontal / vertical transform combination, which may include a discrete cosine transform (DCT), an asymmetric discrete sine transform (ADST), an inverse ADST (e.g., ADST in reverse order), and an identity transform (IDTX). When using an identity transform, the transform is skipped in one of the vertical or horizontal directions. In some examples, the transform process may be skipped.

[0214]

[0171] The quantization unit 208 may quantize the transform coefficients in the transform coefficient block to generate 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 result in loss of information, and thus the quantized transform coefficients may be less accurate than the original transform coefficients generated by the transform processing unit 206.

[0215]

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

[0216]

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

[0217]

[0174] When operating according to AV1, filter unit 216 may perform one or more filter operations on the reconstructed blocks. For example, filter unit 216 may perform a deblocking operation to reduce blockiness artifacts along the edges of a CU. In another example, filter unit 216 may apply a constrained directional enhancement filter (CDEF), which may be applied after deblocking and may include application of a non-separable, non-linear, low-pass directional filter based on the estimated edge direction. Filter unit 216 may also include a loop restoration filter, which may be applied after CDEF and may include a separable symmetric normalized Wiener filter or a dual autoinduction filter.

[0218]

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

[0219]

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

[0220]

[0177] Video encoder 200 may output a bitstream that includes entropy coding syntax elements needed to reconstruct blocks of a slice or picture. Specifically, entropy coding unit 220 may output the bitstream.

[0221]

[0178] The entropy encoding unit 220 may be configured as a symbol-to-symbol adaptive multi-symbol arithmetic coder according to AV1. A syntax element in AV1 includes an alphabet of N elements, and a context (e.g., a probability model) includes a set of N probabilities. The entropy encoding unit 220 may store the probabilities as n-bit (e.g., 15-bit) cumulative distribution functions (CDFs). The entropy encoding unit 22 may perform recursive scaling with an update factor based on the alphabet size to update the context.

[0222]

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

[0223]

[0180] In some examples, operations performed with respect to luma coding blocks do not need to be repeated for chroma coding blocks. As an example, operations of identifying motion vectors (MVs) and reference pictures for luma coding blocks do not need to be repeated to identify MVs and reference pictures for chroma blocks. Rather, the MVs of luma coding blocks may be scaled to determine the MVs of 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.

[0224]

[0181] The video encoder 200 includes a memory configured to store video data and one or more processors implemented in a circuit, the one or more processors configured to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, and apply an ALF to the filtered reconstructed block to determine a final filtered reconstructed block. To apply the ALF to the filtered reconstructed block, the video encoder 200 may be configured to determine a filter from a set of filters based on sample values ​​of the unfiltered reconstructed block, and apply the filter to corresponding samples in the filtered reconstructed block.

[0225]

[0182] Figure 18 is a block diagram illustrating an example video decoder 300 that may implement the techniques of this disclosure. Figure 18 is provided for illustrative purposes and does not limit the techniques broadly illustrated and described in this disclosure. For illustrative purposes, this disclosure describes a video decoder 300 according to VVC (ITU-T H.266 under development) and HEVC (ITU-T H.265) techniques. However, the techniques of this disclosure may be implemented by video coding devices configured for other video coding standards.

[0226] In the example of FIG. 18, the video decoder 300 includes a coded picture buffer (CPB) memory 320, an entropy decoding unit 302, a prediction processing unit 304, an inverse quantization unit 306, an inverse transform processing unit 308, a reconstruction unit 310, a filter unit 312, and a decoded picture buffer (DPB) 314. Any or all of the CPB memory 320, the entropy decoding unit 302, the prediction processing unit 304, the inverse quantization unit 306, the inverse transform processing unit 308, the reconstruction unit 310, the filter unit 312, and the DPB 314 may be implemented in one or more processors or processing circuits. 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. Moreover, the video decoder 300 may include additional or alternative processors or processing circuits that perform these and other functions.

[0227]

[0184] The prediction processing unit 304 includes a motion compensation unit 316 and an intra prediction unit 318. The prediction processing unit 304 may include additional units that perform prediction according to other prediction modes. By way of 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.

[0228]

[0185] When operating according to AV1, the motion compensation unit 316 may be configured to decode coding blocks of the video data (e.g., both luma coding blocks and chroma coding blocks) using translational motion compensation, affine motion compensation, OBMC, and / or synthetic inter-intra prediction, as described above. The intra prediction unit 318 may be configured to decode coding blocks of the video data (e.g., both luma coding blocks and chroma coding blocks) using directional intra prediction, non-directional intra prediction, recursive filter intra prediction, CFL, intra block copy (IBC), and / or color palette mode, as described above.

[0229]

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

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

[0231]

[0188] The various units shown in FIG. 18 are shown to aid in understanding the operations performed by the video decoder 300. The units may be implemented as fixed function circuits, programmable circuits, or a combination thereof. As with FIG. 17, fixed function circuits refer to circuits that provide a specific function and are pre-defined in the operations that may be performed. Programmable circuits refer to circuits that may be programmed to perform various tasks and provide flexible functionality in the operations that may 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 software or firmware instructions. Although a fixed function circuit may execute software instructions (e.g., receive a parameter or output a parameter), the type of operation that the fixed function circuit performs is generally immutable. In some examples, one or more of the units may be different circuit blocks (fixed function or programmable), and in some examples, one or more of the units may be an integrated circuit.

[0232]

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

[0233]

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

[0234]

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

[0235]

[0192] The entropy decoding unit 302 may entropy decode syntax elements that define the quantized transform coefficients of the quantized transform coefficient block, as well as transform information, such as a quantization parameter (QP) and / or a transform mode indication(s). The inverse quantization unit 306 may use the QP associated with the quantized transform coefficient block to determine the degree of quantization, and likewise the degree of inverse quantization that the inverse quantization unit 306 should 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.

[0236] After the inverse quantization unit 306 forms a 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 transform, or another inverse transform to the transform coefficient block.

[0237]

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

[0238]

[0195] 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 perform an intra prediction process in a manner substantially similar to that described with respect to the intra prediction unit 226 (FIG. 17). The intra prediction unit 318 may retrieve data of neighboring samples for the current block from the DPB 314.

[0239]

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

[0240]

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

[0241]

[0198] The video decoder 300 may store the reconstructed block in the DPB 314. For example, in an example 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 an example 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 described above, the DPB 314 may provide reference information to the prediction processing unit 304, such as samples of the current picture for intra prediction and previously decoded pictures for subsequent motion compensation. In addition, the video decoder 300 may output the decoded picture (e.g., decoded video) from the DPB 314 for later display on a display device, such as the display device 118 of FIG. 1.

[0242]

[0199] In this manner, the video decoder 300 represents an example of a video decoding device including a memory configured to store video data and one or more processors implemented in a circuit, the one or more processors configured to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, and apply an ALF to the filtered reconstructed block to determine a final filtered reconstructed block. To apply the ALF to the filtered reconstructed block, the video decoder 300 may be configured to determine a filter from a set of filters based on sample values ​​of the unfiltered reconstructed block, and apply the filter to corresponding samples in the filtered reconstructed block.

[0243]

[0200] Figure 19 illustrates an example implementation of the filter unit 312 of Figure 18. The filter unit 216 of Figure 17 may be implemented in a substantially similar manner. The filter units 216 and 312 may implement the techniques of this disclosure, possibly in conjunction with other components of the video encoder 200 or the video decoder 300. In the example of Figure 19, the filter unit 312 includes a deblocking filter 342, an SAO filter 344, and an ALF unit 346. The SAO filter 344 may be configured to determine offset values ​​for samples of a block, for example, in a manner described in this disclosure. The ALF unit 346 may similarly filter a block of video data in a manner described in this disclosure.

[0244]

[0201] Filter unit 312 may include fewer filters and / or additional filters. In addition, the specific filters shown in FIG. 19 may be implemented in a different order. Other loop filters (either in the coding loop or after the coding loop) may also be used to smooth pixel transitions or otherwise improve video quality. The filtered reconstructed video blocks output by filter unit 312 may be stored in a DPB 314 that stores reference pictures used for subsequent motion compensation. DPB 314 may be part of or separate from an additional memory that stores decoded video for later presentation on a display device, such as display device 118 of FIG. 1.

[0245]

[0202] According to the techniques of this disclosure, the filter unit 312 may be configured to receive an unfiltered reconstructed block of video data from the reconstruction unit 310, for example. The filter unit 312 may apply one or more of a deblocking filter (e.g., the deblocking filter 342) or a sample adaptive offset filter (e.g., the SAO 344) to the unfiltered reconstructed block to determine a filtered reconstructed block. The ALF 346 may be configured to adjust samples of the filtered reconstructed block to determine a final filtered reconstructed block. For example, the ALF 346 may be configured to determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent sample before filtering. The ALF 346 may determine the difference value, for example, according to Equation (23) above. The ALF 345 may then apply a filter to the difference value to determine a sample correction value. The sample correction value may be, for example, a term in Equation (25) above.

[0246]

number

[0247] The ALF 346 may determine final filtered sample values ​​based on the sample modification values. The ALF 346 may output a picture of the video data including the final filtered reconstructed blocks, for example, to the DPB 314 and / or for display.

[0248]

[0203] Figure 20 is a flowchart illustrating an example process for encoding a current block according to the techniques of this disclosure. The current block may include a current CU. Although described with respect to video encoder 200 (Figures 1 and 18), it should be understood that other devices may be configured to perform a process similar to that of Figure 20.

[0249]

[0204] In this example, the video encoder 200 first predicts the current block (350). For example, the video encoder 200 may form a predictive block for the current block. The video encoder 200 may then calculate a residual block for the current block (352). To calculate the residual block, the video encoder 200 may calculate a difference between an original uncoded block and a predictive block for the current block. The video encoder 200 may then transform the residual block and quantize transform coefficients of the residual block (354). The video encoder 200 may then scan the quantized transform coefficients of the residual block (356). During or following the scan, the video encoder 200 may entropy code the transform coefficients (358). For example, the video encoder 200 may code the transform coefficients using CAVLC or CABAC. The video encoder 200 may then output entropy coded data for the block (360).

[0250]

[0205] Figure 21 is a flowchart illustrating an example process for decoding a current block of video data according to the techniques of this disclosure. The current block may include a current CU. Although described with respect to video decoder 300 (Figures 1 and 19), it should be understood that other devices may be configured to perform a process similar to that of Figure 21.

[0251]

[0206] The video decoder 300 may receive entropy coded data for the current block, such as entropy coded prediction information and entropy coded data for transform coefficients of a residual block corresponding to the current block (370). The video decoder 300 may entropy decode the entropy coded data to determine prediction information for the current block and reconstruct transform coefficients of the residual block (372). The video decoder 300 may predict the current block, e.g., using an intra prediction mode or an inter prediction mode indicated by the prediction information for the current block, to calculate a predictive block for the current block (374). The video decoder 300 may then inverse scan the reconstructed transform coefficients to generate a block of quantized transform coefficients (376). The video decoder 300 may then dequantize the transform coefficients and apply an inverse transform to the transform coefficients to generate a residual block (378). The video decoder 300 may finally decode the current block by combining the predictive block and the residual block (380).

[0252]

[0207] Figure 22 is a flowchart illustrating an example process for decoding a current block of video data in accordance with the techniques of this disclosure. Although described with respect to video decoder 300 (Figures 1 and 18), it should be understood that other devices may be configured to perform a process similar to that of Figure 20. For example, a video decoding loop of video encoder 200, including filter unit 216, may perform the technique of Figure 22.

[0253]

[0208] In the example of FIG. 22, the video decoder 300 determines an unfiltered reconstructed block of the video data (800). The video decoder 300 applies one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block (802). The video decoder 300 applies an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block (804). To apply the ALF to the filtered reconstructed block, the video decoder 300 determines a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of a neighboring sample before filtering (806). The value of the neighboring sample before filtering may be, for example, a value of the neighboring sample before one or both of a deblocking filter or a sample adaptive offset filter are applied to the neighboring sample.

[0254]

[0209] As part of applying the ALF to the filtered reconstructed block (804), the video decoder 300 also applies a filter to the difference values ​​to determine sample modification values ​​(808). As part of applying the ALF to the filtered reconstructed block (804), the video decoder 300 also determines final filtered sample values ​​based on the sample modification values ​​(810).

[0255]

[0210] As part of applying the ALF to the filtered reconstructed block (804), the video decoder 300 may apply a first stage ALF to the current sample additively. To apply the first stage ALF, the video decoder 300 may determine a first class index for the current sample, select a filter from a first set of filters based on the first class index, and apply the filter from the first set of filters to the reconstructed sample to determine a first intermediate sample value. As part of applying the ALF to the filtered reconstructed block (804), the video decoder 300 may apply a second stage ALF to the current sample additively. To apply the second stage ALF to the current sample, the video decoder 300 may determine a second class index for the current sample, select a second filter from the second set of filters based on the second class index, apply the second filter to the current sample to determine a second sample modification value, determine a third sample modification value based on the first intermediate sample value, and determine a final filtered sample value based on the sample modification value, the second sample modification value, and the third sample modification value. The sample modification value, the second sample modification value, and the third sample modification value may correspond to, for example, the three summation terms in Equation 25 above.

[0256]

[0211] The video decoder 300 may output a decoded picture of the video data including the final filtered sample values ​​(812). The video decoder 300 may output the decoded picture by storing the picture in a decoded picture buffer for use in decoding subsequent pictures, by storing the decoded picture in a storage medium for later display, or by outputting the decoded picture to a display device for display in real time or near real time. In cases where the technique of FIG. 22 is implemented by a video encoder, the video encoder may output the decoded picture, for example, by storing the picture in a decoded picture buffer for use in encoding subsequent pictures.

[0257]

[0212] The following numbered clauses illustrate one or more aspects of the devices and techniques described in this disclosure.

[0258]

[0213] Clause 1A: A method for decoding video data, the method comprising: determining an unfiltered reconstructed block of the video data; applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block; and applying an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, wherein applying the ALF to the filtered reconstructed block comprises determining a filter from a set of filters based on sample values ​​of the unfiltered reconstructed block, and applying the filter to corresponding samples in the filtered reconstructed block.

[0259]

[0214] Clause 2A: The method described in clause 1A, wherein determining a filter from a set of filters based on sample values ​​of a reconstructed block before filtering includes determining a filter from the set of filters based on one or both of an activity and a direction for the sample values.

[0260]

[0215] Clause 3A: A method as described in clause 1A or 2A, wherein determining a filter from a set of filters based on sample values ​​of the reconstructed block before filtering includes determining a filter from the set of filters based on sample values ​​of the reconstructed block before filtering and corresponding sample values ​​of the filtered reconstructed block.

[0261]

[0216] Clause 4A: A method according to any of clauses 1A to 3A, further comprising receiving signaling, the signaling indicating whether a filter is determined from a set of filters based on sample values ​​of the reconstructed block before filtering, corresponding sample values ​​of the filtered reconstructed block, or both sample values ​​of the reconstructed block before filtering and corresponding sample values ​​of the filtered reconstructed block.

[0262]

[0217] Clause 5A: A method for decoding video data, the method comprising: applying a first stage adaptive loop filter (ALF) to filtered reconstructed samples of a reconstructed block, the method comprising: determining a first class index for the filtered reconstructed samples based on values ​​of corresponding unfiltered reconstructed samples; selecting a filter from a first set of filters based on the first class index; and applying the filter from the first set of filters to the filtered reconstructed samples to determine first intermediate sample values. determining a second class index for the filtered reconstructed samples based on the unfiltered reconstructed samples; selecting a second filter from a second set of filters based on the second class index; applying the second filter to the filtered reconstructed samples to determine first sample correction values; determining the second sample correction values ​​based on the first intermediate sample values; and determining a final filtered reconstructed sample based on the filtered reconstructed samples, the first sample correction values, and the second sample correction values.

[0263]

[0218] Clause 6A: The method of clause 5A, further comprising applying a deblocking filter to the unfiltered reconstructed samples to determine filtered reconstructed samples.

[0264]

[0219] Clause 7A: The method of clause 5A, further comprising applying a sample adaptive offset filter to the unfiltered reconstructed samples to determine filtered reconstructed samples.

[0265]

[0220] Clause 8A: The method of clause 5A, further comprising applying a deblocking filter and a sample adaptive offset filter to the unfiltered reconstructed samples to determine filtered reconstructed samples.

[0266]

[0221] Clause 9A: The method of any one of clauses 5A to 8A, wherein the first set of filters includes a fixed filter.

[0267]

[0222] Clause 10A: The method of any of clauses 5A to 9A, wherein the second set of filters includes signaled filters determined based on syntax signaled in the video data.

[0268]

[0223] Clause 11A: A method according to any of clauses 5A to 10A, wherein determining the first class index includes determining an activity value for pre-reconstructed samples, determining a direction for the pre-reconstructed samples, and determining the first class index based on the activity value and the direction.

[0269]

[0224] Clause 12A: The method of clause 11A, wherein determining the direction includes assigning one of 56 values ​​to the direction.

[0270]

[0225] Clause 13A: The method of any one of clauses 5A to 12A, wherein the first set of filters includes a 9x9 diamond shaped filter.

[0271]

[0226] Clause 14A: A method described in any of clauses 5A to 13A, wherein determining a final filtered reconstructed sample based on the filtered reconstructed sample, the first sample correction value, and the second sample correction value includes adding the first sample correction value and the second sample correction value to the filtered reconstructed sample.

[0272]

[0227] Clause 15A: A method according to any of clauses 5A to 13A, wherein determining a second sample correction value based on the first intermediate sample value includes clipping the second sample correction value to determine a clipped sample correction value, and adding the first sample correction value and the clipped sample correction value to the filtered reconstructed sample.

[0273]

[0228] Clause 16A: The method of clause 15A, further comprising receiving clipped sample correction values ​​in the video data.

[0274]

[0229] Clause 17A: A method described in any of clauses 5A to 16A, wherein determining a second sample correction value based on the first intermediate sample value includes determining a difference between the filtered reconstructed sample and the first intermediate sample value.

[0275]

[0230] Clause 18A: The method of any of clauses 5A to 17A, further comprising selecting a first set of filters from the multiple sets of fixed filters based on a quantization parameter of the reconstructed block.

[0276]

[0231] Clause 19A: A method according to any of clauses 5A to 18A, wherein applying the first stage ALF further includes determining a third class index for the unfiltered reconstructed samples, selecting a third filter from the second set of filters based on the third class index, and applying the third filter from the second set of filters to the unfiltered reconstructed samples to determine a second intermediate sample value, and applying the second stage ALF to the unfiltered reconstructed samples further includes determining a second sample correction value based on the first intermediate sample value and the second intermediate sample value.

[0277]

[0232] Clause 20A: The method of any one of clauses 5A to 19A, further comprising adding the predicted sample values ​​to the residual sample values ​​to determine the unfiltered reconstructed samples.

[0278]

[0233] Clause 21A: The method described in clause 20A, further comprising applying one or both of a deblocking filter or a sample adaptive offset filter to the sum of the predicted sample values ​​and the residual sample values ​​to determine a filtered reconstructed sample.

[0279]

[0234] Clause 22A: The method of any of clauses 5A to 21A, further comprising outputting a decoded picture of the video data, the decoded picture comprising the final filtered reconstructed sample.

[0280]

[0235] Clause 23A: A method for decoding video data, the method comprising: applying a first stage adaptive loop filter (ALF) to filtered reconstructed samples of a reconstructed block, determining a first class index for the filtered reconstructed samples based on values ​​of corresponding unfiltered reconstructed samples, selecting a first filter from a first set of filters based on the first class index, applying the first filter from the first set of filters to the filtered reconstructed samples to determine a first intermediate sample value, determining a second class index for the filtered reconstructed samples based on values ​​of corresponding unfiltered reconstructed samples, selecting a second filter from a second set of filters based on the second class index, and selecting a second filter from the second set of filters to determine a second intermediate sample value. applying a first stage ALF including applying a second filter from a third set of filters to the filtered reconstructed samples; applying a second stage ALF to the filtered reconstructed samples and first and second intermediate sample values, wherein the second stage ALF includes determining a third class index for the filtered reconstructed samples based on corresponding unfiltered reconstructed samples, selecting a third filter from a third set of filters based on the third class index; applying the third filter to the filtered reconstructed samples and the first and second intermediate sample values ​​to determine third sample correction values; and determining a final filtered reconstructed sample based on the filtered reconstructed samples, the first and second intermediate values, and the third sample correction values.

[0281]

[0236] Clause 24A: The method according to any of clauses 1A to 23A, wherein the decoding method is performed as part of a video encoding process.

[0282]

[0237] Clause 25A: A device for coding video data, the device comprising one or more means for performing the method according to any of clauses 1A to 24A.

[0283]

[0238] Clause 26A: The device of clause 21A, wherein the one or more means include one or more processors implemented in the circuit.

[0284]

[0239] Clause 27A: The device of clause 25A or 26A, further comprising a memory for storing video data. Clause 28A: The device of any of clauses 25A to 27A, further comprising a display configured to display the decoded video data.

[0285]

[0240] Clause 29A: The device of any of clauses 25A to 28A, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0286]

[0241] Clause 30A: The device of any one of clauses 25A to 29A, wherein the device comprises a video decoder.

[0287]

[0242] Clause 31A: The device according to any one of clauses 25A to 30A, wherein the device comprises a video encoder.

[0288]

[0243] Clause 32A: A computer-readable storage medium having stored thereon instructions that, when executed, cause one or more processors to perform a method according to any one of clauses 1A to 24A.

[0289]

[0244] Clause 1B: A method for decoding video data, the method comprising: determining an unfiltered reconstructed block of the video data; applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block; and applying an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, wherein applying the ALF to the filtered reconstructed block comprises determining a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent sample before filtering, applying a filter to the difference value to determine a sample correction value, and determining a final filtered sample value based on the sample correction value.

[0290]

[0245] Clause 2B: The method of clause 1B, wherein determining a difference value based on a difference between a value of the current sample and a value of an adjacent sample before filtering includes setting the difference value equal to the difference.

[0291]

[0246] Clause 3B: The method described in clause 1B, wherein determining a difference value based on a difference between a value of the current sample and a value of an adjacent sample before filtering includes setting the difference value equal to a maximum value in response to the difference between the value of the current sample and the value of the adjacent sample before filtering being greater than the maximum value.

[0292]

[0247] Clause 4B: A method according to any of clauses 1B to 3B, wherein applying the ALF to the filtered reconstructed block further includes determining a class index for the current sample, selecting a filter based on the class index, applying the selected filter to the current sample to determine a second sample correction value, and determining a final filtered sample value based on the sample correction value and the second sample correction value.

[0293]

[0248] Clause 5B: The method of clause 4B, further comprising: determining an activity metric for the current sample; determining a direction metric for the current sample; and determining a class index based on the activity metric and the direction metric.

[0294]

[0249] Clause 6B: A method as described in clause 4B or 5B, wherein applying the selected filter to the current sample includes multiplying coefficients of the selected filter by values ​​of corresponding filter support positions, the corresponding filter support positions containing values ​​of the sample of the filtered reconstructed block.

[0295]

[0250] Clause 7B: A method according to any of clauses 1B to 6B, further comprising: applying a first stage adaptive loop filter (ALF) to the current sample, where applying the first stage ALF includes determining a class index for the current sample, selecting a filter from a set of filters based on the class index, and applying the filter from the set of filters to the reconstructed sample to determine an intermediate sample value; applying a second stage ALF to the current sample, where applying the second stage ALF includes selecting a second filter from a second set of filters based on a second class index, and applying the second filter to the intermediate sample value to determine a second sample correction value; and determining a final filtered sample value based on the sample correction value and the second sample correction value.

[0296]

[0251] Clause 8B: The method of any of clauses 1B to 6B, further comprising: applying a first stage adaptive loop filter (ALF) to the current sample, where applying the first stage ALF includes determining a first class index for the current sample, selecting a filter from a first set of filters based on the first class index, and applying the filter from the first set of filters to the reconstructed sample to determine a first intermediate sample value; applying a second stage ALF to the current sample, where applying the second stage ALF includes determining a second class index for the current sample, selecting a second filter from the second set of filters based on the second class index, applying the second filter to the current sample to determine a second sample correction value, and determining a third sample correction value based on the first intermediate sample value; and determining a final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value.

[0297]

[0252] Clause 9B: The method described in Clause 8B, wherein determining a final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value includes adding the sample correction value, the second sample correction value, and the third sample correction value to the current sample.

[0298]

[0253] Clause 10B: A method according to any of clauses 1B to 9B, wherein applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block comprises applying a deblocking filter to the unfiltered reconstructed samples to determine filtered reconstructed samples.

[0299]

[0254] Clause 11B: A method according to any of clauses 1B to 9B, wherein applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block comprises applying a deblocking filter and a sample adaptive offset filter to the unfiltered reconstructed samples to determine a filtered reconstructed sample.

[0300]

[0255] Clause 12B: The method of any one of clauses 1B to 11B, wherein the values ​​of the adjacent samples before filtering include values ​​of the adjacent samples before one or both of a deblocking filter or a sample adaptive offset filter are applied to the adjacent samples.

[0301]

[0256] Clause 13B: The method of any one of clauses 1B to 12B, further comprising outputting a picture of the video data including the final filtered reconstructed block.

[0302]

[0257] Clause 14B: The method of any of clauses 1B to 13B, wherein the decoding method is performed as part of a video encoding process.

[0303]

[0258] Clause 15B: A device for decoding video data, the device comprising a memory configured to store the video data and one or more processors implemented in a circuit, the one or more processors being configured to determine an unfiltered reconstructed block of the video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, and apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, and to apply the ALF to the filtered reconstructed block, the one or more processors are further configured to determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent sample before filtering, apply a filter to the difference value to determine a sample correction value, and determine a final filtered sample value based on the sample correction value.

[0304]

[0259] Clause 16B: The device described in clause 15B, wherein to determine a difference value based on a difference between a value of a current sample and a value of an adjacent sample before filtering, the one or more processors are further configured to set the difference value equal to the difference.

[0305]

[0260] Clause 17B: The device described in Clause 15B, wherein to determine a difference value based on a difference between a value of a current sample and a value of an adjacent sample before filtering, the one or more processors are further configured to set the difference value equal to a maximum value in response to the difference between the value of the current sample and the value of the adjacent sample before filtering being greater than the maximum value.

[0306]

[0261] Clause 18B: A device described in any of clauses 15B to 17B, wherein, further to apply the ALF to the filtered reconstructed block, the one or more processors are configured to determine a class index for the current sample, select a filter based on the class index, apply the selected filter to the current sample to determine a second sample correction value, and determine a final filtered sample value based on the sample correction value and the second sample correction value.

[0307]

[0262] Clause 19B: The device described in Clause 18B, wherein the one or more processors are further configured to determine an activity metric for the current sample, determine a direction metric for the current sample, and determine a class index based on the activity metric and the direction metric.

[0308]

[0263] Clause 20B: A device as described in Clause 18B or 19B, wherein to apply the selected filter to a current sample, the one or more processors are further configured to multiply the coefficients of the selected filter by values ​​of corresponding filter support positions, the corresponding filter support positions containing values ​​of samples of the filtered reconstructed block.

[0309]

[0264] Clause 21B: The device described in any of clauses 15B to 20B, wherein the one or more processors are further configured to: apply a first stage adaptive loop filter (ALF) to the current sample, where to apply the first stage ALF, the one or more processors are further configured to determine a class index for the current sample, select a filter from a set of filters based on the class index, and apply the filter from the set of filters to the reconstructed sample to determine an intermediate sample value; apply a second stage ALF to the current sample, where to apply the second stage ALF, the one or more processors are further configured to select a second filter from a second set of filters based on a second class index, and apply the second filter to the intermediate sample value to determine a second sample correction value; and determine a final filtered sample value based on the sample correction value and the second sample correction value.

[0310]

[0265] Clause 22B: applying a first stage adaptive loop filter (ALF) to the current sample, where to apply the first stage ALF, the one or more processors are further configured to: determine a first class index for the current sample, select a filter from a first set of filters based on the first class index, and apply the filter from the first set of filters to the reconstructed sample to determine a first intermediate sample value; and applying a second stage ALF to the current sample, where applying the second stage ALF The device of any of clauses 15B to 20B, wherein the one or more processors are further configured to determine a second class index for the current sample, select a second filter from the second set of filters based on the second class index, apply the second filter to the current sample to determine a second sample correction value, and determine a third sample correction value based on the first intermediate sample value; and determine a final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value.

[0311]

[0266] Clause 23B: The device described in Clause 22B, wherein the one or more processors are further configured to add the sample correction value, the second sample correction value, and the third sample correction value to the current sample to determine a final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value.

[0312]

[0267] Clause 24B: A device described in any of Clauses 15B to 23B, further configured to apply a deblocking filter to the unfiltered reconstructed samples to determine a filtered reconstructed block, wherein the one or more processors are further configured to apply a deblocking filter to the unfiltered reconstructed samples to determine a filtered reconstructed block.

[0313]

[0268] Clause 25B: A device described in any of clauses 15B to 23B, further configured to apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, wherein the one or more processors apply a deblocking filter and a sample adaptive offset filter to the unfiltered reconstructed samples to determine a filtered reconstructed block.

[0314]

[0269] Clause 26B: A device described in any one of clauses 15B to 25B, wherein the values ​​of the adjacent samples before filtering include values ​​of the adjacent samples before one or both of a deblocking filter or a sample adaptive offset filter are applied to the adjacent samples.

[0315]

[0270] Clause 27B: The device of any one of clauses 15B to 25B, wherein the one or more processors are further configured to output a picture of the video data including the final filtered reconstructed block.

[0316]

[0271] Clause 28B: The device of any one of clauses 15B to 27B, wherein the device comprises a wireless communication device and further comprises a receiver configured to receive video data.

[0317]

[0272] Clause 29B: The device of clause 28B, wherein the wireless communication device comprises a telephone handset and the receiver is configured to demodulate a signal including the video data in accordance with a wireless communication standard.

[0318]

[0273] Clause 30B: The device of any of clauses 15B to 29B, further comprising a display configured to display the decoded video data.

[0319]

[0274] Clause 31B: The device of any of clauses 15B to 30B, wherein the device comprises one or more of a camera, a computer, a mobile device, a broadcast receiver device, or a set-top box.

[0320]

[0275] Clause 32B: The device of any of clauses 15B to 31B, wherein the device comprises a video encoding device.

[0321]

[0276] Clause 33B: A computer-readable storage medium storing instructions which, when executed by one or more processors, cause the one or more processors to determine an unfiltered reconstructed block of video data, apply one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block, apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block, determine a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample, apply a filter to the difference value to determine a sample correction value, and determine a final filtered sample value based on the sample correction value.

[0322] It should be recognized that in some examples, some acts or events of any of the techniques described herein may be performed in a different order, or may be added, merged, or omitted entirely (e.g., not all acts or events described may be required to practice the techniques). Moreover, in some examples, acts or events may be performed in parallel rather than sequentially, for example, through multithreaded processing, interrupt processing, or multiple processors.

[0323]

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

[0324]

[0279] By way of example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included within the definition of the medium. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks typically reproduce data magnetically, while discs reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer readable media.

[0325]

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

[0326]

[0281] The techniques of the present disclosure may be implemented in a wide variety of devices or apparatuses, including wireless handsets, integrated circuits (ICs), or sets of ICs (e.g., chipsets). Various components, modules, or units have been described in this disclosure to highlight functional aspects of devices configured to implement the disclosed techniques, but they do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined in a codec hardware unit or may be provided by a collection of interoperable hardware units, including one or more processors as described above, in conjunction with suitable software and / or firmware.

[0327]

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

Claims

1. 1. A method for encoding or decoding video data, the method comprising: determining an unfiltered reconstructed block of video data; applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block; applying an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block; applying the ALF to the filtered reconstructed block determining a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample in the unfiltered reconstructed block; applying a filter to the difference values ​​to determine sample correction values; determining final filtered sample values ​​based on the sample correction values; A method comprising:

2. 2. The method of claim 1, wherein determining the difference value based on the difference between the value of the current sample and the value of the unfiltered adjacent sample comprises setting the difference value equal to the difference.

3. 2. The method of claim 1 , wherein determining the difference value based on the difference between the value of the current sample and the value of the unfiltered adjacent sample comprises setting the difference value equal to a maximum value in response to the difference between the value of the current sample and the value of the unfiltered adjacent sample being greater than the maximum value.

4. applying the ALF to the filtered reconstructed block determining a class index for the current sample; selecting a filter based on the class index; applying the selected filter to the current sample to determine a second sample modification value; The method of claim 1 , further comprising: determining the final filtered sample value based on the sample correction value and the second sample correction value.

5. determining an activity metric for the current sample; determining a direction metric for the current sample; determining the class index based on an activity metric and the direction metric; The method of claim 4 further comprising:

6. 5. The method of claim 4, wherein applying the selected filter to the current sample comprises multiplying coefficients of the selected filter by values ​​of corresponding filter support locations, the corresponding filter support locations comprising values ​​of samples of the filtered reconstructed block.

7. applying a first stage adaptive loop filter (ALF) to the current sample, wherein applying the first stage ALF includes: determining a class index for the current sample; selecting a filter from a set of filters based on the class index; and applying a filter from the set of filters to the reconstructed samples to determine intermediate sample values; applying a second-stage ALF to the current sample, wherein applying the second-stage ALF includes: selecting a second filter from the second set of filters based on the second class index; and applying the second filter to the intermediate sample values ​​to determine second sample correction values; determining the final filtered sample value based on the sample correction value and the second sample correction value; The method of claim 1 further comprising:

8. applying a first stage adaptive loop filter (ALF) to the current sample, wherein applying the first stage ALF includes: determining a first class index for the current sample; selecting a filter from a first set of filters based on the first class index; and applying the filter from the first set of filters to the reconstructed samples to determine a first intermediate sample value; applying a second-stage ALF to the current sample, wherein applying the second-stage ALF includes: determining a second class index for the current sample; selecting a second filter from a second set of filters based on the second class index; applying the second filter to the current sample to determine a second sample modification value; applying, including determining a third sample correction value based on the first intermediate sample value; determining the final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value; Further comprising:

2. The method of claim 1 , wherein optionally, determining the final filtered sample value based on the sample correction value, the second sample correction value, and the third sample correction value comprises adding the sample correction value, the second sample correction value, and the third sample correction value to the current sample.

9. 2. The method of claim 1 , wherein applying one or more of the deblocking filter or the sample adaptive offset filter to the unfiltered reconstructed block to determine the filtered reconstructed block comprises applying the deblocking filter to unfiltered reconstructed samples to determine filtered reconstructed samples.

10. 2. The method of claim 1 , wherein applying one or more of the deblocking filter or the sample adaptive offset filter to the unfiltered reconstructed block to determine the filtered reconstructed block comprises applying the deblocking filter and the sample adaptive offset filter to unfiltered reconstructed samples to determine filtered reconstructed samples.

11. The method of claim 1 , wherein the values ​​of the adjacent samples before filtering include values ​​of the adjacent samples before one or both of the deblocking filter or the sample adaptive offset filter are applied to the adjacent samples.

12. The method of claim 1 , further comprising outputting a picture of video data including the final filtered reconstructed block.

13. 1. A device for encoding or decoding video data, said device comprising: a memory configured to store video data; and one or more processors implemented in a circuit, the one or more processors comprising: determining an unfiltered reconstructed block of video data; applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block; configured to apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block; To apply the ALF to the filtered reconstructed blocks, the one or more processors: determining a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample in the unfiltered reconstructed block; applying a filter to the difference values ​​to determine sample correction values; The device is further configured to determine final filtered sample values ​​based on the sample correction values.

14. 1. A computer-readable storage medium storing instructions that, when executed by one or more processors, cause the one or more processors to: determining an unfiltered reconstructed block of video data; applying one or more of a deblocking filter or a sample adaptive offset filter to the unfiltered reconstructed block to determine a filtered reconstructed block; The instructions may also include causing the one or more processors to: apply an adaptive loop filter (ALF) to the filtered reconstructed block to determine a final filtered reconstructed block; and to apply the ALF to the filtered reconstructed block. determining a difference value based on a difference between a value of a current sample of the filtered reconstructed block and a value of an adjacent unfiltered sample in the unfiltered reconstructed block; applying a filter to the difference values ​​to determine sample correction values; determining final filtered sample values ​​based on the sample modification values;