Coding method and apparatus, decoding method and apparatus, coder, decoder, code stream, and storage medium

By combining inter-frame and intra-frame prediction modes to calculate the prediction value of the current block, the problem of insufficient prediction accuracy of the current block in video encoding and decoding is solved, thereby improving video encoding and decoding performance and image continuity.

WO2026085741A9PCT designated stage Publication Date: 2026-07-02GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2024-10-22
Publication Date
2026-07-02

AI Technical Summary

Technical Problem

The prediction accuracy of the current block in existing video codec standards is poor, resulting in poor video codec performance.

Method used

By determining the inter-frame prediction mode and intra-frame prediction mode of the current block's neighboring blocks, and combining the inter-frame prediction values ​​and intra-frame prediction values, the prediction value of the current block is calculated to improve prediction accuracy.

Benefits of technology

It enhances video encoding and decoding performance, improves the continuity and natural transition between adjacent blocks in the reconstructed image, and reduces computational overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024126577_02072026_PF_FP_ABST
    Figure CN2024126577_02072026_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides a coding method and apparatus, a decoding method and apparatus, a coder, a decoder, a code stream, a storage medium, and a program product. The decoding method comprises: determining first motion information corresponding to the inter prediction mode of a first neighboring block of the current block; on the basis of the first motion information, obtaining a first inter prediction value of a first region of the current block, wherein the first neighboring block is adjacent to the first region; on the basis of the intra prediction mode of the current block, obtaining a first intra prediction value of the first region; and, on the basis of the first inter prediction value and the first intra prediction value of the first region, determining a prediction value of the current block.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding and decoding methods and devices, codecs, bitstreams, and storage media Technical Field

[0001] This application relates to video technology, including but not limited to encoding and decoding methods and apparatus, codecs, bitstreams, and storage media. Background Technology

[0002] In the field of video encoding and decoding, enhancing video compression efficiency is crucial. The digitization of images and videos generates significant data redundancy, making video compression technology possible. Strong spatial correlations exist between adjacent parts or pixels within an image. Intra-frame prediction utilizes the spatial correlations between already encoded pixels surrounding the current block and pixels within the current block to reduce spatial redundancy in video coding. Furthermore, due to the strong similarity between adjacent images in a video, inter-image prediction methods are used in video encoding and decoding to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0003] However, the prediction of the current block in video codec standards results in poor video encoding and decoding performance. Therefore, researching how to further improve the prediction accuracy of the current block, thereby enhancing video encoding and decoding performance, remains significant.

[0004] Summary of the Invention

[0005] The encoding / decoding method, apparatus, codec, bitstream, and storage medium provided in this application can improve the accuracy of the prediction value of the current block, thereby enhancing video encoding / decoding performance. The encoding / decoding method, apparatus, codec, bitstream, and storage medium provided in this application are implemented as follows:

[0006] In a first aspect, embodiments of this application provide a decoding method, the method being applied to a decoder, the method comprising: determining first motion information corresponding to the inter-frame prediction mode of a first neighboring block of the current block; obtaining a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first neighboring block is adjacent to the first region; obtaining a first intra-frame prediction value of the first region based on the intra-frame prediction mode of the current block; and determining a prediction value of the current block based on the first inter-frame prediction value of the first region and the first intra-frame prediction value.

[0007] Secondly, embodiments of this application provide an encoding method applied to an encoder. The method includes: determining first motion information corresponding to the inter-frame prediction mode of a first neighboring block of the current block; obtaining a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first neighboring block is adjacent to the first region; obtaining a first intra-frame prediction value of the first region based on the intra-frame prediction mode of the current block; and determining a prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0008] Thirdly, embodiments of this application provide a decoding apparatus applied to a decoder. The apparatus includes: a first determining module configured to determine first motion information corresponding to the inter-frame prediction mode of a first adjacent block of the current block; a first prediction module configured to obtain a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first adjacent block is adjacent to the first region; a second prediction module configured to obtain a first intra-frame prediction value of the first region based on the intra-frame prediction mode of the current block; and a second determining module configured to determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0009] Fourthly, embodiments of this application provide an encoding apparatus applied to an encoder. The apparatus includes: a first determining module configured to determine first motion information corresponding to the inter-frame prediction mode of a first adjacent block of the current block; a first prediction module configured to obtain a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first adjacent block is adjacent to the first region; a second prediction module configured to obtain a first intra-frame prediction value of the first region based on the intra-frame prediction mode of the current block; and a second determining module configured to determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0010] Fifthly, embodiments of this application provide a decoder, including a first memory and a first processor; wherein the first memory is used to store a computer program that can run on the first processor; and the first processor is used to execute the decoding method described in embodiments of this application when running the computer program.

[0011] In a sixth aspect, embodiments of this application provide an encoder, including a second memory and a second processor; wherein the second memory is used to store a computer program that can run on the second processor; and the second processor is used to execute the encoding method described in embodiments of this application when running the computer program.

[0012] In a seventh aspect, embodiments of this application provide a bitstream generated based on the residual value between the predicted value of the current block and the sample value of the current block; wherein the predicted value of the current block is obtained through the encoding method described in embodiments of this application.

[0013] Eighthly, embodiments of this application provide an electronic device, including: a processor adapted to execute a computer program; and a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, it implements the encoding method described in the embodiments of this application, or when the computer program is executed by the processor, it implements the decoding method described in the embodiments of this application.

[0014] Ninthly, embodiments of this application provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which, when executed, implements the encoding method described in the embodiments of this application, or the computer program, when executed, implements the decoding method described in the embodiments of this application.

[0015] In a tenth aspect, embodiments of this application provide a computer program product including computer program instructions that cause a computer to perform the method described in the first or second aspect.

[0016] Eleventhly, embodiments of this application provide a computer program that causes a computer to perform the methods described in the first or second aspect.

[0017] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0019] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily need to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0020] Figure 1 is a schematic diagram of a block-based hybrid coding framework that may be applicable to embodiments of this application;

[0021] Figure 2 is a schematic diagram of the current block provided in an embodiment of this application;

[0022] Figure 3 is a schematic diagram of the implementation flow of the decoding method provided in the embodiment of this application;

[0023] Figure 4 is a schematic diagram of the current block provided in an embodiment of this application;

[0024] Figure 5 is a schematic diagram of the current block provided in an embodiment of this application;

[0025] Figure 6 is a schematic diagram of the current block provided in an embodiment of this application;

[0026] Figure 7 is a schematic diagram of the wide-angle mode;

[0027] Figure 8 is a schematic diagram of the 35 intra-frame prediction modes used by HEVC.

[0028] Figure 9 is a schematic diagram of the 66 prediction modes used by AVS3;

[0029] Figure 10 is a schematic diagram of the implementation process of the method for determining the predicted value of the current block provided in the embodiments of this application;

[0030] Figure 11 is a schematic diagram of the implementation process of the method for determining the predicted value of the current block provided in the embodiment of this application;

[0031] Figure 12 is a schematic diagram of the implementation process of weighted averaging of the first inter-frame prediction value and the first intra-frame prediction value provided in an embodiment of this application;

[0032] Figure 13 is a schematic diagram of the implementation flow of the method for determining the predicted value of the current block provided in the embodiments of this application;

[0033] Figure 14 is a schematic diagram of the implementation flow of the encoding method provided in the embodiments of this application;

[0034] Figure 15 is a schematic diagram of the current block provided in an embodiment of this application;

[0035] Figure 16 is a schematic diagram of the decoding device provided in an embodiment of this application;

[0036] Figure 17 is a schematic diagram of the structure of the encoding device provided in an embodiment of this application;

[0037] Figure 18 is a schematic diagram of the decoder provided in an embodiment of this application;

[0038] Figure 19 is a schematic diagram of the encoder provided in an embodiment of this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0041] In the following description, exemplary descriptions such as “some embodiments”, “in other embodiments”, or “in one example” describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subset of all possible embodiments and may be combined with each other without conflict.

[0042] It should be noted that the terms "first", "second", "third", etc., used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It is understood that "first", "second", "third", etc., can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0043] The encoder and decoder framework and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. Those skilled in the art will understand that, with the evolution of encoders and decoders and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0044] Figure 1 is a schematic diagram of a block-based hybrid coding framework that may be applicable to embodiments of this application. As shown in Figure 1, each image, sub-image, or frame in the video is divided into blocks of the same size (e.g., 256x256, 128x128, 64x64, etc.), such as Largest Coding Units (LCUs) or Coding Tree Units (CTUs). Each LCU or CTU can be further divided into rectangular Coding Units (CUs) according to rules. Coding units may also be further divided into Prediction Units (PUs), Transform Units (TUs), etc. As shown in Figure 1, the hybrid coding framework 100 includes a pre-encode filtering module 101, a prediction module 102, a transform module 103, a quantization module 104, an entropy coding module 105, an inverse quantization module 106, an inverse transform module 107, and an in-loop filter module 108. The prediction module 102 includes an intra-prediction unit 109 and an inter-prediction unit. The inter-prediction unit includes a motion estimation subunit 110 and a motion compensation subunit 111. Because there is a strong correlation between adjacent pixels in an image of a video, intra-prediction is used in video encoding and decoding technology to eliminate spatial redundancy between adjacent pixels. Because there is a strong similarity between adjacent images in a video, inter-image prediction (i.e., inter-frame prediction) is used in video encoding and decoding technology to eliminate temporal redundancy between adjacent images, thereby improving coding efficiency.

