CN116471418A - Inter prediction method, encoder, decoder, and computer storage medium - Google Patents

Inter prediction method, encoder, decoder, and computer storage medium Download PDF

Info

Publication number
CN116471418A
CN116471418A CN202310245097.1A CN202310245097A CN116471418A CN 116471418 A CN116471418 A CN 116471418A CN 202310245097 A CN202310245097 A CN 202310245097A CN 116471418 A CN116471418 A CN 116471418A
Authority
CN
China
Prior art keywords
candidate position
current block
motion information
initial candidate
initial
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310245097.1A
Other languages
Chinese (zh)
Inventor
杨宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Publication of CN116471418A publication Critical patent/CN116471418A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/42Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by implementation details or hardware specially adapted for video compression or decompression, e.g. dedicated software implementation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding

Abstract

The embodiment of the application discloses an inter prediction method, an encoder, a decoder and a computer storage medium, which are applied to the decoder, wherein the method comprises the following steps: analyzing the code stream to obtain the prediction mode parameter of the current block; determining at least one initial candidate position of the 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; adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 time domain motion information; and determining an inter prediction value of the current block according to the motion information candidate list.

Description

Inter prediction method, encoder, decoder, and computer storage medium
Cross Reference to Related Applications
The present application is a divisional application of PCT international patent application PCT/CN2021/089252, with application date 2021, 4, 23, entering the chinese national stage, chinese patent application No. 202180008725.3, entitled "inter prediction method, encoder, decoder and computer storage medium", which claims priority from chinese patent office, application No. 202010591597.7, application entitled "inter prediction method, encoder, decoder and computer storage medium", filed 24, 06, 2020. The entire contents of the above application are incorporated by reference into the present application.
Technical Field
The present disclosure relates to the field of video encoding and decoding technologies, and in particular, to an inter-frame prediction method, an encoder, a decoder, and a computer storage medium.
Background
In the field of video encoding and decoding, the process of encoding and decoding a current block may use an inter-frame prediction mode in addition to an intra-frame prediction mode. Inter prediction may include inter geometric partition prediction modes (Geometric Partitioning Mode, GPM), angle weighted prediction modes (Angular Weighted Prediction, AWP), and the like, and the prediction value of the current block can be obtained by dividing the current block between frames into two non-rectangular partitions (or two blocks) and performing weighted fusion after prediction.
Currently, in the prediction process of GPM or AWP, the temporal motion information is derived from the encoded reference frame, which is no longer limited to the upper left corner of the current block. For three positions, i.e., upper right, lower left, lower right, etc., all are outside the current block, if a certain position is not available, e.g., beyond an image boundary, a slice (patch) boundary, etc., then the position is adjusted to be the inner position of the current block. However, for the largest coding unit (Largest Coding Unit, LCU) of the current block, only motion information for one LCU-sized portion of the same location as the current LCU is currently cached. If the right boundary of the current block exactly coincides with the right boundary of the current LCU, or the lower boundary of the current block exactly coincides with the lower boundary of the current LCU, then at least one of the three positions on the right, lower left, and lower right exceeds the boundary of the current LCU, at which time if one or more of the positions are still within the image or within the patch, the representation is still available, and at which time the hardware needs to add additional bandwidth to obtain motion information for the one or more of the positions.
Disclosure of Invention
The application provides an inter-frame prediction method, an encoder, a decoder and a computer storage medium, which can ensure that extra bandwidth is not increased when hardware is realized, and meanwhile, the encoding and decoding performance can be ensured.
The technical scheme of the application is realized as follows:
in a first aspect, an embodiment of the present application provides an inter prediction method, applied to a decoder, including:
analyzing the code stream to obtain the prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information;
and determining the inter prediction value of the current block according to the new motion information candidate list.
In a second aspect, an embodiment of the present application provides an inter prediction method, applied to an encoder, including:
determining a prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information;
and determining the inter prediction value of the current block according to the new motion information candidate list.
In a third aspect, an embodiment of the present application provides a decoder, including an parsing unit, a first determining unit, a first adjusting unit, a first constructing unit, and a first predicting unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
the analysis unit is configured to analyze the code stream and acquire the prediction mode parameters of the 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 an inter prediction value of the current block is determined using a preset inter prediction mode;
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 under the condition that the at least one initial candidate position exceeds the maximum coding unit (LCU) boundary of the current block;
the first determining unit is further configured to determine at least one time domain motion information of the current block based on the at least one target candidate position;
the first construction unit is configured to construct a new motion information candidate list based on the at least one piece of time domain motion information;
the first prediction unit is configured to determine an inter prediction value of the current block according to the new motion information candidate list.
In a fourth aspect, embodiments of the present application provide a decoder including a first memory and a first processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the first memory is used for storing a computer program capable of running on the first processor;
The first processor is configured to perform the method according to the first aspect when the computer program is run.
In a fifth aspect, embodiments of the present application provide an encoder including a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
the second determining unit is configured to determine a prediction mode parameter of the current block; and determining at least one initial candidate position of the 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;
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 under the condition that the at least one initial candidate position exceeds the 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 construction unit is configured to construct a new motion information candidate list based on the at least one piece of time domain motion information;
The second prediction unit is configured to determine an inter prediction value of the current block according to the new motion information candidate list.
In a sixth aspect, embodiments of the present application provide an encoder comprising a second memory and a second processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the second memory is used for storing a computer program capable of running on the second processor;
the second processor is configured to perform the method according to the second aspect when the computer program is run.
In a seventh aspect, embodiments of the present application provide a computer storage medium storing a computer program which when executed by a first processor implements the method according to the first aspect or when executed by a second processor implements the method according to the second aspect.
The inter-frame prediction method, the encoder, the decoder and the computer storage medium provided by the embodiment of the application analyze the code stream to obtain the prediction mode parameters of the current block; determining at least one initial candidate position of the 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; adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information; and determining the inter prediction value of the current block according to the new motion information candidate list. In this way, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby enabling hardware implementation without adding additional bandwidth, and ensuring codec performance.
Drawings
Fig. 1 is a schematic structural diagram of a typical image group according to an embodiment of the present application;
fig. 2A is a schematic diagram of a spatial positional relationship between a current block and an adjacent block according to an embodiment of the present application;
fig. 2B is a schematic diagram of a spatial positional relationship between a current block and an adjacent block according to another embodiment of the present disclosure;
fig. 3 is a schematic diagram of spatial positional relationship of a sheet structure according to an embodiment of the present application;
fig. 4A is a schematic block diagram of a video coding system according to an embodiment of the present application;
fig. 4B is a schematic block diagram of a video decoding system according to an embodiment of the present application;
fig. 5 is a flowchart of an inter prediction method according to an embodiment of the present application;
FIG. 6A is a schematic diagram of an initial candidate position according to an embodiment of the present disclosure;
FIG. 6B is a schematic diagram of another initial candidate position according to an embodiment of the present disclosure;
FIG. 6C is a schematic diagram of another initial candidate position according to an embodiment of the present disclosure;
FIG. 6D is a schematic diagram of another initial candidate position according to an embodiment of the present disclosure;
FIG. 6E is a schematic diagram of another initial candidate position according to an embodiment of the present disclosure;
Fig. 7 is a flowchart of another inter prediction method according to an embodiment of the present application;
FIG. 8A is a schematic diagram of weight distribution of multiple partitioning modes of a GPM on a 64×64 current block according to an embodiment of the present application;
fig. 8B is a schematic diagram of weight distribution of multiple partitioning modes of AWP on a 64×64 current block according to an embodiment of the present application;
fig. 9 is a flowchart of yet another inter prediction method according to an embodiment of the present application;
fig. 10 is a flowchart of still another inter prediction method according to an embodiment of the present application;
fig. 11 is a schematic diagram of a composition structure of a decoder according to an embodiment of the present application;
fig. 12 is a schematic hardware structure of a decoder according to an embodiment of the present application;
fig. 13 is a schematic diagram of a composition structure of an encoder according to an embodiment of the present application;
fig. 14 is a schematic hardware structure of an encoder according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting of the application. It should be noted that, for convenience of description, only a portion related to the related application is shown in the drawings.
In video images, a first image component, a second image component and a third image component are generally adopted to represent a Current Block (CB); wherein the three image components are a luminance component, a blue chrominance component and a red chrominance component, respectively, and in particular, the luminance component is generally represented by the symbol Y, the blue chrominance component is generally represented by the symbol Cb or U, and the red chrominance component is generally represented by the symbol Cr or V; thus, the video image may be represented in YCbCr format or YUV format.
Currently, the common video codec standard is based on a hybrid coding framework that is all block-based. Each frame in the video image is partitioned into square maximum Coding units (Largest Coding Unit, LCU) of the same size (e.g., 128×128, 64×64, etc.), each maximum Coding Unit may also be partitioned into rectangular Coding Units (CU) according to rules; but the coding Unit may also be divided into smaller Prediction Units (PU). Specifically, the hybrid Coding framework may include modules such as prediction, transform (Transform), quantization (Quantization), entropy Coding (Entropy Coding), and Loop filtering (In Loop Filter); among other things, the prediction module may include intra prediction (intra prediction) and inter prediction (inter prediction), and the inter prediction may include motion estimation (motion estimation) and motion compensation (motion compensation). Because of the strong correlation between adjacent pixels in one frame of the video image, the spatial redundancy between the adjacent pixels can be eliminated by using an intra-frame prediction mode in the video encoding and decoding technology; however, since there is also a strong similarity between adjacent frames in the video image, temporal redundancy between adjacent frames is eliminated by using an inter-frame prediction method in the video encoding and decoding technique, so that the encoding efficiency can be improved. The following application will describe in detail the inter prediction.
It should be noted that the Motion information may include Motion Vector (MV) information and reference frame information. Specifically, for a current block using inter prediction, the current frame in which the current block is located has one or more reference frames, and the current block may be a coding unit or a prediction unit, a motion information including a set of motion vectors and reference frame information may be used to indicate to a pixel region having the same size as the current block in a certain reference frame, which is referred to herein as a reference block, or a motion information including two sets of motion vectors and reference frame information may be used to indicate to two reference blocks in a certain two reference frames, which may be the same or different; the motion compensation may then derive an inter prediction value of the current block from the reference block indicated by the motion information.
It should be understood that a P Frame (Predictive Frame) is a Frame that can be predicted only using a reference Frame that precedes the current Frame in picture order (Picture Order Count, POC). At this time, the current reference frame only has one reference frame list, which is represented by RefPicList 0; and RefPicList0 is the reference frame for POC before the current frame. The B frame (Bi-directional Interpolated Prediction Frame) is a frame that can be predicted early using a reference frame with POC before the current frame and a reference frame with POC after the current frame. The B frame has two reference frame lists, which are respectively represented by RefPicList0 and RefPicList1; wherein, refPicList0 is the reference frame before the current frame, refPicList1 is the reference frame after the current frame. For the current block, only a reference block of a certain frame in RefPicList0 may be referred to, which may be referred to as forward prediction; or may refer to only a reference block of a certain frame in RefPicList1, which may be referred to as backward prediction; or may also refer to the reference block of a certain frame in RefPicList0 and the reference block of a certain frame in RefPicList1 at the same time, which may be referred to as bi-prediction. One simple way to reference both reference blocks simultaneously is to average the pixels at each corresponding position within both reference blocks to obtain an inter prediction value (or may be referred to as a prediction block) for each pixel within the current block. The later B frames no longer limit the reference frames of RefPicList0 that are all POC before the current frame, and RefPicList1 that are all POC reference frames after the current frame. In other words, there may be a reference frame in RefPicList0 that is subsequent to the current frame with a POC, and there may be a reference frame in RefPicList1 that is prior to the current frame with a POC, that is, the current block may refer to a reference frame that is subsequent to the current frame with a POC or to a reference frame that is subsequent to the current frame with a POC at the same time. But the reference frames used when the current block is bi-directionally predicted must be one from RefPicList0 and one from RefPicList1; such B frames are also referred to as generalized B frames.
Since the coding and decoding order of Random Access (RA) configuration is different from the POC order, the B frame can refer to the information before the current frame and the information after the current frame at the same time, and coding performance can be improved obviously. Illustratively, a classical group of pictures (Group Of Pictures, GOP) structure of RA is shown in fig. 1, in which fig. 1, the arrow indicates the reference relationship, since no reference frame is needed for an I-frame, then after POC 0I-frame decoding, POC 4P-frame will be decoded, and POC 0I-frame can be referenced when POC 4P-frame is decoded. After decoding the P frame of POC 4, then decoding the B frame of POC 2, and when decoding the B frame of POC 2, the I frame of POC 0 and the P frame of POC 4 may be referred to, and so on. As described above, 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}, as can be seen from fig. 1.
In addition, the codec sequence of the Low Delay (LD) configuration is the same as the POC sequence, and the current frame can only refer to the information before the current frame. The Low Delay configuration is divided into Low Delay P and Low Delay B. Low Delay P is a conventional Low Delay configuration. The typical structure is IPPP … …, i.e. one I frame is first encoded and decoded, and then P frames are all decoded. The typical structure of Low Delay B is IBBB … …, which differs from Low Delay P in that each inter frame is a B-frame, i.e. using two reference frame lists, the current block can reference both the reference block of a certain frame in RefPicList0 and the reference block of a certain frame in RefPicList 1. Here, a reference frame list of the current frame may have at most several reference frames, such as 2, 3, or 4, etc. When a certain current frame is encoded or decoded, which of the reference frames within RefPicList0 and RefPicList1 are each determined by a preset configuration or algorithm, but the same reference frame may occur in RefPicList0 and RefPicList1 at the same time, i.e., the encoder or decoder allows the current block to reference two reference blocks in the same reference frame at the same time.
In embodiments of the present application, an encoder or decoder may generally use index values (represented by index) in a list of reference frames to correspond to the reference frames. If a reference frame list is 4 in length, then index has four values of 0, 1, 2, 3, etc. For example, if RefPicList0 of the current frame has 4 reference frames with POC 5,4,3,0, index 0 of RefPicList0 is a reference frame of POC 5, index1 of RefPicList0 is a reference frame of POC 4, index 2 of RefPicList0 is a reference frame of POC 3, and index 3 of RefPicList0 is a reference frame of POC 0.
In the current standard of multifunctional video coding (Versatile Video Coding, VVC), the predetermined inter prediction mode may be a GPM prediction mode. In the current digital audio/video codec technology standard (Audio Video coding Standard, AVS), the preset inter prediction mode may be an AWP prediction mode. The two prediction modes are common in principle, although the names are different and the specific implementation forms are different, that is, both prediction modes can be applied to the inter prediction method of the embodiment of the present application.
Specifically, for the GPM prediction mode, if the GPM is used, the prediction mode parameters under the GPM, such as the GPM specific partition mode, are transmitted in the code stream; typically, the GPM includes 64 partitioning modes. For the AWP prediction mode, if AWP is used, prediction mode parameters under AWP, such as AWP specific partition modes, are transmitted in the code stream; typically, AWP includes 56 partitioning modes.
In a preset prediction mode, for example, both GPM and AWP need to find two reference blocks using two unidirectional motion information. The current implementation is to construct a motion information candidate list (which may also be referred to as a unidirectional motion information candidate list) at the encoder side by using the related information of the previously encoded/decoded portion of the current block, select unidirectional motion information from the motion information candidate list, and write index values (index) of the two unidirectional motion information in the motion information candidate list into the bitstream. The same way is used on the decoder side, i.e. a motion information candidate list is constructed using the information about the previously decoded part of the current block, which motion information candidate list must be identical to the one constructed on the encoder side. In this way, index values of two pieces of motion information are resolved from the code stream, and then the two pieces of unidirectional motion information are found out from the motion information candidate list, namely the two pieces of unidirectional motion information needed to be used by the current block.
It should be further noted that the unidirectional motion information described in the embodiments of the present application may include motion vector information, that is, the value of (x, y), and corresponding reference frame information, that is, the reference frame list and the reference index values in the reference frame list. One representation is to record the reference index values of two reference frame lists, wherein one reference frame list corresponds to a valid reference index value, such as 0,1,2, etc.; the reference index value corresponding to the other reference frame list is invalid, i.e., -1. The reference frame list with the effective reference index value is the reference frame list used by 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 the active reference frame list is active, and the motion vector corresponding to the inactive reference frame list is inactive. 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), so as to further determine the inter prediction value of the current block.
In practical application, the motion information candidate list is constructed by using not only the spatial domain motion information but also the temporal domain motion information. In the case of constructing a merge candidate list (merge list) in the VVC, temporal motion information and spatial motion information are also used. As shown in fig. 2A, which shows motion information of relevant positions used when the merge list is constructed, candidate positions with padding elements of 1, 2, 3, 4, and 5 represent spatial domain relevant positions, that is, motion information used by these position blocks adjacent to the current block in the current frame; candidate positions with padding elements 6 and 7 represent temporally related positions, i.e. motion information used for corresponding positions in a certain reference frame, which motion information may also be scaled. Here, for temporal motion information, if candidate position 6 is available, motion information corresponding to the 6 position may be used; otherwise, the motion information corresponding to the 7 positions may be used. It should be noted that the use of these several positions is also involved in the construction of the candidate list for motion information in the triangulated prediction mode (Triangle Partition Mode, TPM) and GPM prediction modes; and the size of the blocks is not a real size here, but is merely illustrated as an example.
For the AWP prediction mode, as shown in fig. 2B, block E is the current block, and blocks a, B, C, D, F, G are all neighboring blocks of block E. Specifically, the neighboring block a of the block E is a sample (x 0 -1,y 0 ) The block where the block is located, the neighboring block B of the block E is a sample (x 0 ,y 0 -1) the block in which the block E is located, the adjacent block C of the block E being the sample (x 0 +1,y 0 -1) the block in which the block E is located, the adjacent block D of the block E being the sample (x) 0 -1,y 0 -1) the block in whichThe neighboring block F of block E is a sample (x 0 -1, y 1) the block where is located, the adjacent block G of block E being the sample (x 1 ,y 0 -1) the block in which it is located. Wherein, (x) 0 ,y 0 ) Is the coordinates of the upper left corner sample of block E in the image, (x) 1 ,y 0 ) Is the coordinates of the upper right hand sample of block E in the image, (x) 0 ,y 1 ) Is the coordinates of the lower left hand sample of block E in the image. Here, the spatial positional relationship between the block E and its neighboring blocks A, B, C, D, F and G is shown in fig. 2B.
Note that adjacent block X (X may be A, B, C, D, F or G) "present" means that the block should be within the image and the block should belong to the same piece as block E; otherwise the neighboring block is "not present".
If a block is "not present" or not yet decoded, then this block is "not available"; otherwise this block is "available". If the block in which the image sample is located is "not present" or the sample has not been decoded, then the sample is "not available"; otherwise this sample is "available".
It should also be noted that a slice (patch) is a rectangular region in an image, and includes a portion of a plurality of maximum coding units in the image, where the slice structure is shown in fig. 3, for example, a slice such as A, B, C, D, E, F, and the slices should not overlap.
Further, the image is divided into maximum coding units, the maximum coding units should not overlap, the samples at the upper left corner of the maximum coding units should not exceed the image boundary, and the samples at the lower right corner of the maximum coding units may exceed the image boundary. Here, the maximum coding unit is divided into one or more coding units, which are determined by the coding tree, and the coding units may be divided into one or more transform units.
In the process of constructing the motion information candidate list, the time domain motion information in the current proposal is not limited to the position of the upper left corner of the current block due to the fact that the time domain motion information is from the encoded reference frame. The proposed approach is "where not enough to compensate", where four different positions are set, and assuming that the upper left corner of the current block is (x, y), the width of the current block is width, and the height is height, these 4 positions are shown in table 1 below, respectively. Note that the width and height referred to herein generally refer to the width (i.e., l_width) and height (i.e., l_height) of the luminance component, but are not particularly limited.
TABLE 1
Pos 0 Left upper corner (x,y)
Pos 1 Upper right corner (x+width,y)
Pos 2 Left lower corner (x,y+height)
Pos 3 Lower right corner (x+width,y+height)
For each mode of AWP, the temporal motion information can be determined with which of the 4 positions the small angle is at. The details are shown in table 2 below. In table 2, 0 means "Pos 0",1 means "Pos 1",2 means "Pos 2", and 3 means "Pos 3".
TABLE 2
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
Specifically, assuming that tmvppos=awpldxtolmvpos [ awpldx ], then
If TmvpPos is equal to 0, deducing time domain bidirectional motion information according to the first method;
if TmvpPos is equal to 1, deducing time-domain bidirectional motion information according to a second method;
if TmvpPos is equal to 2, deducing time-domain bidirectional motion information according to a third method;
if TmvpPos is equal to 3, the time-domain bidirectional motion information is deduced according to method four.
Here, the lookup table corresponding to AwpIndToTmvpPos is shown in Table 2. Splitting the derived time-domain bidirectional motion information into unidirectional motion information pointing to a reference frame List0 and unidirectional motion information pointing to a reference frame List1, performing unidirectional motion information check and repeat operation, and if not, putting the unidirectional motion information into an AwpUniArray until the length is 4 or the traversal is finished.
The specific steps of deriving temporal motion information will be provided below by taking the upper left corner, the upper right corner, the lower left corner and the lower right corner of the current block as examples, respectively.
Taking the upper left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the upper left corner of the current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the second step, the second step is carried out,
in the third step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE of the current prediction unit (mvE 1_x, mvE1 y):
here, mvX is mvRef, and mvX is mvE1.
Fourth, the value of the InterPredRefMode is equal to 'PRED_List01'.
Taking the upper right corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the upper right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y
If (x ', y') derived above is not available, such as beyond an image boundary, a patch boundary, etc., then x '=x+l_width-1, y' =y.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper right corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the upper right corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Taking the lower left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower left luminance sample position of the selected current prediction unit is (x ', y'), x '=x, y' =y+l_height.
If (x ', y') derived above is not available, such as beyond an image boundary, patch boundary, etc., then x '=x, y' =y+l_height-1.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower left corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower left corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
/>
here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Taking the lower right corner of the current block as an example, the motion information is deduced as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y+l_height.
If (x ', y') derived above is not available, such as beyond an image boundary, patch boundary, etc., then if x 'is not available, x' =x+l_width-1; if y 'is not available, y' =y+l_height-1.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position of the lower right corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower right corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
The above related technical solution is obvious for improving the compression performance, but since the three positions of the upper right, the lower left and the lower right of the current design are all outside the current block, if one of the three positions of the upper right, the lower left and the lower right is not available, for example, the position exceeds the image boundary, the patch boundary and the like can be modified into the inner position of the current block.
However, when determining the position used to derive temporal motion information, the reference frame used by it is not available beyond the image boundary, patch boundary, etc., because it has already been encoded. But this is not very friendly to existing hardware implementations. Because the hardware implementation does not cache all motion information used to derive temporal motion information for all reference frames used to derive temporal motion information, but only motion information for one LCU-sized portion of the current block that is co-located with the current LCU. Then in the current related art scheme, if the right boundary of the current block exactly coincides with the right boundary of the current LCU, or the lower boundary of the current block exactly coincides with the lower boundary of the current LCU, at least one of the three positions on the right, the left, and the right exceeds the boundary of the current LCU, then if the position or positions are still inside the image or the patch, meaning that it is still available, then the hardware needs to add additional bandwidth to acquire the motion information of the position or positions.
It should be noted that when the frame for deriving temporal motion information stores motion information from which the temporal motion information is derived, one motion information is not typically stored for each pixel, but one motion information is shared by blocks of a certain size, such as 16×16 pixels or 8×8 pixels or 4×4 pixels, etc., where 16×16 pixels or 8×8 pixels or 4×4 pixels generally refer to the number of pixels of the luminance component by default.
Based on this, the embodiment of the application provides an inter prediction method, which can be applied to an encoder or a decoder. After obtaining 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 for determining 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 under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information; and determining the inter prediction value of the current block according to the new motion information candidate list. In this way, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby enabling hardware implementation without adding additional bandwidth, and ensuring codec performance.
Referring to fig. 4A, a block diagram of a video encoding system provided in an embodiment of the present application is shown. As shown in fig. 4A, the video encoding system 11 may include: a transform unit 111, a quantization unit 112, a mode selection and coding control logic unit 113, an intra prediction unit 114, an inter prediction unit 115 (including motion compensation and motion estimation), an inverse quantization unit 116, an inverse transform unit 117, a loop filtering unit 118, a coding unit 119, and a decoded image buffer unit 110; for an input original video signal, a video reconstruction block can be obtained through dividing Coding Tree Units (CTUs), a Coding mode is determined through a mode selection and Coding control logic Unit 113, residual pixel information obtained after intra-frame or inter-frame prediction is transformed through a transformation Unit 111 and a quantization Unit 112, the transformation of the residual information is performed, the transformation is performed from a pixel domain to a transformation domain, and the obtained transformation coefficient is quantized, so that the bit rate is further reduced; the intra-frame prediction unit 114 is configured to perform intra-frame prediction on the video reconstruction block; wherein the intra-prediction unit 114 is configured to determine an optimal intra-prediction mode (i.e., a target prediction mode) of the video reconstruction block; inter prediction unit 115 is configured to perform inter prediction encoding of the received video reconstruction block with respect to one or more blocks in one or more reference frames to provide temporal prediction information; wherein motion estimation is a process of generating a motion vector that can estimate the motion of the video reconstruction block, and then motion compensation is performed based on the motion vector determined by the motion estimation; after determining the inter prediction mode, the inter prediction unit 115 is further configured to provide the selected inter prediction data to the encoding unit 119, and also transmit the calculated and determined motion vector data to the encoding unit 119; furthermore, the inverse quantization unit 116 and the inverse transform unit 117 are used for reconstruction of the video reconstruction block, reconstructing a residual block in the pixel domain, the reconstructed residual block removing blocking artifacts by the loop filtering unit 118, and then adding the reconstructed residual block to one predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video reconstruction block; coding section 119 is for coding various coding parameters and quantized transform coefficients. And the decoded image buffer unit 110 is used for storing reconstructed video reconstruction blocks for prediction reference. As video image encoding proceeds, new reconstructed video reconstruction blocks are generated, and these reconstructed video reconstruction blocks are stored in the decoded image buffer unit 110.
Referring to fig. 4B, a block diagram of a video decoding system is shown according to an embodiment of the present application. As shown in fig. 4B, the video decoding system 12 may include: a decoding unit 121, an inverse transforming unit 127, and inverse quantizing unit 122, intra prediction unit 123, motion compensation unit 124, loop filtering unit 125, and decoded image buffer unit 126; the input video signal is coded by the video coding system 11, and then the code stream of the video signal is output; the code stream is input into the video decoding system 12, and first passes through the decoding unit 121 to obtain decoded transform coefficients; processing by the inverse transform unit 127 and the inverse quantization unit 122 for the transform coefficient to generate a residual block in the pixel domain; the intra prediction unit 123 may be used to generate prediction data for a current video decoded block based on the determined intra prediction direction and data from a previously decoded block of a current frame or picture; the motion compensation unit 124 determines prediction information for the video decoding block by parsing the motion vector and other associated syntax elements and uses the prediction information to generate a predictive block of the video decoding block being decoded; forming a decoded video block by summing the residual blocks from the inverse transform unit 127 and the inverse quantization unit 122 with the corresponding predictive blocks generated by the intra prediction unit 123 or the motion compensation unit 124; the decoded video signal is passed through a loop filtering unit 125 to remove blocking artifacts, which may improve video quality; the decoded video blocks are then stored in a decoded image buffer unit 126. The decoded image buffer unit 126 stores reference images for subsequent intra prediction or motion compensation, and is also used for output of the video signal, resulting in a restored original video signal.
Briefly, the inter-frame prediction method provided in the embodiments of the present application mainly acts on the inter-frame prediction unit 215 of the video encoding system 11 and the inter-frame prediction unit of the video decoding system 12, i.e. the motion compensation unit 124; that is, if the video coding system 11 can obtain a better prediction effect by the inter-frame prediction method provided in the embodiment of the present application, the coding performance is improved; accordingly, in the video decoding system 12, the video decoding recovery quality can be improved, thereby improving the decoding performance.
The technical solutions of the present application will be further described in detail with reference to the accompanying drawings and examples. Before describing in detail, it should be observed that the references to "first", "second", "third", etc. throughout the specification are merely for distinguishing different features, and do not have the functions of defining priority, sequencing, size relationship, etc.
The embodiment of the application provides an inter prediction method, which is applied to video decoding equipment, namely a decoder. The functions performed by the method may be performed by a first processor in a decoder, which decoder comprises at least the first processor and the first memory, invoking a computer program, which computer program may of course be stored in the first memory.
Referring to fig. 5, a flow chart of an inter prediction method according to an embodiment of the present application is shown. As shown in fig. 5, the method may include:
s501: and analyzing the code stream to obtain the prediction mode parameters of the current block.
It should be noted that, the image to be decoded may be divided into a plurality of image blocks, and the current image block to be decoded may be referred to as a current block (may be represented by CU or PU), and the image blocks adjacent to the current block may be referred to as adjacent blocks; i.e. in the image to be decoded, there is a neighboring relationship between the current block and the neighboring block. Here, each current block may include a first image component, a second image component, and a third image component, that is, the current block represents an image block currently to be predicted for the first image component, the second image component, or the third image component in the image to be decoded.
The current block may also be referred to as a luminance block, assuming that the current block performs first image component prediction and the first image component is a luminance component, that is, the image component to be predicted is a luminance component; alternatively, assuming that the current block performs the second image component prediction and the second image component is a chrominance component, i.e., the image component to be predicted is a chrominance component, the current block may also be referred to as a chrominance block.
It should be further noted that the prediction mode parameter indicates the prediction mode adopted by the current block and the parameter related to the prediction mode. Among them, the prediction modes generally include inter prediction mode, conventional intra prediction mode, non-conventional intra prediction mode, etc., and the inter prediction mode includes normal inter prediction mode, GPM prediction mode, AWP prediction mode, etc. That is, the encoder selects the optimal prediction mode to pre-encode the current block, and in this process, the prediction mode of the current block can be determined, so that the corresponding prediction mode parameters are written into the code stream and transmitted from the encoder to the decoder.
In this way, on the decoder side, the prediction mode parameter of the current block can be directly obtained by parsing the code stream, and whether the current block uses a preset inter prediction mode, such as a GPM prediction mode or an AWP prediction mode, is determined according to the obtained prediction mode parameter.
S502: when the prediction mode parameter indicates that an inter prediction value of the current block is determined using a preset inter prediction mode, at least one initial candidate position of the current block is determined.
It should be noted that, when the decoder parses the bitstream to obtain the prediction mode parameter indicating that the inter prediction value of the current block is determined using the preset inter prediction mode, the inter prediction method provided in the embodiment of the present application may be adopted.
It should also be noted that the motion information may include motion vector information and reference frame information. Specifically, for a current block using inter prediction, the current frame in which the current block is located has one or more reference frames, and the current block may be a coding unit or a prediction unit, a motion information including a set of motion vectors and reference frame information may be used to indicate to a pixel region having the same size as the current block in a certain reference frame, which is referred to herein as a reference block, or a motion information including two sets of motion vectors and reference frame information may be used to indicate to two reference blocks in a certain two reference frames, which may be the same or different; the motion compensation may then derive an inter prediction value of the current block from the reference block indicated by the motion information.
In the embodiment of the present application, in order to avoid adding extra bandwidth when implementing hardware, an object of the embodiment of the present application is to make the hardware implement without adding extra bandwidth and maintain its compression performance as much as possible. Here, it is necessary to make the pixel positions used for determining temporal motion information not to exceed the boundary of the current LCU without adding extra bandwidth when implementing hardware. It should be noted that hereinafter the pixel positions used for determining temporal motion information will be referred to simply as positions.
In some embodiments, for S502, the determining at least one candidate location of the current block may include:
acquiring at least one angle initial candidate position of the current block to form an initial candidate position set; wherein the at least one angular initial candidate position comprises at least one of: an upper left initial candidate position, an upper right initial candidate position, a lower left initial candidate position, and a lower right initial candidate position;
at least one initial candidate position of the current block is determined from the set of initial candidate positions.
Further, in some embodiments, the upper left initial candidate position includes at least one of: a first top-left candidate position, a second top-left candidate position, a third top-left candidate position, and a fourth top-left candidate position;
the upper right initial candidate position comprises at least one of the following: a first upper right candidate position, a second upper right candidate position, a third upper right candidate position, and a fourth upper right candidate position;
the lower left initial candidate position includes at least one of: a first lower left candidate position, a second lower left candidate position, a third lower left candidate position, and a fourth lower left candidate position;
The lower right initial candidate position includes at least one of: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
wherein the first upper left candidate position, the first upper right candidate position, the first lower left candidate position, and the first lower right candidate position represent four angular positions inside the current block, the second upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent an upper left angular position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position represent an upper right angular position outside the current block, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position represent a lower left angular position outside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right angular position outside the current block.
It should be noted that, assuming that the position of the upper left corner inside the current block, that is, the position of the pixel corresponding to the first pixel in the upper 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. In addition, the width and the height referred to herein generally refer to the width (i.e., l_width) and the height (i.e., l_height) of the luminance component, but are not particularly limited.
It should be further noted that, since the above-mentioned reference frame for deriving temporal motion information stores motion information for deriving temporal motion information in terms of blocks, the temporal motion information determined in terms of a certain pixel position and the temporal motion information determined in terms of other pixel positions in the same storage block as the pixel position are identical, so that there may be some intermediate calculations in the derivation process to obtain some positions in a unified format from a certain pixel position through some calculations, and these positions may be considered identical as long as they are all in the same storage block.
In a possible implementation, taking fig. 6A as an example, the candidate positions of the upper left corner (i.e., the upper left initial candidate position), the upper right corner (i.e., the upper right initial candidate position), the lower left corner (i.e., the lower left initial candidate position), and the lower right corner (i.e., the lower right initial candidate position) that the current block may use may have a variety of choices. Specifically, for the upper left corner (filled in gray), a first upper left candidate position, a second upper left candidate position, a third upper left candidate position, and a fourth upper left candidate position may be used to represent, specifically, four positions (x, y), (x-1, y), (x, y-1), (x-1, y-1). The upper right corner (filled in gray) may be represented using a first upper right candidate position, a second upper right candidate position, a third upper right candidate position, and a fourth upper right candidate position, specifically represented as four positions (x+width-1, y), (x+width, y-1), (x+width-1, y-1). For the lower left corner (filled in gray), a first lower left candidate position, a second lower left candidate position, a third lower left candidate position, and a fourth lower left candidate position may be used to represent, specifically, four positions (x, y+height-1), (x, y+height), (x-1, y+height-1). The lower right corner (filled in gray) may be represented using a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position, specifically represented as four positions (x+width-1, y+height-1), (x+width, y+height), (x+width-1, y+height), (x+width, y+height-1).
In another possible implementation, taking fig. 6B as an example, for each current block, the current block may be a CU or PU, and the 4 initial candidate locations that may be used at this time are shown in fig. 6B. These four positions fall at four angular positions inside the current block, specifically, these four positions are respectively: the upper left initial candidate position is (x, y), the upper right initial candidate position is (x+width-1, y), the lower left initial candidate position is (x, y+height-1), and the lower right initial candidate position is (x+width-1, y+height-1).
In yet another possible implementation, taking fig. 6C as an example, one of the four positions for the current block, namely the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, the lower right corner, may each be initially selected. Specifically, as shown in fig. 6C, the four positions are respectively: the upper left initial candidate position is (x, y), the upper right initial candidate position is (x+width, y), the lower left initial candidate position is (x, y+height), and the lower right initial candidate position is (x+width, y+height).
In yet another possible implementation, taking fig. 6D as an example, one of the four positions for the current block, namely the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, the lower right corner, may be initially selected each. Specifically, as shown in fig. 6D, the four positions are respectively: the upper left initial candidate position is (x, y), the upper right initial candidate position is (x+width, y-1), the lower left initial candidate position is (x-1, y+height), and the lower right initial candidate position is (x+width, y+height).
In yet another possible implementation, taking fig. 6E as an example, one of the four positions for the current block, namely the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, the lower right corner, may each be initially selected. Specifically, as shown in fig. 6E, the four positions are respectively: the upper left initial candidate position is (x-1, y-1), the upper right initial candidate position is (x+width, y-1), the lower left initial candidate position is (x-1, y+height), and the lower right initial candidate position is (x+width, y+height).
Thus, taking fig. 6A-6E as an example, it provides a variety of initial candidate positions. After the initial candidate position is obtained, it is necessary to determine whether the initial candidate position exceeds the LCU boundary of the current block to further determine how to process when the initial candidate position falls outside the LCU boundary.
S503: and under the condition that the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block.
It should be noted that, in order to avoid adding extra bandwidth when implementing hardware, it is necessary to determine whether at least one initial candidate position used for determining the temporal motion information exceeds the LCU boundary of the current block.
In some embodiments, for S503, the method further comprises: the at least one initial candidate position is determined to be at least one target candidate position for the current block if the at least one initial candidate position does not exceed an LCU boundary for the current block.
That is, if a certain initial candidate position exceeds the LCU boundary, then an adjustment is required for the initial candidate position at this time, so that the adjusted target candidate position does not exceed the LCU boundary; if a certain initial candidate position does not exceed the boundary of the LCU, no adjustment is needed for the initial candidate position at this time, and the initial candidate position can be directly determined as the target candidate position.
In a possible implementation, candidate locations within the current block may be selected, where none of the candidate locations used exceeds the LCU boundary of the current block, which can be determined directly as target candidate locations. Thus, in some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises 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, determining that the at least one initial candidate position does not exceed an LCU boundary, and determining the at least one initial candidate position as at least one target candidate position of the current block.
It should be noted that, taking fig. 6B as an 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 (x+width-1, y+height-1), the initial candidate positions are located inside the current block, i.e., none of the initial candidate positions exceeds the LCU boundary of the current block, then the initial candidate positions may be determined as target candidate positions.
It should also be noted that if a certain position falls outside the LCU boundary, then this position may be adjusted to be within the LCU boundary, i.e. inside the LCU; otherwise, if a location is outside the current block and falls inside the LCU, no adjustment is made at this time.
In another possible implementation, for a certain corner, if the initial candidate position falls outside the LCU boundary, then a certain candidate position inside the LCU and outside the current block for that corner is first adjusted.
In some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the 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.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the right lower initial candidate position and the right lower initial candidate position exceeds the LCU boundary, selecting a candidate position which does not exceed the LCU boundary from right lower corner positions outside the current block, and adjusting the right lower initial candidate position to the selected candidate position to obtain a target candidate position of the current block.
Further, the method may further include: and if no candidate position which does not exceed the boundary of the LCU is selected from the right lower corner positions outside the current block, adjusting the right lower initial candidate position to the right lower corner position inside the current block so as to obtain a target candidate position of the current block.
That is, taking the lower right corner as an example, if the lower right initial candidate position exceeds the LCU boundary, then first adjust to a certain candidate position inside the lower right LCU but outside the current block; if no candidate position that does not exceed the LCU boundary is selected from the lower right corner positions outside the current block, then an adjustment to the lower right corner position inside the current block is required to determine the corresponding target candidate position.
Specifically, taking the lower right corner as an example, if the initial candidate position is (x+width, y+height), if the right boundary of the current block coincides with the right boundary of the LCU and the lower boundary of the current block is inside the LCU, the lower right corner is adjusted to (x+width-1, y+height). If the right boundary of the current block is inside the LCU and the lower boundary of the current block and the lower boundary of the LCU coincide, then the lower right corner is adjusted to (x+width, y+height-1). If the right boundary of the current block and the right boundary of the LCU coincide and the lower boundary of the current block and the lower boundary of the LCU coincide, then the lower right corner is adjusted to (x+width-1, y+height-1). Here, the remaining upper left corner, upper right corner, lower left corner can be adjusted as described above.
For this process, the text is described below. Wherein the text description modifies only the pixel locations of method one, method two, method three, and method four.
Taking the upper left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the top left luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y-1.
If x ' is less than the abscissa x_ LCU _left of the leftmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located; then x' =x;
if y ' is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch where the current prediction unit is located; then y' =y.
Taking the upper right corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the upper right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y-1
If x ' is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located; then x' =x+l_width-1;
If y ' is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch where the current prediction unit is located; then y' =y.
Taking the lower left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower left luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y+l_height.
If x ' is less than the abscissa x_l of the leftmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located; then x' =x;
if y ' is greater than the ordinate y_b of the lowest luminance sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is greater than the ordinate y_boundary_bottom of the lowest luminance sample position of the image or patch where the current prediction unit is located; then y' =y+l_height-1.
Taking the lower right corner of the current block as an example, the motion information is deduced as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y+l_height.
If x ' is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located; then x' =x+l_width-1;
if y ' is greater than the ordinate y_ LCU _bottom of the luminance sample position of the lowest edge of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is greater than the ordinate y_boundary_top of the luminance sample position of the lowest edge of the image or patch where the current prediction unit is located; then y' =y+l_height-1.
It should be noted that, since the slice (patch) in the current standard protocol is always a rectangular area, the above-described processing of slice boundaries is not problematic; however, if the subsequent patch is not limited to a rectangular area, the determination of unavailability of x ', y' is changed to determine whether (x ', y') is within the range of the patch, and will not be described again.
In particular, if the current prediction unit, i.e. the current block, does not exceed the picture or slice boundaries, this is the case in current standard protocols. But if the current prediction unit, i.e. the current block, may exceed the picture or slice boundary, then the above text description may be written as:
taking the upper left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the top left luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y-1.
If x 'is less than the abscissa x_ LCU _left of the leftmost luma sample position of the LCU where the current prediction unit is located, then x' =x;
if x ' is not available, for example, x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located, then x ' =x_boundary_left;
if y 'is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, then y' =y;
if y ' is not available, e.g., y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch in which the current prediction unit is located, then y ' =y_boundary_top.
Taking the upper right corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the top right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y-1.
If x 'is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, then x' =x+l_width-1;
if x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located, then x ' =x_boundary_right;
if y 'is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, then y' =y;
if y ' is not available, e.g., y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch in which the current prediction unit is located, then y ' =y_boundary_top.
Taking the lower left corner of the current block as an example, the step of deducing motion information is as follows:
In the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the top right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y+l_height.
If x 'is less than the abscissa x_l of the leftmost luma sample position of the LCU where the current prediction unit is located, then x' =x;
if x ' is not available, for example, x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located, then x ' =x_boundary_left;
if y 'is greater than the ordinate y_b of the luminance sample position of the lowest edge of the LCU where the current prediction unit is located, then y' =y+l_height-1;
if y ' is not available, e.g., y ' is greater than the ordinate y_boundary_bottom of the luminance sample position of the lowest edge of the image or patch where the current prediction unit is located, then y ' =y_boundary_bottom.
Taking the lower right corner of the current block as an example, the motion information is deduced as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y+l_height.
If x 'is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, then x' =x+l_width-1;
if x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located, then x ' =x_boundary_right;
if y 'is greater than the ordinate y_ LCU _bottom of the luminance sample position of the lowest edge of the LCU where the current prediction unit is located, then y' =y+l_height-1;
if y ' is not available, e.g., y ' is greater than the ordinate y_boundary_top of the luminance sample position at the lowest edge of the image or patch where the current prediction unit is located, then y ' =y_boundary_top.
It is also noted that the top left corner luminance sample position (x, y) may not exceed the image or slice boundary; that is, the above text description is merely for the purpose of altering the consistency in format.
In yet another possible embodiment, if the initial candidate position falls outside the LCU boundary for a certain corner, then the candidate position for the corner whose other initial position falls inside the LCU may be adjusted.
In some embodiments, the method may further comprise:
And if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the candidate positions corresponding to the rest corners except the one corner, and adjusting the initial candidate position of the one corner to the selected candidate position to obtain one target candidate position of the current block.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, adjusting the lower right initial candidate position to the upper right initial candidate position under the condition that the upper right initial candidate position does not exceed the LCU boundary so as to obtain a target candidate position of the current block.
That is, there may be different initial candidate positions for different partitioning modes. Taking partition mode 54 as an example (starting from 0), if the derived temporal motion information should use the initial candidate position for the lower right corner, i.e., (x+width, y+height); but 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, at which time the upper right candidate position may be used if the upper right candidate position is inside the LCU. The candidate position in the upper right corner may be (x+width, y), (x+width-1, y), or (x+width, y-1).
In yet another possible implementation, if for a certain corner, the initial candidate position falls outside the LCU boundary and this corner can only be adjusted to the inside of the current block, then the candidate position for the corner whose other initial position falls inside the LCU can be adjusted.
In some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises the initial candidate position of one corner, the initial candidate position of the one corner exceeds the LCU boundary, and only the candidate position inside the current block in the candidate positions corresponding to the one corner does not exceed the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the candidate positions corresponding to the rest corners except the one corner, and adjusting the initial candidate position of the one corner to the selected candidate position to obtain one target candidate position of the current block.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the lower right initial candidate position, the lower right initial candidate position exceeds an LCU boundary, and only the first lower right candidate position in the lower right corner positions inside and outside the current block does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position under the condition that the upper right initial candidate position does not exceed the LCU boundary, so that one target candidate position of the current block is obtained.
That is, there may be different initial candidate positions for different partitioning modes. Taking partition mode 54 as an example (starting from 0), if the derived temporal motion information should use the initial candidate position for the lower right corner, 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 lower boundary of the current block coincides with the lower boundary of the LCU, then the initial candidate location (x+width, y+height) exceeds the LCU boundary, and the (x+width-1, y+height) and (x+width, y+height-1) at the lower right corner also exceed the LCU boundary, while only (x+width-1, y+height-1) is inside the current block and not beyond the LCU boundary, at which time the upper right corner candidate location may be used if the upper right corner candidate location is inside the LCU. The candidate position in the upper right corner may be (x+width, y), (x+width-1, y), or (x+width, y-1).
In a further possible embodiment, it is also possible to set a prioritization of the at least one initial candidate position for each partition mode and then check in turn whether the LCU boundary of the current block is exceeded.
In some embodiments, the method may further comprise:
setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order aiming at different division modes;
Selecting an initial candidate position according to the preset priority order, and judging whether the selected initial candidate position exceeds an LCU boundary;
if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset priority order;
and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
That is, different preset priority orders may be set for different division modes. Taking the partition mode 54 (starting from 0) as an example, for the partition mode 54, the priority ranks of four initial candidate positions, such as the upper left corner, the upper right corner, the lower left corner, the lower right corner, and the like, may be set, for example, the set initial candidate positions are ranked to be 3, 1, 2, and 0, i.e., the lower right corner is preferentially selected, the upper right corner is selected, the lower left corner is selected, and the upper left corner is selected; and judging in sequence according to the mode.
In a further possible embodiment, it is also possible to set a fixed ordering order of the at least one initial candidate position for each partition mode and then check in turn whether the LCU boundary of the current block is exceeded.
In some embodiments, the method may further comprise:
ordering different initial candidate positions in the initial candidate position set according to a preset sequence aiming at different division modes;
selecting an initial candidate position according to the preset sequence, and judging whether the selected initial candidate position exceeds the LCU boundary;
if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset sequence;
and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
That is, it may also be ordered in a fixed preset order, such as the order 0,1,2,3,0,1, … …, if a certain partition mode first selects 3, i.e. the lower right corner, but the lower right corner cannot fall inside the LCU (i.e. beyond the LCU boundary) but is outside the current block; then 0 is chosen to try again, i.e. the upper left corner, and if 0 is not satisfied, then 1 is chosen to try again, i.e. the upper right corner, and so on, until all 4 initial candidate positions are judged in turn.
Further, if none of the four initial candidate locations can fall inside the LCU but outside the current block, then the current block inner location of the first corner of the position ordering (e.g., the preset priority order or the preset order) may also be set to determine it as the target candidate location; alternatively, if none of the four initial candidate locations fall inside the LCU but outside the current block, another way is to select a default location, such as the top left corner location inside the current block, to determine it as the target candidate location.
Here, it can be simply determined whether the calculations (x, y) and (x ', y') are inside the same LCU. Specifically, if the width of the luminance samples of x divided by the LCU is equal to x 'divided by the width of the luminance samples of the LCU, and the height of the luminance samples of y divided by the LCU is equal to y' divided by the height of the luminance samples of the LCU, (x, y) and (x ', y') are located inside the same LCU; otherwise, (x, y) and (x ', y') are not located inside the same LCU.
S504: at least one temporal motion information of the current block is determined based on the at least one target candidate position.
After obtaining at least one target candidate position, temporal motion information may be determined according to the obtained target candidate position, specifically, motion information used for a temporal position in a corresponding reference frame is taken as temporal motion information of the target candidate position. Here, the frame to which the current block belongs may be referred to as a current frame, and the target candidate position in the current frame is the same as the time domain position in the reference frame although the frame to which the current block belongs is different.
In some embodiments, for S504, the determining at least one temporal motion information of the current block based on the at least one target candidate position may include:
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 time domain position associated with the target candidate position in corresponding reference frame information, and determining motion information used by the time domain position as time domain motion information corresponding to the target candidate position;
and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
That is, temporal motion information is determined based on motion information used for a corresponding position in certain reference frame information. And different time domain motion information can be obtained for different target candidate positions.
Illustratively, the first method, taking the upper left corner of the current block as an example, derives the motion information as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the top left luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y-1.
If x ' is less than the abscissa x_ LCU _left of the leftmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located; then x' =x;
If y ' is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch where the current prediction unit is located; then y' =y.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the upper left corner of the current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Taking the upper right corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the upper right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y-1
If x ' is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located; then x' =x+l_width-1;
if y ' is less than the ordinate y_ LCU _top of the uppermost luma sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is less than the ordinate y_boundary_top of the uppermost luma sample position of the image or patch where the current prediction unit is located; then y' =y.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper right corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the upper right corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
Here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Taking the lower left corner of the current block as an example, the step of deducing motion information is as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower left luminance sample position of the selected current prediction unit is (x ', y'), x '=x-1, y' =y+l_height.
If x ' is less than the abscissa x_l of the leftmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is less than the abscissa x_boundary_left of the leftmost luma sample position of the image or patch where the current prediction unit is located; then x' =x;
if y ' is greater than the ordinate y_b of the lowest luminance sample position of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is greater than the ordinate y_boundary_bottom of the lowest luminance sample position of the image or patch where the current prediction unit is located; then y' =y+l_height-1.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower left corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower left corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
Here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Taking the lower right corner of the current block as an example, the motion information is deduced as follows:
in the first step, the first step is to provide,
assuming that the luminance sample position of the upper left corner 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; and the lower right corner luminance sample position of the selected current prediction unit is (x ', y'), x '=x+l_width, y' =y+l_height.
If x ' is greater than the abscissa x_ LCU _right of the rightmost luma sample position of the LCU where the current prediction unit is located, or x ' is not available, such as x ' is greater than the abscissa x_boundary_right of the rightmost luma sample position of the image or patch where the current prediction unit is located; then x' =x+l_width-1;
if y ' is greater than the ordinate y_ LCU _bottom of the luminance sample position of the lowest edge of the LCU where the current prediction unit is located, or y ' is not available, such as y ' is greater than the ordinate y_boundary_top of the luminance sample position of the lowest edge of the image or patch where the current prediction unit is located; then y' =y+l_height-1.
In the second step, the second step is carried out,
if the reference frame index stored in the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position of the lower right corner of the selected current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is-1, both the L0 reference index and the L1 reference index of the current prediction unit are equal to 0. Taking the size and the position of the coding unit where the current prediction unit is located as the size and the position of the current prediction unit, taking the obtained L0 motion vector predicted value and the L1 motion vector predicted value as the L0 motion vector MvE and the L1 motion vector MvE1 of the current prediction unit respectively, enabling the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit to be equal to 0, and ending the motion information deriving process.
Otherwise the first set of parameters is selected,
the L0 reference index and the L1 reference index of the current prediction unit are both equal to 0. The distance indexes of the images corresponding to the L0 reference index and the L1 reference index of the current prediction unit are respectively marked as a distance index L0 and a distance index L1; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit is respectively denoted as BlockDistance L0 and BlockDistance L1.
In the reference image queue 1, the L0 motion vector of the temporal motion information storage unit where the luminance sample corresponding to the luminance sample position at the lower right corner of the selected current prediction unit is located 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 distanceindex col, and the distance index of the image where the reference unit to which the motion vector points is denoted as distanceindex ref.
In the third step, the third step is that,
in the fourth step, the third step is that,
let L0 reference index RefIdxL0 of the current prediction unit be equal to 0, calculate L0 motion vector mvE0 of the current prediction unit (mvE 0_x, mvE0 _y):
here, mvX is mvRef, and mvX is mvE0.
Let L1 reference index RefIdxL1 of the current prediction unit be equal to 0, calculate L1 motion vector mvE1 of the current prediction unit (mvE 1_x, mvE1 _y):
Here, mvX is mvRef, and mvX is mvE1.
Fifth, the value of the interPredRefMode is equal to 'pred_list01'.
Thus, after deriving temporal motion information, the resulting temporal motion information may be padded into a motion information candidate list to obtain a new motion information candidate list.
S505: and constructing a motion information candidate list based on the at least one time domain motion information.
It should be noted that, after obtaining at least one temporal motion information, it may be filled into the motion information candidate list to obtain a new motion information candidate list. Specifically, for S505, this step may include: and filling at least one piece of time domain motion information into the motion information candidate list to obtain the new motion information candidate list.
It should be noted that, in the existing motion information candidate list, only one filling position of temporal motion information is reserved, and in order to improve the correlation of the lower right corner, the filling position of the temporal motion information in the motion information candidate list may be further increased. Specifically, in some embodiments, the method may further comprise:
adjusting the proportion value of the time domain motion information in the new motion information candidate list;
And controlling filling positions of at least two time domain motion information reserved in the new motion information candidate list according to the adjusted proportion value.
That is, the scale value of temporal motion information in the motion information candidate list may be increased. If at least 1 position is reserved for temporal motion information in the candidate list in the AWP prediction mode, then it may be adjusted to reserve at least 2 (or 3) positions for temporal motion information in the candidate list in the AWP prediction mode, such that a filled position of at least two temporal motion information is reserved in the new motion information candidate list.
In this way, after deriving temporal motion information, a new candidate list of motion information can be constructed. The inter prediction value of the current block is then determined from the new motion information candidate list.
S506: and determining an inter prediction value of the current block according to the motion information candidate list.
It should be noted that, when the prediction mode parameter indicates that the inter prediction value of the current block is determined using a preset inter prediction mode (such as GPM or AWP), two partitions of the current block may be determined at this time. That is, the method may further include: determining two partitions of a current block when a prediction mode parameter indicates that an inter prediction value of the current block is determined using GPM or AWP; wherein the two partitions include a first partition and a second partition.
It should be noted that, after obtaining the new motion information candidate list, the motion information corresponding to the first partition of the current block and the motion information of the second partition may be determined; and then, according to the motion information corresponding to the first partition and the motion information of the second partition, determining the inter prediction value of the current block.
Specifically, as shown in fig. 7, a flow chart of another inter prediction method provided in an embodiment of the present application is shown. The method may include:
s701: analyzing the code stream, and determining a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
s702: determining, based on a motion information candidate list, motion information in the motion information candidate list indicated by the first motion information index value as motion information of the first partition, and motion information in the motion information candidate list indicated by the second motion information index value as motion information of the second partition;
s703: calculating a first predicted value of the first partition by using the motion information of the first partition, and calculating a second predicted value of the second partition by using the motion information of the second partition;
S704: and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
It should be noted that, the conventional unidirectional prediction only searches for a reference block having the same size as the current block, while the conventional bidirectional prediction uses two reference blocks having the same size as the current block, and the pixel value of each point in the prediction block is an average value of the corresponding positions of the two reference blocks, that is, all points of each reference block account for 50%. The bi-directional weighted prediction allows the ratio of the two reference blocks to be different, e.g. 75% for all points in the first reference block and 25% for all points in the second reference block. But the proportions of all points in the same reference block are the same. Other optimization methods, such as decoding-side motion vector correction (Decoder side Motion Vector Refinement, DMVR) techniques, bi-directional optical flow (Bi-directional Optical Flow, BIO), etc., may cause some changes to reference pixels or predicted pixels, and GPM or AWP may also use two reference blocks of the same size as the current block, but some pixel positions 100% use the pixel value of the first reference block corresponding position, some pixel positions 100% use the pixel value of the second reference block corresponding position, and some pixel positions at the boundary area use the pixel values of the two reference block corresponding positions in proportion. The specific how these weights are assigned is determined by the prediction mode of the GPM or AWP, or it can also be considered that the GPM or AWP uses two reference blocks of different sizes from the current block, i.e. each takes a part of the required reference block.
Illustratively, as shown in fig. 8A, a schematic diagram of weight distribution of multiple partitioning modes of a GPM on a 64×64 current block according to an embodiment of the present application is shown. In fig. 8A, there are 64 partitioning modes for the GPM. As shown in fig. 8B, a schematic diagram of weight distribution of multiple partitioning modes of AWP on a 64×64 current block according to an embodiment of the present application is shown. In fig. 8B, there are 56 division modes of AWP. In either of the division modes shown in fig. 8A and 8B, the weight value of the first reference block corresponding position is 0% in the black area, 100% in the white area, and a certain weight value greater than 0% and less than 100% in the gray area according to the difference of the color shades, and 100% minus the weight value of the first reference block corresponding position in the second reference block corresponding position.
It should be appreciated that in early codec techniques, only rectangular partitioning exists, whether CU, PU or Transform Unit (TU) partitioning. The GPM or the AWP realizes non-rectangular division, namely a rectangular block can be divided into two subareas by a straight line, and the two subareas can be triangular, trapezoidal, rectangular or the like according to the difference of the positions and the angles of the straight line, so that the division is closer to the edge of an object or the edges of two areas with different movements. It should be noted that the division is not a true division, but rather a predictive effect division. Since this division only divides the weights of the two reference blocks when generating the prediction block, or can be simply understood that a part of the positions of the prediction block is from the first reference block and another part of the positions is from the second reference block, the current block is not really divided into two CUs or PUs or TUs by the division line. In this way, the residual transform, quantization, inverse transform, inverse quantization, etc. after prediction are also processed as a whole for the current block.
It should be further noted that the GPM or the AWP belongs to an inter-frame prediction technique, and the GPM or the AWP needs to transmit a flag (flag) indicating whether the GPM or the AWP is used in the code stream, where the flag may indicate whether the current block uses the GPM or the AWP. If GPM or AWP is used, the encoder needs to transmit a specific used mode in the code stream, namely one of 64 division modes of GPM or one of 56 division modes of AWP; and index values of two unidirectional motion information. That is, for the current block, the decoder may obtain information about whether the GPM or the AWP is used by parsing the code stream, and if it is determined that the GPM or the AWP is used, the decoder may parse the prediction mode parameter of the GPM or the AWP and two motion information index values, for example, the current block may be divided into two partitions, and then may parse the first motion information index value corresponding to the first partition and the second motion information index value corresponding to the second partition.
Before calculating the inter prediction value of the current block, a new motion information candidate list needs to be constructed first, and a construction method of the motion information candidate list is described below by taking AWP in AVS as an example.
As shown in fig. 2B, block E is the current block, and blocks a, B, C, D, F, and G are all adjacent blocks to block E. Where the neighboring block a of block E is a sample (x 0 -1,y 0 ) The block where the block is located, the neighboring block B of the block E is a sample (x 0 ,y 0 -1) the block in which the block E is located, the adjacent block C of the block E being the sample (x 0 +1,y 0 -1) the block in which the block E is located, the adjacent block D of the block E being the sample (x) 0 -1,y 0 -1) the block in which the block E is located, the adjacent block F of the block E being the sample (x 0 -1,y 1 ) The block where the block is located, the neighboring block G of the block E is a sample (x 1 ,y 0 -1) the block in which it is located. Wherein (x) 0 ,y 0 ) Is the coordinates of the upper left corner sample of block E in the image, (x) 1 ,y 0 ) Is the coordinates of the upper right hand sample of block E in the image, (x) 0 ,y 1 ) Is the coordinates of the lower left hand sample of block E in the image. That is, the spatial positional relationship of the block E and its neighboring blocks A, B, C, D, F and G is detailed in fig. 2B.
For fig. 2B, the "presence" of a neighboring block X (X denoted 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 is "not present". It can be obtained that if a block is "not present" or not yet decoded, then this block is "not available"; otherwise this block is "available". Alternatively, if the block in which the image sample to be decoded is located is "not present" or the sample has not been decoded, then the sample is "not available"; otherwise this sample is "available".
It is assumed that the first unidirectional motion information is expressed as mvAwp0L0, mvAwp0L1, refIdxAwp0L0, and RefIdxAwp0L1. Wherein mvAwp0L0 represents a motion vector corresponding to the first reference frame list RefPicList0, refIdxAwp0L0 represents a reference index value of a reference frame corresponding to the first reference frame list RefPicList 0; mvAwp0L1 represents the corresponding motion vector in the second reference frame list RefPicList1, refIdxAwp0L1 represents the reference index value of the corresponding reference frame in the second reference frame list RefPicList 1. The second one-way motion information and so on.
Since the motion information is unidirectional here, one of RefIdxAwp0L0 and RefIdxAwp0L1 must be a significant value, such as 0,1,2, etc.; the other is an invalid value, such as-1. If RefIdxAwp0L0 is a valid value, then RefIdxAwp0L1 is-1; the corresponding mvAwp0L0 is the required motion vector (x, y), and mvAwp0L1 is not needed to be considered. And vice versa.
Specifically, the steps of deriving mvAwp0L0, mvAwp0L1, refIdxAwp0L0, refIdxAwp0L1, mvAwp1L0, mvAwp1L1, refIdxAwp1L0, and RefIdxAwp1L1 are as follows:
first, as shown in fig. 2B, F, G, C, A, B and D are neighboring blocks to the current block E, and the "availability" of F, G, C, A, B and D is determined:
(a) If F exists and an inter prediction mode is employed, F is "available"; otherwise F "unavailable".
(b) If G exists and an inter prediction mode is employed, G is "available"; otherwise G is "unavailable".
(c) If C exists and an inter prediction mode is employed, C is "available"; otherwise C is "unavailable".
(d) If A exists and an inter prediction mode is employed, A is "available"; otherwise a is "unavailable".
(e) If B exists and an inter prediction mode is employed, B is "available"; otherwise B "unavailable".
(f) If D exists and an inter prediction mode is employed, D is "available"; otherwise D "unavailable".
Second, the unidirectional available motion information is put into a unidirectional motion information candidate list (denoted by awpuni array) in the order of F, G, C, A, B and D until awpuni array length is 3 or the traversal is finished.
Thirdly, if the length of the AwpUniArray is less than 3, splitting the bidirectional available motion information into unidirectional motion information pointing to a reference frame List0 and unidirectional motion information pointing to a reference frame List1 according to the sequence of F, G, C, A, B and D, performing unidirectional motion information check and repeat operation, and if not, putting the AwpUniArray into the AwpUniArray until the length is 3 or traversing is finished.
Fourthly, splitting the deduced time-domain bidirectional motion information into unidirectional motion information pointing to a reference frame List0 and unidirectional motion information pointing to the reference frame List1, performing unidirectional motion information check and repeat operation, and if not, putting the unidirectional motion information into the AwpUniArray until the length is 4 or the traversal is finished.
And fifthly, if the length of the AwpUNIArray is smaller than 4, repeating the filling operation on the last unidirectional motion information in the AwpUNIArray until the length of the AwpUNIArray is 4.
Sixthly, the AwpC and Idx0+1 motion information in the AwpUniArray is assigned to mvAwp0L0, mvAwp0L1, refIdxAwp0L0 and refIdxAwp0L1; the motion information of AwpEndIdx1+1 in AwpenArray is assigned to mvAwp1L0, mvAwp1L1, refIdxAwp1L0 and refIdxAwp1L1.
In the last standard meeting, the above detailed text description is modified as follows,
first, as shown in fig. 2B, F, G, C, A, B and D are neighboring blocks to the current block E, and the "availability" of F, G, C, A, B and D is determined:
(a) If F exists and an inter prediction mode is employed, F is "available"; otherwise F "unavailable".
(b) If G exists and an inter prediction mode is employed and the motion information of G and F are not the same, G is "available"; otherwise G is "unavailable".
(c) If C exists and an inter prediction mode is employed and the motion information of C and G are not the same, C is "available"; otherwise C is "unavailable".
(d) If A exists and adopts an inter prediction mode and the motion information of A and F are not the same, A is "available"; otherwise a is "unavailable".
(e) If B exists and an inter prediction mode is employed, B is "available"; otherwise B "unavailable".
(f) D is "available" if D exists and an inter prediction mode is employed and the motion information of D and a is not the same and the motion information of D and G is also not the same; otherwise D "unavailable"
Second, the available motion information is put into the motion candidate list awpcandarary in order of F, G, C, A, B and D until awpcandarary length is 4 or the traversal is over.
Thirdly, the deduced time domain bidirectional motion information is put into a motion candidate list AwpC and dARRAy.
Fourth, if the length of awpcandraray is less than 5, generating four pieces of motion information in turn, wherein the reference frame information of the generated four pieces of motion information is identical to the reference frame information of the first piece of motion information in awpcandraray. The motion vectors corresponding to the List0 and List1 of the first motion information in the awpcandarry are marked as (x, y) in sequence, the motion vectors in the generated four motion information corresponding candidate lists are respectively (x 0, y 0), (x 1, y 1), (x 2, y 2) and (x 3, y 3), and are calculated as follows,
x0=abs(x)<88:(abs(x)<=64?((abs(x)*5+2)>>2):(abs(x)<=128?((abs(x)*9+4)>>3):((abs(x)*33+16)>>5)))
x0=x<0?-x0:x0
y0=y
x1=x
y1=abs(y)<88:(abs(y)<=64?((abs(y)*5+2)>>2):(abs(y)<=128?((abs(y)*9+4)>>3):((abs(y)*33+16)>>5)))
y1=y<0?-y1:y1
x2=abs(x)<88:(abs(x)<=64?((abs(x)*3+2)>>2):(abs(x)<=128?((abs(x)*7+4)>>3):((abs(x)*31+16)>>5)))
x2=x<0?-x2:x2
x2=abs(x)<8?-x2:x2
y2=y
x3=x
y3=abs(y)<88:(abs(y)<=64?((abs(y)*3+2)>>2):(abs(y)<=128?((abs(y)*7+4)>>3):((abs(y)*31+16)>>5)))
y3=y<0?-y3:y3
y3=abs(y)<8?-y3:y3
the newly generated four pieces of motion information were added sequentially to awpcandarary until the length of awpcandarary was 5.
Fifth, assigning one single motion information of the AwpC and Idx0+1 motion candidates in AwpC and dARRAy to mvAwp0L0, mvAwp0L1, refIdxAwp0L0 and RefIdxAwp0L1:
(a) If AwpC and Idx0 is even, the unidirectional motion information of the motion candidate pointing to the reference frame List0 is assigned to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, and RefIdxAwp0L1 is equal to-1; if the List0 unidirectional motion information does not exist, the unidirectional motion information of the motion candidate pointing to the reference frame List1 is assigned to mvAwp0L1 and RefIdxAwp0L1, wherein mvAwp0L0 is equal to zero, and RefIdxAwp0L0 is equal to-1.
(b) If AwpC and Idx0 is odd, the unidirectional motion information of the motion candidate pointing to the reference frame List1 is assigned to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 is equal to zero, and RefIdxAwp0L0 is equal to-1; if the List1 unidirectional motion information does not exist, the unidirectional motion information of the motion candidate pointing to the reference frame List0 is assigned to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, and RefIdxAwp0L1 is equal to-1.
Sixth, assigning single motion information of the AwpC and Idx1+1 motion candidates in AwpC and dARRAy to mvAwp1L0, mvAwp1L1, refIdxAwp1L0 and RefIdxAwp1L1:
(a) If AwpC and Idx1 is even, the unidirectional motion information of the motion candidate pointing to the reference frame List0 is assigned to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to-1; if the List0 unidirectional motion information does not exist, the unidirectional motion information of the motion candidate pointing to the reference frame List1 is assigned to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to-1.
(b) If AwpC and Idx1 is odd, the unidirectional motion information of the motion candidate pointing to the reference frame List1 is assigned to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to-1; if the List1 unidirectional motion information does not exist, the unidirectional motion information of the motion candidate pointing to the reference frame List0 is assigned to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to-1.
And finding two reference blocks by utilizing the two unidirectional motion information determined by the method, determining the weight of the two reference blocks at each pixel position according to a specific mode used by GPM or AWP, and weighting the two reference blocks to obtain the prediction block of the current block.
Thus, for the current block, the decoder can obtain information about whether the GPM or the AWP is used by parsing the code stream, if it is determined that the GPM or the AWP is used, the decoder can parse the prediction mode parameter and two motion information index values of the GPM or the AWP, and the decoder constructs a motion information candidate list used by the current block GPM or the AWP, then can find two unidirectional motion information in the constructed new motion information candidate list according to the parsed two motion information index values, and can find two reference blocks by using the two unidirectional motion information, and can determine weights of the two reference blocks at each pixel position according to a specific prediction mode used by the GPM or the AWP, and finally, the two reference blocks are weighted and calculated to obtain the prediction block of the current block.
Further, if the current mode is a skip (skip) mode, the prediction block is a decoded block, meaning that decoding of the current block is ended. If the current mode is not the skip mode, the entropy decoding analyzes the quantized coefficients, then inverse quantizes and inversely transforms to obtain residual blocks, and finally adds the residual blocks to the predicted blocks to obtain decoded blocks, meaning that decoding of the current block is finished.
In this way, embodiments of the present application limit the pixel locations used to derive temporal motion information from not exceeding the LCU boundaries of the current block so that hardware implements an application scenario without additional bandwidth increase. In the embodiment of the present application, mainly adopted modes 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 certain candidate position inside the LCU for that corner and outside the current block. (3) If the initial position of one corner falls outside the LCU, then the position of the corner of the other initial position falling inside the LCU is adjusted. The mode (2) is adopted in most cases, so that the hardware is realized without adding extra bandwidth and the compression performance of the hardware is kept as much as possible.
The embodiment provides an inter prediction method applied to a decoder. Analyzing the code stream to obtain the prediction mode parameter of the current block; determining at least one initial candidate position of the 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; adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information; and determining the inter prediction value of the current block according to the new motion information candidate list. In this way, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby enabling hardware implementation without adding additional bandwidth, and ensuring codec performance.
The embodiment of the application provides an inter prediction method, which is applied to video coding equipment, namely an encoder. The functions performed by the method may be performed by a second processor in the encoder calling a computer program, which may of course be stored in a second memory, it being seen that the encoder comprises at least the second processor and the second memory.
Referring to fig. 9, a flow chart of yet another inter prediction method according to an embodiment of the present application is shown. As shown in fig. 9, the method may include:
s901: determining a prediction mode parameter of the current block;
it should be noted that, the image to be encoded may be divided into a plurality of image blocks, the current image block to be encoded may be referred to as a current block, and the image blocks adjacent to the current block may be referred to as adjacent blocks; i.e. in the image to be encoded, there is a neighboring relationship between the current block and the neighboring block. Here, each current block may include a first image component, a second image component, and a third image component; i.e. the current block is the image block of the image to be encoded that is currently to be predicted for the first, second or third image component.
The current block may also be referred to as a luminance block, assuming that the current block performs first image component prediction and the first image component is a luminance component, that is, the image component to be predicted is a luminance component; alternatively, assuming that the current block performs the second image component prediction and the second image component is a chrominance component, i.e., the image component to be predicted is a chrominance component, the current block may also be referred to as a chrominance block.
It should be further noted that the prediction mode parameter indicates the prediction mode adopted by the current block and the parameter related to the prediction mode. Here, for the determination of the prediction mode parameters, a simple decision strategy may be adopted, such as determining according to the magnitude of the distortion value; complex decision strategies may also be employed, such as determining based on the results of rate distortion optimization (Rate Distortion Optimization, RDO), and the embodiments of the present application are not limited in any way. In general, the prediction mode parameters of the current block may be determined in an RDO manner.
Specifically, in some embodiments, for S901, the determining a prediction mode parameter of the current block may include:
precoding the current block by utilizing a plurality of prediction modes to obtain a rate distortion cost value corresponding to each prediction mode;
and selecting a minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determining a prediction mode corresponding to the minimum rate-distortion cost value as a prediction mode parameter of the current block.
That is, on the encoder side, the current block may be separately precoded with respect to the current block using a plurality of prediction modes. Here, the plurality of prediction modes generally include inter prediction modes, conventional intra prediction modes, and non-conventional intra prediction modes; among them, the conventional Intra prediction mode may include a Direct Current (DC) mode, a PLANAR (PLANAR) mode, an angle mode, etc., the non-conventional Intra prediction mode may include a Matrix-based Intra prediction (Matrix-based Intra Prediction, MIP) mode, a Cross-component linear model prediction (Cross-component Linear Model Prediction, CCLM) mode, an Intra Block Copy (IBC) mode, a PLT (Palette) mode, etc., and the inter prediction mode may include a normal inter prediction mode, a GPM prediction mode, an AWP prediction mode, etc.
Thus, after the current block is respectively precoded by utilizing a plurality of prediction modes, the rate distortion cost value corresponding to each prediction mode can be obtained; and then selecting the minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determining a prediction mode corresponding to the minimum rate-distortion cost value as a prediction mode parameter of the current block. In addition, after the current block is respectively precoded by using a plurality of prediction modes, a distortion value corresponding to each prediction mode can be obtained; and then selecting a minimum distortion value from the obtained multiple distortion values, and determining a prediction mode corresponding to the minimum distortion value as a prediction mode parameter of the current block. In this way, the current block is finally encoded using the determined prediction mode parameters, and in this prediction mode, the prediction residual may be made smaller, and the encoding efficiency may be improved.
S902: when the prediction mode parameter indicates that an inter prediction value of a current block is determined using a preset inter prediction mode, at least one initial candidate position of the current block is determined.
It should be noted that, if the prediction mode parameter indicates that the inter prediction value of the current block is determined using the preset inter prediction mode, the inter prediction method provided in the embodiment of the present application may be used. Here, the preset inter prediction mode may be a GPM prediction mode, an AWP prediction mode, or the like.
It should also be noted that the motion information may include motion vector information and reference frame information. In addition, the reference frame information may be a reference frame corresponding to the reference frame determined by the reference frame list and the reference index value together.
In some embodiments, for S902, the determining at least one initial candidate position of the current block may include:
acquiring at least one angle initial candidate position of the current block to form an initial candidate position set; wherein the at least one angular initial candidate position comprises at least one of: an upper left initial candidate position, an upper right initial candidate position, a lower left initial candidate position, and a lower right initial candidate position;
at least one initial candidate position of the current block is determined from the set of initial candidate positions.
Further, in some embodiments, the upper left initial candidate position includes at least one of: a first top-left candidate position, a second top-left candidate position, a third top-left candidate position, and a fourth top-left candidate position;
the upper right initial candidate position comprises at least one of the following: a first upper right candidate position, a second upper right candidate position, a third upper right candidate position, and a fourth upper right candidate position;
The lower left initial candidate position includes at least one of: a first lower left candidate position, a second lower left candidate position, a third lower left candidate position, and a fourth lower left candidate position;
the lower right initial candidate position includes at least one of: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
wherein the first upper left candidate position, the first upper right candidate position, the first lower left candidate position, and the first lower right candidate position represent four angular positions inside the current block, the second upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent an upper left angular position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position represent an upper right angular position outside the current block, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position represent a lower left angular position outside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right angular position outside the current block.
It should be noted that, assuming that the position of the upper left corner inside the current block, that is, the position of the pixel corresponding to the first pixel in the upper 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. In addition, the width and the height referred to herein generally refer to the width (i.e., l_width) and the height (i.e., l_height) of the luminance component, but are not particularly limited.
It should be further noted that, since the above-mentioned reference frame for deriving temporal motion information stores motion information for deriving temporal motion information in terms of blocks, the temporal motion information determined in terms of a certain pixel position and the temporal motion information determined in terms of other pixel positions in the same storage block as the pixel position are identical, so that there may be some intermediate calculations in the derivation process to obtain some positions in a unified format from a certain pixel position through some calculations, and these positions may be considered identical as long as they are all in the same storage block.
Taking fig. 6A-6E as an example, this provides a variety of initial candidate position scenarios. After the initial candidate position is obtained, it is necessary to determine whether the initial candidate position exceeds the LCU boundary of the current block to further determine how to process when the initial candidate position falls outside the LCU boundary.
S903: and under the condition that the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block.
It should be noted that, in order to avoid adding extra bandwidth when implementing hardware, it is necessary to determine whether at least one initial candidate position used for determining the temporal motion information exceeds the LCU boundary of the current block.
In some embodiments, for S903, the method may further include: the at least one initial candidate position is determined to be at least one target candidate position for the current block if the at least one initial candidate position does not exceed an LCU boundary for the current block.
That is, if a certain initial candidate position exceeds the LCU boundary, then an adjustment is required for the initial candidate position at this time, so that the adjusted target candidate position does not exceed the LCU boundary; if a certain initial candidate position does not exceed the boundary of the LCU, no adjustment is needed for the initial candidate position at this time, and the initial candidate position can be directly determined as the target candidate position.
In a possible implementation, candidate locations within the current block may be selected, where none of the candidate locations used exceeds the LCU boundary of the current block, which can be determined directly as target candidate locations. Thus, in some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises 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, determining that the at least one initial candidate position does not exceed an LCU boundary, and determining the at least one initial candidate position as at least one target candidate position of the current block.
In another possible implementation, for a certain corner, if the initial candidate position falls outside the LCU boundary, then a certain candidate position inside the LCU and outside the current block for that corner is first adjusted. Thus, in some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the 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.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the right lower initial candidate position and the right lower initial candidate position exceeds the LCU boundary, selecting a candidate position which does not exceed the LCU boundary from right lower corner positions outside the current block, and adjusting the right lower initial candidate position to the selected candidate position to obtain a target candidate position of the current block.
Further, the method may further include: and if no candidate position which does not exceed the boundary of the LCU is selected from the right lower corner positions outside the current block, adjusting the right lower initial candidate position to the right lower corner position inside the current block so as to obtain a target candidate position of the current block.
That is, taking the lower right corner as an example, if the lower right initial candidate position exceeds the LCU boundary, then first adjust to a certain candidate position inside the lower right LCU but outside the current block; if no candidate position that does not exceed the LCU boundary is selected from the lower right corner positions outside the current block, then an adjustment to the lower right corner position inside the current block is required to determine the corresponding target candidate position.
In yet another possible embodiment, if the initial candidate position falls outside the LCU boundary for a certain corner, then the candidate position for the corner whose other initial position falls inside the LCU may be adjusted. Thus, in some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the candidate positions corresponding to the rest corners except the one corner, and adjusting the initial candidate position of the one corner to the selected candidate position to obtain one target candidate position of the current block.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, adjusting the lower right initial candidate position to the upper right initial candidate position under the condition that the upper right initial candidate position does not exceed the LCU boundary so as to obtain a target candidate position of the current block.
In yet another possible implementation, if for a certain corner, the initial candidate position falls outside the LCU boundary and this corner can only be adjusted to the inside of the current block, then the candidate position for the corner whose other initial position falls inside the LCU can be adjusted. Thus, in some embodiments, the method may further comprise:
and if the at least one initial candidate position comprises the initial candidate position of one corner, the initial candidate position of the one corner exceeds the LCU boundary, and only the candidate position inside the current block in the candidate positions corresponding to the one corner does not exceed the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the candidate positions corresponding to the rest corners except the one corner, and adjusting the initial candidate position of the one corner to the selected candidate position to obtain one target candidate position of the current block.
Further, when the initial candidate position of one of the corners is the lower right initial candidate position, the method may further include:
and if the at least one initial candidate position comprises the lower right initial candidate position, the lower right initial candidate position exceeds an LCU boundary, and only the first lower right candidate position in the lower right corner positions inside and outside the current block does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position under the condition that the upper right initial candidate position does not exceed the LCU boundary, so that one target candidate position of the current block is obtained.
In a further possible embodiment, it is also possible to set a prioritization of the at least one initial candidate position for each partition mode and then check in turn whether the LCU boundary of the current block is exceeded. Thus, in some embodiments, the method may further comprise:
setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order aiming at different division modes;
selecting an initial candidate position according to the preset priority order, and judging whether the selected initial candidate position exceeds an LCU boundary;
if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset priority order;
and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
That is, different preset priority orders may be set for different division modes. Taking the partition mode 54 (starting from 0) as an example, for the partition mode 54, the priority ranks of four initial candidate positions, such as the upper left corner, the upper right corner, the lower left corner, the lower right corner, and the like, may be set, for example, the set initial candidate positions are ranked to be 3, 1, 2, and 0, i.e., the lower right corner is preferentially selected, the upper right corner is selected, the lower left corner is selected, and the upper left corner is selected; and judging in sequence according to the mode.
In a further possible embodiment, it is also possible to set a fixed ordering order of the at least one initial candidate position for each partition mode and then check in turn whether the LCU boundary of the current block is exceeded. Thus, in some embodiments, the method may further comprise:
ordering different initial candidate positions in the initial candidate position set according to a preset sequence aiming at different division modes;
selecting an initial candidate position according to the preset sequence, and judging whether the selected initial candidate position exceeds the LCU boundary;
if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset sequence;
and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
That is, it may also be ordered in a fixed preset order, such as the order 0,1,2,3,0,1, … …, if a certain partition mode first selects 3, i.e. the lower right corner, but the lower right corner cannot fall inside the LCU but is outside the current block; then 0 is chosen to try again, i.e. the upper left corner, and if 0 is not satisfied, then 1 is chosen to try again, i.e. the upper right corner, and so on, until all 4 initial candidate positions are judged in turn.
Further, if none of the four initial candidate locations can fall inside the LCU but outside the current block, then the current block inner location of the first corner of the position ordering (e.g., the preset priority order or the preset order) may also be set to determine it as the target candidate location; alternatively, if none of the four initial candidate locations fall inside the LCU but outside the current block, another way is to select a default location, such as the top left corner location inside the current block, to determine it as the target candidate location.
S904: at least one temporal motion information of the current block is determined based on the at least one target candidate position.
After obtaining at least one target candidate position, temporal motion information may be determined according to the obtained target candidate position, specifically, motion information used for a temporal position in a corresponding reference frame is taken as temporal motion information of the target candidate position. Here, the frame to which the current block belongs may be referred to as a current frame, and the target candidate position in the current frame is the same as the time domain position in the reference frame although the frame to which the current block belongs is different.
In some embodiments, for S904, the determining at least one temporal motion information of the current block based on the at least one target candidate position may include:
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 time domain position associated with the target candidate position in corresponding reference frame information, and determining motion information used by the time domain position as time domain motion information corresponding to the target candidate position;
and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
That is, temporal motion information is determined based on motion information used for a corresponding position in certain reference frame information. And different time domain motion information can be obtained for different target candidate positions.
Thus, after deriving temporal motion information, the obtained temporal motion information may be padded into a motion information candidate list to obtain a new motion information candidate list.
S905: and constructing a motion information candidate list based on the at least one time domain motion information.
It should be noted that, after obtaining at least one temporal motion information, it may be filled into the motion information candidate list to obtain a new motion information candidate list. Specifically, for S905, this step may include: and filling at least one piece of time domain motion information into the motion information candidate list to obtain the new motion information candidate list.
It should be noted that, in the existing motion information candidate list, only one filling position of temporal motion information is reserved, and in order to improve the correlation of the lower right corner, the filling position of the temporal motion information in the motion information candidate list may be further increased. Specifically, in some embodiments, the method may further comprise:
adjusting the proportion value of the time domain motion information in the new motion information candidate list;
and controlling filling positions of at least two time domain motion information reserved in the new motion information candidate list according to the adjusted proportion value.
That is, the scale value of temporal motion information in the motion information candidate list may be increased. If at least 1 position is reserved for temporal motion information in the candidate list in the AWP prediction mode, then it may be adjusted to reserve at least 2 (or 3) positions for temporal motion information in the candidate list in the AWP prediction mode, such that a filled position of at least two temporal motion information is reserved in the new motion information candidate list.
In this way, after deriving temporal motion information, a new candidate list of motion information can be constructed. The inter prediction value of the current block is then determined from the new motion information candidate list.
S906: and determining an inter prediction value of the current block according to the motion information candidate list.
It should be noted that, when the prediction mode parameter indicates that the inter prediction value of the current block is determined using a preset inter prediction mode (such as GPM or AWP), two partitions of the current block may be determined at this time. That is, the method may further include: determining two partitions of a current block when a prediction mode parameter indicates that an inter prediction value of the current block is determined using GPM or AWP; wherein the two partitions include a first partition and a second partition.
It should be noted that, after obtaining the new motion information candidate list, the motion information corresponding to the first partition of the current block and the motion information of the second partition may be determined; and then, according to the motion information corresponding to the first partition and the motion information of the second partition, determining the inter prediction value of the current block.
Specifically, as shown in fig. 10, a flow chart of still another inter prediction method provided in an embodiment of the present application is shown. The method may include:
s1001: determining motion information of the first partition and motion information of the second partition based on the motion information candidate list;
S1002: setting a first motion information index value as an index sequence number value of motion information of the first partition in the motion information candidate list, and setting a second motion information index value as an index sequence number value of motion information of the second partition in the motion information candidate list;
s1003: calculating a first predicted value of the first partition by using the motion information of the first partition, and calculating a second predicted value of the second partition by using the motion information of the second partition;
s1004: and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
Further, in some embodiments, the method may further comprise:
and writing the first motion information index value and the second motion information index value into a code stream.
Early coding techniques only had rectangular partitioning, whether CU, PU, or Transform Unit (TU) partitioning. The GPM or the AWP realizes non-rectangular division, namely a rectangular block can be divided into two subareas by a straight line, and the two subareas can be triangular, trapezoidal, rectangular or the like according to the difference of the positions and the angles of the straight line, so that the division is closer to the edge of an object or the edges of two areas with different movements. It should be noted that the division is not a true division, but rather a predictive effect division. Since this division only divides the weights of the two reference blocks when generating the prediction block, or can be simply understood that a part of the positions of the prediction block is from the first reference block and another part of the positions is from the second reference block, the current block is not really divided into two CUs or PUs or TUs by the division line. In this way, the residual transform, quantization, inverse transform, inverse quantization, etc. after prediction are also processed as a whole for the current block.
It should be further noted that the GPM or the AWP belongs to an inter-frame prediction technique, and on the encoder side, the GPM or the AWP needs to transmit a flag (flag) whether the GPM or the AWP is used or not and two motion information index values (such as a first motion information index value and a second motion information index value) in a code stream, so that on the subsequent decoder side, the flag whether the GPM or the AWP is used or not and the two motion information index values can be directly obtained by parsing the code stream.
That is, for the current block, precoding using GPM or AWP and other available prediction modes may be attempted to determine whether to use GPM or AWP. If the precoding cost of the GPM or AWP is minimal, then the GPM or AWP can be used. Meanwhile, when attempting to use GPM or AWP, a motion information candidate list may also be constructed in the same manner as described in the decoder-side embodiment.
Thus, at the encoder side, two unidirectional motion information are selected from the motion information candidate list, and then one mode is selected from the division modes of the GPM or AWP for precoding to determine the precoding cost of the GPM or AWP. One possible way is to determine the cost of all possible unidirectional motion information candidates based on their partition modes of all possible GPM or AWP, and then take the combination of the two unidirectional motion information with the smallest cost and the partition mode of GPM or AWP as the prediction mode of the two unidirectional motion information and GPM or AWP finally determined.
Finally, information whether GPM or AWP is used is written in the code stream. If it is determined that the GPM or AWP is used, the prediction mode parameter and two unidirectional motion information index values of the GPM or AWP are written in the code stream. Thus, if the current mode is the skip mode, the prediction block is both the encoded block, meaning that the encoding of the current block is ended. If the current mode is not the skip mode, the quantization coefficient is also required to be written in the code stream; the method comprises the steps of obtaining a residual block formed by subtracting a residual obtained by the inter-frame predicted value from an actual value of a current block by a quantized coefficient, transforming and quantizing the residual block, and ending the encoding of the current block at the moment. That is, if the current mode is not the skip mode, it is necessary to subtract the current block from the inter prediction block to obtain a residual block, and then transform, quantize, entropy-encode the residual block; subsequently, on the decoder side, for the case that the current mode is not the skip mode, the quantized coefficients are analyzed through entropy decoding, then the quantized coefficients are inversely quantized and inversely transformed to obtain residual blocks, and finally the residual blocks and the predicted blocks are added to obtain decoded blocks, which means that the decoding of the current block is finished.
The embodiment provides an inter prediction method applied to an encoder. Determining a prediction mode parameter of the current block; determining at least one initial candidate position of the 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; adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information; and determining the inter prediction value of the current block according to the new motion information candidate list. In this way, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby enabling hardware implementation without adding additional bandwidth, and ensuring codec performance.
Based on the same inventive concepts as the previous embodiments, referring to fig. 11, a schematic diagram of the composition structure of a decoder 110 according to an embodiment of the present application is shown. As shown in fig. 11, the decoder 110 may include: an analysis unit 1101, a first determination unit 1102, a first adjustment unit 1103, a first construction unit 1104, and a first prediction unit 1105; wherein, the liquid crystal display device comprises a liquid crystal display device,
an parsing unit 1101 configured to parse the code stream and obtain a prediction mode parameter of the current block;
a first determining unit 1102 configured to determine at least one initial candidate position 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;
a first adjusting unit 1103 configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block, if the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block;
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;
a first construction unit 1104 configured to construct a new motion information candidate list based on the at least one temporal motion information;
A first prediction unit 1105 configured to determine an inter prediction value of the current block according to the new motion information candidate list.
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.
In some embodiments, the first determining unit 1102 is further configured to obtain at least one angular initial candidate position of the current block, forming an initial candidate position set; wherein the at least one angular initial candidate position comprises at least one of: an upper left initial candidate position, an upper right initial candidate position, a lower left initial candidate position, and a lower right initial candidate position; and determining at least one initial candidate position of the current block from the initial candidate position set.
In some embodiments, the top left initial candidate position includes at least one of: a first top-left candidate position, a second top-left candidate position, a third top-left candidate position, and a fourth top-left candidate position;
the upper right initial candidate position at least comprises one of the following: a first upper right candidate position, a second upper right candidate position, a third upper right candidate position, and a fourth upper right candidate position;
The lower left initial candidate position at least comprises one of the following: a first lower left candidate position, a second lower left candidate position, a third lower left candidate position, and a fourth lower left candidate position;
the right lower initial candidate position at least comprises one of the following: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
wherein the first upper left candidate position, the first upper right candidate position, the first lower left candidate position, and the first lower right candidate position represent four angular positions inside the current block, the second upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent an upper left angular position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position represent an upper right angular position outside the current block, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position represent a lower left angular position outside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right angular position outside the current block.
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 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, and determine the at least one initial candidate position as the at least one target candidate position of the current block.
In some embodiments, the first determining unit 1102 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 an LCU boundary, select a candidate position that does not exceed the LCU boundary from candidate positions corresponding to the one of the corners, and adjust the initial candidate position of one of the corners to the selected candidate position to obtain one target candidate position of the current block.
In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, select a candidate position that does not exceed the LCU boundary from lower right corner positions outside the current block 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 adjust the lower right initial candidate position to the selected candidate position to obtain one target candidate position of the current block.
Further, the first determining unit 1102 is further configured to adjust the lower right initial candidate position to a lower right position inside the current block to obtain a target candidate position of the current block if no candidate position that does not exceed the LCU boundary is selected from the lower right positions outside the current block.
In some embodiments, the first determining unit 1102 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 candidate positions corresponding to remaining corners except for the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain one target candidate position of the current block.
In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, further comprise:
and if the at least one initial candidate position comprises the lower right initial candidate position and the lower right initial candidate position exceeds the LCU boundary, adjusting the lower right initial candidate position to the upper right initial candidate position under the condition that the upper right initial candidate position does not exceed the LCU boundary so as to obtain a target candidate position of the current block.
In some embodiments, the first determining unit 1102 is further configured to, if the at least one initial candidate position includes an initial candidate position of one of corners, and the initial candidate position of one of corners exceeds an LCU boundary, and only a candidate position inside the current block in the candidate positions corresponding to the one of corners does not exceed the LCU boundary, select a candidate position not exceeding the LCU boundary from candidate positions corresponding to remaining corners except the one of corners, and adjust the initial candidate position of the one of corners to the selected candidate position to obtain one target candidate position of the current block.
In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block if the at least one initial candidate position includes the lower right initial candidate position and the lower right initial candidate position exceeds an LCU boundary and only the first lower right candidate position in lower right corner positions inside and outside the current block does not exceed the LCU boundary.
In some embodiments, referring to fig. 11, the decoder 110 may further include a first setting unit 1106 and a first determination unit 1107; wherein, the liquid crystal display device comprises a liquid crystal display device,
a first setting unit 1106 configured to set priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order for different division modes;
a first determining unit 1107, 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, returning to execute the step of selecting one initial candidate position according to the preset priority order; and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
In some embodiments, the first setting unit 1106 is further configured to sort, for different division modes, different initial candidate positions in the initial candidate position set according to a preset order;
the first determining unit 1107 is further configured to select an initial candidate position according to the preset sequence, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset sequence; and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
In some embodiments, the first adjusting unit 1103 is further configured to adjust a scale value of the temporal motion information in the new motion information candidate list; and controlling filling positions of at least two time domain motion information reserved in the new motion information candidate list according to the adjusted proportion value.
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 position; and determining a time domain position associated with each target candidate position in corresponding reference frame information, and determining motion information used by the time domain position as time domain motion information corresponding to the target candidate position; and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
In some embodiments, the preset inter prediction mode includes: geometric partition prediction mode or angle weighted prediction mode;
the first determining unit 1102 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that an inter prediction value of the current block is determined using the preset inter prediction mode; wherein the two partitions include a first partition and a second partition.
In some embodiments, the parsing unit 1101 is further configured to parse a code stream, and determine a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
the first determining unit 1102 is further configured to determine, based on the new motion information candidate list, motion information in the new motion information candidate list indicated by the first motion information index value as motion information of the first partition, and motion information in the new motion information candidate list indicated by the second motion information index value as motion information of the second partition;
a first prediction unit 1105 further configured to calculate a first predicted value of the first partition using the motion information of the first partition, and calculate a second predicted value of the second partition using the motion information of the second partition; and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
It will be appreciated that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may of course be a module, or may be non-modular. Furthermore, the components in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer-readable storage medium, if not sold or used as separate products, and based on such understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, which is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor to perform all or part of the steps of the method described in the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Accordingly, the present embodiment provides a computer storage medium, applied to the decoder 110, which stores an inter-prediction program that when executed by the first processor implements the method described on the decoder side in the foregoing embodiment.
Based on the above composition of the decoder 110 and the computer storage medium, referring to fig. 12, a specific hardware structure example of the decoder 110 provided in the embodiment of the present application may include: a first communication interface 1201, a first memory 1202 and a first processor 1203; the various components are coupled together by a first bus system 1204. It is appreciated that the first bus system 1204 is used to enable connected communications between these components. The first bus system 1204 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration, the various buses are labeled as a first bus system 1204 in fig. 12. Wherein, the liquid crystal display device comprises a liquid crystal display device,
a first communication interface 1201, configured to receive and send signals during information transceiving with other external network elements;
a first memory 1202 for storing a computer program capable of running on the first processor 1203;
a first processor 1203 is configured to, when executing the computer program:
analyzing the code stream to obtain the prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
Adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information;
and determining the inter prediction value of the current block according to the new motion information candidate list.
It is appreciated that the first memory 1202 in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). The first memory 1202 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
While the first processor 1203 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the method described above may be performed by integrated logic circuits of hardware or instructions in software form in the first processor 1203. The first processor 1203 described above may be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the first memory 1202, and the first processor 1203 reads the information in the first memory 1202 and performs the steps of the above method in combination with its hardware.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP devices, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof. For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Optionally, as another embodiment, the first processor 1203 is further configured to perform the method of any of the previous embodiments when running the computer program.
The present embodiment provides a decoder that may include an parsing unit, a first determining unit, a first adjusting unit, a first constructing unit, and a first predicting unit. In the decoder, after at least one initial candidate position of the current block is determined, 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, thereby not increasing extra bandwidth when hardware is implemented, and simultaneously ensuring the coding and decoding performance.
Based on the same inventive concepts as the previous embodiments, referring to fig. 13, a schematic diagram of the composition structure of an encoder 130 according to an embodiment of the present application is shown. As shown in fig. 13, the encoder 130 may include: a second determination unit 1301, a second adjustment unit 1302, a second construction unit 1303, and a second prediction unit 1304; wherein, the liquid crystal display device comprises a liquid crystal display device,
a second determining unit 1301 configured to determine a prediction mode parameter of the current block; and determining at least one initial candidate position of the 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;
a second adjustment unit 1302, configured to adjust the at least one initial candidate position to obtain at least one target candidate position of the current block, if the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block;
A second determining unit 1301 further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;
a second construction unit 1303 configured to construct a new motion information candidate list based on the at least one temporal motion information;
the second prediction unit 1304 is configured to determine an inter prediction value of the current block according to the new motion information candidate list.
In some embodiments, referring to fig. 13, the encoder 130 may further include a pre-encoding unit 1305 configured to pre-encode the current block using a plurality of prediction modes to obtain a rate-distortion cost value corresponding to each prediction mode; and selecting a minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determining a prediction mode corresponding to the minimum rate-distortion cost value as a prediction mode parameter of the current block.
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 in case the at least one initial candidate position does not exceed the LCU boundary of the current block.
In some embodiments, the second determining unit 1301 is further configured to obtain at least one angular initial candidate position of the current block, forming an initial candidate position set; wherein the at least one angular initial candidate position comprises at least one of: an upper left initial candidate position, an upper right initial candidate position, a lower left initial candidate position, and a lower right initial candidate position; and determining at least one initial candidate position of the current block from the initial candidate position set.
In some embodiments, the top left initial candidate position includes at least one of: a first top-left candidate position, a second top-left candidate position, a third top-left candidate position, and a fourth top-left candidate position;
the upper right initial candidate position at least comprises one of the following: a first upper right candidate position, a second upper right candidate position, a third upper right candidate position, and a fourth upper right candidate position;
the lower left initial candidate position at least comprises one of the following: a first lower left candidate position, a second lower left candidate position, a third lower left candidate position, and a fourth lower left candidate position;
the right lower initial candidate position at least comprises one of the following: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
Wherein the first upper left candidate position, the first upper right candidate position, the first lower left candidate position, and the first lower right candidate position represent four angular positions inside the current block, the second upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent an upper left angular position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position represent an upper right angular position outside the current block, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position represent a lower left angular position outside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right angular position outside the current block.
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 determine the at least one initial candidate position as the at least one target candidate position of the current block.
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 candidate positions corresponding to the one of the corners, and adjust the initial candidate position of one of the corners to the selected candidate position, so as to obtain one target candidate position of the current block.
In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, select a candidate position that does not exceed the LCU boundary from the lower right corner positions outside the current block 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 adjust the lower right initial candidate position to the selected candidate position to obtain one target candidate position of the current block.
Further, the second determining unit 1301 is further configured to adjust the lower right initial candidate position to the lower right position inside the current block to obtain a target candidate position of the current block if no candidate position that does not exceed the LCU boundary is selected from the lower right positions outside the current block.
In some embodiments, the second determining unit 1301 is further configured to select a candidate position that does not exceed the LCU boundary from candidate positions corresponding to the remaining corners except for one of the corners 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 adjust the initial candidate position of one of the corners to the selected candidate position to obtain one target candidate position of the current block.
In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, adjust the lower right initial candidate position to the upper right initial candidate position to obtain one target candidate position of the current block 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 the upper right initial candidate position does not exceed the LCU boundary.
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 only the candidate position inside the current block in the candidate positions corresponding to the one of the corners does not exceed the LCU boundary, select a candidate position that does not exceed the LCU boundary from the candidate positions corresponding to the remaining corners except for the one of the corners, and adjust the initial candidate position of the one of the corners to the selected candidate position to obtain one target candidate position of the current block.
In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of the one corner is the lower right initial candidate position, adjust the lower right initial candidate position to the upper right initial candidate position to obtain one target candidate position of the current block if the at least one initial candidate position includes the lower right initial candidate position, the lower right initial candidate position exceeds an LCU boundary, and only the first lower right candidate position in the lower right corner positions inside and outside the current block does not exceed the LCU boundary.
In some embodiments, referring to fig. 13, the encoder 130 may further include a second setting unit 1306 and a second judging unit 1307; wherein, the liquid crystal display device comprises a liquid crystal display device,
a second setting unit 1306 configured to set priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order for different division modes;
a second judging unit 1307 configured to select an initial candidate position according to the preset priority order, and judge whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset priority order; and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
In some embodiments, the second setting unit 1306 is further configured to sort, for different division modes, different initial candidate positions in the initial candidate position set according to a preset order;
the second judging unit 1307 is further configured to select an initial candidate position according to the preset sequence, and judge whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, returning to execute the step of selecting one initial candidate position according to the preset sequence; and if the selected initial candidate position does not exceed the LCU boundary, determining the selected initial candidate position as a target candidate position of the current block.
In some embodiments, the second adjusting unit 1302 is further configured to adjust a scale value of temporal motion information in the new motion information candidate list; and controlling filling positions of at least two time domain motion information reserved in the new motion information candidate list according to the adjusted proportion value.
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 position; and determining a time domain position associated with each target candidate position in corresponding reference frame information, and determining motion information used by the time domain position as time domain motion information corresponding to the target candidate position; and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
In some embodiments, the preset inter prediction mode includes: geometric partition prediction mode or angle weighted prediction mode;
the second determining unit 1301 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that an inter prediction value of the current block is determined using the preset inter prediction mode; wherein the two partitions include a first partition and a second partition.
In some embodiments, the second determining unit 1301 is further configured to determine, based on the new motion information candidate list, the motion information of the first partition and the motion information of the second partition, and set a first motion information index value to an index sequence number value of the motion information of the first partition in the new motion information candidate list, and set a second motion information index value to an index sequence number value of the motion information of the second partition in the new motion information candidate list;
a second prediction unit 1304 further configured to calculate a first predicted value of the first partition using the motion information of the first partition, and calculate a second predicted value of the second partition using the motion information of the second partition; and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
In some embodiments, referring to fig. 13, the encoder 130 may further comprise a writing unit 1308 configured to write the first motion information index value and the second motion information index value to a bitstream.
It will be appreciated that in this embodiment, the "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and may of course be a module, or may be non-modular. Furthermore, the components in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer readable storage medium, if not sold or used as a separate product, and based on this understanding, the present embodiment provides a computer storage medium, applied to the encoder 130, which stores an inter prediction program, which when executed by the second processor, implements the method described in the encoder side of the previous embodiment.
Based on the above-described composition of the encoder 130 and the computer storage medium, referring to fig. 14, which shows a specific hardware structure example of the encoder 130 provided in the embodiment of the present application, may include: a second communication interface 1401, a second memory 1402 and a second processor 1403; the various components are coupled together by a second bus system 1404. It is appreciated that the second bus system 1404 is used to enable connected communications between these components. The second bus system 1404 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as a second bus system 1404 in fig. 14. Wherein, the liquid crystal display device comprises a liquid crystal display device,
a second communication interface 1401, configured to receive and send signals during the process of receiving and sending information with other external network elements;
a second memory 1402 for storing a computer program capable of being run on the second processor 1403;
a second processor 1403 for executing, when running the computer program:
determining a prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
Adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 new motion information candidate list based on the at least one temporal motion information;
and determining the inter prediction value of the current block according to the new motion information candidate list.
Optionally, as another embodiment, the second processor 1403 is further configured to perform the method of any of the previous embodiments when the computer program is run.
It is understood that the second memory 1402 is similar to the hardware function of the first memory 1202, and the second processor 1403 is similar to the hardware function of the first processor 1203; and will not be described in detail herein.
The present embodiment provides an encoder that may include a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit. In the encoder, after at least one initial candidate position of the current block is determined, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby not increasing extra bandwidth when hardware is implemented, and simultaneously ensuring the coding and decoding performance.
It should be noted that, in this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
The methods disclosed in the several method embodiments provided in the present application may be arbitrarily combined without collision to obtain a new method embodiment.
The features disclosed in the several product embodiments provided in the present application may be combined arbitrarily without conflict to obtain new product embodiments.
The features disclosed in the several method or apparatus embodiments provided in the present application may be arbitrarily combined without conflict to obtain new method embodiments or apparatus embodiments.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Industrial applicability
In the embodiment of the present application, whether the encoder or the decoder, after determining the prediction mode parameter of the current block, when the prediction mode parameter indicates that the inter prediction value of the current block is determined by using the preset inter prediction mode, determining at least one initial candidate position of the current block; under the condition that the at least one initial candidate position exceeds the 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 temporal motion information of the current block based on the at least one target candidate position; and constructing a motion information candidate list based on at least one piece of time domain motion information, and further determining an inter prediction value of the current block. In this way, after determining at least one initial candidate position of the current block, the at least one initial candidate position is adjusted so that the at least one target candidate position does not exceed the LCU boundary of the current block, thereby enabling hardware implementation without adding additional bandwidth, and ensuring codec performance.

