A residual skip coding and decoding method and device
By adopting the residual skip encoding and decoding method in video encoding and decoding, the residual skip flag in the video decoding device is processed, which solves the problem of excessive resource occupation by the residual block in video encoding and decoding, and improves the code stream transmission efficiency and Decoding performance.
Patent Information
- Application Number
- CN202210212879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-03-04
AI Technical Summary
In the video encoding and decoding process, when a larger coding unit is divided into two sub-coding units for processing, the resulting residual block will be larger, occupying code stream resources and affecting encoding and decoding performance.
The residual skip coding and decoding method is adopted to flexibly process the residual coefficients by obtaining the residual skip identifier, calculate the residual value and reconstruct it, saving code stream resources and improving decoding performance.
It effectively saves resources in the code stream, improves transmission efficiency and decoding performance, and reduces the bit overhead of the residual coefficient.
Smart Images

Figure CN116156167B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of video coding and decoding technology, and in particular to a residual skip coding and decoding method and device. Background Art
[0002] During the encoding and decoding process of the current image block, a larger coding unit will be divided into two appropriate sub-coding units for processing. For example, a 16×2 coding unit will be predicted to obtain a 16×2 residual block, which will be divided into two 8×2 sub-blocks on the left and right for encoding. Among them, the residual coefficients of the two sub-blocks are large, occupying more resources in the bitstream, affecting the encoding and decoding performance. Summary of the invention
[0003] The embodiments of the present application provide a residual skip encoding and decoding method and device, which are helpful to save resources in a bit stream and improve the transmission efficiency of the bit stream.
[0004] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, an embodiment of the present application provides a residual skip decoding method, which is applied to a video decoding device or a chip of a video decoding device, and the method includes: obtaining a residual skip flag in a bitstream, the residual skip flag is used to indicate a target residual skip mode of an image block, and the target residual skip mode is used to characterize whether some or all residual coefficients of the image block are subjected to residual skipping; based on the residual skip flag, obtaining the residual coefficient of the image block; calculating the residual value of the image block according to the residual coefficient of the image block; and reconstructing the image block according to the residual value of the image block and the predicted value of the image block to obtain a reconstructed block.
[0006] Since the residual coefficients occupy more resources in the bitstream, it affects the transmission efficiency. Therefore, the residual skip decoding method proposed in this application is adopted, the decoding end obtains the residual skip flag, obtains the residual coefficients in the bitstream through the residual skip flag, and calculates the residual value, and reconstructs according to the residual value and the predicted value, which helps the residual coefficients in the bitstream to flexibly occupy resources, save transmission bit overhead, and improve decoding performance.
[0007] In one possible implementation, the target residual skip mode includes any one of the following modes: a first residual skip mode; wherein the first residual skip mode is used to characterize that all residual coefficients are subjected to residual skipping; a second residual skip mode; wherein the second residual skip mode is used to characterize that all residual coefficients are not subjected to residual skipping.
[0008] This possible implementation method helps to flexibly encode the residual by determining whether the residual of the image block indicated by the residual skip flag is skipped. The residual skip flag facilitates the decoding end device to parse and identify the code stream to perform corresponding decoding actions, thereby improving the performance of video decoding.
[0009] In one possible implementation, the image block includes at least a first sub-block and a second sub-block, the residual coefficient of the image block includes at least a first sub-block residual coefficient and a second sub-block residual coefficient, and the target residual skip mode includes any one of the following modes: a first residual skip mode; wherein the first residual skip mode is used to characterize that residual skipping is performed on the residual coefficient of the first sub-block and the residual coefficient of the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to characterize that residual skipping is not performed on the residual coefficient of the first sub-block and the residual coefficient of the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to characterize that residual skipping is performed on the residual coefficient of the first sub-block, and residual skipping is not performed on the residual coefficient of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to characterize that residual skipping is not performed on the residual coefficient of the first sub-block, and residual skipping is performed on the residual coefficient of the second sub-block.
[0010] This possible implementation method helps to flexibly encode the residual by partially or completely skipping the residual of the image block indicated by the residual skip flag. The residual skip flag facilitates the decoding end device to parse and identify the code stream to perform corresponding decoding actions, thereby improving the performance of video decoding.
[0011] In a possible implementation, when the target residual skip mode is the first residual skip mode, obtaining the residual coefficient of the image block based on the residual skip flag includes: setting the residual coefficient of the image block to zero according to the residual skip flag.
[0012] This possible implementation provides a specific implementation method for determining the residual coefficient of an image block in a residual skip mode. In this residual skip mode, resources in the bitstream do not need to be occupied by the residual coefficient, effectively reducing the bit overhead of the residual coefficient.
[0013] In a possible implementation, when the target residual skip mode is the second residual skip mode, the residual coefficient of the image block is obtained based on the residual skip flag, including: parsing the bitstream according to the residual skip flag to obtain the residual coefficient of the image block.
[0014] This possible implementation method provides a specific implementation method for parsing the bitstream and obtaining the residual coefficient according to the residual skip mode indicated by the residual skip flag. In this way, a flexible decoding implementation method is provided for the video decoder through the residual skip flag.
[0015] In a possible implementation, when the target residual skip mode is the third residual skip mode, obtaining the residual coefficient of the image block based on the residual skip flag at least includes: setting the residual coefficient of the first sub-block to zero according to the residual skip flag.
[0016] This possible implementation provides a specific implementation method for determining residual coefficients of an image block in a residual skip mode. In the residual skip mode, resources in a bitstream are occupied by part of the residual coefficients, effectively reducing the bit overhead of the residual coefficients.
[0017] In a possible implementation, when the target residual skip mode is the third residual skip mode, the residual coefficient of the second sub-block includes a DC coefficient and an AC coefficient, and the residual value of the image block is calculated according to the residual coefficient of the image block, including: taking the DC coefficient of the second sub-block residual coefficient as a coefficient group, performing semi-fixed length decoding to obtain a first residual value; taking the AC coefficient of the second sub-block residual coefficient as one or more coefficient groups, performing semi-fixed length decoding to obtain a second residual value; and determining the residual value of the image block based on the first residual value and the second residual value.
[0018] This possible implementation method provides a specific implementation method for a video decoder to parse the DC coefficient and AC coefficient of the residual coefficient, thereby increasing the feasibility of the solution.
[0019] In a possible implementation, when the target residual skip mode is the fourth residual skip mode, obtaining the residual coefficient of the image block based on the residual skip flag at least includes: setting the residual coefficient of the second sub-block to zero according to the residual skip flag.
[0020] This possible implementation provides a specific implementation method for determining residual coefficients of an image block in a residual skip mode. In the residual skip mode, resources in a bitstream are occupied by part of the residual coefficients, effectively reducing the bit overhead of the residual coefficients.
[0021] In a possible implementation, when the target residual skip mode is the fourth residual skip mode, the residual coefficient of the first sub-block includes a DC coefficient and an AC coefficient, and the residual value of the image block is calculated according to the residual coefficient of the image block, including: taking the DC coefficient of the first sub-block residual coefficient as a coefficient group, performing semi-fixed length decoding to obtain a third residual value; taking the AC coefficient of the first sub-block residual coefficient as one or more coefficient groups, performing semi-fixed length decoding to obtain a fourth residual value; and determining the residual value of the image block based on the third residual value and the fourth residual value.
[0022] This possible implementation method provides a specific implementation method for a video decoder to parse the DC coefficient and AC coefficient of the residual coefficient, thereby increasing the feasibility of the solution.
[0023] In a possible implementation, residual coefficients in a bitstream are obtained as M coefficient groups through semi-fixed length encoding; a residual value of an image block is calculated based on the residual coefficients of the image block, including: when a residual skip mode represented by a residual skip flag is a third residual skip mode or a fourth residual skip mode, a value of M is derived based on the residual skip flag; wherein M is an integer greater than zero; and the M coefficient groups are semi-fixed length decoded to obtain a residual value of the image block.
[0024] This possible implementation method provides a specific implementation method for the correspondence between the residual skip flag and the coefficient group. The video decoder determines the coefficient group according to the residual skip flag and decodes it, avoiding obtaining the grouping index in the bitstream, which helps to improve the decoding performance.
[0025] In a possible implementation, the bitstream also includes a transform skip flag, which is used to indicate whether the residual coefficients of the image block are transformed. The residual value of the image block is calculated based on the residual coefficients of the image block, including: when the transform skip flag indicates that the residual coefficients of the image block are transformed, the residual coefficients of the image block are dequantized and inversely transformed to obtain the residual value of the image block; when the transform skip flag indicates that the residual coefficients of the image block are not transformed, the residual coefficients of the image block are dequantized to obtain the residual value of the image block.
[0026] This possible implementation method uses a transform skip flag in a bitstream to indicate a specific implementation method for a video decoder to obtain a residual value according to a residual coefficient, thereby improving the feasibility of the solution.
[0027] In a possible implementation, before obtaining the residual skip flag in the bitstream, the method also includes: obtaining a prediction mode flag in the bitstream, the prediction mode flag is used to indicate the prediction mode of the image block, and the prediction mode is used to obtain a prediction value of the image block; determining that the prediction mode of the image block satisfies a first condition, the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or the first condition is that the prediction mode of the image block is a block copy prediction mode, or the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0028] This possible implementation method provides a prerequisite for implementing the solution, establishes a corresponding relationship between the prediction mode and the residual skip mode, and determines whether to perform residual skipping when the prediction mode meets the conditions. This helps to improve the feasibility of the solution.
[0029] In a possible implementation manner, the residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
[0030] This possible implementation method determines the type of residual skip flag by the sampling format of the image block, thereby improving the feasibility of the solution.
[0031] In a second aspect, an embodiment of the present application provides a residual skip encoding method, which is applied to a video encoding device or a chip of a video encoding device, and the method includes: obtaining a residual value of an image block; determining a residual skip flag based on the residual value of the image block, the residual skip flag being used to indicate a target residual skip mode, the target residual skip mode being used to characterize whether part or all of the residual value of the image block has undergone residual skipping; encoding the residual skip flag into a bitstream.
[0032] The residual skip coding method provided in the embodiment of the present application selectively encodes the residual into the bitstream. Compared with the existing residual coding method, it helps to flexibly adjust the bits occupied by the residual coefficients in the bitstream, reduce the overhead of residual coding, and improve the coding performance. In addition, encoding the residual skip flag into the bitstream helps the video decoder to perform the corresponding decoding action, saves the transmission bit overhead, and improves the decoding performance.
[0033] In one possible implementation, the target residual skip mode includes any one of the following modes: a first residual skip mode; wherein the first residual skip mode is used to represent that residual values of an image block are skipped; a second residual skip mode; wherein the second residual skip mode is used to represent that residual values of an image block are not skipped.
[0034] This possible implementation provides a plurality of specific forms of residual skip modes, which helps to select based on a plurality of residual skip modes and incorporate a residual skip mode with better performance.
[0035] In one possible implementation, an image block includes at least a first sub-block and a second sub-block, a residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value, and a residual skip flag indicates that a target residual skip mode includes any one of the following modes: a first residual skip mode; wherein the first residual skip mode is used to characterize that residual skipping is performed on the residual value of the first sub-block and the residual value of the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to characterize that residual skipping is not performed on the residual value of the first sub-block and the residual value of the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to characterize that residual skipping is performed on the residual value of the first sub-block, and residual skipping is not performed on the residual value of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to characterize that residual skipping is not performed on the residual value of the first sub-block, and residual skipping is performed on the residual value of the second sub-block.
[0036] This possible implementation provides a plurality of specific forms of residual skip modes, which helps to select based on a plurality of residual skip modes and incorporate a residual skip mode with better performance.
[0037] In a possible implementation, a residual skip flag is determined based on a residual value of an image block, including: based on the residual value of the image block, calculating the rate-distortion cost when using multiple residual skip modes for residual skip encoding, wherein the multiple residual skip modes include at least a first residual skip mode and a second residual skip mode; taking a residual skip mode among the multiple residual skip modes whose rate-distortion cost satisfies a condition as a target residual skip mode; and determining a residual skip flag based on the target residual skip mode.
[0038] This possible implementation method provides a specific implementation method for determining a target residual skip mode, which helps to determine a residual skip mode with better encoding effect.
[0039] In a possible implementation, the method also includes: determining the residual coefficient of the image block according to the target sub-block residual value and the target residual skip mode; encoding the residual coefficient of the image block into the bitstream; wherein, when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block.
[0040] This possible implementation method provides a specific implementation method for encoding part of the residual into the bitstream, which helps to reduce the resources occupied by the residual coefficients in the bitstream.
[0041] In a possible implementation, the residual coefficient of the image block is determined according to the residual value of the target sub-block, including: obtaining the DC coefficient and AC coefficient of the residual value of the target sub-block; encoding the residual coefficient of the image block into a bitstream, including: performing semi-fixed length encoding on the DC coefficient of the residual value of the target sub-block as a coefficient group; and performing semi-fixed length encoding on the AC coefficient of the residual value of the target sub-block as one or more coefficient groups.
[0042] This possible implementation method provides a specific implementation method of using semi-fixed-length coding on the DC coefficient and AC coefficient of a partial residual.
[0043] In one possible implementation, the residual value of the target sub-block is divided into M coefficient groups, where M is the maximum number of coefficient groups in the target sub-block; when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block; and semi-fixed-length encoding is performed on the M coefficient groups.
[0044] This possible implementation method provides a specific implementation method of using semi-fixed-length coding for part of the residual.
[0045] In a possible implementation, the method further includes: determining the residual coefficient of the image block according to the residual value of the image block and the target residual skip mode; transforming the residual coefficient of the image block to obtain the transformed residual coefficient; encoding the transformed residual coefficient and the transform skip flag into the bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has been transformed; or, determining the residual coefficient of the image block according to the target sub-block residual value and the target residual skip mode; encoding the residual coefficient of the image block and the transform skip flag into the bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has not been transformed.
[0046] This possible implementation method provides an implementation method for whether to transform the residual coefficients, and generates a transformation skip flag accordingly, which is used for the decoding end to obtain and identify, determine the processing of the residual coefficients, and improve the feasibility of the solution.
[0047] In a possible implementation, before determining the residual skip flag based on the residual of the image block, the method also includes: determining that the prediction mode of the image block satisfies a first condition, wherein the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or the first condition is that the prediction mode of the image block is a block copy prediction mode, or the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0048] This possible implementation method provides a specific implementation method in which the prediction mode of the image block and the residual skip mode have a corresponding relationship, thereby increasing the feasibility of the solution.
[0049] In a possible implementation manner, the residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
[0050] This possible implementation provides a type of residual skipping mark corresponding to the sampling format of the image block.
[0051] In a third aspect, an embodiment of the present application provides a video decoding device, which has the function of implementing any residual skip decoding method in the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0052] In a fourth aspect, an embodiment of the present application provides a video encoding device, which has the function of implementing the residual skip encoding method of any one of the second aspects above. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions.
[0053] In a fifth aspect, a video decoding device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the video decoding device is running, the processor executes the computer execution instructions stored in the memory to enable the video decoding device to perform a residual skip decoding method as described in any one of the first aspects above.
[0054] In a sixth aspect, a video encoding device is provided, comprising: a processor and a memory; the memory is used to store computer execution instructions, and when the video encoding device is running, the processor executes the computer execution instructions stored in the memory to enable the video encoding device to perform a residual skip encoding method as described in any one of the second aspects above.
[0055] In a seventh aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer can execute the residual skip coding and decoding method of any one of the first to second aspects above.
[0056] In an eighth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the residual skip coding and decoding method of any one of the first to second aspects.
[0057] In a ninth aspect, an electronic device is provided, the electronic device comprising a video decoding device, wherein a processing circuit is configured to execute a residual skip decoding method as described in any one of the first aspects above.
[0058] In a tenth aspect, an electronic device is provided, the electronic device comprising a video encoding device, wherein a processing circuit is configured to execute a residual skip encoding method as described in any one of the second aspects above.
[0059] In the eleventh aspect, an electronic device is provided, the electronic device comprising a video decoding device and a video encoding device, and the processing circuit is configured to execute the residual skip decoding method as described in any one of the first aspect and the residual skip encoding method as described in any one of the second aspect.
[0060] In a twelfth aspect, a chip is provided, the chip includes a processor, the processor is coupled to a memory, the memory stores program instructions, and when the program instructions stored in the memory are executed by the processor, the residual skip encoding and decoding method of any one of the first to second aspects above is implemented.
[0061] In a thirteenth aspect, a coding and decoding system is provided, the coding and decoding system comprising the video decoding device in the third aspect and the video encoding device in the fourth aspect.
[0062] The technical effects brought about by any implementation method in the third aspect to the thirteenth aspect can be referred to the technical effects brought about by the corresponding implementation methods in the first aspect and the second aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1a is a schematic diagram of the DC prediction mode;
[0064] Figure 1b is a schematic diagram of an angle prediction mode;
[0065] Figure 1c is a schematic diagram of an angle prediction mode;
[0066] Figure 1d is a schematic diagram of an angle prediction mode;
[0067] Figure 1e is a schematic diagram of an angle prediction mode;
[0068] Figure 1f is a schematic diagram of an angle prediction mode;
[0069] Figure 1g is a schematic diagram of an angle prediction mode;
[0070] Figure 2a is a schematic diagram of a block copy prediction mode;
[0071] Figure 2b is a schematic diagram of a block copy prediction mode;
[0072] Figure 2c A schematic diagram of a block copy prediction mode;
[0073] Figure 3 A system architecture diagram of a coding and decoding system provided in an embodiment of the present application;
[0074] Figure 4 A schematic diagram of the structure of a video encoder provided in an embodiment of the present application;
[0075] Figure 5 A schematic diagram of the structure of a video decoder provided in an embodiment of the present application;
[0076] Figure 6 A schematic diagram of a video encoding / decoding process provided in an embodiment of the present application;
[0077] Figure 7 A schematic diagram of the structure of a video decoder or video encoder provided in an embodiment of the present application;
[0078] Figure 8 A flowchart of a video encoding method provided in an embodiment of the present application;
[0079] Fig. 9 A schematic diagram of residual partition coding provided in an embodiment of the present application;
[0080] Fig.10 A schematic diagram of residual skip coding provided in an embodiment of the present application;
[0081] Fig.11 A schematic diagram of residual skip coding provided in an embodiment of the present application;
[0082] Fig.12 A schematic diagram of residual skip coding provided in an embodiment of the present application;
[0083] Fig.13 A flowchart of a video decoding method provided in an embodiment of the present application;
[0084] Fig.14 A schematic diagram of the structure of an encoding device provided in an embodiment of the present application;
[0085] Fig.15 A schematic diagram of the structure of a decoding device provided in an embodiment of the present application;
[0086] Fig.16a A schematic diagram of a transform coefficient grouping and scanning method;
[0087] Fig.16b A schematic diagram of a transform coefficient grouping and scanning method;
[0088] Fig.17a A schematic diagram of a residual coefficient grouping and scanning method;
[0089] Fig.17b Schematic diagram of a residual coefficient grouping and scanning method. DETAILED DESCRIPTION
[0090] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of 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. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.
[0091] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0092] First, the technical terms involved in the embodiments of the present application are introduced:
[0093] 1. Video Coding Technology
[0094] Video sequences contain a series of redundant information, including spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove redundant information in video sequences as much as possible and reduce the amount of data representing the video, video coding technology is proposed to achieve the effect of reducing storage space and saving transmission bandwidth. Video coding technology is also called video compression technology.
[0095] In the international scope, video compression coding standards, for example: Advanced Video Coding (AVC) in Part 10 of the MPEG-2 and MPEG-4 standards developed by the Motion Picture Experts Group (MPEG), H.263, H.264 and H.265 (also known as High Efficiency Video Coding standard, HEVC) developed by the International Telecommunication Union Telecommunication Standardization Sector (ITU-T).
[0096] It should be noted that in a coding algorithm based on a hybrid coding architecture, the above compression coding methods can be used in a mixed manner.
[0097] A video sequence includes a series of pictures, which are further divided into slices, and slices are further divided into blocks. Video coding is performed in blocks. Taking HEVC as an example, HEVC defines Coding Tree Unit (CTU), Coding Unit (CU), Prediction Unit (PU) and Transform Unit (TU). CTU, CU, PU and TU can all be regarded as image blocks obtained after division. Among them, PU and TU are divided based on CU. However, whether CU, PU or TU, they are essentially the concept of blocks (or image blocks).
[0098] 2. Prediction
[0099] Based on the redundant characteristics of temporal redundancy and spatial redundancy in the video sequence, the image block is predicted. For example, in the same frame image, since there is a correlation between adjacent image blocks, the value of the current image block can be inferred (predicted) based on the adjacent image blocks. For another example, in different frame images, for an image block at a certain coordinate position, the value of the image block at the previous moment is correlated with the value of the image block at the next moment, so the value of the image block at the next moment can be predicted based on the value of the image block at the previous moment. Among them, the image block to be predicted is the prediction unit PU. The method used for prediction is called the prediction mode (PredMode). The prediction mode based on the correlation between adjacent image blocks in the same frame image is the intra-frame prediction mode. Among them, the intra-frame prediction mode includes the mean (DC) prediction mode and the angle prediction mode. The following describes different intra-frame prediction modes using 16×2 prediction units.
[0100] The DC prediction mode calculates the average value of reference pixels as the prediction pixel.
[0101] Specifically, PredMode[component]=INTRA_MODE_DC, indicating that the mode for predicting the current sample component component is the DC prediction mode;
[0102] Where PredMatrix[component] represents the predicted value of the current sample component, x and y are used to represent the position coordinates of the current block in the 16×2 prediction unit, x represents the row, y represents the column, 0≤x≤15, 0≤y≤1, and r represents the reconstructed pixel of the reference block above the current block. Figure 1a As shown, the mean D of the reference pixels is calculated as the 16×2 predicted pixels.
[0103] The angle prediction mode can also be called the directional prediction mode, which predicts pixels in different directions based on reference pixels. Among them, the angle prediction mode includes the horizontal prediction mode, the vertical prediction mode, the diagonal prediction mode, and so on.
[0104] Specifically, when PredMode[component] = INTRA_MODE_ANG_0, it means that the prediction mode for the current sampled component component is the vertical downward prediction mode;
[0105] PredMatrix[component][x][y] = r[x + 1], 0 ≤ x ≤ 15, 0 ≤ y ≤ 1.
[0106] As Figure 1b shown, the pixels in the column where the reference pixel is located are predicted based on the direction vertically downward from the reference pixel.
[0107] When PredMode[component] = INTRA_MODE_ANG_1, it means that the prediction mode for the current sampled component component is the horizontal rightward prediction mode;
[0108] PredMatrix[component][x][y] = c[y + 1], 0 ≤ x ≤ 15, 0 ≤ y ≤ 1; where c represents the reconstructed pixel of the reference block on the left side of the current block.
[0109] As Figure 1c shown, the pixels in the row where the reference pixel is located are predicted based on the direction horizontally rightward from the reference pixel.
[0110] When PredMode[component] = INTRA_MODE_ANG_2, it means that the prediction mode for the current sampled component component is the lower right diagonal prediction mode;
[0111] Among them, when x ≥ y, PredMatrix[component][x][y] = r[x - y], 0 ≤ x ≤ 15, 0 ≤ y ≤ 1;
[0112] when x < y, PredMatrix[component][x][y] = c[y - x], 0 ≤ x ≤ 15, 0 ≤ y ≤ 1.
[0113] As Figure 1d shown, the pixels at the position where the reference pixel is located are predicted based on the direction of the lower right diagonal of the reference pixel.
[0114] When PredMode[component]=INTRA_MODE_ANG_3, it indicates that the prediction mode for the current sample component component is the lower left diagonal prediction mode;
[0115] PredMatrix[component][x][y]=r[x+y+2], 0≤x≤15, 0≤y≤1.
[0116] like Figure 1e As shown, the pixel at the position of the reference pixel is predicted based on the direction of the lower left corner of the reference pixel.
[0117] When PredMode[component]=RA_MODE_ANG_4, it indicates that the prediction mode for the current sample component component is the lower right interlaced diagonal prediction mode;
[0118] Wherein, when y=0, PredMatrix[component][x][y]=(r[x]+r[x+1]+1)>>1, 0≤x≤15;
[0119] When y≠0, PredMatrix[component][x][y]=r[x], 0≤x≤15.
[0120] like Figure 1f As shown, the pixel at the location of the reference pixel is predicted based on the direction of the alternate row diagonal to the lower right of the reference pixel.
[0121] When PredMode[component] is equal to INTRA_MODE_ANG_5, it means that the prediction mode for the current sample component component is the lower left interlaced diagonal prediction mode;
[0122] Wherein, when y=0, PredMatrix[component][x][y]=(r[x+1]+r[x+2]+1)>>1, 0≤x≤15;
[0123] When y≠0, PredMatrix[component][x][y]=r[x+2], 0≤x≤15.
[0124] like Figure 1g As shown, the pixel at the location of the reference pixel is predicted based on the direction of the alternate diagonal line below and to the left of the reference pixel.
[0125] It can be understood that the above six angle prediction modes are only examples, and in fact, prediction modes in other directions may also be included.
[0126] In addition, the prediction mode also includes a block copy prediction mode. The block copy prediction mode is also called a block copy prediction mode, which means finding the best reconstructed block as a matching block from the decoded area of the current frame, and using the reconstructed pixels of the matching block as the predicted pixels of the current block. The decoded area of the current frame is the search position of the current block. Still taking the 16×2 prediction unit as an example, the following three block copy prediction modes are included.
[0127] like Figure 2a As shown in FIG. 1 , for block copy prediction mode 1, the 16×2 prediction unit is divided into two 8×2 sub-blocks for searching. At this time, the search position of the 8×2 sub-block is at least K+(8-1)=K+7 positions. Similarly, Figure 2b As shown, for block copy prediction mode 2, the 16×2 prediction unit is divided into four 4×2 sub-blocks for separate searches. At this time, the search position of the 4×2 sub-block is at least K+(4-1)=K+3 positions; Figure 2c As shown, it is block copy prediction mode 3, and the 16×2 prediction unit is divided into eight 2×2 sub-blocks for searching. At this time, the search position of the 2×2 sub-block is at least K+(2-1)=K+1 positions. Among them, K is a preset size. It can be understood that the larger K is, the more accurate the block copy prediction is. Considering the consumption of hardware cost, K can be appropriately selected, for example, K is selected as 32.
[0128] The following describes the system architecture used in the embodiments of the present application. The encoding and decoding method provided in the present application is applicable to a video encoding and decoding system. Figure 3 The structure of the video coding system is shown.
[0129] like Figure 3 As shown, the video encoding and decoding system includes a source device 30 and a destination device 31. The source device 30 generates encoded video data, and the source device 30 can also be called a video encoding device or a video encoding device. The destination device 31 can decode the encoded video data generated by the source device 30, and the destination device 31 can also be called a video decoding device or a video decoding device. The source device 30 and / or the destination device 31 may include at least one processor and a memory coupled to the at least one processor. The memory may include but is not limited to a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures that can be accessed by a computer, and the present application does not make specific limitations on this.
[0130] The source device 30 and the destination device 31 may include a variety of devices, including electronic devices such as 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.
[0131] The destination device 31 may receive the encoded video data from the source device 30 via the link 32. The link 32 may include one or more media and / or devices capable of moving the encoded video data from the source device 30 to the destination device 31. In one example, the link 32 may include one or more communication media that enable the source device 30 to transmit the encoded video data directly to the destination device 31 in real time. In this example, the source device 30 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol) and may transmit the modulated video data to the destination device 31. The one or more communication media may include wireless and / or wired communication media, such as a radio frequency (RF) spectrum, one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, a wide area network, or a global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices that enable communication from the source device 30 to the destination device 31.
[0132] In another example, the encoded video data can be output from the output interface 303 to the storage device 33. Similarly, the encoded video data can be accessed from the storage device 33 through the input interface 313. The storage device 33 can include a variety of locally accessible data storage media, such as a Blu-ray disc, a high-density digital video disc (DVD), a compact disc read-only memory (CD-ROM), a flash memory, or other suitable digital storage media for storing encoded video data.
[0133] In another example, storage device 33 may correspond to a file server or another intermediate storage device that stores the encoded video data generated by source device 30. In this example, destination device 31 may obtain the video data stored therein from storage device 33 via streaming or downloading. The file server may be any type of server that is capable of storing encoded video data and transmitting the encoded video data to destination device 31. For example, the file server may include a World Wide Web (Web) server (e.g., for a website), a File Transfer Protocol (FTP) server, a Network Attached Storage (NAS) device, and a local disk drive.
[0134] The destination device 31 can access the encoded video data through any standard data connection (e.g., an Internet connection). Example types of data connections include wireless channels suitable for accessing the encoded video data stored on a file server, wired connections (e.g., cable modems, etc.), or a combination of both. The encoded video data can be transmitted from the file server in a streaming manner, a download transmission, or a combination of both.
[0135] The decoding method of the present application is not limited to wireless application scenarios. For example, the coding and decoding method of the present application can be applied to video coding and decoding supporting the following multimedia applications: over-the-air television broadcasting, cable television transmission, satellite television transmission, streaming video transmission (e.g., via the Internet), encoding of video data stored on a data storage medium, decoding of video data stored on a data storage medium, or other applications. In some examples, the video coding and decoding system can be configured to support one-way or two-way video transmission to support applications such as video streaming, video playback, video broadcasting, and / or video telephony.
[0136] It should be noted that Figure 3 The video coding and decoding system shown is only an example of a video coding and decoding system, and is not a limitation of the video coding and decoding system in the present application. The coding and decoding method provided in the present application can also be applied to a scenario where there is no data communication between the coding device and the decoding device. In other examples, the video data to be encoded or the encoded video data can be retrieved from a local memory, or can be streamed over a network, etc. The video coding device can encode the video data to be encoded and store the encoded video data in a memory, and the video decoding device can also obtain the encoded video data from the memory and decode the encoded video data.
[0137] exist Figure 3, source device 30 includes a video source 301, a video encoder 302, and an output interface 303. In some examples, output interface 303 may include a modulator / demodulator (modem) and / or a transmitter. Video source 301 may include a video capture device (e.g., a camera), a video archive containing previously captured video data, a video input interface for receiving video data from a video content provider, and / or a computer graphics system for generating video data, or a combination of such sources of video data.
[0138] Video encoder 302 may encode video data from video source 301. In some examples, source device 30 transmits the encoded video data directly to destination device 31 via output interface 303. In other examples, the encoded video data may also be stored on storage device 33 for later access by destination device 31 for decoding and / or playback.
[0139] exist Figure 3 In the example of , the destination device 31 includes a display device 311, a video decoder 312, and an input interface 313. In some examples, the input interface 313 includes a receiver and / or a modem. The input interface 313 can receive the encoded video data via the link 32 and / or from the storage device 33. The display device 311 can be integrated with the destination device 31 or can be external to the destination device 31. In general, the display device 311 displays the decoded video data. The display device 311 can include a variety of display devices, for example, a liquid crystal display, a plasma display, an organic light emitting diode display, or other types of display devices.
[0140] Alternatively, the video encoder 302 and video decoder 312 may each be integrated with an audio encoder and decoder, and may include appropriate multiplexer-demultiplexer units or other hardware and software to handle the encoding of both audio and video in a common data stream or in separate data streams.
[0141] The video encoder 302 and the video decoder 312 may include at least one microprocessor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), discrete logic, hardware, or any combination thereof. If the encoding and decoding method provided in the present application is implemented in software, the instructions for the software may be stored in a suitable non-volatile computer-readable storage medium, and at least one processor may be used to execute the instructions to implement the present application.
[0142] The video encoder 302 and the video decoder 312 in the present application may operate according to a video compression standard (eg, HEVC), or may operate according to other industry standards, which is not specifically limited in the present application.
[0143] Figure 4 4 is a schematic block diagram of a video encoder 302 in an embodiment of the present application. The video encoder 302 can perform prediction, transformation, quantization and entropy coding processes in the prediction module 41, the transformation module 42, the quantization module 43 and the entropy coding module 44 respectively. The video encoder 302 also includes a segmentation module 40 and a summer 402. For video block reconstruction, the video encoder 302 also includes an inverse quantization module 45, an inverse transformation module 46, a summer 401 and a reference image memory 47.
[0144] like Figure 4 As shown in , video encoder 302 receives video data and segmentation module 40 segments the data into primitive blocks. This segmentation may also include segmentation into slices, tiles, or other larger units, and (for example) segmentation of video blocks according to a quadtree structure of the largest coding unit (LCU) and CU. Exemplarily, video encoder 302 encodes components of video blocks within a video slice to be encoded. In general, a slice may be divided into multiple primitive blocks (and possibly into a set of primitive blocks called tiles). The sizes of CUs, PUs, and TUs are typically determined in segmentation module 40.
[0145] The prediction module 41 can provide the obtained prediction block predicted by intra-frame mode prediction or block copy prediction mode to the summer 402 to generate a residual block, and provide the prediction block to the summer 401 for reconstruction to obtain a reconstructed block, which is used as a reference pixel for subsequent prediction. Among them, the video encoder 302 forms a pixel difference by subtracting the pixel value of the prediction block from the pixel value of the original block. The pixel difference is the residual block, and the data in the residual block may include brightness difference and chrominance difference. The data in the residual block can be called residual. The summer 401 represents one or more components that perform this subtraction operation. The prediction module 41 can also send related syntax elements to the entropy coding module 44 for merging into the bitstream.
[0146] The transform module 42 can divide the residual block into one or more TUs for transformation. The transform module 42 uses discrete cosine transform (DCT) or discrete sine transform (DST) to transform the residual block to obtain transform coefficients. The transform module 42 can convert the residual block from the pixel domain to the transform domain (for example, the frequency domain). The commonly used transform methods are DCT2 and DST7. Since the energy of most images is mainly concentrated in the low-frequency area, and the human eye is more sensitive to low frequencies, the dynamic range of image encoding can be reduced on the basis of the transform module by setting the high-frequency coefficients to zero through transformation. Removing the transform coefficients in the high-frequency area reduces the overhead of the bit rate and does not cause much distortion. Among them, the coefficients of the residual block after transformation and quantization are called transform coefficients.
[0147] Transform module 42 may send the resulting transform coefficients to quantization module 43. Quantization module 43 quantizes the transform coefficients to further reduce the bit rate. The quantization process may reduce the bit depth associated with some or all of the coefficients. The degree of quantization may be modified by adjusting the quantization parameter. In some possible embodiments, quantization module 43 may then perform a scan of the matrix containing the quantized transform coefficients. Alternatively, entropy encoding module 44 may perform the scan.
[0148] After quantization, the entropy coding module 44 may entropy encode the quantized transform coefficients. Entropy coding refers to a lossless coding method based on the principle of information entropy. It is the last processing module of video compression, which converts a series of element symbols used to represent the video sequence into a binary code stream for transmission or storage. The output data of the entropy coding module is the final code stream after the original video is compressed. Entropy coding can effectively remove the statistical redundancy of these video element symbols and is one of the important tools to ensure the efficiency of video coding compression. For example, the entropy coding module 44 may perform context-adaptive variable length coding (CAVLC), context-based adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic decoding (SBAC), probability interval segmentation entropy (PIPE) decoding or another entropy coding method or technology. After entropy coding by the entropy coding module 44, the encoded code stream may be transmitted to the video decoder 312 or archived for later transmission or retrieval by the video decoder 312.
[0149] The inverse quantization module 45 and the inverse transform module 46 apply inverse quantization and inverse transform respectively, and the summer 401 adds the inverse transformed residual block to the predicted residual block to generate a reconstructed block, which is used as a reference pixel for subsequent prediction of the original block. The reconstructed block is stored in the reference image memory 47.
[0150] Figure 5 FIG. 3 is a schematic diagram of the structure of the video decoder 312 in an embodiment of the present application. As shown in the figure, the video decoder 312 includes an entropy decoding module 50, a prediction module 51, an inverse quantization module 52, an inverse transformation module 53, a summer 501 and a reference image memory 54. In some feasible implementations, the video decoder 312 may perform the processing related to the image from Figure 4 The video encoder 302 describes an exemplary decoding process which is the inverse of the encoding process.
[0151] During the decoding process, the video decoder 312 receives a bitstream of the encoded video from the video encoder 302. The entropy decoding module 50 of the video decoder 312 entropy decodes the bitstream to generate quantized coefficients and syntax elements. The entropy decoding module 50 forwards the syntax elements to the prediction module 51. The video decoder 312 may receive the syntax elements at the video slice level and / or the video block level.
[0152] The inverse quantization module 52 inversely quantizes (e.g., dequantizes) the quantized transform coefficients provided in the bitstream and decoded by the entropy decoding module 50. The inverse quantization process may include determining the degree of quantization using the quantization parameter calculated by the video encoder 302 for each video block in the video slice, and similarly determining the degree of inverse quantization to be applied. The inverse transform module 53 applies an inverse transform (e.g., a transform method such as DCT, DST, etc.) to the inversely quantized transform coefficients, and generates an inversely transformed residual block in the pixel domain according to an inverse transform unit. The size of the inverse transform unit is the same as the size of the TU, and the inverse transform method and the transform method use the corresponding forward transform and inverse transform in the same transform method, for example, the inverse transform of DCT, DST is an inverse DCT, an inverse DST, or a conceptually similar inverse transform process.
[0153] After the prediction module 51 generates the prediction block, the video decoder 312 forms a decoded video block by summing the inverse transformed residual block from the inverse transform module 53 with the prediction block. Summer 501 represents one or more components that perform this summing operation. If necessary, a deblocking filter may also be applied to filter the decoded block to remove blocking artifacts. The decoded visual blocks in a given frame or image are stored in the reference image memory 54 as reference pixels for subsequent prediction.
[0154] This application provides a possible video encoding / decoding implementation, such as Figure 6 As shown, Figure 6 A schematic diagram of a video encoding / decoding process provided by the present application, wherein Figure a represents a video encoding process, and Figure b represents a video decoding process. The video encoding method can be executed by the above-mentioned source device 30 or video encoder 302, and the video decoding method can be executed by the above-mentioned destination device 31 or video decoder 312. The following description is taken as an example of a video encoder and a video decoder.
[0155] Specifically, the video encoder obtains the original data of the image block, predicts the original data to obtain the residual, selectively transforms the residual, quantizes and entropy codes the transformed or untransformed residual to obtain a bitstream; conversely, the video decoder obtains the bitstream, performs entropy decoding, dequantizes the parsed coefficients, and similarly, selectively performs inverse transformation to complete reconstruction. It can be understood that in the above process, transformation is an optional step, and the residual coefficients in the bitstream obtained by entropy coding can be transformed residual coefficients, or residual coefficients themselves.
[0156] When entropy coding is currently performed, if the data is small, the video encoder can directly quantize each coefficient uniformly and then perform binary coding. If the data is large, it can be further divided into multiple coefficient groups (coefficient groups, CG), and then each CG is uniformly quantized and then binarized. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) can be the same. Among them, the binary coding can also be called binarization coding, as described above about Figure 4 Description of the entropy coding module 44 in FIG. Specifically, the symbols or coefficients to be encoded are binarized, and the binarized symbols or coefficients are converted into binary strings. Different binary codes may encode the same coefficients to obtain binary strings with different binary probability models and different string lengths. Semi-fixed-length coding is a method of binary coding. Semi-fixed-length coding refers to grouping the coefficients to be encoded, encoding each group with a code length (code length, CL), and using the same code length for fixed-length coding of the coefficients in the same group.
[0157] The following is an exemplary explanation of the residual coefficient encoding part in a semi-fixed length coding method. First, the maximum value of the absolute value of the residual in a residual block is defined as the modified maximum value (modified maximum, mm). Secondly, the number of coding bits for the residual coefficients in the residual block is determined (the number of coding bits for the residual coefficients in the same residual block is consistent). For example, if the CL of the current residual block 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 current residual block 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 N value that satisfies that all residuals of the current sub-block are within the range of [-2^(N-1), 2^(N-1)]. If both -2^(N-1) and 2^(N-1) exist, N should be increased by 1, that is, N+1 bits are required to encode all residuals of the current residual block; if only one of the two boundary values of -2^(N-1) and 2^(N-1) exists, a Trailing bit needs to be encoded to determine whether the boundary value is -2^(N-1) or 2^(N-1); if all residuals do not exist in either -2^(N-1) or 2^(N-1), the Trailing bit does not need to be encoded.
[0158] In one example, if Fig.16a and Fig.16b As shown, the scanning and grouping method for transform coefficients. Among them, Fig.16a Divide the transform coefficients into 3 coefficient groups and scan them, Fig.16b The transform coefficients are divided into 5 coefficient groups and scanned. As shown in the figure, the 16×2 transform coefficient block is internally divided (the same grayscale means that the coefficients belong to the same coding group and share one CL).
[0159] In one example, if Fig.17a and Fig.17b As shown, the scanning and grouping method for residual coefficients. Among them, Fig.17a Divide the residual coefficients into 2 coefficient groups and scan them, Fig.17b The transform coefficients are divided into 4 coefficient groups and scanned. As shown in the figure, the 16×2 residual coefficient block is internally divided (the same grayscale means that the coefficients belong to the same coding group and share one CL).
[0160] Correspondingly, the decoder obtains the code length of each coefficient group according to Huffman decoding. If the code length is greater than the image bit width (bit_depth), the code length is used to parse all coefficients in the group. At the same time, the sign bit does not need to be parsed, and the coefficient parsing range is [0, 2^bit_depth-1]. If the code length is less than the image bit width (bit_depth), a fixed-length code is used to parse all coefficients in the group, and the coefficient parsing range is [-2^(CL-1)-1, 2^(CL-1)].
[0161] The video encoder 302 and the video decoder 312 may also be implemented in another implementation form, for example, by using a general digital processor system, such as Figure 7 The coding and decoding device 70 shown in the figure may be a part of the video encoder 302 or a part of the video decoder 312 .
[0162] The coding and decoding device 70 can be applied to the coding side or the decoding side. The coding and decoding device 70 includes a processor 701 and a memory 702. The processor 701 is connected to the memory 702 (such as being connected to each other through a bus 704). Optionally, the coding and decoding device 70 may also include a communication interface 703, which connects the processor 701 and the memory 702 for receiving / sending data.
[0163] The memory 702 may be a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a compact disc read-only memory (CD-ROM). The memory 702 is used to store relevant program codes and video data.
[0164] The processor 701 may be one or more central processing units (CPUs), such as Figure 7 In the example shown in FIG. 7 , the processor 701 is a CPU, which may be a single-core CPU or a multi-core CPU.
[0165] The processor 701 is used to read the program code stored in the memory 702 and execute Figure 8 and Fig.13 The operations of any corresponding implementation scheme and its various feasible implementation modes.
[0166] Below, combined with the above Figure 3 The video coding system shown, Figure 4 The video encoder 302 is shown as well as Figure 5 The video decoder 312 shown describes the encoding and decoding method provided by the present application in detail.
[0167] like Figure 8 As shown, it is a flowchart of a residual skip coding method provided by the present application. The method comprises:
[0168] S801: The video encoder obtains a residual value of an image block.
[0169] Specifically, Figure 4 In the video encoder 302 shown, the residual value of the image block refers to the pixel difference between the predicted pixels of the image block and the original pixels of the original block. Among them, the prediction includes multiple modes, and the commonly used prediction modes are intra-frame prediction mode, point-by-point prediction mode, and block copy prediction mode. For the specific implementation of the prediction mode, please refer to the above description.
[0170] S802: The video encoder determines a residual skip flag based on a residual value of the image block.
[0171] The residual skip flag is used to indicate a target residual skip mode, and the target residual skip mode is used to indicate whether part or all of the residuals of the image block are subjected to residual skipping.
[0172] Specifically, residual skipping refers to a process of partially or completely skipping residual values of an image block and then determining residual coefficients and encoding them into a bitstream.
[0173] Optionally, the target residual skip mode includes any one of the following: a first residual skip mode, used to represent that residual values of an image block are subjected to residual skipping; a second residual skip mode, used to represent that residual values of an image block are not subjected to residual skipping.
[0174] It can be understood that, in the above case, the residual skip mode is used to indicate that all residual values of the image block are skipped or not skipped, and accordingly, the residual coefficients determined according to the residual values are not encoded into the bitstream or are all encoded into the bitstream.
[0175] Optionally, when encoding the residual value of an image block, the residual block is usually divided into at least two sub-blocks in consideration of the hardware capability of the video encoder. Fig. 9 As shown, the 16×2 image block is divided into two 8×2 sub-blocks for encoding respectively. When the image block includes at least the first sub-block and the second sub-block, the residual value of the image block includes at least the first sub-block residual value and the second sub-block residual value, and the target residual skip mode includes any one of the following: the first residual skip mode, which is used to indicate that the first sub-block residual value and the second sub-block residual value are skipped, such as Fig.10 As shown in Figure c in FIG; the second residual skip mode is used to indicate that the residual value of the first sub-block and the residual value of the second sub-block are not skipped, such as Fig.10 As shown in Figure d in the figure; the third residual skip mode is used to indicate that the residual value of the first sub-block is skipped, and the residual value of the second sub-block is not skipped, such as Fig.10 As shown in Figure a; the fourth residual skip mode is used to indicate that the residual value of the first sub-block is not skipped, and the residual value of the second sub-block is skipped, such as Fig.10 As shown in Figure b. Fig.10 In the figure, the image blocks represented by checkered patterns are sub-blocks that perform residual skipping, and the image blocks represented by blanks are sub-blocks that do not perform residual skipping.
[0176] It can be understood that, in the above case, the residual skip mode is used to indicate that all residual values of the image block are skipped or not skipped, or that some residual values of the image block are skipped, and accordingly, it is determined according to the residual values whether all residual coefficients are not encoded into the bitstream or are encoded into the bitstream, or it is determined according to the residual values whether some residual coefficients are encoded into the bitstream. Wherein, encoding some residual coefficients into the bitstream includes encoding the residual coefficients of the first sub-block into the bitstream and not encoding the residual coefficients of the second sub-block into the bitstream; or, the residual coefficients of the first sub-block are not encoded into the bitstream and the residual coefficients of the second sub-block are encoded into the bitstream.
[0177] It is understandable that when the prediction is more accurate, the original pixels of the image block are closer to the predicted pixels, and the obtained residual value is close to zero. Therefore, skipping some or all of the residual values helps to reduce the overhead of the residual coefficient in the bitstream and improve the encoding performance.
[0178] The target residual skip mode indicated by the residual skip flag represents whether part or all of the residual values of the image block are skipped, which helps to achieve flexible encoding. The residual skip flag facilitates the decoding end device to parse and identify the bit stream to perform corresponding decoding actions, thereby improving the performance of video encoding and decoding.
[0179] Specifically, the video encoder may determine the residual skip flag based on the residual value of the image block by including the following steps S11-S13.
[0180] S11. The video encoder calculates the rate-distortion cost when using multiple residual skip modes for residual skip coding.
[0181] Among them, the rate-distortion cost (Rate-Distortion Optimized, RDO) of the image block is calculated as follows:
[0182] J(mode)=D+λ×R;
[0183] Among them, J(mode) represents the rate-distortion cost of different modes, D represents Distortion, which is usually measured by the SSE (error sum of squares) indicator. SSE refers to the mean square sum of pixel differences between the reconstructed block and the original image, λ is the Lagrange multiplier, and R is the actual number of bits required for encoding in the current mode, including the sum of bits required for encoding mode information, motion information, residual, etc. The smaller the rate-distortion cost, the better the encoding effect of the mode.
[0184] Since the residual values of the image block are selectively encoded by using different residual skip modes, the reconstructed blocks formed by the residual values and the predicted values are different, and the actual number of bits required for the current mode encoding is also different.
[0185] Optionally, in the above-mentioned first residual skip mode, the video encoder sets the residual value of the image block to zero.
[0186] In a possible implementation, the residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value. The first sub-block residual value and the second sub-block residual value are both set to zero.
[0187] It can be understood that, when the first residual skip mode is adopted, since the residual value of the image block is zero, its reconstructed block is composed of the predicted value of the image block.
[0188] Optionally, in the second residual skip mode, the video encoder does not skip the residual value of the image block, that is, retains the residual value of the image block.
[0189] In a possible implementation, the residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value. Both the first sub-block residual value and the second sub-block residual value are retained.
[0190] It can be understood that, when the second residual skip mode is adopted, the reconstructed block is composed of the prediction value of the image block and the residual value of the image block.
[0191] Optionally, in the third residual skip mode or the fourth residual skip mode, the video encoder partially skips the residual values of the image block, that is, retains some residual values of the image block.
[0192] In a possible implementation, the residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value. The video encoder retains the target sub-block residual value and skips the residual value of the image block except the target sub-block.
[0193] Specifically, in the third residual skip mode, the video encoder skips the first sub-block residual value and retains the second sub-block residual value. The reconstructed block is composed of the predicted value of the image block and the second sub-block residual value of the image block. In the fourth residual skip mode, the video encoder retains the first sub-block residual value and skips the second sub-block residual value. The reconstructed block is composed of the predicted value of the image block and the first sub-block residual value of the image block.
[0194] S12. The video encoder uses a residual skip mode whose rate-distortion cost satisfies a condition among multiple residual skip modes as a target residual skip mode.
[0195] Among them, the residual skip mode whose rate-distortion cost satisfies the condition should be a selectable coding mode. It can be understood that, generally, the smaller the rate-distortion cost, the better the coding effect, and the video encoder can select the residual skip mode corresponding to the minimum rate-distortion cost as the target residual skip mode.
[0196] S13. The video encoder determines a residual skip flag based on the target residual skip mode.
[0197] In a possible implementation, different residual skip modes are represented by different values in the residual skip flag. The first residual skip mode corresponds to a residual skip flag of the first value, the second residual skip mode corresponds to a residual skip flag of the second value, the third residual skip mode corresponds to a residual skip flag of the third value, and the fourth residual skip mode corresponds to a residual skip flag of the first value. Exemplarily, the first value is 0, the second value is 1, the third value is 2, and the fourth value is 3; or, the first value is 3, the second value is 2, the third value is 1, and the fourth value is 0; or, the first value is 2, the second value is 1, the third value is 3, and the fourth value is 0; or, the first value is 2, the second value is 1, the third value is 3, and the fourth value is 0; or, the first value is 1, the second value is 2, the third value is 3, and the fourth value is 0.
[0198] Another possible implementation is to indicate whether each sub-block in the image block performs residual skipping, and the residual skipping flag includes residual skipping flags of multiple sub-blocks. Exemplarily, the fifth value indicates that residual skipping is performed, and the sixth value indicates that residual skipping is not performed.
[0199] When the image block includes a first sub-block and a second sub-block, the residual skip flag includes a first sub-block residual skip flag and a second sub-block residual skip flag. For example, the first sub-block residual skip flag is a fifth value and the second sub-block residual skip flag is a fifth value, indicating a first residual skip mode, the first sub-block residual skip flag is a sixth value and the second sub-block residual skip flag is a sixth value, indicating a second residual skip mode, the first sub-block residual skip flag is a fifth value and the second sub-block residual skip flag is a sixth value, indicating a third residual skip mode, and the first sub-block residual skip flag is a fifth value and the second sub-block residual skip flag is a sixth value, indicating a fourth residual skip mode.
[0200] Exemplarily, the fifth value is 0 and the sixth value is 1, or the fifth value is 1 and the sixth value is 0.
[0201] It is understandable that when the residual skip mode only includes the first residual skip mode and the second residual skip mode, the residual skip flag is only used to indicate whether to perform residual skipping or not. Then the residual skip flag can be represented by the first value and the second value, respectively, or by the fifth value and the sixth value, respectively.
[0202] The video encoder uses the flag corresponding to the target residual skip mode as the residual skip flag.
[0203] It is understandable that the types of residual skip modes can be preset in the video encoder. The richer the types, the more choices of residual skip modes, which helps different image blocks to be flexibly selected during the encoding process.
[0204] S803: The video encoder encodes the residual skip flag into the bitstream.
[0205] Specifically, the video encoder encodes the residual skip flag corresponding to the residual skip mode with the smallest rate-distortion cost into the bitstream. The bits occupied by the residual skip flag in the bitstream are determined according to the type of the residual skip mode. For example, if there are 4 types of residual skip modes, at least 2 bits are occupied, and the first value, second value, third value and fourth value of the residual skip flag are represented by 00, 01, 10 and 11 respectively. For another example, if there are 2 types of residual skip modes, at least 1 bit is occupied, and the fifth value and sixth value of the residual skip flag are represented by 0 and 1 respectively.
[0206] Through the above method, the video encoder selectively retains part or all of the residuals of the image block during the encoding process, and flexibly adjusts the bits occupied by the residual coefficients in the bitstream, which helps to reduce the overhead of residual encoding and improve encoding performance.
[0207] After the above step S803, the method further includes: the video encoder determines the residual coefficient of the image block.
[0208] Specifically, when the target residual skip mode is the first residual skip mode, the residual value of the image block is zero, the video encoder does not need to encode the residual value of the image block into the bitstream, and accordingly, the video encoder does not need to determine the residual coefficient according to the residual value of the image block.
[0209] Specifically, when the target residual skip mode is the second residual skip mode, the residual values of the image block are all retained, and the video encoder determines the residual coefficient according to all the residual values of the image block. Wherein, when the image block is divided into a plurality of sub-blocks, all the residual values of the image block are composed of the residual values of the plurality of sub-blocks. For example, if the image block includes a first sub-block and a second sub-block, the video encoder determines the residual coefficient according to the residual value of the first sub-block and the residual value of the second sub-block.
[0210] Specifically, when the target residual skip mode is the third residual skip mode or the fourth residual skip mode, the residual value of the image block is partially retained, and the partially retained residual value can be the residual value of the target sub-block in the image block, and the video encoder determines the residual coefficient according to the residual value of the target sub-block and the residual skip mode of the target sub-block. Among them, when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block, and the video encoder determines the residual coefficient of the image block according to the residual value of the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block, and the video encoder determines the residual coefficient of the image block according to the residual value of the first sub-block.
[0211] Optionally, the video encoder determines the residual coefficient of the image block according to the residual value of the image block and the target residual skip mode.
[0212] Optionally, the video encoder determines whether the residual value is transformed. If the residual value is transformed, the residual coefficient of the image block is transformed to obtain the transformed residual coefficient; the transformed residual coefficient is encoded into the bitstream; wherein the transformed residual coefficient may also be referred to as the transform coefficient. If the residual value is not transformed, the residual coefficient of the image block is determined according to the residual value of the image block and the target residual skip mode; the residual coefficient of the image block is encoded into the bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has not been transformed.
[0213] It is understandable that the video encoder encodes the result of whether the transform skip is performed into the bitstream through the transform skip flag to instruct the video decoder to perform the corresponding decoding action. Exemplarily, the transform skip flag occupies one bit in the bitstream, 0 means the transform skip is performed, and 1 means the transform skip is not performed.
[0214] Optionally, the video encoder determines whether to transform the residual value based on the prediction mode. Exemplarily, when the prediction mode is an intra-frame prediction mode, it is determined that the residual value is not transformed; when the prediction mode is a block copy prediction mode, it is determined that the residual value is transformed. Accordingly, the video encoder determines the transform skip flag according to the prediction mode.
[0215] It is understandable that when the prediction mode has a corresponding relationship with whether to perform a transformation, the video encoder can encode any one of the prediction mode flag or the transformation skip flag into the bitstream for the decoding end device to obtain and perform a corresponding decoding action.
[0216] Optionally, when DCT transform is adopted, the transform coefficient includes a DC coefficient and an AC coefficient, wherein the DC coefficient is the direct current component of the DCT transform coefficient, and the AC coefficient is the alternating current component of the DCT transform coefficient. When the video encoder adopts semi-fixed length encoding for the transform coefficient, the transform coefficient can be divided into coefficient groups, and each coefficient group is encoded with a fixed code length. For example, Fig.11 The a and b shown in the figure represent two division methods respectively. The a figure represents division into three coefficient groups, and the b figure represents division into five coefficient groups. Fig.11 In the figure, the black image block represents the DC coefficient in the upper left corner, and the other image blocks represent the AC coefficients; the image blocks of the same form are the same coefficient group. For example, in figure a, according to the order of appearance from left to right, the three coefficient groups include the black image block as a coefficient group, the blank image block as a coefficient group, and the left diagonal image block as a coefficient group; as in figure b, according to the order of appearance from left to right, the five coefficient groups include the black image block as a coefficient group, the checkered image block as a coefficient group, the left diagonal image block as a coefficient group, the blank image block as a coefficient group, and the right diagonal image block as a coefficient group. The video encoder determines the code length for different coefficient groups and encodes them separately.
[0217] Specifically, the video encoder obtains the DC coefficient and AC coefficient of the residual value of the target sub-block; performs semi-fixed length encoding on the DC coefficient of the residual value of the target sub-block as a coefficient group; and performs semi-fixed length encoding on the AC coefficient of the residual value of the target sub-block as one or more coefficient groups. When the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block.
[0218] For example, in Fig.11 In the method of dividing coefficient groups in FIG. a, when the target residual skip mode is the third residual skip mode or the fourth residual skip mode, Fig.11 The left or right 8×2 sub-block of the a picture in is divided into three coefficient groups, and the code length of each coefficient group is determined, and the encoding is performed with the code length of each coefficient group. Fig.11In the method of dividing coefficient groups in Figure b, when the target residual skip mode is the third residual skip mode or the fourth residual skip mode, Fig.11 The left or right 8×2 sub-block of the b-picture in is divided into three coefficient groups, and the code length of each coefficient group is determined, and encoding is performed with the code length of each coefficient group.
[0219] Optionally, when the video encoder does not transform the residual coefficients and uses semi-fixed-length coding for the quantized residual coefficients, the residual coefficients are divided into coefficient groups, and each coefficient group is encoded with a fixed code length. Fig.12 The a and b diagrams shown in the figure represent two division methods, respectively. A diagram represents division into two coefficient groups, and b diagram represents division into four coefficient groups. Fig.12 In the above, image blocks of the same form have the same coefficient group.
[0220] In fact, in Fig.11 In the a and b figures of the figure, the number of coefficient groups divided into the left and right sub-blocks is 3. Fig.12 In Figure a and Figure b, the number of coefficient groups divided into the left and right sub-blocks is 2 respectively; in the case of encoding partial residual values, the video encoder can divide the residual values into M coefficient groups according to a preset grouping method, where M is an integer greater than zero.
[0221] Specifically, the video encoder divides the target sub-block residual into M coefficient groups, wherein when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block. The video encoder performs semi-fixed-length encoding on the M coefficient groups.
[0222] In one example, when the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the value of M is determined to be 3. When the residual skip mode represented by the residual skip flag is the second residual skip mode, the value of M is determined to be 5.
[0223] The above method helps to save resources occupied by group indexes in the code stream and improve transmission efficiency.
[0224] Optionally, before the above-mentioned step S802, the method also includes: the video encoder determines that the prediction mode of the image block satisfies a first condition, and the prediction mode is used to obtain a prediction value of the image block, wherein the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0225] It is understandable that, in the case where some prediction modes have a corresponding relationship with the residual skip mode, the video encoder determines the residual skip mode according to the prediction mode. Specifically, if the first condition is that the prediction mode of the image block is an intra-frame prediction mode, the above steps S802 and S803 are performed only when the first condition is met; similarly, the first condition may also be that the prediction mode of the image block is a block copy prediction mode, or the first condition may be that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0226] Through the above method, the video encoder establishes a corresponding relationship between the prediction mode and the residual skip mode, which helps to execute different residual skip modes for different prediction modes and improve the flexibility of encoding.
[0227] Optionally, image blocks are divided into different types based on different sampling methods, for example, image blocks are divided into luminance image blocks and chrominance image blocks based on the YUV format, and the luminance image blocks and the chrominance image blocks are encoded separately. Accordingly, the residual skip flag includes a luminance residual skip flag and / or a chrominance residual skip flag. When the residual skip modes indicated by the residual skip flag for the luminance image block and the chrominance image block are different, they are distinguished by the luminance residual skip flag and the chrominance residual skip flag.
[0228] The residual skip coding method provided in the embodiment of the present application selectively encodes the residual into the bitstream. Compared with the existing residual coding method, it helps to flexibly adjust the bits occupied by the residual coefficients in the bitstream, reduce the overhead of residual coding, and improve the coding performance. In addition, encoding the residual skip flag into the bitstream helps the video decoder to perform the corresponding decoding action, saves the transmission bit overhead, and improves the decoding performance.
[0229] like Fig.13 As shown, it is a flowchart of a residual skip decoding method provided by the present application. Fig.13 The residual skip decoding method shown is similar to Figure 8 Therefore, the explanation of the relevant contents in this embodiment can refer to the above Figure 8 The embodiment shown. Fig.13 The method shown includes the following steps:
[0230] S1301: The video decoder obtains a residual skip flag in a bitstream.
[0231] The residual skip flag is used to indicate a target residual skip mode of the image block, and the target residual skip mode is used to indicate whether residual skipping is performed on part or all of the residual coefficients of the image block.
[0232] The residual skip flag is used to indicate a target residual skip mode, and the specific implementation manner in which the residual skip flag indicates the target residual skip mode can refer to the description in the above step S802.
[0233] S1302: The video decoder obtains residual coefficients of the image block based on the residual skip flag.
[0234] Optionally, when the target residual skip mode is the first residual skip mode, the video decoder sets the residual coefficient of the image block to zero according to the residual skip flag.
[0235] Optionally, when the target residual skip mode is the second residual skip mode, the video decoder parses the bitstream according to the residual skip flag to obtain the residual coefficients of the image block.
[0236] Optionally, when the target residual skip mode is the third residual skip mode, the video decoder sets the residual coefficient of the first sub-block to zero according to the residual skip flag.
[0237] It can be understood that when the target residual skip mode is the third residual skip mode, the video decoder parses the bitstream according to the residual skip flag, and obtains the residual coefficient of the image block as the second sub-block residual coefficient.
[0238] Optionally, when the target residual skip mode is the fourth residual skip mode, the video decoder sets the residual coefficient of the second sub-block to zero according to the residual skip flag.
[0239] It can be understood that when the target residual skip mode is the fourth residual skip mode, the video decoder parses the bitstream according to the residual skip flag, and obtains the residual coefficient of the image block as the residual coefficient of the first sub-block.
[0240] S1303: The video decoder calculates a residual value of the image block according to the residual coefficient of the image block.
[0241] Optionally, the bitstream also includes a transform skip flag, which is used to indicate whether the residual coefficients in the bitstream are transformed. The video decoder calculates the residual value of the image block according to the residual coefficients of the image block based on the transform skip flag and the residual skip flag.
[0242] Specifically, when the transform skip flag indicates that the residual coefficients of the image block are transformed, the residual coefficients of the image block are dequantized and inversely transformed to obtain the residual value of the image block; when the transform skip flag indicates that the residual coefficients of the image block are not transformed, the residual coefficients of the image block are dequantized to obtain the residual value of the image block.
[0243] Optionally, the code stream also includes a prediction mode identifier, which is used to indicate the prediction mode of the image block. The prediction mode has a corresponding relationship with whether to perform a transformation. The video encoder determines the prediction mode and whether to perform a transformation based on the prediction mode identifier. Exemplarily, when the prediction mode is an intra-frame prediction mode, it is determined that the residual value is not transformed; when the prediction mode is a block copy prediction mode, it is determined that the residual value is transformed.
[0244] Optionally, when the target residual skip mode is the third residual skip mode, the residual coefficient of the second sub-block includes a DC coefficient and an AC coefficient, and the residual value of the image block is calculated according to the residual coefficient of the image block, including: the video decoder takes the DC coefficient of the second sub-block residual coefficient as a coefficient group, performs semi-fixed length decoding, and obtains a first residual value; takes the AC coefficient of the second sub-block residual coefficient as one or more coefficient groups, performs semi-fixed length decoding, and obtains a second residual value; determines the residual value of the image block based on the first residual value and the second residual value.
[0245] Optionally, when the target residual skip mode is the fourth residual skip mode, the residual coefficient of the first sub-block includes a DC coefficient and an AC coefficient, and the residual value of the image block is calculated according to the residual coefficient of the image block, including: taking the DC coefficient of the first sub-block residual coefficient as a coefficient group and performing semi-fixed length decoding to obtain a third residual value; taking the AC coefficient of the first sub-block residual coefficient as one or more coefficient groups and performing semi-fixed length decoding to obtain a fourth residual value; and determining the residual value of the image block based on the third residual value and the fourth residual value.
[0246] Optionally, the residual coefficients in the bitstream are obtained as M coefficient groups through semi-fixed length encoding. When the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the video decoder determines the value of M according to the residual skip flag; wherein M is an integer greater than zero; and the M coefficient groups are semi-fixed length decoded to obtain the residual value of the image block.
[0247] In one example, when the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the value of M is determined to be 3. When the residual skip mode represented by the residual skip flag is the second residual skip mode, the value of M is determined to be 5.
[0248] S1304: The video decoder reconstructs the image block according to the residual value of the image block and the predicted value of the image block to obtain a reconstructed block.
[0249] Optionally, before the above-mentioned step S1301, the method also includes: the video decoder obtains a prediction mode identifier in the bitstream, the prediction mode identifier is used to indicate the prediction mode of the image block, and the prediction mode is used to obtain the prediction value of the image block; the video decoder determines that the prediction mode of the image block satisfies a first condition, the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0250] Through the above method, the video encoder establishes a corresponding relationship between the prediction mode and the residual skip mode, which helps to execute different residual skip modes for different prediction modes and improve the flexibility of encoding.
[0251] Optionally, image blocks are divided into different types based on different sampling methods, for example, image blocks are divided into luminance image blocks and chrominance image blocks based on the YUV format, and the luminance image blocks and the chrominance image blocks are encoded separately. Accordingly, the residual skip flag includes a luminance residual skip flag and / or a chrominance residual skip flag. When the residual skip modes indicated by the residual skip flag for the luminance image block and the chrominance image block are different, they are distinguished by the luminance residual skip flag and the chrominance residual skip flag.
[0252] The residual skip decoding method provided in the embodiment of the present application indicates the residual coefficient in the bitstream through the residual skip flag, which helps the video decoder to complete the reconstruction of the image block by parsing the residual skip flag in the bitstream and parsing the corresponding residual coefficient. Compared with the existing residual decoding method, it helps the residual coefficient in the bitstream to flexibly occupy resources, save transmission bit overhead, and improve decoding performance.
[0253] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, 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 the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0254] The embodiment of the present application can divide the encoder / decoder into functional modules according to the above method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0255] like Fig.14 FIG. 1 is a schematic block diagram of a decoding device 140 provided in an embodiment of the present application. The decoding device 140 may be used to execute the video decoding method provided in an embodiment of the present application, such as Fig.13 The video decoding method shown. The decoding device 140 may include an acquisition unit 1401, a calculation unit 1402 and a reconstruction unit 1403. The acquisition unit 1401 is used to acquire a residual skip flag in a bitstream, the residual skip flag is used to indicate a target residual skip mode of an image block, and the target residual skip mode is used to characterize whether a part or all of the residual coefficients of the image block are subjected to residual skipping. The acquisition unit 1401 is also used to acquire the residual coefficient of the image block based on the residual skip flag. The calculation unit 1402 is used to calculate the residual value of the image block according to the residual coefficient of the image block. The reconstruction unit 1403 is used to reconstruct the image block according to the residual value of the image block and the predicted value of the image block to obtain a reconstructed block.
[0256] In one example, the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to characterize that all residual coefficients are subjected to residual skipping; a second residual skip mode; wherein the second residual skip mode is used to characterize that all residual coefficients are not subjected to residual skipping.
[0257] In one example, an image block includes at least a first sub-block and a second sub-block, and the residual coefficients of the image block include at least the residual coefficients of the first sub-block and the second sub-block, and the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to characterize that residual skipping is performed on the residual coefficients of the first sub-block and the residual coefficients of the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to characterize that residual skipping is not performed on the residual coefficients of the first sub-block and the residual coefficients of the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to characterize that residual skipping is performed on the residual coefficients of the first sub-block, and residual skipping is not performed on the residual coefficients of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to characterize that residual skipping is not performed on the residual coefficients of the first sub-block, and residual skipping is performed on the residual coefficients of the second sub-block.
[0258] In an example, when the target residual skip mode is the first residual skip mode, the acquiring unit 1401 is specifically configured to set the residual coefficient of the image block to zero according to the residual skip flag.
[0259] In an example, when the target residual skip mode is the second residual skip mode, the acquiring unit 1401 is specifically configured to parse the bitstream according to the residual skip flag to obtain the residual coefficient of the image block.
[0260] In an example, when the target residual skip mode is the third residual skip mode, the acquiring unit 1401 is specifically configured to set the residual coefficient of the first sub-block to zero according to the residual skip flag.
[0261] In one example, when the target residual skip mode is the third residual skip mode, the second sub-block residual coefficient includes a DC coefficient and an AC coefficient, and the calculation unit 1402 is specifically used to use the DC coefficient of the second sub-block residual coefficient as a coefficient group, perform semi-fixed length decoding, and obtain a first residual value; use the AC coefficient of the second sub-block residual coefficient as one or more coefficient groups, perform semi-fixed length decoding, and obtain a second residual value; determine the residual value of the image block based on the first residual value and the second residual value.
[0262] In an example, when the target residual skip mode is the fourth residual skip mode, based on the residual skip flag, the acquiring unit 1401 is specifically configured to set the residual coefficient of the second sub-block to zero according to the residual skip flag.
[0263] In one example, when the target residual skip mode is the fourth residual skip mode, the residual coefficient of the first sub-block includes a DC coefficient and an AC coefficient, and the calculation unit 1402 is specifically used to take the DC coefficient of the first sub-block residual coefficient as a coefficient group, perform semi-fixed length decoding, and obtain a third residual value; take the AC coefficient of the first sub-block residual coefficient as one or more coefficient groups, perform semi-fixed length decoding, and obtain a fourth residual value; determine the residual value of the image block based on the third residual value and the fourth residual value.
[0264] In one example, the residual coefficients in the bitstream are obtained as M coefficient groups through semi-fixed length coding; the calculation unit 1402 is specifically used to derive and determine the value of M according to the residual skip flag when the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode; wherein M is an integer greater than zero; the M coefficient groups are semi-fixed length decoded to obtain the residual value of the image block.
[0265] In one example, the bitstream also includes a transform skip flag, which is used to indicate whether the residual coefficients of the image block are transformed. The calculation unit 1402 is specifically used to, when the transform skip flag indicates that the residual coefficients of the image block are transformed, dequantize and detransform the residual coefficients of the image block to obtain the residual value of the image block; when the transform skip flag indicates that the residual coefficients of the image block are not transformed, dequantize the residual coefficients of the image block to obtain the residual value of the image block.
[0266] In one example, the acquisition unit 1401 is further used to obtain a prediction mode identifier in a code stream, the prediction mode identifier is used to indicate a prediction mode of an image block, and the prediction mode is used to obtain a prediction value of the image block; determine that the prediction mode of the image block satisfies a first condition, the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0267] In one example, the residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
[0268] In one example, when the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the value of M is determined to be 3. When the residual skip mode represented by the residual skip flag is the second residual skip mode, the value of M is determined to be 5.
[0269] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0270] Of course, the decoding device provided in the embodiment of the present application includes but is not limited to the above modules. For example, the decoding device may also include a storage unit 1404 .
[0271] The storage unit 1404 may be used to store program codes and data of the decoding apparatus.
[0272] like Fig.15 , which is a schematic block diagram of an encoding device 150 provided in an embodiment of the present application. The encoding device 150 can be used to execute the video encoding method provided in an embodiment of the present application, such as Figure 8The video encoding method shown. The encoding device 150 may include an acquisition unit 1501, a determination unit 1502 and a processing unit 1503. The acquisition unit 1501 is used to acquire the residual value of the image block; the determination unit 1502 is used to determine the residual skip flag based on the residual value of the image block, the residual skip flag is used to indicate the target residual skip mode, and the target residual skip mode is used to indicate whether part or all of the residual values of the image block have been subjected to residual skipping; the processing unit 1503 is used to encode the residual skip flag into the bitstream.
[0273] In one example, the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to represent that residual values of an image block are subjected to residual skipping; a second residual skip mode; wherein the second residual skip mode is used to represent that residual values of an image block are not subjected to residual skipping.
[0274] In one example, an image block includes at least a first sub-block and a second sub-block, a residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value, and a target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to characterize that residual skipping is performed on the residual value of the first sub-block and the residual value of the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to characterize that residual skipping is not performed on the residual value of the first sub-block and the residual value of the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to characterize that residual skipping is performed on the residual value of the first sub-block, and residual skipping is not performed on the residual value of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to characterize that residual skipping is not performed on the residual value of the first sub-block, and residual skipping is performed on the residual value of the second sub-block.
[0275] In one example, determination unit 1502 is specifically used to calculate the rate-distortion cost when residual skip encoding is performed using multiple residual skip modes respectively based on the residual value of the image block, and the multiple residual skip modes include at least a first residual skip mode and a second residual skip mode; among the multiple residual skip modes, a residual skip mode whose rate-distortion cost meets the condition is used as a target residual skip mode; and based on the target residual skip mode, a residual skip flag is determined.
[0276] In one example, determination unit 1502 is further used to determine the residual coefficient of the image block according to the target sub-block residual value and the target residual skip mode; and encode the residual coefficient of the image block into the bitstream; wherein, when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; and when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block.
[0277] In one example, determination unit 1502 is specifically used to obtain the DC coefficient and AC coefficient of the residual value of the target sub-block; encode the residual coefficient of the image block into the bitstream, including: semi-fixed length encoding the DC coefficient of the residual value of the target sub-block as a coefficient group; semi-fixed length encoding the AC coefficient of the residual value of the target sub-block as one or more coefficient groups.
[0278] In one example, processing unit 1503 is also used to divide the residual value of the target sub-block into M coefficient groups, where M is the maximum number of coefficient groups in the target sub-block; wherein, when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block; and semi-fixed-length encoding is performed on the M coefficient groups.
[0279] In one example, the determination unit 1502 is further used to determine the residual coefficient of the image block according to the residual value of the image block and the target residual skip mode; transform the residual coefficient of the image block to obtain the transformed residual coefficient; encode the transformed residual coefficient and the transform skip flag into the bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has been transformed; or, determine the residual coefficient of the image block according to the target sub-block residual value and the target residual skip mode; encode the residual coefficient of the image block and the transform skip flag into the bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has not been transformed.
[0280] In one example, the determination unit 1502 is further used to determine whether the prediction mode of the image block satisfies a first condition, wherein the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
[0281] In one example, the residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
[0282] In one example, when the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the value of M is determined to be 3. When the residual skip mode represented by the residual skip flag is the second residual skip mode, the value of M is determined to be 5.
[0283] Among them, all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module, and will not be repeated here.
[0284] Of course, the encoding device provided in the embodiment of the present application includes but is not limited to the above modules. For example, the encoding device may also include a storage module 1504.
[0285] The storage module 1504 may be used to store program codes and data of the encoding device.
[0286] An embodiment of the present application further provides an electronic device, which includes the above-mentioned decoding device 140, and the decoding device 140 executes the method executed by any one of the video decoders provided above.
[0287] An embodiment of the present application further provides an electronic device, which includes the above-mentioned encoding device 150, and the encoding device 150 executes the method executed by any one of the video encoders provided above.
[0288] An embodiment of the present application also provides a coding and decoding system, which includes the above-mentioned decoding device 140 and encoding device 150, wherein the decoding device 140 executes the method executed by any one of the video decoders provided above, and the encoding device 150 executes the method executed by any one of the video encoders provided above.
[0289] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed on a computer, the computer is enabled to execute the method executed by any one of the video encoders or video decoders provided above.
[0290] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0291] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for implementing the functions of the above-mentioned decoding device 140 or encoding device 150. Optionally, the functions supported by the chip can be referred to above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned embodiment can be completed by instructing the relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned processing unit or processor can be a central processing unit, a general-purpose processor, an application specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0292] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0293] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media and communication chips, etc., are all non-transitory.
[0294] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it 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 instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).
[0295] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0296] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A residual skip decoding method, characterized in that: include: Obtain a residual skip flag in a bitstream, the residual skip flag is used to indicate a target residual skip mode of an image block, the target residual skip mode is used to indicate whether residual skipping is performed on some or all residual coefficients of the image block; the image block includes at least a first sub-block and a second sub-block, the residual coefficients of the image block include at least first sub-block residual coefficients and second sub-block residual coefficients, and the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to indicate that residual skipping is performed on the residual coefficients of the first sub-block and the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to indicate that residual skipping is not performed on the residual coefficients of the first sub-block and the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to indicate that residual skipping is performed on the residual coefficients of the first sub-block and residual skipping is not performed on the residual coefficients of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to indicate that residual skipping is not performed on the residual coefficients of the first sub-block and residual skipping is performed on the residual coefficients of the second sub-block; Based on the residual skip flag, obtaining a residual coefficient of the image block; Calculating a residual value of the image block according to a residual coefficient of the image block; The image block is reconstructed according to the residual value of the image block and the predicted value of the image block to obtain a reconstructed block.
2. The method according to claim 1, characterized in that When the target residual skip mode is the first residual skip mode, acquiring the residual coefficient of the image block based on the residual skip flag includes: According to the residual skip flag, the residual coefficient of the image block is set to zero.
3. The method according to claim 1, characterized in that When the target residual skip mode is the second residual skip mode, acquiring the residual coefficient of the image block based on the residual skip flag includes: The code stream is parsed according to the residual skip flag to obtain the residual coefficient of the image block.
4. The method according to claim 1, characterized in that: When the target residual skip mode is the third residual skip mode, acquiring the residual coefficient of the image block based on the residual skip flag at least includes: According to the residual skip flag, the residual coefficient of the first sub-block is set to zero.
5. The method according to claim 1, characterized in that When the target residual skip mode is the third residual skip mode, the residual coefficient of the second sub-block includes a DC coefficient and an AC coefficient, and calculating the residual value of the image block according to the residual coefficient of the image block includes: Taking the DC coefficient of the residual coefficient of the second sub-block as a coefficient group, performing semi-fixed length decoding to obtain a first residual value; Taking the AC coefficients of the second sub-block residual coefficients as one or more coefficient groups, and performing semi-fixed length decoding to obtain a second residual value; Based on the first residual value and the second residual value, a residual value of the image block is determined.
6. The method according to claim 1, characterized in that When the target residual skip mode is the fourth residual skip mode, acquiring the residual coefficient of the image block based on the residual skip flag at least includes: According to the residual skip flag, the residual coefficient of the second sub-block is set to zero.
7. The method according to claim 1, characterized in that When the target residual skip mode is the fourth residual skip mode, the first sub-block residual coefficient includes a DC coefficient and an AC coefficient, and calculating the residual value of the image block according to the residual coefficient of the image block includes: Taking the DC coefficient of the residual coefficient of the first sub-block as a coefficient group, and performing semi-fixed length decoding to obtain a third residual value; Taking the AC coefficients of the first sub-block residual coefficients as one or more coefficient groups, and performing semi-fixed length decoding to obtain a fourth residual value; Based on the third residual value and the fourth residual value, a residual value of the image block is determined.
8. The method according to claim 1, characterized in that The residual coefficients in the bitstream are obtained as M coefficient groups through semi-fixed length coding; and the residual value of the image block is calculated according to the residual coefficients of the image block, comprising: When the residual skip mode represented by the residual skip flag is the third residual skip mode or the fourth residual skip mode, the value of M is derived according to the residual skip flag; wherein M is an integer greater than zero; Semi-fixed-length decoding is performed on the M coefficient groups to obtain a residual value of the image block.
9. The method according to claim 1, characterized in that: The bitstream also includes a transform skip flag, where the transform skip flag is used to indicate whether the residual coefficient of the image block is transformed, and the calculating the residual value of the image block according to the residual coefficient of the image block includes: When the transform skip flag indicates that the residual coefficient of the image block is to be transformed, dequantizing and inverse transforming the residual coefficient of the image block to obtain a residual value of the image block; When the transform skip flag indicates that the residual coefficient of the image block is not to be transformed, the residual coefficient of the image block is dequantized to obtain the residual value of the image block.
10. The method according to claim 1, characterized in that Before obtaining the residual skip flag in the bitstream, the method further includes: Acquire a prediction mode identifier in a bitstream, wherein the prediction mode identifier is used to indicate a prediction mode of the image block, and the prediction mode is used to acquire a prediction value of the image block; Determine that the prediction mode of the image block satisfies a first condition, wherein the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
11. The method according to claim 1, characterized in that: The residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
12. A residual skip coding method, characterized in that: include: Get the residual value of the image block; Based on the residual value of the image block, a residual skip flag is determined, the residual skip flag is used to indicate a target residual skip mode, and the target residual skip mode is used to indicate whether part or all of the residual values of the image block are subjected to residual skipping; the image block includes at least a first sub-block and a second sub-block, the residual value of the image block includes at least a first sub-block residual value and a second sub-block residual value, and the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to indicate that the first sub-block residual value and the second sub-block residual value are subjected to residual skipping; a second residual skip mode; wherein the second residual skip mode is used to indicate that the first sub-block residual value and the second sub-block residual value are not subjected to residual skipping; a third residual skip mode; wherein the third residual skip mode is used to indicate that the first sub-block residual value is subjected to residual skipping, and the second sub-block residual value is not subjected to residual skipping; a fourth residual skip mode; wherein the fourth residual skip mode is used to indicate that the first sub-block residual value is not subjected to residual skipping, and the second sub-block residual value is subjected to residual skipping; The residual skip flag is encoded into a bitstream.
13. The method according to claim 12, characterized in that The determining a residual skip flag based on the residual value of the image block includes: Based on the residual value of the image block, calculating the rate-distortion cost when using a plurality of residual skip modes to perform residual skip coding respectively, wherein the plurality of residual skip modes at least include the first residual skip mode and the second residual skip mode; Using, among the multiple residual skip modes, a residual skip mode whose rate-distortion cost satisfies a condition as the target residual skip mode; Based on the target residual skip mode, the residual skip flag is determined.
14. The method according to claim 13, characterized in that The method further comprises: Determining a residual coefficient of the image block according to a target sub-block residual value and the target residual skip mode; Encoding the residual coefficients of the image block into a bitstream; Among them, when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block.
15. The method according to claim 14, characterized in that The determining the residual coefficient of the image block according to the residual value of the target sub-block includes: Obtaining a DC coefficient and an AC coefficient of the target sub-block residual value; The step of encoding the residual coefficient of the image block into a bitstream comprises: Performing semi-fixed-length coding on the DC coefficient of the residual value of the target sub-block as a coefficient group; The AC coefficients of the target sub-block residual value are treated as one or more coefficient groups and semi-fixed length encoded.
16. The method according to claim 13, characterized in that The method further comprises: Divide the residual value of the target sub-block into M coefficient groups, where M is the maximum number of coefficient groups in the target sub-block; wherein when the target residual skip mode is the third residual skip mode, the target sub-block is the second sub-block; when the target residual skip mode is the fourth residual skip mode, the target sub-block is the first sub-block; The M coefficient groups are semi-fixed length encoded.
17. The method according to claim 12, characterized in that The method further comprises: Determining a residual coefficient of the image block according to a target sub-block residual value and the target residual skip mode; Transforming the residual coefficient of the image block to obtain a transformed residual coefficient; Encoding the transformed residual coefficient and the transform skip flag into a bitstream; wherein the transform skip flag is used to indicate that the residual coefficient of the image block has been transformed; or, Determining a residual coefficient of the image block according to a target sub-block residual value and the target residual skip mode; The residual coefficients and the transform skip flag of the image block are encoded into a bitstream; wherein the transform skip flag is used to indicate that the residual coefficients of the image block have not been transformed.
18. The method according to any one of claims 12 to 17, characterized in that: Before determining the residual skip flag based on the residual of the image block, the method further includes: Determine that the prediction mode of the image block satisfies a first condition, wherein the first condition is that the prediction mode of the image block is an intra-frame prediction mode, or, the first condition is that the prediction mode of the image block is a block copy prediction mode, or, the first condition is that the prediction mode of the image block is an intra-frame prediction mode or a block copy prediction mode.
19. The method according to any one of claims 12 to 17, characterized in that: The residual skip flag includes a luma residual skip flag and / or a chroma residual skip flag.
20. A video decoding device, characterized in that: include: An acquisition unit is used to acquire a residual skip flag in a bitstream, wherein the residual skip flag is used to indicate a target residual skip mode of an image block, and the target residual skip mode is used to indicate whether residual skipping is performed on part or all of the residual coefficients of the image block; the image block includes at least a first sub-block and a second sub-block, and the residual coefficients of the image block include at least first sub-block residual coefficients and second sub-block residual coefficients, and the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to indicate that residual skipping is performed on the residual coefficients of the first sub-block and the second sub-block; a second residual skip mode; wherein the second residual skip mode is used to indicate that residual skipping is not performed on the residual coefficients of the first sub-block and the second sub-block; a third residual skip mode; wherein the third residual skip mode is used to indicate that residual skipping is performed on the residual coefficients of the first sub-block and residual skipping is not performed on the residual coefficients of the second sub-block; a fourth residual skip mode; wherein the fourth residual skip mode is used to indicate that residual skipping is not performed on the residual coefficients of the first sub-block and residual skipping is performed on the residual coefficients of the second sub-block; The acquisition unit is further configured to acquire a residual coefficient of the image block based on the residual skip flag; A calculation unit, configured to calculate a residual value of the image block according to a residual coefficient of the image block; The reconstruction unit is used to reconstruct the image block according to the residual value of the image block and the predicted value of the image block to obtain a reconstructed block.
21. A video encoding device, characterized in that: include: An acquisition unit, used for acquiring a residual value of an image block; A determination unit, configured to determine a residual skip flag based on the residual value of the image block, the residual skip flag being used to indicate a target residual skip mode, the target residual skip mode being used to characterize whether part or all of the residual values of the image block have been subjected to residual skipping; the image block at least includes a first sub-block and a second sub-block, the residual coefficient of the image block at least includes a first sub-block residual coefficient and a second sub-block residual coefficient, and the target residual skip mode includes any one of the following: a first residual skip mode; wherein the first residual skip mode is used to characterize that the first sub-block residual coefficient and the second sub-block residual coefficient are subjected to residual skipping; a second residual skip mode; wherein the second residual skip mode is used to characterize that the first sub-block residual coefficient and the second sub-block residual coefficient are not subjected to residual skipping; a third residual skip mode; wherein the third residual skip mode is used to characterize that the first sub-block residual coefficient is subjected to residual skipping, and the second sub-block residual coefficient is not subjected to residual skipping; a fourth residual skip mode; wherein the fourth residual skip mode is used to characterize that the first sub-block residual coefficient is not subjected to residual skipping, and the second sub-block residual coefficient is subjected to residual skipping; The processing unit is used to encode the residual skip flag into a bitstream.
22. A video decoder, characterized in that: The video decoder is used to perform the method according to any one of claims 1-11.
23. A video encoder, characterized in that The video encoder is configured to perform the method according to any one of claims 12 to 19.
24. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and when the program is executed on the computer, the computer is caused to execute the method according to any one of claims 1 to 19.
Citation Information
Patent Citations
Video decoding method using residual information in video coding system, and apparatus thereof
CN113508587A
Non-transitory storage medium
CN113747173A
