Image encoding and decoding method, device, and storage medium

JP2024545826A5Active Publication Date: 2025-02-20HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
JP2024541071
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2022-01-07
Filing Date
2023-01-05
Publication Date
2025-02-20
Estimated Expiration
2043-01-05

AI Technical Summary

Technical Problem

Existing video encoding techniques face challenges in efficiently encoding and decoding video data due to redundant information, leading to increased storage space and transmission bandwidth requirements.

Method used

An image encoding and decoding method that reduces decoding complexity by determining the target prediction mode directly from an index table, eliminating the need to analyze flag bits, and optimizes bitstream transmission through truncated unary and binary tree coding of prediction mode indices.

Benefits of technology

This approach enhances encoding and decoding efficiency by reducing decoding complexity and bitstream transmission overhead, while allowing for parallel processing of pixel groups, thereby improving overall video data handling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses an image encoding and decoding method, an apparatus, and a storage medium, which are related to the technical field of image encoding and decoding and are useful for improving encoding and decoding efficiency. One image decoding method includes the steps of: analyzing 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; determining a target prediction mode from an index table based on the index of the target prediction mode, the index table including a correspondence between a plurality of prediction mode indexes and a plurality of prediction modes; and reconstructing the unit to be decoded to obtain a reconstructed block based on at least the target prediction mode.
Need to check novelty before this filing date? Find Prior Art

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, device, and storage medium. [Background technology]

[0002] A complete image in a video is usually called a "frame", and a video consisting of a number of frames arranged in time series is called a video sequence. A video sequence has a series of redundant information, such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove the redundant information in a video sequence as much as possible and reduce the amount of data for representing a video, a video coding technique has been proposed that achieves the effects of reducing storage space and saving transmission bandwidth. The video coding technique may also be called a video compression technique.

