Inter-frame prediction method, encoder, decoder and storage medium

By calculating and embeding the weight index in the inter-geometric division prediction mode, the problem of verbose weight mapping table in the prior art is solved, simplifying the code and reducing storage overhead.

CN119420915APending Publication Date: 2025-02-11GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411821652.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2019-12-31
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

In the prior art, the inter-geometric division prediction mode (GEO) used in the inter-frame prediction process is too verbose, resulting in large data storage overhead and complex code.

Method used

By determining the GEO parameters of the current block, calculating the predicted values ​​of its first and second partitions, and determining the weight index of the pixel points based on these parameters, performing embedding processing to obtain absolute information, thereby simplifying the storage and use of weight values.

Benefits of technology

The text and code during inter-frame prediction is simplified, the overhead of data storage is reduced, and the encoding efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119420915A_ABST
    Figure CN119420915A_ABST
Patent Text Reader

Abstract

The invention discloses an inter-frame prediction method, an encoder, a decoder and a storage medium. The inter-frame prediction method comprises the following steps: determining a prediction mode parameter of a current block; determining a GEO parameter of the current block when the prediction mode parameter indicates that the inter prediction of the current block is determined using GEO; determining a first predicted value and a second predicted value according to the GEO parameter; determining a weight index corresponding to a pixel point in the current block according to the GEO parameter; respectively carrying out clamping processing on the weight indexes corresponding to the pixel points in the current block to obtain weight index absolute information corresponding to the pixel points in the current block; the clamping processing is to clamp the value of the weight index corresponding to the pixel point in the current block to a range from 0 to half of a preset value; determining a first weight value and a second weight value based on the weight index absolute information corresponding to the pixel points in the current block; and obtaining an inter-frame prediction value of the current block by using the first prediction value, the first weight value, the second prediction value and the second weight value.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an application with a filing date of December 31, 2019, application number 2019800996070, and invention name “An inter-frame prediction method, encoder, decoder and storage medium”. Technical Field

[0002] The embodiments of the present application relate to video coding technology, and are related to but not limited to inter-frame prediction methods, encoders, decoders and storage media. Background Art

[0003] In the process of video encoding and decoding, in addition to intra-frame prediction, inter-frame prediction can also be used for encoding and decoding the current block. Inter-frame prediction can include motion estimation and motion compensation. For motion compensation, the inter-frame geometric partitioning prediction mode (GEO) can be used to divide the current block between frames into two non-rectangular partitions for prediction and then weighted fusion to obtain the prediction value of the current block.

[0004] In the prior art, in the prediction process of GEO, it is necessary to use an angle mapping table and a weight mapping table. When predicting the current block, the length of a partition weight mapping table is 27, and the total length of the two partition mapping tables is 54. However, the corresponding weight values ​​among these 54 are composed of five types: {4, 5, 6, 7, 8}.

[0005] However, there are many repeated weights in the existing weight mapping table, and the weight table is too long, which makes the storage overhead of data in inter-frame prediction large and the text and code more complicated. Summary of the invention

[0006] The embodiments of the present application provide an inter-frame prediction method, an encoder, a decoder, and a storage medium, which can simplify the text and code during inter-frame prediction and reduce the overhead of data storage.

[0007] In a first aspect, an embodiment of the present application provides an inter-frame prediction method, which is applied to an encoder, and the method includes:

[0008] Determining prediction mode parameters for the current block;

[0009] When the prediction mode parameter indicates that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode GEO, determining the GEO parameter of the current block;

[0010] Determine, according to the GEO parameters, a first prediction value for a first partition of a current block and a second prediction value for a second partition of the current block;

[0011] Determine the weight index corresponding to the pixel point in the current block according to the GEO parameter;

[0012] The weight indexes corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding processing is to embed the values ​​of the weight indexes corresponding to the pixels in the current block into the range of [0 to half of the preset value];

[0013] Determine a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0014] The first prediction value, the first weight value, the second prediction value and the second weight value are used to perform weighted fusion of the pixels in the current block to obtain an inter-frame prediction value of the current block.

[0015] In a second aspect, an embodiment of the present application provides an inter-frame prediction method, which is applied to a decoder, and the method includes:

[0016] Parse the bitstream and determine the prediction mode parameters of the current block;

[0017] When the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode GEO is used to determine the inter-frame prediction of the current block, parsing the bitstream to determine the GEO parameter of the current block;

[0018] Determine, according to the GEO parameter, a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block;

[0019] Determine the weight index corresponding to the pixel point in the current block according to the GEO parameter;

[0020] The weight indexes corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding processing is to embed the values ​​of the weight indexes corresponding to the pixels in the current block into the range of [0 to half of the preset value];

[0021] Determining a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0022] The first prediction value, the first weight value, the second prediction value and the second weight value are used to determine a weighted fusion of pixels in the current block to obtain an inter-frame prediction value of the current block.

[0023] In a third aspect, an embodiment of the present application provides an encoder, including:

[0024] A first determination unit is configured to determine a prediction mode parameter of a current block; when the prediction mode parameter indicates that an inter-frame geometric partition prediction mode GEO is used to determine an inter-frame prediction of the current block, determine the GEO parameter of the current block; determine a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block according to the GEO parameter; and determine a weight index corresponding to a pixel point in the current block according to the GEO parameter;

[0025] A first embedding unit is used to embed the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding process embeds the value of the weight index corresponding to the pixel in the current block to a range of [0 to half of a preset value];

[0026] The first determining unit is further used to determine a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0027] The first prediction unit is used to perform weighted fusion of pixels in the current block using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain an inter-frame prediction value of the current block.

[0028] In a fourth aspect, an embodiment of the present application provides a decoder, including:

[0029] A parsing unit, used for parsing the bitstream and determining the prediction mode parameters of the current block;

[0030] A second determination unit is configured to parse the bitstream and determine the GEO parameters of the current block when the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode GEO is used to determine the inter-frame prediction of the current block; determine a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block according to the GEO parameters; and determine a weight index corresponding to a pixel point in the current block according to the GEO parameters;

[0031] A second embedding unit is used to embed the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding process embeds the value of the weight index corresponding to the pixel in the current block to a range of [0 to half of a preset value];

[0032] The second determining unit is used to determine a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0033] The second prediction unit is used to determine the weighted fusion of the pixels in the current block by using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain the inter-frame prediction value of the current block.

[0034] In a fifth aspect, an embodiment of the present application further provides an encoder, including:

[0035] a first memory and a first processor;

[0036] The first memory stores a computer program that can be run on the first processor, and the first processor implements the inter-frame prediction method of the encoder when executing the program.

[0037] In a sixth aspect, an embodiment of the present application further provides a decoder, including:

[0038] a second memory and a second processor;

[0039] The second memory stores a computer program that can be run on the second processor, and the second processor implements the inter-frame prediction method of the decoder when executing the program.

[0040] In a seventh aspect, an embodiment of the present application provides a storage medium, including:

[0041] A computer program is stored thereon, and when the computer program is executed by the first processor, the inter-frame prediction method of the encoder is implemented; or when the computer program is executed by the second processor, the inter-frame prediction method of the decoder is implemented.

[0042] The embodiment of the present application provides an inter-frame prediction method, an encoder, a decoder and a storage medium, which determine the prediction mode parameters of the current block; when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partition prediction mode GEO, determine the GEO parameters of the current block; determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GEO parameters; determine the weight index corresponding to the pixel points in the current block according to the GEO parameters; perform embedding processing on the weight index corresponding to the pixel points in the current block respectively to obtain the absolute information of the weight index corresponding to the pixel points in the current block; wherein the embedding processing is to embed the value of the weight index corresponding to the pixel points in the current block to the range of [0 to half of the preset value]; based on the absolute information of the weight index corresponding to the pixel points in the current block, determine the first weight value of the pixel points in the current block and the second weight value of the pixel points in the current block; use the first prediction value, the first weight value, the second prediction value and the second weight value to perform weighted fusion of the pixels in the current block to obtain the inter-frame prediction value of the current block. By adopting the above-mentioned solution to implement the technology, the encoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter during the inter-frame prediction process, and then embed the value of the weight index corresponding to the pixel point in the current block into the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, thereby reducing the storage and use of the weight value corresponding to the absolute information of the weight index by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A schematic block diagram of a video encoding system provided in an embodiment of the present application;

[0044] Figure 2 A schematic block diagram of a video decoding system provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of an implementation process of an intra-frame prediction method provided in an embodiment of the present application Figure 1 ;

[0046] Figure 4a-4g A schematic diagram of seven exemplary division modes provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of an exemplary current block angle and step length provided in an embodiment of the present application;

[0048] Figure 6a A schematic diagram of an exemplary first weight value of brightness provided in an embodiment of the present application;

[0049] Figure 6bA schematic diagram of an exemplary first weight value of chromaticity provided in an embodiment of the present application;

[0050] Figure 7 A schematic diagram of an implementation process of an intra-frame prediction method provided in an embodiment of the present application Figure 2 ;

[0051] Figure 8 A schematic diagram of an exemplary preset motion mask matrix 1 and current motion mask matrices 2, 3 and 4 provided in an embodiment of the present application;

[0052] Fig. 9 A schematic diagram of an implementation flow of an intra-frame prediction method provided in an embodiment of the present application;

[0053] Fig.10 A schematic diagram of the structure of an encoder provided in an embodiment of the present application Figure 1 ;

[0054] Fig.11 A schematic diagram of the structure of an encoder provided in an embodiment of the present application Figure 2 ;

[0055] Fig.12 A schematic diagram of a decoder provided in an embodiment of the present application Figure 1 ;

