In-loop filters for video coding

Bit depth-based clipping operations in adaptive loop filtering enhance encoding efficiency and quality for chrominance and luminance components, addressing inefficiencies in existing video encoding technologies.

JP2024167388AActive Publication Date: 2024-12-03BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024152113
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2019-12-28
Filing Date
2024-09-04
Publication Date
2024-12-03
Estimated Expiration
2040-12-28

AI Technical Summary

Technical Problem

Existing video encoding technologies lack an efficient mechanism for encoding and decoding chrominance and luminance components while preserving video quality, particularly in adaptive loop filtering processes.

Method used

Implement bit depth-based clipping operations in adaptive loop filtering for chroma samples and luminance samples, using a dynamic range defined by a power of two indexed clipping number to enhance encoding efficiency and quality.

Benefits of technology

Improves encoding efficiency and preserves video quality by optimizing the adaptive loop filtering process for chrominance and luminance components, reducing computational overhead and enhancing image reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024167388000001_ABST
    Figure 2024167388000001_ABST
Patent Text Reader

Abstract

To provide a method of improvement in coding of a chroma sample and a luma sample of a video frame by a bit depth-based clipping operation in adaptive loop filtering.SOLUTION: The method comprises a step of, for each of image samples, filtering the respective image sample using an adaptive loop filter having a filter length L and a set of filter coefficients, the step further including: identifying a set of related image samples of the respective image sample; for each sample of the set of related image samples, identifying a respective clip value index and a corresponding filter coefficient; clipping a difference of each sample of the set of related image samples and the respective image sample based on the respective clip value index; and modifying the respective image sample with the clipped difference based on the corresponding filter coefficient.SELECTED DRAWING: Figure 11
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] (CROSS REFERENCE TO RELATED APPLICATIONS) This application claims priority to U.S. Provisional Application No. 62 / 954,485, entitled "In-Loop Filters for Video Coding," filed December 28, 2019, and incorporated by reference in its entirety.

[0002] This application relates generally to encoding and compression of video data, and more particularly to a method and system for improving the encoding of chrominance and luminance components of image frames in a bitstream of video data. [Background technology]

[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 game consoles, smartphones, video teleconferencing devices, video streaming devices, etc. Such electronic devices transmit, receive, encode, decode, and / or store digital video data by implementing video compression and decompression standards such as 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 generally involves 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, a video frame is divided into one or more slices, with each slice having multiple video blocks, which may also be referred to as coding tree units (CTUs). Each CTU may contain one coding unit (CU) or may be recursively divided into smaller CUs until a predetermined minimum CU size is reached. Each CU (also named leaf CU) contains one or more transform units (TU) and also includes one or more prediction units (PU). Each CU may be coded in either intra mode, inter mode, or IBC mode. Video blocks in an intra-coded (I) slice in a video frame are coded using spatial prediction with respect to reference samples in neighboring blocks within the same video frame.Video blocks in an inter-coded (P or B) slice in a video frame may use spatial prediction with respect to reference samples in neighboring blocks in the same video frame, or may use temporal prediction with respect to reference samples in other previous and / or future reference video frames.

[0004] Spatial or temporal prediction based on previously coded reference blocks, e.g. neighboring blocks, results in a predicted block for the current video block being coded. The process of finding the reference block may be achieved by a block matching algorithm. Residual data representing pixel differences between the current block being coded and the predicted block is called a residual block or a prediction error. Inter-coded blocks are coded according to motion vectors and residual blocks that point to reference blocks in a reference frame that form the predicted block. The process of determining the motion vectors is generally called motion prediction. Intra-coded blocks are coded according to an intra prediction mode and a residual block. For further compression, the residual blocks may be transformed from the pixel domain to a transform domain, such as the frequency domain, resulting in residual transform coefficients that are then quantized. The quantized transform coefficients, initially arranged in a two-dimensional array, may be scanned to generate a one-dimensional vector of transform coefficients that are then entropy coded into a video bitstream to achieve even further compression.

[0005] The encoded video bitstream is then stored on a computer-readable recording medium (e.g., flash memory) that is accessed by another electronic device with digital video capabilities, or transmitted directly to the electronic device via wired or wireless connection. The electronic device then performs video decompression (the inverse process of video compression discussed above), e.g., by parsing the encoded video bitstream to obtain syntax elements from the bitstream, reconstructing digital video data from the encoded video bitstream into an original format based at least in part on the syntax elements obtained from the bitstream, and rendering the reconstructed digital video data on a display of the electronic device.

[0006] The reconstructed video block is subjected to in-loop filtering before being stored in a reference picture and used to encode other video blocks. An adaptive loop filter (ALF) is applied to the chrominance and luma components of the reconstructed video block, respectively. It would be beneficial to have a more efficient coding mechanism for encoding and decoding these color components while preserving the image quality of the decoded video data. Summary of the Invention

[0007] The present application describes implementations related to encoding and decoding of video data, and more particularly to an improved method and system for encoding chrominance and luma samples of a video frame involving applying a bit-depth based clipping operation in adaptive loop filtering. Each luma or chrominance sample of a video frame is filtered based on a number of surrounding luma or chrominance samples according to a respective adaptive loop filter (ALF) scheme. For each luma or chrominance sample, the difference between the associated image sample and the respective sample is clipped to a respective dynamic range defined by a clip boundary value equal to a power of 2 with the respective clipping number as an exponent.

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

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

[0010] In another aspect, an electronic device includes one or more processors and a memory for storing instructions, the one or more processors executing the instructions to perform the method of encoding video data described above.

[0011] In another aspect, instructions are stored on a non-transitory computer-readable storage medium, and one or more processors of an electronic device execute the instructions to perform the method of encoding video data described above.

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

[0013] [Figure 1] 1 is a block diagram illustrating an exemplary video encoding and decoding system according to some embodiments. [Diagram 2] 1 is a block diagram illustrating an example video encoder according to some embodiments. [Diagram 3] 1 is a block diagram illustrating an exemplary video decoder according to some embodiments. [Figure 4A] 2 is a schematic diagram of recursively dividing an image frame into video blocks of various sizes and shapes in accordance with some embodiments. [Figure 4B] 2 is a schematic diagram of recursively dividing an image frame into video blocks of various sizes and shapes in accordance with some embodiments. [Figure 4C] 2 is a schematic diagram of recursively dividing an image frame into video blocks of various sizes and shapes in accordance with some embodiments. [Figure 4D] 2 is a schematic diagram of recursively dividing an image frame into video blocks of various sizes and shapes in accordance with some embodiments. [Figure 4E] 2 is a schematic diagram of recursively dividing an image frame into video blocks of various sizes and shapes in accordance with some embodiments. [Diagram 5] FIG. 2 illustrates a portion of a video frame in a bitstream according to some embodiments. [Figure 6] 2 is a block diagram of an in-loop filter applied in a video encoder or video decoder in accordance with some embodiments. [Figure 7A] FIG. 1 illustrates an example ALF filtering scheme in which a luma ALF processes a luma sample based on a set of associated luma samples, in accordance with some embodiments. [Figure 7B] FIG. 2 illustrates an example ALF filtering scheme in which the chroma ALF processes chroma samples based on a set of related chroma samples, in accordance with some embodiments. [Figure 8] 1 is a diagram of an example ALF filtering scheme with clip value index for a set of associated image samples for each image sample in a block of an image frame in accordance with some embodiments. [Figure 9A] 1 is an example table of predefined clipping boundary values ​​according to some embodiments. [Figure 9B] 1 is an example table of predefined clipping boundary values ​​according to some embodiments. [Figure 9C] 1 is an example table of predefined clipping boundary values ​​according to some embodiments. [Figure 10] 4 is a diagram of a data structure of clipped values ​​for image samples according to some embodiments. [Figure 11] 1 is a flow diagram of a video encoding method according to some embodiments. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0014] Reference will now be made in detail to specific embodiments, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous non-limiting specific details are set forth to aid in the understanding of the subject matter presented herein. However, it will be apparent to one skilled in the art that various alternatives may be used without departing from the scope of the claims, and that the subject matter may be practiced without these specific details. For example, it will be apparent to one skilled in the art that the subject matter presented herein may be practiced in many types of electronic devices with digital video capabilities.

