Image encoding and decoding method, device and storage medium

By directly indexing based on the target prediction mode and optimizing the residual encoding mode, the problem of low redundant information removal efficiency in video encoding and decoding is solved, and an efficient encoding and decoding process is realized, reducing the decoding complexity and code streaming overhead, and improving the parallelism and throughput of image reconstruction.

CN116800956BActive Publication Date: 2025-08-22HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310497856.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-07
Publication Date
2025-08-22
Estimated Expiration
2042-01-07

AI Technical Summary

Technical Problem

The prior art has low redundant information removal efficiency in the video encoding and decoding process, resulting in wasting storage space and transmission bandwidth.

Method used

By directly determining the prediction mode from the index table based on the target prediction mode index, the decoding complexity is reduced and the code streaming overhead is saved. The prediction mode index is generated by truncated unary code or binary tree method, and combined with skip and normal residual coding mode, the image reconstruction process is optimized.

Benefits of technology

Improves encoding and decoding efficiency, reduces decoding complexity and code streaming overhead, and improves the parallelism and throughput of image reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116800956B_ABST
    Figure CN116800956B_ABST
Patent Text Reader

Abstract

The present application discloses an image encoding and decoding method, apparatus, and storage medium, relating to the field of image encoding and decoding technology and contributing to improved encoding and decoding efficiency. An image decoding method includes: parsing a bitstream to obtain a first syntax element, the first syntax element including an index of a target prediction mode for a unit to be decoded; determining the target prediction mode from an index table based on the index of the target prediction mode; wherein the index table includes a correspondence between the indices of multiple prediction modes and the multiple prediction modes; and reconstructing the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image coding and decoding technology, and in particular to an image coding and decoding method, device and storage medium. Background Art

[0002] A complete image in a video is typically called a "frame," and a video consisting of multiple frames in chronological order is called a video sequence. Video sequences contain a range of redundant information, including spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. To minimize redundant information in video sequences and reduce the amount of data representing the video, video coding techniques have been developed to reduce storage space and transmission bandwidth. Video coding techniques are also known as video compression techniques.

[0003] With the continuous development of technology, collecting video data is becoming more and more convenient, and the scale of collected video data is also getting larger and larger. Therefore, how to effectively encode and decode video data has become an urgent problem that needs to be solved. Summary of the Invention

[0004] The present application provides an image encoding and decoding method, apparatus, and storage medium for effectively encoding and decoding video data, thereby improving encoding and decoding efficiency.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In 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 for a unit to be decoded; determining the target prediction mode from an index table based on the target prediction mode index; wherein the index table includes a correspondence between indices of multiple prediction modes and the multiple prediction modes; and reconstructing the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block. This technical solution can directly determine the target prediction mode from the index table based on the target prediction mode index without parsing the org_flag flag, thereby reducing decoding complexity at the decoding end and improving decoding efficiency.

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

[0008] In a possible implementation, indexes of multiple prediction modes are generated in a binary tree manner.

[0009] In one possible implementation, the multiple prediction modes include a raw value mode and other prediction modes, and the codeword length of the index of the raw value mode is greater than or equal to the codeword length of the index of one or more of the other prediction modes. Because some other prediction modes are used more frequently than the raw value mode, the codeword length of their index is set to be shorter, which helps further reduce bitstream transmission overhead.

[0010] In a possible implementation, the other prediction modes include at least one of the following: a point prediction mode, an intra-frame prediction mode, or a block copy mode.

[0011] In a possible implementation, the method further includes: parsing the code stream to obtain a second syntax element; wherein the second syntax element includes an index of a residual coding mode of the unit to be decoded; reconstructing the unit to be decoded based at least on a target prediction mode to obtain a reconstructed block, including: if the index of the residual coding mode is used to indicate a skip residual coding mode, predicting the unit to be decoded to obtain a prediction block, and determining the prediction block of the unit to be decoded as the reconstructed block of the unit to be decoded; if the index of the residual coding mode is used to indicate a normal residual coding mode, parsing a residual quantization correlation value of the unit to be decoded to obtain a residual block; 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.

[0012] In one possible implementation, other prediction modes include at least one of the following: point-by-point prediction mode, intra-frame prediction mode, block copy mode based on normal residual coding, point-by-point prediction mode, intra-frame prediction mode or block copy mode based on skipped residual coding.

[0013] In one possible implementation, the unit to be decoded is reconstructed based on at least a target prediction mode to obtain a reconstructed block, including: if the target prediction mode is a point-by-point prediction mode based on skipped residual coding, an intra-frame prediction mode, or a block copy mode, then the prediction block of the unit to be decoded is determined as the reconstructed block of the unit to be decoded; if the target prediction mode is a point-by-point prediction mode, an intra-frame prediction mode, or a block copy mode based on normal residual coding, then the residual quantization correlation value of the unit to be decoded is parsed to obtain the residual block of the unit to be decoded, and the unit to be decoded is reconstructed based on the target prediction mode and the residual block of the unit to be decoded to obtain the reconstructed block of the unit to be decoded.

[0014] In one possible implementation, the unit to be decoded includes at least one prediction group; any one prediction group in the at least one prediction group includes multiple consecutive pixels in the same row / column; any one prediction group includes a first designated pixel area and a second designated pixel area, the first designated pixel area includes multiple pixel groups, the multiple pixel groups are obtained according to the division of the second designated pixel area, the prediction method of the first designated pixel area is different from that of the second designated pixel area, the multiple pixel groups can be predicted in parallel, and the pixel group includes one or multiple consecutive pixels.

[0015] In one possible implementation, if any prediction group includes multiple consecutive elements in the same row, then: the first designated pixel area adopts vertical prediction, and the second designated pixel area adopts horizontal prediction; or, the first designated pixel area adopts vertical prediction, and the second designated pixel area adopts vertical mean prediction.

[0016] In one possible implementation, if any prediction group includes multiple consecutive elements in the same column, then: the first designated pixel area uses horizontal prediction, and the second designated pixel area uses vertical prediction; or, the first designated pixel area uses horizontal prediction, and the second designated pixel area uses horizontal average prediction.

[0017] In a possible implementation, the difference between the numbers of pixels included in different pixel groups is equal to or smaller than a threshold.

[0018] In a possible implementation, if the unit to be decoded does not have a reference block, the reconstructed value of the first pixel of the unit to be decoded is a value obtained by left-shifting the bit width of the unit to be decoded by 1 bit.

[0019] In one possible implementation, the unit to be decoded includes at least one prediction group; any one prediction group in the at least one prediction group contains a plurality of consecutive pixels; the unit to be decoded is reconstructed based on at least a target prediction mode to obtain a reconstructed block, including: when the target prediction mode meets a preset condition, based on a reference value of a first pixel in the plurality of consecutive pixels and a residual value of every two adjacent pixels between the first pixel and the target pixel, determining a reconstructed value of the target pixel; wherein the target pixel is any non-first pixel in the plurality of consecutive pixels, and the reconstructed block of the unit to be decoded contains the reconstructed value of the target pixel.

[0020] In one possible implementation, the first pixel adopts the first prediction method, and the non-first pixel adopts the second prediction method; the target prediction mode includes the first prediction method and the second prediction method, and the target prediction mode satisfies the preset conditions including: the first prediction method and the second prediction method are both horizontal predictions; or, the first prediction method and the second prediction method are both vertical predictions; or, one of the first prediction method and the second prediction method is horizontal prediction, and the other is vertical prediction; or, the first prediction method is a reference prediction method using pixel values ​​of adjacent decoding units to the unit to be decoded, or independent decoding units adjacent to the independent decoding unit where the unit to be decoded is located, and the second prediction method is horizontal prediction or vertical prediction.

[0021] In a second aspect, an image coding method is provided, comprising: determining a target prediction mode for a unit to be coded; determining an index of the target prediction mode from an index table based on the target prediction mode; wherein the index table contains a correspondence between the indices of multiple prediction modes and the multiple prediction modes; and encoding the index of the target prediction mode into a bitstream. This technical solution determines the index of the target prediction mode from the index table directly based on the target prediction mode, and this process can avoid encoding an index indicating whether the target prediction mode is the original value (such as a flag bit org_flag) into the bitstream. Since in most cases, the target prediction mode does not adopt the original value mode, for example, a point-by-point prediction mode or an intra-frame prediction mode is usually adopted, in most cases, there is no need to encode the flag bit (org_flag) representing whether the original value mode is used in the traditional scheme, which helps save bitstream transmission overhead and thus improves coding efficiency.

[0022] In a possible implementation, the indexes of the multiple prediction modes are generated in a truncated unary code manner.

[0023] In a possible implementation, indexes of multiple prediction modes are generated in a binary tree manner.

[0024] In a possible implementation, 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 prediction modes in the other prediction modes.

[0025] In a possible implementation, the multiple prediction modes include an original value mode and other prediction modes, and the other prediction modes include at least one of the following: a point prediction mode, an intra-frame prediction mode, or a block copy mode.

[0026] In one possible implementation, other prediction modes include at least one of the following: point-by-point prediction mode, intra-frame prediction mode, block copy mode based on normal residual coding, point-by-point prediction mode, intra-frame prediction mode or block copy mode based on skipped residual coding.

[0027] In a third aspect, an image reconstruction method is provided, which can be applied to either an image encoding method or an image decoding method. The image reconstruction method includes: determining a residual coding mode for a current image block; if the residual coding mode is a skip residual coding mode, predicting the current image block to obtain a predicted block, and determining the predicted block as a reconstructed block for the current image block; if the residual coding mode is a normal residual coding mode, obtaining a residual quantization correlation value of the current image block to obtain a residual block; and reconstructing the current image block based on the residual block to obtain a reconstructed block for the current image block.

[0028] In this technical solution, the residual coding mode is first determined, and then the residual quantization related values ​​of the current image block are obtained only when the residual coding mode is the normal residual coding mode. When the residual coding mode is the skip residual coding mode, the residual quantization related values ​​of the current image block do not need to be obtained. In this way, when the residual coding mode is the normal residual coding mode, the encoder does not need to encode the residual quantization related values ​​of the current image block into the bitstream, and the decoder does not need to parse the residual quantization related values ​​of the current image block. This helps save bitstream transmission overhead, thereby improving coding efficiency; it also helps reduce decoding complexity, thereby improving decoding efficiency.

[0029] In a fourth aspect, an image reconstruction method is provided, which can be applied to an image encoding method or an image decoding method. The image reconstruction method includes: determining a target prediction mode for a current image block; if the target prediction mode is a prediction mode based on skipped residual coding, predicting a previous 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 correlation value of the previous image block to obtain a residual block of the previous image block, and reconstructing the previous image block based on the target prediction mode and the residual block to obtain a reconstructed block.

[0030] In this technical solution, on the one hand, the traditional residual coding mode is combined with the prediction mode as a new prediction mode provided by the embodiment of the present application. In this way, there is no need to encode (decode) the residual coding mode and the prediction mode separately. Only the new prediction mode needs to be uniformly encoded (decoded), which simplifies the implementation logic and helps save bitstream transmission overhead. On the other hand, for reconstructing the image block in this way, for the encoding end (or decoding end), it can first encode (or decode) the residual coding mode information (such as the index of the residual coding mode, such as res_skip_flag), and then determine whether to encode (or decode) the residual quantization related value (such as the near value or QP value) based on the residual coding mode. Compared with traditional technologies, when the residual coding mode is the skip residual coding mode, there is no need to encode (or decode) the residual quantization related value, which helps save bitstream transmission overhead.

[0031] In a possible implementation, the point-by-point prediction mode based on skipping residual coding includes: a point-by-point prediction mode based on skipping residual coding, an intra-frame prediction mode, or a block copy mode.

[0032] In a possible implementation, the prediction mode based on normal residual coding includes: a point-by-point prediction mode, an intra-frame prediction mode, or a block copy mode based on normal residual coding.

[0033] In a fifth aspect, an image reconstruction method is provided, which can be applied to an image encoding method or an image decoding method. The image reconstruction method includes: determining a prediction mode of at least one prediction group into which the current image block is divided; wherein any one prediction group in the at least one prediction group includes a plurality of continuous pixels in the same row / column; any one prediction group includes a first designated pixel area and a second designated pixel area, the first designated pixel area includes a plurality of pixel groups, the plurality of pixel groups are obtained according to the division of the second designated pixel area, the prediction mode of the first designated pixel area is different from that of the second designated pixel area, the plurality of pixel groups can be predicted in parallel, and the pixel group includes one or a plurality of continuous pixels; based on the prediction mode of at least one prediction group, the current image block is reconstructed to obtain a reconstructed block. In this technical solution, the plurality of pixel groups in a prediction group can be predicted in parallel, thus helping to shorten the prediction time of the prediction group.

[0034] In one possible implementation, if any prediction group includes multiple consecutive elements in the same row, then: the first designated pixel area adopts vertical prediction, and the second designated pixel area adopts horizontal prediction; or, the first designated pixel area adopts vertical prediction, and the second designated pixel area adopts vertical mean prediction.

[0035] In one possible implementation, if any prediction group includes multiple consecutive elements in the same column, then: the first designated pixel area adopts horizontal prediction, and the second designated pixel area adopts vertical prediction; or, the first designated pixel area adopts horizontal prediction, and the second designated pixel area adopts horizontal average prediction.

[0036] In a possible implementation, the difference between the numbers of pixels included in different pixel groups is equal to or smaller than a threshold.

[0037] In a possible implementation, if there is no reference block for the current image block, the reconstructed value of the first pixel of the current image block is a value obtained by left-shifting the bit width of the current image block by 1 bit.

[0038] In a sixth aspect, a method that can be applied to an image encoding method or an image decoding method is provided. The image reconstruction method includes: determining a target prediction mode for a current image block; wherein the current image block includes at least one prediction group; any one of the at least one prediction group includes a plurality of consecutive pixels; when the target prediction mode satisfies a preset condition, determining a reconstruction value of the target pixel based on a reference value of a first pixel in the plurality of consecutive pixels and a residual value of each two adjacent pixels between the first pixel and the target pixel; wherein the target pixel is any non-first pixel in the plurality of consecutive pixels, and the reconstructed block of the current image block includes the reconstruction value of the target pixel.

[0039] With this technical solution, when performing reconstruction, the encoding / decoding end can directly obtain the reconstructed value of the current pixel based on the residual value of its previous pixel and its adjacent pixels, without having to wait for the reconstructed value of its previous pixel. This solution can also greatly improve the parallelism of the reconstruction process, thereby improving the decoding parallelism and throughput.

[0040] In one possible implementation, the first pixel adopts the first prediction method, and the non-first pixels adopt the second prediction method; the target prediction mode includes the first prediction method and the second prediction method, and the target prediction mode satisfies the preset conditions including: the first prediction method and the second prediction method are both horizontal predictions; or, the first prediction method and the second prediction method are both vertical predictions; or, one of the first prediction method and the second prediction method is horizontal prediction, and the other is vertical prediction; or, the first prediction method is a reference prediction method using pixel values ​​of adjacent decoding units of the current image block, or independent decoding units adjacent to the independent decoding unit where the current image block is located, and the second prediction method is horizontal prediction or vertical prediction.

[0041] In a seventh aspect, an image decoding device is provided. The decoding device may be a video decoder or a device including a video decoder. The decoding device includes modules for implementing the method described in any possible implementation of the first, third, fourth, or fifth aspects. The decoding device has the functionality to implement the behaviors described in the aforementioned related method examples. The functionality may be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functionality. The beneficial effects thereof can be found in the description of the corresponding method and are not further elaborated here.

[0042] In an eighth aspect, an image encoding device is provided. The encoding device may be a video encoder or a device including a video encoder. The encoding device includes modules for implementing the method described in any possible implementation of the second, third, fourth, or fifth aspects. The encoding device has the functionality to implement the behaviors described in the aforementioned related method examples. The functionality may be implemented in hardware or by hardware executing corresponding software implementations. The hardware or software includes one or more modules corresponding to the aforementioned functionality. The beneficial effects thereof can be found in the description of the corresponding method and are not further elaborated here.

[0043] In the ninth aspect, the present application provides an electronic device comprising a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method of any one of the implementation methods in the first to sixth aspects.

[0044] For example, the electronic device may refer to a video encoder, or a device including a video encoder.

[0045] For another example, the electronic device may be a video decoder, or a device including a video decoder.

[0046] In the tenth aspect, the present application provides a computer-readable storage medium, which stores a computer program or instructions. When the computer program or instructions are executed by a computing device or a storage system where the computing device is located, a method for implementing any one of the implementation methods of the first to sixth aspects is implemented.

[0047] In the eleventh aspect, the present application provides a computer program product, which includes instructions. When the computer program product is run on a computing device or a processor, the computing device or the processor executes the instructions to implement the method of any one of the implementation methods of the first to sixth aspects.

[0048] In the twelfth aspect, the present application provides a chip comprising a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method of any one of the implementation methods in the first to sixth aspects.

[0049] In the thirteenth aspect, the present application provides an image decoding system, which includes an encoding end and a decoding end. The decoding end is used to implement the corresponding decoding methods provided in the first to sixth aspects, and the encoding end is used to implement the corresponding encoding methods.

[0050] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. In other words, any possible implementation method of any of the above aspects can be applied to other aspects without conflict, thereby obtaining a new embodiment. For example, any image reconstruction method provided in the third to fifth aspects can be applied to any encoding method or decoding method provided in the first or second aspect. For another example, any two reconstruction methods provided in the third to fifth aspects can be combined without conflict, thereby obtaining a new reconstruction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 Schematic diagram of various prediction methods provided in the embodiments of the present application;

[0052] Figure 2 This is a schematic diagram of the architecture of the codec system used in the embodiments of the present application;

[0053] Figure 3 is a schematic block diagram of an example of an encoder for implementing an embodiment of the present application;

[0054] Figure 4 A schematic diagram of the correspondence between an image, a parallel coding unit, an independent coding unit, and a coding unit provided in an embodiment of the present application;

[0055] Figure 5 A schematic diagram of an encoding process provided in an embodiment of the present application;

[0056] Figure 6 is a schematic block diagram of an example of a decoder for implementing an embodiment of the present application;

[0057] Figure 7A A schematic diagram of the process of an image encoding method provided in an embodiment of the present application Figure 1 ;

[0058] Figure 7B A method provided in the embodiment of the present application Figure 7A A flowchart of the corresponding image decoding method;

[0059] Figure 8A A schematic diagram of the process of an image encoding method provided in an embodiment of the present application Figure 2 ;

[0060] Figure 8B A method provided in the embodiment of the present application Figure 8A A flowchart of the corresponding image decoding method;

[0061] Figure 9A A schematic diagram of the process of an image encoding method provided in an embodiment of the present application Figure 3;

[0062] Figure 9B A method provided in the embodiment of the present application Figure 9A A flowchart of the corresponding image decoding method;

[0063] Figure 10 A schematic diagram of an image reconstruction method provided in an embodiment of the present application Figure 1 ;

[0064] Figure 11 A schematic diagram of a method for dividing parallel pixel groups provided in an embodiment of the present application;

[0065] Figure 12 Schematic diagram of the prediction partitioning mode of the current 16x2 image block Figure 1 ;

[0066] Figures 13A-13B The embodiments of this application provide Figure 12 Schematic diagram of the corresponding 16x2 prediction partitioning mode of the current image block;

[0067] Figure 14 Schematic diagram of the prediction partitioning mode of the current 16x2 image block Figure 2 ;

[0068] Figures 15A-15D The embodiments of this application provide Figure 14 Schematic diagram of the corresponding 16x2 prediction partitioning mode of the current image block;

[0069] Figure 16 Schematic diagram of the prediction partitioning mode of the current 8x2 image block;

[0070] Figure 17 The embodiments of this application provide Figure 16 Schematic diagram of the corresponding prediction partitioning mode of the current 8x2 image block;

[0071] Figure 18 Schematic diagram of the prediction partitioning mode of the current 8x1 image block;

[0072] Figure 19 The embodiments of this application provide Figure 18 Schematic diagram of the corresponding 8x1 prediction partitioning mode of the current image block;

[0073] Figure 20 A schematic diagram of residual block grouping for an 8x1 current image block provided in an embodiment of the present application;

[0074] Figure 21 Schematic diagram of the image reconstruction method provided in the embodiment of the present application Figure 2 ;

[0075] Figure 22 The embodiments of this application are provided for illustration Figure 21 Schematic diagram of the prediction mode of an 8x1 image block;

[0076] Figure 23-Figure 28 A schematic diagram of the structure of an encoding device or a decoding device provided in an embodiment of the present application;

[0077] Figure 29 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] First, the technical terms involved in the embodiments of this application are introduced:

[0079] 1) Prediction model

[0080] The combination of prediction methods used to predict the current image block (e.g., the unit to be encoded / decoded) is called a prediction mode. Different pixels in the current image block can use different prediction methods, or the same prediction method. The prediction methods used to predict all pixels in the current image block are collectively referred to as the (or corresponding) prediction mode of the current image block.

[0081] Optionally, the prediction mode includes: a point-by-point prediction mode, an intra-frame prediction mode, a block copy mode, and an original value mode (ie, a reconstructed value mode of directly decoding a fixed bit width), etc.

[0082] For example, the point-by-point prediction mode uses the reconstructed values ​​of pixels at neighboring points as the predicted value. Point-by-point prediction modes include one or more combinations of prediction methods, including vertical prediction, horizontal prediction, vertical mean prediction, and horizontal mean prediction. Vertical prediction uses the value of the pixel above the current pixel (either the adjacent pixel above or the non-adjacent but relatively close pixel above) to obtain the predicted value of the current pixel. One example is to use the reconstructed value of the pixel above the current pixel as the predicted value of the current pixel. Horizontal prediction uses the value of the pixel to the left of the current pixel (either the adjacent pixel to the left or the non-adjacent but relatively close pixel to the left) to obtain the predicted value of the current pixel. Another example is to use the reconstructed value of the pixel to the left of the current pixel as the predicted value of the current pixel. Vertical mean prediction uses the values ​​of the pixels above and below the current pixel to obtain the predicted value of the current pixel. Another example is to use the reconstructed value of the pixel to the left of the current pixel as the predicted value of the current pixel. The predicted value of the current pixel is the average of the reconstructed values ​​of the adjacent pixels vertically above and below the current pixel. Horizontal mean prediction uses the values ​​of the pixels to the left and right of the current pixel to obtain the predicted value of the current pixel. One example is that the predicted value of the current pixel is the average of the reconstructed values ​​of the adjacent pixels on the horizontal left and the reconstructed values ​​of the adjacent pixels on the horizontal right.

[0083] For example, the intra prediction mode uses pixel reconstruction values ​​of surrounding neighboring blocks as prediction values.

[0084] For example, the block copy prediction mode uses pixel reconstruction values ​​of surrounding coded (decoded) blocks (not necessarily adjacent) as prediction values.

[0085] For example, the original value mode is a reconstructed value mode of directly decoding a fixed bit width, that is, a non-reference prediction mode.

[0086] like Figure 1 , which is a schematic diagram of various prediction methods provided in the embodiments of the present application. Figure 1 A small square in the image represents a pixel. Pixels with different labels are used to represent different prediction methods, specifically vertical prediction, horizontal prediction, vertical mean prediction, and horizontal mean prediction. Figure 1 The schematic diagrams of various prediction methods shown can be used to explain any of the relevant drawings involved in this application, such as Figure 12 wait.

[0087] 2) Residual coding mode

[0088] The method of encoding the residual (i.e., the residual block, consisting of the residual value of each pixel in the current image block) of the current image block (e.g., the unit to be coded / decoded) is called a residual coding mode. Residual coding modes include skip residual coding mode and normal residual coding mode.

[0089] In skip residual coding mode, there is no need to encode (decode) the residual coefficients. At this time, the residual values ​​of the pixels in the current image block are all 0, and the reconstructed value of each pixel is equal to the predicted value of the pixel.

[0090] In the normal residual coding mode, the residual coefficients need to be encoded (decoded). At this time, the residual values ​​of the pixels in the previous image block are not all 0, and the reconstructed value of each pixel can be obtained based on the predicted value and the residual value of the pixel.

[0091] In one example, the residual value of a pixel is equivalent to the residual coefficient of the pixel; in another example, the residual coefficient of a pixel may be obtained by processing the residual value of the pixel in a certain manner.

[0092] 3) Other terms

[0093] The term "at least one (kind)" in the embodiments of the present application includes one (kind) or more (kinds). "More than one (kind)" refers to two (kinds) or more than two (kinds). For example, at least one of A, B, and C includes: A exists alone, B exists alone, A and B exist at the same time, A and C exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time. In the description of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a way to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. "More than one" refers to two or more than two. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit them to be different.

[0094] The following describes the system architecture used in the embodiments of the present application.