[0045] The basic workflow of a video codec is as follows: At the encoding end, an image is divided into blocks. Intra-frame prediction or inter-frame prediction is applied to the current block to generate a prediction block. The original block of the current block is subtracted from the prediction block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. Entropy coding is performed on the quantization coefficient matrix to output it to the bitstream. At the decoding end, intra-frame prediction or inter-frame prediction is applied to the current block to generate a prediction block. Simultaneously, the bitstream is parsed to obtain the quantization coefficient matrix. The quantization coefficient matrix is ​​inverse quantized and inverse transformed to obtain a residual block. The prediction block and the residual block are added to obtain a reconstructed block. The reconstructed blocks form a reconstructed image. Loop filtering is performed on the reconstructed image based on the image or based on the blocks to obtain the decoded image. The encoding end also requires similar operations to the decoding end to obtain the decoded image. The decoded image can serve as a reference image for subsequent inter-frame predictions. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined at the encoding end may be output to the bitstream if necessary. The decoding end determines the same block partitioning information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information as the encoding end by parsing and analyzing existing information, thereby ensuring that the decoded image obtained by the encoding end is the same as that obtained by the decoding end. The decoded image obtained by the encoding end is usually also called the reconstructed image. During prediction, the current block can be divided into prediction units, and during transform, the current block can be divided into transform units. The division of prediction units and transform units can be different. The above is the basic flow of a video codec under a block-based hybrid coding framework. With the development of technology, some modules or steps of this framework or flow may be optimized. The embodiments of this application are applicable to the basic flow of a video codec under this block-based hybrid coding framework, but are not limited to this framework and flow.

[0046] It should be noted that, in the embodiments of this application, the current block can be the current coding unit (CU) or the current prediction unit (PU), etc. Due to the need for parallel processing, images can be divided into slices, etc. Slices within the same image can be processed in parallel, meaning there is no data dependency between them. "Frame" is a commonly used term, generally understood as one image. In this application, "frame" can also be replaced with image or slice, etc.

[0047] Regarding Overlapped Block Motion Compensation (OBMC): If the current block and its neighboring blocks both use inter-frame prediction, but their motion information is not identical, discontinuities often appear at the boundaries between the two blocks. The greater the difference in their motion vectors, or the more pronounced the discontinuities may be if different reference images are used. OBMC can be used to eliminate these discontinuities.

[0048] Figure 2 is a schematic diagram of the current block provided in the embodiment of this application; as shown in Figure 2, the current block 200 includes an upper region 201, a left region 202 and a region 203; inter-frame prediction is performed on the current block 200 based on the motion information of the current block 200 (i.e., inter-frame prediction is performed on the entire current block 200, i.e., the whole region), and the predicted value predInterCur is obtained. For the left region 202 and the upper region 201 in the current block 200, prediction is performed again according to the motion information of the adjacent blocks, and the predicted value predInterNb is obtained. The final predicted values ​​of the left region 202 and the upper region 201 are obtained by weighting predInterCur and predInterNb. That is, the calculation formula of the final predicted value PredOBMC of the left region 202 or the upper region 201 is as follows (1):

[0049] PredOBMC=w*predInterCur+(1-w)*predInterNb(1);

[0050] The inventors of this application discovered the following during their research and analysis of video encoding and decoding methods:

[0051] In images where inter-frame prediction is allowed, intra-frame prediction is also permitted. In inter-frame images, some blocks are predicted using inter-frame prediction mode, and others using intra-frame prediction mode. Generally, if the reference image contains the content of the current block, or its content is not significantly different from the current block, the encoder will choose inter-frame prediction, and the difference between the reference block and the current block can be compensated for by residuals. However, if the reference image does not contain the content of the current block, or its content is significantly different from the current block, the encoder may choose intra-frame prediction. A typical scenario is that a foreground object occludes a background object, and as the foreground and background objects move relative to each other, some content of the background object gradually becomes visible. In this case, if the current block happens to contain this part that is not present in the reference image but is visible in the current image, it is highly likely that it will be encoded using intra-frame prediction mode.

[0052] Because encoding and decoding are block-based, VVC supports rectangular block partitioning. In scenes with relative motion between two objects, the block partitioning typically approximates the actual edges of the objects. However, the edges of objects or moving edges can be of arbitrary shapes, and rectangular block partitioning cannot perfectly capture the object's edges. Furthermore, the finer the block partitioning, the greater the overhead for encoding more blocks, requiring more information to be written into the bitstream. Encoders usually trade off between distortion and bitrate, and do not partition blocks entirely based on object edges. Moreover, in images captured by a camera, there is usually a transition region between the edges of objects.

[0053] The inventors of this application discovered that if the current block uses intra-frame prediction while its neighboring blocks use inter-frame prediction, there may be discontinuities or unnatural transitions at the boundary between the current block and its neighboring blocks. This phenomenon may be caused by the fact that most of the current block cannot find suitable content in the reference image and therefore uses intra-frame prediction, but there are still edges of foreground objects in a certain area near the block boundary.

[0054] This application provides a decoding method. Figure 3 is a schematic diagram of the implementation flow of the decoding method provided in this application. As shown in Figure 3, the method includes the following steps 301 to 304:

[0055] Step 301: Determine the first motion information corresponding to the inter-frame prediction mode of the first adjacent block of the current block;

[0056] Step 302: Based on the first motion information, obtain the first inter-frame prediction value of the first region of the current block; wherein, the first adjacent block is adjacent to the first region;

[0057] Step 303: Obtain the first intra-prediction value of the first region according to the intra-prediction mode of the current block;

[0058] Step 304: Determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0059] It is understood that, in the embodiments of this application, for the first region in the current block that is adjacent to the first adjacent block, not only is the first inter-frame prediction value of the first region determined based on the first motion information, but also the first intra-frame prediction value of the first region is determined based on the intra-frame prediction mode of the current block. In this way, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region is beneficial to improving the accuracy of the prediction value of the first region of the current block, thereby enhancing the continuity between the first region and the first adjacent block in the reconstructed image, making the transition of image content between the first region and the first adjacent block more natural.

[0060] The following sections will describe further optional implementation methods for each of the above steps, as well as related terms.

[0061] In step 301, the first motion information corresponding to the inter-frame prediction mode of the first adjacent block of the current block is determined.

[0062] In this embodiment, there are no restrictions on the first neighboring block. In short, the first neighboring block is a block whose prediction mode is inter-frame prediction mode and which is adjacent to the current block. For example, the first neighboring block is a decoded block that is adjacent to the current block.

[0063] In step 302, based on the first motion information, the first inter-frame prediction value of the first region of the current block is obtained; wherein, the first adjacent block is adjacent to the first region.

[0064] In this application embodiment, the size of the first region is not limited. In some embodiments, information related to the size of the first region can be indicated in the bitstream, such as indicating the size of the first region in the bitstream (as mentioned in the first syntax element below), or indicating the relationship between the size of the current block and the size of the first region in the bitstream (as mentioned in the second syntax element below). In other embodiments, information related to the size of the first region may not be indicated in the bitstream, and the decoder may determine the size of the first region autonomously based on the size of the current block. In still other embodiments, the size of the first region may also be a preset fixed value, for example, the size of the first region is 4. These possible implementations are described below.

[0065] In some embodiments, the decoding method further includes, for indicating information related to the size of the first region in the bitstream, decoding the bitstream to determine the value of a first syntax element; the first syntax element is used to indicate the size of the first region.

[0066] Furthermore, in some embodiments, the decoding of the bitstream to determine the value of the first syntax element includes: determining the maximum value of the first syntax element based on the size of the current block; and decoding the bitstream based on the maximum value of the first syntax element to obtain the value of the first syntax element.

[0067] For example, in some embodiments, if the size of the current block is N, then the maximum value of the first syntax element is equal to log2N-1.

[0068] For example, in some embodiments, the step of decoding the bitstream based on the maximum value of the first syntax element to obtain the value of the first syntax element includes: decoding the bitstream based on the maximum value of the first syntax element to obtain a first string; and determining the value of the corresponding first syntax element based on the first string; wherein the first string is a binary string.

[0069] For example, log₂N⁻¹ can be used as a parameter in the binarization process of the first syntax element, or N can be used as a parameter in the binarization process of the first syntax element. When N equals 8, i.e., log₂N⁻¹ equals 2, the correspondence between the binary symbol string and the syntax element value is shown in Table 1 below:

[0070] Table 1

[0071] When N equals 16, i.e., log₂N-1 equals 3, the correspondence between the binary symbol string and the syntax element value is shown in Table 2 below:

[0072] Table 2

[0073] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0074] For example, the correspondence between the value of the first syntax element and the size of the first region is shown in Table 3 below:

[0075] Table 3

[0076] In some embodiments, for information in the bitstream indicating the size related to the first region, the decoding method further includes: decoding the bitstream to determine the value of a second syntax element; and determining the size of the first region based on the size of the current block and the value of the second syntax element. Further, in some embodiments, the second syntax element is used to indicate the relationship between the size of the first region and the size of the current block. Exemplarily, in some embodiments, the second syntax element is used to indicate a proportional relationship between the size of the first region and the size of the current block; wherein different values ​​of the second syntax element indicate different proportional relationships. For example, as shown in Table 4, where N represents the size of the current block.

[0077] Table 4

[0078] For example, the correspondence between the size of the second syntax element and the size of the first region is shown in Table 5 below. The size of the first region needs to be determined based on the value of the current block size N.

[0079] Table 5

