Image prediction method and apparatus, encoding device, decoding device and storage medium
The image prediction method addresses the issue of predicted values exceeding reasonable ranges by determining a reference area and applying a clipping strategy, thereby improving video decoding quality.
Patent Information
- Application Number
- PCT/CN2025/095860
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-11-26
AI Technical Summary
Existing cross-component prediction techniques in video coding, such as CCLM, CCCM, and BVG-CCCM, face issues with predicted values exceeding reasonable ranges due to abrupt changes in luma or chroma components, necessitating a refined clipping strategy.
An image prediction method that determines a reference area for a current block, obtains an initial predicted value using a first prediction model, and constrains it within a clipping range based on the reference area to ensure accurate and valid pixel values.
The method improves prediction accuracy by constraining predicted values within valid ranges, enhancing the quality of video decoding and reconstruction.
Smart Images

Figure CN2025095860_26112026_PF_FP_ABST
Abstract
Description
IMAGE PREDICTION METHOD AND APPARATUS, ENCODING DEVICE, DECODING DEVICE AND STORAGE MEDIUMTECHNICAL FIELD
[0001] The present disclosure generally relates to encoding and decoding technology, and in particular to an image prediction method and apparatus, an encoding device and a decoding device and a computer readable storage medium.BACKGROUND
[0002] In modern video coding standard, cross-component prediction techniques, such as Cross-Component Linear Model (CCLM) , Convolutional Cross-Component Model (CCCM) and its variants, such as Gradient and Location based convolutional cross-component model (GL-CCCM) and Block-vector guided CCCM (BVG-CCCM) , are used to predict one component (typically the chroma component) based on another component (usually the reconstructed luma component) . These methods typically establish a linear or nonlinear regression model that maps the pixel values of the reference components to the predicted values of the target components.
[0003] However, due to abrupt changes in the luma or chroma component, the predicted values may exceed the reasonable range. Therefore, a strategy for clipping predicted values is needed.SUMMARY
[0004] Accordingly, the present disclosure aims to provide an image prediction method and apparatus, an encoding device, a decoding device and a computer readable storage medium.
[0005] A technical scheme adopted by the present disclosure is to provide an image prediction method. The method includes: determining a reference area of a current block of an image; obtaining an initial predicted value corresponding to a sample within the current block based on a first prediction model; determining a clipping range of a final predicted value corresponding to the current block based on the reference area; and determining the final predicted value based on the initial predicted value and the clipping range.
[0006] Another technical scheme adopted by the present disclosure is to provide an image prediction apparatus. The apparatus includes: a first determination module is configured to determine a reference area of a current block of an image; an obtaining module is configured to obtain an initial predicted value corresponding to a sample within the current block based on a first prediction model; a second determination module is configured to determining a clipping range of a final predicted value corresponding to the current block based on the reference area; and a third determination module is configured to determine the final predicted value based on the initial predicted value and the clipping range.
[0007] Another technical scheme adopted by the present disclosure is to provide encoding device. The decoding device includes one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the method of image prediction to any one of any of the foregoing methods.
[0008] Another technical scheme adopted by the present disclosure is to provide decoding device. The decoding device includes one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the method of image prediction according to any one of any of the foregoing methods.
[0009] Another technical scheme adopted by the present disclosure is to provide a computer readable storage medium. The computer readable medium is configured to store a computer program, and the computer program is loaded by a processor to execute steps in the method of image prediction according to any one of the foregoing methods.BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to clearly explain the technical solutions in the embodiments of the present disclosure, the drawings used in the description of the embodiments will be briefly described below. Obviously, the drawings in the following description are merely some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings may also be obtained based on these drawings without any creative work.
[0011] FIG. 1 is a schematic diagram of a conventional video encoding system.
[0012] FIG. 2 is a schematic diagram of a conventional video decoding system.
[0013] FIG. 3A is a schematic diagram of the reference area in the BVG-CCCM method.
[0014] FIG. 3B is a schematic diagram of the CCCM mode uses a 5-point cross-shaped spatial filter.
[0015] FIG. 3C is a schematic diagram of the five specific locations within the co-located luma area.
[0016] FIG. 4 is a flowchart of an image prediction method according to an embodiment of the present disclosure.
[0017] FIG. 5A is a schematic diagram of the reference area in CCCM.
[0018] FIG. 5B are three examples of the reference area.
[0019] FIG. 6A is a flowchart of a template-matching-based block vector search method according to an embodiment of the present disclosure.
[0020] FIG. 6B is schematic diagram of the template-matching-based block vector search method and search range.
[0021] FIG. 7 is a flowchart of another image prediction method according to an embodiment of the present disclosure.
[0022] FIG. 8 is a flowchart of an image prediction method in a specific scenario provided by an embodiment of the present disclosure.
[0023] FIG. 9 specifically describes an image prediction apparatus provided in some embodiments of the present disclosure.
[0024] FIG. 10 shows a schematic diagram of a device for encoding or decoding according to an embodiment of the present disclosure.DETAILED DESCRIPTION
[0025] The disclosure will now be described in detail with reference to the accompanying drawings and examples. Apparently, the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0026] Under the context of video compression, color image or a frame of a color video usually consists of three color components, namely a luma component Y and two chroma components, which are the blue chroma component (Cb) and the red chroma component (Cr) . Each component is represented as a data matrix. The data matrix for each component is decomposed into blocks associated with specific encoding parameters. A block is usually a square or rectangle whose dimensions are integer powers of 2. The coding of an image is processed in raster scanning order: from left to right, then from top to bottom. Within a specific block or a plurality of blocks, luma component is usually coded before chroma components. But in some situations, the coding of an image can also be processed in raster scanning order: from right to left, then from bottom to top, or others. Within a specific block or a plurality of blocks, chroma components can also be coded before luma component.
[0027] Popular video coding standards such as Versatile Video Coding (VVC) uses a prediction / transform hybrid coding framework. Prediction refers to predicting current block (i.e., the block to be coded) using coded blocks or coded areas within the same frame (i.e., intra prediction) or from a different frame (i.e., inter prediction) . When performing intra or inter prediction, the encoder tries multiple intra prediction modes available to the coding standard, computes and compares corresponding prediction blocks and chooses the best prediction mode. The difference between original current block and the prediction block generated by the chosen prediction mode, namely the residual, will also be coded. By transmitting prediction modes and residuals only, the encoder is able to instruct the decoder to decode and reconstruct the original image or video or its approximation.
[0028] Intra-frame Template Matching Prediction (Intra TMP) is a typical intra-frame prediction tool. It involves matching the template (areference block of a specific shape) of the current block with the already reconstructed portion of the current frame to find the most similar reference block, which then serves as the prediction value for the current block. This allows us to utilize the spatial redundancy within the image, significantly reducing the amount of data that needs to be encoded.
[0029] To help understand the technical solutions proposed in the embodiments of this application, a brief introduction of video encoding and decoding system will be provided below.
[0030] As shown in FIG. 1, FIG. 1 is a schematic diagram of a conventional video encoding system. The video encoding system 110 include multiple modules, such as block partitioning unit 1101, transform and quantization unit 1102, intra-frame estimation unit 1103, intra-frame prediction unit 1104, motion compensation unit 1105, motion estimation unit 1106, an inverse transformation and inverse quantization unit 1107, a filter control analysis unit 1108, a filtering unit 1109, an encoding unit 1110, an encoded image buffer unit 1111 and a subtractor 1112.
[0031] Original video signals include video frames. Each video frame is divided into blocks by a block partitioning unit 1101. For each of the video frames, the subtractor 1112 generates residual pixel information about a residual frame by subtracting the input video frame from the output of the intra-frame prediction unit 1104 or the motion compensation unit 1105. The residual pixel information obtained after intra-frame prediction or inter-frame prediction (motion compensation) , is transformed by the transformation and quantization unit 1102. The transformation includes transforming the residual pixel information from the pixel domain to a transform domain, and the resulting transform coefficients are quantized to further reduce the bit rate. The intra-frame estimation unit 1103 performs intra-frame estimation, and the intra-frame prediction unit 1104 performs intra-frame prediction on the video reconstructed blocks. Motion estimation performed by the motion estimation unit 1106 is a process of generating a motion vector that can estimate the displacement of the reconstructed video block, and then motion compensation is performed by the motion compensation unit 1105 based on the determined motion vector. After determining an intra-frame prediction mode, the intra-frame prediction unit 1104 provides selected intra-frame predicted data to the encoding unit 1110, and the motion estimation unit 1106 also sends calculated motion vector data to the encoding unit 1110. The inverse transform and inverse quantization unit 1107 reconstructs the video reconstructed blocks and reconstructs a residual block in the pixel domain, and the filtering unit 1109 is controlled by the filter analysis unit 1108 to remove the blocking artifacts in the reconstructed residual block, and the encoding unit 1110 adds the reconstructed residual block to the prediction block of the encoded image buffer unit 1111 to generate a reconstructed block. The encoding unit 1110 is used for encoding various encoding parameters and quantized transform coefficients (quantized transform coefficients) into bitstream, and outputs the bitstream of the video signals. The encoded image buffer unit 1111 is used for storing reconstructed blocks as the reference blocks for intra-frame prediction. As the video image encoding progresses, new reconstructed blocks are continuously generated, and these blocks are stored in the encoded image buffer unit 1111.
[0032] As shown in FIG. 2, FIG. 2 is a schematic diagram of a conventional video decoding system. The video decoding system 120 include multiple modules such as a decoding unit 1201, an inverse transform and inverse quantization unit 1202, an intra-frame prediction unit 1203, a motion compensation unit 1204, a filtering unit 1205, a decoded image buffer unit 1206 and a post filtering unit 1207.
[0033] The input signals of video frames are encoded by the video encoding system 110 to obtain an output bitstream. The video encoding system 110 transmits the bitstream to the video decoding system 120. The video decoding system 120 receives the bitstream representing the video frames in an encoded format (i.e., in a compressed format) . In the video decoding system 120, the bitstream is processed by the decoding unit 1201 to obtain decoded transform coefficients. The inverse transform and inverse quantization unit 1202 process the transform coefficients to generate a residual block in the pixel domain. The intra-frame prediction unit 1203 is operable to generate an intra-frame prediction block for a current video decoding block based on a determined intra-frame prediction mode and data from previously decoded blocks of the current video frame or picture. The motion compensation unit 1204 determines the inter-frame prediction information for the current video decoding block and generates an inter-frame prediction block by parsing the motion vector and other associated syntax elements. Finally, the decoded video block is formed by summing the residual block from the inverse transform and inverse quantization unit 1202 and the corresponding prediction block generated by the intra-frame prediction unit 1203 or the motion compensation unit 1204. In order to improve video quality, the decoded video blocks are filtered through the filtering unit 1205 to remove blocking artifacts. The decoded video block is then stored in the decoded image buffer unit 1206 as the reference block for subsequent intra-prediction or motion compensation, and for video output, i.e., to reproduce and reconstruct the original video signals. After processing by the post-processing filter unit 1207, the reconstructed video signal can be further processed selectively to achieve a more suitable or enhanced visual experience.
[0034] The embodiments of this invention are mainly used in the intra-frame prediction unit 1104 of the video encoding system 110 and the intra-frame prediction unit 1203 of the video decoding system 120. If approved, the intra-frame prediction methods provided by the embodiments of this application can achieve better prediction effects, thereby improving the quality of video decoding and reconstruction. The intra-frame prediction unit 1104 of the video encoding system 110 can use the encoded pixels within the current frame as a reference to predict and encode the current block. The intra-frame prediction unit 1203 of the video decoding system 120 can perform the same intra-frame prediction method as the intra-frame prediction unit 1103.
[0035] In modern video coding standards, cross-component prediction techniques, such as Cross-CCLM, CCCM and its variants (e.g., GL-CCCM, BVG-CCCM) , are used to predict one component (typically the chroma component) based on another component (usually the reconstructed luma component) . These methods typically establish a linear or nonlinear regression model that maps the pixel values of the reference component to the predicted values of the target component. Such prediction modes are used in parallel with other intra and / or inter prediction modes like DC mode, planar mode, angular modes, chroma direct mode, etc.
[0036] The following introduces each technique individually. Their main differences lie in the design of the reference regions and prediction methods. CCLM uses a linear model, while CCCM / GL-CCCM employs a convolutional model. BVG-CCCM utilizes the block vector of the co-located luma block to guide the selection of reference regions, aiming to obtain more relevant luma samples for model training and prediction.
[0037] (1) CCLM
[0038] CCLM is a cross-component intra prediction mode that predicts chroma image or chroma block using reconstructed luma image or luma block. It involves a linear transformation of the reconstructed luma pixels to obtain chroma values. The term ‘cross-component’ stems from the fact that prediction is made from one color component to another.
[0039] The specific implementation of CCLM involves the following processes:
[0040] The reconstructed luma component values (obtained through a downsampling process) are used to predict chroma values through a prediction function.
[0041] The prediction function is defined as predC (i, j) =α·rec′L (i, j) , where predC represents the predicted chroma value, and rec′L represents the reconstructed luma component value.
[0042] The determination of coefficients α and β depends on the luma and chroma values of adjacent Coding Units (CUs) and can be calculated using the following formulas:
[0043] α= (Ya-Yb) / (Xa-Xb) ,
[0044] β=Yb-α·Xb,
[0045] where Ya is the maximum luma pixel value after downsampling, Xa is the corresponding chroma value for Ya , Yb is the minimum luma pixel value after downsampling, and Xb is the corresponding chroma value for Yb. To reduce computational and storage overhead, the β and α are stored and computed in an exponential manner, and lookup tables are used in the VVC Test Model (VTM) to perform the related division operations. Besides using all upper and left luma reference pixels to calculate the parameters of the linear model, CCLM also offers two additional modes called Linear Model from Above (LMA) and Linear Model from Left (LML) modes. The LMA mode uses only the upper reference pixels, while the LML mode uses only the left-side reference pixels. This increases the flexibility of chroma prediction and allows adaptation to different video contents. The computation of the linear model parameters occurs not only at the encoder side but also at the decoder side. Therefore, the values of α and β do not need to be recorded in the bitstream, reducing additional bitstream overhead.
[0046] (2) CCCM
[0047] The CCCM is a convolutional model used for chroma prediction, similar to the CCLM. It is based on the idea of predicting chroma pixels from reconstructed luma pixels. The CCCM considers the interrelation between luma and chroma components and uses a downsampled version of the luma reconstruction block to match the size of the chroma block.
[0048] The basic steps of the module are as follows:
[0049] 1. Before predicting chroma pixels, the luma reconstruction block is downsampled to match the size of the chroma block.
[0050] 2. A 7-tap convolutional filter is applied to process the luma samples and the predicted chroma pixels is calculated. The specific prediction function is expressed as follows:
[0051] PredChromaVal=C0×C+C1×N+C2×S+C3×E+C4×W+C5×P+C6×B.
[0052] where C represents the luma sample at the corresponding position of the current chroma sample, N, S, E, W are the neighboring samples of the current luma sample, P is a nonlinear term calculated by: P= (C×C+midVal) >>bitDepth , and B is an offset term, which is a preset value. Here, midVal is a bias term representing a scalar offset between input and output, typically set to the median chroma value.
[0053] Filter coefficients Cn are calculated by minimizing the Mean Squared Error (MSE) between the predicted and reconstructed chroma samples. The filter coefficients are derived from the auto-correlation and cross-correlation matrices of the luma reconstructed pixels and chroma reconstructed pixels and optimized through the use of LDL decomposition and back-substitution to provide more accurate chroma prediction. Similar to CCLM, CCCM offers the option of using a single model or multi-model variants. The multi-model variant uses two models, one derived for samples above the average luma reference value, and the other for the remaining samples (following the CCLM design philosophy) . The multi-model CCCM mode can be selected if the prediction unit (PU) has at least 128 available reference samples. The reference area consists of 2 or 6 lines of chroma samples above and to the left of the PU. The number of neighbor samples used to derive CCCM model parameters in the single-model CCCM is determined by the template cost. For the multi-model CCCM mode, the two candidate models use either 6 lines of adjacent luma samples or luma samples that match the current chroma block position to derive averages, dividing the samples into two groups. The cost is determined by applying the candidate cross-component prediction CCP (2 lines or 6 lines) on the template and calculating the total absolute difference (SAD) between the CCP predicted samples and the reconstructed samples in the template.
[0054] (3) GL-CCCM
[0055] GL-CCCM uses a filter that includes one spatial luma sample, two gradient values, two location information, a nonlinear term, and a bias term to map luma values to chromaticity values. Unlike the four spatial neighboring samples used by the CCCM filter, the GL-CCCM takes gradient and location information as inputs.
[0056] The GL-CCCM filter used for the prediction is:
[0057] PredChromaVal=C0×C+C1×Gy+C2×Gx+C3×Y+C4×X+C5×P+C6×B
[0058] Where Gy and Gx are the vertical and horizontal gradients, respectively, and are calculated as:
[0059] Gy= (2×N+N×W+N×E) - (2×S+S×W+S×E) ;
[0060] Gx= (2×W+N×W+S×W) - (2×E+N×E+S×E) .
[0061] Moreover, the Y and X are the spatial coordinates of the center luma sample. C represents the co-located brightness value, P is the nonlinear term, and B is the median shift.
[0062] The rest of the parameters are the same as CCCM tool. The reference area for the parameter calculation is the same as CCCM method.
[0063] These techniques transmit signals through PU-level flags encoded with Context-based Adaptive Binary Arithmetic Coding (CABAC) , and GL-CCCM is regarded as a sub-mode of CCCM, meaning that the GL-CCCM flag is only signaled when the original CCCM flag is true. Like CCCM, the GL-CCCM tool has six modes for calculating parameters:
[0064] Single model GL-CCCM from the top and left templates;
[0065] Single model GL-CCCM from the top template only;
[0066] Single model GL-CCCM from the left template only;
[0067] Multi-model GL-CCCM from the top and left templates;
[0068] Multi-model GL-CCCM from the top template.
[0069] (4) BVG-CCCM
[0070] When co-located luma prediction is encoded using Inter Block Copy (IBC) or IntraTMP in Intra pictures, the BVG-CCCM mode can be used. In this mode, the block vectors of the co-located luma blocks encoded with IBC or IntraTMP are utilized to determine the reference area for calculating the CCCM parameters. Prediction is performed using the computed model parameters and the co-located luma samples. FIG. 3A illustrates the reference area in the BVG-CCCM method. FIG. 3A is a schematic diagram of the reference area in the BVG-CCCM method.
[0071] The BVG-CCCM mode uses an 11-tap filter for inter-component prediction, as follows:
[0072] predChromaVal=C0×C+C1×N+C2×S+C3×E+C4×W+C5×P (N) +C6×P (N) +C7×P (S) +C8×P (W) +C9×P (E) +C10×B. The spatial 5-tap component of the filter includes a central (C) luma sample, which is co-located with the chromaticity sample to be predicted, along with its upper / north (N) , lower / south (S) , left / west (W) , and right / east (E) neighbors, as shown in FIG. 3B in accordance with CCCM. FIG. 3B is a schematic diagram of the CCCM mode uses a 5-point cross-shaped spatial filter. As shown in the FIG. 3B, it uses the central luma sample C which is co-located with the chroma sample to be predicted, as well as its luma neighbors north (N) , south (S) , west (W) , east (E) in the four directions above, below, left, and right.
[0073] The nonlinear term P is represented as the square of the corresponding luma sample, and B is the bias term. Similar to the Direct Block Vector (DBV) mode, five positions in the co-located luma block area are scanned, and then the relevant block vectors are used to determine the reference area for parameter calculation in the BVG-CCCM method.
[0074] In DBV, if the luma block at one of the five preset positions shown in the Fig. 3C is encoded using IBC or IntraTMP mode, its block vector will be scaled and used as the block vector for the chromaticity block. FIG. 3C is a schematic diagram of the five specific locations within the co-located luma area. These five locations are the center, top-left, top-right, bottom-left, and bottom-right of the luma area. Template matching is used to perform the block vector scaling.
[0075] In various cross-component prediction algorithms (CCLM, CCCM, BVG-CCCM) , chroma predicted values need to be clipped due to potential biases during the prediction process. So, the existing regression-based cross-component algorithm roughly includes operations as follows: obtaining the reconstructed area as a reference template; calculating the regression model to obtain the filter coefficients; predicting the chroma values of the current block based on the luma component of the current block; performing clipping of the output values (chroma values) based on a valid pixel range. Typically, the valid pixel range is determining by the valid bit depth of the pixels. For example, when the valid depth is 8, the clipping range is generally between 0 and 255 (i.e., 2^bitdepth-1) .
[0076] However, in practice, the predicted values may be inaccurate in some situations based on the above prediction process. It may exceed the range of actually possible predicted values. Thus, a more refined clipping strategy is needed, which can be implemented by leveraging prior information to constrain the chroma predicted values within a subinterval between 0 and 255, further improving the output values of cross-component prediction algorithms.
[0077] Embodiments of the invention are discussed below with reference to FIGS. 4-9. However, those skilled in the art will readily appreciate that the detailed description given herein with respect to these figures is for explanatory purposes as the invention extends beyond these limited embodiments.
[0078] The present disclosure introduces an image prediction method, which includes a clipping strategy based on the clipping range corresponding to the reference area of the current block. The image prediction method can be used for regression-based cross-component prediction algorithms (e.g. CCLM, CCCM, BVG-CCCM) , and it can also be applied to other prediction algorithms with a prediction model to predict. The image prediction method provided by the embodiments of the present invention can be performed by an encoder device integrated with the encoding system described above, or it can also be performed by a decoder device integrated with the decoding system described above, the encoder device and the decoder device can be various types of electronic devices, such as mobile phones, tablets, desktop computers, laptops, smart televisions, digital cameras, video recorders, set-top boxes, video game consoles, surveillance cameras, and specialized video encoding / decoding chips or modules integrated within larger electronic systems.
[0079] FIG. 4 is a flowchart of an image prediction method according to an embodiment of the present disclosure. As shown in FIG. 4, the method includes operations described in blocks S101 to S104.
[0080] In S101, a reference area of a current block is determined.
[0081] The current block refers to the specific block of pixels in an image or video frame that is the subject of processing or analysis at a particular moment. For example, in image prediction algorithms, the image is typically divided into a grid of small blocks (such as 8x8 or 16x16 pixel blocks) . When the algorithm is working on a specific block within the image, that block is considered the current block. The current block can also be referred to as a prediction unit.
[0082] The reference area is an area within the same frame or the same image which is used as a source of information to help process the current block. In the present disclosure, the reference area is used as a reference information to the prediction process of the current block.
[0083] In some embodiments of the present disclosure, the reference area is adjacent to the current block. The reference area includes a reconstructed block located within a spatial neighborhood of the current block. Integrated with the cross-component prediction techniques above, when the image prediction method is based on CCLM, CCCM or GL-CCCM, the reference area can be a reconstructed block located within a spatial neighborhood of the current block. As shown in FIG. 5A, FIG. 5A is a schematic diagram of the reference area in CCCM. Specifically, the reference area includes at least one of:one or more rows above the current block; one or more rows below the current block; one or more columns to the left of the current block; or one or more columns to the right of the current block. In one example, it only includes one or more rows above the current block, or it only includes one or more rows below the current block, or it only includes one or more columns to the left of the current block, or it only includes one or more columns to the right of the current block. In another example, it can be a combination of any two regions of them, such as several rows above the current block and several columns to the left of the current block; or several rows below the current block and several columns to the right of the current block. As shown in FIG. 5B, FIG. 5B are three examples of the reference area. The first example is that the reference area includes only two rows above the current block. The second example is that the reference area includes only two columns to the left of the current block. The third example is that the reference area includes two rows above the current block and two columns to the left of the current block. In another example, the reference area in CCLM includes only one row above the current block and one column to the left of the current block; the reference area in CCCM includes at most six rows above the current block and six columns to the left of the current block.
[0084] Specifically, Assuming the top-left coordinate of the current block is (x_0, y_0) with block size Width × Height. The top H-row reference area includes pixels with coordinates (x, y) where x_0 ≤x < x_0 + Width and y_0 -Height ≤ y < y_0. The left W-column reference region includes pixels with coordinates (x, y) where x_0 -Width ≤ x < x_0 and y_0 ≤ y < y_0 + Height. The extension includes pixels from the top-left corner area.
[0085] In a specific embodiment, the reference area includes up to 6 rows above and columns to the left of the current block, including luma and chroma samples. The specific size of the reference area is determined based on the current block's position. When the current block is less than 6 rows away from the image boundary, the row number of the current block selected by CCCM will match the distance to the boundary (for example, if the current block is 4 rows away from the image boundary, the reference area will include 4 rows) . When the current block is more than 6 rows away from the image boundary, the reference area will include 6 rows. Similarly, when the current block is less than 6 columns away from the image boundary, the column number of the current block selected by CCCM will match the distance to the boundary (for example, if the current block is 6 columns away from the image boundary, the reference area will include 4 columns) . When the current block is more than 6 columns away from the image boundary, the reference area will include 6 columns.
[0086] In some embodiments of the present disclosure, the reference area can also be a combination of any three region of: one or more rows above the current block; one or more rows below the current block; one or more columns to the left of the current block; one or more columns to the right of the current block, or it can be a combination of all of them.
[0087] In some embodiments of the present disclosure, the reference area is non-adjacent to the current block. For example, there are N rows between the reference area and the current block, where N is greater than or equal to 1. There are M columns between the reference area and the current block, where M is greater than or equal to 1. This selection method of the reference area can provide better prediction results in some scenarios.
[0088] In some embodiments of the present disclosure, the reference area may incorporate non-contiguous neighboring pixels. Specifically, the rows of the reference block are non-adjacent to each other, and / or the columns of the reference block are non-adjacent to each other. For example, specific spaced rows or columns can be sampled from above or to the left of the current block. The reference area can be determined by using only the 1st, 3rd, and 5th rows above the current block with an interval of one row, and / or the 1st, 3rd, and 5th columns to the left of the current block with an internal of one column. This selection method of the reference area can provide better prediction results in some scenarios.
[0089] Assuming the top-left coordinate of the current block is (x_0, y_0) with block size Width ×Height, taking the top area as an example of the reference area, the reference area includes pixels with coordinates (x, y) , where: x_0≤ x < x_0 + Width, and y belongs to a predefined, potentially non-contiguous set {y_0 -k_1, y_0 -k_2, ..., y_0 -k_N} , where k_i > 0.
[0090] In some embodiments of the present disclosure, the reference area is determined by a block vector and the current block, and the size of the reference area can be determined by the size of the current block and the padding size used for filtering. For example, the size of the reference area can be the same as the size of the current block. In some cases, the size of the reference area can be different from the current block. The reference area can be at least one of the following: above the current block, to the left of the current block, below the current block, and to the right of the current block, to the top-left of the current block, to the bottom-left of the current block, to the top-right of the current, to the bottom-right of the current block. When there is only one block vector, the reference area is only one block, and when there are more than one block vectors, the reference area can be more than one block.
[0091] To be specific, first, the block vector is determined based on the current block, then the reference area is determined by adding the current block with the block vector. Here, the block vector has a direction. In the case that the reference area is to the top-left of the current block, the block vector is (X, Y) where X is a positive number and Y is a negative number. Given that the top-left coordinate of the current block is (x_0, y_0) with block size Width × Height, the coordinate of the reference block is defined as (x_0 + X, y_0 + Y) . The determination of the reference area based on the block vector and the current block aims to exploit non-local self-similarity in the image. It can fully exploit the information in the image, locate the blocks similar to the current block as reference blocks and improve the prediction accuracy.
[0092] Integrated with the cross-component prediction techniques above, when the image prediction method is based on BVG-CCCM, the reference area can be determined by the block vector.
[0093] In some embodiments of the present disclosure, the block vector is obtained through information reuse. The block vector is reused from a used block vector corresponding to a previous reference area of a reconstructed co-located luma block or a reconstructed co-located chroma block of the current block. When the image prediction method predicts a chroma value based on the a reconstructed co-located luma block, the block vector is reused from a used block vector corresponding to a previous reference area of the reconstructed co-located luma block. When the image prediction method predicts a luma value based on the reconstructed co-located chroma block, the block vector is reused from a used block vector corresponding to a previous reference area of the reconstructed co-located chroma block.
[0094] Specifically, the encoder device and decoder device will first scan N positions in the co-located luma block of the current block as reference points when predicting the chroma block of the current block. In the current BVG-CCCM scheme, N=5, as shown in FIG. 3C.
[0095] If these N positions are encoded using the Intra Block Copy (IBC) or IntraTMP modes, the encoder device and decoder device will obtain a previous reference area guided by a used block vector. Then the block vector of the current block can be reused from this used block vector. In this way, by reusing the used block vector, it can save searching time of the block vector and obtain a proper reference area at the same time.
[0096] In some embodiments of the present disclosure, the block vector is obtained through a template-matching-based block vector search algorithm, and the resulting block vector points to the reference area.
[0097] Refer to FIG. 6A and FIG. 6B. FIG. 6A is a flowchart of a template-matching-based block vector search method according to an embodiment of the present disclosure. FIG. 6B is schematic diagram of the template-matching-based block vector search method and search range. The method includes operations described in blocks S201 to S204.
[0098] In S201, a template of the current block and a search range is determined.
[0099] The template is constructed using reconstructed neighboring pixels of the current block. For example, a certain number of rows above and / or columns to the left of the current block. The size and shape of the template can be either fixed or adaptive.
[0100] Here, the search range is within the reconstructed pixels of a frame or a picture to which the current block belongs, as shown in FIG. 6B. The size and position of the search area will affect both the computational complexity and the probability of finding good matches. The size and the position of the template can be determined by the characteristic of the image or the performance requirements of the algorithm. For example, if the image content is complex, the search range is required to be large, and if the resolution of the image is low, the search range can be small. For instance, if the initial position of the search area is near the best match position, the search speed is high. If the accuracy requirement is high, the search range can be large, and if the speed requirement is high, the search range can be small.
[0101] In S202, a plurality of candidate blocks is determined, the candidate blocks are within the search range with a size equal to that of the template.
[0102] Specifically, for each candidate position in the search range, corresponding to a candidate block vector that represents the displacement from the current block position to the candidate block position, a candidate block with the same size as template is extracted. It can be understood that a plurality of candidate blocks can be determined within the search range.
[0103] In S203, a plurality of matching costs between the template and the plurality of candidate blocks is obtained.
[0104] After obtaining a plurality of candidate blocks, the matching costs between the templated and the candidate blocks are calculated to determine the best-matching candidate block.
[0105] Here, the matching costs can be calculated through different functions. For example, it can be calculated based on sum of absolute difference (SATD) , sum of absolute transformed differences (SAD) or sum of squared errors (SSE) .
[0106] Specifically, when the matching cost is SAD, for a certain specific block SAD (v) , the function is:
[0107] SAD (v) = Σ |T (i, j) -C (v) (i, j) |.
[0108] Where T (i, j) represents the pixel value of the template at the position (i, j) , C (v) represents the candidate block, and C (v) (i, j) represents the pixel value of the candidate block at the position (i, j) . All pixels within the template need to be traversed. By using SAD as the matching cost. The search strategy can also employ either full search or various fast search algorithms (e.g., diamond search, hexagon search) to reduce complexity.
[0109] In S204, the block vector corresponding to one of the plurality of the candidate blocks with a lowest matching cost is selected.
[0110] Multiple candidate block vectors may be searched, with the final block vector selected based on certain criteria (e.g., lowest SAD value, rate-distortion cost, etc. ) .
[0111] It can be understood that when the matching cost reaches the minimum, the candidate block is the best, then the corresponding block vector is selected. The block vector is denoted as BV_opt:
[0112] BV_opt = argmin_v SAD (v) .
[0113] Here, argmin_v SAD (v) represents the block vector corresponding to the minimum cost with SAD. This BV_opt serves as the block vector guiding the reference area localization.
[0114] Once the guiding block vector BV_opt is obtained, it points to an optimal matching block position at (x_0, y_0) + BV_opt. Here, (x_0, y_0) represents the position of the current block.
[0115] In one specific example, when the chroma value is predicted based on the reconstructed luma value, the corresponding reconstructed chroma block is extracted as the reference area for clipping operations by using its position as a reference. The size of this reference area typically matches the current block size.
[0116] By using template-matching-based block vector search method, the reference area matching the current block will be found, so that when it is used for prediction, the prediction result will be more accurate.
[0117] In some embodiments of the present disclosure, the reference area can also be obtained based on other methods disclosed in the art.
[0118] In S102, an initial predicted value of a sample within the current block is obtained based on a first prediction model.
[0119] The first prediction model is a liner or non-liner function regression model that maps the pixel values of the current block to the predicted values. Here, the predicted values include the initial predicted value. For example, as described above, in CCLM, the prediction model is predC (i, j) =α·rec′L (i, j) . For instance, as described above, in GL-CCCM, the prediction model is PredChromaVal=C0×C+C1×Gy+C2×Gx+C3×Y+C4×X+C5×P+C6×B.
[0120] In some embodiments of the present disclosure, the method employs a minimum mean square error (MSE) strategy to compute the filter coefficients Cn . That is, the specific parameters of the first prediction model.
[0121] For example, The CCLM selects four chroma reference pixels and their corresponding downsampled reconstructed luma pixels as sample points. The filter coefficients α and β are obtained through a division lookup table.
[0122] Then the initial predicted value of the current block is calculated. The method uses the computed filter coefficients and the co-located luma samples to predict the values of the chroma blocks. This step results in the reconstructed values of the chroma blocks, which are predicted chroma pixels based on the reconstructed luma pixels. The formula is Cpred (x, y) =α·Yrec (x, y) +b.
[0123] More description about the variant and parameter can be referred to in the above text, and it will not be elaborated here.
[0124] The initial predicted value can be a chroma value, or it can be a luma value. When the initial predicted value is a chroma value, it can be a blue chroma value, or it can be a red chroma value.
[0125] In some embodiments of the present disclosure, when the initial predicted value is the chroma value, including a blue chroma value and a red chroma value, the initial predicted value is predicted based on a reconstructed luma value. The first prediction model maps the reconstructed luma value to the blue chroma value and the red chroma value respectively, which are to be predicted.
[0126] In some embodiments of the present disclosure, when the initial predicted value is the luma value, the initial predicted value is predicted based on a reconstructed chroma value. The first prediction model maps the reconstructed chroma value to the luma value, which is to be predicted.
[0127] In some embodiments of the present disclosure, the first prediction model is determined by the reference area. For example, when the prediction model maps the reconstructed luma value to the chroma value, the luma sample value and chroma sample value in the reference area are used to calculate the first prediction model.
[0128] Specifically, when using CCLM, CCCM, GL-CCCM or BVG-CCCM, the detailed calculation method of the first prediction model can be found in the text above.
[0129] In S103, a clipping range corresponding to the current block is determined based on the reference area.
[0130] The clipping range is used to constrain the initial predicted value to avoid abnormal values when there are abrupt changes in the luma or chroma component. So, the final predicted value is obtained by constraining the initial predicted value within the clipping range. The final predicted value can be a chroma value, or it can be a luma value.
[0131] In some embodiments of the present disclosure, the determining of a clipping range corresponding to the current block based on the reference area includes the following operations:
[0132] 1. A maximum predicted value and a minimum predicted value is determined based on the reference area.
[0133] 2. The clipping range corresponding to the current block is determined based on the maximum predicted value and the minimum predicted value.
[0134] The type of the maximum predicted value and the minimum predicted value is the same as the type of the initial predicted value and the finial predicted value.
[0135] For example, when the initial predicted value and the final predicted value are luma values, the maximum prediction value and the minimum predicted value are also luma values of the reference area. For instance, when the initial predicted value and the final predicted value are blue chroma values, the maximum prediction value and the minimum predicted value are also blue chroma values of the reference area. In another example, when the initial predicted value and the final predicted value are red chroma values, the maximum prediction value and the minimum predicted value are also red chroma values of the reference area.
[0136] In some embodiments of the present disclosure, the reference area includes multiple sample values. the maximum predicted value is determined as the maximum value of multiple sample values of the reference area, and the minimum predicted value is determined as the minimum value the multiple sample values of the reference area. For example, when the initial predicted value and the final predicted value are luma values, the maximum predicted value is determined as the maximum value of multiple sample luma values of the reference area, and the minimum predicted value is determined as the minimum value the multiple sample luma values of the reference area. When the initial predicted value and the final predicted value are blue chroma values, the maximum predicted value is determined as the maximum value of multiple sample blue chroma values of the reference area, and the minimum predicted value is determined as the minimum value the multiple sample blue chroma values of the reference area. When the initial predicted value and the final predicted value are red chroma values, the maximum predicted value is determined as the maximum value of multiple sample red chroma values of the reference area, and the minimum predicted value is determined as the minimum value the multiple sample red chroma values of the reference area.
[0137] Specifically, the reconstructed chroma samples in the reference area can provide guidance for designing the valid range of cross-component prediction values. Therefore, it is possible to traverse the chroma samples in the reference area to determine the maximum predicted value and the minimum predicted value of the blue chroma samples and red chroma samples. These values are stored in the variables m_CbClipMin, m_CbClipMax, m_CrClipMin, and m_CrClipMax. The mathematical description is as follows:
[0138]
[0139]
[0140]
[0141]
[0142] Here, refArea represents the reference area. refCb (x, y) and refCr (x, y) represent the blue chroma samples values and red chroma samples sample values at the position (x, y) in the reference area, respectively.
[0143] After the determination of the maximum predicted value and the minimum predicted value of the reference, the clipping range corresponding to the current block is determined based on the maximum predicted value and the minimum predicted value.
[0144] In this way, a proper clipping range can be obtained to constrain the final prediction value.
[0145] In some embodiments of the present disclosure, the determination of the clipping range corresponding to the current block based on the reference area includes the following operations:
[0146] 1. A second prediction model is determined based on pixels of the reference area, wherein the second prediction model is a function between a chroma sample value and a luma sample value;
[0147] 2. The clipping range is determined based on the second prediction model and values of the reference area.
[0148] Based on the obtained chroma sample values and luma sample values of the reference area, the encoder device and decoder device establish the second prediction model to achieve cross-component prediction. The second prediction model can be a regression-based model. The construction process of the function can be referred to in the above text.
[0149] In one embodiment of the present disclosure, the second prediction model is the same as the first prediction model, so the second prediction model can use the first prediction model directly. In another embodiment of the present disclosure, the second prediction model is different from the first prediction model.
[0150] Specifically, the predicted chroma sample values (dependent variable) are predicted from luma sample values (independent variable) . For instance, the predicted chroma sample values (dependent variable) are predicted from luma sample values (independent variable) . The established second prediction model is denoted as F (·) .
[0151] After establishing the second prediction model, the determination of the clipping range based on the prediction model and values of the reference area includes the following operations:
[0152] 1. The maximum predicted value and the minimum predicted value are obtained based on the second prediction model and the values of the reference area.
[0153] 2. The clipping range is determined based on the maximum predicted value and the minimum predicted value.
[0154] For example, the encoder device and the decoder device can use the maximum luma sample value of the reference area as the independent variable and substitute them into the second prediction model to obtain the maximum predicted value. Here, the maximum predicted value is a chroma value, including the blue chroma value and the red chroma value. The encoder device and the decoder device can use the minimum luma sample value of the reference area as the independent variable and substitute them into the second prediction model to obtain the minimum predicted value. Here, the minimum predicted value is a chroma value, including the blue chroma value and the red chroma value.
[0155] For instance, the encoder device and the decoder device can use the maximum chroma sample value of the reference area as the independent variable and substitute them into the second prediction model to obtain the maximum predicted value. Here, the maximum predicted value is a luma value. The encoder device and the decoder device can use the minimum chroma sample value of the reference area as the independent variable and substitute them into the second prediction model to obtain the minimum predicted value. Here, the minimum predicted value is a luma value.
[0156] When m_CClipMin is used to represent the minimum predicted value and m_CClipMax is used to represent the maximum predicted value, they are denoted as follows:
[0157]
[0158]
[0159] Here, refArea represents the reference area, and (refL (x, y) ) represents the luma sample value position (x, y) in the reference area.
[0160] In some embodiments of the present disclosure, multiple predicted values of the reference area are obtained based on the second prediction model, the maximum prediction value is the maximum of the multiple predicted value. For example, when the luma sample values of the reference area are substituted into the second prediction model to obtain multiple predicted chroma values, the maximum prediction value is the maximum of multiple predicted chroma values. Here, the predicted chroma values can be blue chroma value or red chroma value.
[0161] For example, in CCLM, the encoder device and the decoder device first downsample the luma block corresponding to the chroma block of the current block to achieve a one-to-one correspondence between the luma values and chroma values. Then, a linear prediction model, which is the second prediction model, is derived using the reference area. Finally, the downsampled luma block's pixels values are sequentially substituted into the second prediction model to calculate the predicted chroma values of the current chroma-coded block. Therefore, the luma block's luma values serve as the independent variable, and the clipping range can be derived from the dynamic range of the independent variables and the model coefficients. The maximum prediction value and the minimum prediction values are stored in clpRng. max and clpRng. min. The mathematical description is as follows:
[0162]
[0163] Here, (refL (x, y) ) represent the luma sample value position (x, y) in the reference area, α is the linear model slope, and β is the linear model offset.
[0164] By using a second prediction model to obtain the clipping range, an accurate clipping range can be obtained.
[0165] After the maximum predicted value and the minimum predicted value are obtained, the clipping range is determined based on the maximum predicted value and the minimum predicted value.
[0166] In some embodiments of the present disclosure, when determining the clipping range, the lower bound value of the clipping range is the minimum predicted value; and the upper bound value of the clipping range is the maximum predicted value. Thus, the final prediction value can be constrained within a proper range.
[0167] Specifically, if mCClipMin is used to represent the minimum predicted value of chroma component here, and mCClipMax is used to represent the maximum predicted value of the chroma component here, the clipping range is [mCClipMin, mCClipMax] .
[0168] If mCbClipMin is used to represent the minimum predicted value of blue chroma component here, and mCbClipMax is used to represent the maximum predicted value of the blue chroma component here, the clipping range is [mCbClipMin, mCbClipMax] . And if mCrClipMin is used to represent the minimum predicted value of red chroma component here, and mCrClipMax is used to represent the maximum predicted value of the red chroma component here, the clipping range is [mCrClipMin, mCrClipMax] .
[0169] In some embodiments of the present disclosure, when determining the clipping range, a first range is determined at first, here the lower bound value of the first range is the minimum predicted value, and the upper bound value of the first range is the maximum predicted value. Then the clipping range is determined as an intersection of the first range and a bit depth defined value range, here the bit depth defined value range is determined by a valid bit depth of the current block.
[0170] Specifically, the bit depth defined value range is [0, 2bitdepth-1] , that is, the default valid range of the current block. When the final prediction value is the blue chrom value, the first range is [mCbClipMin, mCbClipMax] . Then the clipping range is the intersection between [0, 2bitdepth-1] and [mCbClipMin, mCbClipMax] . By using clpRngcb to represent the clipping range, it can be denoted as:
[0171] clpRngcb = [max (0, mCbClipMin) , min (2bitdepth-1, mCbClipMax) ] .
[0172] Similarly, When the final prediction value is the red chrom value, the first range is [mCrClipMin, mCrClipMax] . Then the clipping range is the intersection between [0, 2bitdepth-1] and [mCrClipMin, mCrClipMax] . By using clpRngcr to represent the clipping range, it can be denoted as:
[0173] clpRngcr = [max (0, mCrClipMin) , min (2bitdepth-1, mCrClipMax) ] .
[0174] Thus, the final prediction value can be constrained within a proper range and can avoid mistakes.
[0175] It should be noted that, the execution order of S102 and S103 can be the same, or S102 can be executed first and then S103, or S102 can be executed first and then S103.
[0176] In S104, the final predicted value is determined based on the initial predicted value and the clipping range.
[0177] The final predicted value is the output of the intra-frame prediction unit 1104 of the video encoding system 110 and the intra-frame prediction unit 1203 of the video decoding system 120.
[0178] The final prediction value can be a chroma value, for example, it can be a blue chroma value or a red chroma value. The final prediction value also can be a luma value.
[0179] For example, the final prediction value is the chroma value obtained through the cross-component prediction algorithm. Its different components, the blue chroma value and the red chroma value, are denoted as predCb and predCr respectively. These initial predicted values may exceed the valid pixel ranges clpRngcb and clpRngcr. To address this, we perform clipping on the initial predicted values to obtain the final predicted value based on the clipping range.
[0180] Specifically, if the initial prediction value is less than the minimum value of the clipping range, it will be set to the minimum value of the clipping range; if the initial prediction value exceeds the maximum value of the clipping range, it will be set to this maximum value.
[0181] For example, when the clipping range is [mCClipMin, mCClipMax] , the final prediction value is the chroma value, which can be denoted as predC. predC is defined as:
[0182] predC = min (max (predC, mCClipMin) , mCClipMax) .
[0183] For instance, when the final prediction value is the blue chrom value, which can be denoted as predCb. The clipping range is clpRngcb = [max (0, mCbClipMin) , min (2bitdepth-1, mCbClipMax) ] , predCb is defined as:
[0184] preCb = min (max (predCb, max (0, mCbClipMin) ) , min (2bitdepth-1, mCbClipMax) ) .
[0185] Similarly, when the final prediction value is the red chrom value, which can be denoted as predCr. The clipping range is clpRngcr = [max (0, mCrClipMin) , min (2bitdepth-1, mCrClipMax) ] , predCr is defined as:
[0186] preCr = min (max (predCr, max (0, mCrClipMin) ) , min (2bitdepth-1, mCrClipMax) ) .
[0187] This ensures that the predicted chroma pixel values remain within their respective valid reference ranges, improving the accuracy of the prediction results.
[0188] In some embodiments of the present disclosure, a reference area of the current block of an image is obtained, and an initial predicted value corresponding to a sample with the current block based on a first prediction model is obtained, then a clipping range is determined corresponding to the current block based on the reference area, and then the final predicted value based on the initial predicted value and the clipping range is determined. By using clipping range to constrain the initial predicted value, it can enhance the prediction accuracy of the final predicted value and adaptability of the cross-component methods, thereby improving the quality of video decoding and reconstruction. It can also reduce the number of encoding bits and improve video encoding efficiency.
[0189] The present disclosure further provides an image prediction method. FIG. 7 is a flowchart of another image prediction method according to an embodiment of the present disclosure. As shown in FIG. 7, the method may include operations described in blocks S301 to S308.
[0190] In S301, a reference area of a current block is determined.
[0191] In S302, an initial predicted value corresponding to a sample within the current block is obtained based on a first prediction model.
[0192] In S303, a clipping range corresponding to the current block is determined based on the reference area.
[0193] Block S301, S302 and S303 are the same as those shown in FIG. 6, so it can refer to S101, S102 and S103. Thus, for simplicity and clarity, detailed explanation about each operation will not be repeated herein.
[0194] In S304, a minimum range threshold is obtained.
[0195] In some embodiments of the present disclosure, the minimum range threshold can be a preset value.
[0196] In some other embodiments of the present disclosure, the minimum range threshold can be adaptively determined based on context information, or it can be determined based on the size of the current block.
[0197] For example, when the size of the current block is less than 32, the minimum range threshold can be set to 8. When the size of the current block is less than 64, the minimum range threshold can be set to 16. It should be noted that the specific value of the minimum range threshold may be adjusted according to the performance.
[0198] Besides obtaining the minimum range threshold, the range between the upper bound value of the clipping range and the lower bound value will also be obtained and denoted as Range_initial.
[0199] Range_initial can be calculated as below:
[0200] Range_initial = m_ClipMin -m_ClipMax.
[0201] Here, m_ClipMin represents the upper bound value, m_ClipMax represents the lower bound value.
[0202] In some embodiments of the present disclosure, when the clipping range is [mCClipMin, mCClipMax] . Here, mCClipMin is used to represent the minimum predicted value of chroma component here, and mCClipMax is used to represent the maximum predicted value of the chroma component. m_ClipMin is set to mCClipMin, and m_ClipMax is set to mCClipMax.
[0203] In some other embodiments of the present disclosure, when the clipping range is [max (0, mCbClipMin) , min (2bitdepth-1, mCbClipMax) ] . Here, mCbClipMin is used to represent the minimum predicted value of blue chroma component here, and mCbClipMax is used to represent the maximum predicted value of the blue chroma component. m_ClipMin is set to max (0, mCbClipMin) , and m_ClipMax is set to (2bitdepth-1, mCbClipMax) .
[0204] In S305, whether the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold is determined.
[0205] After obtaining the minimum range threshold and the range between the upper bound value of the clipping range and the lower bound value, the range between the upper bound value of the clipping range and the lower bound value is compared to the minimum range threshold. And then whether the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold is determined.
[0206] When the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, the adjusted clipping range can be obtained through two options.
[0207] Option 1: in S306, when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, an adjusted clipping range based on the minimum range bound threshold and the clipping range is determined.
[0208] Specifically, assuming the minimum range threshold is denoted as MinRangeThreshold, the lower bound of the adjusted clipping range is denoted as ClipMin_adjusted, the upper bound of the adjusted clipping range is denoted as ClipMax_adjusted, the calculation process of the adjusted clipping range is as follow:
[0209] If Range_initial < MinRangeThreshold:
[0210] Center = (m_ClipMin + m_ClipMax) / 2;
[0211] ClipMin_adjusted = Center -MinRangeThreshold / 2;
[0212] ClipMax_adjusted = Center + MinRangeThreshold / 2.
[0213] If Range_initial ≥ MinRangeThreshold, the clipping range do not need to be adjusted, that is:
[0214] ClipMin_adjusted = m_ClipMin;
[0215] ClipMax_adjusted = m_ClipMax.
[0216] Option 2, in S307, when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, determining the adjusted clipping range as a bit depth defined value range, the bit depth defined value range is determined by a valid bit depth of the current block.
[0217] Specifically, the calculation process of the adjusted clipping range is as follow:
[0218] If Range_initial < MinRangeThreshold:
[0219] ClipMin_adjusted = 0;
[0220] ClipMax_adjusted = 2^bitdepth –1.
[0221] If Range_initial ≥ MinRangeThreshold, the clipping range do not need to be adjusted, that is:
[0222] ClipMin_adjusted = m_ClipMin;
[0223] ClipMax_adjusted = m_ClipMax.
[0224] It can be understood that the adjusted clipping range should be within the bit depth defined value range. So the final adjusted clipping range is [max (0, ClipMin_adjusted) , min (2^bitdepth -1, ClipMax_adjusted) ] .
[0225] By using this mechanism, it can solve the problem that the clipping range may become too narrow for prediction in some cases, thus making the final predicted value more accuracy and improving the coding efficiency at the same time.
[0226] In S308, the final predicted value is determined based on the initial predicted value and the adjusted clipping range.
[0227] This block is similar to S104, so it can refer to S104, but when the clipping range is used, it should be replaced with the adjusted clipping range.
[0228] In some embodiments of the present disclosure, a reference area of the current block of an image is obtained, and an initial predicted value corresponding to a sample with the current block based on a first prediction model is obtained, then a clipping range is determined corresponding to the current block based on the reference area, and then the final predicted value based on the initial predicted value and the clipping range is determined. By using clipping range to constrain the initial predicted value, it can enhance the prediction accuracy of the final predicted value and adaptability of the cross-component methods, thereby improving the quality of video decoding and reconstruction. It can also reduce the number of encoding bits and improve video encoding efficiency.
[0229] Furthermore, by comparing the clipping range to the minimum rang threshold, it can solve the problem that the clipping range may become too narrow for prediction in some cases, thus making the final predicted value more accuracy and improving the coding efficiency at the same time.
[0230] As described above, in modern video coding standards, there are several cross-component prediction techniques, such as CCLM, CCCM, GL-CCCM, BVG-CCCM. Based on different cross-component prediction techniques, the image prediction methods differ. Based on BVG-CCCM, FIG. 8 is a flowchart of an image prediction method in a specific scenario provided by an embodiment of the present disclosure. As shown in FIG. 8, the method includes operations described in block S401-S411.
[0231] In S401, a template of the current block and a search range is determined.
[0232] In S402, a plurality of candidate blocks is determined, the candidate blocks are within the search range with a size equal to that of the template.
[0233] In S403, a plurality of matching costs between the template and the plurality of candidate blocks is obtained.
[0234] In S404, the block vector corresponding to one of the plurality of the candidate blocks with a lowest matching cost is selected.
[0235] In S405, a reference area of the current block is determined based on the block vector and the current block.
[0236] In S406, an initial predicted value corresponding to a sample within the current block is obtained based on a first prediction model.
[0237] In S407, a clipping range corresponding to the current block is determined based on the reference area.
[0238] In S408, a minimum range threshold is obtained.
[0239] In S409, whether the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold is determined.
[0240] in S410, when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, an adjusted clipping range based on the minimum range bound threshold and the clipping range is determined.
[0241] In S411, the final predicted value is determined based on the initial predicted value and the adjusted clipping range.
[0242] In this embodiment, block S401-block S404 are the same as S201-S204 shown in FIG. 5A. Block S405 is part of S101, block S406 is the same as S102, block S407 is the same as S103, block S408-block S410 are the same as block S304-S306, and block S411 is the same as block S104. So block S401-S411 can refer to the corresponding blocks in the above text. Thus, for simplicity and clarity, detailed explanation about each operation will not be repeated herein.
[0243] By incorporating these operations, the BVG-CCCM method significantly improves the accuracy and reliability of chroma component prediction, leading to enhanced overall video encoding performance.
[0244] The test results under the Joint Video Experts Team (JVET) Common Test Conditions (CTC) test conditions on Enhanced Compression Model (ECM) 14.1 are shown in table 1. In table 1, compared with ECM-14.1, the BD-Rate savings for the luma and chroma components, as well as the changes in encoding / decoding time and memory usage, are presented on standard test sequences of different categories. Here, columns represent performance indicators, and rows represent test sequences of different categories. Y, U, V represent BD-Rate changes for each component respectively. EncVmPeak and DecVmPeak represent percentage changes in peak memory usage during encoding and decoding. It can be observed that chroma compression rate gains can be achieved without introducing additional time complexity. Table 1
[0245] In some embodiments of the present disclosure, a reference area of the current block of an image is obtained, and an initial predicted value corresponding to a sample with the current block based on a first prediction model is obtained, then a clipping range is determined corresponding to the current block based on the reference area, and then the final predicted value based on the initial predicted value and the clipping range is determined. By using clipping range to constrain the initial predicted value, it can enhance the prediction accuracy of the final predicted value and adaptability of the cross-component methods, thereby improving the quality of video decoding and reconstruction. It can also reduce the number of encoding bits and improve video encoding efficiency.
[0246] Please refer to FIG. 9. FIG. 9 specifically describes an image prediction apparatus provided in some embodiments of the present disclosure, which is applied to video encoding device or video decoding devices. The image prediction apparatus can include: a first determination module 901, an obtaining module 902, a second determination module 903, a third determination module 904.
[0247] The first determination module 901 is configured to determine a reference area of a current block of an image.
[0248] The obtaining module 902 is configured to obtain an initial predicted value corresponding to a sample within the current block based on a first prediction model.
[0249] The second determination module 903 is configured to determining a clipping range corresponding to the current block based on the reference area.
[0250] The third determination module 904 is configured to determine the final predicted value based on the initial predicted value and the clipping range.
[0251] In one embodiment of the present application, the initial predicted value and the final predicted value each includes at least one of: a chroma value or a luma value.
[0252] In one embodiment of the present application, the chroma value comprises a blue chroma value and a red chroma value; when the initial predicted value and the final predicted value each includes the chroma values, the initial predicted value and the final predicted value are predicted based on a reconstructed luma value.
[0253] In one embodiment of the present application, when the initial predicted value and the final predicted value each includes the luma value, the initial predicted value and the final predicted value are predicted based on a reconstructed chroma value.
[0254] In one embodiment of the present application, the second determination module 903 is specifically configured to determine a maximum predicted value and a minimum predicted value based on the reference area, and determine the clipping range corresponding to the current block based on the maximum predicted value and the minimum predicted value.
[0255] In one embodiment of the present application, the second determination module 903 is specifically configured to determine the maximum predicted value as a maximum value of multiple sample values of the reference area, and determine the minimum predicted value as a minimum value of the multiple sample values of the reference area.
[0256] In one embodiment of the present application, the second determination module 903 is specifically configured to determine a second prediction model based on pixels of the reference area, wherein the second prediction model is a function between a chroma sample value and a luma sample value, and determine the clipping range based on the second prediction model and values of the reference area.
[0257] In one embodiment of the present application, the second determination module 903 is specifically configured to obtain a maximum predicted value and a minimum predicted value based on the second prediction model and the values of the reference area, and determine the clipping range based on the maximum predicted value and the minimum predicted value.
[0258] In one embodiment of the present application, wherein a lower bound value of the clipping range is the minimum predicted value; and an upper bound value of the clipping range is the maximum predicted value.
[0259] In one embodiment of the present application, the second determination module 903 is specifically configured to determine a first range, wherein a lower bound value of the first range is the minimum predicted value, and an upper bound value of the first range is the maximum predicted value, and determine the clipping range as an intersection of the first range and a bit depth defined value range, wherein the bit depth defined value range is determined by a valid bit depth of the current block.
[0260] In one embodiment of the present application, the reference area comprises a reconstructed block located within a spatial neighborhood of the current block.
[0261] In one embodiment of the present application, the reference area comprises at least one of: one or more rows above the current block; one or more rows below the current block; one or more columns to the left of the current block; or one or more columns to the right of the current block.
[0262] In one embodiment of the present application, the reference area is adjacent to the current block.
[0263] In one embodiment of the present application, the reference area is non-adjacent to the current block.
[0264] In one embodiment of the present application, the rows are non-adjacent to each other, and / or the columns are non-adjacent to each other.
[0265] In one embodiment of the present application, the reference area is determined by a block vector and the current block.
[0266] In one embodiment of the present application, the block vector is reused from a used block vector corresponding to a previous reference area of a reconstructed co-located luma block or a reconstructed co-located chroma block of the current block.
[0267] In one embodiment of the present application, the block vector is determined by: determining a template of the current block and a search range, wherein the search range is within a frame to which the current block belongs; determining a plurality of candidate blocks, wherein the candidate blocks are within the search range with a size equal to that of the template; obtaining a plurality of matching costs between the template and the plurality of candidate blocks; and selecting the block vector corresponding to one of the plurality of the candidate blocks with a lowest matching cost.
[0268] In one embodiment of the present application, the matching costs are calculated based on sum of absolute difference, sum of absolute transformed differences or sum of squared errors.
[0269] In one embodiment of the present application, the first determination module 901 is specifically configured to determine the reference area by adding the block vector with the current block.
[0270] In one embodiment of the present application, the apparatus further includes a adjustment module 905, the adjustment module is configured to obtain a minimum range threshold; determine whether a range between an upper bound value of the clipping range and a lower bound value is less than the minimum range threshold; and when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, determine an adjusted clipping range based on the minimum range bound threshold and the clipping range.
[0271] In one embodiment of the present application, the adjustment module 905 is specifically configured to when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, determine the adjusted clipping range as a bit depth defined value range, wherein the bit depth defined value range is determined by a valid bit depth of the current block.
[0272] FIG. 10 shows a schematic diagram of a device for encoding or decoding according to an embodiment of the present disclosure. FIG. 10 conceptually illustrates a device 1000 with which some embodiments of the invention are implemented. The device 1000 may be a video decoder or a video encoder. The device 1000 may be a computer (e.g., a desktop computer, personal computer, tablet computer, etc. ) , phone, PDA, or any other sort of electronic device. Such a device includes various types of computer readable media and interfaces for various other types of computer readable media. The device 1000 includes a processor 1002 and a memory 1004. The memory 1004 is configured to store executable instructions that, when executed by the processor, cause the processor to perform any one of the foregoing decoding or encoding methods.
[0273] The processor 1002 may be a single processor or a multi-core processor in different embodiments. In some embodiments, the processor may include a GPU, NPU or DSP which may offload various computations or complement the image processing provided by the processor 1002.
[0274] Some embodiments include electronic components, such as microprocessors, storage and memory that store computer program instructions in a machine-readable or computer-readable medium (alternatively 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) , a variety of recordable / rewritable DVDs (e.g., DVD-RAM, DVD-RW, DVD+RW, etc. ) , flash memory (e.g., SD cards, mini-SD cards, micro-SD cards, etc. ) , magnetic and / or solid state hard drives, read-only and recordable discs, ultra density optical discs, any other optical or magnetic media, and floppy disks. The computer-readable media may store a computer program that is executable by at least one processing unit and includes sets of instructions for performing various operations. Examples of computer programs or computer code include machine code, such as is produced by a compiler, and files including higher-level code that are executed by a computer, an electronic component, or a microprocessor using an interpreter.
[0275] While the above discussion primarily refers to microprocessor or multi-core processors that execute software, some embodiments 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 that are stored on the circuit itself. In addition, some embodiments execute software stored in programmable logic devices (PLDs) , ROM, or RAM devices.
[0276] As used in this specification and any claims of this application, the terms “computer” , “server” , “processor” , and “memory” all refer to electronic or other technological devices. These terms exclude people or groups of people. As used in this specification and any claims of this application, the terms “computer readable medium, ” “computer readable media, ” and “machine readable medium” are entirely restricted to tangible, physical objects that store information in a form that is readable by a computer. These terms exclude any wireless signals, wired download signals, and any other ephemeral signals.
[0277] The present disclosure further provides a computer readable media which is configured to store executable instructions. When the instructions are executed by a processor, the processor may perform any one of the foregoing methods and processes. Many of the above-described features and applications are implemented as software processes that are specified as a set of instructions recorded on a computer readable storage medium (also referred to as computer readable medium) . When these instructions are executed by one or more computational or processing unit (s) (e.g., one or more processors, cores of processors, or other processing units) , they cause the processing unit (s) to perform the actions indicated in the instructions. Examples of computer readable media include, but are not limited to, CD-ROMs, flash drives, random access memory (RAM) chips, hard drives, erasable programmable read only memories (EPROMs) , electrically erasable programmable read-only memories (EEPROMs) , etc. The computer readable media does not include carrier waves and electronic signals passing wirelessly or over wired connections.
[0278] In this specification, the term “software” is meant to include firmware residing in read-only memory or applications stored in magnetic storage which can be read into memory for processing by a processor. Also, in some embodiments, multiple software inventions can be implemented as sub-parts of a larger program while remaining distinct software inventions. In some embodiments, multiple software inventions can also be implemented as separate programs. Finally, any combination of separate programs that together implement a software invention described here is within the scope of the invention. In some embodiments, the software programs, when installed to operate on one or more electronic systems, define one or more specific machine implementations that execute and perform the operations of the software programs.
[0279] While the disclosure has been described with reference to numerous specific details, one of ordinary skill in the art will recognize that the invention can be embodied in other specific forms without departing from the spirit of the invention. In addition, a number of the figures conceptually illustrate processes and methods. 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 one continuous series of operations, and different specific operations may be performed in different embodiments. Furthermore, the process could be implemented using several sub-processes, or as part of a larger macro process.
[0280] The foregoing is merely embodiments of the present disclosure, and is not intended to limit the scope of the disclosure. Any transformation of equivalent structure or equivalent process which uses the specification and the accompanying drawings of the present disclosure, or directly or indirectly application in other related technical fields, are likewise included within the scope of the protection of the present disclosure.
Claims
1.An image prediction method, comprising:determining a reference area of a current block of an image;obtaining an initial predicted value of a sample within the current block based on a first prediction model;determining a clipping range corresponding to the current block based on the reference area; anddetermining a final predicted value of the sample based on the initial predicted value and the clipping range.2.The method of claim 1, wherein the initial predicted value and the final predicted value each comprises at least one of: a chroma value or a luma value.3.The method of claim 2, wherein the chroma value comprises a blue chroma value and a red chroma value;when the initial predicted value and the final predicted value each comprises the chroma value, the initial predicted value and the final predicted value are predicted based on a reconstructed luma value.4.The method of claim 2, wherein when the initial predicted value and the final predicted value each comprises the luma value, the initial predicted value and the final predicted value are predicted based on a reconstructed chroma value.5.The method of any one of claims 1, wherein the determining a clipping range corresponding to the current block based on the reference area comprises:determining a maximum predicted value and a minimum predicted value based on the reference area; anddetermining the clipping range corresponding to the current block based on the maximum predicted value and the minimum predicted value.6.The method of claim 5, wherein the determining a maximum predicted value and a minimum predicted value based on the reference area comprises:determining the maximum predicted value as a maximum value of multiple sample values of the reference area, anddetermining the minimum predicted value as a minimum value of the multiple sample values of the reference area.7.The method of any one of claims 1, wherein the determining a clipping range corresponding to the current block based on the reference area comprises:determining a second prediction model based on pixels of the reference area, wherein the second prediction model is a function between a chroma sample value and a luma sample value; anddetermining the clipping range based on the second prediction model and values of the reference area.8.The method of claim 7, wherein the determining the clipping range based on the second prediction model and values of the reference area comprises:obtaining a maximum predicted value and a minimum predicted value based on the second prediction model and the values of the reference area; anddetermining the clipping range based on the maximum predicted value and the minimum predicted value.9.The method of any one of claims 5 to 8, wherein a lower bound value of the clipping range is the minimum predicted value; andan upper bound value of the clipping range is the maximum predicted value.10.The method of any one of claims 5 to 8, wherein the determining the clipping range corresponding to the current block based on the maximum predicted value and the minimum predicted value comprises:determining a first range, wherein a lower bound value of the first range is the minimum predicted value, and an upper bound value of the first range is the maximum predicted value; anddetermining the clipping range as an intersection of the first range and a bit depth defined value range, wherein the bit depth defined value range is determined by a valid bit depth of the current block.11.The method of any one of claims 1, wherein the reference area comprises a reconstructed block located within a spatial neighborhood of the current block.12.The method of claim 11, wherein the reference area comprises at least one of:one or more rows above the current block;one or more rows below the current block;one or more columns to the left of the current block; orone or more columns to the right of the current block.13.The method of claim 12, wherein the rows are non-adjacent to each other, and / or the columns are non-adjacent to each other.14.The method of any one of claims 11 to 12, wherein the reference area is adjacent to the current block.15.The method of any one of claims 11 to 12, wherein the reference area is non-adjacent to the current block.16.The method of any one of claims 1 to 4, wherein the reference area is determined by a block vector and the current block.17.The method of claim 16, wherein the block vector is reused from a used block vector corresponding to a previous reference area of a reconstructed co-located luma block or a reconstructed co-located chroma block of the current block.18.The method of claim 16, wherein the block vector is determined by:determining a template of the current block and a search range, wherein the search range is within a frame to which the current block belongs;determining a plurality of candidate blocks, wherein the candidate blocks are within the search range with a size equal to that of the template;obtaining a plurality of matching costs between the template and the plurality of candidate blocks;selecting the block vector corresponding to one of the plurality of candidate blocks with a lowest matching cost.19.The method of claim 18, wherein the matching costs are calculated based on sum of absolute difference, sum of absolute transformed differences or sum of squared errors.20.The method of any one of claims 16 -to 19, wherein the determining a reference area of the current block comprises:determining the reference area by adding the block vector with a coordinate of the current block.21.The method of any one of claims 5-to 8, wherein after the determining a clipping corresponding to the current block based on the reference area, the method further comprises:obtaining a minimum range threshold;determining whether a range between an upper bound value of the clipping range and a lower bound value is less than the minimum range threshold;when the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, determining an adjusted clipping range based on the minimum range bound threshold and the clipping range.22.The method of claim 21, whereinwhen the range between the upper bound value of the clipping range and the lower bound value is less than the minimum range threshold, determining the adjusted clipping range as a bit depth defined value range, wherein the bit depth defined value range is determined by a valid bit depth of the current block.23.An image prediction apparatus, comprising:a first determination module, configured to determine a reference area of a current block of an image;an obtaining module, configured to obtain an initial predicted value of a sample within the current block based on a first prediction model;a second determination module, configured to determining a clipping range corresponding to the current block based on the reference area; anda third determination module, configured to determine a final predicted value of the sample based on the initial predicted value and the clipping range.24.An encoding device, comprising:one or more processors;a memory; andone or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the method of image prediction according to any one of claims 1 to 22.25.A decoding device, wherein the decoding device comprises:one or more processors;a memory; andone or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the method of image prediction according to any one of claims 1 to 22.26.A non-transitory computer-readable storage medium, wherein a computer program is stored thereon, and the computer program is loaded by a processor to execute steps in the method of image prediction according to any one of claims 1 to 22.
