Inter prediction method, decoder, encoder and computer storage medium
By constructing a new motion information candidate list and utilizing the weighted derivation mode of the current block, the problem of low decoding efficiency caused by unreasonable construction of the motion information candidate list in inter-frame prediction is solved, and a more efficient decoder decoding effect is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2021-04-02
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, inter-frame prediction methods suffer from low decoding efficiency due to the unreasonable construction of motion information candidate lists.
By constructing a new motion information candidate list and utilizing the weighted export mode of the current block, different motion information candidate lists can be constructed based on different weighted export modes, thereby improving the decoding efficiency of the decoder.
By constructing a candidate list of motion information that conforms to the current block weight derivation pattern, the decoding efficiency of the decoder is improved.
Smart Images

Figure CN116193139B_ABST
Abstract
Description
[0001] Cross-reference to related applications
[0002] This application is a divisional application of Chinese Patent Application No. 202180008731.9, filed on April 2, 2021, under the PCT international patent application PCT / CN2021 / 085454, which entered the Chinese national phase and is entitled "Inter-frame Prediction Method, Decoder, Encoder, and Computer Storage Medium." That Chinese patent application claims priority to Chinese Patent Application No. 202010507268.X, filed on June 5, 2020. The entire contents of the aforementioned patent application are hereby incorporated in whole. Technical Field
[0003] The embodiments of this application relate to, but are not limited to, the field of video encoding and decoding technology, and particularly to an inter-frame prediction method, a decoder, an encoder, and a computer storage medium. Background Technology
[0004] In the field of video encoding and decoding, the decoding process for the current block can employ both intra-frame prediction and inter-frame prediction. Inter-frame prediction can include Geometric Partitioning Mode (GPM) and Angular Weighted Prediction (AWP), which divide the current block into two non-rectangular partitions (or two blocks), predict them separately, and then weight and fuse them to obtain the predicted value for the current block.
[0005] However, the related technologies suffer from low decoding efficiency due to the unreasonable construction of the motion information candidate list. Summary of the Invention
[0006] This application provides an inter-frame prediction method, a decoder, an encoder, and a computer storage medium.
[0007] In a first aspect, an inter-frame prediction method is provided, applied to a decoder, the method comprising: parsing the bitstream to obtain the weight derivation mode of the current block; constructing a new motion information candidate list based on the weight derivation mode of the current block; and determining the inter-frame prediction value of the current block based on the new motion information candidate list.
[0008] Secondly, an inter-frame prediction method is provided, applied to an encoder, the method comprising: determining the weight derivation mode of the current block;
[0009] Based on the weighted derivation mode of the current block, a new motion information candidate list is constructed; based on the new motion information candidate list, the inter-frame prediction value of the current block is determined.
[0010] Thirdly, an inter-frame prediction method is provided, applied to a decoder. The method includes: parsing the bitstream to obtain motion vector information of the original motion information related to the current block; determining motion vector information of M derived motion information based on the scaling result of the motion vector information of the original motion information; M is an integer greater than or equal to 1; constructing a new motion information candidate list based on the motion vector information of the original motion information and the motion vector information of the derived motion information; and determining the inter-frame prediction value of the current block based on the new motion information candidate list.
[0011] Fourthly, an inter-frame prediction method is provided, applied to an encoder. The method includes: determining motion vector information of original motion information related to the current block; determining motion vector information of M derived motion information based on the scaling result of the motion vector information of the original motion information; M being an integer greater than or equal to 1; constructing a new motion information candidate list based on the motion vector information of the original motion information and the motion vector information of the derived motion information; and determining the inter-frame prediction value of the current block based on the new motion information candidate list.
[0012] Fifthly, a decoder is provided, comprising: an acquisition unit for parsing a bitstream and acquiring the weighted derivation mode of the current block; a construction unit for constructing a new motion information candidate list based on the weighted derivation mode of the current block; and a prediction unit for determining the inter-frame prediction value of the current block based on the new motion information candidate list.
[0013] In a sixth aspect, an encoder is provided, comprising: a mode determination unit for determining a weighted derivation mode of a current block; a construction unit for constructing a new motion information candidate list based on the weighted derivation mode of the current block; and a prediction unit for determining an inter-frame prediction value of the current block based on the new motion information candidate list.
[0014] In a seventh aspect, a decoder is provided, comprising: an acquisition unit for parsing a bitstream and acquiring the weighted derivation mode of the current block; a derived motion information determination unit for determining the motion vector information of M derived motion information based on the scaling result of the motion vector information of the original motion information; M being an integer greater than or equal to 1; a construction unit for constructing a new motion information candidate list based on the motion vector information of the original motion information and the motion vector information of the derived motion information; and a prediction unit for determining the inter-frame prediction value of the current block based on the new motion information candidate list.
[0015] Eighthly, an encoder is provided, comprising: a raw motion information determination unit, configured to determine motion vector information of raw motion information related to the current block; a derived motion information determination unit, configured to determine motion vector information of M derived motion information based on the scaling result of the motion vector information of the raw motion information; M being an integer greater than or equal to 1; a construction unit, configured to construct a new motion information candidate list based on the motion vector information of the raw motion information and the motion vector information of the derived motion information; and a prediction unit, configured to determine the inter-frame prediction value of the current block based on the new motion information candidate list.
[0016] A ninth aspect provides a decoder, comprising: a memory and a processor, the memory storing a computer program executable on the processor, the processor executing the program to implement the steps in the above-described method.
[0017] In a tenth aspect, an encoder, a memory, and a processor are provided, the memory storing a computer program executable on the processor.
[0018] When the processor executes the program, it implements the steps in the above method.
[0019] Eleventhly, a computer storage medium is provided, the computer storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps in the above method.
[0020] In this embodiment, the decoder parses the bitstream to obtain the weighted derivation mode of the current block; based on the weighted derivation mode of the current block, it constructs a new motion information candidate list; and based on the new motion information candidate list, it determines the inter-frame prediction value of the current block. Thus, since the decoder constructs a new motion information candidate list based on the weighted derivation mode of the current block, the decoder can construct different new motion information candidate lists according to different weighted derivation modes, thereby ensuring that the construction of the motion information candidate list conforms to the weighted derivation mode of the current block, and ultimately improving the decoder's decoding efficiency. Attached Figure Description
[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0022] Figure 1 This application provides a schematic block diagram of a video encoding system.
[0023] Figure 2 This application provides a schematic block diagram of a video decoding system according to an embodiment of the present application.
[0024] Figure 3 This is a schematic diagram of a typical image group provided in an embodiment of this application;
[0025] Figure 4a A schematic diagram illustrating the weight allocation of GPM in multiple partitioning modes on a 64×64 current block, provided for embodiments of this application;
[0026] Figure 4b A schematic diagram illustrating the weight allocation of AWP in multiple partitioning modes on a 64×64 current block, provided for an embodiment of this application;
[0027] Figure 4c A schematic diagram illustrating the weight allocation of AWP in a 64×32 current block using multiple partitioning modes, provided for an embodiment of this application;
[0028] Figure 4d A schematic diagram illustrating the weight allocation of AWP in multiple partitioning modes on a 32×64 current block, provided for an embodiment of this application;
[0029] Figure 5 This application provides a schematic diagram illustrating the spatial relationship between the current block and adjacent blocks in an embodiment of the present application.
[0030] Figure 6 This is another schematic diagram illustrating the spatial relationship between the current block and adjacent blocks, provided in an embodiment of this application.
[0031] Figure 7 A flowchart illustrating an inter-frame prediction method provided in an embodiment of this application;
[0032] Figure 8 This is another schematic diagram illustrating the spatial relationship between the current block and adjacent blocks, provided in an embodiment of this application.
[0033] Figure 9 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;
[0034] Figure 10 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;
[0035] Figure 11 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;
[0036] Figure 12 This application provides a schematic diagram illustrating the spatial relationship between the current block, adjacent blocks, and corresponding blocks in an embodiment of the present application.
[0037] Figure 13 A flowchart illustrating an inter-frame prediction method provided in another embodiment of this application;
[0038] Figure 14 A flowchart illustrating an inter-frame prediction method provided in another embodiment of this application;
[0039] Figure 15 A flowchart illustrating an inter-frame prediction method provided in another embodiment of this application;
[0040] Figure 16 A schematic diagram of the composition structure of a decoder provided in an embodiment of this application;
[0041] Figure 17 A schematic diagram of the composition structure of an encoder provided in an embodiment of this application;
[0042] Figure 18 A schematic diagram illustrating the composition structure of another decoder provided in an embodiment of this application;
[0043] Figure 19 A schematic diagram of the composition structure of another encoder provided in an embodiment of this application;
[0044] Figure 20 A schematic diagram of a decoder provided in an embodiment of this application;
[0045] Figure 21 This is a schematic diagram of the hardware entity of an encoder provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions of this application and how they solve the aforementioned technical problems will be described in detail below through embodiments and in conjunction with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that in the examples of this application, terms such as "first" and "second" are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0047] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0048] In video images, the current coding block (CB) is generally represented by a first image component, a second image component, and a third image component. These three image components are a luminance component, a blue chrominance component, and a red chrominance component, respectively. Specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V. Thus, video images can be represented in YCbCr format or YUV format.
[0049] Currently, common video codec standards are based on a block-based hybrid coding framework. Each frame in a video image is divided into square Largest Coding Units (LCUs) of the same size (e.g., 128×128, 64×64, etc.). Each LCU can be further divided into rectangular Coding Units (CUs) according to rules; and the Coding Units may be further divided into smaller Prediction Units (PUs). Specifically, the hybrid coding framework may include modules such as prediction, transformation, quantization, entropy coding, and in-loop filtering; among them, the prediction module may include intra-frame prediction and inter-frame prediction, and inter-frame prediction may include motion estimation and motion compensation. Because there is a strong correlation between adjacent pixels within a video frame, intra-frame prediction can eliminate spatial redundancy between adjacent pixels in video encoding and decoding technology. However, because there is also a strong similarity between adjacent frames in a video image, inter-frame prediction can eliminate temporal redundancy between adjacent frames in video encoding and decoding technology, thereby improving decoding efficiency. The following application will describe inter-frame prediction in detail.
[0050] Figure 1 This is a schematic block diagram of a video encoding system provided in an embodiment of this application, such as... Figure 1 As shown, the video coding system 11 may include: a transform unit 111, a quantization unit 112, a mode selection and coding 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, a coding unit 119, and a decoding image buffer unit 110.
[0051] For the input raw video signal, a video reconstruction block can be obtained by partitioning it into Coding Tree Units (CTUs). 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) for 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.
[0052] Figure 2 This is a schematic block diagram of a video decoding system provided in an embodiment of this application, such as... Figure 2 As shown, the video decoding system 12 may include: 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 filtering unit 125, and a decoded image buffer unit 126.
[0053] After the input video signal is encoded by the video encoding system 11, the bitstream of the video signal is output. This bitstream is input into the video decoding system 12, and first passes through the decoding unit 121 to obtain the decoded transform coefficients. The 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 be used to generate prediction data for the current video decoding block based on the determined intra-frame prediction direction and the data from the previously decoded blocks from 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. The prediction information is used to generate a predictive block of the video 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.
[0054] 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 in the video decoding system 12.
[0055] Before introducing the embodiments of this application, some technologies involved in the embodiments of this application will be described first. It should be noted that the following technologies are supplementary descriptions of the embodiments of this application, and these technologies are also part of the embodiments of this application. Those skilled in the art will understand that, without conflict, these technologies can be arbitrarily combined with the embodiments of this application.
[0056] It should also be noted that motion information can include motion vector (MV) information and reference frame information. Specifically, for the current block using inter-frame prediction, the current frame containing the current block has one or more reference frames. The current block can be a coding unit or a prediction unit. Motion information containing a set of motion vectors and reference frame information can be used to indicate a pixel region of the same size as the current block within a reference frame, which is called a reference block. Alternatively, motion information containing two sets of motion vectors and reference frame information can be used to indicate two reference blocks within two reference frames that can be the same or different. Then, motion compensation can obtain the inter-frame prediction value of the current block based on the reference blocks indicated by the motion information.
[0057] It should be understood that a P-frame (Predictive Frame) is a frame that can only be predicted using reference frames whose Picture Order Count (POC) precedes the current frame. In this case, there is only one reference frame list, denoted by RefPicList0; and RefPicList0 contains only reference frames whose POC precedes the current frame. An early B-frame (Bi-directional Interpolated Prediction Frame) could be predicted using reference frames whose POC precedes and those whose POC follows the current frame. A B-frame has two reference frame lists, denoted by RefPicList0 and RefPicList1; RefPicList0 contains only reference frames whose POC precedes the current frame, and RefPicList1 contains only reference frames whose POC follows the current frame. For the current block, it can refer only to a reference block in RefPicList0 (a frame in which the reference is taken), which is called forward prediction; or it can refer only to a reference block in RefPicList1 (a frame in which the reference is taken), which is called backward prediction; or it can refer to both reference blocks in RefPicList0 and RefPicList1 (a frame in which the reference is taken), which is called bidirectional prediction. A simple way to refer to two reference blocks simultaneously is to average the pixels at corresponding positions in the two reference blocks to obtain the inter-frame prediction value (or prediction block) for each pixel in the current block. Later B-frames no longer restrict RefPicList0 to contain only reference frames with the POC preceding the current frame, and RefPicList1 to contain only reference frames with the POC following the current frame. In other words, RefPicList0 can also contain reference frames with the POC following the current frame, and RefPicList1 can also contain reference frames with the POC preceding the current frame; that is, the current block can simultaneously refer to reference frames with the POC preceding the current frame or simultaneously refer to reference frames with the POC following the current frame. However, when the current block is predicted bidirectionally, the reference frames used must be one from RefPicList0 and one from RefPicList1; such B-frames are also called generalized B-frames.
[0058] It should be noted that different standard versions or different technical documents may represent RefPicList0 and RefPicList1 differently, therefore RefPicList0 and RefPicList1 may have other representations. At least in the embodiments of this application, RefPicList0, List0, and L0 represent the same meaning, and RefPicList1, List1, and L1 represent the same meaning.
[0059] Because the encoding / decoding order in Random Access (RA) configuration is different from the POC order, B-frames can simultaneously reference information before and after the current frame, which can significantly improve encoding performance.
[0060] Figure 3 This is a schematic diagram of a typical image group provided in an embodiment of this application, such as... Figure 3 As shown, a classic image group (GOP) structure in RA is as follows: Figure 3 As shown, in Figure 3 In the diagram, arrows indicate reference relationships. Since I-frames do not require a reference frame, after decoding an I-frame with a POC of 0, a P-frame with a POC of 4 will be decoded. When decoding a P-frame with a POC of 4, the I-frame with a POC of 0 can be referenced. After decoding a P-frame with a POC of 4, a B-frame with a POC of 2 is then decoded. When decoding a B-frame with a POC of 2, the I-frame with a POC of 0 and the P-frame with a POC of 4 can be referenced, and so on. Thus, according to... Figure 3 We can see that when the POC order is {0 1 2 3 45 6 7 8}, the corresponding decoding order is {0 3 2 4 1 7 6 8 5}.
[0061] Furthermore, the encoding / decoding order in Low Delay (LD) configuration is the same as the POC order. In this case, the current frame can only refer to information from previous frames. Low Delay configuration is further divided into Low Delay P and Low Delay B. Low Delay P is the traditional Low Delay configuration. Its typical structure is IPPP, meaning that an I-frame is encoded and decoded first, and subsequent decoded frames are all P-frames. The typical structure of Low Delay B is IBBB. The difference from Low Delay P is that each inter-frame is a B-frame, meaning two reference frame lists are used. The current block can simultaneously reference the reference block of a frame in RefPicList0 and the reference block of a frame in RefPicList1. Here, a reference frame list for the current frame can have a maximum of several reference frames, such as 2, 3, or 4. When encoding or decoding a current frame, the number of reference frames in RefPicList0 and RefPicList1 is determined by a preset configuration or algorithm. However, the same reference frame can appear in both RefPicList0 and RefPicList1 at the same time, meaning that the encoder or decoder allows the current block to reference two reference blocks in the same reference frame simultaneously.
[0062] Encoders or decoders typically use index values (denoted by `index`) from a list of reference frames to correspond to reference frames. If a list of reference frames has a length of 4, then the `index` has four values: 0, 1, 2, 3, etc. For example, if the current frame's `RefPicList0` has four reference frames with POC values of 5, 4, 3, and 0, then `refPicList0`'s index 0 is the reference frame for POC 5, `refPicList0`'s index 1 is the reference frame for POC 4, `refPicList0`'s index 2 is the reference frame for POC 3, and `refPicList0`'s index 3 is the reference frame for POC 0.
[0063] In the current VVC video codec standard, the default inter-frame prediction mode is GPM prediction mode. In the current AVS3 video codec standard, the default inter-frame prediction mode is AWP prediction mode. Although these two prediction modes have different names and specific implementations, they are based on the same principle, meaning that both prediction modes can be applied to the inter-frame prediction method of the embodiments in this application.
[0064] For GPM prediction mode, if GPM is used, the bitstream will transmit prediction mode parameters under GPM, such as the specific GPM partitioning mode; typically, GPM includes 64 partitioning modes. For AWP prediction mode, if AWP is used, the bitstream will transmit prediction mode parameters under AWP, such as the specific AWP partitioning mode; typically, AWP includes 56 partitioning modes.
[0065] Figure 4a This application provides a schematic diagram of weight allocation for GPM in various partitioning modes on a 64×64 current block, as illustrated in an embodiment of the present application. Figure 4a In China, GPM has 64 different partitioning schemes.
[0066] Figure 4b This application provides a schematic diagram of weight allocation for multiple partitioning modes of an AWP on a 64×64 current block, as illustrated in an embodiment of the present application. Figure 4b In the AWP, there are 56 partitioning modes.
[0067] Figure 4c This application provides a schematic diagram of weight allocation for multiple partitioning modes of an AWP on a 64×32 current block, as illustrated in an embodiment of the present application. Figure 4c In the AWP, there are 56 partitioning modes.
[0068] Figure 4d This application provides a schematic diagram of weight allocation for multiple partitioning modes of an AWP on a 32×64 current block, as illustrated in an embodiment of the present application. Figure 4dIn the AWP, there are 56 partitioning modes.
[0069] In one implementation, a partitioning pattern can correspond to a weight derivation pattern; that is, there is a correspondence between partitioning patterns and weight derivation patterns. Figure 4a In this context, the current block size is 64×64, and the unit can be pixels.
[0070] exist Figures 4a-4d In the diagram, black represents a weight of 0% for the position corresponding to the first reference block, white represents a weight of 100% for the position corresponding to the first reference block, and gray areas, depending on their shade, represent a weight value greater than 0% and less than 100% for the position corresponding to the first reference block. The weight value for the position corresponding to the second reference block is 100% minus the weight value for the position corresponding to the first reference block.
[0071] It should be understood that although the embodiments of this application provide the current block size as 64×64, 64×32, or 32×64 as described above, it should be understood in the art that the current block size may have other choices in other scenarios. The dimensions 64×64, 64×32, or 32×64 indicate the aspect ratio of the current block. For example, 64×64 can represent an aspect ratio of 1:1, 64×32 can represent an aspect ratio of 2:1, and 32×64 can represent an aspect ratio of 1:2.
[0072] In one implementation, the aspect ratio of the current block can be 1:1, 2:1, 4:1, 1:2, or 1:4, etc. In another implementation, the aspect ratio of the current block can also be other values, such as 1:1.5 or 1.5:1, etc. In yet another implementation, the aspect ratio of the current block can be determined based on the size of the video.
[0073] GPM or AWP requires a flag to be transmitted in the bitstream indicating whether GPM or AWP is being used. If GPM or AWP is used, the specific mode used must be transmitted in the bitstream, either one of the 64 GPM modes or one of the 56 AWP modes, and the index values of two motion information items can also be transmitted in the bitstream. The flag indicates whether the current block uses GPM or AWP. This flag may also be combined with other modes.
[0074] In preset prediction modes, such as GPM and AWP, two motion information blocks are needed to locate two reference blocks. The current implementation involves constructing a motion information candidate list on the encoder side using relevant information from previously encoded / decoded portions of the current block. Motion information is then selected from this candidate list, and its index values are written into the bitstream. The decoder side uses the same method, constructing a motion information candidate list using relevant information from previously decoded portions of the current block. This candidate list is identical to the one constructed on the encoder side. Thus, by parsing the index values of the two motion information blocks from the bitstream and then retrieving them from the candidate list, the two motion information blocks required for the current block are identified.
[0075] In other words, the motion information described in this application embodiment may include: motion vector information, i.e., the value of (x, y), and corresponding reference frame information, i.e., a reference frame list and a reference index value in the reference frame list. One representation is to record the reference index values of two reference frame lists, where the reference index value corresponding to one reference frame list is valid (e.g., 0, 1, 2), and the reference index value corresponding to the other reference frame list is invalid (e.g., -1). The reference frame list with valid reference index values is the reference frame list used for the motion information of the current block, and the corresponding reference frame can be found from this reference frame list based on the reference index value. Each reference frame list has a corresponding motion vector; the motion vector corresponding to a valid reference frame list is valid, and the motion vector corresponding to an invalid reference frame list is invalid. The decoder can find the required reference frame through the reference frame information in the motion information, and can find the reference block in the reference frame based on the position of the current block and the value of the motion vector (x, y), thereby determining the inter-frame prediction value of the current block.
[0076] Figure 5 This application provides a schematic diagram illustrating the spatial relationship between the current block and adjacent blocks, as shown in the embodiments. Figure 5As shown, block E is the current block, while blocks A, B, C, D, F, and G are all neighboring blocks of block E. Specifically, neighboring block A contains the sample (x0-1, y0); neighboring block B contains the sample (x0, y0-1); neighboring block C contains the sample (x0+1, y0-1); neighboring block D contains the sample (x0-1, y0-1); neighboring block F contains the sample (x0-1, y1); and neighboring block G contains the sample (x1, y0-1). Here, (x0, y0) are the coordinates of the top-left corner sample of block E in the image, (x1, y0) are the coordinates of the top-right corner sample of block E in the image, and (x0, y1) are the coordinates of the bottom-left corner sample of block E in the image. In other words, the spatial relationship between block E and its neighboring blocks A, B, C, D, F, and G is detailed in [link to relevant documentation]. Figure 5 .
[0077] for Figure 5 In this context, the existence of a neighboring block X (represented as A, B, C, D, F, or G) means that the block should be within the image to be decoded and that the block should belong to the same spatial region as block E; otherwise, the neighboring block "does not exist." Therefore, if a block "does not exist" or has not yet been decoded, then this block is "unusable"; otherwise, this block is "usable." Alternatively, if the block containing the image sample to be decoded "does not exist" or this sample has not yet been decoded, then this sample is "unusable"; otherwise, this sample is "usable."
[0078] This section describes a method for deriving motion information in related technologies, which includes the following four steps:
[0079] Step 1, 1) If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in the reference image queue 1, which corresponds to the brightness sample position of the upper left corner brightness sample of the current prediction unit, is -1, then the L0 reference index and L1 reference index of the current prediction unit are both equal to 0. The size and position of the coding unit where the current prediction unit is located are used as the size and position of the current prediction unit. Then, the L0 motion vector prediction value and L1 motion vector prediction value obtained according to the method for deriving motion information provided in related technologies are used as the L0 motion vector MvE0 and L1 motion vector MvE1 of the current prediction unit, respectively. The L0 reference index RefIdxL0 and L1 reference index RefIdxL1 of the current prediction unit are both set to 0, thus ending the motion information deriving process.
[0080] 2) Otherwise, the L0 reference index and L1 reference index of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 reference index and L1 reference index of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the images corresponding to the L0 reference index and L1 reference index of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.
[0081] In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with reference index 0 is denoted as mvRef(mvRef_x,mvRef_y), the distance index of the image where the motion information storage unit is located is denoted as DistanceIndexCol, and the distance index of the reference unit where the motion vector points is denoted as DistanceIndexRef.
[0082] The second step is to set BlockDistanceRef = DistanceIndexCol - DistanceIndexRef.
[0083] The third step is to set the L0 reference index RefIdxL0 of the current prediction unit to 0, and then calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:
[0084] mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL0*(16384 / BlockDistanceRef))))+8192)>>14));
[0085] mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL0*(16384 / BlockDistanceRef))))+8192)>>14));
[0086] At this point, mvX is mvRef and MVX is mvE0.
[0087] Set the L1 reference index RefIdxL1 of the current prediction unit to 0, and calculate the L1 motion vector mvE1(mvE1_x,mvE1_y) of the current prediction unit:
[0088] mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL1*(16384 / BlockDistanceRef))))+8192)>>14));
[0089] mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL1*(16384 / BlockDistanceRef))))+8192)>>14));
[0090] At this point, mvX is mvRef and MVX is mvE1.
[0091] Fourth step, the value of interPredRefMode is equal to 'PRED_List01'.
[0092] In practical applications, the construction of the motion information candidate list uses not only spatial motion information but also temporal motion information. Specifically, when constructing the merge list in VVC, both temporal and spatial motion information are used.
[0093] Figure 6 Another schematic diagram illustrating the spatial relationship between the current block and adjacent blocks provided in this application embodiment, such as... Figure 6As shown, this illustrates the motion information used in constructing the merge list. Candidate positions with padding elements 1, 2, 3, 4, and 5 represent spatially relevant positions, i.e., the motion information used by adjacent blocks within the current frame. Candidate positions with padding elements 6 and 7 represent temporally relevant positions, i.e., the motion information used by corresponding positions in a reference frame. This motion information can also be scaled. Here, for temporal motion information, if candidate position 6 is available, the motion information corresponding to position 6 can be used; otherwise, the motion information corresponding to position 7 can be used. It's important to note that these positions are also used in the construction of the motion information candidate list in Triangle Partition Mode (TPM) and GPM prediction modes; and the block size here is not the actual size, but merely an illustrative example.
[0094] Assume the first motion information is represented as mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1. Here, mvAwp0L0 represents the motion vector corresponding to the first reference frame list RefPicList0, and RefIdxAwp0L0 represents the reference index value of the corresponding reference frame in RefPicList0; mvAwp0L1 represents the motion vector corresponding to the second reference frame list RefPicList1, and RefIdxAwp0L1 represents the reference index value of the corresponding reference frame in RefPicList1. The second motion information follows the same pattern.
[0095] When both motion information points are unidirectional, one of RefIdxAwp0L0 and RefIdxAwp0L1 must be a valid value, such as 0, 1, or 2; the other must be an invalid value, such as -1. If RefIdxAwp0L0 is a valid value, then RefIdxAwp0L1 is -1; in this case, the corresponding mvAwp0L0 is the required motion vector, i.e., (x, y), and mvAwp0L1 does not need to be considered. The reverse is also true.
[0096] In the embodiments of this application, two motion information are determined to find two reference blocks. The weights of the two reference blocks at each pixel position are determined according to the specific mode used by GPM or AWP. The two reference blocks are then weighted to obtain the prediction block of the current block.
[0097] The processing after obtaining the prediction block is no different from the original method. At the encoding end, if the current mode is skip mode, the encoding of the current block ends. If the current mode is not skip mode, the current block is subtracted from the prediction block to obtain the residual block, which is then transformed, quantized, and entropy encoded. At the decoding end, if the current mode is skip mode, the prediction block is the decoded block, and the decoding of the current block ends. If the current mode is not skip mode, entropy decoding is used to parse the quantization coefficients, followed by dequantization and inverse transform to obtain the residual block, which is then added to the prediction block to obtain the decoded block.
[0098] The motion information candidate list construction methods for AWP and GPM either follow traditional methods or are based on the existing merge motion information candidate list filtering. The same list construction method is used for all AWP or GPM partitioning patterns. For prediction methods prior to AWP or GPM, which treat the current block as a whole by default, this approach is not problematic. However, when processing AWP or GPM, the current block is actually divided into two parts, or more precisely, the two parts of the current block use different motion information. Therefore, for each part, whether the motion information at the most relevant position can be found, and whether this position's motion information is ranked high in the list, will affect encoding or decoding efficiency.
[0099] Whether it's merging the motion information candidate list or using AWP or GPM, the basic idea behind their construction is to place motion information with a high probability of being selected before motion information with a low probability of being selected, and to use variable-length encoding, that is, to use shorter codewords for motion information at the beginning of the list and longer codewords for motion information at the end of the list, thereby improving encoding efficiency.
[0100] The probability of motion information being selected is related to the correlation between the location used to derive it and the current block. We call this relationship correlation. Generally, the closer the information is to the current block, the stronger the correlation; the more pixels adjacent to the current block, the stronger the correlation.
[0101] For AWP or GPM, we need to consider the correlation between the relevant positions and the two parts of AWP or GPM. So why not simply construct two lists for each part, i.e., two lists for AWP or GPM? This is probably because the increased complexity and performance brought by constructing two lists is not worthwhile. Part of the increased complexity comes from pruning (duplicate checking). There's also a small trick in using a single list. Since two motion information pieces cannot be identical, the index value of the later encoded motion information cannot be the same as the index value of the earlier encoded motion information. Assuming the index value of the later encoded motion information is larger than the index value of the earlier encoded motion information, then the index value of the later encoded motion information is reduced by one, thus using shorter codewords. This is also an advantage of using a single list compared to two lists.
[0102] The two parts of different modes of AWP or GPM are different, as shown above. Figure 4a and Figure 4b As shown. Based on the principle of correlation discussed above, using the correlation technology list construction method, some patterns with strong correlation to the first block of motion information appear earlier in the list, while others appear later. Similarly, some patterns with strong correlation to the second block appear later, while others appear earlier. Some patterns with strong correlation to the first block appear earlier than those with strong correlation to the second block, while others appear later. Therefore, the correlation technology construction method may be most suitable for some patterns, but not for others.
[0103] In the inter-frame prediction method of this application embodiment, the method for constructing the motion information candidate list can be an adaptive method for constructing the motion information candidate list, or a method for constructing the motion information candidate list of AWP or GPM determined according to the mode of AWP or GPM.
[0104] In this application embodiment, more than one method for constructing the motion information candidate list can be set. If AWP or GPM uses one or more modes, a motion information candidate list is used. If AWP or GPM uses a different mode than the one or more modes described above, a motion information candidate list different from the one described above is used.
[0105] For the decoder, after determining the AWP or GPM mode, the method for constructing the motion information candidate list is determined based on the AWP or GPM mode. Only one method for constructing the motion information candidate list is used for the current block, thus not increasing computational complexity.
[0106] Figure 7 This is a flowchart illustrating an inter-frame prediction method provided in an embodiment of this application, as shown below. Figure 7 As shown, this method is applied to a decoder and may include:
[0107] S701, parse the bitstream and obtain the weight export mode of the current block.
[0108] In some implementations, the decoder can parse the bitstream to determine the prediction mode parameters of the current block. These parameters may include the weighted derivation mode of the current block. If the prediction mode parameters indicate that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, the weighted derivation mode of the current block is obtained from the prediction mode parameters. The preset inter-frame prediction mode can be either AWP mode or GPM mode.
[0109] In some implementations, the weight derivation pattern of the current block is used to characterize the weight pattern, weight distribution pattern, or weight distribution region of one or two reference blocks when generating the prediction block of the current block.
[0110] The weight derivation mode of the current block can also be one of the following: bottom-left to top-right weight derivation mode, top-left to bottom-right weight derivation mode, left-right weight derivation mode, or top-bottom weight derivation mode. The bottom-left to top-right weight derivation mode is used to indicate that the bottom-left part of the predicted block comes from the first reference block, and the top-right part comes from the second reference block. The left-right weight derivation mode is used to indicate that the left part of the predicted block comes from the first reference block, and the right part comes from the second reference block, and so on. These will not be listed here.
[0111] The weight derivation mode of the current block can also be the partitioning mode of the current block. The partitioning mode can divide the current block into two parts, for example, by triangular partitioning; by rectangular partitioning; by using arcs or other regular or irregular shapes; or, for example, by determining the partitioning boundary based on the outline of objects in the current block, so that the partitioning boundary fits the outline of the objects as closely as possible. Specifically, in triangular partitioning, the current block will be divided into at least one triangle and / or at least one trapezoid; in rectangular partitioning, the current block will be divided into at least one rectangle. In other embodiments, the partitioning mode of the current block can be dividing the current block into three or more parts.
[0112] The protocol specifies 64 weighted derivation modes for the GPM prediction mode and 56 weighted derivation modes for the AWP prediction mode. The weighted derivation mode of the current block is one of the various weighted derivation modes in the geometric partitioning prediction mode, or one of the various weighted derivation modes in the angle-weighted prediction mode. For example, the weighted derivation mode of the current block can be any of the 64 weighted derivation modes in the GPM prediction mode, or any of the 56 weighted derivation modes in the AWP prediction mode.
[0113] It should be understood that early encoding and decoding technologies only used rectangular partitioning, whether for CUs, PUs, or Transform Units (TUs). GPM and AWP, however, implemented non-rectangular partitioning, using a straight line to divide a rectangular block into two partitions. Depending on the position and angle of the line, the two partitions could be triangular, trapezoidal, or rectangular, allowing for partitioning closer to the edges of objects or the edges of two different moving regions. It's important to note that this partitioning isn't a true partition in the strictest sense, but rather a partitioning based on prediction effect. This partitioning only assigns weights to the two reference blocks when generating the prediction block; or simply put, part of the prediction block's location comes from the first reference block, and another part from the second. It doesn't actually divide the current block into two CUs, PUs, or TUs according to the dividing line. Therefore, post-prediction residual transformations, quantization, inverse transformations, and dequantizations all treat the current block as a whole.
[0114] It should be noted that the image to be decoded can be divided into multiple image blocks, and the current image block to be decoded can be called the current block (which can be represented by CU), and the image blocks adjacent to the current block can be called adjacent blocks; that is, in the image to be decoded, the current block and the adjacent blocks have an adjacency relationship. Here, each current block may include a first image component, a second image component, and a third image component, that is, the current block represents the image block in the image to be decoded that currently needs to perform prediction of the first image component, the second image component, or the third image component.
[0115] 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.
[0116] It should also be noted that the prediction mode parameter indicates the prediction mode used for the current block and the parameters associated with that prediction mode. Prediction modes typically include inter-frame prediction modes, traditional intra-frame prediction modes, and non-traditional intra-frame prediction modes. Inter-frame prediction modes further include ordinary inter-frame prediction modes, GPM prediction modes, and AWP prediction modes. In other words, the encoder selects the optimal prediction mode for precoding the current block. During this process, the prediction mode of the current block is determined, and the corresponding prediction mode parameters are written into the bitstream and transmitted from the encoder to the decoder.
[0117] In this way, on the decoder side, the prediction mode parameters of the current block can be directly obtained by parsing the bitstream. The obtained prediction mode parameters are used to determine whether the current block uses a preset inter-frame prediction mode, such as GPM prediction mode or AWP prediction mode.
[0118] S703. Based on the weight derivation mode of the current block, construct a new candidate list of motion information.
[0119] Different categories of weight derivation modes for the current block result in different lists of new motion information candidates. The categories of weight derivation modes for the current block can be predefined.
[0120] In one implementation, the new motion information candidate list can be different depending on the category of the weight derivation mode of the current block. In another implementation, since the length of the new motion information candidate list is limited, the new motion information candidate list can be the same regardless of the category of the weight derivation mode of the current block. Alternatively, it can be said that the weight derivation mode of the current block has multiple different categories, and the new motion information candidate lists constructed can be the same or different when using some of these different categories.
[0121] However, it is worth noting in this field that even when the new motion information candidate list is constructed using certain categories, the decoder may construct the new motion information candidate list in different ways or with different logic.
[0122] In one implementation, the decoder can determine the sorting method corresponding to the weight derivation mode of the current block. The decoder can determine different sorting methods for different weight derivation modes of the current block, thus allowing it to construct a new motion information candidate list from all or part of the known motion information related to the current block based on the sorting method. One way to construct the new motion information candidate list is to write the motion information into an initial motion information candidate list. In this method, the sorting method of the motion information in the new motion information candidate list may differ from a specific sorting method existing in the current technology.
[0123] During the construction of a new candidate list of motion information, the decoder can determine the first motion information that should be filled into the initial candidate list of motion information and fill the first motion information into the position with index value 0 in the initial candidate list of motion information; then the decoder can determine the second motion information that should be filled into the initial candidate list of motion information, and determine whether the second motion information is duplicated with the already filled motion information (duplicate check step). If it is not duplicated, the second motion information is filled into the position with index value 1 in the initial candidate list of motion information, until a preset number of motion information is filled into the initial candidate list of motion information. Then, a certain motion information is filled into the position with an index of the preset number minus one, and the construction of the new candidate list of motion information is completed.
[0124] The decoder can determine the first motion information, the second motion information, etc., from the known motion information related to the current block based on the sorting method.
[0125] In some implementations, the sorting method can be based on known motion information associated with the current block.
[0126] The new motion information candidate list in this embodiment is a candidate list that allows bidirectional motion information. In other embodiments, the new motion information candidate list may be called a bidirectional motion information candidate list.
[0127] In another implementation, the decoder can determine the motion information to be filled in based on the weight derivation mode of the current block. Each piece of motion information to be filled in can be unidirectional motion information, bidirectional motion information, or one or two unidirectional motion information obtained by splitting bidirectional motion information. Then, the decoder can construct a new motion information candidate list based on the motion information to be filled in. In this way, the ordering of motion information in the new motion information candidate list may differ from the current technology that only fills in unidirectional motion information.
[0128] In another implementation, the decoder can determine the sorting method corresponding to the weight derivation mode of the current block, and the motion information to be filled in corresponding to the weight derivation mode of the current block, based on the sorting method and the motion information to be filled in. Based on this sorting method and the motion information to be filled in, a new motion information candidate list is constructed. In this approach, the sorting method of the motion information in the new motion information candidate list may not only differ from a specific sorting method existing in the current technology, but may also differ from the current technology's method of only filling in unidirectional motion information.
[0129] S705. Based on the new motion information candidate list, determine the inter-frame prediction value for the current block.
[0130] The decoder can determine two motion information from a new motion information candidate list. For example, it can find two motion information in the constructed motion information candidate list based on the index of the two parsed motion information. Based on these two motion information, it can use a one-way or two-way prediction method to obtain two intermediate prediction blocks. Then, it can determine the weight of the two intermediate prediction blocks at each pixel position according to the weight derivation mode of the current block, and weight the two intermediate prediction blocks to obtain the prediction block of the current block.
[0131] When the decoder determines that a certain motion information is bidirectional, it uses bidirectional prediction to obtain intermediate prediction blocks. This can be achieved using BIO, DMVR, or other methods. If the motion information is unidirectional, it uses unidirectional prediction to obtain intermediate prediction blocks.
[0132] In this embodiment, since the new motion information candidate list constructed by the decoder is based on the weight derivation mode of the current block, the decoder can construct different new motion information candidate lists according to different weight derivation modes, thereby making the construction of the motion information candidate list conform to the weight derivation mode of the current block, and thus improving the decoding efficiency of the decoder.
[0133] In some embodiments of this application, the above-mentioned S703 can be implemented in the following way: determining the sorting method of known motion information related to the current block based on the weight derivation mode of the current block; and constructing a new motion information candidate list based on the sorting method.
[0134] The known motion information associated with the current block can be the motion information of decoded blocks that are temporally or spatially related to the current block. In the embodiments of this application, the motion information can be unidirectional motion information, bidirectional motion information, or one or two unidirectional motion information obtained by splitting bidirectional motion information.
[0135] The known motion information associated with the current block includes a preset number of motion information items, which can be any number from 2 to 6, such as 2, 3, 4, 5, or 6. The number of motion information items included in the known motion information associated with the current block can be determined by a trade-off between decoding accuracy and decoder performance.
[0136] The known motion information associated with the current block is either available motion information or existing motion information.
[0137] Under different weighted derivation modes, the sorting methods can be the same or different. In some implementations, if the current block is divided into two parts, the part closer to the left, top, or upper left can be selected from these two parts, and the blocks adjacent to that part can be sorted with higher sorting priority.
[0138] Taking the weighted derivation modes in GPM and AWP prediction modes as examples, when the weighted derivation mode of the current block is top-left or bottom-right, the known motion information is sorted by the motion information of the top-left adjacent block of the current block being sorted first; when the weighted derivation mode of the current block is top or bottom, the known motion information is sorted by the motion information of the block above the current block being sorted first; when the weighted derivation mode of the current block is bottom-left or top-right, the known motion information is sorted by the motion information of the bottom-left adjacent block of the current block being sorted first; when the weighted derivation mode of the current block is left or right, the known motion information is sorted by the motion information of the block to the left of the current block being sorted first.
[0139] In some embodiments of this application, the known motion information related to the current block may include N motion information related to the current block; N is an integer greater than or equal to 1; the N motion information related to the current block may include: motion information of at least one neighboring block of the current block in the spatial domain, and / or, motion information of at least one corresponding block of the current block in the temporal domain.
[0140] In some implementations, the N motion information related to the current block may include only the motion information of adjacent blocks. In other implementations, the N motion information related to the current block may include only the motion information of the corresponding block. In still other implementations, the N motion information related to the current block may include not only the motion information of adjacent blocks but also the motion information of the corresponding block.
[0141] In the embodiments of this application, each of the N motion information includes original motion information, which includes motion vector information and reference frame information.
[0142] The motion vector information may include x-axis motion component information and y-axis motion component information, and the reference frame information may include a reference frame list and an index in the reference frame list. The decoder can determine the reference frame information from the reference frame list by the index.
[0143] In the embodiments of this application, the original motion information can be unidirectional original motion information, or bidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information.
[0144] In some embodiments of this application, the sorting method of motion information of at least one adjacent block can be determined based on the weight derivation mode of the current block.
[0145] In some embodiments of this application, when N is greater than or equal to 2, determining the sorting method of known motion information related to the current block based on the weight derivation mode of the current block may include: when the weight derivation mode of the current block is the first type of weight derivation mode, arranging the motion information of at least one corresponding block before the motion information of at least one adjacent block.
[0146] It should be noted that, in some embodiments, the motion information in the embodiments of this application, unless otherwise specified, may refer to the unidirectional raw motion information parsed by the decoder, or the bidirectional raw motion information, or one or two unidirectional raw motion information obtained by splitting the bidirectional raw motion information. The motion information in the embodiments of this application, unless otherwise specified, may refer not only to the unidirectional raw motion information parsed by the decoder, or the bidirectional raw motion information, or one or two unidirectional motion information obtained by splitting the bidirectional raw motion information, but also to unidirectional derived motion information, or bidirectional derived motion information, or one or two unidirectional derived motion information obtained by splitting the bidirectional derived motion information.
[0147] The original motion information (including unidirectional or bidirectional original motion information) in the embodiments of this application can be the motion information obtained by the decoder through parsing the bitstream, and the derived motion information can be obtained by performing mathematical calculations on the original motion information.
[0148] In other embodiments of this application, when N is greater than or equal to 2, determining the sorting method of known motion information related to the current block based on the weight derivation mode of the current block may include: when the weight derivation mode of the current block is the second type of weight derivation mode, interleaving the motion information of at least one corresponding block within the motion information of at least one adjacent block. In this way, the decoder can fill in a portion of the spatial domain motion information, then fill in a portion or all of the temporal domain motion information, and then fill in non-repeating spatial domain motion information, and so on, until a preset number of motion information pieces have been filled.
[0149] In some other embodiments of this application, when N is greater than or equal to 2, determining the sorting method of known motion information related to the current block based on the weight derivation mode of the current block may include: when the weight derivation mode of the current block is the third type of weight derivation mode, arranging the motion information of at least one corresponding block after the motion information of at least one adjacent block.
[0150] Taking a preset quantity of 5 as an example, the number of motion information in the new motion information candidate list is 5, which can be understood as the length of the new motion information candidate list being 5.
[0151] In some implementations, the decoder may first fill the initial motion information candidate list with motion information in one time domain, and then fill the initial motion information candidate list with motion information in four spatial domains.
[0152] In other implementations, the decoder may first fill one, two, or three spatial motion information into the initial motion information candidate list, then fill one temporal motion information into the initial motion information candidate list, and then fill three, two, or one spatial motion information into the initial motion information candidate list.
[0153] In some other implementations, the decoder may first fill the initial motion information candidate list with motion information in four spatial domains, and then fill the initial motion information candidate list with motion information in one temporal domain.
[0154] In one implementation, the initial motion information candidate list is a list including a preset number of fill positions, each fill position being used to fill in motion information (including one of the following: original motion information, derived motion information, unidirectional motion information, and bidirectional motion information). In another implementation, the initial motion information candidate list can be an empty list. In yet another implementation, after obtaining at least one piece of motion information to be filled in, a new motion information candidate list can be generated based on at least one piece of motion information; in this way, there may be no initial motion information candidate list.
[0155] It should be understood that, in the embodiments of this application, regardless of the filling method used, a deduplication step can be performed before filling. It should also be understood that the embodiments of this application are only exemplified by the new motion information candidate list containing only one time-domain motion information; in other embodiments, the new motion information candidate list may contain at least two time-domain motion information.
[0156] It is worth noting that the sorting methods used in the first type of weight derivation mode, the second type of weight derivation mode, the third type of weight derivation mode mentioned above, and the fourth type of weight derivation mode, the fifth type of weight derivation mode mentioned below are different.
[0157] Different weight derivation modes can be combined without conflict. For example, the weight of the current block can belong to both the second and third weight derivation modes, as well as the fourth weight derivation mode. Therefore, the decoder can not only interweave the motion information of at least one corresponding block within or after the motion information of at least one adjacent block, but also sort the motion information according to the following order: the motion information of the lower-left adjacent block, the motion information of the upper-right adjacent block, the motion information of the upper-left adjacent block, and the motion information of the lower-right block in the time domain. This application does not describe each of the weight derivation modes that can be combined.
[0158] Understandably, under different weighting patterns, the constructed new candidate lists of motion information can be the same or different.
[0159] It should be understood that the various sorting methods provided in the embodiments of this application are merely a sorting approach or define the sorting priority of different motion information in the sorting method. When sorting motion information according to a certain sorting method, it does not mean that at least two types of motion information proposed in these sorting methods must be used up. Rather, it means that when the length of the motion information candidate list reaches a preset number (which may be a preset length), it can be determined that the construction of a new motion information candidate list is complete.
[0160] For example, in a certain type of weighted derivation mode, the sorting method is P, Q, R, S in sequence. When the list reaches Q based on this sorting method, the length of the list reaches the preset length, and the new motion information candidate list is completed, and no further sorting is performed.
[0161] This section describes another way to sort N pieces of motion information:
[0162] In some embodiments of this application, when N is greater than or equal to 2, the sorting method of the known motion information related to the current block is determined based on the weight derivation mode of the current block. This may include: the sorting method of the known motion information related to the current block is a sorting method determined from a set of sorting methods. The set of sorting methods includes: multiple sorting methods obtained by performing full permutations of the motion information of the lower left related block, the motion information of the upper right related block, the motion information of the upper left related block, and the motion information of the lower right related block.
[0163] Among them, the sorting method determined from the sorting method set is different when the weight derivation mode of the current block is different.
[0164] Among them, any one of the motion information of the lower left related block of the current block, the motion information of the upper right related block of the current block, the motion information of the upper left related block of the current block, and the motion information of the lower right related block of the current block is: the motion information of the current block in the spatial domain or the motion information of the current block in the temporal domain.
[0165] The sorting method set can include 24 sorting methods. These 24 sorting methods are obtained by fully permuting the motion information of the lower left related block, the upper right related block, the upper left related block, and the lower right related block of the current block. For example, one sorting method is to sort the motion information of the lower left related block, the upper right related block, the upper left related block, and the lower right related block of the current block in sequence.
[0166] The motion information of the current block in the time domain can be all or part of the motion information of the lower left related block of the current block, all or part of the motion information of the upper right related block of the current block, all or part of the motion information of the upper left related block of the current block, and all or part of the motion information of the lower right related block of the current block, or at least two of them.
[0167] During implementation, the motion information of the lower left adjacent block of the current block includes the motion information of all or some blocks to the lower left of the current block.
[0168] The motion information of the upper right adjacent block of the current block includes the motion information of all or some blocks to the upper right of the current block.
[0169] The motion information of the top-left adjacent block of the current block includes the motion information of all or some of the top-left blocks of the current block.
[0170] The motion information of the lower right block of the current block in the time domain includes: the motion information of the block in the time domain outside the current block, or the motion information of the block in the time domain inside the current block.
[0171] Figure 8 This is another schematic diagram illustrating the spatial relationship between the current block and adjacent blocks provided in an embodiment of this application, such as... Figure 8 As shown, the lower-left adjacent block of the current block 801 can be located in the lower-left region 802 of the current block, and the lower-left adjacent block of the current block 801 can include at least one adjacent block. The upper-left adjacent block of the current block 801 can be located in the upper-left region 803 of the current block, and the upper-left adjacent block of the current block 801 can include at least one adjacent block. The upper-right adjacent block of the current block 801 can be located in the upper-right region 804 of the current block, and the upper-right adjacent block of the current block 801 can include at least one adjacent block. Each adjacent block can be adjacent to the current block 801.
[0172] It is worth noting that the sorting according to the order of J, K, L mentioned in the embodiments of this application can be performed in the following ways:
[0173] (1) Determine whether J exists.
[0174] If J exists, fill J into the initial motion information candidate list and jump to (2).
[0175] If J does not exist, jump to (3).
[0176] (2) Determine whether the number of motion information already entered is the preset number minus one.
[0177] If not, proceed to (3).
[0178] If so, the motion information in the spatial domain of the relevant block has been filled in.
[0179] (3) Determine whether K exists.
[0180] If K exists, add K to the initial motion information candidate list and jump to (4).
[0181] If K does not exist, jump to (5).
[0182] (4) Determine whether the number of motion information already entered is the preset number minus one.
[0183] If not, proceed to (5).
[0184] If so, the motion information in the spatial domain of the relevant block has been filled in.
[0185] (5) Determine whether L exists.
[0186] If L exists, L is added to the initial motion information candidate list, and the motion information in the spatial domain of the relevant block is filled in.
[0187] If L does not exist, the motion information in the spatial domain of the relevant block is filled in.
[0188] Once the motion information in the spatial domain of the relevant block has been filled in, the decoder can then proceed to fill in the motion information in the temporal domain of the current block.
[0189] This section describes another method for determining the order of known motion information related to the current block based on the weight derivation pattern of the current block when N is greater than or equal to 2:
[0190] In some implementations, the decoder can, when the weight derivation mode of the current block is the fourth type of weight derivation mode, arrange all or part of the unidirectional original motion information from the N motion information before splitting the bidirectional motion information from the N motion information to obtain all or part of one or two unidirectional original motion information.
[0191] It should be noted that in the embodiments of this application, each of the N motion information can be unidirectional motion information, or each of the N motion information can be bidirectional motion information, or a portion of the N motion information can be unidirectional motion information and another portion can be bidirectional motion information.
[0192] In this implementation, the decoder always fills in unidirectional raw motion information first. If the number of unidirectional raw motion information filled in is less than the preset number, then it will consider filling in one or two bidirectional raw motion information obtained by splitting the bidirectional motion information.
[0193] It is necessary to clarify the limitations of "all" and "part" in this application. The whole of an object refers to that single object, and a part of an object also refers to that single object. For example, when there is only one unidirectional original motion information among N motion information, the whole of the unidirectional original motion information refers to that single unidirectional original motion information, and a part of the unidirectional original motion information also refers to that single unidirectional original motion information; when there are at least two unidirectional original motion information among N motion information, the whole or part of the unidirectional original motion information can be understood in the art.
[0194] In other implementations, when the weight derivation mode of the current block is the fifth type of weight derivation mode, the decoder can arrange all or part of the unidirectional original motion information in the N motion information before all or part of the bidirectional motion information in the N motion information.
[0195] In this implementation, the decoder first fills in the unidirectional raw motion information, and only considers filling in the bidirectional motion information if the number of unidirectional raw motion information filled in is less than the preset number.
[0196] In some other implementations, the decoder can determine the sorting priority of N motion information when the weight derivation mode of the current block is the sixth type of weight derivation mode, and sort the N motion information based on the sorting priority.
[0197] In this implementation, the decoder does not need to consider the one-way and two-way issues of N motion information, but instead fills in the N motion information according to the pre-set sorting priority of the N motion information.
[0198] For example, the decoder can first fill in the first unidirectional raw motion information, then fill in the second bidirectional raw motion information, or fill in one or two unidirectional motion information obtained by splitting the second bidirectional raw motion information.
[0199] For example, when there is derived motion information, the decoder can first fill in the first unidirectional original motion information, then fill in the first unidirectional derived motion information, and then fill in the second bidirectional original motion information and the second bidirectional derived motion information. Alternatively, it can fill in one or two unidirectional motion information obtained by splitting the second bidirectional original motion information, as well as the unidirectional derived motion information or bidirectional derived motion information corresponding to the one or two unidirectional motion information.
[0200] In another implementation, the decoder can determine the bidirectional information of each of the N motion information and the sorting priority of the N motion information when the weight derivation mode of the current block is the seventh type weight derivation mode, and sort the N motion information based on the bidirectional information and sorting priority of each motion information.
[0201] In this implementation, the decoder needs to comprehensively consider the one-way and two-way problems of N motion information and the sorting priority of N motion information, and then sort the N motion information based on these two factors.
[0202] This section describes how to obtain motion information for a specific block. First, the decoder can identify the first specific frame as an image frame other than the current frame and the frame containing the corresponding block. Then, on the first specific frame, the motion information of the first target block corresponding to the current block can be determined. Finally, the motion information of the first target block can be scaled to obtain the motion information of the corresponding block.
[0203] During implementation, the motion information of the first target block is scaled to obtain the motion information of the corresponding block, which may include one of the following:
[0204] The bidirectional motion information of the first target block is scaled to obtain the bidirectional motion information of the corresponding block;
[0205] The unidirectional motion information of the first target block is scaled to obtain the bidirectional motion information of the corresponding block.
[0206] In one implementation, scaling the motion information of the first target block can be achieved by mapping the motion information of the first target block onto a corresponding block, thereby obtaining the motion information of the corresponding block.
[0207] In this application embodiment, the concept of derived motion information is also creatively proposed. The following explains the derived motion information and its ordering in the new motion information candidate list:
[0208] In this embodiment, each of the N motion information pieces further includes derived motion information, which is determined based on the original motion information. The derived motion information includes motion vector information and reference frame information. The derived motion information corresponding to different motion information pieces may be the same or different.
[0209] The derived motion information can be unidirectional, bidirectional, or a combination of two unidirectional derived motion information obtained by splitting bidirectional derived motion information. Unidirectional derived motion information is determined based on either unidirectional original motion information or bidirectional motion information, while bidirectional derived motion information is determined based on either unidirectional original motion information or bidirectional motion information.
[0210] This section describes the sorting method for N motion information items when N is greater than or equal to 2:
[0211] In some embodiments, the decoder may arrange all or part of the N original motion information before all or part of the N derived motion information.
[0212] Regarding the original motion information and its order, please refer to the description above; it will not be repeated here.
[0213] In this implementation, the decoder always fills in the original motion information first, and only considers filling in the derived motion information if the amount of original motion information filled in is less than the preset amount.
[0214] In other implementations, the decoder can determine at least one of the following: the one-way and two-way information of each of the N original motion information, the sorting priority of the N original motion information, the one-way and two-way information of each of the N derived motion information, and the sorting priority of the N derived motion information, and sort the N motion information based on at least one of the following:
[0215] In this implementation, the decoder can sort N motion information based on at least one type of information, thereby obtaining a new candidate list of motion information that can achieve a balance between prioritizing unidirectional information, the default sorting method, and the sorting method of derived information, thus making the sorting more in line with the actual situation.
[0216] This section describes how the decoder determines derived motion information based on the original motion information:
[0217] In the embodiments of this application, the methods for determining derived motion information based on original motion information can be roughly divided into two types. The first method is to perform mathematical calculations on each piece of original motion information to obtain the derived motion information corresponding to each piece of original motion information. The second method is to average or weighted average the original motion information of at least two adjacent blocks to obtain the derived motion information corresponding to the original motion information of at least two adjacent blocks.
[0218] The first method is described here, which involves calculating each piece of raw motion information, where:
[0219] The prediction direction of the derived motion information is the same as the prediction direction of the original motion information. This prediction direction can be unidirectional or bidirectional.
[0220] The reference frame information for derived motion information is the same as the reference frame information for original motion information.
[0221] During implementation, the decoder can determine the motion vector of the derived motion information based on the motion vector of the original motion information.
[0222] The motion vector information includes first-axis component information and second-axis component information. The first axis is either the x-axis or the y-axis, and the second axis is either the y-axis or the x-axis; the first axis and the second axis are different. For example, if the first axis is the x-axis, then the second axis is the y-axis; if the first axis is the y-axis, then the second axis is the x-axis.
[0223] The method for determining the motion vector information of derived motion based on the motion vector information of the original motion information can be as follows: Based on the first axis component information and the second axis component information in the original motion information, determine the first axis component information and the second axis component information of each of the M derived motion information, and use the first axis component information and the second axis component information of each derived motion information as the motion vector information of each derived motion information; M is an integer greater than or equal to 1.
[0224] One original motion information can generate one or at least two derived motion information. For example, one original motion information can generate one, two, or four derived motion information, etc.
[0225] In one implementation, the sign of the x-axis component in the motion vector information of the original motion information is the same as the sign of the x-axis component in each of the M derived motion information. Similarly, the sign of the y-axis component in the motion vector information of the original motion information is the same as the sign of the y-axis component in each of the M derived motion information.
[0226] During implementation, the determination of motion vector information for derived motion information can be achieved in two main ways: the first is by addition, and the second is by scaling.
[0227] There are two methods for calculating motion information using addition. The first method involves adding one axis from the original motion information to obtain the derived motion information, and the motion information of the other axis from the original information is used as the motion information of the other axis in the derived motion information. The second method involves adding both axes from the original motion information.
[0228] The first method involves determining the first and second axis component information of each of the M derived motion information based on the first and second axis component information in the original motion information. This can include: adding M third values to the first axis component information in the original motion information to obtain M summed first axis results; determining the first axis component information of each derived motion information based on each of the M summed first axis results; and using the second axis component information of the original motion information as the second axis component information of each of the M derived motion information.
[0229] The second method involves determining the first and second axis component information of each of the M derived motion information based on the first and second axis component information in the original motion information. This can include: adding M third values to the first axis component information in the original motion information to obtain M summed first axis results; determining the first axis component information of each derived motion information based on each of the M summed first axis results; and adding M third values to the second axis component information in the original motion information to obtain M summed second axis results; determining the second axis component information of each derived motion information based on each of the M summed second axis results.
[0230] In one implementation, determining the first axis component information of each derived motion information based on each of the M first axis summation results may include: taking each of the M first axis summation results as the first axis component information of each derived motion information.
[0231] There are two methods for scaling calculations. The first method involves scaling one axis of the original motion information to obtain derived motion information, and the motion information of the other axis of the original information is used as the motion information of the other axis of the derived motion information. The second method involves scaling both axes of the original motion information.
[0232] The first method: Based on the first axis component information and the second axis component information in the original motion information, determine the first axis component information and the second axis component information of each of the M derived motion information, which may include: determining the second axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information; and using the second axis component information of the original motion information as the second axis component information of each of the M derived motion information.
[0233] The second method: Based on the first axis component information and the second axis component information in the original motion information, determine the first axis component information and the second axis component information of each of the M derived motion information. This may include: determining the first axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information; and determining the second axis component information of each of the M derived motion information based on the scaling result of the second axis component information of the original motion information.
[0234] In this embodiment, scaling calculation involves scaling the first axis and / or the second axis in the original motion information. Scaling can be either enlarging or reducing. In one embodiment, scaling calculation involves enlarging or reducing the first axis and / or the second axis to directly obtain the motion vector of the derived motion information. In another embodiment, scaling calculation involves determining the motion vector of the derived motion information based on the result of enlarging or reducing the first axis and / or the second axis. For example, when enlarging or reducing the first axis and / or the second axis, other related calculations are also performed to obtain the motion vector of the derived motion information.
[0235] It is understood in the art that scaling calculation and addition calculation are different types of calculations. Different calculation methods produce different derived motion information, and thus the correlation of the derived motion information is also different. Tests have shown that scaling calculation yields higher correlation.
[0236] The following describes the implementation of scaling calculation. It should be understood that although the embodiments of this application use the first axis as an example for relevant description, it should be understood in the art that since the first axis is the x-axis or y-axis, the process of scaling the x-axis and scaling the y-axis in the embodiments of this application can be easily known by describing the first axis.
[0237] Scaling calculations can include multiplication or division calculations; both multiplication and division calculations are scaling calculations, as explained below:
[0238] In some implementations, determining the second axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information includes: multiplying the first axis component information of the original motion information by M first values to obtain M first results, and determining the first axis component information of each derived motion information based on each of the M first results.
[0239] In other embodiments, determining the second axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information includes: dividing the first axis component information of the original motion information by M second values to obtain M first divisors, and determining the first axis component information of each derived motion information based on each of the M first divisors.
[0240] In some implementations, determining the first axis component information of each derived motion information based on each of the M first results includes: taking each of the M first results as the first axis component information of each derived motion information.
[0241] In other embodiments, determining the first axis component information of each derived motion information based on each of the M first results includes: determining M third values corresponding one-to-one with the M first results, adding the M first results and the M third values one-to-one to obtain M second results, and determining the first axis component information of each derived motion information based on each of the M second results.
[0242] In some implementations, determining the first axis component information of each derived motion information based on each of the M second results includes: taking each of the M second results as the first axis component information of each derived motion information.
[0243] In other implementations, each of the M second results is right-shifted by a specific number of bits to obtain M third results, and based on each of the M third results, the first axis component information of each derived motion information is determined.
[0244] The third value is obtained by shifting the target bit to the left, where the target bit is a specific number of bits minus one.
[0245] In some implementations, the absolute value of the first axis component information in the motion vector information of the original motion information is greater than a first threshold; the M first values include a first specific value and a second specific value, the first specific value is greater than 0 and less than 1, the second specific value is greater than 1 and less than 2, and the sum of the first specific value and the second specific value is 2.
[0246] In some embodiments, the method further includes: determining a first specific value as a first coefficient when the absolute value of the first axis component information of the original motion information is less than or equal to a second threshold; determining the first specific value as a second coefficient when the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the second threshold and less than or equal to a third threshold; and determining the first specific value as a third coefficient when the absolute value of the first axis component information in the motion vector information of the original motion information is greater than a third threshold; wherein the first coefficient is less than the second coefficient, and the second coefficient is less than the third coefficient.
[0247] In one implementation, the second threshold is 64, the first coefficient is 0.75, the third threshold is 128, the second coefficient is 0.875, and the third coefficient is 0.9375. It will be understood in the art that these values can have other values based on actual circumstances, and this application does not limit such values.
[0248] In some embodiments, the method further includes: when the absolute value of the first axis component information of the original motion information is less than or equal to a first threshold and the first axis component information in the motion vector information of the original motion information is a positive number, using the first target value as the first axis component information of the derived motion information; when the absolute value of the first axis component information in the motion vector information of the original motion information is less than or equal to the first threshold and the first axis component information in the motion vector information of the original motion information is a negative number, using the negative first target value as the first axis component information of the derived motion information.
[0249] In one embodiment, the first target value is 4 to 10, for example, the first target value is 4, 6, 8, or 10. In the embodiment of this application, the first target value is 8.
[0250] The first threshold can be a number greater than 0, and the first threshold is relatively close to 0. For example, the first threshold can be 1, 2, or 3, etc. Numbers greater than the first threshold can be understood as numbers that are far from 0.
[0251] In some implementations, the M first divisors include a first group of divisors, and / or a second group of divisors, and / or a third group of divisors;
[0252] Each divisor in the first group is greater than the maximum threshold.
[0253] In the second group of divisors, each divisor is greater than or equal to the minimum threshold and less than or equal to the maximum threshold.
[0254] Each divisor in the third group is less than the minimum threshold;
[0255] Based on each of the M first divisors, determine the first axis component information of each derived motion information, including at least one of the following:
[0256] The maximum threshold is used as the first axis component information of each derived motion information corresponding to the first group of divisors in the M derived motion information;
[0257] Each divisor in the second group of divisors is used as the first axis component information of each derivative motion information corresponding to the second group of divisors in the M derivative motion information;
[0258] The minimum threshold is used as the first axis component information of each derived motion information corresponding to the third group of divisors in the M derived motion information.
[0259] In other implementations, determining the first axis component information of each derived motion information based on each of the M first divisors includes: calculating the first axis component information of each derived motion information using a specific function based on each of the M first divisors, wherein the specific function is the CLIP function, where min in the CLIP function can correspond to the minimum threshold and max in the CLIP function can correspond to the maximum threshold.
[0260] The first value, second value, third value, fourth value, first specific value or second specific value, etc., appearing in the embodiments of this application can be an integer or a decimal (which can be called a floating-point number), or an integer or a negative number. The embodiments of this application do not limit this.
[0261] The first specific value can be one of the following: 0.5, 0.75, 0.8, 0.9, 1.1, 1.2, 1.25, 1.5.
[0262] In one implementation, the number of bits shifted to the right can be fixed.
[0263] In another implementation, at least two of the first value, the third value, and the number of bits shifted to the right may have a corresponding relationship.
[0264] In one implementation, the third value can be determined based on the number of bits shifted to the right. For example, the third value is obtained by shifting a number one left by a target bit, where the target bit can be the number of bits shifted to the right minus one. Mathematically, this can be expressed as value = 1 << (shift - 1), where shift is the number of bits shifted to the right and value is the third value. Other values where value is 1 << (shift - 1) are not limited here.
[0265] In some implementations, when the raw motion information is bidirectional raw motion information, the decoder may also perform the following steps:
[0266] The original motion information is split into a first unidirectional original motion information and a second unidirectional original motion information. The first value is multiplied by the first axis component or the second axis component of the motion vector information of the first unidirectional original motion information, and the result is used as the first axis component or the second axis component of the motion vector information of the first unidirectional derived motion information. The fourth value is multiplied by the first axis component or the second axis component of the motion vector information of the second unidirectional original motion information, and the result is used as the first axis component or the second axis component of the motion vector information of the second unidirectional derived motion information. Wherein, both the first value and the fourth value are greater than 0. Wherein, the first value and the fourth value are the same, or the first value and the fourth value are different and the sum of the first value and the fourth value is 2.
[0267] The second method is described here, which involves calculating from at least two pieces of raw motion information, wherein:
[0268] The N motion information may include: the original motion information of at least two adjacent blocks in the spatial domain of the current block; at least two adjacent blocks are adjacent, or at least two adjacent blocks are at the lower left, upper right, or upper left corner of the current block.
[0269] The decoder determines derived motion information based on the original motion information, which may include: the decoder can determine a second target block from at least two adjacent blocks, and take the frame where the second target block is located as a second specific frame; then, the decoder can scale the motion vector information in the original motion information of the adjacent blocks other than the second target block in the at least two adjacent blocks to the second specific frame to obtain motion vector information of at least two blocks to be averaged; wherein, the at least two blocks to be averaged include the second target block; then, the motion vector information of the at least two blocks to be averaged can be averaged or weighted to obtain the motion vector information of the corresponding derived motion information; finally, the motion vector information of the corresponding derived motion information can be used as the motion vector information of the derived motion information of each of the at least two adjacent blocks.
[0270] The prediction direction of the derived motion information is the same as that of the original motion information, and the reference frame information of the derived motion information is the second specific frame.
[0271] Figure 9 A flowchart illustrating another inter-frame prediction method provided in this application embodiment is shown below. Figure 9 As shown, this method is applied to a decoder and may include:
[0272] S901: The decoder parses the bitstream and obtains the weight export mode of the current block.
[0273] S903. Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block.
[0274] The known motion information related to the current block includes N motion information related to the current block; N is an integer greater than or equal to 1. The N motion information related to the current block include: motion information of at least one neighboring block in the spatial domain, and / or motion information of at least one corresponding block in the temporal domain. Each of the N motion information includes the original motion information.
[0275] S905. Determine the initial motion information candidate list.
[0276] In one implementation, the initial motion information candidate list can be an empty list, and the length of the initial motion information candidate list can be a preset number, so that a preset number of motion information can be placed in it.
[0277] S907. Based on the sorting method, all or part of the original motion information of at least one adjacent block, and / or all or part of the original motion information of at least one corresponding block, are sequentially or alternately filled into the initial motion information candidate list to obtain a new motion information candidate list.
[0278] In some implementations, the decoder may only consider filling in the original motion information. For example, the decoder may fill in the original motion information in four spatial domains and one temporal domain sequentially or alternately.
[0279] In other implementations, each of the N motion information includes derived motion information. Then there may be a scenario where the derived motion information is filled into the initial motion information candidate list. In this case, the decoder may fill at least one of the following into the initial motion information candidate list in sequence or alternately, based on the sorting method: all or part of the original motion information of at least one adjacent block, all or part of the original motion information of at least one corresponding block, all or part of the derived motion information of at least one adjacent block, and all or part of the derived motion information of at least one corresponding block.
[0280] In the embodiments of this application, when the derived motion information to be filled in is bidirectional derived motion information, the bidirectional derived motion information is split into two unidirectional derived motion information; at least one of the two unidirectional derived motion information is filled into the initial motion information candidate list; and / or, when the original motion information to be filled in is bidirectional original motion information, the bidirectional original motion information is split into two unidirectional original motion information, at least one of the two unidirectional original motion information is filled into the initial motion information candidate list, or the bidirectional original motion information is filled into the initial motion information candidate list.
[0281] It should be noted that, regardless of the order in which the motion information is entered into the initial motion information candidate list, no more motion information will be entered into the initial motion information candidate list once the number of entered motion information reaches the preset number or the initial motion information candidate list is full.
[0282] In some implementations, the initial motion information candidate list can be filled with a preset number of motion information; each of the preset number of motion information is original motion information or derived motion information; the preset number is between 2 and 6.
[0283] In some implementations, the method may further include: after filling at least one original motion information into the initial motion information candidate list, determining the derived motion information to be filled; and filling the derived motion information to be filled into the initial motion information candidate list.
[0284] In other embodiments, the method may further include: after filling at least one original motion information into an initial motion information candidate list, determining the derived motion information to be filled; if the derived motion information to be filled is different from the original motion information that has already been filled and corresponds to the derived motion information to be filled, filling the derived motion information to be filled into the initial motion information candidate list.
[0285] In some other embodiments, the method may further include: after filling at least one original motion information into an initial motion information candidate list, determining the derived motion information to be filled; if the derived motion information to be filled is different from the original motion information that has already been filled, filling the derived motion information to be filled into the initial motion information candidate list.
[0286] S909. Based on the new motion information candidate list, determine the inter-frame prediction value for the current block.
[0287] In this application embodiment, a method for constructing a new motion information candidate list based on sorting method is proposed. The method for constructing a new motion information candidate list can be flexibly constructed according to different sorting methods. Thus, the new motion information candidate list can arrange motion information in order of strong to weak relevance with the current block, thereby improving the decoding efficiency of the current block.
[0288] Figure 10 A flowchart illustrating another inter-frame prediction method provided in this application embodiment is shown below. Figure 10 As shown, this method is applied to a decoder and may include:
[0289] S1001: The decoder parses the bitstream and obtains the weight export mode of the current block.
[0290] S1003. Based on the bitstream parsed by the decoder, obtain the original motion information of at least one adjacent block and the original motion information of at least one corresponding block.
[0291] S1005. Generate a specific number of derived motion information based on all or part of the original motion information of at least one adjacent block, and / or based on all or part of the original motion information of at least one corresponding block.
[0292] Among them, a specific number is less than or equal to 8; the specific number of derived motion information includes: derived motion information of adjacent blocks and / or derived motion information of corresponding blocks.
[0293] S1007. Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block.
[0294] S1009. Based on the sorting method, construct a new candidate list of motion information.
[0295] In one implementation, the decoder can fill all or part of the original motion information of at least one adjacent block, all or part of the original motion information of at least one corresponding block, and a specific number of generated derivative motion information into the initial motion information candidate list based on the sorting method, thereby constructing a new motion information candidate list.
[0296] S1011. Based on the new motion information candidate list, determine the inter-frame prediction value for the current block.
[0297] In this embodiment of the application, the decoder can obtain all motion information that can be filled into the initial motion information candidate list, and then fill in all the obtained motion information in sequence according to the sorting method until the number of filled motion information is a preset number.
[0298] This document describes another method for obtaining a new candidate list of motion information, provided by an embodiment of this application:
[0299] In some implementations, the decoder can obtain the original motion information of at least one adjacent block and the unidirectional or bidirectional motion information of a corresponding block based on the bitstream parsed by the decoder; fill one of the unidirectional original motion information of at least one adjacent block, or at least two different unidirectional original motion information, into the initial motion information candidate list; if the first total number of unidirectional original motion information filled into the initial motion information candidate list is equal to a preset number minus one, continue to fill the unidirectional or bidirectional motion information of a corresponding block into the initial motion information candidate list.
[0300] In some implementations, if the first total number of unidirectional raw motion information entries added to the initial motion information candidate list is less than a preset number minus one, the bidirectional raw motion information of at least one adjacent block is sequentially split to obtain two unidirectional raw motion information entries corresponding to the bidirectional raw motion information. Then, the two corresponding unidirectional raw motion information entries that differ from the already added unidirectional motion information entries are sequentially added to the initial motion information candidate list. If the second total number of raw motion information entries added to the initial motion information candidate list is equal to a preset number minus one, the unidirectional or bidirectional motion information of a corresponding block is added to the initial motion information candidate list. In this implementation, only the unidirectional motion information of adjacent blocks is added.
[0301] In another embodiment, if the first total number of unidirectional raw motion information filled into the initial motion information candidate list is less than a preset number minus one, then bidirectional raw motion information of at least one adjacent block is sequentially added into the initial motion information candidate list; if the second total number of raw motion information filled into the initial motion information candidate list is equal to a preset number minus one, then unidirectional or bidirectional motion information of a corresponding block is added into the initial motion information candidate list.
[0302] In this implementation, bidirectional motion information of adjacent blocks is also filled in.
[0303] In some implementations, if the second total number of unidirectional original motion information filled into the initial motion information candidate list is less than a preset number minus one, the first two unidirectional original motion information filled into the initial motion information candidate list are obtained; based on the first two unidirectional original motion information, four corresponding unidirectional derived motion information are determined; the four derived motion information that are different from the already filled unidirectional motion information are sequentially filled into the initial motion information candidate list; if the third total number of unidirectional original motion information and unidirectional derived motion information filled into the initial motion information candidate list is equal to a preset number minus one, the unidirectional motion information or bidirectional motion information of a corresponding block is filled into the initial motion information candidate list.
[0304] In some implementations, if the total number of unidirectional original motion information and unidirectional derived motion information filled into the initial motion information candidate list is less than a preset number minus one, the unidirectional motion information or bidirectional motion information of a corresponding block is continued to be filled into the initial motion information candidate list; the unidirectional motion information or bidirectional motion information of the corresponding block that has already been filled is copied and filled in until the total number of filled motion information is the preset number.
[0305] In the method of obtaining a new motion information candidate list in the embodiments of this application, the decoder can fill in a portion of highly relevant motion information. After filling in the highly relevant motion information, if the number of motion information filled in does not reach the preset number, the decoder can then calculate the less relevant motion information and continue to fill in the calculated less relevant motion information into the initial motion information candidate list, thereby reducing the amount of computation of the decoder.
[0306] It is worth noting that, in this embodiment of the application, regardless of the method used to fill in the exercise information, when the total number of exercise information entries reaches a preset number, the filling process is completed, that is, no more entries are made, the filling process terminates, and a new list of candidate exercise information is obtained.
[0307] Figure 11 A flowchart illustrating another inter-frame prediction method provided in this application embodiment is shown below. Figure 11 As shown, this method is applied to a decoder and may include:
[0308] S1101. Parse the bitstream and determine the prediction mode parameters for the current block.
[0309] The prediction mode parameter is used to indicate whether to use the geometric partitioning prediction mode (GPM) or the angle-weighted prediction mode (AWP) to determine the inter-frame prediction value for the current block.
[0310] S1103. Determine the weight derivation mode of the current block from the prediction mode parameters of the current block.
[0311] In the weighted export mode of the current block, the current block is divided into the first partition and the second partition.
[0312] S1105. Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block.
[0313] The known motion information related to the current block includes N motion information related to the current block, which includes: motion information of at least one neighboring block of the current block in the spatial domain, and / or motion information of at least one corresponding block of the current block in the temporal domain.
[0314] Figure 12 This application provides a schematic diagram illustrating the spatial relationship between the current block, adjacent blocks, and corresponding blocks, as shown in the embodiments of this application. Figure 12 As shown, where:
[0315] At least one adjacent block of the current block E may include at least one of the following: outer bottom-left block F, inner right-outer top block G, outer top-right block C, inner top-outer left block B, inner left-outer top block A, and outer top-left block D. At least one corresponding block includes at least one of the following: block H corresponding to the inner top-left corner of the current block E, block I2 corresponding to the inner bottom-right corner of the current block, and block I1 corresponding to the outer bottom-right corner of the current block.
[0316] As not shown in the figures of this application embodiment, this application embodiment may also provide another positional relationship between the current block, adjacent blocks, and corresponding blocks: at least one adjacent block includes at least one of the following: an inner left outer bottom block, an inner upper outer right block, an outer upper right block, an outer lower left block, and an outer upper left block. At least one corresponding block includes at least one of the following: a block corresponding to the upper left corner of the current block's interior, a block corresponding to the lower right corner of the current block's interior, and a block corresponding to the lower right corner of the current block's exterior.
[0317] It should be understood that there may be other positional relationships between the current block, adjacent blocks and corresponding blocks, and this application does not limit this.
[0318] In one implementation, for example, the position of at least one adjacent block can be referenced. Figure 12 As shown in A to F. In another embodiment, at least one adjacent block may include at least one of: inner left outer lower block, inner upper outer right block, outer upper right block, outer lower left block, and outer upper left block. In this embodiment, the decoder may perform grouping of multiple weighted derivation modes in the geometric partitioning prediction mode, or multiple weighted derivation modes in the angle-weighted prediction mode, to obtain at least two classes of weighted derivation modes; different classes of weighted derivation modes correspond to different sorting methods.
[0319] In some implementations, the eighth type of weight derivation pattern is used to characterize the current block's weight derivation pattern as a top-left or bottom-right weight derivation pattern; the ninth type of weight derivation pattern is used to characterize the current block's weight derivation pattern as a top or bottom weight derivation pattern; the tenth type of weight derivation pattern is used to characterize the current block's weight derivation pattern as a bottom-left or top-right weight derivation pattern; and the eleventh type of weight derivation pattern is used to characterize the current block's weight derivation pattern as a left or right weight derivation pattern.
[0320] by Figure 12 The following example illustrates the sorting method for determining known motion information:
[0321] In some embodiments of this application, when the weight derivation mode of the current block belongs to the eighth type of weight derivation mode, the sorting method of the known motion information is determined to be the sorting method of the motion information of the upper left adjacent block of the current block that is sorted first.
[0322] In one implementation, when the weight derivation mode of the current block belongs to the eighth type of weight derivation mode, the sorting method of the known motion information is determined as follows: the sorting of motion information of the upper left adjacent block of the current block and the sorting of motion information of the corresponding block of the current block in the time domain, in order of priority.
[0323] It is understood that the top-left neighbor of the current block includes one or more of the following: the outer top-left, the inner top-outer left, and the inner left-outer top. Other descriptions of the current block are similar.
[0324] In one implementation, the sorting method can be to sort the motion information of the upper left block of the current block, the motion information of the corresponding block of the current block in the time domain, the motion information of the lower left block of the current block, and the motion information of the upper right adjacent block of the current block in sequence.
[0325] In some other embodiments of this application, when the weight derivation mode of the current block belongs to the ninth type of weight derivation mode, the decoder can determine the sorting method of the known motion information as the sorting method of the motion information of the previous block of the current block.
[0326] In one implementation, when the weight derivation mode of the current block belongs to the ninth type of weight derivation mode, the decoder can determine the sorting method of the known motion information as the motion information of the block above the current block, the motion information of the internal left outer lower block of the current block, and so on, in that order.
[0327] During implementation, the parent block of the current block can include both the outer and inner parent blocks of the current block, or the parent block of the current block can include the inner parent block of the current block but not the outer parent block of the current block. Other descriptions of the current block are similar.
[0328] In one implementation, the sorting method can be to sort the motion information of the block above the current block, the motion information of the block below the left outer layer inside the current block, the motion information of the block corresponding to the current block in the time domain, the motion information of the block above the left outer layer outside the current block, the motion information of the block above the right outer layer outside the current block, and the motion information above the left outer layer inside the current block in sequence.
[0329] In some other embodiments of this application, when the weight derivation mode of the current block belongs to the tenth type of weight derivation mode, the decoder can determine that the sorting method of the known motion information is the sorting method of the motion information of the lower left block of the current block.
[0330] In one implementation, if the weight derivation mode of the current block belongs to the tenth type of weight derivation mode, the decoder can determine that the sorting method of the known motion information is the sorting method of the motion information of the lower left block of the current block, the motion information of the inner right outer part of the current block, and so on.
[0331] In one implementation, the sorting method can be to sort the motion information of the lower left block inside the current block, the upper right block inside the current block, the upper right block outside the current block, the upper left block inside the current block, the upper left block inside the current block, the upper left block outside the current block, and the motion information of the corresponding block of the current block in the time domain in sequence.
[0332] In some further embodiments of this application, when the weight derivation mode of the current block belongs to the eleventh type of weight derivation mode, the decoder can determine the sorting method of the known motion information as the sorting method of the motion information of the left block of the current block that comes first.
[0333] In one implementation, if the weight derivation mode of the current block belongs to the eleventh type of weight derivation mode, the decoder can determine the sorting method of the known motion information as the sorting method of the motion information of the left block of the current block and the motion information of the upper right block outside the current block.
[0334] For example, the left block of the current block can include the inner left block of the current block and / or the outer left block of the current block.
[0335] In one implementation, the sorting method can be to sort the motion information of the lower left block inside the current block, the motion information of the upper left block inside the current block, the motion information of the upper right block outside the current block, the motion information of the corresponding block of the current block in the time domain, the motion information of the upper left block outside the current block, the motion information of the upper left block inside the current block, and the motion information of the upper right block inside the current block in sequence.
[0336] S1107. Based on the sorting method, construct a new candidate list of motion information.
[0337] S1109. From the new motion information candidate list, determine the motion information of the first partition and the motion information of the second partition.
[0338] In one implementation, the decoder can first determine the index values of the first partition and the second partition from the parsed bitstream; then, based on a new motion information candidate list, determine the motion information in the new motion information candidate list indicated by the index value of the first partition as the motion information of the first partition; finally, based on the new motion information candidate list, determine the motion information in the new motion information candidate list indicated by the index value of the second partition as the motion information of the second partition.
[0339] S1111. Determine the first predicted value of the first partition based on the motion information of the first partition, and determine the second predicted value of the second partition based on the motion information of the second partition.
[0340] In some implementations, when the motion information of the first partition is bidirectional motion information, the motion information of the first partition is processed according to a bidirectional prediction method to determine a first predicted value for the first partition; and / or, when the motion information of the second partition is bidirectional motion information, the motion information of the second partition is processed according to a bidirectional prediction method to determine a second predicted value for the second partition.
[0341] The bidirectional prediction method can be either a method that does not use bidirectional optical flow (BIO) or a method that optimizes motion vectors at the decoder side (DMVR). In other embodiments, the bidirectional prediction method can also be a method that uses bidirectional optical flow (BIO) or a method that optimizes motion vectors at the decoder side (DMVR), and this application does not limit this method.
[0342] Based on the computational cost of the decoder,
[0343] S1113. The first and second predicted values are weighted and fused to obtain the inter-frame predicted value of the current block.
[0344] In this embodiment, the decoder can construct different candidate lists of motion information according to different weight derivation modes of the current block, so that the sorting method of motion information in the candidate list of motion information can match the weight derivation mode. Thus, the new candidate list of motion information can arrange the motion information in order of strong to weak correlation with the current block, thereby improving the decoding efficiency of the current block.
[0345] In some implementations, the decoder can determine at least one of the following: the size of the current block, the shape of the current block, and the aspect ratio of the current block, based on the weighted derivation mode of the current block, and determine the sorting method of the known motion information related to the current block based on the at least one of these factors.
[0346] For example, the decoder derives the mode based on the weight of the current block, determines the aspect ratio of the current block, and determines the sorting method of the known motion information related to the current block based on the aspect ratio of the current block.
[0347] The ordering of known motion information differs depending on the aspect ratio of the current block. For example, with... Figure 4c 11 and Figure 4dTaking 11 as an example, Figure 4c The black portion of number 11 covers the top right corner of the current block, but... Figure 4d The black portion in block 11 not only covers the top right corner of the current block but also the top left corner. Therefore, the decoder can... Figure 4c The sorting method for the known motion information determined in 11 is set to be based on Figure 4c The 11 determined by the known motion information are sorted in different ways. This can improve decoding efficiency and compression performance.
[0348] In other embodiments, the decoder can not only determine a group of weighted derivation modes in the geometric partitioning prediction mode based on the weighted derivation mode of the current block, or determine a group of weighted derivation modes in the angle-weighted prediction mode, but also determine at least one of the size, shape, and aspect ratio of the current block based on the weighted derivation mode of the current block; and jointly determine the sorting method of the known motion information based on a group and the at least one of them.
[0349] During implementation, the decoder can determine which of the four groups in GPM or AWP belongs to based on the weighted derivation mode of the current block, and determine the aspect ratio of the current block. Then, based on the group to which the weighted derivation mode belongs and the aspect ratio of the current block, it determines the sorting method of the known motion information.
[0350] For example, in some implementations, when the decoder determines that the weight derivation mode of the current block belongs to the eighth type of weight derivation mode and the aspect ratio of the current block is 1:2, the determined sorting method of the known motion information is the first sorting method; when the decoder determines that the weight derivation mode of the current block belongs to the eighth type of weight derivation mode and the aspect ratio of the current block is 2:1, the determined sorting method of the known motion information is the second sorting method; when the decoder determines that the weight derivation mode of the current block belongs to the eighth type of weight derivation mode and the aspect ratio of the current block is 1:1, the determined sorting method of the known motion information is the third sorting method; any two of the first, second, and third sorting methods are different. The third sorting method involves sequentially sorting the motion information of the top-left block of the current block, the motion information of the corresponding block in the time domain, the motion information of the bottom-left block of the current block, and the motion information of the top-right adjacent block of the current block. In other implementations, two of the first, second, and third sorting methods may be the same. In some other embodiments, the first sorting method, the second sorting method, and the third sorting method can all be the same.
[0351] In one feasible implementation, when the weight export modes of the current block belong to the same category of weight export modes but have different aspect ratios, whether the sorting method is the same or not can be related to the shape of the black part. When both black parts are triangles, the sorting method can be the same. When one black part is a triangle and the other black part is a trapezoid, the sorting method is different.
[0352] In this application embodiment, a method for constructing a motion information candidate list for AWP or GPM based on the AWP or GPM mode and the shape of the current block can also be provided. Alternatively, different motion information candidate list construction methods can be used for different current block shapes under the same AWP or GPM mode. For example, as shown in the weighted graphs of 56 modes of AWP on a 64x64 block, 56 modes of AWP on a 64x32 block, and 56 modes of AWP on a 32x64 block, the black portion of mode 11 on 64x64 and 64x32 blocks only covers the upper right corner, while the upper left corner is a white area. However, on the 32x64 block, the black portion covers both the upper left and upper right corners. Therefore, the closely adjacent positions of the two parts of mode 11 are not the same on 64x64, 64x32, and 32x64 blocks. Using different motion information candidate list construction methods will also improve compression performance. One possible approach is to represent the shape of the current block using its aspect ratio, such as a block with an aspect ratio of 1:1, a block with an aspect ratio of 2:1, a block with an aspect ratio of 4:1, a block with an aspect ratio of 1:2, a block with an aspect ratio of 1:4, and so on.
[0353] For the decoder, after determining the AWP or GPM mode and the shape of the current block, it determines the method for constructing the motion information candidate list based on the AWP or GPM mode and the shape of the current block. Only one method for constructing the motion information candidate list is used for the current block, so there is no increase in computational complexity.
[0354] Continue reading Figure 12 , here Figure 12 For example, the implementation method of this application will be described as follows:
[0355] Different methods for constructing candidate lists of motion information may differ in several dimensions. These will be explained one by one below.
[0356] The above diagram illustrates the current method for constructing the motion information candidate list for AWP. F, G, C, A, B, and D are adjacent prediction blocks of the current prediction unit E in the same frame. The motion information derived from F, G, C, A, B, and D is called spatial motion information. H and I are blocks in a reference frame that have the relationship shown in the diagram with the current prediction unit E. The motion information derived from H and I is called temporal motion information. The current method checks the spatial motion information in the order F->G->C->A->B->D. First, it adds the different unidirectional motion information from F, G, C, A, B, and D to the list. Then, it adds each unidirectional motion information from the bidirectional motion information in F, G, C, A, B, and D that is different from the one in the list. Finally, it adds the temporal motion information at position H. Spatial motion information is added at most one position less than the list length, meaning at least one position is reserved for temporal motion information.
[0357] The relevant method adds spatial motion information first, followed by temporal motion information. This makes sense in prediction methods that treat the current block as a whole, because spatial motion information comes from adjacent blocks within the same frame, while temporal motion information comes from different frames; therefore, spatial motion information can be considered more correlated. However, this is not entirely applicable in AWP and GPM. In some modes of AWP or GPM, a part (such as the lower right corner of E) may not be connected to the aforementioned spatially adjacent positions. Instead, it may be connected to the position of I. For this part, spatial motion information may be more correlated than temporal motion information.
[0358] Therefore, the first dimension: some methods of this invention may break the order of spatial motion information preceding temporal motion information. Some methods may use the order of temporal motion information preceding spatial motion information, or an order in which spatial and temporal motion information are interspersed.
[0359] In the AWP method of related technologies, the order of using spatial motion information can be summarized as left (bottom left) -> top (inner right outer top -> outer right top -> top left (outer left inner top -> inner left outer top -> outer left top). In the existing merge method, the order of using spatial motion information can be summarized as outer left inner bottom -> inner right outer top -> outer right outer top -> outer left bottom -> outer left top. If the spatial motion information is set in the relevant position in the bottom right corner, then the spatial motion information is considered to be bottom right. The following diagram can roughly represent the order 1->2->3->4 of the existing method, that is, a broad bottom left -> top right -> top left -> bottom right.
[0360] The second dimension: Some methods of this invention may break the order of related positions. That is, some methods may use a broad order of bottom left -> top right -> top left -> bottom right, while others may use an order different from bottom left -> top right -> top left -> bottom right.
[0361] The order of these settings depends on the AWP or GPM mode. For example, in a left-top-right-bottom division mode (such as 33, 41, 49 in the AWP mode above), use the order left-top -> right-bottom -> others (or right-bottom -> left-top -> others); in a left-bottom-right-top division mode (such as 5, 13, 21 in the AWP mode above), use the order left-bottom -> right-top -> others (or right-top -> left-bottom -> others); in a top-bottom division mode (such as 3, 11, 19 in the AWP mode above), use the order top -> bottom (or bottom -> top), with top being left-top and right-top, and bottom being left-bottom and right-bottom; in a left-right division mode (such as 7, 15, 23 in the AWP mode above), use the order left -> right (or right -> left), with left being left-top and left-bottom, and right being right-top and right-bottom.
[0362] To be more specific, one possible approach is to process all the positions indicated in the above sequence (such as the broad top left) before proceeding to the next position, such as the order of bottom left -> top right -> others. First, process A, B, and D, and then process the bottom right.
[0363] Another possible approach is to process the positions indicated in the above sequence (such as the broad top left) and then proceed to the next position. In the next round of processing, the unprocessed portions of the indicated positions are then addressed. For example, in the order of bottom left -> top right -> others, position A is processed first, followed by the bottom right and other positions, and then B and D are processed in the second round. One possible approach here is to ensure that certain positions in the list are assigned to specific related positions. For example, in the order of bottom left -> top right -> others, the first position in the list (index 0) should ideally contain motion information related to the bottom left (F in AWP), and the second position (index 1) should contain motion information related to the top right (G and C in AWP). If the motion information for G can be filled into the second position (index 1), then C is skipped and processed in the "other" positions of the above sequence. If the motion information for G cannot be filled into the second position (index 1), then the motion information for C is attempted to be filled into the second position (index 1). The goal is to make the index values of the two motion information as small as possible, and to make the index value of the motion information encoded later larger than that of the motion information encoded earlier.
[0364] The third dimension: Some methods of this invention break the processing order of unidirectional motion first, then bidirectional motion. Existing methods prioritize unidirectional motion information regardless of position, or in other words, only one predicted direction of motion information is valid. This invention may prioritize position, or consider both position and unidirectional / bidirectional motion comprehensively.
[0365] The fourth dimension: Some methods of this invention construct a bidirectional motion information candidate list. AWP and GPM construct unidirectional motion information candidate lists, meaning each piece of motion information in the list is unidirectional, or has only one prediction direction, or only one index of the reference frame list is valid, while the other index is invalid. In some methods of this invention, some motion information in the list is bidirectional, or has two prediction directions, or both indices of the reference frame lists are valid.
[0366] If a specific part of AWP or GPM selects bidirectional motion information, then motion compensation for that part is handled using bidirectional prediction. Since bidirectional prediction methods include techniques such as Bidirectional Optical Flow (BIO) and Decoder-side Motion Vector Refinement (DMVR), when AWP or GPM handles motion compensation for a specific part using bidirectional prediction, one possible approach is to enable BIO, DMVR, etc., by default. Another possible approach is to disable BIO, DMVR, etc., by default. Yet another possible approach is to enable one or more techniques by default while disabling others by default.
[0367] If the motion information candidate list allows bidirectional motion information, the processing of temporal motion information may differ. Temporal motion information, denoted as MIT, is derived from the motion information of a block outside the current frame, denoted as MIA. MIA includes at most two prediction directions, each valid prediction direction L0 or L1 pointing to a reference frame and having a corresponding motion vector. This motion information needs to be scaled to the current block. The scaled MIT has at most two prediction directions, each valid prediction direction pointing to a reference frame. The corresponding motion vector needs to be scaled from the motion vector between the non-current frame and the reference frame of the used prediction direction to the motion vector between the current block and the reference frame of the specified current prediction direction. The predicted frames before and after scaling are different, and the reference frames (may) be different. When deriving time-domain motion information, the motion vector of MIT's L0 can be derived from the motion vector of MIA's L0, and the motion vector of MIT's L1 can be derived from the motion vector of MIA's L1. Alternatively, the motion vector of MIT's L0 can be derived from the motion vector of MIA's L0, and the motion vector of MIT's L1 can be derived from the motion vector of MIA's L1.
[0368] When processing temporal motion information (MIT), one possible approach is to treat it as bidirectional motion information. Another possible approach is to treat its L0 and L1 motion information as two separate unidirectional motion information sets. In methods where unidirectional motion information precedes bidirectional motion information, spatial motion information can be treated as two separate unidirectional motion information sets, thus preceding bidirectional motion information.
[0369] Fifthly, this invention can use directly available or transformed motion information, along with motion information derived from this information, as candidates. The priority of derived motion information may be lower than that of directly available or transformed motion information. One possible approach is to process all directly available or transformed motion information before processing the derived motion information. Another possible approach is to process all directly available or transformed motion information for a given approximate position (e.g., top left) before processing the derived motion information for that approximate position. For example, if a position in the list requires using motion information from an approximate position (e.g., top left), but the motion information for A, B, and D overlaps with existing motion information in the list, then the derived motion information for A, B, and D is tried. Then the motion information for other approximate positions is processed.
[0370] Directly available motion information includes spatial motion information, while motion information that can be obtained through transformation includes temporal motion information.
[0371] In some implementations, the derived motion information includes scaled motion information of the motion information that is directly obtainable or obtainable through transformation. If the directly obtainable or scaled motion information MIO is unidirectional motion information, and the effective LX (X is 0 or 1) motion vector of the directly obtainable or scaled motion information MIO is (X_LX, Y_LX), then the prediction direction and reference frame information of the derived motion information MID are the same as those of MIO. The LX (X is 0 or 1) motion vector of MID is (X_LX*SCALE, Y_LX*SCALE), where SCALE is 0.5, 0.75, 0.8, 0.9, 1.1, 1.2, 1.25, 1.5, etc. The LX (X is 0 or 1) motion vector of MID may also be (X_LX*SCALE, Y_LX) or (X_LX, Y_LX*SCALE).
[0372] In implementation, for unidirectional motion information MIO, one possible method is to generate four derived information segments, magnified and scaled down in the x and y directions respectively. The motion information for LX is (X_LX*SCALE_L, Y_LX), X_LX, Y_LX*SCALE_L), (X_LX*SCALE_S, Y_LX), X_LX, Y_LX*SCALE_S). Here, SCALE_L is greater than 1, and SCALE_S is less than 1. One possible method is to add SCALE_L to SCALE_S, which equals 2.
[0373] If the value of X_LX or Y_LX is 0, or the absolute value is too small, scaling may not be effective. In this case, X_LX*SCALE or Y_LX*SCALE can be directly replaced with a fixed value. If the value of X_LX or Y_LX is equal to 0, replace X_LX*SCALE or Y_LX*SCALE with 8 or -8. Or, if the absolute value of X_LX or Y_LX is less than 8, replace X_LX*SCALE or Y_LX*SCALE with 8 or -8. If the absolute value of X_LX or Y_LX is not equal to 0, the replacement value of 8 or -8 can have the same sign as the original plus or minus sign.
[0374] One possible approach is to correlate the scaling factor SCALE with the range of X_LX or Y_LX values. If the value of X_LX or Y_LX is less than or equal to 64, the SCALE is 0.75 (i.e., 3 / 4). If the value of X_LX or Y_LX is greater than 64 but less than or equal to 128, the SCALE is 0.875 (i.e., 7 / 8). If the value of X_LX or Y_LX is greater than 128, the SCALE is 0.9375 (i.e., 15 / 16).
[0375] If the motion information MIO, which is directly obtainable or obtainable through scaling, is bidirectional motion information, then the motion vectors of L0 and L1 are scaled respectively. Let the motion vector of L0 be SCALE0 and the motion vector of L1 be SCALE1. One possible method is that SCALE0 equals SCALE1, and another possible method is that SCALE0 is not equal to SCALE1 and SCALE0 plus SCALE1 equals 2.
[0376] Scaling calculations can be written as X_LX or Y_LX multiplied by a decimal (floating-point number); or as X_LX or Y_LX multiplied by an integer plus a fixed value, then right-shifted; or as the absolute value of X_LX or Y_LX multiplied by an integer plus a fixed value, then right-shifted, and finally a plus or minus sign. Let the number of bits to shift be shift, and the fixed value be value. One possible method is value = 1 << (shift - 1), and another is value = 1 << (shift - 1) or other values.
[0377] In other embodiments, the derived motion information includes motion information offset from the motion information directly obtainable or obtainable through transformation. Let the motion vector of the LX (X is 0 or 1) of the directly obtainable or scaled motion information MIO be (X_LX, Y_LX). Then the prediction direction and reference frame information of the derived motion information MID are the same as MIO. The motion vector of the LX (X is 0 or 1) of MID is (X_LX+OFFSET, Y_LX+OFFSET). The motion vector of the LX (X is 0 or 1) of MID may also be (X_LX+OFFSET, Y_LX) or (X_LX, Y_LX+OFFSET). OFFSET can be 2, 4, 8, 16, etc. Or OFFSET can be CLIP(MAX, MIN, X_LX / N) or CLIP(MAX, MIN, Y_LX / N), where N may be 2, 4, 8, 16, etc. If X_LX / N or Y_LX / N is greater than MAX, the result of CLIP is MAX. If X_LX / N or Y_LX / N is less than MIN, the result of CLIP is MIN; otherwise, the result of CLIP is equal to the value of X_LX / N or Y_LX / N.
[0378] In some other embodiments, the derived motion information includes motion information calculated from scaled motion information of two or more of the aforementioned directly available or transformed motion information. One method for selecting motion information from two or more of the aforementioned directly available or transformed motion information is to select motion information from the same broad range of locations, as described above. Figure XMotion information for A, B, and D in the top left corner. Motion information for C and G in the top right corner. One possible calculation method is to scale the selected two or more motion information pieces onto the same reference frame and then perform an average or weighted average.
[0379] In some implementations, the number of times derived motion information is generated can be limited when constructing the candidate list of motion information, thereby ensuring the complexity of the worst case.
[0380] One possible approach is to avoid deduplication when adding derived motion information to the motion information candidate list; that is, to not compare the derived motion information with every motion information in the candidate list. Another possible approach is to add the derived motion information to the candidate list only if it differs from the motion information used to generate it. This ensures the worst-case complexity is maintained.
[0381] In this way, the repetitive checking steps performed by the decoder can be at least partially eliminated, thereby reducing the computational complexity of the decoder.
[0382] Continue to refer to Figure 12 This application provides two implementations for the decoding end.
[0383] Decoding end example 1:
[0384] For the current block, the decoder parses information about whether the AWP is used. If it is determined that the AWP is used, the decoder parses the AWP mode and the indices of the two motion information. The decoder constructs a candidate list of motion information used by the AWP in the current block. Specifically, as follows:
[0385] The steps to export mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, RefIdxAwp0L1, mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1 are as follows:
[0386] In the first step, F, G, C, A, B, and D are the neighboring prediction blocks of the current prediction unit E (see...). Figure 12 Determine the "availability" of F, G, C, A, and D:
[0387] a) If F exists and inter-frame prediction mode is used, then F is "available"; otherwise, F is "unavailable".
[0388] b) If G exists and is in inter-frame prediction mode, then G is “available”; otherwise, G is “unavailable”.
[0389] c) If C exists and uses inter-frame prediction mode, then C is "available"; otherwise, C is "unavailable".
[0390] d) If A exists and is in inter-frame prediction mode, then A is “available”; otherwise, A is “unavailable”.
[0391] e) If B exists and uses inter-frame prediction mode, then B is "available"; otherwise, B is "unavailable".
[0392] f) If D exists and inter-frame prediction mode is used, then D is "available"; otherwise, D is "unavailable".
[0393] The bidirectional motion information in the time domain derived according to the method for deriving motion information provided in the relevant technology is denoted as T.
[0394] The second step is to generate no more than eight derivative motion information items using one of the methods for generating derivative motion information according to the above embodiments.
[0395] The third step is to determine the scanning order of the relevant locations:
[0396] a) If the result of AWP's modulo 8 is 0, 1, or 7, the scan order is A->B->D->T->F->G->C.
[0397] b) If the result of AWP mode modulo 8 is 2, the scanning order is B->G->F->T->D->C->A.
[0398] c) If the result of AWP mode modulo 8 is 3, 4 or 5, the scan order is F->G->C->A->B->D->T.
[0399] d) If the result of AWP mode modulo 8 is 6, the scan order is F->A->C->T->D->B->G.
[0400] The fourth step involves sorting the motion information. First, the raw motion information is sorted unidirectionally according to the scan order of relevant positions. Then, the raw motion information is sorted bidirectionally according to the scan order of relevant positions. Next, the derived motion information is sorted unidirectionally according to the scan order of relevant positions. Finally, the derived motion information is sorted bidirectionally according to the scan order of relevant positions. Here, both the temporal motion information and its derived motion information are split into unidirectional motion information pointing to the reference frame list List0 and unidirectional motion information pointing to the reference frame list List1, and processed as unidirectional motion information.
[0401] The fifth step is to add the sorted motion information to AwpArray. First, perform a duplicate check on the motion information. If there are no duplicates, add them to AwpArray until the length reaches 5 or the traversal is complete.
[0402] Step 6: If the length of AwpArray is less than 5, repeat the filling operation on the last motion information in AwpArray until the length of AwpArray is 5.
[0403] Step 7: Assign the (0+1)th motion information in AwpArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1; assign the (1+1)th motion information in AwpUniArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1.
[0404] Based on the indices of the two parsed motion information pieces, two motion information pieces are found in the constructed motion information candidate list. If the motion information is bidirectional, a bidirectional prediction method is used to obtain intermediate prediction blocks, where BIO and DMVR are not used; if the motion information is unidirectional, a unidirectional prediction method is used to obtain intermediate prediction blocks. The weights of the two intermediate prediction blocks at each pixel position are determined according to the specific mode used by AWP, and the two intermediate prediction blocks are weighted to obtain the prediction block of the current block.
[0405] If the current mode is skip mode, the prediction block is the decoded block, and decoding of the current block ends. If the current mode is not skip mode, entropy decoding is performed to parse the quantization coefficients, followed by dequantization and inverse transform to obtain the residual block. The residual block is then added to the prediction block to obtain the decoded block. Decoding of the current block ends.
[0406] It should be noted that in the embodiments of this application, the length of AwpArray (the length of the new motion information candidate list) can be a preset number. For example, a length of 1 indicates a preset number of 1, a length of 2 indicates a preset number of 2, and so on.
[0407] Decoding end example 2:
[0408] For the current block, the decoder parses information about whether the AWP is used. If it is determined that the AWP is used, the decoder parses the AWP mode and the indexes of the two motion information.
[0409] The decoder constructs a candidate list of motion information for the current block's AWP. Specifically, it does the following:
[0410] The steps to export mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, RefIdxAwp0L1, mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1 are as follows:
[0411] In the first step, F, G, C, A, B, and D are the neighboring prediction blocks of the current prediction unit E (see...). Figure 12 Determine the "availability" of F, G, C, A, and D:
[0412] a) If F exists and inter-frame prediction mode is used, then F is "available"; otherwise, F is "unavailable".
[0413] b) If G exists and is in inter-frame prediction mode, then G is “available”; otherwise, G is “unavailable”.
[0414] c) If C exists and uses inter-frame prediction mode, then C is "available"; otherwise, C is "unavailable".
[0415] d) If A exists and is in inter-frame prediction mode, then A is “available”; otherwise, A is “unavailable”.
[0416] e) If B exists and uses inter-frame prediction mode, then B is "available"; otherwise, B is "unavailable".
[0417] f) If D exists and inter-frame prediction mode is used, then D is "available"; otherwise, D is "unavailable".
[0418] The second step is to add the available unidirectional motion information into the unidirectional motion information candidate list AwpUniArray in the order of F, G, C, A and D, until the length of AwpUniArray is 4 or the traversal ends.
[0419] Third, if the length of AwpUniArray is less than 3, split the bidirectional available motion information into unidirectional motion information pointing to the reference frame list List0 and unidirectional motion information pointing to the reference frame list List1 in the order of F, G, C, A, B and D. First, perform a deduplication operation on the unidirectional motion information. If there is no duplicate, put it into AwpUniArray until the length is 4 or the traversal ends.
[0420] The fourth step is to split the bidirectional temporal motion information exported according to the method provided in the relevant technology into unidirectional motion information pointing to the reference frame list List0 and unidirectional motion information pointing to the reference frame list List1. First, perform a deduplication operation on the unidirectional motion information. If there is no duplicate, put it into AwpUniArray until the length is 5 or the traversal ends.
[0421] Fifth, if the length of AwpUniArray is less than 5, use the 0th and 1st unidirectional motion information in AwpUniArray sequentially to generate derived motion information. For each unidirectional motion information MIO in AwpUniArray, its effective prediction direction is denoted as LX (X is 0 or 1), and the motion vector corresponding to LX is (X_LX, Y_LX). Four derived motion information are generated and denoted as MID0, MID1, MID2, and MID3, respectively. Their reference frame information is the same as that of MIO.
[0422] The motion vector corresponding to LX of MID0 is (X_LX_0, Y_LX_0), where:
[0423] X_LX_0=(abs(X_LX)>128)? ((abs(X_LX)*17+8)>>4):((abs(X_LX)>64)?((abs(X_LX)*9+4)>>3):((abs(X_LX)>=8)?(abs(X_LX)*5+2)>>2)):8)).
[0424] The expression is explained as follows:
[0425] (1) Determine if abs(X_LX) > 128. If yes, confirm ((abs(X_LX)*17+8)>>4), that is, shift abs(X_LX)*17+8) to the right by 4 bits. If no, execute (2).
[0426] (2) Determine whether (abs(X_LX)>64). If yes, confirm ((abs(X_LX)*9+4)>>3). If no, execute (3).
[0427] (3)((whether abs(X_LX)>=8), if yes, then (abs(X_LX)*5+2)>>2)), otherwise, assign 8 to X_LX_0.
[0428] X_LX_0=(X_LX<0)? -X_LX_0:X_LX_0.
[0429] The expression is explained as follows:
[0430] Determine if X_LX is less than 0. If it is, assign -X_LX_0 to X_LX_0. If it is greater than 0, assign X_LX_0 to X_LX_0.
[0431] Y_LX_0=Y_LX.
[0432] The motion vector corresponding to LX of MID1 is (X_LX_1, Y_LX_1), where:
[0433] X_LX_1=X_LX.
[0434] Y_LX_1=(abs(Y_LX)>128)? ((abs(Y_LX)*17+8)>>4):((abs(Y_LX)>64)?((abs(Y_LX)*9+4)>>3):((abs(Y_LX)>=8)?(abs(X_LX)*5+2)>>2)):8)).
[0435] Y_LX_1=(Y_LX<0)? -Y_LX_1:Y_LX_1.
[0436] The motion vector corresponding to LX of MID2 is (X_LX_2, Y_LX_2), where:
[0437] X_LX_2=(abs(X_LX)>128)? ((abs(X_LX)*15+8)>>4):((abs(X_LX)>64)?((abs(X_LX)*7+4)>>3):((abs(X_LX)>=8)?(abs(X_LX)*3+2)>>2)):8)).
[0438] X_LX_2=(X_LX<=0)? -X_LX_2:X_LX_2.
[0439] Y_LX_2=Y_LX.
[0440] The motion vector corresponding to LX in MID3 is (X_LX_3, Y_LX_3), where:
[0441] X_LX_3=X_LX.
[0442] Y_LX_3=(abs(Y_LX)>128)? ((abs(Y_LX)*15+8)>>4):((abs(Y_LX)>64)?((abs(Y_LX)*7+4)>>3):((abs(Y_LX)>=8)?(abs(X_LX)*3+2)>>2)):8)).
[0443] Y_LX_3=(Y_LX<=0)? -Y_LX_3:Y_LX_3.
[0444] If the derived motion information (MID0, MID1, MID2, or MID3) is different from MIO, add it to AwpUniArray until the length of AwpUniArray is 5 or the processing ends.
[0445] Step 6: If the length of AwpUniArray is less than 5, repeat the filling operation on the last unidirectional motion information in AwpUniArray until the length of AwpUniArray is 5.
[0446] Step 7: Assign the (0+1)th motion information in AwpUniArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1; assign the (1+1)th motion information in AwpUniArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1.
[0447] Based on the indices of the two parsed motion information pieces, two motion information pieces are found in the constructed motion information candidate list. If the motion information is bidirectional, a bidirectional prediction method is used to obtain intermediate prediction blocks, where BIO and DMVR are not used; if the motion information is unidirectional, a unidirectional prediction method is used to obtain intermediate prediction blocks. The weights of the two intermediate prediction blocks at each pixel position are determined according to the specific mode used by AWP, and the two intermediate prediction blocks are weighted to obtain the prediction block of the current block.
[0448] If the current mode is skip mode, the prediction block is the decoded block, and decoding of the current block ends. If the current mode is not skip mode, entropy decoding is performed to parse the quantization coefficients, followed by dequantization and inverse transform to obtain the residual block. The residual block is then added to the prediction block to obtain the decoded block. Decoding of the current block ends.
[0449] Figure 13 A flowchart illustrating an inter-frame prediction method provided in another embodiment of this application is shown below. Figure 13 As shown, this method is applied to an encoder, and the method may include:
[0450] S1301. Determine the weight export mode for the current block.
[0451] S1303. Based on the weighted derivation mode of the current block, construct a new candidate list of motion information.
[0452] S1305. Based on the new motion information candidate list, determine the inter-frame prediction value for the current block.
[0453] In this embodiment, since the new motion information candidate list constructed by the encoder is based on the weight derivation mode of the current block, the encoder can construct different new motion information candidate lists according to different weight derivation modes. This makes the construction of the motion information candidate list conform to the weight derivation mode of the current block. As a result, the new motion information candidate list can arrange the motion information in order of strong to weak relevance to the current block. Thus, the encoder can easily find motion information that is strongly related to the current block, thereby improving the encoding efficiency of the current block.
[0454] In some implementations, the weight derivation mode of the current block is one of a variety of weight derivation modes in the geometric partitioning prediction mode, or the weight derivation mode of the current block is one of a variety of weight derivation modes in the angle-weighted prediction mode.
[0455] In some implementations, the new motion information candidate list is constructed differently depending on the category of the weight derivation mode of the current block.
[0456] In some implementations, a new list of motion information candidates is constructed based on the weight derivation pattern of the current block, including:
[0457] Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block;
[0458] Based on the sorting method, a new candidate list of motion information is constructed.
[0459] In some implementations, the known motion information associated with the current block includes N motion information related to the current block; N is an integer greater than or equal to 1.
[0460] The N motion information related to the current block includes: motion information of at least one neighboring block of the current block in the spatial domain, and / or motion information of at least one corresponding block of the current block in the temporal domain.
[0461] In some implementations, each of the N motion information pieces includes raw motion information, which includes motion vector information and reference frame information.
[0462] In some implementations, the original motion information is unidirectional original motion information, or bidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information.
[0463] In some implementations, the sorting method for known motion information related to the current block is determined based on the weight derivation mode of the current block, including one of the following:
[0464] When the weight derivation mode of the current block is the first type of weight derivation mode, the motion information of at least one corresponding block is arranged before the motion information of at least one adjacent block.
[0465] When the weight derivation mode of the current block is the second type of weight derivation mode, the motion information of at least one corresponding block is interspersed within the motion information of at least one adjacent block.
[0466] When the weight derivation mode of the current block is the third type of weight derivation mode, the motion information of at least one corresponding block is arranged after the motion information of at least one adjacent block.
[0467] In some implementations, when N is greater than or equal to 2, the method for determining the sorting of known motion information related to the current block based on the weight derivation mode of the current block includes one of the following:
[0468] The sorting method for the known motion information related to the current block is a sorting method determined from a set of sorting methods. The set of sorting methods includes: multiple sorting methods obtained by fully permuting the motion information of the lower left related block, the upper right related block, the upper left related block, and the lower right related block of the current block.
[0469] Wherein, when the weight derivation mode of the current block is different, the sorting method determined from the sorting method set is different;
[0470] Among them, any one of the motion information of the lower left related block of the current block, the motion information of the upper right related block of the current block, the motion information of the upper left related block of the current block, and the motion information of the lower right related block of the current block is: the motion information of the current block in the spatial domain or the motion information of the current block in the temporal domain.
[0471] In some implementations, the motion information of the lower left adjacent block of the current block includes: the motion information of all or some blocks to the lower left of the current block;
[0472] The motion information of the upper right adjacent block of the current block includes: the motion information of all or some of the upper right blocks of the current block;
[0473] The motion information of the top-left adjacent block of the current block includes: the motion information of all or some of the top-left blocks of the current block;
[0474] The motion information of the lower right block of the current block in the time domain includes: the motion information of the block in the time domain outside the current block, or the motion information of the block in the time domain inside the current block.
[0475] In some implementations, when N is greater than or equal to 2, the sorting method for the known motion information related to the current block is determined based on the weight derivation mode of the current block, including one of the following:
[0476] When the weight derivation mode of the current block is the fourth type of weight derivation mode, all or part of the unidirectional original motion information in the N motion information is arranged before the bidirectional motion information in the N motion information is split to obtain one or two unidirectional original motion information.
[0477] When the weight derivation mode of the current block is the fifth type of weight derivation mode, all or part of the unidirectional original motion information in the N motion information is arranged before all or part of the bidirectional motion information in the N motion information.
[0478] When the weight derivation mode of the current block is the sixth type of weight derivation mode, determine the sorting priority of N motion information, and sort the N motion information based on the sorting priority;
[0479] When the weight derivation mode of the current block is the seventh type of weight derivation mode, determine the one-way and two-way information of each of the N motion information and the sorting priority of the N motion information, and sort the N motion information based on the one-way and two-way information and the sorting priority of each motion information.
[0480] In some implementations, the method further includes:
[0481] The image frames other than the current frame and the frame containing the corresponding block are identified as the first specific frame;
[0482] In the first specific frame, determine the motion information of the first target block corresponding to the current block;
[0483] The motion information of the first target block is scaled to obtain the motion information of the corresponding block;
[0484] Specifically, the motion information of the first target block is scaled to obtain the motion information of the corresponding block, including one of the following:
[0485] The bidirectional motion information of the first target block is scaled to obtain the bidirectional motion information of the corresponding block;
[0486] The unidirectional motion information of the first target block is scaled to obtain the bidirectional motion information of the corresponding block.
[0487] In some implementations, each of the N motion information pieces further includes derived motion information, which is determined based on the original motion information;
[0488] The derived motion information includes motion vector information and reference frame information.
[0489] In some implementations, the derived motion information is unidirectional derived motion information, or bidirectional derived motion information, or one or two unidirectional derived motion information obtained by splitting bidirectional derived motion information;
[0490] Unidirectional derived motion information is determined based on unidirectional original motion information or bidirectional motion information, while bidirectional derived motion information is determined based on unidirectional original motion information or bidirectional motion information.
[0491] In some implementations, when N is greater than or equal to 2, the sorting method for the N motion information is determined, including one of the following:
[0492] Arrange all or part of the N original motion information pieces before all or part of the N derived motion information pieces;
[0493] Determine at least one of the following information among N original motion information: one-way and two-way information of each original motion information, sorting priority of N original motion information, one-way and two-way information of each derived motion information, and sorting priority of N derived motion information. Sort the N motion information based on at least one of these information.
[0494] In some implementations, the prediction direction of the derived motion information is the same as the prediction direction of the original motion information;
[0495] The reference frame information for derived motion information is the same as the reference frame information for original motion information.
[0496] In some embodiments, the motion vector information includes first axis component information and second axis component information; the method further includes:
[0497] Based on the first axis component information and the second axis component information in the original motion information, the first axis component information and the second axis component information of each of the M derived motion information are determined, and the first axis component information and the second axis component information of each of the derived motion information are used as the motion vector information of each of the derived motion information; M is an integer greater than or equal to 1;
[0498] Wherein, the first axis is the x-axis or y-axis, the second axis is the y-axis or x-axis, and the first axis is different from the second axis.
[0499] In some implementations, determining the first and second axis component information of each of the M derived motion information based on the first and second axis component information in the original motion information includes one of the following:
[0500] Based on the scaling result of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; the second axis component information of the original motion information is used as the second axis component information of each of the M derived motion information.
[0501] Based on the scaling of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; based on the scaling of the second axis component information of the original motion information, the second axis component information of each of the M derived motion information is determined.
[0502] In some implementations, determining the first axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information includes one of the following:
[0503] Multiply the first axis component information of the original motion information by M first values to obtain M first results. Based on each of the M first results, determine the first axis component information of each derived motion information.
[0504] Divide the first axis component information of the original motion information by M second values to obtain M first divisors. Based on each of the M first divisors, determine the first axis component information of each derived motion information.
[0505] In some implementations, determining the first axis component information of each derived motion information based on each of the M first results includes one of the following:
[0506] Each of the M first results is used as the first axis component information of each derived motion information;
[0507] M third values corresponding to the M first results are determined, and the M first results are added to the M third values to obtain M second results. Based on each of the M second results, the first axis component information of each derived motion information is determined.
[0508] In some implementations, determining the first axis component information of each derived motion information based on each of the M second results includes one of the following:
[0509] Each of the M second results is used as the first axis component information of each derived motion information;
[0510] Shift each of the M second results to the right by a specific number of bits to obtain M third results. Based on each of the M third results, determine the first axis component information of each derived motion information.
[0511] The third value is obtained by shifting a target bit to the left, where the target bit is the specific number of bits minus one.
[0512] In some implementations, the absolute value of the first axis component information in the motion vector information of the original motion information is greater than a first threshold.
[0513] The M first values include a first specific value and a second specific value, wherein the first specific value is greater than 0 and less than 1, the second specific value is greater than 1 and less than 2, and the sum of the first specific value and the second specific value is 2.
[0514] In some embodiments, the method further includes:
[0515] If the absolute value of the first axis component information of the original motion information is less than or equal to the second threshold, the first specific value is determined to be the first coefficient.
[0516] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the second threshold and less than or equal to the third threshold, the first specific value is determined to be the second coefficient.
[0517] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the third threshold, the first specific value is determined to be the third coefficient.
[0518] Wherein, the first coefficient is less than the second coefficient, and the second coefficient is less than the third coefficient.
[0519] In some embodiments, the method further includes:
[0520] If the absolute value of the first axis component information of the original motion information is less than or equal to the first threshold, and the first axis component information in the motion vector information of the original motion information is a positive number, the first target value is used as the first axis component information of the derived motion information.
[0521] If the absolute value of the first axis component information in the motion vector information of the original motion information is less than or equal to a first threshold, and the first axis component information in the motion vector information of the original motion information is negative, then the negative first target value is taken as the first axis component information of the derived motion information.
[0522] In some implementations, the M first divisors include a first group of divisors, and / or a second group of divisors, and / or a third group of divisors;
[0523] Each divisor in the first group is greater than the maximum threshold;
[0524] Each divisor in the second group is greater than or equal to the minimum threshold and less than or equal to the maximum threshold;
[0525] Each of the third group of divisors is less than the minimum threshold.
[0526] The determination of the first axis component information of each derived motion information based on each of the M first divisors includes at least one of the following:
[0527] The maximum threshold is used as the first axis component information of each derived motion information corresponding to the first group of divisors in the M derived motion information;
[0528] Each divisor in the second group of divisors is used as the first axis component information of each derivative motion information corresponding to the second group of divisors in the M derivative motion information;
[0529] The minimum threshold is used as the first axis component information of each derived motion information corresponding to the third set of divisors in the M derived motion information.
[0530] In some embodiments, when the original motion information is bidirectional original motion information, the method further includes:
[0531] The original motion information is split into a first unidirectional original motion information and a second unidirectional original motion information;
[0532] The result of multiplying the first value with the first axis component information or the second axis component information in the motion vector information of the first unidirectional original motion information is used as the first axis component information or the second axis component information in the motion vector information of the first unidirectional derived motion information.
[0533] The result of multiplying the fourth value with the first axis component information or the second axis component information in the motion vector information of the second unidirectional original motion information is used as the first axis component information or the second axis component information in the motion vector information of the second unidirectional derived motion information.
[0534] Wherein, both the first value and the fourth value are greater than 0;
[0535] Wherein, the first value is the same as the fourth value, or the first value is different from the fourth value and the sum of the first value and the fourth value is 2.
[0536] In some implementations, the N motion information includes: the original motion information of at least two adjacent blocks of the current block in the spatial domain; at least two adjacent blocks are adjacent, or at least two adjacent blocks are at the lower left, upper right, or upper left corner of the current block;
[0537] Derived motion information is determined based on the original motion information, including:
[0538] Determine the second target block from at least two adjacent blocks, and take the frame containing the second target block as the second specific frame;
[0539] The motion vector information in the original motion information of at least two adjacent blocks, excluding the second target block, is scaled to a second specific frame to obtain the motion vector information of at least two blocks to be averaged; the at least two blocks to be averaged include the second target block;
[0540] The motion vector information of at least two blocks to be averaged is averaged or weighted to obtain the corresponding derived motion vector information.
[0541] The motion vector information of the corresponding derived motion information is used as the motion vector information of the derived motion information of each of at least two adjacent blocks;
[0542] The prediction direction of the derived motion information is the same as that of the original motion information, and the reference frame information of the derived motion information is the second specific frame.
[0543] In some implementations, each of the N motion information pieces includes the original motion information;
[0544] Based on the sorting method, a new candidate list of motion information is constructed, including:
[0545] Determine the candidate list of initial motion information;
[0546] Based on the sorting method, all or part of the original motion information of at least one adjacent block, and / or all or part of the original motion information of at least one corresponding block, are sequentially or intermittently filled into the initial motion information candidate list to obtain a new motion information candidate list.
[0547] In some implementations, each of the N motion information pieces includes derived motion information;
[0548] Based on the sorting method, all or part of the original motion information of at least one adjacent block, and / or all or part of the original motion information of at least one corresponding block, are sequentially or interleaved into the initial motion information candidate list to obtain a new motion information candidate list, including:
[0549] Based on the sorting method, at least one of the following is filled into the initial motion information candidate list in sequence or alternately: all or part of the original motion information of at least one adjacent block, all or part of the original motion information of at least one corresponding block, all or part of the derived motion information of at least one adjacent block, and all or part of the derived motion information of at least one corresponding block.
[0550] In some implementations, the initial motion information candidate list can be filled with a preset number of motion information; each of the preset number of motion information is original motion information or derived motion information; the preset number is between 2 and 6.
[0551] In some implementations, the method further includes:
[0552] After filling at least one piece of original motion information into the initial motion information candidate list, the derived motion information to be filled in is determined.
[0553] Fill in the derived motion information to be filled into the initial motion information candidate list;
[0554] Alternatively, if it is determined that the derived motion information to be filled is different from the original motion information that has already been filled, the derived motion information to be filled is added to the initial motion information candidate list.
[0555] Alternatively, if it is determined that the derived motion information to be filled in is different from the original motion information that has already been filled in, the derived motion information to be filled in is added to the initial motion information candidate list.
[0556] In some implementations, before determining the sorting method of known motion information related to the current block based on the weight derivation mode of the current block, the method further includes:
[0557] Obtain the original motion information of at least one adjacent block and the original motion information of at least one corresponding block;
[0558] Based on all or part of the original motion information of at least one adjacent block, and / or based on all or part of the original motion information of at least one corresponding block, generate a specific number of derived motion information.
[0559] Among them, a specific number is less than or equal to 8; the specific number of derived motion information includes: derived motion information of adjacent blocks and / or derived motion information of corresponding blocks.
[0560] In some implementations, the method further includes:
[0561] Obtain the original motion information of at least one adjacent block, and the unidirectional or bidirectional motion information of a corresponding block;
[0562] Fill the initial motion information candidate list with one of the original motion information of at least one adjacent block, or at least two different original motion information of each other.
[0563] If the total number of unidirectional raw motion information filled into the initial motion information candidate list is equal to the preset number minus one, then the unidirectional or bidirectional motion information of a corresponding block will continue to be filled into the initial motion information candidate list.
[0564] In some implementations, if the first total number of unidirectional raw motion information entries added to the initial motion information candidate list is less than a preset number minus one, the method further includes:
[0565] Sequentially split the bidirectional original motion information of at least one adjacent block to obtain two unidirectional original motion information corresponding to the bidirectional original motion information, and sequentially fill the two unidirectional original motion information that are different from the already filled unidirectional motion information into the initial motion information candidate list; or, sequentially fill the bidirectional original motion information of at least one adjacent block into the initial motion information candidate list.
[0566] If the second total number of original motion information entered into the initial motion information candidate list is equal to the preset number minus one, then one block of unidirectional or bidirectional motion information will be entered into the initial motion information candidate list.
[0567] In some implementations, the method further includes:
[0568] If the second total number of unidirectional raw motion information filled into the initial motion information candidate list is less than the preset number minus one, then the first two unidirectional raw motion information filled into the initial motion information candidate list are obtained.
[0569] Based on the first two unidirectional original motion information, determine the corresponding four unidirectional derived motion information;
[0570] The four derived motion information that are different from the already filled unidirectional motion information are then added to the initial motion information candidate list in sequence;
[0571] If the total number of unidirectional original motion information and unidirectional derived motion information filled into the initial motion information candidate list is equal to the preset number minus one, then the unidirectional motion information or bidirectional motion information of a corresponding block will continue to be filled into the initial motion information candidate list.
[0572] In some implementations, when the derived motion information to be filled is bidirectional derived motion information, the bidirectional derived motion information is split into two unidirectional derived motion information; at least one of the two unidirectional derived motion information is filled into the initial motion information candidate list.
[0573] And / or, if the original motion information to be filled is bidirectional original motion information, the bidirectional original motion information is split into two unidirectional original motion information, and at least one of the two unidirectional original motion information is filled into the initial motion information candidate list, or the bidirectional original motion information is filled into the initial motion information candidate list.
[0574] In some implementations, the method further includes:
[0575] Group the multiple weighted derivation modes in the geometric partitioning prediction mode, or the multiple weighted derivation modes in the angle-weighted prediction mode, to obtain at least two classes of weighted derivation modes; different classes of weighted derivation modes correspond to different sorting methods.
[0576] In some implementations, at least two sets of partitioning patterns are included:
[0577] The eighth type of weight derivation mode is used to characterize the weight derivation mode of the current block as the top-left or bottom-right weight derivation mode;
[0578] The ninth type of weight derivation mode is used to characterize the weight derivation mode of the current block as an upper or lower weight derivation mode;
[0579] The tenth type of weight derivation mode is used to characterize the weight derivation mode of the current block as the lower left and upper right weight derivation mode;
[0580] The eleventh type of weight derivation mode is used to characterize the weight derivation mode of the current block as a left or right weight derivation mode.
[0581] In some implementations, the method for determining the sorting of known motion information related to the current block based on the weight derivation mode of the current block includes one of the following:
[0582] If the weight derivation mode of the current block belongs to the eighth type of weight derivation mode, the sorting method of the known motion information is determined to be the sorting method of the motion information of the upper left adjacent block of the current block that is sorted first.
[0583] If the weight derivation mode of the current block belongs to the ninth type of weight derivation mode, the sorting method of the known motion information is determined to be the sorting method of the motion information of the previous block of the current block that is sorted first.
[0584] If the weight derivation mode of the current block belongs to the tenth type of weight derivation mode, the sorting method of the known motion information is determined to be the sorting method of the motion information of the lower left adjacent block of the current block that is sorted first.
[0585] If the weight derivation mode of the current block belongs to the eleventh type of weight derivation mode, the sorting method of the known motion information is determined to be the sorting method where the motion information of the left block of the current block is sorted first.
[0586] In some implementations, at least one adjacent block includes at least one of the following: outer lower left block, inner right upper outer block, outer upper right block, inner upper outer left block, inner left upper outer block, and outer upper left block; or, at least one adjacent block includes at least one of the following: inner left lower outer block, inner upper outer right block, outer upper right block, outer lower left block, and outer upper left block.
[0587] At least one corresponding block includes at least one of the following: the block corresponding to the top left corner of the current block, the block corresponding to the bottom right corner of the current block, and the block corresponding to the bottom right corner of the current block.
[0588] In some implementations, under the weighted derivation mode of the current block, the current block is divided into a first partition and a second partition;
[0589] Based on the new motion information candidate list, the inter-frame prediction values for the current block are determined, including:
[0590] From the new list of motion information candidates, determine the motion information for the first partition and the motion information for the second partition;
[0591] A first predicted value for the first partition is determined based on the motion information of the first partition, and a second predicted value for the second partition is determined based on the motion information of the second partition.
[0592] The first and second predicted values are weighted and fused to obtain the inter-frame predicted value for the current block.
[0593] In some implementations, when the motion information of the first partition is bidirectional motion information, the motion information of the first partition is processed according to a bidirectional prediction method;
[0594] And / or, if the motion information of the second partition is bidirectional motion information, the motion information of the second partition is processed according to the bidirectional prediction method.
[0595] In some implementations, the bidirectional prediction method is a method that does not use bidirectional optical flow or a method that optimizes motion vectors at the decoding end.
[0596] In some implementations, determining the motion information of the first partition and the motion information of the second partition from a new list of motion information candidates includes:
[0597] Determine the index value of the first partition and the index value of the second partition;
[0598] Based on the new motion information candidate list, the motion information in the new motion information candidate list indicated by the index value of the first partition is determined as the motion information of the first partition;
[0599] Based on the new motion information candidate list, the motion information in the new motion information candidate list indicated by the index value of the second partition is determined as the motion information of the second partition.
[0600] In some implementations, determining the index value of the first partition and the index value of the second partition includes:
[0601] The current block is pre-encoded using multiple prediction modes to obtain the rate-distortion cost corresponding to each prediction mode.
[0602] Select the minimum rate distortion value from the multiple rate distortion values obtained, and determine the two motion information corresponding to the minimum rate distortion value as the index value of the first partition and the index value of the second partition, respectively.
[0603] In some implementations, obtaining the weight export mode of the current block includes:
[0604] Determine the prediction mode parameters for the current block; the prediction mode parameters are used to indicate whether to use the geometric partitioning prediction mode or the angle-weighted prediction mode to determine the inter-frame prediction value for the current block.
[0605] Determine the weight derivation mode of the current block from the prediction mode parameters of the current block.
[0606] In some implementations, the new motion information candidate list is a candidate list that allows for bidirectional motion information.
[0607] This section describes an example of an encoding end that, for the current block, attempts to encode it using AWP and other available modes to determine whether to use AWP. If AWP is the most cost-effective, then AWP is used.
[0608] When attempting an AWP, a pattern is selected from the AWP patterns for encoding to determine the cost of the AWP. One possible approach is to try all AWP patterns and select the one with the lowest cost as the cost of the AWP.
[0609] A motion information candidate list is constructed based on the AWP pattern, and the construction method is the same as that described in the decoding end embodiment. Two motion information candidates are selected from the motion information candidate list. One possible method is to determine the cost of all possible combinations of motion information candidates and all possible AWP patterns, and then select the combination of the two motion information and AWP pattern with the lowest cost as the final determined unidirectional motion information and AWP pattern.
[0610] Information regarding whether AWP is used is written into the bitstream. If AWP is determined to be used, the AWP mode and the indices of two motion information items are written into the bitstream. If the current mode is skip mode, decoding of the current block ends. If the current mode is not skip mode, quantization coefficients are written into the bitstream. The quantization coefficients are obtained by subtracting the predicted block from the actual value of the current block to obtain the residual block, which is then transformed and quantized. Decoding of the current block ends.
[0611] It should be noted that for parts not described in detail on the encoder side, please refer to the descriptions provided on the decoder side.
[0612] The application proposes an adaptive motion information candidate list construction method, namely, a method for determining the construction method of the motion information candidate list of AWP or GPM based on the AWP or GPM pattern, so that each type of AWP or GPM pattern, i.e. each type of partitioning method, has a matching motion information candidate list, thereby improving coding efficiency without adding additional computational complexity to the decoder, because blocks using AWP or GPM only need to construct the AWP or GPM motion information candidate list once.
[0613] The following describes two other inter-frame prediction methods. It should be noted that any parts not mentioned in the following methods can be referred to the descriptions of the above embodiments. Furthermore, it is worth noting that one or at least two embodiments in the following examples can be combined with any one or at least two of the above embodiments without conflict.
[0614] Figure 14 A flowchart illustrating an inter-frame prediction method provided in another embodiment of this application is shown below. Figure 14 As shown, this method is applied to a decoder and may include:
[0615] S1401. Parse the bitstream to obtain the motion vector information of the original motion information related to the current block.
[0616] In one implementation, the decoder can obtain the original motion information during the parsing of the bitstream. Since the original motion information includes motion vector information and reference frame information, the decoder can obtain the motion vector information of the original motion information related to the current block.
[0617] In one implementation, the decoder can obtain known motion information related to the current block. This known motion information includes a preset number of motion information items. For a description of the known motion information related to the current block, please refer to the above embodiments; further details will not be repeated here.
[0618] Each of the preset number of motion information pieces can include original motion information or derived motion information, wherein the derived motion information is determined based on the original motion information.
[0619] The method for determining derived motion information based on the original motion information can refer to the description in the above embodiments, or to the description in the following embodiments.
[0620] It should be understood that the decoder obtains the original motion information related to the current block by parsing the bitstream. The derived motion information related to the current block needs to be calculated from the original motion information.
[0621] S1403. Based on the scaling result of the motion vector information of the original motion information, determine the motion vector information of M derived motion information; M is an integer greater than or equal to 1.
[0622] Scaling the motion vector information of the original motion information can refer to obtaining the motion vector information of the derived motion information based on the result of multiplication or division of the original motion information.
[0623] S1405. Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, construct a new motion information candidate list.
[0624] In one scenario, the decoder parses the bitstream to obtain at least two original motion information pieces related to the current block. Based on each original motion information piece, one or at least two derived motion information pieces can be obtained. When constructing a new motion information candidate list, all or part of the original motion information pieces from the at least two original motion information pieces can be used, as well as all or part of the motion vector information from the M derived motion information pieces. The number of original motion information pieces used can be greater than, less than, or equal to the number of derived motion information pieces. In other words, the new motion information candidate list can include all or part of the at least two original motion information pieces, and all or part of the motion vector information from the M derived motion information pieces.
[0625] During implementation, a new motion information candidate list is constructed based on the motion vector information of the original motion information and the motion vector information of the derived motion information. This may include: determining derived motion information based on the motion vector information of the derived motion information, and constructing a new motion information candidate list based on the original motion information and the derived motion information.
[0626] The determination of derived motion information based on the motion vector information of the derived motion information may include: determining reference frame information for the derived motion information, and determining the derived motion information based on the motion vector information and the reference frame information of the derived motion information. The method for determining the reference frame information of the derived motion information can be referred to the description in the above embodiments.
[0627] Understandably, the new list of motion information candidates includes at least two pieces of motion information, each of which is either original motion information or derived motion information.
[0628] When constructing a new candidate list of motion information based on the original motion information and the derived motion information, the original motion information can be placed before the derived motion information, or the original motion information and the derived motion information can be arranged alternately.
[0629] The sorting method for the original motion information and the derived motion information can be referred to the description of the relevant embodiments above, and will not be repeated here.
[0630] S1407. Based on the new motion information candidate list, determine the inter-frame prediction value of the current block.
[0631] In this embodiment, a new motion information candidate list is constructed based on the motion vector information of the original motion information and the motion vector information of the derived motion information. This new motion information candidate list can make full use of the motion vector information of the original motion information that has already been acquired. As a result, the construction of the motion information candidate list conforms to the weight derivation mode of the current block. Therefore, the new motion information candidate list can arrange the motion information in order of strong to weak correlation with the current block, thereby improving the decoding efficiency of the current block.
[0632] In one embodiment, the motion vector information includes first axis component information and second axis component information;
[0633] Based on the scaling of the motion vector information of the original motion information, the motion vector information of M derived motion information is determined, including one of the following:
[0634] Based on the scaling result of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; the second axis component information of the original motion information is used as the second axis component information of each of the M derived motion information.
[0635] Based on the scaling result of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; based on the scaling result of the second axis component information of the original motion information, the second axis component information of each of the M derived motion information is determined.
[0636] Wherein, the first axis is the x-axis or y-axis, the second axis is the y-axis or x-axis, and the first axis is different from the second axis.
[0637] In one implementation, determining the first axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information includes one of the following:
[0638] Multiply the first axis component information of the original motion information by M first values to obtain M first results. Based on each of the M first results, determine the first axis component information of each derived motion information.
[0639] Divide the first axis component information of the original motion information by M second values to obtain M first divisors. Based on each of the M first divisors, determine the first axis component information of each derived motion information.
[0640] In one implementation, determining the first axis component information of each derived motion information based on each of the M first results includes one of the following:
[0641] Each of the M first results is used as the first axis component information of each derived motion information;
[0642] M third values corresponding to the M first results are determined, and the M first results are added to the M third values to obtain M second results. Based on each of the M second results, the first axis component information of each derived motion information is determined.
[0643] In one implementation, determining the first axis component information of each derived motion information based on each of the M second results includes one of the following:
[0644] Each of the M second results is used as the first axis component information of each derived motion information;
[0645] Shift each of the M second results to the right by a specific number of bits to obtain M third results. Based on each of the M third results, determine the first axis component information of each derived motion information.
[0646] In one implementation, the third value is obtained by left-shifting a target bit, where the target bit is the specific number of bits minus one.
[0647] In one implementation, determining the first axis component information of each derived motion information based on each of the M third results includes:
[0648] If the first axis component information of the original motion information is positive, each of the M third results is used as the first axis component information of each derived motion information.
[0649] If the first axis component information of the original motion information is negative, each of the M third results is multiplied by a negative one to obtain the first axis component information of each derived motion information.
[0650] In one embodiment, the absolute value of the first axis component information in the motion vector information of the original motion information is greater than a first threshold.
[0651] The M first values include a first specific value and a second specific value, wherein the first specific value is greater than 0 and less than 1, the second specific value is greater than 1 and less than 2, and the sum of the first specific value and the second specific value is 2.
[0652] In one embodiment, the method further includes:
[0653] If the absolute value of the first axis component information of the original motion information is less than or equal to the second threshold, the first specific value is determined to be the first coefficient.
[0654] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the second threshold and less than or equal to the third threshold, the first specific value is determined to be the second coefficient.
[0655] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the third threshold, the first specific value is determined to be the third coefficient.
[0656] Wherein, the first coefficient is less than the second coefficient, and the second coefficient is less than the third coefficient.
[0657] In one embodiment, the method further includes:
[0658] If the absolute value of the first axis component information of the original motion information is less than or equal to the first threshold, and the first axis component information in the motion vector information of the original motion information is a positive number, the first target value is used as the first axis component information of the derived motion information.
[0659] If the absolute value of the first axis component information in the motion vector information of the original motion information is less than or equal to a first threshold, and the first axis component information in the motion vector information of the original motion information is negative, then the negative first target value is taken as the first axis component information of the derived motion information.
[0660] In one implementation, the M first divisors include a first group of divisors, and / or a second group of divisors, and / or a third group of divisors;
[0661] Each divisor in the first group is greater than the maximum threshold;
[0662] Each divisor in the second group is greater than or equal to the minimum threshold and less than or equal to the maximum threshold;
[0663] Each of the third group of divisors is less than the minimum threshold.
[0664] The determination of the first axis component information of each derived motion information based on each of the M first divisors includes at least one of the following:
[0665] The maximum threshold is used as the first axis component information of each derived motion information corresponding to the first group of divisors in the M derived motion information;
[0666] Each divisor in the second group of divisors is used as the first axis component information of each derivative motion information corresponding to the second group of divisors in the M derivative motion information;
[0667] The minimum threshold is used as the first axis component information of each derived motion information corresponding to the third set of divisors in the M derived motion information.
[0668] In one embodiment, the original motion information is unidirectional original motion information, or bidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information.
[0669] The derived motion information is unidirectional derived motion information, or bidirectional derived motion information, or one or two unidirectional derived motion information obtained by splitting bidirectional derived motion information;
[0670] The unidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information, and the bidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information.
[0671] In one implementation, the parsing of the bitstream to obtain motion vector information of the original motion information related to the current block includes:
[0672] Parse the bitstream to obtain the motion vector information of the original motion information related to the current block and the weight derivation mode of the current block;
[0673] Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, a new motion information candidate list is constructed, including:
[0674] Based on the weighted derivation mode of the current block, the motion vector information of the original motion information, and the motion vector information of the derived motion information, a new motion information candidate list is constructed.
[0675] In one implementation, the construction of the new motion information candidate list based on the weighted derivation mode of the current block, the motion vector information of the original motion information, and the motion vector information of the derived motion information includes:
[0676] Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block;
[0677] Based on the sorting method, the motion vector information of the original motion information and the motion vector information of the derived motion information are used to construct the new motion information candidate list.
[0678] In one implementation, before determining the sorting method of the known motion information related to the current block based on the weight derivation mode of the current block, the method further includes:
[0679] Based on the bitstream parsed by the decoder, the original motion information of at least one adjacent block and the original motion information of at least one corresponding block are obtained.
[0680] Based on all or part of the original motion information of the at least one adjacent block, and / or based on all or part of the original motion information of the at least one corresponding block, a specific number of derived motion information are generated.
[0681] Wherein, the specific number is less than or equal to 8; the specific number of derived motion information includes: derived motion information of adjacent blocks and / or derived motion information of corresponding blocks.
[0682] In one embodiment, the method further includes:
[0683] If the second total number of unidirectional raw motion information filled into the initial motion information candidate list is less than the preset number minus one, the first two unidirectional raw motion information filled into the initial motion information candidate list are obtained.
[0684] Based on the first two unidirectional original motion information, four corresponding unidirectional derived motion information are determined;
[0685] The four derived motion information that are different from the already filled unidirectional motion information are then added to the initial motion information candidate list in sequence.
[0686] If the total number of unidirectional original motion information and unidirectional derived motion information filled into the initial motion information candidate list is equal to the preset number minus one, then the unidirectional motion information or bidirectional motion information of the corresponding block will continue to be filled into the initial motion information candidate list.
[0687] In one implementation, when the derived motion information to be filled is bidirectional derived motion information, the bidirectional derived motion information is split into two unidirectional derived motion information; at least one of the two unidirectional derived motion information is filled into the initial motion information candidate list.
[0688] And / or, if the original motion information to be filled is bidirectional original motion information, the bidirectional original motion information is split into two unidirectional original motion information, and at least one of the two unidirectional original motion information is filled into the initial motion information candidate list, or the bidirectional original motion information is filled into the initial motion information candidate list.
[0689] In one embodiment, when the original motion information is bidirectional original motion information, the method further includes:
[0690] The original motion information is split into a first unidirectional original motion information and a second unidirectional original motion information;
[0691] The result of multiplying the first value with the first axis component information or the second axis component information in the motion vector information of the first unidirectional original motion information is used as the first axis component information or the second axis component information in the motion vector information of the first unidirectional derived motion information.
[0692] The result of multiplying the fourth value with the first axis component information or the second axis component information in the motion vector information of the second unidirectional original motion information is used as the first axis component information or the second axis component information in the motion vector information of the second unidirectional derived motion information.
[0693] Wherein, both the first value and the fourth value are greater than 0;
[0694] Wherein, the first value is the same as the fourth value, or the first value is different from the fourth value and the sum of the first value and the fourth value is 2.
[0695] In one implementation, the decoder, based on the sorting method, sequentially or alternately fills at least one of the following into the initial motion information candidate list: all or part of the original motion information of at least one adjacent block, all or part of the original motion information of at least one corresponding block, all or part of the derived motion information of at least one adjacent block, and all or part of the derived motion information of at least one corresponding block.
[0696] In one embodiment, the method further includes:
[0697] After filling at least one piece of original motion information into the initial motion information candidate list, the derived motion information to be filled in is determined.
[0698] The derived motion information to be filled is entered into the initial motion information candidate list;
[0699] Alternatively, if it is determined that the derived motion information to be filled is different from the original motion information that has already been filled corresponding to the derived motion information to be filled, the derived motion information to be filled is filled into the initial motion information candidate list.
[0700] Alternatively, if it is determined that the derived motion information to be filled is different from the original motion information that has already been filled, the derived motion information to be filled is added to the initial motion information candidate list.
[0701] It should be understood that when derived motion information is obtained by scaling the first axis / second axis component information of the original motion information, the prediction direction of the derived motion information is the same as the prediction direction of the original motion information; the reference frame information of the derived motion information is the same as the reference frame information of the original motion information.
[0702] Figure 15 This is a flowchart illustrating an inter-frame prediction method provided in another embodiment of this application, as shown below. Figure 15 As shown, this method is applied to an encoder, and the method may include:
[0703] S1501. Determine the motion vector information of the original motion information related to the current block.
[0704] S1503. Based on the scaling result of the motion vector information of the original motion information, determine the motion vector information of M derived motion information; M is an integer greater than or equal to 1.
[0705] S1505. Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, construct a new motion information candidate list.
[0706] S1507. Based on the new motion information candidate list, determine the inter-frame prediction value of the current block.
[0707] In this embodiment, a new motion information candidate list is constructed based on the motion vector information of the original motion information and the motion vector information of the derived motion information. This new motion information candidate list can make full use of the motion vector information of the original motion information that has already been acquired. As a result, the construction of the motion information candidate list conforms to the weight derivation mode of the current block. Therefore, the new motion information candidate list can arrange the motion information in order of strong to weak relevance to the current block, thereby improving the coding efficiency of the current block.
[0708] In one embodiment, the motion vector information includes first axis component information and second axis component information;
[0709] Based on the scaling of the motion vector information of the original motion information, the motion vector information of M derived motion information is determined, including one of the following:
[0710] Based on the scaling result of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; the second axis component information of the original motion information is used as the second axis component information of each of the M derived motion information.
[0711] Based on the scaling result of the first axis component information of the original motion information, the first axis component information of each of the M derived motion information is determined; based on the scaling result of the second axis component information of the original motion information, the second axis component information of each of the M derived motion information is determined.
[0712] Wherein, the first axis is the x-axis or y-axis, the second axis is the y-axis or x-axis, and the first axis is different from the second axis.
[0713] In one implementation, determining the first axis component information of each of the M derived motion information based on the scaling result of the first axis component information of the original motion information includes one of the following:
[0714] Multiply the first axis component information of the original motion information by M first values to obtain M first results. Based on each of the M first results, determine the first axis component information of each derived motion information.
[0715] Divide the first axis component information of the original motion information by M second values to obtain M first divisors. Based on each of the M first divisors, determine the first axis component information of each derived motion information.
[0716] In one implementation, determining the first axis component information of each derived motion information based on each of the M first results includes one of the following:
[0717] Each of the M first results is used as the first axis component information of each derived motion information;
[0718] M third values corresponding to the M first results are determined, and the M first results are added to the M third values to obtain M second results. Based on each of the M second results, the first axis component information of each derived motion information is determined.
[0719] In one implementation, determining the first axis component information of each derived motion information based on each of the M second results includes one of the following:
[0720] Each of the M second results is used as the first axis component information of each derived motion information;
[0721] Shift each of the M second results to the right by a specific number of bits to obtain M third results. Based on each of the M third results, determine the first axis component information of each derived motion information.
[0722] In one implementation, the third value is obtained by left-shifting a target bit, where the target bit is the specific number of bits minus one.
[0723] In one implementation, determining the first axis component information of each derived motion information based on each of the M third results includes:
[0724] If the first axis component information of the original motion information is positive, each of the M third results is used as the first axis component information of each derived motion information.
[0725] If the first axis component information of the original motion information is negative, each of the M third results is multiplied by a negative one to obtain the first axis component information of each derived motion information.
[0726] In one embodiment, the absolute value of the first axis component information in the motion vector information of the original motion information is greater than a first threshold.
[0727] The M first values include a first specific value and a second specific value, wherein the first specific value is greater than 0 and less than 1, the second specific value is greater than 1 and less than 2, and the sum of the first specific value and the second specific value is 2.
[0728] In one embodiment, the method further includes:
[0729] If the absolute value of the first axis component information of the original motion information is less than or equal to the second threshold, the first specific value is determined to be the first coefficient.
[0730] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the second threshold and less than or equal to the third threshold, the first specific value is determined to be the second coefficient.
[0731] If the absolute value of the first axis component information in the motion vector information of the original motion information is greater than the third threshold, the first specific value is determined to be the third coefficient.
[0732] Wherein, the first coefficient is less than the second coefficient, and the second coefficient is less than the third coefficient.
[0733] In one embodiment, the method further includes:
[0734] If the absolute value of the first axis component information of the original motion information is less than or equal to the first threshold, and the first axis component information in the motion vector information of the original motion information is a positive number, the first target value is used as the first axis component information of the derived motion information.
[0735] If the absolute value of the first axis component information in the motion vector information of the original motion information is less than or equal to a first threshold, and the first axis component information in the motion vector information of the original motion information is negative, then the negative first target value is taken as the first axis component information of the derived motion information.
[0736] In one implementation, the M first divisors include a first group of divisors, and / or a second group of divisors, and / or a third group of divisors;
[0737] Each divisor in the first group is greater than the maximum threshold;
[0738] Each divisor in the second group is greater than or equal to the minimum threshold and less than or equal to the maximum threshold;
[0739] Each of the third group of divisors is less than the minimum threshold.
[0740] The determination of the first axis component information of each derived motion information based on each of the M first divisors includes at least one of the following:
[0741] The maximum threshold is used as the first axis component information of each derived motion information corresponding to the first group of divisors in the M derived motion information;
[0742] Each divisor in the second group of divisors is used as the first axis component information of each derivative motion information corresponding to the second group of divisors in the M derivative motion information;
[0743] The minimum threshold is used as the first axis component information of each derived motion information corresponding to the third set of divisors in the M derived motion information.
[0744] In one embodiment, the original motion information is unidirectional original motion information, or bidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information.
[0745] The derived motion information is unidirectional derived motion information, or bidirectional derived motion information, or one or two unidirectional derived motion information obtained by splitting bidirectional derived motion information;
[0746] The unidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information, and the bidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information.
[0747] In one implementation, the step of obtaining motion vector information related to the original motion information of the current block includes:
[0748] Obtain motion vector information related to the original motion information of the current block and the weight derivation mode of the current block;
[0749] Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, a new motion information candidate list is constructed, including:
[0750] Based on the weighted derivation mode of the current block, the motion vector information of the original motion information, and the motion vector information of the derived motion information, a new motion information candidate list is constructed.
[0751] In one implementation, the construction of the new motion information candidate list based on the weighted derivation mode of the current block, the motion vector information of the original motion information, and the motion vector information of the derived motion information includes:
[0752] Based on the weight derivation mode of the current block, determine the sorting method of the known motion information related to the current block;
[0753] Based on the sorting method, the motion vector information of the original motion information and the motion vector information of the derived motion information are used to construct the new motion information candidate list.
[0754] In one implementation, under the weighted derivation mode of the current block, the current block is divided into a first partition and a second partition;
[0755] Determining the inter-frame prediction value of the current block based on the new motion information candidate list includes:
[0756] From the new list of motion information candidates, determine the motion information for the first partition and the motion information for the second partition;
[0757] A first predicted value for the first partition is determined based on the motion information of the first partition, and a second predicted value for the second partition is determined based on the motion information of the second partition.
[0758] The first predicted value and the second predicted value are weighted and fused to obtain the inter-frame predicted value of the current block.
[0759] In one implementation, determining the motion information of the first partition and the motion information of the second partition from the new motion information candidate list includes:
[0760] Determine the index value of the first partition and the index value of the second partition;
[0761] Based on the new motion information candidate list, the motion information in the new motion information candidate list indicated by the index value of the first partition is determined as the motion information of the first partition;
[0762] Based on the new motion information candidate list, the motion information in the new motion information candidate list indicated by the index value of the second partition is determined as the motion information of the second partition.
[0763] In one implementation, determining the index value of the first partition and the index value of the second partition includes:
[0764] The current block is pre-encoded using multiple prediction modes to obtain the rate-distortion cost corresponding to each prediction mode.
[0765] Select the minimum rate distortion value from the multiple obtained rate distortion values, and determine the two motion information corresponding to the minimum rate distortion value as the index value of the first partition and the index value of the second partition, respectively.
[0766] Based on the foregoing embodiments, this application provides a decoder / encoder. The units and modules included in the decoder / encoder can be implemented by a processor in the decoder / encoder; of course, they can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP), or field programmable gate array (FPGA), etc.
[0767] Figure 16 This is a schematic diagram of the composition structure of a decoder provided in an embodiment of this application. The decoder 1600 can be disposed in a decoder, such as... Figure 16 As shown, the decoder 1600 may include:
[0768] Acquisition unit 1601 is used to parse the bitstream and obtain the weight export mode of the current block.
[0769] Construction unit 1602 is used to construct a new motion information candidate list based on the weight derivation mode of the current block.
[0770] The prediction unit 1603 is used to determine the inter-frame prediction value of the current block based on the new motion information candidate list.
[0771] Figure 17 This is a schematic diagram of the composition structure of an encoder provided in an embodiment of this application. The encoder 1700 can be disposed in an encoder, such as... Figure 17 As shown, encoder 1700 may include:
[0772] The mode determination unit 1701 is used to determine the weight derivation mode of the current block.
[0773] Construction unit 1702 is used to construct a new motion information candidate list based on the weight derivation mode of the current block.
[0774] The prediction unit 1703 is used to determine the inter-frame prediction value of the current block based on the new motion information candidate list.
[0775] Figure 18 This is a schematic diagram of the composition structure of another decoder provided in an embodiment of this application. The decoder 1800 can be disposed within a decoder, such as... Figure 18 As shown, the decoder 1800 may include:
[0776] Acquisition unit 1801 is used to parse the bitstream and obtain the weight export mode of the current block;
[0777] The derived motion information determination unit 1802 is used to determine the motion vector information of M derived motion information based on the scaling result of the motion vector information of the original motion information; M is an integer greater than or equal to 1;
[0778] Construction unit 1803 is used to construct a new motion information candidate list based on the motion vector information of the original motion information and the motion vector information of the derived motion information;
[0779] The prediction unit 1804 is used to determine the inter-frame prediction value of the current block based on the new motion information candidate list.
[0780] Figure 19 This is a schematic diagram of the composition structure of another encoder provided in an embodiment of this application. The encoder 1900 can be disposed in the decoder, such as... Figure 19 As shown, encoder 1900 may include:
[0781] The original motion information determination unit 1901 is used to determine the motion vector information of the original motion information related to the current block;
[0782] The derived motion information determination unit 1902 is used to determine the motion vector information of M derived motion information based on the scaling result of the motion vector information of the original motion information; M is an integer greater than or equal to 1.
[0783] Construction unit 1903 is used to construct a new motion information candidate list based on the motion vector information of the original motion information and the motion vector information of the derived motion information;
[0784] Prediction unit 1904 is used to determine the inter-frame prediction value of the current block based on the new motion information candidate list.
[0785] It should be noted that although the embodiments of this application only provide a schematic diagram of the composition structure of decoder 1600, encoder 1700, decoder 1800, and encoder 1900, those skilled in the art will understand that any one of decoder 1600, encoder 1700, decoder 1800, and encoder 1900 may also include other units capable of implementing the steps of any of the above embodiments, and the units already described in the embodiments of this application may also implement other steps of any of the above embodiments.
[0786] The descriptions of the decoder / encoder embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the decoder / encoder embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0787] It should be noted that, in the embodiments of this application, if the above-described inter-frame prediction method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a decoder / encoder to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0788] Figure 20 This is a schematic diagram of a hardware entity of a decoder provided in an embodiment of this application, such as... Figure 20 As shown, the hardware entity of the decoder 2000 includes a processor 2001 and a memory 2002, wherein the memory 2002 stores a computer program that can run on the processor 2001, and the processor 2001 executes the program to implement the steps in the decoder execution method of any of the above embodiments.
[0789] Figure 21 This is a schematic diagram of the hardware entity of an encoder provided in an embodiment of this application, as shown below. Figure 21 As shown, the hardware entity of the encoder 2100 includes a processor 2101 and a memory 2102, wherein the memory 2102 stores a computer program that can run on the processor 2101, and the processor 2101 executes the program to implement the steps in the encoder execution method of any of the above embodiments.
[0790] This application provides a computer storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the decoder execution method described above.
[0791] This application provides a computer storage medium that stores one or more programs, which can be executed by one or more processors to implement the steps of the encoder execution method described above.
[0792] Decoder 2000 can be the same decoder as decoder 1600, and decoder 2000 can be the same decoder as decoder 1800. Encoder 2100 can be the same encoder as encoder 1700, and encoder 2100 can be the same encoder as encoder 1900.
[0793] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0794] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0795] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0796] It should be noted that the descriptions of the decoders, decoders, and computer storage media 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 media and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0797] It should be understood that the phrases "an embodiment," "an embodiment," "an embodiment of this application," or "the foregoing embodiment" throughout the specification mean that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in an embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0798] Unless otherwise specified, any step in the embodiments of this application performed by the decoder / encoder may be executed by the decoder / encoder's processor. Unless otherwise specified, the embodiments of this application do not limit the order in which the decoder / encoder performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods. It should also be noted that any step in the embodiments of this application can be executed independently by the decoder / encoder; that is, when the decoder / encoder performs any step in the following embodiments, it may not depend on the execution of other steps.
[0799] In the several embodiments provided in this application, it should be understood that the disclosed decoder / encoder and method can be implemented in other ways. The decoder / encoder embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of resource devices or units, and can be electrical, mechanical, or other forms.
[0800] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0801] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0802] The features disclosed in the several methods or decoder / encoder embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or decoder / encoder embodiments.
[0803] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage resource devices, read-only memory (ROM), magnetic disks, or optical disks.
[0804] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause the decoder / encoder to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage resource devices, ROM, magnetic disks, or optical disks.
[0805] In the embodiments of this application, descriptions of the same steps and contents in different embodiments can be referred to each other. In the embodiments of this application, the term "and" does not affect the order of steps. For example, the decoder / encoder executes P and then Q, which could mean the decoder / encoder executes P first and then Q, or the decoder / encoder executes Q first and then P, or the decoder / encoder executes P and Q simultaneously. The above descriptions are merely embodiments 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.
[0806] Industrial applicability
[0807] This application provides an inter-frame prediction method, a decoder, an encoder, and a computer storage medium. By adopting the inter-frame prediction method of this application, the decoder can construct different new motion information candidate lists according to different weight derivation modes, thereby making the construction of the motion information candidate list conform to the weight derivation mode of the current block, and thus improving the decoding efficiency of the decoder.
Claims
1. An inter-frame prediction method applied to a decoder, the method comprising: Obtain motion vector information related to the original motion information of the current block; Based on the scaling of the motion vector information of the original motion information, the motion vector information of M derived motion information is determined; M is an integer greater than or equal to 1. Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, a motion information candidate list is constructed; Based on the motion information candidate list, the inter-frame prediction value of the current block is determined; The motion vector information of the original motion information includes first axis component information and second axis component information; The motion vector information of M derived motion information is determined based on the scaling result of the motion vector information of the original motion information, including: Multiply the first axis component information of the original motion information by the first value to obtain the first result; A third value corresponding to the first result is determined, and the first result is added to the third value to obtain a second result. Based on the second result, the first axis component information of the derived motion information is determined; wherein, the third value is obtained by shifting a target position to the left, and the target position is a specific number of bits minus one. The second axis component information of the original motion information is used as the second axis component information of the derived motion information; Wherein, the first axis is the x-axis or y-axis, the second axis is the y-axis or x-axis, and the first axis is different from the second axis.
2. The method of claim 1, wherein, The step of determining the first axis component information of the derived motion information based on the second result includes: The second result is used as the first axis component information of the derived motion information; or... The second result is shifted right by a specific number of bits to obtain a third result. Based on the third result, the first axis component information of the derived motion information is determined.
3. The method of claim 2, wherein, The determination of the first axis component information of the derived motion information based on the third result includes: If the first axis component information of the original motion information is positive, the third result is used as the first axis component information of the derived motion information. If the first axis component of the original motion information is negative, the third result is multiplied by negative one to obtain the first axis component of the derived motion information.
4. The method of any one of claims 1 to 3, wherein, The original motion information is unidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information; The derived motion information is unidirectional derived motion information; The unidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information.
5. The method of any one of claims 1 to 3, wherein, In the list of motion information candidates, temporal motion information precedes spatial motion information.
6. An inter-frame prediction method applied to an encoder, the method comprising: Determine the motion vector information of the original motion information related to the current block; Based on the scaling of the motion vector information of the original motion information, the motion vector information of M derived motion information is determined; M is an integer greater than or equal to 1. Based on the motion vector information of the original motion information and the motion vector information of the derived motion information, a motion information candidate list is constructed; Based on the motion information candidate list, the inter-frame prediction value of the current block is determined; The motion vector information of the original motion information includes first axis component information and second axis component information; The motion vector information of M derived motion information is determined based on the scaling result of the motion vector information of the original motion information, including: The first axis component information of the original motion information is multiplied by a first value to obtain a first result; a third value corresponding to the first result is determined, and the first result is added to the third value to obtain a second result; based on the second result, the first axis component information of the derived motion information is determined; wherein, the third value is obtained by shifting a target position to the left, and the target position is a specific number of bits minus one; The second axis component information of the original motion information is used as the second axis component information of the derived motion information; Wherein, the first axis is the x-axis or y-axis, the second axis is the y-axis or x-axis, and the first axis is different from the second axis.
7. The method of claim 6, wherein, The step of determining the first axis component information of the derived motion information based on the second result includes: The second result is used as the first axis component information of the derived motion information; or... The second result is shifted right by a specific number of bits to obtain a third result. Based on the third result, the first axis component information of the derived motion information is determined.
8. The method according to claim 7, wherein, The determination of the first axis component information of the derived motion information based on the third result includes: If the first axis component information of the original motion information is positive, the third result is used as the first axis component information of the derived motion information. If the first axis component of the original motion information is negative, the third result is multiplied by negative one to obtain the first axis component of the derived motion information.
9. The method according to any one of claims 6 to 8, wherein, The original motion information is unidirectional original motion information, or one or two unidirectional original motion information obtained by splitting bidirectional original motion information; The derived motion information is unidirectional derived motion information; The unidirectional derived motion information is determined based on the unidirectional original motion information or the bidirectional motion information.
10. The method according to any one of claims 6 to 8, wherein, In the list of motion information candidates, temporal motion information precedes spatial motion information.
11. A decoder, comprising: Memory and processor The memory stores computer programs that can run on the processor. When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 5.
12. An encoder, comprising: Memory and processor The memory stores computer programs that can run on the processor. When the processor executes the program, it implements the steps of the method according to any one of claims 6 to 10.
13. A computer storage medium storing one or more programs, said one or more programs being executable by one or more processors to perform the steps of the method according to any one of claims 1 to 5; Alternatively, the one or more programs may be executed by one or more processors to implement the steps of the method according to any one of claims 6 to 10.