Inter prediction method, encoder, decoder and computer storage medium

By adjusting the candidate positions in inter-frame prediction and constructing a new list of motion information, the problem of the current block motion information exceeding the LCU boundary was solved, achieving stability and efficiency of encoding and decoding performance without increasing bandwidth.

CN116471418BActive Publication Date: 2026-01-06GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310245097.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-06-24
Filing Date
2021-04-23
Publication Date
2026-01-06
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

During video encoding and decoding, when predicting between frames, the motion information of the current block exceeds the LCU boundary, and the hardware needs to add extra bandwidth to obtain the motion information, which leads to a decrease in encoding and decoding performance.

Method used

By adjusting the initial candidate position of the current block to ensure it does not exceed the LCU boundary, a new list of motion information candidates is constructed, inter-frame prediction values ​​are determined, and additional bandwidth requirements are avoided.

Benefits of technology

Without increasing hardware bandwidth, the stability and efficiency of encoding and decoding performance are guaranteed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116471418B_ABST
    Figure CN116471418B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses an inter-frame prediction method, an encoder, a decoder and a computer storage medium, which are applied to the decoder. The method comprises the following steps: parsing a code stream, and acquiring a prediction mode parameter of a current block; when the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine an inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined; in the case that the at least one initial candidate position exceeds a maximum coding unit (LCU) boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block; at least one time domain motion information of the current block is determined based on the at least one target candidate position; a motion information candidate list is constructed based on the at least one time domain motion information; and the inter-frame prediction value of the current block is determined according to the motion information candidate list.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-references to related applications

[0002] This application is a divisional application of Chinese Patent Application No. 202180008725.3, filed on April 23, 2021, under the PCT international patent application PCT / CN2021 / 089252, which entered the Chinese national phase and is entitled "Inter-frame prediction method, encoder, decoder, and computer storage medium." This Chinese patent application claims priority to Chinese Patent Application No. 202010591597.7, filed on June 24, 2020, with the same title. The entire contents of the aforementioned application are incorporated herein by reference. Technical Field

[0003] This application relates to the field of video encoding and decoding technology, and in particular to an inter-frame prediction method, an encoder, a decoder, and a computer storage medium. Background Technology

[0004] In the field of video encoding and decoding, the encoding and 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) for prediction, then weighted and fused them to obtain the predicted value for the current block.

[0005] Currently, in the prediction process of GPM or AWP, temporal motion information comes from the already encoded reference frame, and is no longer limited to the top-left corner of the current block. The top-right, bottom-left, and bottom-right positions are all outside the current block. If a position becomes unavailable, such as exceeding the image boundary or patch boundary, then it will be adjusted to an internal position of the current block. However, for the largest coding unit (LCU) of the current block, currently only the motion information of a portion of the LCU size at the same position as the current LCU is cached. If the right boundary of the current block coincides with the right boundary of the current LCU, or the bottom boundary of the current block coincides with the bottom boundary of the current LCU, then at least one of the top-right, bottom-left, and bottom-right positions exceeds the boundary of the current LCU. In this case, if one or more of these positions are still inside the image or patch, it means they are still available. The hardware then needs to increase additional bandwidth to acquire the motion information of these positions. Summary of the Invention

[0006] This application proposes an inter-frame prediction method, encoder, decoder, and computer storage medium that can ensure encoding and decoding performance without increasing the bandwidth during hardware implementation.

[0007] The technical solution of this application is implemented as follows:

[0008] In a first aspect, embodiments of this application provide an inter-frame prediction method applied to a decoder, the method comprising:

[0009] Parse the bitstream to obtain the prediction mode parameters for the current block;

[0010] When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0011] If at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block;

[0012] Based on the at least one target candidate position, at least one temporal motion information of the current block is determined;

[0013] Based on the at least one temporal motion information, a new motion information candidate list is constructed;

[0014] Based on the new motion information candidate list, the inter-frame prediction value of the current block is determined.

[0015] Secondly, embodiments of this application provide an inter-frame prediction method applied to an encoder, the method comprising:

[0016] Determine the prediction mode parameters for the current block;

[0017] When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0018] If at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block;

[0019] Based on the at least one target candidate position, at least one temporal motion information of the current block is determined;

[0020] Based on the at least one temporal motion information, a new motion information candidate list is constructed;

[0021] Based on the new motion information candidate list, the inter-frame prediction value of the current block is determined.

[0022] Thirdly, embodiments of this application provide a decoder, which includes a parsing unit, a first determining unit, a first adjusting unit, a first constructing unit, and a first predicting unit; wherein,

[0023] The parsing unit is configured to parse the code stream and obtain the prediction mode parameters of the current block;

[0024] The first determining unit is configured to determine at least one initial candidate position of the current block when the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using a preset inter-frame prediction mode;

[0025] The first adjustment unit is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block.

[0026] The first determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;

[0027] The first construction unit is configured to construct a new motion information candidate list based on the at least one temporal motion information;

[0028] The first prediction unit is configured to determine the inter-frame prediction value of the current block based on the new motion information candidate list.

[0029] Fourthly, embodiments of this application provide a decoder, which includes a first memory and a first processor; wherein,

[0030] The first memory is used to store computer programs that can run on the first processor;

[0031] The first processor is configured to execute the method as described in the first aspect when running the computer program.

[0032] Fifthly, embodiments of this application provide an encoder, which includes a second determining unit, a second adjusting unit, a second constructing unit, and a second predicting unit; wherein,

[0033] The second determining unit is configured to determine the prediction mode parameters of the current block; and when 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, determine at least one initial candidate position of the current block;

[0034] The second adjustment unit is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block.

[0035] The second determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;

[0036] The second construction unit is configured to construct a new motion information candidate list based on the at least one temporal motion information;

[0037] The second prediction unit is configured to determine the inter-frame prediction value of the current block based on the new motion information candidate list.

[0038] Sixthly, embodiments of this application provide an encoder, which includes a second memory and a second processor; wherein,

[0039] The second memory is used to store computer programs that can run on the second processor;

[0040] The second processor is configured to execute the method described in the second aspect when running the computer program.

[0041] In a seventh aspect, embodiments of this application provide a computer storage medium storing a computer program that, when executed by a first processor, implements the method described in the first aspect, or when executed by a second processor, implements the method described in the second aspect.

[0042] This application provides an inter-frame prediction method, encoder, decoder, and computer storage medium. The method parses the bitstream to obtain prediction mode parameters for the current block. When 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, at least one initial candidate position of the current block is determined. If the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block. Based on the at least one target candidate position, at least one temporal motion information of the current block is determined. Based on the at least one temporal motion information, a new motion information candidate list is constructed. According to the new motion information candidate list, the inter-frame prediction value of the current block is determined. Thus, after determining at least one initial candidate position of the current block, by adjusting the at least one initial candidate position so that the at least one target candidate position does not exceed the LCU boundary of the current block, the hardware implementation can achieve this without increasing additional bandwidth while ensuring encoding and decoding performance. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of a typical image group provided in an embodiment of this application;

[0044] Figure 2A This application provides a schematic diagram illustrating the spatial relationship between the current block and adjacent blocks in an embodiment of the present application.

[0045] Figure 2B This is another schematic diagram illustrating the spatial relationship between the current block and adjacent blocks, provided in an embodiment of this application.

[0046] Figure 3 This is a schematic diagram illustrating the spatial relationship of a sheet structure provided in an embodiment of this application;

[0047] Figure 4A This application provides a schematic block diagram of a video encoding system.

[0048] Figure 4B This application provides a schematic block diagram of a video decoding system according to an embodiment of the present application.

[0049] Figure 5 A flowchart illustrating an inter-frame prediction method provided in an embodiment of this application;

[0050] Figure 6A This is a schematic diagram of an initial candidate position provided in an embodiment of this application;

[0051] Figure 6B A schematic diagram of another initial candidate position provided in an embodiment of this application;

[0052] Figure 6C This is a schematic diagram of another initial candidate position provided in an embodiment of this application;

[0053] Figure 6D A schematic diagram of another initial candidate position provided in an embodiment of this application;

[0054] Figure 6E A schematic diagram of another initial candidate position provided in an embodiment of this application;

[0055] Figure 7 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;

[0056] Figure 8A 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;

[0057] Figure 8BA 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;

[0058] Figure 9 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;

[0059] Figure 10 A flowchart illustrating another inter-frame prediction method provided in an embodiment of this application;

[0060] Figure 11 A schematic diagram of the composition structure of a decoder provided in an embodiment of this application;

[0061] Figure 12 A schematic diagram of the hardware structure of a decoder provided in an embodiment of this application;

[0062] Figure 13 A schematic diagram of the composition structure of an encoder provided in an embodiment of this application;

[0063] Figure 14 This is a schematic diagram of the hardware structure of an encoder provided in an embodiment of this application. Detailed Implementation

[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are merely for explaining the relevant application and not for limiting the application. Furthermore, it should be noted that, for ease of description, only the parts relevant to the application are shown in the accompanying drawings.

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

[0066] 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 coding efficiency. The following application will describe inter-frame prediction in detail.

[0067] It should 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, which 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.

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

[0069] Because the encoding / decoding order in Random Access (RA) configuration differs from the Proof-of-Concept (POC) order, B-frames can simultaneously reference information from both preceding and following frames, significantly improving encoding performance. For example, a classic Group of Pictures (GOP) structure in RA is as follows: Figure 1 As shown, in Figure 1In 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 1 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}.

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

[0071] In the embodiments of this application, the encoder or decoder can typically use the index value (represented by index) in the reference frame list to correspond to the reference frame. If a reference frame list 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 index0 is the reference frame for POC 5, RefPicList0's index1 is the reference frame for POC 4, RefPicList0's index2 is the reference frame for POC 3, and RefPicList0's index3 is the reference frame for POC 0.

[0072] In the current Versatile Video Coding (VVC) standard, the default inter-frame prediction mode is the GPM prediction mode. In the current Audio Video Coding Standard (AVS), the default inter-frame prediction mode is the AWP prediction mode. Although these two prediction modes have different names and specific implementations, they are fundamentally the same; that is, both prediction modes can be applied to the inter-frame prediction method of the embodiments in this application.

[0073] Specifically, for GPM prediction mode, if GPM is used, the bitstream will transmit prediction mode parameters under GPM, such as the specific partitioning mode of GPM; 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 partitioning mode of AWP; typically, AWP includes 56 partitioning modes.

[0074] In preset prediction modes, such as GPM and AWP, two unidirectional motion information pieces are needed to locate two reference blocks. The current implementation involves constructing a motion information candidate list (also called a unidirectional motion information candidate list) on the encoder side using relevant information from previously encoded / decoded portions of the current block. Unidirectional motion information is 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 pieces from the bitstream and then retrieving them from the candidate list, the two unidirectional motion information pieces required for the current block are obtained.

[0075] It should also be noted that the unidirectional motion information described in the embodiments of this application 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, such as 0, 1, 2, etc.; and the reference index value corresponding to the other reference frame list is invalid, i.e., -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 the reference frame list according to 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 unidirectional motion information, and can find the reference block in the reference frame according to 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] In practical applications, the construction of the motion information candidate list utilizes 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. For example... Figure 2A As 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.

[0077] For AWP prediction models, such as Figure 2BAs 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 is the block containing sample (x0-1, y0), neighboring block B is the block containing sample (x0, y0-1), neighboring block C is the block containing sample (x0+1, y0-1), neighboring block D is the block containing sample (x0-1, y0-1), neighboring block F is the block containing sample (x0-1, y1), and neighboring block G is the block containing 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. The spatial relationships between block E and its neighboring blocks A, B, C, D, F, and G are shown in [the diagram]. Figure 2B .

[0078] It should be noted that the existence of an adjacent block X (X can be A, B, C, D, F or G) means that the block should be within the image and that the block should belong to the same patch as block E; otherwise, the adjacent block "does not exist".

[0079] If a block "does not exist" or has not yet been decoded, then the block is "unavailable"; otherwise, the block is "available". If the block containing the image sample "does not exist" or the sample has not yet been decoded, then the sample is "unavailable"; otherwise, the sample is "available".

[0080] It is also important to note that a patch is a rectangular region in an image that contains several maximum coding units within the image. The patch structure is as follows: Figure 3 As shown, such as pieces A, B, C, D, E, F, etc., the pieces should not overlap.

[0081] Furthermore, the image is divided into maximum coding units (MCUs). These MCUs should not overlap, and the sample at the top left corner of a MCU should not exceed the image boundary, while the sample at the bottom right corner may exceed the image boundary. Here, a MCU is divided into one or more coding units, determined by the coding tree, and each coding unit can be divided into one or more transform units.

[0082] In constructing the candidate list of motion information, the temporal motion information in the current proposal, since it comes from the already encoded reference frame, is no longer limited to the top-left corner of the current block. The current proposal adopts a "fill in where it's lacking" approach, setting four different positions. Assuming the top-left corner of the current block is (x, y), the width of the current block is `width`, and the height is `height`, these four positions are shown in Table 1 below. It should be noted that the width and height mentioned here usually refer to the width (i.e., `l_width`) and height (i.e., `l_height`) of the luminance component, but are not specifically limited.

[0083] Table 1

[0084] Pos 0 Top left corner (x,y) Pos 1 Top right corner (x+width,y) Pos 2 bottom left corner (x, y + height) Pos 3 bottom right corner (x+width,y+height)

[0085] For each AWP mode, the temporal motion information can be determined by which of the four positions the small corner is in. This is shown in Table 2 below. In Table 2, 0 represents "Pos 0", 1 represents "Pos 1", 2 represents "Pos 2", and 3 represents "Pos 3".

[0086] Table 2

[0087] 0 0 3 1 2 2 3 0 0 0 3 1 2 2 3 0 0 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 2 1 1 3 3 3 3 3 2 1 1 3 3

[0088] Specifically, assuming TmvpPos = AwpIdxToTmvpPos[AwpIdx], then

[0089] If TmvpPos equals 0, then the bidirectional motion information in the time domain is derived using Method 1.

[0090] If TmvpPos equals 1, then the bidirectional motion information in the time domain is derived using method two.

[0091] If TmvpPos equals 2, then the bidirectional motion information in the time domain can be derived using method three.

[0092] If TmvpPos equals 3, then the bidirectional motion information in the time domain can be derived using method four.