[0080] Since there are four possible sizes for the first region, the correspondence between the binary symbol string and the second syntax element value is shown in Table 6 below:

[0081] Table 6

[0082] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0083] For information not indicating the size of the first region in the bitstream, in some embodiments, the decoder can determine the size of the first region based on the size of the current block. Exemplarily, in some embodiments, determining the size of the first region based on the size of the current block includes: determining the size of the first region based on the size of the current block and a preset proportional relationship. For example, the preset proportional relationship is 1 / 4, 1 / 2, 3 / 4, or 1, etc. Exemplarily, in other embodiments, determining the size of the first region based on the size of the current block includes: determining the size of the first region based on the size of the current block and a preset first mapping relationship; wherein, the preset first mapping relationship refers to the correspondence between the size of the current block and the size of the first region. For example, the preset first mapping relationships are shown in Table 7 below.

[0084] Table 7

[0085] In some embodiments, the size of the first region is either height or width. Exemplarily, in some embodiments, the first region is an upper region, and the size of the first region is the height of the upper region; and / or, the first region is a left-side region, and the size of the first region is the width of the left-side region.

[0086] It can be understood that the first region is the region within the current block. For the first region being the upper region, this upper region can be understood as the region within the current block that is adjacent to the uppermost block of the current block. For example, as shown in Figure 4, the upper region can be region 401 in the current block 400, and the height of region 401 is shown in Figure 4; or, as shown in Figure 5, the upper region can also be region 501 in the current block 500, and the height of region 501 is shown in Figure 5; and as shown in Figure 6, the upper region can also be any region 601 among several regions 601 in the current block 600, and the height of region 601 is shown in Figure 6. Of course, in another possible implementation, the region 601 in the upper left corner can also be the left-side region.

[0087] It can be understood that the first region is the region within the current block. For the first region being the left-hand region, this left-hand region can be understood as the region within the current block that is adjacent to the left-hand neighboring block. For example, as shown in Figure 4, the left-hand region can be region 402 in the current block 400, and the width of region 402 is shown in Figure 4; or, as shown in Figure 5, the left-hand region can also be region 502 in the current block 500, and the width of region 502 is shown in Figure 5; or, as shown in Figure 6, the left-hand region can also be region 602 in the current block 600, and the width of region 602 is shown in Figure 6.

[0088] In this application embodiment, there is no restriction on whether the first region is the left region or the upper region of the current block. Whether to implement steps 301 and 302 for the left region or the upper region is independent of the intra-prediction mode of the current block or depends on the intra-prediction mode of the current block. This application does not impose any restrictions on this.

[0089] In some embodiments, when the intra-frame prediction mode of the current block is a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode, the first region is the upper region within the current block. That is, when the intra-frame prediction mode of the current block is a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode, steps 301 and 302 are performed on the upper region within the current block.

[0090] The inventors of this application discovered through research and analysis that: the intra-frame prediction mode of the current block uses a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode, such as VVC angle prediction mode 18 and several adjacent modes. The predicted value obtained based on this intra-frame prediction mode has strong continuity with the content of the left adjacent block of the current block, but the predicted value obtained based on this intra-frame prediction mode has poor continuity with the content of the upper adjacent block of the current block. Therefore, in the embodiments of this application, the intra-frame prediction mode of the current block is a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode. In the case of one of the prediction modes adjacent to the horizontal prediction mode, steps 301 and 302 can be implemented only for the upper region (i.e., an example of the first region) within the current block, and steps 301 and 302 can be omitted for the left region within the current block. The prediction value of the left region within the current block is equal to the intra-frame prediction value of that region (i.e., the prediction value obtained based on the intra-frame prediction mode of the current block). In this way, while enhancing the continuity between the upper region within the current block and the upper adjacent block of the current block in the reconstructed image, the computational overhead of prediction is saved, thereby improving decoding efficiency.

[0091] In this embodiment of the application, the prediction mode in the horizontal direction is not limited. For example, the prediction mode in the horizontal direction is the VVC angle prediction mode 18; or the prediction mode in the horizontal direction is the HEVC angle prediction mode 10; or the prediction mode in the horizontal direction is the AVS3 prediction mode 24.

[0092] In this embodiment, for prediction modes adjacent to the horizontal prediction mode, the adjacent prediction modes include those directly or indirectly adjacent to the horizontal prediction mode. For example, as shown in FIG7, the horizontal prediction mode is VVC angle prediction mode 18. Angle prediction modes 19 and 17 are prediction modes directly adjacent to angle prediction mode 18, and one or more other angle prediction modes are prediction modes indirectly adjacent to angle prediction mode 18. For example, angle prediction modes 2 to 16 and angle prediction modes 20 to 22 are prediction modes indirectly adjacent to angle prediction mode 18. As shown in FIG8, the horizontal prediction mode is HEVC angle prediction mode 10. Angle prediction modes 9 and 11 are prediction modes directly adjacent to angle prediction mode 10, and one or more other angle prediction modes are prediction modes indirectly adjacent to angle prediction mode 10. As shown in Figure 9, the horizontal prediction mode is prediction mode 24 of AVS3. Prediction modes 57 and 58 are prediction modes directly adjacent to prediction mode 24, and one or more other prediction modes are prediction modes indirectly adjacent to prediction mode 24.

[0093] In some embodiments, when the intra-frame prediction mode of the current block is a vertical prediction mode or one of one or more prediction modes adjacent to the vertical prediction mode, the first region is the left region within the current block. That is, when the intra-frame prediction mode of the current block is a vertical prediction mode or one of one or more prediction modes adjacent to the vertical prediction mode, steps 301 and 302 are performed on the left region within the current block.

[0094] The inventors of this application discovered through research and analysis that: the intra-frame prediction mode of the current block uses a vertical prediction mode or one of one or more prediction modes adjacent to the vertical prediction mode, such as the VVC angle prediction mode 50 and several adjacent modes. The predicted value obtained based on this intra-frame prediction mode has strong continuity with the content of the upper adjacent block of the current block, but the predicted value obtained based on this intra-frame prediction mode has poor continuity with the content of the left adjacent block of the current block. Therefore, in the embodiments of this application, the intra-frame prediction mode of the current block is a vertical prediction mode and... In the case of one of the prediction modes adjacent to the vertical prediction mode, steps 301 and 302 can be implemented only for the left region (i.e., an example of the first region) within the current block, while steps 301 and 302 are not implemented for the upper region within the current block. The prediction value of the upper region within the current block is equal to the intra-frame prediction value of that region (i.e., the prediction value obtained based on the intra-frame prediction mode of the current block). In this way, while enhancing the continuity between the left region within the current block and the left adjacent block of the current block in the reconstructed image, the computational overhead of prediction is saved, thereby improving decoding efficiency.

[0095] In this embodiment of the application, the prediction mode in the vertical direction is not limited. For example, the prediction mode in the vertical direction is the VVC angle prediction mode 50; or the prediction mode in the vertical direction is the HEVC angle prediction mode 26; or the prediction mode in the vertical direction is the AVS3 prediction mode 12.

[0096] In this embodiment, for prediction modes adjacent to the vertical prediction mode, the adjacent prediction modes include prediction modes that are directly or indirectly adjacent to the vertical prediction mode. For example, as shown in FIG7, the vertical prediction mode is VVC angle prediction mode 50, angle prediction modes 49 and 51 are prediction modes directly adjacent to angle prediction mode 50, and one or more other angle prediction modes are prediction modes indirectly adjacent to angle prediction mode 50, such as angle prediction modes 46 to 48 and angle prediction modes 52 to 66, etc., are prediction modes indirectly adjacent to angle prediction mode 50. As shown in FIG8, the vertical prediction mode is HEVC angle prediction mode 26, angle prediction modes 25 and 27 are prediction modes directly adjacent to angle prediction mode 26, and one or more other angle prediction modes are prediction modes indirectly adjacent to angle prediction mode 26. As shown in Figure 9, the vertical prediction mode is prediction mode 12 of AVS3, prediction modes 43 and 44 are prediction modes directly adjacent to prediction mode 12, and one or more other prediction modes are prediction modes indirectly adjacent to prediction mode 12.

[0097] In step 303, the first intra-prediction value of the first region is obtained according to the intra-prediction mode of the current block.

[0098] In step 304, the prediction value of the current block is determined based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0099] In the embodiments of this application, there are no limitations on further embodiments of step 304. For example, the predicted value of the current block can be determined by the method shown in FIG10; in other embodiments, the predicted value of the current block can also be determined by the method shown in FIG11.

[0100] That is, for step 304, in some embodiments, as shown in FIG10, it may include the following steps 1001 and 1002:

[0101] Step 1001: Determine the prediction value of the first region based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0102] In some embodiments, step 1001 may include averaging the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the first region.

[0103] In some embodiments, step 1001 may include: taking a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the first region.

[0104] Step 1002: Determine the predicted value of the current block based on the predicted value of the first region.

[0105] It is understandable that if the first region is the entire area of ​​the current block, the predicted value of the current block is the predicted value of the first region. If the first region is only a part of the current block, the predicted value of the current block includes the predicted value of the first region and the predicted values ​​of other regions of the current block (such as the predicted values ​​of the second region and / or the third region mentioned below).

[0106] For step 304, in some other embodiments, as shown in FIG11, it may include the following step 1101:

[0107] Step 1101: Perform a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the current block.