[0015] Figure 1 is a block diagram illustrating an example system 10 for concurrent encoding and decoding of video blocks in accordance with some embodiments. As shown in Figure 1, system 10 includes a source device 12 that generates and encodes video data that is subsequently decoded by a destination device 14. Source device 12 and destination device 14 may comprise any of a variety of electronic devices, including desktop or laptop computers, tablet computers, smartphones, set-top boxes, digital televisions, cameras, displays, digital media players, video game consoles, video streaming devices, etc. In some embodiments, source device 12 and destination device 14 are equipped with wireless communication capabilities.

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

[0017] In some other embodiments, the encoded video data may be transmitted from output interface 22 to recording device 32. The encoded video data at recording device 32 may then be accessed by destination device 14 via input interface 28. Recording device 32 may be any of a variety of distributed or locally accessible storage media, such as a hard drive, Blu-ray disc, DVD, CD-ROM, flash memory, volatile or non-volatile memory, or other digital recording media suitable for storing encoded video data. In a further example, recording device 32 may correspond to a file server or another intermediate recording device that may hold the encoded video data generated by source device 12. Destination device 14 may access the stored video data by streaming or downloading from recording device 32. The file server may be any type of computer that can store the encoded video data and transmit the encoded video data to destination device 14. Exemplary file servers include a web server (e.g., for a website), an FTP server, a network attached storage (NAS) device, or a local disk drive. Destination device 14 may 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, suitable for accessing the encoded video data stored on the file server. The transmission of the encoded video data from recording device 32 may be a streaming transmission, a download transmission, or a combination of both.

[0018] 1, source device 12 includes a video source 18, a video encoder 20, and an output interface 22. Video source 18 may include sources such as a video capture device, e.g., a video camera, a video archive containing previously captured video, a video feed interface for receiving 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 an example, if video source 18 is a video camera in a security surveillance system, source device 12 and destination device 14 may form a camera phone or video phone. However, the embodiments described herein may be applicable to video coding in general and may be applied to wireless and / or wired applications.

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

[0020] Destination device 14 includes an input interface 28, a video decoder 30, and a display device 34. Input interface 28 may include a receiver and / or a modem and receives encoded video data over link 16. The encoded video data communicated over link 16 or provided by recording device 32 may include various syntax elements generated by video encoder 20 for use in decoding the video data by video decoder 30. The encoded video data, which may include such syntax elements, is transmitted over a communications medium and stored on a recording medium or a file server.

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

[0022] The video encoder 20 and the video decoder 30 may be implemented using VVC, HEVC, MPEG-4 Part 10 AVC (Advanced Video Coding), or other similar standards. It is understood that the present application is not limited to a particular video encoding / decoding standard and may be applicable to other video encoding / decoding standards. It is generally contemplated that video encoder 20 of source device 12 may be configured to encode video data in accordance with any of these current or future standards. Similarly, it is generally contemplated that video decoder 30 of destination device 14 may be configured to decode video data in accordance with any of these current or future standards.

[0023] Video encoder 20 and video decoder 30 may each be implemented using one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), or other integrated circuits. The video encoder 20 may be implemented as any of a variety of suitable encoding circuitry configurations, such as a field programmable gate array (FPGA), discrete logic, software, hardware, firmware, or any combination thereof. When implemented partially in software, the electronic device may store instructions for the software on a suitable non-transitory computer-readable medium and execute the instructions in hardware using one or more processors to perform the video encoding / decoding processes disclosed in this disclosure. Each of the video encoder 20 and the video decoder 30 may be included in one or more encoders or decoders, any of which may be integrated as part of a combined encoder / decoder (CODEC) in the respective device.

[0024] 2 is a block diagram illustrating an example video encoder 20 according to some embodiments described herein. Video encoder 20 may perform intra-predictive and inter-predictive coding of video blocks within video frames. Intra-predictive coding relies on spatial prediction to reduce or remove spatial redundancy in video data within a given video frame or picture. Inter-predictive coding relies on temporal prediction to reduce or remove temporal redundancy in video data within adjacent video frames or pictures of a video sequence.

[0025] As shown in FIG. 2, the video encoder 20 includes a video data memory 40, a prediction processor 41, a decoded picture buffer (DPB) 64, an adder 50, a transform processor 52, a quantizer 54, and an entropy coder 56. The prediction processor 41 further includes a motion estimator 42, a motion compensation unit 44, a partitioner 45, an intra prediction processor 46, and an intra block copy (BC) unit 48. In some embodiments, the video encoder 20 also includes an inverse quantizer 58, an inverse transform processor 60, and an adder 62 for reconstructing video blocks. An in-loop filter 66 may be disposed between the adder 62 and the DPB 64 and includes a deblocking filter for filtering block boundaries to remove blockiness artifacts from the reconstructed video. In-loop filter 66 further includes a sample adaptive offset (SAO) and an adaptive in-loop filter (ALF) for filtering the output of summer 62 before it is input to DPB 64 and used to encode other video blocks. Video encoder 20 may take the form of a fixed or programmable hardware unit, or may be divided among one or more fixed or programmable hardware units.

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

[0027] As shown in FIG. 2, a partitioner 45 within the prediction processor 41 partitions the received video data into video blocks. This partitioning may include partitioning the video frame into slices, tiles, or other larger coding units (CUs) according to a predetermined partitioning structure, such as a quadtree structure, associated with the video data. The video frame may be partitioned into a number of video blocks (or sets of video blocks referred to as tiles). The prediction processor 41 may select one of a number of possible predictive coding modes, such as one of a number of intra-predictive coding modes or one of a number of inter-predictive coding modes, for the current video block based on the error result (e.g., coding rate or distortion level). The prediction processor 41 may provide the resulting intra-predictive or inter-predictive coded block to an adder 50 to generate a residual block, and may provide the coded block to an adder 62 for later reconstructing for use as part of a reference frame. The prediction unit 41 also provides syntax elements, such as motion vectors, intra mode indicators, partitioning information, and other such syntax information, to the entropy coding unit 56 .

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

[0029] In some embodiments, motion estimator 42 determines an inter prediction mode for a current video frame by generating a motion vector indicating a displacement of a prediction unit (PU) of a video block within a current video frame relative to a predictive block within a reference video frame according to a predetermined pattern within a sequence of video frames. Motion prediction performed by motion estimator 42 is a process of generating a motion vector that estimates the motion of a video block. The motion vector may indicate, for example, a displacement of a PU of a video block within a current video frame or picture relative to a predictive block within a reference frame (or other coding unit) relative to a current block to be coded within the current frame (or other coding unit). The predetermined pattern may designate the video frame as a P frame or a B frame in the sequence. Intra BC unit 48 may determine vectors, e.g., block vectors, for intra BC coding in a manner similar to the determination of motion vectors by motion estimator 42 for inter prediction, or may utilize motion estimator 42 to determine block vectors.

[0030] A prediction block is a block of a reference frame that is considered to closely correspond to the PU of the video block to be coded in terms of pixel difference. It is used to estimate the sum of absolute difference (SAD), sum of squared difference (SSD), and In some embodiments, video encoder 20 may calculate values ​​for sub-integer pixel locations of the reference frames stored in DPB 64. The motion estimation unit 42 may interpolate values ​​at quarter-pixel locations, eighth-pixel locations, or other fractional-pixel locations of the reference frame. Thus, motion estimator 42 may perform motion searches on whole pixel locations and fractional pixel locations to output motion vectors with fractional-pixel accuracy.