[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 problem. 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, an image decoding method is provided, comprising: 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; determining a target prediction mode from an index table based on the index of the target prediction mode, the index table including a correspondence between a plurality of prediction mode indexes and a 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 on the decoding side and improving the decoding efficiency.

[0006] In one possible embodiment, the indices of the multiple prediction modes are generated in a truncated unary code manner, which helps to further reduce the overhead of bitstream transmission.

[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 another prediction mode, 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 the usage frequency of some other prediction modes is higher than the usage frequency of 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 modes include at least one of a point prediction mode, an intra-frame prediction mode, or a block copy mode.

[0010] In one possible embodiment, the multiple 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 indexes of the multiple prediction modes are generated in a binary tree manner, a generation rule for the indexes of the multiple prediction modes includes using 1 as the most significant flag bit of the indexes 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 bit 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; analyzing the residual quantization-related value 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 intraframe 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 intraframe 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 prediction block of the unit to be decoded as a reconstructed block of the unit to be decoded if 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 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 of the unit to be decoded to obtain a reconstructed block of the unit to be decoded if the target prediction mode is a point prediction mode based on skip residual coding, an intra-frame prediction mode based on normal residual coding, or a block copy mode based on normal residual coding.

[0014] In one possible embodiment, the pixels of each row of the unit to be decoded are taken as 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, splitting the residual block of a predictive group into a plurality of residual sub-blocks includes splitting the residual block of one predictive group into two residual sub-blocks in a 1:1 ratio, or splitting the residual block of one predictive group into three residual sub-blocks in a 2:1:1 ratio, or splitting the residual block of one predictive group into three residual sub-blocks in a 1:1:2 ratio, or splitting the residual block of one predictive 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, where the first designated pixel region includes multiple pixel groups, where the multiple pixel groups are obtained by dividing 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, where the multiple pixel groups can be predicted in parallel, and where the pixel group includes one or multiple consecutive pixels.

[0017] In one possible embodiment, if any prediction group includes 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 includes 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, one of which 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 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, wherein the target pixel is any one of the non-first pixels of the 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 scheme is used for the initial pixel and a second prediction scheme is used for the non-initial pixel, the target prediction mode includes a first prediction scheme and a second prediction scheme, and the target prediction mode satisfying a preset condition includes that the first prediction scheme and the second prediction scheme are both horizontal prediction, or that the first prediction scheme and the second prediction scheme are both vertical prediction, or that one of the first prediction scheme and the second prediction scheme is horizontal prediction and the other is vertical prediction, or that the first prediction scheme is a scheme for 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 scheme is horizontal prediction or vertical prediction.

[0023] According to a second aspect, an image encoding method is provided, which includes 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 a correspondence 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) of whether the target prediction mode is an original value mode into the bitstream. In most cases, the original value mode is not used, for example, a point prediction mode or an intraframe prediction mode is usually used, so that there is no need to encode a flag bit (org_flag) indicating whether the original value mode is used, which helps to save overhead in bitstream transmission and improves encoding efficiency.

[0024] In one possible embodiment, the indices for the multiple prediction modes are generated in a truncated unary code 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 intraframe 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 intraframe 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, predicting the current image block to obtain a predicted block when the residual coding mode is a skip residual coding mode, and determining the predicted block as a reconstructed block of the current image block, and obtaining a residual quantization-related value of the current image block to obtain a residual block when the residual coding mode is a normal residual coding mode, 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, firstly, a residual coding mode is determined, and if the residual coding mode is a normal residual coding mode, a residual quantization-related value of the current image block is obtained, and if the residual coding mode is a skip residual coding mode, there is no need to obtain a residual quantization-related value of the current image block. In this way, if the residual coding mode is a normal residual coding mode, the coding side does not need to code the residual quantization-related value of the current image block into the bitstream, and the decoding side does not need to analyze the residual quantization-related value of the current image block, which is helpful to save the overhead of bitstream transmission, improve the coding efficiency, help reduce the complexity of decoding, and improve the decoding efficiency.

[0031] According to a fourth aspect, an image reconstruction method applicable to both image encoding and decoding methods is provided, which includes: 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, the existing residual coding mode and the prediction mode are combined into a new prediction mode provided by the embodiment of the present invention, so that the residual coding mode and the prediction mode do not need to be coded (decoded) respectively, and the new prediction mode can be coded (decoded) uniformly, which simplifies the implementation logic and helps to save the overhead of bitstream transmission.In addition, for the coding side (or decoding side), it may first code (or decode) the residual coding mode information (e.g., the index of the residual coding mode, e.g., res_skip_flag), and then determine whether to code (or decode) the residual quantization-related value (e.g., near value or QP value) according to the residual coding mode, so that when the residual coding mode is the skip residual coding mode, it does not need to code (or decode) the residual quantization-related value, which helps to save the overhead of bitstream transmission.

[0033] In one possible embodiment, the prediction mode based on skip residual coding includes a point prediction mode based on skip residual coding, an intraframe 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 intraframe prediction mode based on normal residual coding, or a block copy mode based on normal residual coding.

[0035] According to a fifth aspect, an image reconstruction method applicable to both image encoding and decoding methods is provided. The image reconstruction method includes: determining a prediction mode of at least one prediction group into which a current image block is divided, where one of the at least one prediction groups includes a plurality of consecutive pixels in the same row / column, and one of the prediction groups 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, where 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 the pixel group includes one or a plurality of 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. Since the technical solution allows a plurality of pixel groups in one prediction group to be predicted in parallel, it is helpful to shorten the prediction time of the prediction group.

[0036] In one possible embodiment, if any prediction group includes 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 includes 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 there is no reference block for the current image 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, and 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 a step of determining 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 a target pixel when a target prediction mode satisfies a predetermined condition, wherein the target pixel is a non-first pixel of 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 image encoding and decoding methods, the image reconstruction method comprising: determining a target prediction mode of a current image block, the current image block including at least one prediction group, and one of the at least one prediction group including a plurality of consecutive pixels; and, if the target prediction mode satisfies a preset condition, determining a reconstructed value of a target pixel based on a reference value of a first pixel of the plurality of 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 non-first pixels of the plurality of consecutive pixels, 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 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.

[0043] In one possible embodiment, a first prediction scheme is used for the initial pixel and a second prediction scheme is used for the non-initial pixel, the target prediction mode includes a first prediction scheme and a second prediction scheme, and the target prediction mode satisfying a preset condition includes that the first prediction scheme and the second prediction scheme are both horizontal prediction, or that the first prediction scheme and the second prediction scheme are both vertical prediction, or that one of the first prediction scheme and the second prediction scheme is horizontal prediction and the other is vertical prediction, or that the first prediction scheme is a scheme that performs 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 scheme is horizontal prediction or vertical prediction.

[0044] According to a seventh aspect, an image decoding device is provided, which may be a video decoder or a device including a video decoder. The decoding device includes modules for implementing the method in any one of the possible embodiments of the first, third, fourth, or fifth aspects. The decoding device 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, an image encoding device is provided, 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 the possible embodiments of the second, third, fourth, or fifth aspects. The encoding device 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.

[0046] According to a ninth aspect, the present invention provides an electronic device including a processor and a memory, the memory being used to store computer instructions, and the processor calling and executing the computer instructions from the memory, for 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 performed.

[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 embodiments of the first to sixth aspects.

[0049] According to a twelfth aspect, the present invention provides a chip including a processor and a memory, the memory being adapted to store computer instructions, the processor retrieving and executing the computer instructions from the memory, and adapted to implement a method according to any one of the embodiments 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 other aspects as long as there is no contradiction, thereby obtaining new examples. For example, any one image reconstruction method provided by the above third to fifth aspects may be applied to any one encoding method or decoding method provided by the first or second aspect. As another example, any two image reconstruction methods provided by the above third to fifth aspects may be combined as long as there is no contradiction, thereby obtaining a new reconstruction method. [Brief description of the drawings]

[0052] [Figure 1] FIG. 2 is a schematic diagram of multiple prediction schemes provided by an embodiment of the present invention; [Diagram 2] FIG. 1 is a schematic architecture diagram of an encoding and decoding system to which an embodiment of the present invention is applied; [Diagram 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 images, parallel coding units, independent coding units, and corresponding relationships among coding units provided by an embodiment of the present invention; FIG. [Diagram 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 flow chart 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 predictive partitioning mode for a 16×2 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] 2 is a schematic diagram of a predictive partitioning mode for a 16×2 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] FIG. 2 is a schematic diagram of predictive partitioning modes for an 8×2 current image block. [Figure 16B]FIG. 2 is a schematic diagram of predictive partitioning modes for an 8×2 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 FIG. 16A and FIG. 16B provided by an embodiment of the present invention; [Figure 18A] FIG. 2 is a schematic diagram of predictive partitioning modes for an 8×1 current image block. [Figure 18B] FIG. 2 is a schematic diagram of predictive partitioning modes for an 8×1 current image block. [Figure 19] FIG. 18C is a schematic diagram of a predictive partitioning mode of an 8×1 current image block corresponding to FIG. 18A and FIG. 18B provided by an embodiment of the present invention; [Figure 20] FIG. 2 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] FIG. 2 is a schematic diagram 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. [Diagram 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; [Diagram 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 PREFERRED EMBODIMENTS

[0053] First, technical terms related to the embodiments of the present invention will be described.

[0054] 1) Prediction mode

[0055] The combination of prediction schemes used to predict a current image block (e.g., a unit to be coded / unit to be decoded) is referred to as a prediction mode, where different prediction schemes may be used to predict different pixels in the current image block or the same prediction scheme may be used, and the prediction schemes used to predict all pixels in the current image block may collectively be referred to as the (or corresponding) prediction mode of the current image block.

[0056] The prediction modes may include a point prediction mode, an intra-frame prediction mode, a block copy mode, and an original value mode (i.e., a reconstructed value mode that directly decodes a fixed bit width), etc.

[0057] Exemplarily, 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. The vertical prediction uses a pixel value on the upper side (which may be the neighboring upper side or the non-neighboring but nearby upper side) of the current pixel to obtain a predicted value of the current pixel. As an example, the reconstructed value of the neighboring pixel on the upper side of the current pixel is determined as the predicted value of the current pixel. The horizontal prediction uses a pixel value on the left side (which may be the neighboring left side or the non-neighboring but nearby left side) of the current pixel to obtain a predicted value of the current pixel. As an example, the reconstructed value of the neighboring pixel on the left side of the current pixel is determined as the predicted value of the current pixel. The vertical average prediction uses pixel values ​​on the upper and lower sides of the current pixel to obtain a predicted value of the current pixel. As an example, the predicted value of the current pixel is the average value of the reconstructed value of the neighboring pixel vertically above and the reconstructed value of the neighboring pixel vertically below. The horizontal average prediction uses pixel values ​​on the left and right sides of the current pixel to obtain a predicted value of the current pixel. As an example, the predicted value of the current pixel is the average of the reconstructed values ​​of the horizontally left neighboring pixel and the horizontally right neighboring pixel.

[0058] Illustratively, the intra prediction mode determines a prediction value based on pixel reconstructed values ​​of surrounding neighboring blocks.

[0059] Exemplarily, the block copy prediction mode determines a prediction value based on pixel reconstructed values ​​of surrounding (not necessarily adjacent) coded (decoded) blocks.

[0060] Exemplarily, 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. A small rectangle in FIG. 1 represents a pixel. Pixels with different marks are used to represent different prediction methods, specifically, vertical prediction, horizontal prediction, vertical average prediction and horizontal average prediction are shown. The schematic diagram of each prediction method shown in FIG. 1 may be used to interpret any related attached drawings related to the present invention, such as FIG. 12.

[0062] 2) Residual coding mode

[0063] A manner for coding the residual (i.e., a 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 the residual values ​​of the pixels in the current image block are all zero, and the reconstructed value of each pixel is equal to its predicted value.

[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", for example, A / B can represent A or B. In this specification, "and / or" is merely for describing the related relationship of 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. In addition, in order to clearly and easily explain the technical solutions of the embodiments of the present invention, the embodiments of the present invention use terms such as "first" and "second" to distinguish between identical or similar things that have approximately the same functions and roles. As will be understood by those skilled in the art, the terms "first", "second", etc. are not intended to limit the number or order of execution, and are not necessarily intended to limit the number or order of execution to different ones.

[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 be referred to as an image encoding device or a video encoding device. The destination device 12 is used to decode encoded image data generated by the source device 11, so the destination device 12 may be referred to as an image decoding device or a video decoding device.

[0071] The source device 11 and the destination device 12 may include various devices including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, mobile phones such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, 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 a function corresponding thereto and the destination device 12 or a function corresponding thereto 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 transmit the encoded image data through 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, the source device 11 includes an encoder 112. Optionally, the source device 11 may further include an image preprocessor 111 and a communication interface 113. Here, the image preprocessor 111 is used to perform preprocessing on the received image to be encoded, for example, the preprocessing performed by the image preprocessor 111 may include cropping, color format conversion (e.g., converting from RGB format to YUV format), toning, or noise removal, etc. The 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, the encoder 112 may be used to perform the encoding process in each embodiment described below. The communication interface 113 may be used to transmit the encoded image data to the destination device 12 for storage or direct reconstruction, or any other device (e.g., memory) for decoding or storage. The communication interface 113 may encapsulate the encoded image data into a suitable format before transmitting it.

[0073] Optionally, the above image pre-processor 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 the embodiment of the present invention is not limited in this regard.

[0074] As shown in FIG. 2, the destination device 12 includes a decoder 122. Optionally, the destination device 12 may further include a communication interface 121 and an image post-processor 123. Here, the communication interface 121 may be used to receive encoded image data from the source device 11 or any other source device, which may be, for example, a storage device. The communication interface 121 may also decapsulate data transmitted by the communication interface 113 to obtain encoded image data. The decoder 122 is used to receive the 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, the 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 may be software programs in the destination device 12, and embodiments of the present invention are not limited in this regard.

[0077] The structures of the encoder and decoder in FIG. 2 will be briefly explained below.

[0078] Please refer to FIG. 3, which shows an exemplary 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). Here, 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., performing an encoding process for each image block.

[0080] In one example, a method for dividing an image to be encoded into a number of image blocks may include the following steps.

[0081] Step 1: Divide a frame of image into one or more non-overlapping parallel coding units, each of which is not dependent on the others and can be coded and decoded in parallel / independently.

[0082] Step 2: For each parallel coding unit, the encoding side may split 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 units.

[0083] Step 3: For each independent coding unit, the coding side may further divide it 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 a horizontal equal division method, a vertical equal division method, or a horizontal and vertical equal division method. Of course, the specific implementation is not limited thereto. Each coding unit in the independent coding unit may be dependent on each other, that is, may refer to each other during the execution of the prediction step.

[0084] The width of the coding unit is w_cu and the height is h_cu, and optionally the width is greater than the height (except for edge regions). Typically, the coding unit may be a fixed w_cu×h_cu, where w_cu and h_cu are both powers of 2 (N is 0 or greater), e.g., 16×4, 8×4, 16×2, 8×2, 4×2, 8×1, 4×1, etc.

[0085] A coding unit may contain three components: luma Y, chroma Cb, chroma Cr (or red R, green G, blue B), or only one of them. If it contains three components, the size of these components may be completely the same or different, specifically related to the input format of the image.

[0086] Fig. 4 shows a schematic diagram of the correspondence between images, parallel coding units, independent coding units, and coding units. Here, Fig. 4 takes as an example that an image is divided into a parallel coding unit 1 and a parallel coding unit 2 according to 3:1, 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 a residual value between a true value of an image block and a predicted block of the image block to obtain a residual block, for example, by subtracting pixel values ​​of the predicted block from pixel values ​​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 called transform residual coefficients, and the transform residual coefficients can 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 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, an n-bit transform coefficient may be truncated to an m-bit transform coefficient, 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 and 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 an 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 coding an index of a prediction mode 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, define the maximum value of the residual absolute value in one residual block (RB) as modified maximum (mm). Determine the number of coding bits for the residual coefficients in the RB (the coding bits for the residual coefficients in the same RB are 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 needed 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 determination of CL is to find the smallest M value that satisfies that all the residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If the two boundary values, -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, -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 a method of directly coding the original residual values.

[0094] Also, in some special cases, the original values ​​may be directly coded 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 above-mentioned dequantized residual coefficients into a residual block, and the process may include performing an inverse transform on the above-mentioned dequantized coefficients to obtain an inverse transform block in the pixel domain (or called sample domain), for example, the inverse transform may include an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST). The inverse transform block may be called an inverse transform dequantized block or an inverse transform residual block. Of course, the step of inverse transform 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 pixel transformation or improve image quality.

[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 result of the determination in S901 is "yes", it performs prediction based on the point prediction mode, and performs a step of inverse quantization and reconstruction (S901Y) to realize the encoding process. If the result of the determination in S901 is "no", it determines whether to use an original value mode (S902). If the result of the determination in S902 is "yes", it performs encoding using the original value mode (S902Y). If the result of the determination in S902 is "no", it determines to perform prediction using another prediction mode, for example, intraframe prediction or block copy mode (S903). Then, if it is determined to perform residual skip in S904, it directly performs a step of reconstruction (S905). If it is determined not to perform residual skip in S904, it performs a step of inverse quantization (S906) and determines whether to use a block copy prediction mode (S907). When it is decided to use the block copy prediction mode, in one case, if it is decided to perform transform skip in S908, the reconstruction step (S905) is directly performed, and in another case, if it is decided 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 decided not to use the block copy mode in S907 (in this case, one prediction mode used is an 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 embodiment of the present invention, encoder 20 is used to implement the encoding method described in the embodiment below.

[0101] 6, which illustrates an exemplary block diagram of an example of a decoder 30 for implementing an embodiment of the present invention. The decoder 30 is used, for example, to receive encoded image data (i.e., an encoded bitstream, e.g., including an encoded bitstream of an image block and associated syntax elements) encoded by the encoder 20 to obtain a decoded image. The decoder 30 includes a bitstream parsing 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, where the buffer is used to buffer the reconstructed image block output by the reconstruction unit 305, and the decoded image buffer is used to buffer the filtered image block 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 encoding parameters (e.g., the encoding 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 encoding parameters to the prediction processing unit 304, so that the prediction processing unit 304 performs a prediction process based on the encoding 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 parsing 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 encoded image data (e.g., the encoded 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 regarding the selected prediction mode (i.e., the decoded encoding parameters) from the bitstream analysis unit 301, and predict the current image block based on the associated data in the reconstructed image data and the decoded encoding parameters to obtain a prediction block of the current image block.

[0106] The reconstruction unit 305 is used to add an inverse transformed block (i.e., an inverse transformed residual block) to a prediction block to obtain a reconstructed block in the sample domain, for example by adding sample values ​​of the inverse transformed residual block to 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 the 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 the decoder 30 according to the embodiment of the present invention, the 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 further performed on the 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 values ​​(eg, near values ​​or QP values) 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 performs decoding 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 prediction value and the residual value thereof.

[0117] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS The following image encoding and decoding methods provided by embodiments of the present invention will now be described with reference to the accompanying 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] Fig. 7A is a schematic flow chart 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, a coding unit) in an image to be coded.

[0123] The target prediction mode may be one of a plurality of predefined prediction modes, and specifically may be an original value mode or a prediction mode other than the original value mode. In one example, the other prediction mode includes any one or more combinations of at least one point prediction mode, at least one intraframe prediction mode, and at least one block copy mode. For example, the other prediction mode includes a total of three types of prediction modes, namely, a point prediction mode, an intraframe prediction mode, and a block copy mode. In another example, the other prediction mode includes five types of prediction modes, namely, a point prediction mode 0, a point prediction mode 1, an intraframe prediction mode 0, a block copy mode 0, and a block copy mode 1. In another example, the other prediction mode includes any one or more combinations of at least one point prediction mode based on normal residual coding, at least one intraframe 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 intraframe 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 uses the normal residual coding mode to encode the residual coefficients, and uses the point prediction mode to predict the pixel values ​​of the unit to be coded. When the prediction mode is some other modes, the description is similar, so it is omitted here.

[0125] S102: The encoding side determines an index of a target prediction mode from an index table based on 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.

[0126] Optionally, the correspondence between the multiple prediction modes and the respective indexes may be stored by an index table, or of course, may be stored in other manners, and the embodiment of the present invention is 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 are encoded in a truncated unary code manner, that is, the indexes of the plurality of prediction modes are generated in a truncated unary code manner, for example, see the following example 1 and example 2. As another example, the indexes of the plurality of prediction modes are encoded in a binary tree manner, for example, see the following example 3.

[0128] Optionally, the codeword length (i.e., the number of binary characters, which may be referred to as code 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. 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 the statistical method. For example, the more frequently used a prediction mode is, the shorter the codeword of its index is. Of course, for the multiple prediction modes, the index of some of the prediction modes may satisfy the rule shown in the optional embodiment. Furthermore, optionally, there may be multiple prediction modes in which the codeword length of the index is the same.

[0129] S103: The encoding side encodes an index of the target prediction mode into a bitstream.

[0130] Figure 7B shows an image decoding method provided by an embodiment of the present invention. The image decoding method corresponds to the image encoding method as shown in Figure 7A. The method shown in Figure 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 multiple prediction modes, for example, encodes the indexes of the multiple prediction modes in a truncated unary coding manner, i.e., the indexes of the multiple prediction modes are generated in a truncated unary coding manner.

[0134] Optionally, the codeword length of the index of the original value mode is greater than or equal to 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 an index of the target prediction mode, where the index table includes a correspondence relationship between 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, the decoding side 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. Then, based on the prediction block and the residual block, the decoding side reconstructs the unit to be decoded to obtain a reconstruction block.

[0139] The process of the decoding side reconstructing 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 the following FIG. 21.

[0140] In the coding 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, the bit may be written as org_flag, and if org_flag is "1", it indicates that the prediction mode of the current block is the original value mode, and if org_flag is "0", it 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, the index of the other prediction mode is coded into the bitstream. However, since the probability that the original value mode is used is very low, in most image blocks, one org_flag "0" needs to be coded into the bitstream, which leads to a waste of transmission resources (i.e., the overhead of bitstream transmission increases). 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 of the decoding side.

[0141] However, in the image encoding method shown in Fig. 7A provided by the embodiment of the present invention, the index of the target prediction mode is directly determined from the index table based on the target prediction mode, and the flag (e.g., flag bit org_flag) indicating whether the target prediction mode is the original value mode or not may not be encoded in the bitstream. In most cases, the original value mode is not used as the target prediction mode, for example, point prediction mode or intraframe prediction mode is usually used, so that the flag bit (org_flag) indicating whether the original value mode is used in the conventional scheme does not need to be encoded, which helps to save the overhead of bitstream transmission.

[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 is helpful to save overhead of bitstream transmission.

[0144] Example 1: Suppose the above multiple prediction modes include original value mode, point prediction mode, intraframe prediction mode, and block copy mode, one possible method is to use a truncated unary code scheme to encode the indexes of these prediction modes, and use 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 of the index of the point prediction mode is 0, the codeword of the intraframe prediction mode is 10, the codeword of the block copy mode is 111, and the codeword of the index of the original value mode is 110. Based on such a scheme, since the point prediction mode or the intraframe prediction mode is used in most cases, there is no need to encode a flag bit (org_flag) representing whether the original value mode is used or not.

[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 the normal residual coding mode are, sequentially, noted as normal point prediction mode (mode 1), normal intra-frame prediction mode (mode 2), and normal block copy mode (mode 3), and the point prediction mode, intra-frame prediction mode, and block copy mode based on the skip residual coding mode are, sequentially, noted as special point prediction mode (mode 4), special intra-frame prediction mode (mode 5), and special block copy mode (mode 6), making a total of seven prediction patterns including the original value mode (mode 7). In this case, one possible approach 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 multiple prediction mode indexes using a binary tree scheme Table 3 shows one encoding scheme. [Table 3]

[0149] In Table 3, the multiple prediction modes include the above 15 types of prediction modes as an example. In actual implementation, the index table shown in Table 3 may only include two columns of a prediction mode and a prediction mode index, or only three columns of 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 the point prediction mode 0 and the point prediction mode 1 are "0010" and "0011," respectively. The methods of generating indexes of other prediction modes are similar to this, and therefore will not be described here.

[0156] For intraframe prediction modes 0 to 6, "1" and "0" are used as the second highest bit of the index for "intraframe prediction mode 0" and "intraframe prediction mode 1 to 6", respectively. The indexes for other intraframe prediction modes are not described here. The method of generating the index for the intraframe block copy mode is similar to this.

[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 almost the same, the code length of their indexes is 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 prefix of the index of the other 14 prediction modes is not "11". This is a technical proposal proposed 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 decode quickly.

[0159] A specific embodiment of 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 a 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 referred to.

[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 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] Fig. 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 encoded, 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 described above, so they will not be repeated here.

[0168] S302: If the residual coding mode is a skip residual coding mode, the coding side codes the index of the residual coding mode into the bitstream. In this case, there is no need to code the residual quantization-related value (such as a near value or a QP value) 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 (such as 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 a 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 index of the residual coding mode is used to indicate the 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 the 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: When the index of the residual coding mode is used to indicate a normal residual coding mode, the decoding side analyzes the residual quantization-related value 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 reconstruction 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 FIG. 21 to obtain a reconstruction 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 decoding complexity on the decoding side.

[0179] However, in the image coding method provided by Fig. 8A of the embodiment of the present invention, since "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)", it is proposed that the coding side first codes the residual coding mode information (e.g., the 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 overhead in bitstream transmission.

[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., an index of the residual coding mode, such as res_skip_flag) may be first analyzed, and then whether to analyze the residual quantization related value (e.g., a near value or a QP value) may be determined based on the residual coding mode, thereby reducing the decoding complexity on the decoding side.

[0181] Example 3

[0182] Fig. 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: An 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] The prediction modes based on skip residual coding and the prediction modes based on normal residual coding may be considered as combinations 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 an index of a target prediction mode into a bitstream.

[0188] In one example, the index of the target prediction mode may be generated in a manner that refers to the relevant example in the embodiment shown in FIG. 7A, for example, the indexes of the multiple prediction modes are jointly encoded, for example, the indexes of the multiple prediction modes are encoded in a truncated unary coding manner. Of course, the specific implementation is not limited thereto. In another example, the index of the target prediction mode may be encoded into the bitstream in a conventional manner, 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 a 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 according to the target prediction mode and the residual block may include the step of predicting the unit to be coded according to the target prediction mode to obtain a prediction block, and reconstructing the unit to be coded according to the prediction block and the residual block.Of course, this is not limited thereto, and in another example, reconstruction is performed according to the method shown in Figure 21 to obtain a reconstruction 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 according to the target prediction mode and the residual block may include: predicting the unit to be decoded according to the target prediction mode to obtain a prediction block, and reconstructing the unit to be decoded according to the prediction block and the residual block.Of course, this is not limited thereto, and in another example, reconstruction is performed according to the method shown in Figure 21 to obtain a reconstruction block.

[0198] The image encoding and decoding method shown in Figures 9A and 9B has at least the following beneficial effects. By combining a conventional residual encoding mode and a prediction mode into a new prediction mode provided by an embodiment of the present invention, the residual encoding mode and the prediction mode do not need to be encoded (decoded) respectively, and the new prediction mode can be encoded (decoded) uniformly, which simplifies the implementation logic and helps to save overhead of bitstream transmission. 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 the residual quantization related value (e.g., near value or QP value) based on the prediction mode, thereby saving the bit rate. In addition, first encode (or decode) the residual coding mode information (e.g., an index of the residual coding mode, e.g., 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 when 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 the overhead of bitstream transmission.

[0199] For example, based on the encoding method shown in the above example 2, the decoding side can know whether or not 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 the 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 of 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 any prediction group includes a first designated pixel region and a second designated pixel region, and the first designated pixel region includes a plurality of pixel groups, and the plurality of pixel groups are obtained by dividing according to the second designated pixel region, and the prediction methods of the first designated pixel region and the second designated pixel region are different. 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 subject 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 subject of this embodiment may be the 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 analyzing a bitstream to obtain an index of a prediction mode 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 is 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 prediction group for the current image block, in which case all pixels in the current image block are put into 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 group 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, a prediction group may be composed of all / part of pixels in one / multiple rows of a current image block, and of course, other embodiments are also possible. In principle, a prediction group may include multiple consecutive pixels in the same row.

[0210] In one example, the number of the consecutive pixels included in one prediction group is equal to or greater than a preset threshold.This is because, when the number of consecutive pixels in one prediction group is relatively large, if the pixels in the prediction group are predicted in series, it may take a long time to predict the prediction group.In this case, if the present technical proposal is adopted, it is possible to predict multiple pixel groups in one prediction group in parallel, which is helpful in shortening the prediction time of the prediction group.

[0211] In the prediction process, two pixel groups may be predicted in parallel if there is no dependency between the pixels in the two pixel groups. The number of pixels contained in the different pixel groups may or may not be equal.

[0212] The embodiment of the present invention does not limit which pixels are specifically included in the first and second designated pixel regions, and the prediction method of these pixels. In principle, any of the "first and second designated pixel regions and prediction methods" may be used as long as "multiple pixel groups can be predicted in parallel, and the pixel group includes one or multiple consecutive pixels."

[0213] Fig. 11 shows a parallel pixel group division scheme provided by an embodiment of the present invention. In Fig. 11, the consecutive pixels in the same row in one prediction group are pixels 1-12, the pixels included in the first designated pixel region are pixels 3, 7, and 11, and the pixels included in the second designated pixel region are pixels 1-2, 4-6, 8-10, and 12. The pixel groups are pixel groups 1-4, where pixel groups 1-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, and is not equal to the number of pixels included in 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 manner, 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 time of different pixel groups predicted in parallel is the same or approximately 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 prediction group of the at least one prediction group, predict the prediction group according to the prediction mode of the prediction group to obtain the prediction block of the prediction group, obtain the residual block of the prediction group, and obtain the reconstruction block of the prediction group according to the prediction block and the residual block. Of course, there may be other embodiments, such as, for example, when the values ​​in the residual block are all 0, directly determine the prediction block as the reconstruction block. As another example, reconstruction is performed according to the method shown in FIG. 21 to obtain the reconstruction block.

[0219] In the image reconstruction method shown in Fig. 11, when performing prediction, multiple pixel groups in one prediction group can be predicted in parallel, which helps to reduce 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] In an expanded manner, the "row" in the image reconstruction method shown in FIG. 11 may be replaced with "column" to configure a new embodiment, thereby solving the problem that the prediction process takes time in the current image block whose height is greater than its width (for example, the size of the current image block is 2*16, 2*8, or 1*8, etc.) because the prediction process cannot be performed in parallel. In this case, in one example, the first designated pixel region uses horizontal prediction, and the second designated pixel region uses vertical prediction. In another example, the first designated pixel region uses horizontal prediction, and the second designated pixel region uses horizontal average prediction. Other related embodiments can be obtained by inference based on the related description of FIG. 11 of the present invention, and description is omitted here.

[0221] The image reconstruction method shown in FIG. 11 will be described below using a specific example.

[0222] A 16×2 current image block is targeted, and specifically, it may be a 16×2 luma block or a 16×2 chroma block.

[0223] 1) One prediction division mode of a 16×2 current image block is as shown in FIG. 12, where the current image block includes Group1 to Group2. Specifically, Group1 is composed of pixels in the second row, and horizontal prediction is used for Group1, and Group2 is composed of pixels in the first row, and vertical average prediction is used for Group2. Here, the pixels of Group2 may refer to the pixels in the last row of the adjacent 16×2 image block above.

[0224] As shown in Fig. 12, the encoding of the second pixel in Group2 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 Group1 depends on the reconstructed value of the first pixel in Group2, so the encoding and decoding cannot be performed simultaneously. Therefore, the parallelism of such a prediction division mode is low, and it is not suitable for hardware implementation.

[0225] In order to improve the parallelism in the prediction process, the prediction division mode of the 16×2 current image block may be as shown in FIG. 13A or FIG. 13B, which is applied to the embodiment shown in FIG. 11 of the embodiment of the present invention. Here, the division mode of the prediction group of the current image block shown in FIG. 13A and FIG. 13B is the same as that in FIG. 12, but the prediction mode is different. Specifically, for any 16×2 current image block, the value of one column (2 pixels) to the left and one row (16 pixels) above it may be referred to. The leftmost pixel of the 16×2 current image block is called the first pixel.

[0226] Scheme 1: As shown in FIG. 13A, the prediction modes include:

[0227] a) For the kN+1 (N is preferably 4, k=1, 2 or 3) th 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 Group2 except for the kN+1 (N is preferably 4, k=1, 2 or 3)-th pixel, the reconstructed value of the pixel to the left of the pixel is used as the predicted value of the current pixel.

[0229] c) Optionally, the predicted values ​​of the pixels in Group1, except for the kN+1 (N is preferably 4, k=1, 2 or 3)-th pixel, are preset values ​​(i.e., default values). Optionally, for the other pixels, the average value (e.g., (P0+P1+1)>>1) of the reconstructed value of the pixel above (the reconstructed value of the other adjacent block above, denoted as P0) and the reconstructed value of the pixel below (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 FIG. 13B, the prediction modes include:

[0231] d) For the kN+2 (N is preferably 5, k=1, 2) th 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 Group1 except for 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 (the reconstructed value of the other adjacent block above, denoted as P0) and the reconstructed value of the pixel below (the reconstructed value of group2, denoted as P1) is used as the predicted value of the current pixel.

[0234] 2) One prediction partition mode of a 16×2 current image block is as shown in FIG 14, where the current image block includes Group1 to Group2. Specifically, Group1 is composed of pixels in the first row, and horizontal prediction is used for Group1; Group2 is composed of pixels in the second row, and horizontal prediction is used for Group2.

[0235] In order to improve the parallelism in the prediction process, the embodiment of the present invention is applied to the embodiment shown in FIG. 11, and one prediction division mode of a 16×2 current image block is as shown in FIG. 15A to FIG. 15D. Here, the division mode of the prediction group of the current image block shown in FIG. 15A to FIG. 15D is the same as that in FIG. 14, but the prediction mode is different. Specifically, it includes the following:

[0236] Scheme 1: As shown in FIG. 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, the reconstructed value of the pixel above it is used as the predicted value of the current pixel.

[0238] b) For other pixels in Group1 and Group2, the reconstructed value of the pixel to the left of it is used as the predicted value for the current pixel.

[0239] Scheme 2: As shown in FIG. 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 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 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 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 embodiments 1 and 2, N and k may be other values. In addition, 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 black in FIGS. 13A-13B, 15A-15D may be set to default values ​​if they are not available.

[0247] An 8×2 current image block is targeted, and specifically, it may be an 8×2 luma block or an 8×2 chroma block.

[0248] One grouping division mode for an 8×2 current image block is as shown in Figure 16A and Figure 16B. Here, for any 8×2 current image block, the reconstructed values ​​of pixels in one column (2 pixels) on the left and one row (8 pixels) on the top may be referred to.

[0249] As shown in FIG. 16A, in predictive partitioning 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 partitioning 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 partitioning mode of an 8×2 current image block is as shown in FIG.

[0252] 17, for the kN+1 (N is preferably 4, k=1)-th pixel in Group1 and Group2, the reconstructed value of the pixel above 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] An 8×1 current image block is taken as the target, and specifically, it may be an 8×1 luma block or an 8×1 chroma block.

[0254] One grouping division mode for an 8×1 current image block is as shown in FIG. 18A and FIG. 18B. Here, for any 8×1 current image block, the reconstructed value of the pixel of one column (one pixel) on the left side and one row (eight pixels) on the upper side may be referred to. As shown in FIG. 18A, in prediction division mode A, for all pixels, the reconstructed value of the pixel on the upper side is used as the predicted value of the current pixel, and as shown in FIG. 18B, in prediction division mode B, for all pixels, the reconstructed value of the pixel on the left side is used as the predicted value of the current pixel.

[0255] In Figures 18A and 18B, an 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.

[0257] 19, for the kN+1 (N is preferably 4, k=1)-th pixel of the 8×1 current image block, the reconstructed value of the pixel above is used as the predicted value of the current pixel, while 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 row of an image or an independent coding (decoding) unit of a frame, there is no pixel to the left of the current image block, and then 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, etc. 1<<(bit_depth-1) represents shifting bit_depth-1 to the left by 1 bit.

[0260] Any reconstructed value of a pixel in the present invention can be regarded as a pixel value in a certain component of a pixel. Exemplarily, the component here can be a red R component, a green G component, or a blue B component in an RGB format, or a luminance Y component, a chrominance blue Cb component, or a chrominance red Cr component in a YCbCr format. The size of each component can be the same as the size of an image, or can be smaller than the size of an image. For example, in the YUV420 format, the size of Y is equal to the size of an image, but the width and height of U or V are only half of Y, that is, the size is only 1 / 4 of the image. Based on this, the bit_depth here can represent the bit width of a 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 adjacent image blocks or adjacent 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 blocks of one prediction group are partitioned into one residual sub-block, which is equivalent to not grouping the residual blocks, as shown in FIG.

[0265] Division mode 2: The residual block of one prediction group is divided into a plurality of residual sub-blocks. Specifically, the residual block of one prediction group is divided into a plurality of residual sub-blocks according to a preset ratio. The present invention does not limit the preset ratio. The plurality of 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, a 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 illustrated by taking as an example a coding unit of 16×2, with each row being one prediction group. The 16×2 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 all rectangles marked with the same shade) represent pixels in the same residual sub-block.

[0271] In addition, for an 8×1 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, in concrete implementation, it 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 that the residual coefficients occupy 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 1 bit or 3 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, and when a residual block is divided into a small number of residual sub-blocks, residuals with different characteristics are grouped into one group, and coding efficiency of residual coefficients is not high. Considering at least these two aspects, the embodiment of the present invention provides the above-mentioned residual block partitioning method.

[0277] Example 6

[0278] As shown in Figure 21, a schematic diagram of an image reconstruction method provided by an embodiment of the present invention, which is applicable to both image encoding and decoding methods, may be provided. The method shown in Figure 21 may include the following steps:

[0279] S801: Determine a target prediction mode of 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 subject 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 subject of this embodiment may be the 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 according to a reference value of a first pixel of the consecutive pixels and a residual value of each of two adjacent pixels between the first pixel and the target pixel, where the target pixel is any one of the non-first pixels of the consecutive pixels, 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 a non-first pixel. The target prediction mode includes a first prediction scheme and a second prediction scheme. In this case, the target prediction mode satisfies a preset condition including 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 an image block adjacent to the current image block, or pixel values ​​of an independent coding (decoding) unit 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, and the description will be omitted here.

[0290] Let the reconstruction value of the current 8×1 image block be R(i), the residual value be Res(i) and the predicted value be Pred(i), i=0, 1,..., 7. As shown in Fig. 22, the reconstruction value of the 8×1 block above the current 8×1 block is RA(i), i=0, 1,..., 7, and the reconstruction value of the pixel to the left is RLi, i=0, 1. Here, Fig. 22 is drawn based on Fig. 19.

[0291] Based on the traditional method, the predicted value of an 8×1 image block is If i = 0, Pred(i) = RL0; Pred(i)=R(i-1) for i=1, 2, or 3; 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 8 × 1 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] Based on this method, for the reconstructed value of the pixel i=1, 2 or 3, there is no need to wait for the generation of the reconstructed value of the pixel to its left, but only need to obtain the pixel value RL0 to its left of the current image block and the residual value between the current pixel and the pixel to its left, to directly obtain the reconstructed value of the current pixel. This method can also greatly improve the 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] A part or all of the technical features in any of the above-mentioned embodiments may be combined to form a new embodiment, provided that there is no contradiction. In addition, any of the technical solutions provided by any of the above-mentioned embodiments may be applied to 16×2, 8×2, 8×1 image blocks, and of course, other M×N image blocks, such as 4×2, 16×4, etc.

[0300] To realize the functions in the above embodiments, the encoder / decoder includes corresponding hardware structures and / or software modules for performing each function. As can be easily understood by those skilled in the art, with reference to the units and method steps of each example described in the embodiments disclosed in the present invention, the present invention can be realized in the form of hardware, or a combination of hardware and computer software. Whether a function is performed by hardware or computer software drives 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, any of the decoding devices 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, any of the encoding devices 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] FIG. 23 is a schematic structural diagram of a decoding device 3000 provided by the present invention, and any embodiment of the above decoding method may be executed by the decoding device. 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, where the first syntax element 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. Here, the index table includes a correspondence relationship between indexes of a plurality of prediction modes and a plurality of 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 analysis unit 3001 may be realized by the bitstream analysis unit 301 in FIG. 6. The decision unit 3002 may be realized by the prediction processing unit 304 in FIG. 6. The reconstruction unit 3003 may be realized by combining the prediction processing unit 304 and the reconstruction unit 305 in FIG. 6. The current image block in FIG. 6 may be the unit to be decoded in this embodiment. For more detailed descriptions of the above bitstream analysis unit 3001, decision unit 3002 and reconstruction unit 3003, more detailed descriptions of the technical features thereof, and descriptions of the beneficial effects, etc., all may refer to the above corresponding method embodiments, and thus description is omitted 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 an encoding 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 according to the target prediction mode. Wherein, the index table includes indexes of a plurality of prediction modes and corresponding relationships between a plurality of prediction modes. The encoding unit 3102 is used to encode 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 Fig. 3, and the encoding unit 3102 may be realized by the coefficient encoding unit 205 in Fig. 3. The current image block in Fig. 3 may be the encoding unit of this embodiment. For a more detailed description of the above prediction unit 3101 and encoding unit 3102, a more detailed description of each technical feature thereof, and a description of beneficial effects, etc., please refer to the above corresponding method embodiments, and the description will be omitted here.

