Cross-component sample adaptive offset
Through the cross-component sample adaptive offset technology, the video frame is classified and processed using the correlation between brightness and chromaticity samples, which solves the problem of reconstructing sample artifacts in the prior art, and achieves more efficient image quality improvement and phase Avoid moving problems.
Patent Information
- Application Number
- CN202380037308.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-29
- Filing Date
- 2023-04-28
- Publication Date
- 2024-12-13
AI Technical Summary
Existing video encoding and decoding techniques have compression artifact problems in the processing of reconstructed samples, especially in the fact that band artifacts and ring artifacts caused by quantization errors of high-frequency components are difficult to effectively suppress, and the traditional sample adaptability is biased. Shifting technology has phase shift problems when dealing with multichromatic components.
The cross component sample adaptive offset (CCSAO) technology is introduced to classify the current sample using the correlation between brightness and chromaticity samples, and offset processing is performed based on the classification results, combining deblocking filters and loop filters to Reduce artifacts and are suitable for video encoding and decoding at multiple sampling rates and phases.
It effectively reduces compression artifacts in reconstructed video frames, improves image quality, especially avoids phase shift problems during multi-chromatic component processing, and enhances the accuracy of encoding and decoding and image clarity.
Smart Images

Figure CN119137961A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure is part of a non-provisional application that claims priority to U.S. Provisional Patent Application No. 63 / 336,402, filed on April 29, 2022. The contents of the above-listed applications are incorporated herein by reference in their entirety. Technical Field
[0003] The present disclosure generally relates to video coding and decoding. In particular, the present disclosure relates to a method for refining reconstructed samples using Cross-Component Sample Adaptive Offset (CCSAO). Background Art
[0004] Unless otherwise indicated herein, the approaches described in this section are not prior art to the claims listed below and are not admitted to be prior art by inclusion in this section.
[0005] High-Efficiency Video Coding (HEVC) is an international video codec standard developed by the Joint Collaborative Team on Video Coding (JCT-VC). HEVC is based on a hybrid block-based motion compensation DCT transform-like codec architecture. The basic unit of compression, called a coding unit (CU), is a 2Nx2N square pixel block. Each CU can be recursively divided into four smaller CUs until a predetermined minimum size is reached. Each CU contains one or more prediction units (PUs).
[0006] Versatile video coding (VVC) is the latest international video codec standard developed by the Joint Video Expert Team (JVET) of ITU-TSG16 WP3 and ISO / IEC JTC1 / SC29 / WG11. The input video signal is predicted from a reconstructed signal derived from the coded picture region. The prediction residual signal is processed by block transform. The transform coefficients are quantized and entropy coded along with other auxiliary information in the bitstream. The reconstructed signal is generated from the prediction signal and the reconstructed residual signal after inverse transforming the dequantized transform coefficients. The reconstructed signal is further processed by loop filtering to remove codec artifacts. The decoded picture is stored in a frame buffer and used to predict future pictures in the input video signal.
[0007] In VVC, a coded picture is divided into non-overlapping square block areas represented by associated coding tree units (CTUs). A coded picture can be represented by a set of fragments, each fragment containing an integer number of CTUs. The CTUs in a fragment are processed continuously in a raster scan. Intra-frame prediction or inter-frame prediction can be used to decode bi-predictive (B) fragments, where there are at most two motion vectors and reference indices to predict the sample values of each block. Prediction (P) fragments are decoded using intra-frame prediction or inter-frame prediction with at most one motion vector and reference index to predict the sample values of each block. Intra-frame (I) fragments are decoded using only intra-frame prediction.
[0008] CTU can be divided into one or more non-overlapping coding units (CU) using a quadtree (QT) with a nested multi-type-tree (MTT) structure to accommodate various local motion and texture features. CU can be further divided into smaller CUs using one of five partitioning types: quadtree partitioning, vertical binary tree partitioning, horizontal binary tree partitioning, vertical center side ternary tree partitioning, and horizontal center side ternary tree partitioning.
[0009] Each CU contains one or more prediction units (PUs). The prediction unit, together with the associated CU syntax, serves as the basic unit for sending prediction information. The specified prediction process is used to predict the values of the relevant pixel samples within the PU. Each CU may contain one or more transform units (TUs) for representing prediction residual blocks. A transform unit (TU) consists of a transform block (TB) of luminance samples and two corresponding transform blocks of chrominance samples, each TB corresponding to a residual block of samples from one color component. Integer transform is applied to the transform block. The level value of the quantization coefficient is entropy encoded and decoded in the bitstream together with other auxiliary information. The terms coding tree block (CTB), coding block (CB), prediction block (PB) and transform block (TB) are defined as 2D sample arrays specifying a color component associated with CTU, CU, PU and TU, respectively. Therefore, a CTU consists of a luminance CTB, two chrominance CTBs and related syntax elements. Similar relationships are valid for CU, PU and TU.
[0010] Sample Adaptive Offset (SAO) is a technique used in video codecs to reduce compression artifacts in reconstructed video frames. SAO is used to suppress banding artifacts (false edges) and ringing artifacts caused by quantization errors of high-frequency components in the transform domain. In HEVC, the SAO filter is adaptively applied to all samples that meet certain conditions, such as based on gradients. SAO is a process that modifies decoded samples by conditionally adding an offset to each sample based on the value in a lookup table transmitted by the encoder after the deblocking filter is applied. HEVC specifies two SAO types or classifications that can select SAO operations for each CTU: Band Offset (BO) or Edge Offset (EO). Both SAO types add a certain offset to the sample, which is selected from the lookup table based on the local gradient at the sample position. When BO is applied, the pixel intensity or pixel value is classified into 32 fixed bands. (So, for 8-bit samples, the width of each band is 8 pixel values.) The offset of a specific band will be added to all pixels that fall in that specific band. When EO is applied, the neighboring pixels of the block are used to classify the block into one of four EO types: EO-0 (0 degrees), EO-1 (90 degrees), EO-2 (135 degrees), and EO-3 (45 degrees). For each EO type, each sample within the CTB is classified into one of five categories: local minimum, positive edge, flat area, negative edge, and local maximum. Each category has its corresponding edge offset. Summary of the invention
[0011] The following summary is illustrative only and is not intended to be binding in any way. That is, the following summary is provided to introduce the concepts, highlights, benefits and advantages of the novel and non-obvious technologies described herein. Selected but not all embodiments are further described in the detailed description below. Therefore, the following summary is not intended to identify the essential features of the claimed subject matter, nor is it intended to be used to determine the scope of the claimed subject matter.
[0012] Some embodiments of the present invention provide a video coding method for cross-component sample adative offset (CCSAO). A video codec receives a current sample at a current pixel position of a current block being coded. The video codec selects a luma sample and two chroma samples as luma and chroma co-located samples at the current pixel position. The video codec selects a pixel classification from a plurality of pixel classifications based on the values of the selected luma and chroma co-located samples at the current pixel position. The video codec performs an offset lookup based on the selected pixel classification. The video codec applies the offset to update the current sample. The video codec encodes or decodes the current block based on the updated current sample.
[0013] In some embodiments, only one of the plurality of candidate luma samples in the neighborhood of the current pixel position is qualified as the luma co-located sample of the current pixel position. The neighborhood of the current pixel position may include eight candidate luma samples around the current pixel position and one candidate luma sample at the center position of the neighborhood of the current pixel position, and the selected luma co-located sample is located at the center position of the neighborhood of the current pixel position. In some embodiments, the candidate luma sample at the center position is implicitly selected as the luma co-located sample without being sent in the bitstream.
[0014] In some embodiments, only a subset of the plurality of candidate luma samples near the current pixel position is eligible to be selected as luma co-located samples or used to derive the luma co-located samples for the current pixel position. For example, the plurality of candidate luma samples may include nine luma samples, and the qualified subset of the plurality of candidate luma samples may include only four candidate luma samples. In some embodiments, a linear average of two or more candidate luma samples selected from the qualified subset of the plurality of candidate luma samples is used as the selected luma co-located sample.
[0015] In some embodiments, a first classification index is calculated based on the values of luma and chroma co-located samples selected for a current pixel position, a second classification index is calculated based on the difference between adjacent candidate luma samples (near the current pixel position) relative to a specific threshold, and a pixel class is selected using the first classification index and the second classification index. In some embodiments, the specific threshold is determined based on the bit depth of the current sample. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are included to provide a further understanding of the present disclosure and are incorporated into and constitute a part of the present disclosure. The accompanying drawings illustrate embodiments of the present disclosure and together with the description are used to explain the principles of the present disclosure. It is worth noting that the drawings are not necessarily drawn to scale, as certain components may be shown out of proportion to size in actual implementations in order to clearly illustrate the concepts of the present disclosure.
[0017] Figure 1 The video encoding and decoding workflow when cross-component sample adaptive offset (CCSAO) is applied is shown.
[0018] Figure 2 Candidate positions for the CCSAO classifier are shown.
[0019] Figure 3 Conceptual illustration of the pixel pattern of CCSAO edge offset (EO) sample classification.
[0020] Figure 4 Conceptually illustrating candidate positions for the CCSAO classifier when the center position is always selected as the brightness co-located sample.
[0021] Figure 5 A simplified set of candidate positions for luma co-located samples for CCSAO offset decision is conceptually shown.
[0022] Figure 6 An example video encoder is shown that can implement CCSAO.
[0023] Figure 7 A process for performing CCSAO in some embodiments is conceptually illustrated.
[0024] Figure 8 An example video decoder is shown that can implement CCSAO.
[0025] Fig. 9 A process for performing CCSAO in some embodiments is conceptually illustrated.
[0026] Fig.10 An electronic system for implementing some embodiments of the present disclosure is conceptually illustrated. DETAILED DESCRIPTION
[0027] In the following detailed description, many specific details are set forth by way of example in order to provide a thorough understanding of the relevant teachings. Any variations, derivations, and / or extensions based on the teachings described herein are within the scope of protection of the present disclosure. In some cases, well-known methods, processes, components, and / or circuits associated with one or more example embodiments disclosed herein may be described at a relatively high level without details to avoid unnecessarily obscuring aspects of the teachings of the present disclosure.
[0028] Ⅰ. Cross Component Sample Adaptive Offset (CCSAO)
[0029] Cross-component Sample Adaptive Offset (CCSAO) operates as part of the SAO process and uses the correlation between the three color components (e.g., YUV) as a further guide to refine the reconstructed samples. Like SAO, CCSAO divides the reconstructed samples into different categories, derives an offset for each category, and adds the offset to the reconstructed samples in the category. However, unlike traditional SAO that only uses a single component of the current sample (either luminance or chrominance) as input, CCSAO uses all three color components (luminance and chrominance) to classify the current sample into different categories.
[0030] Figure 1 FIG. 1 shows a video codec workflow when applying cross-component sample adaptive offset (CCSAO). FIG. 1 shows a video codec workflow of a loop filter 100 of a video encoder or decoder. Figure 6 An example video encoder that may incorporate the functionality of loop filter 100 is described below. Figure 8 An example video decoder that may incorporate the functionality of loop filter 100 is described below.
[0031] The loop filter 100 receives the current samples (reconstructed or decoded pixel data) of all color components (YUV) and applies a deblock filter (DBF) 110, a sample adaptive offset (SAO) 120, and a cross-component sample adaptive offset (CCSAO) 130. The output of the loop filter 100 is sent to a reconstructed or decoded picture buffer for display and / or encoding of subsequent pixel blocks.
[0032] As shown, the reconstructed (or decoded) pixel data of the color components are processed by their corresponding deblocking filters. The output samples from the deblocking filters are used as inputs to SAO 120 and CCSAO 130. SAO 120 and CCSAO 130 are applied to all three components. Both SAO 120 and CCSAO 130 include units for each YUV component (SAO-Y, SAO-U, SAO-V; CCSAO-Y, CCSAO-U, CCSAO-V). The output of each color component from the deblocking filter 110 is provided to the SAO of the corresponding corresponding color component. The output of each color component from the deblocking filter 110 is provided to the CCSAO of all three components. In other words, the SAO of the color component depends only on the samples of the component, while the CCSAO of any color component depends on the samples of all three color components, thereby allowing cross-component sample offsets. The offsets generated by SAO 120 and CCSAO 130 are applied (added) to the output samples of the loop filter 100.
[0033] In order to apply band offset (BO) in CCSAO, for a given reconstructed sample, three co-located samples {Y col , U col 、V col} to represent the three components of a given sample. Luminance co-located samples (Y col ) can be selected from a plurality of candidate co-located positions. In some embodiments, the luminance co-located sample (Y col ) can be selected from 9 candidate positions, while the same chrominance sample position (U col and V col ) is fixed. Figure 2 Candidate positions for the CCSAO classifier are shown.
[0034] Three selected co-located samples {Y col , U col 、V col} is used to classify a given sample into one of many different classifications corresponding to different combinations of YUV components. The values of the three co-located samples are classified into three different band indices {band Y 、band U 、band V}, each band index identifies a BO classification for a color component. The three band indices for the three component YUVs are defined according to the following formula:
[0035] band Y =(Y col *N Y )>>BD
[0036] bandU =(U col *N U )>>BD
[0037] band V = (V col * N V ) >> BD (1)
[0038] where {Y col , U col , V col} are the three co-located samples selected for classifying the current sample; {N Y , N U , N V} are respectively applied to {Y col , U col , V col}The number of equally divided frequency bands of the full range. BD is the internal codec bit depth. Band index {band Y , band U , band V} is used to determine a joint index i representing the BO classification for a given sample. The joint index i is defined as:
[0039] i=band Y *(N U *N V ) + band U *N V + band V (2)
[0040] A CCSAO offset is determined and added to the reconstructed (luminance or chrominance) samples that fall into the category indicated by index i:
[0041] C' rec = Clip1(C rec + σ CCSAO [i]) (3)
[0042] C rec and C' rec are the reconstructed (chroma) samples before and after applying CCSAO, respectively. The term σCCSAO[i] is the CCSAO offset applied to the i-th BO class.
[0043] As with SAO, different classifiers are applied to different local regions to further enhance the overall image quality. The parameters of each classifier (e.g., Y col 、N Y 、N U 、N Vand offset positions) are sent at the picture level, and the classifier to be used is explicitly sent and switched at the CTB level. For each classifier, {N Y ,N U ,N V The maximum value of} is set to {16,4,4} and the offset is clamped in the range [-15,15]. At most 4 classifiers are used per frame.
[0044] In some embodiments, the outputs of SAO, bilateral filter (BIF), and CCSAO are added to the reconstructed chroma samples (provided by the deblocking buffer or DBF) and are jointly cropped. The cropped results are provided as chroma samples to an adaptive loop filter (ALF) for further processing in the video encoding and decoding process.
[0045] Similar to the edge classifier of SAO in VVC, CCSAO's edge-based classifier can also use one-dimensional direction patterns to classify samples: horizontal, vertical, 135° diagonal, and 45° diagonal. Figure 3 Pixel patterns for CCSAO edge offset (EO) sample classification are conceptually shown. Each pixel pattern includes 3 pixels in a one-dimensional direction. The four one-dimensional directional diagrams correspond to 0° or horizontal (EO classification = 0), 90° or vertical (EO classification = 1), 135° diagonal (EO classification = 2), and 45° diagonal (EO classification = 3). For each one-dimensional pattern, each sample is classified according to the sample difference between the brightness sample value marked as "c" and its two adjacent brightness samples marked as "a" and "b" along the selected one-dimensional pattern.
[0046] Similar to SAO, the encoder can use rate-distortion optimization (RDO) to decide the best 1-D directional mode and send this additional information in each classifier / set. The sample difference values "ac" and "bc" are compared with a predetermined threshold (Th) to derive the final "class_idx" information. The encoder can select the best "Th" value from the predetermined threshold array based on RDO, and the index in the "Th" array is sent.
[0047] Furthermore, an additional difference between the CCSAO edge-based classifier and the SAO edge classifier in VVC is that in the case of the CCSAO edge-based classifier, the chroma samples use co-located luma samples to derive edge information (samples "a", "c", and "b" are co-located luma samples), while in the case of the SAO edge classifier, the chroma samples use their own neighboring samples to derive edge information. The CCSAO edge-based classifier process is expressed as follows:
[0048] Ea=(ac<0)? (ac<(-Th)? 0:1) : (ac<(Th)? 2:3) (4)
[0049] Eb=(bc<0)? (bc<(-Th)? 0:1) : (bc<(Th)? 2:3) (5)
[0050] class_idx = iB*16 + Ea*4 + Eb (6)
[0051] C'rec = Clip1 (C rec + σ CCSAO [class_idx]) (7)
[0052] Index i B It can be exported as follows:
[0053] i B =(cur*N cur )>>BD or
[0054] i B =(col1*N col1 )>>BD or
[0055] i B = (col2*N col2 ) >> BD (8)
[0056] "cur" is the sample currently being processed, col1 and col2 are the samples at the same position. When the sample currently being processed is the brightness sample Y, col1 and col2 are the samples at the same position C respectively. b and C r Sample. When the sample currently being processed is chrominance (C b ) sample, col1 and col2 are Y and C in the same position respectively. r Sample. When the sample currently being processed is chrominance (C r ) sample, col1 and col2 are Y and C in the same position respectively. bSamples. Based on rate-distortion optimization (RDO), the encoder may send one of the samples "cur", "col1", "col2" used in deriving the frequency band information.
[0057] A. Selection of Brightness Co-located Samples
[0058] As mentioned above, in CCSAO-BO, the locations of brightness co-located samples can be as follows Figure 2 One of the nine positions shown. Allowing multiple candidate luma co-located samples helps to handle different sampling rates and different phases in different color components (e.g., YUV420, YUV422, YUV411, or YUV444). However, allowing multiple candidate luma co-located samples may cause phase shift problems when CCSAO-BO is applied to the luma component. To prevent phase shift problems, in some embodiments, when CCSAO-BO is applied to the luma component, the video codec removes (i.e., does not allow) the selection of (the position of) luma co-located samples. The corresponding syntax for indicating the selected position of the luma co-located sample is not sent, and the selected position of the luma co-located sample is inferred to be the center position, i.e., the position of the sample to be processed (in Figure 2 In some embodiments, the corresponding syntax for indicating the selected position of the luma co-located samples is conditionally sent in CCSAO-BO. In some embodiments, when CCSAO-BO is applied to the luma component, the corresponding syntax for indicating the selected position of the luma co-located samples is always sent, but the value should indicate the center position, i.e., the position sample to be processed.
[0059] Figure 4 Conceptually illustrates the candidate positions for the CCSAO classifier when the center position is always selected as the luma co-located sample. As shown, the candidate luma sample at position "4" is the only eligible candidate that can be selected as the luma co-located sample for CCSAO offset classification.
[0060] B. Simplified Candidates for Brightness Co-located Samples
[0061] As mentioned above, in CCSAO-BO, the location of the brightness co-located sample can be one of nine locations (labeled "0" to "8"), such as Figure 2As shown. The motivation for allowing multiple candidates for luma co-located samples is to facilitate the handling of different sampling rates and different subsampling phases in different color components (e.g., YUV420, YUV422, YUV411, or YUV444). However, the phases at different sampling rates are typically confined to a 2x2 region of the corresponding luma position. (For example, if the chroma position in a picture is (x, y), and the sampling ratios of luma and chroma are different, the chroma phase is typically located in a 2x2 region from (2x, 2y) to (2x+1, 2y+1). Therefore, in some embodiments, the candidates for luma co-located samples are reduced from a 3x3 square with a center position of (2x, 2y) to a 2x2 square with a top left corner of (2x, 2y).
[0062] More generally, in some embodiments, only a subset of candidate luma samples in the neighborhood of the current pixel position are eligible to be selected as luma co-located samples or used to derive luma co-located samples for the current pixel position. For example, in some embodiments, the candidates for luma co-located samples are reduced from sample positions {0,1,2,3,4,5,6,7,8} to sample positions {4,5,7,8}, referring to Figure 5 , which shows a simplified set of candidate positions of luma co-located samples for CCSAO offset decision.
[0063] In some embodiments, the number of candidate luma co-located samples is greater than 4, but only luma samples in one 2x2 square are used to generate corresponding co-located samples by linear or nonlinear combination. For example, the linear combination can be the average of {4} and {7}, the average of {4}, {5}, {7} and {8}, the weighted average of {4}, {5}, {7} and {8}, etc. The nonlinear combination can be the maximum of {4}, {5}, {7} and {8}, the minimum of {4}, {5}, {7} and {8}, the median of {4}, {5}, {7}, {8}, the common value among {4}, {5}, {7}, {8}, the different values among {4}, {5}, {7} and {8}, etc. After reducing the candidate object from a 3x3 square with a center position of (2x, 2y) to a 2x2 square with a top left corner position of (2x, 2y), the processing of CCSAO-BO boundary conditions (e.g., picture boundary, virtual boundary, sub-picture boundary, tile boundary, fragment boundary, etc.) becomes similar to SAO-BO. That is, the boundary processing in SAO-BO can be applied to CCSAO-BO.
[0064] C. Unified EO classification rules for CCSAO-EO and SAO-EO
[0065] In CCSAO-EO, the class index (class_idx in equation (7), or CCSAO-EO_class_idx) can be calculated according to the following equation:
[0066] CCSAO-EO-Ea=(ac<0)? (ac<(-Th)?0:1):(ac<(Th)?2:3) (9)
[0067] CCSAO-EO-Eb=(bc<0)? (bc<(-Th)?0:1):(bc<(Th)?2:3) (10)
[0068] CCSAO_EO_class_idx=i B *16+CCSAO-EO-Ea*4+CCSAO-EO-Eb (11)
[0069] The term i in equation (10) B *16 is the classification index contributed by BO, and the rest of equation (11) is the classification index contributed by EO. The classification method in equation (11) is asymmetric, that is, the classification results are different when adjacent samples a and b are swapped. On the other hand, for SAO-EO, the classification index is calculated by the following equation:
[0070] SAO-EO-Ea = (ac<0)? (ac<(-Th) ? 0 : 1) : (ac < (Th) ? 1 : 2) (12)
[0071] SAO-EO-Eb = (bc<0)? (bc<(-Th) ? 0 : 1) : (bc < (Th) ? 1 : 2) (13)
[0072] SAO_EO_class_idx = SAO-EO-Ea + SAO-EO-Eb (14)
[0073] In SAO-EO, “Th” is set to 0. The classification method in equation (14) is symmetric, that is, the classification results are the same when adjacent samples a and b are exchanged.
[0074] Some embodiments provide a method for unifying the classification methods of CCSAO-EO and SAO-EO. In some embodiments, the equations SAO-EO-Ea and SAO-EO-Eb are used to replace CCSAO-EO-Ea and CCSAO-EO-Eb in equation (10). That is, the equation is modified as follows:
[0075] CCSAO_EO_class_idx=iB*16+SAO-EO-Ea*3+SAO-EO-Eb (15)
[0077] Equation (15) is still asymmetric, and "Th" can be different and sent in CCSAO-EO. In some embodiments, the classification of CCSAO-EO can be modified as follows:
[0078] CCSAO_EO_class_idx = iB * 16 + SAO-EO-Ea + SAO-EO-Eb (16)
[0079] Equation (16) is symmetric, "Th" can be different and sent in CCSAO-EO. In some embodiments, the classification of SAO-EO is modified as follows:
[0080] SAO_EO_class_idx = CCSAO-EO-Ea*4 + CCSAO-EO-Eb (17)
[0081] Equation (17) is asymmetric, and "Th" is inferred to be 0. In some embodiments, the classification of SAO-EO is modified as follows:
[0082] SAO_EO_class_idx = SAO-EO-Ea*3 + CCSAO-EO-Eb (18)
[0083] Equation (18) is asymmetric, and "Th" is inferred to be 0. In some embodiments, different "Th" values are supported in SAO-EO and the selected value is sent in the bitstream. The "Th" values supported in SAO-EO can be different from those in CCSAO-EO, the same as CCSAO-EO, or a subset of CCSAO-EO.
[0084] In some embodiments, the "Th" (threshold) value depends on the input bit depth. When the input bit depth changes, the "Th" value will also change accordingly. For example, when the input bit depth is equal to 8, a set of "Th" values is defined. If the input bit depth increases from 8 to 10, the value corresponding to "Th" is also multiplied by (1<<(10-8)). In some embodiments, symmetric and asymmetric classification methods are supported in CCSAO-EO, and a flag is sent to indicate which method is used.
[0085] II. Example Video Encoder
[0086] Figure 6An example video encoder 600 is shown that can implement cross-component prediction. As shown, the video encoder 600 receives an input video signal from a video source 605 and encodes the signal into a bitstream 695. The video encoder 600 has several components or modules for encoding the signal from the video source 605, including at least some components selected from the following: a transform module 610, a quantization module 611, an inverse quantization module 614, an inverse transform module 615, an intra-frame estimation module 620, an intra-frame prediction module 625, a motion compensation module 630, a motion estimation module 635, a loop filter 645, a reconstructed picture buffer 650, an MV buffer 665, an MV prediction module 665, and an entropy encoder 690. The motion compensation module 630 and the motion estimation module 635 are part of the inter-frame prediction module 640.
[0087] In some embodiments, modules 610-690 are software instruction modules executed by one or more processing units (e.g., processors) of a computing device or electronic device. In some embodiments, modules 610-690 are hardware circuit modules implemented by one or more integrated circuits (ICs) of an electronic device. Although modules 610-690 are shown as separate modules, some modules may be combined into a single module.
[0088] The video source 605 provides a raw video signal that presents the pixel data of each video frame without compression. The subtractor 608 calculates the difference between the raw video pixel data of the video source 605 and the predicted pixel data 613 from the motion compensation module 630 or the intra-frame prediction module 625 as a prediction residual 609. The transform module 610 converts the difference (or residual pixel data or residual signal 608) into transform coefficients (e.g., by performing a discrete cosine transform or DCT). The quantization module 611 quantizes the transform coefficients into quantization data (or quantization coefficients) 612, which are encoded into a bitstream 695 by the entropy encoder 690.
[0089] The inverse quantization module 614 dequantizes the quantized data (or quantized coefficients) 612 to obtain transform coefficients, and the inverse transform module 615 performs an inverse transform on the transform coefficients to generate a reconstructed residual 619. The reconstructed residual 619 is added to the predicted pixel data 613 to generate reconstructed pixel data 616. In some embodiments, the reconstructed pixel data 617 is temporarily stored in a line buffer (not shown) for intra prediction and spatial MV prediction. The reconstructed pixels are filtered by the loop filter 645 and stored in a reconstructed picture buffer 650. In some embodiments, the reconstructed picture buffer 650 is a memory external to the video encoder 600. In some embodiments, the reconstructed picture buffer 650 is a memory internal to the video encoder 600.
[0090] The intra estimation module 620 performs intra prediction based on the reconstructed pixel data 617 to generate intra prediction data. The intra prediction data is provided to the entropy encoder 690 to be encoded into a bitstream 695. The intra prediction data is also used by the intra prediction module 625 to generate the predicted pixel data 613.
[0091] The motion estimation module 635 performs inter-frame prediction by generating MVs to refer to pixel data of previously decoded frames stored in the reconstructed picture buffer 650. These MVs are provided to the motion compensation module 630 to generate predicted pixel data.
[0092] Instead of encoding the complete actual MV in the bitstream, the video encoder 600 uses MV prediction to generate a predicted MV, and the difference between the MV used for motion compensation and the predicted MV is encoded as residual motion data and stored in the bitstream 695.
[0093] The MV prediction module 675 generates a predicted MV based on a reference MV generated for encoding a previous video frame, i.e., a motion compensated MV for performing motion compensation. The MV prediction module 675 obtains the reference MV from the previous video frame from the MV buffer 665. The video encoder 600 stores the MV generated for the current video frame in the MV buffer 665 as a reference MV for generating a predicted MV.
[0094] The MV prediction module 675 uses the reference MV to create a predicted MV. The predicted MV can be calculated by spatial MV prediction or temporal MV prediction. The difference (residual motion data) between the predicted MV and the motion compensation MV (MC MV) of the current frame is encoded into the bit stream 695 by the entropy encoder 690.
[0095] The entropy encoder 690 encodes various parameters and data into a bitstream 695 by using an entropy coding technique such as context-adaptive binary arithmetic coding (CABAC) or Huffman coding. The entropy encoder 690 encodes various header elements, flags along with quantized transform coefficients 612 and residual motion data as syntax elements into the bitstream 695. The bitstream 695 is then stored in a storage device or transmitted to a decoder via a communication medium such as a network.
[0096] The loop filter 645 performs filtering or smoothing operations on the reconstructed pixel data 617 to reduce encoding and decoding artifacts, especially at the boundaries of pixel blocks. In some embodiments, the filtering or smoothing operations performed by the loop filter 645 include a deblocking filter (DBF), a sample adaptive offset (SAO), a cross-component adaptive offset (CCSAO), and / or an adaptive loop filter (ALF). Figure 1 An example loop filter that applies a CCSAO offset to YUV samples is described.
[0097] In some embodiments, when determining the CCSAO offset to be applied to the current pixel sample, the loop filter 645 always selects the candidate luma sample at the current pixel position (or the closest) position, unless the entropy encoder 690 explicitly sends it in the bitstream. In some embodiments, only a subset of the candidate luma samples in the vicinity of the current pixel position (e.g., 4 out of 9) are eligible to be selected as luma co-located samples or used to derive luma co-located samples for the current pixel position. In some embodiments, the loop filter 645 calculates a classification index based on the difference between adjacent candidate luma samples (in the vicinity of the current pixel position) relative to a specific threshold determined based on the bit depth of the current sample. Some CCSAO operations of the loop filter 845 are described in Section I above.
[0098] Figure 7 A process 700 for performing CCSAO in some embodiments is conceptually illustrated. In some embodiments, one or more processing units (e.g., processors) of a computing device implementing encoder 600 perform process 700 by executing instructions stored in a computer-readable medium. In some embodiments, an electronic device implementing encoder 600 performs process 700.
[0099] The encoder receives (at block 710) a current sample at a current pixel position of a current block being encoded.
[0100] The encoder selects (at block 720) one luma sample and two chroma samples as luma and chroma co-located samples for the current pixel position. In some embodiments, only one of the plurality of candidate luma samples in the neighborhood of the current pixel position qualifies as the luma co-located sample for the current pixel position. The neighborhood of the current pixel position may include eight candidate luma samples around the current pixel position and one candidate luma sample at the center of the neighborhood of the current pixel position, and the selected luma co-located sample is located at the center of the neighborhood of the current pixel position. In some embodiments, the candidate luma sample at the center is implicitly selected as the luma co-located sample without being sent in the bitstream.
[0101] In some embodiments, only a subset of the plurality of candidate luma samples in the vicinity of the current pixel position is eligible to be selected as luma co-located samples or used to derive the luma co-located samples for the current pixel position. For example, the plurality of candidate luma samples may include nine luma samples, and the qualified subset of the plurality of candidate luma samples may include only four candidate luma samples. In some embodiments, a linear average of two or more candidate luma samples selected from the qualified subset of the plurality of candidate luma samples is used as the selected luma co-located sample.
[0102] The encoder selects (at block 730) a pixel class from a plurality of pixel classes based on the values of the luma and chroma co-located samples selected for the current pixel position. In some embodiments, a first class index is calculated based on the values of the luma and chroma co-located samples selected for the current pixel position (e.g., equation (2) or (8)), a second class index is calculated based on the difference between neighboring candidate luma samples (near the current pixel position) relative to a particular threshold (e.g., equation (15) or (16)), and the pixel class is selected using the first class index and the second class index (e.g., equations (6) and (7)). In some embodiments, the particular threshold is determined based on the bit depth of the current sample.
[0103] The encoder performs (at block 740) a lookup of the offset based on the selected pixel classification. The encoder updates (at block 750) the current sample (eg, equation (7)) by applying the offset.
[0104] The encoder encodes the current block based on the updated current samples (at block 760).
[0105] III. Sample Video Decoder
[0106] In some embodiments, the encoder may send (or generate) one or more syntax elements in a bitstream so that the decoder may parse the one or more syntax elements from the bitstream.
[0107] Figure 8An example video decoder 800 that can perform CCSAO is shown. As shown, the video decoder 800 is an image decoding or video decoding circuit that receives a bitstream 895 and decodes the contents of the bitstream into pixel data of a video frame for display. The video decoder 800 has several components or modules for decoding the bitstream 895, including some components selected from the following: an inverse quantization module 811, an inverse transform module 810, an intra-frame prediction module 825, a motion compensation module 830, a loop filter 845, a decoded picture buffer 850, an MV buffer 865, an MV prediction module 875, and a parser 890. The motion compensation module 830 is part of the inter-frame prediction module 840.
[0108] In some embodiments, modules 810-890 are software instruction modules executed by one or more processing units (e.g., processors) of a computing device. In some embodiments, modules 810-890 are hardware circuit modules implemented by one or more ICs of an electronic device. Although modules 810-890 are shown as separate modules, some modules may be combined into a single module.
[0109] The parser 890 (or entropy decoder) receives the bitstream 895 and performs initial parsing according to the syntax defined by the video coding or image coding standard. The parsed syntax elements include various header elements, flags, and quantized data (or quantized coefficients) 812. The parser 890 parses out various syntax elements by using entropy coding techniques (e.g., context-adaptive binary arithmetic coding (CABAC) or Huffman encoding).
[0110] The inverse quantization module 811 dequantizes the quantized data (or quantized coefficients) 812 to obtain transform coefficients, and the inverse transform module 810 inversely transforms the transform coefficients 816 to generate a reconstructed residual signal 819. The reconstructed residual signal 819 is added to the predicted pixel data 813 from the intra prediction module 825 or the motion compensation module 830 to generate decoded pixel data 817. The decoded pixel data is filtered by the loop filter 845 and stored in the decoded picture buffer 850. In some embodiments, the decoded picture buffer 850 is a memory external to the video decoder 800. In some embodiments, the decoded picture buffer 850 is a memory internal to the video decoder 800.
[0111] The intra prediction module 825 receives intra prediction data from the bitstream 895 and, accordingly, generates predicted pixel data 813 from decoded pixel data 817 stored in the decoded picture buffer 850. In some embodiments, the decoded pixel data 817 is also stored in a line buffer (not shown) for intra prediction and spatial MV prediction.
[0112] In some embodiments, the contents of the decoded picture buffer 850 are used for display. The display device 855 either obtains the contents of the decoded picture buffer 850 for direct display, or obtains the contents of the decoded picture buffer to a display buffer. In some embodiments, the display device receives pixel values from the decoded picture buffer 850 via pixel transfer.
[0113] The motion compensation module 830 generates predicted pixel data 813 from decoded pixel data 817 stored in the decoded picture buffer 850 according to motion compensated MV (MC MV). These motion compensated MVs are decoded by adding residual motion data received from the bitstream 895 to the predicted MV received from the MV prediction module 875.
[0114] The MV prediction module 875 generates a predicted MV based on a reference MV generated for decoding a previous video frame (e.g., a motion compensated MV for performing motion compensation). The MV prediction module 875 obtains the reference MV of the previous video frame from the MV buffer 865. The video decoder 800 stores the motion compensated MV generated for decoding the current video frame in the MV buffer 865 as a reference MV for generating a predicted MV.
[0115] The loop filter 845 performs filtering or smoothing operations on the decoded pixel data 817 to reduce encoding and decoding artifacts, particularly at the boundaries of pixel blocks. In some embodiments, the filtering operation performed includes sample adaptive offset (SAO). In some embodiments, the filtering operation includes an adaptive loop filter (ALF).
[0116] Reference above Figure 1An example loop filter that applies a CCSAO offset to a YUV sample is described. In some embodiments, when deciding the CCSAO offset to apply to the current pixel sample, the loop filter 845 always selects the candidate luma sample at the current pixel position (or closest to the current pixel position), unless otherwise explicitly overridden by the entropy decoder 890 via syntax from the bitstream 895. In some embodiments, only a subset of candidate luma samples in the vicinity of the current pixel position (e.g., 4 out of 9) are eligible to be selected as luma co-located samples or for deriving luma co-located samples for the current pixel position. In some embodiments, the loop filter 845 calculates a classification index based on the difference between adjacent candidate luma samples (in the vicinity of the current pixel position) relative to a specific threshold determined based on the bit depth of the current sample. Some CCSAO operations of the loop filter 845 are described in Section I above.
[0117] Fig. 9 Conceptually, a process 900 for performing CCSAO in some embodiments is shown. In some embodiments, one or more processing units (e.g., processors) of a computing device implementing decoder 800 perform process 900 by executing instructions stored in a computer-readable medium. In some embodiments, an electronic device implementing decoder 800 performs process 900.
[0118] The decoder receives (at block 910) a current sample at a current pixel position of a current block being decoded.
[0119] The decoder selects (at block 920) one luma sample and two chroma samples as luma and chroma co-located samples for the current pixel position. In some embodiments, only one of the multiple candidate luma samples in the neighborhood of the current pixel position qualifies as the luma co-located sample for the current pixel position. The neighborhood of the current pixel position may include eight candidate luma samples around the current pixel position and one candidate luma sample at the center of the neighborhood of the current pixel position, and the selected luma co-located sample is located at the center of the neighborhood of the current pixel position. In some embodiments, the candidate luma sample at the center is implicitly selected as the luma co-located sample without being sent in the bitstream.
[0120] In some embodiments, only a subset of the plurality of candidate luma samples in the vicinity of the current pixel position is eligible to be selected as luma co-located samples or used to derive the luma co-located samples for the current pixel position. For example, the plurality of candidate luma samples may include nine luma samples, and the qualified subset of the plurality of candidate luma samples may include only four candidate luma samples. In some embodiments, a linear average of two or more candidate luma samples selected from the qualified subset of the plurality of candidate luma samples is used as the selected luma co-located sample.
[0121] The decoder selects (at block 930) a pixel class from a plurality of pixel classes based on the values of the luma and chroma co-located samples selected for the current pixel position. In some embodiments, a first class index is calculated based on the values of the luma and chroma co-located samples selected for the current pixel position (e.g., equation (2) or (8)), a second class index is calculated based on the difference between neighboring candidate luma samples (in the vicinity of the current pixel position) relative to a particular threshold (e.g., equation (15) or (16)), and the pixel class is selected using the first class index and the second class index (e.g., equations (6) and (7)). In some embodiments, the particular threshold is determined based on the bit depth of the current sample.
[0122] The decoder performs (at block 940) a lookup of the offset based on the selected pixel classification. The decoder updates (at block 950) the current sample by applying the offset (eg, equation (7)).
[0123] The decoder reconstructs (at block 960) the current block based on the updated current samples. The decoder may then provide the reconstructed current block for display as part of a reconstructed current picture.
[0124] IV. Example Electronic System
[0125] Many of the above features and applications are implemented as software processes, which are specified as a set of instructions recorded on a computer-readable storage medium (also referred to as a computer-readable medium). When these instructions are executed by one or more computing or processing units (e.g., one or more processors, processor cores, or other processing units), they cause the processing units to perform the actions indicated in the instructions. Examples of computer-readable media include, but are not limited to, compact disc read-only memory (CD-ROM), flash drives, random access memory (RAM) chips, hard drives, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. Computer-readable media do not include carrier waves and electronic signals transmitted by wireless or wired connections.
[0126] In this specification, the term "software" is intended to include firmware residing in read-only memory or application programs stored in magnetic memory, which can be read into memory for processing by a processor. In addition, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while retaining different software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that jointly implement the software inventions described herein are within the scope of this disclosure. In some embodiments, the software program, when installed to run on one or more electronic systems, defines one or more specific machine implementations that process and execute the operations of the software program.
[0127] Fig.10 An electronic system 1000 for implementing some embodiments of the present disclosure is conceptually shown. The electronic system 1000 may be a computer (e.g., a desktop computer, a personal computer, a tablet computer, etc.), a phone, a PDA, or any other type of electronic device. Such an electronic system includes various types of computer-readable media and interfaces for various other types of computer-readable media. The electronic system 1000 includes a bus 1005, a processing unit 1010, a graphics processing unit (GPU) 1015, a system memory 1020, a network 1025, a read-only memory 1030, a permanent storage device 1035, an input device 1040, and an output device 1045.
[0128] Bus 1005 collectively represents all system, peripheral, and chipset buses that communicatively couple numerous internal devices of electronic system 1000. For example, bus 1005 communicatively couples processing unit 1010 with GPU 1015, read-only memory 1030, system memory 1020, and permanent storage device 1035.
[0129] The processing unit 1010 obtains instructions to be executed and data to be processed from these various memory units in order to perform the processing of the present disclosure. In different embodiments, the processing unit can be a single processor or a multi-core processor. Some instructions are passed to and executed by the GPU 1015. The GPU 1015 can offload various calculations or supplement the image processing provided by the processing unit 1010.
[0130] Read-only-memory (ROM) 1030 stores static data and instructions used by processing unit 1010 and other modules of the electronic system. On the other hand, permanent storage device 1035 is a read-write storage device. This device is a non-volatile storage unit that stores instructions and data even when electronic system 1000 is turned off. Some embodiments of the present disclosure use a large-capacity memory device (such as a magnetic disk or optical disk and its corresponding magnetic disk drive) as permanent storage device 1035.
[0131] Other embodiments use removable storage devices (e.g., floppy disks, flash memory devices, etc., and their corresponding disk drives) as permanent storage devices. Like the permanent storage device 1035, the system memory 1020 is a read-write memory device. However, unlike the permanent storage device 1035, the system memory 1020 is a volatile read-write memory, such as a random access memory. The system memory 1020 stores some instructions and data used by the processor at runtime. In some embodiments, the processing according to the present disclosure is stored in the system memory 1020, the permanent storage device 1035 and / or the read-only memory 1030. For example, according to some embodiments of the present disclosure, various memory units include instructions for processing multimedia clips. From these various memory units, the processing unit 1010 obtains instructions to be executed and data to be processed in order to perform the processing of some embodiments.
[0132] The bus 1005 is also connected to an input device 1040 and an output device 1045. The input device 1040 enables a user to convey information and select commands to the electronic system. The input device 1040 includes an alphanumeric keyboard and a pointing device (also referred to as a "cursor control device"), a camera (e.g., a webcam), a microphone, or a similar device for receiving voice commands, etc. The output device 1045 displays an image generated by the electronic system or outputs data. The output device 1045 includes a printer and a display device, such as a cathode ray tube (CRT) or a liquid crystal display (LCD), and a speaker or similar audio output device. Some embodiments include devices used as input and output devices, such as a touch screen.
[0133] Finally, if Fig.10 As shown, bus 1005 also couples electronic system 1000 to a network 1025 via a network adapter (not shown). In this manner, the computer may be part of a computer network, such as a local area network ("LAN"), a wide area network ("WAN"), or an intranet, or a network of multiple networks, such as the Internet. Any or all components of electronic system 1000 may be used in conjunction with the present disclosure.
[0134] Some embodiments include electronic components, such as microprocessors, storage devices, and memory, which store computer program instructions in machine-readable or computer-readable media (or otherwise referred to as computer-readable storage media, machine-readable media, or machine-readable storage media). Some examples of such computer-readable media include RAM, ROM, read-only compact discs (CD-ROM), recordable compact discs (CD-R), rewritable compact discs (CD-RW), read-only digital versatile discs (e.g., DVD-ROM, dual-layer DVD-ROM), various recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc.), flash memory (e.g., SD card, mini SD card, micro SD card, etc.), magnetic and / or solid-state hard drives, read-only and recordable A computer program or computer code may be a computer program that is executable by at least one processing unit and includes a set of instructions for performing various operations. Examples of computer programs or computer codes include machine code such as produced by a compiler, and files including high-level code that is executed by a computer, an electronic component, or a microprocessor using an interpreter.
[0135] Although the above discussion mainly involves microprocessors or multi-core processors executing software, many of the above features and applications are performed by one or more integrated circuits, such as application specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs). In some embodiments, such integrated circuits execute instructions stored on the circuits themselves. In addition, some embodiments execute software stored in programmable logic devices (PLDs), ROM, or RAM devices.
[0136] As used in this specification and any claims of this application, the terms "computer," "server," "processor," and "memory" refer to electronic or other technical devices. These terms do not include people or groups of people. For the purposes of this specification, the terms display or display refer to displaying on an electronic device. As used in this specification and any claims of this application, the terms "computer-readable medium," "computer-readable medium," and "machine-readable medium" are entirely limited to tangible physical objects that store information in a computer-readable form. These terms do not include any wireless signals, wired download signals, and any other transient signals.
[0137] Although the present disclosure has been described with reference to many specific details, those skilled in the art will recognize that the present disclosure may be implemented in other specific forms without departing from the spirit of the present disclosure. Figure 7 and Fig. 9 ) conceptually illustrates the processes. The specific operations of these processes may not be performed in the exact order shown and described. The specific operations may not be performed in a continuous series of operations, and different specific operations may be performed in different embodiments. In addition, the process may be implemented using several sub-processes or as part of a larger macro process. Therefore, it will be understood by those skilled in the art that the present disclosure is not limited by the foregoing illustrative details, but is defined by the appended claims.
[0138] Additional Notes
[0139] The subject matter described herein sometimes represents different components, which are contained in or connected to other different components. It is understood that the described structure is only an example, and in fact, it can be implemented by many other structures to achieve the same function. Conceptually, the arrangement of any components that achieve the same function is actually "associated" to achieve the desired function. Therefore, regardless of the structure or intermediate components, any two components combined to achieve a specific function are considered to be "interrelated" to achieve the desired function. Similarly, any two associated components are considered to be "operably connected" or "operably coupled" to achieve a specific function. Any two components that can be associated with each other are also considered to be "operably coupled" to achieve a specific function. Any two components that can be associated with each other are also considered to be "operably coupled" to achieve a specific function. Specific examples of operable connections include, but are not limited to, physically pairable and / or physically interacting components, and / or wirelessly interactive and / or wirelessly interactive components, and / or logically interactive and / or logically interactive components.
[0140] Furthermore, with respect to the use of substantially any plural and / or singular terms, those skilled in the art can translate from the plural to the singular and / or from the singular to the plural as appropriate to the context and / or application. For sake of clarity, the present invention expressly sets forth various singular / plural arrangements.
[0141] In addition, it will be understood by those skilled in the art that, in general, the terms used in the present invention, especially in the claims, and the subject matter of the claims, are generally used as "open" terms, for example, "including" should be interpreted as "including but not limited to", "having" should be interpreted as "at least having", "including" should be interpreted as "including but not limited to", etc. It will be further understood by those skilled in the art that if a specific number of claim contents are intended to be introduced, it will be clearly indicated in the claim, and will not be displayed in the absence of such contents. For example, to aid understanding, the following claims may contain the phrases "at least one" and "one or more" to introduce the contents of the claims. However, the use of these phrases should not be understood to imply the use of the indefinite article "a" or "an" to introduce the claim contents and restrict any specific patent scope. Even when the same claim includes the introductory phrases "one or more" or "at least one", the indefinite article, such as "a" or "an", should be interpreted to mean at least one or more, and the same is true for the use of the explicit description used to introduce the claim. Furthermore, even when introductory content explicitly refers to a specific number, a person of ordinary skill in the art will recognize that such content should be interpreted as indicating the number being referenced, for example, "two references" without other modifications means at least two references, or two or more references. Furthermore, where a statement similar to "at least one of A, B, and C" is used, it is generally stated so that a person of ordinary skill in the art can understand the statement, for example, "a system includes at least one of A, B, and C" will include but is not limited to a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc. A person of ordinary skill in the art will further understand that any separated words and / or phrases represented by two or more alternative terms, whether in the specification, claims, or drawings, should be understood to include the possibility of one of these terms, one of them, or both of these terms. For example, "A or B" should be understood as the possibility of "A", or "B", or "A and B".
[0142] As can be seen from the foregoing, various embodiments have been described for illustrative purposes, and various modifications may be made without departing from the scope and spirit of the invention. Therefore, the various embodiments disclosed herein are not intended to be limiting, and the true scope and application are indicated by the claims.
Claims
1. A video encoding and decoding method, comprising: Receiving a current sample at a current pixel position of a current block being encoded or decoded; selecting a luma sample and two chroma samples as a plurality of luma and chroma co-located samples for the current pixel position, Wherein, only a subset of the plurality of candidate brightness samples in the neighboring area of the current pixel position is eligible to be selected as the brightness co-located samples or used to derive the brightness co-located samples of the current pixel position; selecting a pixel classification from a plurality of pixel classifications based on a plurality of values of the plurality of luma and chroma co-located samples selected for the current pixel position; performing an offset lookup based on the selected pixel classification; applying the offset to update the current sample; and The current block is encoded or decoded based on the updated current sample.
2. The video encoding and decoding method according to claim 1, characterized in that: The neighboring area of the current pixel position includes 8 candidate brightness samples around the current pixel position and one candidate brightness sample at a central position of the neighboring area of the current pixel position.
3. The video encoding and decoding method according to claim 2, characterized in that: The selected luma co-located sample is located at the center position of the neighborhood of the current pixel position.
4. The video encoding and decoding method according to claim 3, characterized in that: The candidate luma sample at the center position is implicitly selected as the luma co-located sample without being sent in the bitstream.
5. The video encoding and decoding method according to claim 1, characterized in that: The first classification index is calculated based on the plurality of values of the plurality of luma and chroma co-located samples selected for the current pixel position, the method further comprising: calculating a second classification index based on a plurality of difference values between a plurality of adjacent candidate brightness samples (in the neighborhood of the current pixel position) relative to a specific threshold, The pixel classification is selected by using the first classification index and the second classification index.
6. The video encoding and decoding method according to claim 5, characterized in that: The specific threshold is determined based on the bit depth of the current sample.
7. The video encoding and decoding method according to claim 1, characterized in that: Only one of the plurality of candidate luma samples in the neighboring area of the current pixel position is qualified as the luma co-located sample of the current pixel position.
8. The video encoding and decoding method according to claim 1, characterized in that: The plurality of candidate luma samples includes nine luma samples, and The eligible subset of the plurality of candidate luma samples includes four candidate luma samples.
9. The video encoding and decoding method according to claim 7, characterized in that: A linear average of two or more candidate luma samples selected from the eligible subset of the plurality of candidate luma samples is used as the selected luma co-located sample.
10. An electronic device comprising: The video codec circuit is configured to perform a plurality of operations including: Receiving a current sample at a current pixel position of a current block being encoded or decoded; selecting a luma sample and two chroma samples as a plurality of luma and chroma co-located samples for the current pixel position, Wherein, only a subset of the plurality of candidate brightness samples in the neighboring area of the current pixel position is eligible to be selected as the brightness co-located samples or used to derive the brightness co-located samples of the current pixel position; selecting a pixel classification from a plurality of pixel classifications based on a plurality of values of the plurality of luma and chroma co-located samples selected for the current pixel position; performing an offset lookup based on the selected pixel classification; applying the offset to update the current sample; and The current block is encoded or decoded based on the updated current sample.
11. A video decoding method, comprising: Receiving a current sample at a current pixel position of a current block being decoded; selecting a luma sample and two chroma samples as a plurality of luma and chroma co-located samples for the current pixel position, Wherein, only a subset of the plurality of candidate brightness samples in the neighboring area of the current pixel position is eligible to be selected as the brightness co-located samples or used to derive the brightness co-located samples of the current pixel position; selecting a pixel classification from a plurality of pixel classifications based on a plurality of values of the plurality of luma and chroma co-located samples selected for the current pixel position; performing an offset lookup based on the selected pixel classification; applying the offset to update the current sample; and The current block is reconstructed based on the updated current sample.
12. A video encoding method, comprising: Receiving a current sample at a current pixel position of a current block being encoded; selecting a luma sample and two chroma samples as a plurality of luma and chroma co-located samples for the current pixel position, Wherein, only a subset of the plurality of candidate brightness samples in the neighboring area of the current pixel position is eligible to be selected as the brightness co-located samples or used to derive the brightness co-located samples of the current pixel position; selecting a pixel classification from a plurality of pixel classifications based on a plurality of values of the plurality of luma and chroma co-located samples selected for the current pixel position; performing an offset lookup based on the selected pixel classification; applying the offset to update the current sample; and The current block is encoded based on the updated current sample.
