Inter-prediction method, encoder, decoder, and storage medium
By clamping weight indices to half of a preset value, the method addresses the issue of large weight mapping tables in inter-prediction, enhancing efficiency and reducing data storage overhead in video coding.
Patent Information
- Application Number
- JP2025092947
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-26
AI Technical Summary
Existing inter-prediction methods in video coding require large weight mapping tables with many overlapping weights, leading to increased data storage overhead and complex text and code.
Implement a method that determines weight indices for inter-prediction by clamping the maximum absolute value of weight indices to half of a preset value, reducing the size of the weight mapping tables and simplifying the inter-prediction process.
This approach reduces data storage overhead and simplifies the inter-prediction process by half, thereby improving efficiency and reducing the complexity of the weight mapping tables.
Smart Images

Figure 2025124820000001_ABST
Abstract
Description
[Technical Field]
[0001] TECHNICAL FIELD Embodiments of the present application relate to video coding techniques, including, but not limited to, inter-prediction methods, encoders, decoders, and storage media. [Background technology]
[0002] In the process of coding a current block, a video codec can adopt an inter-prediction method in addition to intra-prediction. Inter-prediction can include motion estimation and motion compensation. For motion compensation, an inter-block geometric partitioning prediction mode (GEO, Geometrical partitioning for inter blocks) can be used to divide the current block between frames into two non-rectangular partitions, predict them separately, and then perform weighted fusion to obtain a predicted value of the current block.
[0003] In the prior art, the GEO prediction process requires the use of an angle mapping table and a weight mapping table. When predicting the current block, the length of the weight mapping table for one partition is 27, so the total length of the mapping tables for the two partitions is 54. However, the weight values corresponding to these 54 values consist of five types: {4, 5, 6, 7, 8}.
[0004] However, existing weight mapping tables have many overlapping weights and are too long, which increases data storage overhead during inter-prediction and complicates text and code. Summary of the Invention [Problem to be solved by the invention]
[0005] The embodiments of the present application provide an inter-prediction method, an encoder, a decoder, and a storage medium, which can simplify text and code during inter-prediction and reduce data storage overhead. [Means for solving the problem]
[0006] In a first aspect, embodiments of the present application provide an inter prediction method applied in an encoder, the method comprising: determining prediction mode parameters for a current block; If the prediction mode parameter indicates that inter prediction of the current block is to be determined using an inter-block geometric partition prediction mode (GEO), determining GEO parameters of the current block; determining a first predicted value for a first partition of a current block and a second predicted value for a second partition of the current block based on the GEO parameters; determining a weight index corresponding to a pixel point in the current block based on the GEO parameters; Clamping is performed on weight indices corresponding to pixel points in the current block to obtain absolute information of weight indices corresponding to pixel points in the current block, and the clamping is performed by clamping the maximum absolute value of weight indices corresponding to pixel points in the current block to half of a preset value; determining a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of weight indexes corresponding to the pixel point in the current block; and performing weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter predicted value of the current block.
[0007] In a second aspect, embodiments of the present application provide an inter prediction method applied to a decoder, the method comprising: Parsing the bitstream to determine prediction mode parameters for the current block; If the prediction mode parameter indicates that inter prediction of the current block is to be determined using an inter-block geometric partition prediction mode (GEO), analyzing the bitstream and determining GEO parameters of the current block; determining a first predicted value for a first partition of the current block and a second predicted value for a second partition of the current block based on the GEO parameters; determining a weight index corresponding to a pixel point in the current block based on the GEO parameters; Clamping is performed on weight indices corresponding to pixel points in the current block, respectively, to obtain absolute information of weight indices corresponding to pixel points in the current block, and the clamping is performed by clamping the maximum value of weight indices corresponding to pixel points in the current block to half of a preset value; determining a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of weight indexes corresponding to the pixel point in the current block; and determining a weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter predicted value of the current block.
[0008] In a third aspect, embodiments of the present application provide an encoder, comprising: a first decision unit, a first clamping unit, and a first prediction unit; the first determination unit is used for: determining a prediction mode parameter of a current block; if the prediction mode parameter indicates that an inter-block geometric partition prediction mode (GEO) is used to determine inter-prediction of the current block, determining a GEO parameter of the current block; determining a first predicted value of a first partition of the current block and a second predicted value of a second partition of the current block based on the GEO parameter; and determining a weight index corresponding to a pixel point in the current block based on the GEO parameter; the first clamping unit is used for performing clamping processing on weight indexes corresponding to pixel points in the current block, respectively, to obtain absolute information of weight indexes corresponding to pixel points in the current block, and the clamping processing is for clamping the maximum absolute value of weight indexes corresponding to pixel points in the current block to half of a preset value; The first determining unit is further configured to determine a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of a weight index corresponding to the pixel point in the current block; The first prediction unit is used to perform weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block.
[0009] In a fourth aspect, embodiments of the present application provide a decoder, comprising: a parsing unit, a second determining unit, a second clamping unit, and a second predicting unit; The parsing unit is used for parsing a bitstream and determining a prediction mode parameter of a current block; the second determination unit is used for: analyzing a bitstream to determine GEO parameters of the current block when the prediction mode parameter indicates determining inter prediction of the current block using an inter-block geometric partition prediction mode (GEO); determining a first predicted value of a first partition of the current block and a second predicted value of a second partition of the current block based on the GEO parameters; and determining a weight index corresponding to a pixel point in the current block based on the GEO parameters; the second clamping unit is used for performing clamping processing on weight indexes corresponding to pixel points in the current block, respectively, to obtain absolute information of weight indexes corresponding to pixel points in the current block, and the clamping processing is for clamping a maximum value of weight indexes corresponding to pixel points in the current block to half of a preset value; The second determining unit is configured to determine a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of a weight index corresponding to the pixel point in the current block; The second prediction unit is used to determine a weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block.
[0010] In a fifth aspect, embodiments of the present application further provide an encoder, a first memory and a first processor; The first memory stores a computer program executable on a first processor, and when the first processor executes the program, the inter prediction method of the encoder is realized.
[0011] In a sixth aspect, embodiments of the present application further provide a decoder, a second memory and a second processor; The second memory stores a computer program executable on a second processor, and when the second processor executes the program, the inter-prediction method of the decoder is realized.
[0012] In a seventh aspect, an embodiment of the present application provides a storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a first processor, the inter prediction method of the encoder is realized, or when the computer program is executed by a second processor, the inter prediction method of the decoder is realized. [Effects of the Invention]
[0013] An embodiment of the present application provides an inter-prediction method, an encoder, a decoder, and a storage medium, which determine a prediction mode parameter for a current block, and if the prediction mode parameter indicates that an inter-block geometric partitioning prediction mode (GEO) is used to determine the inter-prediction of the current block, determine a GEO parameter for the current block, and determine a first predicted value for a first partition of the current block and a second predicted value for a second partition of the current block based on the GEO parameter, determine weight indices corresponding to pixel points in the current block based on the GEO parameter, and perform clamping on the weight indices corresponding to the pixel points in the current block to obtain absolute information of the weight indices corresponding to the pixel points in the current block, where the clamping is performed by clamping the maximum absolute value of the weight indices corresponding to the pixel points in the current block to half a preset value, determine a first weight value for the pixel points in the current block and a second weight value for the pixel points in the current block based on the absolute information of the weight indices corresponding to the pixel points in the current block, and perform weighted fusion of the pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block. By adopting the above technical solution, the encoder determines the weight index corresponding to the pixel point in the current block according to the GEO parameter in the process of performing inter prediction, and further clamps the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of a preset value through absolute value clamping processing, which reduces the size by half compared to the conventional case where it is clamped to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the data storage overhead. [Brief explanation of the drawings]
[0014] [Figure 1]FIG. 1 is a schematic block diagram of a video encoding system according to an embodiment of the present invention. [Figure 2] FIG. 2 is a schematic block diagram of a video decoding system according to an embodiment of the present invention. [Figure 3] FIG. 3 is a schematic flow chart 1 of the implementation of the intra prediction method according to an embodiment of the present application. [Figure 4a] FIG. 4a is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4b] FIG. 4b is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4c] FIG. 4c is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4d] FIG. 4d is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4e] FIG. 4e is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4f] FIG. 4f is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 4g] FIG. 4g is a schematic diagram of seven exemplary split modes according to an embodiment of the present application. [Figure 5] FIG. 5 is a schematic diagram of an exemplary current block angle and step size according to an embodiment of the present application. [Figure 6a] FIG. 6a is a schematic diagram of an exemplary first weight value of luminance according to an embodiment of the present application. [Figure 6b] FIG. 6b is a schematic diagram of an exemplary chromaticity first weight value according to an embodiment of the present application. [Figure 7] FIG. 7 is a schematic flow chart 2 of the implementation of the intra prediction method according to an embodiment of the present application. [Figure 8] FIG. 8 is a schematic diagram of an exemplary preset motion mask matrix 1 and current motion mask matrices 2, 3, and 4 according to an embodiment of the present application. [Figure 9]FIG. 9 is a schematic flow chart of a further implementation of an intra prediction method according to an embodiment of the present application. [Figure 10] FIG. 10 is a structural schematic diagram 1 of an encoder according to an embodiment of the present invention. [Figure 11] FIG. 11 is a structural schematic diagram 2 of an encoder according to an embodiment of the present invention. [Figure 12] FIG. 12 is a structural schematic diagram 1 of a decoder according to an embodiment of the present invention. [Figure 13] FIG. 13 is a structural schematic diagram 2 of a decoder according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0015] This application provides a video coding system. As shown in FIG. 1, the video coding system 11 includes a transform unit 111, a quantization unit 112, a mode selection and coding control logic unit 113, an intra prediction unit 114, an inter prediction unit 115 (including motion compensation and motion estimation), an inverse quantization unit 116, an inverse transform unit 117, a loop filtering unit 118, an encoding unit 119, and a decoded image buffering unit 110. For an input original video signal, a video reconstruction block can be obtained by dividing a coding tree unit (CTU). The mode selection and coding control logic unit 113 determines a coding mode, and then, for residual pixel information obtained through intra prediction or inter prediction, the transform unit 111 and the quantization unit 112 transform the video reconstruction block, converting the residual information from the pixel domain to the transform domain. The obtained transform coefficients are quantized, thereby further reducing the bit rate. The intra prediction unit 114 is used to intra predict the video reconstruction block. The intra prediction unit 114 is used to determine an optimal intra prediction mode (i.e., a target prediction mode) for the video reconstructed block, and the inter prediction unit 115 is used to perform inter prediction coding of the received video reconstructed block for one or more blocks in one or more reference frames, thereby providing temporal prediction information. Here, motion estimation is a process of generating motion vectors that can estimate the motion of the video reconstructed block, and then motion compensation performs motion compensation based on the motion vectors determined by motion estimation. After the inter prediction mode is determined, the inter prediction unit 115 is further used to provide the selected inter prediction data to the encoding unit 119, and also to send the calculated and determined motion vector data to the encoding unit 119.The inverse quantization unit 116 and the inverse transform unit 117 are used to reconstruct the video reconstruction block, reconstructing a residual block in the pixel domain. The reconstructed residual block is then filtered by the loop filtering unit 118 to remove blocking artifacts. The reconstructed residual block is then added to a prediction block in the frame in the decoded image buffering unit 110 to generate a reconstructed video reconstruction block. The coding unit 119 is used to code various coding parameters and quantized transform coefficients. The decoded image buffering unit 110 is used to store the reconstructed video reconstruction block for prediction reference. As the video image encoding progresses, new reconstructed video reconstruction blocks are continuously generated, and all of these reconstructed video reconstruction blocks are stored in the decoded image buffering unit 110.
[0016] An embodiment of the present application provides a video decoding system. Figure 2 is a structural diagram of a video decoding system according to an embodiment of the present application. As shown in Figure 2, the video decoding system 12 includes a decoding unit 121, an inverse transform unit 127, an inverse quantization unit 122, an intra prediction unit 123, a motion compensation unit 124, a loop filtering unit 125, and a decoded image buffering unit 126. After an input video signal is encoded by the video encoding system 11, a bitstream of the video signal is output. The bitstream is input to the video decoding system 12 and first passes through the decoding unit 121 to obtain decoded transform coefficients. The transform coefficients are processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate residual blocks in the pixel domain. The intra prediction unit 123 can be used to generate prediction data for a current video decoding block based on a determined intra prediction direction and data from previously decoded blocks of the current frame or picture. The motion compensation unit 124 determines prediction information for the video decoded block by analyzing the motion vectors and other related syntax elements, and uses the prediction information to generate a prediction block for the video decoded block just being decoded. A decoded video block is formed by summing the residual block of the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding prediction block generated by the intra prediction unit 123 or the motion compensation unit 124. The decoded video signal is then passed through a loop filtering unit 125 to remove blocking artifacts, thereby improving video quality. The decoded video block is then stored in a decoded image buffering unit 126, which stores reference images for subsequent intra prediction or motion compensation, and simultaneously outputs the video signal to obtain a restored original video signal.
[0017] The inter prediction method according to the embodiment of the present application mainly plays a role in the inter prediction unit 115 of the video encoding system 11 and the inter prediction unit, i.e., the motion compensation unit 124, of the video decoding system 12. That is, if a relatively good prediction effect can be obtained by the inter prediction method according to the embodiment of the present application in the video encoding system 11, the recovery quality of the video decoding on the decoding side can also be correspondingly improved.
[0018] Based on this, the technical solution of the present application will be described in more detail below with reference to the drawings and examples. Before proceeding to the detailed description, it should be noted that the terms "first," "second," "third," etc. referred to throughout the specification are merely used to distinguish different features, and do not have the function of limiting priority, order, magnitude relationship, etc.
[0019] An embodiment of the present application provides an inter-prediction method applied to a video encoding device, i.e., an encoder. The functions of the method can be realized by a processor in the video encoding device calling program code. Of course, the program code can be stored in a computer storage medium. As can be seen from this, the video encoding device includes at least a processor and a storage medium.
[0020] 3 is a schematic flowchart 1 of the implementation of the intra prediction method according to an embodiment of the present application. As shown in FIG. 3, the method includes the following steps S101 to S107.
[0021] In step S101, the prediction mode parameters of the current block are determined.
[0022] In an embodiment of the present application, a video image may be divided into a plurality of image blocks, and each image block currently to be coded may be referred to as a coding block (CB). Each coding block may include a first image component, a second image component, and a third image component. The current block is a coding block in the video image that is currently waiting to predict the first image component, the second image component, or the third image component.
[0023] If the current block predicts a first image component and the first image component is a luma component, i.e., the image component to be predicted is a luma component, the current block may be referred to as a luma block, or if the current block predicts a second image component and the second image component is a chroma component, i.e., the image component to be predicted is a chroma component, the current block may be referred to as a chroma block.
[0024] The prediction mode parameter indicates the coding mode of the current block and parameters related to the mode. Typically, the prediction mode parameter of the current block can be determined by a rate distortion optimization (RDO) method.
[0025] Specifically, in some embodiments, the encoder determines the prediction mode parameters of the current block in the following manner: the encoder determines the image components to be predicted of the current block, and performs predictive encoding on the image components to be predicted using a plurality of prediction modes based on the parameters of the current block; calculates a rate-distortion cost result corresponding to each prediction mode among the plurality of prediction modes; selects the minimum rate-distortion cost result from the plurality of rate-distortion cost results obtained by the calculation; and determines the prediction mode corresponding to the minimum rate-distortion cost result as the prediction mode parameter of the current block.
[0026] That is, the encoder may employ multiple prediction modes for the current block to encode each of the image components to be predicted. The multiple prediction modes typically include an inter prediction mode, a conventional intra prediction mode, and a non-conventional intra prediction mode. The conventional intra prediction mode may further include a direct current (DC) mode, a planar mode, an angular mode, etc. The non-conventional intra prediction mode may further include an MIP mode, a cross-component linear model prediction (CCLM) mode, an intra block copy (IBC) mode, a palette (PLT) mode, etc. The inter prediction mode may include an inter block geometric partitioning prediction mode (GEO), a triangular partition mode (TPM), etc.
[0027] In this way, the current block is coded using multiple prediction modes, and rate-distortion cost results corresponding to each prediction mode are obtained. Next, the minimum rate-distortion cost result is selected from the obtained multiple rate-distortion cost results, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter for the current block. Finally, the current block can be coded using the determined prediction mode, and this prediction mode produces a small prediction residual, thereby improving coding efficiency.
[0028] In step S102, if the prediction mode parameter indicates that inter prediction of the current block is to be determined using GEO, GEO parameters of the current block are determined.
[0029] In an embodiment of the present application, when a prediction mode parameter GEO is used to determine inter prediction of a current block, the GEO parameter of the current block may be obtained or determined. Here, the current block in the embodiment of the present application refers to an inter block.
[0030] 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 further include step size index information and target division mode, etc.
[0031] In this embodiment, GEO divides an inter-block (i.e., current block) into two non-rectangular sub-partitions for the edge of an object in an image, and performs weighted fusion after predicting each sub-partition. For example, the non-rectangular form may be as shown in the following Figures 4a to 4g.
[0032] In the current VVC Draft7, GEO has a total of 82 division modes, each of which corresponds to one angle α and one step size ρ, and the angle divides 360 degrees into 24. Therefore, there are 24 angles and 4 step sizes, so there are 96 combinations of angles and step sizes.
[0033] Regarding the angle table, the previous angle table based on a fixed step size is replaced with a gradient-based angle table, and an unevenly spaced angle table is constructed using five constant gradients (1, 1 / 2, 1 / 4, 4, 2).
[0034] For example, as shown in Figure 5, the combination of each angle α and step size ρ constitutes one partition mode (here, after excluding all first-class step sizes with angle indexes of 0, 6, 12 to 23, 82 partition modes are obtained), and all partition modes of GEO include the TPM mode, which is integrated and replaced. GEO divides the current block into two non-rectangular subpartitions, and each subpartition performs unidirectional motion compensation independently to obtain a unidirectional prediction value. Finally, the weight matrix corresponding to the current block is used to perform weighted fusion on the unidirectional prediction values of the two partitions to obtain the final GEO prediction value.
[0035] In an embodiment of the present application, when it is determined on the encoder side that inter prediction is to be performed using GEO, the encoder can obtain GEO parameters for the current block when inter prediction is to be performed using GEO.
[0036] In this embodiment, the encoder traverses 82 partition modes corresponding to GEO to determine the partition mode with the smallest rate-distortion cost, i.e., the target partition mode. Then, based on the target partition mode, the encoder can determine angle index information and step size index information corresponding to the target partition mode through a mapping table of preset partition modes, angle indexes, and step size indexes. The mapping table of preset partition modes, angle indexes, and step size indexes is shown in Table 1.
[0037] [Table 1]
[0038] wedge_partition_idx is a partition mode index, angleIdx is angle index information, and distanceIdx is step size index information.
[0039] In step S103, a first predicted value of the first partition of the current block and a second predicted value of the second partition of the current block are determined based on the GEO parameters.
[0040] In an embodiment of the present application, the GEO parameters may include angle index information and a target partition mode, so that the encoder may divide the current block based on the target partition mode to obtain a first partition and a second partition, and determine first motion information of a first reference block corresponding to the first partition and second motion information of a second reference block corresponding to the second partition from a preset merge candidate list. The encoder performs motion compensation based on the first motion information to obtain a first predicted value for the first partition, and performs motion compensation based on the second motion information to obtain a second predicted value for the second partition.
[0041] In addition, in the embodiment of the present application, GEO adopts the one-way merge candidate list of the TPM in the existing VVC7, i.e., the preset merge candidate list, to find the MV, i.e., the motion information, of each of the two partitions after the division of GEO.
[0042] The merge candidate list usually includes a preset number of reference block elements, which may be six, and each element stores data in the form of a structure. Each structure may include motion information of the reference block, a reference frame list, a prediction direction, etc. Data corresponding to GEO is stored in 4x4 size blocks.
[0043] In the present embodiment, information such as angle index information, step size index information, first motion information, and second motion information must all be written into the bitstream during encoding in order to be used during decoding.
[0044] In step S104, a weight index corresponding to a pixel point in the current block is determined based on the GEO parameters.
[0045] The GEO parameters include size information and angle index information of the current block, where the size information is the height and width of the current block. The current block includes many pixel points, and the encoder can determine the position information of the pixel points in the current block based on the size information of the current block, and calculate and obtain the weight index corresponding to each pixel point in the current block based on the position information, angle index information, and updated angle mapping table of each pixel point in the current block.
[0046] The detailed acquisition process will be explained in the following examples.
[0047] In step S105, a clamping process is performed on each weight index corresponding to a pixel point in the current block to obtain absolute information of the weight index corresponding to the pixel point in the current block, and the clamping process is to clamp the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of the preset value.
[0048] The encoder obtains pixel points in the current block, obtains the absolute value of the weight index corresponding to the pixel points in the current block, and clamps the result within the range of [0 to half the preset value], thereby obtaining absolute information of the weight index corresponding to each pixel point in the current block. Here, if the absolute value of the weight index of a pixel point exceeds half the preset value, the absolute information of the weight index corresponding to the pixel point is half the preset value, and if the absolute value of the weight index of a pixel point does not exceed half the preset value, the absolute value of the weight index of the pixel point is the absolute information of the weight index.
[0049] In the present embodiment, the preset value is 26, so the absolute value of the weight index is in the range of [0~13].
[0050] For example, the implementation of the ternary operator is adopted, and the absolute information of the weight index can be obtained by Equation (1). Equation (1) is as follows:
[0051] weightIdxAbs = Clip3(0, 13, abs(weightIdx)) (1) In the formula, weightIdxAbs is the absolute information of the weight index, weightIdx is the weight index, abs() is the absolute value function, and Clip3() is the clamp function.
[0052] In step S106, a first weight value of the pixel point in the current block and a second weight value of the pixel point in the current block are determined according to the absolute information of the weight index corresponding to the pixel point in the current block.
[0053] After obtaining the absolute information of the weight indexes corresponding to pixel points in the current block, the encoder can first determine a weight value corresponding to the absolute information of the weight indexes based on the weight indexes corresponding to pixel points in the current block and the absolute information of the weight indexes corresponding to pixel points in the current block, then determine a weight value of a first pixel point in a first partition and a weight value of a second pixel point in a second partition from pixel points in the current block based on the weight value corresponding to the absolute information of the weight indexes, then determine a first weight value of a pixel point 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 a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0054] In this embodiment, if the weight index corresponding to a pixel point in the current block is less than or equal to 0, it indicates that the pixel point belongs to the first partition, and if the weight index corresponding to a pixel point in the current block is greater than 0, it indicates that the pixel point belongs to the second partition. The process of obtaining the first weight value of the pixel point in the current block based on the first partition may include obtaining absolute information of a first weight index corresponding to the first pixel point in the first partition and absolute information of a second weight index corresponding to the second pixel point in the second partition from absolute information of the weight indexes corresponding to the pixel point in the current block, obtaining the weight value of the first pixel point based on the absolute information of the first weight index, obtaining the weight value of the second pixel point based on the absolute information of the second weight index, and obtaining 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. Meanwhile, the second weight value of the pixel point in the current block is 8-the first weight value.
[0055] In an embodiment of the present application, a specific implementation of the encoder determining the first weight value of a pixel point in the current block and the second weight value of a pixel point in the current block based on the absolute information of the weight index corresponding to the pixel point in the current block may include the following five methods:
[0056] Method 1 If the absolute information of the weight index is smaller than a preset index threshold, the encoder combines the absolute information of the weight index with a first value, performs a preset bit right shift operation, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index. If the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder combines the absolute information of the weight index with a second value, performs a preset bit right shift operation, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index. The encoder determines a first weight value for a 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 a weight index corresponding to a pixel point in the current block. The encoder obtains a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0057] In the embodiment of the present application, since the range of the absolute information of the weight index is [0 to half of the preset value], the encoder may first calculate a weight value corresponding to the absolute information of each weight index within the range of [0 to half of the preset value] based on the absolute information of the weight index of the pixel point in the current block. Specifically, if the absolute information of the weight index is smaller than the preset index threshold, the encoder adds a first value to the absolute information of the weight index and performs a preset bit right shift process, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index. If the absolute information of the weight index is equal to or greater than the preset index threshold, the encoder combines the absolute information of the weight index with a second value and performs a preset bit right shift process, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index.
[0058] For example, the implementation of the ternary operator is adopted, and the weight value corresponding to the absolute information of the weight index can be obtained by Equation (2). Equation (2) is as follows:
[0059] WedgeFilter= weightIdxAbs < 9 ? ((weightIdxAbs + 2)>>2)+4 : ((weightIdxAbs + 3)>>2)+4 (2) In the formula, the preset index threshold is 9, the first value is 2, the second value is 3, the preset weight value is 4, the preset bits is 2, WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is the absolute information of one weight index.
[0060] Note that the result after the right shift in equation (2) only has the integer part.
[0061] By adopting the method of piecewise mapping function, the weight value corresponding to the absolute information of the weight index can be obtained by Equation (3). Equation (3) is as follows:
[0062]
number
[0063] When the preset value is 26, the absolute information of the weight index (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, and the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) calculated by equation (2) or (3) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, respectively.
[0064] As can be seen, the encoder uses a piecewise function to integrate the weight table lookup process into the GEO calculation process, and directly and simply calculates the corresponding weight according to the GEO weight index, thereby omitting the weight mapping table and table lookup operation, and actually implicitly realizing lossless reduction of the GEO weight table.
[0065] In an embodiment of the present application, the encoder obtains absolute information of a first weight index corresponding to a first pixel point of a first partition and absolute information of a second weight index corresponding to a second pixel point of a second partition based on a weight value corresponding to the absolute information of the weight index and a weight index corresponding to a pixel point in a current block, obtains a weight value of the first pixel point based on the absolute information of the first weight index, obtains a weight value of the second pixel point based on the absolute information of the second weight index, and obtains a first weight value of a 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.
[0066] As an example, the first weight value of each pixel point can be obtained using equation (4).
[0067] sampleWeight = weightIdx <= 0 ? WedgeFilter : 8 - WedgeFilter (4) In the formula, sampleWeight is the weight value of one pixel point, weightIdx is the weight index of the one pixel point, and WedgeFilter is the weight value corresponding to the weight absolute information of the one pixel point.
[0068] As can be seen from equation (4), when the first weight value of the pixel point in the entire current block is obtained mainly by the first partition, the weight value of each pixel point in the two partitions needs to be determined based on the two partitions, so that the first weight of the pixel point in the current block can be obtained. Meanwhile, the second weight of the pixel point in the current block mainly by the second partition is obtained by subtracting the first weight value of the pixel point in the current block from 8.
[0069] Method 2 The encoder combines the absolute information of the weight index with the first value and the value of whether the absolute information of the weight index is greater than 8, then performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index. The encoder determines a first weight value for a 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 a pixel point in the current block. The encoder obtains a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0070] In the embodiment of the present application, since the range of the absolute information of the weight index is [0 to half of the preset value], the encoder may first calculate a weight value corresponding to the absolute information of each weight index within the range of [0 to half of the preset value] based on the absolute information of the weight index of the pixel point in the current block. Specifically, the encoder adds a first value, a value indicating whether the absolute information of the weight index is greater than 8, to the absolute information of the weight index, and then performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index.
[0071] For example, the implementation of the ternary operator is adopted, and the weight value corresponding to the absolute information of the weight index can be obtained by Equation (5). Equation (5) is as follows:
[0072] WedgeFilter= ((weightIdxAbs + 2+(weightIdxAbs >8))>>2)+4 (5) In the formula, the first value is 2, the preset weight value is 4, the preset bit is 2, WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is the absolute information of one weight index.
[0073] Note that the result after right shifting in equation (3) only takes the integer part. If the absolute information of the weight index is greater than 8, the value is 1, and if it is 8 or less, the value is 0.
[0074] When the preset value is 26, the absolute information of the weight index (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, and the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) calculated by equation (5) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, respectively.
[0075] In addition, the process in which 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, and obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value is consistent with the description of the implementation of Scheme 1, and will not be repeated here.
[0076] Method 3 The encoder combines the absolute information of the weight index with the first value, 8 - the value after sign determination of the absolute information of the weight index, and then performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index. 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 determines a first weight value for the pixel point in the current block corresponding to the first partition, and based on the first weight value, obtains a second weight value for the pixel point in the current block corresponding to the second partition.
[0077] In this embodiment, since the range of the absolute information of the weight index is [0 to half of the preset value], the encoder may first calculate a weight value corresponding to the absolute information of each weight index within the range of [0 to half of the preset value] based on the absolute information of the weight index of the pixel point in the current block. Specifically, the encoder adds a first value to the absolute information of the weight index, then adds the value after sign determination to the absolute information of the 8-weight index, and then further performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index.
[0078] For example, the implementation of the ternary operator is adopted, and the weight value corresponding to the absolute information of the weight index can be obtained by Equation (6). Equation (6) is as follows:
[0079] WedgeFilter= ((weightIdxAbs + 2+sign(8-weightIdxAbs ))>>2)+4 (6) In the formula, the first value is 2, the preset weight value is 4, the preset bits are 2, WedgeFilter is the weight value corresponding to weightIdxAbs, weightIdxAbs is the absolute information of one weight index, sign() is a function for determining the sign, and if 8-weightIdxAbs<0, the value is 1; if 8-weightIdxAbs is 0 or greater, the value is 0.
[0080] When the preset value is 26, the absolute information of the weight index (weightIdxAbs) is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, and the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) calculated by equation (5) are 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, respectively.
[0081] In addition, the process in which 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, and obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value is consistent with the description of the implementation of Scheme 1, and will not be repeated here.
[0082] Furthermore, to achieve a calculation result relatively similar to that of Equation (6), Equation (7) or Equation (8) may also be adopted and implemented, and the embodiments of the present application are not limited thereto. Equations (7) and (8) are as follows:
[0083] WedgeFilter= ((weightIdxAbs + 2))>>2)+4 (7) WedgeFilter= ((weightIdxAbs + 1))>>2)+4 (8)
[0084] Method 4 The encoder searches for and obtains a 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. The preset weight mapping table is obtained by clamping the weight indexes corresponding to pixel points in the current block to within half of the preset value. The encoder determines a first weight value for a 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 a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0085] In an embodiment of the present application, the encoder may obtain weight values ranging from 0 to half the preset value of the absolute information of the weight index according to any one of Methods 1 to 3, to form a preset weight mapping table. After obtaining the absolute information of the weight index of pixel points in the current block, the encoder may find the weight value corresponding to each pixel point in the preset weight mapping table.
[0086] As an example, a preset weight mapping table is shown in Table 2.
[0087] [Table 2]
[0088] In addition, the process in which 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, and obtains the second weight value of the pixel point in the current block corresponding to the second partition based on the first weight value is consistent with the description of the implementation of Scheme 1, and will not be repeated here.
[0089] Method 5 If the absolute information of the weight index is less than a preset index threshold, the encoder combines the absolute information of the weight index with a first value and performs a preset bit right shift to obtain a new weight index. If the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder combines the absolute information of the weight index with a second value and performs a preset bit right shift to obtain a new weight index. The encoder obtains a new weight value corresponding to the new weight index from a preset new weight mapping table. If 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. If the weight index information is greater than 0, the encoder determines the 8-new weight value as the weight value corresponding to the absolute information of the weight index. The encoder determines a first weight value for a 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 a pixel point in the current block, and obtains a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0090] In this embodiment, a new preset weight mapping table is set to represent the correspondence between weight values and weight index information, where the weight values do not have duplicate values, the weight index information belongs to [0 to half of the preset value], and the number of specific weight index information is the same as the number of weight values, as shown in Table 3.
[0091] [Table 3]
[0092] Here, ReduceIdx is weight index information, and WedgeFilter[ReduceIdx] is a weight value.
[0093] When the encoder obtains the absolute information of the weight index of a pixel point in the current block, if the absolute information of the weight index is smaller than the preset index threshold, the encoder adds a first value to the absolute information of the weight index and performs a preset bit right shift process to obtain a new weight index; if the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder adds a second value to the absolute information of the weight index and performs a preset bit right shift process to obtain a new weight index.
[0094] As an example, the realization method of the ternary operator is adopted, and the new weight index can be obtained by Equation (9). Equation (9) is as follows:
[0095] ReduceIdx=WeightIdxabs < 9 ? ((WeightIdxabs + 2)>>2) : ((WeightIdxabs + 3)>>2) (9) In the formula, ReduceIdx is the new weight index, WeightIdxabs is the absolute information of the weight index of one pixel point, 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 bit is 2.
[0096] Note that the result after the right shift in equation (9) only has the integer part.
[0097] By adopting the method of piecewise mapping function, the new weight index can be further obtained by Equation (10). Equation (10) is as follows:
[0098]
number
[0099] In this embodiment, 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, i.e., the new weight value WedgeFilter[ReduceIdx] corresponding to the new weight index. If the weight index information of each pixel point 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; if the weight index information is greater than 0, the encoder determines the new weight value as the weight value corresponding to the absolute information of the weight index.
[0100] In an embodiment of the present application, the encoder obtains absolute information of a first weight index corresponding to a first pixel point of a first partition and absolute information of a second weight index corresponding to a second pixel point of a second partition based on a weight value corresponding to the absolute information of the weight index and a weight index corresponding to a pixel point in a current block, obtains a weight value of the first pixel point based on the absolute information of the first weight index, obtains a weight value of the second pixel point based on the absolute information of the second weight index, and obtains a first weight value of a 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.
[0101] As an example, the first weight value of each pixel point can be obtained using equation (11).
[0102] sampleWeight = weightIdx <= 0 ? WedgeFilter[ReduceIdx] : 8 - WedgeFilter[ReduceIdx] (11) where sampleWeight is the weight value of a pixel point, weightIdx is the weight index of the pixel point, and WedgeFilter[ReduceIdx] is the new weight value corresponding to the weight absolute information of the pixel point.
[0103] As can be seen, the encoder simplifies the GEO weight mapping table and uses executable formulas to derive the GEO weights in the calculation process, eliminating the weight mapping table and table lookup operations, while also implicitly realizing a reduction in the existing weight mapping table, thereby further simplifying the code and text and reducing the storage overhead of the weight mapping table.
[0104] In step S107, the first predicted value, the first weight value, the second predicted value, and the second weight value are used to perform weighted fusion of pixel points in the current block to obtain an inter predicted value of the current block.
[0105] In an embodiment of the present application, the encoder performs weighted fusion for pixel points in the current block by multiplying the first predicted value of each pixel point by the first weight value and adding the product of the second predicted value of each corresponding pixel point by the second weight value, thereby obtaining an inter-predicted value of the current block.
[0106] Note that the first predicted value and the second predicted value are two predicted values corresponding to each pixel point in the current block, and the first weight value and the second weight value are also two different weight values corresponding to each pixel point in the current block.
[0107] The inter predicted value of the current block can be obtained by employing the following equation (23).
[0108] pbSamples[x][y]=Clip3(0,(1< <bitDepth)-1,(predSamplesLPART1[x][y]*(8-sampleWeight1)+predSamplesLPART2[x][y]*sampleWeight2+offset1)> >shift1) (23) In the formula, pbSamples[x][y] is the inter-predicted value of each pixel point of the current block, predSamplesLPART1[x][y] is the first predicted value of each pixel point, sampleWeight1 is the first weight value of each pixel point, predSamplesLPART2[x][y] is the second predicted value of each pixel point, and sampleWeight2 is the second weight value of each pixel point.
[0109] In some embodiments of the present application, when the encoder performs inter prediction of the current block, it predicts the video components respectively, that is, the first predicted value and the second predicted value both include luma predicted value and chroma predicted value.
[0110] In an embodiment of the present application, the encoder may first obtain the weight value of the luma component, and the weight value of the chroma component can be obtained based on the weight value of the luma component.
[0111] The aforementioned first and second weight values in the present application may be weight values of the luminance component.
[0112] In addition, the encoder takes the weight of the luma sample at the top right corner of each 2*2 block and directly uses it as the weight of the chroma sample at the current (x, y) location, that is, downsampling is performed on the luma sample weight.
[0113] For example, the first weight value of luma shown in Fig. 6a is downsampled to obtain the first weight value of chroma shown in Fig. 6b. Similarly, after downsampling the second weight value of luma, the second weight value of the luma sample at the upper right corner of each 2*2 block can be directly used as the second weight value of the chroma sample at the current (x, y) location.
[0114] It can be understood that in the process of performing inter prediction, the encoder determines the weight index corresponding to the pixel point in the current block based on the GEO parameter, and further clamps the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of a preset value through absolute value clamping processing, which reduces the size by half compared to the conventional case where it is clamped to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the data storage overhead.
[0115] In some embodiments of the present application, as shown in FIG. 7, the GEO parameters of the current block include angle index information and size information of the current block, and the implementation of step S104 in the inter prediction method according to the embodiments of the present application may include the following steps S1041 to S1042:
[0116] In step S1041, the position information of the pixel point within the current block is determined based on the size information of the current block.
[0117] In step S1042, the angle index information is combined with the position information of the pixel points in the current block based on the preset angle mapping table to determine the weight index corresponding to the pixel points in the current block.
[0118] In this embodiment, 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, which can determine the coordinate region in which the current block is located and can further determine the position information of each pixel point in the current block, i.e., the coordinate information (x, y) of each pixel point. 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.
[0119] In some embodiments of the present application, the encoder determines weight indices corresponding to pixel points in the current block based on angle index information, a preset angle mapping table, and position information of pixel points in the current block. The encoder determines cosine angle index information and sine angle index information based on the angle index information, reduces the angle of the preset angle mapping table to obtain an updated angle mapping table, and determines weight indices corresponding to pixel points 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 pixel points in the current block.
[0120] The preset angle mapping table is an angle mapping table adopted in existing technology, as shown in Table 4.
[0121] [Table 4]
[0122] Here, angleIdx is angle index information, and Dis[angleIdx] is the angle.
[0123] In the present embodiment, as shown in Table 5, the angles in the updated angle mapping table obtained by the encoder by reducing the order of the angles in the preset angle mapping table are all angle values that are reduced by one order from the preset angle mapping table.
[0124] [Table 5]
[0125] In the encoder, the original preset angle mapping table is deleted and only the updated angle mapping table is left, thus reducing the storage overhead.
[0126] In the embodiment of the present application, 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. In this process, the encoder first determines the vertical distance (rho) from the block center point to the current dividing line based on the cosine angle index information and the sine angle index information, and then determines the weight index of each pixel point based on the cosine angle index information, the sine angle index information, the updated angle mapping table, the position information of the pixel point in the current block, and rho.
[0127] For example, the cosine angle index information can be obtained by equation (12), and the sine angle index information can be obtained by equation (13). Equations (12) and (13) are as follows:
[0128] displacementX= angleIdx (12) displacementY=(displacementX + 6)%24 (13) In the formula, displacementX is the cosine angle index information, displacementY is the sine angle index information, and angleIdx is the angle index information.
[0129] Note that the cos(α) index number corresponding to the current angle is displacementX, and the corresponding −sin(α) index number is displacementY.
[0130] rho can be obtained by equation (14), which is as follows:
[0131] rho=(Dis [displacementX]<< 8) + (Dis[displacementY] << 8) (14) In the formula, 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, and the cosine angle and sine angle can be obtained based on the update mapping table.
[0132] The weight index of each pixel point of the current block can be obtained by equation (15).
[0133] weightIdx = ((x<<1) + 1)*Dis[displacementX] + ((y<<1) + 1))*Dis[displacementY] - rho (15) In the formula, weightIdx is the weight index of a pixel point, x is the abscissa value of the pixel point, and y is the ordinate value of the pixel point. The position information of a pixel point is (x, y).
[0134] It can be seen that the obtained index is used to look up the weight mapping table to obtain the corresponding weight, and each step of the above calculation requires multiplication by the angles Dis[displacementX] and Dis[displacementY]. In contrast, in the present proposal, the weight mapping table is eliminated and a mathematical method is designed to implicitly halve the weight mapping table, so that each step of calculating the weight index and the motion index requires division by 2. However, since the values in the angle mapping table are all powers of 2, the operation of dividing the weight index and the motion index by 2 can be realized by reducing the degree of the angle mapping table, and can be associated with the reduced weight mapping table.
[0135] In some embodiments of the present application, after step S107 of the inter prediction method according to the embodiments of the present application, the method may further include steps S108 to S113.
[0136] In step S108, a motion offset value is determined based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, and a motion abscissa offset value and a motion ordinate offset value corresponding to the current block are obtained based on the angle index information, the step size index information, and the size information of the current block.
[0137] In step S109, motion index information is obtained based on the motion offset value, the motion abscissa offset value, the motion ordinate 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.
[0138] In step S110, if the absolute value of the motion index information is less than half the preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block.
[0139] In step S111, if the motion index information is equal to or less than 0, the first motion information is determined as the motion information of the current block.
[0140] In step S112, if the motion index information is greater than 0, the second motion information is determined as the motion information of the current block.
[0141] In step S113, the motion information of the current block is stored in the preset merge candidate list.
[0142] In this embodiment, when encoding a current block, the encoder must also store the encoded motion information of the current block for use in inter-prediction of subsequent encoding blocks. The encoder calculates a first angle and a second angle based on the cosine angle index information, the sine angle index information, and an updated angle mapping table, and obtains a motion offset value based on the first angle and the second angle. The encoder obtains motion index information based on the motion offset value, the motion abscissa offset value, the motion ordinate offset value, the position information of the pixel point of 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. If the absolute value of the motion index information is less than half 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. If 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. If 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 a preset merge candidate list.
[0143] As an example, the motion offset value (motionOffset) can be obtained using equation (16). Equation (16) is as follows:
[0144] motionOffset = 3*Dis[displacementX]+ 3*Dis[displacementY] (16)
[0145] In the embodiment of the present application, the GEO parameters further include step size index information. Therefore, the encoder can obtain the motion abscissa offset value and motion ordinate offset value corresponding to the current block based on the angle index information, step size index information, and size information of the current block by adopting equations (17) and (18) when shiftHor==0, as follows:
[0146] offsetX = ( 64 - numSbX ) >> 1 (17) offsetY=(64-numSbY)>>1+angleIdx<12?(distanceIdx*nCbH)>>3:-((distanceIdx*nCbH) >>3) (18) In the formula, offsetX is the motion abscissa offset value, offsetY is the motion ordinate offset value, angleIdx is angle index information, distanceIdx is step size 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.
[0147] In the embodiment of the present application, the GEO parameters further include step size index information. Therefore, the encoder can obtain the motion abscissa offset value and motion ordinate offset value corresponding to the current block based on the angle index information, step size index information, and size information of the current block by adopting equations (19) and (20) when shiftHor==1, as follows:
[0148] offsetX=(64-numSbX)>>1+angleIdx<12?(distanceIdx*nCbW)>>3:-((distanceIdx * nCbW) >> 3) (19) offsetY = ( 64 - numSbY ) >> 1 (20) In the formula, offsetX is the motion abscissa offset value, offsetY is the motion ordinate offset value, angleIdx is angle index information, distanceIdx is step size 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.
[0149] For example, in an embodiment of the present application, the encoder obtains the motion index information based on the motion offset value, the motion abscissa offset value, the motion ordinate 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, which can be obtained by Equation (21). Equation (21) is as follows:
[0150] motionIdx=(((xSbIdx+ offsetX) <<3) +1)*Dis[displacementX]+ (((ySbIdx + offsetY <<3) +1))*Dis[displacementY] - rho + motionOffset (21) In the formula, motionIdx is the motion index information, the position information of the pixel point of the upper left corner of the current block is (xSbIdx, ySbIdx), offsetX is the motion abscissa offset value, offsetY is the motion ordinate 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 division line obtained based on the first angle and the second angle, and motionOffset is the motion offset value.
[0151] Note that ShiftHor is the horizontal offset and its value is 0. Multiple offsets are required in the Y axis and its value is 1. Multiple offsets are required in the X axis.
[0152] If (angleIdx%12==6)||(angleIdx%12!=0&&hwRatio≧1), then ShiftHor=0, Otherwise, ShiftHor=1.
[0153] 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 based on the current motion mask matrix, and store it in a preset merge candidate list.
[0154] In some embodiments of the present application, the encoder may further determine motion information of the current block based on the motion index information: if 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; if the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; if the motion index information is greater than 0, determine the second motion information as the motion information of the current block; and store the motion information of the current block in a preset merge candidate list.
[0155] Assuming that the current block is 16x16, the encoder determines whether the current sub-block stores unidirectional or bidirectional motion information based on the size of abs(motionIdx) in each 4x4 sub-block.
[0156] For example, if abs(motionIdx)<16, the current block stores the configured two-way motion information, i.e., the first motion information and the second motion information. If (motionIdx)≦0, the current block stores the first motion information of the first partition; If (motionIdx)>0, the current block stores the second motion information of the second partition.
[0157] Here, the preset motion index threshold is 32.
[0158] Note that in the embodiment of the present application, the encoder can first obtain a motion mask matrix, and then trim from the preset motion mask matrix based on the motion abscissa offset value and the motion ordinate offset value to obtain a current motion mask matrix for the current block.
[0159] For example, in the preset motion mask matrix 1 shown in FIG. 8, different current motion mask matrices 2, 3, and 4 can be obtained by trimming the preset motion mask matrix 1 using the size A of the current block according to different division modes, angles ψ, step sizes ρ, offsetX, and offsetY.
[0160] Furthermore, because GEO inherits the motion information storage method used by TPM, motion information storage in GEO mode is still performed in units of 4x4 small blocks. Therefore, the size of the GEO predefined motion mask matrix is 56*56. The motion information of each 4x4 small block is determined by the weighting of its upper left corner point, and the finally calculated motion masks of all 4x4 small blocks are stored in a 56x56 matrix. Specifically, the encoder obtains the motion offset value (motionOffset) according to equation (16), and obtains all motion index information (motionIdx1) based on the position information (x, y), motionOffset, rho, first angle, and second angle of each pixel point in the 56x56. Equation (22) is as follows:
[0161] motionIdx1=((x<<3)+1)*Dis[displacementX]+((y<<3+1))*Dis[displacementY] - rho + motionOffset (22)
[0162] Here, the mask corresponding to the motion information in the 56×56 preset motion mask matrix is determined based on abs(motionIdx1) and motionIdx1.
[0163] For example, if abs(motionIdx)<16, the motion mask of the current 4x4 sub-block is 2 (representing bidirectional motion information), If not, If (motionIdx)≦0, the motion mask of the current 4×4 sub-block is 0 (representing the first motion information); If (motionIdx)>0, the motion mask of the current 4x4 sub-block is 1 (representing the second motion information).
[0164] In this embodiment, there are actually seven pre-stored mask matrices (including a weight mask matrix and a motion mask matrix), which correspond to the first step size passing through the center point of the block at seven angles between 0 and 90. The pre-stored mask matrices for other angles are obtained by mirroring these seven matrices horizontally or vertically, thereby reducing the storage space.
[0165] It can be seen that after the inter-prediction method according to the embodiment of the present application is implemented in the GEO-based VVC reference software VTM7.0_common_base, a test sequence required by JVET is performed under Random Access conditions, and no change in the BD-rate is observed for the Y, Cb, and Cr components (consistent with the performance of Anchor). As can be seen from this data, the simplification proposal has no impact on coding performance, and further reduces the storage size of the weight table, simplifying the implementation of text descriptions and codes. In terms of time complexity, because the GEO predefined weight matrix is calculated only once for each sequence before encoding / decoding begins, the operation of the ternary operator provided by the present proposal does not affect the overall encoding / decoding time complexity, and it can be said that the time complexity remains almost unchanged.
[0166] An embodiment of the present application provides an inter-prediction method applied to a video decoding device, i.e., a decoder. The functions of the method can be realized by a processor in the video decoding device calling program code. Of course, the program code can be stored in a computer storage medium. As can be seen from this, the video decoding device includes at least a processor and a storage medium.
[0167] 9 is a schematic flowchart of the implementation of the intra prediction method according to an embodiment of the present application. As shown in FIG. 10, the method includes the following steps S201 to S213.
[0168] In S201, the bitstream is analyzed to determine the prediction mode parameters of the current block.
[0169] In S202, if the prediction mode parameter indicates that the inter prediction of the current block is to be determined using an inter-block geometrical (GEO) prediction mode, the bitstream is analyzed to determine the GEO parameters of the current block.
[0170] In S203, a first predicted value of the first partition of the current block and a second predicted value of the second partition of the current block are determined based on the GEO parameters.
[0171] In S204, a weight index corresponding to a pixel point in the current block is determined based on the GEO parameters.
[0172] In S205, a clamping process is performed on each weight index corresponding to a pixel point in the current block to obtain absolute information of the weight index corresponding to the pixel point in the current block, and the clamping process is to clamp the maximum value of the weight index corresponding to the pixel point in the current block to half of the preset value.
[0173] In S206, a first weight value of the pixel point in the current block and a second weight value of the pixel point in the current block are determined based on the absolute information of the weight index corresponding to the pixel point in the current block.
[0174] In S207, the first predicted value, the first weight value, the second predicted value, and the second weight value are used to determine a weighted fusion of pixel points in the current block to obtain an inter predicted value of the current block.
[0175] In some embodiments of the present application, a specific implementation in which the decoder determines the first weight value of the pixel point in the current block and the second weight value of the pixel point in the current block based on the absolute information of the weight index corresponding to the pixel point in the current block may include the following five methods:
[0176] Method 1 If the absolute information of the weight index is smaller than a preset index threshold, the decoder combines the absolute information of the weight index with a first value to perform a preset bit right shift operation, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index. If the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder combines the absolute information of the weight index with a second value to perform a preset bit right shift operation, and then adds a preset weight value to obtain a weight value corresponding to the absolute information of the weight index. The decoder determines a first weight value for a 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 a weight index corresponding to a pixel point in the current block. The decoder obtains a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0177] Method 2 The decoder combines the absolute information of the weight index with the first value and the value of whether the absolute information of the weight index is greater than 8, then performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index.The decoder determines a first weight value of a 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 a pixel point in the current block.The decoder obtains a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0178] Method 3 The decoder combines the absolute information of the weight index with the first value, 8 - the value after sign determination of the absolute information of the weight index, and then performs a preset bit right shift process, and finally adds the preset weight value to obtain a weight value corresponding to the absolute information of the weight index. 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 determines a first weight value of the pixel point in the current block corresponding to the first partition, and based on the first weight value, obtains a second weight value of the pixel point in the current block corresponding to the second partition.
[0179] Method 4 The decoder searches for and obtains a 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. The preset weight mapping table is obtained by clamping the weight indexes corresponding to pixel points in the current block to within half of the preset value. The decoder determines a first weight value for a 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 a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0180] Method 5 If the absolute information of the weight index is less than a preset index threshold, the decoder combines the absolute information of the weight index with a first value and performs a preset bit right shift to obtain a new weight index. If the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder combines the absolute information of the weight index with a second value and performs a preset bit right shift to obtain a new weight index. The decoder obtains a new weight value corresponding to the new weight index from a preset new weight mapping table. If 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. If the weight index information is greater than 0, the decoder determines the new weight value as the weight value corresponding to the absolute information of the weight index. The decoder determines a first weight value for a pixel point in the current block corresponding to a first partition based on the weight value corresponding to the absolute information of the weight index and a weight index corresponding to a pixel point in the current block, and obtains a second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0181] In an embodiment of the present application, the decoder analyzes angle index information corresponding to the current block, first motion information of the first reference block corresponding to the first partition, second motion information of the second reference block corresponding to the second partition, and step size index information from the bitstream, and performs motion compensation based on the first motion information and the second motion information, respectively, to obtain a first unidirectional predicted value corresponding to the first partition and a second unidirectional predicted value corresponding to the second partition.
[0182] Here, 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 bits is 2.
[0183] In the embodiment of the present application, the implementation of steps S201 to S207 in the decoder is basically the same as the implementation process of steps S101 to S107 on the encoder side, and will not be described again here.
[0184] The difference is that the prediction mode parameter and GEO parameter of the current block on the decoder side are both parsed from the bitstream, whereas the encoder obtains them by itself.
[0185] It can be understood that in the process of performing inter prediction, the decoder determines the weight index corresponding to the pixel point in the current block based on the GEO parameter, and further clamps the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of a preset value through absolute value clamping processing, which reduces the size by half compared to the conventional case where it is clamped to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the data storage overhead.
[0186] 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, and implementing step S204 in the inter prediction method according to the embodiments of the present application may include the following steps S2041 to S2042.
[0187] In step S2041, the position information of the pixel point within the current block is determined based on the size information of the current block.
[0188] In step S2042, the angle index information is combined with the position information of the pixel points in the current block based on the preset angle mapping table to determine the weight index corresponding to the pixel points in the current block.
[0189] In some embodiments of the present application, the decoder may 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 obtain an updated angle mapping table, and determine weight indexes corresponding to pixel points in the current block based on the cosine angle index information, sine angle index information, and updated angle mapping table, respectively, in combination with position information of pixel points in the current block.
[0190] In the embodiment of the present application, the implementation of steps S2041 to S2042 in the decoder basically coincides with steps S1041 to S1042 in the implementation process on the encoder side, and will not be described again here.
[0191] It can be seen that the obtained index is used to look up the weight mapping table to obtain the corresponding weight, and each step of the above calculation requires multiplication by the angles Dis[displacementX] and Dis[displacementY]. In contrast, in the present proposal, the weight mapping table is eliminated and a mathematical method is designed to implicitly halve the weight mapping table, so that each step of calculating the weight index and the motion index requires division by 2. However, since the values in the angle mapping table are all powers of 2, the operation of dividing the weight index and the motion index by 2 can be realized by reducing the degree of the angle mapping table, and can be associated with the reduced weight mapping table.
[0192] In step S208, a motion offset value is determined based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, and a motion abscissa offset value and a motion ordinate offset value corresponding to the current block are obtained based on the angle index information, the step size index information, and the size information of the current block.
[0193] In step S209, motion index information is obtained based on the motion offset value, the motion abscissa offset value, the motion ordinate 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.
[0194] In step S210, if the absolute value of the motion index information is less than half the preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block.
[0195] In step S211, if the motion index information is equal to or less than 0, the first motion information is determined as the motion information of the current block.
[0196] In step S212, if the motion index information is greater than 0, the second motion information is determined as the motion information of the current block.
[0197] In step S213, the motion information of the current block is stored in the preset merge candidate list.
[0198] In the embodiment of the present application, the implementation of steps S208 to S213 in the decoder is basically the same as the implementation process of steps S108 to S113 on the encoder side, and will not be described again here.
[0199] Here, the preset motion index threshold is 32.
[0200] It can be seen that after the inter-prediction method according to the embodiment of the present application is implemented in the GEO-based VVC reference software VTM7.0_common_base, a test sequence required by JVET is performed under Random Access conditions, and no change in the BD-rate is observed for the Y, Cb, and Cr components (consistent with the performance of Anchor). As can be seen from this data, the simplification proposal has no impact on coding performance, and further reduces the storage size of the weight table, simplifying the implementation of text descriptions and codes. In terms of time complexity, because the GEO predefined weight matrix is calculated only once for each sequence before encoding / decoding begins, the operation of the ternary operator provided by the present proposal does not affect the overall encoding / decoding time complexity, and it can be said that the time complexity remains almost unchanged.
[0201] As shown in FIG. 10 , an embodiment of the present application provides an encoder 1, which includes a first decision unit 10, a first clamping unit 11 and a first prediction unit 12; The first determination unit 10 is used for: determining a prediction mode parameter of a current block; if the prediction mode parameter indicates that an inter-block geometric partition prediction mode (GEO) is used to determine inter-prediction of the current block, determining a GEO parameter of the current block; determining a first predicted value of a first partition of the current block and a second predicted value of a second partition of the current block based on the GEO parameter; and determining a weight index corresponding to a pixel point in the current block based on the GEO parameter; the first clamping unit 11 is used to perform clamping on weight indexes corresponding to pixel points in the current block, respectively, to obtain absolute information of weight indexes corresponding to pixel points in the current block, and the clamping is to clamp the maximum absolute value of weight indexes corresponding to pixel points in the current block to half of a preset value; The first determining unit 10 is further used for determining a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of weight indexes corresponding to the pixel point in the current block; The first prediction unit 12 is used to perform weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block.
[0202] 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 first determination unit 10 is further used for determining, based on the size information of the current block, position information of pixel points in the current block; and for determining, based on the angle index information and a preset angle mapping table, weight indexes corresponding to pixel points in the current block in combination with the position information of pixel points in the current block.
[0203] In some embodiments of the present application, the first determination unit 10 is further used for: determining cosine angle index information and sine angle index information based on the angle index information; reducing the angle of the preset angle mapping table to obtain the updated angle mapping table; and determining weight indexes corresponding to pixel points 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 position information of pixel points in the current block.
[0204] In some embodiments of the present application, the first determination unit 10 is further configured to: combine the absolute information of the weight index with a first value to perform a preset bit right shift process, and then add a preset weight value to obtain a weight value corresponding to the absolute information of the weight index when the absolute information of the weight index is smaller than a preset index threshold; combine the absolute information of the weight index with a second value to perform a preset bit right shift process, and then add a preset weight value to obtain a 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; determine a first weight value for a 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 a weight index corresponding to a pixel point in the current block; and obtain the second weight value for a pixel point in the current block corresponding to the second partition based on the first weight value.
[0205] In some embodiments of the present application, the first determination unit 10 is further used for: combining the absolute information of the weight index with a first value, a value indicating whether the absolute information of the weight index is greater than 8, and then performing a preset bit right shift process, and finally adding a preset weight value to obtain a weight value corresponding to the absolute information of the weight index; determining a first weight value of a 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 a pixel point in the current block; and obtaining a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0206] In some embodiments of the present application, the first determination unit 10 is further used for: combining the absolute information of the weight index with a first value, 8 - the value after sign determination of the absolute information of the weight index, then performing a preset bit right shift process, and finally adding a preset weight value to obtain a weight value corresponding to the absolute information of the weight index; determining a first weight value of a 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 a pixel point in the current block; and obtaining a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0207] In some embodiments of the present application, the first determination unit 10 is further used for: searching for and obtaining weight values corresponding to the absolute information of the weight indexes from a preset weight mapping table based on the absolute information of the weight indexes, where the preset weight mapping table is obtained by clamping the weight indexes corresponding to pixel points in the current block to within half of a preset value; determining first weight values of pixel points in the current block corresponding to the first partition based on the weight values corresponding to the absolute information of the weight indexes and the weight indexes corresponding to pixel points in the current block; and obtaining second weight values of pixel points in the current block corresponding to the second partition based on the first weight value.
[0208] In some embodiments of the present application, the first determination unit 10 is further configured to: combine the absolute information of the weight index with a first value to perform a preset bit right shift process to obtain new weight index information when the absolute information of the weight index is less than a preset index threshold; combine the absolute information of the weight index with a second value to perform a preset bit right shift process to obtain new weight index information when the absolute information of the weight index is greater than or equal to the preset index threshold; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; determine the new weight value as the weight value corresponding to the absolute information of the weight index when the weight index information is less than or equal to 0; 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; determine a first weight value of a 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 a weight index corresponding to a pixel point in the current block; and obtain a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0209] In some embodiments of the present application, the encoder 1 further comprises a writing unit 13 and a first storage unit 14 (both not shown), the writing unit 13 is configured to perform weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block, and then write the angle index information into a bitstream; the first determination unit 10 is further used for: determining a motion offset value according to the cosine angle index information, the sine angle index information, and the updated angle mapping table; obtaining a motion abscissa offset value and a motion ordinate offset value corresponding to the current block according to the angle index information, step size index information, and size information of the current block; obtaining motion index information according to the motion offset value, the motion abscissa offset value, the motion ordinate offset value, position information of the pixel point of the upper left corner of the current block, a first angle corresponding to the cosine angle index information, and a second angle corresponding to the sine angle index information; determining the first motion information and the second motion information as the motion information of the current block if the absolute value of the motion index information is less than half a preset motion index threshold; determining the first motion information as the motion information of the current block if the motion index information is less than or equal to 0; and determining the second motion information as the motion information of the current block if the motion index information is greater than 0; The first storage unit 14 is used to store the motion information of the current block in a preset merge candidate list.
[0210] In some embodiments of the present application, the preset 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 bits is 2, and the preset motion index threshold is 32.
[0211] In practical application, as shown in FIG. 11, the embodiment of the present application further provides an encoder, which includes a first memory 15 and a first processor 16; The first memory 15 stores a computer program that can be executed by the first processor 16, and when the first processor 16 executes the program, an encoder-side inter-prediction method is realized.
[0212] It can be understood that in the process of performing inter prediction, the encoder determines the weight index corresponding to the pixel point in the current block based on the GEO parameter, and further clamps the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of a preset value through absolute value clamping processing, which reduces the size by half compared to the conventional case where it is clamped to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the data storage overhead.
[0213] As shown in FIG. 12, an embodiment of the present application provides a decoder 2, which includes an analysis unit 20, a second decision unit 21, a second clamping unit 22 and a second prediction unit 23; The parsing unit 20 is used for parsing the bitstream and determining the prediction mode parameters of the current block; The second determination unit 21 is used to, when the prediction mode parameter indicates that an inter-block geometric partition prediction mode (GEO) is used to determine inter-prediction of the current block, analyze the bitstream and determine GEO parameters of the current block; determine a first predicted value of a first partition of the current block and a second predicted value of a second partition of the current block based on the GEO parameters; and determine a weight index corresponding to a pixel point in the current block based on the GEO parameters; the second clamping unit 22 is used to perform clamping on weight indexes corresponding to pixel points in the current block, respectively, to obtain absolute information of weight indexes corresponding to pixel points in the current block, and the clamping is to clamp the maximum value of weight indexes corresponding to pixel points in the current block to half of a preset value; The second determining unit 21 is further used for determining a first weight value of a pixel point in the current block and a second weight value of a pixel point in the current block according to absolute information of weight indexes corresponding to the pixel point in the current block; The second prediction unit 23 is used to determine a weighted fusion of pixel points in the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain an inter-predicted value of the current block.
[0214] 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 second determination unit 21 is further used for determining, based on the size information of the current block, position information of pixel points in the current block; and for determining, based on the angle index information and a preset angle mapping table, weight indexes corresponding to pixel points in the current block in combination with the position information of pixel points in the current block.
[0215] In some embodiments of the present application, the second determination unit 21 is further used for: determining cosine angle index information and sine angle index information based on the angle index information; reducing the angle of the preset angle mapping table to obtain the updated angle mapping table; and determining weight indexes corresponding to pixel points 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 position information of pixel points in the current block.
[0216] In some embodiments of the present application, the second determination unit 21 is further configured to: combine the absolute information of the weight index with a first value to perform a preset bit right shift process, and then add a preset weight value to obtain a weight value corresponding to the absolute information of the weight index when the absolute information of the weight index is smaller than a preset index threshold; combine the absolute information of the weight index with a second value to perform a preset bit right shift process, and then add a preset weight value to obtain a 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; determine a first weight value of a 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 a weight index corresponding to a pixel point in the current block; and obtain a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0217] In some embodiments of the present application, the second determination unit 21 is further used for: combining the absolute information of the weight index with a first value, a value indicating whether the absolute information of the weight index is greater than 8, and then performing a preset bit right shift process, and finally adding a preset weight value to obtain a weight value corresponding to the absolute information of the weight index; determining a first weight value of a 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 a pixel point in the current block; and obtaining a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0218] In some embodiments of the present application, the second determination unit 21 is further used for: combining the absolute information of the weight index with a first value, 8 - the value after sign determination of the absolute information of the weight index, then performing a preset bit right shift process, and finally adding a preset weight value to obtain a weight value corresponding to the absolute information of the weight index; determining a first weight value of a 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 a pixel point in the current block; and obtaining a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0219] In some embodiments of the present application, the second determination unit 21 is further used for: searching for and obtaining weight values corresponding to the absolute information of the weight indexes from a preset weight mapping table based on the absolute information of the weight indexes, where the preset weight mapping table is obtained by performing clamping processing within half of a preset value on the weight indexes corresponding to pixel points in the current block; determining first weight values of pixel points in the current block corresponding to the first partition based on the weight values corresponding to the absolute information of the weight indexes and the weight indexes corresponding to pixel points in the current block; and obtaining second weight values of pixel points in the current block corresponding to the second partition based on the first weight value.
[0220] In some embodiments of the present application, the second determination unit 21 is further configured to: combine the absolute information of the weight index with a first value to perform a preset bit right shift process to obtain new weight index information when the absolute information of the weight index is less than a preset index threshold; combine the absolute information of the weight index with a second value to perform a preset bit right shift process to obtain new weight index information when the absolute information of the weight index is greater than or equal to the preset index threshold; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; determine the new weight value as the weight value corresponding to the absolute information of the weight index when the weight index information is less than or equal to 0; 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; determine a first weight value of a 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 a weight index corresponding to a pixel point in the current block; and obtain a second weight value of a pixel point in the current block corresponding to the second partition based on the first weight value.
[0221] In some embodiments of the present application, the decoder 2 further comprises a second storage unit 24 (not shown), The second determination unit 21 further performs weighted fusion of each pixel point using the first unidirectional predicted value, the first weight value, the second unidirectional predicted value, and the second weight value to obtain a predicted value of a current block, and then determines a motion offset value according to the cosine angle index information, the sine angle index information, and the updated angle mapping table, and obtains a motion abscissa offset value and a motion ordinate offset value corresponding to the current block according to the angle index information, step size index information, and size information of the current block; and obtaining motion index information based on position information of a pixel point at the upper left corner of a block, a first angle corresponding to the cosine angle index information, and a second angle corresponding to the sine angle index information; determining the first motion information and the second motion information as the motion information of the current block when the absolute value of the motion index information is less than half of a preset motion index threshold; determining the first motion information as the motion information of the current block when the motion index information is less than or equal to 0; and determining the second motion information as the motion information of the current block when the motion index information is greater than 0; The second storage unit 24 is used to store the motion information of the current block in a preset merge candidate list.
[0222] In some embodiments of the present application, the preset 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 bits is 2, and the preset motion index threshold is 32.
[0223] In practical application, as shown in FIG. 13, the embodiment of the present application further provides a decoder, which comprises a second memory 25 and a second processor 26; The second memory 25 stores a computer program that can be executed by the second processor 26, and when the second processor 26 executes the program, a decoder-side inter-prediction method is realized.
[0224] It can be understood that in the process of performing inter prediction, the decoder determines the weight index corresponding to the pixel point in the current block based on the GEO parameter, and can further clamp the maximum absolute value of the weight index corresponding to the pixel point in the current block to half of a preset value through absolute value clamping processing, which reduces the size by half compared to the conventional case where it is clamped to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the data storage overhead.
[0225] Correspondingly, an embodiment of the present application provides a storage medium on which a computer program is stored, the computer program being configured to implement an inter-prediction method for an encoder when executed by a first processor, or to implement an inter-prediction method for a decoder when executed by a second processor.
[0226] It should be noted that the above description of the storage medium and device embodiments is similar to the description of the method embodiment described above and has similar beneficial effects as the method embodiment. For technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the description of the method embodiment of the present application.
[0227] The above description is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Any modifications or replacements that can be easily conceived by those skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be governed by the claims. [Industrial Applicability]
[0228] In the embodiment of the present application, in the process of performing inter prediction, a weight index corresponding to a pixel point in a current block is determined based on a GEO parameter, and the maximum absolute value of the weight index corresponding to a pixel point in the current block can be clamped to half of a preset value through absolute value clamping processing.This reduces the size by half compared to the traditional case of clamping to a preset value, and therefore reduces the storage and use of the weight value corresponding to the absolute information of the weight index by about half, thereby simplifying the text and code during inter prediction and reducing the overhead of data storage.
Claims
1. A decoding device, comprising: a processor and a memory storing instructions, the processor configured to implement a method, the method comprising: Parsing the bitstream to determine prediction mode parameters for the current block; If the prediction mode parameter indicates that an inter prediction value of the current block is determined using an inter block geometric partition prediction mode, determining a partition mode, first motion information, and second motion information of the current block; determining a first predicted value of a first image component sample of the current block based on the first motion information, and determining a second predicted value of the first image component sample of the current block based on the second motion information; determining a weight index corresponding to a first image component sample of the current block based on the partition mode and size information corresponding to a first image component of the current block; determining a first weight value and a second weight value corresponding to the first image component sample of the current block based on a weight index corresponding to the first image component sample of the current block; determining an inter-predicted value of the first image component sample of the current block based on a first predicted value, a first weight value, a second predicted value, and a second weight value of the first image component sample of the current block.
2. determining a weight index corresponding to a first image component sample of the current block based on the partition mode and size information corresponding to the first image component of the current block, According to the division mode, determining angle index information and step size index information corresponding to the division mode according to a mapping table of preset division modes, angle indexes, and step size indexes; and determining a weight index corresponding to the first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to the first image component sample of the current block.
3. determining a weight index corresponding to a first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to a first image component sample of the current block, determining cosine angle index information and sine angle index information based on the angle index information; determining a first angle corresponding to the cosine angle index information and a second angle corresponding to the sine angle index information according to the cosine angle index information, the sine angle index information, and a preset angle mapping table; determining a motion abscissa offset value and a motion ordinate offset value corresponding to a first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to a first image component sample of the current block; and determining a weight index corresponding to the first image component sample of the current block based on position information of the first image component sample of the current block, the motion abscissa offset value, the motion ordinate offset value, the first angle, and the second angle.
4. The method further comprises: determining first motion information and second motion information of a second image component of the current block based on the first motion information and the second motion information; determining a first predicted value of a second image component sample of the current block based on first motion information of the second image component, and determining a second predicted value of the second image component sample of the current block based on second motion information of the second image component; determining weight indexes corresponding to second image component samples of the current block based on the partition mode and size information corresponding to the second image component of the current block; determining a first weight value and a second weight value corresponding to the second image component sample of the current block based on a weight index corresponding to the second image component sample of the current block; and determining an inter-predicted value of the second image component sample of the current block based on the first predicted value, the first weight value, the second predicted value, and the second weight value of the second image component sample of the current block.
5. 5. The decoding device according to claim 4, wherein the first image component is a luminance component and the second image component is a chrominance component.
6. 1. An encoding device, comprising: a processor and a memory storing instructions, the processor configured to implement a method, the method comprising: determining prediction mode parameters for a current block; If the prediction mode parameter indicates that an inter prediction value of the current block is determined using an inter block geometric partition prediction mode, determining a partition mode, first motion information, and second motion information of the current block; determining a first predicted value of a first image component sample of the current block based on the first motion information, and determining a second predicted value of the first image component sample of the current block based on the second motion information; determining a weight index corresponding to a first image component sample of the current block based on the partition mode and size information corresponding to a first image component of the current block; determining a first weight value and a second weight value corresponding to the first image component sample of the current block based on a weight index corresponding to the first image component sample of the current block; determining an inter-predicted value of the first image component sample of the current block based on a first predicted value, a first weighting value, a second predicted value, and a second weighting value of the first image component sample of the current block.
7. determining a weight index corresponding to a first image component sample of the current block based on the partition mode and size information corresponding to the first image component of the current block, According to the division mode, determining angle index information and step size index information corresponding to the division mode according to a mapping table of preset division modes, angle indexes, and step size indexes; determining a weight index corresponding to the first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to the first image component sample of the current block.
8. determining a weight index corresponding to a first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to a first image component sample of the current block, determining cosine angle index information and sine angle index information based on the angle index information; determining a first angle corresponding to the cosine angle index information and a second angle corresponding to the sine angle index information according to the cosine angle index information, the sine angle index information, and a preset angle mapping table; determining a motion abscissa offset value and a motion ordinate offset value corresponding to a first image component sample of the current block based on the angle index information, the step size index information, and size information corresponding to a first image component sample of the current block; and determining a weight index corresponding to the first image component sample of the current block based on position information of the first image component sample of the current block, the motion abscissa offset value, the motion ordinate offset value, the first angle, and the second angle.
9. The method further comprises: determining first motion information and second motion information of a second image component of the current block based on the first motion information and the second motion information; determining a first predicted value of a second image component sample of the current block based on first motion information of the second image component, and determining a second predicted value of the second image component sample of the current block based on second motion information of the second image component; determining weight indexes corresponding to second image component samples of the current block based on the partition mode and size information corresponding to the second image component of the current block; determining a first weight value and a second weight value corresponding to the second image component sample of the current block based on a weight index corresponding to the second image component sample of the current block; and determining an inter-predicted value of the second image component sample of the current block based on the first predicted value, the first weight value, the second predicted value, and the second weight value of the second image component sample of the current block.
10. 10. The encoding device according to claim 9, wherein the first image component is a luminance component and the second image component is a chromaticity component.
11. A non-transitory computer-readable storage medium having a bitstream stored thereon, Storage medium, characterized in that the bitstream is generated by a video coding method according to any one of claims 6 to 10.
Citation Information
Patent Citations
Method and apparatus for video encoding and decoding using bi-prediction
WO2020061147A1
Geometric partitioning mode in video coding
WO2021101791A1
Simplified inter prediction with geometric partitioning
WO2021104433A1