[0031] The motion estimation unit 42 calculates a motion vector for a PU of a video block of an inter-predictive coded frame by comparing the position of the PU with the position of a predictive block of a reference frame selected from a first reference frame list (List 0) or a second reference frame list (List 1), where the first reference frame list or the second reference frame list respectively identifies one or more reference frames stored in the DPB 64. The motion estimation unit 42 sends the calculated motion vector to the motion compensation unit 44 and then to the entropy coding unit 56.

[0032] The motion compensation performed by motion compensation unit 44 may include fetching or generating a predictive block based on the motion vector determined by motion estimation unit 42. When motion compensation unit 44 receives a motion vector for a PU of a current video block, it locates the predictive block to which the motion vector points in one of the reference frame lists, retrieves the predictive block from DPB 64, and forwards the predictive block to summer 50. Summer 50 then forms a residual video block of pixel difference values ​​by subtracting pixel values ​​of the predictive block provided by motion compensation unit 44 from pixel values ​​of the current video block to be coded. The pixel difference values ​​forming the residual video block may include luma or chroma difference components, or both. Motion compensation unit 44 may also generate syntax elements related to the video blocks of the video frames for use by video decoder 30 in decoding the video blocks of the video frames. The syntax elements may include, for example, syntax elements defining a motion vector used to identify a predictive block, any flags indicating a prediction mode, or other syntax information described herein. Note that motion estimation unit 42 and motion compensation unit 44 may be largely integrated, but are shown separately for conceptual purposes.

[0033] In some embodiments, the intra BC unit 48 may generate a vector to capture a predictive block in a manner similar to that described above with respect to the motion estimation unit 42 and the motion compensation unit 44, but the predictive block is in the same frame as the current block to be coded, and the vector is referred to as a block vector, as opposed to a motion vector. In particular, the intra BC unit 48 may determine to use an intra prediction mode to code the current block. In some examples, the intra BC unit 48 may code the current block using various intra prediction modes, e.g., during separate coding passes, and analyze the performance of the intra prediction modes by rate-distortion analysis. The intra BC unit 48 may then select an appropriate intra prediction mode among the various intra prediction modes tested to use in generating the intra mode indicator. For example, the intra BC unit 48 may use the rate-distortion analysis to calculate rate-distortion values ​​for the various intra prediction modes tested, 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 bitrate (i.e., number of bits) used to generate a coded block, along with the amount of distortion (or error) between the coded block and the original uncoded block that is coded to generate the coded block. Intra BC unit 48 may calculate the distortion-to-rate ratio for various coded blocks to determine the intra prediction mode that gives the best rate-distortion value for the block.

[0034] In other examples, the intra BC unit 48 may use, in whole or in part, the motion estimation unit 42 and the motion compensation unit 44 to perform such functions for intra BC prediction in accordance with the embodiments described herein. In this case, the predictive block may be a block that is considered to be a close counterpart of the block to be coded in terms of pixel differences, and may be determined by sum of absolute differences (SAD), sum of squared differences (SSD), or other difference measures. Identifying the predictive block may include calculating values ​​for sub-integer pixel positions.

[0035] Whether the predictive block is from the same frame via intra prediction or a different frame via inter prediction, video encoder 20 may form a residual video block by subtracting pixel values ​​of the predictive block from pixel values ​​of the current video block being encoded, forming pixel difference values. The pixel difference values ​​that form the residual video block may include both luma and chroma difference components.

[0036] The intra prediction unit 46 may intra predict the current video block as an alternative to inter prediction performed by the motion estimation unit 42 and the motion compensation unit 44 or intra block copy prediction performed by the intra BC unit 48, as described above. In particular, the intra prediction unit 46 may determine to use an intra prediction mode to encode the current block. To do so, the intra prediction unit 46 may encode the current block using various intra prediction modes, for example during separate encoding passes, and the intra prediction unit 46 (or a mode selection unit in some examples) may select an appropriate intra prediction mode to use from the tested intra prediction modes. The intra prediction unit 46 may provide information indicative of the selected intra prediction mode for the block to the entropy coder 56. The entropy coder 56 may encode the information indicative of the selected intra prediction mode in the bitstream.

[0037] After prediction processor 41 determines a predictive block for the current video block, either by inter prediction or intra prediction, adder 50 generates a residual video block by subtracting the predictive block from the current video block. The residual video data in the residual block may be included in one or more transform units (TUs) and provided to transform processor 52. Transform processor 52 performs a discrete cosine transform (DCT) to generate a residual video block. The residual video data is transformed into residual transform coefficients using a transform such as the residual video transform (RfD) or a conceptually similar transform.

[0038] The transform processor 52 may send the resulting transform coefficients to a quantizer 54, which quantizes the transform coefficients to further reduce the bit rate. The quantization process may also reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be varied by adjusting a quantization parameter. In some examples, the quantizer 54 may then perform a scan of a matrix containing the quantized transform coefficients. Alternatively, the entropy coder 56 may perform the scan.

[0039] Following quantization, the entropy coding unit 56 may use, for example, context adaptive variable length coding (CAVLC), context adaptive binary arithmetic coding (CABAC), syntax-based context adaptive binary arithmetic coding (SBAC), or the like. The quantized transform coefficients are entropy coded into a video bitstream using context-adaptive binary arithmetic coding (CAIC), probability interval partitioning entropy coding (PIPE), or another entropy coding technique or technique. The coded bitstream may then be transmitted to video decoder 30 or recorded on storage device 32 for later transmission to video decoder 30 or for later retrieval by video decoder 30. Entropy coding unit 56 may also entropy code motion vectors and other syntax elements for the current video frame being coded.

[0040] Inverse quantization unit 58 applies inverse quantization, and inverse transform unit 60 applies inverse transform to reconstruct the residual video block in the pixel domain to generate a reference block for predicting other video blocks. As mentioned above, motion compensation unit 44 may generate a motion compensated prediction block from one or more reference blocks of a frame stored in DPB 64. Motion compensation unit 44 may also apply one or more interpolation filters to the prediction block to calculate sub-integer pixel values ​​for use in motion estimation.

[0041] Summer 62 adds the reconstructed residual block to the motion compensated prediction block generated by motion compensation unit 44 to generate a reference block for storage in DPB 64. The reference block may then be used by intra BC unit 48, motion estimation unit 42, and motion compensation unit 44 as a prediction block to inter predict another video block in a subsequent video frame.

[0042] 3 is a block diagram illustrating an exemplary 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, an adder 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 may perform a decoding process that is generally inverse to the encoding process described for the video encoder 20 in connection with FIG. 2. For example, the motion compensation unit 82 may generate prediction data based on a motion vector received from the entropy decoding unit 80, while the intra prediction processing unit 84 may generate prediction data based on an intra prediction mode indicator received from the entropy decoding unit 80.

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

[0044] Video data memory 79 may store video data, such as an encoded video bitstream, that is decoded by other components of video decoder 30. The video data stored in video data memory 79 may be obtained from recording device 32, from a local video source, such as a camera, by wired or wireless network communication of the video data, or by accessing a physical data storage medium, such as a flash drive or hard disk. Video data memory 79 may include a coded picture buffer (CPB) that stores coded video data from the coded video bitstream. A decoded picture buffer (DPB) 92 of video decoder 30 stores reference video data used to code video data by video decoder 30 (e.g., in an intra-predictive coding mode or an inter-predictive coding mode). The video data memory 79 and DPB 92 may be implemented using a variety of memory devices, such as dynamic random access memory (DRAM: Resistive RAM), including synchronous dynamic random access memory (SDRAM: Synchronous DRAM), magneto-resistive RAM (MRAM: Magneto-resistive RAM), resistive RAM (RRAM), or other types of memory devices. For purposes of illustration, video data memory 79 and DPB 92 are depicted as two separate components of video decoder 30 in FIG. 3. However, it will be apparent to one skilled in the art that video data memory 79 and DPB 92 may be provided by the same memory device or separate memory devices. In some examples, video data memory 79 may be on-chip with other components of video decoder 30 or may be off-chip relative to those components.