[0093] Here, the lookup table corresponding to AwpIdxToTmvpPos is shown in Table 2. The exported bidirectional motion information in the time domain is split into unidirectional motion information pointing to the reference frame list List0 and unidirectional motion information pointing to the reference frame list List1. First, a deduplication operation is performed on the unidirectional motion information. If there is no duplicate, it is put into AwpUniArray until the length is 4 or the traversal ends.

[0094] The following will take the top left, top right, bottom left, and bottom right corners of the current block as examples to provide the specific steps for deriving temporal motion information using methods one, two, three, and four, respectively.

[0095] Method 1, taking the top left corner of the current block as an example, the steps to derive the motion information are as follows:

[0096] first step,

[0097] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0098] otherwise,

[0099] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

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

[0101] The second step,

[0102]

[0103] The third step,

[0104] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0105]

[0106] Here, mvX is mvRef, and MVX is mvE0.

[0107] 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:

[0108]

[0109] Here, mvX is mvRef, and MVX is mvE1.

[0110] Fourth step, the value of interPredRefMode is equal to 'PRED_List01'.

[0111] Method 2, taking the top right corner of the current block as an example, the steps to derive the motion information are as follows:

[0112] first step,

[0113] Assume the top-left corner luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; while the top-right corner luminance sample position of the selected current prediction unit is (x', y'), where x' = x + l_width, and y' = y

[0114] If the (x', y') derived above is unavailable, for example, if it exceeds the image boundary or patch boundary, then x' = x + l_width - 1, y' = y.

[0115] The second step,

[0116] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the upper right corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0117] otherwise,

[0118] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0119] In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the upper right corner brightness sample position of the selected 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 to which the motion vector points is denoted as DistanceIndexRef.

[0120] The third step,

[0121]

[0122] Step 4

[0123] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0124]

[0125] Here, mvX is mvRef, and MVX is mvE0.

[0126] 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:

[0127]

[0128] Here, mvX is mvRef, and MVX is mvE1.

[0129] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0130] Method 3, taking the bottom left corner of the current block as an example, the steps to derive the motion information are as follows:

[0131] first step,

[0132] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower left corner brightness sample of the selected current prediction unit is (x', y'), x' = x, y' = y + l_height.

[0133] If the (x', y') derived above is not available, for example, if it exceeds the image boundary or patch boundary, then x' = x, y' = y + l_height - 1.

[0134] The second step,

[0135] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the lower left corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0136] otherwise,

[0137] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0138] In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the lower left corner brightness sample position of the selected 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.

[0139] The third step,

[0140]

[0141] Step 4

[0142] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0143]

[0144] Here, mvX is mvRef, and MVX is mvE0.

[0145] 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:

[0146]

[0147] Here, mvX is mvRef, and MVX is mvE1.

[0148] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0149] Method 4, taking the bottom right corner of the current block as an example, the steps to derive motion information are as follows:

[0150] first step,

[0151] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower right corner brightness sample of the selected current prediction unit is (x', y'), x' = x + l_width, y' = y + l_height.

[0152] If the derived (x', y') is unavailable, such as if it exceeds the image boundary or patch boundary, then if x' is unavailable, x' = x + l_width - 1; if y' is unavailable, y' = y + l_height - 1.

[0153] The second step,

[0154] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the lower right corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0155] otherwise,

[0156] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0157] 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 lower right corner of the selected 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.

[0158] The third step,

[0159]

[0160] Step 4

[0161] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0 y) of the current prediction unit:

[0162]

[0163] Here, mvX is mvRef, and MVX is mvE0.

[0164] 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:

[0165]

[0166] Here, mvX is mvRef, and MVX is mvE1.

[0167] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0168] The aforementioned technical solutions significantly improve compression performance. However, since the current top-right, bottom-left, and bottom-right positions are all outside the current block, the position will only be modified to be inside the current block if one of these three positions becomes unavailable, such as if it exceeds the image boundary or patch boundary.

[0169] However, when determining the location used to derive temporal motion information, it becomes unavailable when the reference frame used has already been encoded, as it exceeds image boundaries or patch boundaries. This is not ideal for existing hardware implementations. Hardware implementations do not cache all motion information from the reference frame used for deriving temporal motion information; instead, they only cache the motion information of a portion of the LCU size at the same position as the current LCU for the current block. Therefore, in current related technologies, if the right boundary of the current block coincides with the right boundary of the current LCU, or the lower boundary of the current block coincides with the lower boundary of the current LCU, then at least one of the three positions (upper right, lower left, lower right) will exceed the boundary of the current LCU. If this or these positions are still within the image or patch, it means they are still usable, and the hardware needs to increase bandwidth to acquire the motion information at these positions.

[0170] It is important to note that when exporting temporal motion information, the frame storage used for exporting temporal motion information typically does not save motion information for each pixel. Instead, it shares motion information in blocks of a certain size, such as 16×16 pixels, 8×8 pixels, or 4×4 pixels sharing one piece of motion information. Here, 16×16 pixels, 8×8 pixels, or 4×4 pixels usually refer to the number of pixels in the luminance component by default.

[0171] Based on this, embodiments of this application provide an inter-frame prediction method applicable to encoders or decoders. After obtaining the prediction mode parameters of the current block, when the prediction mode parameters indicate the use of a preset inter-frame prediction mode to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined. If the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block. Based on the at least one target candidate position, at least one temporal motion information of the current block is determined. Based on the at least one temporal motion information, a new motion information candidate list is constructed. According to the new motion information candidate list, the inter-frame prediction value of the current block is determined. Thus, after determining at least one initial candidate position of the current block, by adjusting the at least one initial candidate position so that the at least one target candidate position does not exceed the LCU boundary of the current block, the hardware implementation can be implemented without increasing additional bandwidth while ensuring encoding and decoding performance.

[0172] See Figure 4A This illustrates a block diagram of a video encoding system provided in an embodiment of this application. Figure 4AAs 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; for the input raw video signal, it uses coding tree blocks (Coding Tree) to... A video reconstruction block is obtained by dividing the video reconstruction unit (CTU). The coding mode is determined by the mode selection and coding control logic unit 113. Then, the residual pixel information obtained after intra-frame or inter-frame prediction is transformed by the transform unit 111 and the quantization unit 112. This includes transforming the residual information from the pixel domain to the transform domain and quantizing the resulting transform coefficients to further reduce the bit rate. The intra-frame prediction unit 114 is used to perform intra-frame prediction on the video reconstruction block. The intra-frame prediction unit 114 is used to determine the optimal intra-frame prediction mode (i.e., the target prediction mode) 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.

[0173] See Figure 4B The illustration shows a block diagram of a video decoding system provided in this application. Figure 4BAs 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 decoding image buffer unit 126. The input video signal is encoded by the video encoding system 11, and the resulting bitstream is output. This bitstream is input into the video decoding system 12, first passing through the decoding unit 121 to obtain the decoded transform coefficients. These transform coefficients are then processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate residual blocks in the pixel domain. The intra-frame prediction unit 123 can be used to generate the prediction number of the current video decoding block based on the determined intra-frame prediction direction and data from previously decoded blocks in the current frame or image. According to the method, the motion compensation unit 124 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the predictive block of the video decoding block being decoded; the decoded video block is formed by summing the residual block from the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding predictive block generated by the intra-frame prediction unit 123 or the motion compensation unit 124; the decoded video signal is passed through the loop filtering unit 125 to remove block artifacts, which can improve the video quality; then the decoded video block is stored in the decoding image buffer unit 126, which stores the reference image 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.

[0174] In short, the inter-frame prediction method provided in this application mainly operates on the inter-frame prediction unit 215 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. That is, if the video coding system 11 can obtain a better prediction effect through the inter-frame prediction method provided in this application, thereby improving the coding performance, then correspondingly, the video decoding and recovery quality can also be improved in the video decoding system 12, thereby improving the decoding performance.

[0175] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Before proceeding with the detailed description, it should be noted that the terms "first," "second," and "third," etc., mentioned throughout the specification are merely for distinguishing different features and do not have the function of limiting priority, order, or size relationship.

[0176] This application provides an inter-frame prediction method applied to a video decoding device, i.e., a decoder. The functionality of this method can be implemented by a computer program called by a first processor in the decoder. The computer program can be stored in a first memory. Therefore, the decoder includes at least a first processor and a first memory.

[0177] See Figure 5 This illustrates a flowchart of an inter-frame prediction method according to an embodiment of this application. Figure 5 As shown, the method may include:

[0178] S501: Parse the bitstream and obtain the prediction mode parameters for the current block.

[0179] 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 or PU), 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 can 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.

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

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

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

[0183] S502: When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0184] It should be noted that when the decoder parses the bitstream and obtains the prediction mode parameter indicating that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, the inter-frame prediction method provided in the embodiments of this application can be adopted.

[0185] It should also be noted that motion information can include motion vector 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, and 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.

[0186] In this embodiment of the application, to avoid increasing the bandwidth during hardware implementation, the objective is to maintain compression performance as much as possible without increasing the bandwidth during hardware implementation. Here, ensuring that the pixel positions used to determine temporal motion information do not exceed the boundaries of the current LCU is required. It should be noted that the pixel positions used to determine temporal motion information will be referred to simply as "positions" thereafter.

[0187] In some embodiments, for S502, determining at least one candidate position of the current block may include:

[0188] Obtain at least one initial candidate position of the corner of the current block to form an initial candidate position set; wherein, the at least one initial candidate position of the corner includes at least one of the following: the upper left initial candidate position, the upper right initial candidate position, the lower left initial candidate position, and the lower right initial candidate position;

[0189] From the initial candidate position set, at least one initial candidate position of the current block is determined.

[0190] Furthermore, in some embodiments, the initial candidate position at the top left includes at least one of the following: a first candidate position at the top left, a second candidate position at the top left, a third candidate position at the top left, and a fourth candidate position at the top left;

[0191] The initial candidate position in the upper right corner includes at least one of the following: the first candidate position in the upper right corner, the second candidate position in the upper right corner, the third candidate position in the upper right corner, and the fourth candidate position in the upper right corner;

[0192] The initial candidate position in the lower left corner includes at least one of the following: the first candidate position in the lower left corner, the second candidate position in the lower left corner, the third candidate position in the lower left corner, and the fourth candidate position in the lower left corner;

[0193] The initial candidate position in the lower right corner includes at least one of the following: the first candidate position in the lower right corner, the second candidate position in the lower right corner, the third candidate position in the lower right corner, and the fourth candidate position in the lower right corner;

[0194] Wherein, the first top-left candidate position, the first top-right candidate position, the first bottom-left candidate position, and the first bottom-right candidate position represent the four corner positions inside the current block; the second top-left candidate position, the third top-left candidate position, and the fourth top-left candidate position represent the top-left corner position outside the current block; the second top-right candidate position, the third top-right candidate position, and the fourth top-right candidate position represent the top-right corner position outside the current block; the second bottom-left candidate position, the third bottom-left candidate position, and the fourth bottom-left candidate position represent the bottom-left corner position outside the current block; and the second bottom-right candidate position, the third bottom-right candidate position, and the fourth bottom-right candidate position represent the bottom-right corner position outside the current block.

[0195] It should be noted that, assuming the top-left corner of the current block, that is, the pixel position corresponding to the first pixel at the top left corner of the current block, is (x, y), the width of the current block is width, and the height of the current block is height. Furthermore, the width and height mentioned here usually refer to the width (l_width) and height (l_height) of the luminance component, but are not specifically limited thereto.

[0196] It should also be noted that, as mentioned above, the reference frame used to export temporal motion information stores the motion information exported by the temporal motion information in blocks. Therefore, the temporal motion information determined by a certain pixel position is the same as the temporal motion information determined by other pixel positions within the same storage block. Thus, during the export process, there may be some intermediate calculations that obtain a certain pixel position in a certain uniform format. As long as they are all within the same storage block, these positions can be considered the same.

[0197] In one possible implementation, with Figure 6AFor example, the current block can have multiple candidate positions for the top-left (i.e., the initial candidate position for the top-left), top-right (i.e., the initial candidate position for the top-right), bottom-left (i.e., the initial candidate position for the bottom-left), and bottom-right (i.e., the initial candidate position for the bottom-right). Specifically, for the top-left corner (filled in gray), it can be represented by the first, second, third, and fourth candidate positions for the top-left, specifically (x, y), (x-1, y), (x, y-1), and (x-1, y-1). For the top-right corner (filled in gray), it can be represented by the first, second, third, and fourth candidate positions for the top-right, specifically (x+width-1, y), (x+width, y), (x+width, y-1), and (x+width-1, y-1). For the bottom left corner (filled in gray), we can use the first bottom left candidate position, the second bottom left candidate position, the third bottom left candidate position, and the fourth bottom left candidate position, specifically represented as (x, y + height - 1), (x, y + height), (x - 1, y + height), and (x - 1, y + height - 1). For the bottom right corner (filled in gray), we can use the first bottom right candidate position, the second bottom right candidate position, the third bottom right candidate position, and the fourth bottom right candidate position, specifically represented as (x + width - 1, y + height - 1), (x + width, y + height), (x + width - 1, y + height), and (x + width, y + height - 1).

[0198] Another possible implementation is to Figure 6B For example, for each current block, which can be either a CU or a PU, the four initial candidate positions that can be used are as follows: Figure 6B As shown. These four positions fall within the four corners of the current block. Specifically, these four positions are: the initial candidate position for the top left is (x, y), the initial candidate position for the top right is (x + width - 1, y), the initial candidate position for the bottom left is (x, y + height - 1), and the initial candidate position for the bottom right is (x + width - 1, y + height - 1).

[0199] In another possible implementation, with Figure 6C For example, the initial (default) positions of the four positions in the current block—top left, top right, bottom left, and bottom right—can each initially select one of their own positions. Specifically, as shown... Figure 6CAs shown, the four initial candidate positions are: the top left initial candidate position is (x, y), the top right initial candidate position is (x+width, y), the bottom left initial candidate position is (x, y+height), and the bottom right initial candidate position is (x+width, y+height).

[0200] In another possible implementation, with Figure 6D For example, the initial (default) positions of the four positions in the current block—top left, top right, bottom left, and bottom right—can each initially select one of their own positions. Specifically, as shown... Figure 6D As shown, the four initial candidate positions are: the top left initial candidate position is (x, y), the top right initial candidate position is (x+width, y-1), the bottom left initial candidate position is (x-1, y+height), and the bottom right initial candidate position is (x+width, y+height).

