Methods, apparatus, and media for encoding video data

By applying bit-depth-based truncation operations in an adaptive loop filter to filter the luminance and chrominance samples of video frames, the problem of balancing encoding/decoding efficiency and image quality in existing technologies is solved, achieving more efficient video data processing.

CN118869993BActive Publication Date: 2025-11-07BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410884188.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-28
Filing Date
2020-12-28
Publication Date
2025-11-07
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

Existing video encoding and decoding technologies struggle to achieve higher efficiency while maintaining image quality, especially in the application of Adaptive Loop Filters (ALF), where they cannot effectively improve the encoding and decoding efficiency of chroma and luminance components.

Method used

By applying a bit-depth-based truncation operation in the Adaptive Loop Filter (ALF), each luminance and chrominance sample of the video frame is filtered. The difference between the image samples is truncated using the filter length and filter coefficients. The image samples are then modified based on the corresponding truncation value index and a predefined truncation boundary value formula.

Benefits of technology

It improves the encoding and decoding efficiency and image quality of video frames, enhances the filtering effect of the adaptive loop filter, and achieves more efficient video data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118869993B_ABST
    Figure CN118869993B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and medium for encoding video data. The method comprises: obtaining a plurality of coding tree units divided from a video frame; for a coding tree unit in the plurality of coding tree units, obtaining a plurality of image samples, each image sample corresponding to one of a luma sample and a chroma sample; for each of the plurality of image samples, filtering the corresponding image sample using an adaptive loop filter having a filter length L and a set of filter coefficients.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of China Patent Application No. 202080097101.9, which is the China national phase entry of International Patent Application PCT / US2020 / 067159, filed December 28, 2020, which claims priority to U.S. Patent Application No. 62 / 954,485, filed December 28, 2019. TECHNICAL FIELD

[0002] The present application relates generally to video data coding and compression, and in particular to methods and systems for improving coding of chroma and luma components of image frames in a video data bitstream. BACKGROUND

[0003] Digital video is supported by a variety of electronic devices, such as digital televisions, laptop or desktop computers, tablet computers, digital cameras, digital recording devices, digital media players, video gaming consoles, smartphones, video teleconferencing devices, video streaming devices, etc. The electronic devices transmit, receive, encode, decode, and / or store digital video data by implementing video compression / decompression standards defined by MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4, Part 10, Advanced Video Coding (AVC), High Efficiency Video Coding (HEVC), and Versatile Video Coding (VVC) standards. Video compression typically includes performing spatial (intra-frame) prediction and / or temporal (inter-frame) prediction to reduce or remove redundancy inherent in video data. For block-based video coding, video frames are partitioned into one or more slices, each slice having multiple video blocks, which can also be referred to as coding tree units (CTUs). Each CTU can contain one coding unit (CU) or recursively split into smaller CUs until a predefined minimum CU size is reached. Each CU (also referred to as a leaf CU) contains one or more transform units (TUs) and each CU also contains one or more prediction units (PUs). Each CU can be coded in intra, inter, or IBC modes. Video blocks in intra coded (I) slices of a video frame are encoded using spatial prediction relative to reference samples in neighboring blocks within the same video frame. Video blocks in inter coded (P or B) slices of a video frame can be encoded using spatial prediction relative to reference samples in neighboring blocks within the same video frame or temporal prediction relative to reference samples in other reference video frames.

[0004] A prediction block for the current video block to be coded is generated based on spatial or temporal prediction of a previously coded reference block, e.g., a neighboring block. The process of finding the reference block can be done by block matching algorithms. The residual data representing the pixel difference between the current block to be coded and the prediction block is referred to as the residual block or prediction error. An inter coded block is coded according to the motion vector pointing to the reference block in the reference frame from which the prediction block is formed, and the residual block. The process of determining the motion vector is typically referred to as motion estimation. An intra coded block is coded according to an intra prediction mode and the residual block. For further compression, the residual block is transformed from the pixel domain to the transform domain, e.g., the frequency domain, resulting in residual transform coefficients, which can then be quantized. The quantized transform coefficients, which are initially arranged in a two-dimensional array, can be scanned into a one-dimensional vector and then entropy coded into the video bitstream for even more compression.

[0005] The coded video bitstream is then saved in a computer-readable storage medium, such as a flash memory, to be accessed by another electronic device with digital video capabilities, or directly transmitted, wired or wirelessly, to the electronic device. The electronic device then performs video decompression (which is the inverse process of the video compression described above) by, e.g., parsing the coded video bitstream to obtain syntax elements from the bitstream and reconstructing the digital video data from the coded video bitstream into its original format based at least in part on the syntax elements obtained from the bitstream, and renders the reconstructed digital video data on a display of the electronic device.

[0006] Loop filtering is applied to the reconstructed video blocks before they are put into the reference picture store and used to code other video blocks. An adaptive loop filter (ALF) is applied to the chroma and luma components of a reconstructed video block, respectively. It would be beneficial to have a more efficient coding mechanism to encode and decode these color components while maintaining the image quality of the decoded video data. SUMMARY

[0007] This application describes implementations related to video data encoding and decoding, and more specifically, describes methods and systems to improve the coding of luma and chroma samples of a video frame by applying a bit-depth based clipping operation in adaptive loop filtering. Each luma or chroma sample of a video frame is filtered based on a number of surrounding luma or chroma samples according to a respective adaptive loop filter (ALF) scheme. For each of the luma or chroma samples, the difference between the relevant image samples and the respective sample is clipped into a respective dynamic range defined by a clipping boundary value, which is equal to a respective power of 2 raised to a respective number of clipping.

[0008] In one aspect, a method of video data coding includes obtaining, from a bitstream, a plurality of picture samples of a video frame. Each picture sample corresponds to one of a luma sample and a chroma sample. The method further includes, for each of the plurality of picture samples, filtering the respective picture sample using an adaptive loop filter having a filter length and a set of filter coefficients. Filtering the respective picture sample further includes identifying, in the filter length of the respective picture sample, a set of related picture samples; identifying, for each of the set of related picture samples, a respective clipping value index and a corresponding filter coefficient; clipping, based on the respective clipping value index, a difference of each of the set of related picture samples from the respective picture sample; and modifying the respective picture sample with the clipped difference of each of the set of related picture samples based on the respective filter coefficient. For each picture sample, the respective clipping value index corresponds to a respective clipping boundary value equal to a respective clipping power of two, and the respective clipping power is an integer. The method further includes reconstructing the video frame using the plurality of modified picture samples.

[0009] In some embodiments, for each picture sample, the difference of each related picture sample from the respective picture sample is clipped by determining an IBDI of the respective picture sample; for each of the set of related picture samples, determining a respective clipping boundary value based on the IBDI and the respective clipping value index according to a predefined clipping boundary value formula or table, and clipping the difference of each of the set of related picture samples from the respective picture sample based on the respective clipping boundary value. Further, in some embodiments, the predefined clipping boundary value formula or table is locally stored in both a video encoder and a video decoder. For each picture sample, the clipping value index of the related picture sample is obtained from a bitstream.

[0010] In another aspect, an electronic device includes one or more processors and memory storing instructions that, when executed by the one or more processors, cause the electronic device to perform the method of video data coding as described above.

[0011] In yet another aspect, a non-transitory computer-readable storage medium stores instructions having stored thereon, which, when executed by one or more processors of an electronic device, cause the one or more processors to perform the method of video data coding as described above. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings, included to provide a further understanding of the implementations and are incorporated in and constitute a part of this specification, illustrate the described implementations and together with the description serve to explain the basic principles. Like reference numerals refer to corresponding parts throughout.

[0013] Figure 1is a block diagram illustrating an exemplary video encoding and decoding system, in accordance with some embodiments.

[0014] Figure 2 is a block diagram illustrating an exemplary video encoder, in accordance with some embodiments.

[0015] Figure 3 is a block diagram illustrating an exemplary video decoder, in accordance with some embodiments.

[0016] Figures 4A to 4E is a schematic diagram of recursively partitioning an image frame into video blocks of different sizes and shapes, in accordance with some embodiments.

[0017] Figure 5 illustrates a portion of a video frame in a bitstream, in accordance with some embodiments.

[0018] Figure 6 is a block diagram of an in-loop filter applied in a video encoder or decoder, in accordance with some embodiments.

[0019] Figure 7A is an example ALF filtering scheme in which a luma ALF processes a luma sample based on a set of related luma samples, in accordance with some embodiments, and Figure 7B is an example ALF filtering scheme in which a chroma ALF processes a chroma sample based on a set of related chroma samples, in accordance with some embodiments.

[0020] Figure 8 is an example ALF filtering scheme having a set of related image samples for each image sample in a block of an image frame, in accordance with some embodiments.

[0021] Figures 9A to 9C are three example pre-defined clipping boundary value tables, in accordance with some embodiments.

[0022] Figure 10 is a data structure for a value to which an image sample is to be clipped, in accordance with some embodiments.

[0023] Figure 11 is a flowchart of a video coding method, in accordance with some embodiments. DETAILED DESCRIPTION

[0024] Reference will now be made in detail to the specific implementations, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth in order to help understand the subject matter presented herein. But it will be apparent to one of ordinary skill in the art that the subject matter can be practiced without these specific details, and that numerous alternative implementations can be used. For example, it will be apparent to one of ordinary skill in the art that the subject matter presented herein can be implemented on many types of electronic devices having digital video capabilities.

[0025] Figure 1 FIG. 1 is a block diagram illustrating an example system 10 for encoding and decoding video blocks in parallel, in accordance with some embodiments. As shown, system 10 includes a source device 12 that generates and encodes video data for decoding at a later time by a destination device 14. Source device 12 and destination device 14 can comprise any of a variety of electronic devices, including desktop or laptop computers, tablet computers, smart phones, set-top boxes, digital televisions, cameras, display devices, digital media players, video gaming consoles, video streaming devices, etc. In some implementations, source device 12 and destination device 14 are equipped with wireless communication capability. Figure 1

