Image prediction method, encoder, decoder, and storage medium
By simplifying the acquisition of shift offset and quantity parameters in MIP mode, and using fixed constant values to determine MIP input sample values and weighting matrices, the problems of high computational complexity and storage space requirements in H.266/VVC are solved, and the encoding and decoding efficiency is improved.
Patent Information
- Application Number
- CN202411073130.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2019-10-04
- Filing Date
- 2020-08-21
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-08-21
AI Technical Summary
While matrix-based intra-frame prediction (MIP) technology in H.266/VVC improves encoding and decoding performance, it also leads to higher computational complexity and storage space requirements, making it difficult to implement on devices with low computing power or limited storage capacity, thus reducing encoding and decoding efficiency.
By simplifying the process of obtaining the shift offset parameter and shift quantity parameter, and using fixed constant values to determine the MIP input sample value and weighting matrix, the computational complexity and storage space requirements are reduced.
While ensuring encoding and decoding performance, it reduces computational complexity and storage space requirements, and improves encoding and decoding efficiency.
Smart Images

Figure CN118945379A_ABST
Abstract
Description
[0001] Description of the case
[0002] This application is a divisional application based on a Chinese patent with an application date of August 21, 2020, application number 202010852469.3, and invention name “Image prediction method, encoder, decoder and storage medium”.
[0003] CROSS-REFERENCE TO RELATED APPLICATIONS
[0004] Prior U.S. provisional patent application No. 62 / 911,166, filed on October 4, 2019, in the name of Junyan Huo, and entitled “Video Encoding and Decoding Methods and Apparatuses Therefor.” Technical Field
[0005] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to an image prediction method, an encoder, a decoder, and a storage medium. Background Art
[0006] As people's requirements for video display quality increase, new video applications such as high-definition and ultra-high-definition video have emerged. H.265 / High Efficiency Video Coding (HEVC) can no longer meet the needs of the rapid development of video applications. The Joint Video Exploration Team (JVET) has proposed the next-generation video coding standard H.266 / Versatile Video Coding (VVC).
[0007] In H.266 / VVC, the matrix-based intra prediction (MIP) process is very complex. Therefore, while the MIP technology improves the encoding and decoding performance, the storage space and computational complexity required in the encoding and decoding process are also greatly increased, thereby reducing the encoding and decoding efficiency. Summary of the invention
[0008] The present application provides an image prediction method, an encoder, a decoder and a storage medium, which can reduce the complexity and the storage space required in the encoding and decoding process while ensuring the encoding and decoding performance, thereby effectively improving the encoding and decoding efficiency.
[0009] The technical solution of this application can be implemented as follows:
[0010] In a first aspect, an embodiment of the present application provides an image prediction method, which is applied to an encoder, and the method includes:
[0011] Determining prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters;
[0012] When the prediction mode parameter indicates that the intra prediction value of the current block is determined using a matrix-based intra prediction MIP mode, determining the MIP input sample value of the current block according to adjacent sample values of the current block;
[0013] Determine, according to a value of a shift offset parameter, a product of a sum of the MIP input sampling values and the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant;
[0014] Determine a first constant value according to a value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant;
[0015] Setting the value of the first offset to the difference between the first constant value and the product;
[0016] Determining a MIP weighting matrix of the current block according to the prediction parameters;
[0017] Determine a MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset, wherein the MIP prediction value is a prediction value of some sampling points in the current block;
[0018] The MIP prediction value is filtered to obtain an intra-frame prediction value of the current block.
[0019] In a second aspect, an embodiment of the present application provides an image prediction method, which is applied to a decoder, and the method includes:
[0020] Parsing the bitstream to obtain prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters;
[0021] When the prediction mode parameter indicates that the intra prediction value of the current block is determined using a matrix-based intra prediction MIP mode, determining the MIP input sample value of the current block according to adjacent sample values of the current block;
[0022] Determine, according to a value of a shift offset parameter, a product of a sum of the MIP input sampling values and the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant;
[0023] Determine a first constant value according to a value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant;
[0024] Setting the value of the first offset to the difference between the first constant value and the product;
[0025] Determining a MIP weighting matrix of the current block according to the prediction parameters;
[0026] Determine a MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset, wherein the MIP prediction value is a prediction value of some sampling points in the current block;
[0027] The MIP prediction value is filtered to obtain an intra-frame prediction value of the current block.
[0028] In a third aspect, an embodiment of the present application provides an encoder, the encoder comprising a first determination unit, a first calculation unit and a first prediction unit; wherein,
[0029] The first determining unit is configured to determine a prediction parameter of the current block, wherein the prediction parameter includes: a prediction mode parameter; and when the prediction mode parameter indicates that a matrix-based intra-frame prediction MIP mode is used to determine an intra-frame prediction value of the current block, determining a MIP input sample value of the current block according to adjacent sample values of the current block;
[0030] The first calculation unit is configured to determine the product of the sum of the MIP input sample values and the shift offset parameter according to a value of the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; and determine a first constant value according to a value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; and set the value of the first offset to the difference between the first constant value and the product;
[0031] The first determining unit is further configured to determine a MIP weighting matrix of the current block according to the prediction parameter;
[0032] The first prediction unit is configured to determine the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; and filter the MIP prediction value to obtain the intra-frame prediction value of the current block.
[0033] In a fourth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor; wherein:
[0034] The first memory is used to store a computer program that can be run on the first processor;
[0035] The first processor is used to execute the steps of the method described in the first aspect when running the computer program.
[0036] In a fifth aspect, an embodiment of the present application provides a decoder, the decoder comprising a parsing unit, a second determining unit, a second calculating unit, and a second predicting unit; wherein,
[0037] The parsing unit is configured to parse the bitstream to obtain prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters;
[0038] The second determination unit is configured to determine the MIP input sample value of the current block according to the adjacent sample values of the current block when the prediction mode parameter indicates that the matrix-based intra prediction MIP mode is used to determine the intra prediction value of the current block;
[0039] The second calculation unit is configured to determine the product of the sum of the MIP input sample values and the shift offset parameter according to a value of the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; and determine a first constant value according to a value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; and set the value of the first offset to the difference between the first constant value and the product;
[0040] The second determining unit is further configured to determine a MIP weighting matrix of the current block according to the prediction parameter;
[0041] The second prediction unit is configured to determine the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; and filter the MIP prediction value to obtain the intra-frame prediction value of the current block.
[0042] In a sixth aspect, an embodiment of the present application provides a decoder, the decoder comprising a second memory and a second processor; wherein:
[0043] The second memory is used to store a computer program that can be run on the second processor;
[0044] The second processor is used to execute the method as described in the second aspect when running the computer program.
[0045] In a seventh aspect, an embodiment of the present application provides a computer storage medium storing a computer program, wherein the computer program implements the method described in the first aspect when executed by a first processor, or implements the method described in the second aspect when executed by a second processor.
[0046] The embodiment of the present application provides an image prediction method, an encoder, a decoder and a storage medium, which determine prediction parameters of a current block, wherein the prediction parameters include: a prediction mode parameter; when the prediction mode parameter indicates that a matrix-based intra-frame prediction MIP mode is used to determine an intra-frame prediction value of the current block, the MIP input sampling value of the current block is determined according to adjacent sampling values of the current block; according to the value of a shift offset parameter, the product of the sum of the MIP input sampling values and the shift offset parameter is determined, wherein the value of the shift offset parameter is a fixed constant; according to the shift amount The value of the parameter is used to determine the first constant value, wherein the value of the shift quantity parameter is a fixed constant; the value of the first offset is set to the difference between the first constant value and the product; according to the prediction parameter, the MIP weighting matrix of the current block is determined; according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, the MIP prediction value of the current block is determined, wherein the MIP prediction value is the prediction value of some sampling points in the current block; the MIP prediction value is filtered to obtain the intra-frame prediction value of the current block. In this way, for the MIP mode, since the acquisition process of the shift offset parameter and the shift quantity parameter is simplified, it is possible to reduce the complexity and reduce the storage space required in the coding and decoding process on the basis of ensuring the coding and decoding performance, thereby effectively improving the coding and decoding efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a process framework of a MIP prediction process provided for a related technical solution;
[0048] Figure 2 A schematic diagram of the system composition of an encoder provided in an embodiment of the present application;
[0049] Figure 3 A schematic diagram of the system composition of a decoder provided in an embodiment of the present application;
[0050] Figure 4 A schematic diagram of a flow chart of an image prediction method provided in an embodiment of the present application;
[0051] Figure 5 A schematic diagram of a process framework for obtaining a prediction block using a MIP mode provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of a flow chart of another image prediction method provided in an embodiment of the present application;
[0053] Figure 7 A schematic diagram of the structure of an encoder provided in an embodiment of the present application;
[0054] Figure 8 A schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;
[0055] Fig. 9 A schematic diagram of the structure of a decoder provided in an embodiment of the present application;
[0056] Fig.10 A schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
[0057] Fig.11 A schematic diagram of the structure of a sending device provided in an embodiment of the present application;
[0058] Fig.12 A schematic diagram of the structure of a target device provided in an embodiment of the present application;
[0059] Fig.13 A schematic diagram of the structure of a communication system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for the convenience of description, only the parts related to the related applications are shown in the accompanying drawings.
[0061] At present, the International Telecommunication Union-Telecommunication (ITU-T) and the International Organization for Standardization (ISO) / International Electrotechnical Commission (IEC) have launched a standardization project called VVC to develop a new generation of video coding standards, the purpose of which is to improve the coding performance when encoding high-quality videos with one or more characteristics of high resolution, high frame rate, high bit depth, high dynamic range, wide color gamut and omnidirectional viewing angle.
[0062] In H.266 / VVC, the matrix-based intra prediction (MIP) technology is an intra prediction mode, and the encoder or decoder can obtain the intra prediction block of the current block through the MIP technology.
[0063] The following is a description of the relevant technical solutions for the prediction process of the MIP mode.
[0064] The input data of the MIP mode include: the position of the current block (xTbCmp, yTbCmp), the MIP mode index value applied to the current block (which can be represented by modeId), the height of the current block (represented by nTbH), the width of the current block (represented by nTbW), and a transposition processing indication flag indicating whether transposition is required (represented by isTransposed), etc.
[0065] The output data of the MIP mode includes: the intra-frame prediction block of the current block. The prediction value corresponding to the pixel coordinate [x][y] in the intra-frame prediction block is predSamples[x][y]; where x = 0, 1, ..., nTbW-1; y = 0, 1, ..., nTbH-1.
[0066] like Figure 1 As shown, the MIP prediction process may include four steps:
[0067] S101: Configure core parameters.
[0068] For S101, the MIP core parameters may include the type of the current block (represented by mipSizeId), the number of reference samples for each edge (represented by boundySize), the number of MIP input samples (represented by inSize), and the MIP prediction block size output by matrix multiplication (arranged as predSize×predSize). According to the size of the current block, the current block can be divided into three categories, and the type of the current block is recorded by mipSizeId. Here, mipSizeId can be equal to 0, 1, or 2. Moreover, for different types of current blocks, the number of reference sampling points and the MIP prediction block size output by matrix multiplication are different.
[0069] S102: Acquire reference pixels.
[0070] For S102, when predicting the current block, the upper block and the left block of the current block are both encoded blocks. The reference pixels of the MIP technology are the reconstructed values of the upper row of pixels and the left column of pixels of the current block. The process of obtaining the reference pixels adjacent to the upper side (represented by refT) and the reference pixels adjacent to the left side (represented by refL) of the current block is the reference pixel acquisition process.
[0071] S103: Construct input samples.
[0072] For S103, this step is used for the input of matrix multiplication, and may specifically include:
[0073] S1031: Obtain reference samples;
[0074] S1032: construct a reference sampling buffer;
[0075] S1033: Derive matrix multiplication input samples.
[0076] For S1031, the process of obtaining the reference sample is a process of downsampling the reference pixel. For S1032, in the construction of the reference sample buffer, there are two filling methods: a filling method of the buffer when transposition is not required and a filling method of the buffer when transposition is required.
[0077] S104: Generate a predicted value.
[0078] For S104, this step is used to obtain the MIP prediction value of the current block, which may specifically include:
[0079] S1041: constructing a MIP prediction block of matrix multiplication output samples;
[0080] S1042: performing an embedding operation on the MIP prediction block of the matrix multiplication output sample;
[0081] S1043: performing a transposition operation on the MIP prediction block of the matrix multiplication output sample;
[0082] S1044: Generate a final MIP prediction value.
[0083] Among them, for S1041, in the process of constructing the MIP prediction block, it is necessary to obtain not only the weight matrix, but also the shift offset parameter and the shift quantity parameter; then perform a matrix multiplication operation to obtain the MIP prediction block of the matrix multiplication output sample. For S1044, there are two situations for generating the final MIP prediction value: generating a prediction value that does not require upsampling and generating a prediction value that requires upsampling.
[0084] In this way, after the above four steps S101 to S104, the predicted value of at least one pixel in the current block can be obtained.
[0085] exist Figure 1 In the MIP prediction process shown in FIG. 1 , due to the high complexity of the MIP mode, especially for the acquisition of the shift factor and the offset factor, different matrices have different shift factors and offset factors in the related art, resulting in a large storage space and computational complexity required to obtain the shift factor and the offset factor. Therefore, while the MIP technology improves the encoding and decoding performance, the storage space and computational complexity required in the encoding and decoding process are also greatly increased, reducing the encoding and decoding efficiency.
[0086] In addition, due to the computational complexity and storage cost required by the MIP mode, it is difficult to implement the MIP mode on devices with relatively low computing power or small storage capacity. Therefore, the MIP mode in the related art cannot be promoted and is difficult to implement in codec implementation and dynamic video streaming.
[0087] Based on this, an embodiment of the present application provides an image prediction method, the basic idea of which is: determining prediction parameters of a current block, wherein the prediction parameters include: prediction mode parameters; when the prediction mode parameters indicate that the intra-frame prediction value of the current block is determined using a matrix-based intra-frame prediction MIP mode, determining the MIP input sampling value of the current block according to the adjacent sampling values of the current block; determining the product of the sum of the MIP input sampling values and the shift offset parameter according to the value of the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; determining the product of the sum of the MIP input sampling values and the shift offset parameter according to the shift amount The value of the parameter is used to determine the first constant value, wherein the value of the shift quantity parameter is a fixed constant; the value of the first offset is set to the difference between the first constant value and the product; according to the prediction parameter, the MIP weighting matrix of the current block is determined; according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, the MIP prediction value of the current block is determined, wherein the MIP prediction value is the prediction value of some sampling points in the current block; the MIP prediction value is filtered to obtain the intra-frame prediction value of the current block. In this way, for the MIP mode, since the acquisition process of the shift offset parameter and the shift quantity parameter is simplified, it is possible to reduce the complexity and reduce the storage space required in the coding and decoding process on the basis of ensuring the coding and decoding performance, thereby effectively improving the coding and decoding efficiency.
[0088] See also Figure 2 , which shows an example of a system composition block diagram of an encoder provided in an embodiment of the present application. Figure 2 As shown, the encoder 200 may include: a segmentation unit 201, a prediction unit 202, a first adder 207, a transform unit 208, a quantization unit 209, an inverse quantization unit 210, an inverse transform unit 211, a second adder 212, a filtering unit 213, a decoded picture buffer (Decoded Picture Buffer, DPB) unit 214 and an entropy coding unit 215.
[0089] Among them, the segmentation unit 201 divides the picture in the input video into one or more coding tree units (CTUs). The segmentation unit 201 divides the picture into multiple tiles, and can further divide a tile into one or more bricks, where a tile or a brick may include one or more complete and / or partial CTUs. In addition, the segmentation unit 201 can form one or more slices, where a slice can include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture. The segmentation unit 201 can also form one or more sub-pictures, where a sub-picture can include one or more slices, tiles or bricks.
[0090] In the encoder 200, the segmentation unit 201 transmits the CTU to the prediction unit 202. Generally, the prediction unit 202 may be composed of a block segmentation unit 203, a motion estimation (ME) unit 204, a motion compensation (MC) unit 205, and an intra prediction unit 206. Specifically, the block segmentation unit 203 iteratively uses quadtree segmentation, binary tree segmentation, and ternary tree segmentation to further divide the input CTU into smaller coding units (CodingUnits, CUs). The prediction unit 202 may use the ME unit 204 and the MC unit 205 to obtain the inter-frame prediction block of the CU. The intra-frame prediction unit 206 may use various intra-frame prediction modes including the MIP mode to obtain the intra-frame prediction block of the CU. In the example, the rate-distortion optimized motion estimation method may be called by the ME unit 204 and the MC unit 205 to obtain the inter-frame prediction block, and the rate-distortion optimized mode determination method may be called by the intra-frame prediction unit 206 to obtain the intra-frame prediction block.
[0091] The prediction unit 202 outputs the prediction block of the CU, and the first adder 207 calculates the difference between the CU in the output of the segmentation unit 201 and the prediction block of the CU, that is, the residual CU. The transform unit 208 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 209 quantizes the coefficients and outputs the quantized coefficients (i.e., levels). The dequantization unit 210 performs a scaling operation on the quantized coefficients to output the reconstructed coefficients. The inverse transform unit 211 performs one or more inverse transforms corresponding to the transform in the transform unit 208 and outputs the reconstructed residual. The second adder 212 calculates the reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 202. The second adder 212 also sends its output to the prediction unit 202 for use as an intra-frame prediction reference. After all CUs in the picture or sub-picture are reconstructed, the filtering unit 213 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 213 includes one or more filters, such as a deblocking filter, a sample adaptive offset (Sample Adaptive Offset, SAO) filter, an adaptive loop filter (AdaptiveLoop Filter, ALF), a luminance mapping and chroma scaling (Luma Mapping with Chroma Scaling, LMCS) filter, and a neural network-based filter, etc. Alternatively, when the filtering unit 213 determines that the CU is not used as a reference for encoding other CUs, the filtering unit 213 performs loop filtering on one or more target pixels in the CU.
[0092] The output of the filtering unit 213 is a decoded picture or sub-picture, which is cached to the DPB unit 214. The DPB 214 outputs the decoded picture or sub-picture according to the timing and control information. Here, the picture stored in the DPB 214 can also be used as a reference for the prediction unit 202 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 215 converts the parameters (such as control parameters and supplementary information, etc.) required for decoding the picture from the encoder 200 into a binary form, and writes such a binary form into the code stream according to the grammatical structure of each data unit, that is, the encoder 200 finally outputs the code stream.
[0093] Furthermore, the encoder 200 may be a first memory having a first processor and a computer program. When the first processor reads and runs the computer program, the encoder 200 reads the input video and generates a corresponding bitstream. In addition, the encoder 200 may also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have the same Figure 1 Similar connection and data exchange functions to the corresponding units in the
[0094] See also Figure 3, which shows an example of a system composition block diagram of a decoder provided in an embodiment of the present application. Figure 3 As shown, the decoder 300 may include: a parsing unit 301 , a prediction unit 302 , a scaling unit 305 , a transform unit 306 , an adder 307 , a filtering unit 308 and a decoded picture cache unit 309 .
[0095] The input code stream of the decoder 300 may be the code stream output by the encoder 200. The parsing unit 301 parses the input code stream and obtains the value of the syntax element from the input code stream. The parsing unit 301 converts the binary representation of the syntax element into a digital value and sends the digital value to the unit in the decoder 300 to obtain one or more decoded pictures. The parsing unit 301 may also parse one or more syntax elements from the input code stream to display the decoded picture.
[0096] In the decoder 300 , the parsing unit 301 sends the value of the syntax element and one or more variables set or determined according to the value of the syntax element and used to obtain one or more decoded pictures to the units in the decoder 300 .
[0097] The prediction unit 302 determines a prediction block of a current decoding block (eg, CU). Here, the prediction unit 302 may include a motion compensation unit 303 and an intra prediction unit 304.
[0098] Specifically, when the inter-frame decoding mode is indicated to be used to decode the current decoding block, the prediction unit 302 passes the relevant parameters from the parsing unit 301 to the motion compensation unit 303 to obtain the inter-frame prediction block; when the intra-frame prediction mode (including the MIP mode based on the MIP flag) is indicated to be used to decode the current decoding block, the prediction unit 302 transmits the relevant parameters from the parsing unit 301 to the intra-frame prediction unit 304 to obtain the intra-frame prediction block.
[0099] The scaling unit 305 has the same function as the inverse quantization unit 210 in the encoder 200. The scaling unit 305 performs a scaling operation on the quantization coefficients (ie, levels) from the parsing unit 301 to obtain reconstructed coefficients.
[0100] The transform unit 306 has the same function as the inverse transform unit 211 in the encoder 200. The transform unit 306 performs one or more transform operations (ie, inverse operations of one or more transform operations performed by the inverse transform unit 211 in the encoder 200) to obtain a reconstructed residual.
[0101] The adder 307 performs an addition operation on its input (the prediction block from the prediction unit 302 and the reconstructed residual from the transform unit 306) to obtain a reconstructed block of the current decoded block. The reconstructed block is also sent to the prediction unit 302 to be used as a reference for other blocks encoded in the intra prediction mode.
[0102] After all CUs in the picture or sub-picture are reconstructed, the filtering unit 308 performs loop filtering on the reconstructed picture or sub-picture. The filtering unit 308 includes one or more filters, such as a deblocking filter, a sampling adaptive compensation filter, an adaptive loop filter, a luminance mapping and chrominance scaling filter, and a filter based on a neural network. Alternatively, when the filtering unit 308 determines that the reconstructed block is not used as a reference for decoding other blocks, the filtering unit 308 performs loop filtering on one or more target pixels in the reconstructed block. Here, the output of the filtering unit 308 is a decoded picture or sub-picture, and the decoded picture or sub-picture is cached to the DPB 309. The DPB 309 outputs the decoded picture or sub-picture according to the timing and control information. The picture stored in the DPB 309 can also be used as a reference for performing inter-frame prediction or intra-frame prediction by the prediction unit 302.
[0103] Furthermore, the decoder 300 may be a second memory having a second processor and a computer program. When the first processor reads and runs the computer program, the decoder 300 reads the input bitstream and generates a corresponding decoded video. In addition, the decoder 300 may also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have the same Figure 3 Similar connection and data exchange functions to the corresponding units in the
[0104] It should be understood that the image prediction method provided in the embodiment of the present application mainly acts on the intra-frame prediction unit 206 of the encoder 200 and the intra-frame prediction unit 304 of the decoder 300. That is to say, the image prediction method in the embodiment of the present application can be applied to both the encoder and the decoder, and can even be applied to both the encoder and the decoder at the same time, but without any limitation. Here, if the encoder 200 can obtain a better prediction effect and improve the encoding performance through the image prediction method provided in the embodiment of the present application; then, correspondingly, in the decoder 300, the video decoding recovery quality can also be improved, thereby improving the decoding performance.
[0105] Based on this, the technical solution of the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. Before the detailed description, it should be noted that the "first", "second", "third", etc. mentioned throughout the specification are only for distinguishing different features and do not have the function of limiting priority, sequence, size relationship, etc.
[0106] The embodiment of the present application provides an image prediction method, which is applied to a video encoding device, such as an encoder. The function implemented by the method can be implemented by calling a computer program by a first processor in the encoder, and of course the computer program can be stored in a first memory. It can be seen that the encoder includes at least a first processor and a first memory.
[0107] See also Figure 4 , which shows a schematic diagram of the process of an image prediction method in an embodiment of the present application. Figure 4 As shown, the method may include:
[0108] S401: Determine prediction parameters of a current block, wherein the prediction parameters include: prediction mode parameters.
[0109] It should be noted that the image to be encoded can be divided into multiple image blocks, and each image block to be encoded can be called a coding block. Here, each coding block may include a first image component, a second image component, and a third image component. The current block is a coding block in the video image that is currently to be predicted by the first image component, the second image component, or the third image component.
[0110] Here, it is assumed that the first image component is predicted for the current block, and the first image component is the brightness component. That is, the image component to be predicted is the brightness component, so the current block can also be called a brightness block. Alternatively, it is assumed that the second image component is predicted for the current block, and the second image component is the chrominance component, that is, the image component to be predicted is the chrominance component, so the current block can also be called a chrominance block.
[0111] It should also be noted that the prediction mode parameter is used to indicate the prediction mode used by the current block, and different prediction modes correspond to different prediction mode parameters. Here, for determining the prediction mode parameters, a simple decision strategy can be adopted, such as determining according to the size of the distortion value; or a complex decision strategy can be adopted, such as determining according to the result of rate distortion optimization (RDO), which is not limited in any way in the embodiments of the present application. Generally speaking, the RDO method can be used to determine the prediction mode parameters of the current block.
[0112] Specifically, in some embodiments, for S401, determining the prediction parameter of the current block may include:
[0113] Pre-encoding the current block using multiple prediction modes to obtain rate-distortion cost values corresponding to the multiple prediction modes;
[0114] A minimum rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, and a prediction mode parameter in the prediction mode corresponding to the minimum rate-distortion cost value is determined as a prediction mode parameter of the current block.
[0115] That is to say, on the encoder side, multiple prediction modes can be used for the current block to perform pre-coding processing on the current block respectively. Here, the multiple prediction modes generally include inter-frame prediction mode, traditional intra-frame prediction mode and non-traditional intra-frame prediction mode. Among them, the traditional intra-frame prediction mode may include direct current (DC) mode, plane (PLANAR) mode and angle mode, etc. The non-traditional intra-frame prediction mode may include MIP mode, cross-component linear model prediction (CCLM) mode, intra-frame block copy (IBC) mode and PLT (Palette) mode, etc. The inter-frame prediction mode may include traditional inter-frame prediction mode and inter-frame geometric partitioning prediction (GEO) mode, etc.
[0116] In this way, after pre-coding the current block using multiple prediction modes respectively, rate-distortion cost values corresponding to the multiple prediction modes can be obtained. Then, a minimum rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, and the prediction mode parameters under the prediction mode corresponding to the minimum rate-distortion cost value are determined as the prediction mode parameters of the current block.
[0117] In addition, after pre-encoding the current block using multiple prediction modes respectively, distortion values corresponding to the multiple prediction modes can be obtained. Then, a minimum distortion value is selected from the obtained multiple distortion values, and the prediction mode parameters under the prediction mode corresponding to the minimum distortion value are determined as the prediction mode parameters of the current block. In this way, the current block is finally predictively encoded using the determined prediction mode parameters, and in the prediction mode corresponding to the prediction mode parameters, the prediction residual can be made smaller, which can improve the encoding efficiency.
[0118] S402: When the prediction mode parameter indicates that the intra prediction value of the current block is determined using the matrix-based intra prediction MIP mode, determine the MIP input sample value of the current block according to the adjacent sample values of the current block.
[0119] It should be noted that, for the current block, if the current block uses the MIP mode to determine the intra-frame prediction value of the current block, then at this time it is necessary to determine the MIP input sampling value of the current block based on the adjacent sampling values of the current block.
[0120] It should be understood that for the MIP mode, the MIP core parameters need to be configured first. Here, the MIP core parameters may include the type of the current block (represented by mipSizeId), the number of reference samples for each edge (represented by boundySize), the number of MIP input samples (represented by inSize), and the MIP prediction block size output by matrix multiplication (arranged as predSize×predSize). Among them, the MIP mode can divide the current block into three categories according to the width and height of the current block, and mipSizeId can be equal to 0, 1 or 2. Here, mipSizeId represents the type of the current block, that is, the block size index value of the current block in the embodiment of the present application. For different mipSizeId, the number of reference samples (boundySize reference sampling points are required for each edge), the number of MIP input samples (inSize), and the MIP prediction block size output by matrix multiplication (arranged as predSize×predSize) are also different.
[0121] It should also be noted that, in addition to the prediction mode parameters, the prediction parameters may also include: a size parameter of the current block. Here, according to the size parameter of the current block, the block size index value (ie, mipSizeId) of the current block may be determined.
[0122] In a possible implementation manner, determining the block size index value of the current block according to the size parameter of the current block may include:
[0123] If the width and height of the current block are both equal to 4, then the block size index value of the current block can be set to 0;
[0124] On the contrary, if the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, then the block size index value of the current block may be set to 1;
[0125] On the contrary, if the current block is a block of another size, the block size index value of the current block may be set to 2.
[0126] In another possible implementation, determining the block size index value of the current block according to the size parameter of the current block may include:
[0127] If the width and height of the current block are both equal to 4, then the block size index value of the current block can be set to 0;
[0128] Conversely, if one of the width and height of the current block is equal to 4, the block size index value of the current block may be set to 1;
[0129] On the contrary, if the current block is a block of another size, the block size index value of the current block may be set to 2.
[0130] Thus, according to the block size index value of the current block, the number of adjacent boundary reference samples (variable is boundarySize) and the size of the MIP prediction block (variable is predSize, the size of the MIP prediction block is predSize×predSize) can be determined according to the look-up table (LUT) shown in Table 1, and the number of MIP input sample values (expressed by inSize) used for the MIP matrix multiplication operation process can be calculated. The calculation formula is as follows:
[0131] inSize=(2×boundarySize)-(mipSizeId==2)? 1:0 (1)
[0132] The operation rules of the operators in formula (1) are the same as those of the operators defined in the ITU-T H.265 standard. For example, “==” is a logical “equal to” operator.
[0133] Table 1
[0134] mipSizeId boundarySize predSize 0 2 4 1 4 4 2 4 8
[0135] Thus, according to Table 1, when the value of mipSizeId is 0, the value of boundarySize can be 2, and the value of predSize can be 4. That is, at this time, the reference pixel selects two pixels for each edge, and the matrix multiplication output is a 4×4 MIP prediction block.
[0136] When the value of mipSizeId is 1, the value of boundarySize can be 4, and the value of predSize can be 4. That is to say, at this time, the reference pixel selects four pixels for each edge, and the matrix multiplication output is a 4×4 MIP prediction block.
[0137] When the value of mipSizeId is 2, the value of boundarySize can be 4, and the value of predSize can be 8; that is, at this time, the reference pixel selects four pixels for each edge, and the matrix multiplication output is an 8×8 MIP prediction block.
[0138] In addition, the values of boundarySize, inSize and predSize can be determined according to the block size index value of the current block and the lookup table shown in Table 2.
[0139] Table 2
[0140] mipSizeId boundarySize inSize predSize 0 2 4 4 1 4 8 4 2 4 7 8
[0141] Thus, according to Table 2, when the value of mipSizeId is 0, the value of boundarySize can be 2, the value of inSize can be 4, and the value of predSize can be 4; that is, at this time, the reference pixel selects two pixel points for each edge, the number of matrix multiplication input sampling points is four, and the matrix multiplication output is a 4×4 MIP prediction block.
[0142] When the value of mipSizeId is 1, the value of boundarySize can be 4, the value of inSize can be 8, and the value of predSize can be 4; that is, at this time, the reference pixel selects four pixels for each edge, the number of matrix multiplication input sampling points is eight, and the matrix multiplication output is a 4×4 MIP prediction block.
[0143] When the value of mipSizeId is 2, the value of boundarySize can be 4, the value of inSize can be 7, and the value of predSize can be 8; that is, at this time, the reference pixel selects four pixels for each edge, the number of matrix multiplication input sampling points is seven, and the matrix multiplication output is an 8×8 MIP prediction block.
[0144] Furthermore, after configuring the MIP core parameters, it is also necessary to obtain reference pixels; then, based on the reference pixels and the MIP core parameters, the MIP input sample values are constructed. The reference pixels here are the adjacent sample values of the current block, which may include the left adjacent sample values of the current block and the upper adjacent sample values of the current block. In other words, the MIP input sample values of the current block may be determined based on the left adjacent sample values and the upper adjacent sample values of the current block.
[0145] In some embodiments, determining the MIP input sample value of the current block according to the neighboring sample values of the current block may include:
[0146] Performing down-sampling filtering on adjacent sample values of the current block to obtain a first temporary reference value;
[0147] When the size parameter value of the current block is within a preset range, determining a second constant value according to the bit depth of adjacent sample values of the current block;
[0148] Setting the value corresponding to the index number 0 in the MIP input sample value to be equal to the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value;
[0149] Setting the value corresponding to index number i in the MIP input sample value to be equal to the difference between the value corresponding to index number i in the first temporary reference value and the value corresponding to index number 0 in the first temporary reference value, where i is an integer greater than 0;
[0150] When the size parameter value of the current block is not within a preset range, the value corresponding to the index number j in the MIP input sampling value is set to be equal to the difference between the value corresponding to the index number j+1 in the first temporary reference value and the value corresponding to the index number 0 in the first temporary reference value, where j is an integer greater than or equal to 0.
[0151] It should be noted that after the adjacent sample values of the current block are downsampled and filtered, the first temporary reference value can be obtained. Here, for the first temporary reference value, specifically, after the adjacent sample values of the current block are downsampled and filtered, the filtered adjacent sample values can be cached in a buffer (represented by pTemp). Among them, the value corresponding to the index number 0 in the first temporary reference value refers to pTemp[0], and the value corresponding to the index number i in the first temporary reference value refers to pTemp[i].
[0152] It should also be noted that, according to the block size index value of the current block (represented by mipSizeId), it can be determined whether the size parameter value of the current block is within the preset range. Specifically, when mipSizeId=0 or 1, it indicates that the size parameter value of the current block is within the preset range; when mipSizeId=2, it indicates that the size parameter value of the current block is not within the preset range.
[0153] That is to say, the MIP input sampling value is determined by the buffer (represented by pTemp), the block size index value of the current block (represented by MipSizeId), and the bit depth of the adjacent sampling value of the current block (represented by BitDepth), and the number of input samples contained in the MIP input sampling value is only related to the block size index value of the current block. Finally, the value corresponding to the index number x in the MIP input sampling value can be obtained (represented by p[x]).
[0154] Further, in some embodiments, determining the second constant value according to the bit depth of the adjacent sample values of the current block may include:
[0155] The second constant value is set to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the bit depth of the neighboring sample values of the current block minus 1.
[0156] Alternatively, in some embodiments, determining the second constant value according to the bit depth of the adjacent sample values of the current block may include:
[0157] Perform a binary bit left shift on "1" to obtain the second constant value, wherein the number of bits of the bit left shift is equal to the bit depth of the adjacent sample values of the current block minus 1.
[0158] That is, after obtaining the bit depth BitDepth of the adjacent sample values of the current block, the second constant value can be expressed as 1<<(BitDepth-1) or 2^(BitDepth-1). In this way, when the size parameter value of the current block is within the preset range, the second constant value can be combined to determine the MIP input sample value of the current block.
[0159] It should also be noted that the MIP input sample is a matrix vector used for matrix multiplication. The current related technical solution is determined by the buffer (represented by pTemp), the type of the current block (i.e., the block size index value of the current block, represented by mipSizeId), the bit depth of the adjacent sample values of the current block (represented by BitDepth) and the number of MIP input samples, and finally obtains the value corresponding to the index number x in the MIP input sample value (represented by p[x]).
[0160] Specifically, the construction process of the xth input sample value p[x] is as follows:
[0161] In a possible implementation manner, when the size parameter value of the current block is within a preset range, the construction process may include:
[0162] Calculate the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value to obtain the value corresponding to the index number 0 in the MIP input sample value;
[0163] Subtract the value corresponding to index number i in the first temporary reference value from the value corresponding to index number 0 in the first temporary reference value to obtain the value corresponding to index number i in the MIP input sampling value; wherein i is a positive integer greater than 0 and less than N, and N represents the number of elements contained in the input sampling matrix.
[0164] Further, for calculating the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value, the method may further include:
[0165] The minuend in the calculation of the difference is set to be equal to the value corresponding to the index number 0 in the first temporary reference value;
[0166] The subtrahend in the calculation of the difference is set equal to the second constant value.
[0167] That is, when mipSizeId=0 or 1, when x is equal to 0, the value corresponding to the index number 0 in the MIP input sample value (represented by p[0]) can be obtained by subtracting the second constant value (i.e., 1<<(BitDepth-1)) from the value corresponding to the index number 0 in the first temporary reference value (i.e., pTemp[0]). When x is not equal to 0, the value corresponding to the index number x in the MIP input sample value (represented by p[x]) needs to be obtained by subtracting the value corresponding to the index number 0 in the first temporary reference value (i.e., pTemp[0]) from the value corresponding to the index number x in the first temporary reference value (i.e., pTemp[x]).
[0168] The details are as follows:
[0169]
[0170] Alternatively, the method may further include:
[0171] Setting the minuend in the calculation of the difference to be equal to a second constant value;
[0172] The subtrahend in the calculation of the difference is set equal to the value corresponding to the index number 0 in the first temporary reference value.
[0173] That is to say, when mipSizeId = 0 or 1, p[0] can be obtained by subtracting pTemp[0] from 1<<(BitDepth-1); and when x is not equal to 0, p[x] can be obtained by subtracting pTemp[0] from pTemp[x]. The details are as follows:
[0174]
[0175] In another possible implementation, when the size parameter value of the current block is not within a preset range, the construction process may include:
[0176] Subtract the value corresponding to index number i+1 in the first temporary reference value from the value corresponding to index number 0 in the first temporary reference value to obtain the value corresponding to index number i in the MIP input sampling value; wherein i is a positive integer greater than or equal to 0 and less than N, and N represents the number of elements contained in the input sampling matrix.
[0177] That is to say, when mipSizeId=2, the value corresponding to index number 0 in the first temporary reference value, i.e., pTemp[0], can be ignored, and then the value corresponding to index number x in the MIP input sample value (represented by p[x]) can be obtained by subtracting the value corresponding to index number 0 in the first temporary reference value (i.e., pTemp[0]) from the value corresponding to index number x+1 in the first temporary reference value (i.e., pTemp[x+1]). Here, x is a positive integer greater than or equal to 0. Specifically, as shown below,
[0178] p[x]=pTemp[x+1]-pTemp[0] for x=0,...,inSize-1 (4)
[0179] Thus, still taking the 4×4 current block as an example, four values are stored in the buffer pTemp, namely, the first temporary reference value includes: the value corresponding to the index number 0 (ie, pTemp[0]), the value corresponding to the index number 1 (ie, pTemp[1]), the value corresponding to the index number 2 (ie, pTemp[2]), and the value corresponding to the index number 3 (ie, pTemp[3]); at this time, according to formula (2) or formula (3) or formula (4), four MIP input sample values can be determined, represented by p[x], x = 0, 1, 2, 3. Here, for these four MIP input sample values, they can also be combined into a 1×4 MIP input sample matrix.
[0180] S403: Determine, according to the value of the shift offset parameter, the product of the sum of the MIP input sampling values and the shift offset parameter.
[0181] It should be noted that the shift offset parameter may also be referred to as an offset factor, which may be represented by f0. In the embodiment of the present application, the value of the shift offset parameter may be set to a fixed constant, such as 46, 56, 66, 32, etc. The value of the shift offset parameter may also be set to be related to a shift offset parameter table, and the value of the shift offset parameter may be determined by looking up the table, which is not limited in any way.
[0182] S404: Determine a first constant value according to the value of the shift quantity parameter.
[0183] S405: Setting the value of the first offset to the difference between the first constant value and the product.
[0184] It should be noted that the shift quantity parameter may also be referred to as a shift factor, a number of shift bits, a weight shift value, etc., and may be represented by sW, shift, or weight shift. In the embodiment of the present application, the shift quantity parameter is represented by sW. In addition, the first offset may be represented by oW, and the first offset is related to both the shift quantity parameter and the shift offset parameter.
[0185] In the embodiment of the present application, the value of the shift quantity parameter can be set to a fixed constant, such as 5, 6, or 7. The value of the shift quantity parameter can also be set to be related to the shift quantity parameter table, and the value of the shift quantity parameter is determined by looking up the table, which is not limited here.
[0186] S406: Determine a MIP weighting matrix of the current block according to the prediction parameters.
[0187] It should be noted that the prediction parameters may include prediction mode parameters and may also include size parameters of the current block. In the prediction parameters, when the prediction mode parameters indicate that the intra-frame prediction value of the current block is determined using the MIP mode, a weight matrix table may be pre-established at this time, and the weight matrix table may be stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be set separately. In this way, according to the block size index value (mipSizeId) and the MIP mode index value (modeId) of the current block, the MIP weight matrix (or MIP weight matrix, or MIP matrix for short) required for the current block may be determined by looking up a table, and is represented by mWeight[x][y]. Among them, the block size index value (mipSizeId) of the current block is determined by the size parameter of the current block, and the size of the MIP weight matrix mWeight[x][y] is only related to the block size index value of the current block, as shown in Table 3.
[0188] In the MIP weighting matrix shown in Table 3, the number of columns is the number of matrix multiplication input samples inSize, and the number of rows is the number of matrix multiplication output samples predSized×predSized, so that the MIP weighting matrix of the current block can be determined.
[0189] Table 3
[0190] mipSizeId Number of columns Number of lines 0 4 16 1 8 16 2 7 64
[0191] Furthermore, in the encoder, a shift quantity parameter table may be pre-established, and the shift quantity parameter table is also stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be separately set. In the embodiment of the present application, the determination of the shift quantity parameter (sW) may include the following methods:
[0192] In one possible implementation, for different block sizes and different MIP mode index values, the shift quantity parameter may be different. In some embodiments, the method may further include:
[0193] When the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode, determining the MIP mode index value of the current block;
[0194] According to the MIP mode index value, querying a value corresponding to the MIP mode index value from a first preset lookup table, wherein the first preset lookup table is used to record a correspondence between the MIP mode index value and the value of the shift quantity parameter;
[0195] The queried value is determined as the value of the shift quantity parameter.
[0196] It should be noted that the value of the shift quantity parameter can be queried according to the block size index value (represented by mipSizeId) and the MIP mode index value (modeId) of the current block. As shown in the first preset lookup table in Table 4, for different mipSizeId and modeId, the shift quantity parameter required for matrix multiplication can be determined by a lookup table.
[0197] Table 4
[0198]
[0199] However, on the encoder side, Table 4 needs to be stored in a memory or storage unit in the form of a lookup table; however, storage requires a cost, and the lookup process also requires a cost; since the value of the shift quantity parameter in Table 4 is related to the block size and MIP mode index value of the current block, the memory usage is increased, and the computational complexity is also increased.
[0200] In order to reduce memory usage and computational complexity, the embodiment of the present application may simplify the method for determining the shift quantity parameter.
[0201] In another possible implementation, the value of the shift quantity parameter can be set to a fixed constant, and is a fixed constant that is independent of the block size index value and the MIP mode index value. For example, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 5; or, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 6; or, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 7. In the embodiment of the present application, preferably, the value of the shift quantity parameter is equal to 6, but there is no limitation on this.
[0202] In another possible implementation, for the value of the shift quantity parameter, the method may further include:
[0203] Determining a block size index value of the current block according to a size parameter of the current block;
[0204] The value of the shift quantity parameter is determined according to the block size index value of the current block.
[0205] It should be noted that, according to the size parameter of the current block, a block size index value of the current block can be determined.
[0206] In a possible implementation manner, determining the block size index value of the current block according to the size parameter of the current block may include:
[0207] When the width and height of the current block are both equal to 4, setting the block size index value of the current block to 0;
[0208] When the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, setting the block size index value of the current block to 1;
[0209] When the width and height of the current block do not meet the aforementioned conditions, the block size index value of the current block is set to 2.
[0210] In this way, after the block size index value of the current block is determined, the value of the shift quantity parameter can be further determined according to the block size index value of the current block.
[0211] Optionally, in some embodiments, determining the value of the shift quantity parameter according to the block size index value of the current block may include:
[0212] The value of the shift amount parameter is set to be equal to the ratio between the width or height of the current block and a first preset value of the block size index value corresponding to the current block.
[0213] Here, the first preset value represents the number of MIP input sample values obtained from the boundary of the current block. In this case, the method may also include:
[0214] When the block size index values of the current block are equal to 0, 1, and 2 respectively, it is determined that the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4 respectively.
[0215] That is to say, when the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block, if the block size index value of the current block is equal to 0, then the corresponding first preset value is equal to 2; if the block size index value of the current block is equal to 1, then the corresponding first preset value is equal to 4; if the block size index value of the current block is equal to 2, then the corresponding first preset value is equal to 4, so that the value of the shift quantity parameter can be determined according to the ratio between the width or height of the current block and the corresponding first preset value.
[0216] Optionally, in some embodiments, determining the value of the shift quantity parameter according to the block size index value of the current block may include:
[0217] The value of the shift amount parameter is set to be equal to the ratio between the width or height of the current block and a second preset value of the block size index value corresponding to the current block.
[0218] Here, the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weighting matrix. In this case, the method may further include:
[0219] When the block size index values of the current block are equal to 0, 1, and 2 respectively, it is determined that the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8 respectively.
[0220] That is to say, when the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weighting matrix to calculate, at this time, if the block size index value of the current block is equal to 0, then the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 1, then the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 2, then the corresponding second preset value is equal to 8, so that the value of the shift quantity parameter can be determined according to the ratio between the width or height of the current block and the corresponding second preset value.
[0221] In another possible implementation, the shift quantity parameter table may be minimized, and the shift quantity parameter value may still be determined by using a lookup table. Optionally, in some embodiments, determining the shift quantity parameter value according to the block size index value of the current block may include:
[0222] According to the block size index value, querying a value corresponding to the block size index value from a second preset lookup table, wherein the second preset lookup table is used to record a correspondence between the block size index value and the value of the shift quantity parameter;
[0223] The queried value is determined as the value of the shift quantity parameter.
[0224] It should be noted that the value of the shift quantity parameter can be queried only according to the block size index value (represented by mipSizeId) of the current block. As shown in the second preset lookup table in Table 5, for each block size index value, a fixed value may correspond, that is, the size of each block or the size set of each block may have a fixed shift quantity parameter value as shown in Table 5.
[0225] Table 5
[0226] mipSizeId w 0 5 1 6 2 5
[0227] According to Table 5, when the block size index values of the current block are respectively equal to 0, 1 and 2, it can be determined that the values of the shift quantity parameter corresponding to the block size index values are respectively equal to 5, 6 and 5.
[0228] In the above-mentioned implementation, by simplifying the method for determining the shift quantity parameter, especially minimizing the shift quantity parameter table or fixing the value of the shift quantity parameter, the storage of the lookup table can be minimized, thereby reducing the memory occupied by the shift quantity parameter table storage in the MIP mode without increasing the computational complexity.
[0229] In the encoder, a shift offset parameter table may also be pre-established, and the shift offset parameter table is also stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be separately set. In the embodiment of the present application, the determination of the shift offset parameter (fO) may include the following methods:
[0230] In a possible implementation, for different block sizes and different MIP mode index values, the shift offset parameter may also be different. In some embodiments, the method may further include:
[0231] When the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode, determining the MIP mode index value of the current block;
[0232] According to the MIP mode index value, querying a value corresponding to the MIP mode index value from a third preset lookup table, wherein the third preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift offset parameter;
[0233] The queried value is determined as the value of the shift offset parameter.
[0234] It should be noted that the value of the shift offset parameter can be queried according to the block size index value (represented by MipSizeId) and the MIP mode index value (modeId) of the current block. As shown in the third preset lookup table in Table 6, for different mipSizeId and modeId, the shift offset parameter required for matrix multiplication can be determined by a lookup table.
[0235] Table 6
[0236]
[0237] However, on the encoder side, Table 6 also needs to be stored in a memory or storage unit in the form of a lookup table; however, storage requires a cost, and the lookup process also requires a cost; since the value of the shift offset parameter in Table 6 is related to the block size and MIP mode index value of the current block, the memory usage is increased, and the computational complexity is also increased.
[0238] In order to reduce memory usage and computational complexity, the embodiment of the present application may also simplify the method for determining the shift offset parameter.
[0239] In another possible implementation, the value of the shift offset parameter can be set to a fixed constant, and it is a fixed constant that is independent of the block size index value and the MIP mode index value. Typically, the fixed constant has a value range of 0 to 100. For example, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 32; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 46; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 56; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 66. In the embodiment of the present application, preferably, the value of the shift offset parameter is equal to 32, but there is no limitation on this.
[0240] In another possible implementation, for the value of the shift offset parameter, the method may further include:
[0241] Determining a block size index value of the current block according to a size parameter of the current block;
[0242] The value of the shift offset parameter is determined according to the block size index value of the current block.
[0243] It should be noted that, according to the size parameter of the current block, the block size index value of the current block can be determined; and then according to the block size index value of the current block, the value of the shift offset parameter can be further determined.
[0244] Specifically, the shift offset parameter table can be minimized, and the offset factor can still be determined by using a lookup table. Optionally, in some embodiments, determining the value of the shift offset parameter according to the block size index value of the current block can include:
[0245] According to the block size index value, querying a value corresponding to the block size index value from a fourth preset lookup table, wherein the fourth preset lookup table is used to record a correspondence between the block size index value and the value of the shift offset parameter;
[0246] The queried value is determined as the value of the shift offset parameter.
[0247] It should be noted that the value of the shift offset parameter can be queried only according to the block size index value (represented by mipSizeId) of the current block. As shown in the fourth preset lookup table in Table 7, for each block size index value, a fixed value may correspond, that is, the size of each block or the size set of each block may have a fixed shift offset parameter value as shown in Table 7.
[0248] Table 7
[0249] mipSizeId fO 0 34 1 23 2 46
[0250] According to Table 7, when the block size index values of the current block are respectively equal to 0, 1 and 2, it can be determined that the values of the shift offset parameter corresponding to the block size index values are respectively equal to 34, 23 and 46.
[0251] In the above-mentioned implementation, by simplifying the method of determining the shift offset parameter, especially minimizing the shift offset parameter table or fixing the value of the shift offset parameter, the storage of the lookup table can be minimized, thereby reducing the memory occupied by the shift offset parameter table storage in the MIP mode without increasing the computational complexity.
[0252] Thus, after determining the shift offset parameter (fO) and the shift quantity parameter (sW), for the first constant value, optionally, in some embodiments, determining the first constant value according to the value of the shift quantity parameter may include:
[0253] The first constant value is set to an integer exponent power of 2, wherein the exponent of the power is equal to the value of the shift quantity parameter minus 1.
[0254] Optionally, in some embodiments, determining the first constant value according to the value of the shift quantity parameter may include:
[0255] Perform a binary bit left shift on "1" to obtain the first constant value, wherein the number of bits of the bit left shift is equal to the value of the shift quantity parameter minus 1.
[0256] That is, after obtaining the shift quantity parameter (sW), the first constant value can be expressed as 1<<(sW-1) or 2^(sW-1). At this time, when the shift quantity parameter is set to 6, the first constant value can be obtained to be equal to 32.
[0257] Here, if the first offset is represented by oW, the product of the sum of the MIP input sampling values and the shift offset parameter (fO) can be calculated according to the shift offset parameter, which is Then the value of oW can be set to
[0258]
[0259] In this way, in the MIP mode, the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset can be obtained, so as to subsequently determine the MIP prediction value of the current block.
[0260] S407: Determine a MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset.
[0261] Here, the MIP prediction value is the prediction value of some sampling points in the current block.
[0262] It should be noted that determining the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset may include:
[0263] Calculating a first weighted sum of the MIP weighting matrix and the MIP input sample value;
[0264] Calculating a first sum value of the first weighted sum and the first offset;
[0265] Performing a binary bit right shift on the first sum value to obtain a first right-shifted value, wherein the number of bits of the right shift is equal to the value of the shift quantity parameter;
[0266] The MIP prediction value of the current block is set to be equal to the sum of the first right shift value and the value corresponding to the index number 0 in the first temporary reference value.
[0267] Specifically, in MIP mode, the MIP weight matrix (represented by mWeight), the shift quantity parameter (represented by sW) and the shift offset parameter (represented by fO) can be determined according to the block size index value of the current block (represented by mipSizeId) and the MIP mode index value (represented by modeId); then the MIP input sampling value (represented by p[x]), mWeight, sW and fO are input into the matrix multiplication process to obtain the MIP prediction value output by the matrix multiplication (represented by predMip[x][y]), and the sampling points in predMip[x][y] are arranged into a matrix form according to predSize×predSize. Among them, the calculation formula is as follows,
[0268]
[0269] Wherein, [x][y] represents the position coordinates of the pixel point, x represents the horizontal direction, and y represents the vertical direction; inSize represents the number of input samples, p[i] represents the value corresponding to the index number i in the MIP input sample value; pTemp[0] represents the value corresponding to the index number 0 in the first temporary reference value; ">>" represents the binary right shift operator, and "<<" represents the binary left shift operator; incH, predC, and incW represent parameters for obtaining matrix values from the MIP weighting matrix. Thus, according to the above formula (5), predMip[x][y] can be calculated to obtain the MIP prediction block.
[0270] In some embodiments, if sW is fixed at 6 and fO is fixed at 32, the calculation formula is as follows:
[0271]
[0272] or,
[0273]
[0274] Furthermore, it is also necessary to perform embedding processing on the predicted values of the sampling points in the MIP prediction block to obtain the MIP prediction block of the current block; then determine whether to perform transposition processing on the MIP prediction block; if the judgment result is yes, then it is also necessary to perform transposition processing on the predicted sampling values in the MIP prediction block, and determine the transposed MIP prediction block as the MIP prediction block of the current block; if the judgment result is no, then it is not necessary to perform transposition processing on the predicted sampling values in the MIP prediction block, and the MIP prediction block can be directly determined as the MIP prediction block of the current block to obtain the MIP prediction value of the current block, and the MIP prediction value is the prediction value of some sampling points in the current block.
[0275] S408: Filter the MIP prediction value to obtain an intra-frame prediction value of the current block.
[0276] It should be noted that the filtering process on the MIP prediction value to determine the intra prediction value of the current block may include:
[0277] Determine whether the size of the MIP prediction block is the same as the size of the current block;
[0278] When the size of the MIP prediction block is the same as the size of the current block, setting the intra prediction block of the current block to be equal to the MIP prediction block; wherein the MIP prediction block contains prediction sample values of all pixel positions in the current block;
[0279] When the size of the MIP prediction block is different from the size of the current block, filtering is performed on the MIP prediction block to obtain a filtered prediction block, and the filtered prediction block is set as an intra-frame prediction block of the current block.
[0280] Here, the filtering process may include an up-sampling filtering process or a low-pass filtering process.
[0281] It should be noted that the MIP prediction block is composed of MIP prediction values. After obtaining the MIP prediction block, since the size of the MIP prediction block only includes two types: 4×4 MIP prediction block and 8×8 MIP prediction block; thus, the size of the current block may be the same as or different from the size of the MIP prediction block; that is, the sampling value corresponding to the MIP prediction block may not be able to fill the current block, so that the generation of the final prediction value may require upsampling of the MIP prediction block, that is, by judging whether the size of the MIP prediction block is the same as the size of the current block, to determine whether to upsample the MIP prediction block.
[0282] It should also be noted that when the size of the MIP prediction block is the same as the size of the current block, that is, the width and height of the MIP prediction block are the same as the current block, it indicates that there is no need to upsample the MIP prediction block. At this time, the MIP prediction block can be directly filled into the current block, that is, there are no empty pixels in the filled current block. At this time, the intra-frame prediction value of each pixel in the current block can be directly set to the prediction value of each pixel in the MIP prediction block, as shown below.
[0283] predSamples[x][y]=predMip[x][y] (8)
[0284] Where [x][y] represents the position coordinates of the pixel point, x represents the horizontal direction, and y represents the vertical direction; predSamples[x][y] represents the intra-frame prediction value corresponding to the pixel point at the position coordinates [x][y] in the current block, and predMip[x][y] represents the prediction value corresponding to the pixel point at the position coordinates [x][y] in the MIP prediction block. Thus, according to formula (8), the MIP prediction block predMip[x][y] can be directly used as the intra-frame prediction block predSamples[x][y] of the current block, that is, the intra-frame prediction value of at least one pixel point in the current block.
[0285] It should also be noted that when the size of the MIP prediction block is different from the size of the current block, that is, at least one of the width and height of the MIP prediction block is different from the current block, the MIP prediction block cannot fill the current block, that is, there are spare pixels in the filled current block, indicating that the MIP prediction block needs to be filtered. In other words, if upsampling is required in both the horizontal and vertical directions, the MIP prediction block can be sampled horizontally and then vertically to obtain a first upsampling block, which can be represented by predSamples[x][y]; then the MIP prediction block is sampled vertically and then horizontally to obtain a second upsampling block, which can be represented by predSamplesTemp[x][y]; finally, predSamples[x][y] and predSamplesTemp[x][y] are weighted averaged to obtain the intra-frame prediction block of the current block.
[0286] Exemplarily, if the side length nTbS of the current block (here, S can be replaced by W and H respectively) is equal to the side length predSize of predMip (here, predSize is only related to blocksizeIdx of the current block), then the MIP prediction block can be directly set as the intra-frame prediction block of the current block; otherwise, the MIP prediction block needs to be filtered to obtain the intra-frame prediction block of the current block. Here, taking the 4×4 current block as an example, if the current block is the same size as the MIP prediction block, it is not necessary to filter the MIP prediction block at this time, then the MIP prediction block can be directly set as the intra-frame prediction block of the current block, so that the intra-frame prediction value of at least one pixel in the current block can be obtained.
[0287] The following will be combined Figure 2 The encoder 200 shown specifically illustrates the image prediction method of the embodiment of the present application.
[0288] It should be understood that when the intra-frame prediction unit 206 determines that the MIP mode is used to encode the current block (or referred to as CU), or when the intra-frame prediction unit 206 uses the rate-distortion optimization method to evaluate the MIP mode used to encode the CU, the intra-frame prediction unit 206 will obtain the intra-frame prediction block of the current block; wherein the intra-frame prediction block of the current block includes the intra-frame prediction value of at least one pixel in the current block.
[0289] Specifically, for the intra prediction unit 206, it uses the MIP mode to obtain the intra prediction block, the steps are as follows:
[0290] First, the intra-frame prediction unit 206 obtains one or more reference pixels from the adjacent pixels of the current block, for example, by downsampling the adjacent pixels, or directly extracting from the adjacent pixels.
[0291] Then, the intra prediction unit 206 uses the obtained reference pixel points, the MIP matrix and the shift parameter to determine one or more partial prediction pixel points corresponding to the pixel point position in the current block. Here, the pixel point position can be a preset pixel point position in the current block. For example, the pixel point position has uniform horizontal and vertical coordinate values. The shift parameter includes a shift amount parameter and a shift offset parameter, which can be used for the offset operation in the process of obtaining the partial prediction pixel points.
[0292] Finally, the intra-frame prediction unit 206 obtains the predicted pixel points corresponding to the remaining pixel points except the partial pixel points in the current block. For example, the intra-frame prediction unit 206 can use an interpolation filter to obtain the predicted pixel points corresponding to the remaining pixel points, where the input of the interpolation filter can be the partial pixel points and the adjacent pixel points.
[0293] like Figure 5 As shown, it shows an example of a flow chart of obtaining a prediction block using the MIP mode in an embodiment of the present application. The flow can be implemented on the encoder 200.
[0294] Step 501, the intra-frame prediction unit 206 obtains adjacent pixels of the current block, for example, adjacent pixels are marked as Figure 5 The gray filled squares adjacent to the current block in step 501 are shown. The intra-frame prediction unit 206 obtains one or more reference pixels from the adjacent pixels. Figure 5 In the example of step 501, the intra-frame prediction unit 206 may optionally calculate an average value of two adjacent pixels and use the average value as a reference pixel. Alternatively, the intra-frame prediction unit 206 selects an adjacent pixel as a reference pixel for every other adjacent pixel. Figure 5In the example of step 501, the intra prediction unit 206 selects 4 reference pixels from the 8 upper adjacent pixels of the current block, and selects another 4 reference pixels from the 8 left adjacent pixels of the current block.
[0295] Step 502: The intra-frame prediction unit 206 obtains a portion of predicted pixel points corresponding to one or more pixel point positions in the current block. Figure 5 In the example of step 502, the partially predicted pixels are the pixels marked as gray filled squares in the current block. The input of the prediction module 501 is the reference pixels obtained in step 501, and the prediction module 501 calculates the partially predicted pixels using the MIP weighting matrix and the shift parameters; here, the shift parameters include a shift amount parameter and a shift offset parameter.
[0296] In a possible implementation, the prediction module 501 may set its coordinates to (x, y) and obtain the predicted pixel point represented by predMip[x][y]. Then the calculation formula of predMip[x][y] is as shown in Formula (5) or Formula (6).
[0297] In equation (5) or (6), mWeight[i][j] is the MIP weighting matrix; here, the matrix elements may be predetermined constant values; or, they may be adaptively updated using, for example, a training method, the input of which is one or more coded pictures or blocks or pictures in other bitstreams provided to the encoder 200 by an external device; fO is a shift offset parameter for determining oW; sW is a shift quantity parameter; p[i] is a MIP input sample value calculated using a reference pixel; pTemp[0] represents the value corresponding to the index number 0 in the first temporary reference value; ">>" is a binary right shift operator as defined in VVC; incH, predC, and incW are parameters for obtaining matrix values from the MIP weighting matrix.
[0298] Exemplarily, the prediction module 501 calculates p[i] based on the size parameter of the current block and the bit depth value of the color component of the pixel in the current block. The bit depth value is a parameter that specifies how many binary bits are used to represent the value of the color component. Here, the color component can be one of the RGB components, one of the YUV components, one of the YCbCr components, or one of the XYZ components.
[0299] In a possible implementation, if the size parameter of the current block is within a preset range, the prediction module 501 may calculate p[0] using the following formula:
[0300] p[0]=pTemp[0]-(1<<(BitDepth-1)) (9)
[0301] or,
[0302] p[0]=(1<<(BitDepth-1))-pTemp[0] (10)
[0303] Here, BitDepthY is the bit depth value of the Y component of the pixel point in the current block, and p[i] is calculated as follows; where i is an integer greater than 0.
[0304] p[i]=pTemp[i]-pTemp[0] (11)
[0305] Otherwise, if the size parameter of the current block is not within the preset range, the prediction module 501 may calculate p[i] using the following formula; wherein i is an integer greater than or equal to 0.
[0306] p[i]=pTemp[i+1]-pTemp[0] (12)
[0307] The prediction module 501 may determine the values of sW and fO according to the size of the current block and the MIP mode used for the current block. In one example, the prediction module 501 obtains the values of sW and fO using a lookup table.
[0308] In some embodiments, the prediction module 501 may use the above-mentioned Table 4 to determine sW according to the size parameter and MIP mode of the current block. In Table 4, modeId represents a variable indicating a mode index value when the current block uses the MIP mode, and MipSizeId represents a variable obtained according to the size parameter of the current block. For example, if the size parameter of the current block is equal to 4×4, MipSizeId may be set to 0; if the size parameter of the current block is equal to 4×8, 8×4, or 8×8, MipSizeId may be set to 1; if the size of the current block is greater than 8×8, MipSizeId may be set to 2.
[0309] In some embodiments, the prediction module 501 may also use the above Table 5 to determine sW according to the size parameter of the current block. Here, the example of determining mipSizeId is the same as the above-mentioned example of determining mipSizeId.
[0310] In some embodiments, the prediction module 501 may also directly set sW to a constant value. For example, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 5; or, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 6; or, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 7.
[0311] In some embodiments, the prediction module 501 may determine f0 according to the size parameter of the current block and the MIP mode using the above Table 6. modeId represents a variable indicating a mode index value when the current block uses the MIP mode, and the example of determining MipSizeId is the same as the above-mentioned determination of MipSizeId.
[0312] In some embodiments, the prediction module 501 may also determine f0 according to the size parameter of the current block using the above-mentioned Table 7. Here, the example of determining MipSizeId is the same as the above-mentioned determination of MipSizeId.
[0313] In some embodiments, the prediction module 501 may also directly set f0 to a constant value. For example, for blocks of various size parameters and different MIP modes, the prediction module 501 sets f0 to 46; or, the prediction module 501 sets f0 to 56; or, the prediction module 501 sets f0 to 66.
[0314] Step 503, the intra-frame prediction unit 206 obtains the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points. Figure 5 In the process, the intra-frame prediction unit 206 can use the filtering module 502 to obtain the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points. The input of the filtering module 502 is the pixel points marked as gray filled squares in step 502. The filtering module 502 can use one or more interpolation filters to obtain the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points using the input. For example, the input may include the reference pixel points and the partial predicted pixel points of one or more pixel point positions in the current block; or, the input may include the adjacent pixel points and the partial predicted pixel points of one or more pixel point positions in the current block; or, the input may include the reference pixel points, the adjacent pixel points and the partial predicted pixel points of one or more pixel point positions in the current block.
[0315] So, according to Figure 5 As shown in the flowchart, after step 503, the intra prediction unit 206 may obtain the intra prediction block of the current block (ie, CU), that is, determine the intra prediction value of at least one pixel in the current block.
[0316] This embodiment provides an image prediction method, which is applied to an encoder. By determining prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters; when the prediction mode parameters indicate that the intra-frame prediction value of the current block is determined using a matrix-based intra-frame prediction MIP mode, determining the MIP input sample value of the current block according to the adjacent sample values of the current block; determining the product of the sum of the MIP input sample values and the shift offset parameter according to the value of a shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; determining a first constant value according to the value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; setting the value of the first offset to the difference between the first constant value and the product; determining the MIP weighting matrix of the current block according to the prediction parameters; determining the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; filtering the MIP prediction value to obtain the intra-frame prediction value of the current block. In this way, since the process of obtaining the shift offset parameter and the shift quantity parameter is simplified, it is possible to reduce the complexity and the storage space required in the coding and decoding process while ensuring the coding and decoding performance, thereby effectively improving the coding and decoding efficiency.
[0317] The embodiment of the present application also provides an image prediction method, which is applied to a video decoding device, such as a decoder. The function implemented by the method can be implemented by calling a computer program by a second processor in the decoder, and of course the computer program can be stored in a second memory. It can be seen that the decoder includes at least a second processor and a second memory.
[0318] See also Figure 6 , which shows a flow chart of another image prediction method according to an embodiment of the present application. Figure 6 As shown, the method may include:
[0319] S601: Parse the bitstream to obtain prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters.
[0320] It should be noted that the image to be decoded can be divided into multiple image blocks, and each image block to be decoded can be called a decoding block. Here, each decoding block may include a first image component, a second image component, and a third image component; and the current block is a decoding block in the video image that is currently to be predicted for the first image component, the second image component, or the third image component.
[0321] It should also be noted that the prediction mode parameters are used to indicate the prediction mode used by the current block, and different prediction modes correspond to different prediction mode parameters. Among them, the prediction modes usually include inter-frame prediction mode, traditional intra-frame prediction mode and non-traditional intra-frame prediction mode, and non-traditional intra-frame prediction mode includes MIP mode, CCLM mode, IBC mode and PLT mode. In other words, the encoder will select the optimal prediction mode to pre-encode the current block. In this process, the prediction mode of the current block can be determined, so as to obtain the corresponding prediction mode parameters, and then the prediction parameters including the prediction mode parameters under the prediction mode are written into the bitstream and transmitted from the encoder to the decoder.
[0322] In this way, at the decoder side, the prediction parameters of the current block can be obtained by parsing the bitstream, and the prediction mode parameters included in the prediction parameters obtained through parsing can be used to determine whether the current block uses the MIP mode.
[0323] S602: When the prediction mode parameter indicates that the intra prediction value of the current block is determined using the matrix-based intra prediction MIP mode, determine the MIP input sample value of the current block according to the adjacent sample values of the current block.
[0324] It should be noted that, for the current block, if the current block uses the MIP mode to determine the intra-frame prediction value of the current block, then it is necessary to determine the MIP input sampling value of the current block based on the adjacent sampling values of the current block. Among them, the adjacent sampling values of the current block may include the left adjacent sampling value of the current block and the upper adjacent sampling value of the current block. In other words, the MIP input sampling value of the current block can be determined based on the left adjacent sampling value and the upper adjacent sampling value of the current block.
[0325] In some embodiments, determining the MIP input sample value of the current block according to the adjacent sample values of the current block may include:
[0326] Performing down-sampling filtering on adjacent sample values of the current block to obtain a first temporary reference value;
[0327] When the size parameter value of the current block is within a preset range, determine a second constant value according to the bit depth of the adjacent sample values of the current block; set the value corresponding to the index number 0 in the MIP input sample value to be equal to the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value; set the value corresponding to the index number i in the MIP input sample value to be equal to the difference between the value corresponding to the index number i in the first temporary reference value and the value corresponding to the index number equal to 0 in the first temporary reference value, where i is an integer greater than 0;
[0328] When the size parameter value of the current block is not within a preset range, the value corresponding to the index number j in the MIP input sampling value is set to be equal to the difference between the value corresponding to the index number j+1 in the first temporary reference value and the value corresponding to the index number 0 in the first temporary reference value, where j is an integer greater than or equal to 0.
[0329] It should be noted that after the adjacent sample values of the current block are downsampled and filtered, the first temporary reference value can be obtained. Here, for the first temporary reference value, specifically, after the adjacent sample values of the current block are downsampled and filtered, the filtered adjacent sample values can be cached in a buffer (represented by pTemp). Among them, the value corresponding to the index number 0 in the first temporary reference value refers to pTemp[0], and the value corresponding to the index number i in the first temporary reference value refers to pTemp[i].
[0330] It should also be noted that, in addition to the prediction mode parameters, the prediction parameters may also include: a size parameter of the current block. Here, according to the size parameter of the current block, the block size index value (ie, mipSizeId) of the current block may be determined.
[0331] In this way, according to the block size index value of the current block (represented by MipSizeId), it can be determined whether the size parameter value of the current block is within the preset range. Specifically, when mipSizeId=0 or 1, it indicates that the size parameter value of the current block is within the preset range; when mipSizeId=2, it indicates that the size parameter value of the current block is not within the preset range.
[0332] Further, in some embodiments, determining the second constant value according to the bit depth of the adjacent sample values of the current block may include:
[0333] The second constant value is set to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the bit depth of the neighboring sample values of the current block minus 1.
[0334] Alternatively, in some embodiments, determining the second constant value according to the bit depth of the adjacent sample values of the current block may include:
[0335] Perform a binary bit left shift on "1" to obtain the second constant value, wherein the number of bits of the bit left shift is equal to the bit depth of the adjacent sample values of the current block minus 1.
[0336] That is, after obtaining the bit depth BitDepth of the adjacent sample values of the current block, the second constant value can be expressed as 1<<(BitDepth-1) or 2^(BitDepth-1). In this way, when the size parameter value of the current block is within the preset range, the second constant value can be combined to determine the MIP input sample value of the current block.
[0337] It should also be noted that the MIP input sample is a matrix vector used for matrix multiplication. The current related technical solution is determined by the buffer (represented by pTemp), the current block type (i.e., the block size index value of the current block, represented by mipSizeId), the bit depth of the adjacent sample values of the current block (represented by BitDepth) and the number of MIP input samples, and finally obtains the value corresponding to the index number x in the MIP input sample value (represented by p[x]).
[0338] In a possible implementation, when the size parameter value of the current block is within a preset range, that is, mipSizeId=0 or 1, when x is equal to 0, the value corresponding to the index number 0 in the MIP input sample value (represented by p[0]) can be obtained by subtracting the second constant value (i.e., 1<<(BitDepth-1)) from the value corresponding to the index number 0 in the first temporary reference value (i.e., pTemp[0]); then when x is not equal to 0, the value corresponding to the index number x in the MIP input sample value (represented by p[x]) needs to be obtained by subtracting the value corresponding to the index number x in the first temporary reference value (i.e., pTemp[x]) from the value corresponding to the index number 0 in the first temporary reference value (i.e., pTemp[0]). Specifically, as shown in the above formula (2).
[0339] In another possible implementation, the value corresponding to the index number 0 in the first temporary reference value, i.e., pTemp[0], can be ignored, and then the value corresponding to the index number x in the MIP input sample value (represented by p[x]) can be obtained by subtracting the value corresponding to the index number 0 in the first temporary reference value (i.e., pTemp[0]) from the value corresponding to the index number x+1 in the first temporary reference value (i.e., pTemp[x+1]). Here, x is a positive integer greater than or equal to 0. Specifically, as shown in the above formula (4).
[0340] In this way, still taking the 4×4 current block as an example, assume that four values are stored in the buffer pTemp, that is, the first temporary reference value includes: the value corresponding to the index number 0 (i.e., pTemp[0]), the value corresponding to the index number 1 (i.e., pTemp[1]), the value corresponding to the index number 2 (i.e., pTemp[2]) and the value corresponding to the index number 3 (i.e., pTemp[3]); at this time, according to formula (2) or formula (3) or formula (4), four MIP input sampling values can be determined, represented by p[x], x=0,1,2,3.
[0341] S603: Determine, according to the value of the shift offset parameter, the product of the sum of the MIP input sampling values and the shift offset parameter.
[0342] It should be noted that the shift offset parameter may also be referred to as an offset factor, which may be represented by f0. In the embodiment of the present application, the value of the shift offset parameter may be set to a fixed constant, such as 46, 56, 66, 32, etc.; the value of the shift offset parameter may also be set to be related to a shift offset parameter table, and the value of the shift offset parameter may be determined by looking up the table, and no limitation is made here.
[0343] S604: Determine a first constant value according to the value of the shift quantity parameter.
[0344] S605: Setting the value of the first offset to the difference between the first constant value and the product.
[0345] It should be noted that the shift quantity parameter can also be called a shift factor, a number of shift bits, a weight shift value, etc., and can be represented by sW, shift, or weight shift. In the embodiment of the present application, the shift quantity parameter is usually represented by sW. In addition, the first offset can be represented by oW, and the first offset is related to both the shift quantity parameter and the shift offset parameter.
[0346] In an embodiment of the present application, the value of the shift quantity parameter can be set to a fixed constant, such as 5, 6, 7, etc.; the value of the shift quantity parameter can also be set to be related to a shift quantity parameter table, and the value of the shift quantity parameter can be determined by looking up the table. No limitation is made here.
[0347] S606: Determine a MIP weighting matrix of the current block according to the prediction parameters.
[0348] It should be noted that the prediction parameters may include prediction mode parameters and may also include size parameters of the current block. In the prediction parameters, when the prediction mode parameters indicate the use of the MIP mode to determine the intra-frame prediction value of the current block, a weight matrix table may be pre-established at this time, and the weight matrix table may be stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be set separately. In this way, according to the block size index value (mipSizeId) and the MIP mode index value (modeId) of the current block, the MIP weighting matrix required for the current block may be determined by table lookup, represented by mWeight[x][y].
[0349] It should also be noted that in the decoder, a shift quantity parameter table may be pre-established, and the shift quantity parameter table is also stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be separately set. In the embodiment of the present application, the determination of the shift quantity parameter (sW) may include the following methods:
[0350] In one possible implementation, for different block sizes and different MIP mode index values, the shift quantity parameter may be different. In some embodiments, the method may further include:
[0351] When the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode, determining the MIP mode index value of the current block;
[0352] According to the MIP mode index value, querying a value corresponding to the MIP mode index value from a first preset lookup table, wherein the first preset lookup table is used to record a correspondence between the MIP mode index value and the value of the shift quantity parameter;
[0353] The queried value is determined as the value of the shift quantity parameter.
[0354] It should be noted that the value of the shift quantity parameter can be queried according to the block size index value (represented by mipSizeId) and the MIP mode index value (modeId) of the current block. As shown in the first preset lookup table in Table 4 above, for different mipSizeId and modeId, the shift quantity parameter required for matrix multiplication can be determined by a lookup table.
[0355] However, on the decoder side, Table 4 needs to be stored in a memory or storage unit in the form of a lookup table; however, storage requires a cost, and the lookup process also requires a cost; since the shift factor in Table 4 is related to the block size and MIP mode index value of the current block, the memory usage is increased, and the computational complexity is also increased.
[0356] In order to reduce memory usage and computational complexity, the embodiment of the present application simplifies the method for determining the shift factor.
[0357] In another possible implementation, the value of the shift quantity parameter can be set to a fixed constant, and is a fixed constant that is independent of the block size index value and the MIP mode index value. For example, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 5; or, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 6; or, for different block size index values and different MIP mode index values, the value of the shift quantity parameter can be set to 7. In the embodiment of the present application, preferably, the value of the shift quantity parameter is equal to 6, but there is no limitation on this.
[0358] In another possible implementation, for the value of the shift quantity parameter, the method may further include:
[0359] Determining a block size index value of the current block according to a size parameter of the current block;
[0360] The value of the shift quantity parameter is determined according to the block size index value of the current block.
[0361] It should be noted that, according to the size parameter of the current block, the block size index value of the current block may be determined. In a possible implementation manner, according to the size parameter of the current block, determining the block size index value of the current block may include:
[0362] When the width and height of the current block are both equal to 4, setting the block size index value of the current block to 0;
[0363] When the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, setting the block size index value of the current block to 1;
[0364] When the width and height of the current block do not meet the aforementioned conditions, the block size index value of the current block is set to 2.
[0365] In this way, after the block size index value of the current block is determined, the value of the shift quantity parameter can be further determined according to the block size index value of the current block.
[0366] Optionally, in some embodiments, determining the value of the shift quantity parameter according to the block size index value of the current block may include:
[0367] The value of the shift amount parameter is set to be equal to the ratio between the width or height of the current block and a first preset value of the block size index value corresponding to the current block.
[0368] Here, the first preset value represents the number of MIP input sample values obtained from the boundary of the current block. In this case, the method may also include:
[0369] When the block size index values of the current block are equal to 0, 1, and 2 respectively, it is determined that the first preset values corresponding to the block size index values of the current block are equal to 2, 4, and 4 respectively.
[0370] That is to say, when the first preset value represents the number of MIP input sampling values obtained from the boundary of the current block, if the block size index value of the current block is equal to 0, then the corresponding first preset value is equal to 2; if the block size index value of the current block is equal to 1, then the corresponding first preset value is equal to 4; if the block size index value of the current block is equal to 2, then the corresponding first preset value is equal to 4, so that the value of the shift quantity parameter can be determined according to the ratio between the width or height of the current block and the corresponding first preset value.
[0371] Optionally, in some embodiments, determining the value of the shift quantity parameter according to the block size index value of the current block may include:
[0372] The value of the shift amount parameter is set to be equal to the ratio between the width or height of the current block and a second preset value of the block size index value corresponding to the current block.
[0373] Here, the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weighting matrix. In this case, the method may further include:
[0374] When the block size index values of the current block are equal to 0, 1, and 2 respectively, it is determined that the second preset values corresponding to the block size index values of the current block are equal to 4, 4, and 8 respectively.
[0375] That is to say, when the second preset value represents the size of the MIP prediction block of the current block obtained by directly using the MIP weighting matrix to calculate, at this time, if the block size index value of the current block is equal to 0, then the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 1, then the corresponding second preset value is equal to 4; if the block size index value of the current block is equal to 2, then the corresponding second preset value is equal to 8, so that the value of the shift quantity parameter can be determined according to the ratio between the width or height of the current block and the corresponding second preset value.
[0376] In another possible implementation, the shift quantity parameter table may be minimized, and the shift quantity parameter value may still be determined by using a lookup table. Optionally, in some embodiments, determining the shift quantity parameter value according to the block size index value of the current block may include:
[0377] According to the block size index value, querying a value corresponding to the block size index value from a second preset lookup table, wherein the second preset lookup table is used to record a correspondence between the block size index value and the value of the shift quantity parameter;
[0378] The queried value is determined as the value of the shift quantity parameter.
[0379] It should be noted that the value of the shift quantity parameter can be queried only according to the block size index value (represented by mipSizeId) of the current block. As shown in the second preset lookup table in Table 5 above, for each block size index value, a fixed value may correspond, that is, the size of each block or the size set of each block may have a fixed shift quantity parameter value as shown in Table 5.
[0380] According to the above Table 5, when the block size index values of the current block are respectively equal to 0, 1 and 2, it can be determined that the values of the shift quantity parameter corresponding to the block size index values are respectively equal to 5, 6 and 5.
[0381] In this way, by simplifying the method of determining the shift quantity parameter, especially minimizing the shift quantity parameter table or fixing the value of the shift quantity parameter, the storage of the lookup table can be minimized, thereby reducing the memory occupied by the shift factor table storage in the MIP mode without increasing the calculation complexity.
[0382] Furthermore, in the decoder, a shift offset parameter table may be pre-established, and the shift offset parameter table is also stored in a memory or a storage unit, where the memory or storage unit may be integrated in the encoder, or may be separately set. In the embodiment of the present application, the determination of the shift offset parameter (fO) may include the following methods:
[0383] In a possible implementation, for different block sizes and different MIP mode index values, the shift offset parameter may also be different. In some embodiments, the method may further include:
[0384] When the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode, determining the MIP mode index value of the current block;
[0385] According to the MIP mode index value, querying a value corresponding to the MIP mode index value from a third preset lookup table, wherein the third preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift offset parameter;
[0386] The queried value is determined as the value of the shift offset parameter.
[0387] It should be noted that the value of the shift offset parameter can be queried according to the block size index value (represented by mipSizeId) and the MIP mode index value (modeId) of the current block. As shown in the third preset lookup table in Table 6 above, for different mipSizeId and modeId, the shift offset parameter required for matrix multiplication can be determined by a lookup table.
[0388] However, on the decoder side, Table 6 also needs to be stored in a memory or storage unit in the form of a lookup table; however, storage requires a cost, and the lookup process also requires a cost; since the value of the shift offset parameter in Table 6 is related to the block size and MIP mode index value of the current block, the memory usage is increased, and the computational complexity is also increased.
[0389] In order to reduce memory usage and computational complexity, the method for determining the shift offset parameter is also simplified in the embodiment of the present application.
[0390] In another possible implementation, the value of the shift offset parameter can be set to a fixed constant, and it is a fixed constant that is independent of the block size index value and the MIP mode index value. Typically, the fixed constant has a value range of 0 to 100. For example, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 32; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 46; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 56; or, for different block size index values and different MIP mode index values, the value of the shift offset parameter can be set to 66. In the embodiment of the present application, preferably, the value of the shift offset parameter is equal to 32, but there is no limitation on this.
[0391] In another possible implementation, for the value of the shift offset parameter, the method may further include:
[0392] Determining a block size index value of the current block according to a size parameter of the current block;
[0393] The value of the shift offset parameter is determined according to the block size index value of the current block.
[0394] It should be noted that, according to the size parameter of the current block, the block size index value of the current block can be determined; and then according to the block size index value of the current block, the value of the shift offset parameter can be further determined.
[0395] Specifically, the shift offset parameter table can be minimized, and the offset factor can still be determined by using a lookup table. Optionally, in some embodiments, determining the value of the shift offset parameter according to the block size index value of the current block can include:
[0396] According to the block size index value, querying a value corresponding to the block size index value from a fourth preset lookup table, wherein the fourth preset lookup table is used to record a correspondence between the block size index value and the value of the shift offset parameter;
[0397] The queried value is determined as the value of the shift offset parameter.
[0398] It should be noted that the value of the shift offset parameter can be queried only according to the block size index value (represented by mipSizeId) of the current block. As shown in the fourth preset lookup table in Table 7 above, for each block size index value, a fixed value may correspond, that is, the size of each block or the size set of each block may have a fixed shift offset parameter value as shown in Table 7.
[0399] According to the above Table 7, when the block size index values of the current block are respectively equal to 0, 1 and 2, it can be determined that the values of the shift offset parameters corresponding to the block size index values are respectively equal to 34, 23 and 46.
[0400] In this way, by simplifying the method of determining the shift offset parameter, especially minimizing the shift offset parameter table or fixing the value of the shift offset parameter, the storage of the lookup table can be minimized, thereby reducing the memory occupied by the shift offset parameter table storage in the MIP mode without increasing the computational complexity.
[0401] Thus, after determining the shift offset parameter (fO) and the shift quantity parameter (sW), for the first constant value, optionally, in some embodiments, determining the first constant value according to the value of the shift quantity parameter may include:
[0402] The first constant value is set to an integer exponent power of 2, wherein the exponent of the power is equal to the value of the shift quantity parameter minus 1.
[0403] Optionally, in some embodiments, determining the first constant value according to the value of the shift quantity parameter may include:
[0404] Perform a binary bit left shift on "1" to obtain the first constant value, wherein the number of bits of the bit left shift is equal to the value of the shift quantity parameter minus 1.
[0405] That is, after obtaining the shift quantity parameter (sW), the first constant value can be expressed as 1<<(sW-1) or 2^(sW-1). At this time, when the shift quantity parameter is set to 6, the first constant value can be obtained to be equal to 32.
[0406] Here, if the first offset is represented by oW, the product of the sum of the MIP input sampling values and the shift offset parameter (fO) can be calculated according to the shift offset parameter, which is Then the value of oW can be set to
[0407]
[0408] In this way, in the MIP mode, the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset can be obtained, so as to subsequently determine the MIP prediction value of the current block.
[0409] S607: Determine a MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset.
[0410] Here, the MIP prediction value is a prediction value of some sampling points in the current block.
[0411] It should be noted that determining the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset may include:
[0412] Calculating a first weighted sum of the MIP weighting matrix and the MIP input sample value;
[0413] Calculating a first sum value of the first weighted sum and the first offset;
[0414] Performing a binary bit right shift on the first sum value to obtain a first right-shifted value, wherein the number of bits of the right shift is equal to the value of the shift quantity parameter;
[0415] The MIP prediction value of the current block is set to be equal to the sum of the first right shift value and the value corresponding to the index number 0 in the first temporary reference value.
[0416] Specifically, in MIP mode, the MIP weight matrix (represented by mWeight), the shift quantity parameter (represented by sW) and the shift offset parameter (represented by fO) can be determined according to the block size index value of the current block (represented by mipSizeId) and the MIP mode index value (represented by modeId); then the MIP input sample value (represented by p[x]), mWeight, sW and fO are input into the matrix multiplication process to obtain the MIP prediction value output by the matrix multiplication (represented by predMip[x][y]), and the sample points in predMip[x][y] are arranged into a matrix form according to predSize×predSize. The calculation formula is shown in the above formula (5) or formula (6).
[0417] S608: Filter the MIP prediction value to obtain an intra-frame prediction value of the current block.
[0418] It should be noted that the MIP prediction block is composed of MIP prediction values. After the MIP prediction block is obtained, it is possible to determine whether the size of the MIP prediction block is the same as the size of the current block in order to further determine the intra-frame prediction value of the current block. Specifically, according to the judgment result, when the size of the MIP prediction block is the same as the size of the current block, the intra-frame prediction block of the current block is set to be equal to the MIP prediction block; at this time, the MIP prediction block contains the predicted sampling values of all pixel positions in the current block; when the size of the MIP prediction block is not the same as the size of the current block, the MIP prediction block is filtered to obtain a filtered prediction block, and the filtered prediction block is set as the intra-frame prediction block of the current block. Here, the filtering process may include upsampling filtering or low-pass filtering.
[0419] The following will be combined Figure 3 The decoder 300 shown specifically illustrates the image prediction method of the embodiment of the present application.
[0420] It should be understood that when the MIP mode is indicated for decoding the current block, the intra prediction unit 304 will obtain the intra prediction block of the current block; wherein the intra prediction block of the current block includes the intra prediction value of at least one pixel in the current block.
[0421] Specifically, for the intra prediction unit 304, it uses the MIP mode to obtain the intra prediction block, the steps are as follows:
[0422] First, the intra-frame prediction unit 304 obtains one or more reference pixels from the adjacent pixels of the current block, for example, by downsampling the adjacent pixels, or directly extracting from the adjacent pixels.
[0423] Then, the intra prediction unit 304 uses the obtained reference pixel points, the MIP matrix and the shift parameter to determine one or more partial prediction pixel points corresponding to the pixel point position in the current block. Here, the pixel point position can be a preset pixel point position in the current block. For example, the pixel point position has uniform horizontal and vertical coordinate values. The shift parameter includes a shift amount parameter and a shift offset parameter, which can be used for the offset operation in the process of obtaining the partial prediction pixel points.
[0424] Finally, the intra-frame prediction unit 304 obtains the predicted pixel points corresponding to the remaining pixel points except for the partial pixel points in the current block. For example, the intra-frame prediction unit 304 can use an interpolation filter to obtain the predicted pixel points corresponding to the remaining pixel points, where the input of the interpolation filter can be the partial pixel points and the adjacent pixel points.
[0425] See also Figure 2 , which shows an example of a flow chart for obtaining a prediction block using the MIP mode, which can also be implemented on the decoder 300.
[0426] Step 501, the intra-frame prediction unit 304 obtains adjacent pixels of the current block, for example, adjacent pixels are marked as Figure 5 The gray filled squares adjacent to the current block in step 501 are shown. The intra-frame prediction unit 304 obtains one or more reference pixels from the adjacent pixels. Figure 5 In the example of step 501, the intra-frame prediction unit 304 may optionally calculate an average value of two adjacent pixels and use the average value as a reference pixel. Alternatively, the intra-frame prediction unit 304 selects an adjacent pixel as a reference pixel for every other adjacent pixel. Figure 5 In the example shown in step 501, the intra prediction unit 304 selects 4 reference pixels from the 8 upper adjacent pixels of the current block, and selects another 4 reference pixels from the 8 left adjacent pixels of the current block.
[0427] Step 502: The intra-frame prediction unit 304 obtains a portion of predicted pixel points corresponding to one or more pixel point positions in the current block. Figure 5 In the example of step 502, the partially predicted pixels are the pixels marked as gray filled squares in the current block. The input of the prediction module 501 is the reference pixels obtained in step 501. The prediction module 501 calculates the partially predicted pixels using the MIP weighting matrix and the shift parameters; here, the shift parameters include a shift amount parameter and a shift offset parameter.
[0428] In a possible implementation, the prediction module 501 may represent a pixel point with coordinates (x, y), and the predicted pixel point is represented by predMip[x][y]. Then, the calculation formula of predMip[x][y] is as shown in Formula (5) or Formula (6).
[0429] In equation (5) or (6), mWeight[i][j] is the MIP weighting matrix; here, the matrix elements may be predetermined constant values; or, they may be adaptively updated using, for example, a training method, the input of which is one or more coded pictures or blocks or pictures in other bitstreams provided to the encoder 200 by an external device; mWeight[i][j] may be determined according to the MIP mode indicated by the corresponding one or more parameters from the parsing unit 301; fO is a shift offset parameter for determining oW; sW is a shift quantity parameter; p[i] is calculated using reference pixels, i.e., the MIP input sample value in the embodiment of the present application; pTemp[0] represents the first pixel in the reference pixel, i.e., the value corresponding to the index number 0 in the first temporary reference value in the embodiment of the present application; ">>" is a binary right shift operator as defined in VVC; incH, predC, and incW are parameters for obtaining matrix values from the MIP weighting matrix.
[0430] Exemplarily, the prediction module 501 calculates p[i] based on the size parameter of the current block and the bit depth value of the color component of the pixel in the current block. The bit depth value is a parameter that specifies how many binary bits are used to represent the value of the color component, which can be indicated by one or more corresponding parameters from the parsing unit 301. Here, the color component can be one of the RGB components, one of the YUV components, one of the YCbCr components, or one of the XYZ components.
[0431] In a possible implementation, if the size parameter of the current block indicated by one or more corresponding parameters in the parameters from the parsing unit 301 is within a preset range, the prediction module 501 may calculate p[0] using the above formula (9) or formula (10);
[0432] Here, BitDepthY is the bit depth value of the Y component of the pixel in the current block; and p[i] is calculated using the above formula (11); where i is an integer greater than 0.
[0433] Otherwise, if the size of the current block is not within the preset range, the prediction module 501 can use the above formula (12) to calculate p[i]; where i is an integer greater than or equal to 0.
[0434] The prediction module 501 may determine the values of sW and fO according to the size of the current block and the MIP mode used for the current block. In one example, the prediction module 501 obtains the values of sW and fO using a lookup table.
[0435] In some embodiments, the prediction module 501 may use the above-mentioned Table 4 to determine sW according to the size parameter and MIP mode of the current block. In Table 4, modeId represents a variable indicating a mode index value when the current block uses the MIP mode, and MipSizeId represents a variable obtained according to the size parameter of the current block. For example, if the size parameter of the current block is equal to 4×4, MipSizeId may be set to 0; if the size parameter of the current block is equal to 4×8, 8×4, or 8×8, MipSizeId may be set to 1; if the size of the current block is greater than 8×8, MipSizeId may be set to 2.
[0436] In some embodiments, the prediction module 501 may also use the above Table 5 to determine sW according to the size parameter of the current block. Here, the example of determining MipSizeId is the same as the above-mentioned example of determining MipSizeId.
[0437] In some embodiments, the prediction module 501 may also directly set sW to a constant value. For example, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 5; or, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 6; or, for blocks of various size parameters and different MIP modes, the prediction module 501 may set sW to 7.
[0438] In some embodiments, the prediction module 501 may determine f0 according to the size parameter of the current block and the MIP mode using the above Table 6. modeId represents a variable indicating a mode index value when the current block uses the MIP mode, and the example of determining MipSizeId is the same as the above-mentioned determination of MipSizeId.
[0439] In some embodiments, the prediction module 501 may also determine f0 according to the size parameter of the current block using the above-mentioned Table 7. Here, the example of determining MipSizeId is the same as the above-mentioned determination of MipSizeId.
[0440] In some embodiments, the prediction module 501 may also directly set f0 to a constant value. For example, for blocks of various size parameters and different MIP modes, the prediction module 501 sets f0 to 46; or, the prediction module 501 sets f0 to 56; or, the prediction module 501 sets f0 to 66.
[0441] Step 503, the intra-frame prediction unit 304 obtains the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points. Figure 5 In the process, the intra-frame prediction unit 304 may use the filtering module 502 to obtain the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points. The input of the filtering module 502 is the pixel points marked as gray filled squares in step 502. The filtering module 502 may use one or more interpolation filters to obtain the predicted pixel points corresponding to the remaining pixel points in the current block except for some pixel points using the input. For example, the input may include the reference pixel points and the partial predicted pixel points of one or more pixel point positions in the current block; or, the input may include the adjacent pixel points and the partial predicted pixel points of one or more pixel point positions in the current block; or, the input may include the reference pixel points, the adjacent pixel points and the partial predicted pixel points of one or more pixel point positions in the current block.
[0442] So, according to Figure 5 As shown in the flowchart, after step 503, the intra prediction unit 304 may obtain the intra prediction block of the current block (ie, CU), that is, determine the intra prediction value of at least one pixel in the current block.
[0443] This embodiment provides an image prediction method, which is applied to a decoder. The prediction parameters of the current block are obtained by parsing the bitstream, wherein the prediction parameters include: a prediction mode parameter; when the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined by using the matrix-based intra-frame prediction MIP mode, the MIP input sample value of the current block is determined according to the adjacent sample values of the current block; according to the value of the shift offset parameter, the product of the sum of the MIP input sample values and the shift offset parameter is determined, wherein the value of the shift offset parameter is a fixed constant; according to the value of the shift amount parameter, a first constant value is determined, wherein the value of the shift amount parameter is a fixed constant; the value of the first offset is set to the difference between the first constant value and the product; according to the prediction parameters, the MIP weighting matrix of the current block is determined; according to the MIP weighting matrix, the MIP input sample value, the shift amount parameter and the first offset, the MIP prediction value of the current block is determined, wherein the MIP prediction value is the prediction value of some sampling points in the current block; the MIP prediction value is filtered to obtain the intra-frame prediction value of the current block. In this way, after obtaining the prediction parameters of the current block, if it is determined that the current block uses the MIP mode, the process of obtaining the shift offset parameters and the shift quantity parameters is simplified, thereby reducing the complexity and the storage space required in the coding and decoding process while ensuring the coding and decoding performance, thereby effectively improving the coding and decoding efficiency.
[0444] Based on the same inventive concept as the above embodiments, see Figure 7 , which shows a schematic diagram of the structure of an encoder 70 provided in an embodiment of the present application. Figure 7 As shown, the encoder 70 may include: a first determination unit 701, a first calculation unit 702 and a first prediction unit 703; wherein,
[0445] The first determining unit 701 is configured to determine prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters; and when the prediction mode parameters indicate that the intra prediction value of the current block is determined using a matrix-based intra prediction MIP mode, determining the MIP input sample value of the current block according to adjacent sample values of the current block;
[0446] The first calculation unit 702 is configured to determine the product of the sum of the MIP input sample values and the shift offset parameter according to the value of the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; and determine a first constant value according to the value of the shift amount parameter, wherein the value of the shift amount parameter is a fixed constant; and set the value of the first offset to the difference between the first constant value and the product;
[0447] The first determining unit 701 is further configured to determine the MIP weighting matrix of the current block according to the prediction parameter;
[0448] The first prediction unit 703 is configured to determine the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; and filter the MIP prediction value to obtain the intra-frame prediction value of the current block.
[0449] In some embodiments, the adjacent sampling values of the current block include left adjacent sampling values and upper adjacent sampling values of the current block.
[0450] In some embodiments, the prediction parameters further include: a size parameter of the current block.
[0451] In some embodiments, the first determination unit 701 is further configured to perform down-sampling filtering on the adjacent sample values of the current block to obtain a first temporary reference value; and when the size parameter value of the current block is within a preset range, determine a second constant value according to the bit depth of the adjacent sample values of the current block; set the value corresponding to the index number 0 in the MIP input sample value to be equal to the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value; set the value corresponding to the index number i in the MIP input sample value to be equal to the difference between the value corresponding to the index number i in the first temporary reference value and the value corresponding to the index number equal to 0 in the first temporary reference value, where i is an integer greater than 0; and when the size parameter value of the current block is not within the preset range, set the value corresponding to the index number j in the MIP input sample value to be equal to the difference between the value corresponding to the index number j+1 in the first temporary reference value and the value corresponding to the index number 0 in the first temporary reference value, where j is an integer greater than or equal to 0.
[0452] In some embodiments, the first determination unit 701 is further configured to set the second constant value to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the bit depth of the adjacent sample values of the current block minus 1.
[0453] In some embodiments, the first determination unit 701 is further configured to perform a binary bit left shift on "1" to obtain the second constant value, wherein the number of bits of the bit left shift is equal to the bit depth of the adjacent sampling values of the current block minus 1.
[0454] In some embodiments, the value of the shift offset parameter is a fixed constant that is independent of the block size index value and the MIP mode index value.
[0455] In some embodiments, the value of the shift amount parameter is a fixed constant that is independent of the block size index value and the MIP mode index value.
[0456] In some embodiments, the first calculation unit 702 is further configured to set the first constant value to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the value of the shift quantity parameter minus 1.
[0457] In some embodiments, the first calculation unit 702 is further configured to perform a binary bit left shift on "1" to obtain the first constant value, wherein the number of bits of the bit left shift is equal to the value of the shift quantity parameter minus 1.
[0458] In some embodiments, the value of the shift amount parameter is set to be equal to 6.
[0459] In some embodiments, the first calculation unit 702 is further configured to calculate a first weighted sum of the MIP weighting matrix and the MIP input sampling value; and calculate a first sum value of the first weighted sum and the first offset; and perform a binary bit right shift on the first sum value to obtain a first right shift value, wherein the number of bits of the right shift is equal to the value of the shift quantity parameter; and set the MIP prediction value of the current block to be equal to the sum of the first right shift value and the value corresponding to the index number 0 in the first temporary reference value.
[0460] In some embodiments, the first determination unit 701 is further configured to determine a block size index value of the current block according to a size parameter of the current block; and determine a value of the shift quantity parameter according to the block size index value of the current block.
[0461] In some embodiments, the first determination unit 701 is further configured to, when the width and height of the current block are both equal to 4, set the block size index value of the current block to 0; and when the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, set the block size index value of the current block to 1; and when the width and height of the current block do not meet the aforementioned conditions, set the block size index value of the current block to 2.
[0462] In some embodiments, the first determining unit 701 is further configured to determine that when the block size index value of the current block is equal to 0, 1 and 2 respectively, the value of the shift quantity parameter corresponding to the block size index value of the current block is equal to 5, 6 and 5 respectively.
[0463] In some embodiments, see Figure 7 , the encoder 70 may further include a first query unit 704; wherein,
[0464] The first determining unit 701 is further configured to determine a MIP mode index value of the current block when the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode;
[0465] The first query unit 704 is configured to query a value corresponding to the MIP mode index value from a first preset lookup table according to the MIP mode index value, wherein the first preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift quantity parameter; and determine the queried value as the value of the shift quantity parameter.
[0466] In some embodiments, the first query unit 704 is further configured to query a value corresponding to the block size index value from a second preset lookup table based on the block size index value, wherein the second preset lookup table is used to record the correspondence between the block size index value and the value of the shift quantity parameter; and determine the queried value as the value of the shift quantity parameter.
[0467] In some embodiments, the first determination unit 701 is further configured to determine a block size index value of the current block according to a size parameter of the current block; and determine a value of the shift offset parameter according to the block size index value of the current block.
[0468] In some embodiments, the first determining unit 701 is further configured to determine a MIP mode index value of the current block when the prediction mode parameter indicates that the intra prediction value of the current block is determined using the MIP mode;
[0469] The first query unit 704 is also configured to query a value corresponding to the MIP mode index value from a third preset lookup table according to the MIP mode index value, wherein the third preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift offset parameter; and determine the queried value as the value of the shift offset parameter.
[0470] In some embodiments, the first query unit 704 is further configured to query a value corresponding to the block size index value from a fourth preset lookup table according to the block size index value, wherein the fourth preset lookup table is used to record the correspondence between the block size index value and the value of the shift offset parameter; and determine the queried value as the value of the shift offset parameter.
[0471] In some embodiments, the first determination unit 701 is further configured to determine that when the block size index value of the current block is equal to 0, 1 and 2 respectively, the value of the shift offset parameter corresponding to the block size index value of the current block is equal to 34, 23 and 46 respectively.
[0472] It is understandable that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course, it may be a module, or it may be non-modular. Moreover, the components in the present embodiment may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional module.
[0473] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0474] Therefore, an embodiment of the present application provides a computer storage medium, which is applied to an encoder 70, and the computer storage medium stores a computer program, and when the computer program is executed by a first processor, the method described in any one of the aforementioned embodiments is implemented.
[0475] Based on the composition of the encoder 70 and the computer storage medium, see Figure 8 , which shows a specific hardware structure example of the encoder 70 provided in an embodiment of the present application, which may include: a first communication interface 801, a first memory 802 and a first processor 803; each component is coupled together through a first bus system 804. It can be understood that the first bus system 804 is used to realize the connection and communication between these components. In addition to the data bus, the first bus system 804 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Figure 8 In the figure, various buses are marked as the first bus system 804. Among them,
[0476] The first communication interface 801 is used to receive and send signals during the process of sending and receiving information with other external network elements;
[0477] A first memory 802, used to store a computer program that can be run on the first processor 803;
[0478] The first processor 803 is configured to, when running the computer program, execute:
[0479] Determine prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters; when the prediction mode parameters indicate that the intra-frame prediction value of the current block is determined using a matrix-based intra-frame prediction MIP mode, determine the MIP input sample value of the current block according to the adjacent sample values of the current block; determine the product of the sum of the MIP input sample values and the shift offset parameter according to the value of a shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; determine a first constant value according to the value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; set the value of the first offset to the difference between the first constant value and the product; determine the MIP weighting matrix of the current block according to the prediction parameters; determine the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; filter the MIP prediction value to obtain the intra-frame prediction value of the current block.
[0480] It can be understood that the first memory 802 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct memory bus random access memory (DRRAM). The first memory 802 of the system and method described in the present application is intended to include, but is not limited to, these and any other suitable types of memory.
[0481] The first processor 803 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the first processor 803. The above-mentioned first processor 803 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the first memory 802, and the first processor 803 reads the information in the first memory 802 and completes the steps of the above method in combination with its hardware.
[0482] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units or combinations thereof for performing functions described in the present application. For software implementation, the technology described in the present application can be implemented by a module (such as a process, function, etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor.
[0483] Optionally, as another embodiment, the first processor 803 is further configured to execute the method described in any one of the aforementioned embodiments when running the computer program.
[0484] This embodiment provides an encoder, which may include a first determination unit, a first calculation unit, and a first prediction unit. In this way, after obtaining the prediction parameters of the current block, if it is determined that the current block uses the MIP mode, at this time, the acquisition process of the shift offset parameter and the shift quantity parameter is simplified, thereby reducing the complexity and reducing the storage space required in the coding and decoding process on the basis of ensuring the coding and decoding performance, and effectively improving the coding and decoding efficiency.
[0485] Based on the same inventive concept as the above embodiments, see Fig. 9 , which shows a schematic diagram of the structure of a decoder 90 provided in an embodiment of the present application. Fig. 9 As shown, the decoder 90 may include: a parsing unit 901, a second determining unit 902, a second calculating unit 903 and a second predicting unit 904; wherein,
[0486] The parsing unit 901 is configured to parse the bitstream and obtain prediction parameters of the current block, wherein the prediction parameters include: prediction mode parameters;
[0487] A second determining unit 902 is configured to determine the MIP input sample value of the current block according to the adjacent sample values of the current block when the prediction mode parameter indicates that the matrix-based intra prediction MIP mode is used to determine the intra prediction value of the current block;
[0488] The second calculation unit 903 is configured to determine the product of the sum of the MIP input sampling values and the shift offset parameter according to the value of the shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; and determine the first constant value according to the value of the shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; and set the value of the first offset to the difference between the first constant value and the product;
[0489] The second determining unit 902 is further configured to determine the MIP weighting matrix of the current block according to the prediction parameter;
[0490] The second prediction unit 904 is configured to determine the MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sampling value, the shift quantity parameter and the first offset, wherein the MIP prediction value is the prediction value of some sampling points in the current block; and filter the MIP prediction value to obtain the intra-frame prediction value of the current block.
[0491] In some embodiments, the adjacent sampling values of the current block include left adjacent sampling values and upper adjacent sampling values of the current block.
[0492] In some embodiments, the prediction parameters further include: a size parameter of the current block.
[0493] In some embodiments, the second determination unit 902 is further configured to perform downsampling filtering on the adjacent sample values of the current block to obtain a first temporary reference value; and when the size parameter value of the current block is within a preset range, determine a second constant value according to the bit depth of the adjacent sample values of the current block; set the value corresponding to the index number 0 in the MIP input sample value to be equal to the difference between the second constant value and the value corresponding to the index number 0 in the first temporary reference value; set the value corresponding to the index number i in the MIP input sample value to be equal to the difference between the value corresponding to the index number i in the first temporary reference value and the value corresponding to the index number equal to 0 in the first temporary reference value, where i is an integer greater than 0; and when the size parameter value of the current block is not within the preset range, set the value corresponding to the index number j in the MIP input sample value to be equal to the difference between the value corresponding to the index number j+1 in the first temporary reference value and the value corresponding to the index number 0 in the first temporary reference value, where j is an integer greater than or equal to 0.
[0494] In some embodiments, the second determining unit 902 is further configured to set the second constant value to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the bit depth of the adjacent sample values of the current block minus 1.
[0495] In some embodiments, the second determination unit 902 is further configured to perform a binary bit left shift on "1" to obtain the second constant value, wherein the number of bits of the bit left shift is equal to the bit depth of the adjacent sampling values of the current block minus 1.
[0496] In some embodiments, the value of the shift offset parameter is a fixed constant that is independent of the block size index value and the MIP mode index value.
[0497] In some embodiments, the value of the shift amount parameter is a fixed constant that is independent of the block size index value and the MIP mode index value.
[0498] In some embodiments, the second calculation unit 903 is further configured to set the first constant value to be equal to an integer exponent power of 2, wherein the exponent of the power is equal to the value of the shift quantity parameter minus 1.
[0499] In some embodiments, the second calculation unit 903 is further configured to perform a binary bit left shift on "1" to obtain the first constant value, wherein the number of bits of the bit left shift is equal to the value of the shift quantity parameter minus 1.
[0500] In some embodiments, the value of the shift amount parameter is set to be equal to 6.
[0501] In some embodiments, the second calculation unit 903 is further configured to calculate a first weighted sum of the MIP weighting matrix and the MIP input sampling value; and calculate a first sum value of the first weighted sum and the first offset; and perform a binary bit right shift on the first sum value to obtain a first right shift value, wherein the number of bits of the right shift is equal to the value of the shift quantity parameter; and set the MIP prediction value of the current block to be equal to the sum of the first right shift value and the value corresponding to the index number 0 in the first temporary reference value.
[0502] In some embodiments, the second determining unit 902 is further configured to determine a block size index value of the current block according to a size parameter of the current block; and determine a value of the shift quantity parameter according to the block size index value of the current block.
[0503] In some embodiments, the second determination unit 902 is further configured to, when the width and height of the current block are both equal to 4, set the block size index value of the current block to 0; and when the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, set the block size index value of the current block to 1; and when the width and height of the current block do not meet the aforementioned conditions, set the block size index value of the current block to 2.
[0504] In some embodiments, the second determining unit 902 is further configured to determine that when the block size index value of the current block is equal to 0, 1 and 2 respectively, the value of the shift quantity parameter corresponding to the block size index value of the current block is equal to 5, 6 and 5 respectively.
[0505] In some embodiments, see Fig. 9 , the decoder 90 may further include a second query unit 905; wherein,
[0506] The second determining unit 902 is further configured to determine a MIP mode index value of the current block when the prediction mode parameter indicates that the intra-frame prediction value of the current block is determined using the MIP mode;
[0507] The second query unit 905 is configured to query a value corresponding to the MIP mode index value from a first preset lookup table according to the MIP mode index value, wherein the first preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift quantity parameter; and determine the queried value as the value of the shift quantity parameter.
[0508] In some embodiments, the second query unit 905 is further configured to query a value corresponding to the block size index value from a second preset lookup table according to the block size index value, wherein the second preset lookup table is used to record the correspondence between the block size index value and the value of the shift quantity parameter; and determine the queried value as the value of the shift quantity parameter.
[0509] In some embodiments, the second determination unit 902 is further configured to determine a block size index value of the current block according to a size parameter of the current block; and determine a value of the shift offset parameter according to the block size index value of the current block.
[0510] In some embodiments, the second determining unit 902 is further configured to determine a MIP mode index value of the current block when the prediction mode parameter indicates that the intra prediction value of the current block is determined using the MIP mode;
[0511] The second query unit 905 is also configured to query a value corresponding to the MIP mode index value from a third preset lookup table according to the MIP mode index value, wherein the third preset lookup table is used to record the correspondence between the MIP mode index value and the value of the shift offset parameter; and determine the queried value as the value of the shift offset parameter.
[0512] In some embodiments, the second query unit 905 is further configured to query a value corresponding to the block size index value from a fourth preset lookup table based on the block size index value, wherein the fourth preset lookup table is used to record the correspondence between the block size index value and the value of the shift offset parameter; and determine the queried value as the value of the shift offset parameter.
[0513] In some embodiments, the second determination unit 902 is further configured to determine that when the block size index value of the current block is equal to 0, 1 and 2 respectively, the value of the shift offset parameter corresponding to the block size index value of the current block is equal to 34, 23 and 46 respectively.
[0514] It can be understood that in this embodiment, a "unit" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional module.
[0515] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium, which is applied to the decoder 90, and the computer storage medium stores a computer program. When the computer program is executed by the second processor, the method described in any one of the above embodiments is implemented.
[0516] Based on the above-mentioned components of the decoder 90 and the computer storage medium, see Fig.10 , which shows a specific hardware structure example of the decoder 90 provided in an embodiment of the present application, which may include: a second communication interface 1001, a second memory 1002, and a second processor 1003; each component is coupled together via a second bus system 1004. It is understandable that the second bus system 1004 is used to realize the connection and communication between these components. In addition to the data bus, the second bus system 1004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in Fig.10 In the figure, various buses are marked as the second bus system 1004.
[0517] The second communication interface 1001 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
[0518] The second memory 1002 is used to store a computer program that can be run on the second processor 1003;
[0519] The second processor 1003 is configured to, when running the computer program, execute:
[0520] Parse a bitstream to obtain prediction parameters of a current block, wherein the prediction parameters include: a prediction mode parameter; when the prediction mode parameter indicates that a matrix-based intra-frame prediction MIP mode is used to determine an intra-frame prediction value of the current block, determine a MIP input sample value of the current block according to adjacent sample values of the current block; determine a product of a sum of the MIP input sample values and the shift offset parameter according to a value of a shift offset parameter, wherein the value of the shift offset parameter is a fixed constant; determine a first constant value according to a value of a shift quantity parameter, wherein the value of the shift quantity parameter is a fixed constant; set the value of the first offset to the difference between the first constant value and the product; determine a MIP weighting matrix of the current block according to the prediction parameters; determine a MIP prediction value of the current block according to the MIP weighting matrix, the MIP input sample value, the shift quantity parameter and the first offset, wherein the MIP prediction value is a prediction value of some sampling points in the current block; filter the MIP prediction value to obtain an intra-frame prediction value of the current block.
[0521] Optionally, as another embodiment, the second processor 1003 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.
[0522] It can be understood that the hardware functions of the second memory 1002 and the first memory 802 are similar, and the hardware functions of the second processor 1003 and the first processor 803 are similar; they will not be described in detail here.
[0523] This embodiment provides a decoder, which may include a parsing unit, a second determining unit, a second calculating unit, and a second prediction unit. In this way, after obtaining the prediction parameters of the current block, if it is determined that the current block uses the MIP mode, at this time, since the acquisition process of the shift quantity parameter and the shift offset parameter is simplified, it is possible to reduce the complexity and the storage space required in the coding and decoding process while ensuring the coding and decoding performance, thereby effectively improving the coding and decoding efficiency.
[0524] In some embodiments, see Fig.11 , which shows a schematic diagram of the composition structure of a sending device provided in an embodiment of the present application. Fig.11As shown, an exemplary sending device 500 is shown. Among them, the acquisition unit 1101 acquires a video signal and sends the video signal to the encoder 1102. The acquisition unit 1101 may be a device including one or more cameras (including a depth camera). The acquisition unit 1101 may be a device that partially or completely decodes the code stream to obtain a video. The acquisition unit 1101 may also include one or more elements to capture an audio signal. A specific implementation of the encoder 1102 is the encoder 200 described in the aforementioned embodiment, which encodes the video signal from the acquisition unit 1101 as its input video and generates a video code stream. The encoder 1102 may also include one or more audio encoders to encode the audio signal to generate an audio code stream. The storage / transmission unit 1103 receives the video code stream from the encoder 1102. The storage / transmission unit 1103 may also receive the audio code stream from the encoder 1102 and compress the video code stream and the audio code stream together to form a media file (e.g., an ISO-based media file format) or a transport stream.
[0525] Optionally, the storage / transmission unit 1103 writes the media file or the transport stream to a storage unit, such as a hard disk, a DVD disk, a cloud, or a portable storage device.
[0526] Optionally, the storage / transmission unit 1103 transmits the bit stream to a transmission network, such as the Internet, a wired network, a cellular network, a wireless local area network, etc.
[0527] In some embodiments, see Fig.12 , which shows a schematic diagram of the composition structure of a target device provided in an embodiment of the present application. Fig.12 As shown, an exemplary target device 600 is shown. Among them, the receiving unit 1201 receives a media file or a transport stream from a network, or reads a media file or a transport stream from a storage device. The receiving unit 1201 separates the video code stream and the audio code stream from the media file or the transport stream. The receiving unit 1201 can also generate a new video code stream by extracting the video code stream. The receiving unit 1201 can also generate a new audio code stream by extracting the audio code stream. The decoder 1202 includes one or more video decoders, for example, a specific implementation is the decoder 300 described in the above embodiment.
[0528] The decoder 1202 may also include one or more audio decoders. The decoder 1202 decodes the video bitstream and the audio bitstream from the receiving unit 1201 to obtain a decoded video and one or more decoded audios corresponding to one or more channels. The rendering unit 1203 performs operations on the reconstructed video to make it suitable for display. Such operations may include one or more of the following operations to improve the perceived quality: noise reduction, synthesis, conversion of color space, upsampling, downsampling, etc. The rendering unit 1203 may also perform operations on the decoded audio to improve the perceived quality of the displayed audio signal.
[0529] In some embodiments, see Fig.13 , which shows a schematic diagram of the structure of a communication system provided by an embodiment of the present application. Fig.13 As shown, an exemplary communication system 700 is shown. The source device 1301 may be Fig.11 The output of the storage / transmission unit 1103 is processed by the storage medium / transmission network 1302 to store or transmit the code stream. The target device 1303 can be Fig.12 The target device 600 shown in FIG. 1 is a block diagram of a target device 600. Here, the receiving unit 1201 can obtain a code stream from a storage medium / transmission network 1302. The receiving unit 1201 can extract a new video code stream from a media file or a transmission stream. The receiving unit 1201 can also extract a new audio code stream from a media file or a transmission stream. In this way, the image prediction method of the embodiment of the present application can improve the performance of the MIP mode by reducing the computational complexity in the process of obtaining the intra-frame prediction block.
[0530] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0531] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0532] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0533] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0534] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0535] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An image prediction method, applied to a decoder, the method include: Decode the bitstream and determine the prediction mode parameters of the current block; When the prediction mode parameter indicates that a matrix-based intra prediction MIP mode is used to determine an intra prediction value of the current block, determining a MIP mode index of the current block; Determine a MIP input sampling value of the current block according to adjacent sampling values of the current block; Determining a block size index of the current block according to a size parameter of the current block; Determining a MIP weighting matrix of the current block according to the MIP mode index of the current block and the block size index of the current block; Determine a MIP prediction value of the current block according to the MIP input sample value of the current block, the MIP weighting matrix of the current block, a shift offset parameter and a shift quantity parameter, wherein for a block having any MIP mode index and any block size index, the value of the shift offset parameter is 32; for a block having any MIP mode index and any block size index, the value of the shift quantity parameter is 6; The MIP prediction value is filtered to determine the intra-frame prediction value of the current block.
2. The method according to claim 1, It is characterized in that The determining the MIP prediction value of the current block according to the MIP input sample value of the current block, the MIP weighting matrix of the current block, the shift offset parameter and the shift quantity parameter includes: The MIP prediction value of the current block is determined according to the following formula: Wherein, P[] is the MIP input sampling value; inSize is the number of MIP input sample values; mWeight is the MIP weighting matrix of the current block; oW is determined according to the shift offset parameter, the shift quantity parameter and the MIP input sampling value; pTemp[] is a temporary reference value; predSize is used to determine the number of predicted values of the MIP.
3. The method according to claim 2, It is characterized in that The determining, according to the size parameter of the current block, a block size index of the current block comprises: When the width and height of the current block are both equal to 4, the block size index of the current block is equal to 0; When the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, the block size index of the current block is equal to 1; When the width and height of the current block do not satisfy the aforementioned conditions, the block size index of the current block is equal to 2.
4. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: According to the block size index of the current block, the number inSize of the MIP input sample values and the value of predSize used to determine the number of the MIP prediction values are determined.
5. An image prediction method, applied to an encoder, the method include: Determining prediction mode parameters for the current block; When the prediction mode parameter indicates that a matrix-based intra prediction MIP mode is used to determine an intra prediction value of the current block, determining a MIP mode index of the current block; Determine a MIP input sampling value of the current block according to adjacent sampling values of the current block; Determining a block size index of the current block according to a size parameter of the current block; Determining a MIP weighting matrix of the current block according to the MIP mode index of the current block and the block size index of the current block; Determine a MIP prediction value of the current block according to the MIP input sample value of the current block, the MIP weighting matrix of the current block, a shift offset parameter and a shift quantity parameter, wherein for a block having any MIP mode index and any block size index, the value of the shift offset parameter is 32; for a block having any MIP mode index and any block size index, the value of the shift quantity parameter is 6; The MIP prediction value is filtered to determine the intra-frame prediction value of the current block.
6. The method according to claim 5, It is characterized in that The determining the MIP prediction value of the current block according to the MIP input sample value of the current block, the MIP weighting matrix of the current block, the shift offset parameter and the shift quantity parameter includes: The MIP prediction value of the current block is determined according to the following formula: Wherein, P[] is the MIP input sampling value; inSize is the number of MIP input sample values; mWeight is the MIP weighting matrix of the current block; oW is determined according to the shift offset parameter, the shift quantity parameter and the MIP input sampling value; pTemp[] is a temporary reference value; predSize is used to determine the number of predicted values of the MIP.
7. The method according to claim 6, It is characterized in that The determining, according to the size parameter of the current block, a block size index of the current block comprises: When the width and height of the current block are both equal to 4, the block size index of the current block is equal to 0; When the width and height of the current block are both equal to 8, or one of the width and height of the current block is equal to 4, the block size index of the current block is equal to 1; When the width and height of the current block do not satisfy the aforementioned conditions, the block size index of the current block is equal to 2.
8. The method according to any one of claims 5 to 7, It is characterized in that The method further comprises: According to the block size index of the current block, the number inSize of the MIP input sample values and the value of predSize used to determine the number of the MIP prediction values are determined.
9. An encoder, comprising a first determining unit and a first predicting unit; in, The first determination unit is configured to determine a prediction mode parameter of the current block; when the prediction mode parameter indicates that the intra prediction value of the current block is determined using a matrix-based intra prediction MIP mode, determine the MIP mode index of the current block; and determine the MIP input sample value of the current block according to the adjacent sample values of the current block; The first determining unit is further configured to determine a block size index of the current block according to a size parameter of the current block; and determine a MIP weighting matrix of the current block according to the MIP mode index of the current block and the block size index of the current block; The first prediction unit is configured to determine the MIP prediction value of the current block according to the MIP input sampling value of the current block, the MIP weighting matrix of the current block, the shift offset parameter and the shift quantity parameter, wherein when the current block pair has any MIP mode index prediction mode parameter and any block size index size parameter, the value of the shift offset parameter is 32; when the current block pair has any MIP mode index prediction mode parameter and any block size index size parameter, the value of the shift quantity parameter is 6; and filter the MIP prediction value to determine the intra-frame prediction value of the current block.
10. An encoder, comprising a first memory and a first processor; in, The first memory is used to store a computer program that can be run on the first processor; The first processor is configured to execute the method according to any one of claims 5 to 8 when running the computer program.
11. A decoder, the decoder comprising a parsing unit, a second determining unit and a second predicting unit; in, The parsing unit is configured to decode the bitstream and determine the prediction mode parameters of the current block; The second determination unit is configured to determine the MIP mode index of the current block when the prediction mode parameter indicates that the intra prediction value of the current block is determined using the matrix-based intra prediction MIP mode; and determine the MIP input sample value of the current block according to the adjacent sample values of the current block; The second determining unit is further configured to determine a block size index of the current block according to a size parameter of the current block; and determining a MIP weighting matrix of the current block according to the MIP mode index of the current block and the block size index of the current block; The second prediction unit is configured to determine the MIP prediction value of the current block according to the MIP input sampling value of the current block, the MIP weighting matrix of the current block, the shift offset parameter and the shift amount parameter, wherein for a block with any MIP mode index and any block size index, the value of the shift offset parameter is 32; for a block with any MIP mode index and any block size index, the value of the shift amount parameter is 6; and the MIP prediction value is filtered to determine the intra-frame prediction value of the current block.
12. A decoder, the decoder comprising a second memory and a second processor; in, The second memory is used to store a computer program that can be run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 4 when running the computer program.
13. A computer storage medium, It is characterized in that The computer storage medium stores a computer program, which implements the method according to any one of claims 5 to 8 when executed by a first processor, or implements the method according to any one of claims 1 to 4 when executed by a second processor.
14. A computer storage medium having a code stream stored thereon, in, The code stream is generated by executing the steps of the encoding method according to any one of claims 5 to 8.
Citation Information
Patent Citations
Method of and apparatus for encoding and decoding data
CN103533364A
Image-encoding apparatus and method, transform-encoding apparatus and method, apparatus and method for generating a transform base, and image-decoding apparatus and method used in same
US20120307895A1
Facilitating increased precision in MIP-mapped stitched textures for graphics computing devices
US20160364900A1