[0306] FIG. 25 is a schematic structural diagram of an encoding device / 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 a 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 prediction block, and the reconstruction unit 3203 is used to determine the prediction block as a reconstruction 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 a residual quantization-related value of the current image block to obtain a residual block, and the reconstruction unit 3203 is used to reconstruct the current image block according to the residual block to obtain a reconstruction block of the current image block.

[0307] In one example, the decision unit 3201 may be realized by the bitstream analysis unit 301 in FIG. 6, the prediction unit 3202 may be realized by the prediction processing unit 304 in FIG. 6, and the reconstruction unit 3203 may be realized by the reconstruction unit 305 in FIG. 6. In another example, the decision unit 3201 may be realized by the residual coding unit 203 in FIG. 3, the prediction unit 3202 may be realized by the prediction processing unit 201 in FIG. 3, and the reconstruction unit 3203 may be realized by the reconstruction unit 208 in FIG. 3. For more detailed descriptions of the above decision unit 3201, the prediction unit 3202 and the reconstruction unit 3203, more detailed descriptions of the technical features thereof, and descriptions of the beneficial effects, etc., you may refer to the above corresponding method embodiments, so the description will be omitted here.

[0308] FIG. 26 is a schematic structural diagram of an encoding device / decoding device 3300 provided by the present invention, which includes: a determining unit 3301, a predicting unit 3302, a reconstructing 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 reconstructing 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 a residual quantization-related value of the current image block to obtain a residual block of the current image block, and the reconstructing 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 decision unit 3301 may be realized by the bitstream analysis unit 301 in FIG. 6, the prediction unit 3302 may be realized by the prediction processing unit 304 in FIG. 6, the reconstruction unit 3303 may be realized by the reconstruction unit 305 in FIG. 6, and the acquisition unit 3304 may be realized by the bitstream analysis unit 301 and the residual decoding unit 303 in FIG. 6. In another example, the decision unit 3301 and the prediction unit 3302 may be realized by the prediction processing unit 201 in FIG. 3, the reconstruction unit 3303 may be realized by the reconstruction unit 208 in FIG. 3, and the acquisition unit 3304 may be realized by the residual decoding unit 303 in FIG. 3. For more detailed descriptions of the above decision unit 3301, the prediction unit 3302, the reconstruction unit 3303 and the acquisition unit 3304, more detailed descriptions of the technical features thereof, and descriptions of the beneficial effects, etc., you may refer to the above corresponding method embodiments, so the description will be omitted here.