[0108] In some embodiments, the first weight of the first inter-frame prediction value and the first intra-frame prediction value of the first region as described in step 1001 or step 1101 may be a predefined value, and the first inter-frame prediction value and the first intra-frame prediction value of the first region may be weighted according to the first weight and the second weight.

[0109] In some embodiments, as shown in FIG12, the weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first region described in step 1001 or step 1101 may further include the following steps 1201 and 1202:

[0110] Step 1201: Based on the location information of the first sample in the first region, determine the first weight of the first inter-frame prediction value of the first sample and the second weight of the first intra-frame prediction value of the first sample.

[0111] It is understood that in the embodiments of this application, the first weight of the first inter-frame prediction value of the first sample and the second weight of the first intra-frame prediction value of the first sample are adapted to the position information of the first sample. This is beneficial to improving the accuracy of the prediction value of the first sample in the first region, thereby further enhancing the continuity between the first region and the first adjacent block in the reconstructed image, making the transition of image content between the first region and the first adjacent block more natural.

[0112] For step 1201, further, in some embodiments, it may include: determining a first distance relationship between the first sample and the first adjacent block based on the location information of the first sample; and determining the first weight and the second weight based on the first distance relationship.

[0113] For example, in some embodiments, the first weight is positively correlated with the first distance relationship, and the second weight is negatively correlated with the first distance relationship. That is, the closer the first sample is to the first adjacent block, the larger the first weight of the inter-frame prediction value and the smaller the second weight of the intra-frame prediction value; conversely, the farther the first sample is from the first adjacent block, the smaller the first weight of the inter-frame prediction value and the larger the second weight of the intra-frame prediction value. This is beneficial to improving the accuracy of the prediction value of the first sample in the first region, thereby further enhancing the continuity between the first region and the first adjacent block in the reconstructed image, making the transition of image content between the first region and the first adjacent block more natural.

[0114] In one possible implementation, determining the first weight and the second weight based on the first distance relationship includes: determining the first weight based on the first distance relationship, and the second weight being equal to 1 - the first weight; wherein the first distance relationship is positively correlated with the first weight.

[0115] In another possible implementation, determining the first weight and the second weight based on the first distance relationship includes: determining the second weight based on the first distance relationship, wherein the first weight is equal to 1 - the second weight; and wherein the first distance relationship is negatively correlated with the second weight.

[0116] Step 1202: Based on the first weight and the second weight, perform a weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first sample. For example, the weighted average result = w1(i)*predInterNb(i) + w2(i)*predIntraCur(i), where w1(i) is the first weight of the first inter-frame predicted value of the i-th sample, w2(i) is the second weight of the first intra-frame predicted value of the i-th sample, predInterNb(i) is the first inter-frame predicted value of the i-th sample, and predIntraCur(i) is the first intra-frame predicted value of the i-th sample; where the i-th sample is a sample in the first region, which can also be understood as the first sample.

[0117] In some embodiments, step 304, as shown in FIG13, may include the following steps 1301 to 1304:

[0118] Step 1301: Determine the second motion information corresponding to the inter-frame prediction mode of the second adjacent block of the current block;

[0119] Step 1302: Based on the second motion information, obtain the second inter-frame prediction value of the second region of the current block; wherein the second adjacent block is adjacent to the second region;

[0120] It can be understood that the second adjacent block and the first adjacent block are different blocks adjacent to the current block, and the second region and the first region are two different regions within the current block. For example, the first adjacent block is the upper adjacent block of the current block, and the first region is the upper region within the current block; the second adjacent block is the left adjacent block of the current block, and the second region is the left region within the current block; another example is that the first adjacent block and the second adjacent block are two different upper adjacent blocks of the current block, and the first region and the second region are two different upper regions within the current block, such as region 601 shown in Figure 6; yet another example is that the first adjacent block and the second adjacent block are two different left adjacent blocks of the current block, and the first region and the second region are two different left regions within the current block, such as region 602 shown in Figure 6.

[0121] Step 1303: Obtain the second intra-prediction value of the second region according to the intra-prediction mode of the current block;

[0122] Step 1304: Determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value.

[0123] It is understood that in some embodiments, the first region and the second region may constitute the entire region of the current block, and the predicted value of the current block can be determined through step 1304. Further, in some embodiments, step 1304 may include: averaging or weighting the first inter-frame predicted value and the first intra-frame predicted value of the first region to obtain the predicted value of the first region; averaging or weighting the second inter-frame predicted value and the second intra-frame predicted value of the second region to obtain the predicted value of the second region; and obtaining the predicted value of the current block based on the predicted values ​​of the first region and the second region. For example, the predicted value of the current block includes the predicted value of the first region and the predicted value of the second region. Alternatively, in other embodiments, step 1304 may include: averaging or weighting the first inter-frame predicted value and the first intra-frame predicted value of the first region, and averaging or weighting the first inter-frame predicted value and the first intra-frame predicted value of the first region to obtain the predicted value of the current block.

[0124] It is understood that in some embodiments, the first region and the second region may constitute part of the current block, that is, there is also a third region in the current block, which is another region in the current block that is different from the first region and the second region. In some embodiments, step 1304 includes: obtaining a third intra-frame prediction value of the third region of the current block according to the intra-frame prediction mode of the current block; determining the prediction value of the current block according to the first inter-frame prediction value and the first intra-frame prediction value, the second inter-frame prediction value and the second intra-frame prediction value, and the third intra-frame prediction value.

[0125] Further, in some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, the second inter-frame prediction value and the second intra-frame prediction value, and the third intra-frame prediction value includes: averaging or weighting the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the first region; averaging or weighting the second inter-frame prediction value and the second intra-frame prediction value of the second region to obtain the prediction value of the second region; and obtaining the prediction value of the current block based on the prediction value of the first region, the prediction value of the second region, and the third intra-frame prediction value. For example, the prediction value of the current block includes the prediction value of the first region, the prediction value of the second region, and the third intra-frame prediction value of the third region.

[0126] Alternatively, in other embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, the second inter-frame prediction value and the second intra-frame prediction value, and the third intra-frame prediction value includes: averaging or weighting the first inter-frame prediction value and the first intra-frame prediction value of the first region, averaging or weighting the second inter-frame prediction value and the second intra-frame prediction value of the second region, and obtaining the prediction value of the current block based on the third intra-frame prediction value.

[0127] In some embodiments, the weighted average of the second inter-frame predicted value and the second intra-frame predicted value of the second region includes: determining a third weight and a fourth weight of the second inter-frame predicted value of the second sample based on the location information of the second sample in the second region; and performing a weighted average of the second inter-frame predicted value and the second intra-frame predicted value of the second sample based on the third weight and the fourth weight.

[0128] Further, in some embodiments, determining the third weight of the second inter-frame prediction value of the second sample and the fourth weight of the second intra-frame prediction value of the second sample based on the location information of the second sample in the second region includes: determining the second distance relationship between the second sample and the second neighboring block based on the location information of the second sample; and determining the third weight and the fourth weight based on the second distance relationship.

[0129] For example, in some embodiments, the third weight is positively correlated with the second distance relationship, and the fourth weight is negatively correlated with the second distance relationship.

[0130] It is understandable that the methods for determining the third and fourth weights are similar to those for determining the first and second weights mentioned earlier. Therefore, for details regarding the determination of the third and fourth weights that are not described, please refer to the methods for determining the first and second weights for comprehension.

[0131] In the embodiments of this application, the decoder can automatically execute the decoding method. For example, in some embodiments, the decoding method further includes: executing the decoding method when the prediction mode of the first adjacent block of the current block is an inter-frame prediction mode and the prediction mode of the current block is an intra-frame prediction mode.

[0132] In the embodiments of this application, the decoder may also determine whether to execute the decoding method based on the indication of the bitstream. For example, in some other embodiments, the decoding method further includes: decoding the bitstream, determining the value of the third syntax element; and executing the decoding method if the value of the third syntax element is equal to a first value.

[0133] Furthermore, in some embodiments, the decoding of the bitstream to determine the value of the third syntax element includes: decoding the bitstream to determine the value of the third syntax element when the prediction mode of the first adjacent block of the current block is an inter-frame prediction mode and the prediction mode of the current block is an intra-frame prediction mode.

[0134] In some embodiments, the decoding method further includes: decoding the bitstream, determining the residual value of the current block, and determining the reconstructed value of the current block based on the residual value of the current block and the predicted value of the current block.

[0135] This application embodiment provides another encoding method. Figure 14 is a schematic diagram of the implementation flow of the encoding method provided in this application embodiment; as shown in Figure 14, it includes the following steps 1401 to 1404:

[0136] Step 1401: Determine the first motion information corresponding to the inter-frame prediction mode of the first adjacent block of the current block;

[0137] Step 1402: Based on the first motion information, obtain the first inter-frame prediction value of the first region of the current block; wherein the first adjacent block is adjacent to the first region.

[0138] Step 1403: Obtain the first intra-prediction value of the first region according to the intra-prediction mode of the current block;

[0139] Step 1404: Determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0140] It is understandable that for the first region in the current block that is adjacent to the first adjacent block, not only is the first inter-frame prediction value of the first region determined based on the first motion information, but also the first intra-frame prediction value of the first region is determined based on the intra-frame prediction mode of the current block. In this way, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region is beneficial to improving the accuracy of the prediction value of the first region of the current block, thereby helping to save bitstream overhead at the encoding end.