Claims (28)

1. An inter prediction method applied to a decoder, the method comprising:
analyzing the code stream to obtain the prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 time domain motion information;
and determining an inter prediction value of the current block according to the motion information candidate list.
2. The method of claim 1, wherein the method further comprises:
the at least one initial candidate position is determined to be at least one target candidate position for the current block if the at least one initial candidate position does not exceed an LCU boundary for the current block.
3. The method of claim 1, wherein the determining at least one initial candidate location for the current block comprises:
acquiring at least one angular initial candidate position of the current block, wherein the at least one angular initial candidate position comprises: lower right initial candidate position;
and determining at least one initial candidate position of the current block according to the at least one angle initial candidate position.
4. The method of claim 3, wherein,
the right lower initial candidate position at least comprises one of the following: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
wherein the first lower right candidate position characterizes a lower right corner position inside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position characterize a lower right corner position outside the current block.
5. The method of claim 4, wherein the method further comprises:
and if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the 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.
6. The method of claim 5, wherein when the initial candidate position for the one corner is the lower right initial candidate position, the method further comprises:
and if the at least one initial candidate position comprises the right lower initial candidate position and the right lower initial candidate position exceeds the LCU boundary, selecting a candidate position which does not exceed the LCU boundary from right lower corner positions outside the current block, and adjusting the right lower initial candidate position to the selected candidate position to obtain a target candidate position of the current block.
7. The method of claim 6, wherein the method further comprises:
and if no candidate position which does not exceed the boundary of the LCU is selected from the right lower corner positions outside the current block, adjusting the right lower initial candidate position to the right lower corner position inside the current block so as to obtain a target candidate position of the current block.
8. The method of claim 1, wherein the determining at least one temporal motion information of the current block based on the at least one target candidate location 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 time domain position associated with the target candidate position in corresponding reference frame information, and determining time domain motion information corresponding to the target candidate position according to motion information used by the time domain position;
and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
9. The method of claim 1, wherein the preset inter prediction mode comprises an angle weighted prediction mode.
10. The method of claim 1, wherein the method further comprises:
determining two partitions of the current block; the two partitions comprise a first partition and a second partition, and the motion information of the first partition is different from that of the second partition.
11. The method of claim 10, wherein the determining the inter prediction value of the current block according to the motion information candidate list comprises:
analyzing the code stream, and determining a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
determining the motion information of the first partition according to the motion information in the motion information candidate list indicated by the first motion information index value, and determining the motion information of the second partition according to the motion information in the motion information candidate list indicated by the second motion information index value;
Calculating a first predicted value of the first partition by using the motion information of the first partition, and calculating a second predicted value of the second partition by using the motion information of the second partition;
and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
12. An inter prediction method applied to an encoder, the method comprising:
determining a prediction mode parameter of the current block;
determining at least one initial candidate position of the 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;
adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block under the condition that the at least one initial candidate position exceeds the 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 time domain motion information;
and determining an inter prediction value of the current block according to the motion information candidate list.
13. The method of claim 12, wherein the method further comprises:
the at least one initial candidate position is determined to be at least one target candidate position for the current block if the at least one initial candidate position does not exceed an LCU boundary for the current block.
14. The method of claim 12, wherein the determining at least one initial candidate location for the current block comprises:
acquiring at least one angular initial candidate position of the current block, wherein the at least one angular initial candidate position comprises: lower right initial candidate position;
and determining at least one initial candidate position of the current block according to the at least one angle initial candidate position.
15. The method of claim 14, wherein,
the right lower initial candidate position at least comprises one of the following: a first lower right candidate position, a second lower right candidate position, a third lower right candidate position, and a fourth lower right candidate position;
wherein the first lower right candidate position characterizes a lower right corner position inside the current block, and the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position characterize a lower right corner position outside the current block.
16. The method of claim 15, wherein the method further comprises:
and if the at least one initial candidate position comprises the initial candidate position of one corner and the initial candidate position of the one corner exceeds the LCU boundary, selecting the candidate position which does not exceed the LCU boundary from the 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.
17. The method of claim 16, wherein when the initial candidate position for the one corner is the lower right initial candidate position, the method further comprises:
and if the at least one initial candidate position comprises the right lower initial candidate position and the right lower initial candidate position exceeds the LCU boundary, selecting a candidate position which does not exceed the LCU boundary from right lower corner positions outside the current block, and adjusting the right lower initial candidate position to the selected candidate position to obtain a target candidate position of the current block.
18. The method of claim 17, wherein the method further comprises:
And if no candidate position which does not exceed the boundary of the LCU is selected from the right lower corner positions outside the current block, adjusting the right lower initial candidate position to the right lower corner position inside the current block so as to obtain a target candidate position of the current block.
19. The method of claim 12, wherein the determining at least one temporal motion information for the current block based on the at least one target candidate location 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 time domain position associated with the target candidate position in corresponding reference frame information, and determining time domain motion information corresponding to the target candidate position according to motion information used by the time domain position;
and correspondingly obtaining at least one piece of time domain motion information based on the at least one target candidate position.
20. The method of claim 12, wherein the preset inter prediction mode comprises an angle weighted prediction mode.
21. The method of claim 12, wherein the method further comprises:
determining two partitions of the current block; the two partitions comprise a first partition and a second partition, and the motion information of the first partition is different from that of the second partition.
22. The method of claim 21, wherein the determining the inter prediction value of the current block according to the motion information candidate list comprises:
determining the motion information of the first partition and the motion information of the second partition based on the motion information candidate list, setting a first motion information index value as an index sequence number 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 number value of the motion information of the second partition in the motion information candidate list;
calculating a first predicted value of the first partition by using the motion information of the first partition, and calculating a second predicted value of the second partition by using the motion information of the second partition;
and carrying out weighted fusion on the first predicted value and the second predicted value to obtain the inter predicted value of the current block.
23. The method of claim 22, wherein the method further comprises:
and writing the first motion information index value and the second motion information index value into a code stream.
24. A decoder comprising an parsing unit, a first determining unit, a first adjusting unit, a first constructing unit and a first predicting unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
The analysis unit is configured to analyze the code stream and acquire the prediction mode parameters of the 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 an inter prediction value of the current block is determined using a preset inter prediction mode;
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 under the condition that the at least one initial candidate position exceeds the maximum coding unit (LCU) boundary of the current block;
the first determining unit is further configured to determine at least one time domain motion information of the current block based on the at least one target candidate position;
the first construction unit is configured to construct a motion information candidate list based on the at least one piece of time domain motion information;
the first prediction unit is configured to determine an inter prediction value of the current block according to the motion information candidate list.
25. A decoder comprising a first memory and a first processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the first memory is used for storing a computer program capable of running on the first processor;
The first processor being adapted to perform the method of any of claims 1 to 11 when the computer program is run.
26. An encoder comprising a second determination unit, a second adjustment unit, a second construction unit and a second prediction unit; wherein, the liquid crystal display device comprises a liquid crystal display device,
the second determining unit is configured to determine a prediction mode parameter of the current block; and determining at least one initial candidate position of the 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;
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 under the condition that the at least one initial candidate position exceeds the 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 construction unit is configured to construct a motion information candidate list based on the at least one piece of time domain motion information;
the second prediction unit is configured to determine an inter prediction value of the current block according to the motion information candidate list.
27. An encoder, the encoder comprising a second memory and a second processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the second memory is used for storing a computer program capable of running on the second processor;
the second processor being adapted to perform the method of any of claims 12 to 23 when the computer program is run.
28. A computer storage medium storing a computer program which when executed by a first processor implements the method of any one of claims 1 to 11 or when executed by a second processor implements the method of any one of claims 12 to 23.
CN202310245097.1A 2020-06-24 2021-04-23 Inter prediction method, encoder, decoder, and computer storage medium Pending CN116471418A (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN2020105915977 2020-06-24
CN202010591597.7A CN113840148A (en) 2020-06-24 2020-06-24 Inter-frame prediction method, encoder, decoder, and computer storage medium
PCT/CN2021/089252 WO2021258841A1 (en) 2020-06-24 2021-04-23 Inter-frame prediction method, coder, decoder, and computer storage medium
CN202180008725.3A CN114930838A (en) 2020-06-24 2021-04-23 Inter-frame prediction method, encoder, decoder, and computer storage medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202180008725.3A Division CN114930838A (en) 2020-06-24 2021-04-23 Inter-frame prediction method, encoder, decoder, and computer storage medium

Publications (1)

Publication Number Publication Date
CN116471418A true CN116471418A (en) 2023-07-21

Family

ID=78964752

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202010591597.7A Withdrawn CN113840148A (en) 2020-06-24 2020-06-24 Inter-frame prediction method, encoder, decoder, and computer storage medium
CN202180008725.3A Pending CN114930838A (en) 2020-06-24 2021-04-23 Inter-frame prediction method, encoder, decoder, and computer storage medium
CN202310245097.1A Pending CN116471418A (en) 2020-06-24 2021-04-23 Inter prediction method, encoder, decoder, and computer storage medium

Family Applications Before (2)

Application Number Title Priority Date Filing Date
CN202010591597.7A Withdrawn CN113840148A (en) 2020-06-24 2020-06-24 Inter-frame prediction method, encoder, decoder, and computer storage medium
CN202180008725.3A Pending CN114930838A (en) 2020-06-24 2021-04-23 Inter-frame prediction method, encoder, decoder, and computer storage medium

Country Status (4)

Country Link
CN (3) CN113840148A (en)
MX (1) MX2022010727A (en)
TW (1) TW202201958A (en)
WO (1) WO2021258841A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023123478A1 (en) * 2021-12-31 2023-07-06 Oppo广东移动通信有限公司 Prediction methods and apparatuses, devices, system, and storage medium
WO2024027700A1 (en) * 2022-08-05 2024-02-08 Mediatek Inc. Joint indexing of geometric partitioning mode in video coding

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295347B (en) * 2011-08-29 2020-06-26 苗太平洋控股有限公司 Apparatus for decoding motion information in merge mode
CN107483927B (en) * 2011-09-09 2020-06-05 株式会社Kt Method for decoding video signal
KR20130050405A (en) * 2011-11-07 2013-05-16 오수미 Method for determining temporal candidate in inter prediction mode
KR20130050407A (en) * 2011-11-07 2013-05-16 오수미 Method for generating motion information in inter prediction mode
US10785494B2 (en) * 2017-10-11 2020-09-22 Qualcomm Incorporated Low-complexity design for FRUC
US11184633B2 (en) * 2018-11-27 2021-11-23 Qualcomm Incorporated Simplification of history-based motion vector prediction

Also Published As

Publication number Publication date
WO2021258841A1 (en) 2021-12-30
TW202201958A (en) 2022-01-01
MX2022010727A (en) 2022-09-23
CN114930838A (en) 2022-08-19
CN113840148A (en) 2021-12-24

Similar Documents

Publication Publication Date Title
US20220060736A1 (en) Method and an apparatus for processing a video signal
US11057618B2 (en) Method and apparatus for processing a video signal
JP7299342B2 (en) Video processing method, apparatus, storage medium and storage method
JP7313427B2 (en) Coefficient-dependent coding of transformation matrix selection
US10075707B2 (en) Video encoding and decoding
KR101430049B1 (en) Apparatus for decoding a moving picture
JP2024003124A (en) Restricted upsampling process in matrix-based intra prediction
EP2525575A2 (en) Processing method and device for video signals
US10681373B2 (en) Inter-prediction method and device in image coding system
US10742971B2 (en) Inter prediction method and device that performs prediction by applying weights to motion information of a current block
JP2022553789A (en) Syntax signaling and parsing based on color components
CN116471418A (en) Inter prediction method, encoder, decoder, and computer storage medium
CN113709498B (en) Inter prediction method, encoder, decoder, and computer storage medium
CN114651443A (en) Inter-frame prediction method, encoder, decoder, and computer storage medium
US10924730B2 (en) Image decoding method and device in image coding system
CN113727119B (en) Inter-frame prediction method, encoder, decoder, and computer storage medium
WO2022140905A1 (en) Prediction methods, encoder, decoder, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination