Patent Description:
Digital video devices implement video compression techniques, such as those described in the standards defined by MPEG-<NUM>, MPEG-<NUM>, ITU-T H. <NUM>, ITU-T H. <NUM>/MPEG-<NUM>, Part <NUM>, Advanced Video Coding (AVC), the recently finalized High Efficiency Video Coding (HEVC) standard, and extensions of such standards. The video devices may transmit, receive, encode, decode, and/or store digital video information more efficiently by implementing such video compression techniques.

Video compression techniques perform 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 (i.e., a video frame or a portion of a video frame) may be partitioned into video blocks, which may also be referred to as treeblocks, coding units (CUs) and/or coding nodes.

Spatial or temporal prediction results in a predictive block for a block to be coded. Residual data represents pixel differences between the original block to be coded and the predictive block. An inter-coded block is encoded according to a motion vector that points to a block of reference samples forming the predictive block, and the residual data indicating the difference between the coded block and the predictive block. An intra-coded block is encoded according to an intra-coding mode and the residual data. For further compression, the residual data may be transformed from the pixel domain to a transform domain, resulting in residual transform coefficients, which then may be quantized. The quantized transform coefficients, initially arranged in a two-dimensional array, may be scanned in order to produce a one-dimensional vector of transform coefficients, and entropy coding may be applied to achieve even more compression.

Alfonso De La Rocha Gomez - Arevalillo: "Investigating the Adaptive Loop Filter in Next Generation Video Coding", Independent thesis Advanced level (degree of Master (Two Years)), provides a detailed overview of the Adaptive Loop Filter (ALF) implementation in JEM3 (i.e. ISO/IEC Joint Video Exploration Team (JVET). "N16276: Algorithm description of Joint Exploratory Test Model <NUM> (JEM3)". In the ALF stages, blocks included in each classification group for the luma channel are used to design an optimal set of filter coefficients. Therefore, up to <NUM> filters may be used and transmitted in ALF for the luma channel (a different set of filter coefficients for each group). Further, if for a CU, the distortion measured is lower for the filtered signal (using the previously estimated, merged or predicted coefficients) compared to the to-be-filtered one, the ALF-flag for that CU is enabled.

<NPL>), discloses that in JEM, an adaptive loop filter (ALF) with block-based filter adaption is applied. For the Luma component, one among <NUM> filters is selected for each 2x2 block, based on the direction and activity of local gradients. The filtering process of luma component can controlled at CU level. A flag is signaled to indicate whether ALF is applied to the luma component of a CU.

This disclosure describes techniques related to filtering techniques referred to as "Adaptive Loop Filter (ALF). " An ALF may be used in a post-processing stage, for in-loop coding, or in a prediction process. Sample adaptive offset (SAO) filtering and/or adaptive loop filtering may be applied to any of various existing video codec technologies, such as HEVC-compliant codec technology, or be an efficient coding tool in any future video coding standards. The techniques described may therefore apply to a variety of block-based video coding techniques in which video is reconstructed on a block-by-block basis. The blocks of pixels may variously be referred to as coding tree units (CTUs), largest coding units (LCU), prediction unit (PU) or other terminology depending upon the block-based video coding used, as described later.

As will be explained in more detail below, in accordance with the techniques of this disclosure, a video encoder and a video decoder may be configured to determine sets of adaptive loop filters, from among a plurality of sets of adaptive loop filters, on a per-block basis (e.g., for blocks for which adaptive loop filtering is enabled). In this way, the set of adaptive loop filters available for use with a particular block may be more adapted to the local characteristics of the video data near the particular block, thus improving coding efficiency and/or picture quality.

A method according to the invention is defined in the appended independent claim <NUM>. An apparatus according to the invention is defined in appended independent claim <NUM>. A non-transitory computer-readable storage medium according to the invention is defined in the appended independent claim <NUM>.

<FIG> is a block diagram illustrating an example video encoding and decoding system <NUM> useful for understanding the invention. The system <NUM> may utilize the techniques for adaptive loop filtering described in this disclosure. As shown in <FIG>, system <NUM> includes a source device <NUM> that generates encoded video data to be decoded at a later time by a destination device <NUM>. Source device <NUM> and destination device <NUM> may be any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, so-called "smart" pads, televisions, cameras, display devices, digital media players, video gaming consoles, video streaming device, or the like. In some cases, source device <NUM> and destination device <NUM> may be equipped for wireless communication.

Destination device <NUM> may receive the encoded video data to be decoded via a link <NUM>. Link <NUM> may be any type of medium or device capable of moving the encoded video data from source device <NUM> to destination device <NUM>. In one example, link <NUM> may be a communication medium to enable source device <NUM> to transmit encoded video data directly to destination device <NUM> in real-time. The encoded video data may be modulated according to a communication standard, such as a wireless communication protocol, and transmitted to destination device <NUM>. 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 source device <NUM> to destination device <NUM>.

In another example, encoded video data may be output from output interface <NUM> to a storage device <NUM>. Similarly, encoded video data may be accessed from storage device <NUM> by input interface <NUM>. Storage device <NUM> may include any of a variety of distributed or locally accessed data storage media such as a hard drive, Blu-ray discs, DVDs, CD-ROMs, flash memory, volatile or non-volatile memory, or any other suitable digital storage media for storing encoded video data. In a further example, storage device <NUM> may correspond to a file server or another intermediate storage device that may hold the encoded video generated by source device <NUM>. Destination device <NUM> may access stored video data from storage device <NUM> via streaming or download. The file server may be any type of server capable of storing encoded video data and transmitting that encoded video data to the destination device <NUM>. Example file servers include a web server (e.g., for a website), a file transfer protocol (FTP) server, network attached storage (NAS) devices, or a local disk drive. Destination device <NUM> may access the encoded video data through any standard data connection, including an Internet connection. This may include a wireless connection (e.g., a Wi-Fi connection), a wired connection (e.g., DSL, cable modem, etc.), or a combination of both that is suitable for accessing encoded video data stored on a file server. The transmission of encoded video data from storage device <NUM> may be a streaming transmission, a download transmission, or a combination of both.

The techniques of this disclosure are not necessarily limited to wireless applications or settings. The techniques may be applied to video coding in support of any of a variety of multimedia applications, such as over-the-air television broadcasts, cable television transmissions, satellite television transmissions, streaming video transmissions, e.g., via the Internet, encoding of digital video for storage on a data storage medium, decoding of digital video stored on a data storage medium, or other applications. In some examples, system <NUM> may be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and/or video telephony.

In the example of <FIG>, source device <NUM> includes a video source <NUM>, a video encoder <NUM> and an output interface <NUM>. In some cases, output interface <NUM> may include a modulator/demodulator (modem) and/or a transmitter. In source device <NUM>, video source <NUM> may include a source such as a video capture device, e.g., a video camera, a video archive containing previously captured video, a video feed interface to receive video from a video content provider, and/or a computer graphics system for generating computer graphics data as the source video, or a combination of such sources. In general, capturing video data may include any technique for recording, generating, and/or sensing video data. As one example, if video source <NUM> is a video camera, source device <NUM> and destination device <NUM> may form so-called camera phones or video phones. However, the techniques described in this disclosure may be applicable to video coding in general, and may be applied to wireless and/or wired applications.

The captured, pre-captured, or computer-generated video may be encoded by video encoder <NUM>. The encoded video data may be transmitted directly to destination device <NUM> via output interface <NUM> of source device <NUM>. The encoded video data may also (or alternatively) be stored onto storage device <NUM> for later access by destination device <NUM> or other devices, for decoding and/or playback.

Destination device <NUM> includes an input interface <NUM>, a video decoder <NUM>, and a display device <NUM>. In some cases, input interface <NUM> may include a receiver and/or a modem. Input interface <NUM> of destination device <NUM> receives the encoded video data over link <NUM>. The encoded video data communicated over link <NUM>, or provided on storage device <NUM>, may include a variety of syntax elements generated by video encoder <NUM> for use by a video decoder, such as video decoder <NUM>, in decoding the video data. Such syntax elements may be included with the encoded video data transmitted on a communication medium, stored on a storage medium, or stored on a file server.

Display device <NUM> may be integrated with, or external to, destination device <NUM>. In some examples, destination device <NUM> may include an integrated display device and also be configured to interface with an external display device. In other examples, destination device <NUM> may be a display device. In general, display device <NUM> displays the decoded video data to a user, and may be 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.