[0201] In another possible implementation, with Figure 6E For example, the initial (default) positions of the four positions in the current block—top left, top right, bottom left, and bottom right—can each initially select one of their own positions. Specifically, as shown... Figure 6E As shown, the four initial candidate positions are: the top left initial candidate position is (x-1, y-1), the top right initial candidate position is (x+width, y-1), the bottom left initial candidate position is (x-1, y+height), and the bottom right initial candidate position is (x+width, y+height).

[0202] In this way, Figures 6A-6E For example, it provides several initial candidate positions. After obtaining the initial candidate position, it is necessary to determine whether the initial candidate position exceeds the LCU boundary of the current block in order to further determine how to handle the situation when the initial candidate position falls outside the LCU boundary.

[0203] S503: If the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block.

[0204] It should be noted that, in order to avoid adding extra bandwidth during hardware implementation, it is necessary to determine whether at least one initial candidate position used to determine the temporal motion information exceeds the LCU boundary of the current block.

[0205] In some embodiments, for S503, the method further includes: determining the at least one initial candidate position as at least one target candidate position of the current block if the at least one initial candidate position does not exceed the LCU boundary of the current block.

[0206] In other words, if an initial candidate position exceeds the LCU boundary, then the initial candidate position needs to be adjusted so that the adjusted target candidate position does not exceed the LCU boundary; if an initial candidate position does not exceed the LCU boundary, then the initial candidate position does not need to be adjusted and can be directly determined as the target candidate position.

[0207] In one possible implementation, candidate positions within the current block can be selected. In this case, none of the candidate positions exceed the LCU boundary of the current block, allowing them to be directly identified as target candidate positions. Therefore, in some embodiments, the method may further include:

[0208] If the at least one initial candidate position includes the first top-left candidate position, and / or the first top-right candidate position, and / or the first bottom-left candidate position, and / or the first bottom-right candidate position, then it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined as at least one target candidate position of the current block.

[0209] It should be noted that, with Figure 6B For example, since the first top-left candidate position is (x, y), and / or the first top-right candidate position is (x+width-1, y), and / or the first bottom-left candidate position is (x, y+height-1), and / or the first bottom-right candidate position is (x+width-1, y+height-1), these initial candidate positions are inside the current block, that is, none of these initial candidate positions exceed the LCU boundary of the current block. Therefore, these initial candidate positions can be determined as target candidate positions.

[0210] It should also be noted that if a position falls outside the LCU boundary, then the position can be adjusted to fall inside the LCU boundary, that is, inside the LCU; otherwise, if a position is outside the current block but falls inside the LCU, no adjustment is made.

[0211] In another possible implementation, for a certain corner, if the initial candidate position falls outside the LCU boundary, then it is preferred to adjust to a candidate position inside the LCU of that corner and outside the current block.

[0212] In some embodiments, the method may further include:

[0213] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0214] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0215] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the lower right corner position outside the current block, and the lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0216] Furthermore, the method may also include: if no candidate position that does not exceed the LCU boundary is selected from the lower right corner position outside the current block, then the initial lower right candidate position is adjusted to the lower right corner position inside the current block to obtain a target candidate position of the current block.

[0217] In other words, taking the bottom right corner as an example, if the initial candidate position in the bottom right corner exceeds the LCU boundary, then it is first adjusted to a candidate position inside the LCU in the bottom right corner but outside the current block; if no candidate position that does not exceed the LCU boundary is selected from the bottom right corner position outside the current block, then it needs to be adjusted to the bottom right corner position inside the current block to determine the corresponding target candidate position.

[0218] Specifically, taking the bottom right corner as an example, if the initial candidate position is (x+width, y+height), and the right boundary of the current block coincides with the right boundary of the LCU while the bottom boundary of the current block is inside the LCU, then adjust the bottom right corner to (x+width-1, y+height). If the right boundary of the current block is inside the LCU while the bottom boundary of the current block coincides with the bottom boundary of the LCU, then adjust the bottom right corner to (x+width, y+height-1). If the right boundary of the current block coincides with the right boundary of the LCU while the bottom boundary of the current block coincides with the bottom boundary of the LCU, then adjust the bottom right corner to (x+width-1, y+height-1). The other three corners (top left, top right, and bottom left) can be adjusted using the same steps.

[0219] The process is described in the following text. This text description only modifies the pixel positions of Method 1, Method 2, Method 3, and Method 4.

[0220] Method 1, taking the top left corner of the current block as an example, the steps to derive the motion information are as follows:

[0221] first step,

[0222] Assume the top-left corner brightness sample position of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the top-left corner brightness sample position of the selected current prediction unit is (x', y'), x' = x–1, y' = y–1.

[0223] If x' is less than the x-coordinate x_lcu_left of the leftmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x.

[0224] If y' is less than the ordinate y_lcu_top of the topmost luminance sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is less than the ordinate y_boundary_top of the topmost luminance sample position of the image or patch where the current prediction unit is located; then y' = y.

[0225] Method 2, taking the top right corner of the current block as an example, the steps to derive the motion information are as follows:

[0226] first step,

[0227] Assume the top-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; while the top-right luminance sample position of the selected current prediction unit is (x', y'), where x' = x + l_width and y' = y - 1.

[0228] If x' is greater than the x-coordinate x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x + l_width - 1;

[0229] If y' is less than the ordinate y_lcu_top of the topmost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is less than the ordinate y_boundary_top of the topmost brightness sample position of the image or patch where the current prediction unit is located; then y' = y.

[0230] Method 3, taking the bottom left corner of the current block as an example, the steps to derive the motion information are as follows:

[0231] first step,

[0232] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower left corner brightness sample of the selected current prediction unit is (x', y'), x' = x-1, y' = y + l_height.

[0233] If x' is less than the x-coordinate x_l of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x.

[0234] If y' is greater than the ordinate y_b of the bottommost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is greater than the ordinate y_boundary_bottom of the bottommost brightness sample position of the image or patch where the current prediction unit is located; then, y' = y + l_height - 1.

[0235] Method 4, taking the bottom right corner of the current block as an example, the steps to derive motion information are as follows:

[0236] first step,

[0237] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower right corner brightness sample of the selected current prediction unit is (x', y'), x' = x + l_width, y' = y + l_height.

[0238] If x' is greater than the x-coordinate x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x + l_width - 1;

[0239] If y' is greater than the ordinate y_lcu_bottom of the bottommost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is greater than the ordinate y_boundary_top of the bottommost brightness sample position of the image or patch where the current prediction unit is located; then y' = y + l_height - 1.

[0240] It should be noted that since patches in the current standard protocol are always rectangular areas, the above handling of patch boundaries is not a problem; however, if subsequent patches are not limited to rectangular areas, then the judgment that x' and y' are unusable should be changed to judging whether (x', y') is within the range of the patch, which will not be elaborated here.

[0241] Specifically, this applies if the current prediction unit, or the current block, will not exceed the image or patch boundary, as is the case in the current standard protocol. However, if the current prediction unit, or the current block, may exceed the image or patch boundary, then the above description can be written as:

[0242] Method 1, taking the top left corner of the current block as an example, the steps to derive the motion information are as follows:

[0243] first step,

[0244] Assume the top-left corner brightness sample position of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the top-left corner brightness sample position of the selected current prediction unit is (x', y'), x' = x–1, y' = y–1.

[0245] If x' is less than the x-coordinate x_lcu_left of the leftmost brightness sample position of the LCU where the current prediction unit is located, then x' = x;

[0246] If x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost brightness sample position in the image or patch where the current prediction unit is located, then x' = x_boundary_left;

[0247] If y' is less than the ordinate y_lcu_top of the brightness sample position at the top of the LCU where the current prediction unit is located, then y' = y;

[0248] If y' is unavailable, for example, if y' is less than the y_boundary_top of the brightness sample position at the top of the image or patch where the current prediction unit is located, then y' = y_boundary_top.

[0249] Method 2, taking the top right corner of the current block as an example, the steps to derive the motion information are as follows:

[0250] first step,

[0251] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the upper right corner brightness sample of the selected current prediction unit is (x', y'), x' = x + l_width, y' = y – 1.

[0252] If x' is greater than the x_lcu_right coordinate of the rightmost brightness sample position of the LCU where the current prediction unit is located, then x' = x + l_width - 1;

[0253] If x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost brightness sample position in the image or patch where the current prediction unit is located, then x' = x_boundary_right;

[0254] If y' is less than the ordinate y_lcu_top of the brightness sample position at the top of the LCU where the current prediction unit is located, then y' = y;

[0255] If y' is unavailable, such as if y' is less than the y_boundary_top of the brightness sample position at the top of the image or patch where the current prediction unit is located, then y' = y_boundary_top.

[0256] Method 3, taking the bottom left corner of the current block as an example, the steps to derive the motion information are as follows:

[0257] first step,

[0258] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the upper right corner brightness sample of the selected current prediction unit is (x', y'), x' = x-1, y' = y + l_height.

[0259] If x' is less than the x-coordinate x_l of the leftmost brightness sample position of the LCU where the current prediction unit is located, then x' = x;

[0260] If x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost brightness sample position in the image or patch where the current prediction unit is located, then x' = x_boundary_left;

[0261] If y' is greater than the ordinate y_b of the bottommost brightness sample position of the LCU where the current prediction unit is located, then y' = y + l_height – 1;

[0262] If y' is unavailable, for example, if y' is greater than the y_boundary_bottom of the brightness sample position at the bottom of the image or patch where the current prediction unit is located, then y' = y_boundary_bottom.

[0263] Method 4, taking the bottom right corner of the current block as an example, the steps to derive motion information are as follows:

[0264] first step,

[0265] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower right corner brightness sample of the selected current prediction unit is (x', y'), x' = x + l_width, y' = y + l_height.

[0266] If x' is greater than the x_lcu_right coordinate of the rightmost brightness sample position of the LCU where the current prediction unit is located, then x' = x + l_width - 1;

[0267] If x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost brightness sample position in the image or patch where the current prediction unit is located, then x' = x_boundary_right;

[0268] If y' is greater than the ordinate y_lcu_bottom of the lowest brightness sample position of the LCU where the current prediction unit is located, then y' = y + l_height – 1;

[0269] If y' is unavailable, for example, if y' is greater than the y_boundary_top of the bottommost brightness sample position in the image or patch where the current prediction unit is located, then y' = y_boundary_top.

[0270] It should also be noted that the top-left brightness sample position (x,y) may never exceed the image or patch boundary; that is, the above text description is only modified to maintain format consistency.

[0271] In another possible implementation, for a certain corner, if the initial candidate position falls outside the LCU boundary, it can be adjusted to another candidate position of the corner whose initial position falls inside the LCU.

[0272] In some embodiments, the method may further include:

[0273] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners other than the one corner, and the initial candidate position of the one corner is adjusted to the selected candidate position to obtain a target candidate position of the current block.

[0274] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0275] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, then if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position for the current block.

[0276] In other words, different initial candidate positions can be used for different partitioning modes. Taking partitioning mode 54 as an example (starting from 0), if the temporal motion information is to be derived, the initial candidate position of the lower right corner should be used, i.e., (x+width, y+height). However, if the right boundary of the current block is inside the LCU and the lower boundary of the current block coincides with the lower boundary of the LCU, then the initial candidate position (x+width, y+height) exceeds the LCU boundary. In this case, if the candidate position of the upper right corner is inside the LCU, the candidate position of the upper right corner can be used. The candidate position of the upper right corner may be (x+width, y), (x+width-1, y), or (x+width, y-1).

[0277] In another possible implementation, for a certain corner, if the initial candidate position falls outside the LCU boundary and this corner can only be adjusted to the inside of the current block, then it can be adjusted to the candidate position of another corner whose initial position falls inside the LCU.

[0278] In some embodiments, the method may further include:

[0279] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only the candidate position inside the current block does not exceed the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners other than the one corner, and the initial candidate position of the one corner is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0280] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0281] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and among the lower right corner positions inside and outside the current block, only the first lower right candidate position does not exceed the LCU boundary, then if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position for the current block.

[0282] In other words, different initial candidate positions can be used for different partitioning modes. Taking partitioning mode 54 as an example (starting from 0), if the temporal motion information is to be derived, the initial candidate position at the bottom right corner should be used, i.e., (x+width, y+height). However, if the right boundary of the current block coincides with the right boundary of the LCU and the bottom boundary of the current block coincides with the bottom boundary of the LCU, then the initial candidate position (x+width, y+height) exceeds the LCU boundary, and (x+width, y+height-1) and (x+width, y+height-1) at the bottom right corner also exceed the LCU boundary. Only (x+width-1, y+height-1) is inside the current block and does not exceed the LCU boundary. In this case, if the candidate position at the top right corner is inside the LCU, the candidate position at the top right corner can be used. The candidate position at the top right corner could be (x+width, y), (x+width-1, y), or (x+width, y-1).

[0283] In another possible implementation, the priority order of at least one initial candidate position can be set for each partitioning pattern, and then the LCU boundary of the current block can be checked sequentially.

[0284] In some embodiments, the method may further include:

[0285] For different partitioning modes, the priorities corresponding to different initial candidate positions in the initial candidate position set are set according to a preset priority order;

[0286] An initial candidate position is selected according to the preset priority order, and it is determined whether the selected initial candidate position exceeds the LCU boundary.

[0287] If the selected initial candidate position exceeds the LCU boundary, then return to the step of selecting an initial candidate position according to the preset priority order;

[0288] If the selected initial candidate position does not exceed the LCU boundary, then the selected initial candidate position is determined as a target candidate position of the current block.

[0289] In other words, different preset priority orders can be set for different partitioning modes. Taking partitioning mode 54 as an example (starting from 0), for partitioning mode 54, the priority order of the four initial candidate positions, namely the top left corner, top right corner, bottom left corner, and bottom right corner, can be set. For example, if the initial candidate position order is set to 3, 1, 2, 0, then the bottom right corner is selected first, followed by the top right corner, then the bottom left corner, and finally the top left corner; the judgment is performed in the above manner.

[0290] In another possible implementation, a fixed sorting order of at least one initial candidate position can be set for each partitioning pattern, and then the LCU boundary of the current block can be checked sequentially.

[0291] In some embodiments, the method may further include:

[0292] For different partitioning modes, the different initial candidate positions in the initial candidate position set are sorted according to a preset order;

