WO2021258841A1 - Inter-frame prediction method, coder, decoder, and computer storage medium - Google Patents

Inter-frame prediction method, coder, decoder, and computer storage medium Download PDF

Info

Publication number
WO2021258841A1
WO2021258841A1 PCT/CN2021/089252 CN2021089252W WO2021258841A1 WO 2021258841 A1 WO2021258841 A1 WO 2021258841A1 CN 2021089252 W CN2021089252 W CN 2021089252W WO 2021258841 A1 WO2021258841 A1 WO 2021258841A1
Authority
WO
WIPO (PCT)
Prior art keywords
candidate position
current block
initial candidate
motion information
initial
Prior art date
Application number
PCT/CN2021/089252
Other languages
French (fr)
Chinese (zh)
Inventor
杨宁
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to CN202180008725.3A priority Critical patent/CN114930838A/en
Priority to CN202310245097.1A priority patent/CN116471418A/en
Priority to MX2022010727A priority patent/MX2022010727A/en
Publication of WO2021258841A1 publication Critical patent/WO2021258841A1/en

Links

Images

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

Definitions

  • the hardware needs to add additional bandwidth to obtain the motion information of one or these positions.
  • This application proposes an inter-frame prediction method, an encoder, a decoder, and a computer storage medium, which can enable hardware implementation without adding additional bandwidth, and at the same time, can ensure codec performance.
  • the first adjustment unit is configured to adjust the at least one initial candidate position when the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block to obtain at least one of the current block A target candidate position;
  • the first construction unit is configured to construct a new motion information candidate list based on the at least one temporal motion information
  • the first memory is configured to store a computer program that can run on the first processor
  • FIG. 1 is a schematic diagram of the structure of a typical image group provided by an embodiment of this application;
  • 4A is a schematic diagram of the composition of a video encoding system provided by an embodiment of the application.
  • FIG. 5 is a schematic flowchart of an inter-frame prediction method provided by an embodiment of this application.
  • FIG. 11 is a schematic diagram of the composition structure of a decoder provided by an embodiment of the application.
  • a P frame is a frame that can only be predicted using a reference frame before the current frame in the Picture Order Count (POC).
  • the current reference frame has only one reference frame list, which is represented by RefPicList0; and RefPicList0 is all reference frames with POC before the current frame.
  • B-frame Bi-directional Interpolated Prediction Frame early is a frame that can be predicted using the reference frame of the POC before the current frame and the reference frame of the POC after the current frame.
  • the encoder or the decoder can usually use the index value (indicated by index) in the reference frame list to correspond to the reference frame. If the length of a reference frame list is 4, then index has four values such as 0, 1, 2, and 3. For example, if the RefPicList0 of the current frame has 4 reference frames with POC of 5, 4, 3, 0, then index 0 of RefPicList0 is the reference frame of POC 5, index 1 of RefPicList0 is the reference frame of POC 4, and index 2 of RefPicList0 is POC 3 reference frame, index 3 of RefPicList0 is POC 0 reference frame.
  • (x 0 , y 0 ) are the coordinates of the upper left corner sample of block E in the image
  • (x 1 , y 0 ) are the coordinates of the upper right corner sample of block E in the image
  • (x 0 , y 1 ) is block E
  • the spatial position relationship between block E and its neighboring blocks A, B, C, D, F, and G is shown in Fig. 2B.
  • the image is divided into the largest coding unit, the largest coding unit should not overlap, the sample in the upper left corner of the largest coding unit should not exceed the image boundary, and the sample in the lower right corner of the largest coding unit may exceed the image boundary.
  • the maximum coding unit is divided into one or more coding units, which is determined by the coding tree, and the coding unit can be divided into one or more transformation units.
  • mvX is mvRef
  • MVX is mvE0.
  • BlockDistanceRef DistanceIndexCol-DistanceIndexRef
  • each current block may include a first image component, a second image component, and a third image component, that is, the current block represents the prediction of the first image component, the second image component, or the third image component in the image to be decoded.
  • Image block may include a first image component, a second image component, and a third image component, that is, the current block represents the prediction of the first image component, the second image component, or the third image component in the image to be decoded.
  • the determining at least one candidate position of the current block may include:
  • At least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following: upper left initial candidate position, upper right initial candidate position, and lower left initial candidate position And the initial candidate position in the lower right;
  • the width of the current block is width
  • the height of the current block is height.
  • the width and height mentioned here generally refer to the width (i.e., l_width) and height (i.e., l_height) of the brightness component, but are not specifically limited.
  • the first upper right candidate position, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position to represent, specifically expressed as (x+width-1,y), (x+width,y), (x+width,y-1), (x+width-1,y-1) and other four positions.
  • the lower left corner it can be represented by the first lower left candidate position, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position, specifically expressed as (x,y+height-1), (x,y+height), (x-1,y+height), (x-1,y+height), (x-1,y+height-1) and other four positions.
  • the four positions of the current block namely, the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner
  • one of the positions can be initially selected.
  • the four positions are: the upper left initial candidate position is (x, y), the upper right initial candidate position is (x+width, y), and the lower left initial candidate position is (x, y+ height), the initial candidate position at the bottom right is (x+width,y+height).
  • the method may further include: if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, adjusting the lower right initial candidate position to the right inside the current block The lower corner position to obtain a target candidate position of the current block.
  • the text is described as follows. Among them, the text description only modifies the pixel positions of method one, method two, method three and method four.
  • the brightness sample position (x, y) in the upper left corner may never exceed the image or slice boundary; that is, the above text description is only for the purpose of changing to maintain the consistency of the format.
  • the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, a candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position of the current block.
  • S504 Determine at least one temporal motion information of the current block based on the at least one candidate target position.
  • the temporal motion information is determined according to the motion information used in the corresponding position in a certain reference frame information. And for different target candidate positions, different temporal motion information can be obtained.
  • the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), the motion
  • the distance index of the image where the information storage unit is located is recorded as DistanceIndexCol
  • the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
  • mvX is mvRef
  • MVX is mvE0.
  • mvX is mvRef
  • MVX is mvE1.
  • the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero.
  • the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position in the upper right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y),
  • the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
  • BlockDistanceRef DistanceIndexCol-DistanceIndexRef
  • the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero.
  • the L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position at the lower right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y),
  • the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
  • mvX is mvRef
  • MVX is mvE0.
  • mvX is mvRef
  • MVX is mvE1.
  • the obtained temporal motion information can be filled into the motion information candidate list to obtain a new motion information candidate list.
  • the method may further include:
  • S506 Determine the inter prediction value of the current block according to 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 can be determined; and then according to the motion information and the motion information corresponding to the first partition
  • the motion information of the second partition can determine the inter-frame prediction value of the current block.
  • S704 Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  • block E is the current block
  • block A, block B, block C, block D, block F, and block G are all adjacent blocks of block E.
  • the adjacent block A of the block E is the block where the sample (x 0 -1, y 0 ) is located
  • the adjacent block B of the block E is the block where the sample (x 0 , y 0 -1) is located
  • the phase of the block E The adjacent block C is the block where the sample (x 0 +1, y 0 -1) is located
  • the adjacent block D of the block E is the block where the sample (x 0 -1, y 0 -1) is located
  • the adjacent block of the block E F is the block where the sample (x 0 -1, y 1 ) is located
  • the adjacent block G of the block E is the block where the sample (x 1 , y 0 -1) is located.
  • the first one-way motion information is represented as mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1.
  • mvAwp0L0 represents the corresponding motion vector in the first reference frame list RefPicList0
  • RefIdxAwp0L0 represents the reference index value of the corresponding reference frame in the first reference frame list RefPicList0
  • mvAwp0L1 represents the corresponding motion vector in the second reference frame list RefPicList1
  • the motion vector, RefIdxAwp0L1 represents the reference index value of the corresponding reference frame in the second reference frame list RefPicList1.
  • F, G, C, A, B, and D are adjacent blocks of the current block E, and determine the "availability" of F, G, C, A, B, and D:
  • the one-way motion information available in the order of F, G, C, A, B, and D is put into the one-way motion information candidate list (represented by AwpUniArray) until the length of the AwpUniArray is 3 or the traversal ends.
  • the third step if the length of AwpUniArray is less than 3, split the bidirectional motion information available in the order of F, G, C, A, B and D into one-way motion information pointing to the reference frame list List0 and pointing to the reference frame list List1
  • For the unidirectional movement information first perform the duplication operation of the unidirectional movement information, and if it is not repeated, put it into the AwpUniArray until the length is 3 or the traversal ends.
  • the fourth step is to split the derived two-way motion information in the time domain into one-way motion information pointing to the reference frame list List0 and one-way motion information pointing to the reference frame list List1, and perform the one-way motion information double-checking operation first. If it is not repeated, put it into AwpUniArray until the length is 4 or the traversal ends.
  • the fifth step if the length of AwpUniArray is less than 4, the last one-way motion information in AwpUniArray will be filled repeatedly until the length of AwpUniArray is 4.
  • F, G, C, A, B, and D are adjacent blocks of the current block E, and determine the "availability" of F, G, C, A, B, and D:
  • the fourth step if the length of the AwpCandArray is less than 5, four motion information is generated in sequence, and the reference frame information of the generated four motion information is the same as the reference frame information of the first motion information in the AwpCandArray.
  • the motion vectors corresponding to the List0 and List1 lists of the first motion information in AwpCandArray are recorded as (x, y), and the motion vectors in the candidate list corresponding to the four motion information generated are (x0, y0), (x1, y1), (x2,y2) and (x3,y3), calculated as follows,
  • the fifth step is to assign a certain individual motion information of the AwpCandIdx0+1th motion candidate in the AwpCandArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1:
  • AwpCandIdx1 is an even number, assign the one-way motion information that the motion candidate points to the reference frame list List0 to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1; if List0 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List1 is assigned to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to -1.
  • AwpCandIdx1 is an odd number, assign the one-way motion information of the motion candidate to the reference frame list List1 to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, RefIdxAwp1L0 is equal to -1; if List1 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List0 is assigned to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1.
  • 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
  • the embodiment of the present application provides an inter-frame prediction method, which is applied to a video encoding device, that is, an encoder.
  • the functions implemented by the method can be implemented by the second processor in the encoder calling a computer program.
  • the computer program can be stored in the second memory.
  • the encoder includes at least a second processor and a second memory.
  • the current block performs the first image component prediction, and the first image component is the brightness component, that is, the image component to be predicted is the brightness component, then the current block can also be called the brightness block; or, it is assumed that the current block performs the second image component Prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.
  • the motion information may include motion vector information and reference frame information.
  • the reference frame information may be the reference frame corresponding to the reference frame list and the reference index value.
  • the determining at least one initial candidate position of the current block may include:
  • At least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following: upper left initial candidate position, upper right initial candidate position, and lower left initial candidate position And the initial candidate position in the lower right;
  • the upper left initial candidate position includes at least one of the following: 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;
  • the initial lower right candidate position includes at least 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;
  • the motion information is stored in blocks, so the time-domain motion information determined according to a certain pixel position and in accordance with the The time domain motion information determined by other pixel positions in the same storage block as the pixel position is the same, so there may be some intermediate calculations during the export process.
  • a certain pixel position may be calculated to obtain a certain uniform format position. As long as they are all in the same storage block, these positions can be considered the same.
  • the method may further include: in the case that the at least one initial candidate position does not exceed the LCU boundary of the current block, determining the at least one initial candidate position as the At least one target candidate position of the current block.
  • a candidate position within the current block can be selected.
  • the candidate position used does not exceed the LCU boundary of the current block, and it can be directly determined as the target candidate position. Therefore, in some embodiments, the method may further include:
  • 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 right candidate position Next candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined as the at least one target candidate position of the current block.
  • the method may further include:
  • 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, select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, The lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  • the method may further include: if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, adjusting the lower right initial candidate position to the right inside the current block The lower corner position to obtain a target candidate position of the current block.
  • the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select the candidate positions corresponding to the remaining corners except for the one of the corners. For candidate positions beyond the boundary of the LCU, the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  • the method may further include:
  • the method may further include:
  • the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, a candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position of the current block.
  • the method may further include:
  • the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate is included in the lower right corner positions inside and outside the current block If the position does not exceed the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block .
  • the priority order of the at least one initial candidate position may be set for each division mode, and then it is checked in turn whether it exceeds the LCU boundary of the current block. Therefore, in some embodiments, the method may further include:
  • the selected initial candidate position is determined as a target candidate position of the current block.
  • different preset priority orders can be set. Still taking the division mode 54 as an example (starting from 0), for the division mode 54, you can set the priority order of the four initial candidate positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner.
  • the initial candidate position order is set as 3, 1, 2, 0, that is, the lower right corner is selected first, then the upper right corner is selected, then the lower left corner is selected, and the upper left corner is finally selected; the judgments are made in sequence according to the above method.
  • the selected initial candidate position is determined as a target candidate position of the current block.
  • the position sorting (such as the preset priority order or the preset order) of the first corner of the current block internal position can also be set, To determine it as the target candidate position; or, if the four initial candidate positions cannot fall inside the LCU but are outside the current block, another way is to select a default position, such as the upper left corner position inside the current block, to change It is determined as the target candidate position.
  • S904 Determine at least one temporal motion information of the current block based on the at least one candidate target position.
  • the determining at least one temporal motion information of the current block based on the at least one target candidate position may include:
  • For each target candidate position determine the time domain position associated with the target candidate position in the corresponding reference frame information, and determine the motion information used by the time domain position as the time domain motion corresponding to the target candidate position information;
  • the temporal motion information is determined according to the motion information used in the corresponding position in a certain reference frame information. And for different target candidate positions, different time-domain motion information can be obtained.
  • this step may include: filling at least one temporal motion information into the motion information candidate list to obtain the new motion information candidate list.
  • the method may further include:
  • the ratio of the temporal motion information in the motion information candidate list can be increased. If at least 1 position is reserved for temporal motion information in the candidate list in AWP prediction mode, then it can be adjusted to reserve at least 2 (or 3) positions for temporal motion information in the candidate list in AWP prediction mode, so that the new At least two filling positions of time-domain motion information are reserved in the candidate list of motion information.
  • S906 Determine the inter prediction value of the current block according to the new motion information candidate list.
  • the method may further include: when the prediction mode parameter indicates that the inter prediction value of the current block is determined using GPM or AWP, determining two partitions of the current block; wherein, the two partitions include the first partition And the second partition.
  • a preset inter prediction mode such as GPM or AWP
  • the motion information corresponding to the first partition of the current block and the motion information of the second partition can be determined; and then according to the motion information and the motion information corresponding to the first partition
  • the motion information of the second partition can determine the inter-frame prediction value of the current block.
  • FIG. 10 shows a schematic flowchart of still another inter-frame prediction method provided by an embodiment of the present application.
  • the method can include:
  • S1001 Determine the motion information of the first partition and the motion information of the second partition based on the new motion information candidate list;
  • S1002 Set the first motion information index value to the index number value of the motion information of the first partition in the new motion information candidate list, and set the second motion information index value to the motion of the second partition The index number value of the information in the new motion information candidate list;
  • S1003 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;
  • S1004 Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  • the method may further include:
  • the first motion information index value and the second motion information index value are written into a code stream.
  • this division only divides the weight of the two reference blocks when generating the prediction block, or it can be simply understood that part of the position of the prediction block comes from the first reference block, and another part of the position comes from the second reference block, and There is no real division of the current block into two CUs or PUs or TUs according to the dividing line. In this way, the transformation, quantization, inverse transformation, and inverse quantization of the residuals after prediction are also processed with the current block as a whole.
  • two unidirectional motion information is selected from the motion information candidate list, and then one of the GPM or AWP division modes is selected for precoding to determine the precoding cost of GPM or AWP.
  • One possible way is to combine all possible one-way motion information candidates, determine the cost based on all possible GPM or AWP division modes, and then replace the two least expensive one-way motion information and the GPM or AWP division mode The combination of two one-way motion information and GPM or AWP finally determined prediction mode.
  • write information about whether GPM or AWP is used in the code stream If it is determined to use GPM or AWP, write the prediction mode parameter of GPM or AWP and two unidirectional motion information index values in the code stream. In this way, if the current mode is the skip mode, then the prediction block is both a coding block, which means that the coding of the current block is finished. If the current mode is not the skip mode, quantization coefficients need to be written in the bitstream; among them, the quantization coefficient is a residual block composed of the actual value of the current block minus the residual obtained by the inter-frame prediction value, and the residual The difference block is obtained by transforming and quantizing. At this time, the encoding of the current block ends.
  • the current mode is not the skip mode
  • the quantized coefficients are analyzed through entropy decoding, then inverse quantization and inverse transformation are used to obtain the residual block, and finally the residual block and the prediction block are added to obtain the decoded block, which means that the decoding of the current block is finished.
  • This embodiment provides an inter-frame prediction method, which is applied to an encoder. Determine the prediction mode parameter of the current block; when the prediction mode parameter indicates to use the preset inter prediction mode to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block; When the initial candidate position exceeds the maximum coding unit LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block; based on the at least one target candidate position, Determine at least one temporal motion information of the current block; construct a new motion information candidate list based on the at least one temporal motion information; determine the inter prediction of the current block according to the new motion information candidate list value.
  • 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
  • the first determining unit 1102 is configured to determine at least one initial candidate position of the current block when the prediction mode parameter indicates that a preset inter prediction mode is used to determine the inter prediction value of the current block;
  • the first adjustment unit 1103 is configured to adjust the at least one initial candidate position when the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block to obtain at least one of the current block Target candidate position;
  • the first prediction unit 1105 is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
  • the first determining unit 1102 is further configured to determine the at least one initial candidate position as the current block when the at least one initial candidate position does not exceed the LCU boundary of the current block At least one target candidate location.
  • the first determining unit 1102 is further configured to obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein, the at least one corner initial candidate position includes at least one of the following : 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 from the initial candidate position set, at least one initial candidate position of the current block is determined.
  • the initial upper left candidate position includes at least one of the following: 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;
  • the upper right initial candidate position includes 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 initial lower right candidate position includes at least 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;
  • the first determining unit 1102 is further configured to, 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 The first lower left candidate position, and/or the first lower right candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined to be at least one of the current block Target candidate position.
  • the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, and adjust the lower right initial candidate position to the selected candidate position To obtain a target candidate position of the current block.
  • the first determining unit 1102 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then divide the Among the candidate positions corresponding to the remaining corners other than one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain one of the current block Target candidate position.
  • 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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right The initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  • 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, and the Among the candidate positions corresponding to a corner, only the candidate position inside the current block does not exceed the LCU boundary, then the candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners except for one of the corners, and The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  • the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate position does not exceed the LCU boundary in the lower right corner positions inside and outside the current block, then the upper right initial candidate position does not When the boundary of the LCU is exceeded, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  • the decoder 110 may further include a first setting unit 1106 and a first determining unit 1107; wherein,
  • the first setting unit 1106 is 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;
  • the first determining unit 1107 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to execution The step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  • the first setting unit 1106 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different division modes;
  • the first adjustment unit 1103 is further configured to adjust the scale value of the temporal motion information in the new motion information candidate list; and control the new motion information candidate according to the adjusted scale value At least two filling positions for time-domain motion information are reserved in the list.
  • the first determining unit 1102 is further configured to determine the reference frame information corresponding to each target candidate position in the at least one target candidate position; and for each target candidate position, in the corresponding reference frame information Determine the time domain position associated with the target candidate position, and determine the motion information used by the time domain position as the time domain motion information corresponding to the target candidate position; based on the at least one target candidate position, correspondingly obtain at least A time domain motion information.
  • the preset inter-frame prediction mode includes: a geometric division prediction mode or an 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 the preset inter prediction mode is used to determine the inter prediction value of the current block; wherein, the The two partitions include the first partition and the second partition.
  • the parsing unit 1101 is further configured to parse the code stream to determine a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
  • a "unit" may be a part of a circuit, a part of a processor, a part of a program, or software, etc., of course, may also be a module, or may also be non-modular.
  • the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
  • the embodiment of the present application provides a computer storage medium, which is applied to the decoder 110, and the computer storage medium stores an inter-frame prediction program.
  • the inter-frame prediction program is executed by the first processor to realize the decoding in the foregoing embodiment. The method described on the device side.
  • FIG. 12 shows an example of a specific hardware structure of the decoder 110 provided by an embodiment of the present application, which may include: a first communication interface 1201, a first memory 1202, and a first communication interface 1201; A processor 1203; various components are coupled together through a first bus system 1204.
  • the first bus system 1204 is used to implement connection and communication between these components.
  • the first bus system 1204 also includes a power bus, a control bus, and a status signal bus.
  • various buses are marked as the first bus system 1204 in FIG. 12. in,
  • the first communication interface 1201 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • the first processor 1203 is configured to execute: when running the computer program:
  • the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
  • the first memory 1202 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • Enhanced SDRAM, ESDRAM Synchronous Link Dynamic Random Access Memory
  • Synchlink DRAM Synchronous Link Dynamic Random Access Memory
  • DRRAM Direct Rambus RAM
  • the first processor 1203 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the first processor 1203 or instructions in the form of software.
  • the above-mentioned first processor 1203 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC application specific integrated circuit
  • FPGA ready-made programmable gate array
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the first memory 1202, and the first processor 1203 reads the information in the first memory 1202, and completes the steps of the foregoing method in combination with its hardware.
  • the embodiments described in this application can be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, and others for performing the functions described in this application Electronic unit or its combination.
  • ASIC application specific integrated circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing equipment
  • PLD programmable Logic Device
  • PLD Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the technology described in this application can be implemented through modules (for example, procedures, functions, etc.) that perform the functions described in this application.
  • the software codes can be stored in the memory and executed by
  • the first processor 1203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
  • This embodiment provides a decoder, which may include an analysis unit, a first determination unit, a first adjustment unit, a first construction unit, and a first prediction unit.
  • the decoder 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, so that the hardware can be implemented constantly. Increase the extra bandwidth, while still being able to guarantee the codec performance.
  • FIG. 13 shows a schematic diagram of the composition structure of an encoder 130 provided by an embodiment of the present application.
  • 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 second determining unit 1301 is configured to determine the prediction mode parameter of the current block; and when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one of the current block Initial candidate position;
  • the second adjustment unit 1302 is configured to adjust the at least one initial candidate position to obtain at least one of the current block when the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block Target candidate position;
  • the second determining unit 1301 is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;
  • the second prediction unit 1304 is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
  • the encoder 130 may further include a pre-encoding unit 1305, configured to perform pre-encoding processing on the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode. And selecting the minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determine the prediction mode corresponding to the minimum rate-distortion cost value as the prediction mode parameter of the current block.
  • a pre-encoding unit 1305 configured to perform pre-encoding processing on the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode.
  • the second determining unit 1301 is further configured to determine the at least one initial candidate position as the current block when the at least one initial candidate position does not exceed the LCU boundary of the current block At least one target candidate location.
  • the second determining unit 1301 is further configured to obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following : 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 from the initial candidate position set, at least one initial candidate position of the current block is determined.
  • the initial upper left candidate position includes at least one of the following: 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;
  • the upper right initial candidate position includes 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 initial lower left candidate position includes at least 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 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 corner positions inside the current block
  • the second The upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent the upper left corner position outside the current block
  • the second upper right candidate position, the third upper right candidate position, and the fourth The upper right candidate position represents the upper right corner 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 the lower left corner position outside the current block
  • the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right corner position outside the current block.
  • the second determining unit 1301 is further configured to, 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 The first lower left candidate position, and/or the first lower right candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined to be at least one of the current block Target candidate position.
  • the second determining unit 1301 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then divide the Among the candidate positions corresponding to the remaining corners other than one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain one of the current block Target candidate position.
  • 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 the Among the candidate positions corresponding to a corner, only the candidate position inside the current block does not exceed the LCU boundary, then the candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners except for one of the corners, and The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  • the encoder 130 may further include a second setting unit 1306 and a second determining unit 1307; wherein,
  • the second determining unit 1307 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to execution The step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  • the second setting unit 1306 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different division modes
  • the second determining unit 1307 is further configured to select an initial candidate position according to the preset order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the execution The step of selecting an initial candidate position according to the preset order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  • the second adjustment unit 1302 is further configured to adjust the ratio value of the temporal motion information in the new motion information candidate list; and control the new motion information candidate according to the adjusted ratio value At least two filling positions for time-domain motion information are reserved in the list.
  • the second determining unit 1301 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block; wherein, the The two partitions include the first partition and the second partition.
  • the second prediction unit 1304 is further configured to calculate a first prediction value of the first partition using the motion information of the first partition, and calculate a second prediction value of the second partition using the motion information of the second partition And performing weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  • the encoder 130 may further include a writing unit 1308 configured to write the first motion information index value and the second motion information index value into a code stream.
  • a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, or it may be non-modular.
  • the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be realized in the form of hardware or software function module.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium.
  • this embodiment provides a computer storage
  • the medium is applied to the encoder 130, and the computer storage medium stores an inter-frame prediction program.
  • the inter-frame prediction program is executed by the second processor, the method described on the encoder side in the foregoing embodiment is implemented.
  • the second communication interface 1401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
  • the second memory 1402 is configured to store a computer program that can run on the second processor 1403;
  • the second processor 1403 is configured to execute: when the computer program is running:
  • the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
  • the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
  • the second processor 1403 is further configured to execute the method described in any one of the foregoing embodiments when the computer program is running.
  • the hardware function of the second memory 1402 is similar to that of the first memory 1202, and the hardware function of the second processor 1403 is similar to that of the first processor 1203; it will not be described in detail here.
  • This embodiment provides an encoder, which may include a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit.
  • the encoder 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, so that the hardware can be implemented constantly. Increase additional bandwidth, while also ensuring codec performance.
  • the current block is determined At least one initial candidate position of the block; when the at least one initial candidate position exceeds the LCU boundary of the current block, adjust the at least one initial candidate position to obtain at least one target candidate position of the current block; based on the at least one target
  • the candidate position determines at least one temporal motion information of the current block; based on the at least one temporal motion information, a motion information candidate list is constructed to determine the inter-frame prediction value 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

Disclosed are an inter-frame prediction method, a coder, a decoder, and a computer storage medium. The method is applied to the decoder. The method comprises: parsing a code stream, and obtaining a prediction mode parameter of the current block; when the prediction mode parameter indicates the use of a preset inter-frame prediction mode to determine an inter-frame prediction value of the current block, determining at least one initial candidate position of the current block; when the at least one initial candidate position exceeds the boundary of the largest 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; on the basis of the at least one target candidate position, determining at least one time domain motion information of the current block; on the basis of the at least one time domain motion information, constructing a new motion information candidate list; and according to the new motion information candidate list, determining the inter-frame prediction value of the current block.

Description

帧间预测方法、编码器、解码器以及计算机存储介质Inter-frame prediction method, encoder, decoder and computer storage medium
相关申请的交叉引用Cross-references to related applications
本申请要求在2020年06月24日提交中国专利局、申请号为202010591597.7、申请名称为“帧间预测方法、编码器、解码器以及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 24, 2020, the application number is 202010591597.7, and the application name is "Interframe Prediction Method, Encoder, Decoder, and Computer Storage Medium", and its entire content Incorporated in this application by reference.
技术领域Technical field
本申请涉及视频编解码技术领域,尤其涉及一种帧间预测方法、编码器、解码器以及计算机存储介质。This application relates to the technical field of video coding and decoding, and in particular to an inter-frame prediction method, an encoder, a decoder, and a computer storage medium.
背景技术Background technique
在视频编解码领域,针对当前块进行编解码的过程,除了采用帧内预测方式外,还可以采用帧间预测方式。其中,帧间预测可以包括帧间几何划分预测模式(Geometric Partitioning Mode,GPM)和角度加权预测模式(Angular Weighted Prediction,AWP)等,通过将帧间的当前块划分为两个非矩形的分区(或两个块)分别进行预测后再加权融合,能够得到当前块的预测值。In the field of video coding and decoding, in addition to the intra-frame prediction method, the inter-frame prediction method can also be used in the coding and decoding process for the current block. Among them, inter-frame prediction can include geometric partitioning prediction mode (Geometric Partitioning Mode, GPM) and angle-weighted prediction mode (Angular Weighted Prediction, AWP), etc., by dividing the current block between frames into two non-rectangular partitions ( (Or two blocks) are respectively predicted and then weighted and merged to obtain the predicted value of the current block.
目前,在GPM或AWP的预测过程中,时域运动信息是来自于已编码完成的参考帧,这时候不再局限于当前块左上角位置。针对右上、左下、右下等三个位置都处于当前块的外部,如果某一个位置不可用,比如超出图像边界、片(patch)边界等,那么才会调整为当前块的内部位置。然而针对当前块的最大编码单元(Largest Coding Unit,LCU),目前只缓存与当前LCU相同位置的一个LCU大小的部分的运动信息。如果当前块的右边界正好与当前LCU的右边界重合,或当前块的下边界正好与当前LCU的下边界重合,那么右上、左下、右下三个位置中至少有一个超出当前LCU的边界,这时候如果某个或这几个位置仍然在图像内部或patch内部,表示仍然是可用的,此时硬件就需要增加额外的带宽来获取某个或这几个位置的运动信息。At present, in the prediction process of GPM or AWP, the temporal motion information comes from the reference frame that has been coded, and this time is no longer limited to the upper left corner of the current block. Regarding the top right, bottom left, and bottom right positions are all outside the current block, if a certain position is not available, such as beyond the image boundary, patch boundary, etc., then it will be adjusted to the internal position of the current block. However, for the Largest Coding Unit (LCU) of the current block, currently only the part of the motion information of the size of one LCU at the same position as the current LCU is cached. If the right boundary of the current block coincides with the right boundary of the current LCU, or the lower boundary of the current block coincides with the lower boundary of the current LCU, then at least one of the upper right, lower left, and lower right positions exceeds the boundary of the current LCU, At this time, if one or these positions are still inside the image or the patch, it means that they are still available. At this time, the hardware needs to add additional bandwidth to obtain the motion information of one or these positions.
发明内容Summary of the invention
本申请提出一种帧间预测方法、编码器、解码器以及计算机存储介质,可以使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。This application proposes an inter-frame prediction method, an encoder, a decoder, and a computer storage medium, which can enable hardware implementation without adding additional bandwidth, and at the same time, can ensure codec performance.
本申请的技术方案是这样实现的:The technical solution of this application is realized as follows:
第一方面,本申请实施例提供了一种帧间预测方法,应用于解码器,该方法包括:In the first aspect, an embodiment of the present application provides an inter-frame prediction method, which is applied to a decoder, and the method includes:
解析码流,获取当前块的预测模式参数;Parse the code stream to obtain the prediction mode parameters of the current block;
当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
基于所述至少一个时域运动信息,构建新的运动信息候选列表;Constructing a new candidate list of motion information based on the at least one temporal motion information;
根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame prediction value of the current block according to the new motion information candidate list.
第二方面,本申请实施例提供了一种帧间预测方法,应用于编码器,该方法包括:In the second aspect, an embodiment of the present application provides an inter-frame prediction method, which is applied to an encoder, and the method includes:
确定当前块的预测模式参数;Determine the prediction mode parameters of the current block;
当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
基于所述至少一个时域运动信息,构建新的运动信息候选列表;Constructing a new candidate list of motion information based on the at least one temporal motion information;
根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame 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, which includes a parsing unit, a first determination unit, a first adjustment unit, a first construction unit, and a first prediction unit; wherein,
所述解析单元,配置为解析码流,获取当前块的预测模式参数;The parsing unit is configured to parse the code stream to obtain the prediction mode parameter 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 a preset inter prediction mode is used to determine the inter prediction value of the current block;
所述第一调整单元,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The first adjustment unit is configured to adjust the at least one initial candidate position when the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block to obtain at least one of the current block A target candidate position;
所述第一确定单元,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;The first determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;
所述第一构建单元,配置为基于所述至少一个时域运动信息,构建新的运动信息候选列表;The first construction unit is configured to construct a new motion information candidate list based on the at least one temporal motion information;
所述第一预测单元,配置为根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。The first prediction unit is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
第四方面,本申请实施例提供了一种解码器,该解码器包括第一存储器和第一处理器;其中,In a fourth aspect, an embodiment of the present application provides a decoder, which includes a first memory and a first processor; wherein,
所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;The first memory is configured to store a computer program that can run on the first processor;
所述第一处理器,用于在运行所述计算机程序时,执行如第一方面所述的方法。The first processor is configured to execute the method described in the first aspect when the computer program is running.
第五方面,本申请实施例提供了一种编码器,该编码器包括第二确定单元、第二调整单元、第二构建单元和第二预测单元;其中,In a fifth aspect, an embodiment of the present application provides an encoder, which includes a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit; wherein,
所述第二确定单元,配置为确定当前块的预测模式参数;及当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;The second determining unit is configured to determine the prediction mode parameter of the current block; and when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least An initial candidate position;
所述第二调整单元,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The second adjustment unit is configured to adjust the at least one initial candidate position to obtain at least one initial candidate position of the current block when the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block A target candidate position;
所述第二确定单元,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;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 temporal motion information;
所述第二预测单元,配置为根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。The second prediction unit is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
第六方面,本申请实施例提供了一种编码器,该编码器包括第二存储器和第二处理器;其中,In a sixth aspect, an embodiment of the present application provides an encoder, which includes a second memory and a second processor; wherein,
所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;The second memory is configured to store a computer program that can run on the second processor;
所述第二处理器,用于在运行所述计算机程序时,执行如第二方面所述的方法。The second processor is configured to execute the method described in the second aspect when the computer program is running.
第七方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如第一方面所述的方法、或者被第二处理器执行时实现如第二方面所述的方法。In a seventh aspect, an embodiment of the present application provides a computer storage medium that stores a computer program that, when executed by a first processor, implements the method described in the first aspect, or is executed by a second processor. The processor implements the method described in the second aspect when executed.
本申请实施例所提供的一种帧间预测方法、编码器、解码器以及计算机存储介质,解析码流,获取当前块的预测模式参数;当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;在所述至少一个初始候选位置超出所述当前块的LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;基于所述至少一个时域运动信息,构建新的运动信息候选列表;根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。这样,在确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。An inter-frame prediction method, an encoder, a decoder, and a computer storage medium provided by the embodiments of the present application parse the code stream to obtain the prediction mode parameters of the current block; when the prediction mode parameters indicate that the preset inter-frame prediction is used When the mode determines the inter-frame prediction value of the current block, at least one initial candidate position of the current block is determined; when the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position The position is adjusted to obtain at least one target candidate position of the current block; based on the at least one target candidate position, at least one temporal motion information of the current block is determined; based on the at least one temporal motion information, a new A candidate list of motion information; determine the inter prediction value of the current block according to the new candidate list of motion information. 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
附图说明Description of the drawings
图1为本申请实施例提供的一种典型图像组的结构示意图;FIG. 1 is a schematic diagram of the structure of a typical image group provided by an embodiment of this application;
图2A为本申请实施例提供的一种当前块与相邻块的空间位置关系示意图;2A is a schematic diagram of a spatial position relationship between a current block and neighboring blocks provided by an embodiment of the application;
图2B为本申请实施例提供的另一种当前块与相邻块的空间位置关系示意图;2B is a schematic diagram of another spatial position relationship between a current block and neighboring blocks provided by an embodiment of this application;
图3为本申请实施例提供的一种片结构的空间位置关系示意图;3 is a schematic diagram of the spatial position relationship of a chip structure provided by an embodiment of the application;
图4A为本申请实施例提供的一种视频编码***的组成框图示意图;4A is a schematic diagram of the composition of a video encoding system provided by an embodiment of the application;
图4B为本申请实施例提供的一种视频解码***的组成框图示意图;4B is a schematic diagram of a composition block diagram of a video decoding system provided by an embodiment of this application;
图5为本申请实施例提供的一种帧间预测方法的流程示意图;FIG. 5 is a schematic flowchart of an inter-frame prediction method provided by an embodiment of this application;
图6A为本申请实施例提供的一种初始候选位置的结构示意图;FIG. 6A is a schematic structural diagram of an initial candidate position provided by an embodiment of this application;
图6B为本申请实施例提供的另一种初始候选位置的结构示意图;6B is a schematic structural diagram of another initial candidate position provided by an embodiment of this application;
图6C为本申请实施例提供的又一种初始候选位置的结构示意图;6C is a schematic structural diagram of yet another initial candidate position provided by an embodiment of this application;
图6D为本申请实施例提供的再一种初始候选位置的结构示意图;6D is a schematic structural diagram of yet another initial candidate position provided by an embodiment of the application;
图6E为本申请实施例提供的再一种初始候选位置的结构示意图;FIG. 6E is a schematic structural diagram of yet another initial candidate position provided by an embodiment of this application;
图7为本申请实施例提供的另一种帧间预测方法的流程示意图;FIG. 7 is a schematic flowchart of another inter-frame prediction method provided by an embodiment of the application;
图8A为本申请实施例提供的一种GPM在64×64的当前块上多种划分模式的权重分配示意图;8A is a schematic diagram of weight distribution of multiple division modes of GPM on a 64×64 current block according to an embodiment of the application;
图8B为本申请实施例提供的一种AWP在64×64的当前块上多种划分模式的权重分配示意图;FIG. 8B is a schematic diagram of weight distribution of multiple AWP division modes on a 64×64 current block provided by an embodiment of this application;
图9为本申请实施例提供的又一种帧间预测方法的流程示意图;FIG. 9 is a schematic flowchart of another inter-frame prediction method provided by an embodiment of this application;
图10为本申请实施例提供的再一种帧间预测方法的流程示意图;FIG. 10 is a schematic flowchart of yet another inter-frame prediction method provided by an embodiment of this application;
图11为本申请实施例提供的一种解码器的组成结构示意图;FIG. 11 is a schematic diagram of the composition structure of a decoder provided by an embodiment of the application;
图12为本申请实施例提供的一种解码器的硬件结构示意图;FIG. 12 is a schematic diagram of the hardware structure of a decoder provided by an embodiment of the application;
图13为本申请实施例提供的一种编码器的组成结构示意图;FIG. 13 is a schematic diagram of the composition structure of an encoder provided by an embodiment of the application;
图14为本申请实施例提供的一种编码器的硬件结构示意图。FIG. 14 is a schematic diagram of the hardware structure of an encoder provided by an embodiment of the application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。可以理解的是,此处所描述的具体实施例仅仅用于解释相关申请,而非对该申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关申请相关的部分。The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It is understandable that the specific embodiments described here are only used to explain the related application, but not to limit the application. In addition, it should be noted that, for ease of description, only the parts related to the relevant application are shown in the drawings.
在视频图像中,一般采用第一图像分量、第二图像分量和第三图像分量来表征当前块(Coding Block,CB);其中,这三个图像分量分别为一个亮度分量、一个蓝色色度分量和一个红色色度分量,具体地,亮度分量通常使用符号Y表示,蓝色色度分量通常使用符号Cb或者U表示,红色色度分量通常使用符号Cr或者V表示;这样,视频图像可以用YCbCr格式表示,也可以用YUV格式表示。In video images, the first image component, the second image component, and the third image component are generally used to represent the current block (Coding Block, CB); among them, the three image components are a luminance component and a blue chrominance component. And a red chrominance component, specifically, the luminance component is usually represented by the symbol Y, the blue chrominance component is usually represented by the symbol Cb or U, and the red chrominance component is usually represented by the symbol Cr or V; in this way, the video image can be in YCbCr format It can also be expressed in YUV format.
目前,通用的视频编解码标准基于都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(比如128×128,64×64等)的正方形的最大编码单元(Largest Coding Unit,LCU),每个最大编码单元还可以根据规则划分成矩形的编码单元(Coding Unit,CU);而且编码单元可能还会划分成更小的预测单元(Prediction Unit,PU)。具体地,混合编码框架可以包括有预测、变换(Transform)、量化(Quantization)、熵编码(Entropy Coding)、环路滤波(In Loop Filter)等模块;其中,预测模块可以包括帧内预测(intra prediction)和帧间预测(inter prediction),帧间预测可以包括运动估计(motion estimation)和运动补偿(motion compensation)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余;但是由于视频图像中的相邻帧之间也存在着很强的相似性,在视频编解码技术中使用帧间预测方式消除相邻帧之间的时间冗余,从而能够提高编码效率。下述本申请将以帧间预测进行详细描述。At present, common video coding and decoding standards are based on adopting a block-based hybrid coding framework. Each frame in the video image is divided into square largest coding units (LCU) of the same size (such as 128×128, 64×64, etc.). Each largest coding unit can also be divided into rectangles according to rules. Coding Unit (CU); and the coding unit may be divided into smaller prediction units (PU). Specifically, the hybrid coding framework may include modules such as prediction, transformation (Transform), quantization (Quantization), entropy coding (Entropy Coding), and loop filtering (In Loop Filter); among them, the prediction module may include intra prediction (intra Prediction and inter prediction (inter prediction), inter prediction may include motion estimation (motion estimation) and motion compensation (motion compensation). Due to the strong correlation between adjacent pixels in a frame of a video image, the use of intra-frame prediction in the video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; however, due to the adjacent pixels in the video image There are also strong similarities between frames. Inter-frame prediction is used in video coding and decoding technology to eliminate temporal redundancy between adjacent frames, thereby improving coding efficiency. In the following, this application will be described in detail in terms of inter-frame prediction.
需要说明的是,运动信息可以包括运动矢量(Motion Vector,MV)信息和参考帧信息。具体地,对于使用帧间预测的当前块而言,该当前块所在的当前帧具有一个或多个参考帧,而当前块可以是编码单元或预测单元,可以使用一个包含一组运动矢量和参考帧信息的运动信息指示到某一参考帧内一个与当前块大小相同的像素区域,这里称之为参考块,也可以使用一个包含两组运动矢量和参考帧信息的运动信息指示到某两个可以相同也可以不同的参考帧内的两个参考块;然后运动补偿可以根据运动信息所指示的参考块得到当前块的帧间预测值。It should be noted that the motion information may include motion vector (Motion Vector, MV) information and reference frame information. Specifically, for a current block that uses inter-frame prediction, the current frame in which the current block is located has one or more reference frames, and the current block can be a coding unit or a prediction unit, and a set of motion vectors and reference frames can be used. The motion information of the frame information indicates a pixel area of the same size as the current block in a reference frame, which is referred to as a reference block here. A motion information containing two sets of motion vectors and reference frame information can also be used to indicate to two The two reference blocks in the reference frame may be the same or different; then, the motion compensation may obtain the inter-frame prediction value of the current block according to the reference block indicated by the motion information.
应理解,P帧(Predictive Frame)是只能使用图像播放顺序(Picture Order Count,POC)在当前帧之前的参考帧进行预测的帧。这时候当前参考帧只有一个参考帧列表,用RefPicList0表示;且RefPicList0中都是POC在当前帧之前的参考帧。B帧(Bi-directional Interpolated Prediction Frame)早期是可以使用POC在当前帧之前的参考帧及POC在当前帧之后的参考帧进行预测的帧。B帧有两个参考帧列表,分别用RefPicList0和RefPicList1表示;其中,RefPicList0中都是POC在当前帧之前的参考帧,RefPicList1中都是POC在当前帧之后的参考帧。对于当前块而言,可以只参考RefPicList0中某一帧的参考块,这种情况可称为前向预测;或者也可以只参考RefPicList1中某一帧的参考块,这种情况可称为后向预测;或者还可以同时参考RefPicList0中某一帧的参考块和RefPicList1中某一帧的参考块,这种情况可称为双向预测。同时参考两个参考块的一种简单方式是将两个参考块内每一个对应位置的像素进行平均以得到当前块内每一像素的帧间预测值(或者可以称为预测块)。后期B帧不再限制RefPicList0中都是POC在当前帧之前的参考帧,RefPicList1中都是POC在当前帧之后的参考帧。换句话说,RefPicList0中也可以有POC在当前帧之后的参考帧,RefPicList1中也可以有POC在当前帧之前的参考帧,也即是指当 前块可以同时参考POC在当前帧之前的参考帧或者同时参考POC在当前帧之后的参考帧。但是当前块为双向预测时所使用的参考帧必须一个来自于RefPicList0,一个来自于RefPicList1;这种B帧也称为广义B帧。It should be understood that a P frame (Predictive Frame) is a frame that can only be predicted using a reference frame before the current frame in the Picture Order Count (POC). At this time, the current reference frame has only one reference frame list, which is represented by RefPicList0; and RefPicList0 is all reference frames with POC before the current frame. B-frame (Bi-directional Interpolated Prediction Frame) early is a frame that can be predicted using the reference frame of the POC before the current frame and the reference frame of the POC after the current frame. The B frame has two reference frame lists, which are represented by RefPicList0 and RefPicList1 respectively; where RefPicList0 is the reference frame of the POC before the current frame, and RefPicList1 is the reference frame of the POC after the current frame. For the current block, you can only refer to the reference block of a frame in RefPicList0, which can be called forward prediction; or you can only refer to the reference block of a frame in RefPicList1, which can be called backward Prediction; or it can also refer to a reference block of a frame in RefPicList0 and a reference block of a frame in RefPicList1 at the same time. This situation can be called bidirectional prediction. A simple way to refer to two reference blocks at the same time is to average the pixels at each corresponding position in the two reference blocks to obtain the inter prediction value of each pixel in the current block (or may be called a prediction block). Later B frames are no longer restricted to the reference frames in RefPicList0 that are all POC before the current frame, and RefPicList1 are all reference frames that are POC after the current frame. In other words, RefPicList0 can also have a reference frame with POC after the current frame, and RefPicList1 can also have a reference frame with POC before the current frame, which means that the current block can also refer to the reference frame with POC before the current frame or Also refer to the reference frame after the current frame of the POC. But the reference frame used when the current block is bidirectional prediction must come from RefPicList0 and the other from RefPicList1; this kind of B frame is also called generalized B frame.
由于随机访问(Random Access,RA)配置的编解码顺序与POC顺序不同,这样B帧可以同时参考当前帧之前的信息和当前帧之后的信息,能够明显提高编码性能。示例性地,RA的一种经典的图像组(Group Of Pictures,GOP)结构如图1所示,在图1中,箭头表示参考关系,由于I帧不需要参考帧,那么在POC为0的I帧解码后,将会解码POC为4的P帧,而在解码POC为4的P帧时可以参考POC为0的I帧。在POC为4的P帧解码后,然后再解码POC为2的B帧,而在解码POC为2的B帧时可以参考POC为0的I帧和POC为4的P帧,等等。这样,根据图1可以得到,POC顺序为{01 2 3 4 5 6 7 8}的情况下,其对应的解码顺序为{0 3 2 4 1 7 6 8 5}。Since the codec sequence of Random Access (RA) configuration is different from the POC sequence, the B-frame can refer to the information before the current frame and the information after the current frame at the same time, which can significantly improve the coding performance. Exemplarily, a classic group of pictures (GOP) structure of RA is shown in Figure 1. In Figure 1, the arrows indicate the reference relationship. Since the I frame does not require a reference frame, then the POC is 0. After the I frame is decoded, the P frame with the POC of 4 will be decoded, and the I frame with the POC of 0 can be referred to when decoding the P frame with the POC of 4. After decoding a P frame with a POC of 4, decode a B frame with a POC of 2. When decoding a B frame with a POC of 2, you can refer to an I frame with a POC of 0 and a P frame with a POC of 4, and so on. In this way, according to Figure 1, when the POC order is {01 2 3 4 5 6 7 8}, the corresponding decoding order is {0 3 2 4 1 7 6 8 5}.
另外,低延迟(Low Delay,LD)配置的编解码顺序与POC顺序是相同的,这时候当前帧只能参考当前帧之前的信息。其中,Low Delay配置又分Low Delay P和Low Delay B。Low Delay P即传统的Low Delay配置。其典型的结构是IPPP……,即先编解码一个I帧,之后解码的帧都是P帧。Low Delay B的典型结构是IBBB……,与Low Delay P的区别在于每个帧间帧都是B帧,即使用两个参考帧列表,当前块可以同时参考RefPicList0中的某一帧的参考块和RefPicList1中的某一帧的参考块。这里,当前帧的一个参考帧列表最多可以有几个参考帧,如2个、3个或4个等。当编码或解码某一个当前帧时,RefPicList0和RefPicList1内各有哪几个参考帧是由预设配置或算法决定的,但是同一个参考帧可以同时出现在RefPicList0和RefPicList1中,即编码器或解码器允许当前块同时参考同一个参考帧中的两个参考块。In addition, the codec sequence of the Low Delay (LD) configuration is the same as the POC sequence. At this time, the current frame can only refer to the information before the current frame. Among them, Low Delay configuration is divided into Low Delay P and Low Delay B. Low Delay P is the traditional Low Delay configuration. Its typical structure is IPPP..., that is, an I frame is first encoded and decoded, and then all frames decoded are P frames. The typical structure of Low Delay B is IBBB..., the difference from Low Delay P is that each inter frame is a B frame, that is, two reference frame lists are used, and the current block can refer to a reference block of a frame in RefPicList0 at the same time And the reference block of a frame in RefPicList1. Here, a reference frame list of the current frame can have at most several reference frames, such as 2, 3, or 4, etc. When encoding or decoding a certain current frame, the reference frames in RefPicList0 and RefPicList1 are determined by the preset configuration or algorithm, but the same reference frame can appear in RefPicList0 and RefPicList1 at the same time, that is, encoder or decoder The device allows the current block to refer to two reference blocks in the same reference frame at the same time.
在本申请实施例中,编码器或解码器通常可以使用参考帧列表里的索引值(用index表示)来对应参考帧。如果一个参考帧列表长度为4,那么index有0、1、2、3等四个值。例如,如果当前帧的RefPicList0有POC为5,4,3,0的4个参考帧,那么RefPicList0的index 0为POC 5的参考帧,RefPicList0的index1为POC 4的参考帧,RefPicList0的index 2为POC 3的参考帧,RefPicList0的index 3为POC 0的参考帧。In the embodiment of the present application, the encoder or the decoder can usually use the index value (indicated by index) in the reference frame list to correspond to the reference frame. If the length of a reference frame list is 4, then index has four values such as 0, 1, 2, and 3. For example, if the RefPicList0 of the current frame has 4 reference frames with POC of 5, 4, 3, 0, then index 0 of RefPicList0 is the reference frame of POC 5, index 1 of RefPicList0 is the reference frame of POC 4, and index 2 of RefPicList0 is POC 3 reference frame, index 3 of RefPicList0 is POC 0 reference frame.
目前的多功能视频编码(Versatile Video Coding,VVC)标准中,预设的帧间预测模式可以为GPM预测模式。目前的数字音视频编解码技术标准(Audio Video coding Standard,AVS)中,预设的帧间预测模式可以为AWP预测模式。这两种预测模式虽然名称不同、具体的实现形式不同、但原理上是共通的,即这两种预测模式都可以适用本申请实施例的帧间预测方法。In the current Versatile Video Coding (VVC) standard, the preset inter prediction mode may be the GPM prediction mode. In the current digital audio and video coding standard (AVS), the preset inter prediction mode may be the AWP prediction mode. Although the two prediction modes have different names and different specific implementation forms, they are common in principle, that is, the two prediction modes can be applied to the inter-frame prediction method in the embodiment of the present application.
具体来讲,对于GPM预测模式来说,如果使用GPM,那么码流中将会传输GPM下的预测模式参数,比如GPM具体的划分模式;通常情况下,GPM包括有64种划分模式。对于AWP预测模式来说,如果使用AWP,那么码流中将会传输AWP下的预测模式参数,比如AWP具体的划分模式;通常情况下,AWP包括有56种划分模式。Specifically, for the GPM prediction mode, if GPM is used, the prediction mode parameters under GPM, such as the specific division mode of GPM, will be transmitted in the code stream; generally, GPM includes 64 division modes. For the AWP prediction mode, if the AWP is used, the prediction mode parameters under the AWP will be transmitted in the code stream, such as the specific AWP division mode; under normal circumstances, AWP includes 56 division modes.
在预设的预测模式下,比如GPM和AWP均需要使用两个单向运动信息查找两个参考块。目前的实现方式是在编码器侧利用当前块之前已编码/已解码部分的相关信息构建一个运动信息候选列表(也可以称为单向运动信息候选列表),从该运动信息候选列表中选择单向运动信息,将这两个单向运动信息在运动信息候选列表中的索引值(index)写入码流。在解码器侧采用同样的方式,即利用当前块之前已解码部分的相关信息构建一个运动信息候选列表,这个运动信息候选列表与编码器侧构建的候选列表一定是相同的。如此,从码流中解析出两个运动信息的索引值,然后从运动信息候选列表中查找出这两个单向运动信息即为当前块需要使用的两个单向运动信息。In the preset prediction mode, for example, GPM and AWP both need to use two unidirectional motion information to find two reference blocks. The current implementation is to construct a motion information candidate list (also called a one-way motion information candidate list) on the encoder side using the relevant information of the previously encoded/decoded part of the current block, and select a single motion information candidate list from the motion information candidate list. To motion information, write the index values of the two one-way motion information in the motion information candidate list into the code stream. The same method is adopted on the decoder side, that is, a motion information candidate list is constructed using the relevant information of the previously decoded part of the current block. This motion information candidate list must be the same as the candidate list constructed on the encoder side. In this way, the index values of the two motion information are parsed from the code stream, and then the two unidirectional motion information is found from the motion information candidate list, which is the two unidirectional motion information that the current block needs to use.
还需要说明的是,本申请实施例所描述的单向运动信息可以包括有运动矢量信息,即(x,y)的值,以及对应的参考帧信息,即参考帧列表及在参考帧列表中的参考索引值。一种表示方式是记录两个参考帧列表的参考索引值,其中一个参考帧列表对应的参考索引值有效,如0,1,2等;另一个参考帧列表对应的参考索引值为无效,即-1。参考索引值有效的参考帧列表即为当前块的运动信息所使用的参考帧列表,根据参考索引值可以从该参考帧列表中查找到对应的参考帧。每个参考帧列表都有一个对应的运动矢量,有效的参考帧列表对应的运动矢量是有效的,无效的参考帧列表对应的运动矢量是无效的。解码器可以通过单向运动信息中的参考帧信息找到所需的参考帧,根据当前块的位置以及运动矢量即(x,y)的值可以在参考帧中找到参考块,进而确定出当前块的帧间预测值。It should also be noted that the one-way motion information described in the embodiments of the present application may include motion vector information, that is, the value of (x, y), and the corresponding reference frame information, that is, the reference frame list and the reference frame list. The reference index value. One way of expression is to record the reference index values of two reference frame lists, where the reference index value corresponding to one reference frame list is valid, such as 0, 1, 2, etc.; the reference index value corresponding to the other reference frame list is invalid, that is -1. The reference frame list for which the reference index value is valid 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 valid reference frame list is valid, and the motion vector corresponding to the invalid reference frame list is invalid. The decoder can find the required reference frame through the reference frame information in the one-way motion information. According to the position of the current block and the value of the motion vector (x, y), the reference block can be found in the reference frame to determine the current block The inter prediction value of.
实际应用中,运动信息候选列表的构建方式不仅使用了空域运动信息,还使用了时域运动信息。其中,在VVC中构建合并候选列表(merge list)时,也用到了时域运动信息和空域运动信息。如图2A所示,其示出了merge list构建时所使用到的相关位置的运动信息,填充元素为1、2、3、4、5的候选位置表示空域相关位置,即当前帧内与当前块相邻的这些位置块所使用的运动信息;填充元素为6和7的候选位置表示时域相关位置,即某一个参考帧中对应位置所使用的运动信息,这些运动信息还可以是 经过了缩放(scaling)。这里,对于时域运动信息来说,如果候选位置6可用,那么可以使用6位置对应的运动信息;否则,可以使用7位置对应的运动信息。需要注意的是,三角划分预测模式(Triangle Partition Mode,TPM)和GPM预测模式中关于运动信息候选列表的构建中也涉及到了这几个位置的使用;而且这里块的大小并非为实际大小,只是作为示例说明。In practical applications, the construction method of the motion information candidate list not only uses spatial motion information, but also uses temporal motion information. Among them, when constructing a merge list in VVC, temporal motion information and spatial motion information are also used. As shown in Figure 2A, it shows the motion information of the relevant positions used in the construction of the merge list. The candidate positions with filling elements of 1, 2, 3, 4, and 5 indicate the relevant positions in the spatial domain, that is, the current frame and the current The motion information used by these position blocks adjacent to the block; the candidate positions with fill elements 6 and 7 indicate time-domain related positions, that is, the motion information used by the corresponding positions in a certain reference frame. These motion information can also be passed Scaling. Here, for the time domain motion information, if the candidate position 6 is available, then the motion information corresponding to the 6 position can be used; otherwise, the motion information corresponding to the 7 position can be used. It should be noted that the construction of the motion information candidate list in the Triangle Partition Mode (Triangle Partition Mode, TPM) and GPM prediction mode also involves the use of these positions; and the size of the block here is not the actual size, just As an example.
对于AWP预测模式来说,如图2B所示,块E为当前块,而块A、块B、块C、块D、块F、块G均为块E的相邻块。具体来讲,块E的相邻块A是样本(x 0-1,y 0)所在的块,块E的相邻块B是样本(x 0,y 0-1)所在的块,块E的相邻块C是样本(x 0+1,y 0-1)所在的块,块E的相邻块D是样本(x 0-1,y 0-1)所在的块,块E的相邻块F是样本(x 0-1,y 1)所在的块,块E的相邻块G是样本(x 1,y 0-1)所在的块。其中,(x 0,y 0)是块E左上角样本在图像中的坐标,(x 1,y 0)是块E右上角样本在图像中的坐标,(x 0,y 1)是块E左下角样本在图像中的坐标。这里,块E和它的相邻块A、B、C、D、F和G之间的空间位置关系见图2B。 For the AWP prediction mode, as shown in FIG. 2B, block E is the current block, and block A, block B, block C, block D, block F, and block G are all adjacent blocks of block E. Specifically, the adjacent block A of the block E is the block where the sample (x 0 -1, y 0 ) is located, and the adjacent block B of the block E is the block where the sample (x 0 , y 0 -1) is located, and the block E The adjacent block C of is the block where the sample (x 0 +1, y 0 -1) is located, the adjacent block D of the block E is the block where the sample (x 0 -1, y 0 -1) is located, the phase of the block E The neighboring block F is the block where the sample (x 0 -1, y 1 ) is located, and the neighboring block G of the block E is the block where the sample (x 1 , y 0 -1) is located. Among them, (x 0 , y 0 ) are the coordinates of the upper left corner sample of block E in the image, (x 1 , y 0 ) are the coordinates of the upper right corner sample of block E in the image, (x 0 , y 1 ) is block E The coordinates of the lower left corner sample in the image. Here, the spatial position relationship between block E and its neighboring blocks A, B, C, D, F, and G is shown in Fig. 2B.
需要指出,相邻块X(X可为A、B、C、D、F或G)“存在”指该块应在图像内并且该块应与块E属于同一片;否则相邻块“不存在”。It should be pointed out that the "existence" of adjacent block X (X can be A, B, C, D, F or G) means that the block should be in the image and the block should belong to the same slice as block E; otherwise, the adjacent block "does not exist". exist".
如果块“不存在”或者尚未解码,则此块“不可用”;否则此块“可用”。如果图像样本所在的块“不存在”或者此样本尚未解码,则此样本“不可用”;否则此样本“可用”。If the block "does not exist" or has not been decoded, then this block is "unavailable"; otherwise, this block is "available". If the block in which the image sample is located "does not exist" or this sample has not been decoded, then this sample is "unavailable"; otherwise, this sample is "available".
还需要注意的是,片(patch)是图像中的矩形区域,包含有若干最大编码单元在图像内的部分,片结构如图3所示,比如A、B、C、D、E、F等片,片与片之间不应重叠。It should also be noted that a patch is a rectangular area in the image, which contains several parts of the largest coding unit in the image. The structure of the patch is shown in Figure 3, such as A, B, C, D, E, F, etc. There should be no overlap between slices.
进一步地,图像划分为最大编码单元,最大编码单元之间不应重叠,最大编码单元左上角的样本不应超出图像边界,最大编码单元右下角的样本可超出图像边界。这里,最大编码单元划分为一个或多个编码单元,由编码树决定,而编码单元可划分为一个或多个变换单元。Further, the image is divided into the largest coding unit, the largest coding unit should not overlap, the sample in the upper left corner of the largest coding unit should not exceed the image boundary, and the sample in the lower right corner of the largest coding unit may exceed the image boundary. Here, the maximum coding unit is divided into one or more coding units, which is determined by the coding tree, and the coding unit can be divided into one or more transformation units.
在构建运动信息候选列表的过程中,目前提案中时域运动信息由于来自于已编码完成的参考帧,不再局限于当前块左上角的位置。目前提案所提出的方式是“哪里不够补哪里”,这里设置有四个不同的位置,假定当前块的左上角是(x,y),当前块的宽度是width,高度是height,那么这4个位置分别如下表1所示。需要注意的是,这里所说的宽度和高度通常是指亮度分量的宽度(即l_width)和高度(即l_height),但不作具体限定。In the process of constructing the motion information candidate list, the temporal motion information in the current proposal is no longer limited to the position of the upper left corner of the current block because it comes from the encoded reference frame. The current proposal proposed is "Where is not enough to make up where", here are four different positions, 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, then these 4 The positions are shown in Table 1 below. It should be noted that the width and height mentioned here usually refer to the width (i.e. l_width) and height (i.e. l_height) of the brightness component, but are not specifically limited.
表1Table 1
Pos 0 Pos 0 左上角Upper left corner (x,y)(x,y)
Pos 1 Pos 1 右上角Upper right corner (x+width,y)(x+width,y)
Pos 2 Pos 2 左下角Bottom left (x,y+height)(x,y+height)
Pos 3 Pos 3 右下角Bottom right corner (x+width,y+height)(x+width,y+height)
对AWP的每一个模式,小角在上述4个位置中的哪一个位置,时域运动信息就可以利用哪一个位置确定。具体如下表2所示。在表2中,0即表示“Pos 0”,1即表示“Pos 1”,2即表示“Pos 2”,3即表示“Pos 3”。For each mode of AWP, the time domain motion information can be determined by which position of the above 4 positions the small angle is located. 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".
表2Table 2
00 00 33 11 22 22 33 00
00 00 33 11 22 22 33 00
00 33 33 33 22 33 33 33
33 33 33 33 33 33 33 33
33 33 33 33 11 33 33 33
33 33 33 22 11 11 33 33
33 33 33 22 11 11 33 33
具体地,假定TmvpPos=AwpIdxToTmvpPos[AwpIdx],那么Specifically, assuming TmvpPos=AwpIdxToTmvpPos[AwpIdx], then
若TmvpPos等于0,则按方法一推导出时域双向的运动信息;If TmvpPos is equal to 0, use method 1 to derive the two-way motion information in the time domain;
若TmvpPos等于1,则按方法二推导出时域双向的运动信息;If TmvpPos is equal to 1, then derive the two-way motion information in the time domain according to Method 2;
若TmvpPos等于2,则按方法三推导出时域双向的运动信息;If TmvpPos is equal to 2, then derive the two-way motion information in the time domain according to Method 3;
若TmvpPos等于3,则按方法四推导出时域双向的运动信息。If TmvpPos is equal to 3, then the two-way motion information in the time domain is derived according to Method 4.
这里,AwpIdxToTmvpPos对应的查找表如表2所示。将导出的时域双向的运动信息拆分为指向参考帧列表List0的单向运动信息以及指向参考帧列表List1的单向运动信息,先进行单向运动信息查重操作,若不重复则放入AwpUniArray,直至长度为4或遍历结束。Here, the lookup table corresponding to AwpIdxToTmvpPos is shown in Table 2. Split the derived two-way motion information in the time domain into one-way motion information that points to the reference frame list List0 and one-way motion information that points to the reference frame list List1, and perform the one-way motion information double-check operation first, and put it in if it is not repeated AwpUniArray, until the length is 4 or the traversal ends.
下面将以当前块的左上角、右上角、左下角和右下角为例,分别提供方法一、方法二、方法三和方法四推导出时域运动信息的具体步骤。The following will take the upper left corner, upper right corner, lower left corner and lower right corner of the current block as examples to provide specific steps for method 1, method 2, method 3, and method 4 to derive temporal motion information.
方法一,以当前块的左上角为例,推导运动信息的步骤如下:Method 1: Taking the upper left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
如果参考图像队列1中参考索引值为0的图像中与当前预测单元的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction unit Both the L0 reference index and the L1 reference index are equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与当前预测单元的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), the motion The distance index of the image where the information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第二步,The second step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第三步,third step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000001
Figure PCTCN2021089252-appb-000001
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000002
Figure PCTCN2021089252-appb-000002
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第四步,interPredRefMode的值等于‘PRED_List01’。In the fourth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法二,以当前块的右上角为例,推导运动信息的步骤如下:Method 2: Taking the upper right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右上角亮度样本位置为(x’,y’),x’=x+l_width,y’=yAssume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-right luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y
如果上面推导出的(x’,y’)不可用,比如超出图像边界,patch边界等,那么x’=x+l_width-1,y’=y。If the (x’, y’) derived above is not available, such as beyond the image boundary, patch boundary, etc., then x’=x+l_width-1, y’=y.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的右上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position in the upper right corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的右上角亮度样本位置对应的亮度 样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position in the upper right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000003
Figure PCTCN2021089252-appb-000003
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000004
Figure PCTCN2021089252-appb-000004
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法三,以当前块的左下角为例,推导运动信息的步骤如下:Method 3: Taking the lower left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左下角亮度样本位置为(x’,y’),x’=x,y’=y+l_height。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the lower-left luminance sample position of the selected current prediction unit is (x', y'), x'=x, y'=y+l_height.
如果上面推导出的(x’,y’)不可用,比如超出图像边界、patch边界等,那么x’=x,y’=y+l_height-1。If the (x’, y’) derived above is not available, such as beyond the image boundary, patch boundary, etc., then x’=x, y’=y+l_height-1.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的左下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position of the lower left corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的左下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the lower left corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000005
Figure PCTCN2021089252-appb-000005
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x, mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000006
Figure PCTCN2021089252-appb-000006
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法四,以当前块的右下角为例,推导运动信息的步骤如下:Method 4: Taking the lower right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右下角亮度样本位置为(x’,y’),x’=x+l_width,y’=y+l_height。Assume that the position of the upper left luminance sample 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 luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y+l_height.
如果上面推导出的(x’,y’)不可用,比如超出图像边界、patch边界等,那么如果x’不可用,x’=x+l_width-1;如果y’不可用,y’=y+l_height-1。If the (x',y') derived above is not available, such as beyond the 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.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的右下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position in the lower right corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的右下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position at the lower right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000007
Figure PCTCN2021089252-appb-000007
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000008
Figure PCTCN2021089252-appb-000008
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
上述的相关技术方案对压缩性能提升明显,但是由于目前设计的右上、左下、右下三个位置都在当前块的外部,对右上、左下、右下三个位置中的某一个位置如果不可用,比如超出图像边界,patch边界等才会修改为当前块的内部位置。The above-mentioned related technical solutions significantly improve the compression performance, but since the current design of the upper right, lower left, and lower right positions are all outside the current block, if one of the upper right, lower left, and lower right positions is unavailable , Such as beyond the image boundary, the patch boundary, etc. will be modified to the internal position of the current block.
然而,在确定导出时域运动信息所使用的位置时,由于它所使用的参考帧已经编码完成,故在超出图像边界,patch边界等的时候不可用。但是这样对现有的硬件实现不太友好。因为硬件实现时并不会把所使用的导出时域运动信息的参考帧的所有的用于导出时域运动信息的运动信息全部缓存,而是对当 前块的LCU,只缓存与当前LCU相同位置的一个LCU大小的部分的运动信息。那么在目前的相关技术方案中,如果当前块的右边界正好与当前LCU的右边界重合,或者当前块的下边界正好与当前LCU的下边界重合,那么右上、左下、右下三个位置中至少有一个超出当前LCU的边界,这时如果这个或这几个位置仍然在图像内部或patch内部,意味着它仍然是可用的,此时硬件就需要增加额外的带宽去获取这个或这几个位置的运动信息。However, when determining the position used to derive the temporal motion information, since the reference frame used by it has been encoded, it is not available when it exceeds the image boundary, patch boundary, etc. But this is not very friendly to existing hardware implementations. Because the hardware implementation does not cache all the motion information used to derive the time domain motion information of the reference frame used to derive the time domain motion information, but for the LCU of the current block, only cache the same position as the current LCU The motion information of an LCU-sized part. Then, in the current related technical solutions, if the right boundary of the current block coincides with the right boundary of the current LCU, or the lower boundary of the current block coincides with the lower boundary of the current LCU, then the upper right, lower left, and lower right positions At least one is beyond the boundary of the current LCU. At this time, if this or these positions are still inside the image or the patch, it means that it is still available. At this time, the hardware needs to add additional bandwidth to obtain this or these positions. Movement information of the location.
需要注意的是,用于导出时域运动信息的帧存储导出时域运动信息的运动信息时通常不会对每一个像素都保存一个运动信息,而是按一定大小的块共享一个运动信息,如16×16个像素或8×8个像素或4×4个像素等共享一个运动信息,这里,16×16个像素或8×8个像素或4×4个像素通常默认指的是亮度分量的像素数。It should be noted that the frame storage used to derive time-domain motion information usually does not save a motion information for each pixel when deriving the motion information of the time-domain motion information, but shares a motion information in a certain size block, such as 16×16 pixels, 8×8 pixels, or 4×4 pixels share one motion information. Here, 16×16 pixels, 8×8 pixels, or 4×4 pixels usually refer to the brightness component by default. Number of pixels.
基于此,本申请实施例提供了一种帧间预测方法,可应用于编码器或解码器。在得到当前块的预测模式参数后,当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;在所述至少一个初始候选位置超出所述当前块的LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;基于所述至少一个时域运动信息,构建新的运动信息候选列表;根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。这样,在确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。Based on this, the embodiments of the present application provide an inter-frame prediction method, which can be applied to an encoder or a decoder. After the prediction mode parameter of the current block is obtained, when the prediction mode parameter indicates to use the preset inter prediction mode to determine the inter prediction value of the current block, at least one initial candidate position of the current block is determined; When at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block; based on the at least one target candidate position, it is determined At least one temporal motion information of the current block; constructing a new motion information candidate list based on the at least one temporal motion information; determining the inter prediction value of the current block according to the 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
参见图4A,其示出了本申请实施例提供的一种视频编码***框图。如图4A所示,该视频编码***11可以包括:变换单元111、量化单元112、模式选择和编码控制逻辑单元113、帧内预测单元114、帧间预测单元115(包括:运动补偿和运动估计)、反量化单元116、反变换单元117、环路滤波单元118、编码单元119和解码图像缓存单元110;针对输入的原始视频信号,通过编码树块(Coding Tree Unit,CTU)的划分可以得到一个视频重建块,通过模式选择和编码控制逻辑单元113确定编码模式,然后,对经过帧内或帧间预测后得到的残差像素信息,通过变换单元111、量化单元112对该视频重建块进行变换,包括将残差信息从像素域变换到变换域,并对所得的变换系数进行量化,用以进一步减少比特率;帧内预测单元114用于对该视频重建块进行帧内预测;其中,帧内预测单元114用于确定该视频重建块的最优帧内预测模式(即目标预测模式);帧间预测单元115用于执行所接收的视频重建块相对于一或多个参考帧中的一或多个块的帧间预测编码,以提供时间预测信息;其中吗,运动估计为产生运动向量的过程,所述运动向量可以估计该视频重建块的运动,然后,运动补偿基于由运动估计所确定的运动向量执行运动补偿;在确定帧间预测模式之后,帧间预测单元115还用于将所选择的帧间预测数据提供到编码单元119,而且,将所计算确定的运动向量数据也发送到编码单元119;此外,反量化单元116和反变换单元117用于该视频重建块的重构建,在像素域中重构建残差块,该重构建残差块通过环路滤波单元118去除方块效应伪影,然后,将该重构残差块添加到解码图像缓存单元110的帧中的一个预测性块,用以产生经重构建的视频重建块;编码单元119是用于编码各种编码参数及量化后的变换系数。而解码图像缓存单元110用于存放重构建的视频重建块,用于预测参考。随着视频图像编码的进行,会不断生成新的重构建的视频重建块,这些重构建的视频重建块都会被存放在解码图像缓存单元110中。Refer to FIG. 4A, which shows a block diagram of a video encoding system provided by an embodiment of the present application. As shown in FIG. 4A, the video encoding system 11 may include: a transformation unit 111, a quantization unit 112, a mode selection and encoding control logic unit 113, an intra prediction unit 114, and an inter prediction unit 115 (including: motion compensation and motion estimation). ), inverse quantization unit 116, inverse transform unit 117, loop filter unit 118, encoding unit 119, and decoded image buffer unit 110; for the input original video signal, it can be obtained by dividing the coding tree unit (CTU) For a video reconstruction block, the coding mode is determined by the mode selection and coding control logic unit 113, and then the residual pixel information obtained after intra or inter prediction is performed on the video reconstruction block by the transform unit 111 and the quantization unit 112. Transformation includes transforming the residual information from the pixel domain to the transform domain, and quantizing the resulting transform coefficients to further reduce the bit rate; the intra prediction unit 114 is used to perform intra prediction on the video reconstruction block; wherein, The intra prediction unit 114 is used to determine the optimal intra prediction mode (that is, the target prediction mode) of the video reconstruction block; the inter prediction unit 115 is used to perform the comparison of the received video reconstruction block with respect to one or more reference frames. One or more blocks are inter-frame predictive coding to provide temporal prediction information; among them, motion estimation is the process of generating motion vectors, which can estimate the motion of the video reconstruction block, and then motion compensation is based on the motion estimation The determined motion vector performs motion compensation; after determining the inter prediction mode, the inter prediction unit 115 is also used to provide the selected inter prediction data to the encoding unit 119, and the calculated and determined motion vector data is also Send to the encoding unit 119; in addition, the inverse quantization unit 116 and the inverse transform unit 117 are used to reconstruct the video reconstruction block, reconstruct the residual block in the pixel domain, and the reconstructed residual block is removed by the loop filtering unit 118 Block artifacts, and then add the reconstructed residual block to a predictive block in the frame of the decoded image buffer unit 110 to generate a reconstructed video reconstruction block; the encoding unit 119 is used to encode various Coding parameters and quantized transform coefficients. The decoded image buffer unit 110 is used to store the reconstructed video reconstruction block for prediction reference. As the video image encoding progresses, new reconstructed video reconstruction blocks will be continuously generated, and these reconstructed video reconstruction blocks will all be stored in the decoded image buffer unit 110.
参见图4B,其示出了本申请实施例提供的本申请实施例还提供一种视频解码***框图。如图4B所示,该视频解码***12可以包括:解码单元121、反变换单元127,与反量化单元122、帧内预测单元123、运动补偿单元124、环路滤波单元125和解码图像缓存单元126单元;输入的视频信号经过视频编码***11进行编码处理之后,输出该视频信号的码流;该码流输入视频解码***12中,首先经过解码单元121,用于得到解码后的变换系数;针对该变换系数通过反变换单元127与反量化单元122进行处理,以便在像素域中产生残差块;帧内预测单元123可用于基于所确定的帧内预测方向和来自当前帧或图片的先前经解码块的数据而产生当前视频解码块的预测数据;运动补偿单元124是通过剖析运动向量和其他关联语法元素来确定用于视频解码块的预测信息,并使用该预测信息以产生正被解码的视频解码块的预测性块;通过对来自反变换单元127与反量化单元122的残差块与由帧内预测单元123或运动补偿单元124产生的对应预测性块进行求和,而形成解码的视频块;该解码的视频信号通过环路滤波单元125以便去除方块效应伪影,可以改善视频质量;然后将经解码的视频块存储于解码图像缓存单元126中,解码图像缓存单元126存储用于后续帧内预测或运动补偿的参考图像,同时也用于视频信号的输出,得到所恢复的原始视频信号。Refer to FIG. 4B, which shows a block diagram of a video decoding system provided by the embodiment of the present application. As shown in FIG. 4B, the video decoding system 12 may include: a decoding unit 121, an inverse transform unit 127, an inverse quantization unit 122, an intra prediction unit 123, a motion compensation unit 124, a loop filter unit 125, and a decoded image buffer unit Unit 126; after the input video signal is encoded by the video encoding system 11, 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 the decoded transform coefficients; The transform coefficient is processed by the inverse transform unit 127 and the inverse quantization unit 122 to generate a residual block in the pixel domain; the intra prediction unit 123 can be used to determine the intra prediction direction and the previous information from the current frame or picture. The data of the decoded block generates the prediction data of the current video decoding block; the motion compensation unit 124 determines the prediction information for the video decoding block by analyzing the motion vector and other associated syntax elements, and uses the prediction information to generate the prediction information that is being decoded. The predictive block of the video decoding block; the decoding is formed by summing the residual block from the inverse transform unit 127 and the inverse quantization unit 122 and the corresponding predictive block generated by the intra prediction unit 123 or the motion compensation unit 124 The decoded video signal passes through the loop filter unit 125 in order to remove the block artifacts, which can improve the video quality; then the decoded video block is stored in the decoded image buffer unit 126, and the decoded image buffer unit 126 is used for storage The reference image used for subsequent intra-frame prediction or motion compensation is also used for the output of the video signal to obtain the restored original video signal.
简言之,本申请实施例提供的一种帧间预测方法主要作用于视频编码***11的帧间预测单元215和视频解码***12的帧间预测单元,即运动补偿单元124;也就是说,如果在视频编码***11能够通过本申请实施例提供的帧间预测方法得到一个较好的预测效果,提高编码性能;那么,对应地,在视频 解码***12,也能够改善视频解码恢复质量,从而提高解码性能。In short, the inter-frame prediction method provided by 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, that is, the motion compensation unit 124; that is, If the video encoding system 11 can obtain a better prediction effect through the inter-frame prediction method provided by the embodiments of this application and improve the encoding performance; then, correspondingly, the video decoding system 12 can also improve the video decoding restoration quality, thereby Improve decoding performance.
下面将结合附图和实施例对本申请的技术方案进一步详细阐述。在进行详细阐述之前,需要说明的是,说明书通篇中提到的“第一”、“第二”、“第三”等,仅仅是为了区分不同的特征,不具有限定优先级、先后顺序、大小关系等功能。The technical solution of the present application will be further elaborated below with reference to the accompanying drawings and embodiments. Before proceeding in detail, it should be noted that the “first”, “second”, “third”, etc. mentioned throughout the specification are only for distinguishing different features and do not have a limited priority or order. , Size relationship and other functions.
本申请实施例提供一种帧间预测方法,该方法应用于视频解码设备,即解码器。该方法所实现的功能可以通过解码器中的第一处理器调用计算机程序来实现,当然计算机程序可以保存在第一存储器中,可见,该解码器至少包括第一处理器和第一存储器。The embodiment of the present application provides an inter-frame prediction method, which is applied to a video decoding device, that is, a decoder. The function implemented by this method can be implemented by the first processor in the decoder calling a computer program. Of course, the computer program can be stored in the first memory. It can be seen that the decoder includes at least a first processor and a first memory.
参见图5,其示出了本申请实施例一种帧间预测方法的流程示意图。如图5所示,该方法可以包括:Refer to FIG. 5, which shows a schematic flowchart of an inter-frame prediction method according to an embodiment of the present application. As shown in Figure 5, the method may include:
S501:解析码流,获取当前块的预测模式参数。S501: Parse the code stream to obtain the prediction mode parameter of the current block.
需要说明的是,待解码图像可以划分为多个图像块,而当前待解码的图像块可以称为当前块(可以用CU或PU表示),与当前块相邻的图像块可以称为相邻块;即在待解码图像中,当前块与相邻块之间具有相邻关系。这里,每个当前块可以包括第一图像分量、第二图像分量和第三图像分量,也即当前块表示待解码图像中当前待进行第一图像分量、第二图像分量或者第三图像分量预测的图像块。It should be noted that the image to be decoded can be divided into multiple image blocks, and the image block currently to be decoded can be called the current block (which can be represented by CU or PU), and the image block adjacent to the current block can be called adjacent Block; that is, in the image to be decoded, there is an adjacent 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 the prediction of the first image component, the second image component, or the third image component in the image to be decoded. Image block.
其中,假定当前块进行第一图像分量预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么当前块也可以称为亮度块;或者,假定当前块进行第二图像分量预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么当前块也可以称为色度块。Among them, assuming that the current block performs the first image component prediction, and the first image component is the brightness component, that is, the image component to be predicted is the brightness component, then the current block can also be called the brightness block; or, it is assumed that the current block performs the second image component Prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.
还需要说明的是,预测模式参数指示了当前块采用的预测模式以及与该预测模式相关的参数。其中,预测模式通常包括有帧间预测模式、传统帧内预测模式和非传统帧内预测模式等,而帧间预测模式又包括有普通帧间预测模式、GPM预测模式和AWP预测模式等。也就是说,编码器会选取最优的预测模式对当前块进行预编码,在这过程中就可以确定出当前块的预测模式,从而将相应的预测模式参数写入码流,由编码器传输到解码器。It should also be noted that the prediction mode parameter indicates the prediction mode adopted by the current block and the parameters related to the prediction mode. Among them, prediction modes usually include inter prediction modes, traditional intra prediction modes, and non-traditional intra prediction modes, etc., while inter prediction modes include ordinary inter prediction modes, GPM prediction modes, and AWP prediction modes. In other words, the encoder will select the optimal prediction mode to pre-encode the current block. In this process, the prediction mode of the current block can be determined, and the corresponding prediction mode parameters will be written into the code stream and transmitted by the encoder. To the decoder.
这样,在解码器侧,通过解析码流就可以直接获取到当前块的预测模式参数,根据所获取的预测模式参数用以确定当前块是否使用预设的帧间预测模式,比如GPM预测模式或AWP预测模式。In this way, on the decoder side, the prediction mode parameters of the current block can be directly obtained by parsing the code stream, and the obtained prediction mode parameters are used to determine whether the current block uses the preset inter prediction mode, such as GPM prediction mode or AWP prediction model.
S502:当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定当前块的至少一个初始候选位置。S502: When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block.
需要说明的是,在解码器解析码流获取到预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值的情况下,就可以采用本申请实施例所提供的帧间预测方法。It should be noted that when the decoder parses the code stream and obtains that the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, the inter prediction provided in the embodiment of the application can be used. method.
还需要说明的是,运动信息可以包括运动矢量信息和参考帧信息。具体地,对于使用帧间预测的当前块而言,该当前块所在的当前帧具有一个或多个参考帧,而当前块可以是编码单元或预测单元,可以使用一个包含一组运动矢量和参考帧信息的运动信息指示到某一参考帧内一个与当前块大小相同的像素区域,这里称之为参考块,也可以使用一个包含两组运动矢量和参考帧信息的运动信息指示到某两个可以相同也可以不同的参考帧内的两个参考块;然后运动补偿可以根据运动信息所指示的参考块得到当前块的帧间预测值。It should also be noted that the motion information may include motion vector information and reference frame information. Specifically, for a current block that uses inter-frame prediction, the current frame in which the current block is located has one or more reference frames, and the current block can be a coding unit or a prediction unit, and a set of motion vectors and reference frames can be used. The motion information of the frame information indicates a pixel area of the same size as the current block in a reference frame, which is referred to as a reference block here. A motion information containing two sets of motion vectors and reference frame information can also be used to indicate to two The two reference blocks in the reference frame may be the same or different; then, the motion compensation may obtain the inter-frame prediction value of the current block according to the reference block indicated by the motion information.
在本申请实施例中,为了避免硬件实现时增加额外的带宽,本申请实施例的目的就是使硬件实现时不增加额外的带宽而且尽量保持其压缩性能。这里,使硬件实现时不增加额外地带宽就需要使得确定时域运动信息所使用的像素位置不超过当前LCU的边界。需要注意的是,后面统一将确定时域运动信息所使用的像素位置简称为位置。In the embodiments of the present application, in order to avoid adding additional bandwidth during hardware implementation, the purpose of the embodiments of the present application is to prevent additional bandwidth during hardware implementation and maintain its compression performance as much as possible. Here, if the hardware is implemented without adding additional bandwidth, it is necessary to ensure that the pixel position used for determining the temporal motion information does not exceed the boundary of the current LCU. It should be noted that the pixel position used to determine the temporal motion information will be referred to as position in the following uniformly.
在一些实施例中,对于S502来说,所述确定所述当前块的至少一个候选位置,可以包括:In some embodiments, for S502, the determining at least one candidate position of the current block may include:
获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括下述至少一项:左上初始候选位置、右上初始候选位置、左下初始候选位置和右下初始候选位置;Obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following: upper left initial candidate position, upper right initial candidate position, and lower left initial candidate position And the initial candidate position in the lower right;
从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。From the set of initial candidate positions, at least one initial candidate position of the current block is determined.
进一步地,在一些实施例中,左上初始候选位置至少包括下述其中之一:第一左上候选位置、第二左上候选位置、第三左上候选位置和第四左上候选位置;Further, in some embodiments, the upper left initial candidate position includes at least one of the following: 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;
右上初始候选位置至少包括下述其中之一:第一右上候选位置、第二右上候选位置、第三右上候选位置和第四右上候选位置;The upper right initial candidate position includes 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 initial lower left candidate position includes at least 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 initial lower right candidate position includes at least 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 corner positions inside the current block, and the second The upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent the upper left corner position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth The upper right candidate position represents the upper right corner 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 the lower left corner position outside the current block, the The second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right corner position outside the current block.
需要说明的是,假定当前块内部的左上角位置,也就是当前块左上角第一个像素对应的像素位置为(x,y),当前块的宽度为width,当前块的高度为height。另外,这里所说的宽度和高度通常是指亮度分量的宽度(即l_width)和高度(即l_height),但不作具体限定。It should be noted that it is assumed that the upper left corner position inside the current block, that is, the pixel position 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 height mentioned here generally refer to the width (i.e., l_width) and height (i.e., l_height) of the brightness component, but are not specifically limited.
还需要说明的是,由于上面提到用于导出时域运动信息的参考帧存储导出时域运动信息的运动信息是按照块保存运动信息,那么按照某一个像素位置确定的时域运动信息和按照与该像素位置处在同一个存储块内其他像素位置确定的时域运动信息是相同的,这样在导出过程中可能有一些中间计算将某一个像素位置通过一些计算得到某些统一格式的位置,这里只要它们都处在同一个存储块内,那么可以认为这些位置是相同的。It should also be noted that since the reference frame used to derive time-domain motion information mentioned above is used to store and derive the motion information of the time-domain motion information, the motion information is stored in blocks, so the time-domain motion information determined according to a certain pixel position and in accordance with the The time domain motion information determined by other pixel positions in the same storage block as the pixel position is the same, so there may be some intermediate calculations during the export process. A certain pixel position may be calculated to obtain a certain uniform format position. As long as they are all in the same storage block, these positions can be considered the same.
一种可能的实施方式中,以图6A为例,当前块可使用的左上角(即左上初始候选位置)、右上角(即右上初始候选位置)、左下角(即左下初始候选位置)和右下角(即右下初始候选位置)的候选位置可以有多种选择。具体地,对于左上角(用灰色填充),可以使用第一左上候选位置、第二左上候选位置、第三左上候选位置和第四左上候选位置来表示,具体表示为(x,y)、(x-1,y)、(x,y-1)、(x-1,y-1)等四个位置。对右上角(用灰色填充),可以使用第一右上候选位置、第二右上候选位置、第三右上候选位置和第四右上候选位置来表示,具体表示为(x+width-1,y)、(x+width,y)、(x+width,y-1)、(x+width-1,y-1)等四个位置。对左下角(用灰色填充),可以使用第一左下候选位置、第二左下候选位置、第三左下候选位置和第四左下候选位置来表示,具体表示为(x,y+height-1)、(x,y+height)、(x-1,y+height)、(x-1,y+height-1)等四个位置。对右下角(用灰色填充),可以使用第一右下候选位置、第二右下候选位置、第三右下候选位置和第四右下候选位置来表示,具体表示为(x+width-1,y+height-1)、(x+width,y+height)、(x+width-1,y+height)、(x+width,y+height-1)等四个位置。In a possible implementation manner, taking FIG. 6A as an example, the upper left corner (that is, the upper left initial candidate position), the upper right corner (that is, the upper right initial candidate position), the lower left corner (that is, the lower left initial candidate position), and the right There are multiple choices for the candidate positions in the lower corner (ie, the lower right initial candidate position). Specifically, for the upper left corner (filled with gray), it can be represented by the first upper left candidate position, the second upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position, which are specifically expressed as (x, y), ( x-1, y), (x, y-1), (x-1, y-1) and other four positions. For the upper right corner (filled with gray), you can use the first upper right candidate position, the second upper right candidate position, the third upper right candidate position, and the fourth upper right candidate position to represent, specifically expressed as (x+width-1,y), (x+width,y), (x+width,y-1), (x+width-1,y-1) and other four positions. For the lower left corner (filled with gray), it can be represented by the first lower left candidate position, the second lower left candidate position, the third lower left candidate position, and the fourth lower left candidate position, specifically expressed as (x,y+height-1), (x,y+height), (x-1,y+height), (x-1,y+height-1) and other four positions. For the lower right corner (filled with gray), it can be represented by the first lower right candidate position, the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position, specifically expressed as (x+width-1 ,y+height-1), (x+width,y+height), (x+width-1,y+height), (x+width,y+height-1) and other four positions.
另一种可能的实施方式中,以图6B为例,针对每一个当前块,当前块可以是CU或PU,这时候可以使用的4个初始候选位置如图6B所示。这四个位置落在当前块内部的四个角位置,具体地,这四个位置分别为:左上初始候选位置为(x,y),右上初始候选位置为(x+width-1,y),左下初始候选位置为(x,y+height-1),右下初始候选位置为(x+width-1,y+height-1)。In another possible implementation manner, taking FIG. 6B as an example, for each current block, the current block may be a CU or a PU, and the four initial candidate positions that can be used at this time are shown in FIG. 6B. These four positions fall in the four corner positions inside the current block. Specifically, the four positions are: the upper left initial candidate position is (x, y), and 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).
又一种可能的实施方式中,以图6C为例,针对当前块的四个位置,即左上角、右上角、左下角、右下角的初始(默认)位置可以各自初始选择其中一个位置。具体地,如图6C所示,这四个位置分别为:左上初始候选位置为(x,y)、右上初始候选位置为(x+width,y)、左下初始候选位置为(x,y+height)、右下初始候选位置为(x+width,y+height)。In another possible implementation manner, taking FIG. 6C as an example, for the four positions of the current block, namely, the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner, one of the positions can be initially selected. Specifically, as shown in Figure 6C, the four positions are: the upper left initial candidate position is (x, y), the upper right initial candidate position is (x+width, y), and the lower left initial candidate position is (x, y+ height), the initial candidate position at the bottom right is (x+width,y+height).
再一种可能的实施方式中,以图6D为例,针对当前块的四个位置,即左上角、右上角、左下角、右下角的初始(默认)位置可以各自初始选择其中一个位置。具体地,如图6D所示,这四个位置分别为:左上初始候选位置为(x,y)、右上初始候选位置为(x+width,y-1)、左下初始候选位置为(x-1,y+height)、右下初始候选位置为(x+width,y+height)。In another possible implementation manner, taking FIG. 6D as an example, for the four positions of the current block, namely, the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner, one of the positions can be initially selected. Specifically, as shown in Figure 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), and the lower left initial candidate position is (x- 1, y+height), the initial candidate position at the bottom right is (x+width,y+height).
再一种可能的实施方式中,以图6E为例,针对当前块的四个位置,即左上角、右上角、左下角、右下角的初始(默认)位置可以各自初始选择其中一个位置。具体地,如图6E所示,这四个位置分别为:左上初始候选位置为(x-1,y-1)、右上初始候选位置为(x+width,y-1)、左下初始候选位置为(x-1,y+height)、右下初始候选位置为(x+width,y+height)。In another possible implementation manner, taking FIG. 6E as an example, for the four positions of the current block, namely, the initial (default) positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner, one of the positions may be initially selected. Specifically, as shown in Figure 6E, the four positions are: the upper left initial candidate position is (x-1, y-1), the upper right initial candidate position is (x+width, y-1), and the lower left initial candidate position It is (x-1,y+height), and the initial candidate position of the lower right is (x+width,y+height).
这样,以图6A~图6E为例,其提供了多种初始候选位置的情况。在得到初始候选位置之后,需要判断该初始候选位置是否超出当前块的LCU边界,以进一步确定当初始候选位置落在LCU边界之外时如何处理。In this way, taking FIGS. 6A to 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, so as to further determine how to deal with when the initial candidate position falls outside the LCU boundary.
S503:在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置。S503: When the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block, adjust the at least one initial candidate position to obtain at least one target candidate position of the current block.
需要说明的是,为了避免硬件实现时增加额外的带宽,这时候需要判断用于确定时域运动信息所使用的至少一个初始候选位置是否超过当前块的LCU边界。It should be noted that in order to avoid adding additional bandwidth during hardware implementation, 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.
在一些实施例中,对于S503来说,该方法还包括:在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, for S503, the method further includes: in the case that the at least one initial candidate position does not exceed the LCU boundary of the current block, determining the at least one initial candidate position as the current block At least one target candidate position of the block.
也就是说,如果某一初始候选位置超出LCU边界,那么这时候需要针对该初始候选位置进行调整,以使得调整后得到的目标候选位置未超出LCU边界;如果某一初始候选位置未超出LCU边界,那么这时候就不需要针对该初始候选位置进行调整,可以直接将该初始候选位置确定为目标候选位置。In other words, if an initial candidate position exceeds the boundary of the LCU, then the initial candidate position needs to be adjusted at this time, so that the target candidate position obtained after adjustment does not exceed the boundary of the LCU; if an initial candidate position does not exceed the boundary of the LCU , Then there is no need to adjust the initial candidate position at this time, and the initial candidate position can be directly determined as the target candidate position.
一种可能的实施方式中,可以选取当前块内部的候选位置,这时候所使用的候选位置都不超出当前 块的LCU边界,能够将其直接确定为目标候选位置。因此,在一些实施例中,该方法还可以包括:In a possible implementation manner, a candidate position within the current block can be selected. At this time, the candidate position used does not exceed the LCU boundary of the current block, and it can be directly determined as the target candidate position. Therefore, in some embodiments, the method may further include:
若所述至少一个初始候选位置包括所述第一左上候选位置,和/或,所述第一右上候选位置,和/或,所述第一左下候选位置,和/或,所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。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 right candidate position Next candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined as the at least one target candidate position of the current block.
需要说明的是,以图6B为例,由于第一左上候选位置为(x,y),和/或,第一右上候选位置为(x+width-1,y),和/或,第一左下候选位置为(x,y+height-1),和/或,第一右下候选位置(x+width-1,y+height-1),这几个初始候选位置处于当前块内部,即这几个初始候选位置都未超出当前块的LCU边界,那么这时候就可以将这几个初始候选位置确定为目标候选位置。It should be noted that, taking FIG. 6B as an example, since the first upper left candidate position is (x, y), and/or, the first upper right candidate position is (x+width-1,y), and/or, the first The lower left candidate position is (x, y+height-1), and/or, the first lower right candidate position (x+width-1, y+height-1), these initial candidate positions are inside the current block, that is None of these initial candidate positions exceeds the LCU boundary of the current block, then these initial candidate positions can be determined as target candidate positions at this time.
还需要说明的是,如果某一个位置落在LCU边界外部时,那么可以将这个位置调整到LCU边界之内,即落在LCU内部;否则,如果一个位置在当前块外部而落在LCU内部,这时候也不做调整。It should also be noted that if a certain position falls outside the LCU boundary, then this position can be adjusted to within the LCU boundary, that is, inside the LCU; otherwise, if a position falls outside the current block and falls inside the LCU, No adjustments are made at this time.
另一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,那么首选调整到这个角的LCU内部且当前块外部的某一候选位置。In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, it is preferred to adjust to a certain candidate position inside the LCU of this corner and outside the current block.
在一些实施例中,该方法还可以包括:In some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of the one of the corners exceeds the LCU boundary, select from the candidate positions corresponding to the one of the corners that does not exceed the LCU boundary The initial candidate position of one of the corners is adjusted 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, The lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.
进一步地,该方法还可以包括:若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。Further, the method may further include: if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, adjusting the lower right initial candidate position to the right inside the current block The lower corner position to obtain a target candidate position of the current block.
也就是说,以右下角为例,如果右下初始候选位置超出LCU边界,那么首先调整到右下角的LCU内部但是当前块外部的某一候选位置;如果从当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,这时候就需要调整到当前块内部的右下角位置,以确定出对应的目标候选位置。That is to say, taking the lower right corner as an example, if the lower right initial candidate position exceeds the LCU boundary, first adjust to a certain candidate position inside the lower right corner of the LCU but outside the current block; if there is no position from the lower right corner outside the current block The candidate position that does not exceed the boundary of the LCU is selected, and at this time, it needs to be adjusted to the lower right corner position inside the current block to determine the corresponding target candidate position.
具体地,以右下角为例,如果初始候选位置是(x+width,y+height),如果当前块的右边界和LCU的右边界重合而当前块的下边界在LCU的内部,那么把右下角调整到(x+width-1,y+height)。如果当前块的右边界在LCU的内部而当前块的下边界和LCU的下边界重合,那么把右下角调整到(x+width,y+height-1)。如果当前块的右边界和LCU的右边界重合而当前块的下边界和LCU的下边界重合,那么把右下角调整到(x+width-1,y+height-1)。这里,其余的左上角、右上角、左下角,都可以按上述步骤进行调整。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, then the right Adjust the lower corner 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 coincides with the lower boundary of the LCU, then adjust the lower right corner to (x+width,y+height-1). 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 adjust the lower right corner to (x+width-1,y+height-1). Here, the remaining upper left corner, upper right corner, and lower left corner can all be adjusted according to the above steps.
针对该过程,文本描述如下。其中,该文本描述仅修改了方法一、方法二、方法三和方法四种的像素位置。For this process, the text is described as follows. Among them, the text description only modifies the pixel positions of method one, method two, method three and method four.
方法一,以当前块的左上角为例,推导运动信息的步骤如下:Method 1: Taking the upper left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左上角亮度样本位置为(x’,y’),x’=x–1,y’=y–1。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-left luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y-1.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_lcu_left,或x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left;那么x’=x;If x'is smaller than the abscissa x_lcu_left of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is smaller than the abscissa of the leftmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_left; then x'=x;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,或y’不可用,比如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top;那么y’=y。If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is smaller than the ordinate of the uppermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y.
方法二,以当前块的右上角为例,推导运动信息的步骤如下:Method 2: Taking the upper right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右上角亮度样本位置为(x’,y’),x’=x+l_width,y’=y-1Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-right luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y-1
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,或x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right;那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is greater than the abscissa of the rightmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_right; then x'=x+l_width-1;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,或y’不可用,比如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top;那么y’=y。If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is smaller than the ordinate of the uppermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y.
方法三,以当前块的左下角为例,推导运动信息的步骤如下:Method 3: Taking the lower left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左下角亮度样本位置为(x’,y’),x’=x-1,y’=y+l_height。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the lower-left luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y+l_height.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_l,或x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left;那么x’=x;If x'is smaller than the abscissa x_l of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is smaller than the abscissa of the leftmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_left; then x'=x;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_b,或y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_bottom;那么,y’=y+l_height-1。If y'is greater than the ordinate y_b of the lowermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is greater than the ordinate of the lowermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_bottom; then, y'=y+l_height-1.
方法四,以当前块的右下角为例,推导运动信息的步骤如下:Method 4: Taking the lower right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右下角亮度样本位置为(x’,y’),x’=x+l_width,y’=y+l_height。Assume that the position of the upper left luminance sample 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 luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y+l_height.
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,或x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right;那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is greater than the abscissa of the rightmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_right; then x'=x+l_width-1;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_lcu_bottom,或y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_top;那么y’=y+l_height-1。If y'is greater than the ordinate y_lcu_bottom of the lowermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is greater than the ordinate of the lowermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y+l_height-1.
需要说明的是,由于在目前标准协议中的片(patch)总是矩形区域,所以上述对片边界的处理是没有问题的;但是如果后续patch不止限制为矩形区域,那么对x’,y’不可用的判断就要改成判断(x’,y’)是否在patch的范围内,这里不再赘述。It should be noted that since the patch in the current standard protocol is always a rectangular area, there is no problem with the above-mentioned processing of the patch boundary; but if the subsequent patch is not limited to a rectangular area, then x', y' The unavailable judgment should be changed to judge whether (x', y') is within the range of the patch, so I won't repeat it here.
具体地,如果当前预测单元,也就是当前块不会超过图像或片边界,目前的标准协议中是这样的情况。但是如果当前预测单元,也就是当前块可能超过图像或片边界,那么上面的文本描述中可写为:Specifically, if the current prediction unit, that is, the current block does not exceed the image or slice boundary, this is the case in the current standard protocol. But if the current prediction unit, that is, the current block may exceed the image or slice boundary, then the above text description can be written as:
方法一,以当前块的左上角为例,推导运动信息的步骤如下:Method 1: Taking the upper left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左上角亮度样本位置为(x’,y’),x’=x–1,y’=y–1。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-left luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y-1.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_lcu_left,那么x’=x;If x'is smaller than the abscissa x_lcu_left of the leftmost luminance sample position of the LCU where the current prediction unit is located, then x'=x;
如果x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left,那么x’=x_boundary_left;If x’ is not available, for example, x’ is smaller than the abscissa x_boundary_left of the leftmost luminance sample position of the image where the current prediction unit is located, then x’=x_boundary_left;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,那么y’=y;If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, then y'=y;
如果y’不可用,比如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top,那么y’=y_boundary_top。If y'is not available, for example, y'is smaller than the ordinate y_boundary_top of the uppermost luminance sample position of the image or patch where the current prediction unit is located, then y'=y_boundary_top.
方法二,以当前块的右上角为例,推导运动信息的步骤如下:Method 2: Taking the upper right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右上角亮度样本位置为(x’,y’),x’=x+l_width,y’=y–1。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-right luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y-1.
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, then x'=x+l_width-1;
如果x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right,那么x’=x_boundary_right;If x’ is not available, for example, x’ is greater than the abscissa x_boundary_right of the image where the current prediction unit is located or the rightmost luminance sample position of the patch, then x’=x_boundary_right;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,那么y’=y;If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, then y'=y;
如果y’不可用,如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top,那么y’=y_boundary_top。If y'is not available, such as y'is smaller than the ordinate y_boundary_top of the uppermost luminance sample position of the image or patch where the current prediction unit is located, then y'=y_boundary_top.
方法三,以当前块的左下角为例,推导运动信息的步骤如下:Method 3: Taking the lower left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右上角亮度样本位置为(x’,y’),x’=x-1,y’=y+l_height。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-right luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y+l_height.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_l,那么x’=x;If x'is smaller than the abscissa x_l of the leftmost luminance sample position of the LCU where the current prediction unit is located, then x'=x;
如果x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left,那么x’=x_boundary_left;If x’ is not available, for example, x’ is smaller than the abscissa x_boundary_left of the leftmost luminance sample position of the image where the current prediction unit is located, then x’=x_boundary_left;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_b,那么y’=y+l_height–1;If y'is greater than the ordinate y_b of the lowermost luminance sample position of the LCU where the current prediction unit is located, then y'=y+l_height-1;
如果y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_bottom,那么y’=y_boundary_bottom。If y'is not available, for example, y'is greater than the ordinate y_boundary_bottom of the lowermost luminance sample position of the image or patch where the current prediction unit is located, then y'=y_boundary_bottom.
方法四,以当前块的右下角为例,推导运动信息的步骤如下:Method 4: Taking the lower right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右下角亮度样本位置为(x’,y’),x’=x+l_width,y’=y+l_height。Assume that the position of the upper left luminance sample 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 luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y+l_height.
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, then x'=x+l_width-1;
如果x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right,那么x’=x_boundary_right;If x’ is not available, for example, x’ is greater than the abscissa x_boundary_right of the image where the current prediction unit is located or the rightmost luminance sample position of the patch, then x’=x_boundary_right;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_lcu_bottom,那么y’=y+l_height–1;If y'is greater than the ordinate y_lcu_bottom of the lowermost luminance sample position of the LCU where the current prediction unit is located, then y'=y+l_height-1;
如果y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_top,那么y’=y_boundary_top。If y'is not available, for example, y'is greater than the ordinate y_boundary_top of the lowermost luminance sample position of the image or patch where the current prediction unit is located, then y'=y_boundary_top.
还需要注意的是,左上角亮度样本位置(x,y)可能怎么都不会超过图像或片边界;也就是说,上述的文本描述只是为了改动保持格式上的一致。It should also be noted that the brightness sample position (x, y) in the upper left corner may never exceed the image or slice boundary; that is, the above text description is only for the purpose of changing to maintain the consistency of the format.
又一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,那么可以调整到另外一个初始位置落在LCU内部的角的候选位置。In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, it can be adjusted to another corner candidate position whose initial position falls inside the LCU.
在一些实施例中,该方法还可以包括:In some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select the candidate positions corresponding to the remaining corners except for the one of the corners. For candidate positions beyond the boundary of the LCU, the initial candidate position of one of the corners is adjusted 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right The initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
也就是说,针对不同的划分模式,可以具有不同的初始候选位置。以划分模式54为例(从0开始),如果导出时域运动信息应该使用右下角的初始候选位置,即(x+width,y+height);但是如果当前块的右边界在LCU内部而当前块的下边界和LCU的下边界重合,那么该初始候选位置(x+width,y+height)超出LCU边界,这时候如果右上角的候选位置在LCU内部,可以使用右上角的候选位置。其中,右上角的候选位置可能是(x+width,y)、(x+width-1,y)或者(x+width,y-1)。In other words, for different division modes, there may be different initial candidate positions. Take the division mode 54 as an example (starting from 0), if the time domain motion information is derived, the initial candidate position in the lower right corner should be used, that is (x+width,y+height); but if the right boundary of the current block is inside the LCU and the current The lower boundary of the block coincides with the lower boundary of the LCU, and the initial candidate position (x+width, y+height) exceeds the boundary of the LCU. At this time, if the candidate position of the upper right corner is inside the LCU, the candidate position of the upper right corner can be used. Among them, the candidate position in the upper right corner may be (x+width,y), (x+width-1,y) or (x+width,y-1).
再一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,且这个角只能调整到当前块内部,那么可以调整到另外一个初始位置落在LCU内部的角的候选位置。In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, and this corner can only be adjusted inside the current block, then it can be adjusted to another corner whose initial position falls inside the LCU. Candidate position.
在一些实施例中,该方法还可以包括:In some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, a candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边 界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate is included in the lower right corner positions inside and outside the current block If the position does not exceed the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block .
也就是说,针对不同的划分模式,可以具有不同的初始候选位置。以划分模式54为例(从0开始),如果导出时域运动信息应该使用右下角的初始候选位置,即(x+width,y+height);但是如果当前块的右边界与LCU的右边界重合且当前块的下边界和LCU的下边界重合,那么该初始候选位置(x+width,y+height)超出LCU边界,且右下角处的(x+width-1,y+height)和(x+width,y+height-1)也超出LCU边界,而仅(x+width-1,y+height-1)在当前块内部而没有超出LCU边界,这时候如果右上角的候选位置在LCU内部,可以使用右上角的候选位置。其中,右上角的候选位置可能是(x+width,y)、(x+width-1,y)或者(x+width,y-1)。In other words, for different division modes, there may be different initial candidate positions. Take the division mode 54 as an example (starting from 0), if the time domain motion information is derived, the initial candidate position in the lower right corner should be used, that is (x+width,y+height); but if the right boundary of the current block and the right boundary of the LCU If 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 boundary of the LCU, and the (x+width-1,y+height) and ( x+width, y+height-1) also exceeds the LCU boundary, and only (x+width-1, y+height-1) is inside the current block without exceeding the LCU boundary. At this time, if the candidate position in the upper right corner is in the LCU Inside, you can use the candidate position in the upper right corner. Among them, the candidate position in the upper right corner may be (x+width,y), (x+width-1,y) or (x+width,y-1).
再一种可能的实施方式中,还可以是对每一个划分模式设置这至少一个初始候选位置的优先级排序,然后依次检查是否超出当前块的LCU边界。In yet another possible implementation manner, the priority order of the at least one initial candidate position may be set for each division mode, and then it is checked in turn whether it exceeds the LCU boundary of the current block.
在一些实施例中,该方法还可以包括:In some embodiments, the method may further include:
针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;For different division modes, setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order;
按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset priority order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order;
若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
也就是说,针对不同的划分模式,可以设置不同的预设优先级顺序。仍以划分模式54为例(从0开始),针对划分模式54,可以设置左上角、右上角、左下角和右下角等四个初始候选位置的优先级排序,比如设置的初始候选位置排序为3、1、2、0,即优先选取右下角,再选取右上角,然后再选取左下角,最后选取左上角;按照上述方式依次进行判断。In other words, for different division modes, different preset priority orders can be set. Still taking the division mode 54 as an example (starting from 0), for the division mode 54, you can set the priority order of the four initial candidate positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner. For example, the initial candidate position order is set as 3, 1, 2, 0, that is, the lower right corner is selected first, then the upper right corner is selected, then the lower left corner is selected, and the upper left corner is finally selected; the judgments are made in sequence according to the above method.
再一种可能的实施方式中,还可以是对每一个划分模式设置这至少一个初始候选位置的固定排序顺序,然后依次检查是否超出当前块的LCU边界。In another possible implementation manner, it is also possible to set a fixed sorting order of the at least one initial candidate position for each division mode, and then sequentially check whether it exceeds the LCU boundary of the current block.
在一些实施例中,该方法还可以包括:In some embodiments, the method may further include:
针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;For different division modes, sort different initial candidate positions in the initial candidate position set according to a preset order;
按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to perform the step of selecting an initial candidate position according to the preset order;
若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
也就是说,还可以是按照一个固定的预设顺序排序,比如按照0,1,2,3,0,1,……的顺序,如果某一个划分模式首先选取3,即右下角,但是右下角不能落在LCU内部(即超出LCU边界)但位于当前块外部;那么选取0再次尝试,即左上角,如果0也不满足,那么选取1再次尝试,即右上角,以此类推,直至4个初始候选位置都依次判断过。In other words, it can also be sorted according to a fixed preset order, for example, in the order of 0, 1, 2, 3, 0, 1, ..., if a certain division mode first selects 3, which is the lower right corner, but the right The lower corner cannot fall inside the LCU (that is, beyond the boundary of the LCU) but is outside the current block; then select 0 to try again, that is, the upper left corner, if 0 is not satisfied, then select 1 to try again, that is, the upper right corner, and so on, until 4 The initial candidate positions are all judged in turn.
进一步地,如果四个初始候选位置都不能落在LCU内部而位于当前块外部,那么还可以设置位置排序(比如预设优先级顺序或者预设顺序)的第一个角的当前块内部位置,以将其确定为目标候选位置;或者,如果四个初始候选位置都不能落在LCU内部而位于当前块外部,另一种方式是选择一个默认位置,比如当前块内部的左上角位置,以将其确定为目标候选位置。Further, if the four initial candidate positions cannot fall inside the LCU but are outside the current block, then the position sorting (such as the preset priority order or the preset order) of the first corner of the current block internal position can also be set, To determine it as the target candidate position; or, if the four initial candidate positions cannot fall inside the LCU but are outside the current block, another way is to select a default position, such as the upper left corner position inside the current block, to change It is determined as the target candidate position.
这里,计算(x,y)和(x’,y’)是不是在同一个LCU内部可以简单地判断。具体地,如果x除以LCU的亮度样本的宽度等于x’除以LCU的亮度样本的宽度,且y除以LCU的亮度样本的高度等于y’除以LCU的亮度样本的高度,那么(x,y)和(x’,y’)位于同一个LCU内部;否则,(x,y)和(x’,y’)不位于同一个LCU内部。Here, calculating whether (x, y) and (x', y') are in the same LCU can be simply judged. Specifically, if x divided by the width of the luminance sample of the LCU is equal to x'divided by the width of the luminance sample of the LCU, and y divided by the height of the luminance sample of the LCU is equal to y'divided by the height of the luminance sample of the LCU, then (x , Y) and (x', y') are located in the same LCU; otherwise, (x, y) and (x', y') are not located in the same LCU.
S504:基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息。S504: Determine at least one temporal motion information of the current block based on the at least one candidate target position.
需要说明的是,在得到至少一个目标候选位置之后,可以根据所得到的目标候选位置来确定时域运动信息,具体是将对应参考帧中的时域位置所使用的运动信息作为该目标候选位置的时域运动信息。这里,当前块所属的帧可以为称为当前帧,当前帧中的目标候选位置与参考帧中的时域位置虽然所属的帧不同,但是位置是相同的。It should be noted that after at least one candidate target position is obtained, the temporal motion information can be determined according to the obtained candidate target position. Specifically, the motion information used for the temporal position in the corresponding reference frame is used as the target candidate position. Time domain motion information. Here, the frame to which the current block belongs may be referred to as the current frame. Although the target candidate position in the current frame and the time domain position in the reference frame belong to different frames, the positions are the same.
在一些实施例中,对于S504来说,所述基于所述至少一个目标候选位置,确定所述当前块的至少 一个时域运动信息,可以包括: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 the reference frame information corresponding to each target candidate position in the at least one target candidate position;
针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并将所述时域位置使用的运动信息确定为所述目标候选位置对应的时域运动信息;For each target candidate position, determine the time domain position associated with the target candidate position in the corresponding reference frame information, and determine the motion information used by the time domain position as the time domain motion corresponding to the target candidate position information;
基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。Based on the at least one target candidate position, correspondingly obtain at least one temporal motion information.
也就是说,时域运动信息是根据某一个参考帧信息中对应位置所使用的运动信息来确定的。而且针对不同的目标候选位置,可以得到不同的时域运动信息。In other words, the temporal motion information is determined according to the motion information used in the corresponding position in a certain reference frame information. And for different target candidate positions, different temporal motion information can be obtained.
示例性地,方法一,以当前块的左上角为例,推导运动信息的步骤如下:Exemplarily, in method 1, taking the upper left corner of the current block as an example, the steps for deriving motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左上角亮度样本位置为(x’,y’),x’=x–1,y’=y–1。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-left luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y-1.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_lcu_left,或x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left;那么x’=x;If x'is smaller than the abscissa x_lcu_left of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is smaller than the abscissa of the leftmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_left; then x'=x;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,或y’不可用,比如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top;那么y’=y。If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is smaller than the ordinate of the uppermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与当前预测单元的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction unit Both the L0 reference index and the L1 reference index are equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与当前预测单元的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the upper left corner of the current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), the motion The distance index of the image where the information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000009
Figure PCTCN2021089252-appb-000009
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000010
Figure PCTCN2021089252-appb-000010
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法二,以当前块的右上角为例,推导运动信息的步骤如下:Method 2: Taking the upper right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右上角亮度样本位置为(x’,y’),x’=x+l_width,y’=y-1Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the upper-right luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y-1
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,或x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right;那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is greater than the abscissa of the rightmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_right; then x'=x+l_width-1;
如果y’小于当前预测单元所在的LCU的最上边的亮度样本位置的纵坐标y_lcu_top,或y’不可用,比如y’小于当前预测单元所在的图像或patch的最上边的亮度样本位置的纵坐标y_boundary_top;那么y’=y。If y'is smaller than the ordinate y_lcu_top of the uppermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is smaller than the ordinate of the uppermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的右上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position in the upper right corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的右上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position in the upper right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000011
Figure PCTCN2021089252-appb-000011
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000012
Figure PCTCN2021089252-appb-000012
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法三,以当前块的左下角为例,推导运动信息的步骤如下:Method 3: Taking the lower left corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的左下角亮度样本位置为(x’,y’),x’=x-1,y’=y+l_height。Assume that the upper-left luminance sample position of the current prediction unit is (x, y), the width of the luminance prediction block is l_width, and the height of the luminance prediction block is l_height; and the lower-left luminance sample position of the selected current prediction unit is (x', y'), x'=x-1, y'=y+l_height.
如果x’小于当前预测单元所在的LCU的最左边的亮度样本位置的横坐标x_l,或x’不可用,比如x’小于当前预测单元所在的图像或patch的最左边的亮度样本位置的横坐标x_boundary_left;那么x’=x;If x'is smaller than the abscissa x_l of the leftmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is smaller than the abscissa of the leftmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_left; then x'=x;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_b,或y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_bottom;那么,y’=y+l_height-1。If y'is greater than the ordinate y_b of the lowermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is greater than the ordinate of the lowermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_bottom; then, y'=y+l_height-1.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的左下角亮度样本位置对应 的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position of the lower left corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的左下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position of the lower left corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000013
Figure PCTCN2021089252-appb-000013
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000014
Figure PCTCN2021089252-appb-000014
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
方法四,以当前块的右下角为例,推导运动信息的步骤如下:Method 4: Taking the lower right corner of the current block as an example, the steps to derive motion information are as follows:
第一步,first step,
假定当前预测单元的左上角亮度样本位置为(x,y),亮度预测块的宽度为l_width,亮度预测块的高度为l_height;而所选当前预测单元的右下角亮度样本位置为(x’,y’),x’=x+l_width,y’=y+l_height。Assume that the position of the upper left luminance sample 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 luminance sample position of the selected current prediction unit is (x', y'), x'=x+l_width, y'=y+l_height.
如果x’大于当前预测单元所在的LCU的最右边的亮度样本位置的横坐标x_lcu_right,或x’不可用,比如x’大于当前预测单元所在的图像或patch的最右边的亮度样本位置的横坐标x_boundary_right;那么x’=x+l_width-1;If x'is greater than the abscissa x_lcu_right of the rightmost luminance sample position of the LCU where the current prediction unit is located, or x'is not available, for example, x'is greater than the abscissa of the rightmost luminance sample position of the image or patch where the current prediction unit is located x_boundary_right; then x'=x+l_width-1;
如果y’大于当前预测单元所在的LCU的最下边的亮度样本位置的纵坐标y_lcu_bottom,或y’不可用,比如y’大于当前预测单元所在的图像或patch的最下边的亮度样本位置的纵坐标y_boundary_top;那么y’=y+l_height-1。If y'is greater than the ordinate y_lcu_bottom of the lowermost luminance sample position of the LCU where the current prediction unit is located, or y'is not available, for example, y'is greater than the ordinate of the lowermost luminance sample position of the image or patch where the current prediction unit is located y_boundary_top; then y'=y+l_height-1.
第二步,The second step,
如果参考图像队列1中参考索引值为0的图像中与所选当前预测单元的右下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1,则当前预测单元的L0参考索引和L1参考索引均等于0。以当前预测单元所在编码单元的尺寸和位置作为当前预测单元的尺寸和位置,然后将所得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前预测单元的L0运动矢量MvE0和L1运动矢量MvE1,并令当前预测单元的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。If the reference frame index stored in the temporal motion information storage unit of the brightness sample corresponding to the brightness sample position in the lower right corner of the selected current prediction unit in the image with the reference index value of 0 in the reference image queue 1 is -1, then the current prediction The L0 reference index and L1 reference index of the unit are both equal to zero. Take the size and position of the coding unit where the current prediction unit is located as the size and position of the current prediction unit, and then use the obtained L0 motion vector predictor and L1 motion vector predictor as the L0 motion vector MvE0 and L1 motion vector of the current prediction unit, respectively MvE1, and make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current prediction unit both equal to 0, and the motion information derivation process is ended.
否则,otherwise,
当前预测单元的L0参考索引和L1参考索引均等于0。当前预测单元的L0参考索引和L1参考索引对应的图像的距离索引分别记为DistanceIndexL0和DistanceIndexL1;当前预测单元的L0参考索引和L1参考索引对应的图像的BlockDistance分别记为BlockDistanceL0和BlockDistanceL1。Both the L0 reference index and the L1 reference index of the current prediction unit are equal to zero. The distance indexes of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as DistanceIndexL0 and DistanceIndexL1, respectively; the BlockDistance of the image corresponding to the L0 reference index and the L1 reference index of the current prediction unit are recorded as BlockDistanceL0 and BlockDistanceL1, respectively.
在参考图像队列1中参考索引为0的图像中与所选当前预测单元的右下角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。The L0 motion vector of the temporal motion information storage unit where the brightness sample corresponding to the brightness sample position at the lower right corner of the selected current prediction unit is located in the image with the reference index of 0 in the reference image queue 1 is denoted as mvRef(mvRef_x, mvRef_y), The distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is located is recorded as DistanceIndexRef.
第三步,third step,
BlockDistanceRef=DistanceIndexCol-DistanceIndexRefBlockDistanceRef=DistanceIndexCol-DistanceIndexRef
第四步,the fourth step,
令当前预测单元的L0参考索引RefIdxL0等于0,计算当前预测单元的L0运动矢量mvE0(mvE0_x,mvE0_y):Let the L0 reference index RefIdxL0 of the current prediction unit be equal to 0, and calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000015
Figure PCTCN2021089252-appb-000015
这里,mvX即为mvRef,MVX即为mvE0。Here, mvX is mvRef, and MVX is mvE0.
令当前预测单元的L1参考索引RefIdxL1等于0,计算当前预测单元的L1运动矢量mvE1(mvE1_x,mvE1_y):Let the L1 reference index RefIdxL1 of the current prediction unit be equal to 0, and calculate the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current prediction unit:
Figure PCTCN2021089252-appb-000016
Figure PCTCN2021089252-appb-000016
这里,mvX即为mvRef,MVX即为mvE1。Here, mvX is mvRef, and MVX is mvE1.
第五步,interPredRefMode的值等于‘PRED_List01’。In the fifth step, the value of interPredRefMode is equal to ‘PRED_List01’.
这样,在导出时域运动信息之后,可以将所得到的时域运动信息填充至运动信息候选列表中,以得到新的运动信息候选列表。In this way, after the temporal motion information is derived, the obtained temporal motion information can be filled into the motion information candidate list to obtain a new motion information candidate list.
S505:基于所述至少一个时域运动信息,构建新的运动信息候选列表。S505: Based on the at least one temporal motion information, construct a new motion information candidate list.
需要说明的是,在得到至少一个时域运动信息之后,可以将其填入到运动信息候选列表中,以得到新的运动信息候选列表。具体地,对于S505来说,该步骤可以包括:将至少一个时域运动信息填入运动信息候选列表中,得到所述新的运动信息候选列表。It should be noted that after obtaining at least one temporal motion information, it can be filled in the motion information candidate list to obtain a new motion information candidate list. Specifically, for S505, this step may include: filling at least one temporal motion information into the motion information candidate list to obtain the new motion information candidate list.
还需要说明的是,现有的运动信息候选列表中只预留一个时域运动信息的填充位置,为了提高右下角的相关性,还可以增加运动信息候选列表中时域运动信息的填充位置。具体地,在一些实施例中,该方法还可以包括:It should also be noted that only one filling position of time domain motion information is reserved in the existing motion information candidate list. In order to improve the correlation in the lower right corner, the filling position of time domain motion information in the motion information candidate list can also be added. Specifically, in some embodiments, the method may further include:
调整时域运动信息在所述新的运动信息候选列表中的比例值;Adjusting the ratio of the temporal motion information in the new motion information candidate list;
根据所调整的比例值,控制所述新的运动信息候选列表中预留至少两个时域运动信息的填充位置。According to the adjusted ratio value, control to reserve at least two filling positions of time-domain motion information in the new motion information candidate list.
也就是说,可以增加时域运动信息在运动信息候选列表中的比例值。如果AWP预测模式下候选列表中给时域运动信息保留了至少1个位置,那么可以调整为AWP预测模式下候选列表中给时域运动信息保留了至少2个(或3个)位置,使得新的运动信息候选列表中预留至少两个时域运动信息的填充位置。In other words, the ratio of the temporal motion information in the motion information candidate list can be increased. If at least 1 position is reserved for temporal motion information in the candidate list in AWP prediction mode, then it can be adjusted to reserve at least 2 (or 3) positions for temporal motion information in the candidate list in AWP prediction mode, so that the new At least two filling positions of time-domain motion information are reserved in the candidate list of motion information.
这样,在推导出时域运动信息之后,可以构建出新的运动信息候选列表。后续根据新的运动信息候选列表来确定当前块的帧间预测值。In this way, after the temporal motion information is derived, a new motion information candidate list can be constructed. Subsequently, the inter prediction value of the current block is determined according to the new motion information candidate list.
S506:根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。S506: Determine the inter prediction value of the current block according to the new motion information candidate list.
需要说明的是,当预测模式参数指示使用预设的帧间预测模式(比如GPM或AWP)确定当前块的帧间预测值时,这时候可以确定出当前块的两个分区。也就是说,该方法还可以包括:当预测模式参数指示使用GPM或AWP确定当前块的帧间预测值时,确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区。It should be noted that when the prediction mode parameter indicates that a preset inter prediction mode (such as GPM or AWP) is used to determine the inter prediction value of the current block, two partitions of the current block can be determined at this time. That is, the method may further include: when the prediction mode parameter indicates that the inter prediction value of the current block is determined using GPM or AWP, determining two partitions of the current block; wherein, the two partitions include the first partition And the second partition.
还需要说明的是,在得到新的运动信息候选列表后,可以确定出当前块的第一分区对应的运动信息和所述第二分区的运动信息;然后根据第一分区对应的运动信息和所述第二分区的运动信息,能够确定出当前块的帧间预测值。It should also be noted that after a new candidate list of motion information is obtained, the motion information corresponding to the first partition of the current block and the motion information of the second partition can be determined; and then according to the motion information and the motion information corresponding to the first partition The motion information of the second partition can determine the inter-frame prediction value of the current block.
具体地,如图7所示,其示出了本申请实施例提供的另一种帧间预测方法的流程示意图。该方法可以包括:Specifically, as shown in FIG. 7, it shows a schematic flowchart of another inter-frame prediction method provided by an embodiment of the present application. The method can include:
S701:解析码流,确定所述第一分区对应的第一运动信息索引值和所述第二分区对应的第二运动信息索引值;S701: Parse the 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;
S702:基于新的运动信息候选列表,将所述第一运动信息索引值指示的所述新的运动信息候选列表中的运动信息确定为所述第一分区的运动信息,将所述第二运动信息索引值指示的所述新的运动信息 候选列表中的运动信息确定为所述第二分区的运动信息;S702: Based on the new motion information candidate list, determine the motion information in the new motion information candidate list indicated by the first motion information index value as the motion information of the first partition, and determine the second motion The motion information in the new motion information candidate list indicated by the information index value is determined to be the motion information of the second partition;
S703:利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;S703: Use the motion information of the first partition to calculate a first prediction value of the first partition, and use the motion information of the second partition to calculate a second prediction value of the second partition;
S704:对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。S704: Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
需要说明的是,传统的单向预测只是查找一个与当前块大小相同的参考块,而传统的双向预测使用两个与当前块大小相同的参考块,且预测块内每个点的像素值为两个参考块对应位置的平均值,即每一个参考块的所有点都占50%的比例。双向加权预测使得两个参考块的比例可以不同,如第一个参考块中所有点都占75%的比例,第二个参考块中所有点都占25%的比例。但同一个参考块中的所有点的比例都相同。其他一些优化方式比如采用解码端运动矢量修正(Decoder side Motion Vector Refinement,DMVR)技术、双向光流(Bi-directional Optical Flow,BIO)等会使参考像素或预测像素产生一些变化,而且GPM或AWP也使用两个与当前块大小相同的参考块,但某些像素位置100%使用第一个参考块对应位置的像素值,某些像素位置100%使用第二个参考块对应位置的像素值,而在交界区域,按一定比例使用这两个参考块对应位置的像素值。具体这些权重如何分配,由GPM或AWP的预测模式决定,或者也可以认为GPM或AWP使用两个与当前块大小不相同的参考块,即各取所需的一部分作为参考块。It should be noted that the traditional one-way prediction only finds a reference block with the same size as the current block, while the traditional two-way prediction uses two reference blocks with the same size as the current block, and the pixel value of each point in the prediction block is The average value of the corresponding positions of the two reference blocks, that is, all points of each reference block account for 50% of the proportion. Bidirectional weighted prediction makes the ratio of two reference blocks different. For example, all points in the first reference block account for 75%, and all points in the second reference block account for 25%. But the proportions of all points in the same reference block are the same. Other optimization methods such as the use of decoder side Motion Vector Refinement (DMVR) technology, bi-directional optical flow (BIO), etc. will cause some changes in reference pixels or predicted pixels, and GPM or AWP Two reference blocks of the same size as the current block are also used, but some pixel positions 100% use the pixel value of the corresponding position of the first reference block, and some pixel positions 100% use the pixel value of the corresponding position of the second reference block. In the boundary area, the pixel values of the corresponding positions of the two reference blocks are used in a certain proportion. How to allocate these weights is determined by the prediction mode of GPM or AWP, or it can also be considered that GPM or AWP uses two reference blocks with different sizes from the current block, that is, each takes a required part as a reference block.
示例性地,如图8A所示,其示出了本申请实施例提供的一种GPM在64×64的当前块上的多种划分模式的权重分配示意图。在图8A中,GPM存在有64种划分模式。如图8B所示,其示出了本申请实施例提供的一种AWP在64×64的当前块上的多种划分模式的权重分配示意图。在图8B中,AWP存在有56种划分模式。无论是图8A还是图8B,每一种划分模式下,黑色区域表示第一个参考块对应位置的权重值为0%,白色区域表示第一个参考块对应位置的权重值为100%,灰色区域则按颜色深浅的不同表示第一个参考块对应位置的权重值为大于0%且小于100%的某一个权重值,第二个参考块对应位置的权重值则为100%减去第一个参考块对应位置的权重值。Exemplarily, as shown in FIG. 8A, it shows a schematic diagram of weight distribution of multiple division modes of GPM on a 64×64 current block provided by an embodiment of the present application. In Figure 8A, there are 64 division modes for GPM. As shown in FIG. 8B, it shows a schematic diagram of weight distribution of multiple division modes of an AWP on a 64×64 current block provided by an embodiment of the present application. In Figure 8B, there are 56 division modes for AWP. Whether it is Figure 8A or Figure 8B, in each division mode, the black area indicates that the weight value of the corresponding position of the first reference block is 0%, the white area indicates that the weight value of the corresponding position of the first reference block is 100%, and the gray According to the difference in color depth, the area indicates that the weight value of the corresponding position of the first reference block is a weight value greater than 0% and less than 100%, and the weight value of the corresponding position of the second reference block is 100% minus the first The weight value of the corresponding position of each reference block.
应理解,早期的编解码技术中只存在矩形的划分方式,无论是CU、PU还是变换单元(Transform Unit,TU)的划分。而GPM或AWP均实现了非矩形的划分,即用一条直线可以将一个矩形块分成两个分区,根据直线的位置和角度的不同,划分的两个分区可能是三角形或梯形或矩形等,从而能使得划分更贴近物体的边缘或者两个运动不同区域的边缘。需要注意的是,这里所说的划分并不是真正意义上的划分,而更像是一种预测效果上的划分。因为这个划分只是划分了两个参考块在产生预测块时的权重,或者可以简单地理解为预测块的一部分位置来自于第一个参考块,而另一部分位置来自于第二个参考块,并没有真正按划分线把当前块划分成两个CU或PU或TU。这样,在预测之后残差的变换、量化、反变换、反量化等也都是将当前块作为一个整体进行处理。It should be understood that in the early coding and decoding technologies, only rectangular divisions existed, whether it is CU, PU, or transform unit (Transform Unit, TU) division. Both GPM and AWP achieve non-rectangular division, that is, a rectangular block can be divided into two partitions with a straight line. According to the position and angle of the straight line, the two partitions may be triangles, trapezoids, or rectangles, etc. It can make the division closer to the edge of the object or the edge of two different moving areas. It should be noted that the division mentioned here is not a division in the true sense, but more like a division of prediction effects. Because this division only divides the weight of the two reference blocks when generating the prediction block, or it can be simply understood that part of the position of the prediction block comes from the first reference block, and another part of the position comes from the second reference block, and There is no real division of the current block into two CUs or PUs or TUs according to the dividing line. In this way, the transformation, quantization, inverse transformation, and inverse quantization of the residuals after prediction are also processed with the current block as a whole.
还需要说明的是,GPM或AWP属于一种帧间预测技术,GPM或AWP需要在码流中传输一个GPM或AWP是否使用的标志(flag),该flag可以指示当前块是否使用GPM或AWP。如果使用GPM或AWP,编码器在码流中需要传输具体使用的模式,即GPM的64种划分模式之一,或AWP的56种划分模式之一;以及两个单向运动信息的索引值。也就是说,对于当前块而言,解码器通过解析码流可以得到GPM或AWP是否使用的信息,如果确定使用GPM或AWP,解码器可以解析出GPM或AWP的预测模式参数以及两个运动信息索引值,比如当前块可以划分为两个分区,那么可以解析出第一分区对应的第一运动信息索引值和第二分区对应的第二运动信息索引值。It should also be noted that GPM or AWP belongs to an inter-frame prediction technology, and GPM or AWP needs to transmit a flag (flag) of whether GPM or AWP is used in the code stream, and the flag can indicate whether the current block uses GPM or AWP. If GPM or AWP is used, the encoder needs to transmit the specific mode used in the code stream, that is, one of the 64 division modes of GPM, or one of the 56 division modes of AWP; and the index value of two unidirectional motion information. That is to say, for the current block, the decoder can obtain information about whether GPM or AWP is used by parsing the code stream. If it is determined to use GPM or AWP, the decoder can parse out the prediction mode parameters of GPM or AWP and two motion information For the index value, for example, the current block can be divided into two partitions, then the first motion information index value corresponding to the first partition and the second motion information index value corresponding to the second partition can be parsed.
在计算当前块的帧间预测值之前,首先需要构建一个新的运动信息候选列表,下面以AVS中的AWP为例介绍运动信息候选列表的构建方法。Before calculating the inter-frame prediction value of the current block, a new motion information candidate list needs to be constructed first. The following uses the AWP in AVS as an example to introduce the construction method of the motion information candidate list.
如图2B所示,块E为当前块,而块A、块B、块C、块D、块F、块G均为块E的相邻块。其中,块E的相邻块A是样本(x 0-1,y 0)所在的块,块E的相邻块B是样本(x 0,y 0-1)所在的块,块E的相邻块C是样本(x 0+1,y 0-1)所在的块,块E的相邻块D是样本(x 0-1,y 0-1)所在的块,块E的相邻块F是样本(x 0-1,y 1)所在的块,块E的相邻块G是样本(x 1,y 0-1)所在的块。其中(x 0,y 0)是块E左上角样本在图像中的坐标,(x 1,y 0)是块E右上角样本在图像中的坐标,(x 0,y 1)是块E左下角样本在图像中的坐标。也就是说,块E和它的相邻块A、B、C、D、F和G的空间位置关系详见图2B。 As shown in FIG. 2B, block E is the current block, and block A, block B, block C, block D, block F, and block G are all adjacent blocks of block E. Among them, the adjacent block A of the block E is the block where the sample (x 0 -1, y 0 ) is located, the adjacent block B of the block E is the block where the sample (x 0 , y 0 -1) is located, and the phase of the block E The adjacent block C is the block where the sample (x 0 +1, y 0 -1) is located, the adjacent block D of the block E is the block where the sample (x 0 -1, y 0 -1) is located, and the adjacent block of the block E F is the block where the sample (x 0 -1, y 1 ) is located, and the adjacent block G of the block E is the block where the sample (x 1 , y 0 -1) is located. Where (x 0 , y 0 ) are the coordinates of the upper left corner sample of block E in the image, (x 1 , y 0 ) are the coordinates of the upper right corner sample of block E in the image, (x 0 , y 1 ) is the lower left corner of block E The coordinates of the corner sample in the image. In other words, the spatial position relationship between block E and its neighboring blocks A, B, C, D, F, and G is shown in Fig. 2B.
对于图2B而言,相邻块X(X表示为A、B、C、D、F或G)“存在”是指该块应在待解码图像内并且该块应与块E属于同一空间区域;否则相邻块“不存在”。可以得到,如果块“不存在”或者尚未解码,那么此块“不可用”;否则此块“可用”。或者,如果待解码图像样本所在的块“不存在”或者此样本尚未解码,那么此样本“不可用”;否则此样本“可用”。For Figure 2B, the "existence" of the adjacent block X (X is represented as A, B, C, D, F, or G) means that the block should be in the image to be decoded and the block should belong to the same spatial region as the block E ; Otherwise, the adjacent block "does not exist". It can be obtained that if the block "does not exist" or has not been decoded, then this block is "unavailable"; otherwise, this block is "available". Or, if the block in which the image sample to be decoded is located "does not exist" or the sample has not been decoded, then this sample is "unavailable"; otherwise, this sample is "available".
假定第一个单向运动信息表示为mvAwp0L0、mvAwp0L1、RefIdxAwp0L0和RefIdxAwp0L1。其中,mvAwp0L0表示在第一个参考帧列表RefPicList0中对应的运动矢量,RefIdxAwp0L0表示在第一个参考 帧列表RefPicList0中对应的参考帧的参考索引值;mvAwp0L1表示在第二个参考帧列表RefPicList1中对应运动矢量,RefIdxAwp0L1表示在第二个参考帧列表RefPicList1中对应的参考帧的参考索引值。第二个单向运动信息以此类推。Assume that the first one-way motion information is represented as mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1. Among them, mvAwp0L0 represents the corresponding motion vector in the first reference frame list RefPicList0, RefIdxAwp0L0 represents the reference index value of the corresponding reference frame in the first reference frame list RefPicList0; mvAwp0L1 represents the corresponding motion vector in the second reference frame list RefPicList1 The motion vector, RefIdxAwp0L1 represents the reference index value of the corresponding reference frame in the second reference frame list RefPicList1. The second one-way movement information and so on.
由于这里的运动信息都是单向的,所以RefIdxAwp0L0和RefIdxAwp0L1必有一个为有效值,比如0,1,2等;另一个为无效值,比如-1。如果RefIdxAwp0L0为有效值,那么RefIdxAwp0L1为-1;这时候对应的mvAwp0L0即为所需要的运动矢量,即(x,y),mvAwp0L1不需要考虑。反之亦然。Since the motion information here is unidirectional, one of RefIdxAwp0L0 and RefIdxAwp0L1 must be a valid value, such as 0, 1, 2, etc.; the other is an invalid value, such as -1. If RefIdxAwp0L0 is a valid value, then RefIdxAwp0L1 is -1; at this time, the corresponding mvAwp0L0 is the required motion vector, namely (x, y), mvAwp0L1 does not need to be considered. vice versa.
具体来讲,推导mvAwp0L0、mvAwp0L1、RefIdxAwp0L0、RefIdxAwp0L1、mvAwp1L0、mvAwp1L1、RefIdxAwp1L0和RefIdxAwp1L1的步骤如下:Specifically, the steps to derive mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, RefIdxAwp0L1, mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1 are as follows:
第一步,如图2B所示,F、G、C、A、B和D是当前块E的相邻块,确定F、G、C、A、B和D的“可用”性:In the first step, as shown in Figure 2B, F, G, C, A, B, and D are adjacent blocks of the current block E, and determine the "availability" of F, G, C, A, B, and D:
(a)如果F存在且采用帧间预测模式,那么F“可用”;否则F“不可用”。(a) If F exists and uses inter prediction mode, then F is "available"; otherwise, F is "unavailable".
(b)如果G存在且采用帧间预测模式,则G“可用”;否则G“不可用”。(b) If G exists and uses the inter-frame prediction mode, then G is "available"; otherwise, G is "unavailable".
(c)如果C存在且采用帧间预测模式,则C“可用”;否则C“不可用”。(c) If C exists and the inter-frame prediction mode is used, then C is "available"; otherwise, C is "unavailable".
(d)如果A存在且采用帧间预测模式,则A“可用”;否则A“不可用”。(d) If A exists and uses the inter-frame prediction mode, then A is "available"; otherwise, A is "unavailable".
(e)如果B存在且采用帧间预测模式,则B“可用”;否则B“不可用”。(e) If B exists and uses inter prediction mode, then B is "available"; otherwise, B is "unavailable".
(f)如果D存在且采用帧间预测模式,则D“可用”;否则D“不可用”。(f) If D exists and the inter-frame prediction mode is used, then D is "available"; otherwise, D is "unavailable".
第二步,按F、G、C、A、B和D的顺序将单向可用的运动信息放入单向运动信息候选列表(用AwpUniArray表示),直至AwpUniArray长度为3或遍历结束。In the second step, the one-way motion information available in the order of F, G, C, A, B, and D is put into the one-way motion information candidate list (represented by AwpUniArray) until the length of the AwpUniArray is 3 or the traversal ends.
第三步,如果AwpUniArray的长度小于3,按F、G、C、A、B和D的顺序将双向可用的运动信息拆分为指向参考帧列表List0的单向运动信息以及指向参考帧列表List1的单向运动信息,先进行单向运动信息查重操作,若不重复则放入AwpUniArray,直至长度为3或遍历结束。The third step, if the length of AwpUniArray is less than 3, split the bidirectional motion information available in the order of F, G, C, A, B and D into one-way motion information pointing to the reference frame list List0 and pointing to the reference frame list List1 For the unidirectional movement information, first perform the duplication operation of the unidirectional movement information, and if it is not repeated, put it into the AwpUniArray until the length is 3 or the traversal ends.
第四步,将推导出的时域双向的运动信息拆分为指向参考帧列表List0的单向运动信息以及指向参考帧列表List1的单向运动信息,先进行单向运动信息查重操作,若不重复则放入AwpUniArray,直至长度为4或遍历结束。The fourth step is to split the derived two-way motion information in the time domain into one-way motion information pointing to the reference frame list List0 and one-way motion information pointing to the reference frame list List1, and perform the one-way motion information double-checking operation first. If it is not repeated, put it into AwpUniArray until the length is 4 or the traversal ends.
第五步,如果AwpUniArray的长度小于4,那么将AwpUniArray中最后一个单向运动信息进行重复填充操作,直至AwpUniArray长度为4。In the fifth step, if the length of AwpUniArray is less than 4, the last one-way motion information in AwpUniArray will be filled repeatedly until the length of AwpUniArray is 4.
第六步,将AwpUniArray中第AwpCandIdx0+1个运动信息赋值给mvAwp0L0、mvAwp0L1、RefIdxAwp0L0和RefIdxAwp0L1;将AwpUniArray中第AwpCandIdx1+1个运动信息赋值给mvAwp1L0、mvAwp1L1、RefIdxAwp1L0和RefIdxAwp1L1。The sixth step is to assign the AwpCandIdx0+1th motion information in the AwpUniArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1; assign the AwpCandIdx1+1th motion information in the AwpUniArray to mv1, mvAvp1wpLw1, and mv1RefAvAwpLw1.
在最近一次的标准会议中,上述具体的文本描述修改如下,In the latest standard meeting, the above specific text description was revised as follows,
第一步,如图2B所示,F、G、C、A、B和D是当前块E的相邻块,确定F、G、C、A、B和D的“可用”性:In the first step, as shown in Figure 2B, F, G, C, A, B, and D are adjacent blocks of the current block E, and determine the "availability" of F, G, C, A, B, and D:
(a)如果F存在且采用帧间预测模式,则F“可用”;否则F“不可用”。(a) If F exists and adopts inter prediction mode, then F is "available"; otherwise, F is "unavailable".
(b)如果G存在且采用帧间预测模式且G和F的运动信息不相同,则G“可用”;否则G“不可用”。(b) If G exists and uses the inter-frame prediction mode and the motion information of G and F are not the same, then G is "available"; otherwise, G is "unavailable".
(c)如果C存在且采用帧间预测模式且C和G的运动信息不相同,则C“可用”;否则C“不可用”。(c) If C exists and uses the inter-frame prediction mode and the motion information of C and G are not the same, then C is "available"; otherwise, C is "unavailable".
(d)如果A存在且采用帧间预测模式且A和F的运动信息不相同,则A“可用”;否则A“不可用”。(d) If A exists and uses the inter-frame prediction mode and the motion information of A and F are not the same, then A is "available"; otherwise, A is "unavailable".
(e)如果B存在且采用帧间预测模式,则B“可用”;否则B“不可用”。(e) If B exists and uses inter prediction mode, then B is "available"; otherwise, B is "unavailable".
(f)如果D存在且采用帧间预测模式且D和A的运动信息不相同且D和G的运动信息也不相同,则D“可用”;否则D“不可用”(f) If D exists and adopts inter-frame prediction mode, and the motion information of D and A are not the same, and the motion information of D and G is not the same, then D is "available"; otherwise D "unavailable"
第二步,按F、G、C、A、B和D的顺序将可用的运动信息放入运动候选列表AwpCandArray,直至AwpCandArray长度为4或遍历结束。The second step is to put the available motion information into the motion candidate list AwpCandArray in the order of F, G, C, A, B, and D until the length of the AwpCandArray is 4 or the traversal ends.
第三步,将推导出的时域双向的运动信息放入运动候选列表AwpCandArray。The third step is to put the derived two-way motion information in the time domain into the motion candidate list AwpCandArray.
第四步,如果AwpCandArray的长度小于5,依次生成四个运动信息,生成的四个运动信息的参考帧信息与AwpCandArray中第一个运动信息的参考帧信息相同。依次对AwpCandArray中第一个运动信息的List0和List1列表对应的运动矢量记为(x,y),生成的四个运动信息对应候选列表中的运动矢量分别为(x0,y0)、(x1,y1)、(x2,y2)和(x3,y3),计算如下,In the fourth step, if the length of the AwpCandArray is less than 5, four motion information is generated in sequence, and the reference frame information of the generated four motion information is the same as the reference frame information of the first motion information in the AwpCandArray. The motion vectors corresponding to the List0 and List1 lists of the first motion information in AwpCandArray are recorded as (x, y), and the motion vectors in the candidate list corresponding to the four motion information generated are (x0, y0), (x1, y1), (x2,y2) and (x3,y3), calculated as follows,
x0=abs(x)<8?8:(abs(x)<=64?((abs(x)*5+2)>>2):(abs(x)<=128?((abs(x)*9+4)>>3):((abs(x)*33+16)>>5)))x0=abs(x)<8? 8:(abs(x)<=64?((abs(x)*5+2)>>2):(abs(x)<=128?((abs(x )*9+4)>>3):((abs(x)*33+16)>>5)))
x0=x<0?-x0:x0x0=x<0? -x0:x0
y0=yy0=y
x1=xx1=x
y1=abs(y)<8?8:(abs(y)<=64?((abs(y)*5+2)>>2):(abs(y)<=128?((abs(y)*9+4)>>3):((abs(y)*33+16)>>5)))y1=abs(y)<8? 8:(abs(y)<=64?((abs(y)*5+2)>>2):(abs(y)<=128?((abs(y )*9+4)>>3):((abs(y)*33+16)>>5)))
y1=y<0?-y1:y1y1=y<0? -y1:y1
x2=abs(x)<8?8:(abs(x)<=64?((abs(x)*3+2)>>2):(abs(x)<=128?((abs(x)*7+4)>>3):((abs(x)*31+16)>>5)))x2=abs(x)<8? 8:(abs(x)<=64?((abs(x)*3+2)>>2):(abs(x)<=128?((abs(x )*7+4)>>3):((abs(x)*31+16)>>5)))
x2=x<0?-x2:x2x2=x<0? -x2:x2
x2=abs(x)<8?-x2:x2x2=abs(x)<8? -x2:x2
y2=yy2=y
x3=xx3=x
y3=abs(y)<8?8:(abs(y)<=64?((abs(y)*3+2)>>2):(abs(y)<=128?((abs(y)*7+4)>>3):((abs(y)*31+16)>>5)))y3=abs(y)<8? 8:(abs(y)<=64?((abs(y)*3+2)>>2):(abs(y)<=128?((abs(y )*7+4)>>3):((abs(y)*31+16)>>5)))
y3=y<0?-y3:y3y3=y<0? -y3:y3
y3=abs(y)<8?-y3:y3y3=abs(y)<8? -y3:y3
将新生成的四个运动信息依次加入AwpCandArray,直至AwpCandArray的长度为5。The four newly generated motion information are sequentially added to AwpCandArray until the length of AwpCandArray is 5.
第五步,将AwpCandArray中第AwpCandIdx0+1个运动候选的某一个单项运动信息赋值给mvAwp0L0、mvAwp0L1、RefIdxAwp0L0和RefIdxAwp0L1:The fifth step is to assign a certain individual motion information of the AwpCandIdx0+1th motion candidate in the AwpCandArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0, and RefIdxAwp0L1:
(a)如果AwpCandIdx0是偶数,将运动候选指向参考帧列表List0的单向运动信息赋值给mvAwp0L0和RefIdxAwp0L0,mvAwp0L1等于零,RefIdxAwp0L1等于-1;如果List0单向运动信息不存在,将运动候选指向参考帧列表List1的单向运动信息赋值给mvAwp0L1和RefIdxAwp0L1,mvAwp0L0等于零,RefIdxAwp0L0等于-1。(a) If AwpCandIdx0 is an even number, assign the one-way motion information of the motion candidate to the reference frame list List0 to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, RefIdxAwp0L1 is equal to -1; if List0 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List1 is assigned to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 is equal to zero, and RefIdxAwp0L0 is equal to -1.
(b)如果AwpCandIdx0是奇数,将运动候选指向参考帧列表List1的单向运动信息赋值给mvAwp0L1和RefIdxAwp0L1,mvAwp0L0等于零,RefIdxAwp0L0等于-1;如果List1单向运动信息不存在,将运动候选指向参考帧列表List0的单向运动信息赋值给mvAwp0L0和RefIdxAwp0L0,mvAwp0L1等于零,RefIdxAwp0L1等于-1。(b) If AwpCandIdx0 is odd, assign the one-way motion information of the motion candidate to the reference frame list List1 to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 is equal to zero, RefIdxAwp0L0 is equal to -1; if List1 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List0 is assigned to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, and RefIdxAwp0L1 is equal to -1.
第六步,将AwpCandArray中第AwpCandIdx1+1个运动候选的某一个单项运动信息赋值给mvAwp1L0、mvAwp1L1、RefIdxAwp1L0和RefIdxAwp1L1:The sixth step is to assign a certain individual motion information of the AwpCandIdx1+1th motion candidate in the AwpCandArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0, and RefIdxAwp1L1:
(a)如果AwpCandIdx1是偶数,将运动候选指向参考帧列表List0的单向运动信息赋值给mvAwp1L0和RefIdxAwp1L0,mvAwp1L1等于零,RefIdxAwp1L1等于-1;如果List0单向运动信息不存在,将运动候选指向参考帧列表List1的单向运动信息赋值给mvAwp1L1和RefIdxAwp1L1,mvAwp1L0等于零,RefIdxAwp1L0等于-1。(a) If AwpCandIdx1 is an even number, assign the one-way motion information that the motion candidate points to the reference frame list List0 to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1; if List0 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List1 is assigned to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to -1.
(b)如果AwpCandIdx1是奇数,将运动候选指向参考帧列表List1的单向运动信息赋值给mvAwp1L1和RefIdxAwp1L1,mvAwp1L0等于零,RefIdxAwp1L0等于-1;如果List1单向运动信息不存在,将运动候选指向参考帧列表List0的单向运动信息赋值给mvAwp1L0和RefIdxAwp1L0,mvAwp1L1等于零,RefIdxAwp1L1等于-1。(b) If AwpCandIdx1 is an odd number, assign the one-way motion information of the motion candidate to the reference frame list List1 to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, RefIdxAwp1L0 is equal to -1; if List1 unidirectional motion information does not exist, point the motion candidate to the reference frame The unidirectional motion information of List0 is assigned to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1.
利用上述方法确定的两个单向运动信息找到两个参考块,根据GPM或AWP使用的具体的模式确定两个参考块在每一个像素位置的权值,并将两个参考块加权得到当前块的预测块。Use the two unidirectional motion information determined by the above method to find two reference blocks, determine the weight of the two reference blocks at each pixel position according to the specific mode used by GPM or AWP, and weight the two reference blocks to obtain the current block The prediction block.
这样,对于当前块而言,解码器通过解析码流可以得到GPM或AWP是否使用的信息,如果确定使用GPM或AWP,解码器可以解析出GPM或AWP的预测模式参数以及两个运动信息索引值,并且解码器构造当前块GPM或AWP使用的运动信息候选列表,然后根据解析到的两个运动信息索引值可以在上述构建出新的运动信息候选列表中找到两个单向运动信息,然后利用这两个单向运动信息可以查找到两个参考块,根据GPM或AWP使用的具体预测模式能够确定出两个参考块在每一个像素位置的权值,最后将两个参考块加权计算以得到当前块的预测块。In this way, for the current block, the decoder can obtain information about whether GPM or AWP is used by parsing the code stream. If it is determined to use GPM or AWP, the decoder can parse out the prediction mode parameters of GPM or AWP and two motion information index values. , And the decoder constructs the motion information candidate list used by the current block GPM or AWP, and then according to the two parsed motion information index values, two one-way motion information can be found in the new motion information candidate list constructed above, and then use The two one-way motion information can find two reference blocks. According to the specific prediction mode used by GPM or AWP, the weight of the two reference blocks at each pixel position can be determined. Finally, the two reference blocks are weighted and calculated to obtain The prediction block of the current block.
进一步地,如果当前模式是跳过(skip)模式,那么预测块就是解码块,意味着当前块的解码结束。如果当前模式不是跳过模式,熵解码解析量化系数,接着反量化与反变换以得到残差块,最后将残差块与预测块相加可以得到解码块,意味着当前块的解码结束。Further, if the current mode is a skip mode, then the prediction block is a decoded block, which means that the decoding of the current block ends. If the current mode is not the skip mode, entropy decoding analyzes the quantized coefficients, then inverse quantization and inverse transformation to obtain the residual block, and finally the residual block and the prediction block are added to obtain the decoded block, which means that the decoding of the current block is finished.
这样,本申请实施例限制导出时域运动信息所使用的像素位置不会超出当前块的LCU边界以使硬件实现没有额外带宽增加的应用场景。在本申请实施例中,主要采用的方式包括:(1)将所有的初始候选位置都设置在当前块内部;(2)针对某一个角,如果初始候选位置落在LCU外部,那么首选调整到 这个角的LCU内部而当前块外部的某一个候选位置。(3)如果某一个角的初始位置落在了LCU外部,那么调整到另外一个初始位置落在LCU内部的角的位置。其中,大多数采用的是第(2)方式,以使硬件实现时不增加额外的带宽而且尽量保持其压缩性能。In this way, the embodiment of the present application restricts the pixel position used for deriving the temporal motion information from not exceeding the LCU boundary of the current block, so that the hardware realizes the application scenario without additional bandwidth increase. In the embodiments of this application, the main methods used include: (1) All initial candidate positions are set 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 of this corner and outside the current block. (3) If the initial position of a certain corner falls outside the LCU, then adjust to the position of the corner where the other initial position falls inside the LCU. Among them, most adopt the method (2), so that the hardware implementation does not increase additional bandwidth and try to maintain its compression performance.
本实施例提供了一种帧间预测方法,应用于解码器。解析码流,获取当前块的预测模式参数;当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;在所述至少一个初始候选位置超出所述当前块的LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;基于所述至少一个时域运动信息,构建新的运动信息候选列表;根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。这样,在确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。This embodiment provides an inter-frame prediction method, which is applied to a decoder. Analyze the code stream to obtain the prediction mode parameters of the current block; when the prediction mode parameters indicate that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block; When the at least one initial candidate position exceeds the LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block; based on the at least one target candidate position , Determine at least one temporal motion information of the current block; construct a new motion information candidate list based on the at least one temporal motion information; determine the interframe of the current block according to the new motion information candidate list Predictive value. 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
本申请实施例提供一种帧间预测方法,该方法应用于视频编码设备,即编码器。该方法所实现的功能可以通过编码器中的第二处理器调用计算机程序来实现,当然计算机程序可以保存在第二存储器中,可见,该编码器至少包括第二处理器和第二存储器。The embodiment of the present application provides an inter-frame prediction method, which is applied to a video encoding device, that is, an encoder. The functions implemented by the method can be implemented by the second processor in the encoder calling a computer program. Of course, the computer program can be stored in the second memory. It can be seen that the encoder includes at least a second processor and a second memory.
参见图9,其示出了本申请实施例又一种帧间预测方法的流程示意图。如图9所示,该方法可以包括:Refer to FIG. 9, which shows a schematic flowchart of another inter-frame prediction method according to an embodiment of the present application. As shown in Figure 9, the method may include:
S901:确定当前块的预测模式参数;S901: Determine the prediction mode parameter of the current block;
需要说明的是,待编码图像可以划分为多个图像块,当前待编码的图像块可以称为当前块,与当前块相邻的图像块可以称为相邻块;即在待编码图像中,当前块与相邻块之间具有相邻关系。这里,每个当前块可以包括第一图像分量、第二图像分量和第三图像分量;也即当前块为待编码图像中当前待进行第一图像分量、第二图像分量或者第三图像分量预测的图像块。It should be noted that the image to be encoded can be divided into multiple image blocks, the image block currently to be encoded can be called the current block, and the image block adjacent to the current block can be called neighboring blocks; that is, in the image to be encoded, There is an adjacent relationship between the current block and the adjacent 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 is the first image component, the second image component, or the third image component currently to be predicted in the image to be encoded. Image block.
其中,假定当前块进行第一图像分量预测,而且第一图像分量为亮度分量,即待预测图像分量为亮度分量,那么当前块也可以称为亮度块;或者,假定当前块进行第二图像分量预测,而且第二图像分量为色度分量,即待预测图像分量为色度分量,那么当前块也可以称为色度块。Among them, assuming that the current block performs the first image component prediction, and the first image component is the brightness component, that is, the image component to be predicted is the brightness component, then the current block can also be called the brightness block; or, it is assumed that the current block performs the second image component Prediction, and the second image component is a chrominance component, that is, the image component to be predicted is a chrominance component, then the current block can also be called a chrominance block.
还需要说明的是,预测模式参数指示了当前块采用的预测模式以及与该预测模式相关的参数。这里,针对预测模式参数的确定,可以采用简单的决策策略,比如根据失真值的大小进行确定;也可以采用复杂的决策策略,比如根据率失真优化(Rate Distortion Optimization,RDO)的结果进行确定,本申请实施例不作任何限定。通常而言,可以采用RDO方式来确定当前块的预测模式参数。It should also be noted that the prediction mode parameter indicates the prediction mode adopted by the current block and the parameters related to the prediction mode. Here, for the determination of the prediction mode parameters, simple decision-making strategies can be used, such as determination based on the magnitude of the distortion value; complex decision-making strategies, such as determination based on the result of Rate Distortion Optimization (RDO), can also be used. The embodiments of this application do not make any limitation. Generally speaking, the RDO method can be used to determine the prediction mode parameters of the current block.
具体地,在一些实施例中,对于S901来说,所述确定当前块的预测模式参数,可以包括:Specifically, in some embodiments, for S901, the determining the prediction mode parameter of the current block may include:
利用多种预测模式对所述当前块进行预编码处理,获得每一种预测模式对应的率失真代价值;Precoding the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode;
从所获得的多个率失真代价值中选择最小率失真代价值,将所述最小率失真代价值对应的预测模式确定为当前块的预测模式参数。The minimum rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, and the prediction mode corresponding to the minimum rate-distortion cost value is determined as the prediction mode parameter of the current block.
也就是说,在编码器侧,针对当前块可以采用多种预测模式分别对当前块进行预编码处理。这里,多种预测模式通常包括有帧间预测模式、传统帧内预测模式和非传统帧内预测模式;其中,传统帧内预测模式可以包括有直流(Direct Current,DC)模式、平面(PLANAR)模式和角度模式等,非传统帧内预测模式可以包括有基于矩阵的帧内预测(Matrix-based Intra Prediction,MIP)模式、跨分量线性模型预测(Cross-component Linear Model Prediction,CCLM)模式、帧内块复制(Intra Block Copy,IBC)模式和PLT(Palette)模式等,而帧间预测模式可以包括有普通帧间预测模式、GPM预测模式和AWP预测模式等。That is to say, on the encoder side, multiple prediction modes can be used to perform precoding processing on the current block respectively. Here, multiple prediction modes usually include inter prediction mode, traditional intra prediction mode, and non-traditional intra prediction mode; among them, the traditional intra prediction mode can include direct current (DC) mode, plane (PLANAR) Mode and angle mode, etc. Non-traditional intra prediction modes can include matrix-based intra prediction (MIP) mode, cross-component linear model prediction (CCLM) mode, frame Intra Block Copy (IBC) mode and PLT (Palette) mode, etc., while inter prediction mode may include ordinary inter prediction mode, GPM prediction mode, and AWP prediction mode.
这样,在利用多种预测模式分别对当前块进行预编码之后,可以得到每一种预测模式对应的率失真代价值;然后从所得到的多个率失真代价值中选取最小率失真代价值,并将该最小率失真代价值对应的预测模式确定为当前块的预测模式参数。除此之外,还可以在利用多种预测模式分别对当前块进行预编码之后,得到每一种预测模式对应的失真值;然后从所得到的多个失真值中选取最小失真值,并将该最小失真值对应的预测模式确定为当前块的预测模式参数。如此,最终使用所确定的预测模式参数对当前块进行编码,而且在这种预测模式下,可以使得预测残差较小,能够提高编码效率。In this way, after precoding the current block with multiple prediction modes, the rate-distortion cost value corresponding to each prediction mode can be obtained; then the smallest rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, And the prediction mode corresponding to the minimum rate-distortion cost value is determined as the prediction mode parameter of the current block. In addition, after precoding the current block with multiple prediction modes, the distortion value corresponding to each prediction mode can be obtained; then the minimum distortion value can be selected from the obtained multiple distortion values, and the The prediction mode corresponding to the minimum distortion value is determined as the 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 can be made smaller, and the coding efficiency can be improved.
S902:当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置。S902: When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block.
需要说明的是,如果预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值的情况下,就可以采用本申请实施例所提供的帧间预测方法。这里,预设的帧间预测模式可以为GPM预测模式或AWP预测模式等。It should be noted that if the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, the inter prediction method provided in the embodiment of the present application can be used. Here, the preset inter-frame prediction mode may be a GPM prediction mode or an AWP prediction mode.
还需要说明的是,运动信息可以包括运动矢量信息和参考帧信息。另外,参考帧信息可以是由参考帧列表以及参考索引值共同确定所对应的参考帧。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 the reference frame corresponding to the reference frame list and the reference index value.
在一些实施例中,对于S902来说,所述确定所述当前块的至少一个初始候选位置,可以包括:In some embodiments, for S902, the determining at least one initial candidate position of the current block may include:
获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括下述至少一项:左上初始候选位置、右上初始候选位置、左下初始候选位置和右下初始候选位置;Obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following: upper left initial candidate position, upper right initial candidate position, and lower left initial candidate position And the initial candidate position in the lower right;
从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。From the set of initial candidate positions, at least one initial candidate position of the current block is determined.
进一步地,在一些实施例中,左上初始候选位置至少包括下述其中之一:第一左上候选位置、第二左上候选位置、第三左上候选位置和第四左上候选位置;Further, in some embodiments, the upper left initial candidate position includes at least one of the following: 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;
右上初始候选位置至少包括下述其中之一:第一右上候选位置、第二右上候选位置、第三右上候选位置和第四右上候选位置;The upper right initial candidate position includes 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 initial lower left candidate position includes at least 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 initial lower right candidate position includes at least 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 corner positions inside the current block, and the second The upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent the upper left corner position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth The upper right candidate position represents the upper right corner 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 the lower left corner position outside the current block, the The second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right corner position outside the current block.
需要说明的是,假定当前块内部的左上角位置,也就是当前块左上角第一个像素对应的像素位置为(x,y),当前块的宽度为width,当前块的高度为height。另外,这里所说的宽度和高度通常是指亮度分量的宽度(即l_width)和高度(即l_height),但不作具体限定。It should be noted that it is assumed that the upper left corner position inside the current block, that is, the pixel position 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 height mentioned here generally refer to the width (i.e., l_width) and height (i.e., l_height) of the brightness component, but are not specifically limited.
还需要说明的是,由于上面提到用于导出时域运动信息的参考帧存储导出时域运动信息的运动信息是按照块保存运动信息,那么按照某一个像素位置确定的时域运动信息和按照与该像素位置处在同一个存储块内其他像素位置确定的时域运动信息是相同的,这样在导出过程中可能有一些中间计算将某一个像素位置通过一些计算得到某些统一格式的位置,这里只要它们都处在同一个存储块内,那么可以认为这些位置是相同的。It should also be noted that since the reference frame used to derive time-domain motion information mentioned above is used to store and derive the motion information of the time-domain motion information, the motion information is stored in blocks, so the time-domain motion information determined according to a certain pixel position and in accordance with the The time domain motion information determined by other pixel positions in the same storage block as the pixel position is the same, so there may be some intermediate calculations during the export process. A certain pixel position may be calculated to obtain a certain uniform format position. As long as they are all in the same storage block, these positions can be considered the same.
以图6A~图6E为例,其提供了多种初始候选位置的情况。在得到初始候选位置之后,需要判断该初始候选位置是否超出当前块的LCU边界,以进一步确定当初始候选位置落在LCU边界之外时如何处理。Taking FIG. 6A to FIG. 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, so as to further determine how to deal with when the initial candidate position falls outside the LCU boundary.
S903:在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置。S903: When the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block, adjust the at least one initial candidate position to obtain at least one target candidate position of the current block.
需要说明的是,为了避免硬件实现时增加额外的带宽,这时候需要判断用于确定时域运动信息所使用的至少一个初始候选位置是否超过当前块的LCU边界。It should be noted that in order to avoid adding additional bandwidth during hardware implementation, 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.
在一些实施例中,对于S903来说,该方法还可以包括:在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, for S903, the method may further include: in the case that the at least one initial candidate position does not exceed the LCU boundary of the current block, determining the at least one initial candidate position as the At least one target candidate position of the current block.
也就是说,如果某一初始候选位置超出LCU边界,那么这时候需要针对该初始候选位置进行调整,以使得调整后得到的目标候选位置未超出LCU边界;如果某一初始候选位置未超出LCU边界,那么这时候就不需要针对该初始候选位置进行调整,可以直接将该初始候选位置确定为目标候选位置。In other words, if an initial candidate position exceeds the boundary of the LCU, then the initial candidate position needs to be adjusted at this time, so that the target candidate position obtained after adjustment does not exceed the boundary of the LCU; if an initial candidate position does not exceed the boundary of the LCU , Then there is no need to adjust the initial candidate position at this time, and the initial candidate position can be directly determined as the target candidate position.
一种可能的实施方式中,可以选取当前块内部的候选位置,这时候所使用的候选位置都不超出当前块的LCU边界,能够将其直接确定为目标候选位置。因此,在一些实施例中,该方法还可以包括:In a possible implementation manner, a candidate position within the current block can be selected. At this time, the candidate position used does not exceed the LCU boundary of the current block, and it can be directly determined as the target candidate position. Therefore, in some embodiments, the method may further include:
若所述至少一个初始候选位置包括所述第一左上候选位置,和/或,所述第一右上候选位置,和/或,所述第一左下候选位置,和/或,所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。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 right candidate position Next candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined as the at least one target candidate position of the current block.
另一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,那么首选调整到这个角的LCU内部且当前块外部的某一候选位置。因此,在一些实施例中,该方法还可以包括:In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, it is preferred to adjust to a certain candidate position inside the LCU of this corner and outside the current block. Therefore, in some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of the one of the corners exceeds the LCU boundary, select from the candidate positions corresponding to the one of the corners that does not exceed the LCU boundary The initial candidate position of one of the corners is adjusted 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边 界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, The lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.
进一步地,该方法还可以包括:若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。Further, the method may further include: if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, adjusting the lower right initial candidate position to the right inside the current block The lower corner position to obtain a target candidate position of the current block.
也就是说,以右下角为例,如果右下初始候选位置超出LCU边界,那么首先调整到右下角的LCU内部但是当前块外部的某一候选位置;如果从当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,这时候就需要调整到当前块内部的右下角位置,以确定出对应的目标候选位置。That is to say, taking the lower right corner as an example, if the lower right initial candidate position exceeds the LCU boundary, first adjust to a certain candidate position inside the lower right corner of the LCU but outside the current block; if there is no position from the lower right corner outside the current block The candidate position that does not exceed the boundary of the LCU is selected, and at this time, it needs to be adjusted to the lower right corner position inside the current block to determine the corresponding target candidate position.
又一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,那么可以调整到另外一个初始位置落在LCU内部的角的候选位置。因此,在一些实施例中,该方法还可以包括:In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, it can be adjusted to another corner candidate position whose initial position falls inside the LCU. Therefore, in some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select the candidate positions corresponding to the remaining corners except for the one of the corners. For candidate positions beyond the boundary of the LCU, the initial candidate position of one of the corners is adjusted 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right The initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
再一种可能的实施方式中,针对某一个角,如果初始候选位置落在LCU边界外部,且这个角只能调整到当前块内部,那么可以调整到另外一个初始位置落在LCU内部的角的候选位置。因此,在一些实施例中,该方法还可以包括:In another possible implementation manner, for a certain corner, if the initial candidate position falls outside the boundary of the LCU, and this corner can only be adjusted inside the current block, then it can be adjusted to another corner whose initial position falls inside the LCU. Candidate position. Therefore, in some embodiments, the method may further include:
若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, a candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position 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:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate is included in the lower right corner positions inside and outside the current block If the position does not exceed the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, adjust the lower right initial candidate position to the upper right initial candidate position to obtain a target candidate position of the current block .
再一种可能的实施方式中,还可以是对每一个划分模式设置这至少一个初始候选位置的优先级排序,然后依次检查是否超出当前块的LCU边界。因此,在一些实施例中,该方法还可以包括:In yet another possible implementation manner, the priority order of the at least one initial candidate position may be set for each division mode, and then it is checked in turn whether it exceeds the LCU boundary of the current block. Therefore, in some embodiments, the method may further include:
针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;For different division modes, setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order;
按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset priority order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order;
若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
也就是说,针对不同的划分模式,可以设置不同的预设优先级顺序。仍以划分模式54为例(从0开始),针对划分模式54,可以设置左上角、右上角、左下角和右下角等四个初始候选位置的优先级排序,比如设置的初始候选位置排序为3、1、2、0,即优先选取右下角,再选取右上角,然后再选取左下角,最后选取左上角;按照上述方式依次进行判断。In other words, for different division modes, different preset priority orders can be set. Still taking the division mode 54 as an example (starting from 0), for the division mode 54, you can set the priority order of the four initial candidate positions of the upper left corner, the upper right corner, the lower left corner, and the lower right corner. For example, the initial candidate position order is set as 3, 1, 2, 0, that is, the lower right corner is selected first, then the upper right corner is selected, then the lower left corner is selected, and the upper left corner is finally selected; the judgments are made in sequence according to the above method.
再一种可能的实施方式中,还可以是对每一个划分模式设置这至少一个初始候选位置的固定排序顺序,然后依次检查是否超出当前块的LCU边界。因此,在一些实施例中,该方法还可以包括:In another possible implementation manner, it is also possible to set a fixed sorting order of the at least one initial candidate position for each division mode, and then sequentially check whether it exceeds the LCU boundary of the current block. Therefore, in some embodiments, the method may further include:
针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;For different division modes, sort different initial candidate positions in the initial candidate position set according to a preset order;
按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to perform the step of selecting an initial candidate position according to the preset order;
若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
也就是说,还可以是按照一个固定的预设顺序排序,比如按照0,1,2,3,0,1,……的顺序,如果某一个划分模式首先选取3,即右下角,但是右下角不能落在LCU内部但位于当前块外部;那么选取0再次尝试,即左上角,如果0也不满足,那么选取1再次尝试,即右上角,以此类推,直至4个初始候选位置都依次判断过。In other words, it can also be sorted according to a fixed preset order, for example, in the order of 0, 1, 2, 3, 0, 1, ..., if a certain division mode first selects 3, which is the lower right corner, but the right The lower corner cannot fall inside the LCU but is outside the current block; then choose 0 to try again, that is, the upper left corner, if 0 is not satisfied, then choose 1 to try again, that is, the upper right corner, and so on, until the 4 initial candidate positions are in turn Judged.
进一步地,如果四个初始候选位置都不能落在LCU内部而位于当前块外部,那么还可以设置位置排序(比如预设优先级顺序或者预设顺序)的第一个角的当前块内部位置,以将其确定为目标候选位置;或者,如果四个初始候选位置都不能落在LCU内部而位于当前块外部,另一种方式是选择一个默认位置,比如当前块内部的左上角位置,以将其确定为目标候选位置。Further, if the four initial candidate positions cannot fall inside the LCU but are outside the current block, then the position sorting (such as the preset priority order or the preset order) of the first corner of the current block internal position can also be set, To determine it as the target candidate position; or, if the four initial candidate positions cannot fall inside the LCU but are outside the current block, another way is to select a default position, such as the upper left corner position inside the current block, to change It is determined as the target candidate position.
S904:基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息。S904: Determine at least one temporal motion information of the current block based on the at least one candidate target position.
需要说明的是,在得到至少一个目标候选位置之后,可以根据所得到的目标候选位置来确定时域运动信息,具体是将对应参考帧中的时域位置所使用的运动信息作为该目标候选位置的时域运动信息。这里,当前块所属的帧可以为称为当前帧,当前帧中的目标候选位置与参考帧中的时域位置虽然所属的帧不同,但是位置是相同的。It should be noted that after at least one candidate target position is obtained, the temporal motion information can be determined according to the obtained candidate target position. Specifically, the motion information used for the temporal position in the corresponding reference frame is used as the target candidate position. Time domain motion information. Here, the frame to which the current block belongs may be referred to as the current frame. Although the target candidate position in the current frame and the time domain position in the reference frame belong to different frames, the positions are the same.
在一些实施例中,对于S904来说,所述基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息,可以包括: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 the reference frame information corresponding to each target candidate position in the at least one target candidate position;
针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并将所述时域位置使用的运动信息确定为所述目标候选位置对应的时域运动信息;For each target candidate position, determine the time domain position associated with the target candidate position in the corresponding reference frame information, and determine the motion information used by the time domain position as the time domain motion corresponding to the target candidate position information;
基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。Based on the at least one target candidate position, correspondingly obtain at least one temporal motion information.
也就是说,时域运动信息是根据某一个参考帧信息中对应位置所使用的运动信息来确定的。而且针对不同的目标候选位置,可得到不同的时域运动信息。In other words, the temporal motion information is determined according to the motion information used in the corresponding position in a certain reference frame information. And for different target candidate positions, different time-domain motion information can be obtained.
这样,在推导出时域运动信息之后,可以将所得到的时域运动信息填充至运动信息候选列表中,以得到新的运动信息候选列表。In this way, after the time domain motion information is derived, the obtained time domain motion information can be filled into the motion information candidate list to obtain a new motion information candidate list.
S905:基于所述至少一个时域运动信息,构建新的运动信息候选列表。S905: Based on the at least one temporal motion information, construct a new motion information candidate list.
需要说明的是,在得到至少一个时域运动信息之后,可以将其填入到运动信息候选列表中,以得到新的运动信息候选列表。具体地,对于S905来说,该步骤可以包括:将至少一个时域运动信息填入运动信息候选列表中,得到所述新的运动信息候选列表。It should be noted that after obtaining at least one temporal motion information, it can be filled in the motion information candidate list to obtain a new motion information candidate list. Specifically, for S905, this step may include: filling at least one temporal motion information into the motion information candidate list to obtain the new motion information candidate list.
还需要说明的是,现有的运动信息候选列表中只预留一个时域运动信息的填充位置,为了提高右下角的相关性,还可以增加运动信息候选列表中时域运动信息的填充位置。具体地,在一些实施例中,该方法还可以包括:It should also be noted that only one filling position of time domain motion information is reserved in the existing motion information candidate list. In order to improve the correlation in the lower right corner, the filling position of time domain motion information in the motion information candidate list can also be added. Specifically, in some embodiments, the method may further include:
调整时域运动信息在所述新的运动信息候选列表中的比例值;Adjusting the ratio of the temporal motion information in the new motion information candidate list;
根据所调整的比例值,控制所述新的运动信息候选列表中预留至少两个时域运动信息的填充位置。According to the adjusted ratio value, control to reserve at least two filling positions of time-domain motion information in the new motion information candidate list.
也就是说,可以增加时域运动信息在运动信息候选列表中的比例值。如果AWP预测模式下候选列表中给时域运动信息保留了至少1个位置,那么可以调整为AWP预测模式下候选列表中给时域运动信息保留了至少2个(或3个)位置,使得新的运动信息候选列表中预留至少两个时域运动信息的填充位置。In other words, the ratio of the temporal motion information in the motion information candidate list can be increased. If at least 1 position is reserved for temporal motion information in the candidate list in AWP prediction mode, then it can be adjusted to reserve at least 2 (or 3) positions for temporal motion information in the candidate list in AWP prediction mode, so that the new At least two filling positions of time-domain motion information are reserved in the candidate list of motion information.
这样,在推导出时域运动信息之后,可以构建出新的运动信息候选列表。后续根据新的运动信息候选列表来确定当前块的帧间预测值。In this way, after the temporal motion information is derived, a new motion information candidate list can be constructed. Subsequently, the inter prediction value of the current block is determined according to the new motion information candidate list.
S906:根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。S906: Determine the inter prediction value of the current block according to the new motion information candidate list.
需要说明的是,当预测模式参数指示使用预设的帧间预测模式(比如GPM或AWP)确定当前块的帧间预测值时,这时候可以确定出当前块的两个分区。也就是说,该方法还可以包括:当预测模式参数指示使用GPM或AWP确定当前块的帧间预测值时,确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区。It should be noted that when the prediction mode parameter indicates that a preset inter prediction mode (such as GPM or AWP) is used to determine the inter prediction value of the current block, two partitions of the current block can be determined at this time. That is, the method may further include: when the prediction mode parameter indicates that the inter prediction value of the current block is determined using GPM or AWP, determining two partitions of the current block; wherein, the two partitions include the first partition And the second partition.
还需要说明的是,在得到新的运动信息候选列表后,可以确定出当前块的第一分区对应的运动信息和所述第二分区的运动信息;然后根据第一分区对应的运动信息和所述第二分区的运动信息,能够确定出当前块的帧间预测值。It should also be noted that after a new candidate list of motion information is obtained, the motion information corresponding to the first partition of the current block and the motion information of the second partition can be determined; and then according to the motion information and the motion information corresponding to the first partition The motion information of the second partition can determine the inter-frame prediction value of the current block.
具体地,如图10所示,其示出了本申请实施例提供的再一种帧间预测方法的流程示意图。该方法可以包括:Specifically, as shown in FIG. 10, it shows a schematic flowchart of still another inter-frame prediction method provided by an embodiment of the present application. The method can include:
S1001:基于所述新的运动信息候选列表,确定所述第一分区的运动信息和所述第二分区的运动信息;S1001: Determine the motion information of the first partition and the motion information of the second partition based on the new motion information candidate list;
S1002:将第一运动信息索引值设置为所述第一分区的运动信息在所述新的运动信息候选列表中的索引序号值,将第二运动信息索引值设置为所述第二分区的运动信息在所述新的运动信息候选列表中的 索引序号值;S1002: Set the first motion information index value to the index number value of the motion information of the first partition in the new motion information candidate list, and set the second motion information index value to the motion of the second partition The index number value of the information in the new motion information candidate list;
S1003:利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;S1003: 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;
S1004:对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。S1004: Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
进一步地,在一些实施例中,该方法还可以包括:Further, in some embodiments, the method may further include:
将所述第一运动信息索引值和所述第二运动信息索引值写入码流。The first motion information index value and the second motion information index value are written into a code stream.
早期的编解码技术中只存在矩形的划分方式,无论是CU、PU还是变换单元(Transform Unit,TU)的划分。而GPM或AWP均实现了非矩形的划分,即用一条直线可以将一个矩形块分成两个分区,根据直线的位置和角度的不同,划分的两个分区可能是三角形或梯形或矩形等,从而能使得划分更贴近物体的边缘或者两个运动不同区域的边缘。需要注意的是,这里所说的划分并不是真正意义上的划分,而更像是一种预测效果上的划分。因为这个划分只是划分了两个参考块在产生预测块时的权重,或者可以简单地理解为预测块的一部分位置来自于第一个参考块,而另一部分位置来自于第二个参考块,并没有真正按划分线把当前块划分成两个CU或PU或TU。这样,在预测之后残差的变换、量化、反变换、反量化等也都是将当前块作为一个整体进行处理。In the early coding and decoding technologies, only rectangular divisions existed, whether it was CU, PU, or Transform Unit (TU) division. Both GPM and AWP achieve non-rectangular division, that is, a rectangular block can be divided into two partitions with a straight line. According to the position and angle of the straight line, the two partitions may be triangles, trapezoids, or rectangles, etc. It can make the division closer to the edge of the object or the edge of two different moving areas. It should be noted that the division mentioned here is not a division in the true sense, but more like a division of prediction effects. Because this division only divides the weight of the two reference blocks when generating the prediction block, or it can be simply understood that part of the position of the prediction block comes from the first reference block, and another part of the position comes from the second reference block, and There is no real division of the current block into two CUs or PUs or TUs according to the dividing line. In this way, the transformation, quantization, inverse transformation, and inverse quantization of the residuals after prediction are also processed with the current block as a whole.
还需要说明的是,GPM或AWP属于一种帧间预测技术,在编码器侧,GPM或AWP需要在码流中传输一个GPM或AWP是否使用的标志(flag)以及两个运动信息索引值(比如第一运动信息索引值和第二运动信息索引值),这样后续解码器侧,能够通过解析码流直接得到GPM或AWP是否使用的flag以及两个运动信息索引值。It should also be noted that GPM or AWP belongs to an inter-frame prediction technology. On the encoder side, GPM or AWP needs to transmit a flag (flag) indicating whether GPM or AWP is used and two motion information index values ( For example, the first motion information index value and the second motion information index value), so that the subsequent decoder side can directly obtain the flag whether the GPM or AWP is used and the two motion information index values by parsing the code stream.
也就是说,对于当前块而言,可以尝试使用GPM或AWP进行预编码及其他可用预测模式进行预编码,确定是否使用GPM或AWP。如果GPM或AWP的预编码代价最小,那么可以使用GPM或AWP。同时,在尝试使用GPM或AWP时,还可以构建运动信息候选列表,该构建方式和解码器侧实施例所述的构建方式相同。In other words, for the current block, you can try to use GPM or AWP for precoding and other available prediction modes for precoding to determine whether to use GPM or AWP. If the precoding cost of GPM or AWP is the smallest, then GPM or AWP can be used. At the same time, when trying to use GPM or AWP, a motion information candidate list can also be constructed, and this construction method is the same as the construction method described in the embodiment on the decoder side.
这样,在编码器侧,从运动信息候选列表中选择两个单向运动信息,然后从GPM或AWP的划分模式中选择一种模式进行预编码来确定GPM或AWP的预编码代价。一种可能的方式是对所有可能的单向运动信息候选的组合,基于所有可能的GPM或AWP的划分模式确定其代价,然后取代价最小的两个单向运动信息和GPM或AWP的划分模式的组合作为最终所确定的两个单向运动信息和GPM或AWP的预测模式。In this way, on the encoder side, two unidirectional motion information is selected from the motion information candidate list, and then one of the GPM or AWP division modes is selected for precoding to determine the precoding cost of GPM or AWP. One possible way is to combine all possible one-way motion information candidates, determine the cost based on all possible GPM or AWP division modes, and then replace the two least expensive one-way motion information and the GPM or AWP division mode The combination of two one-way motion information and GPM or AWP finally determined prediction mode.
最后,在码流中写入GPM或AWP是否使用的信息。如果确定使用GPM或AWP,在码流中写入GPM或AWP的预测模式参数和两个单向运动信息索引值。如此,如果当前模式是跳过模式,那么预测块既是编码块,意味着当前块的编码结束。如果当前模式不是跳过模式,还需要在码流中写入量化系数;其中,量化系数由当前块的实际值减去帧间预测值所得到的残差而组成的残差块,并对残差块进行变换与量化得到,这时候当前块的编码结束。也就是说,如果当前模式不是跳过模式,需要将当前块与帧间预测块相减得到残差块,然后将残差块进行变换、量化、熵编码;后续在解码器侧,对于当前模式不是跳过模式的情况,通过熵解码解析量化系数,然后反量化、反变换以得到残差块,最后将残差块与预测块相加得到解码块,意味着当前块的解码结束。Finally, write information about whether GPM or AWP is used in the code stream. If it is determined to use GPM or AWP, write the prediction mode parameter of GPM or AWP and two unidirectional motion information index values in the code stream. In this way, if the current mode is the skip mode, then the prediction block is both a coding block, which means that the coding of the current block is finished. If the current mode is not the skip mode, quantization coefficients need to be written in the bitstream; among them, the quantization coefficient is a residual block composed of the actual value of the current block minus the residual obtained by the inter-frame prediction value, and the residual The difference block is obtained by transforming and quantizing. At this time, the encoding of the current block ends. That is to say, if the current mode is not the skip mode, you need to subtract the current block from the inter-frame prediction block to obtain the residual block, and then transform, quantize, and entropy the residual block; then on the decoder side, for the current mode In the case of not skipping mode, the quantized coefficients are analyzed through entropy decoding, then inverse quantization and inverse transformation are used to obtain the residual block, and finally the residual block and the prediction block are added to obtain the decoded block, which means that the decoding of the current block is finished.
本实施例提供了一种帧间预测方法,应用于编码器。确定当前块的预测模式参数;当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;基于所述至少一个时域运动信息,构建新的运动信息候选列表;根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。这样,在确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。This embodiment provides an inter-frame prediction method, which is applied to an encoder. Determine the prediction mode parameter of the current block; when the prediction mode parameter indicates to use the preset inter prediction mode to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block; When the initial candidate position exceeds the maximum coding unit LCU boundary of the current block, the at least one initial candidate position is adjusted to obtain at least one target candidate position of the current block; based on the at least one target candidate position, Determine at least one temporal motion information of the current block; construct a new motion information candidate list based on the at least one temporal motion information; determine the inter prediction of the current block according to the new motion information candidate list value. 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.
基于前述实施例相同的发明构思,参见图11,其示出了本申请实施例提供的一种解码器110的组成结构示意图。如图11所示,解码器110可以包括:解析单元1101、第一确定单元1102、第一调整单元1103、第一构建单元1104和第一预测单元1105;其中,Based on the same inventive concept as the foregoing embodiment, refer to FIG. 11, which shows a schematic diagram of the composition structure of a decoder 110 provided by an embodiment of the present application. 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; among them,
解析单元1101,配置为解析码流,获取当前块的预测模式参数;The parsing unit 1101 is configured to parse the code stream and obtain the prediction mode parameters of the current block;
第一确定单元1102,配置为当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;The first determining unit 1102 is configured to determine at least one initial candidate position of the current block when the prediction mode parameter indicates that a preset inter prediction mode is used to determine the inter prediction value of the current block;
第一调整单元1103,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The first adjustment unit 1103 is configured to adjust the at least one initial candidate position when the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block to obtain at least one of the current block Target candidate position;
第一确定单元1102,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域 运动信息;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;
第一构建单元1104,配置为基于所述至少一个时域运动信息,构建新的运动信息候选列表;The first construction unit 1104 is configured to construct a new motion information candidate list based on the at least one temporal motion information;
第一预测单元1105,配置为根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。The first prediction unit 1105 is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
在一些实施例中,第一确定单元1102,还配置为在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, the first determining unit 1102 is further configured to determine the at least one initial candidate position as the current block when the at least one initial candidate position does not exceed the LCU boundary of the current block At least one target candidate location.
在一些实施例中,第一确定单元1102,还配置为获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括下述至少一项:左上初始候选位置、右上初始候选位置、左下初始候选位置和右下初始候选位置;以及从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。In some embodiments, the first determining unit 1102 is further configured to obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein, the at least one corner initial candidate position includes at least one of the following : 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 from the initial candidate position set, at least one initial candidate position of the current block is determined.
在一些实施例中,所述左上初始候选位置至少包括下述其中之一:第一左上候选位置、第二左上候选位置、第三左上候选位置和第四左上候选位置;In some embodiments, the initial upper left candidate position includes at least one of the following: 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;
所述右上初始候选位置至少包括下述其中之一:第一右上候选位置、第二右上候选位置、第三右上候选位置和第四右上候选位置;The upper right initial candidate position includes 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 initial lower left candidate position includes at least 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 initial lower right candidate position includes at least 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 corner positions inside the current block, and the second The upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent the upper left corner position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth The upper right candidate position represents the upper right corner 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 the lower left corner position outside the current block, the The second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right corner position outside the current block.
在一些实施例中,第一确定单元1102,还配置为若所述至少一个初始候选位置包括所述第一左上候选位置,和/或,所述第一右上候选位置,和/或,所述第一左下候选位置,和/或,所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, the first determining unit 1102 is further configured to, 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 The first lower left candidate position, and/or the first lower right candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined to be at least one of the current block Target candidate position.
在一些实施例中,第一确定单元1102,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, start from the Among the candidate positions corresponding to one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
在一些实施例中,第一确定单元1102,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, and adjust the lower right initial candidate position to the selected candidate position To obtain a target candidate position of the current block.
进一步地,第一确定单元1102,还配置为若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。Further, the first determining unit 1102 is further configured to adjust the lower right initial candidate position to the current block if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right corner position outside the current block The inner lower right corner position to obtain a target candidate position of the current block.
在一些实施例中,第一确定单元1102,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the first determining unit 1102 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then divide the Among the candidate positions corresponding to the remaining corners other than one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain one of the current block Target candidate position.
在一些实施例中,第一确定单元1102,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, the method further includes:
若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right The initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
在一些实施例中,第一确定单元1102,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, and the Among the candidate positions corresponding to a corner, only the candidate position inside the current block does not exceed the LCU boundary, then the candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners except for one of the corners, and The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
在一些实施例中,第一确定单元1102,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the first determining unit 1102 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate position does not exceed the LCU boundary in the lower right corner positions inside and outside the current block, then the upper right initial candidate position does not When the boundary of the LCU is exceeded, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
在一些实施例中,参见图11,解码器110还可以包括第一设置单元1106和第一判断单元1107;其中,In some embodiments, referring to FIG. 11, the decoder 110 may further include a first setting unit 1106 and a first determining unit 1107; wherein,
第一设置单元1106,配置为针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;The first setting unit 1106 is 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;
第一判断单元1107,配置为按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;以及若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。The first determining unit 1107 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to execution The step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
在一些实施例中,第一设置单元1106,还配置为针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;In some embodiments, the first setting unit 1106 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different division modes;
第一判断单元1107,还配置为按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;以及若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。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, return to the execution The step of selecting an initial candidate position according to the preset order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
在一些实施例中,第一调整单元1103,还配置为调整时域运动信息在所述新的运动信息候选列表中的比例值;以及根据所调整的比例值,控制所述新的运动信息候选列表中预留至少两个时域运动信息的填充位置。In some embodiments, the first adjustment unit 1103 is further configured to adjust the scale value of the temporal motion information in the new motion information candidate list; and control the new motion information candidate according to the adjusted scale value At least two filling positions for time-domain motion information are reserved in the list.
在一些实施例中,第一确定单元1102,还配置为确定所述至少一个目标候选位置中每一目标候选位置对应的参考帧信息;以及针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并将所述时域位置使用的运动信息确定为所述目标候选位置对应的时域运动信息;基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。In some embodiments, the first determining unit 1102 is further configured to determine the reference frame information corresponding to each target candidate position in the at least one target candidate position; and for each target candidate position, in the corresponding reference frame information Determine the time domain position associated with the target candidate position, and determine the motion information used by the time domain position as the time domain motion information corresponding to the target candidate position; based on the at least one target candidate position, correspondingly obtain at least A time domain motion information.
在一些实施例中,所述预设的帧间预测模式包括:几何划分预测模式或角度加权预测模式;In some embodiments, the preset inter-frame prediction mode includes: a geometric division prediction mode or an angle-weighted prediction mode;
第一确定单元1102,还配置为当所述预测模式参数指示使用所述预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区。The first determining unit 1102 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block; wherein, the The two partitions include the first partition and the second partition.
在一些实施例中,解析单元1101,还配置为解析码流,确定所述第一分区对应的第一运动信息索引值和所述第二分区对应的第二运动信息索引值;In some embodiments, the parsing unit 1101 is further configured to parse the code stream to determine a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
第一确定单元1102,还配置为基于所述新的运动信息候选列表,将所述第一运动信息索引值指示的所述新的运动信息候选列表中的运动信息确定为所述第一分区的运动信息,将所述第二运动信息索引值指示的所述新的运动信息候选列表中的运动信息确定为所述第二分区的运动信息;The first determining unit 1102 is further configured to determine the motion information in the new motion information candidate list indicated by the first motion information index value as the first partition based on the new motion information candidate list. Motion information, determining the motion information in the new motion information candidate list indicated by the second motion information index value as the motion information of the second partition;
第一预测单元1105,还配置为利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;以及对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。The first prediction unit 1105 is further configured to calculate a first prediction value of the first partition using the motion information of the first partition, and calculate a second prediction value of the second partition using the motion information of the second partition And performing weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood 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., of course, may also be a module, or may also be non-modular. Moreover, the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized in the form of hardware or software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or It is said that the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage media include: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes.
因此,本申请实施例提供了一种计算机存储介质,应用于解码器110,该计算机存储介质存储有帧间预测程序,所述帧间预测程序被第一处理器执行时实现前述实施例中解码器侧所述的方法。Therefore, the embodiment of the present application provides a computer storage medium, which is applied to the decoder 110, and the computer storage medium stores an inter-frame prediction program. The inter-frame prediction program is executed by the first processor to realize the decoding in the foregoing embodiment. The method described on the device side.
基于上述解码器110的组成以及计算机存储介质,参见图12,其示出了本申请实施例提供的解码器110的具体硬件结构示例,可以包括:第一通信接口1201、第一存储器1202和第一处理器1203;各 个组件通过第一总线***1204耦合在一起。可理解,第一总线***1204用于实现这些组件之间的连接通信。第一总线***1204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为第一总线***1204。其中,Based on the composition of the decoder 110 and the computer storage medium described above, refer to FIG. 12, which shows an example of a specific hardware structure of the decoder 110 provided by an embodiment of the present application, which may include: a first communication interface 1201, a first memory 1202, and a first communication interface 1201; A processor 1203; various components are coupled together through a first bus system 1204. It can be understood that the first bus system 1204 is used to implement connection and communication between these components. In addition to the data bus, the first bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the first bus system 1204 in FIG. 12. in,
第一通信接口1201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The first communication interface 1201 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
第一存储器1202,用于存储能够在第一处理器1203上运行的计算机程序;The first memory 1202 is configured to store a computer program that can run on the first processor 1203;
第一处理器1203,用于在运行所述计算机程序时,执行:The first processor 1203 is configured to execute: when running the computer program:
解析码流,获取当前块的预测模式参数;Parse the code stream to obtain the prediction mode parameters of the current block;
当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
基于所述至少一个时域运动信息,构建新的运动信息候选列表;Constructing a new candidate list of motion information based on the at least one temporal motion information;
根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame prediction value of the current block according to the new motion information candidate list.
可以理解,本申请实施例中的第一存储器1202可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的***和方法的第一存储器1202旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the first memory 1202 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), and electrically available Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be a random access memory (Random Access Memory, RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (Double Data Rate SDRAM, DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), Synchronous Link Dynamic Random Access Memory (Synchlink DRAM, SLDRAM) And Direct Rambus RAM (DRRAM). The first memory 1202 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.
而第一处理器1203可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1203中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1203可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1202,第一处理器1203读取第一存储器1202中的信息,结合其硬件完成上述方法的步骤。The first processor 1203 may be an integrated circuit chip with signal processing capability. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the first processor 1203 or instructions in the form of software. The above-mentioned first processor 1203 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps, and logical block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers. The storage medium is located in the first memory 1202, and the first processor 1203 reads the information in the first memory 1202, and completes the steps of the foregoing method in combination with its hardware.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It can be understood that the embodiments described in this application can be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processors, controllers, microcontrollers, microprocessors, and others for performing the functions described in this application Electronic unit or its combination. For software implementation, the technology described in this application can be implemented through modules (for example, procedures, functions, etc.) that perform the functions described in this application. The software codes can be stored in the memory and executed by the processor. The memory can be implemented in the processor or external to the processor.
可选地,作为另一个实施例,第一处理器1203还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the first processor 1203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
本实施例提供了一种解码器,该解码器可以包括解析单元、第一确定单元、第一调整单元、第一构建单元和第一预测单元。在该解码器中,确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。This embodiment provides a decoder, which may include an analysis unit, a first determination unit, a first adjustment unit, a first construction unit, and a first prediction unit. In the decoder, 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, so that the hardware can be implemented constantly. Increase the extra bandwidth, while still being able to guarantee the codec performance.
基于前述实施例相同的发明构思,参见图13,其示出了本申请实施例提供的一种编码器130的组成结构示意图。如图13所示,该编码器130可以包括:第二确定单元1301、第二调整单元1302、第二构建单元1303和第二预测单元1304;其中,Based on the same inventive concept as the foregoing embodiment, refer to FIG. 13, which shows a schematic diagram of the composition structure of an encoder 130 provided by an embodiment of the present application. 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,
第二确定单元1301,配置为确定当前块的预测模式参数;及当所述预测模式参数指示使用预设的 帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;The second determining unit 1301 is configured to determine the prediction mode parameter of the current block; and when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one of the current block Initial candidate position;
第二调整单元1302,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The second adjustment unit 1302 is configured to adjust the at least one initial candidate position to obtain at least one of the current block when the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block Target candidate position;
第二确定单元1301,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;The second determining unit 1301 is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;
第二构建单元1303,配置为基于所述至少一个时域运动信息,构建新的运动信息候选列表;The second construction unit 1303 is configured to construct a new motion information candidate list based on the at least one temporal motion information;
第二预测单元1304,配置为根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。The second prediction unit 1304 is configured to determine the inter prediction value of the current block according to the new motion information candidate list.
在一些实施例中,参见图13,编码器130还可以包括预编码单元1305,配置为利用多种预测模式对所述当前块进行预编码处理,获得每一种预测模式对应的率失真代价值;以及从所获得的多个率失真代价值中选择最小率失真代价值,将所述最小率失真代价值对应的预测模式确定为当前块的预测模式参数。In some embodiments, referring to FIG. 13, the encoder 130 may further include a pre-encoding unit 1305, configured to perform pre-encoding processing on the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode. And selecting the minimum rate-distortion cost value from the obtained multiple rate-distortion cost values, and determine the prediction mode corresponding to the minimum rate-distortion cost value as the prediction mode parameter of the current block.
在一些实施例中,第二确定单元1301,还配置为在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to determine the at least one initial candidate position as the current block when the at least one initial candidate position does not exceed the LCU boundary of the current block At least one target candidate location.
在一些实施例中,第二确定单元1301,还配置为获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括下述至少一项:左上初始候选位置、右上初始候选位置、左下初始候选位置和右下初始候选位置;以及从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。In some embodiments, the second determining unit 1301 is further configured to obtain at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes at least one of the following : 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 from the initial candidate position set, at least one initial candidate position of the current block is determined.
在一些实施例中,所述左上初始候选位置至少包括下述其中之一:第一左上候选位置、第二左上候选位置、第三左上候选位置和第四左上候选位置;In some embodiments, the initial upper left candidate position includes at least one of the following: 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;
所述右上初始候选位置至少包括下述其中之一:第一右上候选位置、第二右上候选位置、第三右上候选位置和第四右上候选位置;The upper right initial candidate position includes 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 initial lower left candidate position includes at least 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 initial lower right candidate position includes at least 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 corner positions inside the current block, and the second The upper left candidate position, the third upper left candidate position, and the fourth upper left candidate position represent the upper left corner position outside the current block, the second upper right candidate position, the third upper right candidate position, and the fourth The upper right candidate position represents the upper right corner 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 the lower left corner position outside the current block, the The second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent a lower right corner position outside the current block.
在一些实施例中,第二确定单元1301,还配置为若所述至少一个初始候选位置包括所述第一左上候选位置,和/或,所述第一右上候选位置,和/或,所述第一左下候选位置,和/或,所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to, 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 The first lower left candidate position, and/or the first lower right candidate position, it is determined that the at least one initial candidate position does not exceed the LCU boundary, and the at least one initial candidate position is determined to be at least one of the current block Target candidate position.
在一些实施例中,第二确定单元1301,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, start from the Among the candidate positions corresponding to one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
在一些实施例中,第二确定单元1301,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, then select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, and adjust the lower right initial candidate position to the selected candidate position To obtain a target candidate position of the current block.
进一步地,第二确定单元1301,还配置为若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。Further, the second determining unit 1301 is further configured to adjust the lower right initial candidate position to the current block if no candidate position that does not exceed the boundary of the LCU is not selected from the lower right corner position outside the current block The inner lower right corner position to obtain a target candidate position of the current block.
在一些实施例中,第二确定单元1301,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to, if the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, then divide the Among the candidate positions corresponding to the remaining corners other than one of the corners, a candidate position that does not exceed the boundary of the LCU is selected, and the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain one of the current block Target candidate position.
在一些实施例中,第二确定单元1301,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超 出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain the Describes a target candidate position of the current block.
在一些实施例中,第二确定单元1301,还配置为若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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 the Among the candidate positions corresponding to a corner, only the candidate position inside the current block does not exceed the LCU boundary, then the candidate position that does not exceed the LCU boundary is selected from the candidate positions corresponding to the remaining corners except for one of the corners, and The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
在一些实施例中,第二确定单元1301,还配置为当所述其中一个角的初始候选位置为所述右下初始候选位置时,若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在所述右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。In some embodiments, the second determining unit 1301 is further configured to, when the initial candidate position of one of the corners is the lower right initial candidate position, if the at least one initial candidate position includes the lower right initial candidate position Position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate position does not exceed the LCU boundary in the lower right corner positions inside and outside the current block, then the upper right initial candidate position does not When the boundary of the LCU is exceeded, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
在一些实施例中,参见图13,编码器130还可以包括第二设置单元1306和第二判断单元1307;其中,In some embodiments, referring to FIG. 13, the encoder 130 may further include a second setting unit 1306 and a second determining unit 1307; wherein,
第二设置单元1306,配置为针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;The second setting unit 1306 is 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;
第二判断单元1307,配置为按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;以及若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。The second determining unit 1307 is configured to select an initial candidate position according to the preset priority order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to execution The step of selecting an initial candidate position according to the preset priority order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
在一些实施例中,第二设置单元1306,还配置为针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;In some embodiments, the second setting unit 1306 is further configured to sort different initial candidate positions in the initial candidate position set according to a preset order for different division modes;
第二判断单元1307,还配置为按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;以及若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。The second determining unit 1307 is further configured to select an initial candidate position according to the preset order, and determine whether the selected initial candidate position exceeds the LCU boundary; and if the selected initial candidate position exceeds the LCU boundary, return to the execution The step of selecting an initial candidate position according to the preset order; if the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
在一些实施例中,第二调整单元1302,还配置为调整时域运动信息在所述新的运动信息候选列表中的比例值;以及根据所调整的比例值,控制所述新的运动信息候选列表中预留至少两个时域运动信息的填充位置。In some embodiments, the second adjustment unit 1302 is further configured to adjust the ratio value of the temporal motion information in the new motion information candidate list; and control the new motion information candidate according to the adjusted ratio value At least two filling positions for time-domain motion information are reserved in the list.
在一些实施例中,第二确定单元1301,还配置为确定所述至少一个目标候选位置中每一目标候选位置对应的参考帧信息;以及针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并将所述时域位置使用的运动信息确定为所述目标候选位置对应的时域运动信息;基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。In some embodiments, the second determining unit 1301 is further configured to determine the reference frame information corresponding to each target candidate position in the at least one target candidate position; and for each target candidate position, in the corresponding reference frame information Determine the time domain position associated with the target candidate position, and determine the motion information used by the time domain position as the time domain motion information corresponding to the target candidate position; based on the at least one target candidate position, correspondingly obtain at least A time domain motion information.
在一些实施例中,所述预设的帧间预测模式包括:几何划分预测模式或角度加权预测模式;In some embodiments, the preset inter-frame prediction mode includes: a geometric division prediction mode or an angle-weighted prediction mode;
第二确定单元1301,还配置为当所述预测模式参数指示使用所述预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区。The second determining unit 1301 is further configured to determine two partitions of the current block when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block; wherein, the The two partitions include the first partition and the second partition.
在一些实施例中,第二确定单元1301,还配置为基于所述新的运动信息候选列表,确定所述第一分区的运动信息和所述第二分区的运动信息,并将第一运动信息索引值设置为所述第一分区的运动信息在所述新的运动信息候选列表中的索引序号值,将第二运动信息索引值设置为所述第二分区的运动信息在所述新的运动信息候选列表中的索引序号值;In some embodiments, the second determining unit 1301 is further configured to determine the motion information of the first partition and the motion information of the second partition based on the new motion information candidate list, and combine the first motion information The index value is set to the index number value of the motion information of the first partition in the new motion information candidate list, and the second motion information index value is set to the motion information of the second partition in the new motion information. The index number value in the information candidate list;
第二预测单元1304,还配置为利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;以及对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。The second prediction unit 1304 is further configured to calculate a first prediction value of the first partition using the motion information of the first partition, and calculate a second prediction value of the second partition using the motion information of the second partition And performing weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
在一些实施例中,参见图13,编码器130还可以包括写入单元1308,配置为将所述第一运动信息索引值和所述第二运动信息索引值写入码流。In some embodiments, referring to FIG. 13, the encoder 130 may further include a writing unit 1308 configured to write the first motion information index value and the second motion information index value into a code stream.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, it may also be a module, or it may be non-modular. Moreover, the various components in this embodiment may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be realized in the form of hardware or software function module.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例提供了一种计算机存储介质,应用于编码器130,该计算机存储介质存储有帧间预测程序,所述帧间预测程序被第二处理器执行时实现前述实施 例中编码器侧所述的方法。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, this embodiment provides a computer storage The medium is applied to the encoder 130, and the computer storage medium stores an inter-frame prediction program. When the inter-frame prediction program is executed by the second processor, the method described on the encoder side in the foregoing embodiment is implemented.
基于上述编码器130的组成以及计算机存储介质,参见图14,其示出了本申请实施例提供的编码器130的具体硬件结构示例,可以包括:第二通信接口1401、第二存储器1402和第二处理器1403;各个组件通过第二总线***1404耦合在一起。可理解,第二总线***1404用于实现这些组件之间的连接通信。第二总线***1404除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图14中将各种总线都标为第二总线***1404。其中,Based on the composition of the encoder 130 and the computer storage medium described above, refer to FIG. 14, which shows an example of the specific hardware structure of the encoder 130 provided by the embodiment of the present application, which may include: a second communication interface 1401, a second memory 1402, and a second communication interface 1401; Two processors 1403; various components are coupled together through a second bus system 1404. It can be understood that the second bus system 1404 is used to implement connection and communication between these components. In addition to the data bus, the second bus system 1404 also includes a power bus, a control bus, and a status signal bus. However, for clarity of description, various buses are marked as the second bus system 1404 in FIG. 14. in,
第二通信接口1401,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The second communication interface 1401 is used for receiving and sending signals in the process of sending and receiving information with other external network elements;
第二存储器1402,用于存储能够在第二处理器1403上运行的计算机程序;The second memory 1402 is configured to store a computer program that can run on the second processor 1403;
第二处理器1403,用于在运行所述计算机程序时,执行:The second processor 1403 is configured to execute: when the computer program is running:
确定当前块的预测模式参数;Determine the prediction mode parameters of the current block;
当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
基于所述至少一个时域运动信息,构建新的运动信息候选列表;Constructing a new candidate list of motion information based on the at least one temporal motion information;
根据所述新的运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame prediction value of the current block according to the new motion information candidate list.
可选地,作为另一个实施例,第二处理器1403还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the second processor 1403 is further configured to execute the method described in any one of the foregoing embodiments when the computer program is running.
可以理解,第二存储器1402与第一存储器1202的硬件功能类似,第二处理器1403与第一处理器1203的硬件功能类似;这里不再详述。It can be understood that the hardware function of the second memory 1402 is similar to that of the first memory 1202, and the hardware function of the second processor 1403 is similar to that of the first processor 1203; it will not be described in detail here.
本实施例提供了一种编码器,该编码器可以包括第二确定单元、第二调整单元、第二构建单元和第二预测单元。在该编码器中,确定出当前块的至少一个初始候选位置后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。This embodiment provides an encoder, which may include a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit. In the encoder, 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, so that the hardware can be implemented constantly. Increase additional bandwidth, while also ensuring codec performance.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this application, the terms "including", "including" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements , But also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or device. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or device that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be combined arbitrarily without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in the several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain a new method embodiment or device embodiment.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
工业实用性Industrial applicability
本申请实施例中,无论是编码器还是解码器,在确定出当前块的预测模式参数后,当预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定当前块的至少一个初始候选位置;在这至少一个初始候选位置超出当前块的LCU边界的情况下,对这至少一个初始候选位置进行调整,得到当前块的至少一个目标候选位置;基于这至少一个目标候选位置,确定当前块的至少一个时域运动信息;基于至少一个时域运动信息,构建运动信息候选列表,进而确定出当前块的帧间预测值。这样,在确定出当前块的至少一个初始候选位置之后,通过对至少一个初始候选位置进行调整以使得至少一个目标候选位置不会超出当前块的LCU边界,从而能够使硬件实现时不增加额外的带宽,同时还能够保证编解码性能。In the embodiment of this application, whether it is an encoder or a decoder, after the prediction mode parameter of the current block is determined, when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, the current block is determined At least one initial candidate position of the block; when the at least one initial candidate position exceeds the LCU boundary of the current block, adjust the at least one initial candidate position to obtain at least one target candidate position of the current block; based on the at least one target The candidate position determines at least one temporal motion information of the current block; based on the at least one temporal motion information, a motion information candidate list is constructed to determine the inter-frame 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, so that the hardware implementation does not add extra Bandwidth, while also ensuring encoding and decoding performance.

Claims (45)

  1. 一种帧间预测方法,应用于解码器,所述方法包括:An inter-frame prediction method applied to a decoder. The method includes:
    解析码流,获取当前块的预测模式参数;Parse the code stream to obtain the prediction mode parameters of the current block;
    当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
    在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
    基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
    基于所述至少一个时域运动信息,构建运动信息候选列表;Constructing a motion information candidate list based on the at least one temporal motion information;
    根据所述运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame prediction value of the current block according to the motion information candidate list.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In a case where the at least one initial candidate position does not exceed the LCU boundary of the current block, the at least one initial candidate position is determined as the at least one target candidate position of the current block.
  3. 根据权利要求1所述的方法,其中,所述确定所述当前块的至少一个初始候选位置,包括:The method according to claim 1, wherein said determining at least one initial candidate position of the current block comprises:
    获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括:右下初始候选位置;Acquiring at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes: the lower right initial candidate position;
    从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。From the set of initial candidate positions, at least one initial candidate position of the current block is determined.
  4. 根据权利要求3所述的方法,其中,The method of claim 3, wherein:
    所述右下初始候选位置至少包括下述其中之一:第一右下候选位置、第二右下候选位置、第三右下候选位置和第四右下候选位置;The initial lower right candidate position includes at least 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 represents the lower right corner position inside the current block, the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent the The position of the lower right corner outside the current block.
  5. 根据权利要求4所述的方法,其中,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    若所述至少一个初始候选位置包括所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。If the at least one initial candidate position includes the first lower right candidate position, determine that the at least one initial candidate position does not exceed the LCU boundary, and determine the at least one initial candidate position as at least one target of the current block Candidate position.
  6. 根据权利要求4所述的方法,其中,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of the one of the corners exceeds the LCU boundary, select from the candidate positions corresponding to the one of the corners that does not exceed the LCU boundary The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  7. 根据权利要求6所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 6, wherein when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, The lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  8. 根据权利要求7所述的方法,其中,所述方法还包括:The method according to claim 7, wherein the method further comprises:
    若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。If no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, the initial lower right candidate position is adjusted to the lower right corner position inside the current block to obtain the current block A target candidate position of.
  9. 根据权利要求4所述的方法,其中,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select the candidate positions corresponding to the remaining corners except for the one of the corners. For candidate positions beyond the boundary of the LCU, the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  10. 根据权利要求9所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 9, wherein when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则在右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate The position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  11. 根据权利要求4所述的方法,其中,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界, 则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the boundary of the LCU, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, then the candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position of the current block.
  12. 根据权利要求11所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 11, wherein when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate is included in the lower right corner positions inside and outside the current block If the position does not exceed the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  13. 根据权利要求3所述的方法,其中,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;For different division modes, setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order;
    按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset priority order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
    若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order;
    若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  14. 根据权利要求3所述的方法,其中,所述方法还包括:The method according to claim 3, wherein the method further comprises:
    针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;For different division modes, sort different initial candidate positions in the initial candidate position set according to a preset order;
    按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
    若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to perform the step of selecting an initial candidate position according to the preset order;
    若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  15. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    调整时域运动信息在所述运动信息候选列表中的比例值;Adjusting the ratio of temporal motion information in the motion information candidate list;
    根据所调整的比例值,控制所述运动信息候选列表中预留至少两个时域运动信息的填充位置。According to the adjusted ratio value, control to reserve at least two filling positions of time-domain motion information in the motion information candidate list.
  16. 根据权利要求1所述的方法,其中,所述基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息,包括:The method according to claim 1, wherein the determining at least one temporal motion information of the current block based on the at least one target candidate position comprises:
    确定所述至少一个目标候选位置中每一目标候选位置对应的参考帧信息;Determining the reference frame information corresponding to each target candidate position in the at least one target candidate position;
    针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并根据所述时域位置使用的运动信息确定所述目标候选位置对应的时域运动信息;For each target candidate position, determine the time domain position associated with the target candidate position in the corresponding reference frame information, and determine the time domain motion information corresponding to the target candidate position according to the motion information used by the time domain position ;
    基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。Based on the at least one target candidate position, correspondingly obtain at least one temporal motion information.
  17. 根据权利要求1所述的方法,其中,所述预设的帧间预测模式包括角度加权预测模式。The method according to claim 1, wherein the preset inter-frame prediction mode comprises an angle-weighted prediction mode.
  18. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区,所述第一分区和所述第二分区的运动信息不同。Determine two partitions of the current block; wherein, the two partitions include a first partition and a second partition, and the motion information of the first partition and the second partition are different.
  19. 根据权利要求18所述的方法,其中,所述根据所述运动信息候选列表,确定所述当前块的帧间预测值,包括:The method according to claim 18, wherein the determining the inter prediction value of the current block according to the motion information candidate list comprises:
    解析码流,确定所述第一分区对应的第一运动信息索引值和所述第二分区对应的第二运动信息索引值;Parse the code stream to determine a first motion information index value corresponding to the first partition and a second motion information index value corresponding to the second partition;
    根据所述第一运动信息索引值指示的所述运动信息候选列表中的运动信息确定所述第一分区的运动信息,根据所述第二运动信息索引值指示的所述运动信息候选列表中的运动信息确定所述第二分区的运动信息;Determine 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 determine the motion information of the first partition according to the motion information in the motion information candidate list indicated by the second motion information index value. The motion information determines the motion information of the second partition;
    利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;Using the motion information of the first partition to calculate a first predictive value of the first partition, and using the motion information of the second partition to calculate a second predictive value of the second partition;
    对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  20. 一种帧间预测方法,应用于编码器,所述方法包括:An inter-frame prediction method, applied to an encoder, and the method includes:
    确定当前块的预测模式参数;Determine the prediction mode parameters of the current block;
    当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;When the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least one initial candidate position of the current block;
    在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一 个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;In the case that the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block, adjusting the at least one initial candidate position to obtain at least one target candidate position of the current block;
    基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;Determine at least one temporal motion information of the current block based on the at least one target candidate position;
    基于所述至少一个时域运动信息,构建运动信息候选列表;Constructing a motion information candidate list based on the at least one temporal motion information;
    根据所述运动信息候选列表,确定所述当前块的帧间预测值。Determine the inter-frame prediction value of the current block according to the motion information candidate list.
  21. 根据权利要求20所述的方法,其中,所述确定当前块的预测模式参数,包括:The method according to claim 20, wherein said determining the prediction mode parameter of the current block comprises:
    利用多种预测模式对所述当前块进行预编码处理,获得每一种预测模式对应的率失真代价值;Precoding the current block using multiple prediction modes to obtain the rate-distortion cost value corresponding to each prediction mode;
    从所获得的多个率失真代价值中选择最小率失真代价值,将所述最小率失真代价值对应的预测模式确定为当前块的预测模式参数。The minimum rate-distortion cost value is selected from the obtained multiple rate-distortion cost values, and the prediction mode corresponding to the minimum rate-distortion cost value is determined as the prediction mode parameter of the current block.
  22. 根据权利要求20所述的方法,其中,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    在所述至少一个初始候选位置未超出所述当前块的LCU边界的情况下,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。In a case where the at least one initial candidate position does not exceed the LCU boundary of the current block, the at least one initial candidate position is determined as the at least one target candidate position of the current block.
  23. 根据权利要求20所述的方法,其中,所述确定所述当前块的至少一个初始候选位置,包括:The method according to claim 20, wherein said determining at least one initial candidate position of the current block comprises:
    获取所述当前块的至少一个角初始候选位置,组成初始候选位置集合;其中,所述至少一个角初始候选位置包括:右下初始候选位置;Acquiring at least one corner initial candidate position of the current block to form an initial candidate position set; wherein the at least one corner initial candidate position includes: the lower right initial candidate position;
    从所述初始候选位置集合中,确定所述当前块的至少一个初始候选位置。From the set of initial candidate positions, at least one initial candidate position of the current block is determined.
  24. 根据权利要求23所述的方法,其中,The method of claim 23, wherein:
    所述右下初始候选位置至少包括下述其中之一:第一右下候选位置、第二右下候选位置、第三右下候选位置和第四右下候选位置;The initial lower right candidate position includes at least 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 represents the lower right corner position inside the current block, the second lower right candidate position, the third lower right candidate position, and the fourth lower right candidate position represent the The position of the lower right corner outside the current block.
  25. 根据权利要求24所述的方法,其中,所述方法还包括:The method of claim 24, wherein the method further comprises:
    若所述至少一个初始候选位置包括所述第一右下候选位置,则确定所述至少一个初始候选位置未超出LCU边界,将所述至少一个初始候选位置确定为所述当前块的至少一个目标候选位置。If the at least one initial candidate position includes the first lower right candidate position, determine that the at least one initial candidate position does not exceed the LCU boundary, and determine the at least one initial candidate position as at least one target of the current block Candidate position.
  26. 根据权利要求24所述的方法,其中,所述方法还包括:The method of claim 24, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从所述其中一个角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of the one of the corners exceeds the LCU boundary, select from the candidate positions corresponding to the one of the corners that does not exceed the LCU boundary The initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  27. 根据权利要求26所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 26, wherein when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则从所述当前块外部的右下角位置中选择未超出LCU边界的候选位置,将所述右下初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。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, select a candidate position that does not exceed the LCU boundary from the lower right corner position outside the current block, The lower right initial candidate position is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  28. 根据权利要求27所述的方法,其中,所述方法还包括:The method of claim 27, wherein the method further comprises:
    若从所述当前块外部的右下角位置中没有选择到未超出LCU边界的候选位置,则将所述右下初始候选位置调整到所述当前块内部的右下角位置,以得到所述当前块的一个目标候选位置。If no candidate position that does not exceed the boundary of the LCU is not selected from the lower right position outside the current block, the initial lower right candidate position is adjusted to the lower right corner position inside the current block to obtain the current block A target candidate position of.
  29. 根据权利要求24所述的方法,其中,所述方法还包括:The method of claim 24, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, select the candidate positions corresponding to the remaining corners except for the one of the corners. For candidate positions beyond the boundary of the LCU, the initial candidate position of one of the corners is adjusted to the selected candidate position to obtain a target candidate position of the current block.
  30. 根据权利要求29所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 29, wherein, when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,则在右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。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, if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate The position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  31. 根据权利要求24所述的方法,其中,所述方法还包括:The method of claim 24, wherein the method further comprises:
    若所述至少一个初始候选位置包括其中一个角的初始候选位置,且所述其中一个角的初始候选位置超出LCU边界,且所述其中一个角对应的候选位置中仅所述当前块内部的候选位置未超出LCU边界,则从除所述其中一个角之外剩余角对应的候选位置中选择未超出所述LCU边界的候选位置,将所述其中一个角的初始候选位置调整到所选择的候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the initial candidate position of one of the corners, and the initial candidate position of one of the corners exceeds the LCU boundary, and among the candidate positions corresponding to one of the corners, only candidates within the current block If the position does not exceed the boundary of the LCU, a candidate position that does not exceed the boundary of the LCU is selected from the candidate positions corresponding to the remaining corners except the one of the corners, and the initial candidate position of the one of the corners is adjusted to the selected candidate Position to obtain a target candidate position of the current block.
  32. 根据权利要求31所述的方法,其中,当所述其中一个角的初始候选位置为所述右下初始候选位置时,所述方法还包括:The method according to claim 31, wherein when the initial candidate position of one of the corners is the lower right initial candidate position, the method further comprises:
    若所述至少一个初始候选位置包括所述右下初始候选位置,且所述右下初始候选位置超出LCU边界,且所述当前块内部和外部的右下角位置中仅所述第一右下候选位置未超出LCU边界,则在右上初始候选位置未超出LCU边界的情况下,将所述右下初始候选位置调整到所述右上初始候选位置,以得到所述当前块的一个目标候选位置。If the at least one initial candidate position includes the lower right initial candidate position, and the lower right initial candidate position exceeds the LCU boundary, and only the first lower right candidate is included in the lower right corner positions inside and outside the current block If the position does not exceed the LCU boundary, if the upper right initial candidate position does not exceed the LCU boundary, the lower right initial candidate position is adjusted to the upper right initial candidate position to obtain a target candidate position of the current block.
  33. 根据权利要求23所述的方法,其中,所述方法还包括:The method according to claim 23, wherein the method further comprises:
    针对不同的划分模式,根据预设优先级顺序设置所述初始候选位置集合中不同初始候选位置对应的优先级;For different division modes, setting priorities corresponding to different initial candidate positions in the initial candidate position set according to a preset priority order;
    按照所述预设优先级顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset priority order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
    若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设优先级顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to the step of selecting an initial candidate position according to the preset priority order;
    若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  34. 根据权利要求23所述的方法,其中,所述方法还包括:The method according to claim 23, wherein the method further comprises:
    针对不同的划分模式,根据预设顺序对所述初始候选位置集合中不同初始候选位置进行排序;For different division modes, sort different initial candidate positions in the initial candidate position set according to a preset order;
    按照所述预设顺序选取一个初始候选位置,并判断所选取的初始候选位置是否超出LCU边界;Selecting an initial candidate position according to the preset order, and determining whether the selected initial candidate position exceeds the boundary of the LCU;
    若所选取的初始候选位置超出LCU边界,则返回执行所述按照所述预设顺序选取一个初始候选位置的步骤;If the selected initial candidate position exceeds the LCU boundary, return to perform the step of selecting an initial candidate position according to the preset order;
    若所选取的初始候选位置未超出LCU边界,则将所选取的初始候选位置确定为所述当前块的一个目标候选位置。If the selected initial candidate position does not exceed the LCU boundary, the selected initial candidate position is determined as a target candidate position of the current block.
  35. 根据权利要求20所述的方法,其中,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    调整时域运动信息在所述运动信息候选列表中的比例值;Adjusting the ratio of temporal motion information in the motion information candidate list;
    根据所调整的比例值,控制所述运动信息候选列表中预留至少两个时域运动信息的填充位置。According to the adjusted ratio value, control to reserve at least two filling positions of time-domain motion information in the motion information candidate list.
  36. 根据权利要求20所述的方法,其中,所述基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息,包括:The method according to claim 20, wherein the determining at least one temporal motion information of the current block based on the at least one target candidate position comprises:
    确定所述至少一个目标候选位置中每一目标候选位置对应的参考帧信息;Determining the reference frame information corresponding to each target candidate position in the at least one target candidate position;
    针对每一目标候选位置,在对应的参考帧信息中确定与所述目标候选位置关联的时域位置,并根据所述时域位置使用的运动信息确定所述目标候选位置对应的时域运动信息;For each target candidate position, determine the time domain position associated with the target candidate position in the corresponding reference frame information, and determine the time domain motion information corresponding to the target candidate position according to the motion information used by the time domain position ;
    基于所述至少一个目标候选位置,对应得到至少一个时域运动信息。Based on the at least one target candidate position, correspondingly obtain at least one temporal motion information.
  37. 根据权利要求20所述的方法,其中,所述预设的帧间预测模式包括角度加权预测模式。The method according to claim 20, wherein the preset inter-frame prediction mode comprises an angle-weighted prediction mode.
  38. 根据权利要求20所述的方法,其中,所述方法还包括:The method according to claim 20, wherein the method further comprises:
    确定所述当前块的两个分区;其中,所述两个分区包括第一分区和第二分区,所述第一分区和所述第二分区的运动信息不同。Determine two partitions of the current block; wherein, the two partitions include a first partition and a second partition, and the motion information of the first partition and the second partition are different.
  39. 根据权利要求38所述的方法,其中,所述根据所述运动信息候选列表,确定所述当前块的帧间预测值,包括:The method of claim 38, wherein the determining the inter prediction value of the current block according to the motion information candidate list comprises:
    基于所述运动信息候选列表,确定所述第一分区的运动信息和所述第二分区的运动信息,并将第一运动信息索引值设置为所述第一分区的运动信息在所述运动信息候选列表中的索引序号值,将第二运动信息索引值设置为所述第二分区的运动信息在所述运动信息候选列表中的索引序号值;Based on the motion information candidate list, determine the motion information of the first partition and the motion information of the second partition, and set the first motion information index value as the motion information of the first partition in the motion information For the index number value in the candidate list, the second motion information index value is set as the index number value of the motion information of the second partition in the motion information candidate list;
    利用所述第一分区的运动信息计算所述第一分区的第一预测值,利用所述第二分区的运动信息计算所述第二分区的第二预测值;Using the motion information of the first partition to calculate a first predictive value of the first partition, and using the motion information of the second partition to calculate a second predictive value of the second partition;
    对所述第一预测值和所述第二预测值进行加权融合,得到所述当前块的帧间预测值。Perform weighted fusion on the first predicted value and the second predicted value to obtain the inter-frame predicted value of the current block.
  40. 根据权利要求39所述的方法,其中,所述方法还包括:The method of claim 39, wherein the method further comprises:
    将所述第一运动信息索引值和所述第二运动信息索引值写入码流。The first motion information index value and the second motion information index value are written into a code stream.
  41. 一种解码器,所述解码器包括解析单元、第一确定单元、第一调整单元、第一构建单元和第一预测单元;其中,A decoder including an analysis unit, a first determination unit, a first adjustment unit, a first construction unit, and a first prediction unit; wherein,
    所述解析单元,配置为解析码流,获取当前块的预测模式参数;The parsing unit is configured to parse the code stream to obtain the prediction mode parameter 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 a preset inter prediction mode is used to determine the inter prediction value of the current block;
    所述第一调整单元,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The first adjustment unit is configured to adjust the at least one initial candidate position when the at least one initial candidate position exceeds the boundary of the maximum coding unit LCU of the current block to obtain at least one of the current block A target candidate position;
    所述第一确定单元,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;The first determining unit is further configured to determine at least one temporal motion information of the current block based on the at least one target candidate position;
    所述第一构建单元,配置为基于所述至少一个时域运动信息,构建运动信息候选列表;The first construction unit is configured to construct a motion information candidate list based on the at least one temporal motion information;
    所述第一预测单元,配置为根据所述运动信息候选列表,确定所述当前块的帧间预测值。The first prediction unit is configured to determine the inter prediction value of the current block according to the motion information candidate list.
  42. 一种解码器,所述解码器包括第一存储器和第一处理器;其中,A decoder including a first memory and a first processor; wherein,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;The first memory is configured to store a computer program that can run on the first processor;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求1至19任一项所述的方法。The first processor is configured to execute the method according to any one of claims 1 to 19 when running the computer program.
  43. 一种编码器,所述编码器包括第二确定单元、第二调整单元、第二构建单元和第二预测单元;其中,An encoder, which includes a second determination unit, a second adjustment unit, a second construction unit, and a second prediction unit; wherein,
    所述第二确定单元,配置为确定当前块的预测模式参数;及当所述预测模式参数指示使用预设的帧间预测模式确定当前块的帧间预测值时,确定所述当前块的至少一个初始候选位置;The second determining unit is configured to determine the prediction mode parameter of the current block; and when the prediction mode parameter indicates that the preset inter prediction mode is used to determine the inter prediction value of the current block, determine at least An initial candidate position;
    所述第二调整单元,配置为在所述至少一个初始候选位置超出所述当前块的最大编码单元LCU边界的情况下,对所述至少一个初始候选位置进行调整,得到所述当前块的至少一个目标候选位置;The second adjustment unit is configured to adjust the at least one initial candidate position to obtain at least one initial candidate position of the current block when the at least one initial candidate position exceeds the maximum coding unit LCU boundary of the current block A target candidate position;
    所述第二确定单元,还配置为基于所述至少一个目标候选位置,确定所述当前块的至少一个时域运动信息;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 temporal motion information;
    所述第二预测单元,配置为根据所述运动信息候选列表,确定所述当前块的帧间预测值。The second prediction unit is configured to determine the inter prediction value of the current block according to the motion information candidate list.
  44. 一种编码器,所述编码器包括第二存储器和第二处理器;其中,An encoder, the encoder includes a second memory and a second processor; wherein,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;The second memory is configured to store a computer program that can run on the second processor;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求20至40任一项所述的方法。The second processor is configured to execute the method according to any one of claims 20 to 40 when running the computer program.
  45. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现如权利要求1至19任一项所述的方法、或者被第二处理器执行时实现如权利要求20至40任一项所述的方法。A computer storage medium, wherein the computer storage medium stores a computer program that, when executed by a first processor, implements the method according to any one of claims 1 to 19, or is executed by a second processor When executed, the method according to any one of claims 20 to 40 is realized.
PCT/CN2021/089252 2020-06-24 2021-04-23 Inter-frame prediction method, coder, decoder, and computer storage medium WO2021258841A1 (en)

Priority Applications (3)

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

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010591597.7A CN113840148A (en) 2020-06-24 2020-06-24 Inter-frame prediction method, encoder, decoder, and computer storage medium
CN202010591597.7 2020-06-24

Publications (1)

Publication Number Publication Date
WO2021258841A1 true WO2021258841A1 (en) 2021-12-30

Family

ID=78964752

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/089252 WO2021258841A1 (en) 2020-06-24 2021-04-23 Inter-frame prediction method, coder, 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027700A1 (en) * 2022-08-05 2024-02-08 Mediatek Inc. Joint indexing of geometric partitioning mode in video coding

Families Citing this family (1)

* 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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103096071A (en) * 2011-11-07 2013-05-08 吴秀美 Method Of Deriving Motion Information
CN103152562A (en) * 2011-11-07 2013-06-12 吴秀美 Method of decoding motion vector
CN103430550A (en) * 2011-09-09 2013-12-04 株式会社Kt Method for deriving a temporal predictive motion vector, and apparatus using the method
CN107222745A (en) * 2011-08-29 2017-09-29 苗太平洋控股有限公司 Device for decoding the movable information under merging patterns
WO2019074622A1 (en) * 2017-10-11 2019-04-18 Qualcomm Incorporated Low-complexity design for fruc
WO2020113052A1 (en) * 2018-11-27 2020-06-04 Qualcomm Incorporated Simplification of history-based motion vector prediction

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107222745A (en) * 2011-08-29 2017-09-29 苗太平洋控股有限公司 Device for decoding the movable information under merging patterns
CN103430550A (en) * 2011-09-09 2013-12-04 株式会社Kt Method for deriving a temporal predictive motion vector, and apparatus using the method
CN103096071A (en) * 2011-11-07 2013-05-08 吴秀美 Method Of Deriving Motion Information
CN103152562A (en) * 2011-11-07 2013-06-12 吴秀美 Method of decoding motion vector
WO2019074622A1 (en) * 2017-10-11 2019-04-18 Qualcomm Incorporated Low-complexity design for fruc
WO2020113052A1 (en) * 2018-11-27 2020-06-04 Qualcomm Incorporated Simplification of history-based motion vector prediction

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024027700A1 (en) * 2022-08-05 2024-02-08 Mediatek Inc. Joint indexing of geometric partitioning mode in video coding

Also Published As

Publication number Publication date
CN116471418A (en) 2023-07-21
TW202201958A (en) 2022-01-01
CN113840148A (en) 2021-12-24
MX2022010727A (en) 2022-09-23
CN114930838A (en) 2022-08-19

Similar Documents

Publication Publication Date Title
JP7299342B2 (en) Video processing method, apparatus, storage medium and storage method
CN113748676B (en) Matrix derivation in intra-coding mode
JP7414843B2 (en) Quantized residual difference pulse code modulation representation of encoded video
TW202025780A (en) History based motion vector predictor for intra block copy
BR112015030508B1 (en) IMAGE CODING AND IMAGE DECODING DEVICES AND METHODS
CN113632493A (en) Sub-block transform in transform skip mode
WO2022117089A1 (en) Prediction method, encoder, decoder and storage medium
CN113853791B (en) Transform bypass coding residual block in digital video
WO2021258841A1 (en) Inter-frame prediction method, coder, decoder, and computer storage medium
TW202139709A (en) Inter-frame prediction method, encoder, decoder, and storage medium
WO2021203924A1 (en) Encoding method, decoding method, encoder, decoder, and storage medium
US11843781B2 (en) Encoding method, decoding method, and decoder
CN114830651A (en) Intra prediction method, encoder, decoder, and computer storage medium
WO2021244125A1 (en) Interframe prediction method, decoder, encoder, and computer storage medium
WO2022116113A1 (en) Intra-frame prediction method and device, decoder, and encoder
WO2021238396A1 (en) Inter-frame prediction methods, encoder, decoder, and computer storage medium
TW202145784A (en) Inter-frame prediction method, encoder, decoder, and computer storage medium for enhancing diversity of motion messages in motion message candidate list to improve coding/decoding performance
WO2022140905A1 (en) Prediction methods, encoder, decoder, and storage medium
KR20220088504A (en) Content Adaptive Segmentation Prediction
WO2021196228A1 (en) Inter-frame prediction method, encoder, decoder and storage medium
WO2023123736A1 (en) Communication method, apparatus, device, system, and storage medium
RU2815738C2 (en) Determination of chromaticity coding mode using matrix-based intra-frame prediction
WO2024108391A1 (en) Video encoding method and apparatus, video decoding method and apparatus, and devices, system and storage medium
WO2024007128A1 (en) Video encoding and decoding methods, apparatus, and devices, system, and storage medium
WO2023193254A1 (en) Decoding method, encoding method, decoder, and encoder

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21830043

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21830043

Country of ref document: EP

Kind code of ref document: A1