[0141] It should be noted that the explanation and further implementation of step 1401 can be understood by referring to the explanation and further implementation of step 301 above. The explanation and further implementation of step 1402 can be understood by referring to the explanation and further implementation of step 302 above. The explanation and further implementation of step 1403 can be understood by referring to the explanation and further implementation of step 303 above. The explanation and further implementation of step 1404 can be understood by referring to the explanation and further implementation of step 304 above. In other words, the methods used by the encoding end and the decoding end to determine the predicted value of the current block are the same. Therefore, the description of the method embodiment for the encoding end is similar to that of the method embodiment for the decoding end described above. For technical details not disclosed in the encoding method embodiments of this application, please refer to the description of the decoding method embodiments of this application for understanding.

[0142] In some embodiments, the encoding method further includes: determining the size of the first region, and determining the value of a first syntax element based on the size of the first region; and generating a bitstream based on the value of the first syntax element.

[0143] Furthermore, in some embodiments, generating a bitstream based on the value of the first syntax element includes: determining the maximum value of the first syntax element based on the size of the current block; and generating a bitstream based on the maximum value of the first syntax element and the value of the first syntax element.

[0144] For example, in some embodiments, if the size of the current block is N, then the maximum value of the first syntax element is equal to log2N-1.

[0145] For example, in some embodiments, generating a bitstream based on the maximum value of the first syntax element and the value of the first syntax element includes: binarizing the value of the first syntax element based on the maximum value of the first syntax element to obtain a first string; and writing the first string into the bitstream; wherein the first string is a binary string.

[0146] For example, the correspondence between the value of the first syntax element and the size of the first region is shown in Table 8 below:

[0147] Table 8

[0148] log₂N⁻¹ can be used as a parameter in the binarization process of the first syntax element, or in other words, N can be used as a parameter in the binarization process of the first syntax element. When N equals 8, i.e., log₂N⁻¹ equals 2, the correspondence between the binary symbol string and the syntax element value is shown in Table 9 below:

[0149] Table 9

[0150] When N equals 16, i.e., log₂N-1 equals 3, the correspondence between the binary symbol string and the syntax element value is shown in Table 10 below:

[0151] Table 10

[0152] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0153] Regarding the determination of the size of the first region, in some embodiments, the encoder can determine the predicted value of the current block based on each candidate size of the first region using steps 1401 to 1404. Based on the predicted value of the current block corresponding to each candidate size of the first region, the encoder calculates the encoding cost for the current block, determines the cost result corresponding to each candidate size, and determines the minimum cost result. The candidate size corresponding to the minimum cost result is then determined as the size of the first region, and the value of the first syntax element is determined based on the size of the first region. In the embodiments of this application, the encoding cost calculation can be determined based on the cost result of Rate Distortion Optimization (RDO), the cost result of Sum of Absolute Difference (SAD), or even the cost result of Sum of Absolute Transformed Difference (SATD), but this application does not impose any limitations on this.

[0154] In other embodiments, the encoding method further includes: determining the size of the first region; determining the value of a second syntax element based on the size of the first region and the size of the current block; and generating a bitstream based on the value of the second syntax element. Further, in some embodiments, the second syntax element is used to indicate the relationship between the size of the first region and the size of the current block; exemplaryly, in some embodiments, the second syntax element is used to indicate the proportional relationship between the size of the first region and the size of the current block.

[0155] For example, the correspondence between the size of the second syntax element and the size of the first region is shown in Table 11 below. The size of the first region needs to be determined based on the value of the current block size N.

[0156] Table 11

[0157] Since there are four possible sizes for the first region, the correspondence between the binary symbol string and the second syntax element value is shown in Table 12 below:

[0158] Table 12

[0159] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0160] Similarly, to determine the relationship between the size of the first region and the size of the current block, the size of the first region can be determined first. In some embodiments, the encoder can determine the candidate size of the corresponding first region based on multiple candidate relationships and the size of the current block. Based on this, steps 1401 to 1404 are used to determine the predicted value of the current block. According to the predicted value of the current block corresponding to each candidate size of the first region, the encoding cost of the current block is calculated, the cost result corresponding to each candidate size is determined, and the minimum cost result is determined. The candidate size corresponding to the minimum cost result is determined as the size of the first region. According to the relationship between the size of the first region and the size of the current block, the value of the second syntax element is determined. In the embodiments of this application, the encoding cost calculation here can be determined based on the cost result of Rate Distortion Optimization (RDO), or it can be determined based on the cost result of Sum of Absolute Difference (SAD), or even based on the cost result of Sum of Absolute Transformed Difference (SATD), but this application does not limit it in any way.

[0161] In some other embodiments, the encoding method further includes: determining the size of the first region based on the size of the current block.

[0162] For example, in some embodiments, determining the size of the first region based on the size of the current block includes: determining the size of the first region based on the size of the current block and a preset proportional relationship. For example, the preset proportional relationship is 1 / 4, 1 / 2, 3 / 4, or 1, etc. For example, in other embodiments, determining the size of the first region based on the size of the current block includes: determining the size of the first region based on the size of the current block and a preset first mapping relationship; wherein, the preset first mapping relationship refers to the correspondence between the size of the current block and the size of the first region.

[0163] In the embodiments of this application, the encoder can automatically execute the encoding method. For example, in some embodiments, the encoding method is executed when the prediction mode of the first adjacent block of the current block is the inter-frame prediction mode and the prediction mode of the current block is the intra-frame prediction mode.

[0164] In some embodiments, the encoding method further includes: determining the value of a third syntax element; and generating a bitstream based on the value of the third syntax element.

[0165] Further, in some embodiments, determining the value of the third syntax element includes: determining the value of the third syntax element when the prediction mode of the first adjacent block of the current block is inter-frame prediction mode and the prediction mode of the current block is intra-frame prediction mode.

[0166] In this embodiment, the encoder can also determine whether to use the encoding method by calculating the encoding costs corresponding to using the encoding method and not using the encoding method. If the encoding cost corresponding to the current block is less than the encoding cost obtained by not using the encoding method when the encoding method is used, then the value of the third syntax element is equal to the first value, that is, the first value is used to instruct the decoding end to use the decoding method described in this embodiment.

[0167] In some embodiments, the encoding method further includes: determining the residual value of the current block based on the predicted value of the current block and the sample value of the current block; and generating a bitstream based on the residual value of the current block.

[0168] In some embodiments, the encoding method further includes: decoding the bitstream, determining the residual value of the current block, and determining the reconstructed value of the current block based on the residual value of the current block and the predicted value of the current block.

[0169] The following examples illustrate possible implementation schemes of the encoding and decoding methods described in one or more of the above embodiments.

[0170] First, OBMC can be used in blocks predicted intra-frame.

[0171] For the current block, intra-frame prediction is performed according to the intra-frame prediction mode of the current block to obtain the predicted value predIntraCur, as shown in Figure 15. For the left region 1501 or the upper region 1502 within the current block 1500, additional inter-frame prediction is performed based on the motion information of adjacent blocks to obtain the predicted value predInterNb. The final predicted value for the left region 1501 or the upper region 1502 within the current block is obtained by weighting predIntraCur and predInterNb. That is, PredOBMC = w * predIntraCur + (1-w) * predInterNb.

[0172] The biggest difference from related technologies is that the current block uses intra-frame prediction mode.

[0173] During weighting, to ensure continuity in the transition between regions using OBMC and those not using OBMC, the weights can be adjusted based on the sample's position. Basically, samples closer to the edge (predInterNb) have a larger weight, and samples closer to the block interior (predIntraCur) have a larger weight. For example, OBMC weighting can be performed on the top four rows and the leftmost column. The weight (w) in the top left first row, first column is 1 / 8, in the top left second row, second column is 3 / 8, in the top left third row, third column is 5 / 8, and in the top left fourth row, fourth column is 7 / 8.

[0174] The motion information of the upper region within the current block can come from the adjacent blocks of the upper region, and the motion information of the left region within the current block can come from the adjacent blocks of the left region. Let the coordinates of the upper left corner of the current block be (x, y). One method to locate the adjacent blocks of the upper region is to determine the block containing (x, y-1), and another method to locate the adjacent blocks of the left region is to determine the block containing (x-1, y).

[0175] In this embodiment, the granularity of OBMC is not limited to using the same motion information for the left and upper regions within the current block. It can also be done at a smaller granularity, such as dividing the left and upper regions within the current block into several 4x4 blocks, each of which can take motion information from adjacent blocks and perform inter-frame prediction independently.

[0176] If the adjacent blocks in the left region of the current block are not using inter-frame prediction mode, then the left region may not implement OBMC. If the adjacent blocks in the upper region of the current block are not using inter-frame prediction mode, then the upper region may not implement OBMC.

[0177] In some embodiments, the application conditions of the method provided in this application are that the prediction mode of the current block is the intra-frame prediction mode and the prediction mode of the adjacent blocks of the current block is the inter-frame prediction mode.

[0178] In some embodiments, the current block will automatically perform OBMC as long as the above conditions are met, without requiring an instruction.

[0179] In some embodiments, if the above conditions are met, a syntax element (flag) is needed to indicate whether the current block performs OBMC. At the decoding end, the decoder determines that the prediction mode of the current block is intra-prediction mode, and at least one neighboring block's prediction mode is inter-prediction mode. An example of a neighboring block is a block containing (x, y-1) and a block containing (x-1, y). Of course, there can also be a larger set of neighboring blocks, including blocks determined by multiple positions. When the above conditions are met, the decoder needs to parse a flag, for example, called `intra_obmc_flag`. If the value of this flag is the first value, then the current block performs the above OBMC operation; if the value of this flag is the second value, then the current block does not perform the above OBMC operation.