[0293] An initial candidate position is selected according to the preset order, and it is determined whether the selected initial candidate position exceeds the LCU boundary.

[0294] If the selected initial candidate position exceeds the LCU boundary, then return to the step of selecting an initial candidate position according to the preset order;

[0295] If the selected initial candidate position does not exceed the LCU boundary, then the selected initial candidate position is determined as a target candidate position of the current block.

[0296] In other words, it can also be sorted according to a fixed preset order, such as 0, 1, 2, 3, 0, 1, ... If a certain partitioning mode first selects 3, that is, the bottom right corner, but the bottom right corner cannot fall inside the LCU (i.e., it exceeds the LCU boundary) but is located outside the current block; then select 0 to try again, that is, the top left corner. If 0 also does not meet the requirements, then select 1 to try again, that is, the top right corner, and so on, until all four initial candidate positions have been judged in turn.

[0297] Furthermore, if none of the four initial candidate positions fall inside the LCU but are located outside the current block, the position inside the current block at the first corner of the position sorting (such as a preset priority order or preset order) can be set as the target candidate position; or, if none of the four initial candidate positions fall inside the LCU but are located outside the current block, another approach is to select a default position, such as the top left corner of the current block, as the target candidate position.

[0298] Here, determining whether (x, y) and (x', y') are within the same LCU can be straightforward. Specifically, if the width of x divided by the luminance sample of the LCU is equal to the width of x' divided by the luminance sample of the LCU, and the height of y divided by the luminance sample of the LCU is equal to the height of y' divided by the luminance sample of the LCU, then (x, y) and (x', y') are within the same LCU; otherwise, (x, y) and (x', y') are not within the same LCU.

[0299] S504: Based on the at least one target candidate position, determine at least one temporal motion information of the current block.

[0300] It should be noted that after obtaining at least one target candidate position, temporal motion information can be determined based on the obtained target candidate position. Specifically, the motion information used by the temporal position in the corresponding reference frame is used as the temporal motion information of the target candidate position. Here, the frame to which the current block belongs can be referred to as the current frame. Although the target candidate position in the current frame and the temporal position in the reference frame belong to different frames, their positions are the same.

[0301] In some embodiments, for S504, determining at least one temporal motion information of the current block based on the at least one target candidate position may include:

[0302] Determine the reference frame information corresponding to each of the at least one target candidate locations;

[0303] For each target candidate position, the temporal position associated with the target candidate position is determined in the corresponding reference frame information, and the motion information used by the temporal position is determined as the temporal motion information corresponding to the target candidate position;

[0304] Based on the at least one target candidate position, at least one temporal motion information is obtained.

[0305] In other words, temporal motion information is determined based on the motion information used at a corresponding position in a specific reference frame. Furthermore, different temporal motion information can be obtained for different target candidate positions.

[0306] For example, in Method 1, taking the top left corner of the current block as an example, the steps for deriving motion information are as follows:

[0307] first step,

[0308] Assume the top-left corner brightness sample position of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the top-left corner brightness sample position of the selected current prediction unit is (x', y'), x' = x–1, y' = y–1.

[0309] If x' is less than the x-coordinate x_lcu_left of the leftmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x.

[0310] If y' is less than the ordinate y_lcu_top of the topmost luminance sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is less than the ordinate y_boundary_top of the topmost luminance sample position of the image or patch where the current prediction unit is located; then y' = y.

[0311] The second step,

[0312] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0313] otherwise,

[0314] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

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

[0316] The third step,

[0317]

[0318] Step 4

[0319] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0320]

[0321] Here, mvX is mvRef, and MVX is mvE0.

[0322] 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:

[0323]

[0324] Here, mvX is mvRef, and MVX is mvE1.

[0325] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0326] Method 2, taking the top right corner of the current block as an example, the steps to derive the motion information are as follows:

[0327] first step,

[0328] Assume the top-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; while the top-right luminance sample position of the selected current prediction unit is (x', y'), where x' = x + l_width and y' = y - 1.

[0329] If x' is greater than the x-coordinate x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x + l_width - 1;

[0330] If y' is less than the ordinate y_lcu_top of the topmost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is less than the ordinate y_boundary_top of the topmost brightness sample position of the image or patch where the current prediction unit is located; then y' = y.

[0331] The second step,

[0332] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the upper right corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0333] otherwise,

[0334] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0335] In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the upper right corner brightness sample position of the selected 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 to which the motion vector points is denoted as DistanceIndexRef.

[0336] The third step,

[0337]

[0338] Step 4

[0339] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0340]

[0341] Here, mvX is mvRef, and MVX is mvE0.

[0342] 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:

[0343]

[0344] Here, mvX is mvRef, and MVX is mvE1.

[0345] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0346] Method 3, taking the bottom left corner of the current block as an example, the steps to derive the motion information are as follows:

[0347] first step,

[0348] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower left corner brightness sample of the selected current prediction unit is (x', y'), x' = x-1, y' = y + l_height.

[0349] If x' is less than the x-coordinate x_l of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x' is unavailable, for example, if x' is less than the x-coordinate x_boundary_left of the leftmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x.

[0350] If y' is greater than the ordinate y_b of the bottommost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is greater than the ordinate y_boundary_bottom of the bottommost brightness sample position of the image or patch where the current prediction unit is located; then, y' = y + l_height - 1.

[0351] The second step,

[0352] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the lower left corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0353] otherwise,

[0354] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0355] In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the lower left corner brightness sample position of the selected 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.

[0356] The third step,

[0357]

[0358] Step 4

[0359] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0360]

[0361] Here, mvX is mvRef, and MVX is mvE0.

[0362] 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:

[0363]

[0364] Here, mvX is mvRef, and MVX is mvE1.

[0365] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0366] Method 4, taking the bottom right corner of the current block as an example, the steps to derive motion information are as follows:

[0367] first step,

[0368] Assume the position of the upper left corner brightness sample of the current prediction unit is (x, y), the width of the brightness prediction block is l_width, and the height of the brightness prediction block is l_height; while the position of the lower right corner brightness sample of the selected current prediction unit is (x', y'), x' = x + l_width, y' = y + l_height.

[0369] If x' is greater than the x-coordinate x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or if x' is unavailable, for example, if x' is greater than the x-coordinate x_boundary_right of the rightmost luminance sample position of the image or patch where the current prediction unit is located; then x' = x + l_width - 1;

[0370] If y' is greater than the ordinate y_lcu_bottom of the bottommost brightness sample position of the LCU where the current prediction unit is located, or y' is unavailable, for example, if y' is greater than the ordinate y_boundary_top of the bottommost brightness sample position of the image or patch where the current prediction unit is located; then y' = y + l_height - 1.

[0371] The second step,

[0372] If the reference frame index stored in the temporal motion information storage unit of the image with reference index value 0 in reference image queue 1, which corresponds to the brightness sample position of the lower right corner brightness sample of the selected 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 obtained L0 motion vector prediction value and L1 motion vector prediction value 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 export process.

[0373] otherwise,

[0374] The L0 and L1 reference indices of the current prediction unit are both equal to 0. The distance indices of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistances of the images corresponding to the L0 and L1 reference indices of the current prediction unit are denoted as BlockDistanceL0 and BlockDistanceL1, respectively.

[0375] 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 lower right corner of the selected 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.

[0376] The third step,

[0377]

[0378] Step 4

[0379] Set the L0 reference index RefIdxL0 of the current prediction unit to 0, and calculate the L0 motion vector mvE0(mvE0_x,mvE0_y) of the current prediction unit:

[0380]

[0381] Here, mvX is mvRef, and MVX is mvE0.

[0382] 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:

[0383]

[0384] Here, mvX is mvRef, and MVX is mvE1.

[0385] Fifth, the value of interPredRefMode is equal to 'PRED_List01'.

[0386] In this way, after exporting the time-domain motion information, the obtained time-domain motion information can be filled into the motion information candidate list to obtain a new motion information candidate list.

[0387] S505: Based on the at least one temporal motion information, construct a motion information candidate list.

[0388] It should be noted that after obtaining at least one temporal motion information, it can be filled into the motion information candidate list to obtain a new motion information candidate list. Specifically, for S505, this step may include: filling at least one temporal motion information into the motion information candidate list to obtain the new motion information candidate list.

[0389] It should also be noted that the existing motion information candidate list only reserves one position for filling time-domain motion information. To improve the relevance of the lower right corner, more positions for filling time-domain motion information can be added to the motion information candidate list. Specifically, in some embodiments, the method may further include:

[0390] Adjust the proportion of temporal motion information in the new motion information candidate list;

[0391] Based on the adjusted ratio, at least two positions for filling time-domain motion information are reserved in the new motion information candidate list.

[0392] In other words, the proportion of temporal motion information in the motion information candidate list can be increased. If at least one position is reserved for temporal motion information in the candidate list under AWP prediction mode, it can be adjusted so that at least two (or three) positions are reserved for temporal motion information in the candidate list under AWP prediction mode, so that at least two positions for temporal motion information are reserved in the new motion information candidate list.

[0393] In this way, after deriving the temporal motion information, a new candidate list of motion information can be constructed. The inter-frame prediction value for the current block is then determined based on this new candidate list.

[0394] S506: Determine the inter-frame prediction value of the current block based on the motion information candidate list.

[0395] It should be noted that when the prediction mode parameter indicates that a preset inter-frame prediction mode (such as GPM or AWP) is used to determine the inter-frame prediction value of the current block, the two partitions of the current block can be determined. That is, the method may also include: when the prediction mode parameter indicates that GPM or AWP is used to determine the inter-frame prediction value of the current block, determining the two partitions of the current block; wherein the two partitions include a first partition and a second partition.

[0396] It should also be noted that after obtaining the new list of motion information candidates, the motion information corresponding to the first partition and the motion information of the second partition of the current block can be determined; then, based on the motion information corresponding to the first partition and the motion information of the second partition, the inter-frame prediction value of the current block can be determined.

[0397] Specifically, such as Figure 7 The diagram illustrates a flowchart of another inter-frame prediction method provided in an embodiment of this application. This method may include:

[0398] S701: Parse the bitstream and determine the first motion information index value corresponding to the first partition and the second motion information index value corresponding to the second partition;

[0399] S702: Based on the motion information candidate list, determine the motion information in the motion information candidate list indicated by the first motion information index value as the motion information of the first partition, and determine the motion information in the motion information candidate list indicated by the second motion information index value as the motion information of the second partition;

[0400] S703: Calculate the first predicted value of the first partition using the motion information of the first partition, and calculate the second predicted value of the second partition using the motion information of the second partition;

[0401] S704: The first predicted value and the second predicted value are weighted and fused to obtain the inter-frame predicted value of the current block.

[0402] It's important to note that traditional unidirectional prediction simply finds a reference block of the same size as the current block, while traditional bidirectional prediction uses two reference blocks of the same size. The pixel value of each point within the predicted block is the average of the corresponding positions in the two reference blocks; that is, all points in each reference block occupy a 50% proportion. Bidirectional weighted prediction allows the proportions of the two reference blocks to differ, such as all points in the first reference block occupying a 75% proportion, and all points in the second reference block occupying a 25% proportion. However, the proportions of all points within the same reference block are the same. Other optimization methods, such as using Decoder-Side Motion Vector Refinement (DMVR) and Bidirectional Optical Flow (BIO), can cause some changes in the reference or predicted pixels. Furthermore, GPM or AWP also use two reference blocks of the same size as the current block, but some pixel positions use 100% of the pixel values ​​from the corresponding positions in the first reference block, and some pixel positions use 100% of the pixel values ​​from the corresponding positions in the second reference block. In the boundary regions, the pixel values ​​from the corresponding positions in the two reference blocks are used in a certain proportion. How these weights are specifically allocated is determined by the prediction mode of GPM or AWP, or it can be considered that GPM or AWP uses two reference blocks that are different from the current block size, that is, taking a portion of each block as a reference block.

[0403] For example, such as Figure 8A As shown, this illustration illustrates a weight allocation diagram of multiple partitioning modes of GPM on a 64×64 current block, provided by an embodiment of this application. Figure 8A In China, GPM has 64 possible partitioning methods. For example... Figure 8B As shown, this illustration illustrates the weight allocation diagram for various partitioning modes of an AWP on a 64×64 current block, provided by an embodiment of this application. Figure 8B In the context of AWP, there are 56 possible partitioning patterns. Regardless of... Figure 8A still Figure 8B In each partitioning mode, the black area represents the weight value of the position corresponding to the first reference block as 0%, the white area represents the weight value of the position corresponding to the first reference block as 100%, and the gray area represents a weight value of the position corresponding to the first reference block as greater than 0% and less than 100%, depending on the shade of the color. The weight value of the position corresponding to the second reference block is 100% minus the weight value of the position corresponding to the first reference block.

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

[0405] It should also be noted that GPM or AWP is an inter-frame prediction technique. GPM or AWP requires transmitting a flag in the bitstream indicating whether GPM or AWP is used. This flag indicates whether the current block uses GPM or AWP. If GPM or AWP is used, the encoder needs to transmit the specific mode used in the bitstream, i.e., one of the 64 partitioning modes of GPM or one of the 56 partitioning modes of AWP; and the index values ​​of two unidirectional motion information. In other words, for the current block, the decoder can obtain information about whether GPM or AWP is used by parsing the bitstream. If it is determined that GPM or AWP is used, the decoder can parse the prediction mode parameters of GPM or AWP and the two motion information index values. For example, if the current block can be divided into two partitions, then the first motion information index value corresponding to the first partition and the second motion information index value corresponding to the second partition can be parsed.

[0406] Before calculating the inter-frame prediction value for the current block, a new motion information candidate list needs to be constructed. The following uses AWP in AVS as an example to introduce the method of constructing the motion information candidate list.

[0407] like Figure 2BAs 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 2B .

[0408] for Figure 2B 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."

[0409] Assume the first unidirectional 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 unidirectional motion information follows the same pattern.

[0410] Since the motion information here is unidirectional, one of RefIdxAwp0L0 and RefIdxAwp0L1 must be a valid value, such as 0, 1, 2, etc.; 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.

[0411] Specifically, the steps for deriving mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, RefIdxAwp0L1, mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1 are as follows:

[0412] First step, such as Figure 2B As shown, F, G, C, A, B, and D are the neighboring blocks of the current block E. Determine the "availability" of F, G, C, A, B, and D:

