A coding and decoding method, device and equipment thereof
By obtaining and utilizing the motion information angle prediction mode of the current block and the matching blocks of surrounding blocks in inter-frame coding, the problems of motion information sharing and bit overhead in the existing technology are solved, and the coding performance and the accuracy of motion information are improved.
Patent Information
- Application Number
- CN202211098101.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-05
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-06-05
AI Technical Summary
In the existing technology, in inter-frame coding, all sub-blocks within the current coding unit share one motion information, which makes it difficult to obtain the best motion information when the moving target is small. Moreover, without dividing the current block into sub-blocks, when transmitting motion information There is additional bit overhead.
By obtaining the motion information angle prediction mode of the current block, select multiple matching blocks pointed by the preconfigured angles of the surrounding blocks, and add the motion information angle prediction mode that is not exactly the same to the motion information prediction mode candidate list, so that according to the candidate list Encode or decode the current block.
On the basis of not dividing the current block into sub-blocks, motion information is provided for each sub-region of the current block, improving coding performance, saving bit overhead, and enhancing the accuracy and coding efficiency of motion information.
Smart Images

Figure CN115460424B
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) 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 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, apparatus and device thereof, which can improve coding performance.
[0007] The present application provides a coding and decoding method, the method comprising:
[0008] Obtaining at least one motion information angle prediction mode of the current block;
[0009] For each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block;
[0010] If the motion information of the plurality of surrounding matching blocks are not completely the same, adding the motion information angle prediction mode to a motion information prediction mode candidate list;
[0011] The current block is encoded or decoded according to the motion information prediction mode candidate list.
[0012] The present application provides a coding and decoding device, the device comprising:
[0013] An acquisition module, used to acquire at least one motion information angle prediction mode of a current block;
[0014] a processing module, configured to select, for each motion information angle prediction mode, a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block based on the pre-configured angle of the motion information angle prediction mode; and if the motion information of the plurality of surrounding matching blocks is not completely the same, add the motion information angle prediction mode to a motion information prediction mode candidate list;
[0015] A coding and decoding module is used to encode or decode the current block according to the motion information prediction mode candidate list.
[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] Obtaining at least one motion information angle prediction mode of the current block;
[0019] For each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block;
[0020] If the motion information of the plurality of surrounding matching blocks are not completely the same, adding the motion information angle prediction mode to a motion information prediction mode candidate list;
[0021] The current block is decoded according to the motion information prediction mode candidate list.
[0022] 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;
[0023] The processor is used to execute machine executable instructions to implement the following steps:
[0024] Obtaining at least one motion information angle prediction mode of the current block;
[0025] For each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block;
[0026] If the motion information of the plurality of surrounding matching blocks are not completely the same, adding the motion information angle prediction mode to a motion information prediction mode candidate list;
[0027] The current block is encoded according to the motion information prediction mode candidate list.
[0028] 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, which can effectively solve the bit overhead caused by sub-block division. That is to say, 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 encoding performance, solving the problem of transmitting a large amount of motion information, and saving a large number of bits. By adding motion information angle prediction modes with different motion information to the motion information prediction mode candidate list, thereby reducing the number of motion information angle prediction modes in the motion information prediction mode candidate list, the encoding performance can be further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] 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.
[0030] Figure 1 is a schematic diagram of a video coding framework in one implementation of the present application;
[0031] Figure 2A and Figure 2B is a schematic diagram of a division method in one implementation of the present application;
[0032] Figure 3A-Figure 3F This is a schematic diagram of an application scenario in one embodiment of the present application;
[0033] Figure 4 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0034] Figure 5A and Figure 5Bis a schematic diagram of a motion information angle prediction mode in an implementation manner of the present application;
[0035] Figure 6 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0036] Figure 7 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0037] Fig. 8A and Figure 8B is a schematic diagram of filling of uncoded blocks and intra-coded blocks;
[0038] Figure 9A-9C is a schematic diagram of surrounding blocks of a current block in one implementation of the present application;
[0039] Figure 10A-Figure 10N is a schematic diagram of a peripheral matching block in one embodiment of the present application;
[0040] Fig.11 is a structural diagram of a coding and decoding device in one embodiment of the present application;
[0041] Fig.12 is a hardware structure diagram of a decoding end device in one embodiment of the present application;
[0042] Fig.13 It is a hardware structure diagram of an encoding end device in one implementation of the present application. DETAILED DESCRIPTION
[0043] 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.
[0044] It should be understood that, although the terms first, second, 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 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".
[0045] 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:
[0046] 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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] Intra prediction and inter prediction technology: Intra prediction refers to predictive coding using 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). Inter prediction refers to predictive coding using the reconstructed pixel values of the temporally adjacent image blocks of the current image block (in different frames as the current image block). 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.
[0051] 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.
[0052] Before introducing the technical solution of the embodiment of the present application, the following basic knowledge is briefly introduced:
[0053] 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.
[0054] 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.
[0055] 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).
[0056] 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.
[0057] 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 division method of the CU within the CTU can be any combination of the above five division types.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] 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.
[0062] 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 optimal MV in the candidate list. In this way, the number of encoding bits of motion information can be greatly saved. The candidate list established in Merge mode includes two situations: 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 explained below.
[0063] Establishment of airspace candidate list. Figure 3AAs 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.
[0064] The establishment of the time domain candidate list. Figure 3B As 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. It should be noted that if the number of candidate MVs in the current candidate list does not reach 5, the default motion information (such as motion information (0,0)) needs to be used to fill in order to reach the specified number.
[0065] 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.
[0066] 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.
[0067] Establishment of airspace candidate list. Figure 3CAs 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. When the first "available" MV is detected on the left or above, the MV is used as the candidate MV for the current prediction unit, and the remaining steps are not performed. At most one candidate is selected from A0, A1, scaled A0, scaledA1, and at most one candidate is selected from B0, B1, B2, scaled B0, scaled B1, scaled B2.
[0068] 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.
[0069] 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).
[0070] 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. For example, see Figure 3D As shown, 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.
[0071] 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.
[0072] For example, if Figure 2A or Figure 2B The current coding unit is divided into multiple sub-image blocks. Figure 3EAs 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] 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.
[0078] 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.
[0079] The following describes the encoding and decoding method in the embodiment of the present application in combination with several specific embodiments.
[0080] 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:
[0081] Step 401: Obtain at least one motion information angle prediction mode of the current block.
[0082] Exemplarily, the motion information angle prediction mode is used to indicate a preconfigured angle, and 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, that is, for each sub-region of the current block, the motion information of the sub-region is determined according to the motion information of the surrounding matching block. Moreover, the surrounding matching block is a block at a specified position determined from the surrounding blocks according to the preconfigured angle.
[0083] 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.
[0084] Exemplarily, the motion information angle prediction mode may include 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, vertical rightward prediction mode. Of course, the above are just a few examples of motion information angle prediction modes, and there may be other types of motion information angle prediction modes. The motion information angle prediction mode is related to the preconfigured angle, for example, the preconfigured angle may also be 10 degrees, 20 degrees, etc. See 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 motion information angle prediction modes correspond to different pre-configured angles.
[0085] Step 402: for each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block.
[0086] Step 403: If the motion information of the multiple surrounding matching blocks pointed to by the pre-configured angle is not completely the same, then the motion information angle prediction mode is added to the motion information prediction mode candidate list.
[0087] Exemplarily, if the motion information of multiple surrounding matching blocks pointed to by the pre-configured angle is exactly the same, it is prohibited to add the motion information angle prediction mode to the motion information prediction mode candidate list.
[0088] For example, based on the preconfigured angle of the horizontal prediction mode, select the surrounding matching blocks pointed to by the preconfigured angle from the surrounding blocks of the current block, such as surrounding matching blocks A1, surrounding matching blocks A2, and surrounding matching blocks A3. If the surrounding matching blocks A1, surrounding matching blocks A2, and surrounding matching blocks A3 are not exactly the same, add the horizontal prediction mode to the motion information prediction mode candidate list. If the surrounding matching blocks A1, surrounding matching blocks A2, and surrounding matching blocks A3 are exactly the same, it is prohibited to add the horizontal prediction mode to the motion information prediction mode candidate list.
[0089] Exemplarily, after selecting multiple surrounding matching blocks pointed to by the preconfigured angle from the surrounding blocks of the current block, at least one first surrounding matching block can be selected from the multiple surrounding matching blocks. For each first surrounding matching block, a second surrounding matching block corresponding to the first surrounding matching block is selected from the multiple surrounding matching blocks. If the motion information of the first surrounding matching block is different from the motion information of the second surrounding matching block, it is determined that the comparison result of the first surrounding matching block is different motion information; if the motion information of the first surrounding matching block is the same as the motion information of the second surrounding matching block, it is determined that the comparison result of the first surrounding matching block is the same motion information. Then, if the comparison result of any first surrounding matching block is different motion information, it is determined that the motion information of the multiple surrounding matching blocks is not completely the same; if the comparison results of all first surrounding matching blocks are the same motion information, it is determined that the motion information of the multiple surrounding matching blocks is completely the same.
[0090] Exemplarily, selecting at least one first peripheral matching block from the plurality of peripheral matching blocks may include, but is not limited to: using any one or more of the plurality of peripheral matching blocks as the first peripheral matching block; or using one or more designated ones of the plurality of peripheral matching blocks as the first peripheral matching block.
[0091] Exemplarily, selecting a second peripheral matching block corresponding to a first peripheral matching block from the multiple peripheral matching blocks may include, but is not limited to: selecting a second peripheral matching block corresponding to the first peripheral matching block from the multiple peripheral matching blocks based on a traversal step and a position of the first peripheral matching block; wherein the traversal step may be a block interval between the first peripheral matching block and the second peripheral matching block.
[0092] For example, for the surrounding matching block A1, the surrounding matching block A2 and the surrounding matching block A3 arranged in sequence, assuming that the surrounding matching block A1 is the first surrounding matching block and the traversal step length is 2, the second surrounding matching block corresponding to the surrounding matching block A1 is the surrounding matching block A3. Based on this, if the motion information of the surrounding matching block A1 is different from the motion information of the surrounding matching block A3, it can be determined that the comparison result of the surrounding matching block A1 is different in motion information; if the motion information of the surrounding matching block A1 is the same as the motion information of the surrounding matching block A3, it is determined that the comparison result of the surrounding matching block A1 is the same in motion information.
[0093] For another example, for the surrounding matching block A1, the surrounding matching block A2 and the surrounding matching block A3 arranged in sequence, assuming that the surrounding matching block A1 and the surrounding matching block A2 are taken as the first surrounding matching block, and the traversal step length is 1, then the second surrounding matching block corresponding to the surrounding matching block A1 is the surrounding matching block A2, and the second surrounding matching block corresponding to the surrounding matching block A2 is the surrounding matching block A3. Based on this, if the motion information of the surrounding matching block A1 is different from the motion information of the surrounding matching block A2, it can be determined that the comparison result of the surrounding matching block A1 is different in motion information; if the motion information of the surrounding matching block A1 is the same as the motion information of the surrounding matching block A2, it is determined that the comparison result of the surrounding matching block A1 is the same in motion information. If the motion information of the surrounding matching block A2 is different from the motion information of the surrounding matching block A3, it can be determined that the comparison result of the surrounding matching block A2 is different in motion information; if the motion information of the surrounding matching block A2 is the same as the motion information of the surrounding matching block A3, it is determined that the comparison result of the surrounding matching block A2 is the same in motion information.
[0094] Exemplarily, before selecting the second surrounding matching block corresponding to the first surrounding matching block from the plurality of surrounding matching blocks, the traversal step length may be determined based on the size of the current block. The number of comparisons of motion information is controlled by the traversal step length.
[0095] For example, assuming that the size of the surrounding matching block is 4*4 and the size of the current block is 16*16, for the horizontal prediction mode, the current block corresponds to 4 surrounding matching blocks. In order to control the number of comparisons of motion information to be 1, the traversal step length can be 2 or 3. If the traversal step length is 2, the first surrounding matching block is the 1st surrounding matching block and the second surrounding matching block is the 3rd surrounding matching block; or, the first surrounding matching block is the 2nd surrounding matching block and the second surrounding matching block is the 4th surrounding matching block. If the traversal step length is 3, the first surrounding matching block is the 1st surrounding matching block and the second surrounding matching block is the 4th surrounding matching block. For another example, in order to control the number of comparisons of motion information to be 2, the traversal step length can be 1, the first surrounding matching block is the 1st surrounding matching block and the 3rd surrounding matching block, the second surrounding matching block corresponding to the 1st surrounding matching block is the 2nd surrounding matching block, and the second surrounding matching block corresponding to the 3rd surrounding matching block is the 4th surrounding matching block.
[0096] Of course, the above is only an example for the horizontal prediction mode, and other methods can be used to determine the traversal step length, which is not limited. Moreover, for other motion information angle prediction modes other than the horizontal prediction mode, the method for determining the traversal step length refers to the horizontal prediction mode, which will not be repeated here.
[0097] Step 404: encode or decode the current block according to the motion information prediction mode candidate list.
[0098] For example, for the encoding end, the current block is encoded according to the motion information prediction mode candidate list. For the decoding end, the current block is decoded according to the motion information prediction mode candidate list.
[0099] 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-regions of the current block can be determined based on the motion information angle prediction mode, which can effectively solve the bit overhead caused by sub-block division. That is, without 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 encoding performance, solving the problem of transmitting a large amount of motion information, and saving a large amount of encoding bit overhead. By adding motion information angle prediction modes with different motion information to the motion information prediction mode candidate list, the motion information angle prediction mode with only a single motion information is removed, the number of motion information angle prediction modes in the motion information prediction mode candidate list is reduced, and the number of bits for encoding multiple motion information is reduced, thereby further improving the encoding performance.
[0100] See also Figure 5B As shown in FIG. 1 , 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. Figure 5B It can be seen that some motion information angle prediction modes will make the motion information of each sub-region in the current block the same, for example, the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode. Such motion information angle prediction modes need to be eliminated. Some motion information angle prediction modes will make the motion information of each sub-region in the current block different, for example, the horizontal downward prediction mode and the vertical right prediction mode. Such motion information angle prediction modes need to be retained, that is, they can be added to the motion information prediction mode candidate list.
[0101] Obviously, if the horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, and vertical right prediction mode are all added to the motion information prediction mode candidate list, when encoding the index of the horizontal downward prediction mode, since there are horizontal prediction mode, vertical prediction mode, and horizontal upward prediction mode in front (the order of each motion information angle prediction mode is not fixed, this is just an example), it may be necessary to encode 0001 to represent it. However, in the embodiment of the present application, only the horizontal downward prediction mode and the vertical right prediction mode are added to the motion information prediction mode candidate list, and the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode are prohibited from being added to the motion information prediction mode candidate list, that is, there is no horizontal prediction mode, vertical prediction mode, and horizontal upward prediction mode in front of the horizontal downward prediction mode. Therefore, when encoding the index of the horizontal downward prediction mode, it may only be necessary to encode 0 to represent it. In summary, the bit overhead caused by encoding the motion information angle prediction mode index information is reduced, the hardware complexity is reduced while saving the bit overhead, the low performance gain problem caused by the motion information angle prediction mode of a single motion information is avoided, and the number of bits for encoding multiple motion information angle prediction modes is reduced.
[0102] Embodiment 2: Based on the preconfigured angle of the motion information angle prediction mode, after selecting multiple surrounding matching blocks pointed to by the preconfigured angle from the surrounding blocks of the current block, if there are uncoded blocks and / or intra-coded blocks in the multiple surrounding matching blocks, the motion information of the uncoded blocks and / or intra-coded blocks is filled. For example, the available motion information of the neighboring blocks of the uncoded blocks and / or intra-coded blocks is filled with the motion information of the uncoded blocks and / or intra-coded blocks; or, the available motion information of the reference blocks at the corresponding positions of the uncoded blocks and / or intra-coded blocks in the time domain reference frame is filled with the motion information of the uncoded blocks and / or intra-coded blocks; or, the default motion information is filled with the motion information of the uncoded blocks and / or intra-coded blocks.
[0103] Exemplarily, if there is an uncoded block among the multiple surrounding matching blocks, the available motion information of the neighboring blocks of the uncoded block can be filled as the motion information of the uncoded block; or, the available motion information of the reference block at the corresponding position of the uncoded block in the time domain reference frame can be filled as the motion information of the uncoded block; or, the default motion information can be filled as the motion information of the uncoded block.
[0104] Exemplarily, if there is an intra-frame coding block among the multiple surrounding matching blocks, the available motion information of the neighboring blocks of the intra-frame coding block can be filled as the motion information of the intra-frame coding block; or, the available motion information of the reference block at the corresponding position of the intra-frame coding block in the time domain reference frame can be filled as the motion information of the intra-frame coding block; or, the default motion information can be filled as the motion information of the intra-frame coding block.
[0105] Exemplarily, if there are uncoded blocks and intra-coded blocks among the multiple peripheral matching blocks, the available motion information of the neighboring blocks of the uncoded block is filled with the motion information of the uncoded block; the available motion information of the neighboring blocks of the intra-coded block is filled with the motion information of the intra-coded block, or the available motion information of the reference block at the corresponding position of the intra-coded block in the time domain reference frame is filled with the motion information of the intra-coded block, or the default motion information is filled with the motion information of the intra-coded block. Alternatively, the available motion information of the reference block at the corresponding position of the uncoded block in the time domain reference frame is filled with the motion information of the uncoded block; the available motion information of the neighboring blocks of the intra-coded block is filled with the motion information of the intra-coded block, or the available motion information of the reference block at the corresponding position of the intra-coded block in the time domain reference frame is filled with the motion information of the intra-coded block, or the default motion information is filled with the motion information of the intra-coded block. Alternatively, the default motion information is filled with the motion information of the uncoded block; the available motion information of the neighboring blocks of the intra-coded block is filled with the motion information of the intra-coded block, or the available motion information of the reference block at the corresponding position of the intra-coded block in the time domain reference frame is filled with the motion information of the intra-coded block, or the default motion information is filled with the motion information of the intra-coded block.
[0106] Embodiment 3: When encoding or decoding a current block according to a motion information prediction mode candidate list, 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 is a target motion information angle prediction mode, the motion information of the current block is determined according to the target motion information angle prediction mode; and a prediction value of the current block is determined according to the motion information of the current block.
[0107] Exemplarily, determining the motion information of the current block according to the target motion information angle prediction mode includes: based on a preconfigured angle corresponding to the target motion information angle prediction mode, selecting multiple surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block; dividing the current block into at least one sub-region; for each sub-region, selecting a surrounding matching block corresponding to the sub-region from the multiple surrounding matching blocks, and determining the motion information of the sub-region according to the motion information of the selected surrounding matching block.
[0108] Exemplarily, determining the motion information of the current block according to the target motion information angle prediction mode includes: determining the selection condition for obtaining the motion information of the current block and 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, the selection condition being a first selection condition or a second selection condition, the first selection condition being 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 being that the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information; based on the preconfigured angle corresponding to the target motion information angle prediction mode, selecting multiple surrounding matching blocks pointed to by the preconfigured angle from the surrounding blocks of the current block; and determining the motion information of the current block according to the selection condition, the sub-region division information and the motion information of the multiple surrounding matching blocks.
[0109] Exemplarily, determining the motion information of the current block according to the target motion information angle prediction mode includes: selecting, from the surrounding blocks of the current block, a surrounding matching block pointed to by the preconfigured angle corresponding to the target motion information angle prediction mode; determining the motion information of the current block according to the motion information of the surrounding matching blocks; if the width and height of the current block are both greater than or equal to 8, the current block is divided into sub-blocks according to 8*8, and the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information.
[0110] Embodiment 4: Referring to the above embodiments, it involves filling the motion information of the surrounding matching blocks (embodiment 2), using the motion information of the surrounding matching blocks to determine the motion information angle prediction mode that needs to be added to the motion information prediction mode candidate list (embodiment 1), and using the motion information angle prediction mode to perform motion compensation (embodiment 3). On this basis, embodiment 1 and embodiment 2 can be combined to fill the motion information of the surrounding matching blocks, and use the motion information of the surrounding matching blocks to determine the motion information angle prediction mode that needs to be added to the motion information prediction mode candidate list. Alternatively, embodiment 2 and embodiment 3 are combined to determine the motion information angle prediction mode that needs to be added to the motion information prediction mode candidate list using the motion information of the surrounding matching blocks, and use the motion information angle prediction mode to perform motion compensation. Alternatively, embodiment 1, embodiment 2 and embodiment 3 are combined to fill the motion information of the surrounding matching blocks, use the motion information of the surrounding matching blocks to determine the motion information angle prediction mode that needs to be added to the motion information prediction mode candidate list, and use the motion information angle prediction mode to perform motion compensation.
[0111] In Example 4, the implementation process of the coding and decoding method is described by combining Example 1, Example 2 and Example 3 as an example. The implementation process of the coding and decoding method combining Example 1 and Example 2 and combining Example 2 and Example 3 is similar to the implementation process of Example 4 and will not be repeated here. Figure 6 FIG. 1 is a flow chart of a coding and decoding method, which can be applied to a coding end and may include:
[0112] Step 601: The encoder fills the motion information of the surrounding blocks of the current block.
[0113] For example, if there are uncoded blocks in the surrounding blocks of the current block, the available motion information of the neighboring blocks of the uncoded block is filled as the motion information of the uncoded block; or, the available motion information of the reference block at the corresponding position of the uncoded block in the time domain reference frame is filled as the motion information of the uncoded block; or, the default motion information is filled as the motion information of the uncoded block. If there are intra-coded blocks in the surrounding blocks of the current block, the available motion information of the neighboring blocks of the intra-coded block is filled as the motion information of the intra-coded block; or, the available motion information of the reference block at the corresponding position of the intra-coded block in the time domain reference frame is filled as the motion information of the intra-coded block; or, the default motion information is filled as the motion information of the intra-coded block.
[0114] Step 602: The encoder creates a motion information prediction mode candidate list corresponding to the current block, and the motion information prediction mode candidate list may include a motion information angle prediction mode. Of course, the motion information prediction mode candidate list may also include other types of motion information prediction modes, which is not limited.
[0115] Exemplarily, the motion information angle prediction mode is used to indicate a preconfigured angle, and 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, that is, for each sub-region of the current block, the motion information of the sub-region is determined according to the motion information of the surrounding matching block. Moreover, the surrounding matching block is a block at a specified position determined from the surrounding blocks according to the preconfigured angle.
[0116] 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.
[0117] Exemplarily, the motion information angle prediction mode includes but is not limited to: 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.
[0118] Exemplarily, it is necessary to create a motion information prediction mode candidate list corresponding to the current block, and both the encoder and the decoder create motion information prediction mode candidate lists corresponding to the current block. The motion information prediction mode candidate list of the encoder and the motion information prediction mode candidate list of the decoder are the same according to the protocol agreement. The encoder and the decoder can adopt the same strategy to create the same motion information prediction mode candidate list.
[0119] 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.
[0120] 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.
[0121] Exemplarily, for the processing of step 602, the process may include the following steps:
[0122] Step a1: Obtain at least one motion information angle prediction mode of the current block.
[0123] For example, the following motion information angle prediction modes can be obtained in sequence: horizontal prediction mode, vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, and 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 and 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.
[0124] Step a2: for each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block.
[0125] Step a3: if the motion information of multiple surrounding matching blocks is not completely the same, add the motion information angle prediction mode to the motion information prediction mode candidate list. If the motion information of multiple surrounding matching blocks is completely the same, it is forbidden to add the motion information angle prediction mode to the motion information prediction mode candidate list.
[0126] For example, for the horizontal prediction mode, multiple surrounding matching blocks pointed to by the preconfigured angle are selected from all surrounding blocks of the current block according to the preconfigured angle of the horizontal prediction mode. Then, at least one first surrounding matching block (such as all or part of all surrounding matching blocks) is selected from the multiple surrounding matching blocks.
[0127] For each first peripheral matching block, a second peripheral matching block corresponding to the first peripheral matching block is selected from the plurality of peripheral matching blocks. If the motion information of the first peripheral matching block is different from the motion information of the second peripheral matching block corresponding to the first peripheral matching block, it is determined that the comparison result of the first peripheral matching block is different in motion information. If the motion information of the first peripheral matching block is the same as the motion information of the second peripheral matching block corresponding to the first peripheral matching block, it is determined that the comparison result of the first peripheral matching block is the same in motion information.
[0128] After obtaining the comparison result of each first surrounding matching block, if the comparison result of any first surrounding matching block is that the motion information is different, it can be determined that the motion information of the multiple surrounding matching blocks is not completely the same, and the horizontal prediction mode is added to the motion information prediction mode candidate list. If the comparison results of all first surrounding matching blocks are that the motion information is the same, it can be determined that the motion information of the multiple surrounding matching blocks is completely the same, and it is forbidden to add the horizontal prediction mode to the motion information prediction mode candidate list.
[0129] For the vertical prediction mode, horizontal upward prediction mode, horizontal downward prediction mode, vertical right prediction mode, etc., their processing procedures refer to the processing procedure of the horizontal prediction mode, and will not be repeated here.
[0130] Thus, for each motion information angle prediction mode, the motion information angle prediction mode may be added to the motion information prediction mode candidate list, or the motion information angle prediction mode may not be added to the motion information prediction mode candidate list. Figure 5B As shown, it is assumed that the horizontal downward prediction mode and the vertical right prediction mode are added to the motion information prediction mode candidate list, while the horizontal prediction mode, the vertical prediction mode, and the horizontal upward prediction mode are not added to the motion information prediction mode candidate list.
[0131] After the above processing, a motion information prediction mode candidate list can be created, and the motion information prediction mode candidate list includes a horizontal downward prediction mode and a vertical right prediction mode. Of course, the motion information prediction mode candidate list can also include other types of motion information prediction modes, which is not limited.
[0132] In step 603, the encoder selects a target motion information prediction mode for the current block from the motion information prediction mode candidate list. The target motion information prediction mode may be a target motion information angle prediction mode, or other types of motion information prediction modes (ie, conventional motion information prediction modes).
[0133] For example, it is assumed that the motion information prediction mode candidate list includes: a horizontal downward prediction mode, a vertical right prediction mode, and other types of motion information prediction modes R (obtained in a traditional manner).
[0134] For the horizontal down prediction mode, according to the preconfigured angle of the horizontal down prediction mode, multiple surrounding matching blocks pointed to by the preconfigured angle are selected from all surrounding blocks of the current block. According to multiple motion information respectively corresponding to the multiple surrounding matching blocks, the rate distortion cost A corresponding to the horizontal down prediction mode is determined.
[0135] According to the multiple motion information corresponding to the multiple peripheral matching blocks, the rate-distortion principle can be used to determine the rate-distortion cost A corresponding to the horizontal downward prediction mode. The rate-distortion cost A can be determined by the following formula: J(mode)=D+λ*R, where D represents Distortion, and can usually be measured using the SSE index, 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.
[0136] Similarly, the rate distortion cost corresponding to the vertical right prediction mode can be determined. For specific determination methods, refer to the determination method of the horizontal downward prediction mode. For example, the vertical right prediction mode corresponds to the rate distortion cost B. The rate distortion cost corresponding to the motion information prediction mode R can be determined by using the rate distortion principle. There is no limitation on this determination method. For example, the motion information prediction mode R corresponds to the rate distortion cost C.
[0137] The minimum rate-distortion cost is determined from rate-distortion cost A, rate-distortion cost B and rate-distortion cost C, and the motion information prediction mode corresponding to the minimum rate-distortion cost is determined as the target motion information prediction mode. For example, when the rate-distortion cost A is the minimum, the target motion information prediction mode is the horizontal downward prediction mode.
[0138] Step 604: If the target motion information prediction mode is the target motion information angle prediction mode, the encoder encodes the current block according to the target motion information angle prediction mode.
[0139] 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.
[0140] Exemplarily, 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, and this process is also a motion compensation process.
[0141] Determining the motion information of the current block according to the target motion information angle prediction mode may include:
[0142] Method 1: The process of determining the motion information of the current block may include the following steps:
[0143] Step b1, determining the selection condition for obtaining motion information of the current block according to the target motion information angle prediction mode and the size of the current block. Exemplarily, the selection condition may be a first selection condition or a second selection condition, the first selection condition may be 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 may be 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).
[0144] 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.
[0145] For another example, 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.
[0146] Refer to Table 1 in the subsequent embodiments, taking the preset size parameter of 8 as an example for explanation, "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.
[0147] Step b2: Determine 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.
[0148] 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.
[0149] 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.
[0150] When the target 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-region is 4*the height of the current block, or the size of the sub-region 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-region is 8*8; if the height of the current block is less than the preset size parameter, the size of the sub-region is 4*4.
[0151] Referring to Table 1 in the subsequent embodiments, the preset size parameter is 8 as an example for explanation.
[0152] 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 seen in Table 1 shown below.
[0153] Table 1
[0154]
[0155]
[0156] In one 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. When the target motion information angle prediction mode is the 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.
[0157] Step b3: Based on the preconfigured angle corresponding to the target motion information angle prediction mode, the encoder selects a plurality of surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block.
[0158] 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.
[0159] Step b4: Determine the motion information of the current block according to the selection condition, the sub-region division information, and the motion information of multiple surrounding matching blocks. 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 can be 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.
[0160] 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 is 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 1 stores bidirectional motion information (i.e., 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 the backward motion information corresponding to the peripheral matching block 1 is 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 (i.e., forward motion information and backward motion information) corresponding to the peripheral matching block 1 is used as the motion information of sub-region 1.
[0161] For sub-region 2, select the surrounding matching block 2 corresponding to sub-region 2 from the surrounding matching blocks of the current block according to the target motion information angle prediction mode. Assuming that the surrounding matching block 2 stores unidirectional motion information, the unidirectional motion information corresponding to the surrounding 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 are both determined as the motion information of the current block. The motion information of sub-region 1 and the motion information of sub-region 2 can be stored in a 4*4 sub-block size.
[0162] Method 2: The process of determining the motion information of the current block may include the following steps:
[0163] Step c1: According to the pre-configured angle corresponding to the target motion information angle prediction mode, the encoder selects a surrounding matching block pointed to by the pre-configured angle from surrounding blocks of the current block.
[0164] 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.
[0165] Step c2: Determine the motion information of the current block according to the motion information of the surrounding matching blocks.
[0166] Exemplarily, if the width and height of the current block are both greater than or equal to 8, the current block is divided into 8*8 sub-blocks, and the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information.
[0167] For example, if the width and height of the current block are both greater than or equal to 8, the current block is divided into at least one sub-region in an 8*8 manner. For each sub-region of the current block, 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 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). The motion information of at least one sub-region is determined as the motion information of the current block.
[0168] Method 3: The process of determining the motion information of the current block may include the following steps:
[0169] Step d1, determining the selection condition for obtaining 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), and the height is greater than or equal to the preset size parameter, then the selection condition is determined to be the second selection condition, which is irrelevant to the target motion information angle prediction mode.
[0170] Step d2: Determine the sub-region division information of the current block according to the size of the current block. 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), and the height is greater than or equal to a preset size parameter, then the size of the sub-region is 8*8, which is irrelevant to the target motion information angle prediction mode.
[0171] Step d3: According to the preconfigured angle corresponding to the target motion information angle prediction mode, select the surrounding matching block pointed to by the preconfigured angle from the surrounding blocks of the current block. For example, after knowing the preconfigured angle, 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 limitation on this.
[0172] Step d4: 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. For example, the encoder may 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 blocks corresponding to the sub-region and the selection condition. Then, the motion information of at least one sub-region may be determined as the motion information of the current block.
[0173] Mode 4: The process of determining the motion information of the current block may include the following steps:
[0174] Step e1: Based on the preconfigured angle corresponding to the target motion information angle prediction mode, the encoder selects a plurality of surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block.
[0175] 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.
[0176] Step e2: The encoder divides the current block into at least one sub-region, and there is no restriction on the division method.
[0177] Step e3: For each sub-region, the encoder selects a surrounding matching block corresponding to the sub-region from multiple surrounding matching blocks, and determines the motion information of the sub-region according to the motion information of the selected surrounding matching block.
[0178] For example, for each sub-region of the current block, a peripheral matching block corresponding to the sub-region is selected from multiple peripheral matching blocks, and motion information of the peripheral matching block is determined as motion information of the sub-region.
[0179] Step e4: Determine the motion information of the at least one sub-region as the motion information of the current block.
[0180] Example 5: 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:
[0181] Step 701: The decoding end fills the motion information of the surrounding blocks of the current block.
[0182] Step 702: The decoder creates a motion information prediction mode candidate list corresponding to the current block, and the motion information prediction mode candidate list may include a motion information angle prediction mode. Of course, the motion information prediction mode candidate list may also include other types of motion information prediction modes, which is not limited.
[0183] 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 prediction modes of the two is exactly the same.
[0184] Illustratively, step 701 - step 702 refer to step 601 - step 602 , which will not be repeated here.
[0185] Step 703, the decoder selects a target motion information prediction mode for the current block from the motion information prediction mode candidate list. The target motion information prediction mode may be a target motion information angle prediction mode, or other types of motion information prediction modes (ie, traditional motion information prediction modes).
[0186] Exemplarily, for the processing of step 703, the process may include the following steps:
[0187] Step f1: 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 prediction mode in the motion information prediction mode candidate list.
[0188] Exemplarily, when the encoder sends a coded bitstream to the decoder, the coded bitstream carries indication information, and the indication information is used to indicate the index information of the target motion information prediction mode in the motion information prediction mode candidate list. For example, the motion information prediction mode candidate list includes: horizontal downward prediction mode, vertical right prediction mode, motion information prediction mode R, and the indication information is used to indicate index information 1, and index information 1 represents the first motion information prediction mode in the motion information prediction mode candidate list.
[0189] Step f2: The decoder selects a motion information prediction mode corresponding to the index information from 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. For example, when the indication information is used to indicate index information 1, the decoder can determine the first motion information prediction mode in the motion information prediction mode candidate list as the target motion information prediction mode of the current block, that is, the target motion information prediction mode is a horizontal downward prediction mode.
[0190] Step 704: If the target motion information prediction mode is the target motion information angle prediction mode, the decoding end decodes the current block according to the target motion information angle prediction mode.
[0191] 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.
[0192] Exemplarily, decoding 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, and this process is also a motion compensation process.
[0193] Exemplarily, the implementation process of step 704 can refer to step 604, which will not be repeated here.
[0194] Embodiment 6: For step 601 and step 701, it is necessary to fill the motion information of the surrounding blocks of the current block. If the width and height of the current block are both 16, the motion information of the surrounding blocks is saved in the minimum unit of 4*4. Fig. 8A As shown, assuming A 14 , A 15 , A 16 and A 17 If the current block is an uncoded block, the uncoded blocks are filled, and the filling method can be any of the following: filling with available motion information of adjacent blocks; filling with default motion information (such as zero motion vector); filling with available motion information of the block at the corresponding position of the temporal reference frame. Of course, the above method is only an example and is not limited to this. If the size of the current block is other sizes, the above method can also be used for filling, which will not be repeated here.
[0195] Embodiment 7: With respect to step 601 and step 701, it is necessary to fill the motion information of the surrounding blocks of the current block. If the width and height of the current block are both 16, the motion information of the surrounding blocks is saved in the minimum unit of 4*4. Figure 8B As shown, assuming that A7 is an intra-frame coding block, these intra-frame coding blocks need to be filled, and the filling method can be any of the following: filling with available motion information of adjacent blocks; filling with default motion information (such as zero motion vector); filling with available motion information of the corresponding position block of the time domain reference frame. Of course, the above method is only an example and is not limited to this. If the size of the current block is other sizes, the above method can also be used for filling, which will not be repeated here.
[0196] Embodiment 8: With respect to step 602 and step 702, it is necessary to create a motion information prediction mode candidate list corresponding to the current block, and the motion information prediction mode candidate list includes a motion information angle prediction mode.
[0197] See also Fig.9A As shown, the surrounding blocks of the current block may include but are not limited to: 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, or other surrounding blocks. 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.
[0198] The width of the current block is W, the height of the current block is H, and the motion information of the surrounding blocks is saved in the smallest unit of 4*4. The sizes of 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, k is any integer in [2m+n+2,2m+2n+1], and the following comparison process is performed:
[0199] Step g1, determine whether j is greater than k, if so, exit the comparison process, otherwise execute step g2.
[0200] Step g2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0201] Exemplarily, if the motion information of the surrounding block Ai is the same as that 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 that of the surrounding block Aj, Diff[i] of the surrounding block Ai may be recorded as 1. After step g2, step g3 is executed.
[0202] Step g3, 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 g1.
[0203] After the above processing, after exiting the comparison process, it can be decided whether to add the motion information angle prediction mode to the motion information prediction mode candidate list according to the comparison result (ie, the value of Diff).
[0204] For the horizontal prediction mode, for any j Diff[i] values that i belongs to in the interval [m+1,m+n], 1<=j<=n is judged. If any j Diff values are all 0, mode[0]=0 is recorded, which means that the motion information is all the same. Otherwise, mode[0]=1 is recorded, which means that the motion information is not all the same. For the vertical prediction mode, for any j Diff[i] values that i belongs to in the interval [m+n+2,2m+n+1], 1<=j<=m is judged. If any j Diff values are all 0, mode[1]=0 is recorded. Otherwise, mode[1]=1 is recorded. For the horizontal upward prediction mode, for any j Diff[i] values that i belongs to in the interval [m+1,2m+n+1], 1<=j<=m+n+1 is judged. If any j Diff values are all 0, mode[2]=0 is recorded. Otherwise, mode[2]=1 is recorded. For the horizontal downward prediction mode, the j Diff[i] values that i belongs to in the interval [1, m+n] are judged, 1<=j<=m+n. If all j Diff values are 0, mode[3]=0 is recorded, otherwise mode[3]=1 is recorded. For the vertical right prediction mode, the j Diff[i] values that i belongs to in the interval [m+n+2, 2m+2n+1] are judged, 1<=j<=m+n. If all j Diff values are 0, mode[4]=0 is recorded, otherwise mode[4]=1 is recorded.
[0205] After the above processing, the mode value of each motion information angle prediction mode can be obtained, and then the motion information angle prediction mode with a mode value of 1 is added to the motion information prediction mode candidate list, and the motion information angle prediction mode with a mode value of 0 is prohibited from being added to the motion information prediction mode candidate list.
[0206] Embodiment 9: For step 602 and step 702, the width value of the current block is W, the height value of the current block is H, W is greater than or equal to 8, H is greater than or equal to 8, the sizes of m and n are W / 4 and H / 4 respectively, let i=W / 8, let j=i+step, and step=W / 8, based on this, the following comparison process is performed:
[0207] Step h1, determine whether j is greater than 2m+2n+1, if so, exit the comparison process, otherwise execute step h2.
[0208] Step h2: Compare the motion information of the surrounding block Ai with the motion information of the surrounding block Aj.
[0209] Exemplarily, if the motion information of the peripheral block Ai is the same as that 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 that 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.
[0210] Step h3: Determine whether m <= j < m + n holds. If it holds, then step = H / 8; 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 / 8; otherwise, determine whether 2m + n + 1 <= j < 2m + 2n + 1 holds. If it holds, then step = H / 8; otherwise, step remains unchanged.
[0211] Step h4: Let i = j, j = j + step, and then return to step h1 for processing.
[0212] After the above processing, after exiting the comparison process, it is possible to decide whether to add the motion information angle prediction mode to the motion information prediction mode candidate list according to the comparison result (i.e., the value of Diff).
[0213] For the horizontal prediction mode, judge the value of Diff[m + n - H / 8]. If the Diff value is 0, then record mode[0] = 0, which means that the motion information is all the same; otherwise, record mode[0] = 1, which means that the motion information is not all the same. For the vertical prediction mode, judge the value of Diff[m + n + 2]. If the Diff value is 0, then record mode[1] = 0; otherwise, record mode[1] = 1. For the horizontal upward prediction mode, judge the value of Diff[i], and the value range of i is m + n, m + n + 1. If all Diff values are 0, then record mode[2] = 0; otherwise, record mode[2] = 1. For the horizontal downward prediction mode, judge the value of Diff[i], and the value range of i is W / 8, m. If all Diff values are 0, then record mode[3] = 0; otherwise, record mode[3] = 1. For the vertical right prediction mode, judge the value of Diff[i], and the value range of i is m + n + 2 + W / 8 and 2m + n + 2. If all Diff values are 0, then record mode[4] = 0; otherwise, record mode[4] = 1.
[0214] After the above processing, the mode value of each motion information angle prediction mode can be obtained, and then the motion information angle prediction mode with a mode value of 1 is added to the motion information prediction mode candidate list, and the motion information angle prediction mode with a mode value of 0 is prohibited from being added to the motion information prediction mode candidate list.
[0215] Embodiment 10: With respect to step 602 and step 702, the width value of the current block is W, the height value of the current block is H, W is 16, H is 16, and the motion information of the surrounding blocks is stored in a minimum unit of 4*4.
[0216] See also Fig. 9B As shown, for the horizontal prediction mode, the motion information of A6 is compared with the motion information of A8 to see if they are the same. If they are not the same, the horizontal prediction mode is added to the motion information prediction mode candidate list. If they are the same, it is prohibited to add the horizontal prediction mode to the motion information prediction mode candidate list.
[0217] For vertical prediction mode, compare A 10 The movement information and A 12 whether the motion information of the vertical prediction mode is the same, if not the same, the vertical prediction mode can be added to the motion information prediction mode candidate list, if the same, the vertical prediction mode can be prohibited from being added to the motion information prediction mode candidate list.
[0218] For the horizontal upward prediction mode, the motion information of A8 can be compared with the motion information of A9 to see if they are the same, and the motion information of A9 can be compared with A1. 10 If the motion information of A8 is the same as that of A9, and the motion information of A9 is the same as that of A 10 If the motion information of A8 is the same as that of A9, the horizontal upward prediction mode may be prohibited from being added to the motion information prediction mode candidate list. Alternatively, if the motion information of A8 is different from the motion information of A9, and / or the motion information of A9 is the same as that of A 10 If the motion information is different, the horizontal upward prediction mode can be added to the motion information prediction mode candidate list.
[0219] For the horizontal downward prediction mode, the motion information of A2 may be compared to see if it is the same as the motion information of A4, and the motion information of A4 may be compared to see if it is the same as the motion information of A6. If the motion information of A2 is the same as the motion information of A4, and the motion information of A4 is the same as the motion information of A6, the horizontal downward prediction mode may be prohibited from being added to the motion information prediction mode candidate list. Alternatively, if the motion information of A2 is different from the motion information of A4, and / or the motion information of A4 is different from the motion information of A6, the horizontal upward prediction mode may be added to the motion information prediction mode candidate list.
[0220] For the vertical right prediction mode, we can compare A 12 The movement information and A 14 Are the motion information of A and B the same? 14 The movement information and A 16 The motion information of is the same. If A 12 The movement information and A 14 The motion information of is the same, and A 14 The movement information and A 16 If the motion information of A is the same as that of B, the vertical right prediction mode may be prohibited from being added to the motion information prediction mode candidate list. 12 The movement information and A 14 The motion information of A is different, and / or A 14 The movement information and A 16 If the motion information is different, the vertical right prediction mode can be added to the motion information prediction mode candidate list.
[0221] Embodiment 11: With respect to step 602 and step 702, the width value of the current block is W, the height value of the current block is H, W is 16, H is 32, and the motion information of the surrounding blocks is stored in a minimum unit of 4*4.
[0222] See also Fig. 9C As shown, for the horizontal prediction mode, the motion information of A8 is compared with A 12 The motion information of the two nodes is the same. If not, the horizontal prediction mode is added to the motion information prediction mode candidate list. If they are the same, the horizontal prediction mode is prohibited from being added to the motion information prediction mode candidate list.
[0223] For vertical prediction mode, compare A 14 The movement information and A 16 whether the motion information of the vertical prediction mode is the same, if not the same, the vertical prediction mode can be added to the motion information prediction mode candidate list, if the same, the vertical prediction mode can be prohibited from being added to the motion information prediction mode candidate list.
[0224] For the horizontal upward prediction mode, we can compare A 12 The movement information and A 13 Are the motion information of A and B the same? 13 The movement information and A 14 The motion information of is the same. If A 12 The movement information and A 13 The motion information of is the same, and A 13 The movement information and A 14If the motion information of A is the same as that of B, the horizontal upward prediction mode may be prohibited from being added to the motion information prediction mode candidate list. 12 The movement information and A 13 The motion information of A is different, and / or A 13 The movement information and A 14 If the motion information is different, the horizontal upward prediction mode can be added to the motion information prediction mode candidate list.
[0225] For the horizontal downward prediction mode, the motion information of A2 may be compared to see if it is the same as the motion information of A4, and the motion information of A4 may be compared to see if it is the same as the motion information of A8. If the motion information of A2 is the same as the motion information of A4, and the motion information of A4 is the same as the motion information of A8, the horizontal downward prediction mode may be prohibited from being added to the motion information prediction mode candidate list. Alternatively, if the motion information of A2 is different from the motion information of A4, and / or the motion information of A4 is different from the motion information of A8, the horizontal upward prediction mode may be added to the motion information prediction mode candidate list.
[0226] For the vertical right prediction mode, we can compare A 16 The movement information and A 18 Are the motion information of A and B the same? 18 The movement information and A 22 The motion information of is the same. If A 16 The movement information and A 18 The motion information of is the same, and A 18 The movement information and A 22 If the motion information of A is the same as that of B, the vertical right prediction mode may be prohibited from being added to the motion information prediction mode candidate list. 16 The movement information and A 18 The motion information of A is different, and / or A 18 The movement information and A 22 If the motion information is different, the vertical right prediction mode can be added to the motion information prediction mode candidate list.
[0227] Embodiment 12: For step 604 and step 704, a motion compensation process needs to be performed, that is, the current block is encoded or decoded according to the target motion information angle prediction mode. In this motion compensation process, the selection condition for obtaining motion information of the current block can be determined according to the target 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. According to the target motion information angle prediction mode and the size of the current block, the sub-region division information of the current block is determined. According to the pre-configured angle corresponding to the target motion information angle prediction mode, the surrounding matching block pointed to by the pre-configured angle is selected from the surrounding blocks of the current block. According to the selection condition, the sub-region division information and the motion information of the surrounding matching blocks, the motion information of the current block is determined.
[0228] Exemplarily, not allowing bidirectional motion information may include: if the motion information of the surrounding matching block is unidirectional motion information, then 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, then 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. Allowing bidirectional motion information may include: if the motion information of the surrounding matching block is unidirectional motion information, then 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, then allowing the bidirectional motion information of the surrounding matching block to be selected as the motion information of the current block or sub-region.
[0229] 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.
[0230] Determining sub-region division information of the current block according to the motion information angle prediction mode and the size of the current block may include: 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, then 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, then the size of the sub-region is 4*4.
[0231] 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 can be greater than the preset size parameter, can be equal to the preset size parameter, and can also 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 can be greater than the preset size parameter, can be equal to the preset size parameter, and can also be less than the preset size parameter; if the width of the current block is equal to the preset size parameter, the height of the current block is greater than or equal to the preset size parameter, and the size of the sub-area is 8*8.
[0232] 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 is greater than the preset size parameter, or equal to the preset size parameter, or 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.
[0233] In one example, the preset size parameter may be 8, or may be other values. 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.
[0234] 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:
[0235] Dividing the current block into at least one sub-region according to the sub-region division information;
[0236] 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;
[0237] The motion information of the at least one sub-region is determined as the motion information of the current block.
[0238] 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.
[0239] The motion compensation process in the above embodiment is described below in conjunction with several specific embodiments.
[0240] Example 13: See Fig. 10A As 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. 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.
[0241] As shown in Table 1, Embodiment 13 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.
[0242] according to Fig. 10A , 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.
[0243] according to Fig. 10A, 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.
[0244] according to Fig. 10A , 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.
[0245] according to Fig. 10A, 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.
[0246] according to Fig. 10A , 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.
[0247] Example 14: See Fig. 10B 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:
[0248] 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.
[0249] 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.
[0250] As shown in Table 1, Embodiment 14 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.
[0251] according to Fig. 10B , 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.
[0252] according to Fig. 10B, 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.
[0253] according to Fig. 10B , 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.
[0254] according to Fig. 10B, 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 4*4 sub-region 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 the 4*4 sub-regions 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 the 4*4 sub-regions 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 the 4*4 sub-regions 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.
[0255] according to Fig. 10B , 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 4*4 sub-region 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 the 4*4 sub-regions 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 the 4*4 sub-regions 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 the 4*4 sub-regions 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.
[0256] Example 15: See Fig. 10C 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:
[0257] 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.
[0258] If the angle prediction mode is another angle prediction mode, 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.
[0259] 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.
[0260] As shown in Table 1, Embodiment 15 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.
[0261] according to Fig. 10C , 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.
[0262] according to Fig. 10C, 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.
[0263] according to Fig. 10C , 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.
[0264] according to Fig. 10C, 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.
[0265] according to Fig. 10C , 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.
[0266] Embodiment 16: If 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.
[0267] 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.
[0268] For example, see Fig. 10D 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.10E 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.10F 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 10G 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. Fig. 10H 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.
[0269] As shown in Table 1, Embodiment 16 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.
[0270] according to Fig. 10D , 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.
[0271] according to Fig.10E, 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.
[0272] according to Fig.10F , 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.
[0273] according to Figure 10G, 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.
[0274] according to Fig. 10H , 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.
[0275] Embodiment 17: 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:
[0276] 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.
[0277] 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.
[0278] For example, see Fig.10I 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. Fig.10J 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.
[0279] As shown in Table 1, Embodiment 17 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 division size is width*4, 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.
[0280] according to Fig.10I, 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.
[0281] according to Fig.10J , when the size of the current block is 16*8 and the target motion information prediction mode 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.
[0282] Embodiment 18: 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:
[0283] 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.
[0284] 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.
[0285] For example, see Figure 10K 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. Fig.10L 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.
[0286] As shown in Table 1, Embodiment 18 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 partition size is 4*height, 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.
[0287] according to Figure 10K , 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.
[0288] according to Fig.10L, when the size of the current block is 16*8 and the target motion information prediction mode is the horizontal mode, it is divided into two sub-regions of 8*8 size. One 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. 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 the 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.
[0289] Embodiment 19: 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:
[0290] 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.
[0291] 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.
[0292] 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.
[0293] See also Figure 10MAs 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.
[0294] As shown in Table 1, Embodiment 19 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.
[0295] according to Figure 10M , when the size of the current block is 16*16 and the target motion information prediction mode is the vertical mode, it is divided into 4 sub-regions of size 4*16. One 4*16 sub-region corresponds to the surrounding matching block B1. According to the motion information of B1, the motion information of the 4*16 sub-region is determined. One 4*16 sub-region corresponds to the surrounding matching block B2. According to the motion information of B2, the motion information of the 4*16 sub-region is determined. One 4*16 sub-region corresponds to the surrounding matching block B3. According to the motion information of B3, the motion information of the 4*16 sub-region is determined. One 4*16 sub-region corresponds to the surrounding matching block B4. According to the motion information of B4, the motion information of the 4*16 sub-region is determined. For the 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.
[0296] according to Figure 10M, 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.
[0297] Embodiment 20: 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. Fig.10N 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.
[0298] In Embodiment 20, 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.
[0299] according to Fig.10N, 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.
[0300] according to Fig.10N , 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.
[0301] according to Fig.10N, 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 can be 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, and there is no restriction on this determination method, 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.
[0302] according to Fig.10N , 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.
[0303] according to Fig.10N , 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.
[0304] Embodiment 21: When the width W of the current block is greater than or equal to 8 and the height H is greater than or equal to 8, motion compensation is performed on each 8*8 sub-region in the current block. For each sub-region, any one of several motion information of the surrounding matching blocks is selected according to the corresponding angle, see Fig.10N shown.
[0305] Embodiment 22: 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.11As shown, it is a structural diagram of the device, including:
[0306] An acquisition module 111, configured to acquire at least one motion information angle prediction mode of a current block;
[0307] The processing module 112 is configured to select, for each motion information angle prediction mode, a plurality of surrounding matching blocks pointed to by the pre-configured angle from the surrounding blocks of the current block based on the pre-configured angle of the motion information angle prediction mode; if the motion information of the plurality of surrounding matching blocks is not completely the same, add the motion information angle prediction mode to a motion information prediction mode candidate list;
[0308] The encoding and decoding module 113 is configured to encode or decode the current block according to the motion information prediction mode candidate list.
[0309] The processing module 112 is further configured to prohibit adding the motion information angle prediction mode to the motion information prediction mode candidate list if the motion information of the plurality of peripheral matching blocks is completely the same.
[0310] The processing module 112 is further configured to select at least one first peripheral matching block from the plurality of peripheral matching blocks; for each first peripheral matching block, select a second peripheral matching block corresponding to the first peripheral matching block from the plurality of peripheral matching blocks; if the motion information of the first peripheral matching block is different from the motion information of the second peripheral matching block, determine that the comparison result of the first peripheral matching block is different in motion information; if the motion information of the first peripheral matching block is the same as the motion information of the second peripheral matching block, determine that the comparison result of the first peripheral matching block is the same in motion information;
[0311] If the comparison result of any first peripheral matching block is that the motion information is different, it is determined that the motion information of the multiple peripheral matching blocks is not completely the same; if the comparison results of all first peripheral matching blocks are that the motion information is the same, it is determined that the motion information of the multiple peripheral matching blocks is completely the same.
[0312] When the processing module 112 selects at least one first peripheral matching block from the plurality of peripheral matching blocks, it is specifically configured to: use any one or more of the plurality of peripheral matching blocks as the first peripheral matching block; or use one or more designated ones of the plurality of peripheral matching blocks as the first peripheral matching block;
[0313] When the processing module 112 selects the second surrounding matching block corresponding to the first surrounding matching block from the multiple surrounding matching blocks, it is specifically used to: select the second surrounding matching block corresponding to the first surrounding matching block from the multiple surrounding matching blocks according to the traversal step and the position of the first surrounding matching block; wherein the traversal step is the block interval between the first surrounding matching block and the second surrounding matching block.
[0314] The processing module 112 is further configured to determine the traversal step length based on the size of the current block.
[0315] In one example, the encoding and decoding device further includes (not shown in the figure):
[0316] A filling module is used to fill the motion information of the uncoded blocks and / or the intra-coded blocks if there are uncoded blocks and / or intra-coded blocks in the multiple surrounding matching blocks.
[0317] When the filling module fills the motion information of the uncoded block and / or the intra-coded block, it is specifically used to: fill the available motion information of the neighboring blocks of the uncoded block and / or the intra-coded block with the motion information of the uncoded block and / or the intra-coded block; or
[0318] Fill the available motion information of the reference block at the corresponding position of the uncoded block and / or the intra-coded block in the time domain reference frame with the motion information of the uncoded block and / or the intra-coded block; or,
[0319] The default motion information is filled as the motion information of the uncoded block and / or the intra-coded block.
[0320] In one example, when the encoding and decoding module 113 encodes or decodes the current block according to the motion information prediction mode candidate list, it is specifically used to:
[0321] Selecting a target motion information prediction mode of the current block from the motion information prediction mode candidate list; if the target motion information prediction mode is a target motion information angle prediction mode, then:
[0322] Determining the motion information of the current block according to the target motion information angle prediction mode;
[0323] A prediction value of the current block is determined according to the motion information of the current block.
[0324] The encoding and decoding module 113 determines the motion information of the current block according to the target motion information angle prediction mode and is specifically used to: select a plurality of surrounding matching blocks pointed to by the pre-configured angle from the surrounding blocks of the current block based on the pre-configured angle corresponding to the target motion information angle prediction mode;
[0325] Divide the current block into at least one sub-region; for each sub-region, select a surrounding matching block corresponding to the sub-region from the plurality of surrounding matching blocks;
[0326] The motion information of the sub-region is determined according to the motion information of the selected peripheral matching blocks.
[0327] The encoding and decoding module 113 determines the motion information of the current block according to the target motion information angle prediction mode, and is specifically used to: determine the selection condition for obtaining the motion information of the current block and 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; 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;
[0328] Based on the preconfigured angle corresponding to the target motion information angle prediction mode, selecting a plurality of surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block;
[0329] 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 plurality of surrounding matching blocks.
[0330] The encoding and decoding module 113 determines the motion information of the current block according to the target motion information angle prediction mode, and is specifically used to: select a surrounding matching block pointed to by the pre-configured angle from the surrounding blocks of the current block according to the pre-configured angle corresponding to the target motion information angle prediction mode;
[0331] The motion information of the current block is determined according to the motion information of the surrounding matching blocks; wherein, if the width and height of the current block are both greater than or equal to 8, the current block is divided into sub-blocks according to 8*8, and the motion information selected from the motion information of the surrounding matching blocks is allowed to be bidirectional motion information.
[0332] 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.12The 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.
[0333] For example, the processor 121 is used to execute machine executable instructions to implement the following steps:
[0334] Obtaining at least one motion information angle prediction mode of the current block;
[0335] For each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block;
[0336] If the motion information of the plurality of surrounding matching blocks are not completely the same, adding the motion information angle prediction mode to a motion information prediction mode candidate list;
[0337] The current block is decoded according to the motion information prediction mode candidate list.
[0338] 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.13 The system comprises: a processor 131 and a machine-readable storage medium 132, wherein the machine-readable storage medium 132 stores machine-executable instructions that can be executed by the processor 131; the processor 131 is used to execute the machine-executable instructions to implement the method disclosed in the above example of the present application.
[0339] For example, the processor 131 is used to execute machine executable instructions to implement the following steps:
[0340] Obtaining at least one motion information angle prediction mode of the current block;
[0341] For each motion information angle prediction mode, based on the pre-configured angle of the motion information angle prediction mode, select a plurality of surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block;
[0342] If the motion information of the plurality of surrounding matching blocks are not completely the same, adding the motion information angle prediction mode to a motion information prediction mode candidate list;
[0343] The current block is encoded according to the motion information prediction mode candidate list.
[0344] 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.
[0345] 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.
[0346] 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.
[0347] 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.
[0348] 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.
[0349] 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.
[0350] 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 is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0351] 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.
[0352] 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: Acquire at least one motion information angle prediction mode of the current block; for each motion information angle prediction mode, select multiple surrounding matching blocks pointed to by the pre-configured angle from surrounding blocks of the current block based on the pre-configured angle of the motion information angle prediction mode; if the motion information of the multiple surrounding matching blocks is not completely the same, add the motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; Selecting a target motion information prediction mode of the current block from the motion information prediction mode candidate list; if the target motion information prediction mode is a target motion information angle prediction mode, selecting a plurality of surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block based on a preconfigured angle corresponding to the target motion information angle prediction mode; If the multiple surrounding matching blocks pointed to by the preconfigured angle include uncoded blocks and / or intra-frame coded blocks, filling the motion information of the uncoded blocks and / or the intra-frame coded blocks; Divide the current block into at least one sub-region; for each sub-region, select a surrounding matching block corresponding to the sub-region from a plurality of surrounding matching blocks; determine motion information of the sub-region according to motion information of the selected surrounding matching block; A prediction value of the current block is determined according to motion information of each sub-region in the current block.
2. The method according to claim 1, characterized in that: The filling the motion information of the uncoded block and / or the intra-coded block includes: For the uncoded block and / or the intra-coded block, default motion information is filled as motion information of the uncoded block and / or the intra-coded block; or available motion information of neighboring blocks of the uncoded block and / or the intra-coded block is filled as motion information of the uncoded block and / or the intra-coded block.
3. The method according to claim 1, characterized in that After selecting a plurality of surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block based on the preconfigured angle of the motion information angle prediction mode, the method further comprises: If the motion information of the plurality of surrounding matching blocks are completely identical, it is prohibited to add the motion information angle prediction mode to the motion information prediction mode candidate list corresponding to the current block.
4. The method according to claim 1 or 3, characterized in that: The method further comprises: Select at least one first peripheral matching block from the plurality of peripheral matching blocks; for each first peripheral matching block, select a second peripheral matching block corresponding to the first peripheral matching block from the plurality of peripheral matching blocks; If the motion information of the first peripheral matching block is different from the motion information of the second peripheral matching block, determining that the comparison result of the first peripheral matching block is different in motion information; if the motion information of the first peripheral matching block is the same as the motion information of the second peripheral matching block, determining that the comparison result of the first peripheral matching block is the same in motion information; If the comparison result of any first peripheral matching block is that the motion information is different, it is determined that the motion information of the multiple peripheral matching blocks is not completely the same; if the comparison results of all first peripheral matching blocks are that the motion information is the same, it is determined that the motion information of the multiple peripheral matching blocks is completely the same.
5. A decoding device, characterized in that: Applied to a decoding end, the device comprises: An acquisition module, used to acquire at least one motion information angle prediction mode of a current block; a processing module, configured to select, for each motion information angle prediction mode obtained by the obtaining module, a plurality of surrounding matching blocks pointed to by the pre-configured angle from the surrounding blocks of the current block based on the pre-configured angle of the motion information angle prediction mode; if the motion information of the plurality of surrounding matching blocks is not completely the same, add the motion information angle prediction mode to a motion information prediction mode candidate list corresponding to the current block; A decoding module, used for selecting a target motion information prediction mode of the current block from the motion information prediction mode candidate list; if the target motion information prediction mode is a target motion information angle prediction mode, then based on a preconfigured angle corresponding to the target motion information angle prediction mode, selecting multiple surrounding matching blocks pointed to by the preconfigured angle from surrounding blocks of the current block; if the multiple surrounding matching blocks pointed to by the preconfigured angle include uncoded blocks and / or intra-coded blocks, then filling the motion information of the uncoded blocks and / or the intra-coded blocks; dividing the current block into at least one sub-region; for each sub-region, selecting a surrounding matching block corresponding to the sub-region from multiple surrounding matching blocks; determining the motion information of the sub-region according to the motion information of the selected surrounding matching block; and determining the prediction value of the current block according to the motion information of each sub-region in the current block.
6. The device according to claim 5, characterized in that When the decoding module fills the motion information of the uncoded block and / or the intra-coded block, it is specifically used to: for the uncoded block and / or the intra-coded block, fill the default motion information as the motion information of the uncoded block and / or the intra-coded block; Alternatively, available motion information of neighboring blocks of the uncoded block and / or the intra-coded block is filled as the motion information of the uncoded block and / or the intra-coded block.
7. The device according to claim 5, characterized in that The processing module is further configured to, based on the pre-configured angle of the motion information angle prediction mode, select multiple surrounding matching blocks pointed to by the pre-configured angle from the surrounding blocks of the current block, and to prohibit adding the motion information angle prediction mode to the motion information prediction mode candidate list corresponding to the current block if the motion information of the multiple surrounding matching blocks are exactly the same.
8. The device according to claim 5 or 7, characterized in that The processing module is further configured to select at least one first surrounding matching block from the multiple surrounding matching blocks; for each first surrounding matching block, select a second surrounding matching block corresponding to the first surrounding matching block from the multiple surrounding matching blocks; if the motion information of the first surrounding matching block is different from the motion information of the second surrounding matching block, determine that the comparison result of the first surrounding matching block is different in motion information; if the motion information of the first surrounding matching block is the same as the motion information of the second surrounding matching block, determine that the comparison result of the first surrounding matching block is the same in motion information; if the comparison result of any first surrounding matching block is different in motion information, determine that the motion information of the multiple surrounding matching blocks is not completely the same; if the comparison results of all first surrounding matching blocks are that the motion information is the same, determine that the motion information of the multiple surrounding matching blocks is completely the same.
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 steps described in any one of claims 1-4.
