A coding and decoding method, device and equipment thereof
By using the motion information angle prediction mode and duplicate checking processing technology in inter-frame coding, the motion information of the current block is obtained, which solves the problem in the existing technology that it is difficult to obtain the best motion information when the moving target is small, and achieves efficient coding performance. and bit savings.
Patent Information
- Application Number
- CN202211610564.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-03-05
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2039-03-05
AI Technical Summary
In the inter-frame encoding, in the current encoding unit, since all sub-blocks share one motion information, it is difficult to obtain the best motion information when the motion target is small, and the bit overhead caused by sub-block division is relatively large.
By obtaining the sports information prediction mode of the current block, including the motion information angle prediction mode, and checking it, determine the target sports information prediction mode to obtain the current block of the sports information, so as to do not perform the sub -block division of the current block. Provide different sports information for each sub -area.
Improving the coding performance, reducing bither overhead, enhancing the predictive accuracy of sports information, and solving the problem of transmitting a large amount of exercise information.
Smart Images

Figure CN116016946B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of coding and decoding technology, and in particular to a coding and decoding method, device and equipment thereof. Background Art
[0002] In order to save space, video images are transmitted after being encoded. The complete video encoding method may include prediction, transformation, quantization, entropy coding, filtering and other processes. Predictive coding includes intra-frame coding and inter-frame coding. Inter-frame coding uses the correlation of the video time domain to predict the pixels of the current image using the pixels of the adjacent encoded images, so as to effectively remove the redundancy of the video time domain.
[0003] In inter-frame coding, a motion vector (MV) can be used to represent the relative displacement between the current image block of the current frame video image and the reference image block of the reference frame video image. For example, there is a strong temporal correlation between the video image A of the current frame and the video image B of the reference frame. When the image block A1 (current image block) of the video image A needs to be transmitted, a motion search can be performed in the video image B to find the image block B1 (i.e., the reference image block) that best matches the image block A1, and determine the relative displacement between the image blocks A1 and B1, which is the motion vector of the image block A1.
[0004] In the prior art, there is no need to divide the current coding unit into blocks, but only one motion information can be determined for the current coding unit by directly indicating the motion information index or the difference information index.
[0005] Since all sub-blocks in the current coding unit share the same motion information, for some small moving targets, the coding unit needs to be divided into blocks to obtain the best motion information. However, if the current coding unit is divided into multiple sub-blocks, additional bit overhead will be generated. Summary of the invention
[0006] The present application provides a coding and decoding method and a device thereof, which can improve coding performance and save bits.
[0007] The present application provides a coding and decoding method, which is applied to a decoding end or an encoding end, and the method includes:
[0008] The motion information prediction mode of the current block is obtained, wherein the motion information prediction mode at least includes a motion information angle prediction mode; and the motion information angle prediction mode of the current block is subjected to duplication checking to obtain a duplication-checked motion information angle prediction mode.
[0009] The present application provides a coding and decoding method, which is applied to a decoding end or an encoding end, and the method includes:
[0010] If the target motion information prediction mode of the current block is the selected motion information angle prediction mode, then:
[0011] Determining motion information of a current block according to the motion information angle prediction mode;
[0012] According to the motion information of the current block, a prediction value of the current block is determined.
[0013] The present application provides a coding and decoding device, which is applied to a decoding end or an encoding end, and the device includes:
[0014] A first determination module, configured to determine the motion information of the current block according to the motion information angle prediction mode if the target motion information prediction mode of the current block is the selected motion information angle prediction mode;
[0015] The second determination module is used to determine the prediction value of the current block according to the motion information of the current block.
[0016] The present application provides a decoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0017] The processor is used to execute machine executable instructions to implement the following steps:
[0018] If the target motion information prediction mode of the current block is the selected motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0019] The present application provides an encoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;
[0020] The processor is used to execute machine executable instructions to implement the following steps:
[0021] If the target motion information prediction mode of the current block is the selected motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0022] As can be seen from the above technical solutions, in the embodiment of the present application, it is not necessary to divide the current block, which effectively solves the bit overhead caused by sub-block division. On the basis of not dividing the current block into sub-blocks, motion information is provided for each sub-region of the current block, and different sub-regions of the current block can correspond to the same or different motion information, thereby improving the coding performance, solving the problem of transmitting a large amount of motion information, and saving a large number of bits. By checking the motion information angle prediction mode for duplicates, the number of motion information angle prediction modes can be reduced, which can further improve the coding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings of the embodiments of the present application.
[0024] Figure 1 is a schematic diagram of a video coding framework in one implementation of the present application;
[0025] Figure 2A and Figure 2B is a schematic diagram of a division method in one implementation of the present application;
[0026] Figure 3A-Figure 3F This is a schematic diagram of an application scenario in one embodiment of the present application;
[0027] Figure 4 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0028] Figure 5A and Figure 5B is a schematic diagram of a motion information angle prediction mode in an implementation manner of the present application;
[0029] Figure 6 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0030] Figure 7 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0031] Figure 8 is a schematic diagram of surrounding blocks of a current block in one implementation of the present application;
[0032] Figure 9A-9N is a schematic diagram of a peripheral matching block in one embodiment of the present application;
[0033] Fig. 10A and Fig. 10Bis a structural diagram of a coding and decoding device in one embodiment of the present application;
[0034] Fig.11 is a hardware structure diagram of a decoding end device in one embodiment of the present application;
[0035] Fig.12 It is a hardware structure diagram of an encoding end device in one implementation of the present application. DETAILED DESCRIPTION
[0036] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the present application and claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items.
[0037] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the present embodiment, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" used may be interpreted as "at..." or "when..." or "in response to determination".
[0038] In an embodiment of the present application, a coding and decoding method is proposed, and the coding and decoding method may involve the following concepts:
[0039] Motion Vector (MV): In inter-frame coding, a motion vector is used to represent the relative displacement between the current image block of the current frame video image and the reference image block of the reference frame video image. For example, there is a strong temporal correlation between the video image A of the current frame and the video image B of the reference frame. When transmitting the image block A1 (current image block) of the video image A, a motion search can be performed in the video image B to find the image block B1 (reference image block) that best matches the image block A1, and determine the relative displacement between the image block A1 and the image block B1, which is the motion vector of the image block A1. Each divided image block has a corresponding motion vector transmitted to the decoding end. If the motion vector of each image block is independently encoded and transmitted, especially when it is divided into a large number of small-sized image blocks, a considerable number of bits are consumed. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent image blocks can be used to predict the motion vector of the current image block to be encoded based on the motion vectors of the adjacent encoded image blocks, and then the prediction difference is encoded, which can effectively reduce the number of bits representing the motion vector.
[0040] Exemplarily, in the process of encoding the motion vector of the current image block, the motion vector of the current macroblock can be first predicted using the motion vector of the adjacent encoded image block, and then the difference (MVD, Motion Vector Difference) between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the true estimate of the motion vector is encoded, thereby effectively reducing the number of encoding bits of the motion vector.
[0041] Motion Information: Since the motion vector represents the position offset between the current image block and a reference image block, in order to accurately obtain the information pointing to the image block, in addition to the motion vector, the index information of the reference frame image is also required to indicate which reference frame image to use. In video coding technology, for the current frame image, a reference frame image list can usually be established, and the reference frame image index information indicates which reference frame image in the reference frame image list is used by the current image block. Many coding technologies also support multiple reference image lists, so an index value can also be used to indicate which reference image list is used. This index value can be called a reference direction. In video coding technology, motion-related information such as motion vectors, reference frame indexes, and reference directions can be collectively referred to as motion information.
[0042] Rate-Distortion Optimized: There are two major indicators for evaluating coding efficiency: bit rate and PSNR (Peak Signal to Noise Ratio). The smaller the bit stream, the greater the compression rate, and the greater the PSNR, the better the quality of the reconstructed image. When selecting a mode, the discriminant formula is essentially a comprehensive evaluation of the two. For example, the cost corresponding to the mode: J (mode) = D + λ * R, illustratively, D represents Distortion, which can usually be measured using the SSE indicator. SSE refers to the mean square sum of the differences between the reconstructed image block and the source image; λ is the Lagrange multiplier, and R is the actual number of bits required for encoding the image block in this mode, including the sum of bits required for encoding mode information, motion information, residuals, etc.
[0043] Intra prediction and inter prediction technology: Intra prediction refers to the use of the reconstructed pixel values of the spatially adjacent image blocks of the current image block (i.e., in the same frame as the current image block) for predictive coding. Inter prediction refers to the use of the reconstructed pixel values of the temporally adjacent image blocks of the current image block (in different frames as the current image block) for predictive coding. Inter prediction uses the correlation of the video time domain. Since the video sequence contains strong temporal correlation, the pixels of the adjacent encoded images are used to predict the pixels of the current image, thereby effectively removing the temporal redundancy of the video.
[0044] CTU (Coding Tree Unit) refers to the maximum coding unit supported by the encoder and the maximum decoding unit supported by the decoder. For example, a frame of an image can be divided into several non-overlapping CTUs, and each CTU can be further divided into smaller blocks based on actual conditions.
[0045] Before introducing the technical solution of the embodiment of the present application, the following basic knowledge is briefly introduced:
[0046] See also Figure 1 , which is a schematic diagram of a video encoding framework, and the video encoding framework can be used to implement the encoding end processing flow of the embodiment of the present application, and the schematic diagram of the video decoding framework is similar to Figure 1 Similarly, without further elaboration here, a video decoding framework can be used to implement the decoding end processing flow of the embodiment of the present application.
[0047] Exemplarily, in the video encoding framework and the video decoding framework, modules such as intra-frame prediction, motion estimation / motion compensation, reference image buffer, in-loop filtering, reconstruction, transformation, quantization, inverse transformation, inverse quantization, and entropy encoder may be included. At the encoding end, the encoding end processing flow may be realized through the cooperation between these modules, and at the decoding end, the decoding end processing flow may be realized through the cooperation between these modules.
[0048] In the image block division technology, a CTU (Coding Tree Unit) can be recursively divided into CU (Coding Unit) using a quadtree, and the CU can be further divided into two or four PUs (Prediction Units). After the prediction is completed and the residual information is obtained, the CU can be further quad-divided into multiple TUs (Transform Units).
[0049] In VVC (Versatile Video Coding), the division of image blocks has undergone major changes, mixing the binary tree / ternary tree / quadtree division structure, that is, the concepts of CU, PU, and TU are cancelled, and a more flexible division method of CU is supported. CU can be divided into square or rectangular divisions, CTU is first divided into quadtrees, and then the leaf nodes of the quadtree division are divided into binary trees and ternary trees.
[0050] See also Figure 2A As shown in , CU can have five types of partitioning, namely quadtree partitioning, horizontal binary tree partitioning, vertical binary tree partitioning, horizontal ternary tree partitioning and vertical ternary tree partitioning. Figure 2B As shown, the partitioning of CUs within a CTU may be any combination of the above five partitioning types.
[0051] A brief introduction to the Merge mode: In the inter-frame prediction module, due to the strong temporal correlation of the video, that is, there are many similar image blocks between two adjacent frames in the temporal domain, the image block of the current frame often performs motion search in the adjacent reference image to find the block that best matches the current image block as the reference image block. Since the reference image block is highly similar to the current image block and the difference between the two is very small, the bitrate overhead of encoding the difference is usually much smaller than the bitrate overhead caused by directly encoding the pixel value of the current image block.
[0052] In order to indicate the position of the reference image block that best matches the current image block, a lot of motion information needs to be encoded and transmitted to the decoder so that the decoder can know the position of the reference image block. However, motion information, especially motion vectors, consume a lot of bit rate for encoding and transmission. In order to save this part of bit rate overhead, a coding mode that saves more motion information is currently designed, namely Merge mode.
[0053] In Merge mode, the motion information of the current image block completely reuses the motion information of a neighboring block in the temporal or spatial domain, that is, one motion information is selected from the motion information set of multiple surrounding image blocks as the motion information of the current image block. Therefore, in Merge mode, only one index value needs to be encoded to indicate which motion information in the motion information set is used by the current image block, thereby saving encoding overhead.
[0054] A brief introduction to the AMVP (Advanced Motion Vector Prediction) mode: The AMVP mode is similar to the Merge mode. Both use the idea of motion information prediction in the spatial and temporal domains. By establishing a candidate motion information list, the best candidate is selected as the motion information of the current image block through the rate-distortion cost. The difference between the AMVP mode and the Merge mode is reflected in the following: In the Merge mode, the MV of the current unit is directly predicted by the adjacent prediction units in the spatial or temporal domain, and there is no motion vector difference (Motion Vector Difference, MVD), while AMVP can be regarded as an MV prediction technology. The encoder only needs to encode the difference between the actual MV and the predicted MV, so there is MVD. The candidate MV queue lengths of the two are different, and the way to construct the MV list is also different.
[0055] In Merge mode, a candidate list is established for the current prediction unit. There are 5 candidate MVs (and their corresponding reference frame information) in the candidate list. By traversing these 5 candidate MVs and calculating the rate-distortion cost, the candidate MV with the smallest rate-distortion cost is finally selected as the best MV. If the encoder and decoder construct the candidate list in the same way, the encoder only needs to transmit the index of the best MV in the candidate list, which can greatly save the number of coding bits for motion information.
[0056] The candidate list established in Merge mode includes two cases: spatial domain and temporal domain. For B Slice, it also includes a combined list method. The spatial domain candidate list, temporal domain candidate list, and combined list are described below.
[0057] Establishment of airspace candidate list. Figure 3A As shown, A1 represents the prediction unit at the bottom left of the current prediction unit, B1 represents the prediction unit at the top right of the current prediction unit, B0 and A0 represent the prediction units closest to the top right and bottom left of the current prediction unit, respectively, and B2 represents the prediction unit closest to the top left corner of the current prediction unit. The HEVC standard stipulates that the spatial candidate list provides a maximum of 4 candidate MVs, that is, the motion information of a maximum of 4 candidate blocks of the above 5 candidate blocks is used, and the spatial candidate list is established in the order of A1-B1-B0-A0-(B2), where B2 is a substitute. When one or more of A1, B1, B0, and A0 do not exist, the motion information of B2 is required, otherwise, the motion information of B2 is not used.
[0058] The establishment of the time domain candidate list. Figure 3BAs shown in Figure 1, the temporal candidate list can be established by using the motion information of the prediction unit at the corresponding position of the current prediction unit in the adjacent coded image. Unlike the spatial candidate list, the temporal candidate list cannot directly use the motion information of the candidate block, but needs to make corresponding scaling adjustments based on the position relationship of the reference image. The HEVC standard stipulates that the temporal candidate list can only provide one candidate MV at most. Figure 3B The MV of the co-located prediction unit at the H position in is obtained by scaling. If the H position is not available, the co-located PU at the C3 position is used for replacement.
[0059] It should be noted that if the number of candidate MVs in the current candidate list does not reach 5, it is necessary to use default motion information (such as motion information (0,0) etc.) to fill in the gaps to reach the specified number.
[0060] Establishment of combination list. For the prediction unit in B Slice, since there are two MVs, its candidate list also needs to provide two prediction MVs. The HEVC standard stipulates that the combination list of B Slice can be generated by combining the first four candidate MVs in the MV candidates in pairs.
[0061] The establishment of the candidate list of the AMVP mode uses the correlation of motion vectors in the spatial and temporal domains to establish a candidate list for the current prediction unit. The encoder selects the best MV from the candidate list and performs differential encoding on the MV. The decoder establishes the same candidate list and only needs the motion vector residual (MVD) and the index value of the predicted MV in the candidate list to calculate the MV of the current prediction unit.
[0062] Establishment of airspace candidate list. Figure 3C As shown, a candidate MV is generated on the left and above the current prediction unit. The selection order on the left is A0-A1-scaled A0-scaled A1, and the selection order on the top is B0-B1-B2 (scaled B0-scaled B1-scaled B2). For the three PUs above, the scaling of their MVs can only be performed when the two PUs on the left are unavailable or both are in intra-frame prediction mode.
[0063] When the first "available" MV is detected on the left or above, use it as the candidate MV for the current prediction unit and do not perform the remaining steps. At most one candidate among A0, A1, scaled A0, scaled A1, and at most one candidate among B0, B1, B2, scaledB0, scaled B1, scaled B2.
[0064] It should be noted that only when the reference image corresponding to the candidate MV is the same as the current prediction unit, the candidate MV can be marked as "available"; otherwise, the candidate MV needs to be scaled accordingly.
[0065] The establishment of the time domain candidate list. The establishment of the time domain candidate list of AMVP is the same as that of Merge. When there are less than two spatial domain candidates and time domain candidates, they are supplemented with (0,0).
[0066] Although the Merge mode can greatly save the encoding overhead of motion information and the AMVP mode can improve the prediction accuracy of motion information, these two modes only have one motion information for the current coding unit, that is, all sub-blocks in the current coding unit share one motion information. For application scenarios where the moving target is small, the coding unit needs to be divided into blocks to obtain the best motion information. If the current coding unit is not divided, the current coding unit has only one motion information, and the prediction accuracy is not very high.
[0067] For example, see Figure 3D As shown in FIG. 1 , region C, region G, and region H are regions within the current coding unit, not sub-image blocks divided within the current coding unit. Assuming that the current coding unit uses the motion information of image block F, then each region within the current coding unit uses the motion information of image block F.
[0068] Obviously, since the distance between region H in the current coding unit and image block F is very far, if region H also uses the motion information of image block F, the prediction accuracy of the motion information of region H is not very high.
[0069] For example, if Figure 2A or Figure 2B The current coding unit can be divided into multiple sub-image blocks. Figure 3E As shown in FIG. 1 , sub-image block C, sub-image block G, sub-image block H and sub-image block I are sub-image blocks divided in the current coding unit. Since the current coding unit is divided into multiple sub-image blocks, each sub-image block in the current coding unit can use motion information independently. Figure 2A or Figure 2B The current coding unit is divided according to the division method, so extra bits are consumed to transmit the division method, which brings certain bit overhead.
[0070] Based on the working principle of Merge mode and AMVP mode, the motion information of some sub-image blocks in the current coding unit cannot use the coded motion information around the current coding unit, resulting in a reduction in the available motion information and low accuracy of the motion information. For example, for sub-image block I in the current coding unit, only the motion information of sub-image block C, sub-image block G, and sub-image block H can be used, while the motion information of image block A, image block B, image block F, image block D, and image block E cannot be used.
[0071] In view of the above findings, a coding and decoding method is proposed in an embodiment of the present application. On the basis of not dividing the current image block, that is, without increasing the overhead caused by sub-block division, the current image block can be made to correspond to multiple motion information, thereby improving the prediction accuracy of the motion information of the current image block. Since the current image block is not divided, it is possible to avoid consuming extra bits to transmit the division method, saving this part of the bit overhead. For each area of the current image block (note that this is any area within the current image block, the size of the area is smaller than the size of the current image block, and it is not a sub-image block obtained by dividing the current image block), the encoded motion information around the current image block can be used to obtain the motion information of each area of the current image block. In other words, different areas of the current image block can correspond to the same or different motion information, and the current image block may have multiple different motion information, thereby providing more motion information for the area inside the coding unit and improving the accuracy of the motion information.
[0072] See also Figure 3D As shown in the figure, C is a sub-region inside the current image block (i.e., the current coding unit), A, B, D, E, and F are the coded blocks around the current image block, and the motion information of the current sub-region C can be directly obtained by using the angle prediction method, and the other sub-regions (such as G, H, etc.) inside the current coding unit are also obtained by the same method. In this way, for the current coding unit, different motion information can be obtained without dividing the current coding unit into blocks, saving a part of the bit overhead of block division.
[0073] The current image block in the embodiment of the present application (hereinafter referred to as the current block) is any image unit in the encoding and decoding process, and the encoding and decoding process is performed in units of the current block, such as the CU in the above embodiment. Figure 3F As shown, the current block includes 9 regions (hereinafter referred to as sub-regions within the current block), such as sub-region f1 to sub-region f9. These are sub-regions within the current block, not sub-image blocks obtained by dividing the current block.
[0074] Different sub-regions in sub-region f1-sub-region f9 may correspond to the same or different motion information. Therefore, without dividing the current block, the current block may also correspond to multiple motion information, such as sub-region f1 corresponds to motion information 1, sub-region f2 corresponds to motion information 2, and so on.
[0075] Exemplarily, when determining the motion information of the sub-region f5, the motion information of the image block A1, the image block A2, the image block A3, the image block E, the image block B1, the image block B2, and the image block B3 may be used, that is, the motion information of the encoded blocks around the current block may be used, thereby providing more motion information for the sub-region f5. Of course, the motion information of other sub-regions of the current block may also be used.
[0076] The following describes the encoding and decoding method in the embodiment of the present application in combination with several specific embodiments.
[0077] Example 1: See Figure 4 FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The method can be applied to a decoding end or an encoding end. The method can include the following steps:
[0078] Step 401, obtaining a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode. Exemplarily, the motion information angle prediction mode is used to indicate a preconfigured angle, and a peripheral matching block is selected from the peripheral blocks of the current block for a sub-region of the current block according to the preconfigured angle, and one or more motion information of the current block is determined according to the motion information of the peripheral matching block; the peripheral matching block is a block at a specified position determined from the peripheral blocks according to the preconfigured angle.
[0079] Exemplarily, the surrounding blocks include blocks adjacent to the current block; or, the surrounding blocks include blocks adjacent to the current block and non-adjacent blocks. Of course, the surrounding blocks may also include other blocks, which is not limited.
[0080] In one example, the motion information angle prediction mode includes but is not limited to one of the following or any combination thereof: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, and vertical rightward prediction mode. Of course, the above are just a few examples, and there may be other types of motion information angle prediction modes, which are related to the preconfigured angle, such as 10 degrees or 20 degrees. Figure 5A As shown, it is a schematic diagram of a horizontal prediction mode, a vertical prediction mode, a horizontal upward prediction mode, a horizontal downward prediction mode, and a vertical rightward prediction mode. Different prediction modes correspond to different pre-configured angles.
[0081] Step 402 , performing a duplication check on the motion information angle prediction mode of the current block to obtain a duplication-checked motion information angle prediction mode, that is, removing duplicate motion information angle prediction modes.
[0082] Exemplarily, the motion information angle prediction mode of the current block is checked for duplication to obtain the motion information angle prediction mode after duplication checking, which may include but is not limited to: determining the motion information angle prediction mode to be checked for duplication; for any two first motion information angle prediction modes to be checked for duplication and second motion information angle prediction modes to be checked for duplication, then: the first motion information can be determined according to the first motion information angle prediction mode to be checked for duplication; and the second motion information can be determined according to the second motion information angle prediction mode to be checked for duplication; then, if the first motion information and the second motion information are the same, it can be determined that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated.
[0083] In one example, determining a motion information angle prediction mode to be checked for duplication may include, but is not limited to: for any motion information angle prediction mode, selecting a surrounding matching block pointed to by a pre-configured angle from surrounding blocks of the current block according to the pre-configured angle of the motion information angle prediction mode; selecting multiple surrounding matching blocks to be traversed from the surrounding matching blocks; if the motion information of the multiple traversed surrounding matching blocks are all the same, determining that the motion information angle prediction mode is the motion information angle prediction mode to be checked for duplication.
[0084] Exemplarily, the multiple surrounding matching blocks to be traversed may be a part of all surrounding matching blocks or all of them, which is related to the traversal step length. In different image blocks, the traversal step lengths may be the same or different.
[0085] In an example, after determining that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated, the repeated first motion information angle prediction mode may be removed; or the repeated second motion information angle prediction mode may be removed.
[0086] In one example, after the motion information angle prediction mode of the current block is checked for duplicates and the motion information angle prediction mode after the check is obtained, the motion information angle prediction mode for the second check for duplicates can also be determined from the motion information angle prediction mode after the check for duplicates; exemplarily, the motion information angle prediction mode after the check for duplicates can include a first part of the motion information angle prediction mode and a second part of the motion information angle prediction mode, the first part of the motion information angle prediction mode can be a motion information angle prediction mode that has not been checked for duplicates, the second part of the motion information angle prediction mode can include a motion information angle prediction mode after the duplication is removed from the motion information angle prediction mode for the check for duplicates, and the motion information angle prediction mode for the second check for duplicates can be the second part of the motion information angle prediction mode. Exemplarily, the motion information angle prediction mode for the second check for duplicates and the inter-frame prediction mode to be checked for duplicates in the prediction mode of the current block except the motion information angle prediction mode are checked for duplicates to obtain the motion information prediction mode after the check for duplicates.
[0087] In one example, the process of checking for duplicates of the motion information angle prediction mode of the secondary duplication check and the inter-frame prediction mode to be checked for duplicates other than the motion information angle prediction mode in the prediction mode of the current block may include but is not limited to: for any one of the motion information angle prediction modes of the secondary duplication check, obtaining the motion information of the motion information angle prediction mode; exemplarily, if the motion information of the motion information angle prediction mode is the same as the motion information of an inter-frame prediction mode to be checked for duplicates, it can be determined that the motion information angle prediction mode is a duplicate of the inter-frame prediction mode to be checked for duplicates.
[0088] In an example, the inter-frame prediction mode to be checked for duplicates may be any one of all non-angle inter-frame prediction modes corresponding to the current block, or the inter-frame prediction mode to be checked for duplicates may also be any one of some non-angle inter-frame prediction modes corresponding to the current block, without limitation.
[0089] In an example, the motion information angle prediction mode of the current block is checked for duplication, and after obtaining the motion information angle prediction mode after the check for duplication, the target motion information prediction mode of the current block can also be determined; if the target motion information prediction mode of the current block is the motion information angle prediction mode, then: the motion information of the current block can be determined based on the motion information angle prediction mode; the prediction value of the current block is determined based on the motion information of the current block.
[0090] It can be seen from the above technical solutions that in the embodiments of the present application, it is not necessary to divide the current block, and the division information of the sub-areas of the current block can be determined based on the motion information angle prediction mode and the current block size, which effectively solves the bit overhead caused by the sub-block division. On the basis of not dividing the current block into sub-blocks, motion information is provided for each sub-area of the current block, and different sub-areas of the current block can correspond to the same or different motion information, which can save a lot of coding bit overhead, thereby improving the coding performance. By checking the motion information angle prediction mode for duplicates, the number of motion information angle prediction modes can be reduced, and the coding performance can be further improved.
[0091] See also Figure 5B As shown, it is a schematic diagram of the horizontal prediction mode, the vertical prediction mode, the horizontal upward prediction mode, the horizontal downward prediction mode, and the vertical rightward prediction mode. Figure 5B It can be seen that different motion information angle prediction modes have the same effect on the current block, such as the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode, which have the same motion information for the current block.
[0092] If the duplicate checking process is not performed, when encoding the index of the horizontal downward prediction mode, since there are horizontal prediction modes, vertical prediction modes, and horizontal upward prediction modes in front (of course, the order of each angle prediction mode is not fixed, this is just an example), it may be necessary to encode 0001 to represent. However, if the duplicate checking process of the embodiment of the present application is performed, there is only a horizontal prediction mode in front of the horizontal downward prediction mode, and there is no vertical prediction mode and horizontal upward prediction mode (these two modes are removed by the duplicate checking process). Therefore, when encoding the index of the horizontal downward prediction mode, it may only be necessary to encode 01 to represent it, and there is no need to encode the vertical prediction mode and the horizontal upward prediction mode. Therefore, by performing duplicate checking on different motion information angle prediction modes, the bit overhead caused by encoding the motion information angle prediction mode index information is reduced. Moreover, the motion information angle prediction mode can be quickly checked for duplicates, saving the bit overhead of encoding and reducing the hardware complexity. In addition, when the motion information angle prediction mode is used for motion compensation, for the friendliness of hardware, bidirectional prediction of small blocks is prohibited.
[0093] Example 2: Based on the same application concept as the above method, see Figure 6 FIG. 1 is a flow chart of a coding and decoding method according to an embodiment of the present application. The method can be applied to a coding end. The method may include:
[0094] Step 601: the encoder creates a motion information prediction mode candidate list corresponding to the current block, where the motion information prediction mode candidate list includes multiple motion information prediction modes, such as motion information angle prediction mode.
[0095] The motion information angle prediction mode is used to indicate a preconfigured angle, select a surrounding matching block for a sub-region of the current block from the surrounding blocks of the current block according to the preconfigured angle, and determine one or more motion information of the current block according to the motion information of the surrounding matching block; the surrounding matching block is a block at a specified position determined from the surrounding blocks according to the preconfigured angle. The surrounding blocks include blocks adjacent to the current block; or, the surrounding blocks include blocks adjacent to the current block and non-adjacent blocks. Of course, the surrounding blocks may also include other blocks, which are not limited.
[0096] The motion information angle prediction mode includes but is not limited to one of the following or any combination: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode. Of course, the above are just a few examples, and there may be other types of motion information angle prediction modes.
[0097] In one example, it is necessary to create a motion information prediction mode candidate list corresponding to the current block, that is, both the encoding end and the decoding end need to create a motion information prediction mode candidate list corresponding to the current block.
[0098] The motion information prediction mode candidate list of the encoding end and the motion information prediction mode candidate list of the decoding end are the same according to the protocol agreement. The encoding end and the decoding end can adopt the same strategy to create the same motion information prediction mode candidate list. Of course, the above methods are just a few examples, and there is no limitation on this creation method, as long as the encoding end and the decoding end have the same motion information prediction mode candidate list.
[0099] Exemplarily, a motion information prediction mode candidate list may be created for the current block, that is, all sub-regions within the current block may correspond to the same motion information prediction mode candidate list; or, multiple motion information prediction mode candidate lists may be created for the current block. For different current blocks, the same or different motion information prediction mode candidate lists may correspond. For the convenience of description, it is taken as an example to create a motion information prediction mode candidate list for each current block, for example, current block A corresponds to motion information prediction mode candidate list 1, current block B corresponds to motion information prediction mode candidate list 1, and so on.
[0100] For example, the motion information prediction mode candidate list includes: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode. Of course, the above methods are just a few examples and are not limited to this. The preconfigured angle can be any angle between 0-360 degrees. The horizontal direction of the center point of the sub-area to the right can be positioned as 0 degrees. In this way, any angle rotated counterclockwise from 0 degrees can be a preconfigured angle, or the center point of the sub-area can be positioned as 0 degrees in other directions. In practical applications, the preconfigured angle can be a fractional angle, such as 22.5 degrees.
[0101] In one example, the motion information angle prediction mode in an embodiment of the present application can be an angle prediction mode for predicting motion information, that is, it is used in the inter-frame coding process instead of the intra-frame coding process, and the motion information angle prediction mode selects the matching block instead of the matching pixel point.
[0102] Step 602: the encoder performs duplicate checking on multiple motion information angle prediction modes in the motion information prediction mode candidate list to obtain a motion information angle prediction mode after duplicate checking. For the sake of distinction, the motion information angle prediction mode after duplicate checking can be referred to as a candidate motion information angle prediction mode.
[0103] For example, see Figure 5B As shown, assuming that the motion information prediction mode candidate list includes: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, and vertical right prediction mode in sequence, the horizontal prediction mode and the vertical prediction mode are checked for duplicates. If the two are repeated, the vertical prediction mode is removed from the motion information prediction mode candidate list. Then, the horizontal prediction mode and the horizontal upward prediction mode are checked for duplicates. If the two are repeated, the horizontal upward prediction mode is removed from the motion information prediction mode candidate list. Then, the horizontal prediction mode and the horizontal downward prediction mode are checked for duplicates. If the two are not repeated, the two are retained, and so on. Exemplarily, assuming that the motion information prediction mode candidate list finally leaves the horizontal prediction mode, the horizontal downward prediction mode, and the vertical right prediction mode, then the remaining motion information angle prediction modes are the candidate motion information angle prediction modes.
[0104] In one example, a plurality of motion information angle prediction modes in a motion information prediction mode candidate list are checked for duplicates to obtain candidate motion information angle prediction modes, which may include: determining the motion information angle prediction mode to be checked for duplicates; for any two first motion information angle prediction modes to be checked for duplicates and second motion information angle prediction modes to be checked for duplicates, then: the first motion information can be determined based on the first motion information angle prediction mode; the second motion information can be determined based on the second motion information angle prediction mode; then, if the first motion information and the second motion information are the same, it can be determined that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated.
[0105] In one example, determining the motion information angle prediction mode to be checked for duplication may include, but is not limited to: for any motion information angle prediction mode, selecting a surrounding matching block pointed to by a pre-configured angle from surrounding blocks of the current block according to the pre-configured angle of the motion information angle prediction mode; selecting multiple surrounding matching blocks to be traversed from these surrounding matching blocks; if the motion information of the multiple traversed surrounding matching blocks are all the same, it can be determined that the motion information angle prediction mode is the motion information angle prediction mode to be checked for duplication.
[0106] For example, see Figure 5B As shown, for the horizontal prediction mode, select the surrounding matching blocks pointed to by the pre-configured angle from all the surrounding blocks of the current block according to the pre-configured angle of the horizontal prediction mode, such as 10 surrounding matching blocks. Then, select multiple surrounding matching blocks from these 10 surrounding matching blocks (such as all or part of the 10 surrounding matching blocks, and 5 surrounding matching blocks are taken as an example later). If the motion information of the 5 surrounding matching blocks is the same, such as A1, then the horizontal prediction mode is determined to be the motion information angle prediction mode to be checked for duplication. Similarly, the vertical prediction mode and the horizontal upward prediction mode are the motion information angle prediction modes to be checked for duplication.
[0107] For the horizontal downward prediction mode, select the surrounding matching blocks pointed to by the preconfigured angles from all the surrounding blocks of the current block according to the preconfigured angles of the horizontal downward prediction mode, such as 8 surrounding matching blocks. Then, select multiple surrounding matching blocks from these 8 surrounding matching blocks (such as all or part of the 8 surrounding matching blocks, and 6 surrounding matching blocks are used as an example later). If the motion information of the 6 surrounding matching blocks is not exactly the same, such as A1, C1, C2, C3 and C4, the horizontal downward prediction mode is not the motion information angle prediction mode to be checked for duplication. Similarly, the vertical right prediction mode is not the motion information angle prediction mode to be checked for duplication.
[0108] Exemplarily, the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode are all motion information angle prediction modes to be checked for duplication. For the horizontal prediction mode and the vertical prediction mode, since the motion information of the horizontal prediction mode is A1, and the motion information of the vertical prediction mode is A1, that is, the two are the same, the horizontal prediction mode and the vertical prediction mode are repeated, and the vertical prediction mode is removed from the motion information prediction mode candidate list. For the horizontal prediction mode and the horizontal upward prediction mode, since the motion information of the horizontal prediction mode is A1, and the motion information of the horizontal upward prediction mode is A1, that is, the two are the same, the horizontal prediction mode and the horizontal upward prediction mode are repeated, and the horizontal upward prediction mode is removed from the motion information prediction mode candidate list. After the above processing, the motion information prediction mode candidate list finally leaves the horizontal prediction mode, the horizontal downward prediction mode, and the vertical right prediction mode, that is, the candidate motion information angle prediction mode.
[0109] It should be noted that if the motion information of the horizontal prediction mode is different from the motion information of the horizontal upward prediction mode, it is determined that the horizontal prediction mode and the horizontal upward prediction mode are not repeated, and the horizontal prediction mode or the horizontal upward prediction mode is not removed from the motion information prediction mode candidate list. Since the horizontal downward prediction mode and the vertical right prediction mode are not the motion information angle prediction modes to be checked for duplication, the horizontal downward prediction mode and the vertical right prediction mode are retained in the motion information prediction mode candidate list.
[0110] In one example, for any motion information angle prediction mode, according to the preconfigured angle of the motion information angle prediction mode, a surrounding matching block pointed to by the preconfigured angle is selected from the surrounding blocks of the current block (such as the 10 surrounding matching blocks mentioned above), and a plurality of surrounding matching blocks to be traversed (such as the 5 surrounding matching blocks mentioned above) are selected from these surrounding matching blocks. For example, the surrounding matching blocks to be traversed are determined according to the traversal step length. Assuming that the traversal step length is 2, the first surrounding matching block to be traversed is matching block 1, the second surrounding matching block to be traversed is matching block 3, and so on. Of course, other methods can also be used, and there is no limitation to this.
[0111] Exemplarily, for each surrounding matching block to be traversed, a surrounding matching block to be compared may be selected from all surrounding blocks of the current block for the surrounding matching block (e.g., the surrounding matching blocks may be selected as the surrounding matching blocks to be compared according to the traversal order, for example, the surrounding matching blocks to be compared are determined according to the traversal step length, assuming that the traversal step length is 2, and the first surrounding matching block to be traversed is matching block 1, then for matching block 1, the surrounding matching block to be compared is matching block 3). If the motion information of the surrounding matching block to be traversed is the same as the motion information of the surrounding matching block to be compared, the comparison value of the surrounding matching block to be traversed is set to the first identifier (e.g., 0). Alternatively, if the motion information of the surrounding matching block to be traversed is different from the motion information of the surrounding matching block to be compared, the comparison value of the surrounding matching block to be traversed is set to the second identifier (e.g., 1).
[0112] After performing the above processing on each surrounding matching block to be traversed, the comparison value of each surrounding matching block to be traversed can be obtained. If the comparison value of each surrounding matching block to be traversed is the first identifier, it means that the motion information of the traversed multiple surrounding matching blocks is the same, and the motion information angle prediction mode is determined to be the motion information angle prediction mode to be checked for duplicates. If the comparison value of any surrounding matching block to be traversed is the second identifier, it is determined that the motion information angle prediction mode is not the motion information angle prediction mode to be checked for duplicates.
[0113] For example, see Figure 5A As shown in the figure, assuming that the first surrounding matching block to be traversed is A3 and the traversal step length is 2, the second surrounding matching block to be traversed is A1, the third surrounding matching block to be traversed is B1, and the fourth surrounding matching block to be traversed is B3. For the surrounding matching block A3 to be traversed, the surrounding matching block to be compared is A1; for the surrounding matching block A1 to be traversed, the surrounding matching block to be compared is B1; for the surrounding matching block B1 to be traversed, the surrounding matching block to be compared is B3.
[0114] Based on this, it is determined whether the motion information of the surrounding matching block A3 to be traversed is the same as the motion information of the surrounding matching block A1 to be compared. If they are the same, the comparison value of the surrounding matching block A3 to be traversed is stored as the first identifier; if they are different, the comparison value of the surrounding matching block A3 to be traversed is stored as the second identifier.
[0115] Then, determine whether the motion information of the surrounding matching block A1 to be traversed is the same as the motion information of the surrounding matching block B1 to be compared. If they are the same, the comparison value of the surrounding matching block A1 to be traversed is stored as the first identifier. If they are different, the comparison value of the surrounding matching block A1 to be traversed is stored as the second identifier, and so on.
[0116] In one example, when determining the surrounding matching blocks to be traversed from the surrounding matching blocks of the current block, the selection can also be made according to different traversal step lengths. For example, two surrounding matching blocks are first determined according to a first traversal step length, and then the next surrounding matching block is determined according to a second traversal step length. There is no limitation to this.
[0117] In step 603, the encoder selects a candidate motion information angle prediction mode from each candidate motion information angle prediction mode in the motion information prediction mode candidate list, and determines the selected candidate motion information angle prediction mode as the target motion information angle prediction mode corresponding to the current block.
[0118] Exemplarily, for the processing of step 603, the process may include the following steps:
[0119] Step a1: for each candidate motion information angle prediction mode in the motion information prediction mode candidate list, determine a peripheral matching block corresponding to the current block according to the candidate motion information angle prediction mode.
[0120] For example, for each candidate motion information angle prediction mode, such as horizontal prediction mode, horizontal downward prediction mode, vertical right prediction mode, etc., see Figure 5A and Figure 5B As shown. Based on the preconfigured angle indicated by the horizontal prediction mode, the surrounding matching block 1 corresponding to the current block can be determined, such as multiple surrounding matching blocks 1, and the determination process will not be repeated. Based on the preconfigured angle indicated by the horizontal downward prediction mode, the surrounding matching block 2 corresponding to the current block can be determined, such as multiple surrounding matching blocks 2. Based on the preconfigured angle indicated by the vertical right prediction mode, the surrounding matching block 3 corresponding to the current block can be determined, such as multiple surrounding matching blocks 3.
[0121] In step a2, the encoder determines the rate-distortion cost corresponding to the candidate motion information angle prediction mode according to the motion information of the surrounding matching blocks (such as multiple motion information corresponding to multiple surrounding matching blocks).
[0122] For example, the rate-distortion cost 1 corresponding to the horizontal prediction mode is determined according to the motion information (i.e., multiple motion information) of multiple surrounding matching blocks 1. The rate-distortion cost 2 corresponding to the horizontal downward prediction mode is determined according to the motion information (i.e., multiple motion information) of multiple surrounding matching blocks 2. The rate-distortion cost 3 corresponding to the vertical right prediction mode is determined according to the motion information (i.e., multiple motion information) of multiple surrounding matching blocks 3.
[0123] In one example, based on multiple motion information of multiple surrounding matching blocks, the rate-distortion principle can be used to determine the rate-distortion cost corresponding to the candidate motion information angle prediction mode. The rate-distortion cost can be determined by the following formula: J(mode)=D+λ*R, where D represents Distortion, which can usually be measured using the SSE indicator, where SSE refers to the mean square sum of the differences between the reconstructed image block and the source image; λ is the Lagrange multiplier, and R is the actual number of bits required for encoding the image block in this mode, including the sum of bits required for encoding mode information, motion information, residuals, etc. There is no limitation on this determination method.
[0124] In step a3, the encoder determines the candidate motion information angle prediction mode with the minimum rate-distortion cost according to the rate-distortion cost corresponding to each candidate motion information angle prediction mode, and determines the candidate motion information angle prediction mode with the minimum rate-distortion cost as the target motion information angle prediction mode corresponding to the current block.
[0125] For example, assuming that the rate-distortion cost 1 corresponding to the horizontal prediction mode is less than the rate-distortion cost 2 corresponding to the horizontal downward prediction mode, and the rate-distortion cost 2 corresponding to the horizontal downward prediction mode is less than the rate-distortion cost 3 corresponding to the vertical right prediction mode, then the horizontal prediction mode can be the target motion information angle prediction mode.
[0126] Step 604: the encoder encodes the current block according to the target motion information angle prediction mode.
[0127] Exemplarily, the encoder may determine the motion information of each sub-region in the current block according to the target motion information angle prediction mode, and perform motion compensation on the sub-region using the motion information of each sub-region.
[0128] In an example, encoding the current block according to the target motion information angle prediction mode may include: determining the motion information of the current block according to the target motion information angle prediction mode; determining the prediction value of the current block according to the motion information of the current block, which is also a motion compensation process.
[0129] Exemplarily, determining the motion information of the current block according to the target motion information angle prediction mode includes:
[0130] Step 6041, according to the target motion information angle prediction mode and the size of the current block, determine the selection condition for obtaining motion information of the current block. Exemplarily, the selection condition can be a first selection condition or a second selection condition, the first selection condition is that the motion information selected from the motion information of the surrounding matching blocks is not allowed to be bidirectional motion information (i.e., unidirectional motion information, or forward motion information in the bidirectional motion information, or backward motion information in the bidirectional motion information is allowed), and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information (i.e., unidirectional motion information, forward motion information in the bidirectional motion information, and backward motion information in the bidirectional motion information are allowed).
[0131] For example, if the size of the current block satisfies: the width is greater than or equal to a preset size parameter (which can be configured based on experience, such as 8, etc.), and the height is greater than or equal to the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the second selection condition. If the size of the current block satisfies: the width is less than the preset size parameter, and the height is greater than the preset size parameter, when the target motion information angle prediction mode is the vertical prediction mode, the selection condition is determined to be the second selection condition; when the target motion information angle prediction mode is a prediction mode other than the vertical prediction mode, the selection condition is determined to be the first selection condition.
[0132] If the size of the current block satisfies: the height is less than the preset size parameter, and the width is greater than the preset size parameter, when the target motion information angle prediction mode is the horizontal prediction mode, the selection condition is determined to be the second selection condition; when the target motion information angle prediction mode is a prediction mode other than the horizontal prediction mode, the selection condition is determined to be the first selection condition. If the size of the current block satisfies: the height is less than the preset size parameter, and the width is less than the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the first selection condition. If the size of the current block satisfies: the height is less than the preset size parameter, and the width is equal to the preset size parameter, or the height is equal to the preset size parameter, and the width is less than the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the first selection condition.
[0133] Refer to Table 1 in the subsequent embodiments. Taking the preset size parameter of 8 as an example, "one-way" in Table 1 indicates that the selection condition is the first selection condition, that is, two-way motion information is not allowed, and "two-way" in Table 1 indicates that the selection condition is the second selection condition, that is, two-way motion information is allowed.
[0134] Step 6042, determining the sub-region division information of the current block according to the target motion information angle prediction mode and the size of the current block, that is, the sub-region division information represents the way of dividing the current block into sub-regions.
[0135] Exemplarily, when the target motion information angle prediction mode is a horizontal upward prediction mode, a horizontal downward prediction mode, or a vertical right prediction mode, if the width of the current block is greater than or equal to a preset size parameter, and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8; if the width of the current block is less than the preset size parameter, or the height of the current block is less than the preset size parameter, the size of the sub-area is 4*4.
[0136] When the target motion information angle prediction mode is the horizontal prediction mode, if the width of the current block is greater than the preset size parameter, the size of the sub-area is the width of the current block*4, or the size of the sub-area is 4*4; if the width of the current block is equal to the preset size parameter and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8; if the width of the current block is less than the preset size parameter, the size of the sub-area is 4*4.
[0137] When the target motion information angle prediction mode is the vertical prediction mode, if the height of the current block is greater than the preset size parameter, the size of the sub-area is 4*the height of the current block, or the size of the sub-area is 4*4; if the height of the current block is equal to the preset size parameter and the width of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8; if the height of the current block is less than the preset size parameter, the size of the sub-area is 4*4.
[0138] See Table 1 in the subsequent embodiments, taking the preset size parameter of 8 as an example.
[0139] In an example, the size of the current block, the motion information angle prediction mode, the size of the sub-region, and the direction of the sub-region (unidirectional represents the first selection condition, i.e., bidirectional motion information is not allowed, and bidirectional represents the second selection condition, i.e., bidirectional motion information is allowed) can be shown in Table 1 below.
[0140] Table 1
[0141]
[0142]
[0143] In an example, when the target motion information angle prediction mode is the horizontal prediction mode, if the width of the current block is greater than 8, the size of the sub-region may also be 4*4 of the current block.
[0144] In an example, when the target motion information angle prediction mode is a vertical prediction mode, if the height of the current block is greater than 8, the size of the sub-region may also be 4*4.
[0145] Step 6043: According to the pre-configured angle corresponding to the target motion information angle prediction mode, a surrounding matching block pointed to by the pre-configured angle is selected from surrounding blocks of the current block.
[0146] For example, for any one of the motion information angle prediction modes among the horizontal prediction mode, the vertical prediction mode, the horizontal upward prediction mode, the horizontal downward prediction mode, and the vertical right prediction mode, the preconfigured angle corresponding to the motion information angle prediction mode can be obtained. After the preconfigured angle is obtained, the surrounding matching block pointed to by the preconfigured angle can be selected from the surrounding blocks of the current block without any restriction.
[0147] Step 6044, determine the motion information of the current block according to the selection condition, the sub-region division information and the motion information of the surrounding matching block. For example, divide the current block into at least one sub-region according to the sub-region division information; for each sub-region of the current block, select a surrounding matching block corresponding to the sub-region from the surrounding matching blocks of the current block according to the target motion information angle prediction mode, and determine the motion information of the sub-region according to the motion information of the surrounding matching block corresponding to the sub-region and the selection condition. Then, the motion information of the at least one sub-region is determined as the motion information of the current block.
[0148] Selecting a surrounding matching block corresponding to the sub-region from the surrounding matching blocks of the current block according to the target motion information angle prediction mode may include but is not limited to: selecting a surrounding matching block pointed to by a pre-configured angle from the surrounding blocks of the current block according to a pre-configured angle corresponding to the target motion information angle prediction mode.
[0149] For example, referring to the above embodiment, it is assumed that the current block is divided into sub-region 1 and sub-region 2 according to the sub-region division information. For sub-region 1, a peripheral matching block 1 corresponding to sub-region 1 can be selected from the peripheral matching blocks of the current block according to the target motion information angle prediction mode (such as horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode, etc.). Assuming that the peripheral matching block 1 stores bidirectional motion information, including forward motion information and backward motion information, if the selection condition of sub-region 1 is the first selection condition, the forward motion information or backward motion information corresponding to the peripheral matching block 1 can be used as the motion information of sub-region 1. If the selection condition of sub-region 1 is the second selection condition, the bidirectional motion information corresponding to the peripheral matching block 1, including the forward motion information and the backward motion information, can be used as the motion information of sub-region 1.
[0150] For sub-region 2, a peripheral matching block 2 corresponding to sub-region 2 can be selected from the peripheral matching blocks of the current block according to the target motion information angle prediction mode. Assuming that the peripheral matching block 2 stores unidirectional motion information, the unidirectional motion information corresponding to the peripheral matching block 2 is used as the motion information of sub-region 2. Then, the motion information of sub-region 1 and the motion information of sub-region 2 can be determined as the motion information of the current block.
[0151] In an example, the motion information of the sub-region 1 and the motion information of the sub-region 2 may be stored in a 4*4 sub-block size.
[0152] In another example, the motion information of the current block is determined according to the target motion information angle prediction mode, including: determining the selection condition for obtaining the motion information of the current block according to the size of the current block; the selection condition is the second selection condition, and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information (allowing unidirectional motion information, forward motion information in the bidirectional motion information, and backward motion information in the bidirectional motion information). For example, if the size of the current block satisfies: the width is greater than or equal to a preset size parameter (configured according to experience, such as 8, etc.), and the height is greater than or equal to the preset size parameter, then the selection condition is directly determined to be the second selection condition, which is irrelevant to the target motion information angle prediction mode.
[0153] Then, according to the size of the current block, the sub-region division information of the current block is determined. For example, if the size of the current block satisfies: the width is greater than or equal to the preset size parameter (configured according to experience, such as 8, etc.), and the height is greater than or equal to the preset size parameter, then the size of the sub-region is 8*8, which is irrelevant to the target motion information angle prediction mode.
[0154] Then, according to the preconfigured angle corresponding to the target motion information angle prediction mode, a surrounding matching block pointed to by the preconfigured angle is selected from the surrounding blocks of the current block. For example, after the preconfigured angle is known, the surrounding matching block pointed to by the preconfigured angle can be selected from the surrounding blocks of the current block, and there is no restriction on this.
[0155] Then, the motion information of the current block is determined according to the selection condition, the sub-region division information and the motion information of the surrounding matching block. For example, the current block is divided into at least one sub-region according to the sub-region division information; for each sub-region of the current block, a surrounding matching block corresponding to the sub-region is selected from the surrounding matching blocks of the current block according to the target motion information angle prediction mode, and the motion information of the sub-region is determined according to the motion information of the surrounding matching blocks corresponding to the sub-region and the selection condition. Then, the motion information of the at least one sub-region is determined as the motion information of the current block.
[0156] Example 3: Based on the same application concept as the above method, see Figure 7 FIG. 1 is a flow chart of a coding and decoding method according to an embodiment of the present application. The method can be applied to a decoding end. The method may include:
[0157] Step 701: The decoding end creates a motion information prediction mode candidate list corresponding to the current block, where the motion information prediction mode candidate list includes multiple motion information prediction modes, such as a motion information angle prediction mode.
[0158] The motion information angle prediction mode includes but is not limited to one of the following or any combination: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode. Of course, the above are just a few examples, and there may be other types of motion information angle prediction modes.
[0159] Exemplarily, the motion information prediction mode candidate list at the decoding end is the same as the motion information prediction mode candidate list at the encoding end, that is, the order of the motion information angle prediction modes of the two is exactly the same.
[0160] Exemplarily, the implementation process of step 701 can refer to step 601, which will not be repeated here.
[0161] Step 702: The decoding end performs a duplicate check on multiple motion information angle prediction modes in the motion information prediction mode candidate list to obtain a motion information angle prediction mode after duplicate checking. For the sake of distinction, the motion information angle prediction mode after duplicate checking can be referred to as a candidate motion information angle prediction mode.
[0162] Exemplarily, the implementation process of step 702 can refer to step 602, which will not be repeated here.
[0163] Step 703: The decoder selects a candidate motion information angle prediction mode from each candidate motion information angle prediction mode in the motion information prediction mode candidate list, and determines the selected candidate motion information angle prediction mode as the target motion information angle prediction mode corresponding to the current block.
[0164] Exemplarily, for the processing of step 703, the process may include the following steps:
[0165] Step b1: The decoding end obtains indication information from the encoded bit stream, where the indication information is used to indicate index information of the target motion information angle prediction mode in the motion information prediction mode candidate list.
[0166] Exemplarily, when the encoder sends a coded bit stream to the decoder, the coded bit stream may carry indication information, and the indication information is used to indicate the index information of the target motion information angle prediction mode in the motion information prediction mode candidate list. For example, assuming that the motion information prediction mode candidate list includes a horizontal prediction mode, a horizontal downward prediction mode, and a vertical right prediction mode in sequence, and the horizontal prediction mode is the target motion information angle prediction mode, then the indication information is used to indicate index information 1, and index information 1 may represent the first candidate motion information angle prediction mode in the motion information prediction mode candidate list.
[0167] Step b2: The decoder selects a candidate motion information angle prediction mode corresponding to the index information from the motion information prediction mode candidate list, and determines the selected candidate motion information angle prediction mode as the target motion information angle prediction mode corresponding to the current block. For example, when the indication information is used to indicate index information 1, the decoder can determine the first candidate motion information angle prediction mode in the motion information prediction mode candidate list as the target motion information angle prediction mode corresponding to the current block.
[0168] Step 704: The decoding end decodes the current block according to the target motion information angle prediction mode.
[0169] Exemplarily, the decoding end may determine the motion information of each sub-region in the current block according to the target motion information angle prediction mode, and perform motion compensation on the sub-region using the motion information of each sub-region.
[0170] Exemplarily, the implementation process of step 704 can refer to step 604, which will not be repeated here.
[0171] Embodiment 4: Based on the same application concept as the above method, another encoding and decoding method is also proposed in the embodiment of the present application. The encoding and decoding method can be applied to the encoding end. The method may include:
[0172] Step c1, the encoder creates a motion information prediction mode candidate list corresponding to the current block, the motion information prediction mode candidate list includes multiple motion information angle prediction modes and motion information non-angle prediction modes (i.e., motion information prediction modes of a different type from the motion information angle prediction mode).
[0173] The implementation process of step c1 can refer to step 601. The difference from step 601 is that the motion information prediction mode candidate list includes not only the horizontal prediction mode, the vertical prediction mode, the horizontal upward prediction mode, the horizontal downward prediction mode, and the vertical right prediction mode, but also the motion information non-angle prediction mode. There is no restriction on the motion information non-angle prediction mode as long as it is different from the motion information angle prediction mode.
[0174] Step c2: the encoder performs duplicate checking on multiple motion information angle prediction modes in the motion information prediction mode candidate list to obtain a motion information angle prediction mode after duplicate checking. For the convenience of distinction, the motion information angle prediction mode after duplicate checking can be called a candidate motion information angle prediction mode.
[0175] Exemplarily, the implementation process of step c2 can refer to step 602, which will not be repeated here.
[0176] Step c3, the encoding end performs duplication checking on the candidate motion information angle prediction mode to be checked for duplication and the inter-frame prediction mode to be checked for duplication (that is, the inter-frame prediction mode to be checked for duplication other than the motion information angle prediction mode, which can be a motion information non-angle prediction mode) to obtain the motion information prediction mode after duplication checking.
[0177] Exemplarily, referring to the above step 602, after checking for duplicates of multiple motion information angle prediction modes, the candidate motion information angle prediction modes may include: horizontal prediction mode, horizontal downward prediction mode, and vertical right prediction mode. Then, the candidate motion information angle prediction mode to be checked for duplicates is determined from the horizontal prediction mode, the horizontal downward prediction mode, and the vertical right prediction mode. For the specific determination method, refer to step 602. Obviously, the horizontal prediction mode is the motion information angle prediction mode to be checked for duplicates, while the horizontal downward prediction mode and the vertical right prediction mode are not the motion information angle prediction modes to be checked for duplicates.
[0178] In summary, the candidate motion information angle prediction modes in the prediction mode candidate list may include a first part of motion information angle prediction modes and a second part of motion information angle prediction modes. The first part of motion information angle prediction modes are motion information angle prediction modes that have not been checked for duplication, for example, a horizontal downward prediction mode and a vertical right prediction mode. The second part of motion information angle prediction modes include motion information angle prediction modes after removing duplication from the checked motion information angle prediction modes, for example, a horizontal prediction mode. Obviously, the above-mentioned candidate motion information angle prediction modes to be checked for duplication (i.e., motion information angle prediction modes that have been checked for duplication twice) may be the second part of motion information angle prediction modes.
[0179] The motion information prediction mode candidate list includes motion information non-angle prediction modes (also called non-angle inter-frame prediction modes), and the number of non-angle inter-frame prediction modes is one or more, taking multiple as an example. For the inter-frame prediction mode to be checked for duplicates, it can be any one of all non-angle inter-frame prediction modes corresponding to the current block, or any one of some non-angle inter-frame prediction modes corresponding to the current block.
[0180] For any one of the candidate motion information angle prediction modes to be checked for duplication, such as the horizontal prediction mode, the motion information of the candidate motion information angle prediction mode is obtained. If the motion information of the candidate motion information angle prediction mode is the same as the motion information of an inter-frame prediction mode to be checked for duplication, it is determined that the candidate motion information angle prediction mode is repeated with the inter-frame prediction mode to be checked for duplication, and the candidate motion information angle prediction mode or the inter-frame prediction mode to be checked for duplication is removed from the motion information prediction mode candidate list. If the motion information of the candidate motion information angle prediction mode is different from the motion information of the inter-frame prediction mode to be checked for duplication, it is determined that the candidate motion information angle prediction mode is not repeated with the inter-frame prediction mode to be checked for duplication, and the candidate motion information angle prediction mode and the inter-frame prediction mode to be checked for duplication are retained in the motion information prediction mode candidate list.
[0181] Step c4: the encoder selects a motion information prediction mode from each motion information prediction mode (such as motion information angle prediction mode and motion information non-angle prediction mode) in the motion information prediction mode candidate list after duplication checking, and determines the selected motion information prediction mode as the target motion information prediction mode of the current block.
[0182] Exemplarily, the implementation process of step c4 can refer to step 603. The difference from step 603 is that in step 603, a comparison is made based on the cost value of each motion information angle prediction mode, and the motion information angle prediction mode with a smaller cost value is selected as the target motion information prediction mode, while in step c4, a comparison is made based on the cost values of all motion information prediction modes after duplication checking (such as motion information angle prediction mode, motion information non-angle prediction mode), and the motion information prediction mode with a smaller cost value is selected as the target motion information prediction mode, that is, the target motion information prediction mode may be a motion information angle prediction mode or a motion information non-angle prediction mode, which will not be repeated here.
[0183] Step c5: The encoder performs motion compensation on the current block according to the target motion information prediction mode.
[0184] If the target motion information prediction mode is the motion information angle prediction mode, the encoder determines the motion information of each sub-region in the current block according to the motion information angle prediction mode, and uses the motion information of each sub-region to perform motion compensation on the sub-region. If the target motion information prediction mode is the motion information non-angle prediction mode, the encoder determines the motion information of each sub-region in the current block according to the motion information non-angle prediction mode, and uses the motion information of each sub-region to perform motion compensation on the sub-region.
[0185] Exemplarily, the implementation process of step c5 may refer to step 604, which will not be repeated here.
[0186] Embodiment 5: Based on the same application concept as the above method, another encoding and decoding method is also proposed in the embodiment of the present application. The encoding and decoding method can be applied to the decoding end. The method may include:
[0187] Step d1, the decoding end creates a motion information prediction mode candidate list corresponding to the current block, and the motion information prediction mode candidate list includes multiple motion information angle prediction modes and motion information non-angle prediction modes (that is, motion information prediction modes of a different type from the motion information angle prediction mode).
[0188] Step d2: The decoding end performs duplicate checking on multiple motion information angle prediction modes in the motion information prediction mode candidate list to obtain a motion information angle prediction mode after duplicate checking. For the convenience of distinction, the motion information angle prediction mode after duplicate checking can be called a candidate motion information angle prediction mode.
[0189] Step d3, the decoding end performs duplication checking on the candidate motion information angle prediction mode to be checked and the inter-frame prediction mode to be checked (that is, the inter-frame prediction mode to be checked for duplication other than the motion information angle prediction mode, which can be a motion information non-angle prediction mode) to obtain the motion information prediction mode after duplication checking.
[0190] Step d4: The decoding end selects a motion information prediction mode from each motion information prediction mode (such as motion information angle prediction mode, motion information non-angle prediction mode) in the motion information prediction mode candidate list, and determines the selected motion information prediction mode as the target motion information prediction mode of the current block.
[0191] Step d5: The decoding end performs motion compensation on the current block according to the target motion information prediction mode.
[0192] Exemplarily, the implementation of steps d1 to d5 may refer to steps c1 to c5, which will not be described in detail here.
[0193] Embodiment 6: Based on the same application concept as the above method, the present embodiment proposes another encoding and decoding method, which can be applied to the encoding end or the decoding end. Figure 8 As shown, the surrounding blocks of the current block may include surrounding blocks A1, surrounding blocks A2, ..., surrounding blocks Am, surrounding blocks Am+1, ..., surrounding blocks Am+n, surrounding blocks Am+n+1, surrounding blocks Am+n+2, ..., surrounding blocks A2m+n+1, surrounding blocks A2m+n+2, ..., surrounding blocks A2m+2n+1. In summary, the surrounding blocks of the current block may include, but are not limited to, blocks adjacent to the current block, blocks non-adjacent to the current block, and even blocks in other adjacent frames, without limitation.
[0194] See also Figure 8As shown, the width and height of the current block are W and H respectively, that is, the width value of the current block is W, the height value of the current block is H, and the motion information of the surrounding blocks is saved in a minimum unit of 4x4.
[0195] In Example 6, the duplicate checking process of the above examples is explained through several specific application scenarios.
[0196] based on Figure 8 As shown, the encoding and decoding method is described below in combination with several specific application scenarios.
[0197] Application scenario 1: m and n are W / 4 and H / 4 respectively, let i be any integer in [1,m], let j=i+step, 1<=step<=Max(m,n), step is the traversal step length, which is an integer, Max(m,n) is the maximum value of m and n, let k be any integer in [2m+n+2,2m+2n+1]. Based on this, the comparison process is:
[0198] Step e1, determine whether j is greater than k, if so, exit the comparison process, otherwise execute step e2.
[0199] Step e2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0200] Exemplarily, if the motion information of the surrounding block Ai is the same as the motion information of the surrounding block Aj, Diff[i] of the surrounding block Ai may be recorded as 0; if the motion information of the surrounding block Ai is different from the motion information of the surrounding block Aj, Diff[i] of the surrounding block Ai may be recorded as 1. After step e2, step e3 is executed.
[0201] Step e3, let i=j, j=j+step, the value of step is any integer in [1,Max(m,n)], the value of step can be the same each time, or it can be different each time, and then return to step e1.
[0202] After the above processing, after exiting the comparison process, the motion information angle prediction mode in the motion information prediction mode candidate list may be checked for duplication according to the comparison result (ie, the value of Diff).
[0203] For the horizontal prediction mode, the j Diff[i] values in the interval [m+1,m+n] are judged, 1<=j<=n. If all j Diff values are 0, mode[0]=0, which means that the motion information is the same. The motion information M[0] is recorded as A. k , k is any integer in the interval [m+1,m+n]; otherwise, mode[0]=1, which means that the motion information is not completely the same.
[0204] For the vertical prediction mode, the j Diff[i] values in the interval [m+n+2, 2m+n+1] are judged, 1<=j<=m. If all j Diff values are 0, mode[1]=0 is recorded, and the motion information M[1] is recorded as A. k , k is any integer in the interval [m+n+2,2m+n+1]; otherwise, mode[1]=1.
[0205] For the horizontal upward prediction mode, if i belongs to any j Diff[i] values in the interval [m+1,2m+n+1], 1<=j<=m+n+1. If any j Diff values are all 0, then mode[2]=0, and the motion information M[2] is recorded as A. k , k is any integer in the interval [m+1,2m+n+1]; otherwise, mode[2]=1.
[0206] For the horizontal downward prediction mode, the j Diff[i] values in the interval [1, m+n] are judged, 1<=j<=m+n. If all j Diff values are 0, mode[3]=0 is recorded, and the motion information M[3] is recorded as A. k , k is any integer in the interval [1, m+n]; otherwise, mode[3]=1.
[0207] For the vertical right prediction mode, if i belongs to any j Diff[i] values in the interval [m+n+2,2m+2n+1], 1<=j<=m+n. If any j Diff values are all 0, record mode[4]=0, and the motion information M[4] is recorded as A. k , k is any integer in the interval [m+n+2,2m+2n+1]; otherwise, mode[4]=1.
[0208] After the above processing, if the mode value of the motion information angle prediction mode is 0, then the motion information angle prediction mode is the motion information angle prediction mode to be checked for duplication. Based on this, first find all motion information angle prediction modes with a mode value of 0. For example, if mode[0] = 0, mode[1] = 0, mode[2] = 0, then the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode are the motion information angle prediction modes to be checked for duplication. Then, compare whether the motion information M[0] is the same as the motion information M[1]. If they are the same, it means that the horizontal prediction mode and the vertical prediction mode are duplicated. If they are different, it means that the horizontal prediction mode and the vertical prediction mode are not duplicated. Similarly, compare whether the motion information M[0] is the same as the motion information M[2]. If they are the same, it means that the horizontal prediction mode and the horizontal upward prediction mode are duplicated. If they are different, it means that the horizontal prediction mode and the horizontal upward prediction mode are not duplicated. And so on. The determination of whether there is duplication will not be elaborated here.
[0209] Application scenario 2: The width W of the current block is greater than or equal to 32, the height H is greater than or equal to 32, and the sizes of m and n are W / 4 and H / 4. Let i = W / 16, j = i + step, step = W / 16, and perform the following comparison process:
[0210] Step f1: Determine whether j is greater than 2m + 2n + 1. If so, exit the comparison process. Otherwise, execute step f2.
[0211] Step f2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0212] Exemplarily, if the motion information of the surrounding block Ai is the same as the motion information of the surrounding block Aj, then Diff[i] of the surrounding block Ai can be recorded as 0; if the motion information of the surrounding block Ai is different from the motion information of the surrounding block Aj, then Diff[i] of the surrounding block Ai can be recorded as 1. After step f2, execute step f3.
[0213] Step f3: Determine whether m <= j < m + n holds. If it holds, then step = H / 16; otherwise, it can also be determined whether m + n <= j < m + n + 2 holds. If it holds, then step = 1; otherwise, further determine whether m + n + 2 <= j < 2m + n + 1 holds. If it holds, then step = W / 16; otherwise, determine whether 2m + n + 1 <= j < 2m + 2n + 1 holds. If it holds, then step = H / 16; otherwise, step remains unchanged.
[0214] Step f4: Let i = j, j = j + step, and then return to step f1 for processing.
[0215] After the above processing, after exiting the comparison process, the motion information angle prediction mode in the motion information prediction mode candidate list may be checked for duplication according to the comparison result (ie, the value of Diff).
[0216] For the horizontal prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be m+nH / 16, m+nH / 8, and m+nH / 16*3. If all the Diff values are 0, mode[0]=0 can be recorded, and the motion information M[0] can be recorded as Am+n; otherwise, mode[0]=1.
[0217] For the vertical prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be m+n+2, m+n+2+W / 16, and m+n+2+W / 8. If all the Diff values are 0, mode[1]=0 can be recorded, and the motion information M[1] can be recorded as Am+n+2; otherwise, mode[1]=1.
[0218] For the horizontal upward prediction mode, multiple Diff[i] values are judged. The value of i can be m+nH / 8, m+nH / 16, m+n, m+n+1, m+n+2, m+n+2+W / 16. If all the Diff values are 0, mode[2]=0 and the motion information M[2] is Am+n+1; otherwise, mode[2]=1.
[0219] For the horizontal downward prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be W / 16, W / 8, W / 16*3, m, m+H / 16, and m+H / 8. If all the Diff values are 0, mode[3]=0 is recorded, and the motion information M[3] is recorded as Am; otherwise, mode[3]=1 is recorded.
[0220] For the vertical right prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be m+n+2+W / 16, m+n+2+W / 8, m+n+2+W / 16*3, 2m+n+2, 2m+n+2+H / 16 and 2m+n+2+H / 8. If the values of these Diffs are all 0, mode[4]=0 can be recorded, and the motion information M[4] can be recorded as A2m+n+2; otherwise, mode[4]=1 can be recorded.
[0221] Based on this, first find all the motion information angle prediction modes with mode value 0, such as mode[0]=0, mode[1]=0, mode[2]=0. Then, compare whether the motion information M[0] is the same as the motion information M[1]. If they are the same, it means that the horizontal prediction mode and the vertical prediction mode are repeated. If they are different, it means that the horizontal prediction mode and the vertical prediction mode are not repeated. And so on, the determination of whether it is repeated will not be elaborated here.
[0222] Application scenario 3: The width W of the current block is greater than or equal to 32, and the height H is less than 32. The sizes of m and n are W / 4 and H / 4. Let i = W / 16, j = i + step, step = W / 16, and perform the following comparison process:
[0223] Step g1: Determine whether j is greater than 2m + 2n + 1. If so, exit the comparison process; otherwise, execute step g2.
[0224] Step g2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0225] Exemplarily, if the motion information of the surrounding block Ai is the same as the motion information of the surrounding block Aj, then Diff[i] of the surrounding block Ai can be recorded as 0; if the motion information of the surrounding block Ai is different from the motion information of the surrounding block Aj, then Diff[i] of the surrounding block Ai can be recorded as 1. After step g2, execute step g3.
[0226] Step g3: Determine whether m <= j < m + n + 2 holds. If it holds, then step = 1; otherwise, determine whether m + n + 2 <= j < 2m + n + 1 holds. If it holds, then step = W / 16; otherwise, determine whether 2m + n + 1 <= j < 2m + 2n + 1 holds. If it holds, then step = 1; otherwise, step remains unchanged.
[0227] Step g4: Let i = j, j = j + step, and then return to step g1 for processing.
[0228] After the above processing, after exiting the comparison process, the motion information angle prediction modes in the motion information prediction mode candidate list can be checked for duplicates according to the comparison result (i.e., the value of Diff).
[0229] For the horizontal prediction mode, judge the values of multiple Diff[i]. Exemplarily, the value of i can be an integer in [m + 1, m + n - 1]. If there is no i value that meets the conditions, or if these Diff values are all 0, then record mode[0] = 0, and the motion information M[0] is recorded as Am + n; otherwise, record mode[0] = 1.
[0230] For the vertical prediction mode, multiple Diff[i] values are judged. For example, the value of i can be m+n+2, m+n+2+W / 16, and m+n+2+W / 8. If all the Diff values are 0, mode[1]=0 is recorded, and the motion information M[1] is recorded as Am+n+2; otherwise, mode[1]=1 is recorded.
[0231] For the horizontal upward prediction mode, multiple Diff[i] values are judged, and the value of i can be any integer in m+n+2, m+n+2+W / 16, and [m+2, m+n+1]. If all the Diff values are 0, mode[2]=0 and the motion information M[2] is Am+n+1; otherwise, mode[2]=1.
[0232] For the horizontal downward prediction mode, multiple Diff[i] values are judged. For example, the value of i is W / 16, W / 8, W / 16*3, and each integer in [m, m+n-2]. If all the Diff values are 0, mode[3]=0 is recorded, and the motion information M[3] is recorded as Am; otherwise, mode[3]=1 is recorded.
[0233] For the vertical right prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be m+n+2+W / 16, m+n+2+W / 8, m+n+2+W / 16*3, and any integer in [2m+n+2,2m+2n]. For example, if all these Diff values are 0, mode[4]=0 can be recorded, and the motion information M[4] can be recorded as A2m+n+2; otherwise, mode[4]=1 can be recorded.
[0234] Based on this, first find all motion information angle prediction modes with mode value 0, such as mode[0] = 0, mode[1] = 0, mode[2] = 0. Then, compare whether the motion information M[0] is the same as the motion information M[1]. If they are the same, it means that the horizontal prediction mode and the vertical prediction mode are repeated. If they are different, it means that the horizontal prediction mode and the vertical prediction mode are not repeated, and so on. The determination of whether it is repeated will not be repeated.
[0235] Application scenario 4: The width W of the current block is less than 32, the height H is greater than or equal to 32, and the sizes of m and n are W / 4 and H / 4. Let i=1, j=i+step, step=1. Based on this, the following comparison process can be performed:
[0236] Step h1, determine whether j is greater than 2m+2n+1, if so, exit the comparison process, otherwise execute step h2.
[0237] Step h2: Compare the motion information of the peripheral block Ai with the motion information of the peripheral block Aj.
[0238] Exemplarily, if the motion information of the peripheral block Ai is the same as the motion information of the peripheral block Aj, then Diff[i] of the peripheral block Ai can be recorded as 0; if the motion information of the peripheral block Ai is different from the motion information of the peripheral block Aj, then Diff[i] of the peripheral block Ai can be recorded as 1. After step h2, step h3 is executed.
[0239] Step h3: Determine whether m <= j < m + n holds. If it holds, then step = H / 16; otherwise, it can be determined whether m + n <= j < m + n + 2 holds; if it holds, then step = 1; otherwise, exemplarily determine whether m + n + 2 <= j < 2m + n + 1 holds. If it holds, then step = 1; otherwise, determine whether 2m + n + 1 <= j < 2m + 2n + 1 holds. If it holds, then step = H / 16; otherwise, step remains unchanged.
[0240] Step h4: Let i = j, j = j + step, and then return to step h1 for processing.
[0241] After the above processing, after exiting the comparison process, the motion information angle prediction modes in the motion information prediction mode candidate list can be checked for duplicates according to the comparison results (i.e., the values of Diff).
[0242] For the horizontal prediction mode, the values of multiple Diff[i] can be judged. Exemplarily, the value of i can be m + n - H / 16, m + n - H / 8, and m + n - H / 16 * 3. If all these Diff values are 0, then mode[0] = 0 can be recorded, and the motion information M[0] is recorded as Am + n; otherwise, mode[0] = 1 can be recorded.
[0243] For the vertical prediction mode, the values of multiple Diff[i] can be judged. Exemplarily, the value of i can be all integers in [m + n + 2, 2m + n]. If all these Diff values are 0, then mode[1] = 0 is recorded, and the motion information M[1] can be recorded as Am + n + 2; otherwise, mode[1] = 1 can be recorded.
[0244] For the horizontal upward prediction mode, the values of multiple Diff[i] are judged. The value of i is all integer values in m + n - H / 8, m + n - H / 16, m + n, [m + n + 1, 2m + n - 1]. If all these Diff values are 0, then mode[2] = 0 is recorded, and the motion information M[2] is recorded as Am + n + 1; otherwise, mode[2] = 1 is recorded.
[0245] For the horizontal downward prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be m, m+H / 16, m+H / 8, and all integer values in [1, m-1]. If all the Diff values are 0, mode[3]=0 can be recorded, and the motion information M[3] is recorded as Am; otherwise, mode[3]=1.
[0246] For the vertical right prediction mode, multiple Diff[i] values are judged, and the value of i is all integer values among 2m+n+2, 2m+n+2+H / 16, 2m+n+2+H / 8, [m+n+3, 2m+n+1]. If all the Diff values are 0, then mode[4]=0 is recorded, and the motion information M[4] is recorded as A2m+n+2; otherwise, mode[4]=1 is recorded.
[0247] Based on this, first find all motion information angle prediction modes with mode value 0, such as mode[0] = 0, mode[1] = 0, mode[2] = 0. Then, compare whether the motion information M[0] is the same as the motion information M[1]. If they are the same, it means that the horizontal prediction mode and the vertical prediction mode are repeated. If they are different, it means that the horizontal prediction mode and the vertical prediction mode are not repeated, and so on. The determination of whether it is repeated will not be repeated.
[0248] Application scenario 5: The width W of the current block is less than 32, the height H is less than 32, and the sizes of m and n are W / 4 and H / 4 respectively. Let i=1, j=i+step, step=1. Based on this, the following comparison process can be performed:
[0249] Step s1, determine whether j is greater than 2m+2n+1, if so, exit the comparison process, otherwise execute step s2.
[0250] Step s2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0251] Exemplarily, if the motion information of the surrounding block Ai is the same as the motion information of the surrounding block Aj, Diff[i] of the surrounding block Ai may be recorded as 0; if the motion information of the surrounding block Ai is different from the motion information of the surrounding block Aj, Diff[i] of the surrounding block Ai may be recorded as 1. After step s2, step s3 is executed.
[0252] Step s3, let i=j, j=j+step, then return to step s1 for processing.
[0253] After the above processing, after exiting the comparison process, the motion information angle prediction mode in the motion information prediction mode candidate list may be checked for duplication according to the comparison result (ie, the value of Diff).
[0254] For the horizontal prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be all integers in [m+1, m+n-1]. If all the Diff values are 0, mode[0]=0 can be recorded, and the motion information M[0] can be recorded as Am+n; otherwise, mode[0]=1 can be recorded.
[0255] For the vertical prediction mode, multiple Diff[i] values can be judged. For example, the value of i is all integers in [m+n+2, 2m+n]. If all the Diff values are 0, mode[1]=0 can be recorded, and the motion information M[1] is recorded as Am+n+2; otherwise, mode[1]=1.
[0256] For the horizontal upward prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be all integers in [m+2, 2m+n-1]. If all the Diff values are 0, mode[2]=0 can be recorded, and the motion information M[2] is recorded as Am+n+1; otherwise, mode[2]=1.
[0257] For the horizontal downward prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be all integers in [1, m+n-2]. If all the Diff values are 0, mode[3]=0 can be recorded, and the motion information M[3] can be recorded as Am; otherwise, mode[3]=1 can be recorded.
[0258] For the vertical right prediction mode, multiple Diff[i] values can be judged. For example, the value of i can be all integers in [m+n+3, 2m+2n]. If all the Diff values are 0, mode[4]=0 can be recorded, and the motion information M[4] can be recorded as A2m+n+2; otherwise, mode[4]=1 can be recorded.
[0259] Based on this, first find all motion information angle prediction modes with mode value 0, such as mode[0] = 0, mode[1] = 0, mode[2] = 0. Then, compare whether the motion information M[0] is the same as the motion information M[1]. If they are the same, it means that the horizontal prediction mode and the vertical prediction mode are repeated. If they are different, it means that the horizontal prediction mode and the vertical prediction mode are not repeated, and so on. The determination of whether it is repeated will not be repeated.
[0260] Embodiment 7: Based on the same application concept as the above method, another encoding and decoding method is proposed in the embodiment of the present application, which can be applied to the encoding end or the decoding end. In one example, if the target motion information prediction mode of the current block is the selected motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0261] Exemplarily, determining the motion information of the current block according to the motion information angle prediction mode includes: determining the selection condition for obtaining the motion information of the current block according to the motion information angle prediction mode and the size of the current block; wherein the selection condition is a first selection condition or a second selection condition, the first selection condition is that the motion information selected from the motion information of the surrounding matching blocks is not allowed to be bidirectional motion information, and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information. Determine the sub-region division information of the current block according to the motion information angle prediction mode and the size of the current block. According to the pre-configured angle corresponding to the motion information angle prediction mode, select the surrounding matching blocks pointed to by the pre-configured angle from the surrounding blocks of the current block. Determine the motion information of the current block according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
[0262] Not allowing bidirectional motion information includes: if the motion information of the surrounding matching block is unidirectional motion information, allowing the unidirectional motion information of the surrounding matching block to be selected as the motion information of the current block or sub-region; if the motion information of the surrounding matching block is bidirectional motion information, allowing the forward motion information or the backward motion information in the bidirectional motion information of the surrounding matching block to be selected as the motion information of the current block or sub-region.
[0263] Allowing bidirectional motion information includes: if the motion information of the surrounding matching block is unidirectional motion information, allowing the unidirectional motion information of the surrounding matching block to be selected as the motion information of the current block or sub-region; if the motion information of the surrounding matching block is bidirectional motion information, allowing the bidirectional motion information of the surrounding matching block to be selected as the motion information of the current block or sub-region.
[0264] Exemplarily, according to the motion information angle prediction mode and the size of the current block, determining the selection condition for obtaining the motion information of the current block may include but is not limited to: if the size of the current block satisfies: the width is greater than or equal to the preset size parameter, and the height is greater than or equal to the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the second selection condition. If the size of the current block satisfies: the width is less than the preset size parameter, and the height is greater than the preset size parameter, when the motion information angle prediction mode is the vertical prediction mode, the selection condition is determined to be the second selection condition; when the motion information angle prediction mode is a prediction mode other than the vertical prediction mode, the selection condition is determined to be the first selection condition. If the size of the current block satisfies: the height is less than the preset size parameter, and the width is greater than the preset size parameter, when the motion information angle prediction mode is the horizontal prediction mode, the selection condition is determined to be the second selection condition; when the motion information angle prediction mode is a prediction mode other than the horizontal prediction mode, the selection condition is determined to be the first selection condition. If the size of the current block satisfies: the height is less than the preset size parameter, and the width is less than the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the first selection condition. If the size of the current block satisfies: the height is less than the preset size parameter and the width is equal to the preset size parameter, or the height is equal to the preset size parameter and the width is less than the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the first selection condition.
[0265] In one example, the sub-region division information of the current block is determined according to the motion information angle prediction mode and the size of the current block, which may include but is not limited to:
[0266] When the motion information angle prediction mode is the horizontal upward prediction mode, the horizontal downward prediction mode, or the vertical right prediction mode, if the width of the current block is greater than or equal to the preset size parameter, and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-region is 8*8; if the width of the current block is less than the preset size parameter, or the height of the current block is less than the preset size parameter, the size of the sub-region is 4*4;
[0267] When the motion information angle prediction mode is the horizontal prediction mode, if the width of the current block is less than the preset size parameter, the size of the sub-area is 4*4, and the height of the current block may be greater than the preset size parameter, may be equal to the preset size parameter, or may be less than the preset size parameter; if the width of the current block is greater than the preset size parameter, the size of the sub-area is the width of the current block*4, or the size of the sub-area is 4*4, and the height of the current block may be greater than the preset size parameter, may be equal to the preset size parameter, or may be less than the preset size parameter; if the width of the current block is equal to the preset size parameter, and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8.
[0268] When the motion information angle prediction mode is the vertical prediction mode, if the height of the current block is less than the preset size parameter, the size of the sub-area is 4*4, and the width of the current block may be greater than the preset size parameter, may be equal to the preset size parameter, or may be less than the preset size parameter; if the height of the current block is greater than the preset size parameter, the size of the sub-area is 4*height of the current block, or the size of the sub-area is 4*4, and the width of the current block may be greater than the preset size parameter, may be equal to the preset size parameter, or may be less than the preset size parameter; if the height of the current block is equal to the preset size parameter, and the width of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8.
[0269] In one example, the preset size parameter may be 8.
[0270] In an example, when the preset size parameter is 8, the conditions for determining the sub-region division and selection of the current block may refer to those shown in Table 1.
[0271] In an example, determining the motion information of the current block according to the selection condition, the sub-region division information, and the motion information of the surrounding matching blocks may include but is not limited to:
[0272] Dividing the current block into at least one sub-region according to the sub-region division information;
[0273] For each sub-region of the current block, selecting a surrounding matching block corresponding to the sub-region from surrounding matching blocks of the current block according to the motion information angle prediction mode, and determining motion information of the sub-region according to motion information of the surrounding matching block corresponding to the sub-region and the selection condition;
[0274] The motion information of the at least one sub-region is determined as the motion information of the current block.
[0275] In one example, the motion information of the current block is determined according to the motion information angle prediction mode, including: determining the selection condition for obtaining the motion information of the current block according to the size of the current block; the selection condition is the second selection condition, and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information; determining the sub-region division information of the current block according to the size of the current block; the sub-region division information of the current block includes: the size of the sub-region of the current block is 8*8. According to the pre-configured angle corresponding to the motion information angle prediction mode, the surrounding matching blocks pointed to by the pre-configured angle are selected from the surrounding blocks of the current block; and the motion information of the current block is determined according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
[0276] In one example, before determining the target motion information prediction mode of the current block, the motion information prediction mode of the current block can also be obtained, and the motion information prediction mode at least includes a motion information angle prediction mode. The motion information angle prediction mode of the current block is checked for duplicates to obtain a motion information angle prediction mode after checking for duplicates, that is, the duplicate motion information angle prediction mode is removed.
[0277] Exemplarily, the motion information angle prediction mode of the current block is checked for duplication to obtain the motion information angle prediction mode after duplication checking, which may include but is not limited to: determining the motion information angle prediction mode to be checked for duplication; for any two first motion information angle prediction modes to be checked for duplication and second motion information angle prediction modes to be checked for duplication, then: the first motion information can be determined according to the first motion information angle prediction mode to be checked for duplication; and the second motion information can be determined according to the second motion information angle prediction mode to be checked for duplication; then, if the first motion information and the second motion information are the same, it can be determined that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated.
[0278] In one example, determining a motion information angle prediction mode to be checked for duplication may include, but is not limited to: for any motion information angle prediction mode, selecting a surrounding matching block pointed to by a pre-configured angle from surrounding blocks of the current block according to the pre-configured angle of the motion information angle prediction mode; selecting multiple surrounding matching blocks to be traversed from the surrounding matching blocks; if the motion information of the multiple traversed surrounding matching blocks are all the same, determining that the motion information angle prediction mode is the motion information angle prediction mode to be checked for duplication.
[0279] In an example, after determining that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated, the repeated first motion information angle prediction mode may be removed; or the repeated second motion information angle prediction mode may be removed.
[0280] In one example, after the motion information angle prediction mode of the current block is checked for duplicates and the motion information angle prediction mode after the check is obtained, the motion information angle prediction mode for the second check for duplicates can also be determined from the motion information angle prediction mode after the check for duplicates; exemplarily, the motion information angle prediction mode after the check for duplicates can include a first part of the motion information angle prediction mode and a second part of the motion information angle prediction mode, the first part of the motion information angle prediction mode can be a motion information angle prediction mode that has not been checked for duplicates, the second part of the motion information angle prediction mode can include a motion information angle prediction mode after the duplication is removed from the motion information angle prediction mode for the check for duplicates, and the motion information angle prediction mode for the second check for duplicates can be the second part of the motion information angle prediction mode. Exemplarily, the motion information angle prediction mode for the second check for duplicates and the inter-frame prediction mode to be checked for duplicates in the prediction mode of the current block except the motion information angle prediction mode are checked for duplicates to obtain the motion information prediction mode after the check for duplicates.
[0281] In one example, the process of checking for duplicates of the motion information angle prediction mode of the secondary duplication check and the inter-frame prediction mode to be checked for duplicates other than the motion information angle prediction mode in the prediction mode of the current block may include but is not limited to: for any one of the motion information angle prediction modes of the secondary duplication check, obtaining the motion information of the motion information angle prediction mode; exemplarily, if the motion information of the motion information angle prediction mode is the same as the motion information of an inter-frame prediction mode to be checked for duplicates, it can be determined that the motion information angle prediction mode is a duplicate of the inter-frame prediction mode to be checked for duplicates.
[0282] In an example, the inter-frame prediction mode to be checked for duplicates may be any one of all non-angle inter-frame prediction modes corresponding to the current block, or the inter-frame prediction mode to be checked for duplicates may also be any one of some non-angle inter-frame prediction modes corresponding to the current block, without limitation.
[0283] In an example, the motion information angle prediction mode of the current block is checked for duplication. After obtaining the motion information angle prediction mode after the check for duplication, the target motion information prediction mode of the current block can also be determined; if the target motion information prediction mode is the motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0284] The motion compensation process in the above embodiment is described below in conjunction with several specific embodiments.
[0285] Example 8: See Fig.9AAs shown, the width W(4) of the current block multiplied by the height H(8) of the current block is less than or equal to 32. For each 4*4 sub-region in the current block, unidirectional motion compensation (Uni) is performed at a certain angle, and bidirectional motion information is not allowed. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is not determined as the motion information of the sub-region, but the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0286] As shown in Table 1, Embodiment 8 is for the example in Table 1 where width*height is less than or equal to 32. For any angle prediction mode, the sub-block division size is 4*4, and the selection condition is unidirectional.
[0287] according to Fig.9A , the size of the current block is 4*8, and when the target motion information prediction mode of the current block is the horizontal mode, two sub-regions of the same size are divided, one of which is a 4*4 sub-region corresponding to the surrounding matching block A1. According to the motion information of A1, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block A1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block A1 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region. The other 4*4 sub-region corresponds to the surrounding matching block A2. According to the motion information of A2, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block A2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block A2 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0288] according to Fig.9A, the size of the current block is 4*8, and when the target motion information prediction mode of the current block is the vertical mode, two sub-regions of the same size are divided, one of which is a 4*4 sub-region corresponding to the surrounding matching block B1. According to the motion information of B1, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block B1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block B1 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region. The other 4*4 sub-region corresponds to the surrounding matching block B1. According to the motion information of B1, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block B1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block B1 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0289] according to Fig.9A , the size of the current block is 4*8, and when the target motion information prediction mode of the current block is horizontal upward, two sub-regions of the same size are divided, one of which is a 4*4 sub-region corresponding to the surrounding matching block E. According to the motion information of E, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block E is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block E is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region. The other 4*4 sub-region corresponds to the surrounding matching block A1. According to the motion information of A1, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block A1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block A1 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0290] according to Fig.9A, the size of the current block is 4*8, and when the target motion information prediction mode of the current block is horizontal downward, two sub-regions of the same size are divided, one of which is a 4*4 sub-region corresponding to the surrounding matching block A2. According to the motion information of A2, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block A2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block A2 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region. The other 4*4 sub-region corresponds to the surrounding matching block A3. According to the motion information of A3, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block A3 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block A3 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0291] according to Fig.9A , when the size of the current block is 4*8 and the target motion information prediction mode of the current block is horizontal downward, two sub-regions of the same size are divided, one of which is a 4*4 sub-region corresponding to the surrounding matching block B2. According to the motion information of B2, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block B2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block B2 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region. The other 4*4 sub-region corresponds to the surrounding matching block B3. According to the motion information of B3, the motion information of the 4*4 sub-region is determined. If the motion information of the surrounding matching block B3 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block B3 is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0292] Example 9: See Fig. 9B As shown, if the width W of the current block is less than 8 and the height H of the current block is greater than 8, motion compensation can be performed on each sub-region in the current block in the following manner:
[0293] If the angle prediction mode is the vertical prediction mode, motion compensation is performed on each 4*H sub-region according to the vertical angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0294] If the angle prediction mode is other angle prediction modes (such as horizontal prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode, etc.), for each 4*4 sub-region in the current block, unidirectional motion compensation can be performed at a certain angle, and bidirectional motion information is not allowed. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0295] As shown in Table 1, Embodiment 9 is for the example in Table 1 where the width is less than 8 and the height is greater than 8, that is, for the vertical prediction mode, the sub-block division size is 4*height, and the selection condition is to allow bidirectional. For other angular prediction modes, the sub-block division size is 4*4, and the selection condition is unidirectional.
[0296] according to Fig. 9B , the size of the current block is 4*16, and when the target motion information prediction mode of the current block is the horizontal mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block A1, and the motion information of the 4*4 sub-region is determined according to the motion information of A1. One of which corresponds to the surrounding matching block A2, and the motion information of the 4*4 sub-region is determined according to the motion information of A2. One of which corresponds to the surrounding matching block A3, and the motion information of the 4*4 sub-region is determined according to the motion information of A3. One of which corresponds to the surrounding matching block A4, and the motion information of the 4*4 sub-region is determined according to the motion information of A4. For any one of A1 to A4, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0297] according to Fig. 9B, the size of the current block is 4*16. When the target motion information prediction mode of the current block is the vertical mode, it can be divided into 4 sub-regions of size 4*4. Each 4*4 sub-region corresponds to the surrounding matching block B1. The motion information of each 4*4 sub-region is determined according to the motion information of B1. If the motion information of the surrounding matching block B1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block B1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region. The motion information of the four sub-regions is the same, so in this embodiment, the current block may not be divided into sub-regions. The current block itself is used as a sub-region corresponding to a surrounding matching block B1. The motion information of the current block is determined according to the motion information of B1.
[0298] according to Fig. 9B , when the size of the current block is 4*16 and the target motion information prediction mode of the current block is the horizontal upward mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block E, and the motion information of the 4*4 sub-region is determined according to the motion information of E. One of which corresponds to the surrounding matching block A1, and the motion information of the 4*4 sub-region is determined according to the motion information of A1. One of which corresponds to the surrounding matching block A2, and the motion information of the 4*4 sub-region is determined according to the motion information of A2. One of which corresponds to the surrounding matching block A3, and the motion information of the 4*4 sub-region is determined according to the motion information of A3. For any one of E to A3, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0299] according to Fig. 9B, when the size of the current block is 4*16 and the target motion information prediction mode of the current block is the horizontal downward mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block A2, and the motion information of the 4*4 sub-region is determined according to the motion information of A2. One of which corresponds to the surrounding matching block A3, and the motion information of the 4*4 sub-region is determined according to the motion information of A3. One of which corresponds to the surrounding matching block A5, and the motion information of the 4*4 sub-region is determined according to the motion information of A4. One of which corresponds to the surrounding matching block A5, and the motion information of the 4*4 sub-region is determined according to the motion information of A5. For any one of A2 to A5, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0300] according to Fig. 9B , when the size of the current block is 4*16 and the target motion information prediction mode of the current block is the horizontal downward mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block B2, and the motion information of the 4*4 sub-region is determined according to the motion information of B2. One of which corresponds to the surrounding matching block B3, and the motion information of the 4*4 sub-region is determined according to the motion information of B3. One of which corresponds to the surrounding matching block B4, and the motion information of the 4*4 sub-region is determined according to the motion information of B4. One of which corresponds to the surrounding matching block B5, and the motion information of the 4*4 sub-region is determined according to the motion information of B5. For any one of B2 to B5, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0301] Example 10: See Fig. 9C As shown, if the width W of the current block is greater than 8 and the height H of the current block is less than 8, motion compensation can be performed on each sub-region in the current block in the following manner:
[0302] If the angle prediction mode is the horizontal prediction mode, motion compensation is performed on each W*4 sub-region according to the horizontal angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0303] If the angle prediction mode is other angle prediction modes, for each 4*4 sub-region in the current block, unidirectional motion compensation can be performed at a certain angle, and bidirectional motion information is not allowed. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the sub-region.
[0304] As shown in Table 1, Embodiment 10 is for the example in Table 1 where the width is greater than 8 and the height is less than 8, that is, for the horizontal prediction mode, the sub-block division size is width*4, and the selection condition is to allow bidirectional. For other angular prediction modes, the sub-block division size is 4*4, and the selection condition is unidirectional.
[0305] according to Fig. 9C , the size of the current block is 16*4. When the target motion information prediction mode of the current block is the horizontal mode, it can be divided into 4 sub-regions of size 4*4. Each 4*4 sub-region corresponds to the surrounding matching block A1. According to the motion information of A1, the motion information of each 4*4 sub-region is determined. If the motion information of the surrounding matching block A1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block A1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region. The motion information of the four sub-regions is the same, so in this embodiment, the current block may not be divided into sub-regions. The current block itself is used as a sub-region corresponding to a surrounding matching block A1. According to the motion information of A1, the motion information of the current block is determined.
[0306] according to Fig. 9C, the size of the current block is 16*4, and when the target motion information prediction mode of the current block is the vertical mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block B1, and the motion information of the 4*4 sub-region is determined according to the motion information of B1. One of which corresponds to the surrounding matching block B2, and the motion information of the 4*4 sub-region is determined according to the motion information of B2. One of which corresponds to the surrounding matching block B3, and the motion information of the 4*4 sub-region is determined according to the motion information of B3. One of which corresponds to the surrounding matching block B4, and the motion information of the 4*4 sub-region is determined according to the motion information of B4. For any one of B1 to B4, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0307] according to Fig. 9C , when the size of the current block is 16*4 and the target motion information prediction mode of the current block is the horizontal upward mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block E, and the motion information of the 4*4 sub-region is determined according to the motion information of E. One of which corresponds to the surrounding matching block B1, and the motion information of the 4*4 sub-region is determined according to the motion information of B1. One of which corresponds to the surrounding matching block B2, and the motion information of the 4*4 sub-region is determined according to the motion information of B2. One of which corresponds to the surrounding matching block B3, and the motion information of the 4*4 sub-region is determined according to the motion information of B3. For any one of E to B3, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0308] according to Fig. 9C, when the size of the current block is 16*4 and the target motion information prediction mode of the current block is the horizontal downward mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block A2, and the motion information of the 4*4 sub-region is determined according to the motion information of A2. One of which corresponds to the surrounding matching block A3, and the motion information of the 4*4 sub-region is determined according to the motion information of A3. One of which corresponds to the surrounding matching block A4, and the motion information of the 4*4 sub-region is determined according to the motion information of A4. One of which corresponds to the surrounding matching block A5, and the motion information of the 4*4 sub-region is determined according to the motion information of A5. For any one of A2 to A5, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0309] according to Fig. 9C , when the size of the current block is 16*4 and the target motion information prediction mode of the current block is the vertical right mode, it is divided into 4 sub-regions of size 4*4, one of which corresponds to the surrounding matching block B2, and the motion information of the 4*4 sub-region is determined according to the motion information of B2. One of which corresponds to the surrounding matching block B3, and the motion information of the 4*4 sub-region is determined according to the motion information of B3. One of which corresponds to the surrounding matching block B4, and the motion information of the 4*4 sub-region is determined according to the motion information of B4. One of which corresponds to the surrounding matching block B5, and the motion information of the 4*4 sub-region is determined according to the motion information of B5. For any one of B2 to B5, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the forward motion information or the backward motion information in the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0310] Embodiment 11: When the width W of the current block is equal to 8 and the height H of the current block is equal to 8, motion compensation is performed at a certain angle for each 8*8 sub-region in the current block (i.e., the sub-region is the current block itself), and bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0311] If the sub-region corresponds to multiple surrounding matching blocks, the motion information of the sub-region may be selected from the motion information of the multiple surrounding matching blocks according to the corresponding angle.
[0312] For example, see Fig.9D As shown, for the horizontal prediction mode, the motion information of the surrounding matching block A1 or the motion information of the surrounding matching block A2 can be selected. Fig.9E As shown, for the vertical prediction mode, the motion information of the surrounding matching block B1 or the motion information of the surrounding matching block B2 can be selected. Fig.9F As shown, for the horizontal upward prediction mode, the motion information of the surrounding matching block E can be selected, the motion information of the surrounding matching block B1 can be selected, and the motion information of the surrounding matching block A1 can be selected. Figure 9G As shown, for the horizontal downward prediction mode, the motion information of the surrounding matching block A2 can be selected, the motion information of the surrounding matching block A3 can be selected, and the motion information of the surrounding matching block A4 can be selected. Figure 9H As shown, for the vertical right prediction mode, the motion information of the surrounding matching block B2 may be selected, the motion information of the surrounding matching block B3 may be selected, and the motion information of the surrounding matching block B4 may be selected.
[0313] As shown in Table 1, Embodiment 11 is for the example in Table 1 where the width is equal to 8 and the height is equal to 8, that is, for any angle prediction mode, the sub-block division size is 8*8, and the selection condition is to allow bidirectionality.
[0314] according to Fig.9D , the size of the current block is 8*8, when the target motion information prediction mode of the current block is the horizontal mode, a sub-region of size 8*8 is divided, and this sub-region corresponds to the surrounding matching block A1. According to the motion information of A1, the motion information of the sub-region is determined. If the motion information of A1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, this sub-region corresponds to the surrounding matching block A2, and the motion information of the sub-region is determined according to the motion information of A2. If the motion information of A2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A2 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0315] according to Fig.9E, the size of the current block is 8*8, when the target motion information prediction mode of the current block is the vertical mode, a sub-region of size 8*8 is divided, and this sub-region corresponds to the surrounding matching block B1. According to the motion information of B1, the motion information of the sub-region is determined. If the motion information of B1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, this sub-region corresponds to the surrounding matching block B2, and according to the motion information of B2, the motion information of the sub-region is determined. If the motion information of B2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B2 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0316] according to Fig.9F , the size of the current block is 8*8, and when the target motion information prediction mode of the current block is the horizontal upward mode, it is divided into sub-regions of size 8*8, and the sub-region corresponds to the surrounding matching block E. According to the motion information of E, the motion information of the sub-region is determined. If the motion information of E is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of E is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block B1, and the motion information of the sub-region is determined according to the motion information of B1. If the motion information of B1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block A1, and the motion information of the sub-region is determined according to the motion information of A1. If the motion information of A1 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A1 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0317] according to Figure 9G, the size of the current block is 8*8, and when the target motion information prediction mode of the current block is the horizontal downward mode, it is divided into sub-regions of size 8*8, and the sub-region corresponds to the surrounding matching block A2. According to the motion information of A2, the motion information of the sub-region is determined. If the motion information of A2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A2 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block A3, and the motion information of the sub-region is determined according to the motion information of A3. If the motion information of A3 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A3 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block A4, and the motion information of the sub-region is determined according to the motion information of A4. If the motion information of A4 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of A4 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0318] according to Figure 9H , when the size of the current block is 8*8 and the target motion information prediction mode of the current block is the vertical right mode, the sub-region with a size of 8*8 is divided, and the sub-region corresponds to the surrounding matching block B2. According to the motion information of B2, the motion information of the sub-region is determined. If the motion information of B2 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B2 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block B3, and the motion information of the sub-region is determined according to the motion information of B3. If the motion information of B3 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B3 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. Alternatively, the sub-region corresponds to the surrounding matching block B4, and the motion information of the sub-region is determined according to the motion information of B4. If the motion information of B4 is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of B4 is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0319] Embodiment 12: The width W of the current block may be greater than or equal to 16, and the height H of the current block may be equal to 8. Based on this, motion compensation may be performed on each sub-region in the current block in the following manner:
[0320] If the angle prediction mode is the horizontal prediction mode, motion compensation is performed on each W*4 sub-region according to the horizontal angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0321] If the angle prediction mode is other angle prediction modes, for each 8*8 sub-region in the current block, bidirectional motion compensation is performed at a certain angle. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. For each 8*8 sub-region, if the sub-region corresponds to multiple surrounding matching blocks, for the motion information of the sub-region, the motion information of any one surrounding matching block is selected from the motion information of multiple surrounding matching blocks.
[0322] For example, see Fig.9I As shown, for the horizontal prediction mode, for the first W*4 sub-region, the motion information of the surrounding matching block A1 can be selected, and for the second W*4 sub-region, the motion information of the surrounding matching block A2 can be selected. Figure 9J As shown, for the vertical prediction mode, for the first 8*8 sub-region, the motion information of the surrounding matching block B1 can be selected, and the motion information of the surrounding matching block B2 can be selected. For the second 8*8 sub-region, the motion information of the surrounding matching block B3 can be selected, and the motion information of the surrounding matching block B4 can be selected. Other angle prediction modes are similar and will not be repeated here.
[0323] As shown in Table 1, Embodiment 12 is for the example in Table 1 where the width is greater than or equal to 16 and the height is equal to 8. For the horizontal prediction mode, the sub-block partition size is width*4, and the selection condition is to allow bidirectional. For other angular prediction modes, the sub-block partition size is 8*8, and the selection condition is to allow bidirectional.
[0324] according to Fig.9I, when the size of the current block is 16*8 and the target motion information prediction mode of the current block is the horizontal mode, it is divided into two sub-regions of size 16*4, one of which corresponds to the surrounding matching block A1. According to the motion information of A1, the motion information of the 16*4 sub-region is determined. The other 16*4 sub-region corresponds to the surrounding matching block A2. According to the motion information of A2, the motion information of the 16*4 sub-region is determined. For these two 16*4 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0325] according to Figure 9J , when the size of the current block is 16*8 and the target motion information prediction mode of the current block is the vertical mode, it is divided into two sub-regions of size 8*8, one of which corresponds to the surrounding matching block B1 or B2. The motion information of the 8*8 sub-region is determined according to the motion information of B1 or B2. The other 8*8 sub-region corresponds to the surrounding matching block B3 or B4. The motion information of the 8*8 sub-region is determined according to the motion information of B3 or B4. For these two 8*8 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0326] Embodiment 13: The width W of the current block may be equal to 8, and the height H of the current block may be greater than or equal to 16. Based on this, motion compensation may be performed on each sub-region in the current block in the following manner:
[0327] If the angle prediction mode is the vertical prediction mode, motion compensation is performed on each 4*H sub-region according to the vertical angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0328] If the angle prediction mode is other angle prediction modes, for each 8*8 sub-region in the current block, bidirectional motion compensation is performed at a certain angle. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. For each 8*8 sub-region, if the sub-region corresponds to multiple surrounding matching blocks, for the motion information of the sub-region, the motion information of any one surrounding matching block is selected from the motion information of multiple surrounding matching blocks.
[0329] For example, see Figure 9K As shown, for the vertical prediction mode, for the first 4*H sub-region, the motion information of the surrounding matching block B1 can be selected, and for the second 4*H sub-region, the motion information of the surrounding matching block B2 can be selected. Figure 9L As shown, for the horizontal prediction mode, for the first 8*8 sub-region, the motion information of the surrounding matching block A1 can be selected, and the motion information of the surrounding matching block A2 can be selected. For the second 8*8 sub-region, the motion information of the surrounding matching block A1 can be selected, and the motion information of the surrounding matching block A2 can be selected. Other angle prediction modes are similar and will not be repeated here.
[0330] As shown in Table 1, Embodiment 13 is for the example in Table 1 where the height is greater than or equal to 16 and the width is equal to 8. For the vertical prediction mode, the sub-block division size is 4*height, and the selection condition is to allow bidirectional. For other angular prediction modes, the sub-block division size is 8*8, and the selection condition is to allow bidirectional.
[0331] according to Figure 9K , when the size of the current block is 8*16 and the target motion information prediction mode of the current block is the vertical mode, it is divided into two sub-regions of size 4*16, one of which corresponds to the surrounding matching block B1. The motion information of the 4*16 sub-region is determined according to the motion information of B1. The other 4*16 sub-region corresponds to the surrounding matching block B2. The motion information of the 4*16 sub-region is determined according to the motion information of B2. For these two 4*16 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0332] according to Figure 9L, when the size of the current block is 16*8 and the target motion information prediction mode of the current block is the horizontal mode, it is divided into two sub-regions of size 8*8, one of which corresponds to the surrounding matching block A1 or A2. The motion information of the 8*8 sub-region is determined according to the motion information of the corresponding surrounding matching block. The other 8*8 sub-region corresponds to the surrounding matching block A1 or A2. The motion information of the 8*8 sub-region is determined according to the motion information of the corresponding surrounding matching block. For these two 8*8 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0333] Embodiment 14: The width W of the current block may be greater than or equal to 16, and the height H of the current block may be greater than or equal to 16. Based on this, motion compensation may be performed on each sub-region in the current block in the following manner:
[0334] If the angle prediction mode is the vertical prediction mode, motion compensation is performed on each 4*H sub-region according to the vertical angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0335] If the angle prediction mode is the horizontal prediction mode, motion compensation is performed on each W*4 sub-region according to the horizontal angle. Bidirectional motion information is allowed when performing motion compensation. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region.
[0336] If the angle prediction mode is other angle prediction modes, for each 8*8 sub-region in the current block, bidirectional motion compensation is performed at a certain angle. For example, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the sub-region. For each 8*8 sub-region, if the sub-region corresponds to multiple surrounding matching blocks, for the motion information of the sub-region, the motion information of any one surrounding matching block is selected from the motion information of multiple surrounding matching blocks.
[0337] See also Figure 9MAs shown, for the vertical prediction mode, for the first 4*H sub-region, the motion information of the surrounding matching block B1 can be selected, for the second 4*H sub-region, the motion information of the surrounding matching block B2 can be selected, for the third 4*H sub-region, the motion information of the surrounding matching block B3 can be selected, and for the fourth 4*H sub-region, the motion information of the surrounding matching block B4 can be selected. For the horizontal prediction mode, for the first W*4 sub-region, the motion information of the surrounding matching block A1 is selected, for the second W*4 sub-region, the motion information of the surrounding matching block A2 is selected, for the third W*4 sub-region, the motion information of the surrounding matching block A3 is selected, and for the fourth W*4 sub-region, the motion information of the surrounding matching block A4 is selected. Other angle prediction modes are similar and will not be repeated here.
[0338] As shown in Table 1, Embodiment 14 is for the example in Table 1 where the height is greater than or equal to 16 and the width is greater than or equal to 16. For the vertical prediction mode, the sub-block division size is 4*height, and the selection condition is to allow bidirectional. For the horizontal prediction mode, the sub-block division size is width*4, and the selection condition is to allow bidirectional. For other angle prediction modes, the sub-block division size is 8*8, and the selection condition is to allow bidirectional.
[0339] according to Figure 9M , when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the vertical mode, it is divided into 4 sub-regions of 4*16 size, one of which corresponds to the surrounding matching block B1, and the motion information of the 4*16 sub-region is determined according to the motion information of B1. One of which corresponds to the surrounding matching block B2, and the motion information of the 4*16 sub-region is determined according to the motion information of B2. One of which corresponds to the surrounding matching block B3, and the motion information of the 4*16 sub-region is determined according to the motion information of B3. One of which corresponds to the surrounding matching block B4, and the motion information of the 4*16 sub-region is determined according to the motion information of B4. For these four 4*16 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0340] according to Figure 9M, when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the horizontal mode, it is divided into 4 sub-regions of size 16*4, one of which corresponds to the surrounding matching block A1, and the motion information of the 16*4 sub-region is determined according to the motion information of A1. One of which corresponds to the surrounding matching block A2, and the motion information of the 16*4 sub-region is determined according to the motion information of A2. One of which corresponds to the surrounding matching block A3, and the motion information of the 16*4 sub-region is determined according to the motion information of A3. One of which corresponds to the surrounding matching block A4, and the motion information of the 16*4 sub-region is determined according to the motion information of A4. For these four 16*4 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0341] Embodiment 15: The width W of the current block may be greater than or equal to 8, and the height H of the current block may be greater than or equal to 8, and motion compensation is performed on each 8*8 sub-region in the current block. Figure 9N As shown, for each 8*8 sub-region, if the sub-region corresponds to multiple surrounding matching blocks, for the motion information of the sub-region, the motion information of any one surrounding matching block is selected from the motion information of the multiple surrounding matching blocks.
[0342] In Embodiment 15, the sub-block division size is independent of the motion information angle prediction mode. No matter which motion information angle prediction mode is used, as long as the width is greater than or equal to 8 and the height is greater than or equal to 8, the sub-region division size can be 8*8. The selection condition is independent of the motion information angle prediction mode. No matter which motion information angle prediction mode is used, as long as the width is greater than or equal to 8 and the height is greater than or equal to 8, the selection condition is to allow bidirectionality.
[0343] according to Figure 9N, when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the horizontal mode, it is divided into 4 sub-regions of 8*8 size, one of which corresponds to the surrounding matching block A1 or A2, and the motion information of the 8*8 sub-region is determined according to the motion information of A1 or A2. One of which corresponds to the surrounding matching block A1 or A2, and the motion information of the 8*8 sub-region is determined according to the motion information of A1 or A2. One of which corresponds to the surrounding matching block A3 or A4, and the motion information of the 8*8 sub-region is determined according to the motion information of A3 or A4. One of which corresponds to the surrounding matching block A3 or A4, and the motion information of the 8*8 sub-region is determined according to the motion information of A3 or A4. For these four 8*8 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0344] according to Figure 9N , when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the horizontal mode, it is divided into 4 sub-regions of 8*8 size, one of which corresponds to the surrounding matching block B1 or B2, and the motion information of the 8*8 sub-region is determined according to the motion information of B1 or B2. One of which corresponds to the surrounding matching block B1 or B2, and the motion information of the 8*8 sub-region is determined according to the motion information of B1 or B2. One of which corresponds to the surrounding matching block B3 or B4, and the motion information of the 8*8 sub-region is determined according to the motion information of B3 or B4. One of which corresponds to the surrounding matching block B3 or B4, and the motion information of the 8*8 sub-region is determined according to the motion information of B3 or B4. For these four 8*8 sub-regions, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0345] according to Figure 9N, when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the horizontal upward mode, it is divided into 4 sub-regions of size 8*8. Then, for each 8*8 sub-region, the surrounding matching block (E, B2 or A2) corresponding to the 8*8 sub-region can be determined without restriction, and the motion information of the 8*8 sub-region is determined according to the motion information of the surrounding matching block. For each 8*8 sub-region, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0346] according to Figure 9N , when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the horizontal downward mode, it is divided into 4 sub-regions of size 8*8. Then, for each 8*8 sub-region, the surrounding matching block (A3, A5 or A7) corresponding to the 8*8 sub-region can be determined without restriction, and the motion information of the 8*8 sub-region is determined according to the motion information of the surrounding matching block. For each 8*8 sub-region, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0347] according to Figure 9N , when the size of the current block is 16*16 and the target motion information prediction mode of the current block is the vertical right mode, it is divided into 4 sub-regions of size 8*8. Then, for each 8*8 sub-region, the surrounding matching block (B3, B5 or B7) corresponding to the 8*8 sub-region can be determined without restriction, and the motion information of the 8*8 sub-region is determined based on the motion information of the surrounding matching block. For each 8*8 sub-region, if the motion information of the surrounding matching block is unidirectional motion information, the unidirectional motion information is determined as the motion information of the corresponding sub-region. If the motion information of the surrounding matching block is bidirectional motion information, the bidirectional motion information is determined as the motion information of the corresponding sub-region.
[0348] Embodiment 16: Based on the same application concept as the above method, the embodiment of the present application proposes a coding and decoding device, which is applied to a decoding end or an encoding end, such as Fig. 10A As shown, it is a structural diagram of the device, including:
[0349] The acquisition module 101 is used to acquire the motion information prediction mode of the current block, and the motion information prediction mode at least includes the motion information angle prediction mode; the processing module 102 is used to perform a duplication check on the motion information angle prediction mode of the current block to obtain the motion information angle prediction mode after duplication check.
[0350] The processing module 102 performs a duplication check on the motion information angle prediction mode of the current block, and obtains the motion information angle prediction mode after duplication check, which is specifically used for:
[0351] Determine the motion information angle prediction mode to be checked for duplication; for any two first motion information angle prediction modes to be checked for duplication and the second motion information angle prediction modes to be checked for duplication, then:
[0352] Determine the first motion information according to the angle prediction mode of the first motion information to be checked for duplication;
[0353] Determine the second motion information according to the angle prediction mode of the second motion information to be checked for duplication;
[0354] If the first motion information and the second motion information are the same, it is determined that the first motion information angular prediction mode and the second motion information angular prediction mode are repeated.
[0355] The processing module 102 determines the angle prediction mode of the motion information to be checked for duplication and is specifically used to:
[0356] For any motion information angle prediction mode, selecting a surrounding matching block pointed to by the pre-configured angle from surrounding blocks of the current block according to the pre-configured angle of the motion information angle prediction mode;
[0357] Selecting a plurality of surrounding matching blocks to be traversed from the surrounding matching blocks;
[0358] If the motion information of the traversed multiple peripheral matching blocks are all the same, then the motion information angle prediction mode is determined to be the motion information angle prediction mode to be checked for duplication.
[0359] After determining that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated, the processing module 102 is further used to: remove the repeated first motion information angle prediction mode; or remove the repeated second motion information angle prediction mode.
[0360] The processing module 102 performs a duplication check on the motion information angle prediction mode of the current block, and after obtaining the motion information angle prediction mode after the duplication check, it is also used to: determine the motion information angle prediction mode for secondary duplication check from the motion information angle prediction mode after the duplication check; wherein the motion information angle prediction mode after the duplication check includes a first part of motion information angle prediction mode and a second part of motion information angle prediction mode, the first part of motion information angle prediction mode is a motion information angle prediction mode that has not been checked for duplication, the second part of motion information angle prediction mode includes a motion information angle prediction mode after removing duplication from the motion information angle prediction mode for duplication check, and the motion information angle prediction mode for secondary duplication check is the second part of motion information angle prediction mode; perform a duplication check on the motion information angle prediction mode for secondary duplication check and the inter-frame prediction mode to be checked for duplication in the prediction mode of the current block except the motion information angle prediction mode, to obtain the motion information prediction mode after the duplication check.
[0361] When the processing module 102 performs duplication checking on the motion information angle prediction mode of the second duplication check and the inter-frame prediction mode to be checked for duplication except the motion information angle prediction mode in the prediction mode of the current block, it is specifically used to: for any one of the motion information angle prediction modes of the second duplication check, obtain the motion information of the motion information angle prediction mode;
[0362] If the motion information of the motion information angle prediction mode is the same as the motion information of an inter-frame prediction mode to be checked for duplicates, it is determined that the motion information angle prediction mode is repeated with the inter-frame prediction mode to be checked for duplicates.
[0363] In one example, the inter-frame prediction mode to be checked for duplicates is any one of all non-angle inter-frame prediction modes corresponding to the current block, or the inter-frame prediction mode to be checked for duplicates is any one of some non-angle inter-frame prediction modes corresponding to the current block.
[0364] The device further includes: a determination module, configured to determine a target motion information prediction mode of the current block; if the target motion information prediction mode of the current block is a motion information angle prediction mode, then:
[0365] Determining motion information of a current block according to the motion information angle prediction mode;
[0366] According to the motion information of the current block, a prediction value of the current block is determined.
[0367] See also Fig. 10B FIG. 1 is a schematic diagram of another encoding and decoding device, wherein the device comprises:
[0368] The first determination module 103 is used to determine the motion information of the current block according to the selected motion information angle prediction mode if the target motion information prediction mode of the current block is the selected motion information angle prediction mode; the second determination module 104 is used to determine the prediction value of the current block according to the motion information of the current block.
[0369] The first determination module 103 determines the motion information of the current block according to the motion information angle prediction mode, and is specifically used to: determine a selection condition for obtaining the motion information of the current block according to the motion information angle prediction mode and the size of the current block; wherein the selection condition is a first selection condition or a second selection condition, the first selection condition is that the motion information selected from the motion information of the surrounding matching blocks is not allowed to be bidirectional motion information, and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information;
[0370] Determine sub-region division information of the current block according to the motion information angle prediction mode and the size of the current block; select a surrounding matching block pointed to by the pre-configured angle from surrounding blocks of the current block according to the pre-configured angle corresponding to the motion information angle prediction mode; and determine motion information of the current block according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
[0371] The first determination module 103 determines the selection condition for obtaining the motion information of the current block according to the motion information angle prediction mode and the size of the current block, and is specifically used to:
[0372] If the size of the current block satisfies: the width is greater than or equal to the preset size parameter, and the height is greater than or equal to the preset size parameter, for any motion information angle prediction mode, determining the selection condition to be the second selection condition;
[0373] If the size of the current block satisfies: the width is smaller than the preset size parameter, and the height is larger than the preset size parameter, when the motion information angle prediction mode is the vertical prediction mode, the selection condition is determined to be the second selection condition; when the motion information angle prediction mode is a prediction mode other than the vertical prediction mode, the selection condition is determined to be the first selection condition;
[0374] If the size of the current block satisfies: the height is smaller than the preset size parameter, and the width is larger than the preset size parameter, when the motion information angle prediction mode is the horizontal prediction mode, the selection condition is determined to be the second selection condition; when the motion information angle prediction mode is a prediction mode other than the horizontal prediction mode, the selection condition is determined to be the first selection condition;
[0375] If the size of the current block satisfies: the height is smaller than the preset size parameter, and the width is smaller than the preset size parameter, for any motion information angle prediction mode, determining the selection condition as the first selection condition;
[0376] If the size of the current block satisfies: the height is less than the preset size parameter and the width is equal to the preset size parameter, or the height is equal to the preset size parameter and the width is less than the preset size parameter, for any motion information angle prediction mode, the selection condition is determined to be the first selection condition.
[0377] The first determination module 103 determines the sub-region division information of the current block according to the motion information angle prediction mode and the size of the current block, and is specifically used to:
[0378] When the motion information angle prediction mode is a horizontal upward prediction mode, a horizontal downward prediction mode, or a vertical right prediction mode, if the width of the current block is greater than or equal to a preset size parameter, and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-region is 8*8; if the width of the current block is less than the preset size parameter, or the height of the current block is less than the preset size parameter, the size of the sub-region is 4*4;
[0379] When the motion information angle prediction mode is the horizontal prediction mode, if the width of the current block is greater than the preset size parameter, the size of the sub-region is the width of the current block*4, or the size of the sub-region is 4*4; if the width of the current block is equal to the preset size parameter, and the height of the current block is greater than or equal to the preset size parameter, the size of the sub-region is 8*8; if the width of the current block is less than the preset size parameter, the size of the sub-region is 4*4;
[0380] When the motion information angle prediction mode is a vertical prediction mode, if the height of the current block is greater than a preset size parameter, the size of the sub-area is 4*the height of the current block, or the size of the sub-area is 4*4; if the height of the current block is equal to the preset size parameter and the width of the current block is greater than or equal to the preset size parameter, the size of the sub-area is 8*8; if the height of the current block is less than the preset size parameter, the size of the sub-area is 4*4.
[0381] The first determination module 103 determines the motion information of the current block according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks, and is specifically used to:
[0382] Dividing the current block into at least one sub-region according to the sub-region division information;
[0383] For each sub-region of the current block, selecting a surrounding matching block corresponding to the sub-region from surrounding matching blocks of the current block according to the motion information angle prediction mode, and determining motion information of the sub-region according to motion information of the surrounding matching block corresponding to the sub-region and the selection condition;
[0384] The motion information of the at least one sub-region is determined as the motion information of the current block.
[0385] The first determination module 103 determines the motion information of the current block according to the motion information angle prediction mode, and is specifically used to: determine a selection condition for obtaining the motion information of the current block according to the size of the current block; wherein the selection condition is a second selection condition, and the second selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information;
[0386] Determine sub-region division information of the current block according to the size of the current block; wherein the size of the sub-region of the current block is 8*8;
[0387] According to the preconfigured angle corresponding to the motion information angle prediction mode, selecting a surrounding matching block pointed to by the preconfigured angle from surrounding blocks of the current block;
[0388] The motion information of the current block is determined according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
[0389] In one example, the device also includes: a processing module, used to obtain a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode; performing a duplication check on the motion information angle prediction mode of the current block to obtain a motion information angle prediction mode after duplication checking.
[0390] The processing module performs a duplicate checking process on the motion information angle prediction mode of the current block, and obtains the motion information angle prediction mode after the duplicate checking, which is specifically used for:
[0391] Determine the motion information angle prediction mode to be checked for duplication; for any two first motion information angle prediction modes to be checked for duplication and the second motion information angle prediction modes to be checked for duplication, then:
[0392] Determine the first motion information according to the angle prediction mode of the first motion information to be checked for duplication;
[0393] Determine the second motion information according to the angle prediction mode of the second motion information to be checked for duplication;
[0394] If the first motion information and the second motion information are the same, it is determined that the first motion information angular prediction mode and the second motion information angular prediction mode are repeated.
[0395] When the processing module determines the angle prediction mode of the motion information to be checked for duplication, it is specifically used to:
[0396] For any motion information angle prediction mode, selecting a surrounding matching block pointed to by the pre-configured angle from surrounding blocks of the current block according to the pre-configured angle of the motion information angle prediction mode;
[0397] Selecting a plurality of surrounding matching blocks to be traversed from the surrounding matching blocks;
[0398] If the motion information of the traversed multiple peripheral matching blocks are all the same, then the motion information angle prediction mode is determined to be the motion information angle prediction mode to be checked for duplication.
[0399] After the processing module determines that the first motion information angle prediction mode and the second motion information angle prediction mode are repeated, it is further used to:
[0400] removing repeated first motion information angle prediction modes; or,
[0401] The repeated second motion information angle prediction mode is removed.
[0402] The processing module performs a duplicate checking process on the motion information angle prediction mode of the current block, and after obtaining the motion information angle prediction mode after the duplicate checking, it is further used to:
[0403] Determine the motion information angle prediction mode for secondary duplication check from the motion information angle prediction mode after duplication check; wherein the motion information angle prediction mode after duplication check includes a first part of motion information angle prediction mode and a second part of motion information angle prediction mode, the first part of motion information angle prediction mode is a motion information angle prediction mode that has not been checked for duplication, the second part of motion information angle prediction mode includes a motion information angle prediction mode after removing duplication from the motion information angle prediction mode for duplication check, and the motion information angle prediction mode for secondary duplication check is the second part of motion information angle prediction mode;
[0404] The motion information angle prediction mode of the second duplication check and the inter-frame prediction mode to be checked for duplication except the motion information angle prediction mode in the prediction mode of the current block are checked for duplication to obtain the motion information prediction mode after duplication check.
[0405] When the processing module performs duplication checking processing on the motion information angle prediction mode of the second duplication check and the inter-frame prediction mode to be checked for duplication except the motion information angle prediction mode in the prediction mode of the current block, it is specifically used to: for any one of the motion information angle prediction modes of the second duplication check, obtain the motion information of the motion information angle prediction mode;
[0406] If the motion information of the motion information angle prediction mode is the same as the motion information of an inter-frame prediction mode to be checked for duplicates, it is determined that the motion information angle prediction mode is repeated with the inter-frame prediction mode to be checked for duplicates.
[0407] The decoding end device provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be specifically referred to Fig.11 The system comprises: a processor 111 and a machine-readable storage medium 112, wherein the machine-readable storage medium 112 stores machine-executable instructions that can be executed by the processor 111; the processor 111 is used to execute the machine-executable instructions to implement the method disclosed in the above example of the present application.
[0408] For example, the processor is used to execute machine executable instructions to implement the following steps:
[0409] Obtaining a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode; performing a duplicate checking process on the motion information angle prediction mode of the current block to obtain a motion information angle prediction mode after duplicate checking; or
[0410] The processor is used to execute machine executable instructions to implement the following steps:
[0411] If the target motion information prediction mode of the current block is the selected motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0412] The encoding end device provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be specifically referred to Fig.12 The system comprises: a processor 121 and a machine-readable storage medium 122, wherein the machine-readable storage medium 122 stores machine-executable instructions that can be executed by the processor 121; the processor 121 is used to execute the machine-executable instructions to implement the method disclosed in the above example of the present application.
[0413] For example, the processor is used to execute machine executable instructions to implement the following steps:
[0414] Obtaining a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode; performing a duplicate checking process on the motion information angle prediction mode of the current block to obtain a motion information angle prediction mode after duplicate checking; or
[0415] The processor is used to execute machine executable instructions to implement the following steps:
[0416] If the target motion information prediction mode of the current block is the selected motion information angle prediction mode, the motion information of the current block is determined according to the motion information angle prediction mode; and the prediction value of the current block is determined according to the motion information of the current block.
[0417] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the encoding and decoding method disclosed in the above example of the present application can be implemented.
[0418] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.
[0419] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0420] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0421] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0422] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0423] Moreover, these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0424] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0425] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A decoding method, characterized in that: Applied to a decoding end, the method comprises: Obtaining a motion information prediction mode of a current block, the motion information prediction mode at least comprising a motion information angle prediction mode; performing a duplicate checking process on the motion information angle prediction mode of the current block to obtain a duplicate checked motion information angle prediction mode, and adding the duplicate checked motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; A target motion information prediction mode of the current block is selected from the motion information prediction mode candidate list; if the target motion information prediction mode of the current block is a motion information angle prediction mode, then: According to the preconfigured angle indicated by the motion information angle prediction mode, a surrounding matching block is selected for the sub-region of the current block from the surrounding blocks of the current block, and the motion information of the sub-region of the current block is determined according to the motion information of the surrounding matching block; wherein the surrounding matching block is a block at a specified position determined from the surrounding blocks of the current block according to the preconfigured angle; A prediction value of the current block is determined according to motion information of a sub-region of the current block.
2. The method according to claim 1, characterized in that The selecting, according to the preconfigured angle indicated by the motion information angle prediction mode, a peripheral matching block for the sub-region of the current block from the peripheral blocks of the current block, and determining the motion information of the sub-region of the current block according to the motion information of the peripheral matching block comprises: Determining, according to the size of the current block, a selection condition for obtaining motion information of the current block, wherein the selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information; Determine sub-region division information of the current block according to the size of the current block; wherein the sub-region division information is used to indicate that the size of the sub-region of the current block is 8*8; According to the preconfigured angle indicated by the motion information angle prediction mode, selecting a surrounding matching block pointed to by the preconfigured angle from surrounding blocks of the current block; The motion information of the sub-region of the current block is determined according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
3. The method according to claim 1, characterized in that The motion information angle prediction mode in the motion information prediction mode candidate list includes at least one of the following: motion information horizontal angle prediction mode, motion information vertical angle prediction mode, motion information horizontal upward angle prediction mode, motion information horizontal downward angle prediction mode, and motion information vertical right angle prediction mode.
4. A coding method, characterized in that: Applied to the encoding end, the method includes: Obtaining a motion information prediction mode of a current block, the motion information prediction mode at least comprising a motion information angle prediction mode; performing a duplicate checking process on the motion information angle prediction mode of the current block to obtain a duplicate checked motion information angle prediction mode, and adding the duplicate checked motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; A target motion information prediction mode of the current block is selected from the motion information prediction mode candidate list; if the target motion information prediction mode of the current block is a motion information angle prediction mode, then: According to the preconfigured angle indicated by the motion information angle prediction mode, a surrounding matching block is selected for the sub-region of the current block from the surrounding blocks of the current block, and the motion information of the sub-region of the current block is determined according to the motion information of the surrounding matching block; wherein the surrounding matching block is a block at a specified position determined from the surrounding blocks of the current block according to the preconfigured angle; A prediction value of the current block is determined according to motion information of a sub-region of the current block.
5. The method according to claim 4, characterized in that The selecting, according to the preconfigured angle indicated by the motion information angle prediction mode, a peripheral matching block for the sub-region of the current block from the peripheral blocks of the current block, and determining the motion information of the sub-region of the current block according to the motion information of the peripheral matching block comprises: Determining, according to the size of the current block, a selection condition for obtaining motion information of the current block, wherein the selection condition is that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information; Determine sub-region division information of the current block according to the size of the current block; wherein the sub-region division information is used to indicate that the size of the sub-region of the current block is 8*8; According to the preconfigured angle indicated by the motion information angle prediction mode, selecting a surrounding matching block pointed to by the preconfigured angle from surrounding blocks of the current block; The motion information of the sub-region of the current block is determined according to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks.
6. The method according to claim 4, characterized in that The motion information angle prediction mode in the motion information prediction mode candidate list includes at least one of the following: motion information horizontal angle prediction mode, motion information vertical angle prediction mode, motion information horizontal upward angle prediction mode, motion information horizontal downward angle prediction mode, and motion information vertical right angle prediction mode.
7. A decoding device, characterized in that: Applied to a decoding end, the device comprises: a processing module, configured to obtain a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode; perform a duplicate checking process on the motion information angle prediction mode of the current block to obtain a duplicate checked motion information angle prediction mode, and add the duplicate checked motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; and select a target motion information prediction mode of the current block from the motion information prediction mode candidate list; A first determination module is configured to, if the target motion information prediction mode of the current block is a motion information angle prediction mode, select a peripheral matching block for a sub-region of the current block from peripheral blocks of the current block according to a preconfigured angle indicated by the motion information angle prediction mode, and determine the motion information of the sub-region of the current block according to the motion information of the peripheral matching block; wherein the peripheral matching block is a block at a specified position determined from peripheral blocks of the current block according to the preconfigured angle; The second determination module is used to determine the prediction value of the current block according to the motion information of the sub-region of the current block.
8. An encoding device, characterized in that: Applied to the encoding end, the device includes: a processing module, configured to obtain a motion information prediction mode of a current block, wherein the motion information prediction mode at least includes a motion information angle prediction mode; perform a duplicate checking process on the motion information angle prediction mode of the current block to obtain a duplicate checked motion information angle prediction mode, and add the duplicate checked motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; and select a target motion information prediction mode of the current block from the motion information prediction mode candidate list; A first determination module is configured to, if the target motion information prediction mode of the current block is a motion information angle prediction mode, select a peripheral matching block for a sub-region of the current block from peripheral blocks of the current block according to a preconfigured angle indicated by the motion information angle prediction mode, and determine the motion information of the sub-region of the current block according to the motion information of the peripheral matching block; wherein the peripheral matching block is a block at a specified position determined from peripheral blocks of the current block according to the preconfigured angle; The second determination module is used to determine the prediction value of the current block according to the motion information of the sub-region of the current block.
9. A decoding end device, characterized in that: include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is used to execute the machine executable instructions to implement the method described in any one of claims 1-3.
10. A coding end device, characterized in that: include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is used to execute the machine executable instructions to implement the method described in any one of claims 4-6.
Citation Information
Patent Citations
Motion compensation prediction method based on motion vector restraint and weighting motion vector
CN103561263A
Motion vector prediction method and devices
CN109089119A