[0413] (a) If F exists and inter-frame prediction mode is used, then F is “available”; otherwise, F is “unavailable”.

[0414] (b) If G exists and is in inter-frame prediction mode, then G is “available”; otherwise, G is “unavailable”.

[0415] (c) If C exists and is in inter-frame prediction mode, then C is “available”; otherwise, C is “unavailable”.

[0416] (d) If A exists and is in inter-frame prediction mode, then A is “available”; otherwise, A is “unavailable”.

[0417] (e) If B exists and is in inter-frame prediction mode, then B is “available”; otherwise, B is “unavailable”.

[0418] (f) If D exists and inter-frame prediction mode is used, then D is “available”; otherwise, D is “unavailable”.

[0419] The second step is to add the available unidirectional motion information into the unidirectional motion information candidate list (represented by AwpUniArray) in the order of F, G, C, A, B and D, until the length of AwpUniArray is 3 or the traversal ends.

[0420] 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 3 or the traversal ends.

[0421] The fourth step is to split the derived bidirectional motion information in the time domain 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 4 or the traversal ends.

[0422] Fifth step: If the length of AwpUniArray is less than 4, then repeat the filling operation on the last unidirectional motion information in AwpUniArray until the length of AwpUniArray is 4.

[0423] Step 6: 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.

[0424] In a recent standards meeting, the specific textual descriptions mentioned above were revised as follows.

[0425] First step, such as Figure 2B As shown, F, G, C, A, B, and D are the neighboring blocks of the current block E. Determine the "availability" of F, G, C, A, B, and D:

[0426] (a) If F exists and inter-frame prediction mode is used, then F is “available”; otherwise, F is “unavailable”.

[0427] (b) If G exists and uses inter-frame prediction mode and the motion information of G and F is different, then G is “available”; otherwise, G is “unavailable”.

[0428] (c) If C exists and uses inter-frame prediction mode and the motion information of C and G is different, then C is "available"; otherwise, C is "unavailable".

[0429] (d) If A exists and uses inter-frame prediction mode and the motion information of A and F is different, then A is “available”; otherwise, A is “unavailable”.

[0430] (e) If B exists and is in inter-frame prediction mode, then B is “available”; otherwise, B is “unavailable”.

[0431] (f) If D exists and uses inter-frame prediction mode, and the motion information of D and A are different, and the motion information of D and G are also different, then D is "available"; otherwise, D is "unavailable".

[0432] The second step is to put the available motion information into the motion candidate list AwpCandArray in the order of F, G, C, A, B and D, until the length of AwpCandArray is 4 or the traversal ends.

[0433] The third step is to put the derived bidirectional motion information in the time domain into the motion candidate list AwpCandArray.

[0434] Fourth step: If the length of AwpCandArray is less than 5, generate four motion information entries sequentially. The reference frame information for these four motion information entries is the same as the reference frame information for the first motion information entry in AwpCandArray. The motion vectors corresponding to List0 and List1 of the first motion information entry in AwpCandArray are denoted as (x, y). The motion vectors corresponding to the four generated motion information entries in the candidate lists are (x0, y0), (x1, y1), (x2, y2), and (x3, y3), respectively, calculated as follows:

[0435] x0=abs(x)<8?8:(abs(x)<=64?((abs(x)*5+2)>>2):(abs(x)<=128?((abs(x)*9+4)>>3):((abs(x)*33+16)>>5)))

[0436] x0 = x < 0? -x0:x0

[0437] y0=y

[0438] x1=x

[0439] y1=abs(y)<8?8:(abs(y)<=64?((abs(y)*5+2)>>2):(abs(y)<=128?((abs(y)*9+4)>>3):((abs(y)*33+16)>>5)))

[0440] y1 = y < 0? -y1:y1

[0441] x2=abs(x)<8?8:(abs(x)<=64?((abs(x)*3+2)>>2):(abs(x)<=128?((abs(x)*7+4)>>3):((abs(x)*31+16)>>5)))

[0442] x² = x < 0? -x²:x²

[0443] x² = abs(x) < 8? -x²:x²

[0444] y2=y

[0445] x3=x

[0446] y3=abs(y)<8?8:(abs(y)<=64?((abs(y)*3+2)>>2):(abs(y)<=128?((abs(y)*7+4)>>3):((abs(y)*31+16)>>5)))

[0447] y3 = y < 0? -y3:y3

[0448] y3=abs(y)<8? -y3:y3

[0449] The four newly generated motion information entries are added to AwpCandArray sequentially until the length of AwpCandArray is 5.

[0450] Fifth step, assign the information of a single motion from the (AwpCandIdx0+1)th motion candidate in AwpCandArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1:

[0451] (a) If AwpCandIdx0 is even, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List0 to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 equals zero, and RefIdxAwp0L1 equals -1; if the unidirectional motion information of List0 does not exist, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List1 to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 equals zero, and RefIdxAwp0L0 equals -1.

[0452] (b) If AwpCandIdx0 is odd, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List1 to mvAwp0L1 and RefIdxAwp0L1, where mvAwp0L0 equals zero and RefIdxAwp0L0 equals -1; if the unidirectional motion information of List1 does not exist, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List0 to mvAwp0L0 and RefIdxAwp0L0, where mvAwp0L1 equals zero and RefIdxAwp0L1 equals -1.

[0453] Step 6: Assign the information of a single motion from the (AwpCandIdx1+1)th motion candidate in AwpCandArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1:

[0454] (a) If AwpCandIdx1 is even, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List0 to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 equals zero, and RefIdxAwp1L1 equals -1; if the unidirectional motion information of List0 does not exist, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List1 to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 equals zero, and RefIdxAwp1L0 equals -1.

[0455] (b) If AwpCandIdx1 is odd, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List1 to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 equals zero, and RefIdxAwp1L0 equals -1; if the unidirectional motion information of List1 does not exist, assign the unidirectional motion information of the motion candidate pointing to the reference frame list List0 to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 equals zero, and RefIdxAwp1L1 equals -1.

[0456] Using the two unidirectional motion information determined by the above method, two reference blocks are found. 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.

[0457] Thus, for the current block, the decoder can obtain information on whether GPM or AWP is used by parsing the bitstream. If it is determined that GPM or AWP is used, the decoder can parse the prediction mode parameters of GPM or AWP and two motion information index values. The decoder constructs a candidate list of motion information used by GPM or AWP for the current block. Then, based on the two parsed motion information index values, two unidirectional motion information can be found in the newly constructed candidate list of motion information. Then, using these two unidirectional motion information, two reference blocks can be found. Based on the specific prediction mode used by GPM or AWP, the weight of the two reference blocks at each pixel position can be determined. Finally, the two reference blocks are weighted and calculated to obtain the prediction block of the current block.

[0458] Furthermore, if the current mode is skip mode, then the predicted block is the decoded block, meaning the decoding of the current block is complete. If the current mode is not skip mode, entropy decoding parses the quantization coefficients, followed by inverse quantization and inverse transform to obtain the residual block. Finally, the residual block is added to the predicted block to obtain the decoded block, meaning the decoding of the current block is complete.

[0459] Thus, the embodiments of this application limit the pixel positions used to derive temporal motion information to not exceed the LCU boundary of the current block, so that the hardware implementation does not increase the application scenario with additional bandwidth. In the embodiments of this application, the main methods adopted include: (1) setting all initial candidate positions inside the current block; (2) for a certain corner, if the initial candidate position falls outside the LCU, then it is preferred to adjust to a candidate position outside the current block but inside the LCU of that corner; (3) if the initial position of a certain corner falls outside the LCU, then it is adjusted to another corner whose initial position falls inside the LCU. Among them, most adopt the method of (2) so that the hardware implementation does not increase the additional bandwidth and maintains its compression performance as much as possible.

[0460] This embodiment provides an inter-frame prediction method applied to a decoder. The method involves parsing the bitstream to obtain prediction mode parameters for the current block. When the prediction mode parameters indicate that a preset inter-frame prediction mode should be used to determine the inter-frame prediction value of the current block, at least one initial candidate position for the current block is determined. If the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position for the current block. Based on the at least one target candidate position, at least one temporal motion information of the current block is determined. Based on the at least one temporal motion information, 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. Thus, after determining at least one initial candidate position for the current block, by adjusting the at least one initial candidate position so that the at least one target candidate position does not exceed the LCU boundary of the current block, the hardware implementation can be implemented without increasing additional bandwidth while ensuring encoding and decoding performance.

[0461] This application provides an inter-frame prediction method applied to a video encoding device, i.e., an encoder. The functionality of this method can be implemented by a computer program called by a second processor in the encoder. The computer program can be stored in a second memory; therefore, the encoder includes at least a second processor and a second memory.

[0462] See Figure 9 This illustrates a flowchart of another inter-frame prediction method according to an embodiment of this application. Figure 9 As shown, the method may include:

[0463] S901: Determine the prediction mode parameters for the current block;

[0464] It should be noted that the image to be encoded can be divided into multiple image blocks. The image block currently to be encoded can be called the current block, and the image blocks adjacent to the current block can be called neighboring blocks; that is, in the image to be encoded, the current block and neighboring blocks are adjacent. Here, each current block may include a first image component, a second image component, and a third image component; that is, the current block is the image block in the image to be encoded that currently needs to perform prediction of the first image component, the second image component, or the third image component.

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

[0466] It should also be noted that the prediction mode parameters indicate the prediction mode adopted by the current block and the parameters associated with that prediction mode. Here, the determination of the prediction mode parameters can employ a simple decision-making strategy, such as determining them based on the magnitude of the distortion value; or it can employ a complex decision-making strategy, such as determining them based on the results of Rate Distortion Optimization (RDO). This application embodiment does not impose any limitations. Generally speaking, the RDO method can be used to determine the prediction mode parameters of the current block.

[0467] Specifically, in some embodiments, for S901, determining the prediction mode parameters of the current block may include:

[0468] The current block is pre-encoded using multiple prediction modes to obtain the rate-distortion cost corresponding to each prediction mode.

[0469] Select the minimum rate distortion value from the multiple obtained rate distortion values, and determine the prediction mode corresponding to the minimum rate distortion value as the prediction mode parameter for the current block.

[0470] In other words, on the encoder side, multiple prediction modes can be used to pre-encode the current block. These multiple prediction modes typically include inter-frame prediction modes, traditional intra-frame prediction modes, and non-traditional intra-frame prediction modes. Traditional intra-frame prediction modes can include Direct Current (DC) mode, Planar mode, and Angle mode, while non-traditional intra-frame prediction modes can include Matrix-based Intra Prediction (MIP) mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode, and PLT (Palette) mode. Inter-frame prediction modes can include ordinary inter-frame prediction mode, GPM prediction mode, and AWP prediction mode.

[0471] In this way, after precoding the current block using multiple prediction modes, the rate-distortion cost corresponding to each prediction mode can be obtained. Then, the minimum rate-distortion cost is selected from the multiple obtained rate-distortion costs, and the prediction mode corresponding to the minimum rate-distortion cost is determined as the prediction mode parameter for the current block. Alternatively, after precoding the current block using multiple prediction modes, the distortion value corresponding to each prediction mode can be obtained. Then, the minimum distortion value is selected from the multiple obtained distortion values, and the prediction mode corresponding to the minimum distortion value is determined as the prediction mode parameter for the current block. Finally, the determined prediction mode parameter is used to encode the current block. Furthermore, this prediction mode results in a smaller prediction residual, improving coding efficiency.

[0472] S902: When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0473] It should be noted that if the prediction mode parameter indicates that a preset inter-frame prediction mode should be used to determine the inter-frame prediction value of the current block, the inter-frame prediction method provided in this application embodiment can be adopted. Here, the preset inter-frame prediction mode can be GPM prediction mode or AWP prediction mode, etc.

[0474] It should also be noted that motion information can include motion vector information and reference frame information. Furthermore, the reference frame information can be determined by a reference frame list and a reference index value.

[0475] In some embodiments, for S902, determining at least one initial candidate position of the current block may include:

[0476] Obtain at least one initial candidate position of the corner of the current block to form an initial candidate position set; wherein, the at least one initial candidate position of the corner includes at least one of the following: the upper left initial candidate position, the upper right initial candidate position, the lower left initial candidate position, and the lower right initial candidate position;

[0477] From the initial candidate position set, at least one initial candidate position of the current block is determined.

[0478] Furthermore, in some embodiments, the initial candidate position at the top left includes at least one of the following: a first candidate position at the top left, a second candidate position at the top left, a third candidate position at the top left, and a fourth candidate position at the top left;

[0479] The initial candidate position in the upper right corner includes at least one of the following: the first candidate position in the upper right corner, the second candidate position in the upper right corner, the third candidate position in the upper right corner, and the fourth candidate position in the upper right corner;

[0480] The initial candidate position in the lower left corner includes at least one of the following: the first candidate position in the lower left corner, the second candidate position in the lower left corner, the third candidate position in the lower left corner, and the fourth candidate position in the lower left corner;

[0481] The initial candidate position in the lower right corner includes at least one of the following: the first candidate position in the lower right corner, the second candidate position in the lower right corner, the third candidate position in the lower right corner, and the fourth candidate position in the lower right corner;

[0482] Wherein, the first top-left candidate position, the first top-right candidate position, the first bottom-left candidate position, and the first bottom-right candidate position represent the four corner positions inside the current block; the second top-left candidate position, the third top-left candidate position, and the fourth top-left candidate position represent the top-left corner position outside the current block; the second top-right candidate position, the third top-right candidate position, and the fourth top-right candidate position represent the top-right corner position outside the current block; the second bottom-left candidate position, the third bottom-left candidate position, and the fourth bottom-left candidate position represent the bottom-left corner position outside the current block; and the second bottom-right candidate position, the third bottom-right candidate position, and the fourth bottom-right candidate position represent the bottom-right corner position outside the current block.

[0483] It should be noted that, assuming the top-left corner of the current block, that is, the pixel position corresponding to the first pixel at the top left corner of the current block, is (x, y), the width of the current block is width, and the height of the current block is height. Furthermore, the width and height mentioned here usually refer to the width (l_width) and height (l_height) of the luminance component, but are not specifically limited thereto.

[0484] It should also be noted that, as mentioned above, the reference frame used to export temporal motion information stores the motion information exported by the temporal motion information in blocks. Therefore, the temporal motion information determined by a certain pixel position is the same as the temporal motion information determined by other pixel positions within the same storage block. Thus, during the export process, there may be some intermediate calculations that obtain a certain pixel position in a certain uniform format. As long as they are all within the same storage block, these positions can be considered the same.