Video encoder <NUM> and video decoder <NUM> may operate according to a video compression standard, such as the recently finalized High Efficiency Video Coding (HEVC) standard, and may conform to the HEVC Test Model (HM). Video encoder <NUM> and video decoder <NUM> may additionally operate according to an HEVC extension, such as the range extension, the multiview extension (MV-HEVC), or the scalable extension (SHVC) which have been developed by the Joint Collaboration Team on Video Coding (JCT-VC) as well as Joint Collaboration Team on 3D Video Coding Extension Development (JCT-3V) of ITU-T Video Coding Experts Group (VCEG) and ISO/IEC Motion Picture Experts Group (MPEG). Alternatively, video encoder <NUM> and video decoder <NUM> may operate according to other proprietary or industry standards, such as the ITU-T H. <NUM> standard, alternatively referred to as ISO/IEC MPEG-<NUM>, Part <NUM>, Advanced Video Coding (AVC), or extensions of such standards, such as the Scalable Video Coding (SVC) and Multi-view Video Coding (MVC) extensions. The techniques of this disclosure, however, are not limited to any particular coding standard. Other examples of video compression standards include ITU-T H. <NUM>, ISO/IEC MPEG-<NUM> Visual, ITU-T H. <NUM> or ISO/IEC MPEG-<NUM> Visual, ITU-T H. <NUM>, and ISO/IEC MPEG-<NUM> Visual. HEVC (ITU-T H. <NUM>), including its range extension, multiview extension (MV-HEVC) and scalable extension (SHVC), were developed by the Joint Collaboration Team on Video Coding (JCT-VC) as well as the Joint Collaboration Team on 3D Video Coding Extension Development (JCT-3V) of ITU-T Video Coding Experts Group (VCEG) and ISO/IEC Motion Picture Experts Group (MPEG). The finalized HEVC draft, referred to as HEVC WD hereinafter, is available at http://phenix. fr/jct/doc_end_user/documents/14_Vienna/wg11/JCTVC-N1003-v1.

ITU-T VCEG (Q6/<NUM>) and ISO/IEC MPEG (JTC <NUM>/SC <NUM>/WG <NUM>) are now developing future video coding technology with a compression capability that potentially exceeds that of the current HEVC standard (including its current extensions and near-term extensions for screen content coding and high-dynamic-range coding). The new standard is called H. <NUM>/VVC (Versatile Video coding). The groups are working together on this exploration activity in a joint collaboration effort known as the Joint Video Exploration Team (JVET) to evaluate compression technology designs proposed by their experts in this area. One version of the reference software, i.e.,<NPL>. The algorithm description for JEM7 is described in <NPL>. A recent draft of the VVC standard is described in <NPL>, JVET-N1001-v3 (hereinafter "VVC Draft <NUM>"). The techniques of this disclosure, however, are not limited to any particular coding standard.

Although not shown in <FIG>, in some aspects, video encoder <NUM> and video decoder <NUM> may each be integrated with an audio encoder and decoder, and may include appropriate MUX-DEMUX units, or other hardware and software, to handle encoding of both audio and video in a common data stream or separate data streams. If applicable, in some examples, MUX-DEMUX units may conform to the ITU H.

Video encoder <NUM> and video decoder <NUM> each may be implemented as any of a variety of suitable encoder circuitry or decoder circuitry, 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 combinations thereof.

This disclosure describes techniques related to filtering operations which could be used in a post-processing stage, as part of in-loop coding, or in the prediction stage of video coding. The techniques of this disclosure may be implemented into existing video codecs, such as HEVC, or be an efficient coding tool for a future video coding standard, such as the H. <NUM>/VVC standard presently under development.

Video coding typically involves predicting a block of video data from either an already coded block of video data in the same picture (e.g., intra prediction) or an already coded block of video data in a different picture (e.g., inter prediction). In some instances, the video encoder <NUM> also calculates residual data by comparing the predictive block to the original block. Thus, the residual data represents a difference between the predictive block and the original block.

Video encoder <NUM> transforms and quantizes the residual data and signals the transformed and quantized residual data in the encoded bitstream. Video decoder <NUM> adds the residual data to the predictive block to produce a reconstructed video block that matches the original video block more closely than the predictive block alone. To further improve the quality of decoded video, video encoder <NUM> and video decoder <NUM> can perform one or more filtering operations on the reconstructed video blocks. Examples of these filtering operations include deblocking filtering, sample adaptive offset (SAO) filtering, and adaptive loop filtering. Parameters for these filtering operations may be determined by video encoder <NUM> and explicitly signaled in the encoded video bitstream or may be implicitly determined by video decoder <NUM> without needing the parameters to be explicitly signaled in the encoded video bitstream.

This disclosure describes techniques related to filtering method(s) referred to as "Adaptive Loop Filter (ALF). " An ALF may be used in a post-processing stage, for in-loop coding, or in a prediction process. SAO filtering and/or adaptive loop filtering may be applied to any of various existing video codec technologies, such as HEVC-compliant codec technology, or be an efficient coding tool in any future video coding standards.

As used in this disclosure, the term video coding generically refers to either video encoding or video decoding. Similarly, the term video coder may generically refer to a video encoder or a video decoder. Moreover, certain techniques described in this disclosure with respect to video decoding may also apply to video encoding, and vice versa. For example, often times video encoders and video decoders are configured to perform the same process, or reciprocal processes. Also, video encoder <NUM> typically performs video decoding as part of the processes of determining how to encode video data.

As will be explained in more detail below, in accordance with the invention video encoder <NUM> and video decoder <NUM> are configured to determine sets of adaptive loop filters, from among a plurality of sets of adaptive loop filters, on a per-block basis (e.g., for blocks for which adaptive loop filtering is enabled). In this way, the set of adaptive loop filters available for use with a particular block are more adapted to the local characteristics of the video data near the particular block, thus improving coding efficiency and/or picture quality.

In HEVC, VVC, and other video coding specifications, a video sequence typically includes a series of pictures. Pictures may also be referred to as "frames. " In one example approach, a picture may include three sample arrays, denoted SL, SCb, and SCr. In such an example approach, SL is a two-dimensional array (i.e., a block) of luma samples. SCb is a two-dimensional array of Cb chrominance samples. Scr is a two-dimensional array of Cr chrominance samples. Chrominance samples may also be referred to herein as "chroma" samples. In other instances, a picture may be monochrome and may only include an array of luma samples.

To generate an encoded representation of a picture, video encoder <NUM> may generate a set of coding tree units (CTUs). Each of the CTUs may include a coding tree block of luma samples, two corresponding coding tree blocks of chroma samples, and syntax structures used to code the samples of the coding tree blocks. In monochrome pictures or pictures having three separate color planes, a CTU may include a single coding tree block and syntax structures used to code the samples of the coding tree block. A coding tree block may be an NxN block of samples. A CTU may also be referred to as a "tree block" or a "largest coding unit" (LCU). The CTUs of HEVC may be broadly analogous to the macroblocks of other standards, such as H. However, a CTU is not necessarily limited to a particular size and may include one or more coding units (CUs). A slice may include an integer number of CTUs ordered consecutively in a raster scan order.

In one example, to generate a coded CTU, video encoder <NUM> may recursively perform quad-tree partitioning on the coding tree blocks of a CTU to divide the coding tree blocks into coding blocks, hence the name "coding tree units. " A coding block may be an NxN block of samples. A CU may include a coding block of luma samples and two corresponding coding blocks of chroma samples of a picture that has a luma sample array, a Cb sample array, and a Cr sample array, and syntax structures used to code the samples of the coding blocks. In monochrome pictures or pictures having three separate color planes, a CU may include a single coding block and syntax structures used to code the samples of the coding block.

Video encoder <NUM> may partition a coding block of a CU into one or more prediction blocks. A prediction block is a rectangular (i.e., square or non-square) block of samples on which the same prediction is applied. A prediction unit (PU) of a CU may include a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and syntax structures used to predict the prediction blocks. In monochrome pictures or pictures having three separate color planes, a PU may include a single prediction block and syntax structures used to predict the prediction block. Video encoder <NUM> may generate predictive luma, Cb, and Cr blocks for luma, Cb, and Cr prediction blocks of each PU of the CU.