[0180] In some embodiments, a variable OBMC implementation scope may be adopted:

[0181] If the current block performs an OBMC operation, there are several options for the scope of the OBMC implementation. Specifically, in the example above, the OBMC can be implemented on the top four rows and the left four columns of the current block. In this embodiment, when the intra-predicted block uses OBMC, several options can be provided, such as setting a variable OBMCSize, which refers to the size of the OBMC implementation, i.e., the size of the first or second region. Specifically, for the top region of the current block, OBMCSize refers to the height of the OBMC implementation, and for the left region of the current block, OBMCSize refers to the width of the OBMC implementation.

[0182] One possible approach is that OBMCSize can be chosen from a fixed set of numbers, such as 4, 8, 16, etc. For example, a 16x16 block has three choices: 4, 8, and 16. The specific number of choices for a block depends on its block size, i.e., its width or height. One possible approach is to denote the smaller of the width and height as N. If N is 4, then there is only 1 choice; if N is 8, then there are only 2 choices, and so on. Therefore, the number of selectable OBMCSizes is log₂N-1. A syntax element can be used to indicate which OBMCSize the current block uses. For example, this syntax element could be obmc_size_idx (i.e., the first or second syntax element). This syntax element can be encoded using truncated unary codes.

[0183] Specifically, the correspondence between obmc_size_idx and OBMCSize is shown in Table 13 below:

[0184] Table 13

[0185] log2N-1 can be used as a parameter in the binarization process of obmc_size_idx, or in other words, N can be used as a parameter in the binarization process of obmc_size_idx. When N equals 8, i.e., log2N-1 equals 2, the correspondence between the binary symbol string and the syntax element value is shown in Table 14 below:

[0186] Table 14

[0187] When N equals 16, i.e., log₂N-1 equals 3, the correspondence between the binary symbol string and the syntax element value is shown in Table 15 below:

[0188] Table 15

[0189] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0190] Another possible approach is to have a fixed number of selectable OBMCSize values, but the value of each OBMCSize is related to the size of the current block. For example, there could be four OBMCSize options, equal to N / 4, N / 2, 3N / 4, and N. A syntax element can be used to indicate which OBMCSize the current block uses. For example, this syntax element could be called `obmc_size_idx`. This syntax element can be encoded using truncated unary codes.

[0191] Specifically, the correspondence between obmc_size_idx and OBMCSize is shown in Table 16 below. The value of OBMCSize needs to be determined based on the value of N.

[0192] Table 16

[0193] Because there are four options for OBMCSize, the correspondence between the binary symbol string and the syntax element value is shown in Table 17 below:

[0194] Table 17

[0195] In VVC, the truncated Rice binarization (TR) is the same as the truncated unary code when cRicParam is 0.

[0196] In some embodiments, the codec can adaptively adjust the OBMC according to the intra-frame prediction mode:

[0197] If the intra-frame prediction mode uses a near-horizontal prediction mode, such as VVC's angle prediction mode 18 and several adjacent modes, the predicted value of the intra-frame prediction has strong continuity with the content adjacent to the left, but poor continuity with the content adjacent to the top. In this case, OBMC can be performed only on the top region of the current block, and not on the left region. If the intra-frame prediction mode uses a near-vertical prediction mode, such as VVC's angle prediction mode 50 and several adjacent modes, the predicted value of the intra-frame prediction has strong continuity with the content adjacent to the top, but poor continuity with the content adjacent to the left. In this case, OBMC can be performed only on the left region of the current block, and not on the top region. That is, the value of the intra-frame prediction mode can be used to determine which regions of the current block, the left and the top, need OBMC and which do not.

[0198] One embodiment is as follows: If the intra-prediction mode is one of intra-angle prediction modes 2 to 22, OBMC can be implemented in the upper region of the current block, while OBMC is not implemented in the left region of the current block. If the intra-prediction mode is one of intra-angle prediction modes 46 to 66, OBMC can be implemented in the left region of the current block, while OBMC is not implemented in the upper region of the current block.

[0199] The method provided in this application can solve the transition problem between adjacent blocks with and without reference image content, thereby improving compression efficiency.

[0200] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps; or steps from different embodiments may be combined into a new technical solution.

[0201] Based on the foregoing embodiments, this application provides a decoding device applied to a decoder. Figure 16 is a schematic diagram of the structure of the decoding device provided in this application. As shown in Figure 16, the decoding device 160 includes:

[0202] The first determining module 1601 is configured to determine the first motion information corresponding to the inter-frame prediction mode of the first adjacent block of the current block;

[0203] The first prediction module 1602 is configured to obtain a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first adjacent block is adjacent to the first region.

[0204] The second prediction module 1603 is configured to obtain the first intra-frame prediction value of the first region according to the intra-frame prediction mode of the current block.

[0205] The second determining module 1604 is configured to determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0206] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: determining the prediction value of the first region based on the first inter-frame prediction value and the first intra-frame prediction value of the first region; and determining the prediction value of the current block based on the prediction value of the first region.

[0207] Furthermore, in some embodiments, determining the prediction value of the first region based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: performing a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the first region.

[0208] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: performing a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the current block.

[0209] Further, in some embodiments, the weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first region includes: determining a first weight and a second weight of the first inter-frame predicted value of the first sample based on the location information of the first sample in the first region; and performing a weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first sample based on the first weight and the second weight.

[0210] Furthermore, in some embodiments, determining the first weight of the first inter-frame prediction value and the second weight of the first intra-frame prediction value of the first sample based on the location information of the first sample in the first region includes: determining the first distance relationship between the first sample and the first adjacent block based on the location information of the first sample; and determining the first weight and the second weight based on the first distance relationship.

[0211] For example, in some embodiments, the first weight is positively correlated with the first distance relationship, and the second weight is negatively correlated with the first distance relationship.

[0212] In some embodiments, when the prediction mode of the first neighboring block of the current block is an inter-frame prediction mode and the prediction mode of the current block is an intra-frame prediction mode, the first determining module 1601, the first prediction module 1602, the second prediction module 1603, and the second determining module 1604 perform the configured steps.

[0213] In some embodiments, the decoding device 160 further includes a first decoding module, which is configured to decode the bitstream and determine the value of a third syntax element; when the value of the third syntax element is equal to a first numerical value, the first determining module 1601, the first predicting module 1602, the second predicting module 1603, and the second determining module 1604 perform the configured steps.

[0214] Furthermore, in some embodiments, the decoding of the bitstream to determine the value of the third syntax element includes: decoding the bitstream to determine the value of the third syntax element when the prediction mode of the first adjacent block of the current block is an inter-frame prediction mode and the prediction mode of the current block is an intra-frame prediction mode.

[0215] In some embodiments, the decoding device 160 further includes a second decoding module configured to decode the bitstream and determine the value of a first syntax element; the first syntax element is used to indicate the size of the first region.

[0216] In some embodiments, decoding the bitstream to determine the value of the first syntax element includes: determining the maximum value of the first syntax element based on the size of the current block; and decoding the bitstream based on the maximum value of the first syntax element to obtain the value of the first syntax element.

[0217] In other embodiments, the decoding device 160 further includes a third decoding module and a third determining module, wherein the third decoding module is configured to decode the bitstream and determine the value of the second syntax element; and the third determining module is configured to determine the size of the first region based on the size of the current block and the value of the second syntax element.

[0218] Furthermore, in some embodiments, the second syntax element is used to indicate the relationship between the size of the first region and the size of the current block.

[0219] In some other embodiments, the decoding device 160 further includes a fourth determining module configured to determine the size of the first region based on the size of the current block.

[0220] For example, in some embodiments, the dimensions of the first region are height or width.

[0221] For example, in some embodiments, the first region is an upper region, and the size of the first region is the height of the upper region; and / or, the first region is a left region, and the size of the first region is the width of the left region.

[0222] In some embodiments, when the intra-frame prediction mode of the current block is a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode, the first region is the upper region within the current block.

[0223] In some embodiments, when the intra-frame prediction mode of the current block is a vertical prediction mode or one of one or more prediction modes adjacent to the vertical prediction mode, the first region is the left region within the current block.

[0224] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: determining second motion information corresponding to the inter-frame prediction mode of the second neighboring block of the current block; obtaining a second inter-frame prediction value of the second region of the current block based on the second motion information; wherein the second neighboring block is adjacent to the second region; obtaining a second intra-frame prediction value of the second region based on the intra-frame prediction mode of the current block; and determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value.

[0225] Further, in some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value, includes: obtaining a third intra-frame prediction value of a third region of the current block based on the intra-frame prediction mode of the current block; and determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value, and the third intra-frame prediction value.

[0226] The description of the decoding device embodiments above is similar to the description of the encoding / decoding method embodiments above, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the encoding / decoding method embodiments of this application for understanding.

[0227] This application provides an encoding device applied to an encoder. Figure 17 is a schematic diagram of the structure of the encoding device provided in this application embodiment. As shown in Figure 17, the encoding device 170 includes:

[0228] The first determining module 1701 is configured to determine the first motion information corresponding to the inter-frame prediction mode of the first adjacent block of the current block;

[0229] The first prediction module 1702 is configured to obtain a first inter-frame prediction value of a first region of the current block based on the first motion information; wherein the first adjacent block is adjacent to the first region.

[0230] The second prediction module 1703 is configured to obtain the first intra-frame prediction value of the first region according to the intra-frame prediction mode of the current block.

[0231] The second determining module 1704 is configured to determine the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region.

