Intra-frame prediction method, encoder, decoder and encoding and decoding system
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2026-04-07
AI Technical Summary
In the prior art, the convolutional cross-component intra-prediction (CCCM) method has too much calculation during the encoding process, resulting in an increase in encoding time, especially when traversing multiple reference areas, computing models and multi-model variants, the number of attempts increases geometrically.
A intra prediction method is proposed, by combining the reference area with the calculation model, presetting the correspondence relationship and optimizing the calculation process. The specific steps include setting a reference area for the current block, predicting the candidate prediction block according to the calculation model, and selecting the best prediction block as the encoded data.
It effectively reduces the amount of encoding calculation, optimizes the encoding process, and maintains high compression performance and reduces encoding time.
Smart Images

Figure CN121816748A_ABST
Abstract
Description
Intra-frame prediction method, encoder, decoder, and encoding / decoding system Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an intra-frame prediction method, an encoder, a decoder and a coding and decoding system. Background Art
[0002] In image and video compression, an image or frame of video typically consists of three color components: luma (Y) and two chroma components (Cb and Cr). Each component is represented as a data matrix. The data matrix for each component is divided into blocks associated with specific coding parameters. For any block on a particular component, which can be a square or rectangle with a side length that is a power of 2, there is a unique corresponding block in the other two components, located at the same spatial location. The encoder operates according to a specific encoding order: luma is processed first, followed by chroma components; processing begins in the upper left corner and proceeds from left to right and top to bottom.
[0003] In video coding standards such as Versatile Video Coding (VVC), intra-frame prediction is a method of using previously coded blocks within the same image to predict the current block. When performing intra-frame prediction on the current block, the encoder tries a variety of preset intra-frame prediction modes, generating a prediction block using the reconstructed values from previously coded blocks. These prediction blocks are then compared to select the best prediction mode. The difference between the current block and the best prediction block (residual) is also encoded. By signaling the best prediction mode and the residual, the decoder can reconstruct the same reconstructed image or video as the encoder.
[0004] When encoding the chrominance components, the luma components in the same image have already been encoded, and the reconstructed luma block can be used as a reference sample for encoding the chrominance components. Therefore, when encoding the current block of the chrominance components, the current block of the chrominance components can be predicted by analyzing the relationship between the luma components and the chrominance components in the nearby encoded blocks and applying this relationship to the current block of the luma components. This method is usually called Cross-Component Prediction (CCP).
[0005] In the current development of video coding, there is a type of CCP method called Convolution Cross-Component Intra Prediction Model (CCCM). The actual implementation of CCCM can have the following variations:
[0006] - Reference region selection: The encoder tests and selects different combinations of coding blocks as reference regions based on their spatial locations.
[0007] - Choice of computational model: The encoder tests different sampling combinations.
[0008] -Multi-model variant: Pixels in the reference area can be further divided into two or more parts based on statistical characteristics, and each part has its own function coefficients calculated to generate the corresponding chrominance pixel prediction value.
[0009] Compared with most traditional intra-frame prediction modes, the computational process of convolutional cross-component intra-frame prediction (CCCM) is more complex. Each CCCM involves sampling feature vectors of hundreds to thousands of pixels in the reference area, solving a system of linear equations, and calculating the prediction block. The existing technology has algorithm variants developed based on the basic principles of CCCM. The introduction of these algorithm variants results in multiple sets of reference areas, calculation models, and multi-model variant settings in CCCM. The process of traversing each type of setting causes the total number of attempts to grow exponentially. Therefore, although CCCM brings benefits in terms of compression performance, it is also very time-consuming.
[0010] Summary of the Invention
[0011] To solve the above problems, the present invention provides an intra-frame prediction method, which uses already encoded pixels in the same image or video frame to predict the current block. The method is performed by an image or video encoder, and the method includes:
[0012] The reference region is composed of a number of pixels, wherein a preset correspondence exists between the reference region and the calculation model;
[0013] Setting at least one reference region for a current block, and predicting at least one candidate prediction block of the current block according to a calculation model;
[0014] The current block is compared with at least one candidate prediction block to determine an optimal prediction block, and a combination of the reference area corresponding to the optimal prediction block and the calculation model is used as encoding data of the current block.
[0015] Optionally, the calculation model includes a directional model and a non-directional model;
[0016] When the calculation model is the directional model, the reference area is paired with one or more directional types of calculation models; and
[0017] When the calculation model is the non-directional model, the reference area is paired with the non-directional calculation model.
[0018] Optionally, the eigenvector corresponding to the calculation model includes a plurality of vector elements, and the vector elements correspond to eigenvalues;
[0019] When at least one eigenvalue in the eigenvector is a directional eigenvalue, the calculation model is the directional model; and
[0020] When all eigenvalues in the eigenvector are non-directional eigenvalues, the calculation model is the non-directional model.
[0021] Optionally, when the reference area includes only pixels located to the left of the current block, the number of eigenvalues in the vertical direction of the adapted calculation model is not less than the number of eigenvalues in the horizontal direction; and
[0022] When the reference area only includes pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is not less than the number of eigenvalues in the vertical direction.
[0023] Optionally, when the reference area includes pixels located to the left of the current block and pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is equal to the number of eigenvalues in the vertical direction.
[0024] Optionally, the calculation model corresponds to a feature vector obtained by sampling brightness features based on pixels in the reference area.
[0025] Optionally, when the reference area includes pixels located to the left of the current block and pixels located above the current block, all calculation models are traversed.
[0026] Optionally, in the brightness feature sampling based on the pixels in the reference area, the sampled feature value includes any one of the following:
[0027] (a) The brightness value of the pixel;
[0028] (b) the brightness values of the neighboring pixels of the pixel;
[0029] (c) the weighted average of the values in (a) and (b) above;
[0030] (d) brightness gradient values of the pixel and / or adjacent pixels;
[0031] (e) The spatial coordinates of the pixel relative to the upper left corner of the reference block;
[0032] (f) the square of the value of (a) or (b) or (c) above;
[0033] (g) Constant value.
[0034] Optionally, the positional relationship between the adjacent pixels and the current pixel is determined based on the sampled characteristic values.
[0035] Optionally, it also includes: if the eigenvalue is a vertical eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is above or below the current pixel, wherein (d) in the eigenvalue is the vertical gradient, and (e) is the vertical coordinate value.
[0036] Optionally, it also includes: if the eigenvalue is a horizontal eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is to the left or right of the current pixel; wherein (d) in the eigenvalue is the horizontal gradient, and (e) is the horizontal coordinate value.
[0037] Optionally, the reference area includes a luminance component reference area and a chrominance component reference area, positions of the luminance component reference area and the chrominance component reference area correspond one to one, and the step of performing prediction on the current block according to the calculation model to obtain at least one candidate prediction block corresponding to the current block includes:
[0038] Determine the coefficients of a linear function using a linear regression method based on the feature vectors of the pixels in the luminance component reference area and the chrominance components of the pixels at the same position in the chrominance component reference area;
[0039] Based on the coefficients of the linear function and the current block, a candidate prediction block corresponding to the calculation model is obtained.
[0040] Optionally, it also includes: further dividing the pixels in the reference area into at least two parts based on statistical characteristics, each of the different parts performs an operation to obtain function coefficients to generate corresponding prediction values, and the prediction values of the at least two parts are combined to form the at least one candidate prediction block.
[0041] Optionally, also include:
[0042] Extracting pixels in several directions of the current block;
[0043] Finding calculation models and function coefficients of the same prediction method corresponding to the pixels in multiple directions, and applying the calculation models and function coefficients to the current block to calculate multiple corresponding derived prediction blocks;
[0044] Calculating an average value of the derived prediction block and the best prediction block to obtain a plurality of average values corresponding to the plurality of derived prediction blocks;
[0045] Calculating the sum of absolute difference values between the average value and the current block to obtain a plurality of first absolute difference sums corresponding to the plurality of average values;
[0046] Selecting a minimum value from a plurality of first absolute difference sums as the second absolute difference sum;
[0047] Calculate the sum of absolute differences between the best prediction block and the current block to obtain a third sum of absolute differences;
[0048] When the second absolute difference sum is smaller than the third absolute difference sum, the prediction block corresponding to the second absolute difference sum is used as a new optimal prediction block.
[0049] The present invention also provides an intra-frame prediction method, which uses decoded pixels in the same image or video frame to reconstruct a current block. The method is performed by an image or video decoder, and the method includes:
[0050] Decoding the encoded data of the current block, wherein the encoded data of the current block includes a combination of a reference area corresponding to an optimal prediction block and a calculation model, wherein the optimal prediction block is determined by comparing the current block with at least one candidate prediction block, wherein the at least one candidate prediction block is obtained by performing prediction on the current block according to the calculation model when at least one reference area is set for the current block, wherein there is a preset correspondence between the reference area and the calculation model, and the reference area consists of a plurality of pixels.
[0051] Optionally, the calculation model includes a directional model and a non-directional model;
[0052] When the calculation model is the directional model, the reference area is paired with one or more directional types of calculation models; and
[0053] When the calculation model is the non-directional model, the reference area is paired with the non-directional calculation model.
[0054] Optionally, the eigenvector corresponding to the calculation model includes a plurality of vector elements, and the vector elements correspond to eigenvalues;
[0055] When at least one eigenvalue in the eigenvector is a directional eigenvalue, the calculation model is the directional model; and
[0056] When all eigenvalues in the eigenvector are non-directional eigenvalues, the calculation model is the non-directional model.
[0057] Optionally, when the reference area includes only pixels located to the left of the current block, the number of eigenvalues in the vertical direction of the adapted calculation model is not less than the number of eigenvalues in the horizontal direction; and
[0058] When the reference area only includes pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is not less than the number of eigenvalues in the vertical direction.
[0059] Optionally, when the reference area includes pixels located to the left of the current block and pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is equal to the number of eigenvalues in the vertical direction.
[0060] Optionally, the calculation model corresponds to a feature vector obtained by sampling brightness features based on pixels in the reference area.
[0061] Optionally, in the brightness feature sampling based on the pixels in the reference area, the sampled feature value includes any one of the following:
[0062] (a) The brightness value of the pixel;
[0063] (b) the brightness values of the neighboring pixels of the pixel;
[0064] (c) the weighted average of the values in (a) and (b) above;
[0065] (d) brightness gradient values of the pixel and / or adjacent pixels;
[0066] (e) The spatial coordinates of the pixel relative to the upper left corner of the reference block;
[0067] (f) the square of the value of (a) or (b) or (c) above;
[0068] (g) Constant value.
[0069] Optionally, the positional relationship between the adjacent pixels and the current pixel is determined based on the sampled characteristic values.
[0070] Optionally, also include:
[0071] If the eigenvalue is a vertical eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is above or below the current pixel, wherein (d) in the eigenvalue is the vertical gradient and (e) is the vertical coordinate value.
[0072] Optionally, also include:
[0073] If the eigenvalue is a horizontal eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is to the left or right of the current pixel; wherein, (d) in the eigenvalue is the horizontal gradient, and (e) is the horizontal coordinate value.
[0074] Optionally, the reference area includes a luminance component reference area and a chrominance component reference area, positions of the luminance component reference area and the chrominance component reference area correspond one to one, and the at least one candidate prediction block corresponding to the current block is obtained in the following manner:
[0075] Determine the coefficients of a linear function using a linear regression method based on the feature vectors of the pixels in the luminance component reference area and the chrominance components of the pixels at the same position in the chrominance component reference area;
[0076] Based on the coefficients of the linear function and the current block, a candidate prediction block corresponding to the calculation model is obtained.
[0077] Optionally, the at least one candidate prediction block corresponding to the current block is obtained in the following manner:
[0078] The pixels in the reference area are further divided into at least two parts based on statistical characteristics, and different parts each perform an operation of obtaining function coefficients to generate corresponding prediction values, and the prediction values of the at least two parts are combined to form the at least one candidate prediction block.
[0079] Optionally, when the coded data of the current block includes neighboring pixels of the current block, the final best prediction block comes from a new prediction block, and the new prediction block is obtained in the following manner:
[0080] Extracting pixels in several directions of the current block;
[0081] Finding calculation models and function coefficients of the same prediction method corresponding to the pixels in multiple directions, and applying the calculation models and function coefficients to the current block to calculate multiple corresponding derived prediction blocks;
[0082] Calculating an average value of the derived prediction block and the best prediction block to obtain a plurality of average values corresponding to the plurality of derived prediction blocks;
[0083] Calculating the sum of absolute difference values between the average value and the current block to obtain a plurality of first absolute difference sums corresponding to the plurality of average values;
[0084] Selecting a minimum value from a plurality of first absolute difference sums as the second absolute difference sum;
[0085] Calculate the sum of absolute differences between the best prediction block and the current block to obtain a third sum of absolute differences;
[0086] When the second absolute difference sum is smaller than the third absolute difference sum, the prediction block corresponding to the second absolute difference sum is used as a new optimal prediction block.
[0087] The present invention also provides an encoder, comprising a processor, wherein the processor is configured to execute instructions to implement the method described above.
[0088] The present invention also provides a decoder, comprising a processor, wherein the processor is configured to execute instructions to implement the method described above.
[0089] The present invention also provides a coding and decoding system, which includes an encoding device and a decoding device, wherein the encoding device includes a first processor, and the first processor is used to execute instructions to implement the method performed by the image or video encoder as described above; the decoding device includes a second processor, and the second processor is used to execute instructions to implement the method performed by the image or video decoder as described above.
[0090] The beneficial effect of the present invention is that it solves the problem in the prior art that the process of traversing the settings of each reference area, calculation model and multi-model variant causes the total number of attempts to grow exponentially and the amount of calculation is too large. The encoding and decoding strategy proposed in the present invention combines the reference area selection and the calculation model. The reference area corresponds to the calculation model, thereby optimizing the calculation process while maintaining the compression performance to a large extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without inventive efforts. Among them:
[0092] FIG1A is a schematic diagram of a video encoding system according to an embodiment of the present invention.
[0093] FIG1B is a schematic diagram of a video decoding system according to an embodiment of the present invention.
[0094] FIG2 is a schematic diagram of three color components in a color image or video frame according to an embodiment of the present invention.
[0095] FIG3 is a schematic diagram of luminance components and chrominance components in a color image or video frame according to an embodiment of the present invention.
[0096] FIG. 4A is a flowchart of an intra-frame prediction method performed by an image or video encoder according to a first embodiment of the present invention.
[0097] FIG. 4B is a flowchart of an intra-frame prediction method performed by an image or video decoder according to the first embodiment of the present invention.
[0098] FIG. 5 is a flowchart of an intra-frame prediction method performed by an image or video encoder according to a second embodiment of the present invention.
[0099] FIG6 is a schematic diagram of a reference area relative to a current block according to an embodiment of the present invention.
[0100] FIG7 is a schematic diagram of the relative positions of a current pixel and adjacent pixels according to an embodiment of the present invention.
[0101] FIG8 is a diagram comparing the technical solution of the present invention with that of the prior art.
[0102] FIG9 is a schematic diagram of neighboring pixels of a current block according to an embodiment of the present invention. DETAILED DESCRIPTION
[0103] In order to more clearly illustrate the embodiments of the present disclosure or related technologies, a brief overview of several embodiments will be introduced below. Obviously, these illustrations are only some embodiments of the present disclosure, and people with ordinary skills can derive other illustrations based on these illustrations.
[0104] In order to better understand the technical solutions proposed in the embodiments of the present invention, it is best to start with a brief introduction to several basic concepts: video encoding and decoding systems.
[0105] Embodiments of the present invention relate to a video coding system. As shown in FIG1A , the video coding system 110 includes multiple units: a block segmentation unit 1101, a transform and quantization unit 1102, an intra-frame estimation unit 1103, an intra-frame prediction unit 1104, a motion compensation unit 1105, a motion estimation unit 1106, an inverse transform and inverse quantization unit 1107, a filter control analysis unit 1108, a loop filter unit 1109, a coding unit 1110, an image buffer unit 1111, and a subtractor 1112.
[0106] Starting with the original video signal, the image frame is divided into coding tree blocks (CTUs, hereinafter referred to as "blocks") by the block segmentation unit 1101. For each current block, the subtractor 1112 subtracts the prediction block output by the intra prediction unit 1103 or the motion compensation unit 1104 from the current block to generate residual pixel information, resulting in a residual block. The transform and quantization unit 1102 transforms and quantizes the residual pixel information obtained through intra prediction or inter prediction (motion compensation). The transform converts the residual pixel information from the pixel domain to the transform domain, and then quantizes the resulting transform coefficients to further reduce the bit rate. The intra estimation unit 1103 performs intra estimation, and the intra prediction unit 1104 performs intra prediction on the video reconstructed block. Motion estimation, performed by the motion estimation unit 1106, generates a motion vector that estimates the motion of the video reconstructed block. The motion compensation unit 1105 then performs motion compensation based on the determined motion vector. After determining the intra prediction mode, the intra prediction unit 1104 provides the selected intra prediction data to the encoding unit 1110. The motion estimation unit 1106 sends the calculated motion vector data to the encoding unit 1110. The inverse transform and inverse quantization unit 1107 reconstructs the video reconstruction block and the reconstructed residual block in the pixel domain. The loop filter unit 1109 is controlled by the filter control and analysis unit 1108 to eliminate artifacts in the reconstructed block. The encoding unit 1110 adds the reconstructed residual block to the prediction block in the coded image buffer unit 1111 to generate a reconstructed block. The encoding unit 1110 is used to encode various coding parameters and quantized transform coefficients (quantized transform coefficients) into a bitstream and output the bitstream of the video signal. The coded image buffer unit 1111 is used to store the reconstructed block as a reference block. As video image encoding progresses, new reconstructed blocks are continuously generated and stored in the coded image buffer unit 1111.
[0107] An embodiment of the present invention provides a video decoding system. As shown in FIG1B , the video decoding system 120 comprises multiple units: a decoding unit 1201, an inverse transform and inverse quantization unit 1202, an intra-frame prediction unit 1203, a motion compensation unit 1204, a loop filter unit 1205, a decoded image buffer unit 1206, and a post-filter unit 1207.
[0108] The video encoding system 110 encodes a video frame 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 a bitstream representing a video frame in an encoded format (i.e., a compressed format). In the video decoding system 120, the decoding unit 1201 processes the bitstream to obtain decoded transform coefficients. The inverse transform and dequantization unit 1202 processes the transform coefficients to generate a residual block in the pixel domain. The intra-frame prediction unit 1203 generates an intra-frame prediction block for the current video decoding block based on a determined intra-frame prediction mode and previously decoded block data for the current video decoding block. The motion compensation unit 1204 determines inter-frame prediction information for the current video decoding block and generates an inter-frame prediction block by parsing motion vectors and other relevant syntax elements. Finally, the decoded video block is formed by adding the residual block generated by the inverse transform and dequantization unit 1202 to the corresponding prediction block generated by the intra-frame prediction unit 1203 or the motion compensation unit 1204. To improve video quality, the decoded video blocks are filtered by filtering unit 1205 to remove artifacts. The decoded video blocks are then stored in decoded image buffer 1206, serving as reference blocks for subsequent intra-frame prediction or motion compensation, and reconstructing the video signal. The reconstructed video signal can then be optionally further processed by post-filtering unit 1207 to achieve a more suitable or enhanced visual experience.
[0109] The data structure of a color image is shown below. As shown in Figure 2, a color image or color video frame typically consists of three color components: luma component Y 301 and two chroma components, Cb 302 and Cr 303. Each component is represented as a data matrix. The data matrix for each component is decomposed into blocks associated with specific coding parameters. For example, block 304 of luma component Y, block 305 of chroma component Cb, and block 306 of chroma component Cr all correspond to spatial locations 307 in the color image. In video coding, the luma component is typically processed first, followed by the chroma components.
[0110] The luminance component of a color image or video frame has a higher resolution in both the vertical and horizontal directions than any of the chrominance components, with twice as many pixels in each direction as the chrominance components. To reflect the spatial correspondence between the luminance and chrominance components during the intra-frame prediction process, the luminance component is downsampled during the intra-frame prediction process to match the resolution of the chrominance components, so that all components have an equal number of pixels in the vertical and horizontal directions.
[0111] When encoding chrominance components, the luma component in the same image has already been encoded, and the reconstructed luma block can serve as a reference sample for encoding the chrominance components. Therefore, when encoding the current chrominance block, the current chrominance block can be predicted by analyzing the relationship between the luma and chrominance components in nearby encoded blocks and applying this relationship to the current luma block. This method is commonly known as cross-component prediction (CCP). The principle of cross-component intra-frame prediction is to use the reconstructed image region of one color component to predict the image region of another color component in the same image. As shown in Figure 3, a current block 405 of any chrominance component (either Cb or Cr) is about to be encoded. At this time, a current block 401 of the luma component Y corresponding to the same spatial position as the current block 405 has already been encoded and reconstructed. Reference blocks 402, 403, and 404 corresponding to the current block 401 also correspond to the same spatial position as reference blocks 406, 407, and 408 corresponding to the current block 405 and have already been encoded and reconstructed. Reference blocks 406, 407, and 408 may constitute a reference region for current block 405. The principle of cross-component prediction is to calculate the relationship between reference blocks 402, 403, and 404 for the luma component and reference blocks 406, 407, and 408 for the chroma components, and apply the relationship to current block 401 for the luma component to calculate predicted values for the chroma components of current block 405. Alternatively, a subset of reference blocks 406, 407, and 408 may constitute a reference region for current block 405.
[0112] The embodiments of the present 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. The video decoding system 120 receives a bitstream representing a video frame. Therefore, the intra-frame prediction unit 1203 of the video decoding system 120 can obtain the luminance component and chrominance component of the reference block, as well as the luminance component of 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 1104 of the video encoding system 110. The intra-frame prediction method provided by the embodiments of the present invention can maintain the quality of video decoding and reconstruction while maintaining a certain compression performance, while reducing the amount of computation on the encoding end and optimizing the computational process.
[0113] An embodiment of the present invention provides an intra-frame prediction method, which is applied to an image or video encoding or decoding device. The functions implemented by this method can be implemented by a processor in the image or video encoding or decoding device calling program code. Of course, the program code can also be stored in a computer storage medium. Therefore, the image or video encoding or decoding device includes a processor and a storage medium.
[0114] FIG4A is a flowchart of an intra-frame prediction method performed by an image or video encoder according to a first embodiment of the present invention. The intra-frame prediction method may be a convolutional cross-component intra-frame prediction (CCCM) method, which uses coded pixels (specifically, coded reference blocks) within the same image or video frame to predict the current block. As shown in FIG4A , the method includes the following steps S101 to S103:
[0115] S101: A reference area is composed of a number of pixels, wherein a preset corresponding relationship exists between the reference area and a calculation model.
[0116] The reference area may be composed of several reference blocks. Specifically, multiple reference blocks are used as a set, and a subset is selected from this set as the reference area. The reference area may include one or more reference blocks, for example, the reference area is composed of the reference block to the left of the current block, or the reference area is composed of the reference block above the current block, or the reference area is composed of the reference blocks to the left, above, and above the left of the current block. In an embodiment of the present invention, multiple reference areas are included, which are composed of different reference blocks or cover pixels of different positions and numbers, and each reference area participates in the calculation of, for example, convolution cross-component intra-frame prediction.
[0117] There is a preset correspondence between the reference area and the calculation model. For each reference area, a calculation model corresponding to the reference area is selected. That is, each reference area has a corresponding calculation model. The calculation model is a feature vector obtained by sampling the brightness features based on the pixels in the reference area. The feature vector corresponding to the calculation model includes multiple different types of feature values, and each vector element of the feature vector corresponds to a type of feature value. For example, for one pixel in a reference area, a value is taken based on the pixel, such as the brightness value of the pixel, the brightness value of the neighboring pixels of the pixel, or the weighted average of the brightness value of the pixel and the brightness value of the neighboring pixels of the pixel, and each of these values can be used as a vector element of the feature vector.
[0118] In this step, a computational model corresponding to each reference region is selected. This is equivalent to using different combinations of vector elements as the feature vector for different reference regions, thereby adapting different computational models. The vector elements in the feature vector can be horizontal or vertical, i.e., directional (more on this later).
[0119] In an embodiment of the present invention, a reference region corresponds to a computation model. Specifically, the computation model corresponding to the reference region is predetermined, and the selection of the reference region and the computation model are mutually constrained. The multiple computation models include multiple different types of computation models, and each reference region can only be adapted to a non-empty subset of the multiple types of computation models. For example, if there are three different reference regions (e.g., reference region 1, reference region 2, and reference region 3) and three different computation models (e.g., computation model 1, computation model 2, and computation model 3), reference region 1 can be adapted to computation model 1, reference region 2 can be adapted to computation model 2, and reference region 3 can be adapted to computation model 3. Alternatively, reference region 1 can be adapted to computation models 1 to 3, reference region 2 can be adapted to computation models 1 and 2, and reference region 3 can be adapted to computation models 1 and 3. When performing related operations such as convolutional cross-component intra prediction (CCCM), operations can be performed in this pairing manner to reduce the overall amount of computation, solving the problem of excessive encoding computation time caused by traversing various combinations of reference regions and computation models in the prior art.
[0120] In one embodiment, the calculation model may include a directional model and a non-directional model; when the calculation model is a directional model, the reference area is paired with a calculation model of one or more directional types; and when the calculation model is a non-directional model, the reference area is paired with a non-directional calculation model.
[0121] In one embodiment, when at least one eigenvalue in the eigenvector is a directional eigenvalue, the calculation model is a directional model; and when all eigenvalues in the eigenvector are non-directional eigenvalues, the calculation model is a non-directional model.
[0122] In one embodiment, when the reference area includes only pixels to the left of the current block, the number of eigenvalues in the vertical direction of the adapted computing model is not less than the number of eigenvalues in the horizontal direction; and when the reference area includes only pixels above the current block, the number of eigenvalues in the horizontal direction of the adapted computing model is not less than the number of eigenvalues in the vertical direction. In one embodiment, when the reference area includes pixels to the left of the current block and pixels above the current block, the number of eigenvalues in the horizontal direction of the adapted computing model is equal to the number of eigenvalues in the vertical direction. In one embodiment, when the reference area includes pixels to the left of the current block and pixels above the current block, all computing models are traversed.
[0123] S102: Setting at least one reference area for the current block, and predicting at least one candidate prediction block of the current block according to a calculation model.
[0124] The current block may correspond to at least one reference region, and each reference region may correspond to one or more computational models. Based on the determined reference region and computational model, prediction is performed on the current block to obtain a candidate prediction block corresponding to the current block. Specifically, there are multiple combinations of reference regions and computational models. For example, during convolutional cross-component intra prediction (CCCM), a candidate prediction block corresponding to the current block can be obtained for each combination of reference region and computational model, and multiple candidate prediction blocks can be obtained for all combinations.
[0125] Specifically, the reference area includes a luminance component reference area and a chrominance component reference area, and the positions of the luminance component reference area and the chrominance component reference area correspond one to one. This step may include: determining the coefficients of the linear function using a linear regression method based on the feature vectors of the pixels in the luminance component reference area and the chrominance components of the pixels at the same position in the chrominance component reference area; and obtaining a candidate prediction block corresponding to the calculation model based on the coefficients of the linear function and the current block.
[0126] Cross-component prediction involves calculating the relationship between a reference region for the luma component and a reference region for the chroma component, and applying this relationship to the current block of the luma component to calculate the predicted value for the chroma component of the current block. That is, for each combination, the candidate prediction block includes the chroma components of the pixels. Specifically, for each combination, a linear regression method can be used to calculate a set of function coefficient vectors with the same length as the feature vector corresponding to the calculation model. This function coefficient vector minimizes the sum of the squared differences between the dot product of the feature vector corresponding to each pixel in the reference region and the function coefficient vector and the chroma values of the pixels at the same position in the reference region. The resulting function coefficient vector is then applied to the current block of the luma component to obtain a candidate prediction block for the chroma component corresponding to the current block. Furthermore, when performing, for example, convolutional cross-component intra prediction (CCCM), a multi-model variant can be employed. When the multi-model variant is enabled, the pixels in the reference region are further divided into at least two parts based on statistical features (e.g., the average luma value of all pixels in the reference region). The function coefficients of each part are calculated to generate corresponding prediction values, and the prediction values of the at least two parts are combined to form the candidate prediction block.
[0127] Convolutional cross-component intra prediction (CCCM) is common knowledge in the technical field, and reference may be made to relevant literature, which will not be described in detail here.
[0128] S103: Compare the current block with at least one candidate prediction block to determine the best prediction block, and use a combination of a reference region and a calculation model corresponding to the best prediction block as encoding data of the current block.
[0129] The current block is compared with at least one candidate prediction block. For example, the candidate prediction blocks generated by each of the above combinations are compared with the current block, and the sum of absolute differences is calculated. The block with the smallest sum of absolute differences is selected as the best prediction block, thus determining the best prediction block. The combination of the reference area corresponding to the best prediction block and the calculation model serves as the coded data for the current block. The coded data further includes the residual between the current block and the best prediction block.
[0130] In another embodiment, the new prediction block can be obtained by the following steps: extracting pixels in several directions of the current block; finding the calculation model and function coefficients of the same prediction method corresponding to the pixels in several directions, and applying the calculation model and function coefficients to the current block to calculate several corresponding derived prediction blocks; calculating the average value of the derived prediction block and the best prediction block to obtain several average values corresponding to the several derived prediction blocks; calculating the sum of the absolute value differences between the average value and the current block to obtain several first absolute difference sums corresponding to the several average values; selecting the minimum value from the several first absolute difference sums as the second absolute difference sum; calculating the sum of the absolute difference between the best prediction block and the current block to obtain a third absolute difference sum; when the second absolute difference sum is less than the third absolute difference sum, taking the prediction block corresponding to the second absolute difference sum as the new best prediction block.
[0131] Specifically, the same prediction method is to use the same CCCM, and the derived prediction block is a prediction block generated by the CCCM configuration used by the neighboring pixels of the current block; in step S103, it can also be considered to extract reference blocks in several directions of the current block, reference blocks in several directions (such as the upper left neighbor block (A) of the upper left corner pixel of the current block; the left neighbor block (B) of the lower left corner pixel of the current block; the upper neighbor block (C) of the upper right corner pixel of the current block), and then find the calculation model and function coefficients of the same prediction method corresponding to the reference blocks in several directions, and apply the calculation model and function coefficients to the current block to calculate the corresponding several derived prediction blocks; that is, from this Search the three neighboring pixels to see whether the pixel uses CCCM. If so, find the convolution cross-component prediction CCCM configuration it uses. The CCCM configuration used by each neighboring pixel generates a prediction block (i.e., a derived prediction block). In this way, multiple derived prediction blocks corresponding to multiple neighboring pixels are generated. Then, for each of the derived prediction blocks, the average value of each of the derived prediction blocks and the best prediction block is calculated to obtain several average values corresponding to the several derived prediction blocks; that is, the prediction block generated by the CCCM configuration used by each neighboring pixel and the best prediction block are averaged to obtain several average values corresponding to the several derived prediction blocks. For each of the plurality of average values, the sum of the absolute value differences between each average value and the current block is calculated to obtain a plurality of first absolute difference sums corresponding to the plurality of average values; then, the minimum value is selected from the plurality of first absolute difference sums as the second absolute difference sum, that is, the one with the smallest first absolute difference sum is selected; then, the sum of the absolute differences between the best prediction block and the current block is calculated to obtain a third absolute difference sum; when the second absolute difference sum is less than the third absolute difference sum, the derived prediction block corresponding to the second absolute difference sum is used as the new best prediction block, that is, the combination formed by the new best prediction block and the neighboring pixels becomes the best configuration.
[0132] In the intra-frame prediction method on the encoding side proposed in the present invention, the reference area selection and the calculation model are combined. The reference area corresponds to the calculation model. Specifically, the calculation model corresponding to the reference area is predetermined, and there is a mutually restrictive relationship between the selection of the reference area and the selection of the calculation model. Therefore, compared with the existing technology, the calculation process can be optimized while maintaining the compression performance to a large extent.
[0133] FIG4B is a flowchart of an intra-frame prediction method performed by an image or video decoder according to a first embodiment of the present invention. The intra-frame prediction method may be a convolutional cross-component intra-frame prediction (CCCM) method, which uses decoded pixels (specifically, decoded reference blocks) within the same image or video frame to reconstruct the current block. As shown in FIG4B , the method includes the following steps S111:
[0134] S111: Decode the coded data of the current block, wherein the coded data of the current block includes a combination of a reference area corresponding to the best prediction block and a calculation model, wherein the best prediction block is determined by comparing the current block with at least one candidate prediction block, wherein the at least one candidate prediction block is obtained by performing a prediction on the current block according to the calculation model when at least one reference area is set for the current block, wherein the reference area and the calculation model have a preset correspondence, and the reference area is composed of a number of pixels. The calculation model corresponding to the reference area is predetermined, and the selection of the reference area and the selection of the calculation model are mutually constrained. For other technical details of the intra-frame prediction method on the decoding side of the embodiment of the present invention, reference can be made to the intra-frame prediction method on the encoding side described above, which will not be repeated here.
[0135] FIG5 is a flowchart of an intra-frame prediction method performed by an image or video encoder according to a second embodiment of the present invention. As shown in FIG5 , the method includes the following steps S201 to S205:
[0136] S201: Acquire a set of previously reconstructed blocks corresponding to the current block, i.e., a reference area;
[0137] When determining the reference region, as shown in Figure 6, the reference region is defined by extending multiple rows or columns in each direction relative to the current block. Within the sampling region, the pixels to be encoded are generally located to the left (L), above (T), top left (TL), top right (TR), and bottom left (BL) of the current block.
[0138] For example, when encoding the current block 405 of the chrominance component, the reference area includes all the reference areas in Figure 2, that is, the reference blocks 402, 403, and 404 on the luminance component and the reference blocks 406, 407, and 408 at the same position on the chrominance component. The method of using these reference blocks to form the reference area is hereinafter referred to as reference area mode 1.
[0139] As another example, the reference area only includes pixels located above the current block, namely, reference blocks 402 and 404 on the luminance component and reference blocks 406 and 408 at the same position on the chrominance component. The reference area formed by these reference blocks is hereinafter referred to as reference area mode 2.
[0140] As another example, the reference area only includes pixels located to the left of the current block, namely, reference blocks 402 and 403 on the luminance component and reference blocks 406 and 407 at the same position on the chrominance component. The reference area formed by these reference blocks is hereinafter referred to as reference area mode 3.
[0141] S202: Select a calculation model;
[0142] As mentioned above, convolutional cross-component intra prediction (CCCM) requires sampling the luminance features of each pixel in the reference area to calculate the prediction function coefficients used to predict the chrominance current block.
[0143] The sampled feature values may include:
[0144] (a) The brightness value of the pixel;
[0145] (b) the brightness values of the neighboring pixels of the pixel;
[0146] (c) the weighted average of the values in (a) and (b) above;
[0147] (d) brightness gradient values of the pixel and / or adjacent pixels;
[0148] (e) The spatial coordinates of the pixel relative to the upper left corner of the reference block;
[0149] (f) the square of the value of (a) or (b) or (c) above;
[0150] (g) Constant value.
[0151] Determine the positional relationship between the adjacent pixels and the current pixel based on the sampled eigenvalues:
[0152] If an eigenvalue is called a vertical eigenvalue, it should have the following characteristics: if it belongs to the (c) type eigenvalue or the (f) type eigenvalue formed by squaring the (c) type eigenvalue, the neighboring pixels are above or below the current pixel; if it belongs to the (d) type eigenvalue, it should be the vertical gradient; if it belongs to the (e) type eigenvalue, it should be the vertical coordinate value.
[0153] If a eigenvalue is called a horizontal eigenvalue, it should have the following characteristics: if it belongs to the (c) type eigenvalue or the (f) type eigenvalue formed by squaring the (c) type eigenvalue, the neighboring pixels are to the left or right of the current pixel; if it belongs to the (d) type eigenvalue, it should be the horizontal gradient; if it belongs to the (e) type eigenvalue, it should be the horizontal coordinate value.
[0154] As shown in FIG7 , the current pixel can be represented by the letter C, and its neighboring pixels can be represented by the following direction letters: north (N), south (S), west (W), east (E), northwest (NW), northeast (NE), southwest (SW), and southeast (SE).
[0155] For example, seven values can be extracted to form the feature vector F, as follows, hereinafter referred to as calculation model 1-1: F = [CG y G x YXC*C 1], contains two horizontal eigenvalues (such as X, Gx ), two vertical eigenvalues (e.g., Y, G y ).
[0156] Among them, G y =(2N+NW+NE)-(2S+SW+SE), G x =(2W+NW+SW)-(2E+NE+SE)
[0157] X and Y are the spatial coordinates in the horizontal and vertical directions mentioned above.
[0158] The present invention proposes the following new models, namely calculation model 1-2 and calculation model 1-3, which use seven values to form the feature vector F:
[0159] Computational model 1-2: F = [CG y G x XG NE-SW C*C 1], including two horizontal eigenvalues (e.g., X, G x ), 1 vertical eigenvalue (e.g., G y ).
[0160] Computational Model 1-3: F = [CG y G x YG NE-SW C*C 1], contains one horizontal eigenvalue (e.g., G x ), two vertical eigenvalues (e.g., Y, G y ).
[0161] Among them, G NE-SW =(2NE+N+E)-(2SW+S+W)
[0162] The above calculation model 1-1, calculation model 1-2, and calculation model 1-3 are collectively referred to as calculation model category 1.
[0163] As shown in Figure 8, under the existing technology, all combinations of reference area patterns and calculation models will be traversed. However, in an embodiment of the present invention, the selection of calculation models in calculation model category 1 will be determined by the reference area. When reference area pattern 1 is used, only calculation model 1-1 is traversed, that is, the model with the same number of eigenvalues in the horizontal direction and the number of eigenvalues in the vertical direction; when reference area pattern 2 is used, only calculation model 1-2 is traversed, that is, the model with more eigenvalues in the horizontal direction; when reference area pattern 3 is used, only calculation model 1-3 is calculated and traversed, that is, the model with more eigenvalues in the vertical direction.
[0164] That is, the calculation model corresponding to the reference area pattern is predetermined, and there is a mutually restrictive relationship between the selection of the reference area pattern and the selection of the calculation model. That is, the directionality is taken into consideration to adapt the reference area pattern and the calculation model. In this way, there is no need to traverse all combinations of reference area patterns and calculation models. While reducing the amount of calculation, a certain compression performance is still maintained, and the quality of video decoding and reconstruction is maintained.
[0165] The present invention proposes another new model as an alternative model or parallel model to the aforementioned calculation model category 1, which uses nine values to form the feature vector F. This new model is referred to as calculation model category 2 and includes three types of calculation models:
[0166] Calculation Model 2-1: F = [CG y G x YXC 2 L(C)L 2 (C)1], contains two horizontal eigenvalues (e.g., X, G x ), two vertical eigenvalues (e.g., Y, G y ).
[0167] Calculation Model 2-2: F = [CG y G x YXC 2 H(C)H 2 (C)1], contains four horizontal eigenvalues (e.g., X, G x 、H(C)、H 2 (C)), two vertical eigenvalues (e.g., Y, G y ).
[0168] Computational Model 2-3: F = [CG y G x YXC 2 V(C)V 2 (C)1], contains two horizontal eigenvalues (e.g., X, G x ), 4 vertical eigenvalues (such as Y, G y 、V(C)、V 2 (C)).
[0169] Among them, L(C)=(4*C+N+S+W+E+4)>>3, H(C)=(2*C+W+E+2)>>2, V(C)=(2*C+N+S+2)>>2, where >> is a right shift operation.
[0170] As shown in Figure 8, in this embodiment, the selection of the calculation model of the calculation model category 2 will be determined by the reference area. When the reference area mode 1 is used, only the calculation model 2-1 is traversed, that is, the model with the same number of eigenvalues in the horizontal direction and the number of eigenvalues in the vertical direction; when the reference area mode 2 is used, only the calculation model 2-2 is traversed, that is, the model with more eigenvalues in the horizontal direction; when the reference area mode 3 is used, only the calculation model 2-3 is traversed, that is, the model with more eigenvalues in the horizontal direction.
[0171] In the prior art, there is a combination of computational models, such as the CCCM-MDF mentioned in the prior art. According to the aforementioned comparison of the number of eigenvalues in the horizontal direction and the number of eigenvalues in the vertical direction, there are three models: the first model is characterized by an equal number of eigenvalues in the horizontal direction and the number of eigenvalues in the vertical direction, hereinafter referred to as Directional Model 1; the second model is characterized by a larger number of eigenvalues in the horizontal direction, hereinafter referred to as Directional Model 2; the third model is characterized by a larger number of eigenvalues in the vertical direction, hereinafter referred to as Directional Model 3.
[0172] As shown in Figure 8, in an embodiment of the present invention, the selection of this type of calculation model is determined by the reference area. When reference area mode 1 is used, only directional model 1 is traversed; when reference area mode 2 is used, only directional model 2 is traversed; when reference area mode 3 is used, only directional model 3 is traversed.
[0173] In the prior art, there is a class of calculation model combinations, such as CCCM and CCCM-NoSub, that do not include any vertical or horizontal eigenvalues. These models are referred to as non-directional models. The method proposed in the present invention does not impose these constraints. The reference area selected in step S201 can be combined with any of these non-directional models.
[0174] The following table lists different types of calculation models and their characteristics
[0175] In summary, in this embodiment of the present invention, the following reference regions and calculation model combinations are traversed:
[0176] In another embodiment, the selection of the reference area constrains the calculation model as follows: when reference area mode 1 is selected, all calculation models are traversed; when reference area mode 2 is selected, the model with more eigenvalues in the vertical direction is skipped; when reference area mode 3 is selected, the model with more eigenvalues in the horizontal direction is skipped.
[0177] In summary, the following reference areas and calculation model combinations are traversed:
[0178] S203: Select multiple model variants;
[0179] When the multi-model variant is turned off, all pixels in the reference area are used to calculate a set of the above prediction function coefficients, and are used to calculate the prediction block of the chrominance block at the same position as the current block.
[0180] When multi-model variants are enabled, the average brightness value of all pixels in the reference area is used as the demarcation point. Pixels whose brightness values are not greater than the average are grouped together, and the remaining pixels are grouped together. Each group performs a separate operation to obtain the function coefficients and calculate the chroma prediction values for the pixels at the same location. The union of the two sets of chroma prediction values forms the chroma prediction block.
[0181] S204: performing convolutional cross-component intra prediction (CCCM) to predict the current block according to the configuration selected above, looping until all configurations have been traversed;
[0182] According to the reference area determined in S201, each pixel is sampled in the manner determined in S202 and grouped in the manner described in S203. A set of function coefficient vectors having the same length as the eigenvector is calculated using a linear regression method. This function coefficient vector can minimize the sum of the squared differences between the result of the dot product between the eigenvector corresponding to each pixel and the function coefficient vector and the chrominance value at the same position in the reference area. Convolutional cross-component intra prediction (CCCM) is common knowledge in the art and reference can be made to relevant literature, which will not be described in detail here.
[0183] S205: Select the prediction that is most similar to the current block as the selected best configuration.
[0184] When selecting the optimal configuration, the predicted block generated by each of the above configurations is compared with the current block, and the sum of absolute differences is calculated. The configuration with the smallest sum of absolute differences is selected as the optimal configuration. The optimal configuration selection method is added to the bitstream, and the decoder can reconstruct the predicted block based on the optimal configuration obtained through decoding.
[0185] In another embodiment, when executing step S205, the configuration with the smallest sum of absolute differences is selected as the optimal configuration. In practice, a configuration combination is extracted from the neighboring pixels of the current block. As shown in Figure 9, three neighbors of the current block are considered: the upper left neighbor of the upper left pixel of the current block (A); the left neighbor of the lower left pixel of the current block (B); and the upper neighbor of the upper right pixel of the current block (C). From these three neighboring pixels, a query is performed to determine whether the pixel uses CCCM. If so, the CCCM configuration used is determined. The prediction block generated by the CCCM configuration used by each neighboring pixel is averaged with the optimal prediction block. The sum of absolute differences between the prediction block corresponding to each average value and the current block is calculated, and the one with the smallest sum of absolute differences is selected. If the smallest sum of absolute differences is smaller than the sum of absolute differences between the prediction block generated by the current candidate configuration and the current block, then the combination formed by the configuration corresponding to the smallest sum of absolute differences and the neighboring pixels becomes the optimal configuration. The selection method for the configuration corresponding to the smallest sum of absolute differences and the selection of neighboring pixels are added to the bitstream, and the decoder can reconstruct the prediction block based on the optimal configuration obtained through decoding.
[0186] After all convolutional cross-component intra prediction (CCCM) calculations are performed, the remaining process can be connected to the current video codec standard to complete the encoding and decoding.
[0187] An embodiment of the present invention further provides an encoder including a memory and a processor. The memory stores an image processing program. When the image processing program is executed by the processor, the steps of the intra-frame prediction method on the encoding side in any of the above embodiments are implemented.
[0188] An embodiment of the present invention further provides a decoder comprising a memory and a processor. The memory stores an image processing program, and when the image processing program is executed by the processor, the steps of the intra-frame prediction method on the decoding side in any of the above embodiments are implemented.
[0189] An embodiment of the present invention also provides a coding and decoding system, which includes an encoding device and a decoding device, the encoding device includes a first processor, the first processor is used to execute instructions to implement the steps of the intra-frame prediction method on the encoding side in any of the above embodiments, and the decoding device includes a second processor, the second processor is used to execute instructions to implement the steps of the intra-frame prediction method on the decoding side in any of the above embodiments.
[0190] The present invention also provides a non-volatile storage medium storing an image processing program. When the image processing program is executed by a processor, the steps of the intra-frame prediction method on the encoding side or the decoding side in any of the above embodiments are implemented.
[0191] In the embodiments of the smart terminal and storage medium provided by the present invention, all technical features of any of the above-mentioned method embodiments may be included. The expanded and explained contents of the specification are basically the same as those of the above-mentioned method embodiments and will not be repeated here.
[0192] An embodiment of the present invention further provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the methods in the various possible implementation modes described above.
[0193] An embodiment of the present invention also provides a chip, including a memory and a processor, wherein the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in various possible implementations as described above.
[0194] It should be understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided by the embodiments of the present invention. The technical solutions of the present invention can also be applied to other scenarios. For example, those skilled in the art will appreciate that as system architectures evolve and new business scenarios emerge, the technical solutions provided by the embodiments of the present invention will also be applicable to similar technical problems.
[0195] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0196] The steps in the method of the embodiment of the present invention can be adjusted in sequence, combined, or deleted according to actual needs.
[0197] The units in the device of the embodiment of the present invention can be merged, divided, and deleted according to actual needs.
[0198] In the present invention, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solution and other contents of the present invention, for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the previous related detailed descriptions.
[0199] In the present invention, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0200] The various technical features of the technical solution of the present invention can be arbitrarily combined. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.
[0201] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present invention.
[0202] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a storage disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).
[0203] The above description is only an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An intra-frame prediction method, which uses pixels that have been encoded in the same image or video frame to predict a current block, the method being performed by an image or video encoder, wherein: The method comprises: The reference area is composed of a number of pixels, wherein there is a preset corresponding relationship between the reference area and the calculation model; Setting at least one reference area for a current block, and predicting at least one candidate prediction block of the current block according to a calculation model; The current block is compared with at least one candidate prediction block to determine an optimal prediction block, and a combination of the reference area corresponding to the optimal prediction block and the calculation model is used as encoding data of the current block.
2. The intra-frame prediction method according to claim 1, wherein: The calculation model includes a directional model and a non-directional model; When the calculation model is the directional model, the reference area is paired with a calculation model of one or more directional types; and When the calculation model is the non-directional model, the reference area is paired with the non-directional calculation model.
3. The intra-frame prediction method according to claim 2, wherein: The characteristic vector corresponding to the calculation model includes a plurality of vector elements, and the vector elements correspond to the characteristic values; When at least one eigenvalue in the eigenvector is a directional eigenvalue, the calculation model is the directional model; and When all eigenvalues in the eigenvector are eigenvalues without directionality, the calculation model is the non-directional model.
4. The intra-frame prediction method according to claim 3, wherein: When the reference area includes only pixels located to the left of the current block, the number of eigenvalues in the vertical direction of the adapted calculation model is not less than the number of eigenvalues in the horizontal direction; and When the reference area only includes pixels located above the current block, the adapted calculation model is: The number of eigenvalues in the horizontal direction is not less than the number of eigenvalues in the vertical direction.
5. The intra-frame prediction method according to claim 4, wherein: When the reference area includes pixels located to the left of the current block and pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is equal to the number of eigenvalues in the vertical direction.
6. The intra-frame prediction method according to claim 3, wherein: The calculation model corresponds to a feature vector obtained by sampling brightness features based on pixels in the reference area.
7. The intra-frame prediction method according to claim 6, wherein: In the brightness feature sampling based on the pixels in the reference area, the sampled feature value includes any one of the following: (a) The brightness value of the pixel; (b) the brightness values of the neighboring pixels of the pixel; (c) the weighted average of the values in (a) and (b) above; (d) brightness gradient value of the pixel and / or neighboring pixels; (e) The spatial coordinates of the pixel relative to the upper left corner of the reference block; (f) the square of the value of (a) or (b) or (c) above; (g) Constant value.
8. The intra-frame prediction method according to claim 7, wherein: The positional relationship between the adjacent pixels and the current pixel is determined according to the sampled characteristic values.
9. The intra-frame prediction method according to claim 8, wherein: Also includes: If the eigenvalue is a vertical eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is above or below the current pixel, wherein (d) in the eigenvalue is the vertical gradient and (e) is the vertical coordinate value.
10. The intra-frame prediction method according to claim 8, wherein: Also includes: If the eigenvalue is a horizontal eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is to the left or right of the current pixel; wherein (d) in the eigenvalue is the horizontal gradient, and (e) is the horizontal coordinate value.
11. The intra-frame prediction method according to claim 7, wherein: The reference area includes a luminance component reference area and a chrominance component reference area, the positions of the luminance component reference area and the chrominance component reference area correspond to each other one by one, and the step of performing prediction on the current block according to the calculation model to obtain at least one candidate prediction block corresponding to the current block includes: Determine the coefficient of the linear function using a linear regression method according to the feature vector of the pixel in the luminance component reference area and the chrominance component of the pixel at the same position in the chrominance component reference area; Based on the coefficients of the linear function and the current block, a candidate prediction block corresponding to the calculation model is obtained.
12. The intra-frame prediction method according to claim 11, wherein: Also includes: The pixels in the reference area are further divided into at least two parts based on statistical characteristics, and different parts respectively perform operations of obtaining function coefficients to generate corresponding prediction values, and the prediction values of the at least two parts are combined to form the at least one candidate prediction block.
13. The intra-frame prediction method according to claim 1, wherein: Also includes: Extracting pixels in several directions of the current block; Finding calculation models and function coefficients of the same prediction mode corresponding to the pixels in several directions, and applying the calculation models and function coefficients to the current block to calculate several corresponding derived prediction blocks; Calculating an average value of the derived prediction block and the best prediction block to obtain a plurality of average values corresponding to the plurality of derived prediction blocks; Calculating the sum of absolute value differences between the average value and the current block to obtain a plurality of first absolute difference sums corresponding to the plurality of average values; Selecting a minimum value from a plurality of first absolute difference sums as the second absolute difference sum; Calculate the absolute difference sum between the best prediction block and the current block to obtain a third absolute difference sum; When the second absolute difference sum is smaller than the third absolute difference sum, the prediction block corresponding to the second absolute difference sum is used as a new optimal prediction block.
14. An intra-frame prediction method, which uses decoded pixels in the same image or video frame to reconstruct a current block, the method being performed by an image or video decoder, the method comprising: Decoding the coded data of the current block, wherein the coded data of the current block includes The method comprises the steps of: determining a reference area corresponding to an optimal prediction block and a calculation model, wherein the optimal prediction block is determined by comparing the current block with at least one candidate prediction block, wherein the at least one candidate prediction block is obtained by performing prediction on the current block according to the calculation model when at least one reference area is set for the current block, wherein the reference area has a preset corresponding relationship with the calculation model, and the reference area consists of a plurality of pixels.
15. The intra-frame prediction method according to claim 14, wherein: The calculation model includes a directional model and a non-directional model; When the calculation model is the directional model, the reference area is paired with a calculation model of one or more directional types; and When the calculation model is the non-directional model, the reference area is paired with the non-directional calculation model.
16. The intra-frame prediction method according to claim 15, wherein: The characteristic vector corresponding to the calculation model includes a plurality of vector elements, and the vector elements correspond to the characteristic values; When at least one eigenvalue in the eigenvector is a directional eigenvalue, the calculation model is the directional model; and When all eigenvalues in the eigenvector are eigenvalues without directionality, the calculation model is the non-directional model.
17. The intra-frame prediction method according to claim 16, wherein: When the reference area includes only pixels located to the left of the current block, the number of eigenvalues in the vertical direction of the adapted calculation model is not less than the number of eigenvalues in the horizontal direction; and When the reference area only includes pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is not less than the number of eigenvalues in the vertical direction.
18. The intra-frame prediction method according to claim 17, wherein: When the reference area includes pixels located to the left of the current block and pixels located above the current block, the number of eigenvalues in the horizontal direction of the adapted calculation model is equal to the number of eigenvalues in the vertical direction.
19. The intra-frame prediction method according to claim 16, wherein: The calculation model corresponds to a feature vector obtained by sampling brightness features based on pixels in the reference area.
20. The intra-frame prediction method according to claim 19, wherein: In the brightness feature sampling based on the pixels in the reference area, the sampled feature value includes any one of the following: (a) The brightness value of the pixel; (b) the brightness values of the neighboring pixels of the pixel; (c) the weighted average of the values in (a) and (b) above; (d) brightness gradient value of the pixel and / or neighboring pixels; (e) The spatial coordinates of the pixel relative to the upper left corner of the reference block; (f) the square of the value of (a) or (b) or (c) above; (g) Constant value.
21. The intra-frame prediction method according to claim 20, wherein: The positional relationship between the adjacent pixels and the current pixel is determined according to the sampled characteristic values.
22. The intra-frame prediction method according to claim 21, wherein: Also includes: If the eigenvalue is a vertical eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is above or below the current pixel, wherein (d) in the eigenvalue is the vertical gradient and (e) is the vertical coordinate value.
23. The intra-frame prediction method according to claim 21, wherein: Also includes: If the eigenvalue is a horizontal eigenvalue, and the eigenvalue is (c) or (f) formed by squaring the brightness value of (c), then the neighboring pixel is to the left or right of the current pixel; wherein (d) in the eigenvalue is the horizontal gradient, and (e) is the horizontal coordinate value.
24. The intra-frame prediction method according to claim 20, wherein: The reference area includes a luminance component reference area and a chrominance component reference area, the positions of the luminance component reference area and the chrominance component reference area correspond to each other one by one, and the at least one candidate prediction block corresponding to the current block is obtained in the following manner: Determine the coefficient of the linear function using a linear regression method according to the feature vector of the pixel in the luminance component reference area and the chrominance component of the pixel at the same position in the chrominance component reference area; Based on the coefficients of the linear function and the current block, a candidate prediction block corresponding to the calculation model is obtained.
25. The intra-frame prediction method according to claim 24, wherein: The at least one candidate prediction block corresponding to the current block is obtained in the following manner: The pixels in the reference area are further divided into at least two parts based on statistical characteristics, and different parts respectively perform operations of obtaining function coefficients to generate corresponding prediction values, and the prediction values of the at least two parts are combined to form the at least one candidate prediction block.
26. The intra-frame prediction method according to claim 14, wherein: When the coded data of the current block includes neighboring pixels of the current block, the final best prediction block comes from a new prediction block, and the new prediction block is obtained in the following manner: Extracting pixels in several directions of the current block; Finding calculation models and function coefficients of the same prediction mode corresponding to the pixels in several directions, and applying the calculation models and function coefficients to the current block to calculate several corresponding derived prediction blocks; Calculating an average value of the derived prediction block and the best prediction block to obtain a plurality of average values corresponding to the plurality of derived prediction blocks; Calculating the sum of absolute value differences between the average value and the current block to obtain a plurality of first absolute difference sums corresponding to the plurality of average values; Selecting a minimum value from a plurality of first absolute difference sums as the second absolute difference sum; Calculate the absolute difference sum between the best prediction block and the current block to obtain a third absolute difference sum; When the second absolute difference sum is smaller than the third absolute difference sum, the prediction block corresponding to the second absolute difference sum is used as a new optimal prediction block.
27. An encoder comprising a processor, the processor being configured to execute instructions to implement the method of any one of claims 1 to 13.
28. A decoder comprising a processor, the processor being configured to execute instructions to implement the method of any one of claims 14 to 26.
29. A coding and decoding system, comprising a coding device and a decoding device, wherein the coding device comprises a first processor, the first processor is used to execute instructions to implement the method described in any one of claims 1 to 13, and the decoding device comprises a second processor, the second processor is used to execute instructions to implement the method described in any one of claims 14 to 26.