As another example, video encoder <NUM> and video decoder <NUM> may be configured to operate according to JEM or VVC. According to JEM or VVC, a video coder (such as video encoder <NUM>) partitions a picture into a plurality of coding tree units (CTUs). Video encoder <NUM> may partition a CTU according to a tree structure, such as a quadtree-binary tree (QTBT) structure or Multi-Type Tree (MTT) structure. The QTBT structure removes the concepts of multiple partition types, such as the separation between CUs, PUs, and TUs (transform units) of HEVC. A QTBT structure includes two levels: a first level partitioned according to quadtree partitioning, and a second level partitioned according to binary tree partitioning. A root node of the QTBT structure corresponds to a CTU. Leaf nodes of the binary trees correspond to coding units (CUs).

In an MTT partitioning structure, blocks may be partitioned using a quadtree (QT) partition, a binary tree (BT) partition, and one or more types of triple tree (TT) partitions. A triple tree partition is a partition where a block is split into three sub-blocks. In some examples, a triple tree partition divides a block into three sub-blocks without dividing the original block through the center. The partitioning types in MTT (e.g., QT, BT, and TT), may be symmetrical or asymmetrical.

Video encoder <NUM> and video decoder <NUM> may be configured to use quadtree partitioning, QTBT partitioning, MTT partitioning, or other partitioning structures.

Video encoder <NUM> may use intra prediction or inter prediction to generate the predictive blocks for a block (e.g., a PU). If video encoder <NUM> uses intra prediction to generate the predictive blocks of a PU, video encoder <NUM> may generate the predictive blocks of the PU based on decoded samples of the picture associated with the PU. If video encoder <NUM> uses inter prediction to generate the predictive blocks of a PU, video encoder <NUM> may generate the predictive blocks of the PU based on decoded samples of one or more pictures other than the picture associated with the PU.

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

To perform intra-prediction, video encoder <NUM> may select an intra-prediction mode to generate the prediction block. Some examples of JEM and VVC provide sixty-seven intra-prediction modes, including various directional modes, as well as planar mode and DC mode. In general, video encoder <NUM> selects an intra-prediction mode that describes neighboring samples to a current block (e.g., a block of a CU) from which to predict samples of the current block. 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, assuming video encoder <NUM> codes CTUs and CUs in raster scan order (left to right, top to bottom).

After video encoder <NUM> generates predictive luma, Cb, and Cr blocks for one or more PUs of a CU, video encoder <NUM> may generate a luma residual block for the CU. Each sample in the CU's luma residual block indicates a difference between a luma sample in one of the CU's predictive luma blocks and a corresponding sample in the CU's original luma coding block. In addition, video encoder <NUM> may generate a Cb residual block for the CU. Each sample in the CU's Cb residual block may indicate a difference between a Cb sample in one of the CU's predictive Cb blocks and a corresponding sample in the CU's original Cb coding block. Video encoder <NUM> may also generate a Cr residual block for the CU. Each sample in the CU's Cr residual block may indicate a difference between a Cr sample in one of the CU's predictive Cr blocks and a corresponding sample in the CU's original Cr coding block.

In some examples, video encoder <NUM> may use quad-tree partitioning to decompose the luma, Cb, and Cr residual blocks of a CU into one or more luma, Cb, and Cr transform blocks. In other examples, the transform block is the same size as the prediction block. A transform block is a rectangular (e.g., square or non-square) block of samples on which the same transform is applied. A transform unit (TU) of a CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax structures used to transform the transform block samples. Thus, each TU of a CU may be associated with a luma transform block, a Cb transform block, and a Cr transform block. The luma transform block associated with the TU may be a sub-block of the CU's luma residual block. The Cb transform block may be a sub-block of the CU's Cb residual block. The Cr transform block may be a sub-block of the CU's Cr residual block. In monochrome pictures or pictures having three separate color planes, a TU may include a single transform block and syntax structures used to transform the samples of the transform block.

Video encoder <NUM> may apply one or more transforms to a luma transform block of a TU to generate a luma coefficient block for the TU. A coefficient block may be a two-dimensional array of transform coefficients. A transform coefficient may be a scalar quantity. Video encoder <NUM> may apply one or more transforms to a Cb transform block of a TU to generate a Cb coefficient block for the TU. Video encoder <NUM> may apply one or more transforms to a Cr transform block of a TU to generate a Cr coefficient block for the TU.

The above block structure with CTUs, CUs, PUs, and TUs generally describes the block structure used in HEVC. Other video coding standards, however, may use different block structures. As one example, although HEVC allows PUs and TUs to have different sizes or shapes, other video coding standards may require predictive blocks and transform blocks to have a same size. The techniques of this disclosure are not limited to the block structure of HEVC and may be compatible with other block structures.

After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block or a Cr coefficient block), video encoder <NUM> may quantize the coefficient block. 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. After video encoder <NUM> quantizes a coefficient block, video encoder <NUM> may entropy encode syntax elements indicating the quantized transform coefficients. For example, video encoder <NUM> may perform Context-Adaptive Binary Arithmetic Coding (CABAC) on the syntax elements indicating the quantized transform coefficients.

Video encoder <NUM> may output a bitstream that includes a sequence of bits that forms a representation of coded pictures and associated data. The bitstream may include a sequence of Network Abstraction Layer (NAL) units. A NAL unit is a syntax structure containing an indication of the type of data in the NAL unit and bytes containing that data in the form of a raw byte sequence payload (RBSP) interspersed as necessary with emulation prevention bits. Each of the NAL units includes a NAL unit header and encapsulates a RBSP. The NAL unit header may include a syntax element that indicates a NAL unit type code. The NAL unit type code specified by the NAL unit header of a NAL unit indicates the type of the NAL unit. A RBSP may be a syntax structure containing an integer number of bytes that is encapsulated within a NAL unit. In some instances, an RBSP includes zero bits.

Different types of NAL units may encapsulate different types of RBSPs. For example, a first type of NAL unit may encapsulate an RBSP for a picture parameter set (PPS), a second type of NAL unit may encapsulate an RBSP for a coded slice, a third type of NAL unit may encapsulate an RBSP for supplemental enhancement information (SEI) messages, and so on. NAL units that encapsulate RBSPs for video coding data (as opposed to RBSPs for parameter sets and SEI messages) may be referred to as video coding layer (VCL) NAL units.

Video decoder <NUM> may receive a bitstream generated by video encoder <NUM>. In addition, video decoder <NUM> may parse the bitstream to obtain syntax elements from the bitstream. Video decoder <NUM> may reconstruct the pictures of the video data based at least in part on the syntax elements obtained from the bitstream. The process to reconstruct the video data may be generally reciprocal to the process performed by video encoder <NUM>. In addition, video decoder <NUM> may inverse quantize coefficient blocks associated with TUs of a current CU. Video decoder <NUM> may perform inverse transforms on the coefficient blocks to reconstruct transform blocks associated with the TUs of the current CU. Video decoder <NUM> may reconstruct the coding blocks of the current CU by adding the samples of the predictive blocks for PUs of the current CU to corresponding samples of the transform blocks of the TUs of the current CU. By reconstructing the coding blocks for each CU of a picture, video decoder <NUM> may reconstruct the picture.

Aspects of HEVC and JEM techniques will now be discussed. <FIG> shows an example block diagram of HEVC decoder <NUM>. Video decoder <NUM> shown in <FIG> generally corresponds to video decoder <NUM>, but unlike video decoder <NUM>, does not include an adaptive loop filter between reconstruction and the reference picture buffer. Video decoder <NUM> is illustrated in greater detail in <FIG>. HEVC employs two in-loop filters, including a de-blocking filter (DBF) and a sample adaptive offset (SAO) filter. Additional details regarding HEVC decoding and SAO are described in <NPL>).

As illustrated in <FIG>, the input to a DBF may be the reconstructed image after intra or inter prediction, as shown with the output from the reconstruction block. The DBF performs detection of the artifacts at the coded block boundaries and attenuates the artifacts by applying a selected filter. Compared to the H. <NUM>/AVC deblocking filter, the HEVC deblocking filter has lower computational complexity and better parallel processing capabilities while still achieving significant reduction of the visual artifacts. For additional examples, see <NPL>).

In HEVC, the deblocking filter decisions are made separately for each boundary of a four-sample length that lies on the grid dividing the picture into blocks of <NUM> x <NUM> samples. Deblocking is performed on a block boundary if the following conditions are true: (<NUM>) the block boundary is a prediction unit (PU) or transform unit (TU) boundary; (<NUM>) the boundary strength (Bs), as defined in Table <NUM> below, is greater than zero; (<NUM>) the variation of signal, as defined in Equation (<NUM>) below, on both sides of a block boundary is below a specified threshold.

If Bs > <NUM> for a luma block boundary, then the deblocking filtering is applied to that boundary if the following condition holds: <MAT> where p and q are luma sample values at the boundary and β is a threshold.

HEVC allows for two types of luma deblocking filters, namely: (i) normal filter, and (ii) strong filter. The choice of deblocking filter depends on whether particular signal variation terms are less than certain thresholds (see "<NPL>) cited above for details). Although the filtering decisions are based only on the two rows (or columns) of a four pixel long vertical (or horizontal, as the case may be) boundary, the filter is applied to every row (or column, as the case may be) in the boundary. The number of pixels used in the filtering process and the number of pixels that may be modified with each type of filtering is summarized in Table <NUM> below.

Chroma deblocking (i.e., deblocking filtering performed on chroma components) is performed only when Bs equals two (<NUM>). In HEVC, only one type of chroma deblocking filter is used. The chroma deblocking filter uses pixels p<NUM>, p<NUM>, q<NUM>, q<NUM> and may modify pixels p<NUM> and q<NUM> in each row (the second subscript indicating the row index is omitted in the above description for brevity, because the filter is applied to every row). In JEM, deblocking is performed at the CU level. The size of CUs on either side of a boundary can be larger than <NUM> x <NUM>. The minimum CU size in JEM is <NUM> x <NUM>. Therefore, deblocking filter may also be applied to boundaries of <NUM> x <NUM> blocks.

The input to an SAO filter may be the reconstructed block after applying the deblocking filter, as shown with the output from the deblocking filter in <FIG>. A video coder may apply an SAO filter to reduce mean sample distortion of a region by first classifying the region samples into multiple categories with a selected classifier, obtaining an offset for each category, and then adding the offset to each sample of the category, where the classifier index and the offsets of the region are coded in the bitstream. In HEVC, the region (the unit for SAO parameters signaling) is defined to be a CTU.

Two SAO types that can satisfy the requirement of being low complexity were adopted in HEVC. Those two types are edge offset (EO) and band offset (BO) SAO, which are discussed in further detail below. Video encoder <NUM> and video decoder <NUM> may code an index of an SAO type. For EO, the sample classification is based on comparison between current samples and neighboring samples according to <NUM>-D directional patterns: horizontal, vertical, <NUM>° diagonal, and <NUM>° diagonal.

<FIG> show four <NUM>-D directional patterns for EO sample classification: horizontal (<FIG>, EO class = <NUM>), vertical (<FIG>, EO class = <NUM>), <NUM>° diagonal (<FIG>, EO class = <NUM>), and <NUM>° diagonal (<FIG>, EO class = <NUM>). Additional details related to SAO are described in <NPL>). In <FIG>, block C is the current block, and blocks A and B are neighboring blocks.

According to the selected EO pattern, five categories denoted by edgeIdx in Table <NUM> are further defined. For edgeIdx equal to <NUM>~<NUM>, the magnitude of an offset may be signaled while the sign flag is implicitly coded, i.e., negative offset for edgeIdx equal to <NUM> or <NUM> and positive offset for edgeIdx equal to <NUM> or <NUM>. For edgeIdx equal to <NUM>, the offset is always set to <NUM> which means no operation is required for this case.

For BO, the sample classification is based on sample values. Each color component may have its own SAO parameters for classification for BO type SAO filtering. BO implies that one offset is added to all samples of the same band. The sample value range is equally divided into <NUM> bands. For <NUM>-bit samples ranging from <NUM> to <NUM>, the width of a band is <NUM>, and sample values from <NUM> to <NUM> + <NUM> belong to band k, where k ranges from <NUM> to <NUM>. One offset is added to all samples of the same band. The average difference between the original samples and reconstructed samples in a band (i.e., offset of a band) is signaled to the decoder (e.g., video decoder <NUM>). There is no constraint on offset signs. Only offsets of four (<NUM>) consecutive bands and the starting band position are signaled to the decoder (e.g., video decoder <NUM>).

Video encoder <NUM> and video decoder <NUM> may be configured to implement various adaptive loop filtering techniques set forth in JEM and/or working drafts of VVC. Aspects of some example JEM filtering techniques (e.g., ALF) will now be described. In addition to the modified de-blocking (DB) and HEVC SAO methods, JEM includes another filtering method called Geometry transformation-based Adaptive Loop Filtering (GALF). The input to an ALF/GALF may be the reconstructed image after the application of SAO (e.g., output of sample adaptive offset in <FIG>). Aspects of GALF are described in <NPL> and in <NPL>.

ALF techniques attempt to minimize the mean square error between the original samples and decoded/reconstructed samples by using an adaptive Wiener filter. Denote the input image as p, the source image as S, and the finite impulse response (FIR) filter as h. Then the following expression of the sum of squared errors (SSE) should be minimized, where (x, y) denotes any pixel position in p or S.

The optimal h, denoted as hopt, can be obtained by setting the partial derivative of SSE with respect to h(i, j) equal to <NUM> as follows: <MAT>.

This leads to the Wiener-Hopf equation shown below, which gives the optimal filter hopt: <MAT>.

In some examples of JEM or VVC, instead of using one filter for the whole picture, video encoder <NUM> and/or video decoder <NUM> may be configured to classify samples in a picture into twenty-five (<NUM>) classes based on the local gradients. Video encoder <NUM> and/or video decoder <NUM> may derive separate optimal Wiener filters for the pixels in each class. Several techniques have been employed to increase the effectiveness of adaptive loop filtering by reducing signaling overhead and computational complexity. Some of the techniques that can be used to increase ALF effectiveness by reducing signaling overhead and/or computational complexity are listed below:.

Details of some aspects of ALF are summarized in this and the following paragraphs. Some aspects of ALF are related to pixel classification and geometry transformation. In one example, video encoder <NUM> and video decoder <NUM> may be configured to compute sums of absolute values of vertical, horizontal and diagonal Laplacians at all pixels within a 6x6 window that covers each pixel in a reconstructed frame (before ALF). Video encoder <NUM> and video decoder <NUM> divide the reconstructed frame into non-overlapped 2x2 blocks. Video encoder <NUM> and video decoder <NUM> classify the four pixels in these blocks into one of twenty five (<NUM>) categories, denoted as Ck (k=<NUM>, <NUM>,. , <NUM>), based on the total Laplacian activity and directionality of that block. Additionally, video encoder <NUM> and video decoder <NUM> apply one of four geometry transformations (no transformation, diagonal flip, vertical flip, or rotation) to the filters based on the gradient directionality of that block. Additional details can be found in <NPL>.

Some aspects of adaptive loop filtering are related to filter derivation and prediction from fixed filters. For each class Ck, video encoder <NUM> and video decoder <NUM> first determine a best prediction filter from the pool for Ck, denoted as hpred,k, based on the SSE given by the filters. The SSE of Ck, which is to be minimized, can be written as below, <MAT> where hΔ,k is the difference between the optimal filter for Ck and hpred,k. Let p'(x, y) = Σi,j hpred,k(i, j)p(x - i, y - j) be the result of filtering pixel p(x, y) by hpred,k. Then the expression for SSEk can be re-written as <MAT>.

By making the partial derivative of SSEk with respect to hΔ,k (i, j) equal to <NUM>, the modified Wiener-Hopf equation is obtained as follows: <MAT>.

For the simplicity of expression, denote Σx,y p(x - i, y - j)p(x - m, y - n) and Σx,y(S(x, y) - p'(x, y))p(x - m, y - n) with (x, y) ∈ Ck by Rpp,k(i - m, j - n) and <MAT>, respectively. Then, the above equation can be written as: <MAT>.

For every Ck, the auto-correlation matrix Rpp,k(i - m, j - n) and cross-correlation vector <MAT> are computed over all (x, y) ∈ Ck.

In one example of adaptive loop filtering, video encoder <NUM> calculates and transmits only the difference between the optimal filter and the fixed prediction filter. If none of the candidate filters available in the pool is a good predictor, then video encoder <NUM> and video decoder <NUM> uses the identity filter (i.e., the filter with only one non-zero coefficient equal to <NUM> at the center that makes the input and output identical) as the predictor.

Some aspects of adaptive loop filtering relate to the merging of pixel classes. Classes are merged to reduce the overhead of signaling filter coefficients. The cost of merging two classes is increased with respect to SSE. Consider two classes Cm and Cn with SSEs given by SSEm and SSEn, respectively. Let Cm+n denote the class obtained by merging Cm and Cn with SSE, denoted as SSEm+n. SSEm+n is always greater than or equal to SSEm + SSEn. Let ΔSSEm+n denote the increase in SSE caused by merging Cm and Cn, which is equal to SSEm+n - (SSEm + SSEn). To calculate SSEm+n, video encoder <NUM> may derive hΔ,m+n, the filter prediction error for Cm+n, using the following expression similar to (<NUM>): <MAT>.

Video encoder <NUM> may calculate the SSE for the merged category Cm+n as: <MAT>.

To reduce the number of classes from N to N-<NUM>, two classes, Cm and Cn, may need to be found, such that merging them leads to the smallest ΔSSEm+n compared to any other combinations. In some ALF designs, video encoder <NUM> is configured to check every pair of available classes for merging to find the pair with the smallest merge cost.

If Cm and Cn (with m < n) are merged, then video encoder <NUM> and video decoder <NUM> may mark Cn as unavailable for further merging and the auto- and cross-correlations for Cm are changed to the combined auto- and cross-correlations as follows: <MAT> <MAT> <MAT>.

Video encoder <NUM> may determine an optimal number of ALF classes after merging for each frame based on the RD cost. In one example, this is done by starting with twenty-five (<NUM>) classes and merging a pair of classes (from the set of available classes) successively until there is only one class left. For each possible number of classes (<NUM>, <NUM>,. , <NUM>) left after merging, video encoder <NUM> may store a map indicating which classes are merged together. Video encoder <NUM> then selects the optimal number of classes such that the RD cost is minimized as follows: <MAT> where D|N is the total SSE of using N classes ( <MAT>), R|N is the total number of bits used to code the N filters, and λ is the weighting factor determined by the quantization parameter (QP). Video encoder <NUM> may transmit the merge map for Nopt number of classes, indicating which classes are merged together, to video decoder <NUM>.

Aspects of signaling ALF parameters are described below. A brief step-by-step description of an example ALF parameter encoding process performed by video encoder <NUM> is given below. Video decoder <NUM> may be configured to perform a reciprocal process (e.g., signal from the perspective of video decoder <NUM> is the reception of syntax elements).

The design of adaptive loop filtering in some examples of JEM may present one or more potential problems. As one example, some example adaptive loop filtering designs perform multiple passes over each frame to design one set of filters (e.g., one filter for each class of pixels or one filter shared among multiple classes in the frame) for the whole frame. Such techniques introduce high encoder latency. High encoder latency may be especially problematic in low delay applications, such as video conferencing, where it may be important to send even a partly encoded frame to the channel as soon as possible.

As another example, according to some adaptive loop filtering designs, one set of filters is used for the whole picture. The local statistics in a small block of the original picture and reconstructed picture may be different than the cumulative statistics obtained using the whole picture. Therefore, an ALF which is optimal for the whole picture may not be optimal for a given block.

As another example, a potential problem with designing a new set of Wiener filters using a small block of a picture in order to obtain better local adaptivity is that the number of pixels available in a small block may not be enough for video encoder <NUM> to determine a good estimate of the correlation matrices and vectors. This may lead to ill-posed Wiener-Hopf equations, which in turn may output less than optimal ALF coefficients.

As another example, some example adaptive loop filtering designs define sixteen (<NUM>) fixed filters for each of the twenty-five (<NUM>) classes, thereby yielding a total of four hundred (<NUM>) filters. These filters may be used as predictor filters for the final filter coefficients for each class. The index of the predictor filter used is signaled for each class. This may cause high signaling overhead and reduce overall coding gain.

Another potential disadvantage of using a fixed set of filters as predictors is that the predictor set is not modified based on the new filters designed for previous frames. Because temporally neighboring frames are likely to have similar statistics, using the optimal filters for previous frames can lead to efficient prediction of optimal filters for the current frame.

As another example, some example adaptive loop filtering designs require two passes over the current frame to make block-level filter on/off decisions. This introduces additional encoder latency. The blocks for which ALF on/off flags are signaled do not align with coding units (CUs). Therefore, CU information such as mode, coded block flag, etc. cannot be considered in an ALF on/off control decision. Using this information may reduce on/off signaling overhead.

To address one or more of the problems discussed above, this disclosure describes techniques to further improve the coding gains and visual quality obtained by using adaptive loop filtering.

According to the invention, video encoder <NUM> signals a set of adaptive loop filters per block in one slice. For example, for each block of video data in a slice of video data, video encoder <NUM> is configured to encode one or more syntax elements indicating a set of adaptive loop filters to use for the block. Video decoder <NUM> is configured to decode the one or more syntax elements for each block to determine the set of adaptive loop filters to use for the block.

According to the invention, the video encoder <NUM> is configured to indicate the ALF set (e.g., the set of adaptive loop filters mentioned above) by encoding a set index to a list of filter sets (e.g., the plurality of sets of adaptive loop filters). In this disclosure, the term "filter set" may refer to a single set of adaptive loop filters, the term "filter sets" may refer to a plurality of sets of adaptive loop filters, and the term "filter set list" may refer to a list of the plurality of sets of adaptive loop filters. In one example, the filter set list may include a plurality of sets of adaptive loop filters. That is, the filter set list may include all the determined possible filter sets (i.e., the plurality of sets of adaptive loop filters) for the slice. The index, in some examples, identifies a particular set of adaptive loop filters from among the plurality of sets of adaptive loop filters included in the list.

Video decoder <NUM> is configured to store and/or determine the plurality of sets of adaptive loop filters according to predetermined rules. Video encoder <NUM> and/or video decoder <NUM> according to the invention may additionally apply any of the following itemized techniques individually. Alternatively, video encoder <NUM> and/or video decoder <NUM> may apply any combination of the itemized techniques discussed below.

As will be discussed below, the plurality of sets of adaptive loop filters may include pre-trained filters, adaptive loop filters that are signaled for a current picture, and adaptive loop filters that are reused from previous pictures. In one example, for a particular set of adaptive loop filters, each respective set of the particular set of adaptive loop filters includes one or more of a current adaptive loop filter signaled for a current picture or a pre-trained adaptive loop filter. Video decoder <NUM> may be configured to decode the index sent by video encoder <NUM> and determine the set of adaptive loop filters, from among the plurality of sets of adaptive loop filters, to use for a particular block of video data.

In this way, video encoder <NUM> and video decoder <NUM> may be configured to determine a respective set of adaptive loop filters, from among a plurality of sets of adaptive loop filters, per block of the current picture for blocks in which adaptive loop filtering is used. In one example of the disclosure, each respective set of adaptive loop filters includes a previous adaptive loop filter used in one or more previous pictures. Video encoder <NUM> and video decoder <NUM> may be configured to determine a respective set of adaptive loop filters for a respective block of the current picture in the case that adaptive loop filtering is enabled for the block (e.g., as indicated by an ALF on/off flag).

Video encoder <NUM> and video decoder <NUM> may further be configured to adaptive loop filter the blocks of the current picture in accordance with the respective sets of adaptive loop filters. For example, as described above, video encoder <NUM> and video decoder <NUM> may be configured to classify the samples of the block and then use the adaptive loop filter in the respective set of adaptive loop filters that is associated with the classification. In another example, video encoder <NUM> may be configured to signal a syntax element that indicates which adaptive loop filter in the respective set of adaptive loop filters to use for the current block. Accordingly, in one example, video encoder <NUM> and video decoder <NUM> may be configured to code a respective flag per block indicating if adaptive loop filtering is used for the respective block (e.g., a block-level ALF on/off flag), and code, based on the respective flag per block, a respective syntax element indicating the respective set of adaptive loop filters, from among the plurality of sets of adaptive loop filters, per block of the current picture. In some examples, video encoder <NUM> and video decoder <NUM> would not code the respective syntax element indicating the respective set of adaptive loop filters in the case that adaptive loop filtering is not used for the current block (e.g., the block-level ALF flag indicates that adaptive loop filtering is off and/or not enabled).

In the above examples, the "block" of the current picture may be defined as any size of block. In one example, the block can be the coding tree unit (CTU) or any other block. The block can be decoupled from the partitioning. In the case that the block is a CTU, video encoder <NUM> and video decoder <NUM> may be configured to use the set of adaptive loop filters singled for the CTU for all blocks partitioned from the CTU.

In one example, video encoder <NUM> and video decoder <NUM> may be configured to determine a list of the plurality of sets of adaptive loop filters. Video encoder <NUM> and video decoder <NUM> may be configured to determine such a list per picture, per slice, or per tile. Each set of adaptive loop filters of the plurality of sets of adaptive loop filters may be configured such that each possible classification of samples has an associated filter. That is, each set may contain a filter assigned per class. As described above, video encoder <NUM> and video decoder <NUM> may be configured to code a set index into the list of the plurality of sets of adaptive loop filters per block. In one example, the list of the plurality of sets of adaptive loop filters may be a table, where each entry in the table is a particular set of adaptive loop filters. In addition, video encoder <NUM> and video decoder <NUM> may be configured to code a flag per block to indicate whether or not an ALF is used (e.g., a block-level ALF on/off flag). The list of the plurality of sets of adaptive loop filters may include one or more pre-trained filters, one or more filters derived using filters from previous pictures, and/or filters signaled in the bitstream for the current picture.

According to some examples of this disclosure, video encoder <NUM> and/or video decoder <NUM> may share the list of the plurality of filter sets across different pictures (e.g., an adaptive loop filter used for a previous picture is included in a set of the plurality of filter sets used for coding a current block). In one example, the filter set list can be initialized with pre-trained filters. After coding a picture, video encoder <NUM> may derive a new filter set based on the encoded picture and add the new filter set to the filter set list. Alternatively, the new filter set can replace an existing filter set in the list. After coding another picture, video encoder <NUM> may derive another filter set and include the derived filter set in the filter set list. In this example, the filter set list is common for all pictures and may be updated after coding a picture. From the decoder side, video decoder <NUM> may detect a signaling of the new filter set after decoding a picture or prior to the decoding of a picture.

According to some examples of this disclosure, video encoder <NUM> may be configured to signal (e.g., encode) syntax elements of a new set of filters per picture, per slice, and/or per tile. Video decoder <NUM> may be configured to determine the new set of filters based on the signaling from video encoder <NUM> and add the new set of filters to the list including the plurality of sets of filters.

In one example, video encoder <NUM> and video decoder <NUM> may be configured to add the new set of filters to the filter set list. The updated list can then be used to filter a block in the next picture or pictures. In another example, video encoder <NUM> and video decoder <NUM> may be configured to use the updated list (e.g., containing the new set of filters derived using the current picture/slice/tile) to filter a block in the current picture/slice/tile.

According to some examples of this disclosure, video encoder <NUM> and video decoder <NUM> may update the filter set list (e.g., the list of the plurality of sets of adaptive loop filters) with filters derived using previous pictures, previous slices, and/or previous tiles. The order in which video encoder <NUM> and video decoder <NUM> may be configured to add the sets of adaptive loop filters in the filter set list can be fixed, predefined, or flexible. The list can be re-ordered per picture based on information related to the current picture and information related to the pictures from which corresponding filters in the list are derived. Video encoder <NUM> may indicate a filter set to video decoder <NUM> using an index in the filter set list. In some examples, video encoder <NUM> may assign a smaller index value to more frequently-used filters or newly-added filters.

In one example, video encoder <NUM> and video decoder <NUM> may be configured to add the newly derived filter set to the beginning of the list. In another example, video encoder <NUM> and video decoder <NUM> may be configured to add the sets of filters derived using previous frames (e.g., previous adaptive loop filters) in the list after the currently-signaled filters and before existing filter sets in the list (e.g., the sets of pre-trained fixed filters). In another example, video encoder <NUM> and video decoder <NUM> may be configured to add adaptive loop filters to each respective set of adaptive loop filters so that current adaptive loop filters are added first, previous adaptive loop filters are added second, and pre-trained adaptive loop filters are added last.

In another example of the disclosure, the ordering of filter sets in the list may depend on other picture-related information. For example, filters derived from pictures in the same temporal layer as the current picture may be placed in the list before filters derived using pictures in another temporal layer. In another example, the index of a filter set in the list may depend on whether the corresponding picture from which it is derived is a reference picture used for prediction of the current picture. Video encoder <NUM> and video decoder <NUM> may be configured to add filters corresponding to a more frequently used reference picture before filters derived from other reference pictures. Ordering filter sets in this manner may result in syntax elements (e.g., indices in the filter set list) with fewer bits for the most frequently used filter sets in the filter set list. Accordingly, fewer bits may be used to signal the filter set used for the block, thus increasing coding efficiency.

In another example, video encoder <NUM> and video decoder <NUM> may be configured to add filters derived using pictures coded with a similar quantization parameter (QP) to the current picture before filters derived from previous pictures coded with a different QP.

In another example of the disclosure, video encoder <NUM> and video decoder <NUM> may be configured to limit the maximum number of sets of filters in the filter set list. In one example, up to thirty-two (<NUM>) sets of filters can be kept in the filter set list. In some examples, video encoder <NUM> may be configured to signal the maximum number of filter sets in the list in the slice header, sequence parameter set, picture parameter set, in other high-level syntax information, or elsewhere.

In another example of the disclosure, video encoder <NUM> can use a different number of bits to signal different filter set indexes. Fewer bits can be used to indicate a lower index position in the list (because filter sets near the top of a list are more likely to be selected) as compared to a higher index position. Again, this may result in fewer bits being used to signal the filter set used for the block more often, thus increasing coding efficiency.

According to some examples of this disclosure, video encoder <NUM> and video decoder <NUM> may be configured to share ALF information for some blocks (e.g., merging of the ALF information across two or more blocks). In one example, video encoder <NUM> and video decoder <NUM> may be configured to share the index of the set of filters and/or ALF on/off flag (this flag indicates whether adaptive loop filtering is applied to a block) across multiple blocks. An ALF merge indicator may indicate which blocks are merged, and which ALF information is associated with the ALF merge indicator. The merge indicator can be an index, a flag, or any other syntax element.

In one example, video encoder <NUM> and video decoder <NUM> may be configured to merge ALF information of a block with a block above, or with a block to the left. In other examples, more flexible ALF information merging that allows merging of one block with any other block (i.e., not necessarily a neighboring block) in the picture can also be used.

In some examples of this disclosure, video decoder <NUM> may be configured to derive the ALF on/off flag based on other existing block information. In one example, video decoder <NUM> may derive the ALF on/off flag based on existing block information, and as such, video encoder <NUM> may not signal the ALF on/off flag. Video encoder <NUM> may signal ALF on/off flag for a group of blocks, denoted as an ALF block. The size of an ALF block may be predetermined, or may be signalled by video encoder <NUM>. In one example, blocks sharing the same ALF on/off flag can represent an ALF block. In another example, the ALF block may be equal to a block.

<FIG> is a block diagram illustrating an example video encoder <NUM> that may implement the techniques described in this disclosure and is useful for understanding the invention. Video encoder <NUM> may perform intra- and inter-coding of video blocks within video slices. Intra-coding relies on spatial prediction to reduce or remove spatial redundancy in video within a given video frame or picture. Inter-coding relies on temporal prediction to reduce or remove temporal redundancy in video within adjacent frames or pictures of a video sequence. Intra-mode (I mode) may refer to any of several spatial-based compression modes. Inter-modes, such as uni-directional prediction (P mode) or bi-prediction (B mode), may refer to any of several temporal-based compression modes.

In the example of <FIG>, video encoder <NUM> includes a video data memory <NUM>, partitioning unit <NUM>, prediction processing unit <NUM>, summer <NUM>, transform processing unit <NUM>, quantization unit <NUM>, entropy encoding unit <NUM>. Prediction processing unit <NUM> includes motion estimation unit (MEU) <NUM>, motion compensation unit (MCU) <NUM>, and intra prediction unit <NUM>. For video block reconstruction, video encoder <NUM> also includes inverse quantization unit <NUM>, inverse transform processing unit <NUM>, summer <NUM>, filter unit <NUM>, and decoded picture buffer (DPB) <NUM>.

As shown in <FIG>, video encoder <NUM> receives video data and stores the received video data in video data memory <NUM>. The video data stored in video data memory <NUM> may be obtained, for example, from video source <NUM>. DPB <NUM> may be a reference picture memory that stores reference video data for use in encoding video data by video encoder <NUM>, e.g., in intra- or inter-coding modes. In various examples, video data memory <NUM> may be on-chip with other components of video encoder <NUM>, or off-chip relative to those components.

Partitioning unit <NUM> retrieves the video data from video data memory <NUM> and partitions the video data into video blocks. This partitioning may also include partitioning into slices, tiles, or other larger units, as wells as video block partitioning, e.g., according to a quadtree structure of LCUs and CUs. Video encoder <NUM> generally illustrates the components that encode video blocks within a video slice to be encoded. The slice may be divided into multiple video blocks (and possibly into sets of video blocks referred to as tiles). Prediction processing unit <NUM> may select one of a plurality of possible coding modes, such as one of a plurality of intra coding modes or one of a plurality of inter coding modes, for the current video block based on error results (e.g., coding rate and the level of distortion). Prediction processing unit <NUM> may provide the resulting intra- or inter-coded block to summer <NUM> to generate residual block data and to summer <NUM> to reconstruct the encoded block for use as a reference picture.

Intra prediction unit <NUM> within prediction processing unit <NUM> may perform intra-predictive coding of the current video block relative to one or more neighboring blocks in the same frame or slice as the current block to be coded to provide spatial compression. Motion estimation unit <NUM> and motion compensation unit <NUM> within prediction processing unit <NUM> perform inter-predictive coding of the current video block relative to one or more predictive blocks in one or more reference pictures to provide temporal compression.

Motion estimation unit <NUM> may be configured to determine the inter-prediction mode for a video slice according to a predetermined pattern for a video sequence. The predetermined pattern may designate video slices in the sequence as P slices or B slices. Motion estimation unit <NUM> and motion compensation unit <NUM> may be highly integrated, but are illustrated separately for conceptual purposes. Motion estimation, performed by motion estimation unit <NUM>, is the process of generating motion vectors, which estimate motion for video blocks. A motion vector, for example, may indicate the displacement of a PU of a video block within a current video frame or picture relative to a predictive block within a reference picture.

A predictive block is a block that is found to closely match the PU of the video block to be coded in terms of pixel difference, which may be determined by sum of absolute difference (SAD), sum of square difference (SSD), or other difference metrics. In some examples, video encoder <NUM> may calculate values for sub-integer pixel positions of reference pictures stored in DPB <NUM>. For example, video encoder <NUM> may interpolate values of one-quarter pixel positions, one-eighth pixel positions, or other fractional pixel positions of the reference picture. Therefore, motion estimation unit <NUM> may perform a motion search relative to the full pixel positions and fractional pixel positions and output a motion vector with fractional pixel precision.

Motion estimation unit <NUM> calculates a motion vector for a PU of a video block in an inter-coded slice by comparing the position of the PU to the position of a predictive block of a reference picture. The reference picture may be selected from a first reference picture list (List <NUM>) or a second reference picture list (List <NUM>), each of which identify one or more reference pictures stored in DPB <NUM>. Motion estimation unit <NUM> sends the calculated motion vector to entropy encoding unit <NUM> and motion compensation unit <NUM>.

Motion compensation, performed by motion compensation unit <NUM>, may involve fetching or generating the predictive block based on the motion vector determined by motion estimation, possibly performing interpolations to sub-pixel precision. Upon receiving the motion vector for the PU of the current video block, motion compensation unit <NUM> may locate the predictive block to which the motion vector points in one of the reference picture lists. Video encoder <NUM> forms a residual video block by subtracting pixel values of the predictive block from the pixel values of the current video block being coded, forming pixel difference values. The pixel difference values form residual data for the block, and may include both luma and chroma difference components. Summer <NUM> represents the component or components that perform this subtraction operation. Motion compensation unit <NUM> may also generate syntax elements associated with the video blocks and the video slice for use by video decoder <NUM> in decoding the video blocks of the video slice.

After prediction processing unit <NUM> generates the predictive block for the current video block, either via intra prediction or inter prediction, video encoder <NUM> forms a residual video block by subtracting the predictive block from the current video block. The residual video data in the residual block may be included in one or more TUs and applied to transform processing unit <NUM>. Transform processing unit <NUM> transforms the residual video data into residual transform coefficients using a transform, such as a discrete cosine transform (DCT) or a conceptually similar transform. Transform processing unit <NUM> may convert the residual video data from a pixel domain to a transform domain, such as a frequency domain.

Transform processing unit <NUM> may send the resulting transform coefficients to quantization unit <NUM>. Quantization unit <NUM> quantizes the transform coefficients to further reduce bit rate. The quantization process may reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting a quantization parameter. In some examples, quantization unit <NUM> may then perform a scan of the matrix including the quantized transform coefficients. In another example, entropy encoding unit <NUM> may perform the scan.

Following quantization, entropy encoding unit <NUM> entropy encodes the quantized transform coefficients. For example, entropy encoding unit <NUM> may perform context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding or another entropy encoding methodology or technique. Following the entropy encoding by entropy encoding unit <NUM>, the encoded bitstream may be transmitted to video decoder <NUM>, or archived for later transmission or retrieval by video decoder <NUM>. Entropy encoding unit <NUM> may also entropy encode the motion vectors and the other syntax elements for the current video slice being coded provided by prediction processing unit <NUM>.

Inverse quantization unit <NUM> and inverse transform processing unit <NUM> apply inverse quantization and inverse transformation, respectively, to reconstruct the residual block in the pixel domain for later use as a reference block of a reference picture. Motion compensation unit <NUM> may calculate a reference block by adding the residual block to a predictive block of one of the reference pictures within one of the reference picture lists. Motion compensation unit <NUM> may also apply one or more interpolation filters to the reconstructed residual block to calculate sub-integer pixel values for use in motion estimation. Summer <NUM> adds the reconstructed residual block to the motion compensated prediction block produced by motion compensation unit <NUM> to produce a reconstructed block.

Filter unit <NUM> filters the reconstructed block (e.g. the output of summer <NUM>) and stores the filtered reconstructed block in DPB <NUM> for uses as a reference block. The reference block may be used by motion estimation unit <NUM> and motion compensation unit <NUM> as a reference block to inter-predict a block in a subsequent video frame or picture. Filter unit <NUM> may perform any type of filtering such as deblock filtering, SAO filtering, peak SAO filtering, ALF, and/or GALF, and/or other types of loop filters. A deblock filter may, for example, apply deblocking filtering to filter block boundaries to remove blockiness artifacts from reconstructed video. A peak SAO filter may apply offsets to reconstructed pixel values in order to improve overall coding quality. Additional loop filters (in loop or post loop) may also be used.

In addition, filter unit <NUM> may be configured to perform any of the techniques in this disclosure related to adaptive loop filtering. In particular, as described above, filter unit <NUM> may be configured to determine a respective set of adaptive loop filters, from among a plurality of sets of adaptive loop filters, per block of the current picture for blocks in which adaptive loop filtering is used, wherein each respective set of adaptive loop filters includes a previous adaptive loop filter used in one or more previous pictures, and adaptive loop filter the blocks of the current picture in accordance with the respective sets of adaptive loop filters.

<FIG> is a block diagram illustrating an example video decoder <NUM> that may implement the techniques described in this disclosure and is useful for understanding the invention. Video decoder <NUM> of <FIG> may, for example, be configured to receive the signaling described above with respect to video encoder <NUM> of <FIG>. In the example of <FIG>, video decoder <NUM> includes video data memory <NUM>, entropy decoding unit <NUM>, prediction processing unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, summer <NUM>, DPB <NUM>, and filter unit <NUM>. Prediction processing unit <NUM> includes motion compensation unit <NUM> and intra prediction unit <NUM>. Video decoder <NUM> may, in some examples, perform a decoding pass generally reciprocal to the encoding pass described with respect to video encoder <NUM> from <FIG>.

During the decoding process, video decoder <NUM> receives an encoded video bitstream that represents video blocks of an encoded video slice and associated syntax elements from video encoder <NUM>. Video decoder <NUM> stores the received encoded video bitstream in video data memory <NUM>. Video data memory <NUM> may store video data, such as an encoded video bitstream, to be decoded by the components of video decoder <NUM>. The video data stored in video data memory <NUM> may be obtained, for example, via link <NUM>, from storage device <NUM>, or from a local video source, such as a camera, or by accessing physical data storage media. Video data memory <NUM> may form a coded picture buffer (CPB) that stores encoded video data from an encoded video bitstream. DPB <NUM> may be a reference picture memory that stores reference video data for use in decoding video data by video decoder <NUM>, e.g., in intra- or inter-coding modes. Video data memory <NUM> and DPB <NUM> may be formed by any of a variety of memory devices, such as DRAM, SDRAM, MRAM, RRAM, or other types of memory devices. In various examples, video data memory <NUM> may be on-chip with other components of video decoder <NUM>, or off-chip relative to those components.

Entropy decoding unit <NUM> of video decoder <NUM> entropy decodes the video data stored in video data memory <NUM> to generate quantized coefficients, motion vectors, and other syntax elements. Entropy decoding unit <NUM> forwards the motion vectors and other syntax elements to prediction processing unit <NUM>. Video decoder <NUM> may receive the syntax elements at the video slice level and/or the video block level.

When the video slice is coded as an intra-coded (I) slice, intra prediction unit <NUM> of prediction processing unit <NUM> may generate prediction data for a video block of the current video slice based on a signaled intra prediction mode and data from previously decoded blocks of the current frame or picture. When the video frame is coded as an inter-coded slice (e.g., B slice or P slice), motion compensation unit <NUM> of prediction processing unit <NUM> produces predictive blocks for a video block of the current video slice based on the motion vectors and other syntax elements received from entropy decoding unit <NUM>. The predictive blocks may be produced from one of the reference pictures within one of the reference picture lists. Video decoder <NUM> may construct the reference frame lists, List <NUM> and List <NUM>, using default construction techniques based on reference pictures stored in DPB <NUM>.

Motion compensation unit <NUM> determines prediction information for a video block of the current video slice by parsing the motion vectors and other syntax elements, and uses the prediction information to produce the predictive blocks for the current video block being decoded. For example, motion compensation unit <NUM> uses some of the received syntax elements to determine a prediction mode (e.g., intra- or inter-prediction) used to code the video blocks of the video slice, an inter-prediction slice type (e.g., B slice or P slice), construction information for one or more of the reference picture lists for the slice, motion vectors for each inter-encoded video block of the slice, inter-prediction status for each inter-coded video block of the slice, and other information to decode the video blocks in the current video slice.

Inverse quantization unit <NUM> inverse quantizes, i.e., de-quantizes, the quantized transform coefficients provided in the bitstream and decoded by entropy decoding unit <NUM>. The inverse quantization process may include use of a quantization parameter calculated by video encoder <NUM> for each video block in the video slice to determine a degree of quantization and, likewise, a degree of inverse quantization that should be applied. Inverse transform processing unit <NUM> applies an inverse transform, e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to the transform coefficients in order to produce residual blocks in the pixel domain.

After prediction processing unit <NUM> generates the predictive block for the current video block using, for example, intra or inter prediction, video decoder <NUM> forms a reconstructed video block by summing the residual blocks from inverse transform processing unit <NUM> with the corresponding predictive blocks generated by motion compensation unit <NUM>. Summer <NUM> represents the component or components that perform this summation operation.

Filter unit <NUM> filters the reconstructed block (e.g. the output of summer <NUM>) and stores the filtered reconstructed block in DPB <NUM> for uses as a reference block. The reference block may be used by motion compensation unit <NUM> as a reference block to inter-predict a block in a subsequent video frame or picture. Filter unit <NUM> may perform any type of filtering such as deblock filtering, SAO filtering, peak SAO filtering, ALF, and/or GALF, and/or other types of loop filters. A deblock filter may, for example, apply deblocking filtering to filter block boundaries to remove blockiness artifacts from reconstructed video. A peak SAO filter may apply offsets to reconstructed pixel values in order to improve overall coding quality. Additional loop filters (in loop or post loop) may also be used.

<FIG> shows an example implementation of filter unit <NUM>. Filter unit <NUM> may be implemented in the same manner. Filter units <NUM> and <NUM> may perform the techniques of this disclosure, possibly in conjunction with other components of video encoder <NUM> or video decoder <NUM>. In the example of <FIG>, filter unit <NUM> includes deblock filter <NUM>, SAO filter <NUM>, and ALF/GALF filter <NUM>. SAO filter <NUM> may, for example, be configured to determine offset values for samples of a block in the manner described in this disclosure. ALF/GALF filter <NUM> may be configured to determine a respective set of adaptive loop filters, from among a plurality of sets of adaptive loop filters, per block of the current picture for blocks in which adaptive loop filtering is used, wherein each respective set of adaptive loop filters includes a previous adaptive loop filter used in one or more previous pictures, and adaptive loop filter the blocks of the current picture in accordance with the respective sets of adaptive loop filters.

Filter unit <NUM> may include fewer filters and/or may include additional filters. Additionally, the particular filters shown in <FIG> 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 the video quality. The decoded video blocks in a given frame or picture are then stored in DPB <NUM>, which stores reference pictures used for subsequent motion compensation. DPB <NUM> may be part of or separate from additional memory that stores decoded video for later presentation on a display device, such as display device <NUM> of <FIG>.

<FIG> is a flowchart illustrating an example method according to the invention. The techniques of <FIG> may be performed by one or more structural units of video encoder <NUM> and video decoder <NUM>, including filter unit <NUM> and filter unit <NUM>. As discussed above, the term "coding" generically refers to both encoding and decoding. Likewise, the term "code" generically refers to both encode and decode.

Video encoder <NUM> and video decoder <NUM> are configured to determine a respective set of adaptive loop filters, from among a plurality of sets of adaptive loop filters, per block of the current picture for blocks in which adaptive loop filtering is used, wherein each respective set of adaptive loop filters includes a previous adaptive loop filter used in one or more previous pictures (<NUM>). To determine the respective sets of adaptive loop filters, video encoder <NUM> and video decoder <NUM> are further configured to code a respective flag per block indicating if adaptive loop filtering is used for the respective block, and code, based on the respective flag per block, a respective syntax element indicating the respective set of adaptive loop filters, from among the plurality of sets of adaptive loop filters, per block of the current picture. The respective syntax element is an index to a list including the plurality of sets of adaptive loop filters. Video encoder <NUM> and video decoder <NUM> is further configured to adaptive loop filter the blocks of the current picture in accordance with the respective sets of adaptive loop filters (<NUM>).

<FIG> is a flowchart illustrating another example method according to the invention. <FIG> shows an example of the techniques of <FIG> in more detail. Video encoder <NUM> and video decoder <NUM> are configured to code a block of video data in a current picture to create a reconstructed block of video data (<NUM>). That is, video encoder <NUM> and video decoder <NUM> may be configured to code the first block of video data in the current picture to create a first reconstructed block of video data.

Video encoder <NUM> and video decoder <NUM> then are configured to determine if a block level ALF On/Off flag is on (<NUM>). If no, video encoder <NUM> and video decoder <NUM> do not apply ALF, and instead proceed to code the next block of video data (<NUM>). If yes, video encoder <NUM> and video decoder <NUM> code, for the block, a syntax element indicating a set of adaptive loop filters (<NUM>). For example, video encoder <NUM> and video decoder <NUM> code, for the first block of video data, a first syntax element indicating a first set of adaptive loop filters from among the plurality of sets of adaptive loop filters.

Video encoder <NUM> and video decoder <NUM> then determine an adaptive loop filter from the set of adaptive loop filters for the currently coded block (<NUM>). For example, video encoder <NUM> and video decoder <NUM> may determine a first adaptive loop filter from the first set of adaptive loop filters for the first reconstructed block of video data. Video encoder <NUM> and video decoder <NUM> may then apply the adaptive loop filter to the reconstructed block (<NUM>). Video encoder <NUM> and video decoder <NUM> may then proceed to code the next block of video data (<NUM>). For example, the next block of video data may be a second block of video data. The process of <FIG> is then repeated. It should be noted that, when performing the techniques of this disclosure, when determining the set of adaptive loop filters for a next block of video data (e.g., a second block of video data), the set of adaptive loop filters for the second block of video data may be different than the set of adaptive loop filters used for other blocks of video data.

If implemented in software, the functions may be stored on or transmitted over, as one or more instructions or code, a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media such as data storage media, or communication media including any medium that facilitates transfer of a computer program from one place to another, e.g., according to a communication protocol.

By way of example, and not limitation, such computer-readable storage media can be any of 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. Combinations of the above should also be included within the computer-readable media.

Claim 1:
A method of coding video data, the method comprising:
determining a plurality of sets of adaptive loop filters for a current slice;
determining (<NUM>) a respective set of adaptive loop filters, from among the plurality of sets of adaptive loop filters, per block of the current slice for blocks in which adaptive loop filtering is used, wherein determining the respective set of adaptive loop filters comprises:
coding a respective syntax element indicating the respective set of adaptive loop filters, from among the plurality of sets of adaptive loop filters, per block of the current slice in which adaptive loop filtering is used,
wherein the blocks of the current slice are coding tree units, CTUs, of the current slice,
wherein each respective set of adaptive loop filters includes a previous adaptive loop filter from one or more previous slices, and
wherein the respective syntax element is an index to a list including the plurality of sets of adaptive loop filters; and
adaptive loop filtering (<NUM>) the blocks of the current slice in accordance with the respective sets of adaptive loop filters.