[0232] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: determining the prediction value of the first region based on the first inter-frame prediction value and the first intra-frame prediction value of the first region; and determining the prediction value of the current block based on the prediction value of the first region.

[0233] Furthermore, in some embodiments, determining the prediction value of the first region based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: performing a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the first region.

[0234] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: performing a weighted average of the first inter-frame prediction value and the first intra-frame prediction value of the first region to obtain the prediction value of the current block.

[0235] Further, in some embodiments, the weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first region includes: determining a first weight and a second weight of the first inter-frame predicted value of the first sample based on the location information of the first sample in the first region; and performing a weighted average of the first inter-frame predicted value and the first intra-frame predicted value of the first sample based on the first weight and the second weight.

[0236] Furthermore, in some embodiments, determining the first weight of the first inter-frame prediction value and the second weight of the first intra-frame prediction value of the first sample based on the location information of the first sample in the first region includes: determining the first distance relationship between the first sample and the first adjacent block based on the location information of the first sample; and determining the first weight and the second weight based on the first distance relationship.

[0237] For example, in some embodiments, the first weight is positively correlated with the first distance relationship, and the second weight is negatively correlated with the first distance relationship.

[0238] In some embodiments, the encoding device 170 further includes a first encoding module, which is configured to determine the size of the first region, and determine the value of a first syntax element based on the size of the first region; and generate a bitstream based on the value of the first syntax element.

[0239] In some embodiments, generating a bitstream based on the value of the first syntax element includes: determining the maximum value of the first syntax element based on the size of the current block; and generating a bitstream based on the maximum value of the first syntax element and the value of the first syntax element.

[0240] In other embodiments, the encoding device 170 further includes a second encoding module configured to: determine the size of the first region; determine the value of a second syntax element based on the size of the first region and the size of the current block; and generate a bitstream based on the value of the second syntax element.

[0241] Furthermore, in some embodiments, the second syntax element is used to indicate the relationship between the size of the first region and the size of the current block.

[0242] In some other embodiments, the encoding device 170 further includes a fourth determining module configured to determine the size of the first region based on the size of the current block.

[0243] For example, in some embodiments, the dimensions of the first region are height or width.

[0244] For example, in some embodiments, the first region is an upper region, and the size of the first region is the height of the upper region; and / or, the first region is a left region, and the size of the first region is the width of the left region.

[0245] In some embodiments, when the intra-frame prediction mode of the current block is a horizontal prediction mode or one of one or more prediction modes adjacent to the horizontal prediction mode, the first region is the upper region within the current block.

[0246] In some embodiments, when the intra-frame prediction mode of the current block is a vertical prediction mode or one of one or more prediction modes adjacent to the vertical prediction mode, the first region is the left region within the current block.

[0247] In some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value of the first region includes: determining second motion information corresponding to the inter-frame prediction mode of the second neighboring block of the current block; obtaining a second inter-frame prediction value of the second region of the current block based on the second motion information; wherein the second neighboring block is adjacent to the second region; obtaining a second intra-frame prediction value of the second region based on the intra-frame prediction mode of the current block; and determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value.

[0248] Further, in some embodiments, determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value, includes: obtaining a third intra-frame prediction value of a third region of the current block based on the intra-frame prediction mode of the current block; and determining the prediction value of the current block based on the first inter-frame prediction value and the first intra-frame prediction value, as well as the second inter-frame prediction value and the second intra-frame prediction value, and the third intra-frame prediction value.

[0249] In some embodiments, when the prediction mode of the first neighboring block of the current block is an inter-frame prediction mode and the prediction mode of the current block is an intra-frame prediction mode, the first determining module 1701, the first prediction module 1702, the second prediction module 1703, and the second determining module 1704 perform the configured steps.

[0250] In some embodiments, the encoding device 170 further includes a third encoding module configured to determine the value of a third syntax element and generate a bitstream based on the value of the third syntax element.

[0251] Further, in some embodiments, determining the value of the third syntax element includes: determining the value of the third syntax element when the prediction mode of the first adjacent block of the current block is inter-frame prediction mode and the prediction mode of the current block is intra-frame prediction mode.

[0252] The description of the encoding device embodiments above is similar to the description of the encoding / decoding method and decoding device embodiments above, and has similar beneficial effects as the encoding / decoding method embodiments and decoding devices above. For technical details not disclosed in the device embodiments of this application, please refer to the description of the encoding / decoding method embodiments and decoding devices of this application for understanding.

[0253] It should be noted that the module division of the apparatus described in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical units, or have two or more units integrated into one unit. The integrated units can be implemented in hardware, as software functional units, or a combination of software and hardware.

[0254] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.

[0255] This application provides a decoder, and Figure 18 is a schematic diagram of the decoder provided in this application embodiment. As shown in Figure 18, the decoder 180 includes: a first communication interface 1801, a first memory 1802, and a first processor 1803; the various components are coupled together through a first bus system 1804. It can be understood that the first bus system 1804 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 1804 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the first bus system 1804 in Figure 18.

[0256] The first communication interface 1801 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0257] The first memory 1802 is used to store computer programs that can run on the first processor 1803;

[0258] The first processor 1803 is configured to execute the decoding method described in the embodiments of this application when running the computer program.

[0259] It is understood that the first memory 1802 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 1802 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0260] The first processor 1803 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 1803 or by instructions in software form. The first processor 1803 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 1802. The first processor 1803 reads the information in the first memory 1802 and completes the steps of the above method in conjunction with its hardware.

[0261] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0262] Alternatively, as another embodiment, the first processor 1803 is also configured to execute any of the aforementioned method embodiments on the decoder side when running the computer program.

[0263] This application provides an encoder. Figure 19 is a schematic diagram of the encoder provided in an embodiment of this application. As shown in Figure 19, the encoder 190 includes: a second communication interface 1901, a second memory 1902, and a second processor 1903; the components are coupled together through a second bus system 1904. It is understood that the second bus system 1904 is used to realize the connection and communication between these components. In addition to a data bus, the second bus system 1904 also includes a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as the second bus system 1904 in Figure 19.

[0264] The second communication interface 1901 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0265] The second memory 1902 is used to store computer programs that can run on the second processor 1903;

[0266] The second processor 1903 is used to execute the encoding method described in the embodiments of this application when running the computer program.

[0267] It is understood that the second memory 1902 has similar hardware functions to the first memory 1802, and the second processor 1903 has similar hardware functions to the first processor 1803; these will not be described in detail here.

[0268] This application provides an electronic device, including: a processor adapted to execute a computer program; and a computer-readable storage medium storing the computer program, which, when executed by the processor, implements the encoding and / or decoding methods described in this application. The electronic device can be various types of devices with video encoding and / or video decoding capabilities, such as mobile phones, tablets, laptops, personal computers, televisions, projection devices, or monitoring devices.

[0269] This application provides a computer-readable storage medium storing a computer program that, when executed, implements a method such as that on the encoder side or a method such as that on the decoder side.

[0270] This application provides a computer program product, including computer program instructions that cause a computer to execute the encoding or decoding method provided in this application.

[0271] This application provides a computer program that causes a computer to execute the encoding or decoding method provided in this application.

[0272] This application provides a bitstream generated based on the residual value between the predicted value of the current block and the sample value of the current block; wherein the predicted value of the current block is obtained by the encoding method described in this application.

[0273] In some embodiments, the bitstream is generated based on the values ​​of one or more of the syntax elements mentioned above.

[0274] It should be noted that the descriptions of the above-described codecs, devices, storage media, computer program products, computer programs, and bitstream embodiments are similar to the descriptions of the above-described method embodiments and have similar beneficial effects. For technical details not disclosed in the codec, storage media, and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0275] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.

[0276] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist simultaneously, and object B exists alone.

[0277] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0278] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.

[0279] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.

[0280] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.

[0281] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0282] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0283] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0284] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0285] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0286] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

A decoding method, the method is applied to a decoder, the method comprises: determining first motion information corresponding to an inter prediction mode of a first neighboring block of a current block; obtaining a first inter prediction value of a first region of the current block according to the first motion information; wherein the first neighboring block is adjacent to the first region; obtaining a first intra prediction value of the first region according to an intra prediction mode of the current block; determining a prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region. The method of claim 1, wherein, The determining a prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region comprises: determining a prediction value of the first region according to the first inter prediction value and the first intra prediction value of the first region; determining a prediction value of the current block according to the prediction value of the first region. The method of claim 2, wherein, The determining a prediction value of the first region according to the first inter prediction value and the first intra prediction value of the first region comprises: performing weighted average on the first inter prediction value and the first intra prediction value of the first region to obtain the prediction value of the first region. The method of claim 1, wherein, The determining a prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region comprises: performing weighted average on the first inter prediction value and the first intra prediction value of the first region to obtain the prediction value of the current block. The method according to claim 3 or 4, wherein The performing weighted average on the first inter prediction value and the first intra prediction value of the first region comprises: determining a first weight of the first inter prediction value and a second weight of the first intra prediction value of a first sample of the first region according to position information of the first sample; performing weighted average on the first inter prediction value and the first intra prediction value of the first sample according to the first weight and the second weight. The method of claim 5, wherein, The determining a first weight of the first inter prediction value and a second weight of the first intra prediction value of a first sample of the first region according to position information of the first sample comprises: determining a first distance relationship between the first sample and the first neighboring block according to the position information of the first sample; determining the first weight and the second weight according to the first distance relationship. The method of claim 6, wherein, The first weight is positively correlated with the first distance relationship, and the second weight is negatively correlated with the first distance relationship. The method of claim 1, wherein, The method further comprises: decoding a bitstream to determine a value of a first syntax element; the first syntax element is used to indicate a size of the first region. The method of claim 8, wherein, The decoding a bitstream to determine a value of a first syntax element comprises: determining a maximum value of the first syntax element according to a size of the current block; decoding a bitstream to obtain the value of the first syntax element according to the maximum value of the first syntax element. The method of claim 1, wherein, The method further comprises: decoding a bitstream to determine a value of a second syntax element, and determining the size of the first region according to the size of the current block and the value of the second syntax element. The method of claim 10, wherein, The second syntax element is used to indicate a relationship between the size of the first region and the size of the current block. The method of claim 1, wherein, The method further comprises: determining a size of the first region according to a size of the current block. The method of any one of claims 8-12, wherein, The size of the first region is a height or a width. The method of claim 13, wherein, The first region is an upper side region and the size of the first region is the height of the upper side region, and / or the first region is a left side region and the size of the first region is the width of the left side region. The method according to any one of claims 1-14, wherein in a case where the intra prediction mode of the current block is a horizontal direction prediction mode or one of one or more prediction modes adjacent to the horizontal direction prediction mode, the first region is an upper side region within the current block. The method according to any one of claims 1-14, wherein in a case where the intra prediction mode of the current block is a vertical direction prediction mode or one of one or more prediction modes adjacent to the vertical direction prediction mode, the first region is a left side region within the current block. The determining the prediction value of the current block according to the first inter prediction value of the first region and the first intra prediction value of the first region comprises: The method of any one of claims 1-14, wherein determining second motion information corresponding to an inter prediction mode of a second neighboring block of the current block; obtaining a second inter prediction value of a second region of the current block according to the second motion information; wherein the second neighboring block is adjacent to the second region; obtaining a second intra prediction value of the second region according to the intra prediction mode of the current block; determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value. The determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value comprises: The method of claim 17, wherein, obtaining a third intra prediction value of a third region of the current block according to the intra prediction mode of the current block; determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value, and the third intra prediction value. The method according to any one of claims 1-18, wherein in a case where the prediction mode of the first neighboring block of the current block is an inter prediction mode and the prediction mode of the current block is an intra prediction mode, the decoding method is performed. The method according to any one of claims 1-18, wherein decoding a code stream to determine a value of a third syntax element; in a case where the value of the third syntax element is equal to a first numerical value, the decoding method is performed. The decoding a code stream to determine a value of a third syntax element comprises: The method of claim 20, wherein, in a case where the prediction mode of the first neighboring block of the current block is an inter prediction mode and the prediction mode of the current block is an intra prediction mode, decoding a code stream to determine a value of a third syntax element. An encoding method, the method is applied to an encoder, the method comprises: determining first motion information corresponding to an inter prediction mode of a first neighboring block of a current block; ​ According to the first motion information, a first inter prediction value of a first region of the current block is obtained; wherein the first neighboring block is adjacent to the first region; According to an intra prediction mode of the current block, a first intra prediction value of the first region is obtained; According to the first inter prediction value and the first intra prediction value of the first region, a prediction value of the current block is determined. The method of claim 22, wherein, The step of determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region comprises: According to the first inter prediction value and the first intra prediction value of the first region, a prediction value of the first region is determined; According to the prediction value of the first region, a prediction value of the current block is determined. The method of claim 23, wherein, The step of determining the prediction value of the first region according to the first inter prediction value and the first intra prediction value of the first region comprises: The first inter prediction value and the first intra prediction value of the first region are weighted and averaged to obtain the prediction value of the first region. The method of claim 22, wherein, The step of determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region comprises: The first inter prediction value and the first intra prediction value of the first region are weighted and averaged to obtain the prediction value of the current block. The method of claim 24 or 25, wherein, The step of weighted and averaging the first inter prediction value and the first intra prediction value of the first region comprises: According to position information of a first sample of the first region, a first weight of the first inter prediction value of the first sample and a second weight of the first intra prediction value of the first sample are determined; The first inter prediction value and the first intra prediction value of the first sample are weighted and averaged according to the first weight and the second weight. The method of claim 26, wherein, The step of determining the first weight of the first inter prediction value of the first sample and the second weight of the first intra prediction value of the first sample according to the position information of the first sample of the first region comprises: According to the position information of the first sample, a first distance relationship between the first sample and the first neighboring block is determined; According to the first distance relationship, the first weight and the second weight are determined. The first weight is positively correlated with the first distance relationship, and the second weight is negatively correlated with the first distance relationship. The method of claim 27, wherein, The method further comprises: The method of claim 22, wherein, The size of the first region is determined, and a value of a first syntax element is determined according to the size of the first region; According to the value of the first syntax element, a code stream is generated. The step of generating the code stream according to the value of the first syntax element comprises: The method of claim 29, wherein, According to the size of the current block, a maximum value of the first syntax element is determined; According to the maximum value of the first syntax element and the value of the first syntax element, the code stream is generated. The method further comprises: The method of claim 22, wherein, The size of the first region is determined, a value of a second syntax element is determined according to the size of the first region and the size of the current block, and a code stream is generated according to the value of the second syntax element. The second syntax element is used to indicate the relationship between the size of the first region and the size of the current block. The method of claim 31, wherein, The method further comprises: The method of claim 22, wherein, According to the size of the current block, the size of the first region is determined. ​ The method of any one of claims 29-33, wherein The size of the first region is a height or a width. The method of claim 34, wherein, The first region is an upper region, and the size of the first region is a height of the upper region, and / or the first region is a left region, and the size of the first region is a width of the left region. The method according to any one of claims 22-35, wherein, In a case where the intra prediction mode of the current block is a horizontal direction prediction mode or one of one or more prediction modes adjacent to the horizontal direction prediction mode, the first region is an upper region within the current block. The method according to any one of claims 22-35, wherein, In a case where the intra prediction mode of the current block is a vertical direction prediction mode or one of one or more prediction modes adjacent to the vertical direction prediction mode, the first region is a left region within the current block. The method of any one of claims 22-35, wherein, The determining the prediction value of the current block according to the first inter prediction value of the first region and the first intra prediction value comprises: determining second motion information corresponding to an inter prediction mode of a second neighboring block of the current block; obtaining a second inter prediction value of a second region of the current block according to the second motion information; wherein the second neighboring block is adjacent to the second region; obtaining a second intra prediction value of the second region according to the intra prediction mode of the current block; determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value. The method of claim 38, wherein, The determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value comprises: obtaining a third intra prediction value of a third region of the current block according to the intra prediction mode of the current block; determining the prediction value of the current block according to the first inter prediction value and the first intra prediction value, and the second inter prediction value and the second intra prediction value, and the third intra prediction value. The method according to any one of claims 22-39, wherein, In a case where the prediction mode of the first neighboring block of the current block is an inter prediction mode and the prediction mode of the current block is an intra prediction mode, the encoding method is performed. The method of any one of claims 22-39, wherein, The method further comprises: determining a value of a third syntax element; generating a bitstream according to the value of the third syntax element. The method of claim 41, wherein, The determining the value of the third syntax element comprises: In a case where the prediction mode of the first neighboring block of the current block is an inter-prediction mode and the prediction mode of the current block is an intra-prediction mode, determining a value of a third syntax element. A decoding apparatus applied to a decoder, the apparatus comprising: a first determining module configured to determine first motion information corresponding to an inter prediction mode of a first neighboring block of a current block; a first prediction module configured to obtain a first inter prediction value of a first region of the current block according to the first motion information; wherein the first neighboring block is adjacent to the first region; The second prediction module is configured to obtain a first intra prediction value of the first region according to an intra prediction mode of the current block. The second determination module is configured to determine a prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region. A decoder comprises a first memory and a first processor; wherein, The first memory is configured to store a computer program capable of running on the first processor. The first processor is configured to execute the method according to any one of claims 1 to 21 when running the computer program. An encoding apparatus applied to an encoder, the apparatus comprising: The first determination module is configured to determine first motion information corresponding to an inter prediction mode of a first neighboring block of a current block. The first prediction module is configured to obtain a first inter prediction value of a first region of the current block according to the first motion information; wherein the first neighboring block is adjacent to the first region. The second prediction module is configured to obtain a first intra prediction value of the first region according to an intra prediction mode of the current block. The second determination module is configured to determine a prediction value of the current block according to the first inter prediction value and the first intra prediction value of the first region. An encoder comprises a second memory and a second processor; wherein, The second memory is configured to store a computer program capable of running on the second processor. The second processor is configured to execute the method according to any one of claims 22 to 42 when running the computer program. A code stream, the code stream being generated according to residual values between a prediction value of a current block and sample values of the current block; wherein, The prediction value of the current block is obtained by the method according to any one of claims 22 to 42. An electronic device comprising: A processor adapted to execute a computer program; A computer readable storage medium having a computer program stored therein, the computer program, when executed by the processor, implements the method according to any one of claims 1 to 21, or the computer program, when executed by the processor, implements the method according to any one of claims 22 to 42. A computer-readable storage medium, wherein, The computer readable storage medium stores a computer program, which, when executed, implements the method according to any one of claims 1 to 21, or implements the method according to any one of claims 22 to 42. A computer program product comprising a computer program or instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 21, or, which, when executed by a processor, implement the steps of the method according to any one of claims 22 to 42.