[0056] Fig.13 A schematic diagram of a decoder provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0057] A video encoding system is provided for this application, such as Figure 1 As shown, the video encoding system 11 includes:

[0058] Transformation unit 111, quantization unit 112, mode selection and coding control logic unit 113, intra-frame prediction unit 114, inter-frame prediction unit 115 (including: motion compensation and motion estimation), inverse quantization unit 116, inverse transformation unit 117, loop filtering unit 118, coding unit 119 and decoded image buffer unit 110; for the input original video signal, through the coding tree block (Coding Tree A video reconstruction block can be obtained by dividing a video frame into a video frame unit (CTU), and a coding mode is determined by a mode selection and coding control logic unit 113. Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by a transform unit 111 and a quantization unit 112 to transform the video reconstruction block, including transforming the residual information from the pixel domain to the transform domain, and quantizing the obtained transform coefficients to further reduce the bit rate; the intra-frame prediction unit 114 is used to perform intra-frame prediction on the video reconstruction block; wherein the intra-frame prediction unit 114 is used to determine the optimal intra-frame prediction mode (i.e., the target prediction mode) of the video reconstruction block; the inter-frame prediction unit 115 is used to perform inter-frame prediction coding of the received video reconstruction block relative to one or more blocks in one or more reference frames to provide temporal prediction information; wherein the motion estimation is used to generate motion estimation information. The motion vector process can estimate the motion of the video reconstruction block, and then the motion compensation is performed based on the motion vector determined by the motion estimation; after determining the inter-frame prediction mode, the inter-frame prediction unit 115 is also used to provide the selected inter-frame prediction data to the encoding unit 119, and the calculated motion vector data is also sent to the encoding unit 119; in addition, the inverse quantization unit 116 and the inverse transformation unit 117 are used to reconstruct the video reconstruction block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the loop filter unit 118. Then, the reconstructed residual block is added to a predictive block in the frame of the decoded image cache unit 110 to generate a reconstructed video reconstruction block; the encoding unit 119 is used to encode various encoding parameters and quantized transform coefficients. The decoded image cache unit 110 is used to store the reconstructed video reconstruction block for prediction reference. As the video image encoding proceeds, new reconstructed video reconstruction blocks will be continuously generated, and these reconstructed video reconstruction blocks will be stored in the decoded image cache unit 110.

[0059] The embodiment of the present application provides a video decoding system. Figure 2 FIG. 1 is a schematic diagram of the composition structure of the video decoding system according to an embodiment of the present application. Figure 2 As shown, the video decoding system 12 includes:

[0060] Decoding unit 121, inverse transform unit 127, inverse quantization unit 122, intra-frame prediction unit 123, motion compensation unit 124, loop filter unit 125 and decoded image cache unit 126; after the input video signal is encoded by the video encoding system 11, the code stream of the video signal is output; the code stream is input into the video decoding system 12, firstly passes through the decoding unit 121, and is used to obtain the decoded transform coefficient; the transform coefficient is processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate a residual block in the pixel domain; the intra-frame prediction unit 123 can be used to generate prediction data of the current video decoding block based on the determined intra-frame prediction direction and the data of the previously decoded block from the current frame or picture; the motion compensation unit 124 determines prediction information for a video decoding block by analyzing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded; a decoded video block is formed by summing the residual block from the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding predictive block generated by the intra-frame prediction unit 123 or the motion compensation unit 124; the decoded video signal passes through a loop filter unit 125 to remove block effect artifacts, thereby improving video quality; the decoded video block is then stored in a decoded image cache unit 126, which stores reference images for subsequent intra-frame prediction or motion compensation, and is also used for output of video signals to obtain the restored original video signal.

[0061] An inter-frame prediction method provided in an embodiment of the present application mainly acts on the inter-frame prediction unit 115 of the video encoding system 11 and the inter-frame prediction unit of the video decoding system 12, namely, the motion compensation unit 124; that is, if the video encoding system 11 can obtain a better prediction effect through the inter-frame prediction method provided in an embodiment of the present application, then, correspondingly, at the decoding end, the video decoding recovery quality can also be improved.

[0062] 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.

[0063] The embodiment of the present application provides an inter-frame prediction method, which is applied to a video encoding device, i.e., an encoder. The function implemented by the method can be implemented by calling a program code by a processor in the video encoding device, and of course the program code can be stored in a computer storage medium. It can be seen that the video encoding device at least includes a processor and a storage medium.

[0064] Figure 3FIG. 1 is a schematic diagram of an implementation flow of an intra-frame prediction method according to an embodiment of the present application. Figure 3 As shown, the method includes:

[0065] S101. Determine prediction mode parameters of a current block.

[0066] In an embodiment of the present application, a video image can be divided into multiple image blocks, each image block currently to be encoded can be called a coding block (Coding Block, CB), wherein each coding block may include a first image component, a second image component, and a third image component; and the current block is a coding 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.

[0067] Among them, assuming that the current block predicts the first image component, and the first image component is a luminance component, that is, the image component to be predicted is a luminance component, then the current block can also be called a luminance block; or, assuming that the current block predicts the second image component, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.

[0068] It should also be noted that the prediction mode parameters indicate the coding mode of the current block and parameters related to the mode. The prediction mode parameters of the current block can usually be determined by using rate distortion optimization (RDO).

[0069] Specifically, in some embodiments, the encoder determines the prediction mode parameters of the current block as follows: the encoder determines the image components to be predicted of the current block; based on the parameters of the current block, the image components to be predicted are respectively predicted and encoded using multiple prediction modes, and the rate-distortion cost results corresponding to each prediction mode under the multiple prediction modes are calculated; the minimum rate-distortion cost result is selected from the multiple rate-distortion cost results calculated, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block.

[0070] That is to say, on the encoder side, multiple prediction modes can be used for the current block to encode the predicted image components respectively. Here, multiple prediction modes generally include inter-frame prediction mode, traditional intra-frame prediction mode and non-traditional intra-frame prediction mode, and the traditional intra-frame prediction mode can include direct current (DC) mode, plane (PLANAR) mode and angle mode, etc., and the non-traditional intra-frame prediction mode can include MIP mode, cross-component linear model prediction (CCLM) mode, intra-frame block copy (IBC) mode and PLT (Palette) mode, etc., and the inter-frame prediction mode can include: Geometrical partitioning for inter blocks (GEO), triangle prediction mode (TPM), etc.

[0071] In this way, after encoding the current block respectively using multiple prediction modes, the rate-distortion cost result corresponding to each prediction mode can be obtained; then the minimum rate-distortion cost result is selected from the multiple rate-distortion cost results obtained, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block; in this way, the current block can finally be encoded using the determined prediction mode, and in this prediction mode, the prediction residual can be made small, which can improve the coding efficiency.

[0072] S102: When the prediction mode parameter indicates that GEO is used to determine inter-frame prediction of the current block, determine GEO parameters of the current block.

[0073] In the embodiment of the present application, when the prediction mode parameter indicates that the GEO is used to determine the inter-frame prediction of the current block, the GEO parameter of the current block can be acquired or determined. The current block in the embodiment of the present application refers to an inter-frame block.

[0074] In the embodiment of the present application, the GEO parameters of the current block include: angle index information and size information of the current block, and may also include: step index information and target division mode, etc.

[0075] It should be noted that in the embodiment of the present application, GEO is aimed at the edge of the object in the image, and divides the inter-frame block (i.e., the current block) into two non-rectangular sub-partitions for prediction and then performs weighted fusion. For example, the non-rectangular form can be as follows: Figure 4a-4g shown.

[0076] Among them, in the current VVC Draft7, GEO has a total of 82 division modes, each division mode corresponds to an angle α and a step length ρ, and the angle divides 360 degrees into 24 types. Therefore, there are 24 angles and 4 step lengths, so there are 96 combinations of angles and step lengths.

[0077] It should be noted that the angle table uses a slope-based angle table instead of the previous angle table based on fixed step size, and uses 5 fixed slopes (1, 1 / 2, 1 / 4, 4, 2) to construct an angle table with unequal intervals.

[0078] For example, Figure 5 As shown in the figure, each combination of angle α and step length ρ constitutes a partitioning mode (82 partitioning modes are obtained after removing all the first step lengths with angle indexes of 0, 6, 12 to 23). All the partitioning modes of GEO include the TPM mode, which unifies and replaces TPM. GEO divides the current block into two non-rectangular sub-partitions, and each sub-partition performs unidirectional motion compensation to obtain a unidirectional prediction value. Finally, the weight matrix corresponding to the current block is used to weight the unidirectional prediction values ​​of the two partitions to obtain the final GEO prediction value.

[0079] In the embodiment of the present application, at the encoder side, when it is determined that GEO is used for inter-frame prediction, the encoder can obtain the GEO parameters when the current block is used for inter-frame prediction.

[0080] In the embodiment of the present application, the encoder determines the division mode with the lowest rate distortion cost by traversing the 82 division models corresponding to GEO, that is, determines the target division mode; the encoder can determine the angle index information and step index information corresponding to the target division mode according to the target division mode through the mapping table of the preset division mode, angle index and step index. The mapping table of the preset division mode, angle index and step index is shown in Table 1:

[0081] Table 1

[0082]

[0083]

[0084] Among them, wedge_partition_idx is the partition mode index, angleIdx is the angle index information, and distanceIdx is the step index information.

[0085] S103 . Determine, according to the GEO parameter, a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block.

[0086] In an embodiment of the present application, since the GEO parameters may include angle index information and a target partition mode, the encoder may divide the current block according to the target partition mode to obtain a first partition and a second partition; determine, from a preset merge candidate list, the first motion information of the first reference block corresponding to the first partition, and the second motion information of the second reference block corresponding to the second partition; the encoder performs motion compensation according to the first motion information to obtain a first prediction value for the first partition, and the encoder performs motion compensation according to the second motion information to obtain a second prediction value for the second partition.

[0087] It should be noted that, in the embodiment of the present application, GEO uses the one-way Merge candidate list of TPM in the original VVC7, that is, the preset merge candidate list, to find the MVs of the two partitions after the division of GEO, that is, the motion information.

[0088] The Merge candidate list generally includes a preset number of reference block elements, which may be 6. Each element stores data in the form of a structure, and each structure may include: motion information of the reference block, reference frame list, prediction direction, etc. When storing data corresponding to GEO, it is stored in blocks of 4×4 size.

[0089] In the embodiment of the present application, information such as angle index information, step index information, first motion information, and second motion information need to be written into the bitstream during encoding for use during decoding.

[0090] S104: Determine the weight index corresponding to the pixel point in the current block according to the GEO parameter.

[0091] The GEO parameters include the size information and angle index information of the current block, and the size information is the height and width of the current block. The current block includes many pixels. The encoder can determine the position information of the pixels in the current block based on the size information of the current block. Based on the position information, angle index information and updated angle mapping table of each pixel in the current block, the weight index corresponding to each pixel in the current block can be calculated.

[0092] The detailed acquisition process will be described in the subsequent embodiments.

[0093] S105. Perform embedding processing on the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the values ​​of the weight indexes corresponding to the pixels in the current block to the range of [0 to half of the preset value].

[0094] After the encoder obtains the pixel points in the current block, it takes the absolute value of the weight index corresponding to the pixel points in the current block and embeds the result in the range of [0 to half of the preset value] to obtain the absolute information of the weight index corresponding to each pixel point in the current block; wherein, when the absolute value of the weight index of a pixel point exceeds half of the preset value, the absolute information of the weight index corresponding to the pixel point is half of the preset value; when the absolute value of the weight index of a pixel point does not exceed half of the preset value, the absolute value of the weight index of the pixel point is its absolute information of the weight index.

[0095] In the embodiment of the present application, the preset value is 26, so the absolute information of the weight index is in the range of [0-13].

[0096] Exemplarily, using the implementation of the ternary operator, the absolute information of the weight index can be obtained by expression (1), which is as follows:

[0097] weightIdxAbs = Clip3(0, 13, abs(weightIdx)) (1)

[0098] Among them, weightIdxAbs is the absolute information of the weight index, weightIdx is the weight index, abs() is the absolute value function, and Clip3() is the embedding function.

[0099] S106. Determine a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block.

[0100] After the encoder obtains the absolute information of the weight index corresponding to the pixel points in the current block, it can first determine the weight value corresponding to the absolute information of the weight index based on the weight index corresponding to the pixel points in the current block and the absolute information of the weight index corresponding to the pixel points in the current block, and then determine the weight value of the first pixel point in the first partition and the weight value of the second pixel point in the second partition from the pixels in the current block based on the weight value corresponding to the absolute information of the weight index, and then determine the first weight value of the pixel points in the current block corresponding to the first partition based on the weight value of the first pixel point in the first partition and the weight value of the second pixel point in the second partition, and finally determine the second weight value of the pixel points in the current block corresponding to the second partition based on the first weight value.

[0101] It should be noted that in the embodiment of the present application, when the weight index corresponding to one of the pixels in the current block is less than or equal to 0, it indicates that the pixel belongs to the first partition; when the weight index corresponding to one of the pixels in the current block is greater than 0, it indicates that the pixel belongs to the second partition. The process of obtaining the first weight value of the pixel in the current block based on the first partition can be: obtaining the first weight index absolute information corresponding to the first pixel in the first partition and the second weight index absolute information corresponding to the second pixel in the second partition based on the absolute information of the weight index corresponding to the pixel in the current block; obtaining the weight value of the first pixel according to the absolute information of the first weight index, and obtaining the weight value of the second pixel according to the absolute information of the second weight index; based on the weight value of the first pixel and the weight value of the second pixel, the first weight value of the pixel in the current block corresponding to the first partition is obtained. The second weight value of the pixel in the current block is: 8-first weight value.

[0102] In an embodiment of the present application, the encoder determines the first weight value of the pixel in the current block and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block. The specific implementation may include the following five methods.

[0103] Method 1: When the absolute information of the weight index is less than the preset index threshold, the encoder shifts the absolute information of the weight index right by a preset position in combination with the first numerical value, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder shifts the absolute information of the weight index right by a preset position in combination with the second numerical value, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the encoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the encoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0104] In an embodiment of the present application, since the range of the absolute information of the weight index is within the range of [0-half of the preset value], the encoder can first calculate the weight values ​​corresponding to each absolute information of the weight index within the range of [0-half of the preset value] based on the absolute information of the weight index of the pixel points in the current block, specifically: when the absolute information of the weight index is less than the preset index threshold, the encoder shifts the absolute information of the weight index plus the first value right by a preset position, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder shifts the absolute information of the weight index combined with the second value right by a preset position, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index.