[0045] During the decoding process, video decoder 30 receives an encoded video bitstream representing video blocks of encoded video frames and associated syntax elements. Video decoder 30 may receive video frame-level and / or video block-level syntax elements. An 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 a prediction processor 81.

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

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

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

[0049] Motion compensation unit 82 and / or intra BC unit 85 determine prediction information for video blocks of a current video frame by analyzing the motion vectors and other syntax elements, and then use the prediction information to generate predictive blocks for the current video block to be decoded. For example, motion compensation unit 82 uses some of the received syntax elements to determine a prediction mode (e.g., intra prediction or inter prediction) used to encode video blocks of the video frame, an inter prediction frame type (e.g., B or P), configuration information for one or more of the reference frame lists for the frame, a motion vector for each inter predictive coded video block in the frame, an inter prediction state for each inter predictive coded video block of the frame, and other information for decoding video blocks in the current video frame.

[0050] Similarly, intra BC unit 85 may use some of the received syntax elements, such as flags, to indicate that the current video block was predicted using an intra BC mode, that it is within the reconstructed region and that it is stored in DPB 92. Configuration information of the video blocks of the current frame, block vectors for each intra BC predicted video block of the frame, intra BC prediction states for each intra BC predicted video block of the frame, and other information for decoding video blocks in the current video frame may be determined.

[0051] Motion compensation unit 82 may also perform the interpolation using an interpolation filter such as that used to calculate sub-integer pixel interpolated values ​​of the reference block during encoding of the video block by video encoder 20. In this case, motion compensation unit 82 may determine from the received syntax elements the interpolation filter used by video encoder 20 and generate the predictive block using the interpolation filter.

[0052] An inverse quantizer 86 inverse quantizes the quantized transform coefficients provided in the bitstream and entropy decoded by entropy decoder 80 using the same quantization parameters calculated by video encoder 20 to determine the degree of quantization for each video block in a video frame. An inverse transform processor 88 applies an inverse transform, such as an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process, to the transform coefficients in order to reconstruct residual blocks in the pixel domain.

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

[0054] In a typical video coding process, a video sequence typically includes an ordered set of frames or pictures. 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 Cb chrominance samples. SCr is a two-dimensional array of Cr chrominance samples. In other cases, a frame may be black and white and therefore include only one two-dimensional array of luma samples.

[0055] As shown in FIG. 4A, the video encoder 20 (more specifically, the divider 45) generates a coded representation of a frame by first dividing the frame into a set of coding tree units (CTUs). A video frame may contain an integer number of CTUs sequentially ordered in a raster scan order from left to right and top to bottom. Each CTU is the largest logical coding unit, and the width and height of the CTUs are signaled by the video encoder 20 in the sequence parameter set such that all CTUs in a video sequence have the same size, which is one of 128×128, 64×64, 32×32, and 16×16. However, it should be noted that the present application is not necessarily limited to a particular size. As shown in FIG. 4B, each CTU is composed of one coding tree block (CTB) of luma samples, a corresponding coding tree block of two chrominance samples, and a symbolic block (SBC) used to code the samples in the coding tree block. The CTU may include syntax elements that describe the characteristics of various types of units of coding blocks of pixels and how a video sequence may be reconstructed at video decoder 30, including inter or intra prediction, intra prediction mode, motion vectors, and other parameters. For black and white pictures or pictures with three separate color planes, the CTU may include a single coding tree block and syntax elements used to code samples of the coding tree block. A coding tree block may be an N×N block of samples.

[0056] To achieve better performance, the video encoder 20 may recursively perform tree partitioning, such as binary-tree partitioning, ternary-tree partitioning, quad-tree partitioning, or a combination thereof, on the coding tree blocks of the CTU to partition the CTU into smaller coding units (CUs). As shown in FIG. 4C, a 64×64 CTU 400 is first partitioned into four smaller CUs, each with a block size of 32×32. Among the four smaller CUs, CU 410 and CU 420 are partitioned into four CUs, each with a block size of 16×16. Two 16×16 CUs 430 and 440 are further partitioned into four CUs, each with a block size of 8×8. FIG. 4D illustrates a quadtree data structure showing the final result of the partitioning process of the CTU 400 as illustrated in FIG. 4C, where each leaf node of the quadtree corresponds to one CU of a respective size ranging from 32×32 to 8×8. Each CU may include a coding block (CB) of luma samples, two corresponding coding blocks of chroma samples of the same size frame, and syntax elements used to code the samples of the coding block, similar to the CTU illustrated in FIG. 4B. In a monochrome picture or a picture with three separate color planes, the CU may include a single coding block and syntax structures used to code the samples of the coding block. It should be noted that the quadtree partitioning illustrated in FIG. 4C and FIG. 4D is merely illustrative, and one CTU may be partitioned into CUs based on quadtree / ternary / binary tree partitioning to fit various local characteristics. In the composite tree structure, one CTU is divided by a quadtree structure, and the leaf CU of each quadtree can be further divided by a binary tree structure and a ternary tree structure. As shown in Fig. 4E, there are five division types, including 4-way, horizontal 2-way, vertical 2-way, horizontal 3-way, and vertical 3-way.

[0057] In some embodiments, video encoder 20 may further divide the coding blocks of a CU into one or more M×N prediction blocks (PBs). A prediction block is a rectangular (square or non-square) block of samples to which a uniform (inter or intra) prediction is applied. A prediction unit (PU) of a CU may include a prediction block of luma samples, two corresponding prediction blocks of chroma samples, and syntax elements used to predict the prediction block. In a monochrome picture or a picture with three separate color planes, a PU may include a single prediction block and syntax structures used to predict the prediction block. Video encoder 20 may generate predicted luma, Cb and Cr blocks for luma, and Cb and Cr prediction blocks in each PU of a CU.

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

[0059] The video encoder 20 may further include a predictive luminance block for one or more PUs in a CU, a predictive After generating the Cb block and the predictive Cr block, video encoder 20 may generate a luma residual block for the CU by subtracting the predictive luma block of the CU from the original luma coding block of the CU, such that each sample in the luma residual block of the CU indicates a difference between a luma sample in one of the predictive luma blocks of the CU and a corresponding sample in the original luma coding block of the CU. Similarly, video encoder 20 may generate a Cb residual block and a Cr residual block of the CU, respectively, such that each sample in the Cb residual block of the CU indicates a difference between a Cb sample in one of the predictive Cb blocks of the CU and a corresponding sample in the original Cb coding block of the CU, and each sample in the Cr residual block of the CU may indicate a difference between a Cr sample in one of the predictive Cr blocks of the CU and a corresponding sample in the original Cr coding block of the CU.

[0060] Moreover, as shown in FIG. 4C, video encoder 20 uses quadtree partitioning to decompose 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 the same transform is applied. A transform unit (TU) of a CU may include a transform block of luma samples, two corresponding transform blocks of chroma samples, and syntax elements used to predict the transform block samples. Thus, each TU of a CU may be associated with a luma transform block, a Cb transform block, and a Cr transform block. In some examples, the luma transform block associated with a TU may be a sub-block of the luma residual block of the CU. The Cb transform block may be a sub-block of the Cb residual block of the CU. The Cr transform block may be a sub-block of the Cr residual block of the CU. In a monochrome picture or a picture with three separate color planes, a TU may include a single transform block and syntax structures used to transform the samples of the transform block.

[0061] Video encoder 20 may apply one or more transforms to a luma transform block of the TU to generate a luma coefficient block for the TU. The coefficient block may be a two-dimensional array of transform coefficients. The transform coefficients may be scalar quantities. Video encoder 20 may apply one or more transforms to a Cb transform block of the TU to generate a Cb coefficient block for the TU. Video encoder 20 may apply one or more transforms to a Cr transform block of the TU to generate a Cr coefficient block for the TU.