[0095] See also Figure 2 , provides a schematic diagram of the architecture of the encoding and decoding system 10 used in the embodiment of the present application. Figure 2 As shown, the codec system 10 may include a source device 11 and a destination device 12. The source device 11 is used to encode images, and therefore, the source device 11 can be referred to as an image encoding device or a video encoding device. The destination device 12 is used to decode the encoded image data generated by the source device 11, and therefore, the destination device 12 can be referred to as an image decoding device or a video decoding device.

[0096] Source device 30 and destination device 31 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, telephone handsets such as so-called "smart" phones, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, or the like.

[0097] Optionally, Figure 2 The source device 11 and the destination device 12 may be two separate devices, or the source device 11 and the destination device 12 may be the same device, that is, the source device 11 or the corresponding function and the destination device 12 or the corresponding function may be integrated into the same device.

[0098] The source device 11 and the destination device 12 may communicate with each other. For example, the destination device 12 may receive encoded image data from the source device 11. In one example, one or more communication media may be provided between the source device 11 and the destination device 12, and the encoded image data may be transmitted via the one or more communication media. The one or more communication media may include routers, switches, base stations, or other devices that facilitate communication from the source device 11 to the destination device 12.

[0099] like Figure 2 As shown, source device 11 includes an encoder 112. Optionally, source device 11 may also include an image preprocessor 111 and a communication interface 113. Image preprocessor 111 is configured to preprocess received images to be encoded. For example, the preprocessing performed by image preprocessor 111 may include retouch, color format conversion (e.g., from RGB to YUV), color grading, or denoising. Encoder 112 is configured to receive the preprocessed images and process them using a relevant prediction mode to provide encoded image data. In some embodiments, encoder 112 may be configured to perform the encoding process described in the various embodiments below. Communication interface 113 may be configured to transmit the encoded image data to destination device 12 or any other device (e.g., a memory) for storage or direct reconstruction. The other device may be any device for decoding or storage. Communication interface 113 may also encapsulate the encoded image data into a suitable format for transmission.

[0100] Optionally, the image preprocessor 111 , encoder 112 , and communication interface 113 may be hardware components in the source device 11 , or may be software programs in the source device 11 , which is not limited in the embodiment of the present application.

[0101] Continue as Figure 2 As shown, destination device 12 includes a decoder 122. Optionally, destination device 12 may also include a communication interface 121 and an image post-processor 123. Communication interface 121 may be used to receive encoded image data from source device 11 or any other source device, such as a storage device. Communication interface 121 may also decapsulate data transmitted by communication interface 113 to obtain encoded image data. Decoder 122 is configured to receive encoded image data and output decoded image data (also referred to as reconstructed image data or reconstructed image data). In some embodiments, decoder 122 may be configured to perform the decoding process described in the various embodiments below.

[0102] The image post-processor 123 is configured 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., from YUV to RGB), color grading, retouch or resampling, or any other processing. The image post-processor 123 may also be configured to transmit the post-processed image data to a display device for display.

[0103] Similarly, optionally, the 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, which is not limited in the embodiment of the present application.

[0104] Below Figure 2 The structure of the encoder and decoder in .

[0105] See also Figure 3 , Figure 3 1 is a schematic block diagram showing an example of an encoder 20 for implementing an embodiment of the present application. Figure 3 In the embodiment, the encoder includes a prediction processing unit 201, a residual calculation unit 202, a residual encoding unit 203, a quantization unit 204, a coefficient encoding unit 205, an inverse quantization unit (also called an inverse quantization unit) 206, a residual decoding unit 207, a reconstruction unit (or called a reconstruction unit) 208, and a filter unit 209. Optionally, the encoder 20 may further include a buffer and a decoded image buffer, wherein the buffer is used to cache the reconstructed image blocks output by the reconstruction unit 208, and the decoded image buffer is used to cache the filtered image blocks output by the filter unit 209.

[0106] 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 segmentation unit ( Figure 3 The encoder 20 is used to encode the image to be encoded block by block, thereby completing the encoding of the image to be encoded, for example, performing an encoding process on each image block.

[0107] In one example, a method for dividing an image to be encoded into a plurality of image blocks may include:

[0108] Step 1: Divide a frame of image into one or more non-overlapping parallel coding units. There is no dependency between the parallel coding units and they can be encoded and decoded in parallel or independently.

[0109] Step 2: For each parallel coding unit, the encoding end may divide it into one or more independent coding units that do not overlap with each other. The independent coding units may not depend on each other, but may share some header information of the parallel coding unit.

[0110] Step 3: For each independent coding unit, the encoder may further divide it into one or more non-overlapping coding units. If the independent coding unit is divided into multiple non-overlapping coding units, the division method may be horizontal equal division, vertical equal division, or horizontal and vertical equal division. The specific implementation is not shown here. The coding units within the independent coding unit may be interdependent, that is, they may reference each other during the prediction step.

[0111] The width of a coding unit is w_cu and the height is h_cu. Optionally, the width is greater than the height (unless it is an edge area). Usually, a coding unit can be a fixed w_cu x h_cu, where w_cu and h_cu are both powers of 2N (N is greater than or equal to 0), such as 16x4, 8x4, 16x2, 8x2, 4x2, 8x1, 4x1, etc.

[0112] A coding unit can include three components: luminance (Y), chrominance (Cb), and chrominance (Cr) (or red (R), green (G), and blue (B)), or just one of them. If it includes all three components, the sizes of the components can be identical or different, depending on the input image format.

[0113] like Figure 4 The figure shows a schematic diagram of the corresponding relationship between an image, a parallel coding unit, an independent coding unit and a coding unit. Figure 4 In the description, an image is divided into parallel coding unit 1 and parallel coding unit 2 according to 3:1, and an independent coding unit includes 4 coding units.

[0114] The prediction processing unit 201 is configured to receive or obtain a true value of an image block and reconstructed image data, and predict a current image block based on relevant data in the reconstructed image data to obtain a prediction block of the current image block.

[0115] The residual calculation unit 202 is used to calculate the residual value between the real value of the image block and the prediction block of the image block to obtain the residual block, for example, by subtracting the pixel value of the prediction block from the pixel value of the image block pixel by pixel.

[0116] In one example, the residual coding unit 203 is configured to determine residual coefficients of the current image block based on the residual block. Optionally, this 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. The transform coefficients may also be referred to as transform residual coefficients, which can represent the residual block in the transform domain. Of course, the transform step may not be included.

[0117] The quantization unit 204 is configured to quantize the transform coefficients by applying scalar quantization or vector quantization to obtain quantized transform coefficients, which may also be referred to as quantized residual coefficients. The quantization process may reduce the bit depth associated with some or all of the transform coefficients. For example, an n-bit transform coefficient may be rounded down to an m-bit transform coefficient during quantization, where n is greater than m. The degree of quantization may be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, different scales may be applied to achieve finer or coarser quantization. A smaller quantization step size corresponds to finer quantization, while a larger quantization step size corresponds to coarser quantization. The appropriate quantization step size may be indicated by the QP.

[0118] The coefficient coding unit 205 is configured to encode the quantized residual coefficients and output the encoded image data (i.e., the encoding result of the current image block to be encoded) in the form of an encoded bitstream. The encoded bitstream can then be transmitted to a decoder or stored for subsequent transmission to a decoder or retrieval. The coefficient coding unit 205 can also be configured to encode other syntax elements for the current image block, such as encoding a prediction mode index into the bitstream.

[0119] In one example, the coefficient coding unit 205 encodes the residual coefficient. One feasible method is: semi-fixed length coding. First, the maximum absolute value of the residual in a residual block (RB) is defined as modifiedmaximum (mm). The number of coding bits for the residual coefficient in the RB is determined (the number of coding bits for the residual coefficient in the same RB is consistent). For example, if the CL of the current RB is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the CL of the previous RB is 7, it means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If both -2^(M-1) and 2^(M-1) exist, M should be increased by 1, that is, M+1 bits are required to encode all residuals of the current RB; if only one of the two boundary values ​​of -2^(M-1) and 2^(M-1) exists, a trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), the trailing bit does not need to be encoded.

[0120] Of course, other residual coefficient encoding methods may also be used, such as exponential Golomb encoding method, Golomb-Rice encoding method, truncated unary encoding method, run-length encoding method, direct encoding of original residual values, etc.

[0121] In addition, for some special cases, the original value can be directly encoded instead of the residual value.

[0122] The inverse quantization unit 206 is configured to inversely quantize the quantized coefficients to obtain inversely quantized coefficients. The inverse quantization is a reverse application of the quantization unit 204, for example, applying an inverse quantization scheme of the quantization scheme applied by the quantization unit 204 based on or using the same quantization step size as the quantization unit 204. The inversely quantized coefficients may also be referred to as inversely quantized residual coefficients.

[0123] The residual decoding unit 207 is configured to decode the dequantized residual coefficients into a residual block. Optionally, this process may include performing an inverse transform on the dequantized coefficients. For example, the inverse transform may include an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST) to obtain an inverse transformed block in the pixel domain (or sample domain). The inverse transformed block may also be referred to as an inverse transformed dequantized block or an inverse transformed residual block. Of course, the inverse transform step may not be included.

[0124] 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. The reconstruction unit 208 can be a summer, 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 can be subsequently used to predict other image blocks.

[0125] The filter unit 209 (or simply “filter”) is configured to filter the reconstructed block to obtain a filtered block, thereby smoothly performing pixel conversion or improving image quality.

[0126] In one example, an encoding process such as Figure 5 As shown. Specifically, the encoder determines whether to adopt the point-by-point prediction mode. If so, prediction is performed based on the point-by-point prediction mode, and inverse quantization and reconstruction steps are performed to implement the encoding process; if not, it is determined whether to adopt the original value mode. If so, the original value mode is adopted for encoding; if not, it is determined to adopt other prediction modes such as intra-frame prediction or block copy mode for prediction. Subsequently, when it is determined to perform residual skipping, the reconstruction step is directly performed; when it is determined not to perform residual skipping, the inverse quantization step is first performed, and it is determined whether to adopt the block copy prediction mode. If it is determined to adopt the block copy prediction mode, in one case, when it is determined to perform transform skipping, the reconstruction step is directly performed; in another case, when it is determined not to perform transform skipping, the encoding process is implemented by performing inverse transform and reconstruction steps. If it is determined not to adopt the block copy mode (in this case, one of the prediction modes adopted is the intra-frame prediction mode), the inverse transform step and the reconstruction step are performed to implement the encoding process.

[0127] Specifically, in the embodiment of the present application, the encoder 20 is used to implement the encoding method described in the embodiments below.