[0105] Exemplarily, using the implementation of the ternary operator, the weight value corresponding to the absolute information of the weight index can be obtained by expression (2), which is as follows:

[0106] WedgeFilter=weightIdxAbs<9? ((weightIdxAbs+2)>>2)+4:((weightIdxAbs+3)>>2)+4(2)

[0107] Among them, the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset position is 2, WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is a weight index absolute information.

[0108] It should be noted that the result after right shift in expression (2) only takes the integer part.

[0109] By adopting the piecewise mapping function, the weight value corresponding to the absolute information of the weight index can be obtained by expression (3), which is as follows:

[0110]

[0111] Among them, WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is the absolute information of a weight index.

[0112] When the preset value is 26, the weight index absolute information (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 13, then the weight values ​​of the weight index absolute information (WedgeFilter[weightIdxAbs]) calculated according to expression (2) or (3) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8 respectively.

[0113] It can be understood that the encoder uses a piecewise function to integrate the weight table lookup process into the GEO operation process, and directly and simply calculates the corresponding weight through the GEO weight index, eliminating the weight mapping table and table lookup operation, and actually implicitly achieves lossless reduction of the GEO weight table.

[0114] In an embodiment of the present application, the encoder obtains first weight index absolute information corresponding to the first pixel point in the first partition and second weight index absolute information corresponding to the second pixel point in the second partition based on the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; obtains the weight value of the first pixel point based on the first weight index absolute information, and obtains the weight value of the second pixel point based on the second weight index absolute information; and obtains the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value of the first pixel point and the weight value of the second pixel point.

[0115] Exemplarily, the first weight value of each pixel can be obtained by using expression (4), which is as follows:

[0116] sampleWeight = weightIdx <= 0? WedgeFilter : 8 – WedgeFilter (4)

[0117] Among them, sampleWeight is the weight value of a pixel, weightIdx is the weight index of the pixel, and WedgeFilter is the weight value corresponding to the absolute weight information of a pixel.

[0118] It can be seen from expression (4) that when the first partition is used as the main method to obtain the first weight value of the pixel points in the entire current block, it is necessary to determine the weight values ​​of each pixel point in the two partitions based on the two partitions, so as to obtain the first weight value of the pixel points in the current block. The second weight of the pixel points in the current block based on the second partition is obtained by subtracting the first weight value of the pixel points in the current block from 8.

[0119] Method 2: The encoder combines the absolute information of the weight index with the first value and determines whether the absolute information of the weight index is greater than 8, then right-shifts it by a preset position, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the encoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the encoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0120] In an embodiment of the present application, since the range of the absolute information of the weight index is within the range of [0-half of the preset value], the encoder can first calculate the weight values ​​corresponding to each absolute information of the weight index within the range of [0-half of the preset value] based on the absolute information of the weight index of the pixel points in the current block. Specifically, the encoder adds the first value to the absolute information of the weight index and determines whether the absolute information of the weight index is greater than 8, then right-shifts the information by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index.

[0121] Exemplarily, using the implementation of the ternary operator, the weight value corresponding to the absolute information of the weight index can be obtained by expression (5), which is as follows:

[0122] WedgeFilter= ((weightIdxAbs + 2+(weightIdxAbs >8))>>2)+4 (5)

[0123] Among them, the first value is 2; the preset weight value is 4; the preset position is 2, WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is a weight index absolute information.

[0124] It should be noted that the result after right shift in expression (3) only takes the integer part. When the absolute information of the weight index is greater than 8, the value is 1, and when it is less than or equal to 8, the value is 0.

[0125] When the preset value is 26, the weight index absolute information (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 13, then the weight values ​​of the weight index absolute information (WedgeFilter[weightIdxAbs]) calculated according to expression (5) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8 respectively.

[0126] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. The process is consistent with the implementation description of method one and will not be repeated here.

[0127] Method three: The encoder combines the weight index absolute information with the first numerical value and the value of 8-the sign of the weight index absolute information, then right-shifts it by a preset position, and finally adds the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel in the current block, determine the first weight value of the pixel in the current block corresponding to the first partition; according to the first weight value, obtain the second weight value of the pixel in the current block corresponding to the second partition.

[0128] In an embodiment of the present application, since the range of the absolute information of the weight index is within the range of [0-half of the preset value], the encoder can first calculate the weight values ​​corresponding to each absolute information of the weight index within the range of [0-half of the preset value] based on the absolute information of the weight index of the pixel points in the current block. Specifically, the encoder adds the first value and the value of 8-the sign of the absolute information of the weight index to the absolute information, and then right-shifts the information by the preset position, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index.

[0129] Exemplarily, using the implementation of the ternary operator, the weight value corresponding to the absolute information of the weight index can be obtained by expression (6), which is as follows:

[0130] WedgeFilter= ((weightIdxAbs + 2+sign(8-weightIdxAbs ))>>2)+4 (6)

[0131] Among them, the first value is 2; the preset weight value is 4; the preset bit is 2, WedgeFilter is the weight value corresponding to weightIdxAbs, weightIdxAbs is a weight index absolute information, sign() is the sign function, when 8-weightIdxAbs<0, the value is 1, when 8-weightIdxAbs is greater than or equal to 0, the value is 0.

[0132] When the preset value is 26, the weight index absolute information (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 and 13, then the weight values ​​of the weight index absolute information (WedgeFilter[weightIdxAbs]) calculated according to expression (5) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8 respectively.

[0133] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. The process is consistent with the implementation description of method one and will not be repeated here.

[0134] Furthermore, in order to achieve a calculation result similar to that of expression (6), expression (7) or expression (8) may also be used, which is not limited in the present embodiment. As follows:

[0135] WedgeFilter= ((weightIdxAbs + 2))>>2)+4 (7)

[0136] WedgeFilter= ((weightIdxAbs + 1))>>2)+4 (8)