[0310] FIG. 27 is a schematic structural diagram of an encoding device / decoding device 3400 provided by the present invention, which includes a determining unit 3401 and a reconstructing unit 3402. The determining unit 3401 is used to determine a prediction mode of 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 / column, 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 according to 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 the 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 according to the prediction mode of the at least one prediction group.

[0311] In one example, the decision unit 3401 may be realized by the bitstream analysis unit 301 in Fig. 6, and the reconstruction unit 3402 may be realized by the prediction processing unit 304 and the reconstruction unit 305 in Fig. 6 together. In another example, the decision unit 3401 may be realized by the prediction processing unit 201 in Fig. 3, and the reconstruction unit 3402 may be realized by the reconstruction unit 208 in Fig. 3. For a more detailed description of the above decision unit 3401 and reconstruction unit 3402, a more detailed description of each technical feature thereof, and a description of beneficial effects, etc., all may refer to the above corresponding method embodiments, and therefore will not be described here.

[0312] FIG. 28 is a schematic structural diagram of an encoding device / decoding device 3500 provided by the present invention, which includes a determining unit 3501 and a reconstructing unit 3502. The determining unit 3501 is used to determine a target prediction mode of a current image block. Wherein, 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. The reconstructing unit 3502 is used to determine a reconstructed value of the target pixel based on a reference value of a first pixel of the plurality of consecutive pixels and a residual value of each of two adjacent pixels between the first pixel and the target pixel, when the target prediction mode satisfies a preset condition. Wherein, the target pixel is any one of the non-first pixels of the plurality of consecutive pixels, and a reconstructed block of the current image block includes a reconstructed value of the target pixel.