[0128] See also Figure 6 , Figure 6 A schematic block diagram of an example of a decoder 30 for implementing an embodiment of the present application is shown. The decoder 30 is used to receive, for example, encoded image data (i.e., an encoded bitstream, for example, an encoded bitstream including 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 operations substantially similar to those described in the preceding text. Figure 2 The decoding pass is the inverse of the encoding pass described by the encoder 20. Optionally, the decoder 30 may further include a buffer and a decoded image buffer, wherein the buffer is used to cache the reconstructed image blocks output by the reconstruction unit 305, and the decoded image buffer is used to cache the filtered image blocks output by the filter unit 306.

[0129] The code stream parsing unit 301 is configured to decode the encoded image data to obtain quantized coefficients and / or decoded coding parameters (e.g., the decoded parameters may include any or all of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters, and / or other syntax elements). The code stream parsing unit 301 is further configured to forward the decoded coding parameters to the prediction processing unit 304, for the prediction processing unit to perform a prediction process based on the coding parameters.

[0130] 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 configured to inverse quantize (ie, inverse quantize) the quantized coefficients decoded by the code stream parsing unit 301 .

[0131] The function of the residual decoding unit 303 can be the same as that of the residual decoding unit 207 of the encoder 20, and the function of the reconstruction unit 305 (for example, a summer) can be the same as that of the reconstruction unit 208 of the encoder 20, which is used to perform an inverse transform (for example, 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 (also referred to as an inverse transform residual block), which is the residual block of the current image block in the pixel domain.

[0132] The prediction processing unit 304 is used to receive or obtain encoded image data (for example, the encoded bit stream of the current image block) and reconstructed image data. The prediction processing unit 301 can also receive or obtain prediction-related parameters and / or information about the selected prediction mode (that is, decoded encoding parameters) from, for example, the code stream parsing unit 302, and predict the current image block based on the relevant data in the reconstructed image data and the decoded encoding parameters to obtain a prediction block of the current image block.

[0133] The reconstruction unit 305 is configured to add the inverse transform block (ie, the inverse transform residual block) to the prediction block to obtain a reconstructed block in the sample domain, for example, by adding sample values ​​of the inverse transform residual block to sample values ​​of the prediction block.

[0134] The filter unit 306 is configured to filter the reconstructed block to obtain a filtered block, which is the decoded image block.

[0135] Specifically, in the embodiment of the present application, the decoder 30 is used to implement the decoding method described in the embodiments below.

[0136] It should be understood that in the encoder 20 and decoder 30 of the embodiment of the present application, the processing results of a certain link can also be output to the next link after further processing. For example, after the interpolation filtering, motion vector derivation or filtering links, the processing results of the corresponding link are further subjected to operations such as Clip or shift.

[0137] In one example, a decoding process may include the following steps:

[0138] Step 1: The code stream parsing unit 301 parses the prediction mode and the residual coding mode;

[0139] Step 2: The code stream parsing unit 301 parses quantization-related values ​​(such as near values ​​or QP values) based on the prediction mode and the residual coding mode;

[0140] Step 3: The inverse quantization unit 302 parses the residual coefficients based on the prediction mode and the quantization correlation value;

[0141] Step 4: The prediction processing unit 304 obtains the predicted value of each pixel of the current image block based on the prediction mode;

[0142] Step 5: The residual value decoding unit 303 obtains the residual value of each pixel of the current image block based on the residual coefficient decoding;

[0143] Step 6: The reconstruction unit 305 obtains a reconstructed value of each pixel in the current coding unit based on the predicted value and residual value of each pixel.

[0144] Below, in conjunction with the accompanying drawings, the embodiment of the present application provides the following image encoding and decoding method for illustration.

[0145] It should be noted that the encoding end in any embodiment of the present application may be the above Figure 2 or Figure 3 The encoder in can also be the above Figure 2 The source device in any embodiment can be the above-mentioned decoding end Figure 2 or Figure 6 The decoder in can also be the above Figure 2 The destination device in the

[0146] Example 1

[0147] like Figure 7A , which is a flow chart of an image encoding method provided in an embodiment of the present application. Figure 7A The method shown includes the following steps:

[0148] S101: The encoding end determines a target prediction mode for a unit to be encoded.

[0149] The unit to be encoded may be any image block to be encoded (ie, encoding unit) in the image to be encoded.

[0150] The target prediction mode may be one of a plurality of predefined prediction modes, specifically an original value mode, or other prediction modes other than the original value mode.

[0151] In one example, the other prediction modes include any one or more of: at least one point-by-point prediction mode, at least one intra-frame prediction mode, and at least one block copy mode. For example, the other modes include three prediction modes: point-by-point prediction mode, intra-frame prediction mode, and block copy mode. For another example, the other modes include five prediction modes: point-by-point prediction mode 0, point-by-point prediction mode 1, intra-frame prediction mode 0, block copy mode 0, and block copy mode 1.

[0152] In another example, the other prediction modes include: at least one point-by-point prediction mode based on normal residual coding, at least one intra-frame prediction mode, at least one block copy mode; at least one point-by-point prediction mode based on skipped residual coding, at least one intra-frame prediction mode, and at least one block copy mode, any one or more of which are combined. This example can be considered as combining the prediction mode in the traditional technology with the residual coding mode to obtain the new prediction mode defined in the embodiments of the present application.

[0153] When the prediction mode is the point-by-point prediction mode based on normal residual coding, the encoder uses the normal residual coding mode to encode the residual coefficients and the point-by-point prediction mode to predict the pixel values ​​of the coding unit to be coded. When the prediction mode is one of the other modes, the process is similar and will not be described in detail.

[0154] S102: The encoding end determines the index of the target prediction mode from an index table based on the target prediction mode; wherein the index table includes the corresponding relationship between the indexes of multiple prediction modes and the multiple prediction modes.

[0155] Optionally, the correspondence between multiple prediction modes and their respective indexes can be stored through an index table, and of course can also be stored through other methods, which is not limited in the embodiments of the present application.

[0156] Optionally, the encoding end jointly encodes the indexes of the multiple prediction modes.

[0157] For example, the indexes of the multiple prediction modes are encoded in a truncated unary code manner, that is, the indexes of the multiple prediction modes are generated in a truncated unary code manner, as can be seen from the following Examples 1 and 2.

[0158] For another example, the indexes of the multiple prediction modes are encoded in a binary tree manner, as can be seen in Example 3 below.

[0159] Optionally, the codeword length (ie, the number of binary characters, also referred to as code length) of the index of the original value mode is greater than or equal to the codeword length of the index of other prediction modes.

[0160] Optionally, the codeword length of the prediction mode index is related to the frequency of use of the prediction mode. The frequency of use here can be obtained based on big data statistics, and the embodiment of the present application does not limit its statistical method. For example, the more frequently used the prediction mode is, the shorter the codeword of its index is. Of course, for the multiple prediction modes, there may be some prediction mode indexes that meet the rules shown in this optional implementation. Further optionally, there may be multiple prediction mode indexes with the same codeword length.

[0161] S103: The encoder encodes the index of the target prediction mode into the bitstream.

[0162] like Figure 7B As shown in FIG, an image decoding method is provided in an embodiment of the present application. Figure 7A The image encoding method shown corresponds to . Figure 7B The methods shown include:

[0163] S201: The decoding end parses the bitstream to obtain a syntax element, where the syntax element includes an index of a target prediction mode of a unit to be decoded.

[0164] The unit to be decoded can be Figure 7A The unit to be encoded in the method shown is obtained by encoding.

[0165] Optionally, the encoding end jointly encodes the indexes of the multiple prediction modes, for example, encodes the indexes of the multiple prediction modes in a truncated unary code manner, that is, the indexes of the multiple prediction modes are generated in a truncated unary code manner.

[0166] 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 other prediction modes.

[0167] Optionally, the codeword length of the prediction mode index is related to the usage frequency of the prediction mode. For example, the more frequently used the prediction mode is, the shorter the codeword of its index is.

[0168] S202: The decoding end determines the target prediction mode from an index table based on the index of the target prediction mode; wherein the index table includes indexes of multiple prediction modes and correspondences between the multiple prediction modes.

[0169] S203: The decoding end 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.

[0170] In one example, the decoding end predicts the pixel values ​​of the unit to be decoded based on the target prediction mode to obtain a prediction block. The decoding end then parses the bitstream to obtain information related to the residual block of the unit to be decoded, and based on this information, obtains the residual block of the unit to be encoded. The unit to be decoded is then reconstructed based on the prediction block and the residual block to obtain a reconstructed block.

[0171] The decoding end reconstructs the decoding unit based on at least the target prediction mode, but is not limited thereto. In another example, the decoding end may be based on the following Figure 21 The method in reconstructs the decoding unit.

[0172] It should be noted that in traditional technology, at the encoding end, an additional bit is usually used to indicate whether the prediction mode of the current image block (i.e., the unit to be encoded) is the original value mode (for example, this bit is recorded as org_flag. If org_flag is "1", it indicates that the prediction mode of the current block is the original value mode. If org_flag is "0", it indicates that the prediction mode of the current block is not the original value mode). If it is not the original value mode, the index of other prediction modes is encoded in the bitstream. However, since the probability of adopting the original value mode is very low, for most image blocks, 1 0 needs to be encoded in the bitstream, which will cause a waste of transmission resources (i.e., increase the bitstream transmission overhead), and regardless of whether the prediction mode is the original value prediction mode, the decoding end needs to decode this flag bit org_flag first, which increases the decoding complexity of the decoding end.

[0173] In the image encoding method shown in FIG. 7 , an embodiment of the present application provides a method for directly determining the target prediction mode index from an index table based on the target prediction mode. This process eliminates the need to include an index indicating whether the target prediction mode is in the original value (e.g., a flag bit, org_flag) in the bitstream. Since the target prediction mode does not use the original value mode in most cases, for example, point-by-point prediction mode or intra-frame prediction mode is typically used, encoding of the flag bit (org_flag) indicating whether the original value mode is used, as in conventional schemes, is unnecessary in most cases. This helps reduce bitstream transmission overhead.

[0174] Accordingly, in the embodiments of the present application Figure 10 In the provided image decoding method, the target prediction mode can be directly determined from the index table based on the index of the target prediction mode without parsing the flag bit org_flag, thereby reducing the decoding complexity of the decoding end.

[0175] Figure 7B The image decoding method shown is the same as Figure 7A The image encoding method shown corresponds to , therefore, the image decoding method helps to save code stream transmission overhead.

[0176] Example 1: Assuming that the above-mentioned multiple prediction modes include raw value mode, point prediction mode, intra-frame prediction mode and block copy mode, then a feasible method is to encode the indexes of these prediction modes in a truncated unary code manner, and the encoding of the index of the raw value mode uses a longer codeword, and the encoding of the index of other prediction modes uses a shorter codeword. For example: the codeword of the index of the point-by-point prediction mode is 0, the codeword of the intra-frame prediction mode is 10, the codeword of the block copy mode is 111, and the codeword of the index of the raw value mode is 110. Based on this scheme, since in most cases the point-by-point prediction mode or the intra-frame prediction mode is used, there is no need to encode the flag bit (org_flag) in the traditional scheme that represents whether the raw value mode is used.

[0177] Based on this example, the index table can be shown as Table 1:

[0178] Table 1: Index table encoded in the truncated unary code mode

[0179]

[0180] Example 2: Assume that the multiple prediction modes mentioned above include: original value mode, point-by-point prediction mode based on normal residual coding, intra prediction mode, block copy mode, and point-by-point prediction mode based on skipped residual coding, intra prediction mode, and block copy mode. The point-by-point prediction mode, intra prediction mode, and block copy mode based on normal residual coding are denoted as normal point-by-point prediction mode (mode 1), normal intra prediction mode (mode 2), and normal block copy mode (mode 3), respectively; the point-by-point prediction mode, intra prediction mode, and block copy mode based on skipped residual coding are denoted as special point-by-point prediction mode (mode 4), special intra prediction mode (mode 5), and special block copy mode (mode 6), respectively. Including the original value mode (mode 7), there are a total of seven prediction modes. Therefore, one feasible method is to encode the indices of these prediction modes using truncated unary codes, with the codewords for modes 1-7 being: 0, 10, 110, 1110, 11110, 111110, and 111111, respectively.

[0181] Based on this example, the index table can be shown as Table 2:

[0182] Table 2: Index table encoded in the truncated unary code mode

[0183]

[0184] Example 3: Encoding the indexes of multiple prediction modes using a binary tree method. Table 3 shows an encoding method.

[0185] Table 3: Index table encoded in binary tree format

[0186]

[0187] Table 3 uses multiple prediction modes including the 15 prediction modes as an example for illustration. In actual implementation, the index table shown in Table 3 may include only two columns: prediction mode and prediction mode index, or three columns: prediction mode number, prediction mode, and prediction mode index.

[0188] The indexes of the various prediction modes in Table 3 are generated according to the following rules:

[0189] First, "0" and "1" are respectively set as the highest bit flags of the indexes of "point prediction mode, intra block copy mode" and "intra prediction mode, original value mode".

[0190] Next, for “point prediction mode, intra block copy mode”, “0” and “1” are respectively used as the second highest flags of the indexes of “point prediction mode” and “intra block copy mode”.

[0191] Next, for the point prediction mode, "1" and "0" are used as the third flag bit of the index of "point prediction mode 0-1" and "point prediction mode 2-3" respectively.

[0192] Finally, for “point prediction mode 0-1”, “0” and “1” are used as the fourth flag bit of the index of “point prediction mode 0” and “point prediction mode 1” respectively.

[0193] Thus, the indexes of point prediction mode 0 and point prediction mode 1 are respectively “0010” and “0011”. The generation method of indexes of other prediction modes is similar and will not be repeated here.

[0194] For frame prediction modes 0-6, "1" and "0" are used as the second-highest bits of the indexes for "frame prediction mode 0" and "frame prediction modes 1-6," respectively. The indexes for other frame prediction modes are not described here. The index generation method for intra block copy mode is similar.

[0195] Optionally, the code length of a prediction mode index is related to the usage frequency of the prediction mode. In one example, referring to Table 3, considering that point prediction modes 0-3 have roughly the same usage frequency, the code lengths of their indexes are set to be the same; considering that intra-frame prediction mode 0 is more frequently used than intra-frame prediction modes 1-6, the code length of its index is less than the usage frequency of the codewords of intra-frame prediction modes 1-6. Other examples are not listed one by one.

[0196] Optionally, the index of one prediction mode does not serve as a prefix for the indices of other prediction modes. For example, the index for prediction mode 0 is "11," and the prefixes for the indices of the other 14 prediction modes are not "11." This is a technical solution proposed based on the consideration that if the prefix of the index of one or more prediction modes is "11," the decoder cannot determine whether the prediction mode is prediction mode 0 or one or more prediction modes when it recognizes "11." This helps the decoder to decode quickly.

[0197] It should be noted that the specific implementation method of generating indexes of multiple prediction modes based on a binary tree is not limited to Table 3.

[0198] For example, in Table 3, the code lengths of the indexes of point prediction modes 0-3 are equal. In specific implementation, the code lengths of the indexes of any two point prediction modes may also be unequal, such as the generation method of the indexes of frame prediction modes 0-6.

[0199] For example, the code lengths of the indexes of intra prediction modes 0-6 may also be equal, such as the generation method of the indexes of reference point prediction modes 0-3.

[0200] For example, Table 3 uses "0" and "1" as the highest bit marks of the indexes of "point prediction mode, intra-frame block copy mode" and "intra-frame prediction mode, original value mode" respectively; in specific implementation, "1" and "0" can also be used as the highest bit marks of the indexes of "point prediction mode, intra-frame block copy mode" and "intra-frame prediction mode, original value mode" respectively.

[0201] Other examples are not listed one by one.

[0202] Example 2

[0203] like Figure 8A , which is a schematic diagram of an image encoding method provided in an embodiment of the present application. Figure 8A The method shown includes the following steps:

[0204] S301: The encoder determines a residual coding mode for a unit to be coded, wherein the residual coding mode may include a skip residual coding mode or a normal residual coding mode.

[0205] For the relevant explanations about the unit to be coded, the skip residual coding mode and the normal residual coding mode, please refer to the above and will not be repeated here.

[0206] S302: If the residual coding mode is the skip residual coding mode, the encoder encodes the index of the residual coding mode into the bitstream. In this case, it is not necessary to encode the residual quantization related value (such as the near value or QP value) of the unit to be coded into the bitstream.

[0207] S303: If the residual coding mode is a normal residual coding mode, the encoder encodes the index of the residual coding mode and the residual quantization-related value (such as a near value or QP value) of the unit to be coded into the bitstream. In one example, the encoder first encodes the index of the residual coding mode and then encodes the residual quantization-related value of the unit to be coded.

[0208] S304: If the residual coding mode is the skip residual coding mode, the encoder 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. In this case, it is not necessary to obtain the residual quantization related value of the unit to be coded.

[0209] S305: If the residual coding mode is the normal residual coding mode, the encoder obtains the residual quantization correlation 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.

[0210] Among them, S304-S305 can be considered as a reconstruction process performed by the encoding end.

[0211] like Figure 8B FIG. 1 is a schematic diagram of an image decoding method provided by an embodiment of the present application. Figure 8A The image encoding method shown corresponds to . Figure 8B The method shown includes the following steps:

[0212] S401: The decoding end parses the code stream to obtain a syntax element. The syntax element includes the index of the residual coding mode of the unit to be decoded. The unit to be decoded can be Figure 8A The method shown in FIG4 is used to encode the image block obtained by encoding the unit to be encoded.

[0213] S402: If the index of the residual coding mode is used to indicate skipping the residual coding mode, the decoding end predicts the unit to be decoded to obtain a prediction block, and determines the prediction block as a reconstructed block of the unit to be decoded.

[0214] Since the residual coding mode is a skip residual coding mode, that is, the residual values ​​of the units to be decoded are all 0, the predicted block can be directly used as a reconstructed block.

[0215] S403: If the index of the residual coding mode indicates the normal residual coding mode, the decoding end parses the residual quantization correlation value of the unit to be decoded to obtain a residual block; and reconstructs the unit to be decoded at least based on the residual block to obtain a reconstructed block.

[0216] In one example, the above syntax elements may further include a prediction mode of the unit to be decoded, and the decoding end predicts the unit to be decoded based on the prediction mode to obtain a prediction block, and reconstructs the unit to be decoded based on the residual block and the prediction block to obtain a reconstructed block. The process of reconstructing the unit to be decoded based on at least the residual block is not limited thereto. In another example, based on Figure 21 The reconstruction is performed using the method shown to obtain a reconstructed block.

[0217] It should be noted that in traditional technologies, a flag bit (resp_skip_flag) is typically used to indicate whether the current block uses the skip residual coding mode. The encoding (decoding) of the residual quantization-related value occurs before res_skip_flag. Therefore, even if res_skip_flag is 1, the residual quantization-related value still needs to be encoded (decoded). However, the residual quantization-related value in this case is redundant. Therefore, this technical solution not only increases the bitstream transmission overhead between the encoder and decoder, but also increases the decoding complexity on the decoder.

[0218] The embodiments of this application Figure 8A In the provided image coding method, considering that "if the residual coding mode is skipped (such as res_skip_flag is 1), there is no need to encode or decode the residual coefficients, and therefore the residual quantization-related values ​​(such as near values, or QP values, etc.) do not need to be encoded (decoded)", it is proposed to first encode the residual coding mode information (such as the index of the residual coding mode, such as res_skip_flag) at the encoding end, and then determine whether to encode the residual quantization-related values ​​(such as near values, or QP values) based on the residual coding mode. Compared with traditional technologies, when the residual coding mode is skipped residual coding mode, there is no need to encode the residual quantization-related values, which helps to save bitstream transmission overhead.

[0219] Accordingly, in the embodiments of the present application Figure 8B In the provided image decoding method, the residual coding mode information (such as the index of the residual coding mode, such as res_skip_flag) can be first parsed, and then based on the residual coding mode, whether to parse the residual quantization related value (such as the near value or QP value) can be determined, thereby reducing the decoding complexity at the decoding end.

[0220] Example 3

[0221] like Figure 9A , which is a schematic diagram of an image encoding method provided in an embodiment of the present application. Figure 9A The method shown includes the following steps:

[0222] S501: The encoding end determines a target prediction mode for a unit to be encoded, wherein the target prediction mode includes a prediction mode based on skipped residual coding or a prediction mode based on normal residual coding.

[0223] The prediction mode based on skipped residual coding and the prediction mode based on normal residual coding can be considered to be a combination of the prediction mode in traditional technology and the residual coding mode, thereby obtaining a new prediction mode defined in the embodiments of the present application.

[0224] In an example, the point-by-point prediction mode based on skipping residual coding includes: a point-by-point prediction mode based on skipping residual coding, an intra-frame prediction mode, or a block copy mode.

[0225] In an example, the prediction mode based on normal residual coding includes: a point-by-point prediction mode, an intra-frame prediction mode, or a block copy mode based on normal residual coding.

[0226] S502: The encoder encodes the index of the target prediction mode into the bitstream.

[0227] In one example, the method for generating the index of the target prediction mode can refer to Figure 7A In the illustrated embodiment, for example, the indexes of the multiple prediction modes are jointly encoded, for example, using a truncated unary encoding scheme. Of course, the specific implementation is not limited thereto. In another example, a conventional method can be used, such as first encoding the flag bit org_flag, and then encoding the target prediction mode index into the bitstream.

[0228] S503: If the target prediction mode is a prediction mode based on skipping residual coding, the encoder performs prediction on 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.

[0229] S504: If the target prediction mode is a prediction mode based on normal residual coding, the encoding end obtains the residual quantization correlation value of the unit to be coded, obtains the 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.

[0230] Among them, S503-S504 can be considered as a reconstruction process performed by the encoding end.

[0231] In one example, reconstructing the coding unit based on the target prediction mode and the residual block may include: predicting the coding unit based on the target prediction mode to obtain a prediction block, and reconstructing the coding unit based on the prediction block and the residual block. Of course, this is not limited to this. In another example, based on Figure 21 The reconstruction is performed using the method shown to obtain a reconstructed block.

[0232] like Figure 9B FIG. 1 is a schematic diagram of an image decoding method provided by an embodiment of the present application. Figure 9A The image encoding method shown corresponds to . Figure 9B The method shown includes the following steps:

[0233] S601: The decoder parses the bitstream to obtain a syntax element, wherein the syntax element includes an index of a target prediction mode for the unit to be decoded, wherein the target prediction mode includes an index of a prediction mode based on skipped residual coding or an index of a prediction mode based on normal residual coding.

[0234] S602: If the target prediction mode is a prediction mode based on skipping residual coding, the decoding end predicts the unit to be decoded to obtain a prediction block, and determines the prediction block as a reconstructed block.

[0235] S603: If the target prediction mode is a prediction mode based on normal residual coding, the decoding end parses the residual quantization correlation value of the unit to be decoded to obtain the 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.

[0236] In one example, reconstructing the unit to be decoded based on the target prediction mode and the residual block may include: predicting the unit to be decoded based on the target prediction mode to obtain a prediction block, and reconstructing the unit to be decoded based on the prediction block and the residual block. Of course, this is not limited to this. In another example, based on Figure 21 The reconstruction is performed using the method shown to obtain a reconstructed block.

[0237] Figure 9A and Figure 9B The image encoding and decoding method shown has at least the following beneficial effects:

[0238] On the one hand, the traditional residual coding mode is combined with the prediction mode as a new prediction mode provided in the embodiment of the present application. In this way, there is no need to encode (decode) the residual coding mode and the prediction mode separately. It is only necessary to uniformly encode (decode) the new prediction mode, which simplifies the implementation logic and helps save the code stream transmission overhead. In other words, the encoding end can encode the residual skip mode as a prediction mode. The encoding end (decoding end) first encodes (decodes) the prediction mode, and then determines whether it is necessary to parse the residual quantization related value (such as the near value, or QP value) based on the prediction mode to save bit rate.

[0239] On the other hand, the residual coding mode information (such as the index of the residual coding mode, such as res_skip_flag) is first encoded (or decoded), and then based on the residual coding mode, it is determined whether to encode (or decode) the residual quantization-related value (such as the near value or QP value). Compared with traditional technologies, when the residual coding mode is the skip residual coding mode, there is no need to encode (or decode) the residual quantization-related value, which helps to save bitstream transmission overhead.

[0240] For example, based on the encoding method shown in Example 2 above, the decoding end can determine whether the corresponding to-be-decoded unit requires residual encoding based on the prediction mode. For modes that do not require residual encoding (such as modes 4, 5, 6, and 7 above), there is no need to encode (or decode) the residual quantization-related value (such as the near value or QP value).

[0241] Example 4

[0242] like Figure 10 As shown, an image reconstruction method provided by an embodiment of the present application can be applied to an image encoding method or an image decoding method. Figure 10 The method shown may include the following steps:

[0243] S701: Determine a prediction mode for at least one prediction group into which a current image block is divided. Any one of the at least one prediction group includes a plurality of consecutive pixels in the same row; the any one 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, the plurality of pixel groups being obtained by dividing the second designated pixel region, and the first designated pixel region and the second designated pixel region having different prediction modes. The plurality of pixel groups can be predicted in parallel, and a pixel group includes one or more consecutive pixels.

[0244] When this embodiment is applied to an image coding method, the execution subject of this embodiment may be an encoding end, and the current image block is specifically an image block to be encoded or a unit to be encoded.

[0245] When this embodiment is applied to an image decoding method, the execution entity of this embodiment may be a decoding end, and the current image block may specifically be an image block to be decoded or a unit to be decoded. S701 may include: parsing a bitstream to obtain an index of a prediction mode of any one or more prediction groups in at least one prediction group into which the current image block is divided.

[0246] The embodiment of the present application 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.

[0247] In one example, the current image block may be divided into one prediction group, which is equivalent to not dividing the current image block into prediction groups. In this case, all pixels in the current image block are regarded as one prediction group.

[0248] In another example, the current image block may be divided into multiple prediction groups.

[0249] The embodiment of the present application does not limit the division method of the prediction groups of the current image block, nor the prediction mode of each prediction group. Hereinafter, the division mode and the prediction mode based on the division mode are collectively referred to as "division prediction mode".

[0250] In one example, a prediction group may be composed of all / part of the pixels in one row / multiple rows of the current image block. Of course, other implementations are also possible. In principle, a prediction group only needs to include multiple consecutive pixels in the same row.

[0251] In one example, the number of consecutive pixels included in a prediction group is greater than or equal to a preset threshold. This is because, when a prediction group contains a large number of consecutive pixels, using serial prediction for the pixels in the prediction group may result in a longer prediction time for the prediction group. In this case, if this solution is used, multiple pixel groups in a prediction group can be predicted in parallel, which helps to shorten the prediction time for the prediction group.

[0252] If there is no dependency between the pixels in two pixel groups during the prediction process, the two pixel groups can be predicted in parallel. The number of pixels contained in different pixel groups can be equal or unequal.

[0253] The embodiments of the present application do not limit which pixels the first designated pixel area and the second designated pixel area specifically include, nor do they limit the prediction method for these pixels. In principle, any "first designated pixel area and second designated pixel area, and prediction method" that satisfies the requirement of "parallel prediction between multiple pixel groups, and the pixel group includes one or multiple consecutive pixels" can be used.

[0254] like Figure 11 As shown, a method for dividing parallel pixel groups provided in an embodiment of the present application is provided. Figure 11 In the example, the consecutive pixels in the same row of a prediction group are pixels 1-12, the first designated pixel region includes pixels 3, 7, and 11, and the second designated pixel region includes pixels 1-2, 4-6, 8-10, and 12. The multiple pixel groups are pixel groups 1-4, where pixel groups 1-3 each include multiple pixels, and pixel group 4 includes one pixel. Pixel groups 2 and 3 have the same number of pixels, but not the same number of pixels as the other pixel groups.

[0255] In one example, the first designated pixel region uses vertical prediction, and the second designated pixel region uses horizontal prediction. In this way, parallel prediction can be achieved between multiple pixel groups.

[0256] In another example, the first designated pixel region adopts vertical prediction, and the second designated pixel region adopts vertical mean prediction. In this way, parallel prediction can be achieved between multiple pixel groups.

[0257] Optionally, the difference in the number of pixels included in different pixel groups is equal to or less than a threshold value. This helps to achieve that the number of pixels included in multiple pixel groups is equal or as equal as possible, so that the prediction durations of different pixel groups predicted in parallel are the same or approximately the same, thereby shortening the total prediction duration of a prediction group.

[0258] S702: Reconstruct the current image block based on the prediction mode of the at least one prediction group to obtain a reconstructed block.

[0259] For example, for any one of the at least one prediction group, the prediction group is predicted based on the prediction mode of the prediction group to obtain a prediction block of the prediction group; and a residual block of the prediction group is obtained; then, based on the prediction block and the residual block, the reconstructed block is obtained. Of course, there are other implementation methods. For example, when all the values ​​in the residual block are 0, the prediction block is directly used as the reconstructed block. For another example, based on Figure 21 The reconstruction is performed using the method shown to obtain a reconstructed block.

[0260] Figure 11 In the image reconstruction method shown, when performing prediction, multiple pixel groups in a prediction group can be predicted in parallel, which helps to shorten the total prediction time of the prediction group. Figure 11 The image decoding method shown can be considered as a new point-by-point prediction mode provided by the embodiment of the present application.

[0261] Scalable, Figure 11 The "row" in the image reconstruction method shown can be replaced by "column", thereby forming a new embodiment to solve the problem that the prediction process takes a long time because the prediction process cannot be performed in parallel in the current image block whose height is greater than the width (for example, the size of the current image block is 2*16, 2*8 or 1*8, etc.). In this case, in one example, the first designated pixel area adopts horizontal prediction and the second designated pixel area adopts vertical prediction. In another example, the first designated pixel area adopts horizontal prediction and the second designated pixel area adopts horizontal average prediction. Other related embodiments can be based on the present application for Figure 11 The relevant description can be inferred and will not be repeated here.

[0262] Below, we will use specific examples to Figure 11 The image reconstruction method shown is described below:

[0263] For the 16x2 current image block, it can be a 16x2 luminance block or a 16x2 chrominance block.

[0264] 1) A prediction partitioning mode of the current image block of 16x2 is as follows Figure 12 As shown, the current image block includes Group 1-2. Specifically:

[0265] Group 1 consists of the second row of pixels and uses horizontal prediction.

[0266] Group 2 consists of the first row of pixels and uses vertical mean prediction. The pixels of group 2 can refer to the last row of pixels of the upper adjacent 16x2 image block.

[0267] like Figure 12 As shown in the figure, the encoding of the second pixel in group 2 depends on the reconstructed value of the first pixel, so the encoding and decoding of the first and second pixels cannot be performed in parallel. Furthermore, the encoding of the first pixel in group 1 depends on the reconstructed value of the first pixel in group 2, so neither encoding nor decoding can be performed simultaneously. This predictive partitioning scheme suffers from low parallelism, making it difficult to implement in hardware.

[0268] In order to improve the parallelism in the prediction process, the following examples are used in this application: Figure 11 In the embodiment shown, the prediction partitioning mode of the 16x2 current image block can be as follows: Figure 13A or Figure 13B As shown, Figure 13A and Figure 13B The prediction group division mode of the current image block shown is the same as Figure 12 Same, but different prediction modes. Specifically:

[0269] Any 16x2 current image block can refer to the values ​​of the left column (2 pixels) and the top row (16 pixels). The leftmost pixel of the 16x2 current image block is called the first pixel. Then:

[0270] Solution 1: Figure 13A As shown, the prediction modes include:

[0271] a) For the kN+1th (N is preferably 4, k=1, 2 or 3) pixel in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel.