[0062] After generating a coefficient block (e.g., a luma coefficient block, a Cb coefficient block, or a Cr coefficient block), the video encoder 20 may quantize the coefficient block. Quantization generally refers to a process in which transform coefficients are quantized to somehow reduce the amount of data used to represent the transform coefficient, resulting in further compression. After quantizing the coefficient block, the video encoder 20 may entropy code syntax elements indicating the quantized transform coefficients. For example, the video encoder 20 may perform context-adaptive binary arithmetic coding (CABAC) on the syntax elements indicating the quantized transform coefficients. Finally, the video encoder 20 may output a bitstream including a series of bits forming a representation of the encoded frame and associated data, which may be stored on a recording device 32 or transmitted to a destination device 14.

[0063] After receiving the bitstream generated by video encoder 20, video decoder 30 may parse the bitstream to obtain syntax elements from the bitstream. Video decoder 30 may reconstruct frames of video data based at least in part on the syntax elements obtained from the bitstream. The process of reconstructing video data is generally the reverse of the encoding process performed by video encoder 20. For example, video decoder 30 may perform an inverse transform on coefficient blocks associated with the TUs of the current CU to reconstruct residual blocks associated with the TUs of the current CU. Video decoder 30 may also convert samples of predictive blocks for the PUs of the current CU into corresponding current samples. Video decoder 30 may reconstruct the frame after reconstructing the coding blocks for each CU in the frame.

[0064] As mentioned above, video coding mainly uses two modes, intra-frame prediction (i.e., intra-prediction) and inter-frame prediction (i.e., inter-prediction), to achieve video compression. Palette-based coding is another coding scheme adopted by many video coding standards. Palette-based coding is particularly suitable for coding screen generated content, in which a video coder (e.g., video encoder 20 or video decoder 30) forms a palette table of colors representing a given block of video data. The palette table includes the most dominant (e.g., frequently used) pixel values ​​in a given block. Pixel values ​​that are not frequently represented in the video data of a given block are not included in the palette table or are included in the palette table as avoided colors.

[0065] Each entry in the palette table includes an index for a corresponding pixel value in the palette table. A palette index for a sample in a block may be coded to indicate the entry in the palette table used to predict or reconstruct the sample. This palette mode begins with the process of generating a palette predictor for the first block of a picture, slice, tile, or such grouping of video blocks. As described below, palette predictors for subsequent video blocks are generally generated by updating a previously used palette predictor. For illustrative purposes, it is assumed that the palette predictor is defined at the picture level. In other words, a picture may contain multiple coding blocks, each with its own palette table, but there is one palette predictor for the entire picture.

[0066] To reduce the number of bits required to signal palette entries in a video bitstream, a video decoder may utilize a palette predictor to determine new palette entries for a palette table used to reconstruct a video block. For example, the palette predictor may include palette entries from a previously used palette table, or may be initialized with a most recently used palette table by including all entries of the most recently used palette table. In some embodiments, the palette predictor may include fewer than all entries from the most recently used palette table and then incorporate some entries from other previously used palette tables. The size of the palette predictor may be the same, larger, or smaller compared to the size of the palette tables used to encode different blocks. In one example, the palette predictor is implemented as a first-in-first-out (FIFO) table containing 64 palette entries.

[0067] To generate a palette table for a block of video data from the palette predictor, the video decoder may receive a one-bit flag for each input of the palette predictor from the encoded video bitstream. The one-bit flag may have a first value (e.g., a binary 1) indicating that the associated input of the palette predictor is included in the palette table or a second value (e.g., a binary 0) indicating that the associated input of the palette predictor is not included in the palette table. If the size of the palette predictor is larger than the palette table used for the block of video data, the video decoder may stop receiving further flags once the maximum size of the palette table is reached.

[0068] In some embodiments, some entries in the palette table are not determined using a palette predictor, but are instead signaled directly in the encoded video bitstream. For such an entry, the video decoder may receive three separate m-bit values ​​from the coded video bitstream indicating pixel values ​​for the luma and two chroma components associated with the entry, where m represents the bit depth of the video data. Palette entries derived from a palette predictor require only a one-bit flag, as opposed to multiple m-bit values ​​required for directly signaled palette entries. Thus, using the palette predictor to signal some or all of the palette entries can significantly reduce the number of bits required to signal the entries of a new palette table, thereby improving the overall coding efficiency of palette mode coding.

[0069] In many cases, a palette predictor for a block is determined based on a palette table used to code one or more previously coded blocks. However, when coding the first coding tree unit in a picture, slice, or tile, the palette table of the previously coded block may not be available. Thus, the palette predictor cannot be generated using entries in the previously used palette table. In such cases, a set of palette predictor initializers, values ​​used to generate a palette predictor when the previously used palette table is not available, may be signaled in a sequence parameter set (SPS) and / or a picture parameter set (PPS). An SPS generally refers to a syntax structure of syntax elements that fits into a set of consecutive coded video pictures, called a coded video sequence (CVS), as determined by the content of syntax elements found in a PPS referenced by syntax elements found in each slice segment header. A PPS generally refers to a syntax structure of syntax elements that fits into one or more individual pictures within a CVS, as determined by the content of syntax elements found in each slice segment header. Thus, an SPS is generally considered a higher level syntax structure than a PPS, meaning that the syntax elements contained in an SPS generally change less frequently and fit a larger portion of the video data compared to the syntax elements contained in a PPS.

[0070] FIG. 5 illustrates a portion of a video frame 500 in a bitstream according to some embodiments. The video frame 500 includes a number of pixels, each of which is made up of a number of color components (e.g., blue, green, and red). In video encoding and decoding, color information of the pixels is represented by a number of luma samples 502 and a number of chroma samples 504. Each of the pixels corresponds to a respective luma sample 502, and each luma sample 502 corresponds to a respective pixel in the video frame 500. Each chroma sample 504 corresponds to a respective set 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 (e.g., 4:1:1, 4:2:0, 4:2:2, 4:4:4, 4:4:0). Specifically, the luma samples 502 and chroma samples 504 of the video frame 500 conform to a subsampling scheme having a three-part ratio equal to 4:1:1, such that, on average, every four luma samples 502 correspond to one chroma sample 504 having a blue color difference component Cb and a red color difference component Cr.

[0071] 6 is a block diagram of an in-loop filter 600 applied in video encoder 20 or video decoder 30 in accordance with some embodiments. In video encoding or coding, each of luma samples 502 and chroma samples 504 is reconstructed from residual blocks of a video frame 500 and filtered through a deblocking filter, one or more sample adaptive offset (SAO) filters 602, and one or more of the in-loop filters 600 (e.g., in-loop filters 66 and 94 of FIGS. 2 and 3) to remove artifacts. The deblocking filter 602 and the ALF 604 are each configured to filter the luma samples 502 or the chroma samples 504 based on samples of the same type, e.g., to filter each luma sample 502 based on a respective set of neighboring luma samples 502 and to filter each luma sample 502 based on a respective set of neighboring chroma samples 504. In some embodiments, the in-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 neighboring the respective chroma sample 504. Conversely, in some embodiments, the in-loop filter 600 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.

[0072] Specifically, the video encoder 20 or the decoder 30 obtains a plurality of luma samples 502 and a plurality of chroma samples 504 of a video frame 500. Each luma sample 502 has a respective luma value, and each chroma sample 504 has a respective luma value. The SAO filter 602 compensates each of the plurality of luma samples 502 and the plurality of chroma samples 504. Specifically, 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 filter 602. Each compensated luma sample 612 is based on a set of adjacent compensated luma samples 612 and updates luma sample 606 using luma ALF 604A, and each compensated chroma sample 614A and 614B is based on a set of adjacent compensated chroma samples 614 and updates chroma sample 608A or 608B using chroma ALF 604B.

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

