Image encoding and decoding method and apparatus, and storage medium
The image encoding and decoding method addresses inefficiencies in video data processing by directly determining prediction modes and employing skip residual coding, resulting in reduced overhead and improved efficiency in video data handling.
Patent Information
- Application Number
- JP2025203857
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-01-07
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-01-05
AI Technical Summary
Existing video coding techniques face challenges in efficiently encoding and decoding video data due to redundant information, leading to high data volume and bandwidth consumption.
An image encoding and decoding method that directly determines target prediction modes from an index table, reduces decoding complexity by omitting flag bits, and employs truncated unary coding and binary tree generation for prediction mode indices, allowing parallel prediction of pixel groups and skip residual coding to minimize bitstream overhead.
This approach enhances encoding and decoding efficiency by reducing bitstream transmission overhead and decoding complexity, improving parallelism and throughput in video data processing.
Smart Images

Figure 2026020319000001_ABST
Abstract
Description
[Technical Field]
[0001] The present invention relates to the technical field of image encoding and decoding, and in particular to an image encoding and decoding method, apparatus, and storage medium. [Background technology]
[0002] A complete image in a video is usually called a "frame," and a video consisting of multiple frames arranged in time series is called a video sequence. A video sequence contains a series of redundant information, such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. To eliminate redundant information in a video sequence as much as possible and reduce the amount of data required to represent the video, video coding techniques have been proposed, which reduce storage space and save transmission bandwidth. Video coding techniques may also be called video compression techniques.
[0003] With the continuous development of technology, the collection of video data becomes more and more convenient, and the scale of the collected video data becomes larger and larger, so how to effectively encode and decode video data becomes an urgent issue. Summary of the Invention
[0004] The present invention provides an image encoding and decoding method, apparatus, and storage medium for effectively encoding and decoding video data to improve encoding and decoding efficiency. To achieve the above objectives, the present invention employs the following technical solutions:
[0005] According to a first aspect, there is provided an image decoding method including the steps of: parsing a bitstream to obtain a first syntax element, where the first syntax element includes an index of a target prediction mode of a unit to be decoded; determining a target prediction mode from an index table based on the index of the target prediction mode, where the index table includes a correspondence relationship between a plurality of prediction mode indexes and the plurality of prediction modes; and reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode. In this technical solution, the target prediction mode can be directly determined from the index table based on the index of the target prediction mode, and there is no need to analyze the flag bit org_flag, thereby reducing the decoding complexity and improving the decoding efficiency.
[0006] In one possible embodiment, the indices of the multiple prediction modes are generated in a truncated unary coding manner, which helps to further reduce the bitstream transmission overhead.
[0007] In one possible embodiment, the indices for the multiple prediction modes are generated in a binary tree fashion.
[0008] In one possible embodiment, the multiple prediction modes include an original value mode and other prediction modes, and the codeword length of the index of the original value mode is equal to or greater than the codeword length of the index of one or more of the other prediction modes. Because some other prediction modes are used more frequently than the original value mode, setting the codeword length of the index to be shorter helps to further reduce the transmission overhead of the bitstream.
[0009] In one possible embodiment, the plurality of prediction modes includes an original value mode and another prediction mode, the other prediction mode including at least one of a point prediction mode, an intra-frame prediction mode, or a block copy mode.
[0010] In one possible embodiment, the plurality of prediction modes include an original value mode, a point prediction mode, an intra-frame prediction mode, and an intra-frame block copy mode, and when the indices of the plurality of prediction modes are generated in a binary tree manner, a generation rule for the indices of the plurality of prediction modes includes using 1 as the most significant flag bit of the indices of the original value mode and the intra-frame prediction mode, using 1, 011, 010, 0011, 0010, 00001, 00000 as the remaining flag bits of the different intra-frame prediction modes, respectively, and using 0001 as the remaining flag bits of the original value mode.
[0011] In one possible embodiment, a second syntax element is also obtained by parsing the bitstream, and the second syntax element includes an index of a residual coding mode of the unit to be decoded. Correspondingly, the step of reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode includes: predicting the unit to be decoded to obtain a prediction block and determining the prediction block of the unit to be decoded as a reconstructed block of the unit to be decoded when the index of the residual coding mode is used to indicate a skip residual coding mode; and analyzing residual quantization-related values of the unit to be decoded to obtain a residual block and reconstructing the unit to be decoded to obtain a reconstructed block based on the target prediction mode and the residual block of the unit to be decoded when the index of the residual coding mode is used to indicate a normal residual coding mode.
[0012] In one possible embodiment, the other prediction modes include at least one of a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, a block copy mode based on normal residual coding, a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, or a block copy mode based on skip residual coding.
[0013] In one possible embodiment, the step of reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode includes the steps of: determining a predicted block of the unit to be decoded as a reconstructed block of the unit to be decoded when the target prediction mode is a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, or a block copy mode based on skip residual coding; and analyzing residual quantization-related values of the unit to be decoded to obtain a residual block of the unit to be decoded when the target prediction mode is a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding; and reconstructing the unit to be decoded based on the target prediction mode and the residual block of the unit to be decoded to obtain a reconstructed block of the unit to be decoded.
[0014] In one possible embodiment, the pixels of each row of the unit to be decoded are grouped into one prediction group, and the residual block of the prediction group is divided into at least one residual sub-block.
[0015] In one possible embodiment, dividing a residual block of a prediction group into a plurality of residual sub-blocks includes dividing a residual block of one prediction group into two residual sub-blocks in a 1:1 ratio, or dividing a residual block of one prediction group into three residual sub-blocks in a 2:1:1 ratio, or dividing a residual block of one prediction group into three residual sub-blocks in a 1:1:2 ratio, or dividing a residual block of one prediction group into four residual sub-blocks in a 1:1:1:1 ratio.
[0016] In one possible embodiment, the unit to be decoded includes at least one prediction group, where any of the at least one prediction group includes multiple consecutive pixels in the same row / column, any of the prediction groups includes a first designated pixel region and a second designated pixel region, the first designated pixel region includes multiple pixel groups, the multiple pixel groups are obtained by dividing based on the second designated pixel region, the prediction methods of the first designated pixel region and the second designated pixel region are different, the multiple pixel groups can be predicted in parallel, and the pixel group includes one or multiple consecutive pixels.
[0017] In one possible embodiment, if any prediction group contains multiple consecutive pixels in the same row, vertical prediction is used for the first designated pixel region, and horizontal prediction or vertical average prediction is used for the second designated pixel region.
[0018] In one possible embodiment, if any prediction group contains multiple consecutive pixels in the same column, horizontal prediction is used for the first designated pixel region, and vertical prediction or horizontal average prediction is used for the second designated pixel region.
[0019] In one possible embodiment, the difference in the number of pixels contained in the different pixel groups is less than or equal to a threshold value.
[0020] In one possible embodiment, if there is no reference block in the unit to be decoded, the reconstructed value of the first pixel in the unit to be decoded is the value obtained by shifting the bit width of the unit to be decoded by one bit to the left.
[0021] In one possible embodiment, the unit to be decoded includes at least one prediction group, and any one of the at least one prediction group includes a plurality of consecutive pixels, and the step of reconstructing the unit to be decoded to obtain a reconstructed block based on at least a target prediction mode includes, if the target prediction mode satisfies a predetermined condition, determining a reconstructed value of the target pixel based on a reference value of a first pixel among the plurality of consecutive pixels and residual values of each of two adjacent pixels between the first pixel and the target pixel, wherein the target pixel is any one of the non-first pixels among the plurality of consecutive pixels, and the reconstructed block of the unit to be decoded includes the reconstructed value of the target pixel.
[0022] In one possible embodiment, a first prediction method is used for the initial pixel and a second prediction method is used for the non-initial pixels, the target prediction mode includes the first prediction method and the second prediction method, and the target prediction mode satisfying a predetermined condition includes that the first prediction method and the second prediction method are both horizontal prediction, or that the first prediction method and the second prediction method are both vertical prediction, or that one of the first prediction method and the second prediction method is horizontal prediction and the other is vertical prediction, or that the first prediction method is a method of performing reference prediction using pixel values of a decoding unit adjacent to the unit to be decoded or pixel values of an independent decoding unit adjacent to the independent decoding unit in which the unit to be decoded is located, and the second prediction method is horizontal prediction or vertical prediction.
[0023] According to a second aspect, there is provided an image encoding method including the steps of: determining a target prediction mode of a unit to be encoded; determining an index of the target prediction mode from an index table based on the target prediction mode, the index table including correspondence relationships between indexes of a plurality of prediction modes and the plurality of prediction modes; and encoding the index of the target prediction mode into a bitstream. In this technical solution, the index of the target prediction mode is directly determined from the index table based on the target prediction mode, and there is no need to encode an index (e.g., a flag bit org_flag) indicating whether the target prediction mode is an original value mode into the bitstream. In most cases, the original value mode is not used, and for example, a point prediction mode or an intra-frame prediction mode is usually used. Therefore, there is no need to encode a flag bit (org_flag) indicating whether the original value mode is used, which helps to save bitstream transmission overhead and improves encoding efficiency.
[0024] In one possible embodiment, the indices of the multiple prediction modes are generated in a truncated unary coding manner.
[0025] In one possible embodiment, the indices for the multiple prediction modes are generated in a binary tree fashion.
[0026] In one possible embodiment, the multiple prediction modes include an original value mode and other prediction modes, and the codeword length of the index of the original value mode is greater than or equal to the codeword length of the index of one or more of the other prediction modes.
[0027] In one possible embodiment, the other prediction modes include at least one of a point prediction mode, an intra-frame prediction mode, or a block copy mode.
[0028] In one possible embodiment, the other prediction modes include at least one of a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, a block copy mode based on normal residual coding, a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, or a block copy mode based on skip residual coding.
[0029] According to a third aspect, there is provided an image reconstruction method applicable to both image encoding and decoding methods, the image reconstruction method including: determining a residual coding mode of a current image block; if the residual coding mode is a skip residual coding mode, predicting the current image block to obtain a predicted block and determining the predicted block as a reconstructed block of the current image block; if the residual coding mode is a normal residual coding mode, obtaining residual quantization-related values of the current image block to obtain a residual block, and reconstructing the current image block based on the residual block to obtain a reconstructed block of the current image block.
[0030] In this technical solution, first, a residual coding mode is determined, and if the residual coding mode is a normal residual coding mode, the residual quantization-related values of the current image block are obtained, and if the residual coding mode is a skip residual coding mode, there is no need to obtain the residual quantization-related values of the current image block. In this way, if the residual coding mode is a normal residual coding mode, the encoding side does not need to encode the residual quantization-related values of the current image block into the bitstream, and the decoding side does not need to analyze the residual quantization-related values of the current image block, which is helpful in saving bitstream transmission overhead, improving coding efficiency, reducing decoding complexity, and improving decoding efficiency.
[0031] According to a fourth aspect, there is provided an image reconstruction method applicable to both image encoding and decoding, comprising: determining a target prediction mode of a current image block; if the target prediction mode is a prediction mode based on skip residual coding, predicting the current image block to obtain a prediction block and determining the prediction block as a reconstructed block; if the target prediction mode is a prediction mode based on normal residual coding, obtaining a residual quantization-related value of the current image block to obtain a residual block of the current image block, and reconstructing the current image block according to the target prediction mode and the residual block to obtain a reconstructed block.
[0032] In this technical solution, a conventional residual coding mode and a prediction mode are combined into a new prediction mode provided by an embodiment of the present invention, so that the residual coding mode and the prediction mode do not need to be coded (decoded) separately, and the new prediction mode can be coded (decoded) uniformly, which simplifies the implementation logic and helps save bitstream transmission overhead. Furthermore, the coding side (or decoding side) can first code (or decode) residual coding mode information (e.g., a residual coding mode index, such as res_skip_flag), and then determine whether to code (or decode) a residual quantization-related value (e.g., a near value or a QP value) based on the residual coding mode. Therefore, when the residual coding mode is a skip residual coding mode, there is no need to code (or decode) the residual quantization-related value, which helps save bitstream transmission overhead.
[0033] In one possible embodiment, the prediction mode based on skip residual coding includes a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, or a block copy mode based on skip residual coding.
[0034] In one possible embodiment, the prediction mode based on normal residual coding includes a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding.
[0035] According to a fifth aspect, there is provided an image reconstruction method applicable to both image encoding and decoding methods. The image reconstruction method includes the steps of: determining a prediction mode of at least one prediction group into which a current image block is divided, where one prediction group of the at least one prediction group includes multiple consecutive pixels in the same row / column, and one prediction group includes a first designated pixel region and a second designated pixel region, the first designated pixel region includes multiple pixel groups, and the multiple pixel groups are obtained by dividing the current image block based on the second designated pixel region, where the prediction methods of the first designated pixel region and the second designated pixel region are different, and the multiple pixel groups can be predicted in parallel, and the pixel group includes one or multiple consecutive pixels; and reconstructing the current image block to obtain a reconstructed block based on the prediction mode of the at least one prediction group. This technical solution allows multiple pixel groups in one prediction group to be predicted in parallel, which helps to shorten the prediction time of the prediction group.
[0036] In one possible embodiment, if any prediction group contains multiple consecutive pixels in the same row, vertical prediction is used for the first designated pixel region, and horizontal prediction or vertical average prediction is used for the second designated pixel region.
[0037] In one possible embodiment, if any prediction group contains multiple consecutive pixels in the same column, horizontal prediction is used for the first designated pixel region, and vertical prediction or horizontal average prediction is used for the second designated pixel region.
[0038] In one possible embodiment, the difference in the number of pixels contained in the different pixel groups is less than or equal to a threshold value.
[0039] In one possible embodiment, if the current image block does not have a reference block, the reconstructed value of the first pixel of the current image block is the value obtained by shifting the bit width of the current image block one bit to the left.
[0040] In one possible embodiment, the current image block includes at least one prediction group, and any one of the at least one prediction group includes a plurality of consecutive pixels. The step of reconstructing the current image block to obtain a reconstructed block based on a prediction mode of the at least one prediction group includes, if a target prediction mode satisfies a predetermined condition, determining a reconstructed value of the target pixel based on a reference value of a first pixel among the consecutive pixels and residual values of each of two adjacent pixels between the first pixel and the target pixel, wherein the target pixel is a non-first pixel among any one of the consecutive pixels, and the reconstructed block of the current image block includes the reconstructed value of the target pixel.
[0041] According to a sixth aspect, there is provided an image reconstruction method applicable to both an image encoding method and an image decoding method, the image reconstruction method including: determining a target prediction mode of a current image block, the current image block including at least one prediction group, and any prediction group of the at least one prediction group including a plurality of consecutive pixels; and, if the target prediction mode satisfies a predetermined condition, determining a reconstructed value of a target pixel based on a reference value of a first pixel of the consecutive pixels and residual values of each of two adjacent pixels between the first pixel and the target pixel, the target pixel being any one of the consecutive pixels other than the first pixel, and the reconstructed block of the current image block including the reconstructed value of the target pixel.
[0042] In this technical solution, when the encoding side / decoding side performs reconstruction, it can directly obtain the reconstructed value of the current pixel based on the residual value between the previous pixel and its adjacent pixels, without having to wait for the reconstructed value of the previous pixel to be obtained. This technical solution can also greatly improve the parallelism of the reconstruction process, thereby improving the decoding parallelism and throughput.
[0043] In one possible embodiment, a first prediction method is used for the initial pixel and a second prediction method is used for the non-initial pixel, the target prediction mode includes a first prediction method and a second prediction method, and the target prediction mode satisfying a predetermined condition includes that the first prediction method and the second prediction method are both horizontal prediction, or that the first prediction method and the second prediction method are both vertical prediction, or that one of the first prediction method and the second prediction method is horizontal prediction and the other is vertical prediction, or that the first prediction method is a method of performing reference prediction using pixel values of a coding unit adjacent to the current image block or an independent coding unit adjacent to the independent coding unit in which the current image block is located, and the second prediction method is horizontal prediction or vertical prediction.
[0044] According to a seventh aspect, there is provided an image decoding apparatus, which may be a video decoder or a device including a video decoder. The decoding apparatus includes modules for implementing the method according to any one of possible embodiments of the first, third, fourth, or fifth aspects. The decoding apparatus has a function for implementing the operations in the above-mentioned related method examples. The functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The beneficial effects thereof are described in the description of the corresponding method, and therefore will not be described here.
[0045] According to an eighth aspect, there is provided an image encoding device, which may be a video encoder or a device including a video encoder. The encoding device includes modules for implementing the method according to any one of possible embodiments of the second, third, fourth, or fifth aspects. The encoding device has a function for implementing the operations of the above-mentioned related method examples. The function may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned functions. The beneficial effects thereof are described in the description of the corresponding method, and therefore will not be described here.
[0046] According to a ninth aspect, the present invention provides an electronic device including a processor and a memory, wherein the memory is used to store computer instructions, and the processor retrieves and executes the computer instructions from the memory, thereby implementing the method according to any one of the first to sixth aspects. For example, the electronic device may be a video encoder or a device including a video encoder. As another example, the electronic device may be a video decoder or a device including a video decoder.
[0047] According to a tenth aspect, the present invention provides a computer-readable storage medium storing a computer program or instructions which, when executed by a computing device or a storage system in which the computing device is located, causes a method according to any one of the embodiments of the first to sixth aspects to be implemented.
[0048] According to an eleventh aspect, the present invention provides a computer program product comprising instructions which, when executed on a computing device or processor, cause the computing device or processor to execute the instructions to perform a method according to any one of the first to sixth aspects.
[0049] According to a twelfth aspect, the present invention provides a chip including a processor and a memory, wherein the memory is used to store computer instructions, and the processor retrieves and executes the computer instructions from the memory, and is used to implement a method according to any one of the first to sixth aspects.
[0050] According to a thirteenth aspect, the present invention provides an image coding system including an encoding side and a decoding side, the decoding side being used to implement a corresponding decoding method provided by the first to sixth aspects, and the encoding side being used to implement a corresponding encoding method.
[0051] The present invention can provide more embodiments by further combining the embodiments provided by each of the above aspects. Alternatively, any one possible embodiment of any one of the above aspects may be applied to another aspect, provided there is no contradiction, thereby obtaining a new embodiment. For example, any one image reconstruction method provided by the third to fifth aspects above may be applied to any one encoding or decoding method provided by the first or second aspect. As another example, any two image reconstruction methods provided by the third to fifth aspects above may be combined, provided there is no contradiction, thereby obtaining a new reconstruction method. [Brief explanation of the drawings]
[0052] [Figure 1] 1 is a schematic diagram of multiple prediction schemes provided by an embodiment of the present invention; [Figure 2]1 is a schematic architecture diagram of an encoding and decoding system to which an embodiment of the present invention is applied; [Figure 3] FIG. 2 is an illustrative block diagram of an example encoder for implementing embodiments of the present invention; [Figure 4] 2 is a schematic diagram of the correspondence between images, parallel coding units, independent coding units, and coding units provided by an embodiment of the present invention; FIG. [Figure 5] FIG. 2 is a schematic diagram of an encoding process provided by an embodiment of the present invention; [Figure 6] FIG. 2 is an illustrative block diagram of an example decoder for implementing embodiments of the present invention; [Figure 7A] 1 is a schematic flowchart 1 of an image encoding method provided by an embodiment of the present invention; [Figure 7B] 7B is a schematic flowchart of an image decoding method corresponding to FIG. 7A provided by an embodiment of the present invention; [Figure 8A] 2 is a schematic flowchart 2 of an image encoding method provided by an embodiment of the present invention; [Figure 8B] 8B is a schematic flowchart of an image decoding method corresponding to FIG. 8A provided by an embodiment of the present invention; [Figure 9A] 3 is a schematic flowchart 3 of an image encoding method provided by an embodiment of the present invention. [Figure 9B] 9B is a schematic flowchart of an image decoding method corresponding to FIG. 9A provided by an embodiment of the present invention; [Figure 10] 1 is a schematic flowchart 1 of an image reconstruction method provided by an embodiment of the present invention. [Figure 11] FIG. 2 is a schematic diagram of a parallel pixel group division scheme provided by an embodiment of the present invention; [Figure 12] 1 is a schematic diagram of a prediction partitioning mode for a 16x2 current image block. [Figure 13A] FIG. 13 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 12, provided by an embodiment of the present invention; [Figure 13B]FIG. 13 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 12, provided by an embodiment of the present invention; [Figure 14] Schematic diagram 2 of the prediction partitioning mode for a 16x2 current image block. [Figure 15A] FIG. 15 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 14, provided by an embodiment of the present invention; [Figure 15B] FIG. 15 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 14, provided by an embodiment of the present invention; [Figure 15C] FIG. 15 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 14, provided by an embodiment of the present invention; [Figure 15D] FIG. 15 is a schematic diagram of a predictive partitioning mode of a 16×2 current image block corresponding to FIG. 14, provided by an embodiment of the present invention; [Figure 16A] 1 is a schematic diagram of a predictive partitioning mode for an 8x2 current image block; [Figure 16B] 1 is a schematic diagram of a predictive partitioning mode for an 8x2 current image block; [Figure 17] FIG. 16C is a schematic diagram of a predictive partitioning mode of an 8×2 current image block corresponding to FIGS. 16A and 16B provided by an embodiment of the present invention; [Figure 18A] 1 is a schematic diagram of a predictive partitioning mode for an 8x1 current image block; [Figure 18B] 1 is a schematic diagram of a predictive partitioning mode for an 8x1 current image block; [Figure 19] 18B and 18C are schematic diagrams of predictive partitioning modes of an 8×1 current image block corresponding to FIGS. 18A and 18B provided by an embodiment of the present invention; [Figure 20] FIG. 1 is a schematic diagram of residual block grouping for an 8×1 current image block provided by an embodiment of the present invention; [Figure 21] 2 is a schematic diagram 2 of an image reconstruction method provided by an embodiment of the present invention. [Figure 22]FIG. 22 is a schematic diagram for explaining prediction modes of the 8×1 image block of FIG. 21 provided by an embodiment of the present invention. [Figure 23] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 24] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 25] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 26] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 27] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 28] 1 is a schematic structural diagram of an encoding device or a decoding device provided by an embodiment of the present invention; [Figure 29] 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention; DETAILED DESCRIPTION OF THE INVENTION
[0053] First, technical terms related to the embodiments of the present invention will be explained.
[0054] 1) Prediction mode
[0055] The combination of prediction schemes used to predict a current image block (e.g., a unit to be coded / a unit to be decoded) is called a prediction mode, where different prediction schemes or the same prediction scheme may be used to predict different pixels in the current image block, and the prediction schemes used to predict all pixels in the current image block may collectively be called the (or corresponding) prediction mode of the current image block.
[0056] Prediction modes may include point prediction mode, intra-frame prediction mode, block copy mode, and original value mode (i.e., reconstructed value mode that directly decodes a fixed bit width).
[0057] Illustratively, the point prediction mode determines a predicted value based on pixel reconstructed values of surrounding neighboring points. The point prediction mode includes one or more combinations of prediction methods such as vertical prediction, horizontal prediction, vertical average prediction, and horizontal average prediction. Vertical prediction obtains a predicted value for the current pixel using the pixel value above the current pixel (which may be the neighboring upper pixel or the non-neighboring neighboring upper pixel). As an example, the reconstructed value of the neighboring pixel above the current pixel is determined as the predicted value for the current pixel. Horizontal prediction obtains a predicted value for the current pixel using the pixel value to the left of the current pixel (which may be the neighboring left pixel or the non-neighboring neighboring left pixel). As an example, the reconstructed value of the neighboring pixel to the left of the current pixel is determined as the predicted value for the current pixel. Vertical average prediction obtains a predicted value for the current pixel using pixel values above and below the current pixel. As an example, the predicted value for the current pixel is the average of the reconstructed value of the neighboring pixel vertically above and below. Horizontal average prediction obtains a predicted value for the current pixel using pixel values to the left and right of the current pixel. As an example, the predicted value of the current pixel is the average of the reconstructed value of the horizontally left neighboring pixel and the reconstructed value of the horizontally right neighboring pixel.
[0058] Illustratively, the intra-frame prediction mode determines a prediction value based on pixel reconstructed values of surrounding neighboring blocks.
[0059] Illustratively, the block copy prediction mode determines a prediction value based on pixel reconstruction values of surrounding (not necessarily adjacent) coded (decoded) blocks.
[0060] Illustratively, the original value mode is a reconstructed value mode that directly decodes a fixed bit width, that is, a no-reference prediction mode.
[0061] FIG. 1 shows a schematic diagram of multiple prediction methods provided by an embodiment of the present invention. Each small rectangle in FIG. 1 represents one pixel. Pixels with different marks are used to represent different prediction methods, specifically vertical prediction, horizontal prediction, vertical average prediction, and horizontal average prediction. The schematic diagrams of the prediction methods shown in FIG. 1 may be used to interpret any of the accompanying drawings related to the present invention, such as FIG. 12.
[0062] 2) Residual coding mode
[0063] A manner for coding the residual (i.e., the residual block, which is composed of the residual values of each pixel in the current image block) of a current image block (e.g., a unit to be coded / unit to be decoded) is called a residual coding mode, which may include a skip residual coding mode and a normal residual coding mode.
[0064] In the skip residual coding mode, there is no need to code (decode) the residual coefficients, and at this time, the residual values of the pixels in the current image block are all 0, and the reconstructed value of each pixel is equal to the predicted value of that pixel.
[0065] In the normal residual coding mode, the residual coefficients need to be coded (decoded), and the residual values of the pixels in the current image block are not all zero, and the reconstructed value of each pixel can be obtained based on the predicted value and the residual value of the pixel.
[0066] In one example, the residual value of a pixel is equivalent to the residual coefficient of the pixel, and in another example, the residual coefficient of a pixel may be obtained by performing a certain operation on the residual value of the pixel.
[0067] 3) Other terms
[0068] The term "at least one" in the embodiments of the present invention includes one or more. "Multiple" means two or more. For example, "at least one of A, B, and C" includes A alone, B alone, C alone, A and B simultaneously, A and C simultaneously, B and C simultaneously, and A, B, and C simultaneously. In the description of the present invention, unless otherwise specified, " / " means "or," e.g., A / B can represent A or B. In this specification, "and / or" is used merely to describe the relationship between related objects and indicates that three types of relationships may exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. "Multiple" means two or more. Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the embodiments of the present invention use terms such as "first," "second," etc. to distinguish between identical or similar entities that have substantially the same functions and roles. As will be understood by those skilled in the art, terms such as "first" and "second" do not limit the number or order of execution, and are not necessarily limited to being different.
[0069] A system architecture to which the embodiment of the present invention is applied will be described below.
[0070] Referring to Fig. 2, a schematic architecture diagram of an encoding and decoding system 10 to which an embodiment of the present invention is applied is shown. As shown in Fig. 2, the encoding and decoding system 10 may include a source device 11 and a destination device 12. The source device 11 is used to encode images, so the source device 11 may also be called an image encoding device or a video encoding device. The destination device 12 is used to decode the encoded image data generated by the source device 11, so the destination device 12 may also be called an image decoding device or a video decoding device.
[0071] The source device 11 and the destination device 12 may include a variety of devices, including a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a mobile phone such as a so-called "smartphone," a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or the like. Optionally, the source device 11 and the destination device 12 in FIG. 2 may be two separate devices, or the source device 11 and the destination device 12 may be the same device, i.e., the source device 11 or its corresponding functionality and the destination device 12 or its corresponding functionality may be integrated into the same device. Communication is possible between the source device 11 and the destination device 12; for example, the destination device 12 can receive encoded image data from the source device 11. In one example, the source device 11 and the destination device 12 may include one or more communication media, and the encoded image data is transmitted via one or more communication media, which may include routers, switches, base stations, or other devices that facilitate communication from the source device 11 to the destination device 12.
[0072] As shown in FIG. 2 , source device 11 includes encoder 112. Optionally, source device 11 may further include image preprocessor 111 and communication interface 113. Here, image preprocessor 111 is used to perform preprocessing on the received image to be encoded. For example, the preprocessing performed by image preprocessor 111 may include cropping, color format conversion (e.g., converting from RGB format to YUV format), toning, or noise removal. Encoder 112 is used to receive the preprocessed image and process the preprocessed image using an associated prediction mode to provide encoded image data. In some embodiments, encoder 112 may be used to perform the encoding process in each embodiment described below. Communication interface 113 may be used to transmit the encoded image data to destination device 12 for storage or direct reconstruction, or to any other device (e.g., memory) for decoding or storage. Communication interface 113 may encapsulate the encoded image data in an appropriate format before transmission.
[0073] Optionally, the above image preprocessor 111, encoder 112 and communication interface 113 may be hardware components in the source device 11 or software programs in the source device 11, and embodiments of the present invention are not limited in this regard.
[0074] As shown in FIG. 2 , destination device 12 includes decoder 122. Optionally, destination device 12 may further include a communication interface 121 and an image post-processor 123. Here, communication interface 121 may be used to receive encoded image data from source device 11 or any other source device, such as a storage device. Communication interface 121 may also decapsulate data transmitted by communication interface 113 to obtain encoded image data. Decoder 122 is used to receive encoded image data and output decoded image data (which may also be referred to as reconstructed image data or reconstructed image data). In some embodiments, decoder 122 may be used to perform the decoding process in each embodiment described below.
[0075] The image post-processor 123 is used to perform post-processing on the decoded image data to obtain post-processed image data. The post-processing performed by the image post-processor 123 may include color format conversion (e.g., converting from YUV format to RGB format), toning, cropping, or resampling, or any other processing, and may be used to transmit the post-processed image data to a display device for display.
[0076] Similarly, optionally, the above-mentioned communication interface 121, decoder 122 and image post-processor 123 may be hardware components in the destination device 12 or software programs in the destination device 12, and embodiments of the present invention are not limited in this regard.
[0077] The structure of the encoder and decoder in FIG. 2 will be briefly explained below.
[0078] 3, which shows an illustrative block diagram of an example of an encoder 20 for implementing an embodiment of the present invention. In FIG. 3, the encoder 20 includes a prediction processing unit 201, a residual calculation unit 202, a residual coding unit 203, a quantization unit 204, a coefficient coding unit 205, an inverse quantization unit 206, a residual decoding unit 207, a reconstruction unit 208, and a filter unit 209. Optionally, the encoder 20 may further include a buffer and a decoded picture buffer (DPB), where the buffer is used to buffer the reconstructed image block output by the reconstruction unit 208, and the decoded picture buffer is used to buffer the filtered image block output by the filter unit 209.
[0079] In one example, the input of the encoder 20 is an image block of the image to be encoded (i.e., a current image block, an image block to be encoded) or a coding unit. In another example, the input of the encoder 20 is an image to be encoded, and the encoder 20 may include a division unit (not shown in FIG. 3 ) for dividing the image to be encoded into multiple image blocks. The encoder 20 is used to encode the image to be encoded block by block, e.g., performs the encoding process for each image block.
[0080] In one example, a method for dividing an image to be coded into a plurality of image blocks may include the following steps.
[0081] Step 1: Divide one frame of image into one or more non-overlapping parallel coding units, each of which does not depend on the others and can be coded and decoded in parallel / independently.
[0082] Step 2: For each parallel coding unit, the encoding side may divide it into one or more non-overlapping independent coding units, which may be independent of each other but may share some header information of the parallel coding unit.
[0083] Step 3: The encoding side may further divide each independent coding unit into one or more non-overlapping coding units. Here, when dividing an independent coding unit into multiple non-overlapping coding units, the division method may be horizontally evenly divided, vertically evenly divided, or horizontally and vertically evenly divided. Of course, specific implementations are not limited to these. Each coding unit within an independent coding unit may be interdependent, i.e., may refer to each other during the execution of the prediction step.
[0084] The width of a coding unit is w_cu and the height is h_cu, and optionally the width is greater than the height (except in the case of edge regions). Typically, a coding unit may be a fixed w_cu x h_cu, where w_cu and h_cu are both powers of 2 (N is 0 or greater), such as 16x4, 8x4, 16x2, 8x2, 4x2, 8x1, 4x1, etc.
[0085] A coding unit may contain three components: luma Y, chroma Cb, and chroma Cr (or three components: red R, green G, and blue B), or only one of them. If it contains three components, the sizes of these components may be identical or different, which is specifically related to the input format of the image.
[0086] Figure 4 shows a schematic diagram of the correspondence between images, parallel coding units, independent coding units, and coding units. Here, Figure 4 takes as an example an image divided into parallel coding unit 1 and parallel coding unit 2 according to a 3:1 ratio, and one independent coding unit includes four coding units.
[0087] The prediction processing unit 201 is used to receive or obtain the true value and reconstructed image data of the image block, and predict the current image block based on the associated data in the reconstructed image data to obtain a predicted block of the current image block.
[0088] The residual calculation unit 202 is used to calculate the residual value between the true value of the image block and the predicted block of the image block to obtain the residual block, for example, by subtracting the pixel value of the predicted block from the pixel value of the image block for each pixel.
[0089] In one example, the residual coding unit 203 is used to determine residual coefficients of the current image block based on the residual block. Optionally, the process may include performing a transform, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), on the residual block to obtain transform coefficients in a transform domain, where the transform coefficients may be referred to as transform residual coefficients, and the transform residual coefficients may represent the residual block in the transform domain. Of course, the transform step may not be included.
[0090] The quantization unit 204 is used to quantize the transform coefficients by applying scalar quantization or vector quantization to obtain quantized transform coefficients, which may also be referred to as quantized residual coefficients. The quantization process may reduce the bit depth for some or all of the transform coefficients. For example, during quantization, n-bit transform coefficients may be truncated to m-bit transform coefficients, where n is greater than m. The degree of quantization may be changed by adjusting a quantization parameter (QP). For example, in the case of scalar quantization, fine or coarse quantization may be achieved by applying different scales. A small quantization step corresponds to fine quantization, and a large quantization step corresponds to coarse quantization. The QP may indicate the appropriate quantization step.
[0091] The coefficient coding unit 205 is used to code the quantized residual coefficients and output coded image data (i.e., the coding result of the current image block to be coded) in the form of a coded bitstream. The coded bitstream may then be transmitted to a decoder or stored for later transmission to a decoder or retrieval. The coefficient coding unit 205 may also be used to code other syntax elements of the current image block, such as encoding a prediction mode index into the bitstream.
[0092] In one example, one possible way for the coefficient coding unit 205 to code the residual coefficients is a semi-fixed-length coding mode. First, the maximum value of the residual absolute value within one residual block (RB) is defined as modified maximum (mm). The number of coding bits for the residual coefficients within the RB is determined (the number of coding bits for residual coefficients within the same RB is the same). For example, if the coding length (CL) of the current RB is 2 and the current residual coefficient is 1, 2 bits are required to code the residual coefficient 1, which is represented as 01. If the CL of the current RB is 7, this represents coding an 8-bit residual coefficient and a 1-bit code bit. The CL is determined by finding the smallest M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If the two boundary values of -2^(M-1) and 2^(M-1) exist simultaneously, M needs to be increased by 1, i.e., M+1 bits are required to code all residuals of the current RB; if only one of the two boundary values of -2^(M-1) and 2^(M-1) exists, one trailing bit needs to be coded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if neither -2^(M-1) nor 2^(M-1) exists in all residuals, there is no need to code the trailing bit.
[0093] Of course, other residual coefficient coding methods may be used, such as exponential Golomb coding, Golomb-Rice coding, truncated unary coding, run-length coding, or direct coding of the original residual values.
[0094] Also, in some special cases, the original values may be coded directly instead of the residual values.
[0095] The inverse quantization unit 206 is used to inverse quantize the quantized coefficients to obtain inverse quantized coefficients, which is an inverse application of the quantization unit 204. For example, the inverse quantization unit 206 may apply an inverse quantization scheme of the quantization scheme applied by the quantization unit 204, based on or using the same quantization step as the quantization unit 204. The inverse quantized coefficients may be referred to as inverse quantized residual coefficients.
[0096] The residual decoding unit 207 is used to decode the dequantized residual coefficients into a residual block, which may include performing an inverse transform on the dequantized coefficients to obtain an inverse transformed block in the pixel domain (also called the sample domain). For example, the inverse transform may include an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST). The inverse transformed block may also be called an inverse transformed dequantized block or an inverse transformed residual block. Of course, the inverse transform step may not be included.
[0097] The reconstruction unit 208 is used to add the inverse transformed block (i.e., the inverse transformed residual block) to the prediction block to obtain a reconstructed block in the sample domain, and the reconstruction unit 208 may be an adder, for example, adding the sample values (i.e., pixel values) of the residual block to the sample values of the prediction block. The reconstructed block output by the reconstruction unit 208 may be used to predict other image blocks later.
[0098] The filter unit 209 (or simply referred to as "filter" for short) is used to filter the reconstructed block to obtain a filtered block, so as to smooth the pixel transformation or improve the quality of the image.
[0099] As an example, the encoding process is shown in FIG. 5. Specifically, the encoder determines whether to use a point prediction mode (S901). If the determination result in S901 is "yes," the encoder performs prediction based on the point prediction mode and then performs an inverse quantization and reconstruction step (S901Y) to realize the encoding process. If the determination result in S901 is "no," the encoder determines whether to use an original value mode (S902). If the determination result in S902 is "yes," the encoder performs encoding using the original value mode (S902Y). If the determination result in S902 is "no," the encoder determines to perform prediction using another prediction mode, such as intra-frame prediction or block copy mode (S903). Thereafter, if the encoder determines to perform residual skipping in S904, the encoder directly performs a reconstruction step (S905). If the encoder determines not to perform residual skipping in S904, the encoder performs an inverse quantization step (S906) and then determines whether to use a block copy prediction mode (S907). When it is determined to use the block copy prediction mode, in one case, if it is determined to perform transform skip in S908, the reconstruction step (S905) is directly performed, and in another case, if it is determined not to perform transform skip in S908, the inverse transform step (S909) and the reconstruction step (S905) are performed to realize the encoding process.When it is determined not to use the block copy mode in S907 (in this case, one prediction mode used is intra-frame prediction mode), the inverse transform step (S909) and the reconstruction step (S905) are performed to realize the encoding process.
[0100] Specifically, in the present embodiment, the encoder 20 is used to implement the encoding method described in the following embodiment.
[0101] 6, which illustrates an exemplary block diagram of an example decoder 30 for implementing an embodiment of the present invention. The decoder 30 is used, for example, to receive coded image data (i.e., a coded bitstream, e.g., including a coded bitstream of image blocks and associated syntax elements) coded by the encoder 20 to obtain a decoded image. The decoder 30 includes a bitstream analysis unit 301, an inverse quantization unit 302, a residual decoding unit 303, a prediction processing unit 304, a reconstruction unit 305, and a filter unit 306. In some examples, the decoder 30 may perform a decoding path that is approximately the reverse of the encoding path described for the encoder 20 of FIG. 2. Optionally, the decoder 30 may further include a buffer and a decoded image buffer. Here, the buffer is used to buffer the reconstructed image blocks output by the reconstruction unit 305, and the decoded image buffer is used to buffer the filtered image blocks output by the filter unit 306.
[0102] The bitstream parsing unit 301 is used to perform decoding on the encoded image data to obtain quantized coefficients and / or decoded coding parameters (e.g., the coding parameters may include any one or all of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters, and / or other syntax elements). The bitstream parsing unit 301 is further used to forward the decoded coding parameters to the prediction processing unit 304 so that the prediction processing unit 304 performs a prediction process based on the coding parameters.
[0103] The function of the inverse quantization unit 302 may be the same as that of the inverse quantization unit 206 of the encoder 20 , and is used to inverse quantize the quantized coefficients decoded by the bitstream analysis unit 301 .
[0104] The function of the residual decoding unit 303 may be the same as that of the residual decoding unit 207 of the encoder 20, and the function of the reconstruction unit 305 (e.g., an adder) may be the same as that of the reconstruction unit 208 of the encoder 20, and is used to perform an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) on the above-mentioned quantized coefficients to obtain an inverse transform block (which may also be called an inverse transform residual block), which is the residual block of the current image block in the pixel domain.
[0105] The prediction processing unit 304 is used to receive or obtain coded image data (e.g., coded bitstream of the current image block) and reconstructed image data, and the prediction processing unit 304 may further receive or obtain, for example, prediction-related parameters and / or information on the selected prediction mode (i.e., decoded coding parameters) from the bitstream analysis unit 301, and predict the current image block based on the related data in the reconstructed image data and the decoded coding parameters to obtain a predicted block of the current image block.
[0106] The reconstruction unit 305 is used to add the inverse transform block (i.e., the inverse transform residual block) to the prediction block to obtain a reconstructed block in the sample domain, for example, by adding the sample values of the inverse transform residual block to the sample values of the prediction block.
[0107] The filter unit 306 is used to filter the reconstructed block to obtain a filtered block, which is a decoded image block.
[0108] Specifically, in the embodiment of the present invention, the decoder 30 is used to implement the decoding method described in the embodiment below.
[0109] In the encoder 20 and decoder 30 according to the embodiment of the present invention, the processing result of a process may be further processed before being output to the next process. For example, after a process such as interpolation filtering, motion vector derivation or filtering, an operation such as clip or shift may be performed on the processing result of the corresponding process.
[0110] In one example, the decoding process may include the following steps.
[0111] Step 1: The bitstream parsing unit 301 analyzes the prediction mode and the residual coding mode.
[0112] Step 2: The bitstream parsing unit 301 analyzes the quantization-related value (such as the near value or the QP value) based on the prediction mode and the residual coding mode.
[0113] Step 3: The inverse quantization unit 302 analyzes the residual coefficients based on the prediction mode and the quantization-related values.
[0114] Step 4: The prediction processing unit 304 obtains a predicted value for each pixel of the current image block based on the prediction mode.
[0115] Step 5: The residual decoding unit 303 decodes based on the residual coefficients to obtain the residual value of each pixel of the current image block.
[0116] Step 6: The reconstruction unit 305 obtains a reconstruction value for each pixel of the current coding unit based on the predicted value and the residual value thereof.
[0117] The following image encoding and decoding methods provided by embodiments of the present invention will be described below with reference to the drawings.
[0118] The encoding side in any embodiment of the present invention may be the encoder in Figure 2 or Figure 3 above, or may be the source device in Figure 2 above, and the decoding side in any embodiment may be the decoder in Figure 2 or Figure 6 above, or may be the destination device in Figure 2 above.
[0119] Example 1
[0120] 7A is a schematic flowchart of an image encoding method provided by an embodiment of the present invention. The method shown in FIG. 7A includes the following steps:
[0121] S101: The encoding side determines a target prediction mode of a unit to be encoded.
[0122] The unit to be coded may be any one image block to be coded (ie, coding unit) in an image to be coded.
[0123] The target prediction mode may be one of a plurality of predefined prediction modes, specifically, the original value mode, or a prediction mode other than the original value mode. In one example, the other prediction modes include any one or more combinations of at least one point prediction mode, at least one intra prediction mode, and at least one block copy mode. For example, the other prediction modes include a total of three prediction modes: a point prediction mode, an intra prediction mode, and a block copy mode. In another example, the other prediction modes include five prediction modes: point prediction mode 0, point prediction mode 1, intra prediction mode 0, block copy mode 0, and block copy mode 1. In another example, the other prediction modes include any one or more combinations of at least one point prediction mode based on normal residual coding, at least one intra prediction mode based on normal residual coding, at least one block copy mode based on normal residual coding, at least one point prediction mode based on skip residual coding, at least one intra prediction mode based on skip residual coding, and at least one block copy mode based on skip residual coding. The example may be considered as a combination of prediction modes and residual coding modes in the prior art to obtain new prediction modes defined in embodiments of the present invention.
[0124] When the prediction mode is a point prediction mode based on normal residual coding, the encoding side encodes residual coefficients using the normal residual coding mode and predicts pixel values of the unit to be coded using the point prediction mode. When the prediction mode is other modes, the process is similar, and therefore the description will be omitted here.
[0125] S102: The encoding side determines an index of the target prediction mode from an index table based on the target prediction mode, where the index table includes a correspondence relationship between the indexes of a plurality of prediction modes and the plurality of prediction modes.
[0126] Optionally, the correspondence between the multiple prediction modes and their respective indexes may be stored by an index table, or may be stored in other ways, and the embodiments of the present invention are not limited thereto.
[0127] Optionally, the encoding side jointly encodes the indexes of the plurality of prediction modes. For example, the indexes of the plurality of prediction modes may be encoded in a truncated unary coding manner, that is, the indexes of the plurality of prediction modes may be generated in a truncated unary coding manner, for example, see Examples 1 and 2 below. As another example, the indexes of the plurality of prediction modes may be encoded in a binary tree manner, for example, see Example 3 below.
[0128] Optionally, the codeword length (i.e., the number of binary characters, also referred to as code length) of the index of the original value mode is equal to or greater than the codeword lengths of the indexes of other prediction modes. Optionally, the codeword length of the index of a prediction mode is related to the frequency of use of the prediction mode. Here, the frequency of use here may be obtained by statistics based on big data, and the embodiment of the present invention is not limited to such statistical method. For example, the more frequently used a prediction mode is, the shorter the codeword of its index. Of course, for the multiple prediction modes, some of the indexes of the prediction modes may satisfy the rule set forth in this optional embodiment. Furthermore, optionally, there may be multiple prediction modes whose index codeword lengths are the same.
[0129] S103: The encoding side encodes the index of the target prediction mode into a bitstream.
[0130] 7B shows an image decoding method provided by an embodiment of the present invention, which corresponds to the image encoding method shown in FIG. 7A. The method shown in FIG. 7B includes:
[0131] S201: The decoding side parses a bitstream to obtain a syntax element, which includes an index of a target prediction mode of a unit to be decoded.
[0132] The unit to be decoded may be obtained by encoding the unit to be encoded in the method shown in FIG. 7A.
[0133] Optionally, the encoding side jointly encodes the indexes of the plurality of prediction modes, for example, by using a truncated unary coding method, i.e., the indexes of the plurality of prediction modes are generated by using a truncated unary coding method.
[0134] Optionally, the codeword length of the index of the original value mode is equal to or greater than the codeword length of the index of the other prediction modes.
[0135] Optionally, the codeword length of a prediction mode's index is related to the frequency of use of that prediction mode, for example, the more frequently used a prediction mode is, the shorter the codeword of its index is.
[0136] S202: The decoding side determines a target prediction mode from an index table based on the index of the target prediction mode, where the index table includes a correspondence relationship between the indexes of a plurality of prediction modes and the plurality of prediction modes.
[0137] S203: The decoding side reconstructs the unit to be decoded based on at least the target prediction mode to obtain a reconstructed block of the unit to be decoded.
[0138] In one example, the decoding side predicts pixel values of the unit to be decoded based on a target prediction mode to obtain a prediction block, then analyzes the bitstream to obtain information related to a residual block of the unit to be decoded, and obtains the residual block of the unit to be decoded based on the information, and then reconstructs the unit to be decoded based on the prediction block and the residual block to obtain a reconstructed block.
[0139] The process by which the decoding side reconstructs the unit to be decoded based on at least the target prediction mode is not limited to this. In another example, the decoding side may reconstruct the unit to be decoded based on the method in Figure 21 below.
[0140] On the encoding side, an additional bit is usually used to indicate whether the prediction mode of the current image block (i.e., the unit to be coded) is the original value mode. For example, this bit may be designated as org_flag, where org_flag = "1" indicates that the prediction mode of the current block is the original value mode, and org_flag = "0" indicates that the prediction mode of the current block is not the original value mode. If the prediction mode of the current block is not the original value mode, an index of another prediction mode is coded into the bitstream. However, since the probability of using the original value mode is very low, for most image blocks, one org_flag "0" needs to be coded into the bitstream, which wastes transmission resources (i.e., increases the overhead of bitstream transmission). In addition, regardless of whether the prediction mode is the original value prediction mode, the decoding side needs to first decode this flag bit org_flag, which increases the decoding complexity on the decoding side.
[0141] However, in the image encoding method shown in Fig. 7A provided by an embodiment of the present invention, an index of the target prediction mode is directly determined from an index table based on the target prediction mode, and a flag (e.g., flag bit org_flag) indicating whether the target prediction mode is the original value mode does not need to be coded into the bitstream. In most cases, the original value mode is not used as the target prediction mode, and for example, a point prediction mode or an intra-frame prediction mode is usually used. Therefore, the need to code the flag bit (org_flag) indicating whether the original value mode is used, as in the conventional scheme, helps to save bitstream transmission overhead.
[0142] Correspondingly, in the image decoding method provided by FIG. 7B in an embodiment of the present invention, the target prediction mode can be directly determined from the index table based on the index of the target prediction mode, and there is no need to analyze the flag bit org_flag, thereby reducing the decoding complexity on the decoding side.
[0143] Since the image decoding method shown in FIG. 7B corresponds to the image encoding method shown in FIG. 7A, the image decoding method helps to save overhead in bitstream transmission.
[0144] Example 1: Assuming that the above multiple prediction modes include an original value mode, a point prediction mode, an intra-frame prediction mode, and a block copy mode, one possible method is to use a truncated unary coding scheme to encode the indexes of these prediction modes, using a long codeword for the index of the original value mode and a short codeword for the index of other prediction modes. For example, the codeword for the index of the point prediction mode is 0, the codeword for the intra-frame prediction mode is 10, the codeword for the block copy mode is 111, and the codeword for the index of the original value mode is 110. Based on this scheme, since the point prediction mode or the intra-frame prediction mode is used in most cases, there is no need to encode a flag bit (org_flag) indicating whether the original value mode is used.
[0145] Based on the example, the index table may be as shown in Table 1. [Table 1]
[0146] Example 2: Assume that the above multiple prediction modes include an original value mode, a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, a block copy mode based on normal residual coding, a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, and a block copy mode based on skip residual coding. The point prediction mode, intra-frame prediction mode, and block copy mode based on normal residual coding mode are respectively referred to as normal point prediction mode (mode 1), normal intra-frame prediction mode (mode 2), and normal block copy mode (mode 3). The point prediction mode, intra-frame prediction mode, and block copy mode based on skip residual coding mode are respectively referred to as special point prediction mode (mode 4), special intra-frame prediction mode (mode 5), and special block copy mode (mode 6). Together with the original value mode (mode 7), there are seven prediction patterns. In this case, one possible method is to code the indices of these prediction modes in a truncated unary coding scheme, such that the codewords for modes 1 to 7 are 0, 10, 110, 1110, 11110, 111110, and 111111, respectively.
[0147] Based on the example, the index table may be as shown in Table 2. [Table 2]
[0148] Example 3: Encoding indexes of multiple prediction modes using a binary tree method Table 3 shows one encoding method. [Table 3]
[0149] In Table 3, an example is described in which the multiple prediction modes include the above 15 types of prediction modes. In actual implementation, the index table shown in Table 3 may include only two columns: a prediction mode and a prediction mode index, or only three columns: a prediction mode number, a prediction mode, and a prediction mode index.
[0150] The indexes of the multiple prediction modes in Table 3 are generated according to the following rules.
[0151] First, "0" and "1" are set as the most significant flag bits of the indexes of "point prediction mode, intra-frame block copy mode" and "intra-frame prediction mode, original value mode", respectively.
[0152] Next, for "point prediction mode, intra-frame block copy mode", "0" and "1" are set as the second highest flag bits of the index of "point prediction mode" and "intra-frame block copy mode", respectively.
[0153] Next, for the point prediction modes, "1" and "0" are set as the third flag bits of the indexes of "point prediction modes 0-1" and "point prediction modes 2-3", respectively.
[0154] Finally, for "point prediction modes 0 to 1", "0" and "1" are set as the fourth flag bits of the indexes of "point prediction mode 0" and "point prediction mode 1", respectively.
[0155] Therefore, the indexes of point prediction mode 0 and point prediction mode 1 are "0010" and "0011," respectively. The methods of generating indexes for other prediction modes are similar to this, and therefore will not be described here.
[0156] For intra-frame prediction modes 0 to 6, "1" and "0" are used as the second highest bit of the index for "intra-frame prediction mode 0" and "intra-frame prediction modes 1 to 6," respectively. The indexes for other intra-frame prediction modes will not be described here. The index generation method for the intra-frame block copy mode is similar.
[0157] Optionally, the code length of the index of a prediction mode is related to the frequency of use of the prediction mode. In one example, referring to Table 3, considering that the frequency of use of point prediction modes 0 to 3 is approximately the same, the code lengths of their indexes are set to be the same, and considering that the frequency of use of intra-frame prediction mode 0 is higher than the frequency of use of intra-frame prediction modes 1 to 6, the code length of its index is shorter than the code length of the index of intra-frame prediction modes 1 to 6. Other examples will not be listed one by one.
[0158] Optionally, the index of a certain prediction mode is not used as a prefix of the index of another prediction mode. For example, the index of prediction mode 0 is "11," and the prefixes of the indexes of the other 14 prediction modes are not "11." This is a proposed technical solution in consideration of the fact that "if the prefix of the index of one or more prediction modes is "11," when the decoding side identifies "11," it cannot determine whether the prediction mode is prediction mode 0 or the one or more prediction modes," which helps the decoding side to perform decoding quickly.
[0159] A specific embodiment for generating indexes for multiple prediction modes based on a binary tree scheme is not limited to Table 3.
[0160] For example, in Table 3, the code lengths of the indexes of point prediction modes 0 to 3 are equal, but in specific implementation, the code lengths of the indexes of any two point prediction modes may not be equal, for example, the method of generating the indexes of intra-frame prediction modes 0 to 6 may be referenced.
[0161] For example, the code lengths of the indexes of the intra-frame prediction modes 0 to 6 may be the same, and the method of generating the indexes of the point-by-point prediction modes 0 to 3 may be referenced.
[0162] For example, in Table 3, "0" and "1" are the most significant flag bits of the indexes of "point prediction mode, intra-frame block copy mode" and "intra-frame prediction mode, original value mode", respectively. However, in a specific implementation, "1" and "0" may be the most significant flag bits of the indexes of "point prediction mode, intra-frame block copy mode" and "intra-frame prediction mode, original value mode", respectively.
[0163] Other examples will not be listed one by one.
[0164] Example 2
[0165] 8A shows a schematic diagram of an image encoding method provided by an embodiment of the present invention. The method shown in FIG. 8A includes the following steps:
[0166] S301: The encoding side determines a residual coding mode of a unit to be coded, where the residual coding mode may include a skip residual coding mode or a normal residual coding mode.
[0167] The relevant descriptions regarding the unit to be coded, the skip residual coding mode, and the normal residual coding mode have been given above, so they will not be repeated here.
[0168] S302: If the residual coding mode is a skip residual coding mode, the coding side encodes an index of the residual coding mode into the bitstream, without needing to encode the residual quantization-related values (such as near values or QP values) of the unit to be coded into the bitstream.
[0169] S303: If the residual coding mode is a normal residual coding mode, the encoding side encodes an index of the residual coding mode and a residual quantization-related value (e.g., a near value or a QP value) of the unit to be coded into a bitstream. In one example, the encoding side first encodes the index of the residual coding mode, and then encodes the residual quantization-related value of the unit to be coded.
[0170] S304: If the residual coding mode is a skip residual coding mode, the coding side predicts the unit to be coded to obtain a prediction block, and determines the prediction block as the reconstruction block of the unit to be coded. In this case, there is no need to obtain the residual quantization-related value of the unit to be coded.
[0171] S305: If the residual coding mode is a normal residual coding mode, the coding side obtains the residual quantization-related value of the unit to be coded to obtain a residual block, and reconstructs the unit to be coded based on the residual block to obtain a reconstructed block of the unit to be coded.
[0172] Here, S304 to S305 can be regarded as a reconstruction process performed by the encoding side.
[0173] Figure 8B shows a schematic diagram of an image decoding method provided by an embodiment of the present invention, which corresponds to the image encoding method shown in Figure 8A. The method shown in Figure 8B includes the following steps:
[0174] S401: The decoding side parses a bitstream to obtain a syntax element, which includes an index of a residual coding mode of a unit to be decoded. The unit to be decoded may be an image block obtained by encoding a unit to be encoded in the manner shown in FIG. 8A.
[0175] S402: If the residual coding mode index is used to indicate a skip residual coding mode, the decoding side predicts the unit to be decoded to obtain a prediction block, and determines the prediction block as the reconstruction block of the unit to be decoded. Because the residual coding mode is a skip residual coding mode, that is, the residual values of the unit to be decoded are all 0, the prediction block may be directly determined as the reconstruction block.
[0176] S403: If the residual coding mode index is used to indicate a normal residual coding mode, the decoding side analyzes the residual quantization-related values of the unit to be decoded to obtain a residual block, and reconstructs the unit to be decoded based on at least the residual block to obtain a reconstructed block.
[0177] In one example, the above syntax element may further include a prediction mode of the unit to be decoded, and the decoding side predicts the unit to be decoded based on the prediction mode to obtain a prediction block, and reconstructs the unit to be decoded based on the residual block and the prediction block to obtain a reconstructed block. The process of reconstructing the unit to be decoded based on at least the residual block is not limited thereto. In another example, reconstruction is performed based on the method shown in Figure 21 to obtain a reconstructed block.
[0178] Typically, one flag bit (denoted as res_skip_flag) indicates whether or not to use the skip residual coding mode for the current block, and since the coding (decoding) of the residual quantization-related value is performed before res_skip_flag, it is necessary to code (decode) the residual quantization-related value even if res_skip_flag is 1. However, since the residual quantization-related value in this case is unnecessary, this technical solution not only increases the overhead of bitstream transmission between the coding side and the decoding side, but also increases the complexity of decoding on the decoding side.
[0179] However, in the image coding method shown in Fig. 8A of an embodiment of the present invention, it is considered that "when the residual coding mode is the skip residual coding mode (e.g., res_skip_flag is 1), there is no need to code or decode the residual coefficients, and therefore there is no need to code (decode) the residual quantization-related values (e.g., near values or QP values) either," and therefore it is proposed that the coding side first codes the residual coding mode information (e.g., an index of the residual coding mode, e.g., res_skip_flag), and then determines whether to code the residual quantization-related values (e.g., near values or QP values) based on the residual coding mode. In this way, when the residual coding mode is the skip residual coding mode, there is no need to code the residual quantization-related values, which helps to save bitstream transmission overhead.
[0180] Correspondingly, in the image decoding method provided by FIG. 8B in an embodiment of the present invention, the residual coding mode information (e.g., the index of the residual coding mode, such as res_skip_flag) may be analyzed first, and then whether to analyze the residual quantization-related value (e.g., the near value or the QP value) may be determined based on the residual coding mode, thereby reducing the decoding complexity on the decoding side.
[0181] Example 3
[0182] 9A shows a schematic diagram of an image encoding method provided by an embodiment of the present invention. The method shown in FIG. 9A includes the following steps:
[0183] S501: The encoding side determines a target prediction mode of a unit to be encoded, where the target prediction mode includes a prediction mode based on skip residual coding or a prediction mode based on normal residual coding.
[0184] Prediction modes based on skip residual coding and prediction modes based on normal residual coding may be considered as a combination of prediction modes and residual coding modes to obtain new prediction modes defined in embodiments of the present invention.
[0185] In one example, the prediction mode based on skip residual coding includes a point prediction mode based on skip residual coding, an intra-frame prediction mode based on skip residual coding, or a block copy mode based on skip residual coding.
[0186] In one example, the prediction mode based on normal residual coding includes a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding.
[0187] S502: The encoding side encodes the index of the target prediction mode into a bitstream.
[0188] In one example, the method for generating the index of the target prediction mode may refer to the related example in the embodiment shown in FIG. 7A , for example, the indexes of the multiple prediction modes may be jointly encoded, for example, encoded using a truncated unary coding method. Of course, specific implementations are not limited thereto. In another example, the index of the target prediction mode may be encoded into the bitstream using a conventional method, such as first encoding the flag bit org_flag.
[0189] S503: If the target prediction mode is a prediction mode based on skip residual coding, the coding side predicts the unit to be coded to obtain a prediction block, and determines the prediction block as a reconstructed block of the unit to be coded.
[0190] S504: If the target prediction mode is a prediction mode based on normal residual coding, the coding side obtains the residual quantization-related value of the unit to be coded to obtain a residual block of the unit to be coded, and reconstructs the unit to be coded based on the target prediction mode and the residual block to obtain a reconstructed block.
[0191] Here, S503 to S504 can be regarded as a reconstruction process performed by the encoding side.
[0192] In one example, the step of reconstructing the unit to be coded based on the target prediction mode and the residual block may include predicting the unit to be coded based on the target prediction mode to obtain a prediction block, and reconstructing the unit to be coded based on the prediction block and the residual block. Of course, this is not limited thereto, and in another example, reconstruction is performed based on the method shown in Figure 21 to obtain a reconstructed block.
[0193] Figure 9B shows a schematic diagram of an image decoding method provided by an embodiment of the present invention, which corresponds to the image encoding method shown in Figure 9A. The method shown in Figure 9B includes the following steps:
[0194] S601: A decoding side parses a bitstream to obtain a syntax element, the syntax element including an index of a target prediction mode of a unit to be decoded, where the target prediction mode includes an index of a prediction mode based on skip residual coding or an index of a prediction mode based on normal residual coding.
[0195] S602: If the target prediction mode is a prediction mode based on skip residual coding, the decoding side predicts the unit to be decoded to obtain a prediction block, and determines the prediction block as a reconstructed block.
[0196] S603: If the target prediction mode is a prediction mode based on normal residual coding, the decoding side analyzes the residual quantization-related value of the unit to be decoded to obtain a residual block of the unit to be decoded, and reconstructs the unit to be decoded based on the target prediction mode and the residual block to obtain a reconstructed block.
[0197] In one example, the step of reconstructing the unit to be decoded based on the target prediction mode and the residual block may include predicting the unit to be decoded based on the target prediction mode to obtain a prediction block, and reconstructing the unit to be decoded based on the prediction block and the residual block. Of course, this is not limited thereto, and in another example, reconstruction is performed based on the method shown in Figure 21 to obtain a reconstructed block.
[0198] The image encoding and decoding methods shown in Figures 9A and 9B have at least the following beneficial effects: By combining a conventional residual coding mode and a prediction mode into a new prediction mode provided by an embodiment of the present invention, it is not necessary to encode (decode) the residual coding mode and the prediction mode separately, and the new prediction mode can be uniformly encoded (decoded), which simplifies the implementation logic and helps save bitstream transmission overhead. Alternatively, the encoding side may also encode the residual skip mode as a prediction mode. The encoding side (decoding side) first encodes (decodes) the prediction mode, and then determines whether it is necessary to analyze a residual quantization-related value (e.g., a near value or a QP value) based on the prediction mode, thereby saving bitrate. In addition, first encode (or decode) residual coding mode information (e.g., an index of the residual coding mode, such as res_skip_flag), and then determine whether to encode (or decode) the residual quantization-related value (e.g., a near value or a QP value) based on the residual coding mode, so that if the residual coding mode is a skip residual coding mode, there is no need to encode (or decode) the residual quantization-related value, which helps to save bitstream transmission overhead.
[0199] For example, based on the encoding method shown in the above example 2, the decoding side can know whether it is necessary to encode the residual for the unit to be encoded that corresponds to the unit to be decoded based on the prediction mode. For modes that do not need to encode the residual (for example, the above modes 4, 5, 6, and 7), it is not necessary to encode (decode) the residual quantization-related value (for example, the near value or the QP value).
[0200] Example 4
[0201] 10 shows an image reconstruction method provided by an embodiment of the present invention, which is applicable to both image encoding and decoding methods. The method shown in FIG. 10 may include the following steps.
[0202] S701: Determine a prediction mode for at least one prediction group into which a current image block is divided. Wherein, any prediction group of the at least one prediction group includes a plurality of consecutive pixels in the same row, and the any prediction group includes a first designated pixel region and a second designated pixel region, the first designated pixel region includes a plurality of pixel groups, and the plurality of pixel groups are obtained by dividing based on the second designated pixel region, and the first designated pixel region and the second designated pixel region have different prediction methods. The plurality of pixel groups can be predicted in parallel, and one pixel group includes one or a plurality of consecutive pixels.
[0203] When this embodiment is applied to an image coding method, the execution body of this embodiment may be the coding side, and the current image block is specifically the image block to be coded or the unit to be coded.
[0204] When this embodiment is applied to an image decoding method, the execution entity of this embodiment may be a decoding side, and the current image block may be a specific image block to be decoded or a unit to be decoded. S701 may include a step of analyzing the bitstream to obtain prediction mode indexes of any one or more prediction groups among at least one prediction group into which the current image block is divided.
[0205] The embodiment of the present invention does not limit the size of the current image block, for example, the width of the current image block is greater than the height, for example, the size of the current image block can be 16*2, 8*2, or 8*1, etc.
[0206] In one example, the current image block may be divided into one prediction group, which is equivalent to not dividing the current image block into prediction groups, in which case all pixels in the current image block are in one prediction group.
[0207] In another example, the current image block may be divided into multiple prediction groups.
[0208] In the embodiment of the present invention, the division method of the prediction groups of the current image block and the prediction mode of each prediction group are not limited. Hereinafter, the division mode and the prediction mode in the division mode are collectively referred to as a "division prediction mode."
[0209] In one example, one prediction group may be composed of all / part of pixels in one / multiple rows of the current image block, and of course, other embodiments may be possible. In principle, one prediction group may include multiple consecutive pixels in the same row.
[0210] In one example, the number of consecutive pixels included in one prediction group is equal to or greater than a predetermined threshold. This is because, when the number of consecutive pixels in one prediction group is relatively large, serial prediction of the pixels in the prediction group may take a long time. In this case, adopting the present technical solution makes it possible to predict multiple pixel groups in one prediction group in parallel, which helps to shorten the prediction time for the prediction group.
[0211] In the prediction process, two groups of pixels may be predicted in parallel if there is no dependency between the pixels in the two groups of pixels. The number of pixels contained in different groups of pixels may or may not be equal.
[0212] The embodiments of the present invention do not limit which pixels are specifically included in the first and second designated pixel regions, or the prediction method for these pixels. In principle, any "first and second designated pixel regions and prediction method" may be used as long as "multiple pixel groups can be predicted in parallel, and each pixel group includes one or multiple consecutive pixels."
[0213] Figure 11 shows a parallel pixel group division scheme provided by an embodiment of the present invention. In Figure 11, consecutive pixels in the same row within one prediction group are pixels 1 to 12, the pixels included in a first designated pixel region are pixels 3, 7, and 11, and the pixels included in a second designated pixel region are pixels 1 to 2, 4 to 6, 8 to 10, and 12. The multiple pixel groups are pixel groups 1 to 4, where pixel groups 1 to 3 include multiple pixels and pixel group 4 includes one pixel. The number of pixels included in pixel group 2 is equal to the number of pixels included in pixel group 3, but is not equal to the number of pixels included in the other pixel groups.
[0214] In one example, vertical prediction is used for a first designated pixel region, and horizontal prediction is used for a second designated pixel region, thus enabling parallel prediction between multiple pixel groups.
[0215] In another example, vertical prediction is used for a first designated pixel region, and vertical average prediction is used for a second designated pixel region. In this way, parallel prediction between multiple pixel groups is possible.
[0216] Optionally, the difference in the number of pixels included in different pixel groups is less than or equal to a threshold value. In this way, it is useful to make the number of pixels included in multiple pixel groups equal or as equal as possible, so that the prediction times of different pixel groups predicted in parallel are the same or nearly the same, and the total prediction time of one prediction group is reduced.
[0217] S702: Reconstruct the current image block based on the prediction mode of the at least one prediction group to obtain a reconstructed block.
[0218] For example, for any one of the at least one prediction groups, predict the prediction group based on the prediction mode of the prediction group to obtain a prediction block of the prediction group, obtain a residual block of the prediction group, and based on the prediction block and the residual block, obtain a reconstructed block of the prediction group. Of course, there may be other embodiments, for example, when all the values in the residual block are 0, directly determine the prediction block as the reconstructed block. As another example, perform reconstruction based on the method shown in FIG. 21 to obtain a reconstructed block.
[0219] In the image reconstruction method shown in FIG. 11, when performing prediction, it is possible to predict a plurality of pixel groups in one prediction group in parallel, which helps to shorten the total prediction time of the prediction group. The image coding method shown in FIG. 11 can be regarded as a new point prediction mode provided by an embodiment of the present invention.
[0220] :Extensively, in the image reconstruction method shown in FIG. 11, "rows" can be replaced with "columns" to constitute a new embodiment, thereby solving the problem that the prediction process takes time due to the inability to execute the prediction process in parallel in the current image block where the height is greater than the width (for example, the size of the current image block is 2*16, 2*8, or 1*8, etc.). In this case, in one example, horizontal prediction is used for the first specified pixel region, and vertical prediction is used for the second specified pixel region. In another example, horizontal prediction is used for the first specified pixel region, and horizontal average value prediction is used for the second specified pixel region. Other related embodiments can be obtained by inference based on the related description of FIG. 11 of the present invention, and the description is omitted here.
[0221] Hereinafter, the image reconstruction method shown in FIG. 11 will be described with specific examples.
[0222] The current image block of 16x2 is targeted, and specifically, it may be a 16x2 luma block or a 16x2 chroma block.
[0223] 1) One prediction division mode of a 16x2 current image block is as shown in Figure 12, where the current image block includes Groups 1 and 2. Specifically, Group 1 consists of pixels in the second row, and horizontal prediction is used for Group 1, while Group 2 consists of pixels in the first row, and vertical average prediction is used for Group 2. Here, the pixels of Group 2 may refer to the pixels in the last row of the adjacent 16x2 image block above.
[0224] As shown in Figure 12, the encoding of the second pixel in Group 2 depends on the reconstructed value of the first pixel, so the encoding of the first pixel and the second pixel cannot be performed in parallel, and the decoding is similar. Also, the encoding of the first pixel in Group 1 depends on the reconstructed value of the first pixel in Group 2, so encoding and decoding cannot be performed simultaneously. Therefore, the parallelism of such a prediction split mode is low, and it is not suitable for hardware implementation.
[0225] In order to improve the parallelism in the prediction process, when applied to the embodiment shown in Figure 11 of the present invention, the prediction division mode of the 16x2 current image block may be as shown in Figure 13A or Figure 13B. Here, the division mode of the prediction group of the current image block shown in Figure 13A and Figure 13B is the same as that of Figure 12, but the prediction mode is different. Specifically, for any 16x2 current image block, the values of one column (2 pixels) to the left and one row (16 pixels) above it may be referenced. The leftmost pixel of the 16x2 current image block is called the first pixel.
[0226] Scheme 1: As shown in Figure 13A, the prediction modes include:
[0227] a) For the kN+1 (N is preferably 4, k=1, 2 or 3) pixel in Group1 and Group2, use the reconstructed value of the pixel above it as the predicted value for the current pixel.
[0228] b) For pixels in Group 2 except for the kN+1 (N is preferably 4, k=1, 2 or 3)-th pixel, use the reconstructed value of the pixel to the left of it as the predicted value of the current pixel.
[0229] c) Optionally, the predicted values of the pixels in Group1, except for the kN+1th pixel (N is preferably 4, and k=1, 2, or 3), are set to a preset value (i.e., a default value). Optionally, for the other pixels, the average value (e.g., (P0+P1+1)>>1) of the reconstructed value of the pixel above it (the reconstructed value of the other upper adjacent block, denoted as P0) and the reconstructed value of the pixel below it (the reconstructed value of group2, denoted as P1) is used as the predicted value of the current pixel. Here, ">>" represents an integer right shift. "a>>N" represents a right shift of N bits, which is similar to dividing a by the Nth power of 2, so ">>1" is equivalent to dividing by 2.
[0230] Scheme 2: As shown in Figure 13B, the prediction modes include:
[0231] d) For the kN+2 (N is preferably 5, k=1, 2) pixel in Group1 and Group2, use the reconstructed value of the pixel above it as the predicted value of the current pixel.
[0232] e) For pixels in Group2 except for the kN+2 (N is preferably 5, k=1, 2)-th pixel, the reconstructed value of the pixel to the left of the pixel is used as the predicted value of the current pixel.
[0233] f) Optionally, for pixels in Group 1 other than the kN+2 (N is preferably 5, k=1, 2)-th pixel, the average value (e.g., (P0+P1+1)>>1, shifted 1 bit to the right, i.e., divided by 2) of the reconstructed value of the pixel above it (the reconstructed value of the other adjacent block above, denoted as P0) and the reconstructed value of the pixel below it (the reconstructed value of Group 2, denoted as P1) is used as the predicted value of the current pixel.
[0234] 2) One prediction division mode of a 16x2 current image block is as shown in Figure 14, where the current image block includes Groups 1 and 2. Specifically, Group 1 consists of pixels in the first row, and horizontal prediction is used for Group 1; Group 2 consists of pixels in the second row, and horizontal prediction is used for Group 2.
[0235] In order to improve the parallelism in the prediction process, the embodiment of the present invention is applied to the embodiment shown in Figure 11, and one prediction division mode of a 16x2 current image block is as shown in Figures 15A to 15D. Here, the division mode of the prediction group of the current image block shown in Figures 15A to 15D is the same as that in Figure 14, but the prediction mode is different. Specifically, it includes:
[0236] Scheme 1: As shown in Figure 15A, the prediction modes include:
[0237] a) For the kN+1 (N is preferably 4, k=1, 2, 3) th pixel in Group1 and Group2, use the reconstructed value of the pixel above it as the predicted value for the current pixel.
[0238] b) For other pixels in Group1 and Group2, use the reconstructed value of the pixel to its left as the predicted value for the current pixel.
[0239] Scheme 2: As shown in Figure 15B, the prediction modes include:
[0240] For the kN+1 (N is preferably 4, k=2, 3)-th pixel in Group1 and Group2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel to the left is used as the predicted value of the current pixel.
[0241] Scheme 3: As shown in Figure 15C, the prediction modes include:
[0242] For the kN+2 (N is preferably 5, k=1, 2)-th pixel in Group1 and Group2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel to the left is used as the predicted value of the current pixel.
[0243] Scheme 4: As shown in Figure 15D, the prediction modes include:
[0244] For the kN+1 (N is preferably 8, k=1)th pixel in Group1 and Group2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel to the left is used as the predicted value of the current pixel.
[0245] In the above-mentioned first and second embodiments, N and k may be other values. Furthermore, when the number of consecutive pixels in a prediction group is different, the values of N and k may be different accordingly.
[0246] The reconstruction values of the current image blocks surrounding the current image block of the pixels marked in black in FIGS. 13A-13B and 15A-15D may be set to default values if they are not available.
[0247] The current image block of 8x2 is targeted, and specifically, it may be an 8x2 luma block or an 8x2 chroma block.
[0248] One grouping division mode for an 8x2 current image block is shown in Figures 16A and 16B, where for any 8x2 current image block, the reconstructed values of the pixels in one column (2 pixels) on the left and one row (8 pixels) on the top may be referenced.
[0249] As shown in FIG. 16A, in predictive split mode A, for every pixel, the reconstructed value of the pixel above is used as the predicted value of the current pixel.
[0250] As shown in FIG. 16B, in predictive split mode B, for every pixel, the reconstructed value of the pixel to its left is used as the predicted value of the current pixel.
[0251] In order to improve the parallelism in the prediction process, in the embodiment of the present invention shown in FIG. 11, one prediction division mode of the 8x2 current image block is as shown in FIG. 17.
[0252] 17, for the kN+1 (N is preferably 4, k=1)-th pixel in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel to the left is used as the predicted value of the current pixel.
[0253] The current image block of 8x1 is targeted, and specifically, it may be an 8x1 luma block or an 8x1 chroma block.
[0254] One grouping division mode for an 8x1 current image block is as shown in Figures 18A and 18B. Here, for any 8x1 current image block, the reconstructed values of the pixels in one column (one pixel) on the left and one row (eight pixels) on the top may be referenced. As shown in Figure 18A, in prediction division mode A, for all pixels, the reconstructed values of the pixels on the top are used as the predicted values of the current pixel. As shown in Figure 18B, in prediction division mode B, for all pixels, the reconstructed values of the pixels on the left are used as the predicted values of the current pixel.
[0255] In Figures 18A and 18B, the 8x1 current image block is divided into one prediction group.
[0256] In order to improve the parallelism in the prediction process, in the embodiment of the present invention shown in FIG. 11, one prediction division mode of the 8×1 current image block is as shown in FIG. 19.
[0257] 19, for the kN+1 (N is preferably 4, k=1)th pixel of the 8x1 current image block, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel to the left is used as the predicted value of the current pixel.
[0258] In one example, in any of the above schemes, if the current image block is in the first column of an image frame or an independent coding (decoding) unit, there is no pixel to the left of the current image block, and in this case, a default value may be used instead of the reconstructed value, for example, the default value may be 1<<(bit_depth-1).
[0259] Similarly, in any of the above schemes, if the current image block is in the first row of an image or an independent coding (decoding) unit, there is no pixel above the current image block, and in this case, a default value may be used instead of its reconstruction value. For example, the default value may be 1<<(bit_depth-1), where bit_depth represents the bit width of the current image block, and may be, for example, 8, 9, 10, 12, or 16. 1<<(bit_depth-1) represents shifting bit_depth-1 to the left by 1 bit.
[0260] In the present invention, the reconstructed values of a pixel can be regarded as the pixel value of a certain component of the pixel. For example, the component here may be the red (R) component, the green (G) component, or the blue (B) component in an RGB format, or the luma (Y) component, the chroma (Cb) component, or the chroma (Cr) component in a YCbCr format. The size of each component may be the same as the image size or smaller than the image size. For example, in the YUV420 format, the size of Y is equal to the image size, but the width and height of U or V are only half of Y, i.e., their size is only 1 / 4 of the image size. Based on this, the bit_depth here may represent the bit width of the current image block in a certain component.
[0261] In any of the above schemes, for each Group, other prediction modes may be used in addition to the above horizontal or vertical prediction modes. One possible prediction mode is to perform reference prediction using pixel values of neighboring image blocks or neighboring independent image blocks.
[0262] Example 5
[0263] In some embodiments of the present invention, the encoding side may group the residual blocks of the encoding unit, specifically, the pixels of each row of the encoding unit are set as a prediction group, and the residual blocks of the prediction group are divided into at least one residual sub-block.
[0264] Partition mode 1: The residual block of one prediction group is divided into one residual sub-block, which is equivalent to not grouping the residual block, as shown in diagram a of Figure 20.
[0265] Partition mode 2: A residual block of one prediction group is divided into multiple residual sub-blocks. Specifically, the residual block of one prediction group is divided into multiple residual sub-blocks according to a preset ratio. The present invention does not limit the preset ratio. The multiple residual sub-blocks may be of equal size, or some of the residual sub-blocks may be of equal size.
[0266] For example, as shown in FIG. 20b, the residual block of one prediction group is divided into two residual sub-blocks according to a 1:1 ratio.
[0267] For example, as shown in FIG. 20c, the residual block of one prediction group is divided into three residual sub-blocks according to a ratio of 2:1:1.
[0268] For example, as shown in FIG. 20d, the residual block of one prediction group is divided into three residual sub-blocks according to a ratio of 1:1:2.
[0269] For example, as shown in diagram e of FIG. 20, the residual block of one prediction group is divided into four residual sub-blocks according to a ratio of 1:1:1:1.
[0270] 20A to 20E are each illustrated using an example in which the coding unit is 16x2 and each row is a prediction group. The 16x2 coding unit may be a luma block or a chroma block. Each small rectangle in each diagram represents one pixel, and small rectangles of the same type (e.g., all white rectangles or rectangles marked with the same color) represent pixels in the same residual sub-block.
[0271] In addition, for an 8x1 prediction group, the residual block of the prediction group may be divided into one residual sub-block, or may be equally divided into two residual sub-blocks. Of course, specific implementation is not limited to these.
[0272] In one example, the coefficient coding schemes of pixels in the same residual sub-block are the same, or the coding lengths of pixels in the same residual sub-block, i.e., the number of bits occupied by the residual coefficients after being coded, are the same.
[0273] In one example, FIG. 20 above shows five partition modes of the residual block.
[0274] In one example, the division mode GPM may be represented by one bit or three bits (as shown in Table 4), where GP0 to GP4 may correspond to diagrams a to e in FIG. [Table 4]
[0275] The index coding method of the residual block partition mode shown in Table 4 may be applied to the partition modes of residual blocks of prediction groups of other sizes, and other partition modes of the prediction groups mentioned above.
[0276] When a residual block is divided into a large number of residual sub-blocks, a large amount of partition mode information needs to be coded, whereas when a residual block is divided into a small number of residual sub-blocks, residuals with different characteristics are grouped into one group, resulting in poor coding efficiency of residual coefficients. Taking at least these two aspects into consideration, an embodiment of the present invention provides the above-mentioned residual block division method.
[0277] Example 6
[0278] As shown in Figure 21, there is provided a schematic diagram of an image reconstruction method, which is applicable to both image encoding and decoding methods, according to an embodiment of the present invention. The method shown in Figure 21 may include the following steps:
[0279] S801: Determine a target prediction mode for a current image block, where the current image block includes at least one prediction group, and any prediction group of the at least one prediction group includes a plurality of consecutive pixels, where the plurality of consecutive pixels may be a plurality of consecutive pixels in a row or a plurality of consecutive pixels in a column.
[0280] When this embodiment is applied to an image coding method, the execution body of this embodiment may be the coding side, and the current image block is specifically the image block to be coded or the unit to be coded.
[0281] When this embodiment is applied to an image decoding method, the execution body of this embodiment may be a decoding side, and the current image block may be a specific image block to be decoded or a unit to be decoded. S801 may include analyzing a bitstream to obtain an index of a target prediction mode of the current image block.
[0282] S802: If the target prediction mode satisfies a preset condition, determine a reconstructed value of a target pixel based on a reference value of a first pixel of the consecutive pixels and residual values of each of two adjacent pixels between the first pixel and the target pixel, where the target pixel is any one of the consecutive pixels other than the first pixel, and the reconstructed block of the current image block includes the reconstructed value of the target pixel.
[0283] In one example, a first prediction scheme is used for a first pixel of the consecutive pixels, and a second prediction scheme is used for the non-first pixels. The target prediction mode includes the first prediction scheme and the second prediction scheme. In this case, the target prediction mode satisfying the predetermined condition includes any one of the following conditions:
[0284] Condition 1: The first prediction method and the second prediction method are both horizontal prediction.
[0285] Condition 2: The first prediction method and the second prediction method are both vertical prediction.
[0286] Condition 3: One of the first prediction method and the second prediction method is horizontal prediction, and the other is vertical prediction. For example, the first prediction method is horizontal prediction, and the second prediction method is vertical prediction. As another example, the first prediction method is vertical prediction, and the second prediction method is horizontal prediction.
[0287] Condition 4: The first prediction method is a method of performing reference prediction using pixel values of image blocks adjacent to the current image block or pixel values of independent coding (decoding) units adjacent to the independent coding (decoding) unit in which the current image block is located. The second prediction method is horizontal prediction or vertical prediction.
[0288] In the image reconstruction method provided by this embodiment, when the encoding side / decoding side performs reconstruction, it can directly obtain the reconstructed value of the current pixel based on the residual value between the previous pixel and its adjacent pixels, without waiting to obtain the reconstructed value of the previous pixel. This technical solution can also greatly improve the parallelism of the reconstruction process, thereby improving the decoding parallelism and throughput.
[0289] For simplicity, the following description will be given taking the prediction mode of the 8×1 image block shown in Fig. 22 as an example. Other image blocks or other prediction modes can be easily inferred by analogy, and therefore will not be described here.
[0290] The reconstruction value of the current 8x1 image block is R(i), the residual value is Res(i), and the predicted value is Pred(i), i = 0, 1,..., 7. As shown in Figure 22, the reconstruction value of the 8x1 block above the current 8x1 block is RA(i), i = 0, 1,..., 7, and the reconstruction value of the pixel to the left is RLi, i = 0, 1. Here, Figure 22 is drawn based on Figure 19.
[0291] Based on the traditional method, the predicted value of an 8x1 image block is If i = 0, Pred(i) = RL0, If i=1, 2 or 3, Pred(i)=R(i-1), If i=4, Pred(i)=RA(4), If i=5, 6 or 7, then Pred(i)=R(i-1).
[0292] From the above, in the conventional method, the reconstructed value of an 8x1 image block is R(i) = Pred(i) + Res(i) == R(i-1) / RA(4) + Res(i), i = 0, 1, ... 7.
[0293] Based on the method shown in Figure 21, For i=0, R(0)=Pred(0)+Res(0)=RL0+Res(0), For i=1, R(1)=Pred(1)+Res(1), and since Pred(1)=R(0), R(1)=R(0)+Res(1)=RL0+Res(0)+Res(1).
[0294] Similarly, for i=2 or 3, R(2)=RL0+Res(0)+Res(1)+Res(2), and R(3)=RL0+Res(0)+Res(1)+Res(2)+Res(3).
[0295] From the above, for any value of i=0 to 3,
number
[0296] According to this method, when a pixel i=1, 2, or 3 is reconstructed, it is not necessary to wait for the reconstructed value of the pixel to its left to be generated, but the reconstructed value of the current pixel can be directly obtained by simply obtaining the pixel value RL0 to its left in the current image block and the residual value between the current pixel and the pixel to its left, which can also significantly improve decoding parallelism and throughput.
[0297] Similarly, for i=4 to 7,
number
[0298] The reconstructed values of the pixels i=5 to 7 can also be obtained without waiting for the reconstructed values of the pixels to the left of them.
[0299] Some or all of the technical features of any of the above-described embodiments may be combined to form a new embodiment, provided that there is no contradiction. In addition, the technical solutions provided by any of the above-described embodiments may be applied to 16x2, 8x2, or 8x1 image blocks, and of course, to other MxN image blocks, such as 4x2 or 16x4.
[0300] To realize the functions in the above embodiments, the encoder / decoder includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art can easily understand that the present invention can be realized in the form of hardware or a combination of hardware and computer software, with reference to the units and method steps of each example described in the embodiments disclosed in the present invention. Whether a function is implemented by hardware or by computer software driving hardware depends on the specific application scenario and design constraints of the technical solution.
[0301] The following describes a decoding device and an encoding device provided by an embodiment of the present invention. In one example, the decoding device provided below may be the destination device 12 or the decoder 122 in Fig. 2, or the decoder 30 in Fig. 6. In another example, the encoding device provided below may be the source device 11 or the encoder 112 in Fig. 2, or the encoder 20 in Fig. 3. This is a uniform method, and will not be described below.
[0302] 23 is a schematic structural diagram of a decoding device 3000 provided by the present invention, which may implement any of the above-described embodiments of the decoding method. The decoding device 3000 includes a bitstream parsing unit 3001, a determining unit 3002, and a reconstruction unit 3003. The bitstream parsing unit 3001 is used to parse a bitstream to obtain a first syntax element, which includes an index of a target prediction mode of a unit to be decoded. The determining unit 3002 is used to determine a target prediction mode from an index table based on the index of the target prediction mode. The index table includes correspondences between multiple prediction mode indexes and multiple prediction modes. The reconstruction unit 3003 is used to reconstruct the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode.
[0303] In one example, the bitstream parsing unit 3001 may be realized by the bitstream parsing unit 301 in Figure 6. The decision unit 3002 may be realized by the prediction processing unit 304 in Figure 6. The reconstruction unit 3003 may be realized by combining the prediction processing unit 304 and the reconstruction unit 305 in Figure 6. The current image block in Figure 6 may be the unit to be decoded in this embodiment. For more detailed descriptions of the above bitstream parsing unit 3001, the decision unit 3002 and the reconstruction unit 3003, more detailed descriptions of their respective technical features, and descriptions of their beneficial effects, please refer to the above corresponding method embodiments, and therefore will not be described here.
[0304] 24 is a schematic structural diagram of an encoding device 3100 provided by the present invention, which includes a prediction unit 3101 and a coding unit 3102. The prediction unit 3101 is used to determine a target prediction mode of a unit to be encoded and to determine an index of the target prediction mode from an index table based on the target prediction mode. The index table includes indexes of multiple prediction modes and corresponding relationships between the multiple prediction modes. The coding unit 3102 is used to code the index of the target prediction mode into a bitstream.
[0305] In one example, the prediction unit 3101 may be realized by the prediction processing unit 201 in Figure 3, and the encoding unit 3102 may be realized by the coefficient encoding unit 205 in Figure 3. The current image block in Figure 3 may be the encoding unit of this embodiment. For more detailed descriptions of the above prediction unit 3101 and encoding unit 3102, more detailed descriptions of their respective technical features, and descriptions of their beneficial effects, please refer to the above corresponding method embodiments, and therefore will not be described here.
[0306] 25 is a schematic structural diagram of an encoding / decoding device 3200 provided by the present invention, which includes a decision unit 3201, a prediction unit 3202, and a reconstruction unit 3203. The decision unit 3201 is used to determine the residual coding mode of a current image block. When the residual coding mode is a skip residual coding mode, the prediction unit 3202 is used to predict the current image block to obtain a predicted block, and the reconstruction unit 3203 is used to determine the predicted block as a reconstructed block of the current image block. When the residual coding mode is a normal residual coding mode, the decision unit 3201 is further used to obtain residual quantization-related values of the current image block to obtain a residual block, and the reconstruction unit 3203 is used to reconstruct the current image block based on the residual block to obtain a reconstructed block of the current image block.
[0307] In one example, the decision unit 3201 may be realized by the bitstream analysis unit 301 in Figure 6, the prediction unit 3202 may be realized by the prediction processing unit 304 in Figure 6, and the reconstruction unit 3203 may be realized by the reconstruction unit 305 in Figure 6. In another example, the decision unit 3201 may be realized by the residual coding unit 203 in Figure 3, the prediction unit 3202 may be realized by the prediction processing unit 201 in Figure 3, and the reconstruction unit 3203 may be realized by the reconstruction unit 208 in Figure 3. For more detailed descriptions of the above decision unit 3201, the prediction unit 3202, and the reconstruction unit 3203, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the above corresponding method embodiments, and therefore description will be omitted here.
[0308] 26 is a schematic structural diagram of an encoding / decoding device 3300 provided by the present invention, which includes a determining unit 3301, a predicting unit 3302, a reconstruction unit 3303, and an obtaining unit 3304. The determining unit 3301 is used to determine a target prediction mode of a current image block. If the target prediction mode is a prediction mode based on skip residual coding, the predicting unit 3302 is used to predict the current image block to obtain a prediction block, and the reconstruction unit 3303 is used to determine the prediction block as a reconstructed block. If the target prediction mode is a prediction mode based on normal residual coding, the obtaining unit 3304 is used to obtain residual quantization-related values of the current image block to obtain a residual block of the current image block, and the reconstruction unit 3303 is used to reconstruct the current image block according to the target prediction mode and the residual block to obtain a reconstructed block.
[0309] In one example, the determining unit 3301 may be realized by the bitstream parsing unit 301 in Figure 6, the prediction unit 3302 may be realized by the prediction processing unit 304 in Figure 6, the reconstruction unit 3303 may be realized by the reconstruction unit 305 in Figure 6, and the obtaining unit 3304 may be realized by the bitstream parsing unit 301 and the residual decoding unit 303 in Figure 6. In another example, the determining unit 3301 and the prediction unit 3302 may be realized by the prediction processing unit 201 in Figure 3, the reconstruction unit 3303 may be realized by the reconstruction unit 208 in Figure 3, and the obtaining unit 3304 may be realized by the residual decoding unit 303 in Figure 3. For more detailed descriptions of the above determining unit 3301, the prediction unit 3302, the reconstruction unit 3303, and the obtaining unit 3304, more detailed descriptions of their respective technical features, and descriptions of their beneficial effects, please refer to the above corresponding method embodiments, and therefore description will be omitted here.
[0310] 27 is a schematic structural diagram of an encoding / decoding device 3400 provided by the present invention, which includes a determination unit 3401 and a reconstruction unit 3402. The determination unit 3401 is used to determine a prediction mode of at least one prediction group into which a current image block is divided. Here, any prediction group of the at least one prediction group includes a plurality of consecutive pixels in the same row / column, and any prediction group includes a first designated pixel region and a second designated pixel region. The first designated pixel region includes a plurality of pixel groups, and the plurality of pixel groups are obtained by dividing based on the second designated pixel region. The prediction methods of the first designated pixel region and the second designated pixel region are different, and the plurality of pixel groups can be predicted in parallel, and each pixel group includes one or a plurality of consecutive pixels. The reconstruction unit 3402 is used to reconstruct the current image block to obtain a reconstructed block based on the prediction mode of the at least one prediction group.
[0311] In one example, the determining unit 3401 may be realized by the bitstream parsing unit 301 in Figure 6, and the reconstruction unit 3402 may be realized by both the prediction processing unit 304 and the reconstruction unit 305 in Figure 6. In another example, the determining unit 3401 may be realized by the prediction processing unit 201 in Figure 3, and the reconstruction unit 3402 may be realized by the reconstruction unit 208 in Figure 3. For more detailed descriptions of the above determining unit 3401 and the reconstruction unit 3402, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the above corresponding method embodiments, and therefore description will be omitted here.
[0312] 28 is a schematic structural diagram of an encoding / decoding device 3500 provided by the present invention, which includes a determination unit 3501 and a reconstruction unit 3502. The determination unit 3501 is used to determine a target prediction mode of a current image block. Here, the current image block includes at least one prediction group, and any prediction group of the at least one prediction group includes a plurality of consecutive pixels. If the target prediction mode satisfies a predetermined condition, the reconstruction unit 3502 is used to determine a reconstructed value of the target pixel based on a reference value of a first pixel of the consecutive pixels and residual values of each of two adjacent pixels between the first pixel and the target pixel. Here, the target pixel is any one of the consecutive pixels other than the first pixel, and the reconstructed block of the current image block includes the reconstructed value of the target pixel.
[0313] In one example, the decision unit 3501 may be realized by the bitstream analysis unit 301 in Figure 6, and the reconstruction unit 3502 may be realized by both the prediction processing unit 304 and the reconstruction unit 305 in Figure 6. In another example, the decision unit 3501 may be realized by the prediction processing unit 201 in Figure 3, and the reconstruction unit 3502 may be realized by the reconstruction unit 208 in Figure 3. For more detailed descriptions of the above decision unit 3501 and the reconstruction unit 3502, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the above corresponding method embodiments, and therefore description will be omitted here.
[0314] The present invention further provides an electronic device for performing any of the above-described embodiments of the decoding method. As shown in FIG. 29, FIG. 29 is a schematic structural diagram of an electronic device provided by the present invention, where the electronic device 3600 includes a processor 3610 and an interface circuit 3620. The processor 3610 and the interface circuit 3620 are coupled to each other. The interface circuit 3620 may be a transceiver or an input / output interface. In one example, the electronic device 3600 may further include a memory 3630 for storing instructions to be executed by the processor 3610, for storing input data required for the processor 3610 to execute the instructions, or for storing data generated after the processor 3610 executes the instructions.
[0315] The electronic device 3600 includes a processor 3610 and a communication interface 3620. The processor 3610 and the communication interface 3620 are coupled to each other. The communication interface 3620 may be a transceiver or an input / output interface. In one example, the electronic device 3600 may further include a memory 3630 for storing instructions to be executed by the processor 3610, for storing input data required for the processor 3610 to execute the instructions, or for storing data generated after the processor 3610 executes the instructions.
[0316] In an embodiment of the present invention, the specific connection medium between the communication interface 3620, the processor 3610, and the memory 3630 is not limited. In an embodiment of the present invention, the communication interface 3620, the processor 3610, and the memory 3630 are connected via a bus 3640 in FIG. 29 . The bus is shown by a bold line in FIG. 29 . The connection method between the other components is merely exemplary and is not particularly limited. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one bold line is shown in FIG. 29 , but this does not mean that there is only one bus or only one type of bus.
[0317] The memory 3630 may be used to store software programs and modules, such as program instructions / modules corresponding to the decoding or encoding methods provided by embodiments of the present invention, and the processor 3610 executes the software programs and modules stored in the memory 3630 to perform various functional applications and data processing, thereby implementing any of the decoding or encoding methods provided above. The communication interface 3620 may be used to communicate signaling and data with other devices. In the present invention, the electronic device 3600 may have multiple communication interfaces 3620.
[0318] The processor in embodiments of the present invention may be a central processing unit (CPU), neural processing unit (NPU), or graphic processing unit (GPU), or may be other general-purpose processor, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0319] The steps of the method in the embodiments of the present invention may be implemented by hardware or by a processor executing software instructions. The software instructions may be configured with corresponding software modules, which may be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from and write information to the storage medium. Of course, the storage medium may be a component of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may also be located in a network device or a terminal device. Of course, the processor and the storage medium may reside as separate components in the network device or the terminal device.
[0320] An embodiment of the present invention further provides an image encoding and decoding system, including an encoding side and a decoding side, where the encoding side may be used to perform any of the encoding methods provided above, and the decoding side may be used to perform a corresponding decoding method.
[0321] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are performed. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, user equipment, or other programmable device. The computer programs or instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer programs or instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless communication. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device such as a server or data center that aggregates one or more available media. The available medium may be a magnetic medium such as a floppy disk, hard disk, or magnetic tape, an optical medium such as a digital video disc (DVD), or a semiconductor medium such as a solid state drive (SSD).
[0322] In each embodiment of the present invention, unless there is a special explanation or logical contradiction, the terms and / or descriptions between different embodiments are consistent and can be referenced, and the technical features in different embodiments can be combined according to their internal logical relationships to form new embodiments. In this invention, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the relationship between related objects and indicates that three types of relationships may exist. For example, A and / or B can represent A alone, A and B simultaneously, or B alone, and A and B may be singular or plural. In the textual description of the present invention, the character " / " generally indicates that the related objects before and after have an "or" relationship. In the formula of the present invention, the character " / " indicates that the related objects before and after have a "division" relationship.
[0323] The various numbers used in the embodiments of the present invention are merely for the convenience of explanation and are not intended to limit the scope of the embodiments of the present invention. The magnitude of the numbers of the above processes does not indicate the order of execution, and the order of execution of each process should be determined by its function and internal logic.
Claims
1. Parsing the bitstream to obtain a first syntax element, the first syntax element including an index of a target prediction mode of a unit to be decoded; determining the target prediction mode from an index table based on an index of the target prediction mode, the index table including a correspondence between indexes of a plurality of prediction modes and the plurality of prediction modes; reconstructing the unit to be decoded based on at least the target prediction mode to obtain a reconstructed block; the plurality of prediction modes include an original value mode and another prediction mode, the other prediction mode including at least one of a point prediction mode, an intra-frame prediction mode, or a block copy mode; Or, the plurality of prediction modes include an original value mode and another prediction mode, and the other prediction mode includes at least one of a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding; 1. An image decoding method comprising:
2. the indexes of the plurality of prediction modes are generated in a binary tree manner.
2. The method of claim 1 .
3. a codeword length of an index of the original value mode is equal to or greater than a codeword length of an index of one or more of the other prediction modes; 2. The method of claim 1 .
4. The plurality of prediction modes include an original value mode, a point prediction mode, an intra-frame prediction mode, and an intra-frame block copy mode. When the indexes of the plurality of prediction modes are generated in a binary tree manner, the rule for generating the indexes of the plurality of prediction modes is as follows: using 1 as the most significant flag bit of the index for the original value mode and the intra-frame prediction mode; using 1, 011, 010, 0011, 0010, 00001, 00000 as the remaining flag bits for different intra-frame prediction modes, respectively; using 0001 as the remaining flag bits for the original value mode; 2. The method of claim 1 .
5. the plurality of prediction modes include an original value mode, a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, and a block copy mode based on normal residual coding, and the step of reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode includes: When the target prediction mode is a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding, the method includes analyzing a residual quantization-related value of the unit to be decoded to obtain a residual block of the unit to be decoded, and reconstructing the unit to be decoded based on the target prediction mode and the residual block to obtain the reconstructed block.
2. The method of claim 1 .
6. Pixels of each row of the unit to be decoded are set as one prediction group, and a residual block of the prediction group is divided into at least one residual sub-block.
6. The method of claim 5.
7. The division of a residual block of a prediction group into multiple residual sub-blocks is Dividing the residual block of one prediction group into two residual sub-blocks according to a 1:1 ratio; or Dividing the residual block of one prediction group into three residual sub-blocks according to a ratio of 2:1:1; or Dividing the residual block of one prediction group into three residual sub-blocks according to a ratio of 1:1:2; or dividing a residual block of one prediction group into four residual sub-blocks according to a ratio of 1:1:1:1; 7. The method of claim 6.
8. the unit to be decoded includes at least one prediction group; any one of the at least one prediction groups includes a plurality of consecutive pixels in the same row / column, the any one prediction group includes a first designated pixel area and a second designated pixel area, the first designated pixel area includes a plurality of separated pixel groups, the plurality of separated pixel groups are obtained by dividing based on the second designated pixel area and are predicted by a prediction method different from that of the first designated pixel area and the second designated pixel area, the plurality of separated pixel groups can be predicted in parallel, and the pixel group includes one or a plurality of consecutive pixels; 2. The method of claim 1 .
9. When any of the prediction groups includes a plurality of consecutive pixels in the same row, vertical prediction is used for the first designated pixel region, and horizontal prediction or vertical average prediction is used for the second designated pixel region; and / or When any of the prediction groups includes a plurality of consecutive pixels in the same column, horizontal prediction is used for the first designated pixel region, and vertical prediction or horizontal average prediction is used for the second designated pixel region.
9. The method of claim 8.
10. The difference in the number of pixels included in different pixel groups is equal to or less than a threshold value.
9. The method of claim 8.
11. When the unit to be decoded does not have a reference block, the reconstructed value of the first pixel of the unit to be decoded is a value obtained by shifting the bit width of the unit to be decoded by one bit to the left.
9. The method of claim 8.
12. The unit to be decoded includes at least one prediction group, and any prediction group of the at least one prediction group includes a plurality of consecutive pixels, and the step of reconstructing the unit to be decoded based on at least the target prediction mode to obtain a reconstructed block includes: and if the target prediction mode satisfies a preset condition, determining a reconstructed value of the target pixel based on a reference value of a first pixel of the consecutive pixels and residual values between all adjacent pixels between the first pixel and the target pixel, wherein the target pixel is a non-first pixel of any one of the consecutive pixels, and the reconstructed block includes the reconstructed value of the target pixel.
2. The method of claim 1 .
13. a bitstream parsing unit for parsing a bitstream to obtain a first syntax element, the first syntax element including an index of a target prediction mode of a unit to be decoded; a determination unit for determining the target prediction mode from an index table based on an index of the target prediction mode, the index table including a correspondence relationship between a plurality of prediction mode indexes and the plurality of prediction modes; a reconstruction unit for reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode; the plurality of prediction modes include an original value mode and another prediction mode, the other prediction mode including at least one of a point prediction mode, an intra-frame prediction mode, or a block copy mode; Or, the plurality of prediction modes include an original value mode and another prediction mode, and the other prediction mode includes at least one of a point prediction mode based on normal residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding; An image decoding device comprising:
14. An electronic device including a processor and a memory, the memory being used to store computer instructions, the processor retrieving and executing the computer instructions from the memory, and the electronic device being used to perform the method of any one of claims 1 to 12. An electronic device characterized by:
15. A computer readable storage medium storing a computer program or instructions, which when executed by an electronic device performs the method of any one of claims 1 to 12. A computer-readable storage medium comprising:
Citation Information
Patent Citations
Compressor, decompressor and image processing apparatus
JP2015005903A
Method for video coding with spatial prediction mode for multi-mode video coding
US20160044308A1
Image processing device
US20190238832A1
Image encoding device and image decoding device
WO2018003008A1
Image coding / decoding method and device, and image processing apparatus
WO2018068259A1