[0272] b) Among the pixels in Group 2, except for the kN+1th pixel (N is preferably 4, k=1, 2 or 3), the other pixels use the reconstructed value of the pixel to the left as the predicted value of the current pixel.

[0273] c) Optionally, for pixels in Group 1, except for the kN+1th pixel (N is preferably 4, k = 1, 2, or 3), the predicted values ​​of all other pixels are preset values ​​(i.e., default values). Optionally, the predicted value of each pixel is the average of the reconstructed value of the pixel above it (the reconstructed value of the adjacent block above, denoted as P0) and the reconstructed value of the pixel below it (the reconstructed value of Group 2, denoted as P1) (e.g., (P0+P1+1)>>1). Here, '>>' represents an integer right shift. 'a>>N' represents a right shift of N bits, similar to dividing a by the power of 2, so '>>1' is equivalent to dividing by 2.

[0274] Option 2: Figure 13B As shown, the prediction modes include:

[0275] d) For the kN+2th (N is preferably 5, k=1, 2) pixel in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel.

[0276] e) Among the pixels in Group 2, except for the kN+2th pixel (N is preferably 5, k=1, 2), the other pixels use the reconstructed value of the pixel to the left as the predicted value of the current pixel.

[0277] f) Optionally, for pixels in Group 1, except for the kN+2th pixel (N is preferably 5, k=1, 2), the other pixels use the average of the reconstructed value of the pixel above them (the reconstructed value of the other adjacent block above, denoted as P0) and the reconstructed value of the pixel below them (the reconstructed value of group 2, denoted as P1) (e.g., (P0+P1+1)>>1, shifted right by one bit, that is, divided by 2) as the predicted value of the current pixel.

[0278] 2) A 16x2 prediction partitioning mode of the current image block is as follows Figure 14 As shown, the current image block includes Group 1-2. Specifically:

[0279] Group 1 consists of the first row of pixels and uses horizontal prediction.

[0280] Group 2 consists of the second row of pixels and uses horizontal prediction.

[0281] In order to improve the parallelism in the prediction process, the following examples are used in this application: Figure 11 In the embodiment shown, a prediction partitioning mode of a 16x2 current image block is as follows Figures 15A-15D As shown, Figures 15A-15D The prediction group division mode of the current image block shown is the same as Figure 14 Same, but different prediction modes. Specifically:

[0282] Solution 1: Figure 15AAs shown, the prediction modes include:

[0283] a) For the kN+1th (N is preferably 4, k=1, 2, 3) pixel in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel.

[0284] b) For other pixels in Group 1 and Group 2, the reconstructed value of the pixel to its left is used as the predicted value of the current pixel.

[0285] Option 2: Figure 15B As shown, the prediction modes include:

[0286] For the kN+1th pixel (N is preferably 4, k=2, 3) in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel on the left is used as the predicted value of the current pixel.

[0287] Option 3: Figure 15C As shown, the prediction modes include:

[0288] For the kN+2th pixel (N is preferably 5, k=1, 2) in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel on the left is used as the predicted value of the current pixel.

[0289] Option 4: Figure 15D As shown, the prediction modes include:

[0290] For the kN+1th pixel (N is preferably 8, k=1) in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel on the left is used as the predicted value of the current pixel.

[0291] It should be noted that in the above embodiments 1-2, N and k may take other values. Furthermore, when the number of consecutive pixels in the prediction group is different, the values ​​of N and k may also be different accordingly.

[0292] It should also be noted that Figures 13A-13B 、 Figures 15A-15D The reconstructed values ​​of the current image block surrounding the current image block of the pixel marked with black shadow in the middle may be set to default values ​​if they are not available.

[0293] For the 8x2 current image block, it can be an 8x2 luminance block or an 8x2 chrominance block.

[0294] A group prediction mode for the current image block of 8x2 is as follows Figure 16As shown. Among them, any 8x2 current image block can refer to the reconstruction values ​​of the pixels in the left column (2 pixels) and the upper row (8 pixels). Then:

[0295] like Figure 16 As shown in Figure a, in prediction partition mode A, all pixels use the reconstructed value of the upper pixel as the prediction value of the current pixel.

[0296] like Figure 16 As shown in Figure b, in prediction partition mode B, all pixels use the reconstructed value of the pixel on its left as the predicted value of the current pixel.

[0297] In order to improve the parallelism in the prediction process, the following examples are used in this application: Figure 11 In the embodiment shown, a prediction partitioning mode of a current image block of 8x2 is as follows Figure 17 shown.

[0298] exist Figure 17 For the kN+1th pixel (N is preferably 4, k=1) in Group 1 and Group 2, the reconstructed value of the pixel above it is used as the predicted value of the current pixel. For other pixels, the reconstructed value of the pixel on the left is used as the predicted value of the current pixel.

[0299] For the 8x1 current image block, it can be an 8x1 luminance block or an 8x1 chrominance block.

[0300] A group prediction mode for the current image block of 8x1 is as follows Figure 18 As shown in . Among them, any 8x1 current image block can refer to the reconstruction values ​​of the pixels in the left column (1 pixel) and the upper row (8 pixels). Then:

[0301] like Figure 18 As shown in Figure a, in prediction partition mode A, all pixels use the reconstructed value of the upper pixel as the prediction value of the current pixel.

[0302] like Figure 18 As shown in Figure b, in prediction partition mode B, all pixels use the reconstructed value of the left pixel as the prediction value of the current pixel.

[0303] exist Figure 18 In , the 8x1 current image block is divided into a prediction group.

[0304] In order to improve the parallelism in the prediction process, the following examples are used in this application: Figure 11 In the embodiment shown, a prediction partitioning mode of a current image block of 8x2 is as follows Figure 19 shown.

[0305] exist Figure 19In the 8x1 current image block, the kN+1th pixel (N is preferably 4, k=1) uses the reconstructed value of the pixel above it as the predicted value of the current pixel. The other pixels use the reconstructed value of the pixel on the left as the predicted value of the current pixel.

[0306] It should be noted that:

[0307] In one example, in any of the above schemes, if the current image block is located in the first column of a frame image or an independent encoding (decoding) unit, and there are no pixels to the left of the current image block, a default value may be used instead of the reconstructed value. For example, the default value may be 1<<(bit_depth-1).

[0308] Similarly, for any of the above schemes, if the current image block is in the first row of an image or an independent coding (decoding) unit, and there are no pixels above the current image block, a default value may be used instead of the reconstructed value. For example, the default value may be 1<<(bit_depth-1).

[0309] Among them, bit_depth represents the bit width of the current image block, for example, it can be 8, 9, 10, 12 or 16. 1<<(bit_depth-1) means bit_depth-1 is shifted left by one bit. It should be noted that the reconstructed values ​​of pixels in this application can be considered as the pixel values ​​of the pixels in a certain component. For example, the components here can be the red R component, the green G component or the blue B component in the RGB format; or, they can be the luminance Y component, the chrominance blue Cb component or the chrominance red Cr component in the YCbCr format. The size of each component can be the same as the image size or smaller than the image size. For example, in the YUV420 format, the size of Y is equal to the image size, and 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 the current image block in a certain component.

[0310] It should also be noted that in any of the above solutions, for each Group, in addition to using the above horizontal or vertical prediction modes, other prediction modes may also be used. One feasible prediction mode is to use the pixel values ​​of adjacent image blocks or adjacent independent image blocks for reference prediction.

[0311] Example 5

[0312] In some embodiments of the present application, the encoder may group the residual blocks of the coding unit. Specifically, each row of pixels in the coding unit is used as a prediction group, and the residual block of the prediction group is divided into at least one small residual block.

[0313] Division mode 1: The residual block of a prediction group is divided into a small residual block. This is equivalent to not grouping the residual block, such as Figure 20 As shown in Figure a.

[0314] Partition Mode 2: The residual block of a prediction group is divided into multiple residual blocks. Specifically, the residual block of a prediction group is divided into multiple residual blocks according to a preset ratio. This application does not limit the prediction ratio. The multiple residual blocks can be of equal size, or the sizes of some residual blocks can be equal.

[0315] For example, the residual block of a prediction group is divided into two residual blocks in a 1:1 ratio, such as Figure 20 As shown in Figure b.

[0316] For example, the residual block of a prediction group is divided into three residual blocks according to the ratio of 2:1:1, such as Figure 20 As shown in Figure c.

[0317] For example, the residual block of a prediction group is divided into three residual blocks according to the ratio of 1:1:2, such as Figure 20 As shown in Figure d.

[0318] For example, the residual block of a prediction group is divided into 4 residual blocks according to the ratio of 1:1:1:1, such as Figure 20 As shown in Figure e.

[0319] in, Figure 20 Figures a through e in the figure are illustrated using a 16x2 coding unit (CU), with each row serving as a prediction group. The 16x2 CU can be either a luma block or a chroma block. Each square in each figure represents a pixel, and squares of the same type (e.g., all white, or all shaded) represent pixels in the same residual block.

[0320] In addition, for an 8x1 prediction group, the residual block of the prediction group may be divided into one residual small block or divided equally into two residual small blocks. Of course, the specific implementation is not limited thereto.

[0321] In an example, the coefficients of pixels in the same residual block are encoded in the same manner, or the coding length (CL), that is, the number of bits occupied by the residual coefficients after encoding, of the pixels in the same residual block is the same.

[0322] In one example, the above Figure 20 Five partitioning modes of the residual block are illustrated.

[0323] In one example, 1 bit or 3 bits can be used to represent the partitioning mode GPM (as shown in Table 4). GP0-GP4 can correspond to Figure 20 Figures a-e in .

[0324] Table 4: GPM index encoding method (conventional binary encoding method)

[0325]

[0326] It should be noted that the index coding method of the residual block partition mode shown in Table 4 can also be applied to the partition modes of the residual blocks of prediction groups of other sizes, as well as other partition modes of the above-mentioned prediction groups.

[0327] It should be noted that when a residual block is divided into a large number of residual sub-blocks, more division pattern information needs to be encoded; when a residual block is divided into a small number of residual sub-blocks, residuals with different characteristics are grouped together, and the coding efficiency of the residual coefficients is low. To take at least these two considerations into account, the embodiments of the present application provide the above-mentioned residual block division method.

[0328] Example 6

[0329] like Figure 21 , which is a schematic diagram of an image reconstruction method provided in an embodiment of the present application, which can be applied to an image encoding method or an image decoding method. Figure 21 The method shown may include the following steps:

[0330] S801: Determine a target prediction mode of a current image block; wherein the current image block includes at least one prediction group; and any one prediction group of the at least one prediction group includes a plurality of consecutive pixels.

[0331] The plurality of continuous pixels may be a plurality of continuous pixels in a row or a plurality of continuous pixels in a column.

[0332] When this embodiment is applied to an image coding method, the execution subject of this embodiment may be an encoding end, and the current image block is specifically an image block to be encoded or a unit to be encoded.

[0333] When this embodiment is applied to an image decoding method, the execution subject of this embodiment may be a decoding end, and the current image block may specifically be an image block to be decoded or a unit to be decoded. S801 may include: parsing a bitstream to obtain an index of a target prediction mode for the current image block.

[0334] S802: When the target prediction mode satisfies a preset condition, a reconstructed value of the target pixel is determined based on a reference value of the first pixel among the plurality of consecutive pixels and a residual value of every two adjacent pixels between the first pixel and the target pixel; wherein the target pixel is any non-first pixel among the plurality of consecutive pixels, and the reconstructed block of the current image block includes the reconstructed value of the target pixel.

[0335] In one example, the first pixel in the plurality of consecutive pixels uses the first prediction method, and the non-first pixels use the second prediction method. The target prediction mode includes the first prediction method and the second prediction method. In this case, the target prediction mode satisfies the preset conditions including any of the following conditions:

[0336] Condition 1: Both the first prediction method and the second prediction method are horizontal predictions;

[0337] Condition 2: Both the first prediction mode and the second prediction mode are vertical predictions;

[0338] 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. For another example, the first prediction method is vertical prediction, and the second prediction method is horizontal prediction.

[0339] Condition 4: The first prediction mode is to use pixel values ​​of an image block adjacent to the current image block, or an independent coding (decoding) unit adjacent to the independent coding (decoding) unit where the current image block is located for reference prediction. The second prediction mode is horizontal prediction or vertical prediction.

[0340] The image reconstruction method provided in this embodiment allows the encoding / decoding end to obtain the reconstructed value of the current pixel directly based on the residual value between the previous pixel and its adjacent pixels when performing reconstruction, without having to wait for the reconstructed value of the previous pixel. This solution can also greatly improve the parallelism of the reconstruction process, thereby improving the decoding parallelism and throughput.

[0341] For simplicity, the following Figure 22 The prediction mode of the 8x1 image block shown is used as an example for explanation. Other image blocks or other prediction modes can be simply deduced by analogy and will not be described in detail.

[0342] The reconstruction value of the current 8x1 image block is R(i), the residual value is Res(i), and the predicted value is Pred(i), i=0, 1, ... 7. The reconstruction value of the 8x1 block above the current 8x1 block is RA(i)i=0, 1, ... 7, and the reconstruction value of the left pixel is RLi, i=0, 1, as shown in the following example: Figure 22 As shown. Figure 22 is Figure 19 Drawn on the basis of .

[0343] Based on the traditional method, the predicted value of the 8x1 image block is:

[0344] If i=0, then Pred(i)=RL0;

[0345] If i = 1, 2 or 3, then Pred(i) = R(i-1);

[0346] If i=4, then Pred(i)=RA(4);

[0347] If i=5, 6 or 7, then Pred(i)=R(i-1).

[0348] In summary, in the traditional method, the reconstructed value of the 8x1 image block is: R(i)=Pred(i)+Res(i)==R(i-1) / RA(4)+Res(i), i=0, 1,…7.

[0349] based on Figure 21 The method shown:

[0350] For i=0; R(0)=Pred(0)+Res(0)=RL0+Res(0);

[0351] 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).

[0352] 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).

[0353] In summary, for any value of i=0~3, Based on this method, the reconstructed value of the pixel with i = 1, 2, or 3 does not need to wait for the reconstruction value of the pixel to its left. Instead, the reconstructed value of the current pixel can be directly obtained by simply obtaining the pixel value RL0 to the left of the current image block and the residual value between the current pixel and the pixel to its left. This solution can also significantly improve decoding parallelism and throughput.

[0354] And so on, i=4~7, , the reconstructed values ​​of pixels i=5~7 can be obtained without waiting for the reconstructed values ​​of the pixels to its left.

[0355] It should be noted that, in the absence of any conflict, some or all of the technical features in any of the embodiments provided above may be combined to form new embodiments. Furthermore, the technical solutions provided in any of the embodiments above are applicable to 16x2, 8x2, and 8x1 image blocks, and can also be applied to other MxN image blocks, such as 4x2 and 16x4.

[0356] It is understood that in order to implement the functions in the above embodiments, the encoder / decoder includes hardware structures and / or software modules that perform the corresponding functions. Those skilled in the art should readily appreciate that, in conjunction with the units and method steps of the various examples described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in hardware or in a computer software-driven hardware manner depends on the specific application scenario and design constraints of the technical solution.

[0357] The following describes the decoding device and encoding unit provided by the embodiment of the present application. In one example, any of the decoding devices provided below can be Figure 2 The destination device 12 or decoder 122 in the embodiment of the present invention may be Figure 6 In another example, any of the following encoding devices may be Figure 2 The source device 11 or encoder 112 in the embodiment of the present invention may be Figure 3 The encoder 20 in the embodiment is described here uniformly and will not be described in detail below.

[0358] Figure 23 This is a structural diagram of a decoding device 3000 provided in the present application. Any of the above-mentioned decoding method embodiments can be executed using the decoding device. The decoding device 3000 includes a code stream parsing unit 3001, a determination unit 3002, and a reconstruction unit 3003. The code stream parsing unit 3001 is used to parse the code stream to obtain a first syntax element, and the first syntax element includes an index of a target prediction mode of a unit to be decoded. The determination unit 3002 is used to determine a target prediction mode from an index table based on the index of the target prediction mode; wherein the index table contains a correspondence between the indexes of multiple prediction modes and the multiple prediction modes; the reconstruction unit 3003 is used to reconstruct the unit to be decoded based on at least the target prediction mode to obtain a reconstructed block.

[0359] In one example, the code stream parsing unit 3001 can Figure 6 The decoding and parsing unit 301 in the embodiment of the present invention is implemented. The determining unit 3002 can be realized by Figure 6 The prediction processing unit 304 in the reconstruction unit 3003 can be realized by Figure 6 The prediction processing unit 304 is implemented in conjunction with the reconstruction unit 305. Figure 6 The current image block in may be the unit to be decoded in this embodiment.

[0360] For a more detailed description of the above-mentioned code stream parsing unit 3001, determination unit 3002 and reconstruction unit 3003, as well as a more detailed description of each technical feature therein, and a description of the beneficial effects, etc., please refer to the above-mentioned corresponding method embodiment part, which will not be repeated here.

[0361] Figure 24 This is a schematic diagram of the structure of an encoding device 3100 provided in this application. The encoding device 3100 includes a prediction unit 3101 and an encoding unit 3102. The prediction unit 3101 is used to determine a target prediction mode for a unit to be encoded and, based on the target prediction mode, determine an index of the target prediction mode from an index table; the index table contains a correspondence between the indices of multiple prediction modes and the multiple prediction modes. The encoding unit 3102 is used to encode the index of the target prediction mode into a bitstream.

[0362] In one example, the prediction unit 3101 can Figure 3 The prediction processing unit 201 in the encoding unit 3102 can be realized by Figure 3 The coefficient encoding unit 205 in is implemented. Figure 3 The current image block in can be the coding unit of this embodiment.

[0363] For a more detailed description of the prediction unit 3101 and the encoding unit 3102, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the corresponding method embodiment section above and will not be repeated here.

[0364] Figure 25 This is a structural diagram of an encoding device / decoding device 3200 provided in this application. The encoding device / decoding device 3200 includes: a determination unit 3201, a prediction unit 3202 and a reconstruction unit 3203.

[0365] Determination unit 3201 is configured to determine a residual coding mode for the current image block. If the residual coding mode is skip residual coding mode, prediction unit 3202 is configured to predict the current image block to obtain a prediction block, and reconstruction unit 3203 is configured to determine the prediction block as a reconstructed block for the current image block. If the residual coding mode is normal residual coding mode, determination unit 3201 is further configured to obtain a residual quantization correlation value for the current image block to obtain a residual block, and reconstruction unit 3203 is configured to reconstruct the current image block based on the residual block to obtain a reconstructed block for the current image block.

[0366] In one example, the determining unit 3201 may Figure 6The code stream parsing unit 301 in the prediction unit 3202 can be realized by Figure 6 The prediction processing unit 304 is implemented, and the reconstruction unit 3203 can be Figure 6 The reconstruction unit 305 in is implemented.

[0367] In another example, the determining unit 3201 may Figure 3 The residual coding unit 203 in the prediction unit 3202 can be realized by Figure 3 The prediction processing unit 201 in the embodiment can be realized by the reconstruction unit 3203 Figure 3 The reconstruction unit 208 in is implemented.

[0368] For a more detailed description of the above-mentioned determination unit 3201, prediction unit 3202 and reconstruction unit 3203, as well as a more detailed description of each technical feature and a description of the beneficial effects, please refer to the above-mentioned corresponding method embodiment part, which will not be repeated here.