[0074] Each of the deblocking filter, SAO filter, and ALF of the in-loop filter 600 includes one or more in-loop filter coefficients, and the cross-component ALF 610 also includes multiple cross-component filter coefficients. The in-loop filter coefficients and cross-component filter coefficients are signaled in an adaptation parameter set (APS). In one example, the APS carries and signals multiple sets (e.g., up to 25 sets) of luma filter coefficients and clip value indexes, and multiple sets (e.g., up to 8 sets) of chroma filter coefficients and clip value indexes. The APS is transferred in the bitstream along with the video frame 500 from the video encoder 20 to the video encoder 30, i.e., the APS is a bitstream transport overhead. In some embodiments, a separate classification of filter coefficients for the luma component of the luma samples 502 reduces the bitstream transport overhead. In one example, the index of the APS used for an image slice is signaled in the corresponding slice header.

[0075] FIG. 7A is an example ALF filtering scheme 700 in which a luma sample 502A is processed by a luma ALF 604A based on a set of associated luma samples 502B, and FIG. 7B is an example ALF filtering scheme 750 in which a chroma sample 504A is processed by a chroma ALF 604B 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 7×7 diamond shape) and selects from a number of predefined filters (e.g., 25 filters with predefined filter coefficients) for each 4×4 block based on the local gradient direction and function. Each square in FIG. 7A represents a luma sample 502 labeled with the corresponding filter coefficient (C0-C12) of the luma ALF 604A, which has a diamond shape. To combine the 25 luma samples 502 using the luma ALF 604A, a total of 13 filter coefficients (C0-C12) are symmetrically applied to the luma samples 502A. Similarly, the chroma ALF 604B has a diamond filter shape (e.g., a 5×5 diamond shape) and is selected from a number of predefined filters (e.g., 8 filters with predefined filter coefficients). Each square in FIG. 7B represents a chroma sample 504 labeled with a corresponding filter coefficient (C0-C6) of the chroma ALF 604B, which has a diamond shape. To combine the 13 chroma samples 504 in the chroma ALF 604B, a total of 7 filter coefficients (C0-C6) are symmetrically applied to the chroma sample 504A.

[0076] For example, when adaptive loop filtering is enabled for the CTB, each image sample R(i,j) within the CU (e.g., luma sample 502A, chroma sample 504A) is filtered to obtain a sample value R′(i,j) of the following formula:

[0077]

number

[0078] For clipping in adaptive loop filtering, each image sample contains a set of associated image samples at the filter length L of the ALF 604. With reference to FIG. 7A, the associated luma sample 502B of each luma sample 502A includes three rows of luma samples (i.e., nine luma samples) above the respective luma sample 502A, three rows of luma samples (i.e., nine luma samples) below the respective luma sample 502A, three luma samples to the left of the respective luma sample 502A, and three luma samples to the right of the respective luma sample 502A. Referring to FIG. 7B, the associated color difference samples 504B of each color difference sample 504A include two rows of color difference samples (i.e., four color difference samples) above each color difference sample 504A, two rows of color difference samples (i.e., four color difference samples) below each color difference sample 50rA, two color difference samples to the left of each color difference sample 504A, and two color difference samples to the right of each color difference sample 504A.

[0079] In some embodiments, the filter parameters of the ALF are signaled in the APS, which includes a clip value index representing the aforementioned clipping parameter c(k,l). In the APS, up to 25 sets of luma filter coefficients (e.g., set C0-C12 in FIG. 7A) and clipping value indexes, and up to 8 sets of chroma filter coefficients (e.g., set C0-C6 in FIG. 7B) and clipping value indexes may be signaled. To reduce the overhead of signaling bits, filter coefficients of different classes for luma samples 502A may be combined. In the slice header, the index of the APS used for the current slice is signaled. The clipping value index decoded from the APS allows the clipping boundary values ​​to be determined using a predefined clipping boundary value formula or table. These boundary clipping values ​​depend on the internal bit depth and define the dynamic range within which the difference between the associated image sample and the set of image samples 502A or 504A is clipped. In some embodiments, separate predefined clipping boundary value formulas or tables are applied for luma samples 502A and chroma samples 504A.

[0080] In some embodiments, multiple APS indices (e.g., seven indices) may be signaled in the slice header to select a subset of multiple corresponding luma and chroma filter sets for adaptive loop filtering in the current slice. This adaptive loop filtering process may be controlled at the CTB level. A flag is signaled to indicate whether adaptive loop filtering is applied to the luma CTB. In response to determining that the flag enables adaptive loop filtering, the luma CTB selects a luma filter set among multiple (e.g., 16) luma filter sets. An index of the luma filter set is signaled for the luma CTB to indicate the luma filter set to be applied. Each of the multiple filter sets is predefined and hard-coded in both the encoder 20 and the decoder 30, and only the index of the luma filter set needs to be transmitted in the bitstream carrying the video frame 500. Similarly, for the chroma sample 504A, when the flag enables adaptive loop filtering, an index of the chroma filter set is signaled in the slice header to select one of the multiple chroma filter sets for adaptive loop filtering of the current slice. If there are multiple chrominance filter sets in the APS, for each chrominance CTB, the index of the chrominance filter set is signaled at the CTB level. Each of the filter sets is stored locally in the video encoder or video decoder with the filter coefficients f(k,l) and clipping parameters c(k,l), or the index of the filter coefficients f(k,l) and clipping parameters c(k,l).