[0137] Method 4: The encoder searches for the weight value corresponding to the absolute information of the weight index from a preset weight mapping table based on the absolute information of the weight index; wherein the preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block within half of the preset values; the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the encoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.

[0138] In an embodiment of the present application, the encoder can obtain the weight value of the absolute information of the weight index from 0 to half of the preset value based on any one of methods one to three, as a preset weight mapping table. When the encoder obtains the absolute information of the weight index of the pixel points in the current block, the weight value corresponding to each pixel point can be found from the preset weight mapping table.

[0139] Exemplarily, the preset weight mapping table is shown in Table 2.

[0140] Table 2

[0141]

[0142] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. The process is consistent with the implementation description of method one and will not be repeated here.

[0143] Method 5: When the absolute information of the weight index is less than the preset index threshold, the encoder shifts the absolute information of the weight index right by a preset position in combination with the first numerical value to obtain a new weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder shifts the absolute information of the weight index right by a preset position in combination with the second numerical value to obtain a new weight index; the encoder obtains the new weight value corresponding to the new weight index from the preset new weight mapping table; when the weight index information is less than or equal to 0, the encoder determines the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, the encoder determines 8-the new weight value as the weight value corresponding to the absolute information of the weight index; the encoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the encoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0144] In an embodiment of the present application, a preset new weight mapping table is set to indicate the correspondence between weight values ​​and weight index information, wherein the weight values ​​have no repeated values, the weight index information belongs to [0-half of the preset value], and the number of specific weight index information is consistent with the number of weight values, as shown in Table 3.

[0145] Table 3

[0146] ReduceIdx 0 1 2 3 4 WedgeFilter[ReduceIdx] 4 5 6 7 8

[0147] Among them, ReduceIdx is the weight index information, and WedgeFilter[ReduceIdx] is the weight value.

[0148] When the encoder obtains the absolute information of the weight index of the pixel in the current block, when the absolute information of the weight index is less than the preset index threshold, the encoder adds the absolute information of the weight index to the first value and shifts it right by the preset position to obtain a new weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder adds the absolute information of the weight index to the second value and shifts it right by the preset position to obtain a new weight index.

[0149] Exemplarily, using the implementation of the ternary operator, the new weight index can be obtained by expression (9), which is as follows:

[0150] ReduceIdx=WeightIdxabs<9? ((WeightIdxabs+2)>>2):((WeightIdxabs+3)>>2)(9)

[0151] Among them, ReduceIdx is the new weight index, WeightIdxabs is the absolute information of the weight index of a pixel, the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; and the preset position is 2.

[0152] It should be noted that the result after right shift in expression (9) only takes the integer part.

[0153] By adopting the piecewise mapping function, the new weight index can also be obtained by expression (10), which is as follows:

[0154]

[0155] In an embodiment of the present application, the encoder can obtain the weight value corresponding to the absolute information of the weight index of each pixel point in the current block from the preset new weight mapping table, that is, the new weight value WedgeFilter[ReduceIdx] corresponding to the new weight index. When the weight index information of each pixel point is less than or equal to 0, the encoder will determine the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, the encoder will determine 8-the new weight value as the weight value corresponding to the absolute information of the weight index.

[0156] In an embodiment of the present application, the encoder obtains first weight index absolute information corresponding to the first pixel point in the first partition and second weight index absolute information corresponding to the second pixel point in the second partition based on the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; obtains the weight value of the first pixel point based on the first weight index absolute information, and obtains the weight value of the second pixel point based on the second weight index absolute information; and obtains the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value of the first pixel point and the weight value of the second pixel point.

[0157] Exemplarily, the first weight value of each pixel can be obtained by using expression (11), where:

[0158] as follows:

[0159] sampleWeight=weightIdx<=0? WedgeFilter[ReduceIdx]:8-WedgeFilter[ReduceIdx](11)

[0160] Among them, sampleWeight is the weight value of a pixel, weightIdx is the weight index of the pixel, and WedgeFilter[ReduceIdx] is the new weight value corresponding to the absolute weight information of a pixel.

[0161] It can be understood that the encoder simplifies the GEO weight mapping table and uses a feasible mathematical formula to derive the GEO weight during the calculation process. While eliminating the weight mapping table and table lookup operations, it also implicitly achieves a reduction in the original weight mapping table, further simplifying the code and text, and reducing the storage overhead of the weight mapping table.

[0162] S107 . Perform weighted fusion of pixels in the current block using the first prediction value, the first weight value, the second prediction value, and the second weight value to obtain an inter-frame prediction value of the current block.

[0163] In an embodiment of the present application, the encoder can complete the weighted fusion of the pixels in the current block by multiplying the first prediction value of each pixel by the first weight value, plus the product of the corresponding second prediction value of each pixel and the second weight value, to obtain the inter-frame prediction value of the current block.

[0164] It should be noted that the first prediction value and the second prediction value are two prediction values ​​corresponding to each pixel in the current block, and the first weight value and the second weight value also correspond to two different weight values ​​of each pixel in the current block.

[0165] The inter-frame prediction value of the current block can be obtained by using expression (23), as shown below:

[0166] pbSamples[x][y]=Clip3(0,(1< <bitDepth)-1,(predSamplesLPART1[x][y]*(8-

[0167] sampleWeight1)+predSamplesLPART2[x][y]*sampleWeight2+offset1)>>shift1)(23)

[0168] Among them, pbSamples[x][y] is the inter-frame prediction value of each pixel of the current block, predSamplesLPART1[x][y] is the first prediction value of each pixel, sampleWeight1 is the first weight value of each pixel, predSamplesLPART2[x][y] is the second prediction value of each pixel, and sampleWeight2 is the second weight value of each pixel.

[0169] In some embodiments of the present application, when the encoder performs inter-frame prediction of the current block, it predicts the video components separately, that is, the first prediction value and the second prediction value both include a luminance prediction value and a chrominance prediction value.

[0170] In an embodiment of the present application, the encoder may first obtain the weight value of the luminance component, and the weight value of the chrominance component may be obtained based on the weight value of the luminance component.

[0171] The first weight and the second weight value mentioned above in the present application may be the weight value of the brightness component.

[0172] It should be noted that the encoder obtains the luminance sample weight at the upper right corner of each 2*2 block and directly uses it as the chrominance sample weight at the current (x, y), that is, downsampling the luminance sample weight.

[0173] For example, Figure 6a The first weight of brightness is shown, which is downsampled to obtain Figure 6b The first weight value of the chrominance shown can be downsampled according to the second weight of the luminance. The second weight of the luminance sample in the upper right corner of each 2*2 block can be directly used as the second weight of the chrominance sample at the current (x, y).

[0174] It can be understood that, during the inter-frame prediction process, the encoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter, and then embed the value of the weight index corresponding to the pixel point in the current block to the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, and therefore, the storage and use of the weight value corresponding to the absolute information of the weight index is reduced by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage.

[0175] In some embodiments of the present application, Figure 7 As shown, the GEO parameters of the current block include: angle index information and size information of the current block. The implementation of S104 in an inter-frame prediction method provided in an embodiment of the present application may include:

[0176] S1041, determining position information of pixels in the current block according to size information of the current block;

[0177] S1042: Determine a weight index corresponding to a pixel point in the current block according to the angle index information and the preset angle mapping table in combination with position information of the pixel point in the current block.

[0178] In the embodiment of the present application, the size information of the current block of the encoder includes the height H of the current block and the width W of the current block, so that the coordinate area where the current block is located can be determined, and then the position information of each pixel in the current block can be determined, that is, the coordinate information (x, y) of each pixel. The encoder can determine the weight index corresponding to the pixel in the current block according to the angle index information, the preset angle mapping table, and the position information of the pixel in the current block.

[0179] In some embodiments of the present application, the encoder can determine the weight index corresponding to the pixel point in the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel point in the current block. The implementation process is as follows: the encoder determines the cosine angle index information and the sine angle index information based on the angle index information; the encoder reduces the angle of the preset angle mapping table to a power to obtain an updated angle mapping table; the encoder determines the weight index corresponding to the pixel point in the current block based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, respectively, in combination with the position information of the pixel point in the current block.

[0180] It should be noted that the preset angle mapping table is an angle mapping table used in the prior art, as shown in Table 4:

[0181] Table 4

[0182]

[0183] Among them, angleIdx is the angle index information, and Dis[angleIdx] is the angle.

[0184] In the embodiment of the present application, the encoder performs power reduction processing on the angles in the preset angle mapping table, and the angles in the updated angle mapping table are all angle values ​​in the preset angle mapping table reduced by one power. As shown in Table 5:

[0185] Table 5

[0186]

[0187]

[0188] The encoder deletes the original preset angle mapping table and only keeps the updated angle mapping table, which can reduce storage overhead.

[0189] In an embodiment of the present application, the encoder determines the weight index corresponding to the pixel point in the current block according to the cosine angle index information, the sine angle index information, the update angle mapping table, and the position information of the pixel point in the current block. In the implementation process, the encoder needs to first determine the vertical distance rho from the block center point to the current dividing line according to the cosine angle index information and the sine angle index information, and then determine the weight index of each pixel point according to the cosine angle index information, the sine angle index information, the update angle mapping table, the position information of the pixel point in the current block, and rho.

[0190] Exemplarily, the cosine angle index information can be obtained according to expression (12), and the sine angle index information can be obtained according to expression (13). Expressions (12) and (13) are as follows:

[0191] displacementX= angleIdx (12)

[0192] displacementY=(displacementX + 6)%24 (13)

[0193] Among them, displacementX is the cosine angle index information, displacementY is the sine angle index information; angleIdx is the angle index information.

[0194] It should be noted that the cos(α) index number corresponding to the current angle is displacementX, and the corresponding -sin(α) index number is displacementY.

[0195] The acquisition of rho can be obtained according to expression (14), which is as follows:

[0196] rho=(Dis [displacementX]<< 8) + (Dis[displacementY] << 8) (14)

[0197] Among them, Dis[displacementX] is the cosine angle (first angle) corresponding to the cosine angle index information, and Dis[displacementY is the sine angle (second angle) corresponding to the sine angle index information, wherein the cosine angle and the sine angle can be obtained according to the updated mapping table.

[0198] The weight index of each pixel of the current block can be obtained by expression (15), which is as follows:

[0199] weightIdx=((x<<1)+1)*Dis[displacementX]

[0200] + ((y<<1) + 1))*Dis[displacementY] - rho (15)

[0201] Among them, weightIdx is the weight index of a pixel point, x is the horizontal coordinate value of a pixel point, and y is the vertical coordinate value of the pixel point. The position information of a pixel point is (x, y).

[0202] It can be understood that by looking up the corresponding weight in the weight mapping table through the obtained index, it can be found that each step of the above calculation needs to be multiplied by the angles Dis[displacementX] and Dis[displacementY]. This solution is to remove the weight mapping table and design a mathematical method to implicitly reduce the weight mapping table by half. Therefore, it is necessary to divide by 2 at each step in calculating the weight index and motion index. However, since the values ​​in the angle mapping table are all powers of 2, the angle mapping table can be reduced to a power to achieve the operation of dividing the weight index and motion index by 2, and correspond to the reduced weight mapping table.

[0203] In some embodiments of the present application, after S107 of an inter-frame prediction method provided in an embodiment of the present application, the method may further include:

[0204] S108. Determine the motion offset value according to the cosine angle index information, the sine angle index information, and the updated angle mapping table, and obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information, and the size information of the current block.

[0205] S109. Obtain motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information.

[0206] S110. When the absolute value of the motion index information is less than half of a preset motion index threshold, determine the first motion information and the second motion information as motion information of the current block.

[0207] S111. When the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block.

[0208] S112: When the motion index information is greater than 0, determine the second motion information as the motion information of the current block.

[0209] S113. Store the motion information of the current block in a preset merge candidate list.

[0210] In an embodiment of the present application, when the encoder encodes the current block, it is also necessary to store the motion information of the encoding of the current block for use in inter-frame prediction of subsequent encoding blocks. The encoder calculates the first angle and the second angle based on the cosine angle index information, the sine angle index information, and the update angle mapping table, and then obtains the motion offset value based on the first angle and the second angle; the encoder obtains the motion index information based on the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point in the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of the preset motion index threshold, the encoder determines the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, the encoder determines the first motion information as the motion information of the current block; when the motion index information is greater than 0, the encoder determines the second motion information as the motion information of the current block; the motion information of the current block is stored in the preset merge candidate list.

[0211] Exemplarily, the motion offset value motionOffset can be obtained by using expression (16), which is as follows:

[0212] motionOffset = 3*Dis[displacementX]+ 3*Dis[displacementY] (16)

[0213] In the embodiment of the present application, since the GEO parameter also includes step index information, the encoder can obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block. When shiftHor==0, it can be implemented by using expressions (17) and (18). Expressions (17) and (18) are as follows:

[0214] offsetX = ( 64 - numSbX ) >> 1 (17)

[0215] offsetY=(64-numSbY)>>1+angleIdx<12? (distanceIdx*nCbH)>>3:-((distanceIdx*nCbH)>>3)(18)

[0216] Among them, offsetX is the motion horizontal coordinate offset value, offsetY is the motion vertical coordinate offset value, angleIdx is the angle index information, distanceIdx is the step index information, numSbX is the width of the motion mask matrix of the current block, numSbY is the height of the motion mask matrix of the current block, and nCbW and nCbH represent the width and height of the current block.

[0217] In the embodiment of the present application, since the GEO parameter also includes step index information, the encoder can obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block. When shiftHor==1, it can be implemented by using expressions (19) and (20). Expressions (19) and (20) are as follows:

[0218] offsetX=(64-numSbX)>>1+angleIdx<12? (distanceIdx*nCbW)>>3:-((distanceIdx *

[0219] nCbW) >> 3) (19)

[0220] offsetY = ( 64 - numSbY ) >> 1 (20)

[0221] Among them, offsetX is the motion horizontal coordinate offset value, offsetY is the motion vertical coordinate offset value, angleIdx is the angle index information, distanceIdx is the step index information, numSbX is the width of the motion mask matrix of the current block, numSbY is the height of the motion mask matrix of the current block, and nCbW and nCbH represent the width and height of the current block.

[0222] Exemplarily, in the embodiment of the present application, the encoder obtains the motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information. The implementation can be obtained by expression (21), and the expression (21) is as follows:

[0223] motionIdx=(((xSbIdx+offsetX)<<3)+1)*Dis[displacementX]+(((ySbIdx+offsetY<<3)+1))*Dis[displacementY]-rho+motionOffset(21)

[0224] Among them, motionIdx is the motion index information, the position information of the pixel point in the upper left corner of the current block (xSbIdx, ySbIdx), offsetX is the motion horizontal coordinate offset value, offsetY is the motion vertical coordinate offset value, Dis[displacementX] is the first angle, Dis[displacementY] is the second angle, rho is also the vertical distance from the block center point to the current dividing line obtained according to the first angle and the second angle, and motionOffset is the motion offset value.

[0225] It should be noted that ShiftHor is a horizontal offset. If its value is 0, more offset is required on the Y axis. If its value is 1, more offset is required on the X axis.

[0226] If (angleIdx%12==6)||(angleIdx%12!=0&&hwRatio≥1), ShiftHor=0;

[0227] Otherwise, ShiftHor=1.

[0228] In some embodiments of the present application, the encoder may determine the motion information of the current block from the first motion information and the second motion information according to the current motion mask matrix and store the information in a preset merge candidate list.

[0229] In some embodiments of the present application, the encoder may also determine the motion information of the current block according to the motion index information. When the absolute value of the motion index information is less than half of the preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block; when the motion index information is less than or equal to 0, the first motion information is determined as the motion information of the current block; when the motion index information is greater than 0, the second motion information is determined as the motion information of the current block; and the motion information of the current block is stored in the preset merge candidate list.

[0230] Assuming that the current block is 16×16, the encoder determines whether the current sub-block stores unidirectional or bidirectional data based on the size of abs(motionIdx) at each 4×4 sub-block.

[0231] Exemplarily, if abs(motionIdx)<16, the current block stores constructed bidirectional motion information, namely, the first motion information and the second motion information;

[0232] If (motionIdx)<=0, the current block stores the first motion information of the first partition;

[0233] If (motionIdx)>0, the current block stores the second motion information of the second partition.

[0234] The preset motion index threshold is 32.

[0235] It should be noted that in the embodiment of the present application, the encoder can first obtain the motion mask matrix, and then cut the current motion mask matrix of the current block from the preset motion mask matrix according to the motion horizontal coordinate offset value and the motion vertical coordinate offset value.

[0236] For example, Figure 8 The preset motion mask matrix 1 shown can be used to cut out different current motion mask matrices 2, 3 and 4 from 1 using the size A of the current block based on different division modes, angles ψ, step sizes ρ, offsetX and offsetY.

[0237] It should be noted that since GEO inherits the way TPM stores motion information, the storage of motion information in the GEO mode is still stored in units of 4×4 blocks, so the size of the motion mask matrix predefined by GEO is 56*56, and the motion information of each 4×4 block is determined by the weighted weight at the point in its upper left corner. Finally, the calculated motion masks of all 4×4 blocks are stored in a 56×56 matrix. Specifically, the encoder obtains the motion offset value motionOffset through expression (16), and obtains all motion index information motionIdx1 based on the position information (x, y) of each pixel point in 56×56, motionOffset, rho, the first angle and the second angle. As shown in expression (22):

[0238] motionIdx1=((x<<3)+1)*Dis[displacementX]+((y<<3+1))*Dis[displacementY]-rho+motionOffset(22)

[0239] The mask corresponding to the motion information in the 56×56 preset motion mask matrix is ​​determined based on abs(motionIdx1) and motionIdx1.

[0240] Exemplarily, if abs(motionIdx)<16, the motion mask of the current 4×4 sub-block is 2 (representing bidirectional motion information);

[0241] otherwise,

[0242] If (motionIdx)<=0, the motion mask of the current 4×4 sub-block is 0 (representing the first motion information);