[0369] Figure 26 This is a structural diagram of a coding device / decoding device 3300 provided in the present application, and the coding device / decoding device 3300 includes: a determination unit 3301, a prediction unit 3302, a reconstruction unit 3303 and an acquisition unit 3304. The determination unit 3301 is used to determine the target prediction mode of the current image block. If the target prediction mode is a prediction mode based on skip residual coding, the prediction unit 3302 is used to predict the previous image block to obtain a prediction block, and the reconstruction unit 3303 is used to determine the prediction block as a reconstructed block. If the target prediction mode is a prediction mode based on normal residual coding, the acquisition unit 3304 is used to obtain the residual quantization correlation value of the previous image block to obtain the residual block of the previous image block, and the reconstruction unit 3303 is used to reconstruct the previous image block based on the target prediction mode and the residual block to obtain a reconstructed block.

[0370] In one example, the determining unit 3301 may Figure 6 The code stream parsing unit 301 in the prediction unit 3302 can be realized by Figure 6 The prediction processing unit 304 is implemented, and the reconstruction unit 3303 can be Figure 6 The reconstruction unit 305 in the embodiment can be realized by obtaining the unit 3304. Figure 6 The code stream parsing unit 301 and the residual decoding unit 303 are implemented.

[0371] In another example, the determining unit 3301 and the predicting unit 3302 may be Figure 3 The prediction processing unit 201 in the embodiment can be realized by the reconstruction unit 3303 Figure 3 The reconstruction unit 208 in the embodiment can be realized by the acquisition unit 3304 Figure 3 The residual decoding unit 303 in is implemented.

[0372] For a more detailed description of the above-mentioned determination unit 3301, prediction unit 3302, reconstruction unit 3303 and acquisition unit 3304, as well as a more detailed description of each technical feature and a description of the beneficial effects, please refer to the above-mentioned corresponding method embodiment part and will not be repeated here.

[0373] Figure 27 This is a structural diagram of a coding device / decoding device 3400 provided in the present application, and the coding device / decoding device 3400 includes: a determination unit 3401 and a reconstruction unit 3402. The determination unit 3401 is used to determine the prediction mode of at least one prediction group into which the current image block is divided; wherein, any one prediction group in the at least one prediction group includes a plurality of continuous pixels in the same row / column; any one prediction group includes a first designated pixel area and a second designated pixel area, the first designated pixel area includes a plurality of pixel groups, the plurality of pixel groups are obtained according to the division of the second designated pixel area, the prediction mode of the first designated pixel area is different from that of the second designated pixel area, the plurality of pixel groups can be predicted in parallel, and the pixel group includes one or a plurality of continuous pixels. The reconstruction unit 3402 is used to reconstruct the current image block based on the prediction mode of at least one prediction group to obtain a reconstructed block.

[0374] In one example, the determining unit 3401 may Figure 6 The code stream parsing unit 301 in the embodiment can be realized by the reconstruction unit 3402 Figure 6 The prediction processing unit 304 and the reconstruction unit 305 are implemented together.

[0375] In another example, the determining unit 3401 may Figure 3 The prediction processing unit 201 in the embodiment can be realized by the reconstruction unit 3402 Figure 3 The reconstruction unit 208 in is implemented together.

[0376] For a more detailed description of the above-mentioned determination unit 3401 and reconstruction unit 3402, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the above-mentioned corresponding method embodiment part and will not be repeated here.

[0377] Figure 28This is a structural diagram of a coding device / decoding device 3500 provided in the present application, and the coding device / decoding device 3500 includes: a determination unit 3501 and a reconstruction unit 3502. The determination unit 3501 is used to determine a target prediction mode of a current image block; wherein the current image block includes at least one prediction group; and any one of the at least one prediction group contains a plurality of consecutive pixels. The reconstruction unit 3502 is used to determine a reconstruction value of the target pixel based on a reference value of the first pixel in the plurality of consecutive pixels and a residual value of every two adjacent pixels between the first pixel and the target pixel when the target prediction mode meets a preset condition; wherein the target pixel is any non-first pixel in the plurality of consecutive pixels, and the reconstructed block of the current image block includes the reconstruction value of the target pixel.

[0378] In one example, the determining unit 3501 may Figure 6 The code stream parsing unit 301 in the embodiment can be realized by the reconstruction unit 3502 Figure 6 The prediction processing unit 304 and the reconstruction unit 305 are implemented together.

[0379] In another example, the determining unit 3501 may Figure 3 The prediction processing unit 201 in the embodiment can be realized by the reconstruction unit 3502 Figure 3 The reconstruction unit 208 in is implemented together.

[0380] For a more detailed description of the above-mentioned determination unit 3501 and reconstruction unit 3502, as well as a more detailed description of each technical feature therein and a description of the beneficial effects, etc., please refer to the above-mentioned corresponding method embodiment part and will not be repeated here.

[0381] This application also provides an electronic device for executing any of the above decoding method embodiments. Figure 29 As shown, Figure 29 This is a schematic diagram of the structure of an electronic device provided in this application. 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. It is understood that the communication interface 3620 can be a transceiver or an input / output interface. In one example, the electronic device 3600 may further include a memory 3630 for storing instructions executed by the processor 3610, or storing input data required by the processor 3610 to execute instructions, or storing data generated after the processor 3610 executes instructions.

[0382] 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 application. Figure 29The communication interface 3620, the processor 3610 and the memory 3630 are connected via a bus. Figure 29 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, Figure 29 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0383] The memory 3630 can be used to store software programs and modules, such as program instructions / modules corresponding to the decoding method or encoding method provided in the embodiments of the present application. The processor 3610 executes the software programs and modules stored in the memory 3630 to perform various functional applications and data processing to implement any of the decoding methods or encoding methods provided above. The communication interface 3620 can be used to communicate signaling or data with other devices. In this application, the electronic device 3600 can have multiple communication interfaces 3620.

[0384] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), a neural processing unit (NPU), or a graphic processing unit (GPU), and may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), 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.

[0385] The method steps in the embodiments of the present application can be implemented via hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, 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, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an ASIC. Alternatively, the ASIC can be located in a network device or a terminal device. Of course, the processor and storage medium can also exist as discrete components in the network device or the terminal device.

[0386] An embodiment of the present application further provides a coding and decoding system, including an encoding end and a decoding end. The encoding end can be used to execute any one of the encoding methods provided above, and the decoding end is used to execute the corresponding decoding method.

[0387] The above embodiments can be implemented in whole or in part using software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part 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, the processes or functions described in the embodiments of this application are performed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium can 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).

[0388] In the various embodiments of the present application, unless otherwise specified and without logical conflicts, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships. In the present application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In the textual description of the present application, the character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula of the present application, the character " / " indicates that the previous and next associated objects are in a "division" relationship.

[0389] It is understood that the various numbers used in the embodiments of this application are merely for ease of description and are not intended to limit the scope of the embodiments of this application. The order of the sequence numbers of the above-mentioned processes does not necessarily imply a specific order of execution; the order of execution of the processes should be determined by their functions and inherent logic.

Claims

1. An image decoding method, characterized in that: include: Parsing a bitstream to obtain a first syntax element, where the first syntax element includes an index of a target prediction mode of a unit to be decoded; Based on the index of the target prediction mode, determining the target prediction mode from an index table; wherein the index table contains a correspondence between the indexes of multiple prediction modes and the multiple prediction modes; Reconstructing the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block; The multiple prediction modes include an original value mode and other prediction modes, and the other prediction modes include at least one of the following: a point-by-point prediction mode, an intra-frame prediction mode, or a block copy mode; or, The multiple prediction modes include an original value mode and other prediction modes, and the other prediction modes include at least one of the following: Point-by-point prediction mode, intra-frame prediction mode, and block copy mode based on normal residual coding.

2. The method according to claim 1, characterized in that The indexes of the multiple prediction modes are generated in a binary tree manner.

3. The method according to claim 1, characterized in that 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 prediction modes in the other prediction modes.

4. The method according to claim 1, wherein The multiple prediction modes include original value mode, point prediction mode, intra prediction mode and intra block copy mode; When the indexes of the multiple prediction modes are generated in a binary tree manner, the index generation rules of the multiple prediction modes include: 1 is used as the highest flag bit of the index of the original value mode and the intra prediction mode; 1, 011, 010, 0011, 0010, 00001, and 00000 are used as the remaining flag bits of different intra prediction modes; and 0001 is used as the remaining flag bits of the original value mode.

5. The method according to claim 1, wherein The multiple prediction modes include original value mode, point-by-point prediction mode based on normal residual coding, intra-frame prediction mode, and block copy mode; The reconstructing the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block includes: If the target prediction mode is a point-by-point prediction mode, an intra-frame prediction mode or a block copy mode based on normal residual coding, the residual quantization related value of the unit to be decoded is parsed to obtain the residual block of the unit to be decoded, and the unit to be decoded is reconstructed based on the target prediction mode and the residual block to obtain the reconstructed block.

6. The method according to claim 5, characterized in that Each row of pixels in the unit to be decoded is used as a prediction group, and the residual block of the prediction group is divided into at least one small residual block.

7. The method according to claim 6, characterized in that The residual block of the prediction group is divided into multiple residual blocks including: Divide the residual block of a prediction group into two small residual blocks in a 1:1 ratio; or Divide the residual block of a prediction group into three small residual blocks in a ratio of 2:1:1; or Divide the residual block of a prediction group into three small residual blocks in a ratio of 1:1:2; or The residual block of a prediction group is divided into four small residual blocks in a ratio of 1:1:1:

1.

8. The method according to claim 1, characterized in that The unit to be decoded includes at least one prediction group; Any one of the at least one prediction group includes a plurality of consecutive pixels in the same row / column; Any one of the prediction groups includes a first designated pixel area and a second designated pixel area, the first designated pixel area includes multiple pixel groups, the multiple pixel groups are obtained by dividing the second designated pixel area, the prediction method of the first designated pixel area is different from that of the second designated pixel area, the multiple pixel groups can be predicted in parallel, and the pixel group includes one or multiple consecutive pixels.

9. The method according to claim 8, characterized in that If any one of the prediction groups includes multiple consecutive elements in the same row, then: The first designated pixel region adopts vertical prediction, and the second designated pixel region adopts horizontal prediction; Alternatively, the first designated pixel region adopts vertical prediction, and the second designated pixel region adopts vertical mean prediction; And / or, if any one of the prediction groups includes a plurality of consecutive elements in the same column, then: The first designated pixel region adopts horizontal prediction, and the second designated pixel region adopts vertical prediction; Alternatively, the first designated pixel region is predicted using horizontal prediction, and the second designated pixel region is predicted using horizontal average value prediction.

10. The method according to claim 8 or 9, characterized in that The difference between the numbers of pixels included in different pixel groups is equal to or smaller than a threshold.

11. The method according to claim 8 or 9, characterized in that If there is no reference block for the unit to be decoded, the reconstructed value of the first pixel of the unit to be decoded is a value obtained by shifting the bit width of the unit to be decoded left by 1 bit.

12. The method according to any one of claims 1 to 9, characterized in that The unit to be decoded includes at least one prediction group; any one of the at least one prediction group includes a plurality of continuous pixels; Reconstructing the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block, including: When the target prediction mode meets a preset condition, the reconstructed value of the target pixel is determined based on the reference value of the first pixel among the multiple consecutive pixels and the residual value of every two adjacent pixels between the first pixel and the target pixel; wherein the target pixel is any non-first pixel among the multiple consecutive pixels, and the reconstructed block contains the reconstructed value of the target pixel.

13. An image decoding device, characterized in that: include: a bitstream parsing unit, configured to parse the bitstream to obtain a first syntax element, wherein the first syntax element includes an index of a target prediction mode of a unit to be decoded; a determining unit, configured to determine the target prediction mode from an index table based on the index of the target prediction mode; wherein the index table includes a correspondence between the indexes of multiple prediction modes and the multiple prediction modes; a reconstruction unit, configured to reconstruct the unit to be decoded based at least on the target prediction mode to obtain a reconstructed block; The multiple prediction modes include an original value mode and other prediction modes, and the other prediction modes include at least one of the following: a point-by-point prediction mode, an intra-frame prediction mode, or a block copy mode; or, The multiple prediction modes include an original value mode and other prediction modes, and the other prediction modes include at least one of the following: Point-by-point prediction mode, intra-frame prediction mode, and block copy mode based on normal residual coding.

14. An electronic device, characterized in that: The system comprises a processor and a memory, wherein the memory is used to store computer instructions, and the processor is used to call and execute the computer instructions from the memory to implement the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that The storage medium stores a computer program or instruction, and when the computer program or instruction is executed by an electronic device, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Image processor and image processing method

    CN103004199A

  • Method of video coding using prediction based on intra picture block copy

    CN110365976A