[0026] In some implementations, destination device 14 can receive encoded video data to be decoded via a link 16. Link 16 can comprise any type of communication medium or device capable of transmitting encoded video data from source device 12 to destination device 14. In one example, link 16 can comprise a communication medium to enable source device 12 to transmit encoded video data directly to destination device 14 in real-time. The encoded video data can be modulated according to a communication standard, such as a wireless communication protocol, and transmitted to destination device 14. The communication medium can comprise any wireless or wired communication medium, such as a radio frequency (RF) spectrum or one or more physical transmission lines. The communication medium can form part of a packet-based network, such as a local area network, a wide-area network, or a global network such as the Internet. The communication medium can include routers, switches, base stations, or any other equipment that can be useful to facilitate communication from source device 12 to destination device 14.

[0027] ​In some other implementations, the encoded video data can be transmitted from output interface 22 to storage device 32. Subsequently, the encoded video data in storage device 32 can be accessed by destination device 14 via input interface 28. Storage device 32 can 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 32 can correspond to a file server or another intermediate storage device that can hold the encoded video data generated by source device 12. Destination device 14 can access stored video data from storage device 32 via streaming or download. The file server can be any type of computer capable of storing encoded video data and transmitting that encoded video data to destination device 14. Exemplary file servers include a web server (e.g., for a website), an FTP server, network attached storage (NAS) devices, or a local disk drive. Destination device 14 can access the encoded video data through any standard data connection, including a wireless channel (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 the encoded video data from storage device 32 can be a streaming transmission, a download transmission, or a combination of both.

[0028] As shown in Figure 1 Source device 12 includes video source 18, video encoder 20, and output interface 22. Video source 18 can 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. As one example, if video source 18 is a video camera of a security surveillance system, source device 12 and destination device 14 can form a photograph or video telephone. However, the implementations described in the present application can be applied to video coding in general, and can have application to wireless and / or wired applications.

[0029] The captured, pre-captured, or computer-generated video can be encoded by video encoder 20. The encoded video data can be transmitted directly to destination device 14 via output interface 22 of source device 12. The encoded video data can also (or alternatively) be stored onto storage device 32 for later access by destination device 14 or other devices, for decoding and / or playback. Output interface 22 can further include a modem and / or a transmitter.

[0030] Destination device 14 includes input interface 28, video decoder 30, and display device 34. Input interface 28 can include a receiver and / or a modem and receive encoded video data over link 16. The encoded video data communicated over link 16, or provided on storage device 32, can include a variety of syntax elements generated by video encoder 20 for use in decoding the video data by video decoder 30. Such syntax elements can be included with the encoded video data transmitted on a communication medium, stored on a storage medium, or stored on a file server.

[0031] In some implementations, destination device 14 can include a display device 34, which can be an integrated display device and an external display device configured to communicate with destination device 14. Display device 34 displays the decoded video data to a user and can comprise 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.

[0032] Video encoder 20 and video decoder 30 can operate according to a proprietary or industry standard, such as VVC, HEVC, MPEG-4, Part 10, Advanced Video Coding (AVC), or extensions of such standards. It should be understood that the present application is not limited to a specific video encoding / decoding standard and can be applicable to other video encoding / decoding standards. In general, it is contemplated that video encoder 20 of source device 12 can be configured to encode video data according to any of these current or future standards. Similarly, it is also generally contemplated that video decoder 30 of destination device 14 can be configured to decode video data according to any of these current or future standards.

[0033] Video encoder 20 and video decoder 30 each can be implemented as any of a variety of suitable encoder 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. When implemented partially in software, an electronic device can store instructions for the software in a suitable, non- transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the video encoding / decoding operations disclosed in the present disclosure. Each of video encoder 20 and video decoder 30 can be included in one or more encoders or decoders, either of which can be integrated as part of a combined encoder / decoder (CODEC) in a respective device.

[0034] Figure 2is a block diagram illustrating an exemplary video encoder 20, in accordance with some embodiments described in this application. Video encoder 20 can perform intra-prediction encoding and inter-prediction encoding of video blocks within a video frame. Intra-prediction encoding relies on spatial prediction to reduce or remove spatial redundancy of video data within a given video frame or picture. Inter-prediction encoding relies on temporal prediction to reduce or remove temporal redundancy of video data within neighboring video frames or pictures of a video sequence.

[0035] As shown in Figure 2 Video encoder 20 includes video data memory 40, prediction processing unit 41, decoded picture buffer (DPB) 64, summer 50, transform processing unit 52, quantization unit 54, and entropy encoding unit 56. Prediction processing unit 41 further includes motion estimation unit 42, motion compensation unit 44, partition unit 45, intra-prediction processing unit 46, and intra-block copy (BC) unit 48. In some embodiments, video encoder 20 also includes inverse quantization unit 58, inverse transform processing unit 60, and summer 62 for video block reconstruction. In-loop filter 66 can be located between summer 62 and DPB 64 and includes a deblocking filter to filter block boundaries and remove blockiness artifacts from reconstructed video. In-loop filter 66 further includes a sample adaptive offset (SAO) and an adaptive loop filter (ALF) to filter the output of summer 62 before it is placed into DPB 64 and used to code other video blocks. Video encoder 20 can take the form of fixed or programmable hardware units, or can be partitioned among one or more of the illustrated fixed or programmable hardware units.

[0036] Video data memory 40 can store video data to be encoded by the components of video encoder 20. The video data in video data memory 40 can be obtained, for example, from video source 18. DPB 64 is a buffer that stores reference video data for use in encoding video data by video encoder 20 (e.g., in intra-prediction encoding mode or inter-prediction encoding mode). Video data memory 40 and DPB 64 can be formed by any of a wide variety of memory devices. In various examples, video data memory 40 can be on-chip with other components of video encoder 20, or off-chip relative to those components.

[0037] As shown in Figure 2As shown, partition unit 45 within prediction processing unit 41 partitions the video data into video blocks after the video data is received. This partitioning can also include partitioning of video frames into slices, tiles, or other larger coding units (CUs) according to a predefined partitioning structure, such as a quadtree structure associated with the video data. Video frames can be partitioned into a plurality of video blocks (or sets of video blocks referred to as tiles). Prediction processing unit 41 can select one of a plurality of possible predictive encoding modes, such as one of a plurality of intra-predictive encoding modes or one of a plurality of inter-predictive encoding modes, for the current video block based on error results (e.g., rate and distortion levels). Prediction processing unit 41 can provide the resulting intra- or inter-predicted block to summer 50 to generate a residual block, and to summer 62 to reconstruct the encoded block for use as part of a reference frame at a later time. Prediction processing unit 41 also provides syntax elements, such as motion vectors, intra-mode indicators, partition information, and other such syntax information to entropy encoding unit 56.

[0038] To select an appropriate intra-predictive encoding mode for a current video block, intra-prediction processing unit 46 within prediction processing unit 41 can perform intra-predictive encoding of the current video block relative to one or more neighboring blocks in the same frame as the current block being coded to provide spatial prediction. Motion estimation unit 42 and motion compensation unit 44 within prediction processing unit 41 perform inter-predictive encoding of the current video block relative to one or more prediction blocks in one or more reference frames to provide temporal prediction. Video encoder 20 can perform multiple encoding passes, e.g., to select an appropriate encoding mode for each block of video data.

[0039] In some implementations, motion estimation unit 42 determines an inter-prediction mode for a current video frame by generating a motion vector that indicates a displacement of a prediction unit (PU) of a video block within the current video frame relative to a prediction block within a reference video frame according to a predetermined pattern within a sequence of video frames. Motion estimation performed by motion estimation unit 42 is a process of generating motion vectors that estimates the movement of video blocks. A motion vector, for example, can indicate a displacement of a PU of a video block within a current video frame or picture relative to a prediction block (or other coded unit) within a reference frame that is relative to the current block (or other coded unit) being coded within the current frame. The predetermined pattern can designate video frames in the sequence as P-frames or B-frames. Intra-BC unit 48 can determine vectors, e.g., block vectors, for intra-BC encoding in a similar manner as motion vectors are determined by motion estimation unit 42 for inter-prediction, or can utilize motion estimation unit 42 to determine block vectors.

[0040] A prediction block is a block of a reference frame that is deemed to closely match a PU of a video block to be coded in terms of pixel differences, which can be determined by sum of absolute differences (SAD), sum of squared differences (SSD), or other difference metrics. In some implementations, video encoder 20 can calculate values for sub-integer pixel positions of reference frames stored in DPB 64. For example, video encoder 20 can interpolate values for quarter-pel positions, eighth-pel positions, or other fractional-pel positions of reference frames. Thus, motion estimation unit 42 can perform a motion search with respect to both integer-pel positions and fractional-pel positions and output motion vectors with fractional-pel precision.

[0041] Motion estimation unit 42 calculates motion vectors for PUs of a video block in an inter-predicted coded frame by comparing the location of the PUs to the location of a prediction block of a reference frame selected from a first reference frame list (List 0) or a second reference frame list (List 1), each of which identifies one or more reference frames stored in DPB 64. Motion estimation unit 42 sends the calculated motion vectors to motion compensation unit 44 and then to entropy encoding unit 56.

[0042] Motion compensation performed by motion compensation unit 44 can involve retrieving or generating a prediction block based on the motion vectors determined by motion estimation unit 42. Upon receiving the motion vectors for the PUs of a current video block, motion compensation unit 44 can locate the prediction block pointed to by the motion vectors in one of the reference frame lists, retrieve the prediction block from DPB 64, and forward the prediction block to summer 50. Summer 50 then forms a residual video block of pixel difference values by subtracting the pixel values of the prediction block supplied by motion compensation unit 44 from the pixel values of the current video block being coded. The pixel difference values forming the residual video block can include luma difference components or chroma difference components, or both. Motion compensation unit 44 can also generate syntax elements associated with the video block of the video frame for use by video decoder 30 when decoding the video block of the video frame. The syntax elements can include, for example, syntax elements defining motion vectors for identifying the prediction block, any flags indicating the mode of prediction, or any other syntax information described herein. Note that motion estimation unit 42 and motion compensation unit 44 can be highly integrated, but are shown separately for conceptual purposes.

[0043] In some implementations, intra BC unit 48 can generate vectors and obtain prediction blocks in a manner similar to that described above in connection with motion estimation unit 42 and motion compensation unit 44, but where the prediction blocks are in the same frame as the current block being coded, and where the vectors are referred to as block vectors relative to the motion vectors. In particular, intra BC unit 48 can determine an intra prediction mode for use in coding the current block. In some examples, intra BC unit 48 can code the current block using various intra prediction modes, e.g., during a separate encoding pass, and test their performance through a rate-distortion analysis. Next, intra BC unit 48 can select an appropriate intra prediction mode to use among the various tested intra prediction modes and generate an intra mode indicator accordingly. For example, intra BC unit 48 can use the rate-distortion analysis for the various tested intra prediction modes to compute rate-distortion values and select the intra prediction mode with the best rate-distortion characteristics among the tested modes as the appropriate intra prediction mode to use. The rate-distortion analysis generally determines the amount of distortion (or error) between the coded block and the original uncoded block (coded to produce the coded block) and the bit rate (i.e., number of bits) used to produce the coded block. Intra BC unit 48 can compute a ratio of the distortion and the rate for the various coded blocks to determine which intra prediction mode exhibits the best rate-distortion value for the block.

[0044] In other examples, intra BC unit 48 can use motion estimation unit 42 and motion compensation unit 44, in whole or in part, to perform such functionality for intra BC prediction according to the implementations described herein. In either case, for intra block copy, the prediction block can be a block that is considered to closely match the block to be coded in terms of pixel differences, which can be determined by sum of absolute differences (SAD), sum of squared differences (SSD), or other difference metrics, and the identification of the prediction block can include computing values for sub-integer pixel positions.

[0045] Regardless of whether the prediction block is from the same frame according to intra prediction or from a different frame according to inter prediction, video encoder 20 can form a residual video block by subtracting pixel values of the prediction block from pixel values of the current video block being coded, thereby forming pixel difference values. The pixel difference values forming the residual video block can include luma component differences and chroma component differences.

[0046] As described above, intra prediction processing unit 46 can perform intra prediction on the current video block as an alternative to inter prediction performed by motion estimation unit 42 and motion compensation unit 44, or intra block copy prediction performed by intra BC unit 48. In particular, intra prediction processing unit 46 can determine an intra prediction mode to use for encoding the current block. To this end, intra prediction processing unit 46 can encode the current block using various intra prediction modes, e.g., during a separate encoding pass, and intra prediction processing unit 46 (or, in some examples, a mode selection unit) can select an appropriate intra prediction mode to use from among the tested intra prediction modes. Intra prediction processing unit 46 can provide information indicative of the selected intra prediction mode for the block to entropy encoding unit 56. Entropy encoding unit 56 can encode the information indicative of the selected intra prediction mode in the bitstream.

[0047] After prediction processing unit 41 determines the predictive block for the current video block via either inter prediction or intra prediction, summer 50 forms a residual video block by subtracting the predictive block from the current video block. The residual video data in the residual block can be included in one or more transform units (TUs) and is provided to transform processing unit 52. Transform processing unit 52 transforms the residual video data into residual transform coefficients using a transform such as a discrete cosine transform (DCT) or a conceptually similar transform.

[0048] Transform processing unit 52 can send the resulting transform coefficients to quantization unit 54. Quantization unit 54 quantizes the transform coefficients to further reduce bit rate. The quantization process can also reduce the bit depth associated with some or all of the coefficients. The degree of quantization can be modified by adjusting a quantization parameter. In some examples, quantization unit 54 can then perform a scan of the matrix including the quantized transform coefficients. Alternatively, entropy encoding unit 56 can perform the scan.

[0049] Following quantization, entropy encoding unit 56 entropy encodes the quantized transform coefficients using, for example, 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 other entropy encoding methods or techniques. The encoded bits can then be transmitted to video decoder 30, or archived on storage device 32 for later transmission to or retrieval by video decoder 30. Entropy encoding unit 56 can also entropy encode motion vectors and other syntax elements for the encoded current video frame.

[0050] The inverse quantization unit 58 and the inverse transform processing unit 60 apply inverse quantization and inverse transform, respectively, to reconstruct the residual video block in the pixel domain to generate a reference block used to predict other video blocks. As described above, the motion compensation unit 44 can generate a motion- compensated predicted block from one or more reference blocks stored in the DPB 64. The motion compensation unit 44 can also apply one or more interpolation filters to the predicted block to calculate sub-integer pixel values for use in motion estimation.

[0051] The summer 62 adds the reconstructed residual block to the motion-compensated predicted block produced by the motion compensation unit 44 to produce a reference block for storage in the DPB 64. The reference block can then be used by the intra BC unit 48, the motion estimation unit 42, and the motion compensation unit 44 as a prediction block to inter predict another video block in a subsequent video frame.

[0052] Figure 3 FIG. 1 is a block diagram illustrating an example video decoder 30 according to some embodiments of the present application. The video decoder 30 includes a video data memory 79, an entropy decoding unit 80, a prediction processing unit 81, an inverse quantization unit 86, an inverse transform processing unit 88, a summer 90, and a DPB 92. The prediction processing unit 81 further includes a motion compensation unit 82, an intra prediction processing unit 84, and an intra BC unit 85. The video decoder 30 can perform decoding processes generally reciprocal to those performed by the video encoder 20 described above in connection with FIG. 1. Figure 2 The decoding processes described in relation to the video encoder 20 are reversed. For example, the motion compensation unit 82 can generate prediction data based on motion vectors received from the entropy decoding unit 80, while the intra prediction unit 84 can generate prediction data based on intra prediction mode indicators received from the entropy decoding unit 80.

[0053] In some examples, the units of the video decoder 30 can be assigned tasks to perform embodiments of the present application. Also, in some examples, embodiments of the present disclosure can be divided among one or more units of the video decoder 30. For example, the intra BC unit 85 can perform embodiments of the present application alone or in combination with other units of the video decoder 30, such as the motion compensation unit 82, the intra prediction processing unit 84, and the entropy decoding unit 80. In some examples, the video decoder 30 can not include the intra BC unit 85, and the functions of the intra BC unit 85 can be performed by other components of the prediction processing unit 81, such as the motion compensation unit 82.

[0054] Video data storage 79 can store video data, such as encoded video bitstreams, to be decoded by other components of video decoder 30. The video data stored in video data storage 79 can be obtained, for example, from storage device 32 via wired or wireless network transmission, from a local video source such as a camera, by accessing a physical data storage medium, e.g., a flash drive or hard disk, or by any other suitable technique. Video data storage 79 can include a coded picture buffer (CPB) that stores encoded video data from an encoded video bitstream. Decoded picture buffer (DPB) 92 of video decoder 30 stores reference video data for use in decoding video data by video decoder 30 (e.g., in intra- or inter-coding modes). Video data storage 79 and DPB 92 can be formed by any of a variety of memory devices, such as dynamic random access memory (DRAM), including synchronous DRAM (SDRAM), magneto resistive RAM (MRAM), resistive RAM (RRAM), or other types of memory devices. For Figure 3 illustrative purposes, video data storage 79 and DPB 92 are depicted as two distinct components of video decoder 30. But it will be readily apparent to one of ordinary skill in the art that video data storage 79 and DPB 92 can be provided by the same memory device or separate memory devices. In some examples, video data storage 79 can be on-chip with other components of video decoder 30, or off-chip relative to those components.

[0055] During the decoding process, video decoder 30 receives an encoded video bitstream that represents encoded video frames and associated syntax elements. Video decoder 30 can receive the syntax elements at the video frame level and / or video block level. Entropy decoding unit 80 of video decoder 30 entropy decodes the bitstream to generate quantized coefficients, motion vectors, or intra-prediction mode indicators, and other syntax elements. Entropy decoding unit 80 then forwards the motion vectors and other syntax elements to prediction processing unit 81.

[0056] When a video frame is coded as an intra-predicted (I) frame or intra-coded prediction blocks in other types of frames, intra-prediction processing unit 84 of prediction processing unit 81 can generate prediction data for a video block of the current video frame based on a signaled intra-prediction mode and reference data from previously decoded blocks of the current frame.

[0057] When a video frame is coded as an inter prediction coded (i.e., B or P) frame, motion compensation unit 82 of prediction processing unit 81 generates one or more prediction blocks for a video block of the current video frame based on the motion vectors and other syntax elements received from entropy decoding unit 80. Each prediction block can be generated from a reference frame within one of the reference frame lists. Video decoder 30 can construct the reference frame lists: List 0 and List 1, using default construction techniques based on the reference frames stored in DPB 92.

[0058] In some examples, when a video block is coded according to the intra BC modes described herein, intra BC unit 85 of prediction processing unit 81 generates a prediction block for the current video block based on block vectors and other syntax elements received from entropy decoding unit 80. The prediction block can be within a reconstructed region of the same picture as the current video block defined by video encoder 20.

[0059] Motion compensation unit 82 and / or intra BC unit 85 determine the prediction information for a video block of the current video frame by parsing the motion vectors and other syntax elements, and then use the prediction information to generate the prediction block for the decoded current video block. For example, motion compensation unit 82 uses some of the received syntax elements to determine the prediction mode used to code the video block of the video frame (e.g., intra prediction or inter prediction), the inter prediction frame type (e.g., B or P), the construction information for one or more of the reference frame lists for the frame, the motion vectors for each inter prediction coded video block of the frame, the inter prediction status for each inter prediction coded video block of the frame, and other information used to decode the video block in the current video frame.

[0060] Similarly, intra BC unit 85 can use some of the received syntax elements (e.g., flags) to determine that the current video block is predicted using the intra BC mode, the construction information for the frame’s video blocks to be stored in DPB 92 and be within a reconstructed region, the block vectors for each intra BC predicted video block of the frame, the intra BC prediction status for each intra BC predicted video block of the frame, and other information used to decode the video block in the current video frame.

[0061] Motion compensation unit 82 can also perform interpolation to calculate interpolated values for sub-integer pixels of a reference block using an interpolation filter as used by video encoder 20 during encoding of the video block. In this case, motion compensation unit 82 can determine the interpolation filter used by video encoder 20 from the received syntax elements and use the interpolation filter to generate the prediction block.

[0062] The dequantization unit 86 dequantizes the transform coefficients, which are provided in the bitstream and entropy decoded by the entropy decoding unit 80, using the same quantization parameters calculated by the video encoder 20 for each video block in the video frame to determine the degree of quantization. The inverse transform processing unit 88 applies an inverse transform (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to reconstruct the residual block in the pixel domain.

[0063] After the motion compensation unit 82 or the intra-frame BC unit 85 generates a prediction block for the current video block based on vectors and other syntax elements, the adder 90 reconstructs the decoded video block of the current video block by summing the residual block from the inverse transform processing unit 88 and the corresponding prediction block generated by the motion compensation unit 82 and the intra-frame BC unit 85. A loop filter 94 may be located between the adder 90 and the DPB 92 and includes a deblocking filter to filter block boundaries and remove block artifacts from the decoded video block. The loop filter 94 further includes a SAO filter and an ALF to filter the decoded video block output by the adder 90. The decoded video block in a given frame is then stored in the DPB 92, which stores reference frames for subsequent motion compensation of the next video block. The DPB 92 or a separate memory device may also store the decoded video for later presentation in a format such as... Figure 1 Display devices such as 34.

[0064] In a typical video encoding and decoding process, a video sequence typically consists of an ordered set of frames or images. Each frame may include three sample arrays, denoted as SL, SCb, and SCr. SL is a two-dimensional array of luma samples. SCb is a two-dimensional array of chroma samples (Cb). SCr is a two-dimensional array of chroma samples (Cr). In other instances, a frame may be monochromatic and therefore consist of only a two-dimensional array of luma samples.

[0065] like Figure 4A As shown, the video encoder 20 (or more specifically, the partitioning unit 45) generates an encoded representation of a frame by first dividing the frame into a set of coding tree units (CTUs). A video frame may include an integer number of CTUs ordered consecutively from left to right and from top to bottom in raster scan order. Each CTU is the largest logical coding unit, and the width and height of the CTU are signaled by the video encoder 20 in the sequence parameter set such that all CTUs in the video sequence have the same size, namely one of 128×128, 64×64, 32×32, and 16×16. However, it should be noted that this application is not limited to a specific size. Figure 4BAs shown, each CTU can include one coding tree block (CTB) of luma samples, two corresponding coding tree blocks of chroma samples, and syntax elements used to code the samples of the coding tree blocks. The syntax elements describe properties of different types of units of the coded blocks of pixels and how the video sequence can be reconstructed at the video decoder 30, including inter or intra prediction, intra prediction modes, motion vectors, and other parameters. In monochrome pictures or pictures having three separate color planes, a CTU can include a single coding tree block and syntax elements used to code the samples of the coding tree block. A coding tree block can be an NxN block of samples.

[0066] To achieve better performance, the video encoder 20 can recursively perform tree partitioning, such as binary tree partitioning, ternary tree partitioning, quad tree partitioning, or a combination of the two, on the coding tree blocks of a CTU and divide the CTU into smaller coding units (CUs). As Figure 4C As depicted, a 64x64 CTU 400 is first divided into four smaller CUs, each having a block size of 32x32. Among the four smaller CUs, CUs 410 and 420 are each divided into four 16x16 CUs by block size. Two 16x16 CUs 430 and 440 are each further divided into four 8x8 CUs by block size. Figure 4D The final result of the partitioning process of the CTU 400 as depicted in FIG. 4 is illustrated by the quad tree data structure depicted in FIG. 5, where each leaf node of the quad tree corresponds to one CU having a size in the range of 32x32 to 8x8. Similar to the binary tree data structure depicted in FIG. 3, each node of the quad tree data structure can be associated with a syntax element indicating the type of partitioning applied to the corresponding CU. Figure 4C The final result of the partitioning process of the CTU 400 as depicted in FIG. 4 is illustrated by the quad tree data structure depicted in FIG. 5, where each leaf node of the quad tree corresponds to one CU having a size in the range of 32x32 to 8x8. Similar to the binary tree data structure depicted in FIG. 3, each node of the quad tree data structure can be associated with a syntax element indicating the type of partitioning applied to the corresponding CU. Figure 4B As depicted, each CU can include a coding block (CB) of luma samples and two corresponding coding blocks of chroma samples of the same size of the frame, and syntax elements used to code the samples of the coding blocks. In monochrome pictures or pictures having three separate color planes, a CU can include a single coding block and syntax elements used to code the samples of the coding block. It should be noted that Figure 4C and Figure 4D The quad tree partitioning as depicted in FIG. 5 is for illustration purposes only and one CTU can be split into multiple CUs to adapt to different local characteristics based on quad tree / ternary tree / binary tree partitioning. In a multi-type tree structure, one CTU is partitioned by a quad tree structure and each quad tree leaf CU can be further partitioned by a binary tree structure or a ternary tree structure. As Figure 4E As shown, there are five types of partitioning, namely, quad partitioning, horizontal binary partitioning, vertical binary partitioning, horizontal ternary partitioning, and vertical ternary partitioning.

[0067] In some implementations, video encoder 20 can further partition the coding block of a CU into one or more MxN prediction blocks (PBs). A prediction block is a rectangular (square or non-square) block of samples on which the same prediction (inter or intra) is applied. A prediction unit (PU) of a CU can comprise a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and syntax elements used to perform prediction on the prediction block. In a monochrome picture or a picture having three separate color planes, a PU can comprise a single prediction block and syntax structures used to predict the prediction block. Video encoder 20 can generate prediction luma, Cb, and Cr blocks for the luma, Cb, and Cr prediction blocks, respectively, of each PU of a CU.

[0068] Video encoder 20 can use intra prediction or inter prediction to generate the prediction blocks for a PU. If video encoder 20 uses intra prediction to generate the prediction blocks for a PU, video encoder 20 can generate the prediction blocks for the PU based on decoded samples of the frame associated with the PU. If video encoder 20 uses inter prediction to generate the prediction blocks for a PU, video encoder 20 can generate the prediction blocks for the PU based on decoded samples of one or more frames other than the frame associated with the PU.

[0069] After video encoder 20 generates the prediction luma, Cb, and Cr blocks for one or more PUs of a CU, video encoder 20 can generate luma residual blocks for the CU by subtracting the prediction luma blocks for the CU from its original luma coding block, such that each sample in the luma residual blocks for the CU indicates a difference between a luma sample in one of the prediction luma blocks for the CU and a corresponding sample in the original luma coding block for the CU. Similarly, video encoder 20 can generate Cb and Cr residual blocks for the CU, respectively, such that each sample in the Cb residual blocks for the CU indicates a difference between a Cb sample in one of the prediction Cb blocks for the CU and a corresponding sample in the original Cb coding block for the CU, and each sample in the Cr residual blocks for the CU can indicate a difference between a Cr sample in one of the prediction Cr blocks for the CU and a corresponding sample in the original Cr coding block for the CU.

[0070] Furthermore, as Figure 4CAs illustrated, video encoder 20 can use quad-tree partitioning to divide the luma, Cb, and Cr residual blocks of a CU into one or more luma, Cb, and Cr transform blocks. A transform block is a rectangular (square or non-square) block of samples to which a same transform is applied. A transform unit (TU) of a CU can include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax elements used to transform the transform block samples. Thus, each TU of a CU can be associated with a luma transform block, a Cb transform block, and a Cr transform block. In some examples, the luma transform block associated with a TU can be a sub-block of the luma residual block of the CU. The Cb transform block can be a sub-block of the Cb residual block of the CU. The Cr transform block can be a sub-block of the Cr residual block of the CU. In monochrome pictures or pictures having three separate color planes, a TU can include a single transform block and syntax structures used to transform the samples of the transform block.

[0071] Video encoder 20 can apply one or more transforms to the luma transform block of a TU to generate a luma coefficient block of the TU. A coefficient block can be a two- dimensional array of transform coefficients. A transform coefficient can be a scalar. Video encoder 20 can apply one or more transforms to the Cb transform block of a TU to generate a Cb coefficient block of the TU. Video encoder 20 can apply one or more transforms to the Cr transform block of a TU to generate a Cr coefficient block of the TU.

[0072] After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block, or a Cr coefficient block), video encoder 20 can quantize the coefficient block. Quantization generally refers to a process that quantizes transform coefficients to possibly reduce the amount of data used to represent the transform coefficients, providing further compression. After video encoder 20 quantizes a coefficient block, video encoder 20 can entropy encode syntax elements indicating the quantized transform coefficients. For example, video encoder 20 can perform Context- Adaptive Binary Arithmetic Coding (CABAC) on the syntax elements indicating the quantized transform coefficients. Ultimately, video encoder 20 can output a bitstream that includes a sequence of bits that forms a representation of encoded frames and associated data, which is saved in storage device 32 or transmitted to destination device 14.

[0073] After receiving the bitstream generated by video encoder 20, video decoder 30 can parse the bitstream to obtain syntax elements from the bitstream. Video decoder 30 can reconstruct the frames of the video data based at least in part on the syntax elements obtained from the bitstream. The process of reconstructing the video data is generally reciprocal to the encoding process performed by video encoder 20. For example, video decoder 30 can perform inverse transforms on the coefficient blocks associated with the TUs of the current CU to reconstruct the residual blocks associated with the TUs of the current CU. Video decoder 30 also reconstructs the coding block of the current CU by adding the samples of the prediction block of the PUs of the current CU to corresponding samples of the transform blocks of the TUs of the current CU. After reconstructing the coding blocks of each CU of a frame, video decoder 30 can reconstruct the frame.

[0074] As noted above, video coding primarily uses two modes, namely, intra-frame prediction (or intra-prediction) and inter-frame prediction (or inter-prediction) to achieve video compression. Palette-based coding is another coding scheme employed by many video coding standards. In palette-based coding, which can be particularly suitable for screen-generated content coding, a video coder (e.g., video encoder 20 or video decoder 30) forms a palette table that represents the colors of the video data of a given block. The palette table includes the most dominant (e.g., frequently used) pixel values in the given block. Pixel values that are not frequently represented in the video data of the given block are not included in the palette table or are included in the palette table as escape colors.

[0075] Each entry in the palette table includes an index to the corresponding pixel value in the palette table. The palette indices for the samples in a block can be coded to indicate which entry in the palette table is to be used to predict or reconstruct which sample. Palette mode begins with a process of generating a palette prediction value for the first block of a picture, slice, tile, or other such grouping of video blocks. As will be explained below, the palette prediction value for subsequent video blocks is typically generated by updating the previously used palette prediction value. For purposes of illustration, assume that the palette prediction value is defined at the picture level. In other words, a picture can include multiple coding blocks, each having its own palette table, but there is one palette prediction value for the entire picture.

[0076] To reduce the bits needed to signal the palette entries in a video bitstream, a video decoder can utilize palette prediction values to determine new palette entries in a palette table to reconstruct a video block. For example, the palette prediction values can include palette entries from a previously used palette table, or can even be initialized with a recently used palette table by including all entries of the recently used palette table. In some implementations, the palette prediction values can include less than all entries from a recently used palette table, and then incorporate some entries from other previously used palette tables. The palette prediction values can have the same size as the palette table used to code a different block, or can be larger or smaller than the palette table used to code a different block. In one example, the palette prediction values are implemented as a first-in-first-out (FIFO) table that includes 64 palette entries.

[0077] To generate a palette table for a video data block from the palette prediction values, the video decoder can receive a one-bit flag for each entry of the palette prediction values from the coded video bitstream. The one-bit flag can have a first value (e.g., binary one) indicating that the associated entry of the palette prediction values is to be included in the palette table, or a second value (e.g., binary zero) indicating that the associated entry of the palette prediction values is not to be included in the palette table. If the size of the palette prediction values is larger than the palette table for the video data block, the video decoder can stop receiving more flags once the maximum size of the palette table is reached.

[0078] In some implementations, some entries in the palette table can be directly signaled in the coded video bitstream, rather than being determined using the palette prediction values. For such entries, the video decoder can receive three separate m-bit values from the coded video bitstream, the m-bit values indicating the pixel values of the luma and two chroma components associated with the entry, where m represents the bit depth of the video data. Those palette entries derived from the palette prediction values only require a one-bit flag, as compared to the multiple m-bit values needed for the directly signaled palette entries. Thus, signaling some or all of the palette entries using the palette prediction values can significantly reduce the number of bits needed to signal the entries of a new palette table, thereby improving the overall coding efficiency of the palette mode coding.

[0079] In many instances, a palette prediction value for a block is determined based on a palette table used to code one or more previously coded blocks. However, when coding a first coding tree unit in a picture, slice, or tile, the palette table of the previously coded blocks can not be available. Thus, the palette prediction value cannot be generated using entries of the previously used palette table. In such a case, a palette prediction value initializer sequence can be signaled in a sequence parameter set (SPS) and / or a picture parameter set (PPS), which is a value used to generate the palette prediction value when the previously used palette table is not available. The SPS generally refers to a syntax structure of syntax elements that applies to a series of consecutive coded video pictures referred to as a coded video sequence (CVS), as determined by the content of the syntax elements found in the PPS, which is referenced by the syntax elements found in each slice segment header. The PPS generally refers to a syntax structure of syntax elements that applies to one or more individual pictures within a CVS, as determined by the syntax elements found in each slice segment header. Thus, the SPS is generally considered to be a higher level syntax structure than the PPS, which means that the syntax elements included in the SPS generally change less frequently and apply to a larger portion of the video data than the syntax elements included in the PPS.

[0080] Figure 5 A portion of a video frame 500 in a bitstream is illustrated in accordance with some embodiments. The video frame 500 includes a plurality of pixels, and each pixel is composed of a plurality of color elements (e.g., blue, green, and red). In video encoding and decoding, the color information of the plurality of pixels is represented by a plurality of luma samples 502 and a plurality of chroma samples 504. Each pixel in the plurality of pixels corresponds to a respective luma sample 502, and each luma sample 502 also corresponds to a respective pixel in the video frame 500. Each chroma sample 504 corresponds to a respective group of luma samples 502 according to a subsampling scheme. Each luma sample 502 has a luma component Y’, and each chroma sample 504 has a blue-difference chroma component Cb and a red-difference chroma component Cr. The subsampling scheme of the luma and chroma components (Y’:Cb:Cr) has a three-part ratio, such as 4:1:1, 4:2:0, 4:2:2, 4:4:4, and 4:4:0. Specifically, the luma samples 502 and the chroma samples 504 of the video frame 500 adhere to a subsampling scheme with a three-part ratio equal to 4:1:1, and on average, every four luma samples 502 correspond to one chroma sample 504 with the blue-difference chroma component Cb and the red-difference chroma component Cr.

[0081] Figure 6is a block diagram of a loop filter 600 applied in the video encoder 20 or decoder 30 according to some embodiments. In video encoding or decoding, each of the luma samples 502 and the chroma samples 504 is reconstructed from a residual block of the video frame 500 and filtered by the loop filter 600 (e.g., the deblocking filters, one or more sample adaptive offset (SAO) filters 602, and one or more adaptive loop filter (ALF) filters 604 of the loop filters 66 and 94 in Figure 2 and Figure 3 are filtered to remove artifacts by a deblocking filter, one or more SAO filters 602, and one or more ALF filters 604. The filtered luma samples 606 and chroma samples 608 are stored in the decoded picture buffer 64 or 92 and used to encode or decode other video blocks in the video frame 500. In some embodiments, each of the deblocking filter, the SAO filters 602, and the ALF filters 604 is configured to filter each luma sample 502 or chroma sample 504 based on the same type of samples, e.g., each luma sample 502 is filtered based on a respective set of neighboring luma samples 502 and each luma sample 502 is filtered based on a respective set of neighboring chroma samples 504. In some embodiments, the loop filter 600 further includes a cross-component filter 610 configured to filter each chroma sample 504 based on one or more luma samples 502 adjacent to the respective chroma sample 504. Conversely, in some embodiments, the loop filter 600 further includes an alternative cross-component filter configured to filter each luma sample 502 based on one or more chroma samples 504 adjacent to the respective luma sample 502.

[0082] In particular, the video encoder 20 or decoder 30 obtains a plurality of luma samples 502 and a plurality of chroma samples 504 of the video frame 500. Each luma sample 502 has a respective luma value, and each chroma sample 504 has a respective luma value. The SAO filters 602 compensate each of the plurality of luma samples 502 and the plurality of chroma samples 504. In particular, the SAO filters 602A, 602B, and 602C compensate the luma samples 502, the blue-difference chroma component Cb of the chroma samples 504, and the red-difference chroma component Cr of the chroma samples 504, respectively. The ALF 604 is coupled to the SAO filters 602. Each of the compensated luma samples 612 is updated to the luma samples 606 using the luma ALF 604A based on a set of neighboring compensated luma samples 612, while each of the compensated chroma samples 614A and 614B is updated to the chroma samples 608A or 608B using the chroma ALF 604B based on a set of neighboring compensated chroma samples 614.

[0083] In some embodiments, the cross-component filter 610 is configured to generate a chroma refinement value 616 for each chroma sample 504 based on the set of luma samples 502. The respective chroma sample 504 is updated using the chroma refinement value 616, i.e., the chroma value of the respective chroma sample 504 is refined using the chroma refinement value 616. The updated respective chroma sample 608 is stored in association with the video frame 500. In some embodiments, the cross-component filter 610 comprises a first cross-component filter 610A and a second cross-component filter 610, which are configured to generate a first refinement value 616A and a second refinement value 616B. The first refinement value 616A and the second refinement value 616B are used to separately update a blue-difference chroma component 618A and a red-difference chroma component 618B to output a first refined chroma value 608A and a second refined chroma value 608B, respectively.

[0084] Each of the deblocking filter, the SAO filter, and the ALF filter of the in-loop filter 600 comprises one or more in-loop filter coefficients, and the cross-component ALF 610 further comprises a plurality of cross-component filter coefficients. The in-loop filter coefficients and the cross-component filter coefficients are signaled in an adaptation parameter set (APS). In an example, the APS carries and signals a plurality of sets (e.g., up to 25 sets) of luma filter coefficients and clipping value indices, and a plurality of sets (e.g., up to 8 sets) of chroma filter coefficients and clipping value indices. The APS is transmitted from the video encoder 20 to the video decoder 30 together with the video frames 500 in the bitstream, i.e., the APS is an overhead of the bitstream transmission. In some embodiments, the filter coefficients for different categories of the luma component of the luma samples 502 are merged to reduce the overhead of the bitstream transmission. In an example, the APS index for an image slice is signaled in the corresponding slice header.

[0085] Figure 7A is an example ALF filtering scheme 700 in which the luma ALF 604A processes a luma sample 502A based on a set of associated luma samples 502B, and Figure 7B is an example ALF filtering scheme 750 in which the chroma ALF 604B processes a chroma sample 504A based on a set of associated chroma samples 504B, according to some embodiments. The luma ALF 604A has a diamond filter shape (e.g., a 7x7 diamond shape) and is selected from a plurality of pre-defined filters (e.g., 25 filters with pre-defined filter coefficients) for each 4x4 block based on the direction and activity of local gradients. Figure 7AEach square in the figure represents a luma sample 502 that is marked with the corresponding filter coefficients (C0-C12) of the luma ALF 604A having a diamond shape. For the luma sample 502A, a total of 13 filter coefficients (C0-C12) are applied symmetrically to combine 25 luma samples 502 using the luma ALF 604A. Similarly, the chroma ALF 604B has a diamond filter shape (e.g., 5x5 diamond shape) and is selected from a plurality of predefined filters (e.g., 8 filters having predefined filter coefficients). Figure 7B Each square in the figure represents a luma sample 502 that is marked with the corresponding filter coefficients (C0-C12) of the luma ALF 604A having a diamond shape. For the luma sample 502A, a total of 13 filter coefficients (C0-C12) are applied symmetrically to combine 25 luma samples 502 using the luma ALF 604A. Similarly, the chroma ALF 604B has a diamond filter shape (e.g., 5x5 diamond shape) and is selected from a plurality of predefined filters (e.g., 8 filters having predefined filter coefficients).

[0086] When adaptive loop filtering is enabled, for example, for a CTB, each image sample R(i,j) within the CU (e.g., luma sample 502A, chroma sample 504A) is filtered, resulting in a sample value R'(i,j) as follows:

[0087] R'(i,j) = R(i,j) + ((∑ k≠0 ∑ l≠0 f(k,l) x K(R(i+k,j+l) - R(i,j), c(k,l)) + 64) » 7) (1)

[0088] where f(k,l) represents a decoded filter coefficient, K(x,y) is a clipping function, and c(k,l) represents a decoded clipping parameter. The variables k and l vary between 0 and L-1, where L represents a filter length. to where L represents a filter length.

[0089] For clipping in adaptive loop filtering, each image sample involves a set of related image samples in a filter length L of the ALF 604. Referring to Figure 7A , the related luma samples 502B for each luma sample 502A include 3 rows of luma samples (i.e., 9 luma samples) above the respective luma sample 502A, 3 rows of luma samples (i.e., 9 luma samples) below the respective luma sample 502A, 3 luma samples to the left of the respective luma sample 502A, and 3 luma samples to the right of the respective luma sample 502A. Referring to Figure 7BThe associated chroma samples 504B for each chroma sample 504A include 2 rows of chroma samples (i.e., 4 chroma samples) above the respective chroma sample 504A, 2 rows of chroma samples (i.e., 4 chroma samples) below the respective chroma sample 504A, 2 chroma samples to the left of the respective chroma sample 504A, and 2 chroma samples to the right of the respective chroma sample 504A.

[0090] In some embodiments, the ALF filter parameters are signaled in an APS including the clipping value indices representing the clipping parameters c(k, l) described above. In one APS, up to 25 sets of luma filter coefficients (e.g., one set of C0-C12 in Table 1) and clipping value indices, and up to 8 sets of chroma filter coefficients (e.g., one set of C0-C6 in Table 2) and clipping value indices can be signaled. To reduce the signaling bit overhead, the filter coefficients of different categories can be merged for luma samples 502A. In the slice header, the APS index used by the current slice is signaled. The clipping value indices decoded from the APS allow the use of a predefined clipping boundary value formula or table to determine the clipping boundary values. These boundary clipping values depend on the internal bit depth and define a dynamic range in which the difference of a set of associated image samples and the image sample 502A or 504A is clipped. In some embodiments, different predefined clipping boundary value formulas or tables are applied for luma samples 502A and chroma samples 504A. Figure 7A Figure 7B In some embodiments, the ALF filter parameters are signaled in an APS including the clipping value indices representing the clipping parameters c(k, l) described above. In one APS, up to 25 sets of luma filter coefficients (e.g., one set of C0-C12 in Table 1) and clipping value indices, and up to 8 sets of chroma filter coefficients (e.g., one set of C0-C6 in Table 2) and clipping value indices can be signaled. To reduce the signaling bit overhead, the filter coefficients of different categories can be merged for luma samples 502A. In the slice header, the APS index used by the current slice is signaled. The clipping value indices decoded from the APS allow the use of a predefined clipping boundary value formula or table to determine the clipping boundary values. These boundary clipping values depend on the internal bit depth and define a dynamic range in which the difference of a set of associated image samples and the image sample 502A or 504A is clipped. In some embodiments, different predefined clipping boundary value formulas or tables are applied for luma samples 502A and chroma samples 504A.

[0091] ​In some embodiments, in the slice header, a plurality of APS indices (e.g., 7 indices) can be signaled to select a subset of a plurality of corresponding luma and chroma filter sets for adaptive loop filtering in the current slice. Such adaptive loop filtering process can be controlled at the CTB level. A flag is signaled to indicate whether adaptive loop filtering is applied to luma CTBs. According to a determination that the flag enables adaptive loop filtering, a luma filter set is selected among a plurality of (e.g., 16) luma filter sets for the luma CTB. A luma filter set index is signaled for the luma CTB to indicate which luma filter set is applied. Each of the plurality of filter sets is predefined and hard-coded in the encoder 20 and the decoder 30, and only the luma filter set index needs to be transmitted along with the bitstream carrying the video frames 500. Likewise, for the chroma samples 504A, when the flag enables adaptive loop filtering, a chroma filter set index is signaled in the slice header to select one of a plurality of chroma filter sets for adaptive loop filtering of the current slice. At the CTB level, if there is more than one chroma filter set in the APS, a chroma filter set index is signaled for each chroma CTB. Each filter set is locally stored in the video encoder or decoder with filter coefficients f(k, l) and clipping parameters c(k, l) or indices of filter coefficients f(k, l) and clipping parameters c(k, l).

[0092] In some embodiments, the filter coefficients are quantized with a norm equal to 128. Bitstream conformance is applied such that the values of filter coefficients with non-central positions should be in the range [-2 7 to 2 7 -1]. Filter coefficients with central positions are not signaled in the bitstream and are assumed to be 128.

[0093] Figure 8 is an example ALF filter scheme 800 with clipping value indices for a set of related image samples 804 for each image sample 802 in a block of an image frame according to some embodiments. For each image sample 802 (e.g., luma sample 502A, chroma sample 504A), the ALF 604 has a filter length L and corresponds to a plurality of filter coefficients (e.g., C0-C13 for luma sample 502A). A set of related image samples 804 is identified in the filter length of the respective image sample 802. For each of the set of related image samples 804 (e.g., luma samples 502B corresponding to filter coefficients C1-C12 in FIG. 7), a respective clipping value index and a corresponding filter coefficient is identified. For example, Figure 8 Each related image sample 804 in has a clipping value index equal to 0, 1, 2, or 3.

[0094] The respective clip value index corresponds to a respective clip boundary value M equal to 2 raised to the power of a respective clip number i, and the respective clip number i is an integer. The ALF 604 clips each of the set of related image samples 804 from the respective image sample 802 by a difference into a dynamic range DR defined by the respective clip boundary value M associated with the respective clip value index. The clipped difference of each of the set of related image samples 804 is utilized to modify the respective image sample 802 (e.g., luma sample 502A, chroma sample 504A) based on the respective filter coefficient such that a plurality of modified image samples 802 can be used to reconstruct an image frame. When the boundary value is limited to an integer power of 2, the clipped difference of the related image sample 804 from each image sample 802 includes only logical AND operations and / or logical OR operations. In these ways, the clipping operation does not include any comparison operations to each image sample 802, thereby reducing the amount of computation required for adaptive loop filtering and conserving computational resources for encoding and decoding the corresponding video frame.

[0095] In some embodiments, for a first block of image samples, a single set of clip value indices is determined for all image samples 802 in the first block. The set of value indices is transmitted from the video encoder 20 to the video decoder 30 along with the block of image samples, allowing the ALF 604 to process each image sample 802 in the first block based on the same single set of clip value indices. An example block is an entire video frame, slice, tile, brick, tile group, coding tree, or any other coding unit. Further, in some embodiments, the video frame includes a second block different from the first block. A second set of clip value indices is used for adaptive loop filtering of image samples 802 in the second block. The second set of clip value indices is determined separately from the single set of clip value indices used for the first block of image samples.

[0096] Figures 9A to 9Care three example pre-defined clipping boundary value tables 900A-900C according to some embodiments. Each pre-defined clipping boundary value table 900 associates a set of clipping value indices 902 with a set of clipping boundary values (M) 904 according to a set of internal bit depth indices (IBDI) 906. Each clipping boundary value M in these tables 900A-900C is equal to 2 raised to the corresponding clipping number i. Each clipping boundary value table 900 is applied as a reference in the ALF 604 to determine the clipping boundary value M for the corresponding clipping value index. For example, for a first picture sample 802 of a video frame, when one of its associated picture samples 804A is to be clipped from the difference with the first picture sample 802, the associated picture sample 804A is provided to the corresponding clipping value index 902A (i.e., equal to 0), and the IBDI 906A (e.g., IBDI = 10) can be determined from the first picture sample 802 to be filtered. The corresponding clipping boundary value 904A (i.e., equal to 1024) is identified from the pre-defined clipping boundary value table 900A at the intersection of the column corresponding to the clipping value index 902A and the row corresponding to the IBDI 906A.

[0097] Each clipping boundary value 904 is equal to 2 raised to the corresponding clipping number i. For the same clipping value index (e.g., 902A), the corresponding clipping number i is an integer that increases in a linear fashion with the IBDI 906. Each boundary value 904 (M) is expressed as a function of the corresponding clipping number i as follows:

[0098] M = 2 i . (1)

[0099] In some embodiments, for each associated picture sample 804 used for the adaptive loop filtering of the first picture sample 802, the clipped difference of the associated picture sample 804 from the first picture sample 802 is in the range of [-M, M-1], i.e., in the range of [-2 i , 2 i -1]. Alternatively, in some embodiments, the clipped difference of the associated picture sample 804 from the first picture sample 802 is in the range of [-M+1, M], i.e., in the range of [-2 i +1, 2 i ]. Alternatively, in some embodiments, the clipped difference of the associated picture sample 804 from the first picture sample 802 is in the range of [-M+1, M-1], i.e., in the range of [-2 i +1, 2 i -1]. Alternatively, in some embodiments, the clipped difference of the associated picture sample 804 from the first picture sample 802 is in the range of [-M, M], i.e., in the range of [-2 i , 2 i ].

[0100] In some embodiments, the predefined clipping boundary value table 900 used in the filtering of a block of image samples 802 is obtained with the bitstream carrying the block, allowing the table 900 to be updated for each block of image samples 802. An example block is an entire video frame, slice, tile, brick, tile group, coding tree, or any other coding unit. Alternatively, two copies of the same predefined clipping boundary value table 900 used in the adaptive loop filtering are stored in the video encoder 20 and the video decoder 30, respectively. In the process of filtering a block of image samples 802, the predefined clipping boundary value table 900 is not received with the video frame, but is extracted from a local memory pre-storing one or more different predefined clipping boundary value tables (e.g., a subset or all of tables 900A-900C). The image samples 802 of a block share a set of clipping value indices and a boundary table indicator. The set of clipping value indices and the boundary table indicator are obtained in connection with the block of image samples 802 in the bitstream, while one or more clipping boundary value tables are stored locally. One of the clipping boundary value tables 900 is selected based on the boundary table indicator and applied to the clipping operation to filter each image sample 802 in the block.

[0101] The predefined clipping boundary value table 900A is represented by the following equation:

[0102]

[0103] where CVI is the respective clipping value index and CBV is the respective clipping boundary value for each of the set of relevant image samples 804. In some embodiments, the clipping boundary value table 900A is not stored in the local memory, but equation (2) is stored therein. For each image sample 802, the clipping boundary value for each relevant image sample 804 is determined based on the IBDI and the respective clipping value index according to the predefined clipping boundary value equation (2) described above.

[0104] The clipping boundary value for a clipping value index of 2 is different in the predefined clipping boundary value tables 900A and 900B. The predefined clipping boundary value table 900B is represented by the following equation:

[0105]

[0106] In some embodiments, the clipping boundary value table 900B is not stored in the local memory, but equation (3) is stored therein. For each image sample 802, the clipping boundary value for each relevant image sample 804 is determined based on the IBDI and the respective clipping value index according to the predefined clipping boundary value equation (3) described above.

[0107] The clipping boundary value for the clipping value index of 1 is different in the predefined clipping boundary value tables 900A and 900C. The predefined clipping boundary value table 900C is represented by the following equation:

[0108]

[0109] In some embodiments, the clipping boundary value table 900C is not stored in the local memory, but rather the equation (4) is stored therein. For each image sample 802, a clipping boundary value is determined for each associated image sample 804 based on the IBDI and the respective clipping value index according to the predefined clipping boundary value equation (4) described above.

[0110] In some embodiments, the bitstream includes a plurality of image samples 802 of a video frame. The plurality of image samples 802 includes a subset of luma samples 502A and a subset of chroma samples 504A. The subset of luma samples 502A corresponds to a first set of clipping value indices that define a respective clipping value index for each of a set of associated luma samples 502B in a first filter length LI of each luma sample 502A. The subset of chroma samples 504A corresponds to a second set of clipping value indices that define a respective clipping value index for each of a set of associated chroma samples 504B in a second filter length L2 of each chroma sample 504A. The second set of clipping value indices is different than the first set of clipping value indices. Further, in some embodiments, the first set of clipping value indices and the second set of clipping value indices correspond to a clipping boundary value table or equation that associates each clipping value index in the respective set of clipping value indices with a respective clipping boundary value based on the IBDI. Additionally, in some embodiments, the clipping boundary value table or equation is selected from a predefined number of clipping boundary value tables or equations. Alternatively, in some embodiments, the first set of clipping value indices and the second set of clipping value indices correspond to a first clipping boundary value table / equation and a second clipping boundary value table / equation that is different than the first clipping boundary value table / equation.

[0111] Figure 10is a data structure for a value 1000 to be clipped for a picture sample 802 according to some embodiments. The picture sample 802 corresponds to one of the luma samples 502 and the chroma samples 504 of a video frame. In some embodiments, the value 1000 to be clipped corresponds to a difference between a related picture sample 804 and the picture sample 802. The first bit of the binary representation of the value 1000 is defined as the least significant bit (LSB), which is usually the rightmost bit. The index of the bits increases by 1 from the LSB to the most significant bit (MSB) on the left side. In some embodiments, the dynamic range for clipping the difference between the related picture sample 804 and the corresponding picture sample 802 is defined as a clipping upper limit value -M and a lower limit value M-1, and is represented in the form of [-M, M-1], where M is equal to 2 i . The corresponding clipping operation can be implemented as a logical AND and / or a logical OR operation performed on the bits in the range from the (i+1)th bit to the MSB. Using the logical AND and / or the logical OR operation is simpler than performing a comparison-based clipping operation.

[0112] In an example, assume that the value 1000 to be clipped is represented by 11 bits, with a value range from -21 11 to 21 11 -1 (inclusive). The clipping upper and lower limit values define a dynamic range of [-21 4 , 21 4 -1], and the bits from the fifth bit to the MSB need to be checked to determine whether the value 1000 is out of the dynamic range defined by the upper limit value and the lower limit value. If the value 1000 to be clipped is positive, a logical OR operation is performed on all the bits from the fifth bit to the MSB. If the result of the logical OR operation is 1, the value 1000 is greater than 21 4 -1 and the value 1000 is clipped to 21 4 -1. If the value 1000 to be clipped is negative, a logical AND operation is performed on all the bits from the fifth bit to the MSB. If the result of the logical AND operation is 0, the value 1000 is less than -21 4 -1 and the value 1000 is clipped to -21 4 .

[0113] In another example, the value 1000 to be clipped is in a value range of -16 to 15. The value 1000 has five bits. One bit is used to represent the sign, and four bits are used to represent the magnitude of the value 1000. The clipping boundary value is 4, and the dynamic range for clipping is set to [-21 2 , 21 2-1]. If the input value 1000 equals 14 (binary representation 0, 1110), a logical OR operation is applied on the third and fourth binary bits, resulting in a value 1, indicating that the input value 1000 exceeds the upper limit and is therefore clipped to the upper limit value 3. If the input value 1000 equals 2 (binary representation 0, 0010), a logical OR operation is applied on the third and fourth binary bits, resulting in a value 0, indicating that the input value 1000 does not exceed the upper limit and remains unchanged. If the input value 1000 equals -14 (binary representation 1, 0010), a logical AND operation is applied on the third and fourth binary bits, resulting in a value 0, indicating that the input value 1000 exceeds the lower limit and is set to the lower limit value -4. If the input value 1000 equals -2 (binary representation 1, 1110), a logical AND operation is applied on the third and fourth binary bits, resulting in a value 1, indicating that the input value 1000 does not exceed the lower limit and remains unchanged.

[0114] Figure 11 is a flowchart of a video coding method 1100 according to some embodiments. The video coding method 1100 is implemented in an electronic device having a video encoder 20 or a decoder 30. The electronic device obtains (1102) a plurality of image samples 802 of a video frame from a bitstream. Each image sample 802 corresponds to one of a luma sample 502 and a chroma sample 504. For each of the plurality of image samples 802, a respective image sample 802 is filtered (1104) using an adaptive loop filter 604 having a filter length L and a set of filter coefficients. Specifically, the electronic device identifies (1106) a set of related image samples 804 in the filter length L of the respective image sample 802. For each of the set of related image samples 804, a respective clipping value index and a corresponding filter coefficient are identified (1108). Based on the respective clipping value index, a difference of each of the set of related image samples 804 from the respective image sample 802 is clipped (1110). The respective clipping value index corresponds (1112) to a respective clipping boundary value equal to a respective power of 2 of an integer i, and the respective integer i is an integer. The electronic device modifies (1114) the respective image sample 802 with the clipped difference of each of the set of related image samples 804 based on the respective filter coefficient. The video frame is reconstructed (1116) using the plurality of modified image samples 802. In some embodiments, the plurality of image samples 802 form a block of the video frame. Optionally, the block is an entire video frame, a slice, a tile, a brick, a tile group, a coding tree, or any other coding unit.

[0115] In some embodiments, for each picture sample 802, the IBDI of the respective picture sample 802 is determined (1118). For each of the set of related picture samples 804, the electronic device determines (1120) the respective clipping boundary value based on the IBDI and the respective clipping value index according to the predefined clipping boundary value table 900. The difference between each of the set of related picture samples 804 and the respective picture sample 802 is clipped (1122) based on the respective clipping boundary value. Further, in some embodiments, the predefined clipping boundary value table 900 is obtained from a bitstream. Alternatively, in some embodiments, the predefined clipping boundary value table 900 is extracted from a local memory. The local memory can store a plurality of clipping boundary value tables (e.g., a subset or all of tables 900A-99C), and the predefined clipping boundary value table 900 is selected from the plurality of clipping boundary value tables. An example of the predefined clipping boundary value table 900 is shown in FIG. 9. Figures 9A to 9C

[0116] In some embodiments, for each picture sample 802, the IBDI of the respective picture sample 802 is determined. For each of the set of related picture samples 804, the electronic device determines the respective clipping boundary value based on the IBDI and the respective clipping value index according to a predefined clipping boundary value formula. The difference between each of the set of related picture samples 804 and the respective picture sample 802 is clipped based on the respective clipping boundary value. The predefined clipping boundary value formula is represented as one of formulas (2)-(4).

[0117] In some embodiments, wherein for each of the set of related picture samples, the clipping value index is selected from a plurality of consecutive numbers (e.g., 0, 1, 2, and 3). The respective clipping number i is at least a function of the clipping value index, i.e., varies with the clipping value index. Moreover, the respective clipping number i is linearly related to the IBDI for each clipping value index. For example, when the clipping value index is equal to 0, the respective clipping number i is equal to the IBDI, and when the clipping value index is equal to 3, the respective clipping number i is equal to the IBDI minus 7.

[0118] In some embodiments, for each of the set of related picture samples, the clipped difference of the respective related picture sample is within the range of [-2 i , 2 i -1].

[0119] In some embodiments, for each of the set of related picture samples, the clipped difference of the respective related picture sample is within the range of [-2 i +1, 2 i ], [-2 i , 2 i ], and [-2 i +1, 2 i ​-1] of the plurality of ranges.

[0120] In some embodiments, clipping the difference for each of the set of related image samples to the respective image sample comprises only logical AND operations and / or logical OR operations.

[0121] In some embodiments, the plurality of image samples includes a subset of luma samples 502A and a subset of chroma samples 504A. The subset of luma samples 502A corresponds to a first set of clip value indices that define respective clip value indices for each of a set of related luma samples 502B in a first filter length LI of each luma sample 502A. The subset of chroma samples 504A corresponds to a second set of clip value indices that define respective clip value indices for each of a set of related chroma samples 504B in a second filter length L2 of each chroma sample 504A. The second set of clip value indices is different than the first set of clip value indices. Further, in some embodiments, each of the first set of clip value indices and the second set of clip value indices correspond to a clip boundary value table or formula that associates each clip value index in the respective set of clip value indices with a respective clip boundary value based on the IBDI. Additionally, in some embodiments, the clip boundary value table or formula corresponding to the first set or the second set of clip value indices is selected from a predefined number of clip boundary value tables or formulas. Further, in some embodiments, wherein the first set of clip value indices and the second set of clip value indices correspond to a first clip boundary value table / formula and a second clip boundary value table / formula different than the first clip boundary value table / formula.

[0122] In one or more examples, the functions described can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media can include computer-readable storage media, which corresponds to a tangible medium 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. In this manner, computer- readable media generally can correspond to (1) tangible computer-readable storage media which is non-transitory or (2) a communication medium such as a signal or carrier wave. Data storage media can be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, code and / or data structures for implementation of the techniques described in this application. A computer program product can include a computer-readable medium.

[0123] The terminology used in the description of the implementations herein is for the purpose of describing particular implementations only and is not intended to limit the scope of the claims. As used in the description of the implementations and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and / or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “comprises” and / or “comprising,” when used in this specification, specify the presence of stated features, elements, and / or components, but do not preclude the presence or addition of one or more other features, elements, components, and / or groups thereof.

[0124] It will be also understood that, although the terms first, second, etc. can be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first electrode could be termed a second electrode, and, similarly, a second electrode could be termed a first electrode, without departing from the scope of the present implementations. The first electrode and the second electrode are both electrodes, but they are not the same electrode.

[0125] The description of the application has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the application in the form disclosed. Many modifications, variations, and alternative implementations will be apparent to those of ordinary skill in the art, based on the teachings and concepts presented herein. Embodiments were chosen and described in order to best explain the principles of the application and the practical application, and to enable others skilled in the art to understand the various implementations with various modifications being suited to the particular use contemplated and with various other implementations being obvious. Accordingly, it is intended that the scope of the claims is not to be limited by the specific examples disclosed, and that modifications and other implementations are intended to be included within the scope of the appended claims.

Claims

1. A method for encoding video data, comprising: obtaining a plurality of coding tree units partitioned from a video frame; for a coding tree unit of the plurality of coding tree units, obtaining a plurality of picture samples, each picture sample corresponding to one of a luma sample and a chroma sample; for each of the plurality of picture samples, filtering a respective picture sample using an adaptive loop filter having a filter length L and a set of filter coefficients, further comprising: identifying a set of related picture samples for the respective picture sample; for each of the set of related picture samples, identifying a respective clipping value index and a corresponding filter coefficient; clipping a difference between each of the set of related picture samples and the respective picture sample based on the respective clipping value index, wherein the respective clipping value index corresponds to a respective clipping boundary value equal to a respective clipping power of two, and all respective clipping powers corresponding to each respective clipping value index are integers; and modifying the respective picture sample with the clipped difference between each of the set of related picture samples and the respective picture sample based on the corresponding filter coefficient.

2. The method of claim 1, wherein, For each picture sample, clipping the difference based on the respective clipping value index comprises: determining an intra bit depth index IBDI for the respective picture sample; for each of the set of related picture samples, determining the respective clipping boundary value based on the IBDI and the respective clipping value index from a predefined clipping boundary value table; and clipping the difference between each of the set of related picture samples and the respective picture sample based on the respective clipping boundary value.

3. The method of claim 2, further comprising: obtaining the predefined clipping boundary value table from a bitstream.

4. The method of claim 2, further comprising: extracting the predefined clipping boundary value table from a local memory.

5. The method of claim 4, wherein, the local memory stores a plurality of clipping boundary value tables, the method further comprising: selecting the predefined clipping boundary value table from the plurality of clipping boundary value tables.

6. The method of claim 2, wherein, the predefined clipping boundary value table is represented as one of the following three tables, wherein a respective clipping boundary value is identified at an intersection of a column corresponding to a clipping value index and a row corresponding to an IBDI from the predefined clipping boundary value table:

7. The method of claim 1, wherein, For each picture sample, clipping the difference based on the respective clipping value index comprises: determining an intra bit depth index IBDI for the respective picture sample; for each of the set of related picture samples, determining the respective clipping boundary value based on the IBDI and the respective clipping value index from a predefined clipping boundary value formula; and clipping the difference between each of the set of related picture samples and the respective picture sample based on the respective clipping boundary value; wherein the predefined clipping boundary value formula is represented as one of the following formulas: and wherein CVI is the respective clipping value index and CBV is the respective clipping boundary value for each of the set of related picture samples.

8. The method of any one of claims 1-7, wherein, For each of the set of related image samples, the clipping value index is selected from 0, 1, 2, and 3, and the corresponding clipping number i is a function of at least the clipping value index.

9. The method of any one of claims 1-7, wherein, for each of the set of related image samples, the clipped difference between the related image sample and the respective image sample is in the range [-2 i , 2 i -1], where i is the respective clipping number.

10. The method of any one of claims 1-7, wherein, For each of the set of related image samples, the truncated difference between the respective related image sample and the respective image sample is within one of a plurality of ranges including [-2 i +1, 2 i ], [-2 i , 2 i ] and [-2 i +1, 2 i -1], where i is the respective truncation number.

11. The method of any one of claims 1-7, wherein, Clipping the difference for each of the set of related image samples from the respective image sample comprises only logical AND operations and / or logical OR operations.

12. The method of any of claims 1-7, wherein: the plurality of image samples comprises a subset of luma samples and a subset of chroma samples; the subset of luma samples corresponds to a first set of clipping value indices defining a respective clipping value index for each of a set of related luma samples in a first filter length L1 for each luma sample; and the subset of chroma samples corresponds to a second set of clipping value indices defining a respective clipping value index for each of a set of related chroma samples in a second filter length L2 for each chroma sample, the second set of clipping value indices being different than the first set of clipping value indices.

13. The method of claim 12, wherein, each of the first set of clipping value indices and the second set of clipping value indices corresponds to a clipping boundary value table or formula that associates each clipping value index in the respective set of clipping value indices with the respective clipping boundary value based on an internal bit depth increase (IBDI).

14. The method of claim 13, further comprising: selecting the clipping boundary value table or formula from a predefined number of clipping boundary value tables or formulas.

15. The method of claim 12, wherein, the first set of clipping value indices and the second set of clipping value indices correspond to a first clipping boundary value table / formula and a second value table / formula different than the first clipping boundary value table / formula.

16. The method of claim 1, wherein, the sampling scheme of the video frame is 4:2:

2.

17. The method of claim 1, wherein, the sampling scheme of the video frame is 4:4:

4.

18. An electronic device, comprising: one or more processors; and memory having instructions stored thereon that, when executed by the one or more processors, cause the processors to perform the method of any of claims 1-17 to generate a video bitstream.

19. A non-transitory computer-readable medium having stored thereon instructions and a bitstream generated by the method of any of claims 1-15, the instructions, when executed by one or more processors, cause the processors to perform the method of any of claims 1-17.

20. A method for storing a bitstream, comprising: performing an encoding method to generate a bitstream; and storing the bitstream, wherein the encoding method comprises: obtaining a plurality of coding tree units partitioned from a video frame; for a coding tree unit of the plurality of coding tree units, obtaining a plurality of image samples, each image sample corresponding to one of a luma sample and a chroma sample; for each of the plurality of image samples, filtering a respective image sample using an adaptive loop filter having a filter length L and a set of filter coefficients, further comprising: identifying a set of related image samples for the respective image sample; for each of the set of related image samples, identifying a respective clipping value index and a corresponding filter coefficient; clipping a difference between each of the set of related image samples and the respective image sample based on the respective clipping value index, wherein the respective clipping value index corresponds to a respective clipping boundary value equal to a respective power-of-2 clipping number, and all respective clipping numbers corresponding to each respective clipping value index are integers; and modifying the respective image sample with the clipped difference between each of the set of related image samples and the respective image sample based on the corresponding filter coefficient.

21. The method of claim 20, wherein, the sampling scheme of the video frame is 4:2:

2.

22. The method of claim 20, wherein, the sampling scheme of the video frame is 4:4:

4.

23. A computer program product comprising instructions for execution by a computing device having one or more processors, wherein the instructions, when executed by the one or more processors, cause the computing device to store a bitstream generated in the steps of the method of any of claims 1 to 17.

Citation Information

Patent Citations

  • Method and apparatus for adaptive loop filtering

    CN102804776A

  • Deblocking filter for video coding and processing

    US20190306503A1