Patent Description:
This disclosure relates to video encoding and video decoding.

Of particular relevance for the present invention are the video coding techniques disclosed in VVC Test Model <NUM> and the corresponding VVC Draft <NUM> that are further referenced and discussed below in the section "Detailed Description".

<NPL> ) describes controlled clipping where controlled clipping describes a process that clips predicted or reconstructed pixel values to minimum and maximum values that are signaled in the bit-stream. The clipping process is applied at four stages, namely post-prediction, post-reconstruction, post-deblocking, and post-adaptive loop filter (post-ALF).

<CIT>, <CIT>, discloses a method of coding, implemented by a decoding device, the method comprising: obtaining a bitstream wherein at least one bit in the bitstream represents a syntax element for a current block, wherein the syntax element specifies the clipping index of the clipping value for adaptive loop filter (ALF); parsing the bitstream to obtain a value of the syntax element for the current block, wherein the syntax element is coded using a fixed length code; applying adaptive loop filtering on the current block, based on the value of the syntax element for the current block. Herein fixed length code means that all possible values of the syntax element are signaled using the same number of bits.

<CIT> describes methods and apparatus for Adaptive Loop Filter (ALF) processing of reconstructed video. According to one method, clipping values for the ALF processing are determined depending on a bit depth of a center reconstructed pixel. A current ALF output for the current block is derived, where the current ALF output comprises a weighted sum of clipped differences of original differences and each of the original differences is calculated between a first reconstructed pixel at a non-center filter location and the center reconstructed pixel, and each of the original differences is clipped according to a corresponding clipping value to form one clipped difference. In another method, a target clipping value is always signaled at an encoder side or parsed at a decoder side even if the target clipping value is zero. In another method, the clipping values are encoded or decoded using a fixed-length code.

The invention is defined in the independent claims, to which the reader is now directed. Preferred or advantageous embodiments are set out in the dependent claims.

Enabling disclosure of the protected invention is provided below with the embodiments combining the "first aspect of this disclosure" and the "second aspect of this disclosure". Further examples and embodiments are provided for illustrative purposes only without representing embodiments of the protected invention.

Video encoders and video decoders may apply an adaptive loop filter (ALF) to samples of a picture in a decoded video signal. Application of an ALF may enhance the quality of a decoded video signal. During application of an ALF, a video coder (e.g., a video encoder or a video decoder) may determine a filtered value for a current sample. To determine the filtered value for the current sample, the video coder may multiply a clipped sample of an ALF filter support for the current sample by a corresponding filter coefficient. A support is a set of samples used to derive a value for a sample being filtered. The video coder may then determine the filtered value for the current sample by adding the value of the current sample to a sum the resulting multiplication products.

As noted above, the video coder multiplies clipped samples by corresponding filter coefficients. The clipping is controlled by a set of clipping values. The clipping values specify an upper limit and a lower limit on the value of the sample. The video coder may use different clipping values in different circumstances. Accordingly, a video encoder may signal an index (i.e., an ALF clipping index) of the applicable set of clipping values. For instance, the video encoder may signal the ALF clipping index in an adaptation parameter set (APS).

In VVC Test Model <NUM> (VTM-<NUM>) (<NPL>), the ALF clipping index is signaled using an exponential-Golomb (exp-Golomb) code. Signaling the ALF clipping index as an exp-Golomb code may slow down the decoding process because determining the meaning of an exp-Golomb code may involve performing multiple comparison operations, which tend to be relatively slow.

This disclosure may address the problem. As described herein, a video coder (e.g., a video encoder or a video decoder) may code an ALF clipping index as a fixed-length unsigned integer. The video coder may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data. Because the ALF clipping index is signaled as a fixed-length unsigned integer, a video decoder may be able to perform a decoding process faster.

<FIG> is a block diagram illustrating an example video encoding and decoding system <NUM> that may perform the 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 a video. Thus, video data may include raw, unencoded video, encoded video, decoded (e.g., reconstructed) video, and video metadata, such as signaling data.

As shown in <FIG>, system <NUM> includes a source device <NUM> that provides encoded video data to be decoded and displayed by a destination device <NUM>, in this example. In particular, source device <NUM> provides the video data to destination device <NUM> via a computer-readable medium <NUM>. Source device <NUM> and destination device <NUM> may comprise any of a wide range of devices, including desktop computers, notebook (i.e., laptop) computers, tablet computers, set-top boxes, telephone handsets such smartphones, 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, and thus may be referred to as wireless communication devices.

In the example of <FIG>, source device <NUM> includes video source <NUM>, memory <NUM>, video encoder <NUM>, and output interface <NUM>. Destination device <NUM> includes input interface <NUM>, video decoder <NUM>, memory <NUM>, and display device <NUM>. In accordance with this disclosure, video encoder <NUM> of source device <NUM> and video decoder <NUM> of destination device <NUM> may be configured to apply the techniques for signaling clipping indices for adaptive loop filters in video coding. Thus, source device <NUM> represents an example of a video encoding device, while destination device <NUM> represents an example of a video decoding device. In other examples, a source device and a destination device may include other components or arrangements. For example, source device <NUM> may receive video data from an external video source, such as an external camera. Likewise, destination device <NUM> may interface with an external display device, rather than including an integrated display device.

System <NUM> as shown in <FIG> is merely one example. In general, any digital video encoding and/or decoding device may perform techniques for signaling clipping indices for adaptive loop filters in video coding. Source device <NUM> and destination device <NUM> are merely examples of such coding devices in which source device <NUM> generates coded video data for transmission to destination device <NUM>. This disclosure refers to a "coding" device as a device that performs coding (encoding and/or decoding) of data. Thus, video encoder <NUM> and video decoder <NUM> represent examples of coding devices, in particular, a video encoder and a video decoder, respectively. In some examples, devices <NUM>, <NUM> may operate in a substantially symmetrical manner such that each of devices <NUM>, <NUM> include video encoding and decoding components. Hence, system <NUM> may support one-way or two-way video transmission between source device <NUM> and destination device <NUM>, e.g., for video streaming, video playback, video broadcasting, or video telephony.

In general, video source <NUM> represents a source of video data (i.e., raw, unencoded video data) and provides a sequential series of pictures (also referred to as "frames") of the video data to video encoder <NUM>, which encodes data for the pictures. Video source <NUM> of source device <NUM> 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 to receive video from a video content provider. As a further alternative, video source <NUM> 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, video encoder <NUM> encodes the captured, pre-captured, or computer-generated video data. Video encoder <NUM> may rearrange the pictures from the received order (sometimes referred to as "display order") into a coding order for coding. Video encoder <NUM> may generate a bitstream including encoded video data. Source device <NUM> may then output the encoded video data via output interface <NUM> onto computer-readable medium <NUM> for reception and/or retrieval by, e.g., input interface <NUM> of destination device <NUM>.

Memory <NUM> of source device <NUM> and memory <NUM> of destination device <NUM> represent general purpose memories. In some examples, memories <NUM>, <NUM> may store raw video data, e.g., raw video from video source <NUM> and raw, decoded video data from video decoder <NUM>. Additionally or alternatively, memories <NUM>, <NUM> may store software instructions executable by, e.g., video encoder <NUM> and video decoder <NUM>, respectively. Although memory <NUM> and memory <NUM> are shown separately from video encoder <NUM> and video decoder <NUM> in this example, it should be understood that video encoder <NUM> and video decoder <NUM> may also include internal memories for functionally similar or equivalent purposes. Furthermore, memories <NUM>, <NUM> may store encoded video data, e.g., output from video encoder <NUM> and input to video decoder <NUM>. In some examples, portions of memories <NUM>, <NUM> may be allocated as one or more video buffers, e.g., to store raw, decoded, and/or encoded video data.

