Video encoder, video decoder, and corresponding method
By applying BDOF processing on specific-sized picture blocks under defined conditions, the method addresses the challenge of balancing complexity and accuracy in video coding, improving efficiency in video encoding and decoding.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2026-01-07
- Publication Date
- 2026-04-21
AI Technical Summary
Existing video coding technologies face challenges in balancing coding complexity with prediction accuracy, particularly in bidirectional prediction methods.
Implementing bidirectional optical flow (BDOF) processing on picture blocks of specific sizes, subject to predefined conditions, to enhance prediction accuracy while controlling coding complexity.
BDOF technology improves coding efficiency by obtaining predicted sample values closer to the original values, reducing complexity and enhancing accuracy for video encoding and decoding processes.
Smart Images

Figure 2026067888000001_ABST
Abstract
Description
[Technical Field]
[0001] This application relates to the field of video coding technology, and more particularly to video encoders, video decoders, and corresponding methods. [Background technology]
[0002] Digital video functionality can be incorporated into a wide variety of devices, including digital televisions, digital live broadcasting systems, wireless broadcasting systems, personal digital assistants (PDAs), laptop or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radiotelephones (so-called "smartphones"), video conferencing equipment, video streaming equipment, and similar devices. Digital video devices implement video compression technologies, such as those specified in standards defined by MPEG-2, MPEG-4, ITU-T H.263, and ITU-T H.264 / MPEG-4 Part 10: Advanced Video Coding (AVC), the H.265 / High-Efficiency Video Coding (HEVC) standard, and extensions thereof. By implementing such video compression technologies, video devices can transmit, receive, encode, decode, and / or store digital video information more efficiently.
[0003] Video compression techniques are used to reduce or eliminate inherent redundancy in video sequences by performing spatial (intra-picture) prediction and / or temporal (inter-picture) prediction. In block-based video coding, a video slice (i.e., a video frame, or part of a video frame) is divided into multiple picture blocks, which may also be referred to as tree blocks, coding units (CUs), and / or coding nodes. Picture blocks in an intra-coded (I) slice of a picture are coded through spatial prediction based on reference samples in adjacent blocks within the same picture. Picture blocks in an inter-coded (P or B) slice of a picture may use spatial prediction based on reference samples in adjacent blocks within the same picture, or temporal prediction based on reference samples in another reference picture. A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0004] Various video coding standards, including the High-Efficiency Video Coding (HEVC) standard, propose predictive coding modes for use on picture blocks. Specifically, the block currently being coded is predicted based on coded video data blocks. In intra-predictive mode, the current block is predicted based on one or more previously decoded adjacent blocks within the same picture as the current block. In inter-predictive mode, the current block is predicted based on decoded blocks in different pictures.
[0005] Predictions include forward prediction, backward prediction, bidirectional prediction, and the like. In bidirectional prediction, based on the motion information in the motion compensation processes of forward prediction and backward prediction, it is necessary to obtain a forward prediction block (for example, corresponding to the predicted sample values in the first list) and a backward prediction block (for example, corresponding to the predicted sample values in the second list) respectively, and based on these forward prediction blocks and backward prediction blocks, the prediction block of the current block is determined. How to reduce the coding complexity while improving the prediction accuracy of the prediction block of the current block is a technical problem studied by those skilled in the art. Summary of the Invention
[0006] Embodiments of the present invention disclose a video encoder, a video decoder, and a corresponding method for balancing the coding / decoding complexity and the prediction accuracy to a certain extent.
[0007] According to a first aspect, an embodiment of this application provides a video encoding method, and the method includes: When a plurality of preset conditions are satisfied, performing bidirectional optical flow BDOF (Bi - directional optical flow, abbreviated as BIO or BDOF) processing on the current picture block to obtain the predicted sample values of the current picture block, and the plurality of preset conditions include at least the condition that the size of the current picture block satisfies the first preset size. The size of the current picture block is usually represented by the width and height (briefly written as W×H), and the width and height are measured by samples (either sample or pixel). For example, if the size of the current picture block is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the size of the current picture block is 8×16, 8 indicates that the width of the current picture block is 8 samples, and 16 indicates that the height of the current picture block is 16 samples.
[0008] That the size of the current picture block satisfies the first preset size includes (or is) that the height H of the current picture block is 8 or more, and when the product of the width W and the height H of the current picture block is equal to 64, the width W is not equal to the height H.
[0009] Alternatively, that the size of the current picture block satisfies the first preset size includes (or is) that the height H of the current picture block is 8 or more, and the width W of the current picture block is 8 or more.
[0010] Alternatively, that the size of the current picture block satisfies the first preset size includes (or is) that the height H of the current picture block is 8 or more, the width W of the current picture block is 8 or more, and the product of the width W and the height H of the current picture block is greater than 64.
[0011] Alternatively, that the size of the current picture block satisfies the first preset size includes (or is) that the height H of the current picture block is 8 or more, the width W of the current picture block is 8 or more, and the product of the width W and the height H of the current picture block is greater than 128.
[0012] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0013] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0014] The method further reconstructs the current picture block based on at least the predicted sample values of the current picture block, The syntax element is encoded into the target bitstream, and the syntax element is used to indicate that bidirectional prediction is applied, This includes the following.
[0015] It should be understood that in the process of performing BDOF on the current picture block, the prediction is performed by the subblocks. Specifically, performing a bidirectional optical flow BDOF operation on the current picture block may mean performing a bidirectional optical flow BDOF operation on the current subblock of the current picture block in order to obtain the predicted sample values of the current subblock of the current picture block. The predicted sample values of the current picture block include the predicted sample values of one or more subblocks, and these one or more subblocks include the current subblock. If the current picture block contains only one subblock, the size of that subblock may be equal to the size of the current picture block.
[0016] Furthermore, before it is decided whether to determine (or obtain through prediction) the predicted sample values of the current picture block according to the BDOF technique, other reference conditions may exist in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0017] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0018] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0019] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0020] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0021] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0022] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0023] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0024] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0025] Condition I: The current picture block size is the first preset size.
[0026] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0027] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0028] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0029] In this embodiment of the application, a state determination operation may be further included. For example, it may be determined whether the above-mentioned preset conditions are satisfied.
[0030] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0031] It should be understood that the method in this embodiment of this application may be carried out by a video encoder or an electronic device having video encoding capabilities.
[0032] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0033] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0034] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0035] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0036] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0037] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0038] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0039] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0040] In one optional solution, the method further includes determining the sample residual based on the current picture block's sample value and the current picture block's predicted sample value, and encoding the syntax element into the target bitstream, which includes encoding the syntax element and the sample residual into the target bitstream. In other words, in addition to the syntax element, the sample residual may also be encoded into the target bitstream (the sample residual can be obtained through computation using a residual calculation unit, for example, the sample residual may be 0 or non-zero). This solution can be applied to AMVP mode and merge mode. There are also cases where it is not necessary to encode the sample residual into the target bitstream. For example, in skip mode, it is not necessary to encode the sample residual into the target bitstream.
[0041] According to a second aspect, one embodiment of this application provides an encoding method, the method is When the current size of the picture block is a second preset size, a first processing method determines (or obtains through prediction) the predicted sample value of the current picture block (e.g., the predicted sample of the current coding unit) based on the reference sample value corresponding to the first list (i.e., list0) and the reference sample value corresponding to the second list (i.e., list1), wherein the first processing method is not BDOF (or referred to as Bi-directional Optical Flow, BIO). In other words, when the current size of the picture block is a second preset size, it is not permitted to use BDOF to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). The second set of preset sizes includes 8x8 (the first 8 indicates that the picture block width is currently 8 samples, and the second 8 indicates that the picture block height is currently 8 samples), 4xN (4 indicates that the picture block width is currently 4 samples, and N indicates that the picture block height is currently N samples, with other sizes estimated by analogy), 8x16, or 16x8. N is a power of 2 and is greater than or equal to 8. For example, the value of N could be 16, 32, 64, etc.
[0042] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0043] The method then includes reconstructing the current picture block based on at least the predicted sample values of the current picture block. The "at least" here indicates that the predicted sample values of the current picture block must be used to reconstruct the current picture block, but other information may also be used.
[0044] The method then includes encoding a syntax element into the target bitstream, the syntax element being used to indicate at least that bidirectional prediction is applied.
[0045] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0046] Furthermore, the aforementioned cases in which the second preset size includes 8×8, 4×N, 8×16, or 16×8 may also be limited to cases where the second preset size is 8×8, 4×N, 8×16, or 16×8. In other words, BDOF may be prohibited from being used for one of the sizes listed above as 8×8, 4×N, 8×16, and 16×8, or for multiple of these sizes. Examples will be used below for illustrative purposes.
[0047] Example 1: The second preset size includes (or is) 8x8. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 8x8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 8x8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0048] Example 2: The second preset size includes (or is) 4 × N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 4 × N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 4 × N, with N being 8 or greater, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0049] Example 3: The second preset size includes (or is) 8×8 or 4×N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8 and 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is either 8×8 or 4×N, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0050] Example 4: The second preset size includes (or is) 8×8, 4×N, 8×16, or 16×8, where N is 8 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8, 4×N, 8×16, and 16×8. In this case, when the current size of the picture block is one of the second preset sizes, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is one of 8×8, 4×N, 8×16, and 16×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0051] Example 5: The second preset size includes (or is) N×8, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size N×8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0052] Example 6: The second preset size includes (or is) N×8 or 4×N, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes N×8 or 4×N. In this case, obtaining a predicted sample value of the current picture block through prediction in the first processing method, based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, when the current picture block size is the second preset size, can be specifically expressed as follows: When the current picture block size is N×8 or 4×N, obtain a predicted sample value of the current picture block through prediction in the first processing method, based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list. Furthermore, in some scenarios, the use of the BDOF is also prohibited for size M×4, so in this application, when the use of the BDOF is prohibited for the second preset size, the BDOF may also be prohibited from being used for size M×4, where M is an integer of 4 or greater.
[0053] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0054] It should be understood that the method in this embodiment of this application may be carried out by a video encoder or an electronic device having video encoding capabilities.
[0055] According to the method described above, the characteristics of current picture blocks of various sizes are fully considered when BDOF technology is used. When the size of the current picture block is a second preset size, the predicted sample value of the current picture block is determined according to a technology other than BDOF technology. This significantly reduces coding complexity and improves coding efficiency.
[0056] In one of the optional solutions, determining the predicted sample value of the current picture block using a first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list is: Perform a weighting calculation on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list to obtain the predicted sample values for the current picture block, or According to Merge-with-Motion Vector Difference (MMVD) technology, predictive sample values for the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, or According to the combined inter / intra prediction CIIP technique, the predicted sample values of the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list. Includes.
[0057] In this embodiment of this application, whether a weighting calculation method, MMVD technique, CIIP technique, or other prediction technique is specifically used may be determined by using corresponding conditions or indicated by using corresponding directional information.
[0058] It should be understood that the BDOF technique is equivalent to conventional patch optimization techniques for predicting the predicted sample value of a picture block. According to the BDOF technique, in many scenarios, predicted sample values can be obtained that are closer to the actual sample values of the picture block. Therefore, the sample residuals obtained based on these predicted sample values will be smaller, thus improving coding efficiency. The aforementioned weighting calculation method may be considered conventional for obtaining the predicted sample value of a picture block, and the aforementioned MMVD and CIIP techniques may each be considered conventional patch optimization techniques. In this embodiment of the application, when the size of the picture block is a second preset size, the predicted sample value of the picture block is determined not by the BDOF technique, but by conventional (e.g., a weighting calculation method) or other patch optimization techniques (e.g., MMVD or CIIP). This can significantly reduce coding complexity and improve coding efficiency.
[0059] In one of the optional solutions, the method further, The process includes performing a bidirectional optical flow BDOF (Blind Degree of Flow) operation on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the above preset conditions include at least the condition that the size of the current picture block satisfies a first preset size.
[0060] For the current picture block size to satisfy the first preset size, the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0061] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0062] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0063] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0064] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0065] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0066] The method further includes reconstructing the current picture block based on at least the predicted sample values of the current picture block.
[0067] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0068] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0069] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0070] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0071] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0072] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0073] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0074] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0075] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0076] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0077] Condition I: The current picture block size is the first preset size.
[0078] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0079] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0080] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0081] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0082] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0083] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0084] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0085] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0086] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0087] In one optional solution, the method further includes determining the sample residual based on the current picture block's sample value and the current picture block's predicted sample value, and encoding the syntax element into the target bitstream, which includes encoding the syntax element and the sample residual into the target bitstream.
[0088] According to a third aspect, one embodiment of this application provides a video decoding method, the method is The bitstream is parsed to obtain syntax elements, which are used to indicate that bidirectional prediction is applied, at a minimum. When multiple preset conditions are met, a bidirectional optical flow (BDOF, or simply BDOF, or Bidirectional Optical Flow (BIO)) process is performed on the current picture block to obtain predicted sample values of the current picture block, and the above multiple preset conditions include at least the condition that the size of the current picture block satisfies the first preset size. This includes the fact that the size of a picture block is currently expressed by its width and height (often abbreviated as W×H), and the width and height are measured in samples (or pixels). For example, if the size of a picture block is currently 8×8, the first 8 indicates that the width of the picture block is 8 samples, and the second 8 indicates that the height of the picture block is 8 samples. In another example, if the size of a picture block is currently 8×16, the 8 indicates that the width of the picture block is 8 samples, and the 16 indicates that the height of the picture block is 16 samples.
[0089] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0090] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0091] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0092] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0093] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0094] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0095] The method further includes determining the sample value of the current picture block based on the predicted sample value of the current picture block, the predicted sample value of the current picture block includes the predicted sample values of one or more subblocks.
[0096] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0097] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0098] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0099] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0100] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0101] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0102] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0103] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0104] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0105] Condition I: The current picture block size is the first preset size.
[0106] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0107] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0108] It should be understood that the current picture block (also referred to as the current block) here can be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0109] In this embodiment of the application, a state determination operation may be further included. For example, it may be determined whether the above-mentioned preset conditions are satisfied.
[0110] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0111] It should be understood that the method in this embodiment of this application may be carried out by a video decoder, or an electronic device having a video decoding function.
[0112] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0113] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0114] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0115] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0116] In one of the optional solutions, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (e.g., when only one MVD is included, the untransmitted MVD may be derived based on the transmitted MVD). The second index (also referred to as the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0117] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0118] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0119] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0120] In one of the optional solutions, parsing the bitstream to obtain syntax elements includes parsing the bitstream to obtain sample residuals and syntax elements, and determining the sample value of the current picture block based on at least the predicted sample value of the current picture block includes determining the sample value of the current picture block based on the sample residuals and the predicted sample value of the current picture block.
[0121] According to a fourth aspect, one embodiment of this application provides a decoding method, which is The bitstream is parsed to obtain syntax elements, which are used to indicate that bidirectional prediction is applied, at a minimum. When the current size of the picture block is a second preset size, a first processing method determines (or obtains through prediction) the predicted sample value of the current picture block (e.g., the predicted sample of the current coding unit) based on the reference sample value corresponding to the first list (i.e., list0) and the reference sample value corresponding to the second list (i.e., list1), wherein the first processing method is not BDOF (or referred to as Bi-directional Optical Flow, BIO). In other words, when the current size of the picture block is a second preset size, it is not permitted to use BDOF to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). The second set of preset sizes includes 8x8 (the first 8 indicates that the picture block width is currently 8 samples, and the second 8 indicates that the picture block height is currently 8 samples), 4xN (4 indicates that the picture block width is currently 4 samples, and N indicates that the picture block height is currently N samples, with other sizes estimated by analogy), 8x16, or 16x8. N is a power of 2 and is greater than or equal to 8. For example, the value of N could be 16, 32, 64, etc.
[0122] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0123] The method further includes determining the sample value of the current picture block based on at least the predicted sample value of the current picture block.
[0124] It should be understood that the current picture block (also referred to as the current block) here can be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0125] Furthermore, the aforementioned cases in which the second preset size includes 8×8, 4×N, 8×16, or 16×8 may also be limited to cases where the second preset size is 8×8, 4×N, 8×16, or 16×8. In other words, BDOF may be prohibited from being used for one of the sizes listed above as 8×8, 4×N, 8×16, and 16×8, or for multiple of these sizes. Examples will be used below for illustrative purposes.
[0126] Example 1: The second preset size includes (or is) 8x8. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 8x8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 8x8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0127] Example 2: The second preset size includes (or is) 4 × N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 4 × N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 4 × N, with N being 8 or greater, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0128] Example 3: The second preset size includes (or is) 8×8 or 4×N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8 and 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is either 8×8 or 4×N, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0129] Example 4: The second preset size includes (or is) 8×8, 4×N, 8×16, or 16×8, where N is 8 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8, 4×N, 8×16, and 16×8. In this case, when the current size of the picture block is one of the second preset sizes, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is one of 8×8, 4×N, 8×16, and 16×8, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0130] Example 5: The second preset size includes (or is) N×8, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size N×8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0131] Example 6: The second preset size includes (or is) N×8 or 4×N, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes N×8 or 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8 or 4×N, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0132] Furthermore, in some scenarios, the use of BDOF is prohibited even for size M × 4. Therefore, in this application, when the use of BDOF is prohibited for a second preset size, BDOF may also be prohibited for use for size M × 4, provided that M is an integer greater than or equal to 4.
[0133] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0134] It should be understood that the method in this embodiment of this application may be carried out by a video decoder, or an electronic device having a video decoding function.
[0135] According to the method described above, the characteristics of current picture blocks of various sizes are fully considered when BDOF technology is used. When the size of the current picture block is a second preset size, the predicted sample value of the current picture block is determined according to a technology other than BDOF technology. This significantly reduces coding complexity and improves coding efficiency.
[0136] In one of the optional solutions, obtaining the predicted sample value of the current picture block through prediction using a first processing method, based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, Perform a weighting calculation on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list to obtain the predicted sample values for the current picture block, or According to Merge-with-Motion Vector Difference (MMVD) technology, predictive sample values for the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, or According to the combined inter / intra prediction CIIP technique, the predicted sample values of the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, or According to decoder-side motion vector refinement DMVR technology, the predicted sample value of the current picture block is obtained through prediction based on the reference sample corresponding to the first list and the reference sample corresponding to the second list. Includes.
[0137] In this embodiment of the application, whether a weighting calculation method, MMVD technology, or CIIP technology is specifically used may be determined by using the corresponding conditions or indicated by using the corresponding instruction information.
[0138] It should be understood that BDOF technology is equivalent to conventional patch optimization techniques for predicting the predicted sample value of a picture block. According to BDOF technology, in many scenarios, predicted sample values can be obtained that are closer to the actual sample values of the picture block. Therefore, the sample residuals obtained based on these predicted sample values are smaller, thus improving coding efficiency. Consequently, BDOF technology is typically used on the encoder side. To recover predicted sample values more accurately, BDOF technology is also used correspondingly on the decoder side. The aforementioned weighting calculation method may be considered conventional technology for obtaining predicted sample values of a picture block, and the aforementioned MMVD, CIIP, and DMVR technologies may each be considered conventional patch optimization techniques. In this embodiment of this application, when the size of the picture block is a second preset size, the predicted sample value of the picture block is determined not by BDOF technology, but by conventional technology (e.g., weighting calculation method) or other patch optimization techniques (e.g., MMVD, CIIP, or DMVR). This can significantly reduce the complexity of decoding and improve decoding efficiency.
[0139] In one of the optional solutions, the method further, The process includes performing a bidirectional optical flow BDOF (Blind Degree of Flow) operation on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the above preset conditions include at least the condition that the size of the current picture block satisfies a first preset size.
[0140] The current size of a picture block satisfies the first preset size if the current height H of the picture block is 8 or greater, and the width W is not equal to the height H when the product of the width W and height H of the picture block is equal to 64 (or is).
[0141] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0142] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0143] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0144] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0145] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0146] The method further includes reconstructing the current picture block based on at least the predicted sample values of the current picture block.
[0147] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0148] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0149] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0150] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0151] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0152] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0153] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0154] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0155] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0156] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0157] Condition I: The current picture block size is the first preset size.
[0158] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0159] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0160] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0161] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0162] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0163] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0164] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0165] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0166] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0167] In one of the optional solutions, parsing the bitstream to obtain syntax elements includes parsing the bitstream to obtain sample residuals and syntax elements, and determining the sample value of the current picture block based on at least the predicted sample value of the current picture block includes determining the sample value of the current picture block based on the sample residuals and the predicted sample value of the current picture block.
[0168] According to a fifth aspect, one embodiment of this application provides an interpretation method, which is: Currently, it is determined whether the picture block satisfies multiple preset conditions. When the above multiple preset conditions are satisfied, a bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) process is performed on the current picture block to obtain the predicted sample values of the current picture block, wherein the above multiple preset conditions include at least the condition that the size of the current picture block satisfies the first preset size. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). For example, if the size of the current picture block is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the size of the current picture block is 8×16, the 8 indicates that the width of the current picture block is 8 samples, and the 16 indicates that the height of the current picture block is 16 samples.
[0169] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0170] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0171] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0172] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0173] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0174] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0175] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0176] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0177] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0178] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0179] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0180] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0181] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0182] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0183] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0184] Condition I: The current picture block size is the first preset size.
[0185] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0186] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0187] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block. Certainly, the current picture block here may instead be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0188] In one optional solution, the method further includes skipping the execution of bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) processing on the current picture block when at least one of the above preset conditions is not satisfied. Specifically, the predicted sample values of the current picture block can be obtained through prediction in a first processing method based on reference sample values corresponding to a first list and reference sample values corresponding to a second list. The first processing method is not BDOF. For further details, please refer to the relevant sections of this specification. Details will not be explained again here.
[0189] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0190] It should be understood that the method in this embodiment of this application can be performed by a video encoder or an electronic device having video encoding capabilities, or by a video decoder or an electronic device having video decoding capabilities. For example, the method can be specifically performed by an interpretation unit within these devices.
[0191] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0192] According to a sixth aspect, one embodiment of this application provides a video coding apparatus, the coding apparatus including an interpretation unit, a reconstruction unit, and an entropy coding unit.
[0193] The interpretation unit is configured to perform bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) processing on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the above preset conditions include at least the condition that the size of the current picture block satisfies a first preset size. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). For example, if the size of the current picture block is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the size of the current picture block is 8×16, the 8 indicates that the width of the current picture block is 8 samples, and the 16 indicates that the height of the current picture block is 16 samples.
[0194] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0195] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0196] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0197] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0198] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0199] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0200] The reconstruction unit is configured to reconstruct the current picture block based on at least the predicted sample values of the current picture block.
[0201] The entropy coding unit is configured to encode a syntax element into the target bitstream, and the syntax element is used to indicate that bidirectional prediction is applied.
[0202] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0203] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0204] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0205] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0206] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0207] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0208] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0209] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0210] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0211] Condition I: The current picture block size is the first preset size.
[0212] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0213] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0214] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0215] In this embodiment of the application, a state determination operation may be further included. For example, the interpretation unit may be configured to determine whether the above-mentioned preset conditions are satisfied.
[0216] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0217] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0218] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0219] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0220] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0221] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0222] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0223] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0224] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0225] In one optional solution, the video encoding device further includes a residual calculation unit configured to determine the sample residual based on the current picture block's sample value and the current picture block's predicted sample value, and the entropy encoding unit is specifically configured to encode the syntax elements and the sample residual into the target bitstream. In other words, in addition to the syntax elements, the sample residual may also be encoded into the target bitstream (the sample residual may be obtained through computation using the residual calculation unit). This solution can be applied to AMVP mode and merge mode. There are also cases where it is not necessary to encode the sample residual into the target bitstream. For example, in skip mode, it is not necessary to encode the sample residual into the target bitstream.
[0226] According to a seventh aspect, one embodiment of this application provides a video coding device, the video coding device including an interpretation unit, a reconstruction unit, and an entropy coding unit.
[0227] The interpretation unit is configured to determine (or obtain through prediction) the predicted sample value of the current picture block (e.g., the predicted sample of the current coding unit) using a first processing method based on the reference sample value corresponding to the first list (i.e., list0) and the reference sample value corresponding to the second list (i.e., list1), when the current picture block size is a second preset size, and the first processing method is not BDOF (or Bi-directional optical flow, BIO). In other words, when the current picture block size is a second preset size, it is not permitted to use BDOF to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list. The current picture block size is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). The second set of preset sizes includes 8x8 (the first 8 indicates that the picture block width is currently 8 samples, and the second 8 indicates that the picture block height is currently 8 samples), 4xN (4 indicates that the picture block width is currently 4 samples, and N indicates that the picture block height is currently N samples, with other sizes estimated by analogy), 8x16, or 16x8. N is a power of 2 and is greater than or equal to 8. For example, the value of N could be 16, 32, 64, etc.
[0228] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0229] The reconstruction unit is configured to reconstruct the current picture block based on at least the predicted sample values of the current picture block. The "at least" here indicates that the predicted sample values of the current picture block must be used to reconstruct the current picture block, but other information may also be used.
[0230] The entropy coding unit is configured to encode a syntax element into the target bitstream, and the syntax element is used to indicate that bidirectional prediction is applied.
[0231] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0232] Furthermore, the aforementioned cases in which the second preset size includes 8×8, 4×N, 8×16, or 16×8 may also be limited to cases where the second preset size is 8×8, 4×N, 8×16, or 16×8. In other words, BDOF may be prohibited from being used for one of the sizes listed above as 8×8, 4×N, 8×16, and 16×8, or for multiple of these sizes. Examples will be used below for illustrative purposes.
[0233] Example 1: The second preset size includes (or is) 8x8. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 8x8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 8x8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0234] Example 2: The second preset size includes (or is) 4 × N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 4 × N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 4 × N, with N being 8 or greater, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0235] Example 3: The second preset size includes (or is) 8×8 or 4×N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8 and 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is either 8×8 or 4×N, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0236] Example 4: The second preset size includes (or is) 8×8, 4×N, 8×16, or 16×8, where N is 8 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8, 4×N, 8×16, and 16×8. In this case, when the current size of the picture block is one of the second preset sizes, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is one of 8×8, 4×N, 8×16, and 16×8, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0237] Example 5: The second preset size includes (or is) N×8, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size N×8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0238] Example 6: The second preset size includes (or is) N×8 or 4×N, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes N×8 or 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8 or 4×N, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0239] Furthermore, in some scenarios, the use of BDOF is prohibited even for size M × 4. Therefore, in this application, when the use of BDOF is prohibited for a second preset size, BDOF may also be prohibited for use for size M × 4, provided that M is an integer greater than or equal to 4.
[0240] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0241] According to the method described above, the characteristics of current picture blocks of various sizes are fully considered when BDOF technology is used. When the size of the current picture block is a second preset size, the predicted sample value of the current picture block is determined according to a technology other than BDOF technology. This significantly reduces coding complexity and improves coding efficiency.
[0242] In one of the optional solutions, in the process of determining the predicted sample value of the current picture block using a first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, the interpretation unit specifically: Weighted calculations are performed on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list to obtain the predicted sample values for the current picture block, or According to Merge-with-Motion Vector Difference (MMVD) technology, the predicted sample value of the current picture block is obtained through prediction based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, or According to the combined inter / intra prediction CIIP technique, the predicted sample values of the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list. It is configured in this way.
[0243] In this embodiment of the application, whether a weighting calculation method, MMVD technology, or CIIP technology is specifically used may be determined by using the corresponding conditions or indicated by using the corresponding instruction information.
[0244] It should be understood that the BDOF technique is equivalent to conventional patch optimization techniques for predicting the predicted sample value of a picture block. According to the BDOF technique, in many scenarios, predicted sample values can be obtained that are closer to the actual sample values of the picture block. Therefore, the sample residuals obtained based on these predicted sample values will be smaller, thus improving coding efficiency. The aforementioned weighting calculation method may be considered conventional for obtaining the predicted sample value of a picture block, and the aforementioned MMVD and CIIP techniques may each be considered conventional patch optimization techniques. In this embodiment of the application, when the size of the picture block is a second preset size, the predicted sample value of the picture block is determined not by the BDOF technique, but by conventional (e.g., a weighting calculation method) or other patch optimization techniques (e.g., MMVD or CIIP). This can significantly reduce coding complexity and improve coding efficiency.
[0245] In one of the optional solutions, The interpretation unit is further configured to perform a bidirectional optical flow BDOF process on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the above preset conditions include at least the condition that the size of the current picture block satisfies a first preset size.
[0246] For the current picture block size to satisfy the first preset size, the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0247] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0248] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0249] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0250] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0251] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0252] The reconstruction unit is further configured to reconstruct the current picture block based on at least the predicted sample values of the current picture block.
[0253] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0254] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0255] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0256] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0257] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0258] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0259] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0260] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0261] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0262] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0263] Condition I: The size of the current picture block is the first preset size.
[0264] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there is no weighting coefficient for the luma component of list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there is no weighting coefficient for the luma component of list1 prediction.
[0265] For example, when all of Conditions A to J are satisfied, it is determined that the BDOF technique can be used to predict the predicted sample value of the current picture block. For example, bdofFlag is set to true. Note that the foregoing conditions are merely examples, and other conditions may be further added, or one or more of the foregoing conditions may be replaced, or one or more of the foregoing conditions may be removed.
[0266] In one option solution, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indication information (e.g., predFlagL0 = 1 and predFlagL1 = 1), the prediction direction indication information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to the first list (i.e., list0) and a second motion vector corresponding to the second list (i.e., list1), and the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0267] In this embodiment of the application, the reference frame index is used to identify a reference picture corresponding to a motion vector (e.g., the first motion vector or the second motion vector) used within a specified reference picture list (the first list list0 or the second list list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0268] In the video coding field, the inter prediction mode includes forward prediction, backward prediction, and bidirectional prediction (including forward prediction and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction indication information. For example, the prediction direction indication information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0 = 1 and predFlagL1 = 1, the prediction direction indication information indicates that bidirectional prediction is applied. When predFlagL0 = 1 and predFlagL1 = 0, the prediction direction indication information indicates that forward prediction is used. When predFlagL0 = 0 and predFlagL1 = 1, the prediction direction indication information indicates that backward prediction is used. It can be understood that "forward" and "backward" correspond to reference picture list 0 (list0, i.e., the aforementioned first list) and reference picture list 1 (list1, i.e., the aforementioned second list) of the current picture, respectively.
[0269] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0270] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0271] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0272] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0273] In one optional solution, the video encoding device further includes a residual calculation unit configured to determine the sample residual based on the current picture block's sample value and the current picture block's predicted sample value, and the entropy encoding unit is specifically configured to encode the syntax elements and the sample residual into the bitstream to be transmitted.
[0274] According to the eighth aspect, one embodiment of this application provides a video decoding device, which includes an entropy decoding unit, an interpretation unit, and a reconstruction unit.
[0275] The entropy decoding unit is configured to analyze the bitstream and obtain a syntax element, which is used to indicate at least that bidirectional prediction is applied.
[0276] The interpretation unit is configured to perform bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) processing on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the above preset conditions include at least the condition that the size of the current picture block satisfies a first preset size. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). For example, if the size of the current picture block is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the size of the current picture block is 8×16, the 8 indicates that the width of the current picture block is 8 samples, and the 16 indicates that the height of the current picture block is 16 samples.
[0277] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0278] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0279] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0280] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0281] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0282] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0283] The reconstruction unit is configured to determine the sample value of the current picture block based on at least the predicted sample value of the current picture block.
[0284] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0285] Condition A: There exists a high-level syntax identifier sps_bdof_enabled_flag indicating that the BDOF technology is allowed to be used for the current video sequence.
[0286] Condition B: The prediction direction indication information predFlagL0 corresponding to the first list (List1) is equal to 1, and the prediction direction indication information predFlagL1 corresponding to the second list (list0) is equal to 1.
[0287] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the current picture block is located satisfy the relationship (POC_L0 - POC_Cur) × (POC_L1 - POC_Cur) < 0. In other words, the picture containing the current picture block is between the two reference pictures.
[0288] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index related to motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for the motion compensation of the current block is translational motion.
[0289] Condition E: merge_subblock_flag[x0][y0] is equal to 0. Here, merge_subblock_flag[x0][y0] equal to 0 indicates that the sub-block merge mode is not applied to the current picture block.
[0290] Condition F: sym_mvd_flag[x0][y0] is equal to 0. sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0291] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0292] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0293] Condition I: The current picture block size is the first preset size.
[0294] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0295] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0296] It should be understood that the current picture block (also referred to as the current block) here can be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0297] In this embodiment of the application, a state determination operation may be further included. For example, the interpretation unit may be configured to determine whether the above-mentioned preset conditions are satisfied.
[0298] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0299] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0300] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0301] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0302] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0303] In one of the optional solutions, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (e.g., when only one MVD is included, the untransmitted MVD may be derived based on the transmitted MVD). The second index (also referred to as the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0304] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0305] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0306] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0307] In one optional solution, the entropy decoding unit is configured to analyze the bitstream to obtain sample residuals and syntax elements, and the reconstruction unit is configured to determine the sample value of the current picture block based on the sample residuals and the predicted sample value of the current picture block.
[0308] According to the ninth aspect, one embodiment of this application provides a video decoding device, which includes an entropy decoding unit, an interpretation unit, and a reconstruction unit.
[0309] The entropy decoding unit is configured to analyze the bitstream and obtain a syntax element, which is used to indicate at least that bidirectional prediction is applied.
[0310] The interpretation unit is configured to determine (or obtain through prediction) the predicted sample value of the current picture block (e.g., the predicted sample of the current coding unit) using a first processing method based on the reference sample value corresponding to the first list (i.e., list0) and the reference sample value corresponding to the second list (i.e., list1), when the current picture block size is a second preset size, and the first processing method is not BDOF (or Bi-directional optical flow, BIO). In other words, when the current picture block size is a second preset size, it is not permitted to use BDOF to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list. The current picture block size is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (or pixels). The second set of preset sizes includes 8x8 (the first 8 indicates that the picture block width is currently 8 samples, and the second 8 indicates that the picture block height is currently 8 samples), 4xN (4 indicates that the picture block width is currently 4 samples, and N indicates that the picture block height is currently N samples, with other sizes estimated by analogy), 8x16, or 16x8. N is a power of 2 and is greater than or equal to 8. For example, the value of N could be 16, 32, 64, etc.
[0311] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0312] The reconstruction unit is configured to determine the sample value of the current picture block based on at least the predicted sample value of the current picture block.
[0313] It should be understood that the current picture block (also referred to as the current block) here can be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0314] Furthermore, the aforementioned cases in which the second preset size includes 8×8, 4×N, 8×16, or 16×8 may also be limited to cases where the second preset size is 8×8, 4×N, 8×16, or 16×8. In other words, BDOF may be prohibited from being used for one of the sizes listed above as 8×8, 4×N, 8×16, and 16×8, or for multiple of these sizes. Examples will be used below for illustrative purposes.
[0315] Example 1: The second preset size includes (or is) 8x8. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 8x8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 8x8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0316] Example 2: The second preset size includes (or is) 4 × N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 4 × N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 4 × N, with N being 8 or greater, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0317] Example 3: The second preset size includes (or is) 8×8 or 4×N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8 and 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is either 8×8 or 4×N, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0318] Example 4: The second preset size includes (or is) 8×8, 4×N, 8×16, or 16×8, where N is 8 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8, 4×N, 8×16, and 16×8. In this case, when the current size of the picture block is one of the second preset sizes, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is one of 8×8, 4×N, 8×16, and 16×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0319] Example 5: The second preset size includes (or is) N×8, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size N×8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0320] Example 6: The second preset size includes (or is) N×8 or 4×N, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes N×8 or 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8 or 4×N, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0321] Furthermore, in some scenarios, the use of BDOF is prohibited even for size M × 4. Therefore, in this application, when the use of BDOF is prohibited for a second preset size, BDOF may also be prohibited for use for size M × 4, provided that M is an integer greater than or equal to 4.
[0322] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0323] According to the method described above, the characteristics of current picture blocks of various sizes are fully considered when BDOF technology is used. When the size of the current picture block is a second preset size, the predicted sample value of the current picture block is determined according to a technology other than BDOF technology. This significantly reduces coding complexity and improves coding efficiency.
[0324] In one of the optional solutions, in the process of obtaining the predicted sample value of the current picture block through prediction using a first processing method, based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, the interpretation unit specifically: Weighted calculations are performed on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list to obtain the predicted sample values for the current picture block, or According to Merge-with-Motion Vector Difference (MMVD) technology, the predicted sample value of the current picture block is obtained through prediction based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, or According to the combined inter / intra prediction CIIP technique, the predicted sample values of the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, or According to decoder-side motion vector refinement DMVR technology, the predicted sample value of the current picture block is obtained through prediction based on the reference sample corresponding to the first list and the reference sample corresponding to the second list. It is configured in this way.
[0325] In this embodiment of the application, whether a weighting calculation method, MMVD technology, or CIIP technology is specifically used may be determined by using the corresponding conditions or indicated by using the corresponding instruction information.
[0326] It should be understood that BDOF technology is equivalent to conventional patch optimization techniques for predicting the predicted sample value of a picture block. According to BDOF technology, in many scenarios, predicted sample values can be obtained that are closer to the actual sample values of the picture block. Therefore, the sample residuals obtained based on these predicted sample values are smaller, thus improving coding efficiency. Consequently, BDOF technology is typically used on the encoder side. To recover predicted sample values more accurately, BDOF technology is also used correspondingly on the decoder side. The aforementioned weighting calculation method may be considered conventional technology for obtaining predicted sample values of a picture block, and the aforementioned MMVD, CIIP, and DMVR technologies may each be considered conventional patch optimization techniques. In this embodiment of this application, when the size of the picture block is a second preset size, the predicted sample value of the picture block is determined not by BDOF technology, but by conventional technology (e.g., weighting calculation method) or other patch optimization techniques (e.g., MMVD, CIIP, or DMVR). This can significantly reduce the complexity of decoding and improve decoding efficiency.
[0327] In one optional solution, the interpretation unit is further configured to perform a bidirectional optical flow BDOF process on the current picture block to obtain predicted sample values for the current picture block when several preset conditions are met, the several preset conditions include at least the condition that the size of the current picture block satisfies a first preset size.
[0328] The current size of a picture block satisfies the first preset size if the current height H of the picture block is 8 or greater, and the width W is not equal to the height H when the product of the width W and height H of the picture block is equal to 64 (or is).
[0329] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0330] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0331] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0332] Alternatively, the current picture block size satisfying the first preset size includes (or is) the current picture block height H being greater than 8.
[0333] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0334] The reconstruction unit is further configured to reconstruct the current picture block based on at least the predicted sample values of the current picture block.
[0335] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0336] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0337] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0338] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0339] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0340] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0341] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0342] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0343] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0344] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0345] Condition I: The current picture block size is the first preset size.
[0346] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0347] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0348] In one of the optional solutions, the syntax element includes an index of target candidate motion information (e.g., merge_idx[xCb][yCb]), the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indicator information (e.g., predFlagL0=1 and predFlagL1=1), the prediction direction indicator information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to a first list (i.e., list0) and a second motion vector corresponding to a second list (i.e., list1), the reference frame index includes an index of the first reference frame corresponding to the first list (e.g., refIdxL0) and an index of the second reference frame corresponding to the second list (e.g., refIdxL1).
[0349] In this embodiment of this application, a reference frame index is used to identify a reference picture corresponding to a motion vector used (e.g., a first motion vector or a second motion vector) within a specified list of reference pictures (a first list, list0, or a second list, list1). A picture may be referred to as a frame, and a reference picture may be referred to as a reference frame.
[0350] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0351] In one optional solution, the syntax elements include a first index, a second index, prediction direction information, and a motion vector difference MVD, where the first index (e.g., mvp_lX_flag[xCb][yCb]) is used to point to a target candidate motion vector predictor, which includes a first motion vector predictor corresponding to a first list (e.g., list0) and a second motion vector predictor corresponding to a second list (e.g., list1), and the motion vector difference MVD includes a first MVD corresponding to the first list and / or a second MVD corresponding to the second list (optionally, when MMVD technology is used, only one MVD may be transmitted, and an MVD in the other direction that needs to be used by the decoder side may be derived based on the transmitted MVD). The second index (also called the reference frame index) is used to point to the reference frame of the current picture block, which includes a first reference frame corresponding to the first list and a second reference frame corresponding to the second list. For example, the second index is refIdxL0 and refIdxL1, where refIdxL0 is the index of the first reference frame corresponding to the first list, and refIdxL1 is the index of the second reference frame corresponding to the second list. Prediction direction indicators (e.g., predFlagL0=1 and predFlagL1=1) are used to indicate that bidirectional prediction is applied.
[0352] The first motion vector (e.g., Mv0_L0) corresponding to the first list is obtained based on the first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list and the first MVD (e.g., MVD0) corresponding to the first list. For example, Mv0_L0 = Mvp0_L0 + MVD0.
[0353] The second motion vector (e.g., Mv1_L1) corresponding to the second list is obtained based on the second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list and the second MVD (e.g., MVD1) corresponding to the second list. For example, Mv1_L1 = Mvp1_L1 + MVD1.
[0354] In the field of video coding, interpretation modes include forward prediction, backward prediction, and bidirectional prediction (including forward and backward prediction), and the specific prediction mode used on the encoder side is usually indicated by prediction direction information. For example, prediction direction information may include syntax elements predFlagL0 and predFlagL1. When predFlagL0=1 and predFlagL1=1, the prediction direction information indicates that bidirectional prediction is applied. When predFlagL0=1 and predFlagL1=0, the prediction direction information indicates that forward prediction is used. When predFlagL0=0 and predFlagL1=1, the prediction direction information indicates that backward prediction is used. It can be understood that “forward” and “backward” correspond to the current picture's reference picture list 0 (list0, i.e., the first list mentioned above) and reference picture list 1 (list1, i.e., the second list mentioned above), respectively.
[0355] In one optional solution, the entropy decoding unit is configured to analyze the bitstream to obtain sample residuals and syntax elements, and the reconstruction unit is configured to determine the sample value of the current picture block based on the sample residuals and the predicted sample value of the current picture block.
[0356] According to the tenth aspect, one embodiment of this application provides an interpretation device (e.g., an interpretation unit), which is: Currently, a determination unit is configured to determine whether a picture block satisfies multiple preset conditions, An interpredictive processing unit is configured to perform bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) processing on the current picture block to obtain predicted sample values of the current picture block when the above multiple preset conditions are satisfied, wherein the above multiple preset conditions include at least the condition that the size of the current picture block satisfies a first preset size. The size of the current picture block is usually expressed by width and height (abbreviated as W×H), and the width and height are measured by samples (samples or pixels). For example, if the size of the current picture block is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the size of the current picture block is 8×16, the 8 indicates that the width of the current picture block is 8 samples, and the 16 indicates that the height of the current picture block is 16 samples.
[0357] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0358] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0359] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0360] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0361] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0362] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0363] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0364] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0365] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0366] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0367] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0368] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0369] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0370] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0371] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0372] Condition I: The current picture block size is the first preset size.
[0373] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0374] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0375] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block. Certainly, the current picture block here may instead be understood as the picture block being processed. For example, in the decoding process, the current picture block is the decoding block.
[0376] In one optional solution, the interpretation processing unit is further configured to skip performing bidirectional optical flow (BDOF, abbreviated as BIO or BDOF) processing on the picture block if at least one of the above preset conditions is not satisfied.
[0377] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0378] It should be understood that the method in this embodiment of this application can be performed by a video encoder or an electronic device having video encoding capabilities, or by a video decoder or an electronic device having video decoding capabilities. For example, the method can be specifically performed by an interpretation unit within these devices.
[0379] Specifically, the conditions for enabling or using BDOF technology in this solution differ from those in conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the original sample values, and to appropriately control the complexity of coding. This balances the complexity of encoding / decoding with prediction accuracy to some extent, thereby improving coding efficiency.
[0380] According to the eleventh aspect, one embodiment of this application provides a video data decoding device, said device A memory configured to store video data in bitstream format, A video decoder configured to decode a bitstream to obtain a syntax element, the syntax element being used to indicate that bidirectional prediction is applied, and to perform bidirectional optical flow BDOF processing on the current picture block to obtain predicted sample values of the current picture block when several preset conditions are satisfied, wherein the above several preset conditions include at least the condition that the size of the current picture block satisfies a first preset size, Includes.
[0381] For the current picture block size to satisfy the first preset size, the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0382] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0383] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0384] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0385] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0386] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0387] According to the twelfth aspect, one embodiment of this application provides a video data encoding device, said device Memory configured to store video data, where the video data includes one or more picture blocks, A video encoder configured to perform a bidirectional optical flow BDOF process on the current picture block to obtain predicted sample values of the current picture block when several preset conditions are met, wherein the several preset conditions include at least the condition that the size of the current picture block satisfies a first preset size. Includes.
[0388] For the current picture block size to satisfy the first preset size, the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0389] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, and the current width W of the picture block being 8 or greater.
[0390] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0391] Alternatively, the current size of the picture block satisfying the first preset size includes the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 128.
[0392] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0393] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0394] The video encoder is further configured to encode a syntax element into the target bitstream, and the syntax element is used to indicate, at a minimum, that bidirectional prediction is applied.
[0395] According to the 13th aspect, one embodiment of the present application provides an encoding device including coupled non-volatile memory and a processor. The processor invokes program code stored in the memory to perform some or all of the steps of any of the methods in the first aspect.
[0396] According to the 14th aspect, one embodiment of the present application provides a decoding device including coupled non-volatile memory and a processor. The processor invokes program code stored in the memory to perform some or all of the steps of any of the methods in the third aspect.
[0397] According to the 15th aspect, one embodiment of the present application provides a computer-readable storage medium that stores program code, the program code including instructions used to perform some or all of the steps of any of the methods in the first aspect.
[0398] According to the sixteenth aspect, one embodiment of this application provides a computer program product. When the computer program product is executed on a computer, the computer is enabled to perform some or all of the steps of any of the methods in the first aspect.
[0399] It should be understood that the technical solutions in the second to sixteenth aspects of this application are consistent with the technical solution in the first aspect of this application, and the beneficial effects achieved by these aspects and their corresponding feasible implementations are similar. Further details will not be explained again. [Brief explanation of the drawing]
[0400] To further clarify the technical solutions in the embodiments or background of this application, the accompanying drawings illustrating the embodiments or background of this application are described below. [Figure 1A] This is a block diagram of an example of a video encoding and decoding system 10 implementing one embodiment of this application. [Figure 1B] This is a block diagram of an example of a video coding system 40 that implements one embodiment of this application. [Figure 2] This is a block diagram of one example configuration of an encoder 20 implementing one embodiment of this application. [Figure 3] This is a block diagram of one example configuration of a decoder 30 implementing one embodiment of this application. [Figure 4] This is a block diagram of an example of a video coding device 400 that implements one embodiment of this application. [Figure 5] This is a block diagram of another example of an encoding or decoding device 10 implementing one embodiment of this application. [Figure 5A] This is a schematic diagram of motion information for the current picture block and reference block according to one embodiment of this application. [Figure 5B] This is a schematic diagram of an interpretation scenario according to one embodiment of this application. [Figure 5C] This is a schematic diagram of an interconnected block scenario according to one embodiment of this application. [Figure 6A] This is a schematic flowchart of an encoding method according to one embodiment of this application. [Figure 6B] This is a schematic diagram of a forward-referenced picture and a back-referenced picture implementing one embodiment of this application. [Figure 6C] This is a schematic diagram of a motion vector refinement process that implements one embodiment of this application. [Figure 6D] This is a schematic diagram illustrating a scenario of a padding-based extension method according to one embodiment of this application. [Figure 7] This is a schematic flowchart of a decoding method according to one embodiment of this application. [Figure 8] This is a schematic diagram of an interpretation prediction device according to one embodiment of this application. [Modes for carrying out the invention]
[0401] Embodiments of this application will be described below with reference to the accompanying drawings. The following description will refer to the accompanying drawings, which form part of this disclosure and illustrate specific aspects of the embodiments of this application or specific aspects in which the embodiments of this application may be used. It should be understood that embodiments of this application may be used in other aspects and may include structural or logical modifications not depicted in the accompanying drawings. Accordingly, the following detailed description should not be constrained to mean limitingly, and the scope of this application is defined by the accompanying claims. For example, it should be understood that what is disclosed in conjunction with a described method may also apply to a corresponding apparatus or system configured to perform that method, and vice versa. For example, if one or more specific method steps are described, the corresponding apparatus may include one or more units, such as functional units, for performing the described method steps, even if such one or more units are not explicitly described or shown in the accompanying drawings (e.g., one unit that performs the one or more steps, or multiple units, each performing one or more of those steps). Furthermore, if a particular device is described based on one or more units, such as a functional unit, the corresponding method may include one step used to perform the function of the one or more units (e.g., one step to perform the function of the one or more units, or multiple steps, each used to perform the function of one or more of the multiple units), even if such one or more steps are not explicitly described or shown in the accompanying drawings. Moreover, it should be understood that the various embodiments and / or features of the aspects described in this specification may be combined with each other unless specifically stated otherwise.
[0402] The technical solutions in the embodiments of this application may be applied not only to existing video coding standards (e.g., standards such as H.264 and HEVC) but also to future video coding standards (e.g., the H.266 standard). The terminology used in the implementation of this application is intended solely to describe specific embodiments of this application and is not intended to limit this application. First, the concepts related to the embodiments of this application will be briefly described below.
[0403] Video coding typically refers to processing a series of pictures that constitute a video or video sequence. In the field of video coding, the terms “picture,” “frame,” and “image” may be used synonymously. As used in this specification, video coding includes video encoding and video decoding. Video encoding is performed on the source side and typically involves processing the original video pictures (e.g., by compression) to reduce the amount of data representing the video pictures for more efficient storage and / or transmission. Video decoding is performed on the destination side and typically involves the reverse processing of the encoder to reconstruct the video pictures. In embodiments, “coding” of video pictures should be understood as “encoding” or “decoding” of a video sequence. The combination of the encoding and decoding parts is also referred to as coding (encoding and decoding).
[0404] A video sequence consists of a series of pictures, each of which is further divided into slices, and each slice into blocks. Video coding is performed using these blocks. Some newer video coding standards further extend the concept of a “block.” For example, macroblocks (MBs) are introduced in the H.264 standard. Macroblocks can be further divided into multiple predictive blocks (partitions) that can be used for predictive coding. High-efficiency video coding (HEVC) standards use basic concepts such as “coding units” (CUs), “prediction units” (PUs), and “transform units” (TUs). Multiple block units are obtained through functional partitioning and described using a new tree-based structure. For example, a CU can be divided into smaller CUs based on a quadtree, and these smaller CUs can be further divided to generate a quadtree structure. A CU is the basic unit for partitioning and encoding the picture to be coded. PU and TU have a similar tree structure. A PU can correspond to a prediction block and is the basic unit for prediction coding. A CU can be further divided into multiple PUs in a certain partitioning mode. A TU can correspond to a transformation block and is the basic unit used to transform prediction residuals. However, in practice, CU, PU, and TU are all conceptually blocks (or picture blocks).
[0405] For example, in HEVC, a CTU is divided into multiple CUs by using a quadtree structure represented as a coding tree. The decision of whether to encode the picture region through interpicture (time) prediction or intrapicture (spatial) prediction is made at the CU level. Each CU can further be divided into one, two, or four PUs based on the PU partitioning type. Within a single PU, the same prediction process is applied, and the relevant information is transmitted to the decoder on a PU basis. After obtaining residual blocks by applying the prediction process based on the PU partitioning type, the CU can be divided into transform units (TUs) based on another quadtree structure similar to the coding tree used for the CU. In recent developments of video compression technology, quadtree plus binary tree (QTBT) partition frames are used to partition coding blocks. In a QTBT block structure, a CU can be square or rectangular.
[0406] In this specification, for the sake of clarity and ease of understanding, the picture block being processed within the current picture may be referred to as the current block or the picture block being processed. For example, in encoding, the picture block is the block being encoded, and in decoding, the picture block is the block being decoded. The decoded picture block within the reference picture used to predict the current block is referred to as the reference block. Specifically, the reference block is the block that provides a reference signal to the current block, and the reference signal represents the sampled value within the picture block. The block within the reference picture that provides a prediction signal to the current block may be referred to as the prediction block. The prediction signal represents the pixel value, sampled value, or sampled signal within the prediction block. For example, after considering several reference blocks, the optimal reference block is found. That optimal reference block provides a prediction to the current block, and that block is referred to as the prediction block.
[0407] In lossless video coding, the original video picture can be reconstructed. Specifically, (assuming no transmission loss or other data loss occurs during storage or transmission), the reconstructed video picture will have the same quality as the original video picture. In lossy video coding, further compression is performed, for example through quantization, to reduce the amount of data required to represent the video picture, and the decoder cannot completely reconstruct the video picture. Specifically, the quality of the reconstructed video picture will be lower or inferior to the quality of the original video picture.
[0408] Some H.261 video coding standards concern “lossy hybrid video coding” (specifically, where spatial and temporal predictions in the sample domain are combined with 2D transform coding to apply quantization in the transform domain). Each picture in a video sequence is typically divided into a pair of non-overlapping blocks, and coding is typically performed at the block level. Specifically, on the encoder side, the video is typically processed, i.e., encoded, at the block (video block) level. For example, predicted blocks are generated through spatial (intra-picture) and temporal (inter-picture) predictions, and these predicted blocks are subtracted from the current block (the block being processed or being processed) to obtain a residual block, which is then transformed and quantized in the transform domain to reduce the amount of data that will be transmitted (compressed). On the decoder side, the reverse processing part applied to the encoder is applied to the encoded or compressed block to reconstruct the current block for representation. Furthermore, the encoder replicates the decoder processing loop so that the encoder and decoder produce the same predictions (e.g., intra-predictions and inter-predictions) and / or reconstructions in order to process, i.e., encode, subsequent blocks.
[0409] The following describes a system architecture to which embodiments of this application apply. Figure 1A is a schematic block diagram of an example of a video encoding and decoding system 10 to which embodiments of this application apply. As shown in Figure 1A, the video encoding and decoding system 10 may include a source device 12 and a destination device 14. The source device 12 generates encoded video data, and therefore the source device 12 may be referred to as a video encoding device. The destination device 14 can decode the encoded video data generated by the source device 12, and therefore the destination device 14 may be referred to as a video decoding device. In various implementation solutions, the source device 12, the destination device 14, or both the source device 12 and the destination device 14 may include one or more processors and memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other medium that can be used to store desired program code in the form of computer-accessible instructions or data structures, as described in this specification. The source device 12 and destination device 14 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smartphones," televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, wireless communication devices, or similar devices.
[0410] Although Figure 1A depicts the source device 12 and the destination device 14 as separate devices, the device embodiment may instead include the functions of both the source device 12 and the destination device 14, or the functions of both the source device 12 and the destination device 14, i.e., the source device 12 or its corresponding function and the destination device 14 or its corresponding function. In such an embodiment, the source device 12 or its corresponding function and the destination device 14 or its corresponding function may be implemented using the same hardware and / or software, separate hardware and / or software, or any combination thereof.
[0411] A communication connection between the source device 12 and the destination device 14 may be implemented via link 13. The destination device 14 may receive encoded video data from the source device 12 via link 13. Link 13 may include one or more media or devices that can move the encoded video data from the source device 12 to the destination device 14. In one example, link 13 may include one or more communication media that enable the source device 12 to directly transmit encoded video data to the destination device 14 in real time. In this example, the source device 12 can modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol) and transmit the modulated video data to the destination device 14. The one or more communication media may include wireless communication media and / or wired communication media, such as a radio frequency (RF) spectrum or one or more physical transmission cables. The one or more communication media may be part of a packet-based network, which is, for example, a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media mentioned above may include a router, switch, base station, or other device that facilitates communication from the source device 12 to the destination device 14.
[0412] The source device 12 includes an encoder 20. Optionally, the source device 12 may further include a picture source 16, a picture preprocessor 18, and a communication interface 22. In a particular implementation, the encoder 20, picture source 16, picture preprocessor 18, and communication interface 22 may be hardware components within the source device 12, or they may be software programs within the source device 12. Descriptions of these are provided separately below.
[0413] The picture source 16 may include, or may be, any type of device that generates pictures or comments (for screen content encoding, where some text on the screen is also considered part of the picture or image to be encoded), such as any type of picture capture device configured to capture real-world pictures, and / or a computer graphics processor configured to generate computer-animated pictures, for example; or any type of device configured to acquire and / or provide real-world pictures or computer-animated pictures (e.g., screen content or virtual reality (VR) pictures) and / or any combination thereof (e.g., augmented reality (AR) pictures). The picture source 16 may also be a camera configured to capture pictures or a memory configured to store pictures. The picture source 16 may further include any type of (internal or external) interface through which previously captured or generated pictures are stored and / or through which pictures are acquired or received. If the picture source 16 is a camera, the picture source 16 may be, for example, a local camera or an integrated camera integrated into the source device. If the picture source 16 is memory, the picture source 16 may be local memory or, for example, integrated memory integrated into the source device. If the picture source 16 includes an interface, the interface may be, for example, an external interface for receiving pictures from an external video source. The external video source may be, for example, a camera, external memory, or an external picture capturing device such as an external picture generation device. The external picture generation device may be, for example, an external computer graphics processor, a computer, or a server. The interface may be any type of interface, such as a wired or wireless interface or an optical interface, according to some proprietary or standardized interface protocol.
[0414] A picture can be considered a two-dimensional array or matrix of picture elements. Picture elements within an array may also be referred to as samples. The number of samples in the horizontal and vertical (or axis) directions of the array or picture determines the size and / or resolution of the picture. For color representation, typically three color components are employed; specifically, a picture can be represented as, or contain, three sample arrays. For example, in the RGB format or color space, a picture contains corresponding red, green, and blue sample arrays. However, in video coding, each sample is typically represented in a luminance / chrominance format or color space. For example, a picture in the YUV format contains a luminance component indicated by Y (sometimes indicated by L instead) and two chrominance components indicated by U and V. The luminance (luma) component Y represents brightness or gray level intensity (for example, both are the same in a grayscale picture), and the two chrominance (chroma) components U and V represent chromaticity or color information components. Correspondingly, a picture in YUV format includes a luminance sample array of luminance sample values (Y) and two chrominance sample arrays of chrominance values (U and V). A picture in RGB format may be transformed or converted to YUV format, and vice versa. This process is also called color conversion or transformation. If a picture is monochrome, it may contain only luminance sample arrays. In this embodiment of this application, the picture sent to the picture processor by the picture source 16 may also be referred to as raw picture data 17.
[0415] The picture preprocessor 18 is configured to receive raw picture data 17 and perform preprocessing on the raw picture data 17 to obtain a preprocessed picture 19 or preprocessed picture data 19. For example, the preprocessing performed by the picture preprocessor 18 may include cropping, color format conversion (e.g., from RGB format to YUV format), color correction, or noise reduction.
[0416] The encoder 20 (also referred to as the video encoder 20) is configured to receive preprocessed picture data 19 and process the preprocessed picture data 19 in an associated prediction mode (for example, the prediction mode in the embodiments of this specification) to provide encoded picture data 21 (details of the configuration of the encoder 20 will be further described based on Figures 2, 4, or 5). In some embodiments, the encoder 20 may be configured to perform an encoder-side application of the chromablock prediction method described in this application by performing various embodiments described below.
[0417] The communication interface 22 may be configured to receive encoded picture data 21 and transmit the encoded picture data 21 to the destination device 14 or some other device (e.g., memory) via link 13 for storage or direct reconstruction. The other device may be any device used for decoding or storage. The communication interface 22 may be configured to encapsulate the encoded picture data 21 into a format suitable for transmission over link 13, such as a data packet.
[0418] The destination device 14 includes a decoder 30. Optionally, the destination device 14 may further include a communication interface 28, a picture post-processor 32, and a display device 34. Descriptions of these are provided separately below.
[0419] The communication interface 28 may be configured to receive encoded picture data 21 from the source device 12 or some other source. The other source is, for example, a storage device. The storage device is, for example, an encoded picture data storage device. The communication interface 28 may be configured to transmit or receive encoded picture data 21 via the link 13 between the source device 12 and the destination device 14, or via any type of network. The link 13 is, for example, a direct wired or wireless connection. The any type of network is, for example, a wired or wireless network or any combination thereof, or any type of private or public network or any combination thereof. The communication interface 28 may be configured, for example, to deencapsulate data packets transmitted via the communication interface 22 to obtain encoded picture data 21.
[0420] Both communication interface 28 and communication interface 22 can be configured as one-way or two-way communication interfaces, and may be configured, for example, to send and receive messages to establish a connection, and to confirm and exchange any other information relating to the communication link and / or data transmission, such as encoded picture data transmission.
[0421] The decoder 30 is configured to receive encoded picture data 21 and provide decoded picture data 31 or decoded picture 31 (details of the decoder 30 configuration will be further described below based on Figures 3, 4, or 5). In some embodiments, the decoder 30 may be configured to perform various embodiments described below to implement a decoder-side application of the chromablock prediction method described in this application.
[0422] The picture post-processor 32 is configured to post-process the decoded picture data 31 (also referred to as reconstructed picture data) to obtain post-processed picture data 33. The post-processing performed by the picture post-processor 32 may include color format conversion (e.g., from YUV format to RGB format), color correction, cropping, resampling, or any other processing. The picture post-processor 32 may further be configured to transmit the post-processed picture data 33 to the display device 34.
[0423] The display device 34 is configured to receive the post-processed picture data 33 and display the picture to, for example, a user or viewer. The display device 34 can be, or may include, any type of display for presenting the reconstructed picture, such as an integrated or external display or monitor. For example, the display may include a liquid crystal display (LCD), an organic light-emitting diode (OLED) display, a plasma display, a projector, a microLED display, a liquid crystal on silicon (LCoS), a digital light processor (DLP), or any other type of display.
[0424] Although Figure 1A depicts the source device 12 and the destination device 14 as separate devices, the device embodiment may instead include the functions of both the source device 12 and the destination device 14, or the functions of both the source device 12 and the destination device 14, i.e., the source device 12 or its corresponding function and the destination device 14 or its corresponding function. In such an embodiment, the source device 12 or its corresponding function and the destination device 14 or its corresponding function may be implemented using the same hardware and / or software, separate hardware and / or software, or any combination thereof.
[0425] As will become apparent to those skilled in the art based on these descriptions, the presence of different units or functions and the (strict) functional division of the source device 12 and / or destination device 14 shown in Figure 1A may vary depending on the actual device and application. The source device 12 and destination device 14 may include any of a wide range of devices, including any type of handheld or fixed device, such as a notebook or laptop computer, mobile phone, smartphone, tablet or tablet computer, video camera, desktop computer, set-top box, television, camera, in-vehicle device, display device, digital media player, video game console, video streaming device (e.g., content service server or content distribution server), broadcast receiver device, or broadcast transmitter device, and may or may not use any type of operating system.
[0426] The encoder 20 and decoder 30 may each be implemented as one of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. Where the technology is partially implemented using software, the device may store software instructions in a suitable non-temporary computer-readable storage medium and execute the technology of this disclosure by using hardware, such as one or more processors, to execute these instructions. Any of the foregoing (including hardware, software, combinations of hardware and software, and similar) may be considered as one or more processors.
[0427] In some cases, the video encoding and decoding system 10 shown in Figure 1A is merely an example, and the technology of this application may be applied to video coding configurations (e.g., video encoding or video decoding) that do not necessarily involve any data communication between the encoding device and the decoding device. In other examples, data may be retrieved from local memory, streamed over a network, etc. The video encoding device can encode the data and store the data in memory, and / or the video decoding device can retrieve the data from memory and decode the data. In some examples, devices that encode the data and store the data in memory and / or retrieve the data from memory and decode the data, without communicating with each other, perform the encoding and / or decoding.
[0428] Figure 1B is an explanatory diagram of an example of a video coding system 40, including the encoder 20 of Figure 2 and / or the decoder 30 of Figure 3, according to one embodiment. The video coding system 40 can implement various combinations of technologies in the embodiments of this application. In the illustrated implementation, the video coding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and / or a video encoder / decoder implemented by the logic circuit 47 of the processing circuit 46), an antenna 42, one or more processors 43, one or more memories 44, and / or a display device 45.
[0429] As shown in Figure 1B, the imaging device 41, antenna 42, processing circuit 46, logic circuit 47, encoder 20, decoder 30, processor 43, memory 44, and / or display device 45 can communicate with each other. As described, the video coding system 40 is shown having an encoder 20 and a decoder 30, but in different examples, the video coding system 40 may include only the encoder 20 or only the decoder 30.
[0430] In some examples, the antenna 42 may be configured to transmit or receive an encoded bitstream of video data. Furthermore, in some examples, the display device 45 may be configured to present the video data. In some examples, the logic circuit 47 may be implemented by a processing circuit 46. The processing circuit 46 may include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, or similar. The video coding system 40 may also include an optional processor 43. The optional processor 43 may similarly include application-specific integrated circuit (ASIC) logic, a graphics processor, a general-purpose processor, or similar. In some examples, the logic circuit 47 may be implemented by hardware, such as dedicated hardware for video coding. The processor 43 may be implemented by general-purpose software, an operating system, or similar. Furthermore, memory 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM) or dynamic random access memory (DRAM)) or non-volatile memory (e.g., flash memory). In one non-limiting example, memory 44 may be implemented by cache memory. In some examples, logic circuits 47 may access memory 44 (e.g., to implement a picture buffer). In other examples, logic circuits 47 and / or processing circuits 46 may include memory (e.g., a cache) for implementing a picture buffer.
[0431] In some examples, a video encoder 20 implemented using logic circuits may include a picture buffer (implemented, for example, by a processing circuit 46 or memory 44) and a graphics processing unit (implemented, for example, by a processing circuit 46). The graphics processing unit may be communicatively coupled to the picture buffer. The graphics processing unit may include an encoder 20 implemented by a logic circuit 47 to implement various modules and / or any other encoder systems or subsystems described in this specification with reference to Figure 2. The logic circuits may be configured to perform various operations described in this specification.
[0432] In some examples, the decoder 30 may be similarly implemented by logic circuits 47 to implement various modules as described with reference to the decoder 30 in Figure 3 and / or any other decoder systems or subsystems as described in this specification. In some examples, the decoder 30 implemented by logic circuits may include a picture buffer (implemented by processing circuits 46 or memory 44) and a graphics processing unit (implemented, for example, by processing circuits 46). The graphics processing unit may be communicatively coupled to the picture buffer. The graphics processing unit may include the decoder 30 implemented by logic circuits 47 to implement various modules as described with reference to Figure 3 and / or any other decoder systems or subsystems as described in this specification.
[0433] In some examples, antenna 42 may be configured to receive an encoded bitstream of video data. As described, the encoded bitstream may include data related to video frame encoding and described in this specification, such as data related to coding partitions (e.g., conversion coefficients or quantized conversion coefficients, optional indicators (described), and / or data defining coding partitions), indicators, index values, mode selection data, or similar. The video coding system 40 may further include a decoder 30 coupled to antenna 42 and configured to decode the encoded bitstream. A display device 45 is configured to present video frames.
[0434] It should be understood that, in this embodiment of this application, with respect to the example described with reference to encoder 20, decoder 30 may be configured to perform the reverse process. With respect to signaling syntax elements, decoder 30 may be configured to receive and parse such syntax elements and, in correspondence, decode the relevant video data. In some examples, encoder 20 may entropically encode the syntax elements into an encoded video bitstream. In such examples, decoder 30 may parse the syntax elements and, in correspondence, decode the relevant video data.
[0435] The video picture encoding method described in this embodiment is performed on the encoder 20, and the video picture decoding method described in this embodiment is performed on the decoder 30. The encoder 20 and decoder 30 in this embodiment may be, for example, encoders / decoders that support video standard protocols such as H.263, H.264, HEVC, MPEG-2, MPEG-4, VP8, or VP9, or next-generation video standard protocols (e.g., H.266).
[0436] Figure 2 is a schematic / conceptual block diagram of an example of an encoder 20 configured to implement one embodiment of this application. In the example of Figure 2, the encoder 20 includes a residual calculation unit 204, a transformation unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transformation unit 212, a reconstruction unit 214, a buffer 216, a loop filter 220, a decoded picture buffer (DPB) 230, a prediction unit 260, and an entropy coding unit 270. The prediction unit 260 may include an inter-prediction unit 244, an intra-prediction unit 254, and a mode selection unit 262. The inter-prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown in the figure). The encoder 20 shown in Figure 2 may also be referred to as a hybrid video encoder or a video encoder based on a hybrid video codec.
[0437] For example, the residual calculation unit 204, the transformation processing unit 206, the quantization unit 208, the prediction processing unit 260, and the entropy coding unit 270 form the forward signal path of the encoder 20, while, for example, the inverse quantization unit 210, the inverse transformation processing unit 212, the reconstruction unit 214, the buffer 216, the loop filter 220, the decoded picture buffer (DPB) 230, and the prediction processing unit 260 form the inverted signal path of the encoder. The inverted signal path of the encoder corresponds to the signal path of the decoder (see decoder 30 in Figure 3).
[0438] The encoder 20 receives, for example, via input 202, a picture 201 or a picture block 203 of picture 201, such as a picture within a series of pictures forming a video or video sequence. Picture block 203 may also be called the current picture block or the picture block to be encoded, and picture 201 may also be called the current picture or the picture to be encoded (particularly in video coding to distinguish the current picture from other pictures, such as previously encoded and / or decoded pictures within the same video sequence, i.e., the video sequence that also contains the current picture).
[0439] One embodiment of the encoder 20 may include a splitting unit (not shown in Figure 2) configured to divide a picture 201 into multiple blocks, such as picture blocks 203. The picture 201 is typically divided into multiple non-overlapping blocks. The splitting unit may be configured to use the same block size and corresponding grid that defines the block size for all pictures in the video sequence, or it may vary the block size between pictures, subsets, or groups of pictures to divide each picture into a corresponding block.
[0440] In one example, the predictive processing unit 260 of the encoder 20 may be configured to perform any combination of the division techniques described above.
[0441] Although the size of picture block 203 is smaller than the size of picture 201, like picture 201, picture block 203 is, or can be considered, a two-dimensional array or matrix of samples with sample values. In other words, picture block 203 may include, for example, one sample array (e.g., a luminar array in the case of monochrome picture 201), three sample arrays (e.g., one luminar array and two chromar arrays in the case of a color picture), or any other number and / or type of arrays depending on the applied color format. The number of samples in the horizontal and vertical (or axis) directions of picture block 203 determines the size of picture block 203.
[0442] The encoder 20 shown in Figure 2 is configured to encode the picture 201 block by block, and is configured, for example, to perform encoding and prediction for each picture block 203.
[0443] The residual calculation unit 204 is configured to calculate the residual block 205 based on the picture block 203 and the prediction block 265 (further details about the prediction block 265 will be provided later), and is configured to obtain the residual block 205 in the sample domain by, for example, subtracting the sample value of the prediction block 265 from the sample value of the picture block 203 for each sample (for each pixel).
[0444] The transformation processing unit 206 is configured to obtain transformation coefficients 207 in the transformation domain by applying a transformation such as a discrete cosine transform (DCT) or a discrete sine transform (DST) to the sample values of the residual block 205. The transformation coefficients 207 are sometimes called transformation residual coefficients and represent the residual block 205 in the transformation domain.
[0445] The conversion processing unit 206 may be configured to apply an integer approximation of DCT / DST, such as the conversion specified in HEVC / H.265. Compared to the orthogonal DCT conversion, such an integer approximation is typically scaled based on a certain factor. An additional scale factor is applied as part of the conversion process to preserve the norm of the residual blocks processed by the forward and inverse conversions. The scale factor is typically selected based on several constraints, such as the scale factor being a power of 2 for shift operations, the bit depth of the conversion coefficients, or a trade-off between precision and implementation cost. For example, a specific scale factor may be specified for the inverse conversion by, for example, the inverse conversion processing unit 212 on the decoder 30 side (and the corresponding inverse conversion by, for example, the inverse conversion processing unit 212 on the encoder 20 side), and correspondingly, a corresponding scale factor may be specified for the forward conversion by the conversion processing unit 206 on the encoder 20 side.
[0446] The quantization unit 208 is configured to quantize the transformation coefficients 207 to obtain quantized transformation coefficients 209, for example by applying scalar quantization or vector quantization. The quantized transformation coefficients 209 are sometimes called quantized residual coefficients 209. The quantization process can reduce the bit depth of some or all of the transformation coefficients 207. For example, if n is greater than m, an n-bit transformation coefficient may be truncated to an m-bit transformation coefficient during quantization. The degree of quantization can be changed by adjusting the quantization parameter (QP). For example, in scalar quantization, several different scales can be applied to achieve finer or coarser quantization. Smaller quantization step sizes correspond to finer quantization, and larger quantization step sizes correspond to coarser quantization. The quantization parameter (QP) can indicate an appropriate quantization step size. For example, the quantization parameter can be an index to a given set of appropriate quantization step sizes. For example, smaller quantization parameters can correspond to finer quantization (smaller quantization step sizes), and larger quantization parameters can correspond to coarser quantization (larger quantization step sizes), and vice versa. Quantization may include division by the quantization step size and the corresponding quantization or inverse quantization performed by, for example, the inverse quantization unit 210, or it may include multiplication by the quantization step size. In some standard-compliant embodiments, such as HEVC, the quantization step size can be determined using the quantization parameter. Generally, the quantization step size can be calculated based on the quantization parameter by using a fixed-point approximation of the equation involving division. Further scale factors may be introduced into quantization and dequantization to restore the norm of the residual block, and the norm of the residual block may be modified for the scale used in the fixed-point approximation of the equation relating to the quantization step size and quantization parameter. In one implementation example, the scale of the inverse transform may be coupled with the scale of the dequantization.Alternatively, a customized quantization table may be used and signaled from the encoder to the decoder, for example, within the bitstream. Quantization is a lossy operation, and larger quantization steps result in greater losses.
[0447] The inverse quantization unit 210 is configured to apply the inverse quantization of the quantization unit 208 to the quantized coefficients to obtain the dequantized coefficients 211, for example, by applying the inverse of the quantization scheme applied by the quantization unit 208, based on or using the same quantization step size as the quantization unit 208. The dequantized coefficients 211 are sometimes called the dequantized residual coefficients 211 and may correspond to the conversion coefficients 207, although the dequantized coefficients 211 are usually different from the conversion coefficients due to losses caused by quantization.
[0448] The inverse transform processing unit 212 is configured to obtain the inverse transform block 213 in the sample domain by applying the inverse transform of the transform applied by the transform processing unit 206, such as the inverse discrete cosine transform (DCT) or the inverse discrete sine transform (DST). The inverse transform block 213 is sometimes called the inverse transform dequantization block 213 or the inverse transform residual block 213.
[0449] The reconstruction unit 214 (for example, the adder 214) is configured to add the inverse transform block 213 (i.e., the reconstruction residual block 213) to the prediction block 265 by adding the sample values of the reconstruction residual block 213 and the sample values of the prediction block 265, thereby obtaining the reconstruction block 215 in the sample domain.
[0450] Optionally, a buffer unit 216 (abbreviated as "buffer" 216) of, for example, a line buffer 216 is configured to buffer or store the reconstructed block 215 and the corresponding sample values, for example, for intra-prediction. In other embodiments, the encoder may be configured to use the unfiltered reconstructed block and / or corresponding sample values stored in the buffer unit 216 for some type of estimation and / or prediction, such as intra-prediction.
[0451] For example, in one embodiment, the encoder 20 may be configured such that a buffer unit 216 stores a reconstructed block 215, which is used not only for the intra-prediction 254 but also for a unit in the loop filter unit 220 (not shown in Figure 2), and / or such that the buffer unit 216 and the decoded picture buffer 230 form a single buffer. In another embodiment, a block or sample (not shown in Figure 2) from the filtered block 221 and / or the decoded picture buffer 230 is used as input or basis for the intra-prediction unit 254.
[0452] The loop filter unit 220 (abbreviated as “loop filter” 220) is configured to filter the reconstructed block 215 to smooth sample transitions or improve image quality, thereby obtaining a filtered block 221. The loop filter unit 220 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters such as a bilateral filter, an adaptive loop filter (ALF), a sharpening or smoothing filter, or a co-filter. In Figure 2, the loop filter unit 220 is shown as an in-loop filter, but in other implementations, the loop filter unit 220 may be implemented as a post-loop filter. The filtered block 221 is sometimes called a filtered reconstructed block 221. After the loop filter unit 220 has performed the filtering process on the reconstructed encoded block, the decoded picture buffer 230 may store the reconstructed encoded block.
[0453] In one embodiment, the encoder 20 (correspondingly, the loop filter unit 220) may be configured to output loop filter parameters (e.g., sample adaptive offset information) either directly or after entropy coding performed by the entropy coding unit 270 or some other entropy coding unit, so that the decoder 30 can receive and apply the same loop filter parameters to decoding.
[0454] The decoded picture buffer (DPB) 230 may be a reference picture memory for storing reference picture data for use in video data encoding by the encoder 20. The DPB 230 may include any of a variety of memory devices, such as dynamic random access memory (DRAM) (including synchronous DRAM (SDRAM), magnetoresistive RAM (MRAM), or resistive RAM (RRAM)), or other types of memory devices. The DPB 230 and buffer 216 may be provided by the same memory device or by separate memory devices. In one example, the decoded picture buffer (DPB) 230 is configured to store filtered blocks 221. The decoded picture buffer 230 may also be configured to store other pre-filtered blocks, such as a pre-reconstructed and filtered block 221, of the same current picture or of a different picture, such as a pre-reconstructed picture, and may also provide a fully pre-reconstructed, i.e., decoded picture (and corresponding reference blocks and samples) and / or a partially reconstructed current picture (and corresponding reference blocks and samples), for example, interpretation. In one example, if the reconstructed block 215 is reconstructed without in-loop filtering, the decoded picture buffer (DPB) 230 is configured to store the reconstructed block 215.
[0455] The prediction processing unit 260, also referred to as the block prediction processing unit 260, is configured to receive or acquire picture block 203 (the current picture block 203 of the current picture 201) and reconstructed picture data such as reference sample of the same (current) picture from buffer 216 and / or reference picture data 231 of one or more preceding decoded pictures from the decoded picture buffer 230, and to process such data for prediction, specifically to provide a prediction block 265 which may be an inter-prediction block 245 or an intra-prediction block 255.
[0456] The mode selection unit 262 may be configured to select a prediction mode (e.g., intra-prediction mode or inter-prediction mode) and / or a corresponding prediction block 245 or 255 to be used as the prediction block 265 for the calculation of the residual block 205 and the reconstruction of the reconstruction block 215.
[0457] In one embodiment, the mode selection unit 262 may be configured to select a prediction mode (for example, from prediction modes supported by the prediction processing unit 260) that provides the best match or in other words the smallest residual (smallest residual means better compression for transmission or storage), or the smallest signaling overhead (smallest signaling overhead means better compression for transmission or storage), or considers or balances both. The mode selection unit 262 may be configured to determine the prediction mode based on rate distortion optimization (RDO), specifically by selecting a prediction mode that provides the smallest rate distortion optimization, or by selecting a prediction mode in which the associated rate distortion satisfies at least the prediction mode selection criteria.
[0458] The following describes in detail the prediction processing (for example, performed by the prediction processing unit 260) and mode selection (for example, performed by the mode selection unit 262) performed by an example of the encoder 20.
[0459] As described above, the encoder 20 is configured to determine or select the optimal or best prediction mode from a set of (predetermined) prediction modes. The set of prediction modes may include, for example, an intra-prediction mode and / or an inter-prediction mode.
[0460] The set of intra-prediction modes may include 35 different intra-prediction modes, such as non-directional modes like DC (or average) mode and planar mode, or directional modes like those specified in H.265, or it may include 67 different intra-prediction modes, such as non-directional modes like DC (or average) mode and planar mode, or directional modes like those specified in H.266 under development.
[0461] In one possible implementation, the set of interprediction modes depends on the available reference picture (i.e., at least some decoded pictures stored in DBP230, as described above) and other interprediction parameters, for example, whether the entire reference picture is used or only a portion of the reference picture is used, for example, the search window area around the region of the current block, and / or whether sample interpolation, for example, 1 / 2 sample and / or 1 / 4 sample interpolation, is applied. The set of interprediction modes may include, for example, a skip mode and a merge mode. In a particular implementation, the set of interprediction modes may include, in embodiments of this application, a skip-based merge with motion vector difference (MMVD) mode or a merge-based MMVD mode. In one example, the intraprediction unit 254 may be configured to perform some combination of interprediction techniques described later.
[0462] In addition to the prediction mode described above, a skip mode and / or direct mode may also be applied in the embodiments of this application.
[0463] The prediction processing unit 260 may further divide the picture block 203 into smaller block partitions or subblocks by repeatedly using, for example, quad-tree (QT) partitioning, binary-tree (BT) partitioning, ternary-tree (TT) partitioning, or any combination thereof, and then perform predictions for each of the block partitions or subblocks. Mode selection includes selecting the tree structure of the picture block 203 to be divided and selecting the prediction mode to be used for each of the block partitions or subblocks.
[0464] The interpretation unit 244 may include a motion estimation (ME) unit (not shown in Figure 2) and a motion compensation (MC) unit (not shown in Figure 2). The motion estimation unit is configured to receive or acquire, for motion estimation, picture block 203 (the current picture block 203 of the current picture 201) and decoded picture 231, or at least one or more pre-reconstruction blocks, such as one or more reconstruction blocks of other / different pre-decoded pictures 231. For example, a video sequence may include the current picture and the pre-decoded picture 231, or in other words, the current picture and the pre-decoded picture 231 may be part of or form part of a set of pictures that make up the video sequence.
[0465] For example, the encoder 20 may be configured to select a reference block from multiple reference blocks of the same picture or multiple different pictures among multiple other pictures, provide the reference picture to the motion estimation unit (not shown in Figure 2), and / or provide an offset (spatial offset) between the position (coordinates X and Y) of the reference block and the position of the current block as an interpretation parameter. This offset is also called a motion vector (MV).
[0466] The motion compensation unit is configured to obtain inter-prediction parameters and perform inter-prediction based on or using the inter-prediction parameters to obtain inter-prediction blocks 245. Motion compensation performed by the motion compensation unit (not shown in Figure 2) may include fetching or generating predictive blocks based on motion / block vectors determined through motion estimation (and possibly performing interpolation with sub-pixel precision). Interpolation filtering may generate additional pixel samples from known samples, thereby potentially increasing the number of candidate predictive blocks that can be used to code picture blocks. Now receiving a motion vector for the picture block's PU, the motion compensation unit 246 may locate the predictive block pointed to by the motion vector within one of the reference picture lists. The motion compensation unit 246 may also generate syntax elements related to blocks and video slices, which the decoder 30 may use to decode picture blocks in video slices.
[0467] Specifically, the interprediction unit 244 can transmit a syntax element to the entropy coding unit 270, which includes interprediction parameters (e.g., indication information for the selection of the interprediction mode to be used for predicting the current block after considering multiple interprediction modes). In one possible application scenario, if there is only one interprediction mode, the interprediction parameters do not need to be carried within the syntax element. In this case, the decoder side 30 can perform decoding directly by using the default prediction mode. It can be understood that the interprediction unit 244 may be configured to perform any combination of multiple interprediction techniques.
[0468] The intra-prediction unit 254 is configured to acquire, for intra-prediction, the picture block 203 (current picture block) and one or more preceding reconstructed blocks, such as reconstructed adjacent blocks of the same picture, for example, by receiving them. The encoder 20 may be configured to select an intra-prediction mode from a plurality of (predetermined) intra-prediction modes, for example.
[0469] In one embodiment, the encoder 20 is configured to select an intra-prediction mode according to an optimization criterion, such as based on minimum residual (e.g., an intra-prediction mode that provides a prediction block 255 that is most similar to the current picture block 203) or minimum rate distortion.
[0470] The intra-prediction unit 254 is further configured to determine an intra-prediction block 255, for example, based on the intra-prediction parameters in the selected intra-prediction mode. In any case, after selecting an intra-prediction mode for a block, the intra-prediction unit 254 is further configured to provide the entropy coding unit 270 with intra-prediction parameters, i.e., information indicating the intra-prediction mode selected for that block. In one example, the intra-prediction unit 254 may be configured to perform any combination of multiple intra-prediction techniques.
[0471] Specifically, the intra-prediction unit 254 can transmit a syntax element to the entropy coding unit 270, which includes intra-prediction parameters (e.g., indication information for the selection of the intra-prediction mode to be used for predicting the current block after considering multiple intra-prediction modes). In one possible application scenario, if there is only one intra-prediction mode, the intra-prediction parameters do not need to be carried within the syntax element. In this case, the decoder 30 can directly perform decoding in the default prediction mode.
[0472] The entropy coding unit 270 is configured to obtain encoded picture data 21, which can be output via output 272, in the form of an encoded bitstream 21, by applying (or not applying) an entropy coding algorithm or scheme (e.g., variable length coding scheme, context adaptive VLC (CAVLC) scheme, arithmetic coding scheme, context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques) to one or all of the quantized residual coefficients 209, inter-prediction parameters, intra-prediction parameters, and / or loop filter parameters. The encoded bitstream may be transmitted to the video decoder 30 or may be archived for later transmission or retrieval by the video decoder 30. The entropy coding unit 270 may also be configured to entropy code another syntax element with respect to the current video slice being coded.
[0473] A structurally slightly different video encoder 20 can be used to encode the video stream. For example, a non-conversion-based encoder 20 may directly quantize the residual signal for some blocks or frames without using a conversion processing unit 206. In another implementation, the encoder 20 may have a quantization unit 208 and an inverse quantization unit 210 coupled into a single unit.
[0474] Specifically, in embodiments of this application, the encoder 20 may be configured to implement the video picture encoding method described in the following embodiments.
[0475] It should be understood that a structurally slightly different video encoder 20 may be used to encode the video stream. For example, for some picture blocks or picture frames, the video encoder 20 may directly quantize the residual signal, eliminating the need for processing by the conversion processing unit 206 and, correspondingly, the need for processing by the inverse conversion processing unit 212. Alternatively, for some picture blocks or picture frames, the video encoder 20 may not generate residual data, eliminating the need for processing by the conversion processing unit 206, the quantization unit 208, the inverse quantization unit 210, and the inverse conversion processing unit 212. Alternatively, the video encoder 20 may directly store the reconstructed picture block as a reference block, eliminating the need for processing by the filter 220. Alternatively, the quantization unit 208 and the inverse quantization unit 210 within the video encoder 20 may be combined. The loop filter 220 is optional. Furthermore, in the case of lossless compression coding, the transformation unit 206, quantization unit 208, inverse quantization unit 210, and inverse transformation unit 212 are optional. It should be understood that in different application scenarios, the inter-prediction unit 244 and intra-prediction unit 254 may be used selectively.
[0476] Figure 3 is a schematic / conceptual block diagram of an example of a decoder 30 configured to implement one embodiment of this application. The video decoder 30 is configured to receive encoded picture data (e.g., encoded bitstream) 21, encoded by, for example, an encoder 20, and obtain a decoded picture 231. In the decoding process, the video decoder 30 receives video data from the video encoder 20, such as an encoded video bitstream representing, for example, picture blocks of encoded video slices and associated syntax elements.
[0477] In the example in Figure 3, the decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transformation unit 312, a reconstruction unit 314 (e.g., an adder 314), a buffer 316, a loop filter 320, a decoded picture buffer 330, and a prediction unit 360. The prediction unit 360 may include an inter-prediction unit 344, an intra-prediction unit 354, and a mode selection unit 362. In some examples, the video decoder 30 may perform a decoding process that is generally the reverse of the encoding process described with respect to the video encoder 20 in Figure 2.
[0478] The entropy decoding unit 304 is configured to perform entropy decoding on the encoded picture data 21 to obtain decoded encoded parameters (not shown in Figure 3), such as quantized coefficients 309 and / or one or all of the (decoded) inter-prediction parameters, intra-prediction parameters, loop filter parameters, and / or other syntax elements. The entropy decoding unit 304 is further configured to transfer the inter-prediction parameters, intra-prediction parameters, and / or other syntax elements to the prediction processing unit 360. The video decoder 30 may receive syntax elements at the video slice level and / or video block level.
[0479] The inverse quantization unit 310 may have the same function as the inverse quantization unit 210. The inverse transformation processing unit 312 may have the same function as the inverse transformation processing unit 212. The reconstruction unit 314 may have the same function as the reconstruction unit 214. The buffer 316 may have the same function as the buffer 216. The loop filter 320 may have the same function as the loop filter 220. The decoded picture buffer 330 may have the same function as the decoded picture buffer 230.
[0480] The prediction processing unit 360 may include an inter-prediction unit 344 and an intra-prediction unit 354. The inter-prediction unit 344 may be functionally similar to the inter-prediction unit 244, and the intra-prediction unit 354 may be functionally similar to the intra-prediction unit 254. The prediction processing unit 360 is typically configured to perform block prediction and / or acquire prediction blocks 365 from encoded data 21, and to receive or acquire (explicitly or implicitly) information about prediction-related parameters and / or selected prediction modes from, for example, an entropy decoding unit 304.
[0481] Furthermore, when a video slice is encoded into an intra-coded (I) slice, the intra-prediction unit 354 of the prediction processing unit 360 is configured to generate a prediction block 365 for the picture block of the current video slice based on the signaled intra-prediction mode and the data of the preceding decoded block of the current frame or picture. When a video frame is encoded into an inter-coded (i.e., B or P) slice, the inter-prediction unit 344 (e.g., motion compensation unit) in the prediction processing unit 360 is configured to generate a prediction block 365 for the video block in the current video slice based on the motion vector and other syntax elements received from the entropy decoding unit 304. In inter-prediction, a prediction block may be generated from one of the reference pictures in a single reference picture list. The video decoder 30 can construct reference frame lists, List 0 and List 1, by using default construction techniques and based on the reference pictures stored in the DPB 330.
[0482] The prediction processing unit 360 is configured to determine prediction information for a video block in the current video slice by analyzing motion vectors and other syntax elements, and to generate a prediction block for the current video block being decoded using the prediction information. In one example of this application, the prediction processing unit 360 uses some of the received syntax elements to determine a prediction mode for encoding a video block in a video slice (e.g., intra-prediction or inter-prediction), an inter-prediction slice type (e.g., B-slice, P-slice, or GPB-slice), one or more pieces of configuration information from a reference picture list for that slice, the motion vector of each inter-encoded video block in that slice, the inter-prediction state of each inter-encoded video block in that slice, and other information, and decodes the video block in the current video slice. In another example of this disclosure, the syntax elements received from the bitstream by the video decoder 30 include syntax elements in one or more of the following: an adaptive parameter set (APS), a sequence parameter set (SPS), a picture parameter set (PPS), or a slice header.
[0483] The inverse quantization unit 310 may be configured to perform inverse quantization (i.e., dequantization) on quantized transformation coefficients provided in the bitstream and decoded by the entropy decoding unit 304. The inverse quantization process may include determining the degree of quantization to be applied and the degree of inverse quantization to be applied, using quantization parameters calculated by the video encoder 20 for each video block in the video slice.
[0484] The inverse transformation processing unit 312 is configured to generate residual blocks in the sample domain by applying an inverse transformation (e.g., inverse DCT, inverse integer transformation, or a conceptually similar inverse transformation process) to the transformation coefficients.
[0485] The reconstruction unit 314 (for example, an adder 314) is configured to add the inverse transform block 313 (i.e., the reconstruction residual block 313) to the prediction block 365 by adding the sample values of the reconstruction residual block 313 to the sample values of the prediction block 365, thereby obtaining the reconstruction block 315 in the sample domain.
[0486] The loop filter unit 320 (either within or after the coding loop) is configured to filter the reconstructed block 315 to smooth sample transitions or improve image quality, thereby obtaining a filtered block 321. In one example, the loop filter unit 320 may be configured to perform some combination of filtering techniques described later. The loop filter unit 320 is intended to represent one or more loop filters, such as a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters such as a bilateral filter, an adaptive loop filter (ALF), a sharpening or smoothing filter, or a co-filter. Although the loop filter unit 320 is shown as an in-loop filter in Figure 3, in another implementation, the loop filter unit 320 may be implemented as a post-loop filter.
[0487] The decoded video block 321 within a given frame or picture is then stored in a decoded picture buffer 330 that stores a reference picture used for subsequent motion compensation.
[0488] The decoder 30 is configured, for example, to output the decoded picture 331 via output 332 for presentation or viewing to the user.
[0489] A slightly different video decoder 30 may be used to decode the compressed bitstream. For example, the decoder 30 may generate the output video stream without using the loop filter unit 320. For example, a non-conversion-based decoder 30 can directly dequantize the residual signal for some blocks or frames without using the inverse conversion processing unit 312. In another implementation, the video decoder 30 may have an inverse quantization unit 310 and an inverse conversion processing unit 312 coupled into a single unit.
[0490] Specifically, in the embodiments of this application, the decoder 30 is configured to implement the video picture decoding method described in the following embodiments.
[0491] It should be understood that a structurally slightly different video decoder 30 can be used to decode the encoded video bitstream. For example, the video decoder 30 may generate an output video stream without processing by the filter 320. Alternatively, for some picture blocks or picture frames, the entropy decoding unit 304 of the video decoder 30 does not obtain quantized coefficients through decoding, and accordingly, the inverse quantization unit 310 and the inverse transformation processing unit 312 are not required to perform processing. The loop filter 320 is optional. Also, in the case of lossless compression, the inverse quantization unit 310 and the inverse transformation processing unit 312 are optional. It should be understood that in different application scenarios, the inter-prediction unit and the intra-prediction unit may be used selectively.
[0492] It should be understood that, on the encoder 20 and decoder 30 in this application, the processing result of one procedure may be further processed and then output to the next procedure. For example, after a procedure such as interpolation filtering, motion vector derivation, or loop filtering, further operations such as clipping or shifting may be performed on the processing result of the corresponding procedure.
[0493] For example, the motion vectors of the current picture block's subblocks, derived from the motion vectors of the control points of the current picture block, or from the motion vectors of adjacent affine coding blocks, may be further processed. This is not limited to the present invention. For example, the values of the motion vectors are constrained to be within a certain bit width range. Assuming that the allowable bit width of the motion vector is bitDepth, the values of the motion vectors are in the range of -2^(bitDepth-1) to 2^(bitDepth-1)-1, where the symbol "^" represents exponentiation. If bitDepth is 16, the values are in the range of -32768 to 32767. If bitDepth is 18, the values are in the range of -131072 to 131071. In another example, the values of the motion vectors (e.g., the motion vectors MV of four 4x4 subblocks within one 8x8 picture block) are constrained to be such that the maximum difference between the integer parts of the MVs of those four 4x4 subblocks does not exceed N samples, for example, one sample.
[0494] Figure 4 is a schematic diagram of a video coding device 400 (e.g., a video encoding device 400 or a video decoding device 400) according to one embodiment of this application. The video coding device 400 is suitable for implementing the embodiments described in this specification. In one embodiment, the video coding device 400 may be a video decoder (e.g., the decoder 30 in Figure 1A) or a video encoder (e.g., the encoder 20 in Figure 1A). In another embodiment, the video coding device 400 may be one or more components of the decoder 30 in Figure 1A or the encoder 20 in Figure 1A.
[0495] The video coding device 400 includes an inlet port 410 and a receiving unit (Rx) 420 for receiving data, a processor, logic unit, or central processing unit (CPU) 430 for processing data, a transmitter unit (Tx) 440 (or shortly referred to as transmitter 440) and an exit port 450 for transmitting data, and a memory 460 (e.g., memory 460) configured to store data. The video coding device 400 may further include optical-to-electrical conversion components and electrical-to-optical (EO) components coupled to the inlet port 410, the receiving unit 420 (or shortly referred to as receiver 420), the transmitter unit 440, and the exit port 450 for the input and output of optical or electrical signals.
[0496] The processor 430 is implemented by hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., multicore processors), FPGAs, ASICs, and DSPs. The processor 430 communicates with an inlet port 410, a receiver unit 420, a transmitter unit 440, an exit port 450, and memory 460. The processor 430 includes a coding module 470 (e.g., an encoding module 470 or a decoding module 470). The encoding / decoding module 470 implements the embodiments disclosed in this specification to carry out the chrominance block prediction method provided in embodiments of this application. For example, the encoding / decoding module 470 performs, processes, or provides various coding operations. Thus, the encoding / decoding module 470 substantially enhances the functionality of the video coding device 400 and affects the conversion of the video coding device 400 to several different states. Alternatively, the encoding / decoding module 470 is implemented as instructions stored in memory 460 and executed by the processor 430.
[0497] Memory 460 includes one or more disks, tape drives, and solid-state drives, and is used as an overflow data storage device to store a program when it is selected for execution, and to store instructions and data read during program execution. Memory 460 can be volatile and / or non-volatile, and may be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and / or static random access memory (SRAM).
[0498] Figure 5 is a simplified block diagram of a device 500 that can be used as either or both of the source device 12 and destination device 14 of Figure 1A, according to one embodiment. The device 500 can implement the technology of this application. In other words, Figure 5 is a schematic block diagram of one implementation of an encoding or decoding device (abbreviated as coding device 500) according to one embodiment of this application. The coding device 500 may include a processor 510, memory 530, and a bus system 550. The processor and memory are connected via the bus system. The memory is configured to store instructions. The processor is configured to execute instructions stored in memory. The memory of the coding device stores program code, and the processor can invoke the program code stored in memory to execute various picture encoding or decoding methods described in this application, in particular various inter-predictive mode or intra-predictive mode picture encoding or decoding methods. To avoid repetition, details will not be described again here.
[0499] In this embodiment of the application, the processor 510 may be a Central Processing Unit (CPU). Alternatively, the processor 510 may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or similar. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or similar.
[0500] The memory 530 may include a read-only memory (ROM) device or a random access memory (RAM) device. Alternatively, any other preferred type of storage device may be used as the memory 530. The memory 530 may include code and data 531 accessed by the processor 510 via the bus 550. The memory 530 may further include an operating system 533 and an application program 535. The application program 535 includes at least one program that enables the processor 510 to execute the video coding or decoding method described in this application (in particular, the video picture prediction method or inter prediction method described in this application). For example, the application program 535 may include applications 1 to N and further include a video coding or decoding application (abbreviated as a video coding application) that performs the video coding or decoding method described in this application.
[0501] In addition to the data bus, the bus system 550 may further include a power bus, control bus, status signal bus, and similar buses. However, for clarity, the various types of buses shown in the diagram are marked as bus system 550.
[0502] Optionally, the coding device 500 may further include one or more output devices, such as a display 570. In one example, the display 570 may be a touch display combining a touch unit that operably detects touch input with a display. The display 570 may be connected to the processor 510 via the bus 550.
[0503] In embodiments of this application, interpretation is a crucial step. From the encoder's perspective, interpretation involves searching for a reconstructed picture relating to a reference block that matches the current coding block in the current picture. As shown in Figure 5A, the sample values of the samples in the reference block (e.g., reference block Fr1 or reference block Fr2, where the sample values in the reference block can be understood as the reference sample values in this application) are used as predicted information or predicted values (hereinafter, "information" and "values" are not distinguished) of the sample values of the samples in the current coding block (i.e., current picture block) Fc. This process is referred to as motion estimation ME. Motion information of the current coding block is also transmitted. From the decoder's perspective, motion information needs to be obtained through analysis during interpretation, and based on the obtained motion information, the reference block is determined in the reconstructed picture, and the sample values of the samples in the reference block (i.e., reference sample values) are used as predicted information. This process is referred to as motion compensation MC. Reconstructed information can be obtained by combining the predicted information and residual information, and then performing a filtering operation on the combined information. The ideas in this application may be used in HEVC or in other video coding standards. The following describes the possible cases of interpredictive modes on the encoder side, using an example of using this idea in HEVC. The possible cases of interpredictive modes on the decoder side are similar and therefore no further explanation is provided.
[0504] HEVC has two modes: Advanced Motion Vector Prediction (AMVP) mode and Merge mode. These two modes will be explained separately below.
[0505] In AMVP mode, first, an affine candidate motion vector list is constructed using motion information from spatially or temporally adjacent coding blocks to the currently coding block. Then, the optimal motion vector is determined from the affine candidate motion vector list as the motion vector predictor (MVP) for the currently coding block. The rate distortion cost is calculated using equation (0-1), where J is the rate-distortion cost (RD cost), SAD is the sum of absolute differences (SAD) between the predicted sample value and the original sample value obtained through motion estimation using the candidate motion vector predictor, R is the bit rate, and λ is the Lagrange multiplier. The encoder transmits the index value of the selected motion vector predictor in the affine candidate motion vector list and the reference frame index value to the decoder. Furthermore, to obtain the actual motion vector of the currently coding block, a motion search is performed within the adjacent region centered on the MVP. The encoder transmits the difference between the MVP and the actual motion vector (motion vector difference) to the decoder. J = SAD + λR (0-1)
[0506] In merge mode, first, a candidate motion information list is constructed using the motion information of spatially or temporally adjacent coding blocks to the currently coded block. Then, the optimal motion information is determined from the candidate motion information list based on the rate distortion cost and used as the motion information for the currently coded block. Finally, the index value of the position of the optimal motion information in the candidate motion information list (referred to as the merge index, hereafter the same) is transmitted to the decoder. The spatial and temporal candidate motion information for the currently coded block is shown in Figure 5B. The spatial candidate motion information comes from five spatially adjacent blocks (A0, A1, B0, B1, and B2). If an adjacent block is unavailable or in intra coding mode, that adjacent block is not added to the candidate motion information list. The temporal candidate motion information for the currently coded block is obtained after the MV of the collated block in the reference frame is scaled based on the picture order count (POC) of the reference frame and the current frame. First, it is determined whether the block at position T in the reference frame is available. If that block is unavailable, the block at position C is selected.
[0507] In HEVC interpretation, all samples in the current coding block use the same motion information, and motion compensation is performed based on that motion information to obtain the predicted sample value of the current coding block. The motion information mainly includes: (1) the prediction direction of the coding block, including forward prediction, backward prediction, and bidirectional prediction, where forward prediction indicates that the coding block is obtained through prediction based on the preceding coded frame, backward prediction indicates that the coding block is obtained through prediction based on the succeeding coded frame, and bidirectional prediction indicates that the coding block is obtained through prediction referencing the preceding and succeeding coded frames; (2) the reference frame index of the coding block, which indicates the frame in which the reference block of the current coding block is located; and (3) the motion vector MV of the coding block, which indicates the motion displacement of the coding block relative to the reference block, where MV has a horizontal component (MV x (and so on) and vertical component (MV y These include (denoted as ) and represent the horizontal displacement of the coding block relative to the reference block and the vertical displacement of the coding block relative to the reference block, respectively. When forward or backward prediction is performed on the coding block, there is only one MV. When bidirectional (i.e., forward and backward) prediction is performed on the coding block, there are two MVs. Figure 5C illustrates the motion information described above. In Figure 5C and the following descriptions of motion and prediction information, 0 represents forward prediction and 1 represents backward prediction. For example, Ref0 represents the forward reference frame, Ref1 represents the backward reference frame, MV0 represents the forward motion vector, and MV1 represents the backward motion vector. A, B, and C represent the forward reference block, the current coding block, and the back reference block, respectively. Cur represents the current coding frame, and the dashed line represents the movement path of B.
[0508] The basic motion compensation process for forward prediction is as follows: As shown in Figure 5C, the current coding block is block B in the figure, and the height and width of B are H and W, respectively. In this case, based on the motion information, the forward reference frame of the current coding block B is frame Ref0 and the forward motion vector MV0 of the current coding block B is (MV0 x MV0 y It can be seen that ). When coding block B in frame Cur is coded, first, based on the coordinates (i,j) of the upper left corner point of B in frame Cur, the same coordinate point is found in frame Ref0, and based on the length and width of block B, block B' in Ref0 can be obtained, and then B' is moved to block A based on the MV0 of block B'. Finally, interpolation is performed on block A to obtain the predicted block of the current coding block B. The sample value of each sample in the predicted block of the current coding block B is referenced as the predicted value of the corresponding sample in block B. The motion compensation process for backward prediction is the same as that for forward prediction, but the reference direction is different. The predicted blocks obtained through motion compensation in backward and forward prediction are called forward prediction blocks and backward prediction blocks, respectively. When bidirectional prediction is not performed on a coding block, the obtained forward prediction block and backward prediction block are the predicted blocks of the current coding block.
[0509] In bidirectional prediction, first, forward prediction blocks and backward prediction blocks are obtained based on motion information in the forward prediction motion compensation process and the backward prediction motion compensation process. Then, weighted prediction or BDOF (also called Bi-directional Optical Flow (BIO)) is performed on the sample values at the same position within the forward prediction block and backward prediction block to obtain the prediction block of coding block B.
[0510] In BDOF technology, after bidirectional motion compensation is performed on the current coding block, forward and backward predicted blocks are acquired. Then, based on the sample values of the forward and backward predicted blocks, corrected motion vectors are derived for each 4x4 subblock within the current coding block. Finally, to obtain the predicted value of the current coding block, compensation is performed again on each sample within the current coding block based on the corrected motion vectors, and the final predicted block of the current coding block is acquired. Embodiments of this application focus on specific conditions under which motion compensation is performed using BDOF to reduce coding complexity and improve coding performance.
[0511] Figure 6A is a schematic flowchart of an encoding method according to one embodiment of the present invention. This encoding procedure may be performed by a video encoding device. The video encoding device may be the video encoder 20 described above, or a device including the video encoder 20. Specifically, the procedure may be performed by an interprediction unit (also called an interpreter) 244, an entropy encoding unit (also called an entropy encoder) 270, and similar components within the video encoder 20. The procedure described above is described as a series of steps or operations. It should be understood that the steps of the procedure may be performed in various orders and / or simultaneously, and are not limited to the execution order shown in Figure 6A. A related explanation of the procedure corresponding to Figure 6A is as follows.
[0512] The encoding device first determines whether several preset conditions are satisfied. If the multiple preset conditions are satisfied, S600 is executed; otherwise, S601 is executed. If the multiple preset conditions are not satisfied, only the case of S601 is used as representative of the detailed description herein. Other cases that are the same as those in the prior art are not described in this application.
[0513] Step S600: When multiple preset conditions are met, the encoding device performs a bidirectional optical flow BDOF process on the current picture block to obtain predicted sample values for the current picture block.
[0514] Bidirectional optical flow (BDOF) can be abbreviated as BIO or BDOF.
[0515] The above preset conditions include at least the condition that the current picture block size satisfies the first preset size. The current picture block size is usually expressed by width and height (often abbreviated as W×H), and the width and height are measured in samples (or pixels). For example, if the current picture block size is 8×8, the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples. In another example, if the current picture block size is 8×16, the 8 indicates that the width of the current picture block is 8 samples, and the 16 indicates that the height of the current picture block is 16 samples.
[0516] For the current picture block size to satisfy the first preset size, it includes (or is) the following: the current picture block height H is 8 or greater, and the width W is not equal to the height H when the product of the current picture block width W and height H is equal to 64.
[0517] Alternatively, for the current picture block size to satisfy the first preset size includes (or is) the current picture block height H being 8 or greater, and the current picture block width W being 8 or greater.
[0518] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current height H of the picture block being 8 or greater, the current width W of the picture block being 8 or greater, and the product of the current width W and the current height H of the picture block being greater than 64.
[0519] Alternatively, the current size of the picture block satisfying the first preset size includes (or is) the current picture block height H being 8 or greater, the current picture block width W being 8 or greater, and the product of the current picture block width W and the current picture block height H being greater than 128.
[0520] Alternatively, the current picture block size satisfying the first preset size includes the current picture block height H being greater than 8.
[0521] Alternatively, for the current picture block size to satisfy the first preset size includes the current picture block height H being greater than 8 and the current picture block width W being 8 or greater.
[0522] Furthermore, before it is determined (or obtained through prediction) whether to determine the predicted sample value of the current picture block based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list, according to the BDOF technique, there may be other reference conditions in addition to the size of the current picture block. These other reference conditions are not limited to those described herein. For ease of understanding, an example is used below.
[0523] Condition A: A high-level syntax identifier sps_bdof_enabled_flag exists that indicates that BDOF technology is currently permitted to be used for the video sequence.
[0524] Condition B: The predicted direction indicator predFlagL0 corresponding to the first list (List1) is equal to 1, and the predicted direction indicator predFlagL1 corresponding to the second list (list0) is equal to 1.
[0525] Condition C: The picture order count POC_L0 of the reference frame corresponding to the first list (list0), the picture order count POC_L1 of the reference frame corresponding to the second list (list1), and the picture order count POC_Cur of the picture in which the picture block is currently located satisfy the relationship (POC_L0-POC_Cur)×(POC_L1-POC_Cur)<0. In other words, the picture containing the picture block is located between the two reference pictures.
[0526] Condition D: MotionModelIdc[xCb][yCb] is equal to 0. MotionModelIdc is the motion model index for motion compensation. MotionModelIdc[xCb][yCb] equal to 0 indicates that the motion model for motion compensation of the block is currently translational motion.
[0527] Condition E: merge_subblock_flag[x0][y0] is equal to 0, where merge_subblock_flag[x0][y0] equal to 0 indicates that subblock merge mode is not currently applied to the picture block.
[0528] Condition F: sym_mvd_flag[x0][y0] is equal to 0. A sym_mvd_flag[x0][y0] equal to 0 indicates that the mvd_coding(x0,y0,refList,cpIdx) syntax structure exists for the current block.
[0529] Condition G: bcwIdx[xCb][yCb] is equal to 0. bcwIdx represents the bidirectional prediction weight index for the current picture block.
[0530] Condition H: cIdx is equal to 0. cIdx represents the color component index of the current picture block.
[0531] Condition I: The current picture block size is the first preset size.
[0532] Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there are no weighting coefficients for the luma component of the list1 prediction.
[0533] For example, when all of conditions A through J are satisfied, it is determined that BDOF technology can be used to predict the predicted sample value of the picture block. For example, bdofFlag is set to true. Note that the conditions described above are merely examples, and other conditions may be added, or one or more of the above conditions may be replaced, or one or more of the above conditions may be removed.
[0534] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0535] It can be understood that, by referring to the aforementioned cases, further cases can be obtained, and these other cases also fall within the scope of protection of this application.
[0536] It should be understood that the method in this embodiment of the application can be performed by a picture prediction device, such as a video encoder or an electronic device having a video encoding function, and more specifically, by an interpretation unit within a video encoder.
[0537] Specifically, the requirements for using BDOF technology in this solution differ from those for using conventional technologies, particularly regarding the size of the current picture block. By using BDOF technology on a current picture block with a first preset size, it is possible to obtain predicted sample values that are closer to the actual sample values, allowing for better control of coding complexity and improving coding efficiency.
[0538] In this embodiment of the application, the encoding device performing bidirectional optical flow BDOF processing on the current picture block when a plurality of preset conditions are satisfied may specifically be as follows: When a plurality of preset conditions are satisfied, the encoding device performs bidirectional optical flow BDOF processing on the current picture block based on the reference sample values corresponding to the first list and the reference samples corresponding to the second list.
[0539] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0540] It can be understood that the first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and the second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1) are obtained in different ways in different interpretation modes. The specific interpretation mode used can be selected using a mode selection unit. Below, we will explain separately how the first and second motion vectors are determined in AMVP mode, merge mode, and skip mode.
[0541] Possible case 1: The interpretation mode is AMVP mode.
[0542] The encoding device first constructs a list of candidate motion vector predictors (MVPs).
[0543] Specifically, the video encoding device constructs a candidate motion vector predictor MVP list (also referred to as a candidate motion vector list) by using an inter-prediction unit (also referred to as an inter-prediction module). The constructed candidate motion vector predictor MVP list may be a triplet candidate motion vector predictor MVP list or a 2-tuple candidate motion vector predictor MVP list. In this embodiment of the application, the video encoding device performs inter-prediction in a bidirectional prediction scheme.
[0544] Next, the video encoding device determines target candidate motion information within the MVP list according to the rate distortion cost criteria.
[0545] Specifically, target candidate motion information is sometimes referred to as the optimal candidate motion vector, or it may have a different name. In conclusion, target candidate motion information is the optimal candidate determined within the MVP list according to the rate distortion cost criterion (e.g., usage cost is minimized). Target candidate motion information corresponds to a unique index number in the candidate motion vector predictor MVP list.
[0546] Next, the first and second motion vectors are determined based on the target candidate motion information. The target candidate motion information includes a first motion vector predictor (e.g., Mvp0_L0) corresponding to the first list (i.e., list0), and a second motion vector predictor (e.g., Mvp1_L1) corresponding to the second list (i.e., list1). For example, the first motion vector Mv0_L0 (forward) corresponding to the first list (list0) may be obtained based on the sum of the first motion vector predictor Mvp0_L0 and the motion vector difference MVD0. Similarly, the second motion vector Mv1_L1 may be obtained based on the sum of the second motion vector predictor Mvp1_L1 and the motion vector difference MVD1. Optionally, the first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) here may be expressed as the first motion vector corresponding to the first direction (e.g., forward direction), and the second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1) may be expressed as the second motion vector corresponding to the second direction (e.g., backward direction).
[0547] Possible case 2: The interpretation mode is merge mode.
[0548] The encoding device first constructs a list of candidate motion information.
[0549] Specifically, the video encoding device constructs a candidate motion information list (also called a candidate motion vector list) by using an interpretation unit (also called an interpretation module).
[0550] Next, the video encoding device determines the target candidate motion information within the candidate motion information list according to the rate distortion cost criterion.
[0551] Specifically, the target candidate motion information includes a target candidate motion vector, a reference frame index, and prediction direction indication information, the prediction direction indication information is used to indicate that bidirectional prediction is applied, the target candidate motion vector includes a first motion vector corresponding to the first list and a second motion vector corresponding to the second list, and the reference frame index includes the index of the first reference frame corresponding to the first list and the index of the second reference frame corresponding to the second list.
[0552] Target candidate motion information is sometimes referred to as optimal candidate motion information, or may have a different name. In conclusion, target candidate motion information is the optimal candidate determined within the candidate motion information list according to a rate distortion cost criterion (e.g., the cost of use is minimized).
[0553] Possible Case 3: The interpretation mode is skip mode. For further explanation, please refer to the explanation of merge mode in Case 2 above. The difference from merge mode is that in skip mode, it is not necessary to transmit residual samples.
[0554] Referring to Figure 6B, in this embodiment of the application, the present picture to which the present picture block belongs has two reference pictures, a preceding reference picture and a succeeding reference picture, which are a first reference picture (e.g., a forward reference picture or forward reference frame, where “forward” may also be referred to as a first direction) and a second reference picture (e.g., a backward reference picture or backward reference frame, where “backward” may also be referred to as a second direction). The reference sample corresponding to the first list is the reference sample on the first reference picture, and the reference sample corresponding to the second list is the reference sample on the second reference picture.
[0555] Optionally, obtaining predicted sample values for the current block through predictions based on reference sample values corresponding to the first list and reference sample values corresponding to the second list, according to the BDOF technique, may include deriving a modified motion vector for each subblock of the current block based on the reference sample values corresponding to the first list and reference sample values corresponding to the second list, according to the BDOF technique, and then performing motion compensation on each subblock based on the modified motion vector to obtain the predicted sample values for each subblock. For ease of understanding, an example is provided below.
[0556] The sample value of the reference sample value corresponding to the first list (list0) is I (0) It can be represented as (i,j), and the sample value of the reference sample value corresponding to the second list (list1) is I (1) These can be expressed as (i,j). Together, these two values represent the forward and backward prediction values I. (k) We can call this (i,j), where i=0..cuW-1, j=0..cuH-1, and k can be 0 and 1. Here, I (k) (i,j) can be obtained through interpolation using an 8-tap interpolation filter, and sample values at other positions (with one row and one column extension) can be obtained through interpolation using a bilinear interpolation filter. The sample values of the extended region may be obtained by other means, for example, using an 8-tap interpolation filter, or they may be the reference sample values at integer sample positions. This is not limited to the above. Here, cuW and cuH are the width and height of the current picture block, respectively. Obtaining predicted sample values of the current picture block through predictions based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, according to the BDOF technique, may specifically include the following steps.
[0557] Step 1: Calculate the sum of absolute differences SAD between the sample values of the reference sample values corresponding to the first list and the sample values of the reference sample values corresponding to the second list, determine whether SAD is less than the threshold TH_CU. If SAD is less than the threshold TH_CU, skip executing BDOF. If SAD is greater than or equal to the threshold TH_CU, execute BDOF. This step is optional.
[0558] The SAD calculation formula is as follows:
Equation
[0559] The threshold TH_CU can be set to (1<<(BD - 8 + shift))×cuW×cuH, where shift is Max(2, 14 - BD).
[0560] Alternatively, TH_CU may be set to 1<<(BD - 3 + shift).
[0561] Optionally, whether to execute BDOF may instead be determined by other methods, and these other methods will not be enumerated one by one here.
[0562] When it is determined to execute BDOF, continue to execute Step 4.
[0563] Step 2: Calculate the horizontal gradient value and vertical gradient value of the forward and backward prediction values of the current CU.
[0564] The horizontal gradient value ∂I (k) / ∂x(i, j) and the vertical gradient value ∂I (k) / ∂y(i, j) of the forward and backward prediction values of the current CU are the horizontal gradient value ∂I (0) / ∂x(i, j) and the vertical gradient value ∂I (0) / ∂y(i, j) at the sample position (i, j) of the reference sample values corresponding to the first list and the horizontal gradient value ∂I (1) / ∂x(i,j) and vertical slope value ∂I (1) The horizontal gradient value ∂I is included in / ∂y(i,j), where k is sequentially set to 0 and 1. (k) / ∂x(i,j) and vertical slope value ∂I (k) / ∂y(i,j) can be obtained using the following formula:
number
[0565] Here, i = 0..cuW-1 and j = 0..cuH-1.
[0566] In this step, the cuW × cuH prediction matrix for the current picture block can be obtained.
[0567] Step 4: Perform padding to extend the current forward and backward predicted values, horizontal slope values, and vertical slope values of the CU.
[0568] Calculating the corrected motion vector of a 4x4 subblock involves obtaining the forward and backward predicted values I of the 6x6 region in which the 4x4 subblock is located. (k) (x,y) and the horizontal gradient value ∂I of the forward and backward predicted values. (k) / ∂x(i,j) and the vertical gradient value ∂I of the forward and backward predicted values. (k) The function / ∂y(i,j) is required. Calculating the gradient value for a 6x6 region requires forward and backward predicted values for an 8x8 region. Therefore, when obtaining forward and backward predicted values using an interpolation filter, in order to calculate the gradient value of (W+2)×(H+2), it is necessary to extend the area by two rows and two columns to obtain a predicted sample block of size (W+4)×(H+4), where W is the current width of the CU and H is the current height of the CU. Special processing can be performed on the boundaries of the CU to reduce the complexity of the BDOF. Details are as follows.
[0569] First, an 8-tap filter is used to obtain the predicted values for the W×H region. Then, the region is expanded by one row and one column around it, and the predicted values for the expanded region are obtained using a bilinear filter, resulting in the predicted values for the (W+2)×(H+2) region.
[0570] Next, the gradient value of the W×H region can be obtained through calculations based on the predicted values of the (W+2)×(H+2) region according to the formula.
[0571] Finally, following the padding method, the gradient values of the W×H region are extended to the surrounding area to obtain the horizontal and vertical gradient values of the (W+2)×(H+2) region. The predicted values of the W×H region are extended to the surrounding area to obtain the predicted values of the (W+2)×(H+2) region.
[0572] The padding is shown in Figure 6D. I at i = -1..cuW and j = -1..cuH (k) (i,j), ∂I (k) / ∂x(i,j), and ∂I (k) To obtain / ∂y(i,j), padding is performed according to the method shown in Figure 6D. Specifically, a prediction matrix of (cuW+2)×(cuH+2), a horizontal gradient matrix, and a vertical gradient matrix are obtained.
[0573] Step 5: Derive the modified motion vectors for each 4x4 subblock, and then perform weighting.
[0574] For each 4x4 subblock, the correct motion vector (v) is determined according to equation (2-3). x ,v y The correct motion vector (v) of each 4x4 subblock is obtained. Specifically, the correct motion vector (v) of each 4x4 subblock is obtained. x ,v y ) is obtained by applying BDOF to a 6x6 window Ω around the subblock to minimize the predicted values of L0 and L1. Specifically, (v x ,v y ) is derived according to the following equation:
number
[0575] Here,
number
[0576] S1, S2, S3, S5, and S6 are calculated according to the following formula:
number
[0577] Here,
number
[0578] Here, I (0) (i,j) is the forward predicted value of the sample position (i,j) in the current CU, that is, the reference sample value of the current CU and the sample value of the sample position (i,j) in the reference sample value corresponding to the first list, I (1) (i,j) is the backward predicted value of the sample position (i,j) in the current CU, i.e., the reference sample value of the current CU and the sample value of the sample position (i,j) in the reference sample value corresponding to the second list.
[0579] After the modified motion vector is obtained according to equation (2-3), the final predicted value of each sample in the current picture block, i.e., the sample value in the predicted block of the current picture block, can be determined according to the following equation:
number
[0580] Here, shift and offset are 15-BD and 1<<(14-BD)+2·(1<<13). rnd(.) is the rounding function (rounding to the nearest integer). pred BIO (i,j) is the predicted sample value for the current picture block's sample position (i,j).
[0581] Step S601: When the current size of the picture block is the second preset size, the encoding device determines the predicted sample value of the current picture block using the first processing method, based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0582] Specifically, the first processing method is not BDOF (or Bi-directional optical flow, BIO). In other words, when the current picture block size is a second preset size, it is not permitted to use BDOF to determine the predicted sample value of the current picture block based on the reference sample values corresponding to the first and second lists. The current picture block size is usually expressed by width and height (abbreviated as W×H), and the width and height are measured in samples (or pixels). The second preset sizes include 8×8 (the first 8 indicates that the width of the current picture block is 8 samples, and the second 8 indicates that the height of the current picture block is 8 samples), 4×N (4 indicates that the width of the current picture block is 4 samples, and N indicates that the height of the current picture block is N samples, with other sizes estimated by analogy), 8×16, or 16×8. N is a power of 2 and is greater than or equal to 8. For example, the values of N can be 16, 32, 64, etc.
[0583] In this embodiment of the application, the reference sample values corresponding to the first list and the reference sample values corresponding to the second list are obtained through predictions based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0) and a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1), respectively. For example, the reference sample values corresponding to the first list (i.e., list0) can be determined based on a first motion vector (e.g., Mv0_L0) corresponding to the first list (i.e., list0), and the reference sample values corresponding to the second list (i.e., list1) can be determined based on a second motion vector (e.g., Mv1_L1) corresponding to the second list (i.e., list1).
[0584] Note that the first and second motion vectors are determined in different ways in different interpretation modes. For details on how the first and second motion vectors are determined in AMVP mode, merge mode, and skip mode, please refer to the explanation in step S600. We will not explain the details again here.
[0585] It should be understood that the current picture block (also called the current block) here can be understood as the picture block being processed. For example, in the encoding process, the current picture block is the encoding block.
[0586] Furthermore, the aforementioned cases in which the second preset size includes 8×8, 4×N, 8×16, or 16×8 may also be limited to cases where the second preset size is 8×8, 4×N, 8×16, or 16×8. In other words, BDOF may be prohibited from being used for one of the sizes listed above as 8×8, 4×N, 8×16, and 16×8, or for multiple of these sizes. Examples will be used below for illustrative purposes.
[0587] Example 1: The second preset size includes (or is) 8x8. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 8x8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 8x8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0588] Example 2: The second preset size includes (or is) 4 × N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size of 4 × N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is 4 × N, with N being 8 or greater, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0589] Example 3: The second preset size includes (or is) 8×8 or 4×N. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8 and 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is either 8×8 or 4×N, with N being 8 or greater, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0590] Example 4: The second preset size includes (or is) 8×8, 4×N, 8×16, or 16×8, where N is 8 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes 8×8, 4×N, 8×16, and 16×8. In this case, when the current size of the picture block is one of the second preset sizes, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is one of 8×8, 4×N, 8×16, and 16×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0591] Example 5: The second preset size includes (or is) N×8, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for a size N×8. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0592] Example 6: The second preset size includes (or is) N×8 or 4×N, where N is 4 or greater. In other words, in this embodiment of the application, the BDOF is prohibited from being used for sizes N×8 or 4×N. In this case, when the current size of the picture block is the second preset size, obtaining a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list can be specifically expressed as follows: When the current size of the picture block is N×8 or 4×N, obtain a predicted sample value of the current picture block through prediction in the first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list.
[0593] Furthermore, in some scenarios, the use of BDOF is prohibited even for size M × 4. Therefore, in this application, when the use of BDOF is prohibited for a second preset size, BDOF may also be prohibited for use for size M × 4, provided that M is an integer greater than or equal to 4.
[0594] It should be understood that, by reference to the cases described above, further cases can be obtained, and these other cases also fall within the scope of protection of this application. It should be understood that the method in this embodiment of this application can be performed by a picture prediction device, such as a video encoder or an electronic device having a video encoding function, and more specifically, by an interpretation unit within a video encoder.
[0595] In one of the optional solutions, determining the predicted sample value of the current picture block using a first processing method based on the reference sample value corresponding to the first list and the reference sample value corresponding to the second list is: Perform a weighting calculation on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list to obtain the predicted sample values for the current picture block, or According to Merge-with-Motion Vector Difference (MMVD) technology, predictive sample values for the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list, or According to the combined inter / intra prediction CIIP technique, the predicted sample values of the current picture block are obtained through prediction based on the reference sample values corresponding to the first list and the reference sample values corresponding to the second list. Includes.
[0596] In this embodiment of the application, whether a weighting scheme, MMVD technique, or CIIP technique is specifically used may be determined by using corresponding conditions or indicated by using corresponding instructional information. Optionally, information later encoded into a bitstream may further include a target identifier, which is used to indicate a scheme used to predict the predicted sample values of the current block. For example, the target identifier is mmvd_flag[x0][y0]. When mmvd_flag[x0][y0] is a preset value (e.g., value 1), it indicates that the MMVD scheme is used for the current picture block.
[0597] Optionally, an MMVD implementation is provided below. As shown in Figure 6C, the predicted motion information of the current picture block is obtained. Assume that the forward motion vector predictor and backward motion vector predictor of the current picture block (i.e., the aforementioned motion vector predictor corresponding to the first list and the aforementioned motion vector predictor corresponding to the second list) are MV0(-22,18) and MV1(2,12), respectively, and that the forward motion vector difference and backward motion vector difference are MVD0(1,0) and MVD1(-1,0), respectively.
[0598] Currently, forward and backward prediction are performed separately on the picture block, and forward and backward prediction blocks for the picture block are obtained.
[0599] MV0(-22,18) and MV1(2,12) are used as reference inputs for the forward motion vector predictor and backward motion vector predictor, and a first-precision motion search is performed on the forward reference prediction block q0 and the backward reference prediction block h0. For example, the first precision is 1 sample.
[0600] The forward-reference prediction block q0 and the backward-reference prediction block h0 are each used as starting search points for performing a first-precision motion search, and the difference between the newly discovered forward-reference prediction block and the new backward-reference prediction block is determined each time. For example, the difference between eight pairs of forward-reference prediction blocks and backward-reference prediction blocks around the above forward-reference prediction block and backward-reference prediction block is determined, and the difference between the forward-reference prediction block q0 and the backward-reference prediction block h0 is determined. Assume that the motion vector predictors of the forward-reference prediction block and backward-re...
Claims
1. A method for predicting bidirectional optical flow BDOF for the current picture block in video encoding or video decoding, The process includes the step of performing a BDOF operation on the current picture block to obtain a predicted sample value for the current picture block when the value of the flag bdofflag is set to true, If all of the preset conditions are satisfied for the current picture block, the value of the flag bdofflag is set to true, and if one or more of the preset conditions are not satisfied for the current picture block, the value of the flag bdofflag is set to false. The aforementioned multiple preset conditions are, Condition B: The first prediction direction indicator information predFlagL0 corresponding to the first list (List1) is equal to 1, and the second prediction direction indicator information predFlagL1 corresponding to the second list (list0) is equal to 1, where predFlagL0 and predFlagL1, both equal to 1, indicate that bidirectional prediction is applied to the current picture block. Condition D: MotionModelIdc is equal to 0, where MotionModelIdc equal to 0 indicates that the motion model for compensating the motion of the current picture block is translational motion. Condition E: The merge_subblock_flag contained in the syntax element associated with the current picture block is equal to 0, where merge_subblock_flag equal to 0 indicates that the subblock merge mode is not applied to the current picture block. Condition F: The sym_mvd_flag included in the syntax element is equal to 0, where sym_mvd_flag equal to 0 indicates that an mvd_coding syntax structure exists for the current picture block. Condition G: The bcwIdx included in the syntax element is equal to 0, where bcwIdx represents the bidirectional prediction weight index for the current picture block. Condition H: cIdx is equal to 0, where cIdx represents the color component index of the current picture block. Condition I: The height H of the current picture block is 8 or more, the width W of the current picture block is 8 or more, and the product of the width W of the current picture block and the height H of the current picture block is greater than 128, where W and H are each 2 n And n is an integer, and Condition J: Both luma_weight_l0_flag[refIdxL0] and luma_weight_l1_flag[refIdxL1] included in the syntax element are equal to 0, where luma_weight_l0_flag equal to 0 indicates that there is no first weighting coefficient for the luma component of the list0 prediction, and luma_weight_l1_flag equal to 0 indicates that there is no second weighting coefficient for the luma component of the list1 prediction. Performing the BDOF process on the aforementioned picture block means that A forward prediction block according to the forward motion vector for the current picture block and a backward prediction block according to the backward motion vector for the current picture block are obtained. The forward horizontal slope value, backward horizontal slope value, forward vertical slope value, and backward vertical slope value for the current sample in the current picture block are calculated based on the forward predicted sample and backward predicted sample corresponding to the current sample, wherein the forward predicted sample is in the forward prediction block and the backward predicted sample is in the backward prediction block. Based on the forward prediction block, the backward prediction block, the forward horizontal slope value, the backward horizontal slope value, the forward vertical slope value, and the backward vertical slope value, the corrected motion vector of each subblock in the current picture block is derived. The predicted sample value of the current picture block is determined based on the corrected motion vectors of the forward prediction block, the backward prediction block, and each subblock within the current picture block. method.
2. The method according to claim 1, wherein if condition I among the plurality of preset conditions is not satisfied for the current picture block, the value of the flag bdofflag is set to equal false.
3. The method further includes the step of determining whether the aforementioned set of preset conditions are satisfied for the current picture block. If all of the above preset conditions are satisfied for the current picture block, then bdofflag is set to equal to true, and a bidirectional optical flow BDOF process is performed on the current picture block to obtain the predicted sample value of the current picture block. If one or more of the aforementioned preset conditions are not satisfied for the current picture block, the bdofflag is set to false, and the BDOF process for the current picture block is skipped. The method according to claim 1 or 2.
4. The method according to any one of claims 1 to 3, wherein the forward prediction block corresponding to the forward reference frame Ref0 and the backward prediction block corresponding to the backward reference frame Ref1 are obtained from the forward reference frame and the backward reference frame using the forward motion vector MV0 and the backward motion vector MV1 for the current picture block for the forward reference frame Ref0 and the backward reference frame Ref1, respectively.
5. The method according to any one of claims 1 to 4, wherein the predicted sample value of the current picture block is a dual predicted sample value based on BDOF prediction.
6. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed on a processor, the method according to any one of claims 1 to 5 is performed.
7. An encoder having a processing circuit that performs the method according to any one of claims 1 to 5.
8. A decoder having a processing circuit that performs the method according to any one of claims 1 to 5.