[0485] by Figures 6A-6E For example, it provides several initial candidate positions. After obtaining the initial candidate position, it is necessary to determine whether the initial candidate position exceeds the LCU boundary of the current block in order to further determine how to handle the situation when the initial candidate position falls outside the LCU boundary.

[0486] S903: If the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block.

[0487] It should be noted that, in order to avoid adding extra bandwidth during hardware implementation, it is necessary to determine whether at least one initial candidate position used to determine the temporal motion information exceeds the LCU boundary of the current block.

[0488] In some embodiments, for S903, the method may further include: determining the at least one initial candidate position as at least one target candidate position of the current block if the at least one initial candidate position does not exceed the LCU boundary of the current block.

[0489] In other words, if an initial candidate position exceeds the LCU boundary, then the initial candidate position needs to be adjusted so that the adjusted target candidate position does not exceed the LCU boundary; if an initial candidate position does not exceed the LCU boundary, then the initial candidate position does not need to be adjusted and can be directly determined as the target candidate position.

[0490] In one possible implementation, candidate positions within the current block can be selected. In this case, none of the candidate positions exceed the LCU boundary of the current block, allowing them to be directly identified as target candidate positions. Therefore, in some embodiments, the method may further include:

[0491] If the at least one initial candidate position includes the first top-left candidate position, and / or the first top-right candidate position, and / or the first bottom-left candidate position, and / or the first bottom-right candidate position, then it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined as at least one target candidate position of the current block.

[0492] In another possible implementation, for a given corner, if the initial candidate position falls outside the LCU boundary, then it is preferred to adjust to a candidate position inside the LCU of that corner and outside the current block. Therefore, in some embodiments, the method may further include:

[0493] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0494] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0495] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the lower right corner position outside the current block, and the lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0496] Furthermore, the method may also include: if no candidate position that does not exceed the LCU boundary is selected from the lower right corner position outside the current block, then the initial lower right candidate position is adjusted to the lower right corner position inside the current block to obtain a target candidate position of the current block.

[0497] In other words, taking the bottom right corner as an example, if the initial candidate position in the bottom right corner exceeds the LCU boundary, then it is first adjusted to a candidate position inside the LCU in the bottom right corner but outside the current block; if no candidate position that does not exceed the LCU boundary is selected from the bottom right corner position outside the current block, then it needs to be adjusted to the bottom right corner position inside the current block to determine the corresponding target candidate position.

[0498] In another possible implementation, for a given corner, if the initial candidate position falls outside the LCU boundary, it can be adjusted to another candidate position where the initial position falls inside the LCU. Therefore, in some embodiments, the method may further include:

[0499] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners other than the one corner, and the initial candidate position of the one corner is adjusted to the selected candidate position to obtain a target candidate position of the current block.

[0500] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0501] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, then if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position for the current block.

[0502] In another possible implementation, for a given corner, if the initial candidate position falls outside the LCU boundary, and this corner can only be adjusted to the interior of the current block, then it can be adjusted to another candidate position for a corner whose initial position falls inside the LCU. Therefore, in some embodiments, the method may further include:

[0503] If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only the candidate position inside the current block does not exceed the LCU boundary, then a candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners other than the one corner, and the initial candidate position of the one corner is adjusted to the selected candidate position to obtain a target candidate position for the current block.

[0504] Furthermore, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:

[0505] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and among the lower right corner positions inside and outside the current block, only the first lower right candidate position does not exceed the LCU boundary, then if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position for the current block.

[0506] In another possible implementation, the method may also involve prioritizing at least one initial candidate position for each partitioning pattern, and then sequentially checking whether the LCU boundary of the current block is exceeded. Therefore, in some embodiments, the method may further include:

[0507] For different partitioning modes, the priorities corresponding to different initial candidate positions in the initial candidate position set are set according to a preset priority order;

[0508] An initial candidate position is selected according to the preset priority order, and it is determined whether the selected initial candidate position exceeds the LCU boundary.

[0509] If the selected initial candidate position exceeds the LCU boundary, then return to the step of selecting an initial candidate position according to the preset priority order;

[0510] If the selected initial candidate position does not exceed the LCU boundary, then the selected initial candidate position is determined as a target candidate position of the current block.

[0511] In other words, different preset priority orders can be set for different partitioning modes. Taking partitioning mode 54 as an example (starting from 0), for partitioning mode 54, the priority order of the four initial candidate positions, namely the top left corner, top right corner, bottom left corner, and bottom right corner, can be set. For example, if the initial candidate position order is set to 3, 1, 2, 0, then the bottom right corner is selected first, followed by the top right corner, then the bottom left corner, and finally the top left corner; the judgment is performed in the above manner.

[0512] In another possible implementation, a fixed sorting order can be set for at least one initial candidate position for each partitioning pattern, and then the LCU boundary of the current block can be checked sequentially. Therefore, in some embodiments, the method may further include:

[0513] For different partitioning modes, the different initial candidate positions in the initial candidate position set are sorted according to a preset order;

[0514] An initial candidate position is selected according to the preset order, and it is determined whether the selected initial candidate position exceeds the LCU boundary.

[0515] If the selected initial candidate position exceeds the LCU boundary, then return to the step of selecting an initial candidate position according to the preset order;

[0516] If the selected initial candidate position does not exceed the LCU boundary, then the selected initial candidate position is determined as a target candidate position of the current block.

[0517] In other words, it can also be sorted according to a fixed preset order, such as 0, 1, 2, 3, 0, 1, ... If a certain partitioning mode first selects 3, that is, the bottom right corner, but the bottom right corner cannot fall inside the LCU but is located outside the current block, then select 0 to try again, that is, the top left corner. If 0 also does not meet the requirements, then select 1 to try again, that is, the top right corner, and so on, until all four initial candidate positions have been judged in turn.

[0518] Furthermore, if none of the four initial candidate positions fall inside the LCU but are located outside the current block, the position inside the current block at the first corner of the position sorting (such as a preset priority order or preset order) can be set as the target candidate position; or, if none of the four initial candidate positions fall inside the LCU but are located outside the current block, another approach is to select a default position, such as the top left corner of the current block, as the target candidate position.

[0519] S904: Based on the at least one target candidate position, determine at least one temporal motion information of the current block.

[0520] It should be noted that after obtaining at least one target candidate position, temporal motion information can be determined based on the obtained target candidate position. Specifically, the motion information used by the temporal position in the corresponding reference frame is used as the temporal motion information of the target candidate position. Here, the frame to which the current block belongs can be referred to as the current frame. Although the target candidate position in the current frame and the temporal position in the reference frame belong to different frames, their positions are the same.

[0521] In some embodiments, for S904, determining at least one temporal motion information of the current block based on the at least one target candidate position may include:

[0522] Determine the reference frame information corresponding to each of the at least one target candidate locations;

[0523] For each target candidate position, the temporal position associated with the target candidate position is determined in the corresponding reference frame information, and the motion information used by the temporal position is determined as the temporal motion information corresponding to the target candidate position;

[0524] Based on the at least one target candidate position, at least one temporal motion information is obtained.

[0525] In other words, temporal motion information is determined based on the motion information used at a corresponding position in a specific reference frame. Furthermore, different temporal motion information can be obtained for different target candidate positions.

[0526] In this way, after deriving the time-domain motion information, the obtained time-domain motion information can be filled into the motion information candidate list to obtain a new motion information candidate list.

[0527] S905: Based on the at least one temporal motion information, construct a motion information candidate list.

[0528] It should be noted that after obtaining at least one temporal motion information, it can be added to the motion information candidate list to obtain a new motion information candidate list. Specifically, for S905, this step may include: adding at least one temporal motion information to the motion information candidate list to obtain the new motion information candidate list.

[0529] It should also be noted that the existing motion information candidate list only reserves one position for filling time-domain motion information. To improve the relevance of the lower right corner, more positions for filling time-domain motion information can be added to the motion information candidate list. Specifically, in some embodiments, the method may further include:

[0530] Adjust the proportion of temporal motion information in the new motion information candidate list;

[0531] Based on the adjusted ratio, at least two positions for filling time-domain motion information are reserved in the new motion information candidate list.

[0532] In other words, the proportion of temporal motion information in the motion information candidate list can be increased. If at least one position is reserved for temporal motion information in the candidate list under AWP prediction mode, it can be adjusted so that at least two (or three) positions are reserved for temporal motion information in the candidate list under AWP prediction mode, so that at least two positions for temporal motion information are reserved in the new motion information candidate list.

[0533] In this way, after deriving the temporal motion information, a new candidate list of motion information can be constructed. The inter-frame prediction value for the current block is then determined based on this new candidate list.

[0534] S906: Determine the inter-frame prediction value of the current block based on the motion information candidate list.

[0535] It should be noted that when the prediction mode parameter indicates that a preset inter-frame prediction mode (such as GPM or AWP) is used to determine the inter-frame prediction value of the current block, the two partitions of the current block can be determined. That is, the method may also include: when the prediction mode parameter indicates that GPM or AWP is used to determine the inter-frame prediction value of the current block, determining the two partitions of the current block; wherein the two partitions include a first partition and a second partition.

[0536] It should also be noted that after obtaining the new list of motion information candidates, the motion information corresponding to the first partition and the motion information of the second partition of the current block can be determined; then, based on the motion information corresponding to the first partition and the motion information of the second partition, the inter-frame prediction value of the current block can be determined.

[0537] Specifically, such as Figure 10 The diagram illustrates a flowchart of another inter-frame prediction method provided in an embodiment of this application. This method may include:

[0538] S1001: Based on the motion information candidate list, determine the motion information of the first partition and the motion information of the second partition;

[0539] S1002: Set the first motion information index value to the index number value of the motion information of the first partition in the motion information candidate list, and set the second motion information index value to the index number value of the motion information of the second partition in the motion information candidate list;

[0540] S1003: Calculate the first predicted value of the first partition using the motion information of the first partition, and calculate the second predicted value of the second partition using the motion information of the second partition;

[0541] S1004: The first predicted value and the second predicted value are weighted and fused to obtain the inter-frame predicted value of the current block.

[0542] Furthermore, in some embodiments, the method may further include:

[0543] Write the first motion information index value and the second motion information index value into the bitstream.

[0544] 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, dividing a rectangular block into two regions using a straight line. Depending on the line's position and angle, these two regions could be triangular, trapezoidal, or rectangular, allowing for partitioning closer to the object's edge or the edges of two moving regions. It's important to note that this partitioning isn't a true division in the strictest sense, but rather a division 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 transforms, and dequantizations treat the current block as a whole.

[0545] It should also be noted that GPM or AWP is a type of inter-frame prediction technology. On the encoder side, GPM or AWP needs to transmit a flag indicating whether GPM or AWP is used and two motion information index values ​​(such as the first motion information index value and the second motion information index value) in the bitstream. This way, the decoder side can directly obtain the flag indicating whether GPM or AWP is used and the two motion information index values ​​by parsing the bitstream.

[0546] In other words, for the current block, precoding with GPM or AWP, as well as other available prediction modes, can be attempted to determine whether to use GPM or AWP. If the precoding cost of GPM or AWP is the lowest, then GPM or AWP can be used. Simultaneously, while attempting to use GPM or AWP, a motion information candidate list can be constructed, in the same way as described in the decoder-side embodiment.

[0547] Thus, on the encoder side, two unidirectional motion information pieces are selected from the motion information candidate list, and then a mode is chosen from the GPM or AWP partitioning patterns for precoding to determine the precoding cost of GPM or AWP. One possible approach is to determine the cost of all possible combinations of unidirectional motion information candidates based on all possible GPM or AWP partitioning patterns, and then use the combination of the two unidirectional motion information pieces and the GPM or AWP partitioning pattern with the lowest cost as the final determined prediction mode for the two unidirectional motion information pieces and the GPM or AWP.

[0548] Finally, information regarding whether GPM or AWP is used is written into the bitstream. If GPM or AWP is determined to be used, the prediction mode parameters of GPM or AWP and two unidirectional motion information index values ​​are written into the bitstream. Thus, if the current mode is skip mode, the prediction block is also the coded block, meaning the encoding of the current block is complete. If the current mode is not skip mode, quantization coefficients also need to be written into the bitstream; these quantization coefficients are formed by subtracting the inter-frame prediction values ​​from the actual values ​​of the current block to obtain a residual block, which is then transformed and quantized. At this point, the encoding of the current block is complete. In other words, if the current mode is not skip mode, the current block needs to be subtracted from the inter-frame prediction block to obtain a residual block, which is then transformed, quantized, and entropy encoded. Subsequently, on the decoder side, for cases where the current mode is not skip mode, the quantization coefficients are parsed through entropy decoding, then dequantized and inverse transformed to obtain the residual block. Finally, the residual block is added to the prediction block to obtain the decoded block, meaning the decoding of the current block is complete.

[0549] This embodiment provides an inter-frame prediction method applied to an encoder. The method involves: determining prediction mode parameters for the current block; when the prediction mode parameters indicate using a preset inter-frame prediction mode to determine the inter-frame prediction value of the current block, determining at least one initial candidate position for the current block; if the at least one initial candidate position exceeds the maximum coding unit (LCU) boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position for the current block; based on the at least one target candidate position, determining at least one temporal motion information for the current block; constructing a new motion information candidate list based on the at least one temporal motion information; and determining the inter-frame prediction value for the current block based on the new motion information candidate list. Thus, after determining at least one initial candidate position for the current block, by adjusting the at least one initial candidate position so that the at least one target candidate position does not exceed the LCU boundary of the current block, the hardware implementation can be performed without increasing additional bandwidth while maintaining encoding and decoding performance.

[0550] Based on the same inventive concept as the foregoing embodiments, see [link to previous document]. Figure 11 This illustrates a schematic diagram of the composition structure of a decoder 110 provided in an embodiment of this application. Figure 11 As shown, the decoder 110 may include: a parsing unit 1101, a first determining unit 1102, a first adjusting unit 1103, a first constructing unit 1104, and a first prediction unit 1105; wherein,

[0551] The parsing unit 1101 is configured to parse the bitstream and obtain the prediction mode parameters of the current block;

[0552] The first determining unit 1102 is configured to determine at least one initial candidate position of the current block when the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using a preset inter-frame prediction mode.