[0081] In some embodiments, the filter coefficients are quantized with a norm equal to 128. If the value of a filter coefficient that has a non-neutral point is [-2 7 ~2 7 Bitstream adaptation is applied so that the filter coefficients with neutral points are estimated to be 128 without being signaled in the bitstream.

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

[0083] Each clip value index corresponds to a respective clipping boundary value M equal to a power of 2 with the respective clipping number as an index, and each clipping number i is an integer. The ALF 604 clips the difference between each of the set of related image samples 804 and each image sample 802 to a dynamic range DR defined by the respective clipping boundary value M associated with the respective clip value index. Each image sample 802 (e.g., luma sample 502A, chroma sample 504A) is modified based on the respective filter coefficients with the clipped difference of each of the set of related image samples 804 such that an image frame can be reconstructed using a plurality of modified image samples 802. When the boundary values ​​are restricted to a power of 2 with an integer index, the step of clipping the difference between each of the related image samples 804 and each image sample 802 includes only logical AND and / or OR operations. By these means, this clipping operation does not include any comparison operation for each image sample 802, thereby reducing the amount of calculations required for adaptive loop filtering and saving computational resources from the encoding of the corresponding video frame.

[0084] In some embodiments, for a first block of image samples, a single set of clip value indexes is determined for all image samples 802 in the first block. The set of clip value indexes is transferred from the video encoder 20 to the video decoder 30 along with the block of image samples, enabling the ALF 604 to process each of the image samples 802 in the first block based on the same single set of clip value indexes. Exemplary blocks are entire video frames, slices, bricks, tiles, tile groups, coding trees, or any other coding units. Furthermore, in some embodiments, the video frame includes a second block different from the first block. The second set of clip value indexes is used for adaptive loop filtering of the image samples 802 in the second block. The second set of clip value indexes is determined separately from the single set of clip value indexes used for the first block of the image.

[0085] 9A-9C are three examples of predefined clipping boundary value tables 900A-900C according to some embodiments. Each of the predefined clipping boundary value tables 900 associates a set of clip value indexes 902 with a set of clipping boundary values ​​(M) 904 according to a set of internal bit depth indexes (IBDI) 906. Every clipping boundary value M in these tables 900A-900C is equal to a power of 2 with the respective clipping number i as the index. Each clipping boundary value table 900 is applied to the ALF 604 as a reference to determine the clipping boundary value M for each clip value index. For example, for a first image sample 802 of a video frame, when the difference between one of its associated image samples 804A and the first image sample 802 is clipped, this associated image sample 804A is provided with a respective clip value index 902A (i.e., 0), and an IBDI 906A (e.g., IBDI=10) may be determined from the filtered first image sample 802. A respective clipping boundary value 904A (i.e., 1024) is identified from a predefined clipping boundary value table 900A at the intersection of the column corresponding to the clip value index 902A and the row corresponding to the IBDI 906A.

[0086] Each clipping boundary value 904 is equal to a power of 2 with the respective clipping number i as an exponent. For the same clip value index (e.g., 902A), each clipping number i is an integer that increases linearly with IBDI 906. Each boundary value 904(M) is expressed as a function of the respective clipping number i by the following equation: M=2 i (1)

[0087] In some embodiments, for each associated image sample 804 used for adaptive loop filtering of the first image sample 802, the clipped difference between the associated image sample 804 and the first image sample 802 is in the range [-M, M-1], i.e., [-2i ,2 i Alternatively, in some embodiments, the clipped difference between the associated image sample 804 and the first image sample 802 falls within the range [-M+1, M], i.e., [-2 i +1,2 i ]. Alternatively, in some embodiments, the clipped difference between the associated image sample 804 and the first image sample 802 is in the range [-M+1, M-1], i.e., [-2 i +1,2 i Alternatively, in some embodiments, the clipped difference between the associated image sample 804 and the first image sample 802 falls in the range [-M,M], i.e., [-2 i ,2 i ].

[0088] In some embodiments, the predefined clipping boundary value table 900 used for filtering a block of image samples 802 is obtained in a bitstream carrying the block, allowing updating of the table 900 for each block of image samples 802. Exemplary blocks are entire video frames, slices, bricks, tiles, tile groups, coding trees, or any other coding units. Alternatively, two copies of the same predefined clipping boundary value table 900 used in adaptive loop filtering are stored separately in the video encoder 20 and the video decoder 30. During filtering of a block of image samples 802, the predefined clipping boundary value table 900 is not received in a video frame, but is instead retrieved from a local memory that previously stores one or more separate predefined clipping boundary value tables (e.g., a subset or all of tables 900A-900C). Each image sample 802 of a block shares a set of clip value indexes and boundary value table indicators. A set of clip value indexes and boundary value table indicators are obtained in the bitstream in association with a block of image samples 802, and one or more clipping boundary value tables are stored locally. Based on the boundary value table indicator, one of the clipping boundary value tables 900 is selected and applied to a clipping operation for filtering each image sample 802 in the block.

[0089] The predetermined clipping boundary value table 900A is expressed by the following equation:

[0090]

number

[0091] The clipping boundary value for the clip value index 2 is different between the predetermined clipping boundary value tables 900A and 900B. The predetermined clipping boundary value table 900B is expressed by the following formula: It is expressed as:

[0092]

number

[0093] In some embodiments, the clipping boundary value table 900B is not stored in the local memory, but rather, equation (3) is stored. For each image sample 802, a clipping boundary value is determined for each associated image sample 804 based on the IBDI and the respective clip value index according to the above predetermined clipping boundary value equation (3).

[0094] The clipping boundary value for a clip value index of 1 differs between the predetermined clipping boundary value tables 900A and 900C. The predetermined clipping boundary value table 900C is expressed by the following equation.

[0095]

number

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

[0097] 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 clip value indexes defining a respective clip value index for each of a set of associated luma samples 502B at a first filter length L1 of each luma sample 502A. The subset of chroma samples 504A corresponds to a second set of clip value indexes defining a respective clip value index for each of a set of associated chroma samples 504B at a second filter length L2 of each chroma sample 504A. The second set of clip value indexes is different from the first set of clip value indexes. Furthermore, in some embodiments, each of the first and second sets of clip value indexes corresponds to a table or formula of clipping boundary values, associating each clip value index in each set of clip value indexes to a respective clipping boundary value based on the IBDI. Additionally, in some embodiments, the clipping boundary value table or formula is selected from a predefined number of clipping boundary value tables or formulas. Alternatively, in some embodiments, the first and second sets of clip value indexes are selected from a first clipping boundary value table / formula and a first clipping boundary value table / formula. The table / formula for the ping boundary values ​​corresponds to a table / formula for a second value that is different from the table / formula for the ping boundary values.

[0098] FIG. 10 is a data structure of a clipped value 1000 for an image sample 802 according to some embodiments. The image sample 802 corresponds to one of the luma samples 502 and chroma samples 504 of a video frame. In some embodiments, the clipped value 1000 corresponds to the difference between the associated image sample 804 and the image 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 right-most bit. The bit indices increase by one from the LSB towards the most significant bit (MSB), which is the left-most bit. In some embodiments, the dynamic range for clipping the difference between the associated image sample 804 and the respective image sample 802 is defined by an upper clipping limit −M and a lower clipping limit M−1, expressed in the form [−M,M−1], where M is 2. i The corresponding clipping operation may be implemented as a logical "AND" and / or logical "OR" operation performed on the bit range from the (i+1)th bit to the MSB. Using logical "AND" and / or logical "OR" operations is simpler than performing a comparison-based clipping operation.

[0099] In one example, the value to be clipped, 1000, is -2 11 ~2 11 Assume that the clipping limit is represented by an 11-bit value with a range of [-2 4 ,2 4 We define a dynamic range of 1000 [1000-1000-1] and the bits in the range from the 5th bit to the MSB need to be examined to determine if the value 1000 exceeds the dynamic range defined by the upper and lower values. If the value 1000 to be clipped is positive, a logical "OR" operation is performed on all those bits in the range from the 5th bit to the MSB. If the result of the logical "OR" operation is 1, then the value 1000 is 2 4 -1 or greater, 2 4If the value 1000 to be clipped is negative, a logical "AND" operation is performed on all those bits in the range from the 5th bit to the MSB. If the result of the logical "AND" operation is 0, the value 1000 is clipped to -2. 4 Less than -2 4 is clipped to

[0100] In another example, the value 1000 to be clipped is in the range of -16 to 15. The value 1000 has 5 bits. The most significant bit is used to represent the sign of the value 1000, and the other 4 bits are used to represent the magnitude of the value 1000. The clip boundary is 4, and the dynamic range of clipping is [-2 2 ,2 2 -1]. If the input value 1000 is 14 (binarized as 01110), a logical "or" operation is applied to the third and fourth bins, resulting in a 1, indicating that the input value 1000 exceeds the upper limit, and is therefore clipped to the upper limit value of 3. If the input value 1000 is 2 (binarized as 00010), a logical "or" operation is applied to the third and fourth bins, resulting in a 0, indicating that the input value 1000 does not exceed the upper limit, and is therefore left unchanged. If the input value 1000 is -14 (binarized as 10010), a logical "and" operation is applied to the third and fourth bins, resulting in a 0, indicating that the input value 1000 is below the lower limit, and is set to the lower limit value of -4. If the input value 1000 is -2 (binarized as 11110), then a logical "and" operation is applied to the third and fourth bins, resulting in a 1, indicating that the input value 1000 is not below the lower limit, so it is left unchanged.

[0101] FIG. 11 is a flow diagram of a video encoding method 1100 according to some embodiments. The video encoding method 1100 is implemented in an electronic device having a video encoder 20 or a video 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 the luma sample 502 and the chroma sample 504. For each of the plurality of image samples 802, the 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 at a filter length L of each image sample 802. For each of the sets of related image samples 804, a respective clip value index and corresponding filter coefficients are identified (1108). The difference between each of the sets of related image samples 804 and each image sample 802 is clipped based on the respective clip value index (1110). The respective clip value index corresponds to a respective clipping boundary value equal to a power of two indexed by the respective clipping number i (1112), where the respective clipping number i is an integer. The electronic device modifies (1114) each image sample 802 with the clipped difference of each of the sets of related image samples 804 based on the respective filter coefficients. A video frame is reconstructed (1116) using the modified image samples 802. In some embodiments, the multiple image samples 802 form a block of the video frame. A block is optionally an entire video frame, a slice, a brick, a tile, a tile group, a coding tree, or any other coding unit.

[0102] In some embodiments, for each image sample 802, an IBDI for the respective image sample 802 is determined (1118). For each of the set of related image samples 804, the electronic device determines (1120) a respective clipping boundary value based on the IBDI and a respective clip value index from the predefined clipping boundary value table 900. The difference between each of the set of related image samples 804 and the respective image sample 802 is clipped (1122) based on the respective clipping boundary value. Furthermore, in some embodiments, the predefined clipping boundary value table 900 is obtained in the bitstream. Alternatively, in some embodiments, the predefined clipping boundary value table 900 is retrieved from a local memory. The local memory may store multiple 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 multiple clipping boundary value tables. Examples of the predefined clipping boundary value table 900 are shown in Figures 9A-9C.

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

[0104] In some embodiments, for each of the sets of related image samples, the clip value index is selected from a number of consecutive numbers (e.g., 0, 1, 2, and 3). Each clipping number i is at least a function of the clipping value index, i.e., varies with the clipping value index. Also, each clipping number i has a linear relationship with the IBDI for each clip value index. For example, when the clip value index is 0, each clipping number i is equal to the IBDI, and when the clip value index is 3, each clipping number i is equal to IBDI minus 7.

[0105] In some embodiments, for each of a set of related image samples, the clipped difference of each related image sample is in the range [-2 i ,2 i -1].

[0106] In some embodiments, for each of a set of related image samples, The clipped difference of the associated image samples is [-2 i +1,2 i ], [-2 i ,2 i ], and [-2 i +1,2 i The range is one of several, including -1.

[0107] In some embodiments, clipping the difference between each of the sets of related image samples and the respective image sample comprises only logical AND and / or OR operations.

[0108] 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 indexes defining a respective clip value index for each of the set of associated luma samples 502B in the first filter length L1 of each luma sample 502A. The subset of chroma samples 504A corresponds to a second set of clip value indexes defining a respective clip value index for each of the set of associated chroma samples 504B in the second filter length L2 of each chroma sample 504A. The second set of clip value indexes is different from the first set of clip value indexes. Furthermore, in some embodiments, each of the first and second sets of clip value indexes corresponds to a table or formula of clipping boundary values, which associates each clip value index in each set of clip value indexes with a respective clipping boundary value based on the IBDI. Additionally, in some embodiments, the table or formula of clipping boundary values ​​corresponding to the first or second set of clip value indexes is selected from a predefined number of tables or formulas of clipping boundary values. Further, in some embodiments, the first and second sets of clip value indexes correspond to a first clipping boundary value table / formula and a second value table / formula that is different from the first clipping boundary value table / formula.

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

[0110] The terminology used in the description of the embodiments herein is for the purpose of describing only certain embodiments and is not intended to limit the scope of the claims. As used in the description of the embodiments and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. The term "and / or" as used herein is also understood to refer to and include any and all possible combinations of one or more of the associated listed items. It is further understood that the terms "comprise" and / or "comprising" as used herein specify the presence of stated features, elements, and / or components, but do not exclude the presence or addition of one or more other features, elements, components, and / or groups thereof.

[0111] Terms such as first, second, etc. may be used herein to describe various elements. However, it should be understood that these elements should not be limited by these terms. These terms are merely used to distinguish one element from another. For example, a first electrode may be referred to as a second electrode, and similarly, a second electrode may be referred to as a first electrode, without departing from the scope of the embodiment. The first electrode and the second electrode are both electrodes, but are not the same electrode.

[0112] The description in this application has been presented for purposes of illustration and description and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications, variations, and alternative embodiments will be apparent to those skilled in the art having the benefit of the teachings presented in the foregoing description and the associated drawings. The embodiments have been selected and described in order to best explain the principles and practical applications of the invention, to enable others skilled in the art to understand the invention in terms of various embodiments, and to best utilize the basic principles and various embodiments with various modifications as appropriate for the particular use contemplated. It is therefore to be understood that the claims are not limited to the specific examples of the disclosed embodiments and modifications thereof, but that other embodiments are contemplated to be included within the scope of the appended claims.

Claims

1. 1. A method for encoding video data, comprising the steps of: obtaining a plurality of image samples of a video frame from a bitstream, each image sample corresponding to one of a luma sample and a chroma sample; for each of the plurality of image samples, filtering the 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 at the filter length L of each of the image samples; identifying, for each of the set of related image samples, a respective clip value index and corresponding filter coefficients; clipping the difference between each of the sets of associated image samples and the respective image sample based on the respective clip value index, the respective clip value index corresponding to a respective clipping boundary value equal to a power of two with a respective clipping number as an exponent, the respective clipping number being an integer; modifying the respective image samples with the clipped difference of each of the set of related image samples based on the respective filter coefficients; reconstructing the video frame using the plurality of modified image samples; A method comprising:

2. 2. The method of claim 1 , clipping the difference based on the respective clip value index for each image sample, determining an IBDI for each of the image samples; determining, for each of the set of related image samples, a respective clipping boundary value based on the IBDI and the respective clip value index according to a predefined clipping boundary value table; clipping the difference between each of the sets of related image samples and the respective image sample based on the respective clipping boundary value; The method further comprising:

3. 3. The method of claim 2, further comprising the step of obtaining the predetermined clipping boundary value table in the bitstream.

4. 3. The method of claim 2, further comprising the step of retrieving the predetermined clipping boundary value table from a local memory.

5. 5. The method of claim 4, the local memory stores a plurality of clipping boundary value tables; The method further comprising the step of selecting the predetermined clipping boundary value table from the plurality of clipping boundary value tables.

6. 3. The method of claim 2, The method of claim 1, wherein the predetermined clipping boundary value table is expressed as one of the following three tables: 【Table 1】

7. 2. The method of claim 1 , clipping the difference based on the respective clip value index for each image sample, determining an IBDI for each of the image samples; determining, for each of the set of related image samples, a respective clipping boundary value based on the IBDI and the respective clip value index according to a predetermined clipping boundary value formula; clipping the difference between each of the sets of related image samples and the respective image sample based on the respective clipping boundary value; Further comprising:

5. The method of claim 1, wherein the predetermined clipping boundary value equation is expressed as one of the following equations, where CVI is the respective clipping value index and CBV is the respective clipping boundary value for each of the sets of associated image samples: [0010]

8. 8. A method according to claim 1, wherein for each of the sets of related image samples, the clip value index is selected from 0, 1, 2 and 3, and the respective clipping number i is at least a function of the clipping value index.

9. 9. A method according to claim 1, wherein for each of the set of related image samples, the clipped difference of the respective related image sample is in the range [-2 i , 2 i -1] method.

10. 10. A method according to claim 1, wherein for each of the set of related image samples, the clipped difference of the respective related image sample is within the range of [-2 i +1, 2 i ], [-2 i , 2 i ], and [-2 i +1, 2 i −1].

11. 11. The method according to claim 1, wherein clipping the difference between each of the sets of related image samples and the respective image sample comprises only logical AND and / or OR operations.

12. 12. The method according to any one of claims 1 to 11, the plurality of image samples includes a subset of luma samples and a subset of chroma samples; The subset of luminance samples is filtered by a first filter length L 1 corresponding to a first set of clip value indices defining a respective clip value index for each of the sets of associated luma samples in The subset of color difference samples has a second filter length L 2 a second set of clip value indices defining a respective clip value index for each of the sets of associated chrominance samples in the first set of clip value indices, the second set of clip value indices being different from the first set of clip value indices; method.

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

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

15. 13. The method of claim 12, wherein the first and second sets of clip value indices correspond to a first clipping boundary value table / formula and a second value table / formula that is different from the first clipping boundary value table / formula.

16. one or more processors; a memory having instructions stored therein; An electronic device, wherein the one or more processors perform a method according to any one of claims 1 to 15 by executing the instructions.

17. 16. A non-transitory computer readable medium having instructions stored thereon, the instructions being executed by one or more processors to perform a method according to any one of claims 1 to 15.