[0243] If (motionIdx)>0, the motion mask of the current 4×4 sub-block is 1 (representing the second motion information).

[0244] It should be noted that, in the embodiment of the present application, there are actually a total of 7 pre-stored mask matrices (including weighted weight mask matrices and motion mask matrices), corresponding to the first step length of 7 angles between 0-90 passing through the block center point. The pre-stored mask matrices of the remaining angles are obtained by mirroring these seven matrices in the horizontal or vertical direction to reduce storage space.

[0245] It can be understood that after the inter-frame prediction method provided in the embodiment of the present application is implemented on the VVC reference software VTM7.0_common_base based on GEO, the test sequence required by JVET is tested under the condition of Random Access. There is no change in the BD-rate on the Y, Cb, and Cr components (consistent with the Anchor performance). This data shows that the simplified scheme will not have any impact on the encoding performance, and reduces the storage of the weight table, and simplifies the implementation of text descriptions and codes. In terms of time complexity, since the GEO predefined weight matrix is ​​calculated only once for each sequence before the start of encoding and decoding, the operation of the ternary operator brought by this scheme will not affect the overall encoding and decoding time complexity. It can be said that the time complexity remains basically unchanged.

[0246] The embodiment of the present application provides an inter-frame prediction method, which is applied to a video decoding device, i.e., a decoder. The function implemented by the method can be implemented by calling a program code by a processor in the video decoding device, and of course the program code can be stored in a computer storage medium. It can be seen that the video encoding device at least includes a processor and a storage medium.

[0247] Fig. 9 FIG. 1 is a schematic diagram of an implementation flow of an intra-frame prediction method according to an embodiment of the present application. Fig. 9 As shown, the method includes:

[0248] S201, parsing a bit stream to determine prediction mode parameters of a current block.

[0249] S202: When the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode GEO is used to determine the inter-frame prediction of the current block, parse the bitstream to determine the GEO parameters of the current block.

[0250] S203 . Determine, according to the GEO parameter, a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block.

[0251] S204: Determine the weight index corresponding to the pixel point in the current block according to the GEO parameter.

[0252] S205. Perform embedding processing on the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the values ​​of the weight indexes corresponding to the pixels in the current block to the range of [0 to half of the preset value].

[0253] S206 . Determine a first weight value of the pixel in the current block and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block.

[0254] S207 . Determine a weighted fusion of pixels in the current block using the first prediction value, the first weight value, the second prediction value, and the second weight value to obtain an inter-frame prediction value of the current block.

[0255] In some embodiments of the present application, the specific implementation of the decoder determining the first weight value of the pixel in the current block and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block may include the following five methods.

[0256] Method 1: When the absolute information of the weight index is less than the preset index threshold, the decoder shifts the absolute information of the weight index right by a preset position in combination with the first numerical value, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder shifts the absolute information of the weight index right by a preset position in combination with the second numerical value, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the decoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the decoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0257] Method 2: The decoder combines the absolute information of the weight index with the first value and determines whether the absolute information of the weight index is greater than 8, then right-shifts it by a preset position, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the decoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the decoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0258] Method three: The decoder combines the absolute information of the weight index with the first numerical value and the value of the sign of the absolute information of the weight index, and then right-shifts it by a preset position, and finally adds the preset weight numerical value to obtain the weight value corresponding to the absolute information of the weight index; according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; according to the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.

[0259] Method 4: The decoder searches for the weight value corresponding to the absolute information of the weight index from the preset weight mapping table according to the absolute information of the weight index; wherein the preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block within half of the preset values; the decoder determines the first weight value of the pixel in the current block corresponding to the first partition according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the decoder obtains the second weight value of the pixel in the current block corresponding to the second partition according to the first weight value.

[0260] Method 5: When the absolute information of the weight index is less than the preset index threshold, the decoder performs a preset right shift on the absolute information of the weight index in combination with the first numerical value to obtain a new weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder performs a preset right shift on the absolute information of the weight index in combination with the second numerical value to obtain a new weight index; the decoder obtains the new weight value corresponding to the new weight index from the preset new weight mapping table; when the weight index information is less than or equal to 0, the decoder determines the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, the decoder determines 8-the new weight value as the weight value corresponding to the absolute information of the weight index; the decoder determines the first weight value of the pixel point in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; the decoder obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value.

[0261] In an embodiment of the present application, the decoder parses the angle index information corresponding to the current block, the first motion information of the first reference block corresponding to the first partition, the second motion information and the step index information of the second reference block corresponding to the second partition from the bit stream; and performs motion compensation according to the first motion information and the second motion information, respectively, to obtain the first unidirectional prediction value corresponding to the first partition and the second unidirectional prediction value corresponding to the second partition.

[0262] Among them, the preset value is 26; the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; and the preset position is 2.

[0263] In the embodiment of the present application, the implementation of S201-S207 of the decoder is basically the same as the process of implementing S101-S107 on the encoder side, which will not be repeated here.

[0264] The difference is that the prediction mode parameters and GEO parameters of the current block on the decoder side are parsed from the bitstream, while the encoder obtains them by itself.

[0265] It can be understood that, during the inter-frame prediction process, the decoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter, and then embed the value of the weight index corresponding to the pixel point in the current block to the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, and therefore, the storage and use of the weight value corresponding to the absolute information of the weight index is reduced by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage.

[0266] In some embodiments of the present application, the GEO parameters of the current block include: angle index information and size information of the current block; the implementation of S204 in an inter-frame prediction method provided in an embodiment of the present application may include:

[0267] S2041. Determine position information of pixels in the current block according to size information of the current block.

[0268] S2042: Determine a weight index corresponding to a pixel point in the current block according to the angle index information and the preset angle mapping table in combination with the position information of the pixel point in the current block.

[0269] In some embodiments of the present application, the decoder can determine the cosine angle index information and the sine angle index information based on the angle index information; reduce the angle of the preset angle mapping table to a power to obtain an updated angle mapping table; determine the weight index corresponding to the pixel point in the current block based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, respectively in combination with the position information of the pixel point in the current block.

[0270] In the embodiment of the present application, the implementation of S2041-S2042 of the decoder is basically consistent with S1041-S1042 of the implementation process on the encoder side, and will not be repeated here.

[0271] It can be understood that by looking up the corresponding weight in the weight mapping table through the obtained index, it can be found that each step of the above calculation needs to be multiplied by the angles Dis[displacementX] and Dis[displacementY]. This solution is to remove the weight mapping table and design a mathematical method to implicitly reduce the weight mapping table by half. Therefore, it is necessary to divide by 2 at each step in calculating the weight index and motion index. However, since the values ​​in the angle mapping table are all powers of 2, the angle mapping table can be reduced to a power to achieve the operation of dividing the weight index and motion index by 2, and correspond to the reduced weight mapping table.

[0272] S208, determining a motion offset value according to the cosine angle index information, the sine angle index information, and the updated angle mapping table, and obtaining a motion horizontal coordinate offset value and a motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information, and the size information of the current block;

[0273] S209, obtaining motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information;

[0274] S210, when the absolute value of the motion index information is less than half of the preset motion index threshold, determining the first motion information and the second motion information as the motion information of the current block;

[0275] S211. When the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block;

[0276] S212: When the motion index information is greater than 0, determine the second motion information as the motion information of the current block;

[0277] S213. Store the motion information of the current block in a preset merge candidate list.

[0278] In the embodiment of the present application, the implementation of S208-S213 of the decoder is basically the same as the process of implementing S108-S113 on the encoder side, which will not be repeated here.

[0279] The preset motion index threshold is 32.

[0280] It can be understood that after the inter-frame prediction method provided in the embodiment of the present application is implemented on the VVC reference software VTM7.0_common_base based on GEO, the test sequence required by JVET is tested under the condition of Random Access. There is no change in the BD-rate on the Y, Cb, and Cr components (consistent with the Anchor performance). This data shows that the simplified scheme will not have any impact on the encoding performance, and reduces the storage of the weight table, and simplifies the implementation of text descriptions and codes. In terms of time complexity, since the GEO predefined weight matrix is ​​calculated only once for each sequence before the start of encoding and decoding, the operation of the ternary operator brought by this scheme will not affect the overall encoding and decoding time complexity. It can be said that the time complexity remains basically unchanged.

[0281] like Fig.10 As shown, an embodiment of the present application provides an encoder 1, comprising:

[0282] The first determination unit 10 is used to determine the prediction mode parameters of the current block; when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partition prediction mode GEO, determine the GEO parameters of the current block; determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GEO parameters; determine the weight index corresponding to the pixel point in the current block according to the GEO parameters;

[0283] The first embedding unit 11 is used to embed the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding process embeds the value of the weight index corresponding to the pixel in the current block to a range of [0 to half of a preset value];

[0284] The first determination unit 10 is further configured to determine a first weight value of a pixel in the current block and a second weight value of a pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0285] The first prediction unit 12 is used to perform weighted fusion of pixels in the current block using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain an inter-frame prediction value of the current block.

[0286] In some embodiments of the present application, the GEO parameters of the current block include: angle index information and size information of the current block;

[0287] The first determination unit 10 is also used to determine the position information of the pixel points in the current block according to the size information of the current block; and determine the weight index corresponding to the pixel points in the current block according to the angle index information and the preset angle mapping table, respectively in combination with the position information of the pixel points in the current block.

[0288] In some embodiments of the present application, the first determination unit 10 is further used to determine cosine angle index information and sine angle index information based on the angle index information; reduce the angle of the preset angle mapping table to a power to obtain the updated angle mapping table; and determine the weight index corresponding to the pixel point in the current block based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, respectively in combination with the position information of the pixel point in the current block.