Computer-readable medium <NUM> may represent any type of medium or device capable of transporting the encoded video data from source device <NUM> to destination device <NUM>. In one example, computer-readable medium <NUM> represents a communication medium to enable source device <NUM> to transmit encoded video data directly to destination device <NUM> in real-time, e.g., via a radio frequency network or computer-based network. Output interface <NUM> may modulate a transmission signal including the encoded video data, and input interface <NUM> may demodulate the received transmission signal, according to a communication standard, such as a wireless communication protocol. The communication medium may comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium may form part of a packet-based network, such as a local area network, a wide-area network, or a global network such as the Internet. The communication medium may include routers, switches, base stations, or any other equipment that may be useful to facilitate communication from source device <NUM> to destination device <NUM>.

In some examples, computer-readable medium <NUM> may include storage device <NUM>. Source device <NUM> may output encoded data from output interface <NUM> to storage device <NUM>. Similarly, destination device <NUM> may access encoded data from storage device <NUM> via 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 some examples, computer-readable medium <NUM> may include file server <NUM> or another intermediate storage device that may store the encoded video data generated by source device <NUM>. Source device <NUM> may output encoded video data to file server <NUM> or another intermediate storage device that may store the encoded video generated by source device <NUM>. Destination device <NUM> may access stored video data from file server <NUM> via streaming or download. File server <NUM> may be any type of server device capable of storing encoded video data and transmitting that encoded video data to the destination device <NUM>. File server <NUM> may represent a web server (e.g., for a website), a File Transfer Protocol (FTP) server, a content delivery network device, or a network attached storage (NAS) device. Destination device <NUM> may access encoded video data from file server <NUM> 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., digital subscriber line (DSL), cable modem, etc.), or a combination of both that is suitable for accessing encoded video data stored on file server <NUM>. File server <NUM> and input interface <NUM> may be configured to operate according to a streaming transmission protocol, a download transmission protocol, or a combination thereof.

Output interface <NUM> and input interface <NUM> may represent wireless transmitters/receivers, modems, wired networking components (e.g., Ethernet cards), wireless communication components that operate according to any of a variety of IEEE <NUM> standards, or other physical components. In examples where output interface <NUM> and input interface <NUM> comprise wireless components, output interface <NUM> and input interface <NUM> may be configured to transfer data, such as encoded video data, according to a cellular communication standard, such as <NUM>, <NUM>-LTE (Long-Term Evolution), LTE Advanced, <NUM>, or the like. In some examples where output interface <NUM> comprises a wireless transmitter, output interface <NUM> and input interface <NUM> may be configured to transfer data, such as encoded video data, according to other wireless standards, such as an IEEE <NUM> specification, an IEEE <NUM> specification (e.g., ZigBee™), a Bluetooth™ standard, or the like. In some examples, source device <NUM> and/or destination device <NUM> may include respective system-on-a-chip (SoC) devices. For example, source device <NUM> may include an SoC device to perform the functionality attributed to video encoder <NUM> and/or output interface <NUM>, and destination device <NUM> may include an SoC device to perform the functionality attributed to video decoder <NUM> and/or input interface <NUM>.

Input interface <NUM> of destination device <NUM> receives an encoded video bitstream from computer-readable medium <NUM> (e.g., a communication medium, storage device <NUM>, file server <NUM>, or the like). The encoded video bitstream may include signaling information defined by video encoder <NUM>, which is also used by video decoder <NUM>, such as syntax elements having values that describe characteristics and/or processing of video blocks or other coded units (e.g., slices, pictures, groups of pictures, sequences, or the like). Display device <NUM> displays decoded pictures of the decoded video data to a user. Display device <NUM> may represent any of a variety of display devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), a plasma display, an organic light emitting diode (OLED) display, or another type of display device.

Video encoder <NUM> and video decoder <NUM> may operate according to a video coding standard, such as ITU-T H. <NUM>, also referred to as High Efficiency Video Coding (HEVC) or extensions thereto, such as the multi-view and/or scalable video coding extensions. Alternatively, video encoder <NUM> and video decoder <NUM> may operate according to other proprietary or industry standards, such as ITU-T H. <NUM>, also referred to as Versatile Video Coding (VVC). A recent draft of the VVC standard is described in <NPL>. The techniques of this disclosure, however, are not limited to any particular coding standard.

As another example, video encoder <NUM> and video decoder <NUM> may be configured to operate according to VVC. According to VVC, a video coder (such as video encoder <NUM>) partitions a picture into a plurality of CTUs. A coding tree block (CTB) is N×N block of samples for some value of N such that the division of a component into CTBs is a partitioning. In VVC, a CTU may be defined as a CTB of luma samples, two corresponding CTBs of chroma samples of a picture that has three sample arrays, or a CTB of samples of a monochrome picture or a picture that is coded using three separate colour planes and syntax structures used to code the samples.

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 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.

Some examples of 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 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).

As noted above, following any transforms to produce transform coefficients, video encoder <NUM> 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 the quantization process, video encoder <NUM> may reduce the bit depth associated with some or all of the transform coefficients. For example, video encoder <NUM> may round an n-bit value down to an m-bit value during quantization, where n is greater than m. In some examples, to perform quantization, video encoder <NUM> may perform a bitwise right-shift of the value to be quantized.

Following quantization, video encoder <NUM> may scan the transform coefficients, producing a one-dimensional vector from the two-dimensional matrix including the quantized transform coefficients. The scan may be designed to place higher energy (and therefore lower frequency) transform coefficients at the front of the vector and to place lower energy (and therefore higher frequency) transform coefficients at the back of the vector. In some examples, video encoder <NUM> may utilize a predefined scan order to scan the quantized transform coefficients to produce a serialized vector, and then entropy encode the quantized transform coefficients of the vector. In other examples, video encoder <NUM> may perform an adaptive scan. After scanning the quantized transform coefficients to form the one-dimensional vector, video encoder <NUM> may entropy encode the one-dimensional vector, e.g., according to context-adaptive binary arithmetic coding (CABAC). Video encoder <NUM> may also entropy encode values for syntax elements describing metadata associated with the encoded video data for use by video decoder <NUM> in decoding the video data.

In general, video decoder <NUM> performs a reciprocal process to that performed by video encoder <NUM> to decode the encoded video data of the bitstream. For example, video decoder <NUM> may decode values for syntax elements of the bitstream using CABAC in a manner substantially similar to, albeit reciprocal to, the CABAC encoding process of video encoder <NUM>. The syntax elements may define partitioning information for partitioning a picture into CTUs, and partitioning 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 (e.g., CUs) of video data.

In the field of video coding, it is common to apply filtering in order to enhance the quality of a decoded video signal. The filter can be applied as a post-filter, where filtered frame is not used for prediction of future frames, or as an in-loop filter, where the filtered frame is used to predict a future frame. A filter can be designed, for example, by minimizing the error between the original signal and the decoded filtered signal.

In VVC Test Model <NUM> (VTM-<NUM>) (<NPL>, the decoded filter coefficients f(k, l) and clipping values c(k, l) are applied to the reconstructed image R(i, j) as follows: <MAT> In VTM-<NUM>, a 7x7 filter is applied to luma components and a <NUM>×<NUM> filter is applied to chroma components. <FIG> is a conceptual diagram illustrating an example <NUM>×<NUM> diamond-shaped ALF support. <FIG> is a conceptual diagram illustrating an example 7x7 diamond-shaped ALF support. In equation (<NUM>), K may be equal to <MAT>, where L denotes filter length. Furthermore, in equation (<NUM>) and elsewhere in this disclosure, the clip3 function may be defined as: <MAT>.

In equation (<NUM>), and elsewhere in this disclosure, a clipping value c(k, l) may be calculated as follows. For the luma component, a clipping value c(k, l) may be calculated as: <MAT> In equation (<NUM>'), BitDepthY is the bit depth for the luma component and clipIdx(k,l) is a clipping index for position (k,l). clipIdx(k,l) can be <NUM>, <NUM>, <NUM> or <NUM>.

For the chroma component, a clipping value c(k, l) may be calculated as: <MAT> In equation (<NUM>"), BitDepthC is the bit depth for the chroma component and clipIdx(k,l) is a clipping value for position (k,l). clipIdx(k,l) can be <NUM>, <NUM>, <NUM> or <NUM>.

For the luma component, <NUM>×<NUM> blocks in the whole picture are classified based on a <NUM>-dimensional (1D) Laplacian direction (up to <NUM> directions) and 2D Laplacian activity (up to <NUM> activity values). The calculation of direction Dirb and unquanitzed activity Actb. Actb is further quantized to the range of <NUM> to <NUM> inclusively.

Firstly, a video coder (e.g., video encoder <NUM> or video decoder <NUM>) calculates values of two diagonal gradients, in addition to the horizontal and vertical gradients used in the existing ALF, using a 1D Laplacian. As it can be seen from equations (<NUM>) to (<NUM>), below, the sum of gradients of all pixels within an 8x8 window that covers a target pixel is employed as the represented gradient of the target pixel, where R(k, l) denotes the reconstructed pixels at location (k, l) and indices i and j refer to the coordinates of the upper-left pixel in the <NUM>×<NUM> block. Each pixel is associated with four gradient values, with a vertical gradient denoted by gv, a horizontal gradient denoted by gh, a <NUM>-degree diagonal gradient denoted by gd1 and a <NUM>-degree diagonal gradient denoted by gd2.

when both k and l are even numbers or both k and l are not even numbers.

Otherwise, <NUM>. <MAT> when both k and l are even numbers or both k and l are not even numbers.

To assign the directionality Dirb, a ratio of a maximum and a minimum of the horizontal and vertical gradients (denoted by Rh,v in equation (<NUM>), below) and the ratio of a maximum and a minimum of two diagonal gradients (denoted by Rd1,d2 in equation (<NUM>), below) are compared against each other with two thresholds t<NUM> and t<NUM>.

In equations (<NUM>) and (<NUM>), and elsewhere in this disclosure, <MAT> denotes the maximum of the horizonal and vertical gradients; <MAT> denotes the minimum of the horizontal and vertical gradients; <MAT> denotes the maximum of the two diagonal gradients; and <MAT> denotes the minimum of the two diagonal gradients.

By comparing the detected ratios of the horizontal/vertical and diagonal gradients, five direction modes, i.e., Dirb within the range of [<NUM>, <NUM>] inclusive, are defined in equation (<NUM>), below. The values of Dirb and their physical meanings are described in Table <NUM>.

The video coder (e.g., video encoder <NUM> or video decoder <NUM>) may calculate an activity value Act as: <MAT>.

The video coder may further quantize Act to a range of <NUM> to <NUM>, inclusive. The quantized value of Act is denoted as Â.

The quantization process for Act may be defined as follows: <MAT> <MAT> wherein NUM_ENTRY is set to <NUM>, ScaleFactor is set to <NUM>, shift is (<NUM> + internal coded-bitdepth), and ActivityToIndex[NUM_ENTRY] = {<NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>, <NUM>}. The function Clip_post(a, b) returns the smaller value between a and b.

In total, each <NUM>×<NUM> luma block can be categorized by the video coder into one of <NUM> (<NUM> directions × <NUM> activity levels) classes and an index is assigned to each <NUM>×<NUM> block according the value of Dirb and Actb of the block. The group index may be denoted by C and set equal to <NUM>Dirb + Â, wherein Â is the quantized value of Actb.

In some examples, the video coder may apply geometry transformations to filter coefficients. For instance, in some such examples, the video coder may, for each category, signal one set of filter coefficients and clipping values. To better distinguish different directions of blocks marked with the same category index, four geometry transformations, including no transformation, diagonal, vertical flip and rotation, are introduced. An example of <NUM>×<NUM> filter support with the three geometric transformations is depicted in <FIG>. In other words, <FIG> are conceptual diagrams illustrating example 5x5 filter supports with different geometric transformations. Comparing <FIG> and <FIG>, the formula forms of the three additional geometry transformations may be derived as: <MAT> In equation (<NUM>), K is the size of the filter and <NUM> ≤ k, l ≤ K - <NUM> are coefficient coordinates, such that location (<NUM>,<NUM>) is at the upper left corner and location (K - <NUM>, K - <NUM>) is at the lower right corner. Note that when the diamond filter support is used, such as in the ALF of VVC Draft <NUM>, the filter coefficients with coordinates out of the filter support are always set to <NUM>. One way of indicating the geometry transformation index is to derive the geometry transformation index implicitly to avoid additional overhead. In Geometric ALF (GALF), the transformations are applied (e.g., by a video coder such as video encoder <NUM> or video decoder <NUM>) to the filter coefficients f(k, l) depending on gradient values calculated for that block. The relationship between the transformation and the four gradients calculated using Equations (<NUM>)-(<NUM>) is described in Table <NUM>, below. To summarize, the transformations are based on which one of two gradients (horizontal and vertical, or <NUM>-degree and <NUM>-degree gradients) is larger. Based on the comparison, the video coder may extract more accurate direction information. Therefore, different filtering results could be obtained due to transformation while the overhead of filter coefficients is not increased.

Filter information may be signaled in a bitstream. One luma filter set contains filter information (including filter coefficients and clipping values) for all <NUM> classes. Fixed filters can be used to predict the filters for each class. A flag could be signaled for each class to indicate whether this class uses a fixed filter as its filter predictor. If yes (i.e., if the flag for a class indicates that the class uses a fixed filter as its filter predictor), the fixed filter information is signaled.

To reduce the number of bits required to represent the filter coefficients, different classes can be merged. The information regarding which classes are merged may be provided by sending, for each of the <NUM> classes, an index iC. Classes having the same index iC share the same filter coefficients that are coded. The mapping between classes and filters is signaled for each luma filter set. The index iC is coded with truncated binary binarization method. A signaled filter can be predicted from a previously signaled filter.

A bitstream may comprise 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 may include a NAL unit header and may encapsulate a RBSP. The NAL unit header may include a syntax element indicating 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. An 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.

As noted above, a bitstream may include a representation of encoded pictures of the video data and associated data. The associated data may include parameter sets. NAL units may encapsulate RBSPs for video parameter sets (VPSs), sequence parameter sets (SPSs), picture parameter sets (PPSs), and Adaptation Parameter Sets (APSs). A VPS is a syntax structure that includes syntax elements that apply to zero or more entire coded video sequences (CVSs). An SPS is also a syntax structure including syntax elements that apply to zero or more entire CVSs. An SPS may include a syntax element that identifies a VPS that is active when the SPS is active. Thus, the syntax elements of a VPS may be more generally applicable than the syntax elements of an SPS. A PPS is a syntax structure including syntax elements that apply to zero or more coded pictures. A PPS may include a syntax element that identifies an SPS that is active when the PPS is active. A slice header of a slice may include a syntax element that indicates a PPS that is active when the slice is being coded. An APS is a syntax structure containing syntax elements that apply to zero or more slices as determined by zero or more syntax elements found in slice headers. A slice header of a slice may include one or more syntax elements that indicate APSs that are active when the slice is being coded.

In VTM-<NUM>, APSs are used to carry ALF filter coefficients in bitstream. An APS can contain a set of luma filters or a set of chroma filters or both. A tile group, slice, or picture only signals indices of APSs that used for the current tile group in its tile group, slice, or picture header.

In VTM-<NUM>, filters generated from previously coded tile groups, slices, or pictures may be used for a current tile group, slice, or picture to save the overhead for filter signaling. Video encoder <NUM> may choose, for a luma CTB, a filter set among fixed filter sets and filter sets from APSs. Video encoder <NUM> may signal the chosen filter set index. All chroma CTBs use a filter from the same APS. In a tile group, slice, or picture header, video encoder <NUM> signals the APSs used for luma and chroma CTBs of a current tile group, slice, or picture. A tile is a rectangular region of CTBs within a particular tile column and a particular tile row in a picture.

In the video decoder of VTM-<NUM> (e.g., video decoder <NUM>), filter coefficients of the ALF are reconstructed first. Clipping indices are then decoded for non-zero filter coefficients. For filter coefficients with values of zero, the video decoder infers the clipping indices to be zero. Exponential-Golomb (i.e., Exp-Golomb) coding is used for signaling of clipping indices. The order of an Exp-Golomb code for a clipping index depends on its position in the filter template.

To be specific, in VTM-<NUM>, an APS may include clipping indices for the luma component that are parsed as follows, where alf_luma_clip_idx specifies a clipping index:.

VVC Draft <NUM> provides the following semantics for the syntax elements shown in the syntax table above:.

The order kClipY[ i ] of the exp-Golomb code used to decode the values of alf_luma_clip_idx[ sfIdx ][ j ] is derived as follows: <MAT> alf_luma_clip_eg_order_increase_flag[ i ].

alf_luma_clip_idx[ sfIdx ][ j ] specifies the clipping index of the clipping value to use before multiplying by the j-th coefficient of the signalled luma filter indicated by sfldx. When alf_luma_clip_idx[ sfIdx ][ j ] is not present, it is inferred to be equal <NUM> (no clipping). It is a requirement of bitstream conformance that the values of alf_luma_clip_idx[ sfIdx ][ j ] with sfldx = <NUM>. alf_luma_num_filters_signalled_minus1 and j = <NUM>. <NUM> shall be in the range of <NUM> to <NUM>, inclusive.

The order k of the exp-Golomb binarization uek(v) is derived as follows: <MAT>.

The variable filterClips[ sfIdx ][ j ] with
sfldx = <NUM>. alf_luma_num_filters_signalled_minus1, j = <NUM>. <NUM> is initialized as follows: <MAT>.

The luma filter clipping values AlfClipL[ adaptation_parameter_set_id ] with elements AlfClipL[ adaptation_parameter_set_id ][ filtIdx ][ j ], with filtIdx = <NUM>. NumAlfFilters - <NUM> and j = <NUM>. <NUM> are derived as follows: <MAT>.

In the syntax tables of this disclosure, u(n) indicates an unsigned integer using n bits. When the letter n in a descriptor of type u(n) is "v" in a syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. The descriptor tb(v) indicates a truncated binary value using up to maxVal bits with maxVal defined in the semantics of the syntax element. The descriptor tu(v) indicates a truncated unary value using up to maxVal bits with maxVal defined in the semantics of the syntax element. The descriptor ue(v) indicates an unsigned integer <NUM>-th order Exp-Golomb-coded syntax element with the left bit first. The descriptor uek(v) indicates an unsigned integer k-th order Exp-Golomb-coded syntax element with the left bit first. The descriptor se(v) indicates a signed integer <NUM>-th order Exp-Golomb-coded syntax element with the left bit first.

VVC Draft <NUM> provides the following parsing process for syntax elements coded using descriptor tb(v):.

VVC Draft <NUM> provides the following parsing process for syntax elements coded using descriptor tu(v):.

VVC Draft <NUM> provides the following parsing process for syntax elements coded using descriptors ue(v) uek(v), and se(v):.

leadingZeroBits = -<NUM>
for( b = <NUM>; !b; leadingZeroBits++ ) (<NUM>-<NUM>)
b = read_bits( <NUM>).

The variable codeNum is then assigned as follows: <MAT> where the value returned from read_bits( leadingZeroBits ) is interpreted as a binary representation of an unsigned integer with most significant bit written first.

Table <NUM>-<NUM> illustrates the structure of the <NUM>-th order Exp-Golomb code by separating the bit string into "prefix" and "suffix" bits. The "prefix" bits are those bits that are parsed as specified above for the computation of leadingZeroBits, and are shown as either <NUM> or <NUM> in the bit string column of Table <NUM>-<NUM>. The "suffix" bits are those bits that are parsed in the computation of codeNum and are shown as xi in Table <NUM>-<NUM>, with i in the range of <NUM> to leadingZeroBits - <NUM>, inclusive. Each xi is equal to either <NUM> or <NUM>.

Table <NUM>-<NUM> illustrates explicitly the assignment of bit strings to codeNum values.

Depending on the descriptor, the value of a syntax element is derived as follows:.

Input to this process is codeNum as specified in clause <NUM>.

Output of this process is a value of a syntax element coded as se(v).

The syntax element is assigned to the codeNum by ordering the syntax element by its absolute value in increasing order and representing the positive value for a given absolute value with the lower codeNum. Table <NUM>-<NUM> provides the assignment rule.

In VVC Draft <NUM>, clipping indices for chroma components are parsed as follows:.

The order expGoOrderC[ i ] of the exp-Golomb code used to decode the values of alf_chroma_coeff_abs[ j ] is derived as follows: <MAT> <MAT>.

alf_chroma_coeff_abs[ j ] specifies the absolute value of the j-th chroma filter coefficient. When alf_chroma_coeff_abs[ j ] is not present, it is inferred to be equal <NUM>. It is a requirement of bitstream conformance that the values of alf_chroma_coeff_abs[ j ] shall be in the range of <NUM> to <NUM><NUM> - <NUM>, inclusive.

The order k of the exp-Golomb binarization uek(v) is derived as follows: <MAT> <MAT>.

alf_chroma_coeff_sign[ j ] specifies the sign of the j-th chroma filter coefficient as follows:.

When alf_chroma_coeff_sign[ j ] is not present, it is inferred to be equal to <NUM>. The chroma filter coefficients AlfCoeffC[ adaptation_parameter_set_id ] with elements AlfCoeffc[ adaptation_parameter_set_id ][ j ], with j = <NUM>. <NUM> are derived as follows: <MAT> ( <NUM> - <NUM> * alf_chroma_coeff_sign[ j ] ).

It is a requirement of bitstream conformance that the values of AlfCoeffC[ adaptation_parameter_set_id ][ j ] with j = <NUM>. <NUM> shall be in the range of -<NUM><NUM> - <NUM> to <NUM><NUM> - <NUM>, inclusive.

alf_chroma_clip_min_eg_order_minus1 plus <NUM> specifies the minimum order of the exp-Golomb code for chroma clipping index signalling. The value of alf_chroma_clip_min_eg_order_minus1 shall be in the range of <NUM> to <NUM>, inclusive. alf_chroma_clip_eg_order_increase_flag[ i ] equal to <NUM> specifies that the minimum order of the exp-Golomb code for chroma clipping index signalling is incremented by <NUM>. alf_chroma_clip_eg_order_increase_flag[ i ] equal to <NUM> specifies that the minimum order of the exp-Golomb code for chroma clipping index signalling is not incremented by <NUM>.

The order expGoOrderC[ i ] of the exp-Golomb code used to decode the values of alf_chroma_clip_idx[ j ] is derived as follows: <MAT> <MAT>.

alf_chroma_clip_idx[ j ] specifies the clipping index of the clipping value to use before multiplying by the j-th coefficient of the chroma filter. When alf_chroma_clip_idx[ j ] is not present, it is inferred to be equal <NUM> (no clipping). It is a requirement of bitstream conformance that the values of alf_chroma_clip_idx[ j ] with j = <NUM>. <NUM> shall be in the range of <NUM> to <NUM>, inclusive. The order k of the exp-Golomb binarization uek(v) is derived as follows: <MAT>.

The chroma filter clipping values AlfClipC[ adaptation_parameter_set_id ] with elements AlfClipC[ adaptation_parameter_set_id ][ j ], with j = <NUM>. <NUM> are derived as follows: <MAT>.

As described above, to parse clipping indices, filter coefficients are reconstructed first. In addition, recursive exp-Golomb coding is used for parsing clipping indices. Reconstructing the filter coefficients first and using recursive exp-Golomb coding may increase the delay in video decoder <NUM>.

Aspects of this disclosure describe examples that may simplify the parsing of clipping indices for both luma and chroma components. The aspects and examples of this disclosure may be used separately, or in combination. Aspects of this disclosure may decrease the delay in video decoder <NUM> and, in some examples, the decoding path of video encoder <NUM>. In accordance with the protected invention, the following first and second aspect are used in combination.

In a first aspect of this disclosure and in accordance with the protected invention, a clipping index clipIdx(k,l) is always signaled/parsed (e.g., by video encoder <NUM> or video decoder <NUM>, respectively) even if the corresponding filter coefficient f(k,l) is zero. In other words, the condition that the corresponding filter coefficient is non-zero may be removed. For instance, with reference to the syntax tables above, the lines "if( filtCoeff[ sfIdx ][ j ])" and "if ( alf_chroma_coeff_abs[ j ] )" may be removed. In this way, a video coder (e.g., video encoder <NUM> or video decoder <NUM>) may code the ALF clipping index regardless of a value of a corresponding filter coefficient of the ALF. For instance, the video coder may determine that the corresponding filter coefficient is equal to <NUM> and still code (e.g., encode or decode) the ALF clipping index.

In a second aspect of this disclosure, the recursive exp-Golomb coding is removed. For instance, in one example of the second aspect of this disclosure and further in accordance with the protected invention, fixed-length coding is used to signal clipping indices, letting x be the length of each code word, as shown in the exemplary syntax tables below.

In contrast to VVC Draft <NUM>, in which alf_luma_clip_idx and alf_chroma_clip_idx have descriptors uek(v) (denoting unsigned integer k-th order Exp-Golomb coding), alf_luma_clip_idx and alf_chroma_clip_idx have descriptors u(x) in this example (denoting an unsigned integer using x bits). The syntax tables of this example may form part of a syntax table of an APS.

Thus, in this example, a video coder (e.g., video encoder <NUM> or video decoder <NUM>) may code an ALF clipping index as a fixed-length unsigned integer. Furthermore, the video coder may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data.

Thus, a video coder (e.g., video encoder <NUM> or video decoder <NUM>) may code (e.g., encode or decode) an ALF clipping index as one of: a fixed-length unsigned integer (descriptor u(x)), a truncated binary value (descriptor tb(v)), a truncated unary value (descriptor tu(v)), or an unsigned <NUM>-th order Exp-Golomb coded value (descriptor (ue(v)). The video coder may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data. The video coder may perform this for either or both luma and chroma components. Thus, the ALF clipping index may be a luma ALF clipping index or a chroma ALF clipping index. With respect to the first aspect of this disclosure, the video coder may code the ALF clipping index regardless of a value of a corresponding filter coefficient of the ALF.

In some examples, to apply the ALF based on the ALF clipping index, the video coder may determine a clipping value based on the clipping index as indicated in equation (<NUM>') or (<NUM>"), as set forth above. The video coder may then use the clipping value in equation (<NUM>), as set forth above. The video coder may determine the filter coefficients as set forth elsewhere in this disclosure, or in other ways.

This disclosure may generally refer to "signaling" certain information, such as syntax elements. The term "signaling" may generally refer to the communication of values for syntax elements and/or other data used to decode encoded video data. That is, video encoder <NUM> may signal values for syntax elements in the bitstream. In general, signaling refers to generating a value in the bitstream. As noted above, source device <NUM> may transport the bitstream to destination device <NUM> substantially in real time, or not in real time, such as might occur when storing syntax elements to storage device <NUM> for later retrieval by destination device <NUM>.

<FIG> are conceptual diagram illustrating an example quadtree binary tree (QTBT) structure <NUM>, and a corresponding coding tree unit (CTU) <NUM>. The solid lines represent quadtree splitting, and dotted lines indicate binary tree splitting. In each split (i.e., non-leaf) node of the binary tree, one flag is signaled to indicate which splitting type (i.e., horizontal or vertical) is used, where <NUM> indicates horizontal splitting and <NUM> indicates vertical splitting in this example. For the quadtree splitting, there is no need to indicate the splitting type, since quadtree nodes split a block horizontally and vertically into <NUM> sub-blocks with equal size. Accordingly, video encoder <NUM> may encode, and video decoder <NUM> may decode, syntax elements (such as splitting information) for a region tree level (i.e., the first level) of QTBT structure <NUM> (i.e., the solid lines) and syntax elements (such as splitting information) for a prediction tree level (i.e., the second level) of QTBT structure <NUM> (i.e., the dashed lines). Video encoder <NUM> may encode, and video decoder <NUM> may decode, video data, such as prediction and transform data, for CUs represented by terminal leaf nodes of QTBT structure <NUM>.

In one example of the QTBT partitioning structure, the CTU size is set as 128x128 (luma samples and two corresponding 64x64 chroma samples), the MinQTSize is set as 16x16, the MaxBTSize is set as 64x64, the MinBTSize (for both width and height) is set as <NUM>, and the MaxBTDepth is set as <NUM>. The quadtree partitioning is applied to the CTU first to generate quad-tree leaf nodes. The quadtree leaf nodes may have a size from 16x16 (i.e., the MinQTSize) to 128x128 (i.e., the CTU size). If the quadtree leaf node is 128x128, it will not be further split by the binary tree, since the size exceeds the MaxBTSize (i.e., 64x64, in this example). Otherwise, the quadtree leaf node will be further partitioned by the binary tree. Therefore, the quadtree leaf node is also the root node for the binary tree and has the binary tree depth as <NUM>. When the binary tree depth reaches MaxBTDepth (<NUM>, in this example), no further splitting is permitted. When the binary tree node has width equal to MinBTSize (<NUM>, in this example), it implies that no further vertical splitting is permitted. Similarly, a binary tree node having a height equal to MinBTSize implies that no further horizontal splitting is permitted for that binary tree node. As noted above, leaf nodes of the binary tree are referred to as CUs, and are further processed according to prediction and transform without further partitioning.

<FIG> is a block diagram illustrating an example video encoder <NUM> that may perform the techniques of this disclosure. <FIG> is provided for purposes of explanation and should not be considered limiting of the techniques as broadly exemplified and described in this disclosure. For purposes of explanation, this disclosure describes video encoder <NUM> in the context of video coding standards such as the H. <NUM> (HEVC) video coding standard and the H. <NUM> (VVC) video coding standard in development. However, the techniques of this disclosure are not limited to these video coding standards, and are applicable generally to video encoding and decoding.

In the example of <FIG>, video encoder <NUM> includes video data memory <NUM>, mode selection unit <NUM>, residual generation unit <NUM>, transform processing unit <NUM>, quantization unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, decoded picture buffer (DPB) <NUM>, and entropy encoding unit <NUM>. Any or all of video data memory <NUM>, mode selection unit <NUM>, residual generation unit <NUM>, transform processing unit <NUM>, quantization unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, DPB <NUM>, and entropy encoding unit <NUM> may be implemented in one or more processors or in processing circuitry. Moreover, video encoder <NUM> may include additional or alternative processors or processing circuitry to perform these and other functions.

The various units of <FIG> are illustrated to assist with understanding the operations performed by video encoder <NUM>. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Fixed-function circuits refer to circuits that provide particular functionality and are preset on the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that can be performed. For instance, programmable circuits may execute software or firmware that cause the programmable circuits to operate in the manner defined by instructions of the software or firmware. Fixed-function circuits may execute software instructions (e.g., to receive parameters or output parameters), but the types of operations that the fixed-function circuits perform are generally immutable. In some examples, one or more of the units may be distinct circuit blocks (fixed-function or programmable), and in some examples, the one or more units may be integrated circuits.

Video encoder <NUM> may include arithmetic logic units (ALUs), elementary function units (EFUs), digital circuits, analog circuits, and/or programmable cores, formed from programmable circuits. In examples where the operations of video encoder <NUM> are performed using software executed by the programmable circuits, memory <NUM> (<FIG>) may store the object code of the software that video encoder <NUM> receives and executes, or another memory within video encoder <NUM> (not shown) may store such instructions.

Mode selection unit <NUM> includes a motion estimation unit <NUM>, motion compensation unit <NUM>, and an intra-prediction unit <NUM>. Mode selection unit <NUM> may include additional functional units to perform video prediction in accordance with other prediction modes. As examples, mode selection unit <NUM> may include a palette unit, an intra-block copy unit (which may be part of motion estimation unit <NUM> and/or motion compensation unit <NUM>), an affine unit, a linear model (LM) unit, or the like.

Video encoder <NUM> may partition a picture retrieved from video data memory <NUM> into a series of CTUs, and encapsulate one or more CTUs within a slice. Mode selection unit <NUM> may partition a CTU of the picture in accordance with a tree structure, such as the QTBT structure or the quad-tree structure of HEVC described above. As described above, video encoder <NUM> may form one or more CUs from partitioning a CTU according to the tree structure. Such a CU may also be referred to generally as a "video block" or "block.

Motion estimation unit <NUM> may form one or more motion vectors (MVs) that defines the positions of the reference blocks in the reference pictures relative to the position of the current block in a current picture. Motion estimation unit <NUM> may then provide the motion vectors to motion compensation unit <NUM>. For example, for uni-directional inter-prediction, motion estimation unit <NUM> may provide a single motion vector, whereas for bi-directional inter-prediction, motion estimation unit <NUM> may provide two motion vectors. Motion compensation unit <NUM> may then generate a prediction block using the motion vectors. For example, motion compensation unit <NUM> may retrieve data of the reference block using the motion vector. As another example, if the motion vector has fractional sample precision, motion compensation unit <NUM> may interpolate values for the prediction block according to one or more interpolation filters. Moreover, for bi-directional inter-prediction, motion compensation unit <NUM> may retrieve data for two reference blocks identified by respective motion vectors and combine the retrieved data, e.g., through sample-by-sample averaging or weighted averaging.

Mode selection unit <NUM> provides the prediction block to residual generation unit <NUM>. Residual generation unit <NUM> receives a raw, unencoded version of the current block from video data memory <NUM> and the prediction block from mode selection unit <NUM>. Residual generation unit <NUM> 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, residual generation unit <NUM> may also determine differences between sample values in the residual block to generate a residual block using residual differential pulse code modulation (RDPCM). In some examples, residual generation unit <NUM> may be formed using one or more subtractor circuits that perform binary subtraction.

In examples where mode selection unit does not further partition a CU into PUs, each CU may be associated with a luma coding block and corresponding chroma coding blocks. As above, the size of a CU may refer to the size of the luma coding block of the CU. The video encoder <NUM> and video decoder <NUM> may support CU sizes of 2Nx2N, 2NxN, or Nx2N.

For other video coding techniques such as an intra-block copy mode coding, an affine-mode coding, and linear model (LM) mode coding, as a few examples, mode selection unit <NUM>, via respective units associated with the coding techniques, generates a prediction block for the current block being encoded. In some examples, such as palette mode coding, mode selection unit <NUM> may not generate a prediction block, and instead generate syntax elements that indicate the manner in which to reconstruct the block based on a selected palette. In such modes, mode selection unit <NUM> may provide these syntax elements to entropy encoding unit <NUM> to be encoded.

Quantization unit <NUM> may quantize the transform coefficients in a transform coefficient block, to produce a quantized transform coefficient block. Quantization unit <NUM> may quantize transform coefficients of a transform coefficient block according to a quantization parameter (QP) value associated with the current block. Video encoder <NUM> (e.g., via mode selection unit <NUM>) may adjust the degree of quantization applied to the transform coefficient blocks associated with the current block by adjusting the QP value associated with the CU. Quantization may introduce loss of information, and thus, quantized transform coefficients may have lower precision than the original transform coefficients produced by transform processing unit <NUM>.

Filter unit <NUM> may perform one or more filter operations on reconstructed blocks. For example, filter unit <NUM> may perform deblocking operations to reduce blockiness artifacts along edges of CUs. Operations of filter unit <NUM> may be skipped, in some examples. In accordance with an example of this disclosure, filter unit <NUM> may apply, based on an ALF clipping index coded as a fixed-length unsigned integer, an ALF to a block of a picture of the video data.

Video encoder <NUM> stores reconstructed blocks in DPB <NUM>. For instance, in examples where operations of filter unit <NUM> are not needed, reconstruction unit <NUM> may store reconstructed blocks to DPB <NUM>. In examples where operations of filter unit <NUM> are needed, filter unit <NUM> may store the filtered reconstructed blocks to DPB <NUM>. Motion estimation unit <NUM> and motion compensation unit <NUM> may retrieve a reference picture from DPB <NUM>, formed from the reconstructed (and potentially filtered) blocks, to inter-predict blocks of subsequently encoded pictures. In addition, intra-prediction unit <NUM> may use reconstructed blocks in DPB <NUM> of a current picture to intra-predict other blocks in the current picture.

In some examples, operations performed with respect to a luma coding block need not be repeated for the chroma coding blocks. As one example, operations to identify a motion vector (MV) and reference picture for a luma coding block need not be repeated for identifying an MV and reference picture for the chroma blocks. Rather, the MV for the luma coding block may be scaled to determine the MV for the chroma blocks, and the reference picture may be the same. As another example, the intra-prediction process may be the same for the luma coding block and the chroma coding blocks.

Video encoder <NUM> represents an example of a device configured to encode video data including a memory configured to store video data, and one or more processing units implemented in circuitry and configured to encode an ALF clipping index as one of: a fixed-length unsigned integer, a truncated binary value, a truncated unary value, or an unsigned <NUM>-th order Exp-Golomb coded value. In other words, video encoder <NUM> may include, in a bitstream that includes an encoded representation of video data, an ALF clipping index syntax element, where the ALF clipping index syntax element is formatted as one of these types of data. In some examples, the ALF clipping index is a luma ALF clipping index (e.g., alf_luma_clip_idx or another syntax element) or a chroma ALF clipping index (e.g., alf_chroma_clip_idx or another syntax element). Additionally, the processing units of video encoder <NUM> may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data. For instance, filter unit <NUM> of video encoder <NUM> may apply the ALF.

<FIG> is a block diagram illustrating an example video decoder <NUM> that may perform the techniques of this disclosure. <FIG> is provided for purposes of explanation and is not limiting on the techniques as broadly exemplified and described in this disclosure. For purposes of explanation, this disclosure describes video decoder <NUM> according to the techniques of VVC, and HEVC. However, the techniques of this disclosure may be performed by video coding devices that are configured to other video coding standards.

In the example of <FIG>, video decoder <NUM> includes coded picture buffer (CPB) memory <NUM>, entropy decoding unit <NUM>, prediction processing unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, and decoded picture buffer (DPB) <NUM>. Any or all of CPB memory <NUM>, entropy decoding unit <NUM>, prediction processing unit <NUM>, inverse quantization unit <NUM>, inverse transform processing unit <NUM>, reconstruction unit <NUM>, filter unit <NUM>, and DPB <NUM> may be implemented in one or more processors or in processing circuitry. Moreover, video decoder <NUM> may include additional or alternative processors or processing circuitry to perform these and other functions.

Prediction processing unit <NUM> includes motion compensation unit <NUM> and intra-prediction unit <NUM>. Prediction processing unit <NUM> may include additional units to perform prediction in accordance with other prediction modes. As examples, prediction processing unit <NUM> may include a palette coding unit, an intra-block copy coding unit (which may form part of motion compensation unit <NUM>), an affine coding unit, a linear model (LM) coding unit, or the like. In other examples, video decoder <NUM> may include more, fewer, or different functional components.

CPB 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 CPB memory <NUM> may be obtained, for example, from computer-readable medium <NUM> (<FIG>). CPB memory <NUM> may include a CPB that stores encoded video data (e.g., syntax elements) from an encoded video bitstream. Also, CPB memory <NUM> may store video data other than syntax elements of a coded picture, such as temporary data representing outputs from the various units of video decoder <NUM>. DPB <NUM> generally stores decoded pictures, which video decoder <NUM> may output and/or use as reference video data when decoding subsequent data or pictures of the encoded video bitstream. CPB memory <NUM> and DPB <NUM> may be formed by any of a variety of memory devices, such as DRAM, including SDRAM, MRAM, RRAM, or other types of memory devices. CPB memory <NUM> and DPB <NUM> may be provided by the same memory device or separate memory devices. In various examples, CPB memory <NUM> may be on-chip with other components of video decoder <NUM>, or off-chip relative to those components.

Additionally or alternatively, in some examples, video decoder <NUM> may retrieve coded video data from memory <NUM> (<FIG>). That is, memory <NUM> may store data as discussed above with CPB memory <NUM>. Likewise, memory <NUM> may store instructions to be executed by video decoder <NUM>, when some or all of the functionality of video decoder <NUM> is implemented in software to be executed by processing circuitry of video decoder <NUM>.

The various units shown in <FIG> are illustrated to assist with understanding the operations performed by video decoder <NUM>. The units may be implemented as fixed-function circuits, programmable circuits, or a combination thereof. Similar to <FIG>, fixed-function circuits refer to circuits that provide particular functionality, and are preset on the operations that can be performed. Programmable circuits refer to circuits that can be programmed to perform various tasks and provide flexible functionality in the operations that can be performed. For instance, programmable circuits may execute software or firmware that cause the programmable circuits to operate in the manner defined by instructions of the software or firmware. Fixed-function circuits may execute software instructions (e.g., to receive parameters or output parameters), but the types of operations that the fixed-function circuits perform are generally immutable. In some examples, one or more of the units may be distinct circuit blocks (fixed-function or programmable), and in some examples, the one or more units may be integrated circuits.

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

Filter unit <NUM> may perform one or more filter operations on reconstructed blocks. For example, filter unit <NUM> may perform deblocking operations to reduce blockiness artifacts along edges of the reconstructed blocks. Operations of filter unit <NUM> are not necessarily performed in all examples. In accordance with an example of this disclosure, filter unit <NUM> may apply, based on an ALF clipping index coded as a fixed-length unsigned integer, an ALF to a block of a picture of the video data.

Video decoder <NUM> may store the reconstructed blocks in DPB <NUM>. For instance, in examples where operations of filter unit <NUM> are not performed, reconstruction unit <NUM> may store reconstructed blocks to DPB <NUM>. In examples where operations of filter unit <NUM> are performed, filter unit <NUM> may store the filtered reconstructed blocks to DPB <NUM>. As discussed above, DPB <NUM> may provide reference information, such as samples of a current picture for intra-prediction and previously decoded pictures for subsequent motion compensation, to prediction processing unit <NUM>. Moreover, video decoder <NUM> may output decoded pictures from DPB <NUM> for subsequent presentation on a display device, such as display device <NUM> of <FIG>.

In this manner, video decoder <NUM> represents an example of a video decoding device including a memory configured to store video data, and one or more processing units implemented in circuitry and configured to decode an ALF clipping index as one of: a fixed-length unsigned integer, a truncated binary value, a truncated unary value, or an unsigned <NUM>-th order Exp-Golomb coded value. In other words, video decoder <NUM> may obtain an ALF clipping index syntax element from a bitstream and interpret the ALF clipping index syntax element as one of these types of data. In some examples, the ALF clipping index is a luma ALF clipping index (e.g., alf_luma_clip_idx or another syntax element) or a chroma ALF clipping index (e.g., alf_chroma_clip _idx or another syntax element). Additionally, the processing units of video decoder <NUM> may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data. For instance, filter unit <NUM> of video decoder <NUM> may apply the ALF.

<FIG> is a flowchart illustrating an example method for encoding a current block. The current block may comprise a current CU. Although described with respect to video encoder <NUM> (<FIG> and <FIG>), it should be understood that other devices may be configured to perform a method similar to that of <FIG>.

In this example, video encoder <NUM> initially predicts the current block (<NUM>). For example, video encoder <NUM> may form a prediction block for the current block. Video encoder <NUM> may then calculate a residual block for the current block (<NUM>). To calculate the residual block, video encoder <NUM> may calculate a difference between the original, unencoded block and the prediction block for the current block. Video encoder <NUM> may then transform and quantize transform coefficients of the residual block (<NUM>). Next, video encoder <NUM> may scan the quantized transform coefficients of the residual block (<NUM>). During the scan, or following the scan, video encoder <NUM> may entropy encode the transform coefficients (<NUM>). For example, video encoder <NUM> may encode the transform coefficients using CAVLC or CABAC. Video encoder <NUM> may then output the entropy encoded data of the block (<NUM>).

Additionally, in the example of <FIG>, to support prediction of subsequent blocks, video encoder <NUM> may reconstruct the current block (<NUM>). For instance, video encoder <NUM> may inverse quantize transform coefficients of the current block, apply an inverse transform to the transform coefficients to generate residual data, and add the residual data for the current block to the prediction block of the current block. Additionally, video encoder <NUM> may apply one or more filters to reconstructed blocks of the current picture (<NUM>). For instance, video encoder <NUM> may apply an ALF to reconstructed blocks of the current picture. In accordance with a technique of this disclosure, to support corresponding application of the ALF at video decoder <NUM>, video encoder <NUM> may encode an ALF clipping index. Video encoder <NUM> (e.g., filter unit <NUM> of video encoder <NUM>) may apply, based on the ALF clipping index, an ALF to a block (e.g., a reconstructed block) of the current picture. In accordance with a technique of this disclosure, video encoder <NUM> may encode the ALF clipping index as a fixed-length unsigned integer, a truncated binary value, a truncated unary value, or an unsigned <NUM>-th order Exp-Golomb coded value.

<FIG> is a flowchart illustrating an example method for decoding a current block of a current picture of video data. The current block may comprise a current CU. Although described with respect to video decoder <NUM> (<FIG> and <FIG>), it should be understood that other devices may be configured to perform a method similar to that of <FIG>.

Video decoder <NUM> may receive entropy encoded data for the current block, such as entropy encoded prediction information and entropy encoded data for transform coefficients of a residual block corresponding to the current block (<NUM>). Video decoder <NUM> may also receive non-entropy encoded data in a bitstream. Video decoder <NUM> may entropy decode the entropy encoded data to determine prediction information for the current block and to reproduce transform coefficients of the residual block (<NUM>). Video decoder <NUM> may predict the current block (<NUM>), e.g., using an intra- or inter-prediction mode as indicated by the prediction information for the current block, to calculate a prediction block for the current block. Video decoder <NUM> may then inverse scan the reproduced transform coefficients (<NUM>), to create a block of quantized transform coefficients. Video decoder <NUM> (e.g., inverse quantization unit <NUM> and inverse transform processing unit <NUM>) may then inverse quantize and inverse transform the transform coefficients to produce a residual block (<NUM>). Video decoder <NUM> may decode the current block by combining the prediction block and the residual block (<NUM>).

Additionally, in the example of <FIG>, after combining the prediction block and the residual block to reconstruct the current block, video decoder <NUM> (e.g., filter unit <NUM> of video decoder <NUM>) may apply one or more filters to reconstructed blocks of the current picture (<NUM>). For instance, video decoder <NUM> may apply an ALF to reconstructed blocks of the current picture. Video decoder <NUM> may decode an ALF clipping index and apply, based on the ALF clipping index, an ALF to a block (e.g., a reconstructed block) of the current picture. In accordance with a technique of this disclosure, video decoder <NUM> may decode the ALF clipping index as a fixed-length unsigned integer, a truncated binary value, a truncated unary value, or an unsigned <NUM>-th order Exp-Golomb coded value.

<FIG> is a flowchart illustrating an example operation for coding video data in accordance with one or more techniques of this disclosure. In the example of <FIG>, a video coder (e.g., video encoder <NUM> or video decoder <NUM>) may code (e.g., encode or decode) an Adaptive Loop Filter (ALF) clipping index as a fixed-length unsigned integer (<NUM>). For example, when the video coder is a video encoder such as video encoder <NUM>, the video encoder may encode the ALF clipping index by including a fixed-length unsigned integer representing the ALF clipping index in a bitstream. In an example where the video coder is a video decoder such as video decoder <NUM>, the video decoder may decode the ALF clipping index by parsing the fixed-length unsigned integer representing the ALF clipping index from the bitstream.

Furthermore, in the example of <FIG>, the video coder may apply, based on the ALF clipping index, an ALF to a block of a picture of the video data (<NUM>). For example, the video coder may use the ALF clipping index to look up or calculate a set of clipping values (e.g., - c(k, l) and c(k, l)), e.g., using equation (<NUM>') or equation (<NUM>"), above. The video coder may then use the set of clipping values in applying an ALF to reconstructed samples of the block (e.g., as shown in equation (<NUM>), above). The video coder may apply the ALF as part of action <NUM> of <FIG> or action <NUM> of <FIG>. The ALF clipping index may be a luma ALF clipping index (e.g., alf_luma_clip_idx), in which case the video coder uses the luma ALF clipping index to determine clipping values for use in applying an ALF to luma samples. In some examples, the ALF clipping index is a luma ALF clipping index, in which case the video coder uses the luma ALF clipping index (e.g., alf_chroma_clip_idx) to determine clipping values for use in applying an ALF to luma samples. Applying an ALF to a block (e.g., a <NUM>×<NUM> block) of a picture may including determining ALF filter coefficients for the block, using the ALF clipping index to determine clipping values for at least one sample of the block, and using the clipping values and ALF filter coefficients, e.g., as described in equation (<NUM>).

Furthermore, in some examples, the video coder may code a luma ALF clipping index as a first fixed-length unsigned integer and may code a chroma ALF clipping index as a second fixed-length unsigned integer. In such examples, the video coder may apply, based on the luma ALF clipping index, an ALF to a luma block of the picture and may apply, based on the chroma ALF clipping index, an ALF to a chroma block of the picture.

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 circuitry. Accordingly, the terms "processor" and "processing circuity," as used herein may refer to any of the foregoing structures or any other structure suitable for implementation of the techniques described herein.

Claim 1:
A method of coding video data, the method comprising:
for each respective location in a plurality of locations in a filter support, coding an adaptive loop filter, ALF, clipping index for the respective location in the filter support as a fixed-length unsigned integer regardless of a value of a corresponding filter coefficient of an ALF (<NUM>) including when said coefficient value is equal to zero, wherein the corresponding filter coefficient of the ALF is a filter coefficient for the respective location in the filter support; and
applying the ALF to a block of a picture of the video data (<NUM>), wherein applying the ALF to the block comprises, for each respective sample of the block:
for each respective location in the plurality of locations in the filter support:
using the ALF clipping index for the respective location in the filter support to determine a set of clipping values for the respective location in the filter support;
using the clipping values for the respective location in the filter support to clip a value for a sample at the respective location in the filter support, wherein the clipping values for the respective location in the filter support specify an upper limit and a lower limit on the value for the sample at the respective location in the filter support; and
generating a multiplication product for the respective location in the filter support by multiplying the clipped value for the sample at the respective location in the filter support by the filter coefficient for the respective location in the filter support; and
determining a filtered value for the respective sample of the block based on a value of the respective sample of the block and a sum of the multiplication products for the plurality of locations in the filter support.