A coding and decoding method, device and equipment thereof
Through the inter-frame and intra-frame joint prediction method, the weighted attributes are used to determine the target prediction mode, and the prediction values of the intra-frame and inter-frame areas are combined to solve the problem of poor prediction effect of inter-frame coding on the edge of objects in the existing technology, and improve the coding efficiency. performance and forecast accuracy.
Patent Information
- Application Number
- CN202210633928.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-09-05
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2039-09-05
AI Technical Summary
In the existing technology, when inter-frame coding processes object edges, rectangular division cannot effectively segment different objects, resulting in poor prediction results, large coding residuals, and poor coding performance.
The inter-frame and intra-frame joint prediction method is used to determine the target intra-frame and inter-frame prediction modes by obtaining the weighted attributes of the current block, and combines the prediction values of the intra-frame and inter-frame areas to improve prediction accuracy and coding performance.
It improves the prediction accuracy and coding performance of inter-frame coding, reduces the coding residual, and makes the predicted value closer to the original pixel.
Smart Images

Figure CN115022639B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of coding and decoding technology, and in particular to a coding and decoding method, device and equipment thereof. Background Art
[0002] In order to save space, video images are transmitted after being encoded. The complete video encoding method may include prediction, transformation, quantization, entropy coding, filtering and other processes. Among them, predictive coding may include intra-frame coding and inter-frame coding. Furthermore, inter-frame coding uses the correlation of the video time domain to predict the current pixel using the pixels of the adjacent encoded image to effectively remove the redundancy of the video time domain. In addition, intra-frame coding refers to using the correlation of the video space domain to predict the current pixel using the pixels of the encoded block of the current frame image to remove the redundancy of the video space domain.
[0003] In inter-frame coding, a motion vector (MV) can be used to represent the relative displacement between the current block of the current frame image and the reference block of the reference frame image. For example, there is a strong temporal correlation between the current frame image A and the reference frame image B. When the current block A1 of image A needs to be transmitted, a motion search can be performed in image B to find the reference block B1 that best matches the current block A1, and determine the relative displacement between the current block A1 and the reference block B1, that is, the motion vector of the current block A1.
[0004] In the prior art, the current block is a rectangle, but the edge of an actual object is often not a rectangle. For the current block at the edge of an object, there are often two different objects (such as a foreground object and a background). When the motions of the two objects are inconsistent, the rectangular division cannot separate the two objects well. The triangular prediction mode divides the current block into two inter-frame prediction areas along the diagonal line, and assigns different motion information to each area. However, when the deformation of one of the objects is large, the inter-frame prediction of the area cannot obtain its prediction value well, which directly leads to poor prediction effect, large coding residual, poor coding performance and other problems. Summary of the invention
[0005] The present application provides a coding and decoding method, apparatus and device thereof, which improve the accuracy of prediction.
[0006] The present application provides a coding and decoding method, the method comprising:
[0007] When determining to start inter-frame and intra-frame joint prediction for a current block, obtaining a weighted attribute of the current block; wherein the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0008] Acquire, according to the weighted attribute, a target intra prediction mode bound to the weighted attribute;
[0009] Obtaining a target inter-frame prediction mode of the current block;
[0010] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0011] The present application provides a coding and decoding method, the method comprising:
[0012] When determining to start inter-frame and intra-frame joint prediction for the current block, obtaining a target intra-frame prediction mode of the current block;
[0013] Acquire a weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0014] Obtaining a target inter-frame prediction mode of the current block;
[0015] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0016] The present application provides a coding and decoding device, the device comprising:
[0017] A first acquisition module is used to acquire a weighted attribute of the current block when determining to start inter-frame and intra-frame joint prediction for the current block; wherein the weighted attribute is used to indicate the division information of the current block and the relative position of the intra-frame region and the inter-frame region included in the current block; and acquire a target intra-frame prediction mode bound to the weighted attribute according to the weighted attribute;
[0018] A second acquisition module, used to acquire a target inter-frame prediction mode of the current block;
[0019] The third acquisition module is used to obtain the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0020] The present application provides a coding and decoding device, the device comprising:
[0021] A first acquisition module is used to acquire a target intra prediction mode of the current block when determining to start inter-frame and intra-frame joint prediction for the current block; acquire a weighted attribute bound to the target intra prediction mode according to the target intra prediction mode; the weighted attribute is used to indicate the division information of the current block and the relative position of the intra region and the inter region included in the current block;
[0022] A second acquisition module, used to acquire a target inter-frame prediction mode of the current block;
[0023] The third acquisition module is used to obtain the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0024] 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;
[0025] The processor is used to execute machine executable instructions to implement the following steps:
[0026] When determining to start inter-frame and intra-frame joint prediction for a current block, obtaining a weighted attribute of the current block; wherein the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0027] Acquire, according to the weighted attribute, a target intra prediction mode bound to the weighted attribute;
[0028] Obtaining a target inter-frame prediction mode of the current block;
[0029] Acquire a prediction value of the current block according to the target intra prediction mode and the target inter prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region and a prediction value of an inter region, the prediction value of the intra region is determined according to the target intra prediction mode, and the prediction value of the inter region is determined according to the target inter prediction mode;
[0030] Alternatively, the processor is used to execute machine executable instructions to implement the following steps:
[0031] When determining to start inter-frame and intra-frame joint prediction for the current block, obtaining a target intra-frame prediction mode of the current block;
[0032] Acquire a weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0033] Obtaining a target inter-frame prediction mode of the current block;
[0034] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0035] 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;
[0036] The processor is used to execute machine executable instructions to implement the following steps:
[0037] When determining to start inter-frame and intra-frame joint prediction for a current block, obtaining a weighted attribute of the current block; wherein the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0038] Acquire, according to the weighted attribute, a target intra prediction mode bound to the weighted attribute;
[0039] Obtaining a target inter-frame prediction mode of the current block;
[0040] Acquire a prediction value of the current block according to the target intra prediction mode and the target inter prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region and a prediction value of an inter region, the prediction value of the intra region is determined according to the target intra prediction mode, and the prediction value of the inter region is determined according to the target inter prediction mode;
[0041] Alternatively, the processor is used to execute machine executable instructions to implement the following steps:
[0042] When determining to start inter-frame and intra-frame joint prediction for the current block, obtaining a target intra-frame prediction mode of the current block;
[0043] Acquire a weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0044] Obtaining a target inter-frame prediction mode of the current block;
[0045] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0046] It can be seen from the above technical solution that in the embodiment of the present application, when determining to start the inter-frame and intra-frame joint prediction for the current block, the target intra-frame prediction mode and the target inter-frame prediction mode can be obtained, and the prediction value of the current block can be obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode. In the above method, the prediction value of the current block can be obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, thereby improving the prediction accuracy, improving the prediction performance, improving the encoding performance, and reducing the encoding residual. Moreover, when determining the target intra-frame prediction mode, the target intra-frame prediction mode bound to the weighted attribute is obtained according to the weighted attribute, thereby further improving the encoding performance, making the predicted value closer to the original pixel, and bringing about an improvement in the encoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the video coding framework;
[0048] Figure 2A and Figure 2B It is a schematic diagram of inter-frame and intra-frame joint prediction;
[0049] Figure 3A-3D is a schematic diagram of inter-frame and intra-frame joint prediction in one implementation of the present application;
[0050] Figure 4 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0051] Figure 5A-5H is a schematic diagram of division information in one implementation of the present application;
[0052] Figure 6A-6C is a schematic diagram of inter-frame and intra-frame joint prediction in one implementation of the present application;
[0053] Figure 7A-7D is a flowchart of a coding and decoding method in one embodiment of the present application;
[0054] Figure 8 is a flowchart of a coding and decoding method in one embodiment of the present application;
[0055] Figure 9A-9D It is a schematic diagram of the intra-frame area and the inter-frame area;
[0056] Fig. 10A and Fig. 10B It is a schematic diagram of a process for obtaining a predicted value in one embodiment of the present application;
[0057] Fig.11A and Fig. 11B is a schematic structural diagram of a coding and decoding device in one embodiment of the present application;
[0058] Fig. 11C is a hardware structure diagram of a decoding end device in one embodiment of the present application;
[0059] Fig.11D It is a hardware structure diagram of an encoding end device in one implementation of the present application. DETAILED DESCRIPTION
[0060] 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 embodiments of the present application and the 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. It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, 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 embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "at the time of" or "when" or "in response to determination".
[0061] In the embodiments of the present application, a coding and decoding method, apparatus and device thereof are proposed, which may involve the following concepts:
[0062] Intra prediction and inter prediction:
[0063] Intra-frame prediction refers to the use of the correlation in the video spatial domain to predict the current pixel using the pixels of the coded block of the current image, so as to remove the spatial redundancy of the video. Intra-frame prediction specifies multiple prediction modes, each of which corresponds to a texture direction (except DC mode and Planar mode). For example, if the texture of the image is arranged horizontally, the horizontal prediction mode can better predict the image information, and prediction can be performed based on the horizontal prediction mode.
[0064] Inter-frame prediction refers to the use of adjacent coded image pixels to predict the pixels of the current image based on the correlation of the video time domain. Since the video sequence contains strong temporal correlation, it can effectively remove the temporal redundancy of the video. The inter-frame prediction part of the video coding standard uses block-based motion compensation technology. The main principle is to find a best matching block in the previously coded image for each pixel block of the current image. This process is called motion estimation (ME).
[0065] Prediction Signal: Prediction signal refers to the pixel value derived from the coded pixel. The residual is obtained by the difference between the original pixel and the predicted pixel, and then the residual transform quantization and coefficient encoding are performed. Inter-frame prediction pixel refers to the pixel value derived from the reference frame of the current block. Since the pixel position is discrete, the motion vector accuracy is often higher than the pixel accuracy of the reference frame, so interpolation operation is often required to obtain the final prediction pixel. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two, and the higher the coding compression performance.
[0066] Motion Vector (MV): In inter-frame coding, a motion vector can be used to represent the relative displacement between the current block of the current frame video image and the reference block of the reference frame video image. Each divided block has a corresponding motion vector transmitted to the decoding end. If the motion vector of each block is independently encoded and transmitted, especially when divided into a large number of small-sized 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 blocks can be used to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then the prediction difference is encoded, which can effectively reduce the number of bits representing the motion vector. Furthermore, in the process of encoding the motion vector of the current block, the motion vector of the current block can be first predicted using the motion vector of the adjacent encoded block, and then the difference (MVD, Motion Vector Difference) between the predicted value (MVP, Motion Vector Prediction) of the motion vector and the true estimate of the motion vector is encoded, thereby effectively reducing the number of bits for encoding the motion vector.
[0067] Motion Information: Since the motion vector represents the position offset between the current block and a reference block, in order to accurately obtain the information pointing to the block, in addition to the motion vector, the index information of the reference frame image is also required to indicate which reference frame image the current block uses. 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 block. In addition, 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 summary, in video coding technology, motion vectors, reference frame indexes, reference directions and other motion-related information can be collectively referred to as motion information.
[0068] Intra-frame prediction mode: In intra-frame coding, intra-frame prediction mode can be used for motion compensation, that is, intra-frame prediction mode is used to obtain the prediction value of the current block. For example, intra-frame prediction mode can include Planar mode, DC mode and 33 angle modes. See Table 1 for examples of intra-frame prediction modes. Planar mode corresponds to mode 0, DC mode corresponds to mode 1, and the remaining 33 angle modes correspond to modes 1-34. Planar mode is suitable for areas where pixel values change slowly. Two linear filters in the horizontal and vertical directions are used, and the average value of the two is used as the prediction value of the current block pixel. DC mode is suitable for large flat areas. The average value of the surrounding pixels of the current block is used as the prediction value of the current block. There can be 33 angle modes, mode 26 represents the vertical direction, and mode 10 represents the horizontal direction. In the latest new generation codec standard VVC, more subdivided angle directions are adopted, such as a total of 67 angle modes.
[0069] Table 1
[0070] Intra prediction mode Intra prediction mode 0 Planar Mode 1 DC Mode 2…34 angular2...angular34
[0071] Inter-frame prediction mode: In inter-frame coding, the inter-frame prediction mode can be used for motion compensation, that is, the prediction value of the current block is obtained by using the inter-frame prediction mode. For example, the inter-frame prediction mode can include the conventional merge mode (Merge mode), MMVD mode, affine merge mode, ATMVP (Alternative Temporal Motion Vector Prediction, optional temporal motion vector prediction) mode, etc. The ATMVP mode can also be called SBTMVP (sub-block TMVP) mode.
[0072] 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, where 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.
[0073] Video Coding Framework: See Figure 1 As shown, 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, no further description will be given here, and the decoding end processing flow of the embodiment of the present application can be implemented using a video decoding framework. 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 but are not limited to. At the encoding end, the encoding end processing flow can be implemented through the cooperation between these modules, and at the decoding end, the decoding end processing flow can be implemented through the cooperation between these modules.
[0074] Exemplarily, intra-frame prediction and inter-frame prediction remove spatial correlation and temporal correlation in video sequences respectively. With the continuous improvement of compression efficiency, simultaneous intra-frame prediction and inter-frame prediction are performed on coding blocks, which can remove both spatial correlation and temporal correlation to a certain extent. Therefore, a joint intra-frame and inter-frame prediction scheme is proposed.
[0075] See also Figure 2AAs shown, the CIIP (Combined inter / intra prediction) prediction block is obtained by weighting the intra prediction block (i.e., the pixel at each position is the intra prediction value obtained by adopting the intra prediction mode) and the inter prediction block (i.e., the pixel at each position is the inter prediction value obtained by adopting the inter prediction mode), and the weight of the inter prediction value and the intra prediction value adopted at each pixel position is 1:1. For example, for each position, the intra prediction value of the position is weighted with the inter prediction value of the position to obtain the joint prediction pixel value of the position, and finally the joint prediction pixel value of each position is combined into a CIIP prediction block. Exemplarily, the intra prediction mode of the intra prediction block can be fixed at the encoding end and the decoding end, so as to avoid the transmission syntax indicating a specific intra prediction mode. Alternatively, an intra prediction mode list is constructed, the encoding end encodes the index value of the selected intra prediction mode into the bitstream, and the decoding end selects the intra prediction mode from the intra prediction mode list based on the index value.
[0076] See also Figure 2B As shown, the CIIP prediction block is obtained by weighting the intra prediction block (i.e., the pixel at each position is the intra prediction value obtained by adopting the intra prediction mode) and the inter prediction block (i.e., the pixel at each position is the inter prediction value obtained by adopting the inter prediction mode). The CIIP prediction block is divided into two areas, one area is the intra area, and the other area is the inter area. The CIIP prediction block is distributed in a non-square manner in the inter area. The dotted dividing line can be a main diagonal line or a sub-diagonal line. The positions of the intra area and the inter area are variable. Each position of the intra area is mainly determined based on the intra prediction value. For example, when the intra prediction value of the position is weighted with the inter prediction value of the position, the weight of the intra prediction value is larger, and the weight of the inter prediction value is smaller (even 0), and the joint prediction pixel value of the position is obtained. Each position in the inter-frame area is mainly determined based on the inter-frame prediction value. For example, when the intra-frame prediction value of the position is weighted with the inter-frame prediction value of the position, the weight of the inter-frame prediction value is larger, and the weight of the intra-frame prediction value is smaller (even 0), and the joint prediction pixel value of the position is obtained. Finally, the joint prediction pixel value of each position is combined into a CIIP prediction block. Exemplarily, the intra-frame prediction mode of the intra-frame prediction block can be fixed at the encoding end and the decoding end, thereby avoiding the transmission syntax indicating a specific intra-frame prediction mode. Alternatively, the encoding end and the decoding end adopt a unified derivation method to derive the intra-frame prediction mode of the current block based on the intra-frame prediction mode of the surrounding blocks.
[0077] In the above method, the physical meaning of the dividing line is not taken into account, resulting in that the predicted value of the intra-frame prediction mode may come from the object on the other side of the dividing line, resulting in reduced accuracy of intra-frame prediction. In response to the above findings, an inter-frame and intra-frame joint prediction method is proposed in an embodiment of the present application, taking into account the following physical meaning of the dividing line: if the two sides of the dividing line belong to different objects, for the intra-frame area derived from the surrounding reconstructed pixels, the predicted value of the intra-frame area should not use the reconstructed pixels on one side of the inter-frame area. Therefore, for different weighted attributes (including division information and the relative position of the inter-frame area and the intra-frame area), different intra-frame prediction modes can be bound so that the predicted value of the intra-frame area does not use the reconstructed pixels on one side of the inter-frame area.
[0078] For example, see Figure 3A As shown in FIG. 1 , the intra-frame region is located at the lower left of the inter-frame region. For the intra-frame region, if the intra-frame region in the current block and the left peripheral region of the current block belong to the same object, then the pixels reconstructed based on the left peripheral region of the current block (such as Figure 3A The dark gray area on the left side of the current block in the image is used to determine that the reliability of the prediction value of the intra-frame area is better. Therefore, the reconstructed pixels on the left side of the outer side of the current block are credible, while the inter-frame area of the current block and the upper peripheral area of the current block belong to the same object. Based on the reconstructed pixels on the upper peripheral side of the current block, the reliability of the prediction value of the intra-frame area is poor. Therefore, the reconstructed pixels on the upper peripheral side of the current block are unreliable. Since the reconstructed pixels on the left side of the outer side of the current block are credible, and the reconstructed pixels on the upper peripheral side of the current block are unreliable, in a preferred embodiment, it is desired to use reconstructed pixels with high reliability to obtain the prediction value of the intra-frame area, rather than using reconstructed pixels with low reliability to obtain the prediction value of the intra-frame area. In summary, in order to use reconstructed pixels with high reliability to obtain the prediction value of the intra-frame area, Figure 3A The intra-frame prediction mode with weighted attribute binding shown makes the prediction value of the intra-frame area refer to the reconstructed pixels on the left side of the outer side of the current block, but does not refer to the reconstructed pixels on the upper side of the outer side of the current block.
[0079] See also Figure 3B As shown in FIG. 1 , the intra-frame region is located at the upper right of the inter-frame region. For the intra-frame region, if the intra-frame region in the current block and the upper peripheral region of the current block belong to the same object, then the pixels reconstructed based on the upper peripheral region of the current block (such as Figure 3BThe prediction value of the intra-frame region is determined to be more reliable based on the reconstructed pixels on the left side of the current block. Therefore, the reconstructed pixels on the upper side of the current block are reliable. The inter-frame region of the current block and the left side of the current block belong to the same object. Based on the reconstructed pixels on the left side of the current block, the prediction value of the intra-frame region is determined to be less reliable. Therefore, the reconstructed pixels on the left side of the current block are not reliable. Since the reconstructed pixels on the upper side of the current block are reliable, the reconstructed pixels on the left side of the current block are not reliable. In a preferred embodiment, Figure 3B The intra-frame prediction mode with weighted attribute binding shown makes the prediction value of the intra-frame area refer to the reconstructed pixels on the upper side of the outer periphery of the current block, but does not refer to the reconstructed pixels on the left side of the outer periphery of the current block.
[0080] See also Figure 3C As shown, the intra-frame region of the current block is located at the upper left of the inter-frame region of the current block. For the intra-frame region, if the intra-frame region in the current block belongs to the same object as the upper peripheral region of the current block and also belongs to the same object as the left peripheral region of the current block, then the reliability of the prediction value of the intra-frame region determined based on the reconstructed pixels of the upper peripheral of the current block is better. Therefore, the reconstructed pixels of the upper peripheral of the current block are credible, and the reliability of the prediction value of the intra-frame region determined based on the reconstructed pixels of the left peripheral of the current block is also better. Therefore, the reconstructed pixels of the left peripheral of the current block are credible. Since the reconstructed pixels of the upper peripheral of the current block are credible, the reconstructed pixels of the left peripheral of the current block are credible, in a preferred embodiment, Figure 3C The intra prediction mode with weighted attribute binding shown makes the prediction value of the intra region refer to the reconstructed pixels on the upper side of the outer periphery of the current block, and the prediction value of the intra region refer to the reconstructed pixels on the left side of the outer periphery of the current block.
[0081] See also Figure 3D As shown, the intra-frame area is located at the lower right of the inter-frame area. For the intra-frame area, if the intra-frame area in the current block does not belong to the same object as the upper peripheral area of the current block, and does not belong to the same object as the left peripheral area of the current block, then the reliability of the prediction value of the intra-frame area determined based on the reconstructed pixels of the upper peripheral area of the current block is relatively poor. Therefore, the reconstructed pixels of the upper peripheral area outside the current block are not credible. The reliability of the prediction value of the intra-frame area determined based on the reconstructed pixels of the left peripheral area of the current block is relatively poor. Therefore, the reconstructed pixels of the left peripheral area outside the current block are not credible. Since the reconstructed pixels of the upper peripheral area outside the current block are not credible, and the reconstructed pixels of the left peripheral area outside the current block are not credible, in a preferred embodiment, Figure 3D The weighting attributes shown do not need to be bound to the intra prediction mode and in this case the weighting attributes should not be used.
[0082] To sum up, in the embodiments of the present application, first, different weighting attributes are set, and for different weighting attributes, the corresponding intra-frame prediction modes are bound, so that the prediction value of the intra-frame area does not use the reconstructed pixels with lower credibility close to the inter-frame area side, so that the prediction value can be closer to the original pixel, thereby improving the encoding performance, improving the prediction accuracy, and improving the prediction performance.
[0083] The following is a detailed description of the encoding and decoding method in the embodiments of the present application in conjunction with several specific embodiments.
[0084] 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 coding and decoding method can be applied to a decoding end or an encoding end. The coding and decoding method can include the following steps:
[0085] Step 401, when determining to start inter-frame and intra-frame joint prediction for the current block, obtain the weighted attribute of the current block; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block.
[0086] In step 401, the decoding end or the encoding end needs to determine whether to start inter-frame and intra-frame joint prediction for the current block. If the inter-frame and intra-frame joint prediction is started for the current block, the encoding and decoding method of the embodiment of the present application can be used. If the inter-frame and intra-frame joint prediction is not started for the current block, the encoding and decoding method of the embodiment of the present application may not be used, and this process is not limited.
[0087] Exemplarily, it can be determined whether the characteristic information of the current block meets a specific condition; if yes, it is determined to start the inter-frame and intra-frame joint prediction for the current block; if no, it is determined not to start the inter-frame and intra-frame joint prediction for the current block. The characteristic information may include but is not limited to one or any combination of the following: the frame type of the current frame where the current block is located, and the size information of the current block.
[0088] For example, if the characteristic information is the frame type of the current frame where the current block is located, the frame type of the current frame where the current block is located meets specific conditions, including but not limited to: if the frame type of the current frame where the current block is located is a B frame, then it is determined that the frame type meets the specific conditions.
[0089] For example, if the characteristic information is the size information of the current block, and the size information includes the width of the current block and the height of the current block, then the size information of the current block satisfies a specific condition, which may include but is not limited to: if the width of the current block is greater than or equal to the first value, and the height of the current block is greater than or equal to the second value, it is determined that the size information of the current block satisfies the specific condition. Or, if the width of the current block is greater than or equal to the third value, the height of the current block is greater than or equal to the fourth value, the width of the current block is less than or equal to the fifth value, and the height of the current block is less than or equal to the sixth value, it is determined that the size information of the current block satisfies the specific condition. Or, if the product of the width and height of the current block is greater than or equal to the seventh value, it is determined that the size information of the current block satisfies the specific condition.
[0090] For example, the above values can be configured based on experience, such as 8, 16, 32, 64, 128, etc., without limitation. In a possible implementation, the first value can be 8, the second value can be 8, the third value can be 8, the fourth value can be 8, the fifth value can be 64, the sixth value can be 64, and the seventh value can be 64.
[0091] Of course, the above is just an example and is not limited to this. In summary, if the width of the current block is greater than or equal to 8, and the height of the current block is greater than or equal to 8, it is determined that the size information of the current block meets the specific conditions. Or, if the width of the current block is greater than or equal to 8, the height of the current block is greater than or equal to 8, the width of the current block is less than or equal to 64, and the height of the current block is less than or equal to 64, it is determined that the size information of the current block meets the specific conditions. Or, if the product of the width and height of the current block is greater than or equal to 64, it is determined that the size information of the current block meets the specific conditions.
[0092] For example, if the characteristic information is the frame type of the current frame where the current block is located and the size information of the current block, when the frame type meets the specific condition and the size information meets the specific condition, it is determined that the characteristic information of the current block meets the specific condition.
[0093] In step 401, the decoding end or the encoding end needs to obtain the weighted attribute of the current block, and the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame area and the inter-frame area included in the current block. Exemplarily, based on the division information of the current block, the current block is divided into an intra-frame area and an inter-frame area, and the shape of the intra-frame area can be the same as the shape of the inter-frame area, or the shape of the intra-frame area can be different from the shape of the inter-frame area. The intra-frame area is one of the following areas: a triangular area, a trapezoidal area, and a pentagonal area; the inter-frame area is one of the following areas: a triangular area, a trapezoidal area, and a pentagonal area.
[0094] For example, the current block can be divided into two triangular regions, see Figure 5AAs shown in FIG. 1 , an example of dividing the current block into two triangular regions in a sub-diagonal manner is shown in FIG. Figure 5B As shown in the figure, it is an example of dividing the current block into two triangular regions according to the main diagonal line. For another example, the current block can be divided into a triangular region and a trapezoidal region, or divided into two trapezoidal regions, or divided into a triangular region and a pentagonal region. Of course, the above are just a few examples and there is no limitation to this. The current block can be divided into two regions of any shape. This article only introduces some division possibilities. Figure 5C and Figure 5D As shown, the current block is divided into a triangular area and a trapezoidal area, see Figure 5E and Fig. 5F As shown, the current block is divided into two trapezoidal areas, see Figure 5G and Figure 5H As shown, the current block is divided into a triangular area and a pentagonal area.
[0095] In a possible implementation, the weighted attribute is used to indicate that the current block is divided into the upper left-lower right direction, and the relative position of the intra-frame region and the inter-frame region included in the current block is that the intra-frame region is located at the lower left of the inter-frame region. Figure 5B The division shown can also be Figure 5D The division shown can also be Fig. 5F The division shown can also be Figure 5G The division shown is not limited to this, as long as it is divided according to the upper left-lower right. After the current block is divided according to the upper left-lower right, the relative position relationship between the intra-frame area and the inter-frame area in the current block is configured such that the intra-frame area is located at the lower left of the inter-frame area, see Figure 3A As shown, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the lower left of the inter-frame region, see Fig. 6A As shown, the relative position relationship between the intra-frame area and the inter-frame area in the configured current block is that the intra-frame area is located at the lower left of the inter-frame area. Figure 3A and Fig. 6A These are just two examples and are not intended to be limiting.
[0096] In a possible implementation, the weighted attribute is used to indicate that the current block is divided into the upper left-lower right direction, and the relative position relationship between the intra-frame region and the inter-frame region in the current block is configured such that the intra-frame region is located above and to the right of the inter-frame region. Figure 5B The division shown can also be Figure 5D The division shown can also be Fig. 5F The division shown can also be Figure 5GThe division shown is not limited to this, as long as it is divided according to the upper left-lower right. After the current block is divided according to the upper left-lower right, the relative position relationship between the intra-frame area and the inter-frame area in the current block is configured such that the intra-frame area is located at the upper right of the inter-frame area. Figure 3B As shown, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the upper right of the inter-frame region, see Figure 6B As shown, the relative position relationship between the intra-frame area and the inter-frame area in the configured current block is that the intra-frame area is located at the upper right of the inter-frame area. Figure 3B and Figure 6B These are just two examples and are not intended to be limiting.
[0097] In a possible implementation, the weighted attribute is used to indicate that the current block is divided into the lower left and upper right directions, and the relative position relationship between the intra-frame region and the inter-frame region in the current block is configured such that the intra-frame region is located at the upper left of the inter-frame region. Figure 5A The division shown can be Figure 5C The division shown can also be Figure 5E The division shown can also be Figure 5H The division shown is not limited to this, as long as it is divided according to the lower left-upper right. After the current block is divided according to the lower left-upper right, the relative position relationship between the intra-frame area and the inter-frame area in the current block is configured such that the intra-frame area is located at the upper left of the inter-frame area. Figure 3C As shown, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the upper left of the inter-frame region, see Figure 6C As shown, the relative position relationship between the intra-frame area and the inter-frame area in the configured current block is that the intra-frame area is located at the upper left of the inter-frame area. Figure 3C and Figure 6C These are just two examples and are not intended to be limiting.
[0098] In step 401, the decoding end or the encoding end needs to obtain the weighted attribute of the current block. The encoding end can select a weighted attribute from all weighted attributes by comparing the rate-distortion cost value of each weighted attribute, and encode the index value of the weighted attribute into the coded bit stream. The decoding end obtains the weighted attribute corresponding to the index value in the coded bit stream. Alternatively, the encoding end and the decoding end both predefine a weighted attribute, and there is no restriction on the acquisition method, which can be multiple. Regarding the process of the decoding end or the encoding end obtaining the weighted attribute of the current block, please refer to the subsequent embodiments, which will not be repeated here.
[0099] Step 402: Acquire a target intra prediction mode bound to the weighted attribute according to the weighted attribute.
[0100] In a possible implementation, each weighted attribute may correspond to only one intra prediction mode, and the binding relationship between the two may be agreed upon in advance. Based on this, after obtaining the weighted attribute of the current block, if the weighted attribute corresponds to an intra prediction mode, the one intra prediction mode may be determined as the target intra prediction mode bound to the weighted attribute.
[0101] For example, if the weighted attribute is used to indicate that the current block is divided into upper left and lower right, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the lower left of the inter-frame region, see Figure 3A or Fig. 6A As shown, the target intra-frame prediction mode bound to the weighted attribute is the horizontal angle prediction mode. Figure 3A or Fig. 6A The binding relationship between the weighted attribute and the horizontal angle prediction mode is shown in FIG. Figure 3A or Fig. 6A When shown, the target intra-frame prediction mode is determined to be the horizontal angle prediction mode.
[0102] For example, if the weighted attribute is used to indicate that the current block is divided into upper left and lower right, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the upper right of the inter-frame region, see Figure 3B or Figure 6B As shown, the target intra-frame prediction mode bound to the weighted attribute is the vertical angle prediction mode. Figure 3B or Figure 6B The binding relationship between the weighted attribute and the vertical angle prediction mode is shown in FIG. Figure 3B or Figure 6B When shown, the target intra-frame prediction mode is determined to be the vertical angle prediction mode.
[0103] For example, if the weighted attribute is used to indicate that the current block is divided into the lower left and upper right regions, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the upper left of the inter-frame region, see Figure 3C or Figure 6C As shown, the target intra-frame prediction mode bound to the weighted attribute is the Planar prediction mode. Figure 3C or Figure 6C The binding relationship between the weighted attribute and the Planar prediction mode shown in FIG. Figure 3C or Figure 6C When shown, the target intra-frame prediction mode is determined to be the Planar prediction mode.
[0104] In another possible implementation, the weighted attribute may correspond to an intra-frame prediction mode list, and the intra-frame prediction mode list includes at least two intra-frame prediction modes. Based on this, after obtaining the weighted attribute of the current block, if the weighted attribute corresponds to an intra-frame prediction mode list, and the intra-frame prediction mode list includes at least two intra-frame prediction modes, the target intra-frame prediction mode bound to the weighted attribute may be obtained from the intra-frame prediction mode list.
[0105] The encoder compares the rate-distortion cost value of each intra-frame prediction mode in the intra-frame prediction mode list, obtains the target intra-frame prediction mode bound to the weighted attribute from the intra-frame prediction mode list, and encodes the index value of the target intra-frame prediction mode into the encoded bit stream. The decoder selects the intra-frame prediction mode corresponding to the index value from the intra-frame prediction mode list, and determines the selected intra-frame prediction mode as the target intra-frame prediction mode bound to the weighted attribute. For the process of the decoder or encoder obtaining the target intra-frame prediction mode bound to the weighted attribute, refer to the subsequent embodiments, which will not be repeated here.
[0106] For example, if the weighted attribute is used to indicate that the current block is divided into upper left and lower right, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the lower left of the inter-frame region, see Figure 3A or Fig. 6A As shown, the first intra-frame prediction mode in the intra-frame prediction mode list is the horizontal angle prediction mode. Based on this, the decoding end or the encoding end obtains the target intra-frame prediction mode bound to the weighted attribute from the intra-frame prediction mode list in which the first intra-frame prediction mode is the horizontal angle prediction mode.
[0107] For example, if the weighted attribute is used to indicate that the current block is divided into upper left and lower right, the intra-frame area is located at the upper right of the inter-frame area, see Figure 3B or Figure 6B As shown, the first intra-frame prediction mode in the intra-frame prediction mode list is a vertical angle prediction mode. Based on this, the decoding end or the encoding end obtains the target intra-frame prediction mode bound to the weighted attribute from the intra-frame prediction mode list in which the first intra-frame prediction mode is a vertical angle prediction mode.
[0108] For example, if the weighted attribute is used to indicate that the current block is divided into the lower left and upper right regions, the relative position relationship between the intra-frame region and the inter-frame region in the configured current block is that the intra-frame region is located at the upper left of the inter-frame region, see Figure 3C or Figure 6CAs shown, the first intra prediction mode in the intra prediction mode list is the Planar prediction mode. Based on this, the decoder or encoder obtains the target intra prediction mode bound to the weighted attribute from the intra prediction mode list whose first intra prediction mode is the Planar prediction mode.
[0109] Step 403: Obtain a target inter-frame prediction mode for the current block.
[0110] For example, an inter-frame prediction mode can be selected from all inter-frame prediction modes as the target inter-frame prediction mode, such as the inter-frame prediction mode can be a conventional merge mode, or an AMVP (Advanced Motion Vector Prediction) mode, or an MMVD mode, or an affine merge mode, or an ATMVP mode. There is no restriction on the acquisition process of this target inter-frame prediction mode, and it can be acquired in a traditional way.
[0111] Step 404, obtaining a prediction value of the current block according to a target intra-frame prediction mode and a target inter-frame prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra-frame region and a prediction value of an inter-frame region, wherein the prediction value of the intra-frame region can be determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame region can be determined according to the target inter-frame prediction mode.
[0112] In a possible implementation, when the current block is divided into three parts, namely, an intra region, an inter region and an inter-frame intra joint region according to a weighted attribute of the current block, the prediction value of the current block includes a prediction value of the intra region, a prediction value of the inter region and a prediction value of the inter-frame intra joint region. Based on this, the prediction value of the intra region of the current block can be obtained according to the target intra prediction mode; the prediction value of the inter region of the current block can be obtained according to the target inter prediction mode. Then, the intra prediction value of the inter-frame intra joint region is obtained according to the target intra prediction mode, and the inter prediction value of the inter-frame intra joint region is obtained according to the target inter prediction mode, and the prediction value of the inter-frame intra joint region (i.e., the final prediction value of the inter-frame intra joint region) is obtained according to the intra prediction value of the inter-frame intra joint region and the inter prediction value of the inter-frame intra joint region.
[0113] In another possible implementation, when the current block is divided into an intra-frame region and an inter-frame region according to a weighted attribute of the current block, the prediction value of the current block includes a prediction value of the intra-frame region and a prediction value of the inter-frame region. Based on this, the prediction value of the intra-frame region of the current block (i.e., the intra-frame prediction value of the intra-frame region) can be obtained according to the target intra-frame prediction mode, and the prediction value of the inter-frame region of the current block (i.e., the inter-frame prediction value of the inter-frame region) can be obtained according to the target inter-frame prediction mode.
[0114] It can be seen from the above technical solution that in the embodiment of the present application, when determining to start the inter-frame and intra-frame joint prediction for the current block, the target intra-frame prediction mode and the target inter-frame prediction mode can be obtained, and the prediction value of the current block can be obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode. In the above method, the prediction value of the current block can be obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, thereby improving the prediction accuracy, improving the prediction performance, improving the encoding performance, and reducing the encoding residual. Moreover, when determining the target intra-frame prediction mode, the target intra-frame prediction mode bound to the weighted attribute is obtained according to the weighted attribute, thereby further improving the encoding performance, making the predicted value closer to the original pixel, and bringing about an improvement in the encoding performance.
[0115] Embodiment 2: The encoding end and the decoding end pre-agree on the binding relationship between the weighted attribute and the intra-frame prediction mode, and each weighted attribute corresponds to only one intra-frame prediction mode. Exemplarily, by binding a suitable intra-frame prediction mode to each weighted attribute, when the prediction value of the intra-frame region in the current block is obtained according to the intra-frame prediction mode bound to the weighted attribute, a reliable prediction value is obtained. For example, the binding relationship between the weighted attribute and the intra-frame prediction mode is pre-configured at the encoding end, and the binding relationship between the weighted attribute and the intra-frame prediction mode is configured at the decoding end, and the binding relationship between the two is the same.
[0116] For example, it is pre-agreed that weighted attribute 1 has a binding relationship with intra-frame prediction mode 1, weighted attribute 2 has a binding relationship with intra-frame prediction mode 2, and weighted attribute 3 has a binding relationship with intra-frame prediction mode 3. Of course, three binding relationships are taken as an example here. In actual applications, the number of binding relationships can be more than 3 or less than 3, and there is no restriction on this.
[0117] Exemplarily, the weighted attribute 1 is used to indicate that the current block is divided into the upper left and lower right regions, and the intra-frame region is located at the lower left of the inter-frame region. For example, the weighted attribute 1 can be referred to Figure 3A or Fig. 6A As shown. Based on weighted attribute 1, the reconstructed pixels on the left side of the current block are credible, and the reconstructed pixels on the upper side of the current block are not credible due to the existence of the dividing line. Therefore, the intra-frame prediction mode 1 bound to weighted attribute 1 needs to make the prediction value of the intra-frame area refer to the reconstructed pixels on the left side of the current block, rather than the reconstructed pixels on the upper side of the current block. For example, the intra-frame prediction mode 1 bound to weighted attribute 1 can be a horizontal angle prediction mode or an upper left-lower right angle prediction mode along the dividing line. The horizontal angle prediction mode is taken as an example below.
[0118] Exemplarily, weighted attribute 2 is used to indicate that the current block is divided into upper left-lower right, and the relative position of the intra-frame region and the inter-frame region included in the current block is that the intra-frame region is located at the upper right of the inter-frame region. For example, weighted attribute 2 can refer to Figure 3B or Figure 6B As shown. Based on weighted attribute 2, the reconstructed pixels on the upper side of the current block are credible, and the reconstructed pixels on the left side of the current block are not credible due to the existence of the dividing line. Therefore, the intra-frame prediction mode 2 bound to weighted attribute 2 needs to make the prediction value of the intra-frame area refer to the reconstructed pixels on the upper side of the current block instead of the reconstructed pixels on the left side of the current block. For example, the intra-frame prediction mode 2 bound to weighted attribute 2 can be a vertical angle prediction mode or an upper left-lower right angle prediction mode along the dividing line. The vertical angle prediction mode is taken as an example below.
[0119] Exemplarily, weighted attribute 3 is used to indicate that the current block is divided into the lower left and upper right regions, and the relative position of the intra-frame region and the inter-frame region included in the current block is that the intra-frame region is located at the upper left of the inter-frame region. For example, weighted attribute 3 can refer to Figure 3C or Figure 6C As shown. Based on weighting attribute 3, the reconstructed pixels on the upper side of the current block are credible, and the reconstructed pixels on the left side of the current block are credible. Therefore, the intra-frame prediction mode 3 bound to weighting attribute 3 can make the prediction value of the intra-frame area refer to the reconstructed pixels on the upper side and the left side of the current block. For example, the intra-frame prediction mode 3 bound to weighting attribute 3 can be a Planar prediction mode. The intra-frame prediction mode 3 bound to weighting attribute 3 can also make the prediction value of the intra-frame area refer to the reconstructed pixels on the upper side of the current block. For example, the intra-frame prediction mode 3 bound to weighting attribute 3 can be a vertical angle prediction mode. The intra-frame prediction mode 3 bound to weighting attribute 3 can also make the prediction value of the intra-frame area refer to the reconstructed pixels on the left side of the current block. For example, the intra-frame prediction mode 3 bound to weighting attribute 3 can be a horizontal angle prediction mode. For the convenience of description, the Planar prediction mode is used as an example for explanation.
[0120] In the above application scenario, see Fig. 7A FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The coding and decoding method can be applied to a coding end. The coding and decoding method can include the following steps:
[0121] Step 711, the encoder determines whether to start inter-frame and intra-frame joint prediction for the current block. If yes, step 712 is executed; if not, the encoding and decoding method of the embodiment of the present application may not be used, and no limitation is imposed on this process.
[0122] Exemplarily, the implementation of step 711 may refer to Example 1, which will not be repeated here.
[0123] Step 712: The encoder obtains the weighted attribute of the current block and the target intra prediction mode bound to the weighted attribute. The weighted attribute is used to indicate the partition information of the current block and the relative position of the intra region and the inter region included in the current block.
[0124] Step 713: The encoder obtains the target inter-frame prediction mode of the current block.
[0125] With respect to step 712 and step 713, the encoding end may implement the steps as follows:
[0126] Method 1: The encoder uses a certain weighted attribute by default through protocol agreement, and determines the target intra-frame prediction mode bound to the weighted attribute through the binding relationship between the weighted attribute and the intra-frame prediction mode. The encoder uses a certain inter-frame prediction mode by default through protocol agreement, and uses this inter-frame prediction mode as the target inter-frame prediction mode of the current block.
[0127] For example, the encoding end uses the default protocol Figure 3A The weighted attribute 1 shown is shown, the encoder determines that the target intra prediction mode bound to the weighted attribute 1 is the horizontal angle prediction mode. The encoder uses the normal merge mode by default through protocol agreement, and the encoder determines that the target inter prediction mode of the current block is the normal merge mode.
[0128] Method 2: The encoder performs joint prediction on the current block based on each weighted attribute, the intra-frame prediction mode bound to the weighted attribute, each inter-frame prediction mode, and each motion information in the inter-frame prediction mode, and determines the rate-distortion cost of the current block using the rate-distortion principle. Then, the encoder selects the minimum rate-distortion cost from all rate-distortion costs, uses the weighted attribute corresponding to the minimum rate-distortion cost as the weighted attribute of the current block, uses the intra-frame prediction mode bound to the weighted attribute as the target intra-frame prediction mode of the current block; uses the inter-frame prediction mode corresponding to the minimum rate-distortion cost as the target inter-frame prediction mode of the current block; and uses the motion information corresponding to the minimum rate-distortion cost as the target motion information of the current block.
[0129] For example, referring to the above embodiment, there are weighted attribute 1, weighted attribute 2, weighted attribute 3, intra-frame prediction mode 1 bound to weighted attribute 1, intra-frame prediction mode 2 bound to weighted attribute 2, and intra-frame prediction mode 3 bound to weighted attribute 3. Assuming that there are inter-frame prediction mode A and inter-frame prediction mode B, there are no restrictions on the inter-frame prediction mode A and inter-frame prediction mode B. For example, the inter-frame prediction mode A is a conventional merge mode, and the inter-frame prediction mode B is an MMVD mode. A motion information candidate list for the inter-frame prediction mode A is constructed, and the motion information candidate list may include motion information A1 and motion information A2. A motion information candidate list for the inter-frame prediction mode B is constructed, and the motion information candidate list may include motion information B1 and motion information B2. There is no restriction on the construction process of the motion information candidate list, and reference may be made to the traditional implementation method.
[0130] For weighted attribute 1, intra prediction mode 1, inter prediction mode A, and motion information A1 bound to weighted attribute 1, weighted attribute 1 is used to divide the current block into an intra region and an inter region, and the current block is jointly predicted based on intra prediction mode 1 and motion information A1 to obtain a prediction value of the current block. There is no restriction on this process. For example, the prediction value of the intra region of the current block is obtained according to intra prediction mode 1, and the prediction value of the inter region of the current block is obtained according to motion information A1. Of course, the above method is only an example. The rate-distortion principle and the prediction value of the current block are used to determine the rate-distortion cost 1 of the current block.
[0131] For weighted attribute 1, intra-frame prediction mode 1, inter-frame prediction mode A, and motion information A2, weighted attribute 1 is used to divide the current block into an intra-frame area and an inter-frame area, and the current block is jointly predicted based on intra-frame prediction mode 1 and motion information A2 to obtain a prediction value of the current block. The rate-distortion principle and the prediction value of the current block are used to determine the rate-distortion cost 2 of the current block.
[0132] For weighted attribute 1, intra-frame prediction mode 1, inter-frame prediction mode B, and motion information B1, weighted attribute 1 is used to divide the current block into an intra-frame area and an inter-frame area, and the current block is jointly predicted based on intra-frame prediction mode 1 and motion information B1 to obtain a prediction value of the current block. The rate-distortion principle and the prediction value of the current block are used to determine a rate-distortion cost 3 of the current block.
[0133] For weighted attribute 1, intra-frame prediction mode 1, inter-frame prediction mode B, and motion information B2, weighted attribute 1 is used to divide the current block into an intra-frame area and an inter-frame area, and the current block is jointly predicted based on intra-frame prediction mode 1 and motion information B2 to obtain a prediction value of the current block. The rate-distortion principle and the prediction value of the current block are used to determine a rate-distortion cost 4 of the current block.
[0134] For weighted attribute 2, intra prediction mode 2 bound to weighted attribute 2, inter prediction mode A, motion information A1, weighted attribute 2 is used to divide the current block into an intra region and an inter region, and the current block is jointly predicted based on intra prediction mode 2 and motion information A1 to obtain a prediction value of the current block, and the rate-distortion cost 5 of the current block is determined using the rate-distortion principle and the prediction value of the current block. By analogy, for each weighted attribute, the intra prediction mode bound to the weighted attribute, each inter prediction mode, and each motion information in the inter prediction mode can be jointly predicted for the current block to obtain a prediction value of the current block, and the rate-distortion cost of the current block is determined based on the rate-distortion principle and the prediction value of the current block.
[0135] After traversing and obtaining all rate-distortion costs, the minimum rate-distortion cost is selected from all rate-distortion costs. Assuming that the minimum rate-distortion cost is rate-distortion cost 1, weighted attribute 1 is used as the weighted attribute of the current block (step 712), intra-frame prediction mode 1 bound to weighted attribute 1 is used as the target intra-frame prediction mode of the current block (step 712), inter-frame prediction mode A is used as the target inter-frame prediction mode of the current block (step 713), and motion information A1 is used as the target motion information of the current block.
[0136] Step 714, the encoding end obtains the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode. The prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area. The prediction value of the intra-frame area can be determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area can be determined according to the target inter-frame prediction mode.
[0137] Embodiment 3: The decoding end and the encoding end pre-agreed on the binding relationship between the weighted attribute and the intra-frame prediction mode, and each weighted attribute corresponds to only one intra-frame prediction mode. For example, the binding relationship between the weighted attribute and the intra-frame prediction mode is pre-configured at the decoding end, and the binding relationship between the weighted attribute and the intra-frame prediction mode is configured at the encoding end, and the binding relationship between the two is the same.
[0138] For example, the binding relationship between weighted attribute 1 and intra prediction mode 1, the binding relationship between weighted attribute 2 and intra prediction mode 2, and the binding relationship between weighted attribute 3 and intra prediction mode 3 are pre-agreed. Weighted attribute 1 is used to indicate that the current block is divided into upper left and lower right, and the intra region is located at the lower left of the inter region, see Figure 3A or Fig. 6A As shown, the intra-frame prediction mode 1 bound to the weighted attribute 1 can be a horizontal angle prediction mode or an upper left-lower right angle prediction mode along the dividing line. The horizontal angle prediction mode is taken as an example. The weighted attribute 2 is used to indicate that the current block is divided into upper left-lower right, and the intra-frame area is located above the right of the inter-frame area. Figure 3B or Figure 6BAs shown, the intra-frame prediction mode 2 bound to the weighted attribute 2 can be a vertical angle prediction mode or an upper left-lower right angle prediction mode along the dividing line. The vertical angle prediction mode is taken as an example. The weighted attribute 3 is used to indicate that the current block is divided into the lower left-upper right, and the intra-frame area is located at the upper left of the inter-frame area. Figure 3C or Figure 6C As shown, the intra prediction mode 3 bound to the weighted attribute 3 may be a Planar prediction mode, a vertical angle prediction mode, or a horizontal angle prediction mode, and the Planar prediction mode is taken as an example for description.
[0139] In the above application scenario, see Figure 7B FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The coding and decoding method can be applied to a decoding end. The coding and decoding method can include the following steps:
[0140] Step 721, the decoding end determines whether to start inter-frame and intra-frame joint prediction for the current block. If yes, step 722 is executed; if not, the encoding and decoding method of the embodiment of the present application may not be used, and no limitation is imposed on this process.
[0141] Exemplarily, the implementation of step 721 can refer to Example 1, which will not be repeated here.
[0142] In another possible implementation, when the encoder determines to start inter-frame and intra-frame joint prediction for the current block, the encoder may also carry indication information 1 for starting inter-frame and intra-frame joint prediction for the current block in the coded bit stream, and based on the indication information 1, the decoder may determine to start inter-frame and intra-frame joint prediction for the current block. Alternatively, when the encoder determines not to start inter-frame and intra-frame joint prediction for the current block, the encoder may also carry indication information 2 for not starting inter-frame and intra-frame joint prediction for the current block in the coded bit stream, and based on the indication information 2, the decoder may determine not to start inter-frame and intra-frame joint prediction for the current block.
[0143] Exemplarily, when the encoder determines to start inter-frame and intra-frame joint prediction for the current block, it can also determine whether the current block is an inter-frame and intra-frame joint prediction with non-square division, that is, whether the current block is divided into an intra-frame region and an inter-frame region, and both the intra-frame region and the inter-frame region are not square. If not, the encoder does not adopt the technical solution of the embodiment of the present application, and carries indication information 3 of not adopting inter-frame and intra-frame joint prediction with non-square division in the encoded bit stream. Based on the indication information 3, the decoder determines that the current block is not an inter-frame and intra-frame joint prediction with non-square division, and the decoder does not adopt the technical solution of the embodiment of the present application. If yes, the encoder executes steps 712-714, carries indication information 4 of adopting inter-frame and intra-frame joint prediction with non-square division in the encoded bit stream, and based on the indication information 4, the decoder determines that the current block is an inter-frame and intra-frame joint prediction with non-square division, and executes subsequent steps.
[0144] Step 722: The decoder obtains a weighted attribute of the current block, where the weighted attribute is used to indicate the division information of the current block and the relative position of the intra-frame region and the inter-frame region included in the current block. For example, the decoder can be implemented in the following manner:
[0145] Method 1: The decoding end uses a certain weighted attribute by default through protocol agreement. For example, the decoding end uses a certain weighted attribute by default through protocol agreement. Figure 3A The weighted attribute 1 shown in the figure also needs to be used by the encoding end through the protocol agreement by default. Figure 3A The weighted attributes shown are 1.
[0146] Mode 2: When the encoder sends a coded bit stream to the decoder, the coded bit stream includes indication information of the weighted attribute. Based on the indication information, the decoder uses the weighted attribute corresponding to the indication information as the weighted attribute of the current block.
[0147] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 1, the encoded bit stream includes indication information of weighted attribute 1, and based on the indication information, the decoder determines that the weighted attribute of the current block is weighted attribute 1.
[0148] For another example, if the encoder determines that the weighted attribute of the current block is weighted attribute 2, the encoded bit stream includes indication information of weighted attribute 2, and based on the indication information, the decoder determines that the weighted attribute of the current block is weighted attribute 2.
[0149] For another example, if the encoder determines that the weighted attribute of the current block is weighted attribute 3, the encoded bit stream includes indication information of weighted attribute 3, and based on the indication information, the decoder determines that the weighted attribute of the current block is weighted attribute 3.
[0150] In a possible implementation, the weighted attribute is determined according to the first indication information, and the first indication information is used to indicate the division information of the current block and the relative position of the intra-frame region and the inter-frame region. In this implementation, the division information of the current block and the relative position of the intra-frame region and the inter-frame region can be simultaneously indicated by the first indication information.
[0151] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 1, the coded bit stream includes first indication information for weighted attribute 1, and the first indication information is used to indicate that the current block is divided according to the upper left-lower right, and the intra-frame area is located at the lower left of the inter-frame area. After receiving the coded bit stream, the decoder parses the first indication information from the coded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the upper left-lower right, and the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located at the lower left of the inter-frame area, that is, the weighted attribute of the current block is weighted attribute 1.
[0152] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 2, the coded bit stream includes first indication information for weighted attribute 2, and the first indication information is used to indicate that the current block is divided according to the upper left-lower right, and the intra-frame area is located in the upper right of the inter-frame area. After receiving the coded bit stream, the decoder parses the first indication information from the coded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the upper left-lower right, and the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located in the upper right of the inter-frame area, that is, the weighted attribute of the current block is weighted attribute 2.
[0153] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 3, the coded bit stream includes first indication information for weighted attribute 3, and the first indication information is used to indicate that the current block is divided according to the lower left-upper right, and the intra-frame area is located at the upper left of the inter-frame area. After receiving the coded bit stream, the decoder parses the first indication information from the coded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the lower left-upper right, and the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located at the upper left of the inter-frame area, that is, the weighted attribute of the current block is weighted attribute 3.
[0154] In another possible implementation, the weighted attribute is determined based on first indication information and second indication information, the first indication information is used to indicate the division information of the current block, and the second indication information is used to indicate the relative position of the intra-frame area and the inter-frame area, that is, the division information of the current block and the relative position of the intra-frame area and the inter-frame area are respectively indicated by different indication information.
[0155] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 1, the encoded bit stream includes first indication information and second indication information for weighted attribute 1, the first indication information is used to indicate that the current block is divided according to the upper left-lower right, and the second indication information is used to indicate that the intra-frame area is located at the lower left of the inter-frame area. After receiving the encoded bit stream, the decoder parses the first indication information and the second indication information from the encoded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the upper left-lower right. Based on the second indication information, the decoder determines that the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located at the lower left of the inter-frame area. In summary, the weighted attribute of the current block is determined to be weighted attribute 1.
[0156] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 2, the encoded bit stream includes first indication information and second indication information for weighted attribute 2, the first indication information is used to indicate that the current block is divided according to the upper left-lower right, and the second indication information is used to indicate that the intra-frame area is located in the upper right of the inter-frame area. After receiving the encoded bit stream, the decoder parses the first indication information and the second indication information from the encoded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the upper left-lower right. Based on the second indication information, the decoder determines that the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located in the upper right of the inter-frame area. In summary, the weighted attribute of the current block is determined to be weighted attribute 2.
[0157] For example, if the encoder determines that the weighted attribute of the current block is weighted attribute 3, the encoded bit stream includes first indication information and second indication information for weighted attribute 3, the first indication information is used to indicate that the current block is divided according to the lower left-upper right, and the second indication information is used to indicate that the intra-frame area is located in the upper left of the inter-frame area. After receiving the encoded bit stream, the decoder parses the first indication information and the second indication information from the encoded bit stream. Based on the first indication information, the decoder determines that the division information of the current block is to divide the current block according to the lower left-upper right. Based on the second indication information, the decoder determines that the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located in the upper left of the inter-frame area. In summary, the weighted attribute of the current block is determined to be weighted attribute 3.
[0158] In another possible implementation, the weighted attribute is determined based on first indication information, and the first indication information is used to indicate the division information of the current block. Then, the decoding end can determine the relative position of the intra-frame area and the inter-frame area based on the division information of the current block. In this implementation, only the division information of the current block is indicated by the first indication information, and there is no need to indicate the relative position of the intra-frame area and the inter-frame area. The decoding end can determine the relative position of the intra-frame area and the inter-frame area based on the division information of the current block. Exemplarily, if the first indication information is used to indicate that the current block is divided according to the lower left-upper right, the decoding end can determine the relative position of the intra-frame area and the inter-frame area as the intra-frame area is located at the upper left of the inter-frame area.
[0159] See also Figure 3D As shown in the figure, when the intra-frame area is located at the lower right of the inter-frame area, the reconstructed pixels on the upper peripheral side of the current block are not credible, and the reconstructed pixels on the left peripheral side of the current block are not credible. Therefore, this weighted attribute should be avoided or disabled. Based on this, if the division information of the current block is to divide the current block according to the lower left-upper right, the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located at the upper left of the inter-frame area, and the situation where the intra-frame area is located at the lower right of the inter-frame area will not occur.
[0160] Based on the above principle, if the encoding end determines that the weighted attribute of the current block is weighted attribute 3, the encoded bit stream includes the first indication information for weighted attribute 3, and the first indication information is used to indicate that the current block is divided according to the lower left-upper right. After receiving the encoded bit stream, the decoding end parses the first indication information from the encoded bit stream. Based on the first indication information, the decoding end determines that the division information of the current block is to divide the current block according to the lower left-upper right. Since the division information is to divide the current block according to the lower left-upper right, the decoding end determines that the relative position of the intra-frame area and the inter-frame area is that the intra-frame area is located in the upper left of the inter-frame area, that is, even if the relative position of the intra-frame area and the inter-frame area is not indicated in the encoded bit stream, it can be deduced that the intra-frame area is located in the upper left of the inter-frame area. Finally, it can be determined that the weighted attribute of the current block is weighted attribute 3.
[0161] In the above embodiment, the first indication information is used to indicate the division information of the current block, and the first indication information is used to indicate that the current block is divided according to the preconfigured division mode. Exemplarily, the preconfigured division mode may be to divide according to the diagonal of the current block; for example, when the value of the first indication information is a first value, the diagonal is a first diagonal, and when the value of the first indication information is a second value, the diagonal is a second diagonal.
[0162] For example, when the value of the first indication information is the first value, the diagonal line is the upper left-lower right diagonal line, such as Figure 5B The diagonal lines shown, Figure 5D The diagonal lines shown, Fig. 5F The diagonal lines shown, Figure 5G The diagonal line shown in FIG. 1 is not limited to this, as long as it is a diagonal line from upper left to lower right. When the value of the first indication information is the second value, the diagonal line is a diagonal line from lower left to upper right, such as Figure 5A The diagonal lines shown, Figure 5C The diagonal lines shown, Figure 5E The diagonal lines shown, Figure 5H The diagonal line shown is not limited to this, as long as it is a diagonal line from lower left to upper right.
[0163] Step 723: The decoding end obtains the target intra prediction mode bound to the weighted attribute according to the weighted attribute.
[0164] Exemplarily, the decoding end can determine the target intra-frame prediction mode bound to the weighted attribute through the binding relationship between the weighted attribute and the intra-frame prediction mode. For example, if the weighted attribute of the current block is weighted attribute 1, the target intra-frame prediction mode bound to weighted attribute 1 is determined to be the horizontal angle prediction mode; or, if the weighted attribute of the current block is weighted attribute 2, the target intra-frame prediction mode bound to weighted attribute 2 is determined to be the vertical angle prediction mode; or, if the weighted attribute of the current block is weighted attribute 3, the target intra-frame prediction mode bound to weighted attribute 3 is determined to be the Planar prediction mode.
[0165] Step 724: The decoder obtains the target inter-frame prediction mode of the current block. For example, this can be achieved in the following manner:
[0166] Method 1: The decoding end uses a certain inter-frame prediction mode by default through protocol agreement, and uses the inter-frame prediction mode as the target inter-frame prediction mode of the current block. For example, if the decoding end uses the normal merge mode by default through protocol agreement, the target inter-frame prediction mode of the current block is determined to be the normal merge mode, and the encoding end also needs to use the normal merge mode by default through protocol agreement.
[0167] Method 2: When the encoder sends the encoded bit stream to the decoder, the encoded bit stream includes indication information of the target inter-frame prediction mode. Based on the indication information, the decoder uses the inter-frame prediction mode corresponding to the indication information as the target inter-frame prediction mode of the current block. For example, if the encoder determines that the target inter-frame prediction mode of the current block is the normal merge mode, the encoded bit stream includes indication information of the normal merge mode. After receiving the encoded bit stream, the decoder parses the indication information from the encoded bit stream. Based on the indication information, the decoder uses the normal merge mode as the target inter-frame prediction mode of the current block.
[0168] Exemplarily, assuming that the target inter-frame prediction mode is a normal merge mode, it is also necessary to construct a motion information candidate list of the normal merge mode, and the motion information candidate list includes at least one candidate motion information. When the encoder sends a coded bit stream to the decoder, the coded bit stream includes indication information of the target motion information (i.e., the encoder selects from the motion information candidate list), and the indication information is used to indicate the index value of the target motion information in the motion information candidate list.
[0169] After receiving the encoded bit stream, the decoding end can parse the indication information of the target motion information from the encoded bit stream. Based on the indication information of the target motion information, the decoding end can select the motion information corresponding to the index value from the motion information candidate list, and use the selected motion information as the target motion information of the current block.
[0170] Step 725, the decoding end obtains the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode. The prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area. The prediction value of the intra-frame area can be determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area can be determined according to the target inter-frame prediction mode.
[0171] Embodiment 4: The encoder constructs an intra-frame prediction mode list for the current block, and each weighted attribute corresponds to an intra-frame prediction mode list. Exemplarily, based on the intra-frame prediction mode list corresponding to the weighted attribute, a suitable intra-frame prediction mode can be selected from the intra-frame prediction mode list, so that when the prediction value of the intra-frame region in the current block is obtained according to the intra-frame prediction mode, a reliable prediction value is obtained. For example, weighted attribute 1 is used to indicate that the current block is divided into upper left-lower right, and the intra-frame region is located at the lower left of the inter-frame region, see Figure 3A or Fig. 6A The first intra prediction mode in the intra prediction mode list corresponding to weighted attribute 1 is the horizontal angle prediction mode. There is no restriction on other intra prediction modes in the intra prediction mode list. Weighted attribute 2 is used to indicate that the current block is divided into upper left and lower right, and the intra region is located in the upper right of the inter region, see Figure 3B or Figure 6B As shown. The first intra-frame prediction mode in the intra-frame prediction mode list corresponding to weighting attribute 2 is the vertical angle prediction mode. There is no restriction on other intra-frame prediction modes in the intra-frame prediction mode list. Weighting attribute 3 is used to indicate that the current block is divided into the lower left and upper right regions, and the intra-frame region is located in the upper left of the inter-frame region, see Figure 3C or Figure 6C As shown. The first intra-frame prediction mode in the intra-frame prediction mode list corresponding to weighting attribute 3 is the Planar prediction mode. There is no restriction on other intra-frame prediction modes in the intra-frame prediction mode list. For the convenience of description, the intra-frame prediction mode list corresponding to weighting attribute 1 is recorded as intra-frame prediction mode list 1, the intra-frame prediction mode list corresponding to weighting attribute 2 is recorded as intra-frame prediction mode list 2, and the intra-frame prediction mode list corresponding to weighting attribute 3 is recorded as intra-frame prediction mode list 3.
[0172] In a possible implementation, different intra-frame prediction mode lists may be constructed for different weighting attributes, and the intra-frame prediction modes in each intra-frame prediction mode list may be the same or different. For example, intra-frame prediction mode list 1 corresponding to weighting attribute 1 includes a horizontal angle prediction mode and an angle prediction mode from the upper left to the lower right along the dividing line. Intra-frame prediction mode list 2 corresponding to weighting attribute 2 includes a vertical angle prediction mode and an angle prediction mode from the upper left to the lower right along the dividing line. Intra-frame prediction mode list 3 corresponding to weighting attribute 3 includes a Planar prediction mode, a vertical angle prediction mode, and a horizontal angle prediction mode; or, a Planar prediction mode, a horizontal angle prediction mode, and a vertical angle prediction mode.
[0173] In another possible implementation, different intra-frame prediction mode lists may be constructed for different weighting attributes, and the intra-frame prediction modes in each intra-frame prediction mode list may be the same, but the order of the intra-frame prediction modes is different. For example, all intra-frame prediction mode lists include vertical angle prediction mode, horizontal angle prediction mode, and Planar prediction mode, and intra-frame prediction mode list 1 corresponding to weighting attribute 1 includes horizontal angle prediction mode, Planar prediction mode, and vertical angle prediction mode. Intra-frame prediction mode list 2 corresponding to weighting attribute 2 includes vertical angle prediction mode, Planar prediction mode, and horizontal angle prediction mode. Intra-frame prediction mode list 3 corresponding to weighting attribute 3 includes Planar prediction mode, vertical angle prediction mode, and horizontal angle prediction mode; or, Planar prediction mode, horizontal angle prediction mode, and vertical angle prediction mode.
[0174] In the above application scenario, see Figure 7C FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The coding and decoding method can be applied to a coding end. The coding and decoding method can include the following steps:
[0175] Step 731, the encoder determines whether to start inter-frame and intra-frame joint prediction for the current block. If yes, step 732 is executed; if not, the encoding and decoding method of the embodiment of the present application may not be used, and no limitation is imposed on this process.
[0176] Step 732: The encoder obtains the weighted attribute of the current block.
[0177] Step 733: The encoder obtains the target intra prediction mode bound to the weighted attribute from the intra prediction mode list.
[0178] Step 734: The encoder obtains the target inter-frame prediction mode of the current block.
[0179] With respect to steps 732 to 734, the encoding end may implement the steps as follows:
[0180] Method 1: The encoder uses a certain weighted attribute by default through protocol agreement, uses a certain intra-frame prediction mode in the intra-frame prediction mode list by default through protocol agreement, and uses a certain inter-frame prediction mode by default through protocol agreement. For example, Figure 3A The weighted attribute 1 shown uses the horizontal angle prediction mode as the target intra-frame prediction mode by default through protocol agreement, and uses the normal merge mode as the target inter-frame prediction mode by default through protocol agreement.
[0181] Method 2: The encoding end jointly predicts the current block based on each weighted attribute, each intra-frame prediction mode in the intra-frame prediction mode list corresponding to the weighted attribute, each inter-frame prediction mode, and each motion information in the inter-frame prediction mode, and determines the rate-distortion cost of the current block using the rate-distortion principle. The specific process refers to the above embodiment and will not be repeated here.
[0182] After traversing and obtaining all rate-distortion costs, the encoder selects the minimum rate-distortion cost from all rate-distortion costs, uses the weighted attribute corresponding to the minimum rate-distortion cost as the weighted attribute of the current block, uses the intra-frame prediction mode corresponding to the minimum rate-distortion cost as the target intra-frame prediction mode of the current block, uses the inter-frame prediction mode corresponding to the minimum rate-distortion cost as the target inter-frame prediction mode of the current block, and uses the motion information corresponding to the minimum rate-distortion cost as the target motion information of the current block.
[0183] Step 735, the encoding end obtains the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode. The prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area. The prediction value of the intra-frame area can be determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area can be determined according to the target inter-frame prediction mode.
[0184] Embodiment 5: The decoding end constructs an intra-frame prediction mode list for the current block. The construction process refers to the construction process of the encoding end and will not be repeated here. Exemplarily, weighting attribute 1 corresponds to intra-frame prediction mode list 1, and the first intra-frame prediction mode in intra-frame prediction mode list 1 is a horizontal angle prediction mode. Weighting attribute 2 corresponds to intra-frame prediction mode list 2, and the first intra-frame prediction mode in intra-frame prediction mode list 2 is a vertical angle prediction mode. Weighting attribute 3 corresponds to intra-frame prediction mode list 3, and the first intra-frame prediction mode in intra-frame prediction mode list 3 is a Planar prediction mode.
[0185] In the above application scenario, see Fig.7D FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The coding and decoding method can be applied to a decoding end. The coding and decoding method can include the following steps:
[0186] Step 741: The decoding end determines whether to start inter-frame and intra-frame joint prediction for the current block. If yes, step 742 is executed; if no, the encoding and decoding method of the embodiment of the present application may not be used, and no limitation is imposed on this process.
[0187] Step 742, the decoder obtains the weighted attribute of the current block, which is used to indicate the division information of the current block and the relative position of the intra-frame area and the inter-frame area included in the current block. The specific process is shown in step 722 and will not be repeated here.
[0188] Step 743: The decoding end obtains the target intra prediction mode bound to the weighted attribute from the intra prediction mode list.
[0189] When the encoder sends the encoded bit stream to the decoder, the encoded bit stream includes indication information of the target intra prediction mode, and the indication information is used to indicate the index value of the target intra prediction mode in the intra prediction mode list (i.e., the intra prediction mode list corresponding to the weighted attribute). The decoder obtains the encoded bit stream and parses the indication information from the encoded bit stream. Based on the indication information, the decoder selects the intra prediction mode corresponding to the index value from the intra prediction mode list corresponding to the weighted attribute, and determines the selected intra prediction mode as the target intra prediction mode bound to the weighted attribute.
[0190] For example, when the encoder determines that the target intra prediction mode is the first intra prediction mode in intra prediction mode list 1, the encoded bit stream includes an index value 0, and the index value 0 represents the first intra prediction mode in intra prediction mode list 1.
[0191] After the decoder obtains the encoded bit stream, it determines that the weighted attribute of the current block is weighted attribute 1, and obtains the intra-frame prediction mode list 1 corresponding to the weighted attribute 1. Referring to the above embodiment, the first intra-frame prediction mode in the intra-frame prediction mode list 1 is the horizontal angle prediction mode. Then, the decoder selects the intra-frame prediction mode corresponding to the index value 0 from the intra-frame prediction mode list 1, that is, the horizontal angle prediction mode, and uses the horizontal angle prediction mode as the target intra-frame prediction mode.
[0192] Step 744: The decoder obtains the target inter-frame prediction mode of the current block.
[0193] Step 745, the decoding end obtains the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode. The prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area. The prediction value of the intra-frame area can be determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area can be determined according to the target inter-frame prediction mode.
[0194] Example 6: See Figure 8FIG. 1 is a flow chart of a coding and decoding method in an embodiment of the present application. The coding and decoding method can be applied to a decoding end or an encoding end. The coding and decoding method can include the following steps:
[0195] Step 801 : when it is determined to start inter-frame and intra-frame joint prediction for a current block, a target intra-frame prediction mode of the current block is obtained.
[0196] Step 802: acquiring a weighted attribute bound to the target intra prediction mode according to the target intra prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra region and the inter region included in the current block.
[0197] Step 803: Obtain the target inter-frame prediction mode of the current block.
[0198] Step 804, obtaining a prediction value of the current block according to a target intra-frame prediction mode and a target inter-frame prediction mode, wherein the prediction value of the current block includes at least a prediction value of an intra-frame region and a prediction value of an inter-frame region, wherein the prediction value of the intra-frame region is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame region is determined according to the target inter-frame prediction mode.
[0199] Exemplarily, the method for determining whether to start the inter-frame and intra-frame joint prediction can be referred to in Example 1, which will not be described in detail here.
[0200] Exemplarily, the explanations of the target intra prediction mode, weighted attributes, division information of the current block, the relative position of the intra region and the inter region, the target inter prediction mode, etc. can be found in Example 1 and will not be repeated here.
[0201] In a possible implementation, each intra prediction mode may correspond to only one weighted attribute, and the binding relationship between the two may be agreed upon in advance. Based on this, after obtaining the target intra prediction mode of the current block, if the target intra prediction mode corresponds to one weighted attribute, the one weighted attribute may be determined as the weighted attribute bound to the target intra prediction mode.
[0202] For example, if the weighted attribute is used to indicate that the current block is divided into upper left and lower right, the intra-frame area is located at the lower left of the inter-frame area, see Figure 3A or Fig. 6A As shown, the target intra-frame prediction mode bound to the weighted attribute is the horizontal angle prediction mode. Figure 3A or Fig. 6A The binding relationship between the weighted attribute and the horizontal angle prediction mode shown in FIG. 1 is as follows. When the target intra-frame prediction mode is the horizontal angle prediction mode, the weighted attribute is determined as follows: Figure 3A or Fig. 6A shown.
[0203] For example, if the weighted attribute is used to indicate that the current block is divided into upper left-lower right, the intra-frame area is located above and to the right of the inter-frame area, see Figure 3B or Figure 6B As shown, the target intra-frame prediction mode bound to the weighted attribute is the vertical angle prediction mode. Figure 3B or Figure 6B The binding relationship between the weighted attribute and the vertical angle prediction mode shown in FIG. 1 is as follows. When the target intra-frame prediction mode is the vertical angle prediction mode, the weighted attribute is determined as follows: Figure 3B or Figure 6B shown.
[0204] For example, if the weighted attribute is used to indicate that the current block is divided into lower left and upper right, the intra-frame area is located at the upper left of the inter-frame area, see Figure 3C or Figure 6C As shown, the target intra-frame prediction mode bound to the weighted attribute is the Planar prediction mode. Figure 3C or Figure 6C The binding relationship between the weighted attribute and the Planar prediction mode shown in FIG. 1 is determined when the target intra-frame prediction mode is the Planar prediction mode. Figure 3C or Figure 6C shown.
[0205] In another possible implementation, the intra prediction mode may correspond to a weighted attribute list (for example, different intra prediction modes may correspond to the same weighted attribute list or may correspond to different weighted attribute lists, without limitation), and the weighted attribute list includes at least two weighted attributes. Based on this, after obtaining the target intra prediction mode of the current block, if the target intra prediction mode corresponds to a weighted attribute list, and the weighted attribute list includes at least two weighted attributes, the weighted attribute bound to the target intra prediction mode may be obtained from the weighted attribute list.
[0206] For the encoder, the encoder needs to obtain the target intra prediction mode of the current block, the weighted attribute bound to the target intra prediction mode, and the target inter prediction mode. For example, the encoder performs joint prediction on the current block based on each intra prediction mode, the weighted attribute bound to the intra prediction mode (such as a weighted attribute bound to the intra prediction mode, or each weighted attribute in the weighted attribute list), each inter prediction mode, and each motion information in the inter prediction mode, and determines the rate distortion cost of the current block using the rate distortion principle. Then, the encoder can select the minimum rate distortion cost from all rate distortion costs, use the intra prediction mode corresponding to the minimum rate distortion cost as the target intra prediction mode of the current block, use the weighted attribute corresponding to the minimum rate distortion cost as the weighted attribute of the current block; use the inter prediction mode corresponding to the minimum rate distortion cost as the target inter prediction mode of the current block; and use the motion information corresponding to the minimum rate distortion cost as the target motion information of the current block. Of course, the above method is only an example and is not limited to this.
[0207] For the decoding end, the decoding end needs to obtain the target intra-frame prediction mode of the current block, the weighted attribute bound to the target intra-frame prediction mode, and the target inter-frame prediction mode. In a possible implementation, it is assumed that each intra-frame prediction mode corresponds to only one weighted attribute. By binding a suitable weighted attribute to each intra-frame prediction mode, when the prediction value of the intra-frame region in the current block is obtained according to the intra-frame prediction mode and the weighted attribute bound to the intra-frame prediction mode, a reliable prediction value is obtained. When the encoding end sends the encoded bit stream to the decoding end, the encoded bit stream includes indication information of the target intra-frame prediction mode. Based on the indication information, the decoding end uses the intra-frame prediction mode corresponding to the indication information as the target intra-frame prediction mode of the current block, and this process is not described in detail. Then, based on the binding relationship between the intra-frame prediction mode and the weighted attribute, the decoding end can obtain the weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode. The process of the decoding end obtaining the target inter-frame prediction mode can refer to the above embodiment. At this point, the decoder obtains the target intra prediction mode of the current block, the weighted attribute bound to the target intra prediction mode, and the target inter prediction mode.
[0208] In another possible implementation, assuming that there is a weighted attribute list, a suitable weighted attribute can be selected from the weighted attribute list, so that when the prediction value of the intra-frame region in the current block is obtained according to the intra-frame prediction mode and the weighted attribute bound to the intra-frame prediction mode, a reliable prediction value is obtained. When the encoder sends the coded bit stream to the decoder, the coded bit stream includes the first indication information of the target intra-frame prediction mode and the second indication information of the weighted attribute, and the second indication information is used to indicate the index value of the weighted attribute in the weighted attribute list. After the decoder obtains the coded bit stream, based on the first indication information, the decoder uses the intra-frame prediction mode corresponding to the first indication information as the target intra-frame prediction mode of the current block. Based on the second indication information, the decoder selects the weighted attribute corresponding to the index value from the weighted attribute list, and this weighted attribute is the weighted attribute bound to the target intra-frame prediction mode. The process of the decoder obtaining the target inter-frame prediction mode can refer to the above embodiment. So far, the decoder obtains the target intra-frame prediction mode of the current block, the weighted attribute bound to the target intra-frame prediction mode, and the target inter-frame prediction mode.
[0209] Example 7: For Figure 3D As shown in the weighted attribute, see the above embodiment. Since the reconstructed pixels on the upper side of the current block are not credible, the reconstructed pixels on the left side of the current block are not credible. Therefore, the weighted attribute in this case can no longer be used. Figure 3D The weighted attributes shown will Figure 3D The weighted attribute shown is recorded as weighted attribute 4, and weighted attribute 4 is used to indicate the division information of the current block, and the relative positions of the intra-frame region and the inter-frame region included in the current block. Weighted attribute 4 is used to indicate that the current block is divided according to the lower left-upper right, and the intra-frame region is located at the lower right of the inter-frame region.
[0210] See also Fig.9A As shown, the intra-frame prediction mode bound with weighted attribute 4 is used to make the prediction value of the intra-frame area refer to the reconstructed pixels of area A, or to make the prediction value of the intra-frame area refer to the reconstructed pixels of area B, or to make the prediction value of the intra-frame area refer to the reconstructed pixels of area A and area B. There is no restriction on this intra-frame prediction mode.
[0211] The implementation of weighted attribute 4 is similar to the implementation of weighted attributes in the above embodiment, and will not be described in detail here.
[0212] In the above embodiment, a weighted attribute can be selected from all weighted attributes as the weighted attribute of the current block (recorded as the target weighted attribute), and the order of these weighted attributes can be referred to in Figure 9B-9D As shown. Fig. 9B For example, if the index value of the target weighted attribute is 0, it means Fig. 9B The first weighted attribute of is weighted attribute 3 in the above embodiment. Fig. 9C For example, if the index value of the target weighted attribute is 0, it means Fig. 9C The first weighted attribute of is weighted attribute 2 in the above embodiment. Fig.9D For example, if the index value of the target weighted attribute is 0, it means Fig.9D The first weighted attribute of is weighted attribute 1 in the above embodiment. Fig. 9B For example, if the index value of the target weighted attribute is 1, it means Fig. 9B The second weighted attribute of , that is, the weighted attribute 2 in the above embodiment, and so on.
[0213] See also Fig. 9B As shown, N0 and N1 are two surrounding blocks of the current block. If N0 is an intra-frame prediction block and N1 is an intra-frame prediction block, then Fig. 9B Sort all weighted attributes in the order shown. Fig. 9B As shown, N0 and N1 are two surrounding blocks of the current block. If N0 is not an intra-frame prediction block and N1 is not an intra-frame prediction block, then Fig. 9B Sort all weighted attributes in the order shown. Fig. 9C As shown, N0 and N1 are two surrounding blocks of the current block. If N0 is an intra-frame prediction block and N1 is not an intra-frame prediction block, then Fig. 9C Sort all weighted attributes in the order shown. Fig.9D As shown, N0 and N1 are two surrounding blocks of the current block. If N0 is not an intra-frame prediction block and N1 is an intra-frame prediction block, then Fig.9D Sort all weighted attributes in the order shown. Of course, Figure 9B-9D This is just an example, and other shapes may also be used, such as the intra-frame area and the inter-frame area being a triangular area and a trapezoidal area respectively, or the intra-frame area and the inter-frame area being trapezoidal areas, or the intra-frame area and the inter-frame area being a triangular area and a pentagonal area respectively, which will not be repeated here.
[0214] Embodiment 8: In the above embodiment, the encoder / decoder needs to obtain the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode. The process of obtaining the prediction value of the current block is described below.
[0215] Method 1: When the current block is divided into three parts, namely, the intra region, the inter region and the inter-intra region according to the weighted attribute of the current block, the prediction value of the current block includes the prediction value of the intra region, the prediction value of the inter region and the prediction value of the inter-intra region. Based on this, the prediction value of the intra region of the current block is obtained according to the target intra prediction mode, and the prediction value of the inter region of the current block is obtained according to the target inter prediction mode (that is, the prediction value of the inter region is obtained according to the target motion information of the target inter prediction mode. The method for determining the target motion information is referred to in the above embodiment, and the method for obtaining the prediction value according to the target motion information is not repeated here). Then, the intra prediction value of the inter-intra region is obtained according to the target intra prediction mode, and the inter prediction value of the inter-intra region is obtained according to the target inter prediction mode, and the prediction value of the inter-intra region is obtained according to the intra prediction value of the inter-intra region and the inter prediction value of the inter-intra region.
[0216] For example, see Fig. 10A As shown, the area in the upper right corner is the intra-frame area, the area in the lower left corner is the inter-frame area, and the distance between the center of each sub-block in the inter-frame and intra-frame joint area (such as the sub-blocks shown in blocks 1, 2, 4, 6, and 7) and the dividing line is less than a preset threshold (which can be configured based on experience). For the intra-frame area, the prediction value of the intra-frame area of the current block can be obtained according to the target intra-frame prediction mode, and the specific acquisition method will not be repeated. For the inter-frame area, the prediction value of the inter-frame area of the current block can be obtained according to the target inter-frame prediction mode, and the specific acquisition method will not be repeated.
[0217] For the inter-frame intra-frame joint region, the following methods can be used for implementation: Method 1, obtain the prediction value of the inter-frame intra-frame joint region of the current block according to the target intra-frame prediction mode. Method 2, obtain the prediction value of the inter-frame intra-frame joint region of the current block according to the target inter-frame prediction mode. Method 3, obtain the intra-frame prediction value of the inter-frame intra-frame joint region according to the target intra-frame prediction mode, obtain the inter-frame prediction value of the inter-frame intra-frame joint region according to the target inter-frame prediction mode, and obtain the prediction value of the inter-frame intra-frame joint region according to the intra-frame prediction value of the inter-frame intra-frame joint region and the inter-frame prediction value of the inter-frame intra-frame joint region.
[0218] See also Fig. 10A As shown, for method 1, the prediction values of blocks 1, 2, 4, 6, and 7 are obtained according to the target intra-frame prediction mode. For method 2, the prediction values of blocks 1, 2, 4, 6, and 7 are obtained according to the target inter-frame prediction mode. Methods 1 and 2 are not described in detail here, and the implementation process of method 3 is described later.
[0219] In mode 3, the encoding end / decoding end can obtain the prediction value of each pixel point of the inter-frame intra-frame joint area according to the target intra-frame prediction mode (hereinafter referred to as the intra-frame prediction value), and obtain the prediction value of each pixel point of the inter-frame intra-frame joint area according to the target inter-frame prediction mode (hereinafter referred to as the inter-frame prediction value). Then, for each pixel point of the inter-frame intra-frame joint area, the intra-frame prediction value and the inter-frame prediction value of the pixel point can be weighted to obtain the target prediction value of the pixel point. Based on the target prediction value of each pixel point of the inter-frame intra-frame joint area, the prediction value of the inter-frame intra-frame joint area can be composed.
[0220] Exemplarily, for each pixel point in the intra-frame joint area, when the intra-frame prediction value and the inter-frame prediction value are weighted, the weight value of the intra-frame prediction value and the weight value of the inter-frame prediction value may be the same or different. For example, if the pixel point is closer to the intra-frame area, the weight value of the intra-frame prediction value is greater than the weight value of the inter-frame prediction value; if the pixel point is closer to the inter-frame area, the weight value of the intra-frame prediction value is less than the weight value of the inter-frame prediction value; if the pixel point is located at the dividing line, the weight value of the intra-frame prediction value is equal to the weight value of the inter-frame prediction value. Of course, the above is only an example of the size of the weight value and is not limited to this.
[0221] Each sub-block in the inter-frame and intra-frame joint region can be a 1*1 sub-block, that is, a single pixel block, or an N*M sub-block, where N is greater than or equal to 1 and M is greater than or equal to 1. Fig. 10A As shown, the inter-frame and intra-frame joint area includes a sub-block marked as 1, a sub-block marked as 2, a sub-block marked as 4, a sub-block marked as 6, and a sub-block marked as 7.
[0222] For each sub-block marked as 7, hereinafter referred to as sub-block 7, the intra-frame prediction value is recorded as prediction value P1, the inter-frame prediction value is recorded as prediction value P2, the weight value of prediction value P1 is a, the weight value of prediction value P2 is b, and the target prediction value of sub-block 7 is: P1*a+P2*b. The weight value a is greater than the weight value b. Assuming a is 7 / 8 and b is 1 / 8, the target prediction value is: P1*7 / 8+P2*1 / 8.
[0223] For each sub-block 6 marked as 6, the intra-frame prediction value is recorded as prediction value P1, the inter-frame prediction value is recorded as prediction value P2, the weight value of prediction value P1 is a, the weight value of prediction value P2 is b, and the target prediction value of sub-block 6 is: P1*a+P2*b. The weight value a is greater than the weight value b. Compared with sub-block 7, sub-block 6 is closer to the inter-frame area. Therefore, the weight value a of sub-block 6 is less than the weight value a of sub-block 7. Assuming a is 6 / 8 and b is 2 / 8, the target prediction value is: P1*6 / 8+P2*2 / 8.
[0224] For each sub-block 4 marked as 4, the intra-frame prediction value is recorded as prediction value P1, the inter-frame prediction value is recorded as prediction value P2, the weight value of prediction value P1 is a, the weight value of prediction value P2 is b, and the target prediction value of sub-block 4 is: P1*a+P2*b. Sub-block 4 is located on the dividing line, the weight value a is equal to the weight value b, a is 4 / 8, b is 4 / 8, then the target prediction value is: P1*4 / 8+P2*4 / 8.
[0225] For each sub-block 2 marked as 2, the intra-frame prediction value is recorded as prediction value P1, the inter-frame prediction value is recorded as prediction value P2, the weight value of prediction value P1 is a, the weight value of prediction value P2 is b, and the target prediction value of sub-block 2 is: P1*a+P2*b. The weight value a is less than the weight value b. Assuming a is 2 / 8 and b is 6 / 8, the target prediction value is: P1*2 / 8+P2*6 / 8.
[0226] For each sub-block 1 marked as 1, the intra-frame prediction value is recorded as prediction value P1, and the inter-frame prediction value is recorded as prediction value P2. The weight value of prediction value P1 is a, and the weight value of prediction value P2 is b. The target prediction value of sub-block 1 is: P1*a+P2*b. The weight value a is smaller than the weight value b. Compared with sub-block 2, sub-block 1 is closer to the intra-frame area. Therefore, the weight value a of sub-block 1 is smaller than the weight value a of sub-block 2. Assuming a is 1 / 8 and b is 7 / 8, the target prediction value is: P1*1 / 8+P2*7 / 8.
[0227] In the above embodiment, the sum of the weight value a and the weight value b of each sub-block may be 1. The closer to the intra-frame area, the larger the weight value a and the smaller the weight value b; the closer to the inter-frame area, the smaller the weight value a and the larger the weight value b. Of course, the above weight value a and weight value b are only an example of this application scenario, and there is no limitation on the weight value a and weight value b.
[0228] Method 2: When the current block is divided into an intra-frame region and an inter-frame region according to the weighted attribute of the current block, the prediction value of the current block includes the prediction value of the intra-frame region and the prediction value of the inter-frame region. Based on this, the prediction value of the intra-frame region of the current block is obtained according to the target intra-frame prediction mode, and the prediction value of the inter-frame region of the current block is obtained according to the target inter-frame prediction mode. For example, the prediction value of the inter-frame region can be obtained according to the target motion information of the target inter-frame prediction mode. The method for determining the target motion information is referred to the above embodiment, and the method for obtaining the prediction value according to the target motion information is not repeated here.
[0229] For example, see Fig. 10BAs shown, the area in the upper right corner is the intra-frame area, and the area in the lower left corner is the inter-frame area. The area on the dividing line can be considered as the intra-frame area or the inter-frame area, and there is no restriction on this. Based on this, for the intra-frame area, the prediction value of the intra-frame area of the current block can be obtained according to the target intra-frame prediction mode, and for the inter-frame area, the prediction value of the inter-frame area of the current block can be obtained according to the target inter-frame prediction mode.
[0230] See also Fig. 10B As shown, for each sub-block in the intra-frame area, the intra-frame prediction value of each sub-block is determined, and the intra-frame prediction value is recorded as prediction value P1. For each sub-block in the inter-frame area, the inter-frame prediction value of each sub-block is determined, and the inter-frame prediction value is recorded as prediction value P2. For each sub-block X, the intra-frame prediction value of each sub-block X is determined, or the inter-frame prediction value of each sub-block X is determined, and there is no limitation on this. Exemplarily, the intra-frame prediction values of all sub-blocks X can be determined, or the inter-frame prediction values of all sub-blocks X can be determined, or the intra-frame prediction values of some sub-blocks X can be determined, and the inter-frame prediction values of the remaining sub-blocks X can be determined.
[0231] In the above embodiment, it is necessary to obtain the prediction value of the intra region of the current block according to the target intra prediction mode, and / or obtain the prediction value of the inter-frame and intra-frame joint region of the current block. The process of obtaining the prediction value of the relevant region (hereinafter referred to as the intra prediction value) according to the target intra prediction mode can be implemented in the following manner:
[0232] If the weighted attribute is weighted attribute 3 and the target intra prediction mode is Planar prediction mode, the weighted value (such as the average value) of the reconstructed pixels on the left side of the current block and the reconstructed pixels on the upper side of the current block can be used to obtain the intra prediction value. For example, the following formula can be used to obtain the intra prediction value:
[0233]
[0234] If the weighted attribute is weighted attribute 2 and the target intra prediction mode is the vertical angle prediction mode, the weighted value (such as the average value) of the reconstructed pixels around the upper side of the current block can be used to obtain the intra prediction value. For example, the following formula can be used to obtain the intra prediction value:
[0235] If the weighted attribute is weighted attribute 1 and the target intra prediction mode is the horizontal angle prediction mode, the weighted value (such as the average value) of the reconstructed pixels on the left side of the current block can be used to obtain the intra prediction value. For example, the following formula can be used to obtain the intra prediction value:
[0236] In the above formulas, W represents the width of the current block, H represents the height of the current block, dcVal represents the intra-frame prediction value, p[][] represents the reconstructed pixels, p[-1][] represents the reconstructed pixels in a column on the left side of the current block, and p[][-1] represents the reconstructed pixels in a row on the upper side of the current block. The addend before the right shift sign >> (such as W>>1, H>>1, etc.) is used to round the value.
[0237] In the above formula, the value range of x' is 0 to W-1. Of course, the value range of 0 to W-1 is just an example. In practical applications, it can also be other value ranges, which are related to the weighted attributes. For example, for Figure 6C The weighted attribute x′ shown in the figure ranges from 0 to S, where S is less than W-1. The length of S is related to the horizontal length of the region within the frame, and there is no restriction on this. When the number of reconstructed pixels is changed, the size of the denominator needs to be changed accordingly.
[0238] In the above formula, the value range of y′ is 0 to H-1. Of course, the value range of 0 to H-1 is just an example. In practical applications, it can also be other value ranges, which are related to the weighted attributes. For example, Figure 6C The weighted attribute y′ shown in the figure has a value range of 0 to T, where T is less than H-1, and the length of T is related to the vertical length of the region within the frame, which is not limited. When the number of reconstructed pixels is changed, the size of the denominator needs to be changed accordingly.
[0239] Based on the same application concept as the above method, the embodiment of the present application also proposes a coding and decoding device, which is applied to the coding end or the decoding end, see Fig.11A As shown, it is a structural diagram of the device, including:
[0240] The first acquisition module 1111 is used to acquire a weighted attribute of the current block when determining to start inter-frame and intra-frame joint prediction for the current block; wherein the weighted attribute is used to indicate the division information of the current block and the relative position of the intra-frame region and the inter-frame region included in the current block; and acquire a target intra-frame prediction mode bound to the weighted attribute according to the weighted attribute;
[0241] A second acquisition module 1112 is used to acquire a target inter-frame prediction mode of the current block;
[0242] The third acquisition module 1113 is used to obtain the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0243] When the current block is divided into the intra-frame region, the inter-frame region and the inter-frame and intra-frame combined region according to the weighted attribute of the current block, the prediction value of the current block includes the prediction value of the intra-frame region, the prediction value of the inter-frame region and the prediction value of the inter-frame and intra-frame combined region, the third acquisition module 1113 is specifically used to:
[0244] Acquire a prediction value of an intra-frame region of the current block according to the target intra-frame prediction mode;
[0245] Acquire a prediction value of the inter-frame region of the current block according to the target inter-frame prediction mode;
[0246] According to the target intra-frame prediction mode, the intra-frame prediction value of the inter-frame intra-frame joint area is obtained, and according to the target inter-frame prediction mode, the inter-frame prediction value of the inter-frame intra-frame joint area is obtained; according to the intra-frame prediction value of the inter-frame intra-frame joint area and the inter-frame prediction value of the inter-frame intra-frame joint area, the prediction value of the inter-frame intra-frame joint area is obtained.
[0247] When the current block is divided into the intra-frame region and the inter-frame region according to the weighted attribute of the current block, the prediction value of the current block includes the prediction value of the intra-frame region and the prediction value of the inter-frame region, and the third acquisition module 1113 is specifically used to: acquire the prediction value of the intra-frame region of the current block according to the target intra-frame prediction mode;
[0248] A prediction value of the inter-frame region of the current block is obtained according to the target inter-frame prediction mode.
[0249] The weighted attribute is determined according to first indication information, where the first indication information is used to indicate the division information of the current block and the relative position of the intra-frame region and the inter-frame region.
[0250] The weighted attribute is determined according to first indication information and second indication information, wherein the first indication information is used to indicate division information of the current block, and the second indication information is used to indicate a relative position between an intra-frame region and an inter-frame region.
[0251] The weighted attribute is determined according to the first indication information, and the first indication information is used to indicate the division information of the current block; the first acquisition module 1111 is also used to determine the relative position of the intra-frame region and the inter-frame region according to the division information of the current block. For example, if the first indication information is used to indicate that the current block is divided according to the lower left-upper right, the relative position of the intra-frame region and the inter-frame region is determined to be that the intra-frame region is located at the upper left of the inter-frame region.
[0252] The first indication information is used to indicate that the current block is divided according to a preconfigured division mode. The preconfigured division mode is to divide according to the diagonal of the current block; when the value of the first indication information is a first value, the diagonal is a first diagonal, and when the value of the first indication information is a second value, the diagonal is a second diagonal.
[0253] The first acquisition module 1111 is specifically used to acquire the target intra prediction mode bound to the weighted attribute according to the weighted attribute: if the weighted attribute corresponds to an intra prediction mode, then determine the one intra prediction mode as the target intra prediction mode bound to the weighted attribute; or
[0254] If the weighted attribute corresponds to an intra prediction mode list, and the intra prediction mode list includes at least two intra prediction modes, then a target intra prediction mode bound to the weighted attribute is obtained from the intra prediction mode list.
[0255] If the method is applied to the decoding end, the first acquisition module 1111 is specifically used to obtain the target intra-frame prediction mode bound to the weighted attribute from the intra-frame prediction mode list: obtain the encoded bit stream, the encoded bit stream includes indication information; wherein the indication information is used to indicate the index value of the target intra-frame prediction mode in the intra-frame prediction mode list; select the intra-frame prediction mode corresponding to the index value from the intra-frame prediction mode list; and determine the selected intra-frame prediction mode as the target intra-frame prediction mode bound to the weighted attribute.
[0256] The weighted attribute is used to indicate that the current block is divided into upper left and lower right, and the intra-frame area is located at the lower left of the inter-frame area, and the target intra-frame prediction mode bound to the weighted attribute is the horizontal angle prediction mode.
[0257] The weighted attribute is used to indicate that the current block is divided into upper left-lower right, and the intra-frame area is located in the upper right of the inter-frame area, and the target intra-frame prediction mode bound to the weighted attribute is the vertical angle prediction mode.
[0258] The weighted attribute is used to indicate that the current block is divided into lower left-upper right, and the intra-frame area is located in the upper left of the inter-frame area, and the target intra-frame prediction mode bound to the weighted attribute is the Planar prediction mode.
[0259] The weighted attribute is used to indicate that the current block is divided into upper left and lower right, and the intra-frame area is located at the lower left of the inter-frame area, then the first intra-frame prediction mode in the intra-frame prediction mode list is a horizontal angle prediction mode.
[0260] The weighted attribute is used to indicate that the current block is divided into upper left-lower right, and the intra-frame area is located in the upper right of the inter-frame area, then the first intra-frame prediction mode in the intra-frame prediction mode list is a vertical angle prediction mode.
[0261] The weighted attribute is used to indicate that the current block is divided into lower left and upper right, and the intra-frame area is located at the upper left of the inter-frame area, then the first intra-frame prediction mode in the intra-frame prediction mode list is the Planar prediction mode.
[0262] Based on the same application concept as the above method, the embodiment of the present application also proposes a coding and decoding device, which is applied to the coding end or the decoding end, see Fig. 11B As shown, it is a structural diagram of the device, including:
[0263] The first acquisition module 1121 is used to acquire a target intra prediction mode of the current block when determining to start inter-frame and intra-frame joint prediction for the current block; acquire a weighted attribute bound to the target intra prediction mode according to the target intra prediction mode; the weighted attribute is used to indicate the division information of the current block and the relative position of the intra region and the inter region included in the current block;
[0264] A second acquisition module 1122, configured to acquire a target inter-frame prediction mode of the current block;
[0265] The third acquisition module 1123 is used to obtain the prediction value of the current block according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0266] Based on the same application concept as the above method, 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. 11C As shown. It includes: a processor 1131 and a machine-readable storage medium 1132, wherein: the machine-readable storage medium 1132 stores machine-executable instructions that can be executed by the processor 1131; the processor 1131 is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0267] For example, the processor 1131 is used to execute machine executable instructions to implement the following steps:
[0268] When determining to start inter-frame and intra-frame joint prediction for a current block, obtaining a weighted attribute of the current block; wherein the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0269] Acquire, according to the weighted attribute, a target intra prediction mode bound to the weighted attribute;
[0270] Obtaining a target inter-frame prediction mode of the current block;
[0271] Acquire a prediction value of the current block according to the target intra prediction mode and the target inter prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region and a prediction value of an inter region, the prediction value of the intra region is determined according to the target intra prediction mode, and the prediction value of the inter region is determined according to the target inter prediction mode;
[0272] Alternatively, the processor 1131 is used to execute machine executable instructions to implement the following steps:
[0273] When determining to start inter-frame and intra-frame joint prediction for the current block, obtaining a target intra-frame prediction mode of the current block;
[0274] Acquire a weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0275] Obtaining a target inter-frame prediction mode of the current block;
[0276] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0277] Based on the same application concept as the above method, 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.11D As shown. It includes: a processor 1141 and a machine-readable storage medium 1142, wherein: the machine-readable storage medium 1142 stores machine-executable instructions that can be executed by the processor 1141; the processor 1141 is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.
[0278] For example, the processor 1141 is used to execute machine executable instructions to implement the following steps:
[0279] When determining to start inter-frame and intra-frame joint prediction for a current block, obtaining a weighted attribute of the current block; wherein the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0280] Acquire a target intra prediction mode bound to the weighted attribute according to the weighted attribute;
[0281] Obtaining a target inter-frame prediction mode of the current block;
[0282] Acquire a prediction value of the current block according to the target intra prediction mode and the target inter prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region and a prediction value of an inter region, the prediction value of the intra region is determined according to the target intra prediction mode, and the prediction value of the inter region is determined according to the target inter prediction mode;
[0283] Alternatively, the processor 1141 is used to execute machine executable instructions to implement the following steps:
[0284] When determining to start inter-frame and intra-frame joint prediction for the current block, obtaining a target intra-frame prediction mode of the current block;
[0285] Acquire a weighted attribute bound to the target intra-frame prediction mode according to the target intra-frame prediction mode; the weighted attribute is used to indicate the division information of the current block, and the relative position of the intra-frame region and the inter-frame region included in the current block;
[0286] Obtaining a target inter-frame prediction mode of the current block;
[0287] The prediction value of the current block is obtained according to the target intra-frame prediction mode and the target inter-frame prediction mode, the prediction value of the current block at least includes the prediction value of the intra-frame area and the prediction value of the inter-frame area, the prediction value of the intra-frame area is determined according to the target intra-frame prediction mode, and the prediction value of the inter-frame area is determined according to the target inter-frame prediction mode.
[0288] Based on the same application concept as the above method, the 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 method disclosed in the above example of the present application can be implemented. Among them, the above machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device, which can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory, random 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 optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0289] The systems, devices, modules or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be 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 device, a game console, a tablet computer, a wearable device, or a combination of any of these devices. For the convenience of description, the above devices are described separately by function into various units. Of course, when implementing this application, the functions of each unit can be implemented in the same one or more software and / or hardware.
[0290] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0291] 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.
[0292] These computer program instructions may also be stored in a computer-readable memory that can direct 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 manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the functions specified in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in one or more boxes. The above description is only the 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, It is characterized in that Applied to a decoding end, the method comprises: When determining to start weighted prediction for the current block, obtaining a weighted attribute of the current block, the weighted attribute is used to indicate the division information of the current block; wherein obtaining the weighted attribute of the current block includes: obtaining a weighted attribute corresponding to an index value in a coded bit stream; Obtaining a target intra-frame prediction mode according to the weighted attribute; Acquire a prediction value of the current block according to the target intra prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region, and the prediction value of the intra region is determined according to the target intra prediction mode; The weighted attribute is used to indicate that the current block is divided according to the upper left-lower right dividing line, and the target intra-frame prediction mode is an angle prediction mode along the upper left-lower right dividing line; if the intra-frame area is located at the lower left of the current block, the prediction value of the intra-frame area is the prediction value of the left adjacent area; or, if the intra-frame area is located at the upper right of the current block, the prediction value of the intra-frame area is the prediction value of the upper adjacent area.
2. The method according to claim 1, It is characterized in that The weighted attribute is used to indicate a partition line of the current block, and the target intra-frame prediction mode includes an angular prediction mode along the partition line.
3. The method according to claim 1 or 2, It is characterized in that The weighted attribute is used to indicate that the current block is divided according to an upper left-lower right dividing line, the weighted attribute corresponds to a second intra-frame prediction mode list, and the second intra-frame prediction mode list at least includes an angular prediction mode along the upper left-lower right dividing line; The target intra-frame prediction mode is an angle prediction mode selected from the second intra-frame prediction mode list.
4. A coding method, It is characterized in that Applied to the encoding end, the method includes: When determining to start weighted prediction for a current block, obtaining a weighted attribute of the current block, the weighted attribute being used to indicate partition information of the current block; encoding an index value corresponding to the weighted attribute in a coded bit stream; Obtaining a target intra-frame prediction mode according to the weighted attribute; Acquire a prediction value of the current block according to the target intra prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra region, and the prediction value of the intra region is determined according to the target intra prediction mode; The weighted attribute is used to indicate that the current block is divided according to the upper left-lower right dividing line, and the target intra-frame prediction mode is an angle prediction mode along the upper left-lower right dividing line; if the intra-frame area is located at the lower left of the current block, the prediction value of the intra-frame area is the prediction value of the left adjacent area; or, if the intra-frame area is located at the upper right of the current block, the prediction value of the intra-frame area is the prediction value of the upper adjacent area.
5. A decoding device, It is characterized in that Applied to a decoding end, the device comprises: A first acquisition module is used to acquire a weighted attribute of the current block when it is determined to start weighted prediction for the current block, wherein the weighted attribute is used to indicate the division information of the current block; wherein the first acquisition module acquires the weighted attribute of the current block by: acquiring the weighted attribute corresponding to the index value in the coded bit stream; A second acquisition module, configured to acquire a target intra-frame prediction mode according to the weighted attribute; A third acquisition module, configured to acquire a prediction value of a current block according to the target intra-frame prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra-frame region, and the prediction value of the intra-frame region is determined according to the target intra-frame prediction mode; The weighted attribute is used to indicate that the current block is divided according to the upper left-lower right dividing line, and the target intra-frame prediction mode is an angle prediction mode along the upper left-lower right dividing line; if the intra-frame area is located at the lower left of the current block, the prediction value of the intra-frame area is the prediction value of the left adjacent area; or, if the intra-frame area is located at the upper right of the current block, the prediction value of the intra-frame area is the prediction value of the upper adjacent area.
6. The device according to claim 5, It is characterized in that The weighted attribute is used to indicate a partition line of the current block, and the target intra-frame prediction mode includes an angular prediction mode along the partition line.
7. The device according to claim 5 or 6, It is characterized in that The weighted attribute is used to indicate that the current block is divided according to an upper left-lower right dividing line, the weighted attribute corresponds to a second intra-frame prediction mode list, and the second intra-frame prediction mode list at least includes an angular prediction mode along the upper left-lower right dividing line; The target intra-frame prediction mode is an angle prediction mode selected from the second intra-frame prediction mode list.
8. An encoding device, It is characterized in that Applied to the encoding end, the device includes: A first acquisition module is used to acquire a weighted attribute of the current block when it is determined to start weighted prediction for the current block, wherein the weighted attribute is used to indicate the division information of the current block; and encode an index value corresponding to the weighted attribute in a coded bit stream; A second acquisition module, configured to acquire a target intra-frame prediction mode according to the weighted attribute; A third acquisition module, configured to acquire a prediction value of a current block according to the target intra-frame prediction mode, wherein the prediction value of the current block at least includes a prediction value of an intra-frame region, and the prediction value of the intra-frame region is determined according to the target intra-frame prediction mode; The weighted attribute is used to indicate that the current block is divided according to the upper left-lower right dividing line, and the target intra-frame prediction mode is an angle prediction mode along the upper left-lower right dividing line; if the intra-frame area is located at the lower left of the current block, the prediction value of the intra-frame area is the prediction value of the left adjacent area; or, if the intra-frame area is located at the upper right of the current block, the prediction value of the intra-frame area is the prediction value of the upper adjacent area.
9. A decoding terminal device, It is 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 machine executable instructions to implement the method steps described in any one of claims 1-3.
10. A coding terminal device, It is characterized in that include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is configured to execute machine executable instructions to implement the method steps of claim 4.