[0289] In some embodiments of the present application, the first determination unit 10 is also used to, when the weight index absolute information is less than a preset index threshold, perform right shifting of the weight index absolute information in combination with a first numerical value by a preset position, and then add a preset weight value to obtain a weight value corresponding to the weight index absolute information; when the weight index absolute information is greater than or equal to the preset index threshold, perform right shifting of the weight index absolute information in combination with a second numerical value by a preset position, and then add a preset weight value to obtain a weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0290] In some embodiments of the present application, the first determination unit 10 is further used to combine the weight index absolute information with a first numerical value and determine whether the weight index absolute information is greater than 8, then right shift by a preset position, and finally add a preset weight numerical value to obtain a weight value corresponding to the weight index absolute information; determine a first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain a second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0291] In some embodiments of the present application, the first determination unit 10 is also used to combine the weight index absolute information with the first numerical value, 8-the value of the sign of the weight index absolute information, and then right-shift it by a preset position, and finally add the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0292] In some embodiments of the present application, the first determination unit 10 is also used to find out the weight value corresponding to the absolute information of the weight index from a preset weight mapping table according to the absolute information of the weight index; wherein the preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block within half of the preset values; according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; according to the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.

[0293] In some embodiments of the present application, the first determination unit 10 is also used to, when the weight index absolute information is less than a preset index threshold, perform a preset right shift on the weight index absolute information in combination with a first numerical value to obtain new weight index information; when the weight index absolute information is greater than or equal to the preset index threshold, perform a preset right shift on the weight index absolute information in combination with a second numerical value to obtain new weight index information; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; when the weight index information is less than or equal to 0, determine the new weight value as the weight value corresponding to the weight index absolute information; when the weight index information is greater than 0, determine 8-the new weight value as the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0294] In some embodiments of the present application, the encoder 1 further includes: a writing unit 13 and a first storage unit 14 (neither shown in the figure);

[0295] The writing unit 13 is configured to write the angle index information into a bitstream after performing weighted fusion of pixels in the current block using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain an inter-frame prediction value of the current block;

[0296] The first determination unit 10 is further used to determine the motion offset value according to the cosine angle index information, the sine angle index information, and the update angle mapping table, and obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information, and the size information of the current block; obtain the motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of a preset motion index threshold, determine the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; when the motion index information is greater than 0, determine the second motion information as the motion information of the current block;

[0297] The first storage unit 14 is configured to store the motion information of the current block in a preset merging candidate list.

[0298] In some embodiments of the present application, the preset numerical value is 26; the preset index threshold is 9; the first numerical value is 2; the second numerical value is 3; the preset weight numerical value is 4; the preset position is 2; and the preset motion index threshold is 32.

[0299] In practical applications, such as Fig.11 As shown, the embodiment of the present application also provides an encoder, including:

[0300] A first memory 15 and a first processor 16;

[0301] The first memory 15 stores a computer program that can be run on the first processor 16 , and the first processor 16 executes the program to implement an inter-frame prediction method on the encoder side.

[0302] It can be understood that, during the inter-frame prediction process, the encoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter, and then embed the value of the weight index corresponding to the pixel point in the current block to the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, and therefore, the storage and use of the weight value corresponding to the absolute information of the weight index is reduced by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage.

[0303] like Fig.12 As shown, the embodiment of the present application provides a decoder 2, including:

[0304] A parsing unit 20, used to parse the bitstream and determine the prediction mode parameters of the current block;

[0305] The second determination unit 21 is configured to parse the bitstream and determine the GEO parameters of the current block when the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode GEO is used to determine the inter-frame prediction of the current block; determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GEO parameters; and determine the weight index corresponding to the pixel point in the current block according to the GEO parameters;

[0306] The second embedding unit 22 is used to embed the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding process embeds the value of the weight index corresponding to the pixel in the current block to a range of [0 to half of a preset value];

[0307] The second determining unit 21 is further configured to determine a first weight value of a pixel in the current block and a second weight value of a pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0308] The second prediction unit 23 is used to determine the weighted fusion of the pixels in the current block by using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain the inter-frame prediction value of the current block.

[0309] In some embodiments of the present application, the GEO parameters of the current block include: angle index information and size information of the current block;

[0310] The second determination unit 21 is also used to determine the position information of the pixel points in the current block according to the size information of the current block; and determine the weight index corresponding to the pixel points in the current block according to the angle index information and the preset angle mapping table, respectively in combination with the position information of the pixel points in the current block.

[0311] In some embodiments of the present application, the second determination unit 21 is further used to determine cosine angle index information and sine angle index information based on the angle index information; reduce the angle of the preset angle mapping table to a power to obtain the updated angle mapping table; and determine the weight index corresponding to the pixel point in the current block based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, respectively in combination with the position information of the pixel point in the current block.

[0312] In some embodiments of the present application, the second determination unit 21 is also used for, when the weight index absolute information is less than a preset index threshold, shifting the weight index absolute information in combination with the first numerical value right by a preset position, and then adding a preset weight value to obtain a weight value corresponding to the weight index absolute information; when the weight index absolute information is greater than or equal to the preset index threshold, shifting the weight index absolute information in combination with the second numerical value right by a preset position, and then adding a preset weight value to obtain a weight value corresponding to the weight index absolute information; determining the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtaining the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0313] In some embodiments of the present application, the second determination unit 21 is further used to combine the weight index absolute information with the first numerical value, determine whether the weight index absolute information is greater than 8, and then right-shift by a preset position, and finally add the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0314] In some embodiments of the present application, the second determination unit 21 is also used to combine the weight index absolute information with the first numerical value, 8-the value of the sign of the weight index absolute information, and then right-shift it by a preset position, and finally add the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0315] In some embodiments of the present application, the second determination unit 21 is also used to search for the weight value corresponding to the absolute information of the weight index from a preset weight mapping table according to the absolute information of the weight index; wherein the preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block within half of the preset values; according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; according to the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.

[0316] In some embodiments of the present application, the second determination unit 21 is also used to, when the weight index absolute information is less than a preset index threshold, perform a preset right shift on the weight index absolute information in combination with a first numerical value to obtain new weight index information; when the weight index absolute information is greater than or equal to the preset index threshold, perform a preset right shift on the weight index absolute information in combination with a second numerical value to obtain new weight index information; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; when the weight index information is less than or equal to 0, determine the new weight value as the weight value corresponding to the weight index absolute information; when the weight index information is greater than 0, determine 8-the new weight value as the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0317] In some embodiments of the present application, the decoder 2 further includes a second storage unit 24 (not shown in the figure);

[0318] The second determination unit 21 is further configured to perform weighted fusion of each pixel point by using the first unidirectional prediction value, the first weight value, the second unidirectional prediction value and the second weight value to obtain the prediction value of the current block, determine the motion offset value according to the cosine angle index information, the sine angle index information and the update angle mapping table, and obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block; obtain the motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of the preset motion index threshold, determine the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; when the motion index information is greater than 0, determine the second motion information as the motion information of the current block;

[0319] The second storage unit 24 is configured to store the motion information of the current block in a preset merging candidate list.

[0320] In some embodiments of the present application, the preset value is 26; the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset position is 2; and the preset motion index threshold is 32.

[0321] In practical applications, such as Fig.11 As shown, the embodiment of the present application also provides an encoder, including:

[0322] A first memory 15 and a first processor 16;

[0323] The first memory 15 stores a computer program that can be run on the first processor 16 , and the first processor 16 executes the program to implement an inter-frame prediction method on the encoder side.

[0324] It can be understood that, during the inter-frame prediction process, the encoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter, and then embed the value of the weight index corresponding to the pixel point in the current block to the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, and therefore, the storage and use of the weight value corresponding to the absolute information of the weight index is reduced by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage.

[0325] like Fig.12As shown, the embodiment of the present application provides a decoder 2, including:

[0326] A parsing unit 20, used to parse the bitstream and determine the prediction mode parameters of the current block;

[0327] The second determination unit 21 is configured to parse the bitstream and determine the GEO parameters of the current block when the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode GEO is used to determine the inter-frame prediction of the current block; determine the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block according to the GEO parameters; and determine the weight index corresponding to the pixel point in the current block according to the GEO parameters;

[0328] The second embedding unit 22 is used to embed the weight indexes corresponding to the pixels in the current block to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein the embedding process embeds the value of the weight index corresponding to the pixel in the current block to a range of [0 to half of a preset value];

[0329] The second determining unit 21 is further configured to determine a first weight value of a pixel in the current block and a second weight value of a pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block;

[0330] The second prediction unit 23 is used to determine the weighted fusion of the pixels in the current block by using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain the inter-frame prediction value of the current block.

[0331] In some embodiments of the present application, the GEO parameters of the current block include: angle index information and size information of the current block;

[0332] The second determination unit 21 is also used to determine the position information of the pixel points in the current block according to the size information of the current block; and determine the weight index corresponding to the pixel points in the current block according to the angle index information and the preset angle mapping table, respectively in combination with the position information of the pixel points in the current block.

[0333] In some embodiments of the present application, the second determination unit 21 is further used to determine cosine angle index information and sine angle index information based on the angle index information; reduce the angle of the preset angle mapping table to a power to obtain the updated angle mapping table; and determine the weight index corresponding to the pixel point in the current block based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, respectively in combination with the position information of the pixel point in the current block.

