Inter-frame prediction method, encoder, decoder and storage medium
By embedding the weight index within the range of [0 to half of the preset value], the data storage and code for inter-frame prediction are simplified, the problem of the lengthy weight mapping table is solved, and more efficient data processing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-31
- Publication Date
- 2026-03-24
AI Technical Summary
In existing inter-frame prediction methods, the weight mapping table is lengthy, resulting in high data storage overhead and complex code.
By embedding the weight index within the range of 0 to half of a preset value, the processing of absolute information of the weight index is simplified, reducing the storage and use of weight values.
It simplifies the text and code for inter-frame prediction and reduces data storage overhead.
Smart Images

Figure CN121728249A_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese Patent Application No. 201980099607.0, filed on December 31, 2019, entitled "Inter-Frame Prediction Method, Encoder, Decoder and Storage Medium". TECHNICAL FIELD
[0002] Embodiments of the present application relate to video coding technology, and more particularly, but not exclusively, to an inter-frame prediction method, an encoder, a decoder and a storage medium. BACKGROUND
[0003] In video coding, in the process of coding a current block, in addition to intra-frame prediction, inter-frame prediction can also be used. Inter-frame prediction can include motion estimation and motion compensation. For motion compensation, a geometrical partitioning for inter blocks (GEO) mode can be used to divide the current block into two non-rectangular partitions for prediction and then perform weighted fusion to obtain the prediction value of the current block.
[0004] In the prior art, in the prediction process of GEO, an angle mapping table and a weight mapping table are needed. Since the length of the weight mapping table of one partition is 27 when predicting the current block, the total length of the two partition mapping tables is 54, but the corresponding weight values in the 54 are composed of five kinds of {4, 5, 6, 7, 8}.
[0005] However, there are many repeated weights in the existing weight mapping table, and the weight table is too long, which makes the data storage overhead of inter-frame prediction larger and the text and code more complex. SUMMARY
[0006] Embodiments of the present application provide an inter-frame prediction method, an encoder, a decoder and a storage medium, which can simplify the text and code during inter-frame prediction and reduce the data storage overhead.
[0007] In a first aspect, embodiments of the present application provide an inter-frame prediction method applied to an encoder, the method comprising: determining a prediction mode parameter of a current block; when the prediction mode parameter indicates that a GEO mode is used to determine the inter-frame prediction of the current block, determining a GEO parameter of the current block; determining a first prediction value of a first partition of the current block and a second prediction value of a second partition of the current block according to the GEO parameter; determining a weight index corresponding to a pixel point in the current block according to the GEO parameter; The weight indices corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixels in the current block into the range of [0 to half of a preset value]. Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block. The first predicted value, the first weight value, the second predicted value, and the second weight value are used to perform weighted fusion of the pixels within the current block to obtain the inter-frame predicted value of the current block.
[0008] Secondly, embodiments of this application provide an inter-frame prediction method applied to a decoder, the method comprising: Analyze the bitstream to determine the prediction mode parameters for the current block; When the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), the bitstream is parsed to determine the GEO parameters of the current block. Based on the GEO parameters, determine the first predicted value of the first partition of the current block and the second predicted value of the second partition of the current block; Based on the GEO parameters, determine the weight index corresponding to the pixel in the current block; The weight indices corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixels in the current block into the range of [0 to half of a preset value]. Based on the absolute information of the weight index corresponding to the pixel in the current block, the first weight value and the second weight value of the pixel in the current block are determined. The first predicted value, the first weight value, the second predicted value, and the second weight value are used to determine the weighted fusion of pixels within the current block to obtain the inter-frame predicted value of the current block.
[0009] Thirdly, embodiments of this application provide an encoder, including: The first determining unit is used to determine the prediction mode parameters of the current block; when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), the GEO parameters of the current block are determined; based on the GEO parameters, the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block are determined; based on the GEO parameters, the weight index corresponding to the pixel in the current block is determined. The first embedding unit is used to perform embedding processing on the weight indexes corresponding to the pixels in the current block respectively to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixels in the current block into the range of [0 to half of a preset value]. The first determining unit is further configured to determine a first weight value and a second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block; The first prediction unit is used to perform weighted fusion of pixels within the current block using the first predicted value, the first weight value, the second predicted value, and the second weight value to obtain the inter-frame prediction value of the current block.
[0010] Fourthly, embodiments of this application provide a decoder, including: The parsing unit is used to parse the bitstream and determine the prediction mode parameters of the current block; The second determining unit is configured to, when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), parse the bitstream, determine the GEO parameters of the current block; determine the first prediction value of the first partition and the second prediction value of the second partition of the current block based on the GEO parameters; and determine the weight index corresponding to the pixel in the current block based on the GEO parameters. The second embedding unit is used to perform embedding processing on the weight indexes corresponding to the pixels in the current block respectively to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixels in the current block into the range of [0 to half of a preset value]. The second determining unit is used to determine the first weight value and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block. The second prediction unit is used to determine the weighted fusion of pixels within the current block using the first prediction value, the first weight value, the second prediction value, and the second weight value, to obtain the inter-frame prediction value of the current block.
[0011] Fifthly, embodiments of this application also provide an encoder, including: First memory and first processor; The first memory stores a computer program that can run on a first processor, which, when executed, implements the inter-frame prediction method of the encoder.
[0012] Sixthly, embodiments of this application also provide a decoder, including: Second memory and second processor; The second memory stores a computer program that can run on a second processor, which, when executing the program, implements the inter-frame prediction method of the decoder.
[0013] In a seventh aspect, embodiments of this application provide a storage medium, including: It stores a computer program that, when executed by a first processor, implements the inter-frame prediction method of the encoder; or, when executed by a second processor, implements the inter-frame prediction method of the decoder.
[0014] This application provides an inter-frame prediction method, encoder, decoder, and storage medium. The method involves determining prediction mode parameters for the current block; when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), determining the GEO parameters for the current block; determining a first prediction value for a first partition and a second prediction value for a second partition of the current block based on the GEO parameters; determining the weight index corresponding to a pixel within the current block based on the GEO parameters; performing a embedding process on the weight indices corresponding to pixels within the current block to obtain absolute information of the weight indices corresponding to pixels within the current block; wherein the embedding process embeds the values of the weight indices corresponding to pixels within the current block into the range of [0 to half a preset value]; determining a first weight value and a second weight value for pixels within the current block based on the absolute information of the weight indices corresponding to pixels within the current block; and performing a weighted fusion of the first prediction value, first weight value, second prediction value, and second weight value for pixels within the current block to obtain the inter-frame prediction value for the current block. By employing the above-described scheme, the encoder can determine the weight index corresponding to the pixel in the current block based on the GEO parameters during inter-frame prediction. Then, through absolute value embedding, the value of the weight index corresponding to the pixel in the current block is embedded within the range of [0 to half of the preset value]. This reduces the size of the preset value by half, thereby reducing the storage and use of the weight value corresponding to half of the absolute information of the weight index. This simplifies the text and code during inter-frame prediction and reduces the data storage overhead. Attached Figure Description
[0015] Figure 1 This application provides a schematic block diagram of a video encoding system. Figure 2 This application provides a schematic block diagram of a video decoding system according to an embodiment of the present application. Figure 3 A schematic diagram of the implementation process of an intra-frame prediction method provided in this application embodiment. Figure 1 ; Figures 4a-4gA schematic diagram illustrating seven exemplary partitioning patterns provided for embodiments of this application; Figure 5 A schematic diagram illustrating the angle and step size of an exemplary current block provided in an embodiment of this application; Figure 6a A schematic diagram illustrating an exemplary first weighted value for brightness provided in an embodiment of this application; Figure 6b A schematic diagram illustrating an exemplary first weighted value for chromaticity provided in an embodiment of this application; Figure 7 A schematic diagram of the implementation process of an intra-frame prediction method provided in this application embodiment. Figure 2 ; Figure 8 A schematic diagram illustrating an exemplary preset motion mask matrix 1 and current motion mask matrices 2, 3, and 4 provided for embodiments of this application; Figure 9 A schematic diagram illustrating the implementation process of an intra-frame prediction method provided in this application embodiment; Figure 10 A schematic diagram of an encoder provided in an embodiment of this application. Figure 1 ; Figure 11 A schematic diagram of an encoder provided in an embodiment of this application. Figure 2 ; Figure 12 A schematic diagram of the structure of a decoder provided in an embodiment of this application. Figure 1 ; Figure 13 A schematic diagram of the structure of a decoder provided in an embodiment of this application. Figure 2 . Detailed Implementation
[0016] This application provides a video encoding system, such as... Figure 1 As shown, the video encoding system 11 includes: The system comprises a transform unit 111, a quantization unit 112, a mode selection and encoding control logic unit 113, an intra-frame prediction unit 114, an inter-frame 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 decoding image buffer unit 110; for the input raw video signal, it uses coding tree blocks (Coding Tree) to transform the signal. A video reconstruction block can be obtained by dividing the video reconstruction unit (CTU). The coding mode is determined by the mode selection and coding control logic unit 113. Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transform unit 111 and the quantization unit 112. This includes transforming the residual information from the pixel domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame prediction unit 114 is used to perform intra-frame prediction on the video reconstruction block. The intra-frame prediction unit 114 is used to determine the optimal intra-frame prediction mode (i.e., the target prediction mode) of the video reconstruction block. The inter-frame prediction unit 115 is used to perform inter-frame prediction coding of the received video reconstruction block relative to one or more blocks in one or more reference frames to provide temporal prediction information. Motion estimation is used to generate motion. The motion vector estimation process estimates the motion of the video reconstruction block. Motion compensation is then performed based on the motion vector determined by the motion estimation. After determining the inter-frame prediction mode, the inter-frame prediction unit 115 provides the selected inter-frame prediction data to the encoding unit 119 and also sends the calculated motion vector data to the encoding unit 119. Furthermore, the inverse quantization unit 116 and the inverse transform unit 117 reconstruct the video reconstruction block, reconstructing a residual block in the pixel domain. This reconstructed residual block is then filtered by the loop filter unit 118 to remove block artifacts. The reconstructed residual block is then added to a predictive block in the frame of the decoding image buffer unit 110 to generate the reconstructed video reconstruction block. The encoding unit 119 encodes various encoding parameters and quantized transform coefficients. The decoding image buffer unit 110 stores the reconstructed video reconstruction block for prediction reference. As video image encoding progresses, new reconstructed video reconstruction blocks are continuously generated and stored in the decoding image buffer unit 110.
[0017] This application provides a video decoding system. Figure 2 This is a schematic diagram of the composition structure of the video decoding system according to an embodiment of this application, as shown below. Figure 2 As shown, the video decoding system 12 includes: The system comprises a decoding unit 121, an inverse transform unit 127, an inverse quantization unit 122, an intra-frame prediction unit 123, a motion compensation unit 124, a loop filter unit 125, and a decoded image buffer unit 126. The input video signal is encoded by the video encoding system 11, and the resulting bitstream is output. This bitstream is input into the video decoding system 12, first passing through the decoding unit 121 to obtain the decoded transform coefficients. These transform coefficients are then processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate residual blocks in the pixel domain. The intra-frame prediction unit 123 can generate prediction data for the current video decoding block based on the determined intra-frame prediction direction and data from previously decoded blocks in the current frame or image. The motion compensation unit... 124 determines the prediction information for the video decoding block by analyzing motion vectors and other associated syntax elements, and uses the prediction information to generate a predictive block of the video decoding block being decoded; the decoded video block is formed by summing the residual block from the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding predictive block generated by the intra-frame prediction unit 123 or the motion compensation unit 124; the decoded video signal is passed through the loop filter unit 125 to remove block artifacts, which can improve video quality; then the decoded video block is stored in the decoded image buffer unit 126, which stores reference images for subsequent intra-frame prediction or motion compensation, and is also used for the output of the video signal to obtain the recovered original video signal.
[0018] The inter-frame prediction method provided in this application embodiment mainly operates on the inter-frame prediction unit 115 of the video coding system 11 and the inter-frame prediction unit, i.e., the motion compensation unit 124, of the video decoding system 12. In other words, if the video coding system 11 can obtain a better prediction effect through the inter-frame prediction method provided in this application embodiment, then correspondingly, the video decoding and recovery quality can also be improved at the decoding end.
[0019] Based on this, the technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Before proceeding with the detailed description, it should be noted that the terms "first," "second," and "third," etc., mentioned throughout the specification are merely for distinguishing different features and do not have the function of limiting priority, order, or size relationship.
[0020] This application provides an inter-frame prediction method applied to a video encoding device, i.e., an encoder. The functionality achieved by this method can be implemented by a processor in the video encoding device calling program code. Of course, the program code can be stored in a computer storage medium. Therefore, the video encoding device includes at least a processor and a storage medium.
[0021] Figure 3This is a schematic diagram illustrating the implementation process of an intra-frame prediction method according to an embodiment of this application, as shown below. Figure 3 As shown, the method includes: S101. Determine the prediction mode parameters for the current block.
[0022] In this embodiment of the application, a video image can be divided into multiple image blocks. Each image block to be encoded can be called 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 the coding block in the video image to be predicted for the first image component, the second image component, or the third image component.
[0023] In this context, if the current block performs prediction of the first image component, and the first image component is the luminance component, that is, the image component to be predicted is the luminance component, then the current block can also be called the luminance block; or, if the current block performs prediction of the second image component, and the second image component is the chrominance component, that is, the image component to be predicted is the chrominance component, then the current block can also be called the chrominance block.
[0024] It should also be noted that the prediction mode parameters indicate the coding mode of the current block and the parameters associated with that mode. Rate Distortion Optimization (RDO) is typically used to determine the prediction mode parameters of the current block.
[0025] Specifically, in some embodiments, the encoder determines the prediction mode parameters of the current block as follows: the encoder determines the image components to be predicted in the current block; based on the parameters of the current block, it performs prediction encoding on the image components to be predicted using multiple prediction modes, calculates the rate-distortion cost result corresponding to each prediction mode under multiple prediction modes; selects the minimum rate-distortion cost result from the multiple calculated rate-distortion cost results, and determines the prediction mode corresponding to the minimum rate-distortion cost result as the prediction mode parameters of the current block.
[0026] In other words, on the encoder side, multiple prediction modes can be used to encode the image components to be predicted for the current block. Here, multiple prediction modes typically include inter-frame prediction modes, traditional intra-frame prediction modes, and non-traditional intra-frame prediction modes. Traditional intra-frame prediction modes can include Direct Current (DC) mode, Planar mode, and Angle mode, etc. Non-traditional intra-frame prediction modes can include MIP mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode, and PLT (Palette) mode, etc. Inter-frame prediction modes can include Geometrical partitioning for inter blocks (GEO) mode, Triangle partitioning mode (TPM) mode, etc.
[0027] In this way, after encoding the current block using multiple prediction modes, the rate-distortion cost result corresponding to each prediction mode can be obtained. Then, the minimum rate-distortion cost result is selected from the multiple rate-distortion cost results, and the prediction mode corresponding to the minimum rate-distortion cost result is determined as the prediction mode parameter of the current block. In this way, the current block can be encoded using the determined prediction mode. Moreover, under this prediction mode, the prediction residual can be small, which can improve the coding efficiency.
[0028] S102. When the prediction mode parameters indicate that GEO is used to determine the inter-frame prediction of the current block, determine the GEO parameters of the current block.
[0029] In this embodiment, when the prediction mode parameter indicates that the inter-frame prediction of the current block is determined using GEO, the GEO parameters of the current block can be obtained or determined. Here, in this embodiment, the current block refers to an inter-frame block.
[0030] In this embodiment, the GEO parameters of the current block include: angle index information and size information of the current block, and may also include: step size index information and target partitioning mode, etc.
[0031] It should be noted that, in this embodiment, GEO targets the object edges in the image, dividing the inter-frame block (i.e., the current block) into two non-rectangular sub-partitions, predicting them separately, and then performing weighted fusion. For example, the non-rectangular form can be as follows: Figures 4a-4g As shown.
[0032] In the current VVC Draft7, GEO has a total of 82 partitioning modes. Each partitioning mode corresponds to an angle α and a step size ρ. The angle is divided into 24 types, so there are 24 types of angles and 4 types of step sizes. Thus, there are 96 combinations of angles and step sizes.
[0033] It should be noted that the angle table is replaced by a slope-based angle table, using five fixed slopes (1, 1 / 2, 1 / 4, 4, 2) to construct an angle table with unequal intervals.
[0034] For example, such as Figure 5 As shown, each combination of angle α and step size ρ constitutes a partitioning pattern (after removing all the first step sizes with angle indices of 0, 6, 12~23, 82 partitioning patterns are obtained). GEO's partitioning patterns include the TPM pattern, which is unified and replaced. GEO divides the current block into two non-rectangular sub-partitions. Each sub-partition undergoes unidirectional motion compensation to obtain a unidirectional prediction value. Finally, the unidirectional prediction values of the two sub-partitions are weighted and fused using the weight matrix corresponding to the current block to obtain the final GEO prediction value.
[0035] In the embodiments of this application, when it is determined on the encoder side that GEO is used for inter-frame prediction, the encoder can obtain the GEO parameters when the current block uses GEO for inter-frame prediction.
[0036] In this embodiment, the encoder determines the partitioning mode with the lowest rate-distortion cost by traversing the 82 partitioning models corresponding to GEO, i.e., determining the target partitioning mode. The encoder can then determine the angle index and step size index information corresponding to the target partitioning mode based on a mapping table of preset partitioning modes, angle indices, and step size indices. The mapping table of preset partitioning modes, angle indices, and step size indices is shown in Table 1. Table 1
[0037] Among them, wedge_partition_idx is the partitioning mode index, angleIdx is the angle index information, and distanceIdx is the step size index information.
[0038] S103. Based on the GEO parameters, determine the first predicted value of the first partition of the current block and the second predicted value of the second partition of the current block.
[0039] In this embodiment, since the GEO parameters may include angle index information and target partitioning mode, the encoder can partition the current block according to the target partitioning mode to obtain a first partition and a second partition; from the preset merging candidate list, the encoder determines the first motion information of the first reference block corresponding to the first partition and the second motion information of the second reference block corresponding to the second partition; the encoder performs motion compensation according to the first motion information to obtain the first predicted value of the first partition, and the encoder performs motion compensation according to the second motion information to obtain the second predicted value of the second partition.
[0040] It should be noted that in the embodiments of this application, GEO uses the original TPM unidirectional Merge candidate list in VVC7, that is, the preset merge candidate list, to find the MV of each of the two partitions after the division of GEO, that is, the motion information.
[0041] The Merge candidate list typically includes a preset number of reference blocks, which can be up to six. Each element stores data in the form of a structure, which may contain motion information for the reference block, a list of reference frames, and the prediction direction. The data corresponding to GEO is stored in 4x4 blocks.
[0042] In this embodiment, information such as angle index information, step index information, first motion information, and second motion information needs to be written into the bitstream during encoding for use during decoding.
[0043] S104. Determine the weight index corresponding to the pixel in the current block based on the GEO parameters.
[0044] The GEO parameters include the size and angle index information of the current block. The size information refers to the height and width of the current block. The current block contains many pixels. The encoder can determine the position information of the pixels within the current block based on the size information. Based on the position information of each pixel within the current block, the angle index information, and the updated angle mapping table, the weight index corresponding to each pixel within the current block can be calculated.
[0045] The detailed acquisition process will be described in subsequent embodiments.
[0046] S105. Perform embedding processing on the weight indices corresponding to the pixels in the current block to obtain the absolute information of the weight indices corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixel in the current block into the range of [0 to half of the preset value].
[0047] After the encoder acquires the pixels within the current block, it takes the absolute value of the weight index corresponding to each pixel within the current block and embeds the result within the range of [0 to half of a preset value] to obtain the absolute information of the weight index corresponding to each pixel within the current block. Specifically, if the absolute value of the weight index of a pixel exceeds half of the preset value, the absolute information of the weight index corresponding to that pixel is half of the preset value; if the absolute value of the weight index of a pixel does not exceed half of the preset value, the absolute value of the weight index of that pixel is its absolute information.
[0048] In this embodiment of the application, the preset value is 26, so the absolute information of the weight index is in the range of [0-13].
[0049] For example, using the ternary operator implementation, the absolute information of the weight index can be obtained through expression (1), which is as follows: weightIdxAbs = Clip3(0, 13, abs(weightIdx)) (1) Wherein, weightIdxAbs is the absolute information of the weight index, weightIdx is the weight index, abs() is the absolute value function, and Clip3() is the embedding function.
[0050] S106. Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block.
[0051] After obtaining the absolute information of the weight index corresponding to the pixel in the current block, the encoder can first determine the weight value corresponding to the absolute information of the weight index based on the weight index of the pixel in the current block and the absolute information of the weight index. Then, based on the weight value corresponding to the absolute information of the weight index, it can determine the weight value of the first pixel of the first partition and the weight value of the second pixel of the second partition from the pixels in the current block. Then, based on the weight value of the first pixel of the first partition and the weight value of the second pixel of the second partition, it can determine the first weight value of the pixel in the current block corresponding to the first partition. Finally, based on the first weight value, it can determine the second weight value of the pixel in the current block corresponding to the second partition.
[0052] It should be noted that, in this embodiment, when the weight index of a pixel within the current block is less than or equal to 0, it indicates that the pixel belongs to the first partition; when the weight index of a pixel within the current block is greater than 0, it indicates that the pixel belongs to the second partition. The process of obtaining the first weight value of a pixel within the current block based on the first partition can be as follows: Obtain the absolute information of the first weight index corresponding to the first pixel of the first partition and the absolute information of the second weight index corresponding to the second pixel of the second partition from the absolute information of the weight index corresponding to the pixel within the current block; obtain the weight value of the first pixel based on the absolute information of the first weight index; obtain the weight value of the second pixel based on the absolute information of the second weight index; and obtain the first weight value of the pixel within the current block corresponding to the first partition based on the weight values of the first and second pixels. The second weight value of the pixel within the current block is then: 8 - the first weight value.
[0053] In this embodiment of the application, the encoder determines the first weight value and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block. The specific implementation of this can include the following five methods.
[0054] Method 1: When the absolute information of the weight index is less than the preset index threshold, the encoder performs a right shift of the absolute information of the weight index by a preset number of bits, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index. When the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder performs a right shift of the absolute information of the weight index by a preset number of bits, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index. The encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block. The encoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0055] In this embodiment, since the absolute information of the weight index is within the range of [0 - half of the preset value], the encoder can first calculate the weight value corresponding to each absolute information of the weight index within the range of [0 - half of the preset value] based on the absolute information of the weight index of the pixels in the current block. Specifically, when the absolute information of the weight index is less than the preset index threshold, the encoder adds the first value to the absolute information of the weight index, shifts it to the right by a preset number, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index. When the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder combines the absolute information of the weight index with the second value, shifts it to the right by a preset number, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index.
[0056] For example, using the ternary operator implementation, the weight value corresponding to the absolute information of the weight index can be obtained through expression (2), which is as follows: WedgeFilter= weightIdxAbs<9 ? ((weightIdxAbs + 2)>>2)+4 :((weightIdxAbs + 3)>>2)+4 (2) The preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset position is 2; WedgeFilter is the weight value corresponding to weightIdxAbs; and weightIdxAbs is an absolute information of a weight index.
[0057] It should be noted that the result of the right shift in expression (2) only takes the integer part.
[0058] Using a piecewise mapping function, the weight value corresponding to the absolute information of the weight index can be obtained through expression (3), which is as follows: (3) Where WedgeFilter is the weight value corresponding to weightIdxAbs, and weightIdxAbs is an absolute information of a weight index.
[0059] 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 and 13. Then the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) are calculated according to expression (2) or (3) as follows: 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8.
[0060] Understandably, the encoder integrates the weight lookup process into the GEO operation by using a piecewise function. The corresponding weight is directly and simply calculated through the weight index of GEO, eliminating the need for the weight mapping table and lookup operation. In effect, it implicitly achieves lossless reduction of the GEO weight table.
[0061] In this embodiment, the encoder obtains the first absolute weight index information corresponding to the first pixel of the first partition and the second absolute weight index information corresponding to the second pixel of the second partition based on the weight value corresponding to the absolute weight index information and the weight index corresponding to the pixel of the current block; obtains the weight value of the first pixel based on the first absolute weight index information, and obtains the weight value of the second pixel based on the second absolute weight index information; and obtains the first weight value of the pixel of the current block corresponding to the first partition based on the weight value of the first pixel and the weight value of the second pixel.
[0062] For example, the first weight value of each pixel can be obtained using expression (4), which is as follows: sampleWeight = weightIdx<= 0 ? WedgeFilter : 8 – WedgeFilter (4) Where sampleWeight is the weight value of a pixel, weightIdx is the weight index of that pixel, and WedgeFilter is the weight value corresponding to the absolute weight information of a pixel.
[0063] As can be seen from expression (4), when obtaining the first weight value of the pixels in the current block based on the first partition, it is necessary to determine the weight value of each pixel in the two partitions in order to obtain the first weight of the pixels in the current block. The second weight of the pixels in the current block based on the second partition is obtained by subtracting the first weight value of the pixels in the current block from 8.
[0064] Method 2: The encoder combines the absolute information of the weight index with the first value and whether the absolute information of the weight index is greater than 8, then performs a right shift by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the encoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0065] In this embodiment, since the range of absolute information of weight index is within the range of [0 - half of the preset value], the encoder can first calculate the weight value corresponding to each absolute information of weight index within the range of [0 - half of the preset value] based on the absolute information of weight index of the pixel in the current block. Specifically, the encoder adds the first value to the absolute information of weight index, checks whether the absolute information of weight index is greater than 8, then performs right shift by a preset number, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of weight index.
[0066] For example, using the ternary operator implementation, the weight value corresponding to the absolute information of the weight index can be obtained through expression (5), which is as follows: WedgeFilter= ((weightIdxAbs + 2+(weightIdxAbs>8))>>2)+4 (5) Wherein, the first value is 2; the preset weight value is 4; the preset position is 2; WedgeFilter is the weight value corresponding to weightIdxAbs; and weightIdxAbs is an absolute information of a weight index.
[0067] It should be noted that the result of the right shift in expression (3) only takes the integer part. When the absolute information of the weight index is greater than 8, the value is 1, and when it is less than or equal to 8, the value is 0.
[0068] 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 and 13. Then the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) are calculated according to expression (5) as follows: 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8.
[0069] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. This process is consistent with the implementation description of Method 1 and will not be repeated here.
[0070] Method 3: The encoder combines the absolute information of the weight index with the first value and the sign value of 8 minus the absolute information of the weight index, then performs a right shift by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; based on the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.
[0071] In this embodiment, since the range of absolute information of weight index is within the range of [0 - half of the preset value], the encoder can first calculate the weight value corresponding to each absolute information of weight index within the range of [0 - half of the preset value] based on the absolute information of weight index of the pixel in the current block. Specifically, the encoder adds the first value to the absolute information of weight index and the value of 8 minus the sign of the absolute information of weight index, then performs right shift by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of weight index.
[0072] For example, using the ternary operator implementation, the weight value corresponding to the absolute information of the weight index can be obtained through expression (6), which is as follows: WedgeFilter= ((weightIdxAbs + 2+sign(8-weightIdxAbs ))>>2)+4 (6) The first value is 2; the preset weight value is 4; the preset position is 2; WedgeFilter is the weight value corresponding to weightIdxAbs; weightIdxAbs is an absolute information of a weight index; sign() is the sign function, which is 1 when 8-weightIdxAbs<0 and 0 when 8-weightIdxAbs is greater than or equal to 0.
[0073] 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 and 13. Then the weight values of the absolute information of the weight index (WedgeFilter[weightIdxAbs]) are calculated according to expression (5) as follows: 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7 and 8.
[0074] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. This process is consistent with the implementation description of Method 1 and will not be repeated here.
[0075] Furthermore, in order to achieve a calculation result similar to that of expression (6), expression (7) or expression (8) can also be used, etc., and this application embodiment does not impose any restrictions. As follows: WedgeFilter= ((weightIdxAbs + 2))>>2)+4 (7) WedgeFilter= ((weightIdxAbs + 1))>>2)+4 (8) Method 4: The encoder retrieves the weight value corresponding to the absolute information of the weight index from a preset weight mapping table based on the absolute information of the weight index. The preset weight mapping table is obtained by embedding the weight indexes corresponding to the pixels in the current block with a preset value of half. The encoder determines the first weight value of the pixels 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 indexes corresponding to the pixels in the current block. The encoder obtains the second weight value of the pixels in the current block corresponding to the second partition based on the first weight value.
[0076] In this embodiment of the application, the encoder can obtain weight values from 0 to half of a preset value based on any one of the methods one to three, and use this as a preset weight mapping table. When the encoder obtains the weight index absolute information of the pixels in the current block, it can look up the weight value corresponding to each pixel in the preset weight mapping table.
[0077] For example, the preset weight mapping table is shown in Table 2.
[0078] Table 2
[0079] It should be noted that the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, and obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value. This process is consistent with the implementation description of Method 1 and will not be repeated here.
[0080] Method 5: When the absolute information of the weight index is less than the preset index threshold, the encoder performs a right shift of the absolute information of the weight index by a preset number of bits in combination with the first value to obtain a new weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the encoder performs a right shift of the absolute information of the weight index by a preset number of bits in combination with the second value to obtain a new weight index; the encoder obtains the new weight value corresponding to the new weight index from the preset new weight mapping table; when the weight index information is less than or equal to 0, the encoder determines the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, the encoder determines the weight value corresponding to the absolute information of the weight index by 8; the encoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the encoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0081] In this embodiment of the application, a preset new weight mapping table is set to represent the correspondence between weight values and weight index information. The weight values have no duplicate values, and the weight index information belongs to [0-half of the preset value]. The number of specific weight index information is consistent with the number of weight values, as shown in Table 3.
[0082] Table 3
[0083] Where ReduceIdx is the weight index information, and WedgeFilter[ReduceIdx] is the weight value.
[0084] When the encoder obtains the absolute weight index information of the pixels in the current block, if the absolute weight index information is less than the preset index threshold, the encoder adds a first value to the absolute weight index information and shifts it to the right by a preset number of bits to obtain a new weight index; if the absolute weight index information is greater than or equal to the preset index threshold, the encoder adds a second value to the absolute weight index information and shifts it to the right by a preset number of bits to obtain a new weight index.
[0085] For example, using the ternary operator implementation, the new weight index can be obtained through expression (9), which is as follows: ReduceIdx=WeightIdxabs<9 ? ((WeightIdxabs + 2)>>2) : ((WeightIdxabs +3)>>2) (9) Where ReduceIdx is the new weight index, WeightIdxabs is the absolute information of the weight index of a pixel, the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; and the preset bit is 2.
[0086] It should be noted that the result of the right shift in expression (9) only takes the integer part.
[0087] Using a piecewise mapping function, the new weight index can also be obtained through expression (10), which is as follows: (10) In this embodiment, the encoder can obtain the weight value corresponding to the absolute information of the weight index of each pixel in the current block from the preset new weight mapping table, that is, the new weight value WedgeFilter[ReduceIdx] corresponding to the new weight index. When the weight index information of each pixel is less than or equal to 0, the encoder will determine the weight value corresponding to the absolute information of the weight index with the new weight value; when the weight index information is greater than 0, the encoder will determine the weight value corresponding to the absolute information of the weight index with the new weight value.
[0088] In this embodiment, the encoder obtains the first absolute weight index information corresponding to the first pixel of the first partition and the second absolute weight index information corresponding to the second pixel of the second partition based on the weight value corresponding to the absolute weight index information and the weight index corresponding to the pixel of the current block; obtains the weight value of the first pixel based on the first absolute weight index information, and obtains the weight value of the second pixel based on the second absolute weight index information; and obtains the first weight value of the pixel of the current block corresponding to the first partition based on the weight value of the first pixel and the weight value of the second pixel.
[0089] For example, the first weight value of each pixel can be obtained using expression (11), which is as follows: sampleWeight = weightIdx<= 0 ? WedgeFilter[ReduceIdx] : 8 WedgeFilter[ReduceIdx] (11) Where sampleWeight is the weight value of a pixel, weightIdx is the weight index of that pixel, and WedgeFilter[ReduceIdx] is the new weight value corresponding to the absolute weight information of a pixel.
[0090] Understandably, the encoder simplifies the weight mapping table of GEO by deriving the GEO weights during the calculation process using feasible mathematical formulas. This eliminates the need for the weight mapping table and lookup operations, while also implicitly reducing the original weight mapping table. This further simplifies the code and text, and also reduces the storage overhead of the weight mapping table.
[0091] S107. Use the first predicted value, the first weight value, the second predicted value, and the second weight value to perform weighted fusion of the pixels in the current block to obtain the inter-frame predicted value of the current block.
[0092] In this embodiment of the application, the encoder can perform weighted fusion of pixels within the current block by multiplying the first predicted value of each pixel by the first weight value, and adding the product of the second predicted value of each pixel by the second weight value, to obtain the inter-frame predicted value of the current block.
[0093] It should be noted that the first predicted value and the second predicted value are two predicted values corresponding to each pixel in the current block, and the first weight value and the second weight value also correspond to two different weight values for each pixel in the current block.
[0094] The inter-frame prediction value of the current block can be obtained using expression (23), as shown below: pbSamples[x][y]=Clip3(0,(1< <bitDepth)–1,(predSamplesLPART1[x][y]*(8–sampleWeight1)+predSamplesLPART2[x][y]*sampleWeight2+offset1)> >shift1)(23) Where pbSamples[x][y] is the inter-frame prediction value for each pixel in the current block, predSamplesLPART1[x][y] is the first prediction value for each pixel, sampleWeight1 is the first weight value for each pixel, predSamplesLPART2[x][y] is the second prediction value for each pixel, and sampleWeight2 is the second weight value for each pixel.
[0095] In some embodiments of this application, when the encoder performs inter-frame prediction for the current block, it predicts the video components separately. That is, the first prediction value and the second prediction value both include a luminance prediction value and a chrominance prediction value.
[0096] In this embodiment of the application, the encoder can first obtain the weight value of the luminance component, and the weight value of the chrominance component can be obtained based on the weight value of the luminance component.
[0097] The first and second weight values mentioned above in this application can be the weight values of the luminance component.
[0098] It should be noted that the encoder obtains the luminance sample weight of the upper right corner of each 2*2 block and directly uses it as the chrominance sample weight at the current (x, y) position, that is, it downsamples the luminance sample weight.
[0099] For example, such as Figure 6a The first weight of brightness is shown below. Downsampling this weight yields... Figure 6b The first weight value of chroma shown can be used similarly to the second weight of luminance. After downsampling, the second weight of the luminance sample in the upper right corner of each 2*2 block can be directly used as the second weight of the chroma sample at the current (x, y) position.
[0100] Understandably, during inter-frame prediction, the encoder can determine the weight index corresponding to the pixel in the current block based on the GEO parameters. Then, through absolute value embedding, the value of the weight index corresponding to the pixel in the current block is embedded within the range of [0 to half of the preset value]. This reduces the size by half of the preset value, thereby reducing the storage and use of the weight value corresponding to half of the absolute information of the weight index. This simplifies the text and code during inter-frame prediction and reduces the overhead of data storage.
[0101] In some embodiments of this application, such as Figure 7 As shown, the GEO parameters of the current block include: angle index information and the size information of the current block. The implementation of S104 in the inter-frame prediction method provided in this application embodiment may include: S1041. Determine the position information of the pixels within the current block based on the size information of the current block; S1042. Based on the angle index information and the preset angle mapping table, and combined with the position information of the pixels in the current block, determine the weight index corresponding to the pixels in the current block.
[0102] In this embodiment, the size information of the current block of the encoder includes the height H and the width W of the current block. This allows the coordinate region where the current block is located to be determined, and thus the position information of each pixel within the current block, i.e., the coordinate information (x, y) of each pixel. The encoder can determine the weight index corresponding to the pixel within the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel within the current block.
[0103] In some embodiments of this application, the encoder can determine the weight index corresponding to the pixel in the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel in the current block. The implementation process is as follows: the encoder determines the cosine angle index information and the sine angle index information based on the angle index information; the encoder performs power reduction processing on the angles in the preset angle mapping table to obtain the updated angle mapping table; the encoder determines the weight index corresponding to the pixel in the current block based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block, respectively.
[0104] It should be noted that the preset angle mapping table is the angle mapping table used in the prior art, as shown in Table 4: Table 4
[0105] Where angleIdx is the angle index information, and Dis[angleIdx] is the angle.
[0106] In this embodiment, the encoder performs power-down processing on the angles in the preset angle mapping table, resulting in angles in the updated angle mapping table that are all angle values in the preset angle mapping table that have been reduced to a power. As shown in Table 5: Table 5
[0107] In this process, the original preset angle mapping table is deleted from the encoder, and only the updated angle mapping table is retained, which reduces storage overhead.
[0108] In this embodiment of the application, the encoder determines the weight index corresponding to the pixel in the current block based on the cosine angle index information, sine angle index information, and the updated angle mapping table, combined with the position information of the pixel in the current block. In the process of determining the weight index of the pixel in the current block, the encoder first needs to determine 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 determine the weight index of each pixel based on the cosine angle index information, the sine angle index information, the updated angle mapping table, the position information of the pixel in the current block, and rho.
[0109] For example, the cosine angle index information can be obtained according to expression (12), and the sine angle index information can be obtained according to expression (13). Expressions (12) and (13) are as follows: displacementX= angleIdx (12) displacementY=(displacementX + 6)%24 (13) Where displacementX is the cosine angle index information, displacementY is the sine angle index information, and angleIdx is the angle index information.
[0110] It should be noted that the cos(α) index number corresponding to the current angle is displacementX, and the corresponding -sin(α) index number is displacementY.
[0111] The value of rho can be obtained from expression (14), which is as follows: rho=(Dis [displacementX]<<8) + (Dis[displacementY]<<8) (14) Where 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. The cosine angle and sine angle can be obtained by updating the mapping table.
[0112] The weight index of each pixel in the current block can be obtained by expression (15), which is as follows: weightIdx = ((x<<1) + 1)*Dis[displacementX] + ((y<<1) + 1))*Dis[displacementY] – rho (15) Where weightIdx is the weight index of a pixel, x is the x-coordinate of the pixel, and y is the y-coordinate of the pixel. The position information of a pixel is (x, y).
[0113] It is understandable that by looking up the weight mapping table through the obtained index to get the corresponding weight, it can be found that each step of the above calculation needs to be multiplied with the angles Dis[displacementX] and Dis[displacementY]. However, this solution removes the weight mapping table and designs a mathematical method to implicitly reduce the weight mapping table by half. Therefore, it is necessary to divide by 2 in each step of calculating the weight index and motion index. However, since the values in the angle mapping table are all powers of 2, the weight index and motion index can be divided by 2 by reducing the power of the angle mapping table, and then correspond to the reduced weight mapping table.
[0114] In some embodiments of this application, after step S107 of the inter-frame prediction method provided in this application, the method may further include: S108. Based on the cosine angle index information, sine angle index information, and updated angle mapping table, determine the motion offset value, and based on the angle index information, step size index information, and current block size information, obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block.
[0115] S109. Based on the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel at the top 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, obtain the motion index information.
[0116] S110. When the absolute value of the motion index information is less than half of the preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block.
[0117] S111. When the motion index information is less than or equal to 0, the first motion information is determined as the motion information of the current block.
[0118] S112. When the motion index information is greater than 0, the second motion information is determined as the motion information of the current block.
[0119] S113. Store the motion information of the current block in the preset merge candidate list.
[0120] In this embodiment, when encoding the current block, the encoder also needs to store the motion information of the current block for use in inter-frame prediction of subsequent encoded blocks. The encoder calculates the first angle and the second angle based on the cosine angle index information, the sine angle index information, and the updated angle mapping table, and then obtains the 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 horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel at the top left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information. When the absolute value of the motion index information is less than half of the preset motion index threshold, the encoder determines the first motion information and the second motion information as the motion information of the current block. When the motion index information is less than or equal to 0, the encoder determines the first motion information as the motion information of the current block. When the motion index information is greater than 0, the encoder determines the second motion information as the motion information of the current block. The motion information of the current block is stored in a preset merging candidate list.
[0121] For example, the motion offset value motionOffset can be obtained using expression (16), which is as follows: motionOffset = 3*Dis[displacementX]+ 3*Dis[displacementY] (16) In this embodiment, since the GEO parameters also include step index information, the encoder can obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block based on the angle index information, step index information, and the size information of the current block. When shiftHor==0, this can be achieved using expressions (17) and (18), which are as follows: offsetX = (64) numSbX )>>1 (17) offsetY=(64 numSbY)>>1+angleIdx<12?(distanceIdx*nCbH)>>3: ((distanceIdx*nCbH)>>3) (18) Where offsetX is the horizontal coordinate offset value, offsetY is the vertical coordinate offset value, angleIdx is the angle index information, distanceIdx is the 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.
[0122] In this embodiment, since the GEO parameters also include step index information, the encoder can obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block based on the angle index information, step index information, and the size information of the current block. When shiftHor==1, this can be achieved using expressions (19) and (20), which are as follows: offsetX=(64 numSbX)>>1+angleIdx<12?(distanceIdx*nCbW)>>3: ((distanceIdx * nCbW)>>3) (19) offsetY = (64) numSbY )>>1 (20) Where offsetX is the horizontal coordinate offset value, offsetY is the vertical coordinate offset value, angleIdx is the angle index information, distanceIdx is the 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.
[0123] For example, in this embodiment of the application, the encoder obtains motion index information based on motion offset value, motion horizontal coordinate offset value, motion vertical coordinate offset value, position information of the pixel point at the upper left corner of the current block, first angle corresponding to cosine angle index information, and second angle corresponding to sine angle index information. This can be achieved by expression (21), which is as follows: motionIdx=(((xSbIdx+ offsetX)<<3) +1)*Dis[displacementX]+ (((ySbIdx +offsetY<<3) +1))*Dis[displacementY] – rho + motionOffset (21) Where motionIdx is the motion index information, the position information of the top left pixel of the current block (xSbIdx, ySbIdx), offsetX is the horizontal coordinate offset value, offsetY is the vertical coordinate offset value, Dis[displacementX] is the first angle, Dis[displacementY] is the second angle, rho is the vertical distance from the block center point to the current dividing line obtained based on the first and second angles, and motionOffset is the motion offset value.
[0124] It should be noted that ShiftHor is the horizontal offset, with a value of 0. The value of 1 is used to determine the offset required on the Y-axis and the X-axis.
[0125] If (angleIdx % 12 == 6)||( angleIdx % 12 != 0&&hwRatio ≥ 1), ShiftHor=0; Otherwise, ShiftHor=1.
[0126] In some embodiments of this application, the encoder can 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 merging candidate list.
[0127] In some embodiments of this application, the encoder can also determine the motion information of the current block based on the motion index information. When the absolute value of the motion index information is less than half of a preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block; when the motion index information is less than or equal to 0, the first motion information is determined as the motion information of the current block; when the motion index information is greater than 0, the second motion information is determined as the motion information of the current block; and the motion information of the current block is stored in a preset merging candidate list.
[0128] Assuming the current block is 16×16, the encoder determines whether the current sub-block stores data in one direction or two directions based on the size of abs(motionIdx) at each 4×4 sub-block.
[0129] For example, if abs(motionIdx) < 16, the current block stores the constructed bidirectional motion information, namely 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.
[0130] The preset motion index threshold is 32.
[0131] It should be noted that, in the embodiments of this application, the encoder can first obtain the motion mask matrix, and then, based on the motion horizontal coordinate offset value and the motion vertical coordinate offset value, cut out the current motion mask matrix of the current block from the preset motion mask matrix.
[0132] For example, such as Figure 8 The preset motion mask matrix 1 shown can be used to cut out different current motion mask matrices 2, 3 and 4 from 1 by taking the size A of the current block, based on different partitioning modes, angles ψ, step size ρ, offsetX and offsetY.
[0133] It should be noted that, since GEO inherits the way TPM stores motion information, the motion information in GEO mode is still stored in 4×4 blocks. Therefore, the size of the predefined motion mask matrix in GEO is 56*56. The motion information of each 4×4 block is determined by the weighted weight of its upper left corner. Finally, the motion masks of all 4×4 blocks are stored in a 56×56 matrix. Specifically, the encoder obtains the motion offset value motionOffset through expression (16). Based on the position information (x, y) of each pixel in the 56×56 matrix, motionOffset, rho, first angle and second angle, the complete motion index information motionIdx1 is obtained. As shown in expression (22): motionIdx1=((x<<3)+1)*Dis[displacementX]+((y<<3+1))*Dis[displacementY] – rho + motionOffset (22) The motion information in the 56×56 preset motion mask matrix is masked based on abs(motionIdx1) and motionIdx1.
[0134] For example, if abs(motionIdx) < 16, the motion mask of the current 4×4 sub-block is 2 (representing bidirectional motion information). otherwise, 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 4×4 sub-block is 1 (representing the second motion information).
[0135] It should be noted that, in this embodiment, there are actually a total of 7 pre-stored mask matrices (including weighted mask matrices and motion mask matrices), corresponding to the first step size case of passing the block center point at 7 angles between 0 and 90 degrees. The pre-stored mask matrices for the remaining angles are obtained by mirroring these seven matrices in the horizontal or vertical direction, thereby reducing storage space.
[0136] It is understandable that after the inter-frame prediction method provided in this application is implemented on the GEO-based VVC reference software VTM7.0_common_base, and tested under Random Access conditions on the test sequences required by JVET, the BD-rate for the Y, Cb, and Cr components remains unchanged (consistent with Anchor performance). This data indicates that the simplified scheme does not affect the encoding performance, reduces the storage of the weight table, and simplifies the text description and code implementation. Regarding time complexity, since the GEO predefined weight matrix is calculated only once for each sequence before encoding / decoding begins, the ternary operator operation introduced by this scheme does not affect the overall encoding / decoding time complexity; in other words, the time complexity remains essentially unchanged.
[0137] This application provides an inter-frame prediction method applied to a video decoding device, i.e., a decoder. The functionality achieved by this method can be implemented by a processor in the video decoding device calling program code. Of course, the program code can be stored in a computer storage medium. Therefore, the video encoding device includes at least a processor and a storage medium.
[0138] Figure 9 This is a schematic diagram illustrating the implementation process of an intra-frame prediction method according to an embodiment of this application, as shown below. Figure 9 As shown, the method includes: S201. Parse the bitstream and determine the prediction mode parameters for the current block.
[0139] S202. When the prediction mode parameters indicate that the inter-frame prediction of the current block is determined by using the inter-frame geometric partitioning prediction mode (GEO), the bitstream is parsed to determine the GEO parameters of the current block.
[0140] S203. Based on the GEO parameters, determine the first predicted value of the first partition of the current block and the second predicted value of the second partition of the current block.
[0141] S204. Determine the weight index corresponding to the pixel in the current block based on the GEO parameters.
[0142] S205. Perform embedding processing on the weight indices corresponding to the pixels in the current block to obtain the absolute information of the weight indices corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixel in the current block into the range of [0 to half of the preset value].
[0143] S206. Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block.
[0144] S207. Use the first predicted value, the first weight value, the second predicted value, and the second weight value to determine the weighted fusion of pixels within the current block, and obtain the inter-frame predicted value of the current block.
[0145] In some embodiments of this application, the decoder determines the first weight value and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block. The specific implementation of this can include the following five methods.
[0146] Method 1: When the absolute information of the weight index is less than the preset index threshold, the decoder combines the absolute information of the weight index with the first value, shifts it to the right by a preset number of bits, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index. When the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder combines the absolute information of the weight index with the second value, shifts it to the right by a preset number of bits, and then adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index. The decoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block. The decoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0147] Method 2: The decoder combines the absolute information of the weight index with the first value and whether the absolute information of the weight index is greater than 8, then performs a right shift by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; the decoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the decoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0148] Method 3: The decoder combines the absolute information of the weight index with the first value and the sign value of 8 minus the absolute information of the weight index, then performs a right shift by a preset number of bits, and finally adds the preset weight value to obtain the weight value corresponding to the absolute information of the weight index; based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block, the first weight value of the pixel in the current block corresponding to the first partition is determined; based on the first weight value, the second weight value of the pixel in the current block corresponding to the second partition is obtained.
[0149] Method 4: The decoder retrieves the weight value corresponding to the absolute information of the weight index from a preset weight mapping table based on the absolute information of the weight index. The preset weight mapping table is obtained by performing a nesting process on the weight index of the pixel in the current block, which is half of a preset value. The decoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index of the pixel in the current block. The decoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0150] Method 5: When the absolute information of the weight index is less than the preset index threshold, the decoder performs a right shift of the absolute information of the weight index by a preset number of bits, combined with the first value, to obtain a new weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, the decoder performs a right shift of the absolute information of the weight index by a preset number of bits, combined with the second value, to obtain a new weight index; the decoder obtains the new weight value corresponding to the new weight index from the preset new weight mapping table; when the weight index information is less than or equal to 0, the decoder determines the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, the decoder determines 8 - the new weight value as the weight value corresponding to the absolute information of the weight index; the decoder determines the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; the decoder obtains the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0151] In this embodiment, the decoder parses the angle index information corresponding to the current block, the first motion information of the first reference block corresponding to the first partition, the second motion information of the second reference block corresponding to the second partition, and the step size index information from the bitstream; and performs motion compensation based on the first motion information and the second motion information to obtain the first unidirectional prediction value corresponding to the first partition and the second unidirectional prediction value corresponding to the second partition.
[0152] The preset values are 26, 9, 2, 3, 4, and 2.
[0153] In the embodiments of this application, the implementation of S201-S207 of the decoder is basically the same as the implementation of S101-S107 on the encoder side, and will not be described again here.
[0154] The difference is that the prediction mode parameters and GEO parameters of the current block on the decoder side are parsed from the bitstream, while the encoder obtains them itself.
[0155] Understandably, during inter-frame prediction, the decoder can determine the weight index corresponding to the pixel in the current block based on the GEO parameter. Then, through absolute value embedding, the value of the weight index corresponding to the pixel in the current block is embedded within the range of [0 to half of the preset value]. This reduces the size by half of the preset value, thereby reducing the storage and use of the weight value corresponding to half of the absolute information of the weight index. This simplifies the text and code during inter-frame prediction and reduces the data storage overhead.
[0156] In some embodiments of this application, the GEO parameters of the current block include: angle index information and the size information of the current block; the implementation of S204 in an inter-frame prediction method provided in this application embodiment may include: S2041. Determine the position information of the pixels within the current block based on the size information of the current block.
[0157] S2042. Based on the angle index information and the preset angle mapping table, and combined with the position information of the pixels in the current block, determine the weight index corresponding to the pixels in the current block.
[0158] In some embodiments of this application, the decoder can determine the cosine angle index information and the sine angle index information based on the angle index information; perform power reduction processing on the angles of the preset angle mapping table to obtain the updated angle mapping table; and determine the weight index corresponding to the pixel in the current block based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block, respectively.
[0159] In the embodiments of this application, the implementation of S2041-S2042 of the decoder is basically the same as the implementation process of S1041-S1042 on the encoder side, and will not be described again here.
[0160] It is understandable that by looking up the weight mapping table through the obtained index to get the corresponding weight, it can be found that each step of the above calculation needs to be multiplied with the angles Dis[displacementX] and Dis[displacementY]. However, this solution removes the weight mapping table and designs a mathematical method to implicitly reduce the weight mapping table by half. Therefore, it is necessary to divide by 2 in each step of calculating the weight index and motion index. However, since the values in the angle mapping table are all powers of 2, the weight index and motion index can be divided by 2 by reducing the power of the angle mapping table, and then correspond to the reduced weight mapping table.
[0161] S208. Based on the cosine angle index information, sine angle index information, and updated angle mapping table, determine the motion offset value, and based on the angle index information, step size index information, and current block size information, obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block. S209. Based on the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel at the top 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, obtain the motion index information. S210. When the absolute value of the motion index information is less than half of the preset motion index threshold, the first motion information and the second motion information are determined as the motion information of the current block. S211. When the motion index information is less than or equal to 0, the first motion information is determined as the motion information of the current block; S212. When the motion index information is greater than 0, the second motion information is determined as the motion information of the current block; S213. Store the motion information of the current block in the preset merge candidate list.
[0162] In the embodiments of this application, the implementation of S208-S213 of the decoder is basically the same as the implementation of S108-S113 on the encoder side, and will not be described again here.
[0163] The preset motion index threshold is 32.
[0164] It is understandable that after the inter-frame prediction method provided in this application is implemented on the GEO-based VVC reference software VTM7.0_common_base, and tested under Random Access conditions on the test sequences required by JVET, the BD-rate for the Y, Cb, and Cr components remains unchanged (consistent with Anchor performance). This data indicates that the simplified scheme does not affect the encoding performance, reduces the storage of the weight table, and simplifies the text description and code implementation. Regarding time complexity, since the GEO predefined weight matrix is calculated only once for each sequence before encoding / decoding begins, the ternary operator operation introduced by this scheme does not affect the overall encoding / decoding time complexity; in other words, the time complexity remains essentially unchanged.
[0165] like Figure 10 As shown, this application embodiment provides an encoder 1, including: The first determining unit 10 is used to determine the prediction mode parameters of the current block; when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), the GEO parameters of the current block are determined; based on the GEO parameters, the first prediction value of the first partition of the current block and the second prediction value of the second partition of the current block are determined; based on the GEO parameters, the weight index corresponding to the pixel in the current block is determined. The first embedding unit 11 is used to perform embedding processing on the weight index corresponding to the pixel in the current block respectively to obtain the absolute information of the weight index corresponding to the pixel in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixel in the current block into the range of [0 to half of a preset value]. The first determining unit 10 is further configured to determine the first weight value and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block; The first prediction unit 12 is used to perform weighted fusion of the pixels within the current block using the first prediction value, the first weight value, the second prediction value, and the second weight value to obtain the inter-frame prediction value of the current block.
[0166] In some embodiments of this application, the GEO parameters of the current block include: angle index information and the size information of the current block; The first determining unit 10 is further configured to determine the position information of the pixels in the current block based on the size information of the current block; and to determine the weight index corresponding to the pixels in the current block based on the angle index information and the preset angle mapping table, in combination with the position information of the pixels in the current block.
[0167] In some embodiments of this application, the first determining unit 10 is further configured to determine cosine angle index information and sine angle index information based on the angle index information; to perform power reduction processing on the angles of the preset angle mapping table to obtain the updated angle mapping table; and to determine the weight index corresponding to the pixel in the current block based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block, respectively.
[0168] In some embodiments of this application, the first determining unit 10 is further configured to: when the absolute information of the weight index is less than a preset index threshold, right-shift the absolute information of the weight index by a preset number of positions and add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, right-shift the absolute information of the weight index by a preset number of positions and add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0169] In some embodiments of this application, the first determining unit 10 is further configured to combine the absolute information of the weight index with a first value and whether the absolute information of the weight index is greater than 8, then perform a right shift by a preset number of bits, and finally add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition according to the first weight value.
[0170] In some embodiments of this application, the first determining unit 10 is further configured to combine the absolute information of the weight index with a first value, 8 minus the sign value of the absolute information of the weight index, then perform a right shift by a preset number of bits, and finally add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0171] In some embodiments of this application, the first determining unit 10 is further configured to find the weight value corresponding to the absolute information of the weight index from a preset weight mapping table based on the absolute information of the weight index; wherein, the preset weight mapping table is obtained by performing a nesting process on the weight index corresponding to the pixel point in the current block, respectively, within half of a preset value; a first weight value of the pixel point in the current block corresponding to the first partition is determined 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 a second weight value of the pixel point in the current block corresponding to the second partition is obtained based on the first weight value.
[0172] In some embodiments of this application, the first determining unit 10 is further configured to: when the absolute information of the weight index is less than a preset index threshold, right-shift the absolute information of the weight index by a preset number of bits to obtain new weight index information; when the absolute information of the weight index is greater than or equal to the preset index threshold, right-shift the absolute information of the weight index by a preset number of bits to obtain new weight index information; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; when the weight index information is less than or equal to 0, determine the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, determine the new weight value as the weight value corresponding to the absolute information of the weight index; determine a first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain a second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0173] In some embodiments of this application, the encoder 1 further includes: a writing unit 13 and a first storage unit 14 (both not shown in the figures). The writing unit 13 is used to write the angle index information into the bitstream after performing weighted fusion of the pixels in the current block using the first prediction value, the first weight value, the second prediction value and the second weight value to obtain the inter-frame prediction value of the current block; The first determining unit 10 is further configured to: determine a motion offset value based on the cosine angle index information, the sine angle index information, and the updated angle mapping table; and obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block based on the angle index information, step size index information, and the size information of the current block; obtain motion index information based on the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of a preset motion index threshold, determine the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; when the motion index information is greater than 0, determine the second motion information as the motion information of the current block. The first storage unit 14 is used to store the motion information of the current block in a preset merging candidate list.
[0174] In some embodiments of this application, the preset value is 26; the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset bit is 2; and the preset motion index threshold is 32.
[0175] In practical applications, such as Figure 11 As shown in the embodiments of this application, an encoder is also provided, including: First memory 15 and first processor 16; The first memory 15 stores a computer program that can run on the first processor 16, which is an inter-frame prediction method on the encoder side when the first processor 16 executes the program.
[0176] Understandably, during inter-frame prediction, the encoder can determine the weight index corresponding to the pixel in the current block based on the GEO parameters. Then, through absolute value embedding, the value of the weight index corresponding to the pixel in the current block is embedded within the range of [0 to half of the preset value]. This reduces the size by half of the preset value, thereby reducing the storage and use of the weight value corresponding to half of the absolute information of the weight index. This simplifies the text and code during inter-frame prediction and reduces the overhead of data storage.
[0177] like Figure 12 As shown, this application embodiment provides a decoder 2, including: The parsing unit 20 is used to parse the bitstream and determine the prediction mode parameters of the current block; The second determining unit 21 is configured to, when the prediction mode parameters indicate that the inter-frame prediction of the current block is determined using the inter-frame geometric partitioning prediction mode (GEO), parse the bitstream, determine the GEO parameters of the current block; determine the first prediction value of the first partition and the second prediction value of the second partition of the current block based on the GEO parameters; and determine the weight index corresponding to the pixel in the current block based on the GEO parameters. The second embedding unit 22 is used to perform embedding processing on the weight indexes corresponding to the pixels in the current block respectively to obtain the absolute information of the weight indexes corresponding to the pixels in the current block; wherein, the embedding processing is to embed the value of the weight index corresponding to the pixels in the current block into the range of [0 to half of a preset value]. The second determining unit 21 is further configured to determine the first weight value and the second weight value of the pixel in the current block based on the absolute information of the weight index corresponding to the pixel in the current block; The second prediction unit 23 is used to determine the weighted fusion of pixels within the current block using the first prediction value, the first weight value, the second prediction value, and the second weight value, to obtain the inter-frame prediction value of the current block.
[0178] In some embodiments of this application, the GEO parameters of the current block include: angle index information and the size information of the current block; The second determining unit 21 is further configured to determine the position information of the pixels in the current block based on the size information of the current block; and to determine the weight index corresponding to the pixels in the current block based on the angle index information and the preset angle mapping table, in combination with the position information of the pixels in the current block.
[0179] In some embodiments of this application, the second determining unit 21 is further configured to determine cosine angle index information and sine angle index information based on the angle index information; to perform power reduction processing on the angles of the preset angle mapping table to obtain the updated angle mapping table; and to determine the weight index corresponding to the pixel in the current block based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block, respectively.
[0180] In some embodiments of this application, the second determining unit 21 is further configured to: when the absolute information of the weight index is less than a preset index threshold, right-shift the absolute information of the weight index by a preset number of positions and add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; when the absolute information of the weight index is greater than or equal to the preset index threshold, right-shift the absolute information of the weight index by a preset number of positions and add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0181] In some embodiments of this application, the second determining unit 21 is further configured to combine the absolute information of the weight index with a first value and whether the absolute information of the weight index is greater than 8, then perform a right shift by a preset number of bits, and finally add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition according to the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition according to the first weight value.
[0182] In some embodiments of this application, the second determining unit 21 is further configured to combine the absolute information of the weight index with the first value, 8 minus the sign value of the absolute information of the weight index, then perform a right shift by a preset number of bits, and finally add a preset weight value to obtain the weight value corresponding to the absolute information of the weight index; determine the first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain the second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0183] In some embodiments of this application, the second determining unit 21 is further configured to find the weight value corresponding to the absolute information of the weight index from a preset weight mapping table based on the absolute information of the weight index; wherein, the preset weight mapping table is obtained by performing a nesting process on the weight index corresponding to the pixel point in the current block, respectively, within half of a preset value; a first weight value of the pixel point in the current block corresponding to the first partition is determined 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 a second weight value of the pixel point in the current block corresponding to the second partition is obtained based on the first weight value.
[0184] In some embodiments of this application, the second determining unit 21 is further configured to: when the absolute information of the weight index is less than a preset index threshold, right-shift the absolute information of the weight index by a preset number of bits to obtain new weight index information; when the absolute information of the weight index is greater than or equal to the preset index threshold, right-shift the absolute information of the weight index by a preset number of bits to obtain new weight index information; obtain a new weight value corresponding to the new weight index information from a preset new weight mapping table; when the weight index information is less than or equal to 0, determine the new weight value as the weight value corresponding to the absolute information of the weight index; when the weight index information is greater than 0, determine the new weight value as the weight value corresponding to the absolute information of the weight index; determine a first weight value of the pixel in the current block corresponding to the first partition based on the weight value corresponding to the absolute information of the weight index and the weight index corresponding to the pixel in the current block; and obtain a second weight value of the pixel in the current block corresponding to the second partition based on the first weight value.
[0185] In some embodiments of this application, the decoder 2 further includes a second storage unit 24 (not shown in the figure). The second determining unit 21 is further configured to: after obtaining the predicted value of the current block by weighted fusion of each pixel using the first unidirectional prediction value, the first weight value, the second unidirectional prediction value, and the second weight value; determine the motion offset value according to the cosine angle index information, the sine angle index information, and the updated angle mapping table; and obtain the motion horizontal coordinate offset value and motion vertical coordinate offset value corresponding to the current block according to the angle index information, the step size index information, and the size information of the current block; obtain motion index information according to the motion offset value, the motion horizontal coordinate offset value, the motion vertical coordinate offset value, the position information of the pixel at the upper left corner of the current block, the first angle corresponding to the cosine angle index information, and the second angle corresponding to the sine angle index information; when the absolute value of the motion index information is less than half of a preset motion index threshold, determine the first motion information and the second motion information as the motion information of the current block; when the motion index information is less than or equal to 0, determine the first motion information as the motion information of the current block; when the motion index information is greater than 0, determine the second motion information as the motion information of the current block. The second storage unit 24 is used to store the motion information of the current block in a preset merge candidate list.
[0186] In some embodiments of this application, the preset value is 26; the preset index threshold is 9; the first value is 2; the second value is 3; the preset weight value is 4; the preset bit is 2; and the preset motion index threshold is 32.
[0187] In practical applications, such as Figure 13 As shown in the embodiments of this application, a decoder is also provided, including: Second memory 25 and second processor 26; The second memory 25 stores a computer program that can run on the second processor 26, which implements an inter-frame prediction method on the decoder side when executing the program.
[0188] Understandably, during inter-frame prediction, the decoder can determine the weight index corresponding to the pixel in the current block based on the GEO parameter. Then, through absolute value embedding, the value of the weight index corresponding to the pixel in the current block is embedded within the range of [0 to half of the preset value]. This reduces the size by half of the preset value, thereby reducing the storage and use of the weight value corresponding to half of the absolute information of the weight index. This simplifies the text and code during inter-frame prediction and reduces the data storage overhead.
[0189] Accordingly, embodiments of this application provide a storage medium storing a computer program thereon. When the computer program is executed by a first processor, it implements an inter-frame prediction method for an encoder; or, when the computer program is executed by a second processor, it implements an inter-frame prediction method for a decoder.
[0190] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0191] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A code stream storage method, applied to an encoder, characterized in that, Performing an inter-frame prediction method to generate a bitstream, and storing the bitstream, the inter-frame prediction method comprising: Determine the prediction mode parameters for the current block; When the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using the inter-frame geometric partitioning prediction mode, the geometric partitioning prediction mode parameter of the current block is determined. Based on the geometric partitioning prediction mode parameters, a first predicted value and a second predicted value of the pixels within the current block are determined; wherein, the first predicted value is predicted based on the first motion information of the current block, and the second predicted value is predicted based on the second motion information of the current block; Based on the geometric partitioning prediction mode parameters, determine the weight index corresponding to the pixel in the current block; The weight indices corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain the absolute information of the weight indices corresponding to the pixels in the current block; Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block; The inter-frame prediction value of the pixel in the current block is determined by weighted fusion of the first predicted value, the first weight value, the second predicted value, and the second weight value.
2. The method according to claim 1, characterized in that, The geometric partitioning prediction mode parameters for the current block include: Angle index information and the size information of the current block; determining the weight index corresponding to the pixel point in the current block according to the geometric partitioning prediction mode parameters includes: Based on the size information of the current block, determine the position information of the pixels within the current block; Based on the angle index information, the preset angle mapping table, and the position information of the pixels in the current block, the weight index corresponding to the pixels in the current block is determined.
3. The method according to claim 2, characterized in that, The step of determining the weight index corresponding to the pixel in the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel in the current block includes: Based on the angle index information, determine the cosine angle index information and the sine angle index information; The angles in the preset angle mapping table are subjected to powers of 1 to obtain an updated angle mapping table; The weight index corresponding to the pixel in the current block is determined based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block.
4. A method for receiving a bitstream, applied to a decoder, characterized in that, The process involves reading the bitstream and executing an inter-frame prediction method to decode the bitstream and generate video or images, wherein the inter-frame prediction method includes: Analyze the bitstream to determine the prediction mode parameters for the current block; When the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using the inter-frame geometric partitioning prediction mode, the bitstream is parsed to determine the geometric partitioning prediction mode parameter of the current block. Based on the geometric partitioning prediction mode parameters, a first predicted value and a second predicted value of the pixels within the current block are determined; wherein, the first predicted value is predicted based on the first motion information of the current block, and the second predicted value is predicted based on the second motion information of the current block; Based on the geometric partitioning prediction mode parameters, determine the weight index corresponding to the pixel in the current block; The weight indices corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain the absolute information of the weight indices corresponding to the pixels in the current block; Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block; The inter-frame prediction value of the pixel in the current block is determined by weighted fusion of the first predicted value, the first weight value, the second predicted value, and the second weight value.
5. The method according to claim 4, characterized in that, The geometric partitioning prediction mode parameters for the current block include: Angle index information and current block size information; determining the weight index corresponding to the pixel point within the current block based on the geometric partitioning prediction mode parameters includes: Based on the size information of the current block, determine the position information of the pixels within the current block; Based on the angle index information, the preset angle mapping table, and the position information of the pixels in the current block, the weight index corresponding to the pixels in the current block is determined.
6. The method according to claim 5, characterized in that, The step of determining the weight index corresponding to the pixel in the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel in the current block includes: Based on the angle index information, determine the cosine angle index information and the sine angle index information; The angles in the preset angle mapping table are subjected to powers of 1 to obtain an updated angle mapping table; The weight index corresponding to the pixel in the current block is determined based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block.
7. A method for transmitting a code stream, characterized in that, Execute the inter-frame prediction method to generate the bitstream; and transmitting the bitstream, wherein the inter-frame prediction method includes: Determine the prediction mode parameters for the current block; When the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using the inter-frame geometric partitioning prediction mode, the geometric partitioning prediction mode parameter of the current block is determined. Based on the geometric partitioning prediction mode parameters, a first predicted value and a second predicted value of the pixels within the current block are determined; wherein, the first predicted value is predicted based on the first motion information of the current block, and the second predicted value is predicted based on the second motion information of the current block; Based on the geometric partitioning prediction mode parameters, determine the weight index corresponding to the pixel in the current block; The weight indices corresponding to the pixels in the current block are respectively subjected to embedding processing to obtain the absolute information of the weight indices corresponding to the pixels in the current block; Based on the absolute information of the weight index corresponding to the pixel in the current block, determine the first weight value and the second weight value of the pixel in the current block; The inter-frame prediction value of the pixel in the current block is determined by weighted fusion of the first predicted value, the first weight value, the second predicted value, and the second weight value.
8. The method according to claim 7, characterized in that, The geometric partitioning prediction mode parameters for the current block include: Angle index information and the size information of the current block; determining the weight index corresponding to the pixel point in the current block according to the geometric partitioning prediction mode parameters includes: Based on the size information of the current block, determine the position information of the pixels within the current block; Based on the angle index information, the preset angle mapping table, and the position information of the pixels in the current block, the weight index corresponding to the pixels in the current block is determined.
9. The method according to claim 8, characterized in that, The step of determining the weight index corresponding to the pixel in the current block based on the angle index information, the preset angle mapping table, and the position information of the pixel in the current block includes: Based on the angle index information, determine the cosine angle index information and the sine angle index information; The angles in the preset angle mapping table are subjected to powers of 1 to obtain an updated angle mapping table; The weight index corresponding to the pixel in the current block is determined based on the cosine angle index information, the sine angle index information, the updated angle mapping table, and the position information of the pixel in the current block.
10. A computer-readable storage medium storing a computer program / instructions and a code stream thereon, characterized in that, When the computer program / instruction is executed by the processor, it implements the inter-frame prediction method of any one of claims 1-3 to generate a bitstream.
Citation Information
Patent Citations
Methods and apparatus for video encoding and decoding geometrically partitioned bi-predictive mode partitions
CN101822056A
Image Fusion Method And Image Processing Apparatus
CN106210501A
Video encoding method and apparatus, and video decoding method and apparatus
US20180288410A1
Interframe prediction method, device, and codec for video image
WO2019227297A1