[0313] In one example, the decision unit 3501 may be realized by the bitstream analysis unit 301 in Fig. 6, and the reconstruction unit 3502 may be realized by the prediction processing unit 304 and the reconstruction unit 305 in Fig. 6 together. In another example, the decision unit 3501 may be realized by the prediction processing unit 201 in Fig. 3, and the reconstruction unit 3502 may be realized by the reconstruction unit 208 in Fig. 3. For a more detailed description of the above decision unit 3501 and reconstruction unit 3502, a more detailed description of each technical feature thereof, and a description of beneficial effects, etc., all may refer to the above corresponding method embodiments, and therefore will not be described here.

[0314] The present invention further provides an electronic device for performing any of the above-mentioned decoding method embodiments. 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, or for storing input data required for the processor 3610 to execute instructions, or for storing data generated after the processor 3610 executes 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, or 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 the 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 the embodiment of the present invention, in FIG. 29, the communication interface 3620, the processor 3610, and the memory 3630 are connected via a bus 3640, and the bus is shown by a thick line in FIG. 29, and the connection manner between the other components is merely illustrative and is not particularly limited thereto. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of expression, only one thick 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 the embodiments of the present invention, and the processor 3610 executes various functional applications and data processing by executing the software programs and modules stored in the memory 3630, thereby implementing any of the decoding or encoding methods provided above. The communication interface 3620 may be used for signaling and data communication with other devices. In the present invention, the electronic device 3600 may have multiple communication interfaces 3620.