[0334] In some embodiments of the present application, the second determination unit 21 is also used for, when the weight index absolute information is less than a preset index threshold, shifting the weight index absolute information in combination with the first numerical value right by a preset position, and then adding a preset weight value to obtain a weight value corresponding to the weight index absolute information; when the weight index absolute information is greater than or equal to the preset index threshold, shifting the weight index absolute information in combination with the second numerical value right by a preset position, and then adding a preset weight value to obtain a weight value corresponding to the weight index absolute information; determining the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtaining the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0335] In some embodiments of the present application, the second determination unit 21 is further used to combine the weight index absolute information with the first numerical value, determine whether the weight index absolute information is greater than 8, and then right-shift by a preset position, and finally add the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0336] In some embodiments of the present application, the second determination unit 21 is also used to combine the weight index absolute information with the first numerical value, 8-the value of the sign of the weight index absolute information, and then right-shift it by a preset position, and finally add the preset weight numerical value to obtain the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0337] In some embodiments of the present application, the second determination unit 21 is also used to search for the weight value corresponding to the absolute information of the weight index from a preset weight mapping table according to the absolute information of the weight index; wherein the preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block within half of the preset values; according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; according to the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.

[0338] In some embodiments of the present application, the second determination unit 21 is also used to, when the weight index absolute information is less than a preset index threshold, perform a preset right shift on the weight index absolute information in combination with a first numerical value to obtain new weight index information; when the weight index absolute information is greater than or equal to the preset index threshold, perform a preset right shift on the weight index absolute information in combination with a second numerical value to obtain new weight index information; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; when the weight index information is less than or equal to 0, determine the new weight value as the weight value corresponding to the weight index absolute information; when the weight index information is greater than 0, determine 8-the new weight value as the weight value corresponding to the weight index absolute information; determine the first weight value of the pixel point in the current block corresponding to the first partition according to the weight value corresponding to the weight index absolute information and the weight index corresponding to the pixel point in the current block; and obtain the second weight value of the pixel point in the current block corresponding to the second partition according to the first weight value.

[0339] In some embodiments of the present application, the decoder 2 further includes a second storage unit 24 (not shown in the figure);

[0340] The second determination unit 21 is further configured to perform weighted fusion of each pixel point by using the first unidirectional prediction value, the first weight value, the second unidirectional prediction value and the second weight value to obtain the prediction value of the current block, determine the motion offset value according to the cosine angle index information, the sine angle index information and the update angle mapping table, and obtain the motion horizontal coordinate offset value and the motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block; obtain the motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point at the upper left corner of the current block, the first angle corresponding to the cosine angle index information and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of the preset motion index threshold, determine the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; when the motion index information is greater than 0, determine the second motion information as the motion information of the current block;

[0341] The second storage unit 24 is configured to store the motion information of the current block in a preset merging candidate list.

[0342] In some embodiments of the present application, the preset value is 26; the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset position is 2; and the preset motion index threshold is 32.

[0343] In practical applications, such as Fig.13 As shown, the embodiment of the present application also provides a decoder, including:

[0344] A second memory 25 and a second processor 26;

[0345] The second memory 25 stores a computer program that can be run on the second processor 26. When the second processor 25 executes the program, an inter-frame prediction method on the decoder side is implemented.

[0346] It can be understood that, during the inter-frame prediction process, the decoder can determine the weight index corresponding to the pixel point in the current block according to the GEO parameter, and then embed the value of the weight index corresponding to the pixel point in the current block to the range of [0 to half of the preset value] through the absolute value embedding processing. In this way, the size of the preset value is reduced by half, and therefore, the storage and use of the weight value corresponding to the absolute information of the weight index is reduced by half, thereby simplifying the text and code during inter-frame prediction and reducing the overhead of data storage.

[0347] Accordingly, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a first processor, the inter-frame prediction method of the encoder is implemented; or, when the computer program is executed by a second processor, the inter-frame prediction method of the decoder is implemented.

[0348] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0349] The above is only an implementation method 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 inter-frame prediction method, characterized in that: Applicable to decoders, including: Parse the bitstream and determine the prediction mode parameters of the current block; When the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode is used to determine the inter-frame prediction value of the current block, determining the partitioning mode, the first motion information, and the second motion information of the current block; Determine a first prediction value of a pixel in the current block according to the first motion information, and determine a second prediction value of a pixel in the current block according to the second motion information; Determining angle index information and step index information of the current block according to a division mode of the current block; Determine a weight index corresponding to a pixel point in the current block according to the position information of the pixel point in the current block, the angle index information and the step index information; Determine a first weight value and a second weight value corresponding to the pixel in the current block according to the weight index corresponding to the pixel in the current block; Determine an inter-frame prediction value of a pixel in the current block according to the first prediction value of a pixel in the current block, the first weight value, the second prediction value, and the second weight value.

2. The method according to claim 1, characterized in that The step of determining the angle index information and the step index information of the current block according to the division mode of the current block includes: According to the division mode of the current block, based on a mapping table of preset division modes, angle indices and step indices, angle index information and step index information corresponding to the division mode of the current block are determined.

3. The method according to claim 1 or 2, characterized in that: The determining, according to the position information of the pixel point in the current block, the angle index information and the step index information, a weight index corresponding to the pixel point in the current block comprises: Determine cosine angle index information and sine angle index information according to the angle index information; Determine a motion horizontal coordinate offset value and a motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block; The weight index corresponding to the pixel point in the current block is determined according to the cosine angle index information, the sine angle index information, the motion horizontal coordinate offset value, the motion vertical coordinate offset value and the position information of the pixel point in the current block.

4. The method according to claim 3, characterized in that The step of determining a weight index corresponding to a pixel point in the current block according to the cosine angle index information, the sine angle index information, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, and the position information of the pixel point in the current block comprises: Determine, according to the cosine angle index information, the sine angle index information and an angle mapping table, a first angle corresponding to the cosine angle index information and a second angle corresponding to the sine angle index information; The weight index corresponding to the pixel point in the current block is determined according to the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point in the current block, the first angle corresponding to the cosine angle index information and the second angle corresponding to the sine angle index information.

5. The method according to any one of claims 1, 2, and 4, characterized in that: The determining, according to the weight index corresponding to the pixel point in the current block, the first weight value and the second weight value corresponding to the pixel point in the current block comprises: Performing bit embedding processing according to the weight index of the pixel point in the current block to obtain the absolute information of the weight index corresponding to the pixel point in the current block; According to the absolute information of the weight index corresponding to the pixel in the current block, a first weight value and a second weight value corresponding to the pixel in the current block are determined.

6. An inter-frame prediction method, characterized in that: Applications for encoders include: Determine prediction mode parameters of the current block, and write the prediction mode parameters into a bitstream; When the prediction mode parameter indicates that the inter-frame geometric partitioning prediction mode is used to determine the inter-frame prediction value of the current block, determining the partitioning mode, the first motion information, and the second motion information of the current block; Determine a first prediction value of a pixel in the current block according to the first motion information, and determine a second prediction value of a pixel in the current block according to the second motion information; Determining angle index information and step index information of the current block according to a division mode of the current block; Determine a weight index corresponding to a pixel point in the current block according to the position information of the pixel point in the current block, the angle index information and the step index information; Determine a first weight value and a second weight value corresponding to the pixel in the current block according to the weight index corresponding to the pixel in the current block; Determine an inter-frame prediction value of a pixel in the current block according to the first prediction value of a pixel in the current block, the first weight value, the second prediction value, and the second weight value.

7. The method according to claim 6, characterized in that The step of determining the angle index information and the step index information of the current block according to the division mode of the current block includes: According to the division mode of the current block, based on a mapping table of preset division modes, angle indices and step indices, angle index information and step index information corresponding to the division mode of the current block are determined.

8. The method according to claim 6 or 7, characterized in that: The determining, according to the position information of the pixel point in the current block, the angle index information and the step index information, a weight index corresponding to the pixel point in the current block comprises: Determine cosine angle index information and sine angle index information according to the angle index information; Determine a motion horizontal coordinate offset value and a motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step index information and the size information of the current block; The weight index corresponding to the pixel point in the current block is determined according to the cosine angle index information, the sine angle index information, the motion horizontal coordinate offset value, the motion vertical coordinate offset value and the position information of the pixel point in the current block.

9. The method according to claim 8, characterized in that The step of determining a weight index corresponding to a pixel point in the current block according to the cosine angle index information, the sine angle index information, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, and the position information of the pixel point in the current block comprises: Determine, according to the cosine angle index information, the sine angle index information and an angle mapping table, a first angle corresponding to the cosine angle index information and a second angle corresponding to the sine angle index information; The weight index corresponding to the pixel point in the current block is determined according to the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel point in the current block, the first angle corresponding to the cosine angle index information and the second angle corresponding to the sine angle index information.

10. The method according to any one of claims 6, 7 and 9, characterized in that: The determining, according to the weight index corresponding to the pixel point in the current block, the first weight value and the second weight value corresponding to the pixel point in the current block comprises: Performing bit embedding processing according to the weight index of the pixel point in the current block to obtain the absolute information of the weight index corresponding to the pixel point in the current block; According to the absolute information of the weight index corresponding to the pixel in the current block, a first weight value and a second weight value corresponding to the pixel in the current block are determined.

11. An encoder, characterized in that: The encoder comprises: a first memory and a first processor; wherein, A first memory, for storing 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 6 to 10 when running the computer program.

12. A decoder, characterized in that: The decoder comprises: a second memory and a second processor; wherein, A second memory for storing a computer program that can be run on a second processor; The second processor is configured to execute the method according to any one of claims 1 to 5 when running the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a code stream generated by the decoding method of any one of claims 1 to 5 or the encoding method of any one of claims 6 to 10.

Citation Information

Patent Citations

  • Methods and apparatus for video encoding and decoding geometrically partitioned bi-predictive mode partitions

    CN101822056A

  • Method and apparatus of video coding

    CN108702515A

  • Bi-directional inter-frame prediction method and apparatus

    WO2019184639A1