[0553] The first adjustment unit 1103 is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block.

[0554] The first determining unit 1102 is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;

[0555] The first construction unit 1104 is configured to construct a new motion information candidate list based on the at least one temporal motion information;

[0556] The first prediction unit 1105 is configured to determine the inter-frame prediction value of the current block based on the new motion information candidate list.

[0557] In some embodiments, the first determining unit 1102 is further configured to determine the at least one initial candidate position as at least one target candidate position of the current block if the at least one initial candidate position does not exceed the LCU boundary of the current block.

[0558] In some embodiments, the first determining unit 1102 is further configured to obtain at least one initial candidate position of the current block to form an initial candidate position set; wherein the at least one initial candidate position of the corner includes at least one of the following: upper left initial candidate position, upper right initial candidate position, lower left initial candidate position and lower right initial candidate position; and to determine at least one initial candidate position of the current block from the initial candidate position set.

[0559] In some embodiments, the initial candidate position at the top left includes at least one of the following: a first candidate position at the top left, a second candidate position at the top left, a third candidate position at the top left, and a fourth candidate position at the top left;

[0560] The initial candidate position in the upper right corner includes at least one of the following: a first candidate position in the upper right corner, a second candidate position in the upper right corner, a third candidate position in the upper right corner, and a fourth candidate position in the upper right corner;

[0561] The initial candidate position in the lower left corner includes at least one of the following: a first candidate position in the lower left corner, a second candidate position in the lower left corner, a third candidate position in the lower left corner, and a fourth candidate position in the lower left corner;

[0562] The initial candidate position in the lower right corner includes at least one of the following: a first candidate position in the lower right corner, a second candidate position in the lower right corner, a third candidate position in the lower right corner, and a fourth candidate position in the lower right corner;

[0563] Wherein, the first top-left candidate position, the first top-right candidate position, the first bottom-left candidate position, and the first bottom-right candidate position represent the four corner positions inside the current block; the second top-left candidate position, the third top-left candidate position, and the fourth top-left candidate position represent the top-left corner position outside the current block; the second top-right candidate position, the third top-right candidate position, and the fourth top-right candidate position represent the top-right corner position outside the current block; the second bottom-left candidate position, the third bottom-left candidate position, and the fourth bottom-left candidate position represent the bottom-left corner position outside the current block; and the second bottom-right candidate position, the third bottom-right candidate position, and the fourth bottom-right candidate position represent the bottom-right corner position outside the current block.

[0564] In some embodiments, the first determining unit 1102 is further configured to determine that the at least one initial candidate position does not exceed the LCU boundary if the at least one initial candidate position includes the first upper left candidate position, and / or the first upper right candidate position, and / or the first lower left candidate position, and / or the first lower right candidate position, and / or the at least one initial candidate position is determined as at least one target candidate position of the current block.

[0565] In some embodiments, the first determining unit 1102 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain a target candidate position of the current block.

[0566] In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, and adjust the lower right initial candidate position to the selected candidate position to obtain a target candidate position of the current block.

[0567] Furthermore, the first determining unit 1102 is also configured to, if no candidate position not exceeding the LCU boundary is selected from the lower right corner position outside the current block, adjust the initial lower right candidate position to the lower right corner position inside the current block to obtain a target candidate position of the current block.

[0568] In some embodiments, the first determining unit 1102 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the remaining corners other than the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain a target candidate position of the current block.

[0569] In some embodiments, the first determining unit 1102 is further configured such that when the initial candidate position of one of the corners is the lower right initial candidate position, the method further includes:

[0570] If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, then if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position for the current block.

[0571] In some embodiments, the first determining unit 1102 is further configured to select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the remaining corners other than the corner, and adjust the initial candidate position of the corner to the selected candidate position to obtain a target candidate position of the current block if the at least one initial candidate position includes an initial candidate position of one of the corners, and the initial candidate position of the corner exceeds the LCU boundary, and only the candidate position inside the current block does not exceed the LCU boundary among the candidate positions corresponding to the candidate positions corresponding to the remaining corners other than the corner.

[0572] In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate position does not exceed the LCU boundary among the lower right corner positions inside and outside the current block, then, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block.

[0573] In some embodiments, see Figure 11 The decoder 110 may further include a first setting unit 1106 and a first judging unit 1107; wherein,

[0574] The first setting unit 1106 is configured to set the priority of different initial candidate positions in the initial candidate position set according to a preset priority order for different division modes.

[0575] The first judgment unit 1107 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, determine the selected initial candidate position as a target candidate position of the current block.

[0576] In some embodiments, the first setting unit 1106 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different partitioning modes;

[0577] The first judgment unit 1107 is further configured to select an initial candidate position according to the preset order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset order; if the selected initial candidate position does not exceed the LCU boundary, determine the selected initial candidate position as a target candidate position of the current block.

[0578] In some embodiments, the first adjustment unit 1103 is further configured to adjust the proportion of temporal motion information in the new motion information candidate list; and according to the adjusted proportion, control the reservation of at least two filling positions for temporal motion information in the new motion information candidate list.

[0579] In some embodiments, the first determining unit 1102 is further configured to determine reference frame information corresponding to each of the at least one target candidate positions; and for each target candidate position, determine a temporal position associated with the target candidate position in the corresponding reference frame information, and determine the motion information used by the temporal position as the temporal motion information corresponding to the target candidate position; and obtain at least one temporal motion information based on the at least one target candidate position.

[0580] In some embodiments, the preset inter-frame prediction mode includes: geometric partitioning prediction mode or angle-weighted prediction mode;

[0581] The first determining unit 1102 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using the preset inter-frame prediction mode; wherein the two partitions include a first partition and a second partition.

[0582] In some embodiments, the parsing unit 1101 is further configured to parse the bitstream and determine the first motion information index value corresponding to the first partition and the second motion information index value corresponding to the second partition;

[0583] The first determining unit 1102 is further configured to, based on the new motion information candidate list, determine the motion information in the new motion information candidate list indicated by the first motion information index value as the motion information of the first partition, and determine the motion information in the new motion information candidate list indicated by the second motion information index value as the motion information of the second partition;

[0584] The first prediction unit 1105 is further configured to calculate a first prediction value of the first partition using motion information of the first partition, calculate a second prediction value of the second partition using motion information of the second partition, and perform weighted fusion of the first prediction value and the second prediction value to obtain the inter-frame prediction value of the current block.

[0585] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0586] If the integrated unit is implemented as a software functional module and not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, 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 computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0587] Therefore, this application provides a computer storage medium applied to a decoder 110, which stores an inter-frame prediction program. When the inter-frame prediction program is executed by a first processor, it implements the method described on the decoder side in the foregoing embodiments.

[0588] Based on the composition of the decoder 110 and the computer storage medium described above, see [link to documentation]. Figure 12 This illustrates a specific hardware structure example of the decoder 110 provided in this application embodiment, which may include: a first communication interface 1201, a first memory 1202, and a first processor 1203; the various components are coupled together through a first bus system 1204. It is understood that the first bus system 1204 is used to implement the connection and communication between these components. In addition to a data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 12 The general designated all buses as the first bus system 1204. Among them,

[0589] The first communication interface 1201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0590] The first memory 1202 is used to store computer programs that can run on the first processor 1203;

[0591] The first processor 1203 is configured to, when running the computer program, execute:

[0592] Parse the bitstream to obtain the prediction mode parameters for the current block;

[0593] When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0594] If at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block;

[0595] Based on the at least one target candidate position, at least one temporal motion information of the current block is determined;

[0596] Based on the at least one temporal motion information, a new motion information candidate list is constructed;

[0597] Based on the new motion information candidate list, the inter-frame prediction value of the current block is determined.

[0598] It is understood that the first memory 1202 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 (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1202 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0599] The first processor 1203 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1203 or by software instructions. The first processor 1203 may 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 may 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 may reside 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 the first memory 1202. The first processor 1203 reads the information in the first memory 1202 and completes the steps of the above method in conjunction with its hardware.

[0600] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), DSP devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0601] Alternatively, as another embodiment, the first processor 1203 is further configured to execute the method described in any of the foregoing embodiments when running the computer program.

[0602] This embodiment provides a decoder, which may include a parsing unit, a first determining unit, a first adjusting unit, a first constructing unit, and a first predicting unit. In this decoder, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that at least one target candidate position does not exceed the LCU boundary of the current block. This allows for hardware implementation without increasing additional bandwidth while ensuring encoding and decoding performance.

[0603] Based on the same inventive concept as the foregoing embodiments, see [link to previous document]. Figure 13 This illustrates a schematic diagram of the composition structure of an encoder 130 provided in an embodiment of this application. Figure 13 As shown, the encoder 130 may include: a second determining unit 1301, a second adjusting unit 1302, a second constructing unit 1303, and a second prediction unit 1304; wherein,

[0604] The second determining unit 1301 is configured to determine the prediction mode parameters of the current block; and when 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, determine at least one initial candidate position of the current block.

[0605] The second adjustment unit 1302 is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block.

[0606] The second determining unit 1301 is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;

[0607] The second construction unit 1303 is configured to construct a new motion information candidate list based on the at least one temporal motion information;

[0608] The second prediction unit 1304 is configured to determine the inter-frame prediction value of the current block based on the new motion information candidate list.

[0609] In some embodiments, see Figure 13The encoder 130 may further include a precoding unit 1305, configured to precode the current block using multiple prediction modes to obtain the rate-distortion value corresponding to each prediction mode; and to select the minimum rate-distortion value from the multiple obtained rate-distortion values, and determine the prediction mode corresponding to the minimum rate-distortion value as the prediction mode parameter of the current block.

[0610] In some embodiments, the second determining unit 1301 is further configured to determine the at least one initial candidate position as at least one target candidate position of the current block if the at least one initial candidate position does not exceed the LCU boundary of the current block.

[0611] In some embodiments, the second determining unit 1301 is further configured to obtain at least one initial candidate position of the current block to form an initial candidate position set; wherein the at least one initial candidate position of the corner includes at least one of the following: upper left initial candidate position, upper right initial candidate position, lower left initial candidate position and lower right initial candidate position; and to determine at least one initial candidate position of the current block from the initial candidate position set.

[0612] In some embodiments, the initial candidate position at the top left includes at least one of the following: a first candidate position at the top left, a second candidate position at the top left, a third candidate position at the top left, and a fourth candidate position at the top left;

[0613] The initial candidate position in the upper right corner includes at least one of the following: a first candidate position in the upper right corner, a second candidate position in the upper right corner, a third candidate position in the upper right corner, and a fourth candidate position in the upper right corner;

[0614] The initial candidate position in the lower left corner includes at least one of the following: a first candidate position in the lower left corner, a second candidate position in the lower left corner, a third candidate position in the lower left corner, and a fourth candidate position in the lower left corner;

[0615] The initial candidate position in the lower right corner includes at least one of the following: a first candidate position in the lower right corner, a second candidate position in the lower right corner, a third candidate position in the lower right corner, and a fourth candidate position in the lower right corner;

[0616] Wherein, the first top-left candidate position, the first top-right candidate position, the first bottom-left candidate position, and the first bottom-right candidate position represent the four corner positions inside the current block; the second top-left candidate position, the third top-left candidate position, and the fourth top-left candidate position represent the top-left corner position outside the current block; the second top-right candidate position, the third top-right candidate position, and the fourth top-right candidate position represent the top-right corner position outside the current block; the second bottom-left candidate position, the third bottom-left candidate position, and the fourth bottom-left candidate position represent the bottom-left corner position outside the current block; and the second bottom-right candidate position, the third bottom-right candidate position, and the fourth bottom-right candidate position represent the bottom-right corner position outside the current block.

[0617] In some embodiments, the second determining unit 1301 is further configured to determine that the at least one initial candidate position does not exceed the LCU boundary if the at least one initial candidate position includes the first upper left candidate position, and / or the first upper right candidate position, and / or the first lower left candidate position, and / or the first lower right candidate position, and / or the at least one initial candidate position is determined as at least one target candidate position of the current block.

[0618] In some embodiments, the second determining unit 1301 is further configured to, if the at least one initial candidate position includes an initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain a target candidate position of the current block.

[0619] In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, and adjust the lower right initial candidate position to the selected candidate position to obtain a target candidate position of the current block.

[0620] Furthermore, the second determining unit 1301 is also configured to, if no candidate position not exceeding the LCU boundary is selected from the lower right corner position outside the current block, adjust the initial lower right candidate position to the lower right corner position inside the current block to obtain a target candidate position of the current block.

[0621] In some embodiments, the second determining unit 1301 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the remaining corners other than the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain a target candidate position of the current block.

[0622] In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, then, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block.

[0623] In some embodiments, the second determining unit 1301 is further configured to: if the at least one initial candidate position includes an initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only the candidate positions inside the current block do not exceed the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the remaining corners other than one of the corners, and adjust the initial candidate position of one of the corners to the selected candidate position to obtain a target candidate position of the current block.

[0624] In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate position among the lower right corner positions inside and outside the current block does not exceed the LCU boundary, then, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block.

[0625] In some embodiments, see Figure 13 The encoder 130 may further include a second setting unit 1306 and a second judging unit 1307; wherein,

[0626] The second setting unit 1306 is configured to set the priority of different initial candidate positions in the initial candidate position set according to a preset priority order for different division modes.

[0627] The second judgment unit 1307 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, determine the selected initial candidate position as a target candidate position of the current block.

[0628] In some embodiments, the second setting unit 1306 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different partitioning modes;

[0629] The second judgment unit 1307 is further configured to select an initial candidate position according to the preset order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset order; if the selected initial candidate position does not exceed the LCU boundary, determine the selected initial candidate position as a target candidate position of the current block.

[0630] In some embodiments, the second adjustment unit 1302 is further configured to adjust the proportion of temporal motion information in the new motion information candidate list; and according to the adjusted proportion, control the reservation of at least two filling positions for temporal motion information in the new motion information candidate list.

[0631] In some embodiments, the second determining unit 1301 is further configured to determine reference frame information corresponding to each of the at least one target candidate positions; and for each target candidate position, determine a temporal position associated with the target candidate position in the corresponding reference frame information, and determine the motion information used by the temporal position as the temporal motion information corresponding to the target candidate position; and obtain at least one temporal motion information based on the at least one target candidate position.

[0632] In some embodiments, the preset inter-frame prediction mode includes: geometric partitioning prediction mode or angle-weighted prediction mode;

[0633] The second determining unit 1301 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that the inter-frame prediction value of the current block is determined using the preset inter-frame prediction mode; wherein the two partitions include a first partition and a second partition.

[0634] In some embodiments, the second determining unit 1301 is further configured to determine the motion information of the first partition and the motion information of the second partition based on the new motion information candidate list, and set the first motion information index value as the index number value of the motion information of the first partition in the new motion information candidate list, and set the second motion information index value as the index number value of the motion information of the second partition in the new motion information candidate list;

[0635] The second prediction unit 1304 is further configured to calculate a first prediction value of the first partition using the motion information of the first partition, calculate a second prediction value of the second partition using the motion information of the second partition, and perform weighted fusion of the first prediction value and the second prediction value to obtain the inter-frame prediction value of the current block.

[0636] In some embodiments, see Figure 13 The encoder 130 may further include a writing unit 1308 configured to write the first motion information index value and the second motion information index value into the bit stream.

[0637] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional module.

[0638] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium applied to the encoder 130. The computer storage medium stores an inter-frame prediction program. When the inter-frame prediction program is executed by the second processor, it implements the method described on the encoder side in the aforementioned embodiment.

[0639] Based on the composition of the encoder 130 and the computer storage medium described above, see [link to documentation]. Figure 14 This illustrates a specific hardware structure example of the encoder 130 provided in this application embodiment, which may include: a second communication interface 1401, a second memory 1402, and a second processor 1403; the various components are coupled together through a second bus system 1404. It is understood that the second bus system 1404 is used to implement communication between these components. In addition to a data bus, the second bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 14The various buses are all labeled as the second bus system 1404. Among them,

[0640] The second communication interface 1401 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0641] The second memory 1402 is used to store computer programs that can run on the second processor 1403;

[0642] The second processor 1403 is configured to, when running the computer program, perform:

[0643] Determine the prediction mode parameters for the current block;

[0644] When the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined.

[0645] If at least one initial candidate position exceeds the boundary of the maximum coding unit (LCU) of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block;

[0646] Based on the at least one target candidate position, at least one temporal motion information of the current block is determined;

[0647] Based on the at least one temporal motion information, a new motion information candidate list is constructed;

[0648] Based on the new motion information candidate list, the inter-frame prediction value of the current block is determined.

[0649] Alternatively, as another embodiment, the second processor 1403 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0650] It is understood that the second memory 1402 has similar hardware functions to the first memory 1202, and the second processor 1403 has similar hardware functions to the first processor 1203; these will not be described in detail here.

[0651] This embodiment provides an encoder, which may include a second determining unit, a second adjusting unit, a second constructing unit, and a second predicting unit. In this encoder, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that at least one target candidate position does not exceed the LCU boundary of the current block. This enables the hardware implementation to achieve the same result without increasing additional bandwidth, while also ensuring encoding and decoding performance.

[0652] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0653] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0654] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0655] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0656] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0657] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0658] Industrial applicability

[0659] In this embodiment, after determining the prediction mode parameters of the current block, both the encoder and decoder determine at least one initial candidate position of the current block when the prediction mode parameters indicate that a preset inter-frame prediction mode should be used to determine the inter-frame prediction value of the current block. If the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block. Based on the at least one target candidate position, at least one temporal motion information of the current block is determined. Based on the at least one temporal motion information, a motion information candidate list is constructed, and then the inter-frame prediction value of the current block is determined. In this way, after determining at least one initial candidate position of the current block, by adjusting the at least one initial candidate position so that the at least one target candidate position does not exceed the LCU boundary of the current block, the hardware implementation can be implemented without increasing the additional bandwidth, while ensuring the encoding and decoding performance.

Claims

1. An inter prediction method applied to a decoder, the method comprising: parsing a bitstream to obtain a prediction mode parameter of a current block; determining at least one initial candidate position of the current block when the prediction mode parameter indicates that a preset inter prediction mode is used to determine an inter prediction value of the current block; adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block in a case that the at least one initial candidate position exceeds a maximum coding unit (LCU) boundary of the current block; determining at least one temporal motion information of the current block based on the at least one target candidate position; constructing a motion information candidate list based on the at least one temporal motion information; determining the inter prediction value of the current block according to the motion information candidate list; wherein the determining the at least one initial candidate position of the current block comprises: obtaining a bottom-right initial candidate position of the current block; determining the at least one initial candidate position of the current block according to the bottom-right initial candidate position; wherein the bottom-right initial candidate position comprises a first bottom-right candidate position, a second bottom-right candidate position, a third bottom-right candidate position and a fourth bottom-right candidate position, the first bottom-right candidate position representing a bottom-right corner position inside the current block, and the second bottom-right candidate position, the third bottom-right candidate position and the fourth bottom-right candidate position representing bottom-right corner positions outside the current block; wherein the method further comprises: determining the at least one initial candidate position as the at least one target candidate position of the current block in a case that the at least one initial candidate position does not exceed the LCU boundary of the current block.

2. The method of claim 1, wherein, The method further comprises: if the at least one initial candidate position comprises an initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting a candidate position not exceeding the LCU boundary from candidate positions corresponding to the one corner, and adjusting the initial candidate position of the one corner to the selected candidate position to obtain a target candidate position of the current block.

3. The method of claim 2, wherein, if the at least one initial candidate position comprises the bottom-right initial candidate position and the bottom-right initial candidate position exceeds the LCU boundary, selecting a candidate position not exceeding the LCU boundary from bottom-right corner positions outside the current block, and adjusting the bottom-right initial candidate position to the selected candidate position to obtain a target candidate position of the current block. The method further comprises:

4. The method of claim 3, wherein, if no candidate position not exceeding the LCU boundary is selected from the bottom-right corner positions outside the current block, adjusting the bottom-right initial candidate position to a bottom-right corner position inside the current block to obtain a target candidate position of the current block. The determining the at least one temporal motion information of the current block based on the at least one target candidate position comprises:

5. The method of claim 1, wherein, determining reference frame information corresponding to each target candidate position in the at least one target candidate position. ​ For each target candidate position, a time domain position associated with the target candidate position is determined in corresponding reference frame information, and time domain motion information corresponding to the target candidate position is determined according to motion information used by the time domain position; At least one time domain motion information is determined based on the at least one target candidate position.

6. The method of claim 1, wherein, The preset inter prediction mode includes an angular weighted prediction mode.

7. The method of claim 1, wherein, The method further includes: Two partitions of the current block are determined; wherein the two partitions include a first partition and a second partition, and motion information of the first partition and the second partition is different.

8. The method of claim 7, wherein, The method further includes: A bitstream is parsed to determine a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition; Motion information of the first partition is determined according to motion information in the motion information candidate list indicated by the first motion information index value, and motion information of the second partition is determined according to motion information in the motion information candidate list indicated by the second motion information index value; A first prediction value of the first partition is calculated using the motion information of the first partition, and a second prediction value of the second partition is calculated using the motion information of the second partition; The first prediction value and the second prediction value are fused by weighting to obtain an inter prediction value of the current block.

9. An inter prediction method applied to an encoder, the method comprising: determining a prediction mode parameter of a current block; when the prediction mode parameter indicates that an inter prediction value of the current block is determined using a preset inter prediction mode, determining at least one initial candidate position of the current block; in a case where the at least one initial candidate position exceeds a maximum coding unit (LCU) boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block; determining at least one time domain motion information of the current block based on the at least one target candidate position; constructing a motion information candidate list based on the at least one time domain motion information; determining an inter prediction value of the current block according to the motion information candidate list; wherein the determining the at least one initial candidate position of the current block comprises: obtaining a bottom-right initial candidate position of the current block; determining the at least one initial candidate position of the current block according to the bottom-right initial candidate position; wherein the bottom-right initial candidate position includes a first bottom-right candidate position, a second bottom-right candidate position, a third bottom-right candidate position, and a fourth bottom-right candidate position, the first bottom-right candidate position represents a bottom-right corner position inside the current block, and the second bottom-right candidate position, the third bottom-right candidate position, and the fourth bottom-right candidate position represent bottom-right corner positions outside the current block; wherein the method further comprises: in a case where the at least one initial candidate position does not exceed the LCU boundary of the current block, determining the at least one initial candidate position as at least one target candidate position of the current block.

10. The method of claim 9, wherein, The method further comprises: If the at least one initial candidate position includes an initial candidate position of one corner, and the initial candidate position of the one corner exceeds the LCU boundary, a candidate position not exceeding the LCU boundary is selected from candidate positions corresponding to the one corner, and the initial candidate position of the one corner is adjusted to the selected candidate position to obtain a target candidate position of the current block.

11. The method of claim 10, wherein, When the initial candidate position of the one corner is the bottom-right initial candidate position, the method further comprises: If the at least one initial candidate position includes the bottom-right initial candidate position, and the bottom-right initial candidate position exceeds the LCU boundary, a candidate position not exceeding the LCU boundary is selected from a bottom-right corner position outside the current block, and the bottom-right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.

12. The method of claim 11, wherein, The method further comprises: If no candidate position not exceeding the LCU boundary is selected from the bottom-right corner position outside the current block, the bottom-right initial candidate position is adjusted to a bottom-right corner position inside the current block to obtain a target candidate position of the current block.

13. The method of claim 9, wherein, The determining of the at least one temporal motion information of the current block based on the at least one target candidate position comprises: determining reference frame information corresponding to each target candidate position in the at least one target candidate position; for each target candidate position, determining a temporal position associated with the target candidate position in the corresponding reference frame information, and determining temporal motion information corresponding to the target candidate position according to motion information used by the temporal position; corresponding to the at least one target candidate position, obtaining at least one temporal motion information.

14. The method of claim 9, wherein, The preset inter prediction mode includes an angular weighted prediction mode.

15. The method of claim 9, wherein, The method further comprises: determining two partitions of the current block; wherein the two partitions include a first partition and a second partition, and motion information of the first partition and the second partition is different.

16. The method of claim 15, wherein, The determining of the inter prediction value of the current block according to the motion information candidate list comprises: based on the motion information candidate list, determining motion information of the first partition and motion information of the second partition, setting a first motion information index value as an index sequence value of the motion information of the first partition in the motion information candidate list, and setting a second motion information index value as an index sequence value of the motion information of the second partition in the motion information candidate list; calculating a first prediction value of the first partition by using the motion information of the first partition, and calculating a second prediction value of the second partition by using the motion information of the second partition; performing weighted fusion on the first prediction value and the second prediction value to obtain the inter prediction value of the current block.

17. The method of claim 16, wherein, The method further comprises: writing the first motion information index value and the second motion information index value into a bitstream.

18. A decoder, comprising a parsing unit, a first determining unit, a first adjusting unit, a first constructing unit and a first predicting unit; wherein, The parsing unit is configured to parse a code stream and acquire a prediction mode parameter of a current block. The first determining unit is configured to determine at least one initial candidate position of the current block when the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine an inter-frame prediction value of the current block. The first adjusting unit is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds a maximum coding unit (LCU) boundary of the current block. The first determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position. The first constructing unit is configured to construct a motion information candidate list based on the at least one temporal motion information. The first predicting unit is configured to determine the inter-frame prediction value of the current block according to the motion information candidate list. The first determining unit is further configured to acquire a right-bottom initial candidate position of the current block, and determine at least one initial candidate position of the current block according to the right-bottom initial candidate position, wherein the right-bottom initial candidate position includes a first right-bottom candidate position, a second right-bottom candidate position, a third right-bottom candidate position and a fourth right-bottom candidate position, the first right-bottom candidate position represents a right-bottom corner position inside the current block, and the second right-bottom candidate position, the third right-bottom candidate position and the fourth right-bottom candidate position represent right-bottom corner positions outside the current block. The first determining unit is further configured to determine the at least one initial candidate position as at least one target candidate position of the current block when the at least one initial candidate position does not exceed the LCU boundary of the current block.

19. A decoder, comprising a first memory and a first processor; wherein the first memory is configured to store a computer program capable of running on the first processor; and the first processor is configured to execute the method in any one of claims 1 to 8 when running the computer program.

20. An encoder, comprising a second determining unit, a second adjusting unit, a second constructing unit and a second predicting unit; wherein the second determining unit is configured to determine a prediction mode parameter of a current block, and determine at least one initial candidate position of the current block when the prediction mode parameter indicates that a preset inter-frame prediction mode is used to determine an inter-frame prediction value of the current block; the second adjusting unit is configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block when the at least one initial candidate position exceeds a maximum coding unit (LCU) boundary of the current block; the second determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position; the second constructing unit is configured to construct a motion information candidate list based on the at least one temporal motion information; and the second predicting unit is configured to determine the inter-frame prediction value of the current block according to the motion information candidate list. ​ ​ ​ The second prediction unit is configured to determine an inter prediction value of the current block according to the motion information candidate list. The second determination unit is further configured to obtain a bottom-right initial candidate position of the current block; and determine at least one initial candidate position of the current block according to the bottom-right initial candidate position. The bottom-right initial candidate position includes a first bottom-right candidate position, a second bottom-right candidate position, a third bottom-right candidate position and a fourth bottom-right candidate position. The first bottom-right candidate position represents a bottom-right corner position inside the current block, and the second bottom-right candidate position, the third bottom-right candidate position and the fourth bottom-right candidate position represent bottom-right corner positions outside the current block. The second determination unit is further configured to determine the at least one initial candidate position as at least one target candidate position of the current block in a case that the at least one initial candidate position does not exceed a LCU boundary of the current block.

21. An encoder, comprising a second memory and a second processor; wherein: the second memory is configured to store a computer program capable of running on the second processor; 22. A computer storage medium, wherein, the second processor is configured to execute the method in any one of claims 9 to 17 when running the computer program.

23. A method of transmitting a bitstream, the method comprising: The computer storage medium stores a computer program, which is executed by the first processor to implement the method in any one of claims 1 to 8, or executed by the second processor to implement the method in any one of claims 9 to 17. The method in any one of claims 9 to 17 is executed to generate a code stream; and the code stream is transmitted.

Citation Information

Patent Citations

  • Method for deriving a temporal predictive motion vector, and apparatus using the method

    CN103430550A

  • Inter prediction method, encoder, decoder and computer storage medium

    CN113840148A

  • Inter prediction method, encoder, decoder and computer storage medium

    CN114930838A