[0318] The processor in an embodiment 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 processors, digital signal processors (DSP), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general purpose processor may be a microprocessor or any conventional processor.

[0319] The steps of the method in the embodiment of the present invention may be implemented by hardware or by a processor executing software instructions. The software instructions may be composed of corresponding software modules, which may be stored in a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a removable hard disk, a 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 the storage medium 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 exist in a network device or a terminal device as separate components.

[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 invention may be realized by software, hardware, firmware, or any combination thereof. When the invention is realized using software, all or part of the invention may be realized 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 executed. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. The computer programs or instructions may be stored in a computer-readable storage medium, or may be 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 by wire or wirelessly. 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 accumulates 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 and logical contradiction, the terms and / or explanations between different embodiments are consistent and can be cited from each other, and the technical features in different embodiments can be combined according to their internal logical relationships to form a new embodiment. In the present invention, "at least one" refers to one or more, and "multiple" refers to two or more. "And / or" describes the related relationship of related objects and indicates that there may be three types of relationships, for example, A and / or B can represent A alone, A and B simultaneously, and B alone, and A and B may be singular or plural. In the textual description of the present invention, the character " / " generally represents that the related objects before and after are in an "or" relationship, and in the formula of the present invention, the character " / " represents that the related objects before and after are in a "division" relationship.

[0323] The various numbers in the embodiments of the present invention are merely given 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 each process above does not mean the execution order, and the execution order of each process should be determined by its function and internal logic.

Claims

1. determining a prediction mode of at least one prediction group into which a current image block is divided, where any prediction group of the at least one prediction group includes a plurality of consecutive pixels in the same row / column, 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 separated pixel groups, the plurality of separated 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 plurality of separated pixel groups can be predicted in parallel, and the pixel group includes one or a plurality of consecutive pixels; reconstructing the current image block based on a prediction mode of the at least one prediction group to obtain a reconstructed block.

13. An image encoding and decoding method comprising:

2. 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.

2. The method of claim 1 .

3. The difference in the number of pixels included in the different pixel groups is less than or equal to a threshold value.

3. The method according to claim 1 or 2.

4. If there is no reference block for the current image block, the reconstructed value of the reference block for the current image block is a value obtained by shifting 1 to the left by bit_depth-1 bits, where bit_depth represents the bit width of the current image block.

3. The method according to claim 1 or 2.

5. 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; 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 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 ​​of each of two adjacent pixels between the first pixel and the target pixel, the target pixel being a non-first pixel of any one of the consecutive pixels, and a reconstructed block of the current image block including the reconstructed value of the target pixel.

3. The method according to claim 1 or 2.

6. A determination unit for determining a prediction mode of 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 / column, and the any prediction group includes a first designated pixel region and a second designated pixel region, and the first designated pixel region includes a plurality of separated pixel groups, and the plurality of separated pixel groups are obtained by dividing based on the second designated pixel region, and the prediction methods of the first designated pixel region and the second designated pixel region are different, and the plurality of separated pixel groups can be predicted in parallel, and the pixel group includes one or a plurality of consecutive pixels; a reconstruction unit for reconstructing the current image block to obtain a reconstructed block based on a prediction mode of the at least one prediction group.

1. An image encoding / decoding device comprising:

7. An electronic device including a processor and a memory, the memory being adapted to store computer instructions, the processor being adapted to retrieve and execute the computer instructions from the memory, and adapted to implement the method according to any one of claims 1 to 2.

1. An electronic device comprising:

8. A computer readable storage medium storing a computer program or instructions, which, when executed by an electronic device, performs the method according to any one of claims 1 to 2. A computer-readable storage medium comprising: