Image encoding / decoding method, device, electronic device, and storage medium
The image encoding/decoding method addresses the inefficiencies in existing video coding technologies by analyzing code streams to determine prediction modes and orders, enabling parallel pixel prediction and reducing residual value caching, thus enhancing encoding and decoding efficiency.
Patent Information
- Application Number
- JP2024557706
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-03-29
- Filing Date
- 2023-03-28
- Publication Date
- 2025-04-14
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Existing video coding technologies face challenges in efficiently encoding and decoding large volumes of video data, due to redundant information such as spatial, temporal, visual, and information redundancy.
An image encoding/decoding method that analyzes the code stream of a block to determine a target prediction mode and order, predicting pixels in parallel based on reconstructed values, and reconstructing blocks without caching residual values, thereby improving prediction and decoding efficiency.
The method enhances prediction efficiency by predicting pixels in parallel and reduces cache space requirements, leading to improved encoding and decoding efficiency and accuracy.
Smart Images

Figure 2025510358000001_ABST
Abstract
Description
[Technical field]
[0001] This application claims priority to Chinese Patent Application No. 202210320915.5, filed with the China Patent Office on March 29, 2022, for invention entitled "Image encoding / decoding method, apparatus, electronic device and storage medium," the entire contents of which are incorporated herein by reference.
[0002] The present application relates to the field of image encoding / decoding technology, and in particular to an image encoding / decoding method, device, electronic device, and storage medium. [Background technology]
[0003] A complete image in a video is usually called a "frame", and a video composed of multiple frames in a time series is called a video sequence. A video sequence contains a series of redundant information, such as spatial redundancy, temporal redundancy, visual redundancy, information entropy redundancy, structural redundancy, knowledge redundancy, and importance redundancy. In order to remove as much redundant information as possible in a video sequence and reduce the amount of data representing the video, video coding technology has been proposed to achieve the effects of reducing storage space and saving transmission bandwidth. Video coding technology is also called video compression technology.
[0004] With the development of technology, it is becoming more and more convenient to collect video data, and the scale of the collected video data is becoming larger and larger. Therefore, how to effectively encode and decode video data has become a problem that needs to be solved. Summary of the Invention
[0005] The present application provides an image encoding / decoding method, device, electronic device, and storage medium, and the image encoding / decoding method can improve the efficiency of image encoding / decoding.
[0006] In order to achieve the above object, the present application provides the following technical means. In a first aspect, the present application provides an image decoding method, the method including: analysing a code stream of a block to be decoded to determine a target prediction mode for predicting pixels in the block to be decoded; determining a target prediction order corresponding to the target prediction mode based on the target prediction mode; predicting each pixel in the block to be decoded in the target prediction order according to the target prediction mode; and reconstructing each pixel based on a predicted value of each pixel to obtain a reconstructed block of the block to be decoded.
[0007] According to the image decoding method provided by the present application, when the decoding side predicts pixels in a block to be decoded in a target prediction mode, the decoding side predicts the pixels in the block to be decoded in a target prediction order corresponding to the target prediction mode. In this process, when the decoding side predicts any pixel of the block to be decoded, the pixel for predicting the pixel has already been reconstructed. Therefore, the image decoding method provided by the present application predicts each pixel in the block to be decoded in a target prediction order according to the target prediction mode, and can predict some pixels in the block to be decoded in parallel, thereby improving prediction efficiency for pixels in the block to be decoded. When the decoding side reacquires the reconstruction value based on the prediction value and the residual value, there is no need to cache the residual value, so that the decoding method provided by the embodiment of the present application can not only save cache space for caching the residual value, but also improve decoding efficiency.
[0008] In one possible design form, when predicting any pixel in the block to be decoded in the above-mentioned target prediction order, the pixel for predicting the any pixel has already been reconstructed. By predicting a pixel using the pixel that has been reconstructed, the pixel used for prediction during the decoding process can be made to match the pixel used for prediction during the encoding process, thereby reducing the decoding error, making the predicted value of the pixel during the decoding process more accurate, and improving the decoding accuracy.
[0009] In another possible design form, when the target prediction mode indicates that each pixel in the block to be decoded is predicted dot-by-dot in a target prediction order, predicting each pixel in the block to be decoded in a target prediction order according to the target prediction mode includes predicting each pixel in the block to be decoded dot-by-dot along a direction indicated by the target prediction order according to the target prediction mode, where if the target prediction mode is a first target prediction mode, the target prediction order is a first prediction order, and if the target prediction mode is a second target prediction mode, the target prediction order is a second prediction order, and the first prediction order and the second prediction order are different.
[0010] In other words, different prediction modes correspond to different prediction orders.In this way, when encoding on the encoding side, by selecting appropriate prediction orders for different prediction modes, the difference between the pixels in the encoding target block and the predicted value can be reduced, so that the encoding target block can be encoded with fewer bits, and accordingly, the decoding side decodes fewer bits, and the decoding efficiency is improved.Therefore, the decoding method provided by this possible design can further improve the decoding efficiency of images.
[0011] In another possible design, for a block to be decoded having a first size, the target prediction mode predicts the block to be decoded in a third prediction order, and for a block to be decoded having a second size, the target prediction mode predicts the block to be decoded in a fourth prediction order, where the third prediction order and the fourth prediction order are different.
[0012] In other words, when the size of the block to be decoded is different, if the pixel in the block to be decoded is predicted using the same prediction mode, the prediction order may be different.In this way, when encoding on the encoding side, by selecting an appropriate prediction order according to the size of the block to be encoded, the difference between the pixel in the block to be encoded and the predicted value can be reduced, so that the block to be encoded can be encoded with fewer bits, and accordingly, the number of bits to be decoded on the decoding side is reduced, and the decoding efficiency is improved.Therefore, the decoding method provided by this possible design form can further improve the decoding efficiency of images.
[0013] In one possible design form, when the target prediction mode indicates that pixels in each sub-block in the block to be decoded are predicted sequentially in units of sub-blocks of a preset size in the block to be decoded, predicting each pixel in the block to be decoded in a target prediction order in accordance with the target prediction mode includes sequentially predicting pixels in each sub-block in the block to be decoded along a direction indicated by the target prediction order in accordance with the target prediction mode.
[0014] In another possible design form, the target prediction mode includes a prediction mode for each sub-block in the block to be decoded, and for a first sub-block in the block to be decoded, if the first sub-block includes a first pixel and a second pixel, the prediction mode of the first sub-block is used to predict the first pixel and the second pixel in parallel based on reconstructed pixels surrounding the first sub-block.
[0015] According to the two possible design forms, when the decoding side predicts a subblock, the decoding side can predict multiple pixels in the subblock in parallel based on the reconstructed pixels around the subblock, that is, such a prediction mode can further improve the prediction efficiency of the decoding side for the block to be decoded. Because the decoding side does not need to cache the residual value when obtaining the reconstruction value based on the prediction value and the residual value, the decoding method provided by the two possible design forms further saves cache space and improves the decoding efficiency.
[0016] In another possible design form, reconstructing each pixel based on the predicted value of each pixel to obtain a reconstructed block of the block to be decoded includes: inverse quantizing a first residual block of the block to be decoded obtained by analyzing the code stream of the block to be decoded based on an inverse quantization parameter of each pixel in the block to be decoded and an inverse quantization preset array obtained by analyzing the code stream of the block to be decoded to obtain a second residual block; and reconstructing each pixel based on the predicted value of each pixel and the second residual block to obtain a reconstructed block.
[0017] This possible design can perform inverse quantization according to a preset inverse quantization array, and reduce multiplication during the inverse quantization process. Because multiplication takes time, reducing the multiplication can improve the calculation efficiency of the inverse quantization process, that is, the inverse quantization of the first residual block of the block to be decoded can be efficiently realized, so that the decoding method provided by this possible design can further improve the decoding efficiency of the image.
[0018] In one possible design form, analyzing the code stream of the block to be decoded includes analyzing the code stream of the block to be decoded using a variable code length decoding scheme to obtain a coding code length (CL) for encoding each value in the residual block corresponding to the block to be decoded and a first residual block.
[0019] According to this possible design, the residual block and CL of the block to be decoded are coded by fewer bits on the coding side, so that the corresponding bits to be decoded on the decoding side are reduced, and the decoding efficiency is improved. Therefore, the decoding method provided by this possible design can further improve the decoding efficiency of the image.
[0020] In a second aspect, the present application provides an image encoding method, the method including: determining a target prediction mode for a block to be encoded and determining a target prediction order corresponding to the target prediction mode; predicting each pixel in the block to be encoded in the target prediction order according to the target prediction mode; determining a residual block of the block to be encoded based on a predicted value of each pixel; and encoding the residual block in the target prediction order to obtain a code stream of the block to be encoded.
[0021] According to the image coding method provided by the present application, when the coding side predicts pixels in the coding target block in a target prediction mode, the coding side predicts the pixels in the coding target block in a target prediction order corresponding to the target prediction mode. In this process, when the coding side predicts any pixel in the coding target block, the pixel for predicting the pixel has already been reconstructed. Therefore, the image coding method provided by the present application predicts each pixel in the coding target block in a target prediction order according to the target prediction mode, and can predict some pixels in the coding target block in parallel, thereby improving prediction efficiency for pixels in the coding target block. Since the coding side does not need to cache the residual value when re-obtaining the reconstruction value based on the prediction value and the residual value, the coding method provided by the embodiment of the present application can not only save cache space for caching the residual value, but also improve coding efficiency.
[0022] In one possible design form, when predicting any pixel in the current block to be coded in the target prediction order, the pixels for predicting the pixel have already been reconstructed.
[0023] In another possible design form, when the target prediction mode indicates that each pixel in the block to be coded is predicted dot-by-dot in a target prediction order, predicting each pixel in the block to be coded in a target prediction order according to the target prediction mode includes predicting each pixel in the block to be coded dot-by-dot along a direction indicated by the target prediction order according to the target prediction mode. Wherein, when the target prediction mode is a first target prediction mode, the target prediction order is a first prediction order, and when the target prediction mode is a second target prediction mode, the target prediction order is a second prediction order, which are different from the first prediction order and the second prediction order. In other words, different prediction modes correspond to different prediction orders.
[0024] In another possible design form, for a block to be coded having a first size, the target prediction mode predicts the block to be coded with a third prediction order. For a block to be coded having a second size, the target prediction mode predicts the block to be coded with a fourth prediction order, where the third prediction order is different from the fourth prediction order. In other words, when the size of the block to be coded is different, the prediction order may be different when the same prediction mode is used to predict pixels in the block to be coded.
[0025] In another possible design form, when the target prediction mode indicates sequential prediction for pixels of each sub-block in the block to be encoded, with sub-blocks of a preset size in the block to be encoded as units, predicting each pixel in the block to be encoded in a target prediction order in accordance with the target prediction mode includes sequential prediction for pixels of each sub-block in the block to be encoded along a direction indicated by the target prediction order in accordance with the target prediction mode.
[0026] In another possible design form, the target prediction mode includes a prediction mode for each sub-block in the block to be encoded, and for a first sub-block in the block to be encoded, if the first sub-block includes a first pixel and a second pixel, the prediction mode of the first sub-block is used to predict the first pixel and the second pixel in parallel based on reconstructed pixels surrounding the first sub-block.
[0027] In another possible design form, before encoding the residual block in a target prediction order to obtain a code stream of the block to be encoded, the method includes determining a quantization parameter QP for each pixel in the block to be encoded. The residual block to be encoded is quantized based on the QP of each pixel and the quantization preset array to obtain a first residual block. Thus, encoding the residual block in the target prediction order to obtain a code stream of the block to be encoded includes encoding the first residual block in the target prediction order to obtain a code stream of the block to be encoded.
[0028] In another possible design form, encoding the first residual block in the target prediction order to obtain a code stream for the block to be encoded includes encoding the first residual block in the target prediction order and using a variable code length encoding scheme to obtain a code stream for the block to be encoded.
[0029] Since the image encoding method provided by the second aspect and any of its possible design forms corresponds to the image decoding method provided by the first aspect and any of its possible design forms, it is understood that the beneficial effects of the technical means provided by the second aspect and any of its possible design forms refer to the description of the beneficial effects of the corresponding method in the first aspect, and redundant description will be omitted here.
[0030] In a third aspect, the present application provides an image decoding method, the method including: analyzing a code stream of a block to be decoded, to obtain an inverse quantization parameter for each pixel in the block to be decoded and a first residual block of the block to be decoded; inverse quantizing the first residual block based on a QP indicated by the inverse quantization parameter for each pixel and an inverse quantization preset array to obtain a second residual block; and reconstructing the block to be decoded based on the second residual block to obtain a reconstructed block.
[0031] In the image decoding method provided by the present application, in the image decoding process, the quantization processing method realized based on the quantization preset array provided by the present application reduces the multiplication operation in the quantization process. Because the calculation resources occupied by the multiplication operation are high, the calculation resources occupied in the quantization process can be reduced by reducing the multiplication operation, so that the calculation resources on the encoding side can be greatly saved. In addition, because the calculation speed of the multiplication operation is slow, the quantization processing process in the image decoding method is significantly improved in efficiency compared with the prior art, and the image decoding efficiency of the image decoding method is also greatly improved.
[0032] In one possible design form, the analyzing the code stream of the block to be decoded and obtaining the inverse quantization parameter of each pixel in the block to be decoded and the first residual block of the block to be decoded includes: determining a target prediction mode for predicting pixels in the block to be decoded and an inverse quantization parameter of each pixel in the block to be decoded based on the code stream of the block to be decoded; determining a residual scanning order corresponding to the target prediction mode based on the target prediction mode; and analyzing the code stream of the block to be decoded based on the residual scanning order to obtain the first residual block. Wherein, when the target prediction mode is a first target prediction mode, the residual scanning order is a first scanning order, and when the target prediction mode is a second target prediction mode, the residual scanning order is a second scanning order, which are different from the first scanning order and the second scanning order. In other words, different prediction modes correspond to different residual scanning orders.
[0033] In another possible design, for a block to be decoded having a first size, a third scan order is used to analyze the code stream of the block to be decoded in the target prediction mode. For a block to be decoded having a second size, a fourth scan order is used to analyze the code stream of the block to be decoded in the target prediction mode, where the third scan order is different from the fourth scan order. In other words, when the size of the block to be decoded is different, if the pixels in the block to be decoded are predicted using the same prediction mode, the residual scan order for analyzing the code stream of the block to be decoded may be different.
[0034] According to the two possible design forms, when analyzing according to the residual scanning order to obtain the residual block to be decoded, if the prediction block of the block to be decoded is predicted in the same target prediction order as the residual scanning order, the efficiency of reconstructing the reconstruction block of the block to be decoded based on the residual block and the prediction block can be improved, that is, the two possible design forms can further improve the decoding efficiency of the image. In addition, the encoding side can encode the residual block with fewer bits when encoding by selecting a scanning order suitable for the target prediction mode, that is, the block to be encoded is encoded with fewer bits, and accordingly, the bits to be decoded on the decoding side are reduced, and the decoding efficiency is improved. Therefore, the decoding method provided by the possible design forms can further improve the decoding efficiency of the image.
[0035] In another possible design form, in the above inverse quantization preset array, the interval between two adjacent numbers is 1 in the 1st to nth numbers, the interval between two adjacent numbers is 2 in the n+1st to n+mth numbers, and the numerical interval between two adjacent numbers is 2 in the n+k*m+1st to n+k*m+mth numbers. k+1 where n, m are integers greater than 1, and k is a positive integer.
[0036] In another possible design form, inverse quantizing the first residual block based on the QP of each pixel and the quantization preset array to obtain a second residual block includes: determining an amplification parameter corresponding to each pixel in the inverse quantization preset array based on the QP of each pixel; and performing an inverse quantization operation on the first residual block based on the amplification parameter corresponding to each pixel to obtain a second residual block.
[0037] In another possible design form, the inverse quantization of the first residual block based on the QP of each pixel and the quantization preset array to obtain the second residual block includes: determining an amplification parameter and a displacement parameter corresponding to each pixel based on the QP of each pixel and the quantization preset array; and performing an inverse quantization operation on the first residual block based on the amplification parameter and the displacement parameter corresponding to each pixel to obtain the second residual block, where the value of the amplification parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array, and the value of the displacement parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array. 3 The difference between the quotient obtained by dividing by
[0038] According to the above three possible design forms, the multiplication operation in the inverse quantization process can be further reduced based on the previously set inverse quantization preset array. Since the computational resources occupied by the multiplication operation are high, the computational resources occupied by the inverse quantization process can be reduced by reducing the multiplication operation. That is, the inverse quantization processing method realized based on the quantization preset array provided by the present application can greatly save the computational resources on the decoding side. In addition, since the calculation speed of the multiplication operation is slow, the efficiency of the inverse quantization processing process in the image decoding method is greatly improved compared with the prior art. Therefore, the decoding method provided by the possible design forms can further improve the image decoding efficiency.
[0039] In another possible design form, reconstructing the block to be decoded based on the second residual block to obtain a reconstructed block includes inversely transforming the second residual block to reconstruct a residual value block of the block to be decoded, and reconstructing the block to be decoded based on the residual value block to obtain a reconstructed block.
[0040] In another possible design form, reconstructing the block to be decoded based on the second residual block includes predicting each pixel in the block to be decoded in a target prediction order corresponding to the target prediction mode according to a target prediction mode, and reconstructing the block to be decoded based on the predicted value of each pixel and the second residual block to obtain a reconstructed block.
[0041] As can be seen from the above, predicting the block to be decoded based on the target prediction mode provided by the present application can improve prediction efficiency, so that the image decoding efficiency can be further improved by this possible design form.
[0042] In another possible design form, analyzing the code stream of the block to be decoded includes analyzing the code stream of the block to be decoded using a variable code length decoding scheme to obtain an encoding code length CL for encoding each value in the residual block corresponding to the block to be decoded and a first residual block.
[0043] According to this possible design, the residual block and CL of the block to be decoded are coded by the coding side with fewer bits, so that the corresponding bits to be decoded by the decoding side are reduced, and the decoding efficiency is improved. Therefore, the decoding method provided by this possible design can further improve the decoding efficiency of the image.
[0044] In a fourth aspect, the present application provides an image encoding method, the method including: determining a second residual block of a block to be encoded and a quantization parameter QP for each pixel in the block to be encoded; quantizing the second residual block based on the QP for each pixel and the quantization preset array to obtain a first residual block; and encoding the first residual block to obtain a code stream of the block to be encoded.
[0045] In the image coding process according to the image coding method provided by the present application, the quantization processing method implemented according to the quantization preset array provided by the present application reduces the multiplication operation in the quantization process. Because the computational resources occupied by the multiplication operation are high, the computational resources occupied in the quantization process can be reduced by reducing the multiplication operation, thereby greatly saving the computational resources on the coding side. In addition, because the multiplication operation takes time, the calculation efficiency of the quantization process can be improved, and the image coding efficiency of the image coding method is greatly improved.
[0046] In another possible design form, encoding the first residual block to obtain a code stream of the block to be encoded includes: determining a target prediction mode of the block to be encoded and determining a residual scanning order corresponding to the target prediction mode; and encoding the residual block in the residual scanning order to obtain a code stream of the block to be encoded, where if the target prediction mode is a first target prediction mode, the residual scanning order is a first scanning order, and if the target prediction mode is a second target prediction mode, the residual scanning order is a second scanning order, and the first scanning order and the second scanning order are different.
[0047] In another possible design, for a to-be-coded block having a first size, the to-be-coded block is coded using a third scan order in the target prediction mode, and for a to-be-coded block having a second size, the to-be-coded block is coded using a fourth scan order in the target prediction mode, where the third scan order and the fourth scan order are different.
[0048] In another possible design form, the quantization preset array includes an amplification parameter array and a shift parameter array, the amplification parameter array and the shift parameter array include the same number of numerical values, and for an i-th value amp[i] of the amplification parameter array and an i-th value shift[i] of the shift parameter array, shift[i] The inverse quantization preset array consisting of the quotient of amp[i] and amp[i] has the following characteristics: the interval between two adjacent numbers is 1 for the 1st to nth numbers, the interval between two adjacent numbers is 2 for the n+1 to n+mth numbers, and the interval between two adjacent numbers is 2 for the n+k*m+1 to n+k*m+mth numbers. k+1 where n and m are integers greater than 1, and i and k are both positive integers.
[0049] In another possible design form, quantizing the second residual block based on the QP of each pixel and the quantization preset array to obtain the first residual block includes determining an amplification parameter for each pixel in the amplification parameter array based on the QP of each pixel and determining a displacement parameter for each pixel in the displacement parameter array, and performing a quantization operation on the second residual block based on the amplification parameter and the displacement parameter of each pixel to obtain the first residual block.
[0050] In another possible design form, quantizing the second residual block based on the QP of each pixel and the quantization preset array to obtain the first residual block includes: determining an amplification parameter and a displacement parameter corresponding to each pixel based on the QP of each pixel and the quantization preset array; and performing a quantization operation on the second residual block based on the amplification parameter and the displacement parameter corresponding to each pixel to obtain the second residual block, where the value of the amplification parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array, and the value of the displacement parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array. 3 This is the sum of the quotient obtained by dividing by .
[0051] In another possible design form, the second residual block is an original residual value block of the block to be coded, or the second residual block is a residual coefficient block obtained by transforming a residual value block.
[0052] In another possible design form, determining the second residual block of the block to be encoded includes predicting each pixel in the block to be encoded in a target prediction order according to a target prediction mode, and determining the second residual block based on the predicted value of each pixel in the block to be encoded.
[0053] In another possible design form, encoding the first residual block to obtain a code stream of the block to be encoded includes encoding the first residual block using a variable code length encoding scheme to obtain a code stream of the block to be encoded.
[0054] Since the image encoding method provided by the fourth aspect and any of its possible design forms corresponds to the image decoding method provided by the third aspect and any of its possible design forms, it is understood that the beneficial effects of the technical means provided by the fourth aspect and any of its possible design forms refer to the explanation of the beneficial effects of the corresponding method in the third aspect, and redundant explanations will be omitted here.
[0055] In a fifth aspect, the present application provides an image encoding method, the method including: determining a residual block corresponding to a block to be encoded; and encoding the residual block using a variable length code encoding scheme to obtain a code stream of the block to be encoded.
[0056] According to the coding method provided by the present application, when the coding side codes the residual block of the coding target block by a variable code length coding method such as the degree-convertible exponential Columbus coding algorithm, the coding side can adaptively code smaller residual values with fewer bits, thereby saving bits and further increasing the compression ratio of image coding, and the coding method provided by the present application can also improve the coding efficiency.
[0057] In one possible design form, the variable code length encoding scheme includes an order-convertible exponential Columbus encoding scheme, and encoding the residual block using the variable code length encoding scheme to obtain a code stream for the block to be encoded includes determining an attribute type for each pixel in the block to be encoded; for a first value corresponding to a third pixel of the block to be encoded in the residual block, determining a target order for encoding the first value based on the preset policy and the attribute type of the third pixel; and encoding the first value using an exponential Columbus encoding algorithm of the target order to obtain a code stream.
[0058] In another possible design form, the variable code length encoding scheme includes a preset order exponential Columbus encoding scheme, and encoding the residual block using the variable code length encoding scheme to obtain a code stream for the block to be encoded includes, for a first value in the residual block corresponding to a third pixel of the block to be encoded, encoding the first value using a preset order exponential Columbus encoding algorithm to obtain a code stream.
[0059] The two possible design forms implement variable-length coding of the residual values in the residual block by a degree-convertible or preset-order exponential Columbus coding scheme, which can adaptively code smaller residual values with fewer bits, thereby saving bits.
[0060] In another possible design, the method includes determining a syntax element corresponding to the residual block, the syntax element including an encoding code length CL for encoding each value in the residual block, and encoding the CL for each value using a variable code length encoding scheme to obtain a codestream.
[0061] In another possible design form, the variable code length encoding scheme includes an order-convertible exponential Columbus encoding scheme, and for any value in the residual block, encoding the CL of each value using the variable code length encoding scheme to obtain a codestream includes determining a target order for encoding the CL of any value, and encoding the CL of any value using the target order exponential Columbus encoding algorithm to obtain a codestream.
[0062] The two possible design forms realize variable length coding of the CL in the residual block by a degree-convertible or preset-order exponential Columbus coding scheme, which can adaptively code smaller CL with fewer bits, thereby saving bits.
[0063] In another possible design form, for any value in the residual block, encoding the CL of each value using the above variable length code encoding scheme to obtain a code stream includes: if the CL of any value is less than or equal to a threshold, encoding the CL of any value using a predetermined number of bits; and if the CL of any value is greater than the threshold, encoding the CL of any value using truncated unary coding to obtain a code stream.
[0064] The possible design form realizes variable length coding of the CL of the residual value in the residual block by fixed length coding and truncated unary coding, and the coding method can adaptively code smaller CL with fewer bits, thereby saving bits.
[0065] In another possible design form, the residual block is an original residual value block of the block to be coded, or the residual block is a residual coefficient block obtained by transforming the original residual value block, or the residual block is a quantized coefficient block obtained by quantizing the residual coefficient block.
[0066] In another possible design form, when the residual block is an original residual value block of the block to be encoded, determining the residual block corresponding to the block to be encoded includes determining a target prediction mode of the block to be encoded and determining a residual scanning order corresponding to the target prediction mode, predicting each pixel in the block to be encoded in a target prediction order according to the target prediction mode, and determining the residual block based on the predicted value of each pixel in the block to be encoded.
[0067] According to this possible design form, predicting the block to be encoded based on the target prediction mode provided by the present application can improve prediction efficiency, and therefore, according to this possible design form, the encoding efficiency of the image can be further improved.
[0068] In another possible design form, when the residual block is a quantized coefficient block obtained by quantizing a residual coefficient block, before encoding the residual block using the variable-length code encoding method to obtain a code stream of a block to be encoded, the method further includes: determining a quantization parameter QP of each pixel in the block to be encoded; and quantizing the residual value block to be encoded based on the QP of each pixel and a quantization preset array to obtain a residual block.
[0069] This possible design form enables quantization of the residual value block to be encoded to be achieved with fewer multiplication operations, and enables efficient quantization of the residual value block to be encoded, so that the encoding method provided by this possible design form can further improve the encoding efficiency of images.
[0070] As a sixth aspect, the present application provides an image decoding method, the method including: analyzing a code stream of a block to be decoded using a variable code length decoding scheme to obtain an encoding code length CL for encoding each value in a residual block corresponding to the block to be decoded; determining the residual block based on the CL for encoding each value; and reconstructing the block to be decoded based on the residual block to obtain a reconstructed block.
[0071] In another possible design form, the variable code length decoding scheme includes an order-convertible or preset order exponential Columbus decoding scheme, and analyzing the code stream of the block to be decoded using the variable code length decoding scheme to obtain an encoding code length CL for encoding each value in the residual block corresponding to the block to be decoded includes: determining a target order for analyzing the CL for encoding each value in the residual block; and analyzing the code stream using an exponential Columbus decoding algorithm of the target order to obtain a CL for encoding each value in the residual block.
[0072] In another possible design form, analyzing the code stream of the block to be decoded using the above variable code length decoding scheme to obtain a coding code length CL for encoding each value in the residual block corresponding to the block to be decoded includes: if the number of bits of the CL for encoding any value in the residual block is a predetermined number, analyzing the code stream based on a fixed length decoding policy to obtain a CL for encoding any value; if the number of bits of the CL for encoding any value in the residual block is greater than the predetermined number, analyzing the code stream based on a truncated unary coding rule to obtain a CL for encoding any value.
[0073] In another possible design form, determining the residual block based on the CL for encoding each of the values includes: determining a bit group corresponding to each pixel in the block to be decoded in the code stream based on the CL for encoding each of the values; determining an attribute type for each pixel in the block to be decoded; for a first bit group corresponding to a third pixel in the block to be decoded, determining a target order for parsing the first bit group based on the preset policy and the attribute type of the third pixel; and parsing the first bit group using an exponential Columbus decoding algorithm of the target order to obtain a residual block.
[0074] In another possible design form, determining the residual block based on the CL for encoding each of the values includes: determining a group of bits in the code stream corresponding to each pixel in the block to be decoded based on the CL for encoding each of the values; and for a first group of bits corresponding to a third pixel in the block to be decoded, analyzing the first group of bits using an exponential Columbus decoding algorithm of a preset order to obtain the residual block.
[0075] In another possible design form, reconstructing the block to be decoded based on the residual block to obtain a reconstructed block includes reconstructing a residual value block of the block to be decoded by performing inverse quantization and inverse transformation on the residual block or inverse quantizing the residual block, and reconstructing the block to be decoded based on the residual value block to obtain a reconstructed block.
[0076] In another possible design form, reconstructing the block to be decoded based on the residual block to obtain a reconstructed block includes: determining a target prediction mode for predicting pixels in the block to be decoded based on a code stream of the block to be decoded; determining a target prediction order corresponding to the target prediction mode based on the target prediction mode; predicting each pixel in the block to be decoded in the target prediction order according to the target prediction mode; and reconstructing the block to be decoded based on the predicted value of each pixel in the block to be decoded and the residual block to obtain a reconstructed block.
[0077] In another possible design form, inverse quantizing the residual block includes inverse quantizing the residual block based on an inverse quantization parameter for each pixel in the block to be decoded obtained by analyzing a code stream of the block to be decoded and an inverse quantization preset array.
[0078] Since the image decoding method provided by the sixth aspect and any of its possible design forms corresponds to the image encoding method provided by the fifth aspect and any of its possible design forms, it is understood that the beneficial effects of the technical means provided by the sixth aspect and any of its possible design forms refer to the explanation of the beneficial effects of the corresponding methods in the fifth aspect, and redundant explanations will be omitted here.
[0079] As a seventh aspect, the present application provides an image decoding device. The decoding device may be a video decoder or a device including a video decoder. The decoding device includes modules for implementing the method according to any of the first, third, or sixth aspects. The decoding device has a function for implementing the operations in the examples of the related method. The functions may be implemented by hardware, or may be implemented by causing the hardware to execute corresponding software. The hardware or software includes one or more modules corresponding to the functions. The beneficial effects thereof may be described by referring to the corresponding methods, and redundant description will be omitted here.
[0080] As an eighth aspect, the present application provides an image encoding device. The encoding device may be a video encoder or a device including a video encoder. The encoding device includes modules for implementing the method according to any of the feasible aspects of the second, fourth, or fifth aspects. The encoding device has a function for implementing the operations in the examples of the related method. The functions may be implemented by hardware, or may be implemented by causing the hardware to execute corresponding software. The hardware or software includes one or more modules corresponding to the functions. The beneficial effects thereof may be described by referring to the corresponding method, and redundant description will be omitted here.
[0081] In a ninth aspect, the present application provides an electronic device comprising a processor and a memory, the memory being adapted to store computer instructions, and the processor being adapted to retrieve and execute the computer instructions from the memory to realize a method in any of the possible aspects of the first to sixth aspects. For example, the electronic device may be a video encoder, or may be a device equipped with a video encoder. For example, the electronic device may be a video decoder or a device equipped with a video decoder.
[0082] In a tenth aspect, the present application provides a computer readable storage medium having stored thereon a computer program or instructions which, when executed by a processor, realises a method in any of the possible implementations of the first to sixth aspects.
[0083] In an eleventh aspect, the present application provides a computer program product, the computer program product including instructions, which when executed on a computing device or processor, cause the computing device or processor to execute the instructions to implement a method in any of the possible implementations of the first to sixth aspects.
[0084] In a twelfth aspect, the present application provides a chip, the chip comprising a memory and a processor, the memory being adapted to store computer instructions, and the processor being adapted to retrieve and execute the computer instructions from the memory to implement a method in any of the possible aspects of the first to sixth aspects.
[0085] In a thirteenth aspect, the present application provides an image encoding / decoding system, comprising an encoding side and a decoding side, the decoding side being used to realize a corresponding decoding method provided by the first, second or sixth aspect, and the encoding side being used to realize the corresponding encoding method.
[0086] The present application may be further combined to provide more embodiments in addition to the embodiments provided by each of the above aspects. Alternatively, any possible implementation form of any of the above aspects may be applied to other aspects as long as it is not inconsistent, thereby obtaining new embodiments. For example, any of the image decoding methods provided by the first, third and sixth aspects may be combined with two aspects or three aspects without inconsistency to obtain a new image decoding method. [Brief description of the drawings]
[0087] The drawings described herein constitute a part of this application for the purpose of further understanding of the present application. The exemplary embodiments and the description thereof are for the purpose of interpreting the present application and are not to be construed as unduly limiting the present application.
[0088] [Figure 1]FIG. 1 is a schematic diagram of the architecture of an encoding / decoding system 10 applied to an embodiment of the present application. [Diagram 2] FIG. 2 is a schematic block diagram of an example of an encoder 112 for implementing the method of the present embodiment. [Diagram 3] FIG. 3 is a schematic diagram of the corresponding relationship between images, parallel encoding means, independent encoding means and encoding means provided by an embodiment of the present application. [Figure 4] FIG. 4 is a schematic flow chart of an encoding process provided by an embodiment of the present application. [Diagram 5] FIG. 5 is a schematic block diagram of an example of a decoder 122 for implementing the method of the present embodiment. [Figure 6a] FIG. 6a is a schematic flow chart of an image encoding method provided by an embodiment of the present application. [Figure 6b] FIG. 6b is a schematic flowchart of an image decoding method provided by an embodiment of the present application. [Figure 6c] FIG. 6c is a schematic flow chart of another image encoding method provided by an embodiment of the present application. [Figure 7a] FIG. 7a is a schematic diagram of a prediction order provided by an embodiment of the present application. [Figure 7b] FIG. 7b is a schematic diagram of another prediction order provided by an embodiment of the present application. [Figure 7c-1] FIG. 7c-1 is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7c-2] FIG. 7c-2 is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7d-1] FIG. 7d-1 is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7d-2] FIG. 7d-2 is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7d-3] FIG. 7d-3 is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7e] FIG. 7e is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7f] FIG. 7f is a schematic diagram of yet another prediction order provided by an embodiment of the present application. [Figure 7g] FIG. 7g is a schematic diagram of yet another sequence provided by an embodiment of the present application. [Figure 8] FIG. 8 is a schematic flowchart of another image decoding method provided by an embodiment of the present application. [Figure 9a] FIG. 9a is a schematic flow chart of yet another image encoding method provided by an embodiment of the present application. [Figure 9b] FIG. 9b is a schematic flowchart of another image decoding method provided by an embodiment of the present application. [Figure 10a] FIG. 10a is a schematic flow chart of yet another image encoding method provided by an embodiment of the present application. [Figure 10b] FIG. 10b is a schematic flowchart of another image decoding method provided by an embodiment of the present application. [Figure 11] FIG. 11 is a schematic diagram of the structure of a decoding device 1100 provided by an embodiment of the present application. [Figure 12] FIG. 12 is a schematic diagram of the structure of an encoding device 1200 provided by an embodiment of the present application. [Figure 13] FIG. 13 is a schematic diagram of the structure of a decoding device 1300 provided by an embodiment of the present application. [Figure 14] FIG. 14 is a schematic diagram of the structure of an encoding device 1400 provided by an embodiment of the present application. [Figure 15] FIG. 15 is a schematic diagram of the structure of an encoding device 1500 provided by an embodiment of the present application. [Figure 16] FIG. 16 is a schematic diagram of the structure of a decoding device 1600 provided by an embodiment of the present application. [Figure 17] FIG. 17 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0089] In the following, in order to facilitate a clearer understanding of the embodiments of the present application, some of the terms or techniques related to the embodiments of the present application will be described.
[0090] 1) Prediction mode A combination of prediction methods used to predict the predicted value of each pixel in a current image block (e.g., an image block to be coded (hereinafter simply referred to as a block to be coded) or an image block to be decoded (hereinafter simply referred to as a block to be decoded)) is called a prediction mode. Here, predicting different pixels in the current image block may use different prediction methods or the same prediction method, and the prediction methods used to predict all pixels in the current image block may be together called the (or corresponding) prediction mode of the current image block.
[0091] Preferably, the prediction modes include a dot-by-dot prediction mode, an intra prediction mode, a block copy mode, and an original value mode (i.e., a mode in which a reconstructed value of a fixed bit width is decoded as is), and the like.
[0092] Exemplarily, the dot-by-dot prediction mode refers to a prediction mode in which the reconstruction value of the neighboring pixels around the prediction target pixel is used as the prediction value of the prediction target pixel. The dot-by-dot prediction mode includes one or more combinations of prediction methods such as vertical prediction, horizontal prediction, vertical average prediction, and horizontal average prediction.
[0093] Here, vertical prediction is to obtain a predicted value (PointPredData) of a prediction target pixel by using a reconstructed value of a pixel on the upper side of the prediction target pixel (which may be an adjacent upper side, or may be a non-adjacent but close upper side). In the embodiment of the present application, a prediction method using vertical prediction is called a T prediction method. As an example, the reconstructed value of an upper adjacent pixel of the prediction target pixel is set as the predicted value of the prediction target pixel.
[0094] Horizontal prediction is a method of obtaining a predicted value of a pixel to be predicted using a reconstructed value of a pixel to the left of the pixel to be predicted (which may be an adjacent pixel to the left, or a non-adjacent pixel to the left but close to the left). In the embodiment of the present application, a prediction method using horizontal prediction is called an L prediction method. As an example, the reconstructed value of a pixel adjacent to the left of the pixel to be predicted is used as the predicted value of the pixel to be predicted.
[0095] The vertical average prediction is to obtain a predicted value of a pixel to be predicted by using the reconstructed values of the pixels above and below the pixel to be predicted. In the embodiment of the present application, a prediction method using the vertical average prediction is called a TB prediction method. As an example, the predicted value of the pixel to be predicted is the average value of the reconstructed value of the pixel to be predicted vertically above and the reconstructed value of the pixel to be predicted vertically below.
[0096] The horizontal average prediction is to obtain a predicted value of a prediction target pixel by using reconstructed values of pixels on the left and right sides of the prediction target pixel. In the embodiment of the present application, a prediction method using the horizontal average prediction is called a RL prediction method. As an example, the average value of the reconstructed value of the horizontal left adjacent pixel and the reconstructed value of the horizontal right adjacent pixel of the prediction target pixel is set as the predicted value of the prediction target pixel.
[0097] Illustratively, the intra prediction mode is a prediction mode in which a reconstructed value of a pixel in an adjacent block surrounding a block to be predicted is used as a predicted value.
[0098] Exemplarily, the block copy mode is a prediction mode in which the reconstructed values of pixels of a (decoded) block (not necessarily adjacent) are used as prediction values.
[0099] Exemplarily, the original value mode is a mode in which a reconstructed value of a fixed bit width is decoded as is, that is, a no-reference prediction mode.
[0100] 2) Residual coding mode The manner of coding the residual (i.e., the residual block, which is a block of residual values for each pixel in the current image block) of a current image block (e.g., a block to be coded or decoded) is called a residual coding mode, which may include a residual skip coding mode and a normal residual coding mode.
[0101] There is no need to code (decode) the residual coefficients in the residual skip coding mode, in which the residual values of the pixels in the current image block are all zero, and the reconstructed value of each pixel is equal to the predicted value of that pixel.
[0102] The residual coefficients need to be coded (decoded) in a normal residual coding mode, where the residual values of the pixels in the current image block are all non-zero and the reconstructed value of each pixel can be obtained based on the prediction value and the residual value of that pixel.
[0103] In one example, the residual coefficient of a pixel may be equal to the residual value of this pixel. In another example, the residual coefficient of a pixel may be obtained by processing the residual value of this pixel.
[0104] 3) Quantization and dequantization In the process of image coding, in order to compress an image, a residual block of a block to be coded is usually quantized, or a residual coefficient block obtained by processing the residual block is quantized, so that the quantized residual block or the residual coefficient block can be coded with fewer bits. It is understood that the residual block is a residual value block obtained based on the original pixel block and the predicted block of the block to be coded, and the residual coefficient block is a coefficient block obtained by converting the residual block.
[0105] For example, the encoding device may quantize the residual block, and the encoding device may divide each residual value in the residual block of the current block by the quantization coefficient to reduce the residual value in the residual block. In this manner, the quantized and reduced residual value may be encoded with fewer bits than the unquantized residual value, thereby achieving compression encoding of the image.
[0106] As such, to reconstruct an image block from a compression-encoded codestream, the decoder can dequantize the residual block or residual coefficient block parsed from the codestream, thereby reconstructing an unquantized residual block or residual coefficient block corresponding to the image block, and then the decoder reconstructs the image block based on the reconstructed residual block or residual coefficient block to obtain a reconstructed block of the image.
[0107] As an example, the decoding device analyzes a quantized residual block of a block to be decoded from a code stream, and the encoding device can inversely quantize the residual block. Specifically, the encoding device multiplies each residual value in the analyzed residual block by a quantization coefficient to reconstruct the residual value of the non-quantized residual block corresponding to the block to be decoded, and obtains a reconstructed residual block. Here, the quantization coefficient is a quantization coefficient used when the encoding device quantizes the residual block of the block to be decoded when encoding the block to be decoded. In this way, the decoding device realizes reconstruction of the block to be decoded based on the residual block reconstructed after inverse quantization, and obtains a reconstructed block of the block to be decoded.
[0108] 4) Other terms The term "at least one (kind)" in the examples of the present application includes one (kind) or multiple (kinds). "Multiple (kinds)" means two (kinds) or more than two (kinds). For example, at least one of A, B, and C includes A alone, B alone, A and B simultaneously, A and C simultaneously, B and C simultaneously, and A, B, and C simultaneously. In the description of the present application, unless otherwise stated, " / " means "or", for example, A / B means A or B. The term "and / or" in the present application is only for describing the related relationship of related objects, and indicates that three kinds of relationships can exist, for example, A and / or B can indicate three situations: A alone, A and B simultaneously, and B alone. "Multiple" means two or more. In addition, in order to clearly describe the technical means according to the embodiments of the present application, the embodiments of the present application use the words "first" and "second" to distinguish between identical or similar items having substantially the same functions and actions. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily limit "different".
[0109] A system architecture applied to the embodiments of the present application will now be described.
[0110] Referring to Fig. 1, Fig. 1 shows an architecture schematic diagram of an encoding / decoding system 10 applied to an embodiment of the present application. As shown in Fig. 1, the encoding / decoding system 10 may include a source device 11 and a target device 12. Here, the source device 11 is used to encode an image, so the source device 11 may be called an image encoding device or a video encoding device. The target device 12 is used to decode the encoded image data generated by the source device 11, so the target device 12 may be called an image decoding device or a video decoding device.
[0111] The specific form of the source device 11 and the target device 12 may be various devices and is not limited in the embodiment of the present application. For example, the source device 11 and the target device 12 may be a desktop computer, a mobile computing device, a notebook (e.g., laptop) computer, a tablet computer, a set-top box, a mobile phone such as a so-called "smartphone", a television, a camera, a display device, a digital media player, a video game console, an in-vehicle computer, or other similar devices.
[0112] 1 may be two separate devices. Alternatively, the source device 11 and the target device 12 may be the same device, that is, the source device 11 or a corresponding function and the target device 12 or a corresponding function may be integrated into the same device.
[0113] Communication is possible between the source device 11 and the target device 12. For example, the target device 12 can receive encoded image data from the source device 11. As an example, one or more communication media may be included between the source device 11 and the target device 12 for transmitting the encoded image data. The one or more communication media may include a router, a switch, a base station, or other devices that facilitate communication from the source device 11 to the target device 12, and is not limited to the embodiments of the present application.
[0114] As shown in FIG. 1, the source device 11 includes an encoder 112. Preferably, the source device 11 may also include an image preprocessor 111 and a communication interface 113. Here, the image preprocessor 111 is used to perform preprocessing on the received image to be encoded, and for example, the preprocessing performed by the image preprocessor 111 may include cropping, color format conversion (e.g., converting from RGB format to YUV format), color correction, or noise removal, etc. The encoder 112 is used to receive the image preprocessed by the image preprocessor 111, process the preprocessed image using an associated prediction mode, and provide encoded image data. In some embodiments, the encoder 112 is used to perform the encoding process in various embodiments described below. The communication interface 113 may be used to transmit the encoded image data to the target device 12 or other devices (e.g., memory) for storage or direct reconstruction, and the other devices may be any devices for decoding or storage. The communication interface 113 may encapsulate the encoded image data into a suitable format before transmitting it.
[0115] Preferably, the above image pre-processor 111, encoder 112 and communication interface 113 may be hardware components in the source device 11, or may be software programs in the source device 11, which are not limited in the embodiments of the present application.
[0116] The target device 12 includes a decoder 122. Preferably, the target device 12 may also include a communication interface 121 and an image post-processor 123. Here, the communication interface 121 is used to receive encoded image data from the source device 11 or other source devices, such as storage devices. The communication interface 121 may also decapsulate data transmitted by the communication interface 113 to obtain encoded image data. The decoder 122 is used to receive the encoded image data and output decoded image data (also referred to as reconstructed image data or reconstructed image data). In some embodiments, the decoder 122 is used to perform the decoding process in various embodiments described below. The image post-processor 123 is used to perform post-processing on the decoded image data to obtain post-processed image data. The post-processing performed by the image post-processor 123 may include color format conversion (e.g., from YUV format to RGB format), color correction, polishing or resampling, or any other processing, and the image post-processor 123 is used to transfer the post-processed image data to a display device for display.
[0117] Preferably, the above communication interface 121, decoder 122 and image post-processor 123 may be hardware components in the target device 12, or may be software programs in the target device 12, which are not limited in the embodiments of the present application.
[0118] Next, the configurations of the encoder 112 and the decoder 122 in FIG. 1 will be briefly described.
[0119] Referring to Fig. 2, Fig. 2 shows a schematic block diagram of an example of an encoder 112 for implementing the method of the embodiment of the present application. As shown in Fig. 2, the encoder 112 includes a prediction processing means 201, a residual calculation means 202, a residual transformation means 203, a quantization means 204, an encoding means 205, an inverse quantization means (also called dequantization means) 206, a residual inverse transformation means 207, a reconstruction means (or called reconstruction means) 208, and a filter means 209. Preferably, the encoder 112 can also include a buffer and a decoded image buffer. Here, the buffer is used to buffer the reconstructed block (or to be the reconstructed block) output from the reconstruction means 208, and the decoded image buffer is used to buffer the filtered image block output from the filter means 209.
[0120] In one example, the input of the encoder 112 is an image block of the image to be encoded (i.e., a block to be encoded or an encoding means). As another example, the input of the encoder 112 is an image to be encoded, and the encoder 112 may include a dividing means (not shown in FIG. 2) for dividing the image to be encoded into a plurality of image blocks. The encoder 112 is used to perform encoding on a block-by-block basis to complete the encoding of the image to be encoded. For example, the encoder 112 performs an encoding process on each image block to complete the encoding of the image to be encoded.
[0121] In one example, a method for dividing an image to be encoded into a plurality of image blocks includes the following steps.
[0122] Step 1: Divide one frame of image into one or more parallel encoding means that do not overlap with each other, and there is no dependency between the parallel encoding means, so that they can be encoded and decoded in parallel / independently.
[0123] Step 2: For each parallel encoding means, the encoding side can be divided into one or more independent encoding means that do not overlap with each other, and each independent encoding means does not need to depend on each other, but can share some of the header information of the parallel encoding means.
[0124] Step 3: The encoding side can divide each independent encoding means into one or more non-overlapping encoding means. Here, when the independent encoding means is divided into multiple non-overlapping encoding means, the division method can be horizontal equal division, vertical equal division, or horizontal and vertical equal division. Of course, the concrete implementation is not limited to this. Each encoding means in the independent encoding means can depend on each other, that is, they can refer to each other in the process of performing the prediction step.
[0125] The width of the encoding means is w_cu and the height is h_cu, preferably the width is greater than the height (unless it is an edge region). In general, the encoding means is a fixed w_cu×h_cu, and both w_cu, h_cu may be 2N (N is 0 or more), such as 16×4, 8×4, 16×2, 8×2, 8×2, 4×2, 8×1, 4×1, etc.
[0126] The coding means may include three components, luma Y, chroma Cb, chroma Cr (or red R, green G, blue B), or only one of them. If it includes three components, the size of some components may be completely the same or different, depending on the image input format.
[0127] As shown in Fig. 3, Fig. 3 is a schematic diagram of the corresponding relationship between an image, a parallel encoding means, an independent encoding means and an encoding means. For example, the parallel encoding means 1 and the parallel encoding means 2 in Fig. 3 divide an image according to an image area ratio of 3:1, where the parallel encoding means 1 comprises one independent encoding means divided into four encoding means.
[0128] The prediction processing means 201 receives or acquires the true value of the block to be coded and the reconstructed image data, predicts the block to be coded based on correlation data in the reconstructed image data, and obtains a predicted block of the block to be coded.
[0129] The residual calculation means 202 calculates a residual value between the true value of the block to be coded and a predicted block of the block to be coded, and obtains a residual block. For example, the residual block is obtained by subtracting the pixel value of the predicted block from the true pixel value of the block to be coded on a pixel-by-pixel basis.
[0130] In one example, the residual transform means 203 is used to determine residual coefficients based on the residual block. Preferably, this process includes transforming the residual block, such as discrete cosine transform (DCT) or discrete sine transform (DST), to obtain transform coefficients in a transform domain, where the transform coefficients may also be called transform residual coefficients or residual coefficients, and the residual coefficients can represent the residual block in a transform domain. Of course, the encoder 112 may not include a step of residual transform in the process of encoding the block to be encoded.
[0131] The quantization means 204 quantizes the transform coefficients or residual values by applying scalar quantization or vector quantization to obtain quantized residual coefficients (or quantized residual values). The quantization process can reduce a bit depth associated with some or all of the residual coefficients. For example, a p-bit transform coefficient may be truncated to a q-bit transform coefficient during quantization, where p is greater than q. The degree of quantization can be modified by adjusting a quantization parameter (QP). For example, for scalar quantization, fine or coarse quantization is achieved by applying different scales. A small quantization step size corresponds to fine quantization, and a large quantization step size corresponds to coarse quantization. The appropriate quantization step size can be indicated by QP.
[0132] The encoding means 205 encodes the quantized residual coefficients (or quantized residual values) and outputs the encoded image data (i.e. the encoding result of the current block to be encoded) as an encoded bitstream (also called codestream), which can be transferred to a decoder or can be stored and subsequently transferred to a decoder or used for retrieval. The encoding means 205 is also used to encode syntax elements of the block to be encoded, for example encoding the prediction mode used for the block to be encoded into the codestream.
[0133] In one example, the encoding means 205 encodes the residual coefficients using a semi-fixed length encoding method as a viable method. First, the maximum value of the residual absolute value in a residual block (RB) is defined as modified maximum (mm). The number of encoding bits of the residual coefficients in this RB (the number of encoding bits of the residual coefficients in the same RB is the same), i.e., the encoding code length CL, is determined from the above mm. For example, if the CL of the current RB is 2 and the current residual coefficient is 1, the encoding residual coefficient 1 requires 2 bits, which is shown as 01. In one specific case, if the CL of the current RB is 7, it represents that an 8-bit residual coefficient and a 1-bit code bit are encoded. Here, the method of determining CL is to search for the minimum M value that satisfies the condition that all residuals in the current RB are in the range of [-2^(M-1), 2^(M-1)], and the found M is set as the CL of the current RB. If the current RB has two boundary values, 2^(M-1) and 2^(M-1), at the same time, M should be increased by 1, i.e., all residuals in the current RB should be coded with M+1 bits. If the current RB has only one of the two boundary values, 2^(M-1) and 2^(M-1), the Trailing bit (least significant) should be coded to determine whether it is 2^(M-1) or 2^(M-1). If all residuals in the current RB are neither 2^(M-1) nor 2^(M-1), there is no need to code the Trailing bit.
[0134] Of course, other residual coefficient coding methods can be used, such as the exponential Golomb (Columbus coding algorithm) coding method, the Golomb-Rice (a variant of the Columbus coding algorithm) coding method, the truncated unary coding coding method, the run-length coding method, or direct coding of the original residual values.
[0135] Also, in certain cases, the encoding means 205 may directly encode the original values rather than the residual values.
[0136] The inverse quantization means 206 is used to inverse quantize the quantized residual coefficients (or quantized residual values) to obtain inverse quantized residual coefficients (or inverse quantized residual values), where the inverse quantization is an inverse application of the quantization means 204, for example applying an inverse quantization scheme of the quantization scheme applied by the quantization means 204, based on or using the same quantization step length as the quantization means 204.
[0137] The residual inverse transform means 207 is used to inversely transform (or inversely transform) the dequantized residual coefficients to obtain a reconstructed residual block. Preferably, the inverse transform may include an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST). Thus, the inverse transform values obtained by inversely transforming (or inversely transforming) the dequantized residual coefficients are residual values reconstructed in the pixel domain (also called the sample domain). That is, the block obtained by inversely transforming the dequantized residual coefficient block by the residual inverse transform means 207 is a reconstructed residual block. Of course, if the encoder 112 does not include the residual transform means 203, the encoder 112 may not include the inverse transform step.
[0138] The reconstruction means 208 is used to add the reconstructed residual block to the prediction block to obtain a reconstructed block in the sample domain, and may be an adder. For example, the reconstruction means 208 adds the residual values in the reconstructed residual block to the prediction values of the corresponding pixels in the prediction block to obtain reconstructed values of the corresponding pixels. The reconstructed block output by the reconstruction means 208 may then be used to predict other image blocks to be coded.
[0139] A filter means 209 (or simply called "filter") is used to filter the reconstructed block to obtain a filtered block, thereby smoothing pixel transitions and improving image quality.
[0140] In one example, the encoding process is shown in FIG. 4. Specifically, the encoder determines whether to use a dot-by-dot prediction mode. If the dot-by-dot prediction mode is used, the encoder predicts pixels in the encoding target block based on the dot-by-dot prediction mode to encode the encoding target block, and performs an inverse quantization and reconstruction step on the encoding result to realize the encoding process. If the dot-by-dot prediction mode is not used, the encoder determines whether to use an original value mode. If the original value mode is used, the encoder performs encoding in the original value mode. If the original value mode is not used, the encoder decides to predict and encode using other prediction modes, such as intra prediction mode or block copy mode. Then, if it is determined to perform a residual skip, the encoder performs a reconstruction step on the encoding result as it is. If it is determined not to perform a residual skip, the encoder performs an inverse quantization step on the encoding result to obtain an inverse quantized residual block, and determines whether to use a block copy prediction mode. When it is determined that the block copy prediction mode is used, in one case, if it is determined that a transform skip is performed, a reconstruction step is directly performed on the dequantized residual block, and in another case, if it is determined that a transform skip is not performed, an inverse transform and reconstruction step is performed on the dequantized residual block to realize the encoding process.When it is determined that the block copy mode is not used (in this case, the prediction mode used is an intra prediction mode), an inverse transform and reconstruction step is performed on the dequantized residual block to realize the encoding process.
[0141] Specifically, in the embodiment of the present application, the encoder 112 is used to realize the encoding method described in the following embodiment.
[0142] In one example, the encoding process implemented by the encoder 112 may include the following steps.
[0143] Step 11: The prediction processing means 201 determines a prediction mode, predicts the block to be coded based on the determined prediction mode and a reconstructed block of the coded image block, and obtains a predicted block of the block to be coded. Here, the reconstructed block of the encoded image block is obtained by the inverse quantization means 206, the residual inverse transformation means 207 and the reconstruction means 208 sequentially processing the quantized residual coefficient block of the encoded image block.
[0144] Step 12: The residual calculation means 202 obtains a residual block of the block to be coded based on the prediction block and the original pixel values of the block to be coded.
[0145] Step 13: The residual transform means 203 transforms the residual block to obtain a residual coefficient block.
[0146] Step 14: The quantization means 204 quantizes the residual coefficient block to obtain a quantized residual coefficient block.
[0147] Step 15: The encoding means 205 encodes the quantized residual coefficient block, and encodes related syntax elements (eg, prediction mode, coding mode) to obtain a codestream of the block to be encoded. 5, which shows a schematic block diagram of an example of a decoder 122 for implementing the method of the embodiment of the present application. The decoder 122, for example, receives image data encoded by the encoder 112 (i.e., an encoded bitstream, for example, including an encoded bitstream of an image block and associated syntax elements) to obtain a decoded image block.
[0148] As shown in Fig. 5, the decoder 122 includes a code stream analysis means 301, an inverse quantization means 302, a residual inverse transform means 303, a prediction processing means 304, a reconstruction means 305, and a filter means 306. In some examples, the decoder 122 can perform a decoding process that is substantially the reverse of the encoding process described by the encoder 112 of Fig. 2. Preferably, the decoder 122 includes a buffer and a filtered image buffer, where the buffer is used to buffer the reconstructed image block output by the reconstruction means 305, and the filtered image buffer is used to buffer the filtered image block output from the filter means 306.
[0149] The codestream analysis means 301 decodes the encoded bitstream to obtain quantized residual coefficients (or quantized residual values) and / or decoding parameters (e.g., the decoding parameters include any one or all of inter prediction parameters, intra prediction parameters, filter parameters, and / or other syntax elements performed on the encoding side). The codestream analysis means 301 is also used to transfer the decoding parameters to the prediction processing means 304, so that the prediction processing means 304 performs a prediction process based on the decoding parameters.
[0150] The function of the inverse quantization means 302 may be the same as that of the inverse quantization means 206 of the encoder 112, and is used to inverse quantize the quantized residual coefficients decoded and output by the codestream analysis means 301.
[0151] The function of the residual inverse transform means 303 may be the same as that of the residual inverse transform means 207 of the encoder 112, and is used to inverse transform (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) the dequantized residual coefficients to obtain reconstructed residual values. The block obtained by inverse transform is the residual block of the block to be decoded reconstructed in the pixel domain.
[0152] The functionality of the reconstruction means 305 (eg an adder) may be the same as the functionality of the reconstruction means 208 of the encoder 112 .
[0153] The prediction processing means 304 is used to receive or obtain encoded image data (e.g., the encoded bitstream of the current image block) and reconstructed image data, and the prediction processing means 304 can, for example, receive or obtain associated parameters of the prediction mode and / or information regarding the selected prediction mode (i.e., the above-mentioned decoding parameters) from the code stream analysis means 301, and can also predict the current image block based on the associated data and the decoding parameters in the reconstructed image data to obtain a predicted block of the current image block.
[0154] The reconstruction means 305 is used to add the reconstructed residual block to the prediction block to obtain a reconstructed block of the image to be decoded in the sample domain, for example by adding the residual values in the reconstructed residual block and the prediction values in the prediction block.
[0155] The filter means 306 is used to filter the reconstructed block to obtain a filtered block, which is the decoded image block.
[0156] Specifically, in the embodiment of the present application, the decoder 122 is used to realize a decoding method described in the following embodiment.
[0157] It should be understood that in the encoder 112 and the decoder 122 according to an embodiment of the present application, the processing result of a certain step may be further processed and output to the next step, for example, after a step such as interpolation filtering, motion vector derivation or filtering, an operation such as clip or shift may be performed on the processing result of the corresponding step.
[0158] In one example, the decoding process implemented by the decoder 122 may include the following steps.
[0159] Step 21: The codestream analysis means 301 analyzes the prediction mode and the residual coding mode.
[0160] Step 22: The codestream analyzing means 301 analyzes the quantization-related value (eg, near value (value indicating the quantization step size) or QP value, etc.) based on the prediction mode and the residual coding mode.
[0161] Step 23: The inverse quantization means 302 analyzes the residual coefficients according to the prediction mode and the quantization related values.
[0162] Step 24: The prediction processing means 304 obtains a predicted value for each pixel in the current image block according to the prediction mode.
[0163] Step 25: The residual inverse transform means 303 inverse transforms the residual coefficients to reconstruct the residual values of each pixel in the current image block.
[0164] Step 26: The reconstruction means 305 obtains a reconstruction value for each pixel of the current encoding means based on the prediction value and the residual value thereof.
[0165] Hereinafter, with reference to the drawings, an embodiment of the present application will be described with reference to the following image encoding / decoding method.
[0166] Note that the encoding side in any embodiment of the present application may be the encoder 112 in Fig. 1 or Fig. 2, or the source device 11 in Fig. 1. The decoding side in any embodiment of the present application may be the decoder 122 in Fig. 1 or Fig. 5, or the target device 12 in Fig. 1, and the embodiment of the present application is not limited thereto.
[0167] Referring to Fig. 6a, Fig. 6a shows a schematic flowchart of an image encoding method provided by an embodiment of the present application. The method may include the following steps:
[0168] S11: The encoding side determines a target prediction mode of a block to be encoded, and also determines a target prediction order corresponding to the target prediction mode. Here, for a detailed explanation of S11, reference may be made to the explanation of S101 described later, and duplicate explanations will be omitted here.
[0169] S12: The encoding side predicts each pixel in the encoding target block in the target prediction order according to the target prediction mode. For a detailed explanation of S12, please refer to the explanation of S102 described later, and a duplicate explanation will be omitted here.
[0170] S13: The encoding side determines a residual block of the encoding target block based on the predicted value of each pixel in the encoding target block. For a detailed explanation of S13, please refer to the explanation of S103 described later, and a duplicate explanation will be omitted here.
[0171] S14 (optional), the encoding side performs a transform process on the residual block of the encoding target block to obtain a transformed residual coefficient block.
[0172] S15: The encoding side performs a quantization process on the residual coefficient block to obtain a quantized residual coefficient block. It is understood that if the encoding side does not execute S14, the encoding side can directly quantize the residual block to obtain a quantized residual block. Here, for a detailed description of the quantization process of the residual block or the residual coefficient block on the encoding side, reference may be made to the description of the quantization of the residual block in S301-S302 described later, and a duplicated description will be omitted here.
[0173] S16: The encoding side encodes the quantized residual coefficient block to obtain a code stream of the encoding target block. If the encoding side does not perform S14, it is understood that the encoding side encodes the quantized residual block to obtain a codestream of the block to be encoded. Here, the process of encoding the quantized residual coefficient block (or residual block) on the encoding side may refer to the description of S502 described later, and redundant description will be omitted here.
[0174] In addition, the residual scanning order in which the encoding side encodes the residual coefficient block may be the same as the target prediction order in S11. In this way, the decoding side can predict the predicted value of the pixel in the block to be decoded in the target prediction order, and decode the residual block of the block to be decoded in the residual scanning order that is the same as the target prediction order, and can efficiently obtain the reconstructed block of the block to be decoded.
[0175] In the image coding method described in S11 to S16, the target prediction mode used for predicting pixels in the coding target block has high prediction efficiency, and the quantization method used for quantizing the residual block or the residual coefficient block can reduce the multiplication operation on the coding side, that is, can improve the quantization efficiency.And, the coding method used for the coding side can reduce the number of bits for coding the residual block or the residual coefficient block, so that the method provided by the embodiment of the present application can greatly improve the coding efficiency on the coding side.
[0176] Referring to Figure 6b, Figure 6b shows a schematic flowchart of an image decoding method provided by an embodiment of the present application. The method may include the following steps:
[0177] S21: The decoding side analyzes the code stream of the block to be decoded, and determines a target prediction mode for predicting pixels in the block to be decoded. For a detailed explanation of S21, please refer to the explanation of S201 described later, and a duplicate explanation will be omitted here.
[0178] S22: The decoding side determines a target prediction order corresponding to the target prediction mode based on the target prediction mode. For a detailed explanation of S22, please refer to the explanation of S202 described later, and a duplicate explanation will be omitted here.
[0179] S23: The decoding side predicts each pixel in the block to be decoded in the target prediction order according to the target prediction mode, and obtains a predicted value of each pixel.
[0180] S24: The decoding side analyzes the code stream of the block to be decoded using a variable code length decoding method to obtain a CL of each value in the residual block corresponding to the block to be decoded, and analyzes the code stream of the block to be decoded based on the CL and in accordance with the target prediction order to obtain a first residual block of the block to be decoded. Here, residual scanning order can be the same as above-mentioned target prediction order.When residual scanning order is the same as above-mentioned target prediction order, that is, when decoding side predicts the pixel in the block to be decoded with target prediction order, decoding side further analyzes the first residual block of the block to be decoded from the code stream of the block to be decoded according to the residual scanning order that is the same as the target prediction order.Therefore, the decoding efficiency of decoding side can be improved. Here, the decoding side uses a variable code length decoding method to analyze the code stream of the block to be decoded, and the process of obtaining the CL of each value in the residual block corresponding to the block to be decoded can refer to the description of S601 described later. The description of the decoding side determining the first residual block based on the CL is the same as the method of obtaining the residual block of the block to be decoded described in S602, and the redundant description will be omitted here.
[0181] S25: The decoding side obtains the inverse quantization parameter of each pixel in the block to be decoded by analyzing the code stream of the block to be decoded. Here, for a detailed explanation of the inverse quantization parameters, the explanation of S401 to be described later may be referred to, and a duplicate explanation will be omitted here.
[0182] S26: The decoding side inversely quantizes the first residual block based on the QP indicated by the inverse quantization parameter of each pixel in the block to be decoded and the inverse quantization preset array, to obtain a second residual block. For a detailed explanation of S26, please refer to the explanation of S402 described later, and a duplicate explanation will be omitted here. Note that the embodiment of the present application does not limit the order of execution of S23 and S24 to S26, and for example, S23 and S24 to S26 can be executed simultaneously.
[0183] S27 (optional), the decoding side performs an inverse transform process on the second residual block to obtain an inverse transformed second residual block. If the image encoding process includes the above S14, it is understood that the decoding side executes S27.
[0184] S28: The decoding side reconstructs the block to be decoded based on the inverse transformed second residual block and the predicted value of each pixel in the block to be decoded, to obtain a reconstructed block. If the decoding side does not execute S27, it is understood that the decoding side directly reconstructs the block to be decoded based on the second residual block and the predicted value of each pixel in the block to be decoded to obtain a reconstructed block.
[0185] The image decoding methods of S21 to S28 correspond to the image coding methods of S11 to S16. In the image decoding methods described in S21 to S28, the target prediction mode used on the decoding side for predicting pixels in a block to be decoded has high prediction efficiency, and the inverse quantization method used on the decoding side for inverse quantizing a residual block or a residual coefficient block can reduce multiplication operations on the decoding side, that is, can improve the inverse quantization efficiency. And, the decoding method used on the decoding side can reduce the number of bits for decoding a residual block or a residual coefficient block, so that the method provided by the embodiment of the present application can significantly improve the decoding efficiency on the decoding side.
[0186] Example 1 As shown in Fig. 6c, which is a schematic flowchart of another image encoding method provided by an embodiment of the present application. The method shown in Fig. 6c includes the following steps:
[0187] At S101, the encoding side determines a target prediction mode of a block to be encoded, and also determines a target prediction order corresponding to the target prediction mode.
[0188] Specifically, the encoding side can predict each block to be encoded using different prediction modes, predict the encoding performance of the block to be encoded based on the predicted values in the different prediction modes, and determine a target prediction mode.
[0189] For example, the encoding side predicts the encoding target block using different prediction modes, and obtains a prediction block based on different prediction mode prediction, and then the encoding side executes the above-mentioned steps 13 to 16 to obtain the code stream of the encoding target block in different prediction modes. The encoding side determines the time for obtaining the code stream of the encoding target block in different prediction modes, and determines the prediction mode that takes the shortest time as the target prediction mode. In other words, the encoding side determines the prediction mode with the highest encoding efficiency as the target prediction mode.
[0190] In addition to conventional prediction modes, the embodiment of the present application provides multiple prediction modes. In the prediction modes provided by the embodiment of the present application, the encoding side can sequentially predict pixels in the encoding target block in a preset order. The encoding side sequentially predicts pixels in the encoding target block in a preset order means that the encoding side sequentially predicts pixels in the encoding target block along a preset trajectory. In this process, when the encoding side predicts any pixel in the encoding target block, the pixel for predicting the any pixel has already been reconstructed. Here, a detailed description of the prediction modes provided by the embodiment of the present application can be referred to below, and redundant description will be omitted here.
[0191] The encoding side predicts the encoding performance of the block to be encoded based on different prediction modes, determines a target prediction mode, and then determines a target prediction order for predicting pixels in the block to be encoded in the target prediction mode.
[0192] Here, the target prediction order may be a prediction order for pixels in the current block to be coded, or may be a prediction order for sub-blocks in the current block to be coded.
[0193] S102: The encoding side predicts each pixel in the encoding target block in the target prediction order according to the target prediction mode.
[0194] Preferably, the target prediction mode can indicate that each pixel in the encoding target block is predicted dot by dot in the target prediction order. For example, when the target prediction mode is one of the first to fifth prediction modes described below, the target prediction order is used to predict each pixel in the encoding target block dot by dot along the trajectory direction indicated by the target prediction order.
[0195] In this case, the encoding side predicts each pixel in the block to be encoded sequentially dot by dot along the trajectory direction indicated by the target prediction order to obtain a predicted value for each pixel.
[0196] Preferably, the target prediction mode can indicate that pixels in each subblock in the target block to be coded are predicted sequentially as a subblock unit having a preset size in the target block to be coded.For example, when the target prediction mode is a sixth prediction mode described later, the target prediction mode is used to indicate that pixels in each subblock in the target block to be coded are predicted sequentially as a subblock unit having a preset size in the target block to be coded.
[0197] In this case, the target prediction mode includes the prediction mode in each sub-block in the block to be coded.In this way, the coding side can predict the pixels in each sub-block in the block to be coded sequentially along the direction indicated by the target prediction order according to the target prediction mode.In addition, when the coding side predicts one sub-block in the block to be coded, the coding side can predict each pixel in the sub-block in parallel based on the reconstructed pixels around the sub-block.
[0198] S103: The encoding side determines a residual block of the encoding target block based on the predicted value of each pixel in the encoding target block.
[0199] The encoding side can determine a residual block of the block to be encoded based on the predicted value of each pixel in the block to be encoded and the original pixel value in the block to be encoded.
[0200] For example, the encoding side can use the residual calculation means 202 shown in Figure 2 to calculate the difference between the predicted value of each pixel in the block to be encoded and the original pixel value in the block to be encoded to obtain a residual block of the block to be encoded.
[0201] S104: the encoding side encodes the residual block in a residual scanning order to obtain a code stream of the encoding target block.
[0202] Here, the residual scanning order corresponds to the target prediction mode, and preferably, the residual scanning order may be the same as the target prediction order.
[0203] For example, when the encoding target block is a 16×2 size image block, if the target prediction mode is a prediction mode shown in Table 1 described later, the residual scanning order may be an order indicated by a preset trajectory shown in FIG. 7a. If the target prediction mode is a prediction mode shown in Table 2 described later, the residual scanning order may be an order indicated by a preset trajectory shown in FIG. 7b. If the target prediction mode is a prediction mode shown in Table 3-1 described later, the residual scanning order may be an order indicated by a preset trajectory shown in FIG. 7c-1. If the target prediction mode is a prediction mode shown in Table 4-1 described later, the residual scanning order may be an order indicated by a preset trajectory shown in FIG. 7d-1.
[0204] Also, for example, when the encoding target block is an 8×2 size image block, if the target prediction mode is a prediction mode shown in Table 3-2 described later, the residual scanning order may be the order shown in the preset trajectory shown in Figure 7c-2. If the target prediction mode is a prediction mode shown in Table 4-2 described later, the residual scanning order may be the order shown in the preset trajectory shown in Figure 7d-2.
[0205] Furthermore, for example, when the encoding target block is an 8×1 size image block, if the target prediction mode is a prediction mode shown in Table 4-3 described later, the residual scanning order may be the order shown in the preset trajectory shown in Figure 7d-3. If the target prediction mode is a prediction mode shown in Table 5 described later, the residual scanning order may be the order shown in the preset trajectory shown in Figure 7e.
[0206] Furthermore, for example, when the block to be encoded is an image block of size 16x2, if the target prediction mode is the prediction mode shown in Figure 7f described below, the residual scanning order may be the order shown by the pre-set trajectory shown in Figure 7g.
[0207] Preferably, the encoding side may perform a transform process on the residual block of the block to be encoded to obtain a residual coefficient block of the block to be encoded. The encoding side may also quantize the residual coefficient block to obtain a quantized residual coefficient block. Then, the encoding side may code the quantized residual coefficient block in the target prediction order to obtain a coded codestream of the block to be encoded.
[0208] For example, the encoding side may first perform a transform process on the residual block of the block to be encoded by the residual transform means 203 shown in Fig. 2 to obtain a residual coefficient block of the block to be encoded. The encoding side may also quantize the residual coefficient block by the quantization means 204 shown in Fig. 2 to obtain a quantized residual coefficient block. Then, the encoding side may code the quantized residual coefficient block in the target prediction order by the coding means 205 shown in Fig. 2 to obtain a coded code stream of the block to be encoded.
[0209] Preferably, the encoding side can directly perform a quantization process on the residual block of the encoding target block to obtain a quantized residual block, and then encodes the quantized residual block in the target prediction order to obtain an encoded codestream of the encoding target block.
[0210] For example, the encoding side can directly quantize the residual block of the block to be encoded by the quantization means 204 shown in Fig. 2 to obtain a quantized residual block. Then, the encoding side can encode the quantized residual block in the target prediction order by the encoding means 205 shown in Fig. 2 to obtain an encoded code stream of the block to be encoded.
[0211] Preferably, the encoding side takes the target prediction mode as a syntax element of the block to be encoded, or takes the target prediction mode and the corresponding target prediction order as a syntax element of the block to be encoded, and encodes the syntax element. The encoding side can also add the encoded syntax element data to the encoded codestream of the block to be encoded.
[0212] In addition, in the embodiments of the present application, the method for quantizing the residual block or the residual coefficient block of the block to be coded is not particularly limited. For example, the residual block or the residual coefficient block of the block to be coded can be quantized using the quantization method described in Example 2 below, and of course, there is no limitation thereto.
[0213] In addition, in the embodiment of the present application, the specific encoding method for encoding the quantized residual block or residual coefficients and related syntax elements by the encoding side is not particularly limited. For example, the encoding can be performed using a variable code length encoding method described in the following Example 3, and of course, there is no limitation thereto.
[0214] The prediction mode provided by the embodiment of the present application will be described in detail below. Note that the prediction mode for predicting one coding target block can include at least one of the above-mentioned T prediction method, TB prediction method, L prediction method and RL prediction method. Here, one pixel in the coding target block can be predicted by any of the prediction methods of T prediction method, TB prediction method, L prediction method or RL prediction method.
[0215] Note that any of the prediction modes below can be applied to a flow in which the encoding side encodes an image, and can also be applied to a flow in which the decoding side decodes image data, and the embodiment of the present application is not limited thereto.
[0216] In the first prediction mode, as shown in Table 1, taking the size of the encoding target block as an example of 16×2, Table 1 shows the prediction mode for predicting each pixel in the encoding target block having a size of 16×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by a preset trajectory as shown in Figure 7a. In other words, when the encoding side predicts pixels in the encoding target block sequentially according to the preset trajectory shown in Figure 7a, each pixel in the encoding target block is predicted by a specific prediction method in the prediction mode shown in Table 1.
[0217] [Table 1]
[0218] It should be understood that the prediction method shown in each grid in Table 1 is used to predict the predicted value of the corresponding pixel in the block to be coded shown in FIG. 7a. For example, the T prediction method shown in the first grid in the first row in Table 1 is used to predict the predicted value of pixel 1-1 located in the first grid in the block to be coded shown in FIG. 7a. For example, the RL prediction method shown in the second grid in the first row in Table 1 is used to predict the predicted value of pixel 1-2 located in the second grid in the block to be coded shown in FIG. 7a. For example, the T prediction method shown in the first grid in the second row in Table 1 is used to predict the predicted value of pixel 2-1 located in the first grid in the second row in the block to be coded shown in FIG. 7a. For example, the T prediction method shown in the fifteenth grid in the second row in Table 1 is used to predict the predicted value of pixel 1-15 located in the fifteenth grid in the second row in the block to be coded shown in FIG. 7a.
[0219] It should also be understood that the two blocks of size 16×2 shown in FIG. 7a represent the same image block (e.g., the block to be coded) in the image to be coded. In FIG. 7a, the block to be coded is represented by two blocks only to clearly show a preset trajectory when the coding side sequentially predicts pixels in the block to be coded, and the preset trajectory is the trajectory shown by the black solid line with an arrow in FIG. 7a. Here, the origin is the start point of the preset trajectory, and the pixel points at both ends of the black dashed line are two adjacent pixel points on the preset trajectory.
[0220] In this way, for example, when the encoding side predicts the encoding target block according to the preset trajectory shown in FIG. 7a, the encoding side first predicts pixel 1-1 shown in FIG. 7a by the T prediction method shown in Table 1. That is, the predicted value of pixel 1-1=P T1-1 and P T1-1 is the upper pixel of pixel 1-1 (e.g., a pixel in the upper image block of the block to be coded). It should be understood that the upper image block and the left image block of the block to be coded are usually subjected to the coding process prior to the block to be coded, and therefore the pixel values in the upper image block and the left image block of the block to be coded have already been reconstructed. It should be understood that after the coding side obtains the predicted value of pixel 1-1, it can determine the reconstructed value of pixel 1-1 based on the predicted value of pixel 1-1 (e.g., after the coding side obtains the predicted value of pixel 1-1, it performs steps 13 to 16 described above, reconstructs the residual value of the pixel by performing inverse quantization and inverse transformation, and further obtains the reconstructed value of pixel 1-1 based on the predicted value and the reconstructed residual value).
[0221] Also, for example, the encoding side predicts pixel 1-1 according to a preset trajectory shown in FIG. 7a, and then predicts pixel 2-1 shown in FIG. 7a by the T prediction method shown in Table 1. That is, the predicted value of pixel 2-1=P T2-1 And P T2-1 is the reconstructed value of the pixel above pixel 2-1 (eg, reconstructed pixel 1-1).
[0222] Further, for example, the encoding side predicts pixel 2-15 according to the preset trajectory shown in FIG. 7a, and then predicts pixel 1-2 shown in FIG. 7a using the RL prediction method shown in Table 1. That is, the predicted value of pixel 1-2=(P R1-2 +P L1-2 +1)>>1, and (P R1-2 +P L1-2 +1)>>1 is (P R1-2 +P L1-2 +1) shifted one bit to the right, and the mathematical result, (P R1-2 +P L1-2 +1) divided by 21. R1-2 is the reconstructed value of the pixel to the right of pixel 1-2 (e.g., reconstructed pixel 1-3, since pixel 1-3 is before pixel 1-2 in the prediction order), and P L1-2 is the reconstructed value of the pixel to the left of pixel 1-2 (eg, reconstructed pixel 1-1).
[0223] In the second prediction mode, as shown in Table 2, taking the size of the encoding target block as an example of 16×2, Table 2 shows another prediction mode for predicting each pixel in the encoding target block having a size of 16×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7b. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7b, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 2. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 2, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7b, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0224] [Table 2]
[0225] In this way, for example, when the encoding side predicts the encoding target block according to the preset trajectory shown in FIG. 7b, the encoding side first predicts pixel 2-1 shown in FIG. 7b using the L prediction method shown in Table 2. That is, the predicted value of pixel 2-1=P L2-1 And P L2-1 is the reconstructed value of the pixel to the left of pixel 2-1 (eg, the pixel in the left image block of the current block to be coded).
[0226] Further, for example, the encoding side predicts pixel 2-16 according to the preset trajectory shown in FIG. 7b, and then predicts pixel 1-1 shown in FIG. 7b using the TB prediction method shown in Table 2. That is, the predicted value of pixel 1-1=(P T1-1 +P B1-1 +1)>>1. T1-1 is the reconstructed value of the pixel above pixel 1-1 (e.g., the pixel in the upper image block of the block to be coded), and P B1-1 is the reconstructed value of the pixel below pixel 1-1 (eg, reconstructed pixel 2-1, since pixel 2-1 is before pixel 1-1 in the prediction order).
[0227] In the third prediction mode, as shown in Table 3-1, taking the size of the encoding target block as an example of 16×2, Table 3-1 shows another prediction mode for predicting each pixel in the encoding target block having a size of 16×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7c-1. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7c-1, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 3-1. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 3-1, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7c-1, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0228] [Table 3-1]
[0229] In the third prediction mode, as shown in Table 3-2, taking the size of the encoding target block as an example of 8×2, Table 3-2 shows a prediction mode for predicting each pixel in the encoding target block having a size of 8×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7c-2. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7c-2, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 3-2. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 3-2, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7c-2, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0230] [Table 3-2]
[0231] In the fourth prediction mode, as shown in Table 4-1, taking the size of the encoding target block as an example of 16×2, Table 4-1 shows another prediction mode for predicting each pixel in the encoding target block having a size of 16×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7d-1. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7d-1, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 4-1. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 4-1, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7d-1, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0232] [Table 4-1]
[0233] In the fourth prediction mode, as shown in Table 4-2, taking the size of the encoding target block as an example of 8×2, Table 4-2 shows another prediction mode for predicting each pixel in the encoding target block having a size of 8×2. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7d-2. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7d-2, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 4-2. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 4-2, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7d-2, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0234] [Table 4-2]
[0235] In the fourth prediction mode, as shown in Table 4-3, taking the size of the encoding target block as an example of 8×1, Table 4-3 shows another prediction mode for predicting each pixel in the encoding target block having a size of 8×1. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7d-3. That is, when the encoding side predicts pixels in the encoding target block sequentially using the preset trajectory shown in FIG. 7d-3, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 4-3. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 4-3, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7d-3, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0236] [Table 4-3]
[0237] In the fifth prediction mode, as shown in Table 5, the size of the encoding target block is 8×1 as an example, and Table 5 shows a prediction mode for predicting each pixel in the encoding target block having a size of 8×1. In this prediction mode, the prediction order in which the encoding side predicts pixels in the encoding target block may be the order shown by the preset trajectory shown in FIG. 7e. That is, when the encoding side sequentially predicts pixels in the encoding target block using the preset trajectory shown in FIG. 7e, each pixel in the encoding target block is predicted using a specific prediction method in the prediction mode shown in Table 5. Here, for a detailed explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 5, the explanation of predicting each pixel in the encoding target block using the prediction method shown in Table 1 above can be referred to, and for an explanation of the preset trajectory shown in FIG. 7e, the explanation of the preset trajectory in FIG. 7a can be referred to, and redundant explanations will be omitted here.
[0238] [Table 5]
[0239] As can be seen from the above, each prediction mode corresponds to a different prediction order.For example, when the prediction mode is a first prediction mode, the prediction order is a first prediction order, and when the prediction mode is a second prediction mode, the prediction order is a second prediction order, and the first prediction order and the second prediction order are different.The first prediction order and the second prediction order may be one of the prediction orders corresponding to the first prediction mode to the sixth prediction mode in the above-mentioned example.
[0240] Also, as can be seen, in the same prediction mode, when the size of the block to be coded is different, the corresponding prediction order is also different.For example, for a block to be coded of a first size, the first prediction mode predicts the block to be coded in the third prediction order, and for a block to be coded of a second size, in which the third prediction order and the fourth prediction order are different, the first prediction mode predicts the block to be coded in the fourth prediction order.For example, for blocks to be coded of three different sizes, 16×2, 8×2, and 8×1, the fourth prediction mode can use three different prediction orders, as shown in FIG. 7d-1, FIG. 7d-2, and FIG. 7d-3, respectively.
[0241] Here, the first prediction order, the second prediction order, the third prediction order, and the fourth prediction order can all represent prediction trajectories for pixels in the block to be coded, and can also represent prediction trajectories for sub-blocks in the block to be coded.
[0242] In the sixth prediction mode, the prediction mode is used to indicate that the encoding side predicts each sub-block in the encoding target block in units of sub-blocks having a preset size in the encoding target block in sequence along the direction indicated by the prediction order corresponding to the prediction mode.In addition, in the prediction mode, when predicting any sub-block in the encoding target block, the encoding side can predict pixels in any sub-block in parallel based on reconstructed pixels around the any sub-block.
[0243] In such a prediction mode, the encoding side can divide the block to be encoded into multiple non-overlapping sub-blocks having a preset size, and arrange the divided sub-blocks in the direction indicated by the prediction order corresponding to the prediction mode.
[0244] As an example, refer to FIG. 7f, which shows a schematic diagram of one sub-block of the block to be coded provided by an embodiment of the present application.
[0245] As shown in (a) of Fig. 7f, if it is assumed that the subblock having the preset size is a subblock of 2x2 size, for a 16x2 block to be coded, the block to be coded can be divided into eight non-overlapping 2x2 subblocks as shown in (a) of Fig. 7f. The arrangement direction of these eight subblocks, that is, the direction shown as the prediction order corresponding to the prediction mode, is, for example, the direction indicated by the arrow shown in (a) of Fig. 7f.
[0246] As shown in (b) of Fig. 7f, assuming that the sub-block having the preset size is a sub-block of 4x2 size, for a 16x2 block to be coded, the block to be coded can be divided into four non-overlapping 4x2 sub-blocks as shown in (b) of Fig. 7f. The arrangement direction of these four sub-blocks, that is, the direction shown as the prediction order corresponding to the prediction mode, is, for example, the direction indicated by the arrow shown in (b) of Fig. 7f.
[0247] As shown in (c) of Fig. 7f, assuming that the sub-block having the preset size is a sub-block of 8x2 size, for a 16x2 block to be coded, the block to be coded can be divided into two non-overlapping 8x2 sub-blocks as shown by the thick black frame in (c) of Fig. 7f. The arrangement direction of these two sub-blocks, that is, the direction shown as the prediction order corresponding to the prediction mode, is, for example, the direction indicated by the arrow shown in (c) of Fig. 7f.
[0248] Specifically, for any subblock in the block to be coded, the sixth prediction mode indicates that a pixel in any subblock is predicted based on the reconstructed values of pixels above (adjacent or not adjacent), to the left (adjacent or not adjacent), and diagonally above (adjacent or not adjacent) the subblock. Note that, in this prediction mode, a pixel in a subblock is not predicted depending on other pixels in the same subblock. For the sake of simplicity, in the embodiment of the present application, this prediction mode indicates that a pixel in any subblock is predicted based on the reconstructed values of neighboring pixels above, to the left, and diagonally above the subblock.
[0249] The sixth prediction mode is for indicating that each subblock in the block to be coded is predicted in sequence along the direction indicated by the prediction order corresponding to the prediction mode, with the subblock shown in (a) of Figure 7f as a unit. As shown in (a) of Figure 7f, assume that any of the above subblocks is subblock a, and the gray grid shown in (a) of Figure 7f is the pixel adjacent to the upper side, left side and diagonally upper side of subblock a. Take as an example that the pixels in subblock a are Y0, Y1, Y2, Y3, respectively, the upper pixel in subblock a includes T0 and T1, the left pixel in subblock a includes L0 and L1, and the diagonally upper pixel in subblock a is LT.
[0250] In one possible embodiment, the sixth prediction mode may specifically indicate that a predicted value of Y0 in sub-block a is obtained based on T0, L0 and LT, a predicted value of Y1 in sub-block a is obtained based on T1, L0 and LT, a predicted value of Y2 in sub-block a is obtained based on T0, L1 and LT, and a predicted value of Y3 in sub-block a is obtained based on T1, L1 and LT.
[0251] Preferably, the first prediction method specifically indicated by the sixth prediction mode may be to determine a predicted value of any pixel in any sub-block in the block to be encoded based on the horizontal gradient or vertical gradient of the pixel above, to the left of, and diagonally above the pixel.
[0252] Referring to FIG. 7f(a), taking pixel Y0 of subblock a as an example, if the encoding side determines that the reconstructed values of the upper pixel T0, the left pixel L0, and the diagonally upper pixel LT of Y0 satisfy condition 1, the encoding side determines the reconstructed value of the left pixel L0 of Y0 as the predicted value of Y0. Here, condition 1 is used to indicate that the horizontal gradient of the pixels around Y0 is the smallest. Specifically, condition 1 is |reconstructed value of T0-reconstructed value of LT|≦|reconstructed value of L0-reconstructed value of LT| and |reconstructed value of T0-reconstructed value of LT|≦|reconstructed value of L0+reconstructed value of T0-2*LT|. If the encoding side determines that the reconstructed values of the upper pixel T0, the left pixel L0, and the diagonally upper pixel LT of Y0 satisfy condition 2, the encoding side determines the reconstructed value of the upper pixel T0 of Y0 as the Y0 predicted value. Here, condition 2 is used to indicate that the vertical gradient of the pixels around Y0 is the smallest. Specifically, condition 2 is |reconstructed value of T0-reconstructed value of LT|≦|reconstructed value of L0+reconstructed value of T0-2*LT|. When the encoding side determines that the reconstructed values of the upper pixel T0, the left pixel L0, and the diagonally upper pixel LT of Y0 do not satisfy the above conditions 1 and 2, it determines the reconstructed value of the diagonally upper pixel LT of Y0 as the Y0 predicted value.
[0253] Preferably, the prediction method 2 specifically indicated by the sixth prediction mode may determine a predicted value of any pixel in any sub-block in the block to be encoded based on the average value of reconstructed values of the pixel above, to the left of, and diagonally above the pixel.
[0254] Continuing to refer to FIG. 7f(a), taking pixel Y0 of sub-block a as an example, the predicted value of Y0 may be (reconstructed value of L0+reconstructed value of T0+2*LT)>>2, where (reconstructed value of L0+reconstructed value of T0+2*LT)>>2 represents the binary value of (reconstructed value of L0+reconstructed value of T0+2*LT) shifted right by 2 bits.
[0255] In another possible embodiment, the sixth prediction mode specifically indicates that the reconstructed value of the upper pixel, the left pixel, or the diagonally upper pixel located in the prediction direction of any pixel in any subblock of the encoding target block is determined as the prediction value of the pixel. Here, the prediction direction may be the left 45 degree direction or the right 45 degree direction of the pixel, and the embodiment of the present application is not limited thereto.
[0256] As an example, the sixth prediction mode is used to indicate that the subblocks shown in (b) of Figure 7f are sequentially predicted in the block to be coded according to the prediction order corresponding to the prediction mode, and with reference to (b) of Figure 7f, assume that any of the above subblocks is subblock b, and the gray grid shown in (b) of Figure 7f is the pixels adjacent to the upper side, left side and diagonally upper side of subblock b. The pixels in subblock b are Y0, Y1, Y2, Y3, Y4, Y5, Y6 and Y7, respectively, the upper pixels in subblock b include T0, T1, T2, T3, T4 and T5, the left pixels in subblock b include L0 and L1, and the diagonally upper pixel in subblock b is LT.
[0257] When the prediction direction is a 45-degree diagonal left direction of the pixel to be predicted, the sixth prediction mode specifically determines the reconstructed value of LT at 45 degrees diagonal left of Y0 in subblock b as the predicted value of Y0, determines the reconstructed value of T0 at 45 degrees diagonal left of Y1 in subblock b as the predicted value of Y1, determines the reconstructed value of T1 at 45 degrees diagonal left of Y2 in subblock b as the predicted value of Y2, and determines the reconstructed value of T2 at 45 degrees diagonal left of Y3 in subblock b as the predicted value of Y3. It shows that the reconstructed value is determined as the predicted value of Y3, the reconstructed value of L0 at 45 degrees diagonal to the left of Y4 in sub-block b is determined as the predicted value of Y4, the reconstructed value of LT at 45 degrees diagonal to the left of Y5 in sub-block b is determined as the predicted value of Y5, the reconstructed value of T0 at 45 degrees diagonal to the left of Y6 in sub-block b is determined as the predicted value of Y6, and the reconstructed value of T1 at 45 degrees diagonal to the left of Y7 in sub-block b is determined as the predicted value of Y7.
[0258] When the prediction direction is a 45-degree diagonal direction to the right of the pixel to be predicted, the sixth prediction mode specifically determines the reconstructed value of T1 at 45 degrees diagonal to the right of Y0 in subblock b as the predicted value of Y0, determines the reconstructed value of T2 at 45 degrees diagonal to the right of Y1 in subblock b as the predicted value of Y1, determines the reconstructed value of T3 at 45 degrees diagonal to the right of Y2 in subblock b as the predicted value of Y2, and determines the reconstructed value of T4 at 45 degrees diagonal to the right of Y3 in subblock b as the predicted value of Y4. The reconstructed value of T2 at 45 degrees diagonal to the right of Y4 in sub-block b is determined as the predicted value of Y4, the reconstructed value of T3 at 45 degrees diagonal to the right of Y5 in sub-block b is determined as the predicted value of Y5, the reconstructed value of T4 at 45 degrees diagonal to the right of Y6 in sub-block b is determined as the predicted value of Y6, and the reconstructed value of T5 at 45 degrees diagonal to the right of Y7 in sub-block b is determined as the predicted value of Y7.
[0259] Preferably, when the target prediction mode includes a prediction mode for each sub-block in the block to be decoded, for a first sub-block in the block to be decoded, if the first sub-block includes a first pixel and a second pixel, the prediction mode of the first sub-block is used to predict the first pixel and the second pixel in parallel based on reconstructed pixels surrounding the first sub-block.
[0260] Here, the first subblock is a subblock in the currently predicted block to be decoded. For example, as shown in (a) of FIG. 7f, if the size of each subblock in the block to be decoded is 2×2, the block to be decoded can be divided into 8 subblocks, and when the prediction of the block to be coded shown in (a) of FIG. 7f is started, the first subblock is the first subblock from left to right, and when the reconstruction of the pixels in the first subblock is completed, the reconstruction of the pixels in the second subblock from left to right can be started, and at this time, the first subblock is the second subblock. The first pixel and the second pixel included in the first subblock may be two sets of pixels in the first subblock that do not overlap each other, and the first pixel or the second pixel may include one or more pixels in the first subblock. For example, taking the subblock a in (a) of FIG. 7f as an example, in one case, the first pixel in the subblock a may include Y0, and the second pixel in the subblock a may include Y1, Y2, Y3. In another case, a first pixel in sub-block a may include Y0 and Y1, and a second pixel in sub-block a may include Y2 and Y3, or in yet another case, a first pixel in sub-block a may include Y1, and a second pixel in sub-block a may include Y2.
[0261] In addition, when the encoding side predicts pixels in the block to be encoded using the sixth prediction mode, when the encoding side encodes the residual block or residual coefficient block corresponding to the block to be encoded, the encoding can be performed in the order shown by the trajectory shown in Figure 7g.
[0262] According to the coding method described in S101 to S104 above, when predicting pixels in a block to be coded in a target prediction mode, the coding side predicts pixels in the block to be coded in a target prediction order corresponding to the target prediction mode. In this process, when the coding side predicts any pixel in the block to be coded, the pixel for predicting the pixel has already been reconstructed. Therefore, the coding method provided by the embodiment of the present application predicts each pixel in the block to be coded in a target prediction order according to the target prediction mode, and can predict some pixels in the block to be coded in parallel, thereby improving prediction efficiency for pixels in the block to be coded. Since the coding side does not need to cache the residual value when re-obtaining a reconstructed value based on a predicted value and a residual value, the coding method provided by the embodiment of the present application can not only save cache space for caching residual values, but also improve coding efficiency.
[0263] In addition, when the target prediction mode indicates that each subblock in the block to be coded is predicted sequentially in units of subblocks, in this prediction mode, when the coding side predicts one subblock, it can predict multiple pixels in the subblock in parallel based on the reconstructed pixels around the subblock, that is, according to this prediction mode, the coding side can further improve the prediction efficiency for the block to be coded. Furthermore, when the coding side re-obtains the reconstruction value based on the prediction value and the residual value, the coding side does not need to cache the residual value, so the coding method provided by the embodiment of the present application further saves cache space and improves coding efficiency.
[0264] As shown in Figure 8, which is a schematic flowchart of another image decoding method provided by an embodiment of the present application. The method shown in Figure 8 includes the following steps:
[0265] In step S201, the decoding side analyzes the code stream of a block to be decoded, and determines a target prediction mode for predicting pixels in the block to be decoded. Here, the code stream of the block to be decoded may be a code stream received by the decoding side from the encoding side, or it may be a code stream obtained from another device, for example a code stream obtained from a storage device, and the embodiments of the present application are not limited to this. Here, the target prediction mode is used to predict pixels in a block to be decoded to obtain predicted values of pixels in the block to be decoded. The target prediction mode here is understood to be a prediction mode used by the encoding side to predict pixels in an image block when encoding.
[0266] Specifically, the decoding side can obtain the target prediction mode by analyzing the code stream of the block to be decoded using a decoding method corresponding to the encoding side.
[0267] S202: The decoding side determines a target prediction order corresponding to the target prediction mode based on the target prediction mode. Here, the above description can be referred to for an explanation of the prediction modes and the prediction orders corresponding to the prediction modes, and therefore a duplicated explanation will be omitted here.
[0268] Preferably, a correspondence relationship between a plurality of prediction modes and a corresponding prediction order may be preset on the decoding side. In this manner, when the decoding side determines a prediction mode as a target prediction mode, it can determine a target prediction order corresponding to the target prediction mode from the preset correspondence relationships.
[0269] S203: The decoding side predicts each pixel in the block to be decoded in a target prediction order according to the target prediction mode, and obtains a predicted value of each pixel. Here, for an explanation of predicting each pixel in the block to be decoded in a prediction order corresponding to the prediction mode based on the prediction mode, reference may be made to the detailed explanation regarding the prediction modes described above, and redundant explanations will be omitted here.
[0270] S204: The decoding side reconstructs each pixel based on the predicted value of each pixel in the block to be decoded, and obtains a reconstructed block of the block to be decoded.
[0271] Preferably, the decoding side can first obtain a residual block of the block to be decoded by analyzing the code stream. Then, the decoding side dequantizes the residual block to obtain a reconstructed residual block of the block to be decoded. In this way, the decoding side can obtain a reconstructed block of the block to be decoded based on the predicted values of the pixels in the block to be decoded obtained above and the residual values in the reconstructed residual block.
[0272] For example, the decoding side can first analyze the code stream of the block to be decoded by the code stream analysis means 301 shown in Fig. 5 to obtain a residual block of the block to be decoded. Then, the decoding side can inversely quantize the residual block by the inverse quantization means 302 shown in Fig. 5 to obtain a reconstructed residual block of the block to be decoded. In this way, the decoding side can obtain a reconstructed block of the block to be decoded by the reconstruction means 305 based on the predicted values of the pixels in the block to be decoded obtained above and the residual values in the reconstructed residual block.
[0273] Preferably, the decoding side can first obtain a residual coefficient block of the block to be decoded by analyzing the code stream. Then, the decoding side inversely quantizes the residual block to obtain a dequantized residual coefficient block. Next, the decoding side inversely transforms the dequantized residual coefficient block to obtain a reconstructed residual block of the block to be decoded. In this way, the decoding side can obtain a reconstructed block of the block to be decoded based on the predicted values of pixels in the block to be decoded obtained above and the residual values in the reconstructed residual block.
[0274] For example, the decoding side first analyzes the code stream of the block to be decoded by the code stream analysis means 301 shown in Fig. 5, and can obtain a residual coefficient block of the block to be decoded. Then, the decoding side inversely quantizes the residual coefficient block by the inverse quantization means 302 shown in Fig. 5, and can obtain a dequantized residual coefficient block. Next, the decoding side inversely transforms the dequantized residual coefficient block by the residual inverse transformation means 303 shown in Fig. 5, and obtains a reconstructed residual block of the block to be decoded. In this way, the decoding side can obtain a reconstructed block of the block to be decoded by the reconstruction means 305, based on the predicted values of the pixels in the block to be decoded obtained above and the residual values in the reconstructed residual block.
[0275] Here, the decoding side can analyze the code stream of the block to be decoded by a decoding method corresponding to the encoding side to obtain the residual block or the residual coefficient block of the block to be decoded. For example, the residual scanning order in which the decoding side decodes the code stream of the block to be decoded is the target prediction order for predicting the pixels in the block to be decoded. Here, the target prediction order corresponds to the target prediction mode for predicting the block to be decoded. The above description can be referred to for the explanation of the residual scanning order, and the redundant explanation will be omitted here.
[0276] In addition, since the image decoding method shown in Figure 8 corresponds to the image encoding method shown in Figure 6c, this image decoding method contributes to improving prediction efficiency for the block to be decoded, and when reconstructing the block to be decoded based on the prediction value and the residual value to obtain a reconstructed value of the block to be decoded, it is possible to save cache space for caching the residual value, and thus improve the decoding efficiency.
[0277] In addition, in the embodiment of the present application, the method for inverse quantizing the residual block or the residual coefficient block of the block to be decoded is not particularly limited. For example, the residual block or the residual coefficient block of the block to be decoded can be inverse quantized using the inverse quantization method described in the embodiment 2 below, and of course, there is no limitation thereon.
[0278] Furthermore, in the embodiments of the present application, the method by which the decoding side decodes the code stream of the block to be decoded is not particularly limited, and for example, decoding can be performed using a variable code length decoding method described in Example 3 below, and of course, there is no limitation thereto.
[0279] Example 2 As shown in Figure 9a, which is a schematic flow chart of another image encoding method provided by an embodiment of the present application, the method shown in Figure 9a includes the following steps:
[0280] At S301, the encoding side determines a second residual block of the encoding target block and a quantization parameter QP of each pixel in the encoding target block. Here, the second residual block may be an original residual value block of the block to be coded, or the second residual block may be a residual coefficient block obtained by transforming the original residual value block.
[0281] Here, the original residual value block of the block to be coded is a residual block obtained by the coding side based on the original pixel values of the block to be coded and the predicted block of the block to be coded. The process of the coding side predicting the pixels in the block to be coded to obtain a predicted block can be realized based on the method described in the first embodiment, and of course, can be obtained based on any method for obtaining a predicted block of the block to be coded in the prior art, and it is understood that this is not limited in the embodiment of the present application. The residual coefficient block is obtained by the coding side performing a conversion process on the original residual value block, and the embodiment of the present application does not specifically limit the process of the coding side performing a conversion process on the original residual value block.
[0282] For ease of explanation, the following embodiments of the present application take as an example that the second residual block is the original residual value block of the current block to be coded.
[0283] In addition, the encoding side may determine a quantization parameter QP of each pixel in the encoding target block before or after obtaining the second residual block of the encoding target block. For example, the encoding side may read a preset quantization parameter QP. Here, the embodiment of the present application does not specifically limit the process in which the encoding side determines the quantization parameter QP of each pixel in the encoding target block.
[0284] S302: the encoding side quantizes the second residual block based on the QP of each pixel in the encoding target block and the quantization preset array to obtain a first residual block. Here, the quantization preset array is used to quantize the values in the second residual block.
[0285] In a first possible embodiment, the quantization preset array includes an amplification parameter array and a displacement parameter array, and the amplification parameter array and the displacement parameter array include the same number of values. When the amplification parameter in the amplification parameter array is represented by amp and the displacement parameter in the displacement parameter array is represented by shift, the encoding side can perform a quantization process for each value in the second residual block according to formula (1).
[0286]
number
[0287] Here, amp[QP] represents the QPth amplification parameter in the amplification parameter array, shift[QP] represents the QPth displacement parameter in the displacement parameter array, and (pre-quantization residual value × amp[QP]) >> shift[QP] represents a right shift of shift[QP] bits for the (pre-quantization residual value × amp[QP]) binary value.
[0288] In the embodiment of the present application, for the value amp[i] of the i-th amplification parameter in the amplification parameter array and the value shift[i] of the i-th displacement parameter in the displacement parameter array,shift[i] In the inverse quantization preset array consisting of the quotient of amp[i] and amp[i], the interval between two adjacent numbers is 1 in the 1st to nth numbers in the inverse quantization preset array, the interval between two adjacent numbers is 2 in the n+1 to n+mth numbers, and the interval between two adjacent numbers is 2 in the n+k*m+1 to n+k*m+mth numbers. k+1 where n and m are integers greater than 1, and i and k are both positive integers.
[0289] Here, the inverse quantization preset array is used to realize the inverse quantization process of the first residual block obtained by quantization, and the inverse quantization operation realized by the inverse quantization preset array and the quantization operation realized by the quantization preset array are mutually inverse. Therefore, based on the inverse quantization preset array having the above rule, the amplification parameter array and the displacement parameter array for realizing the quantization operation can be determined in the reverse direction.
[0290] As an example, the amplification parameter in the inverse quantization preset array is represented by mult, and the inverse quantization preset array includes 42 amplification parameters. For example, n is set to 12 and m is set to 6, and the inverse quantization preset array having the above rule is as follows:
number
number
number
[0291] In this way, the encoding side can determine the amplification parameter of each pixel in the amplification parameter array based on the determined QP of each pixel in the encoding target block, and determine the displacement parameter of each pixel in the displacement parameter array. Then, the encoding side performs a quantization operation on the second residual block based on the amplification parameter and the displacement parameter corresponding to each pixel in the encoding target block to obtain a first residual block.
[0292] For example, for any pixel in the block to be coded, the coding side can search in the amplification parameter array based on the determined QP of the pixel, determine the QP-th value in the amplification parameter array as the amplification parameter of the pixel, and determine the QP-th value in the displacement parameter array as the displacement parameter of the pixel. Then, based on the amplification parameter and displacement parameter corresponding to the pixel, the coding side performs a quantization operation on the residual value corresponding to the pixel in the second residual block according to the above formula (1), thereby obtaining a quantized residual value corresponding to the pixel. When the coding side completes the quantization process on all the residual values in the second residual block, a first residual block is obtained.
[0293] With this feasible embodiment, the encoding side only needs to perform up to six types of multiplication when quantizing the residual values in the second residual block, and compared with the prior art, this method significantly reduces the amount of calculation on the encoding side, that is, this method significantly saves the computing resources on the encoding side.
[0294] In a second possible embodiment, the quantization preset array can include fewer values compared with the first possible embodiment. In this embodiment, the encoding side can realize the quantization process of each residual value in the second residual block according to formula (2).
[0295]
number
[0296] Here, amp is an amplification parameter determined by the encoding side based on the QP of each pixel in the block to be encoded and the quantization preset array, and shift is a displacement parameter determined by the encoding side based on the QP of each pixel in the block to be encoded and the quantization preset array, and offset is an offset parameter that can be rounded off to the nearest whole number after quantization, and (residual value before quantization×amp+offset) “shift” represents a right shift of the shift bit for the binary value of (residual value before quantization×amp+offset).
[0297] Specifically, the value of the amplification parameter amp corresponding to each pixel in the block to be coded determined by the coding side is the value of the logical product of the QP of each pixel and 7 in the quantization preset array, and the value of the displacement parameter shift corresponding to each pixel in the block to be coded determined by the coding side is the value of the logical product of 7 and the QP of each pixel multiplied by 2. 3 It is the sum of the quotients obtained by dividing by.
[0298] That is, assuming that the values in the quantization preset array are represented by quant_scal, the amplification parameter amp can be calculated by quant_scale[QP&0x07], and the displacement parameter shift can be calculated by 7+(QP>>3). Here, [QP&0x07] represents the logical product of the binary value of QP and 7 (equivalent to the mathematical result of dividing QP by 8 and taking the remainder), and quant_scale[QP&0x07] is the QP&0x07th value in the quantization preset array. QP>>3 indicates a 3-bit right shift for the binary value of QP.
[0299] Also, offset can be obtained by calculating 1<<(shift-1), which represents a left shift of (shift-1) for the binary value of 1 (the mathematical result is 1 multiplied by the power of (shift-1)).
[0300] In the embodiment of the present application, when the encoding side realizes the quantization process of the second residual block by equation (2), the quantization preset array may be quant_scal[8]={128, 140, 153, 166, 182, 197, 216, 234}.
[0301] In this way, the encoding side calculates the amplification parameter and displacement parameter corresponding to each pixel in the determined encoding target block based on the QP of the pixel and the quantization preset array. Then, the encoding side realizes quantization of the second residual block by formula (2) based on the calculated amplification parameter, displacement parameter and offset parameter of each pixel in the encoding target block to obtain a first residual block.
[0302] As can be seen, according to this possible embodiment, the encoding side needs to perform up to eight kinds of multiplication when quantizing the residual value in the second residual block. Compared with the prior art, this method greatly reduces the amount of calculation on the encoding side, that is, this method greatly saves the calculation resources on the encoding side.
[0303] In a third possible embodiment, the encoding side can realize the quantization process of each residual value in the second residual block according to equation (3).
[0304]
number
[0305] Here, shift represents a displacement parameter, and the value of shift is related to QP and is a monotonically non-decreasing integer. Alternatively, if QP is increasing, it should be understood that shift corresponds one-to-one to QP and the value of shift is a monotonically non-increasing integer. The above description can be referred to for the explanation of offset, and redundant explanation will be omitted here. And, offset is determined by (shift==0)?0:(1<<(shift-1)). Specifically, when shift is set to 0, offset is set to 0, and when shift is not set to 0, offset is set to (1<<(shift-1)) (i.e., the value obtained by shifting (shift-1) bits to the left for a binary value of 1).
[0306] In this way, the encoding side can determine the displacement parameter of each pixel according to the QP of each pixel in the determined encoding target block, and further determine the corresponding offset parameter. Then, the encoding side can realize the quantization of the second residual block according to the equation (3) according to the displacement parameter and offset parameter of each pixel in the determined encoding target block, and obtain the first residual block.
[0307] As can be seen, according to this possible embodiment, the encoding side does not need to perform multiplication operations when quantizing the residual value in the second residual block.Compared with the prior art, in the encoding scene where the requirement for the granularity of quantization is not high, this method greatly reduces the computation amount of the encoding side, that is, this method greatly saves the computation resources of the encoding side.
[0308] S303: the encoding side encodes the first residual block to obtain a code stream of the encoding target block.
[0309] The encoding side obtains and encodes a first residual block to obtain an encoded codestream of the current block.
[0310] Preferably, the encoding side encodes the syntax element of the current block, using the QP corresponding to each pixel when quantizing the second residual block and the specific quantization method used as the syntax element of the current block. The encoding side can also add the encoded syntax element data to the encoded code stream of the current block.
[0311] Preferably, the residual scanning order that the encoding side uses to encode the first residual block may be the target prediction order that the encoding side uses to predict pixels in the block to be encoded. Here, the target prediction order corresponds to the target prediction mode that predicts the block to be decoded. The target prediction mode and the target prediction order can be described in the above description, and redundant description will be omitted here.
[0312] In addition, in the embodiment of the present application, the specific mode for predicting the block to be coded is not particularly limited, and for example, the block to be coded can be predicted using the prediction mode described in Example 1 above, and of course, there is no limitation thereto.
[0313] Furthermore, the embodiments of the present application do not specifically limit the specific encoding scheme used by the encoding side to encode the first residual block and related syntax elements, and may, for example, be encoded using the variable code length encoding scheme described in Example 3.
[0314] According to the image coding method described in S301 to S303 above, a quantization processing method is used in the image coding process that can save computational resources on the coding side, i.e., the efficiency of the quantization processing process in this image coding method is greatly improved, and therefore, according to this image coding method, the image coding efficiency is greatly improved.
[0315] As shown in Figure 9b, which is a schematic flowchart of another image decoding method provided by an embodiment of the present application. The method shown in Figure 9b includes the following steps:
[0316] S401: The decoding side analyzes the code stream of a block to be decoded, and obtains an inverse quantization parameter of each pixel in the block to be decoded and a first residual block of the block to be decoded. Here, the code stream of the block to be decoded may be a code stream received by the decoding side from the encoding side, or a code stream obtained from another device, for example a code stream obtained from a storage device, and the embodiments of the present application are not limited to this. Here, the inverse quantization parameter is used to indicate that the decoding side performs inverse quantization processing on the residual values in the first residual block using an inverse quantization method corresponding to the inverse quantization parameter. The inverse quantization parameter may include a quantization parameter QP.
[0317] Specifically, the decoding side analyzes the code stream of the block to be decoded using a decoding method corresponding to the encoding side, and obtains the inverse quantization parameters of each pixel in the block to be decoded and the first residual block of the block to be decoded.
[0318] For example, the residual scan order in which the decoding side decodes the code stream of the block to be decoded is the target prediction order for predicting pixels in the block to be decoded. Here, the target prediction order corresponds to the target prediction mode for predicting the block to be decoded. The above description can be referred to for the description of the target prediction mode and the target prediction order, and the redundant description will be omitted here.
[0319] Preferably, the decoding side can analyze the code stream of the block to be decoded using a variable code length decoding method, and obtain the coding code length CL for encoding each value in the residual block corresponding to the block to be decoded, and the first residual block. Here, the decoding side can refer to the following description of S601 for the process of analyzing the code stream of the block to be decoded using a variable code length decoding method, and obtaining CL for each value in the residual block corresponding to the block to be decoded. The decoding side can refer to the description of S602 for the description of determining the first residual block based on CL, and redundant description will be omitted here.
[0320] Other possible implementations of step S401 will be described later, but redundant explanations will be omitted here.
[0321] S402: The decoding side inversely quantizes the first residual block based on the QP indicated by the inverse quantization parameter of each pixel in the block to be decoded and the inverse quantization preset array, to obtain a second residual block.
[0322] In a first possible form, when the decoding side determines, based on the inverse quantization parameters of each pixel in the block to be decoded, that the inverse quantization method of the first residual block and the quantization method described in the first possible form in S302 above are mutually inverse, for an explanation of the inverse quantization preset array, reference may be made to the explanation of the inverse quantization preset array in S302, and redundant explanations will be omitted here.
[0323] In this case, the decoding side can determine the amplification parameter corresponding to each pixel from the inverse quantization preset array based on the QP of each pixel in the block to be decoded. Then, the decoding side can perform the inverse quantization process on the first residual block based on the amplification parameter corresponding to each pixel to obtain the second residual block.
[0324] For example, for any pixel in the block to be decoded, the decoding side can search the inverse quantization preset array based on the QP of the pixel, and determine the QP-th value in the inverse quantization preset array as the amplification parameter of the pixel. Then, the decoding side obtains an inverse quantized residual value corresponding to the pixel by multiplying the residual value corresponding to the pixel in the first residual block based on the amplification parameter corresponding to the pixel. When the decoding side completes the inverse quantization process for all the residual values in the first residual block, a second residual block is obtained.
[0325] Preferably, the decoding side determines an amplification parameter corresponding to each pixel in the block to be decoded, and then performs a left shift operation on the residual value in the first residual block corresponding to each pixel, thereby realizing multiplication of the residual value and the amplification parameter corresponding to the residual value, but this is not limited to this in the embodiments of the present application.
[0326] In a second possible embodiment, when the decoding side determines based on the inverse quantization parameters of each pixel in the block to be decoded that the inverse quantization method of the first residual block and the quantization method described in the second possible embodiment at S302 above are mutually inverse, the decoding side can realize an inverse quantization process for each residual value in the first residual block based on the above equation (2) to obtain a second residual block.
[0327] In this case, the amplification parameter mult in equation (2) (to be distinguished from amp in the above quantization process) is calculated using dequant_scale[QP&0x07], which is the QP&0x07th value in the dequantization preset array. The displacement parameter shift in equation (2) is calculated using 7-(QP>>3). The offset parameter offset in equation (2) is calculated using (shift==0)?0:(1<(shift-1)).
[0328] In the embodiment of the present application, when the decoding side realizes the inverse quantization process of the first residual block by equation (2), the inverse quantization preset array may be dequant_scal[8]={128, 117, 107, 99, 90, 83, 76, 70}.
[0329] In this way, the decoding side calculates the amplification parameter and displacement parameter corresponding to each pixel in the block to be decoded based on the QP of the pixel and the inverse quantization preset array.Then, the decoding side realizes the inverse quantization of the first residual block according to the formula (2) based on the calculated amplification parameter, displacement parameter, and offset parameter of each pixel in the block to be decoded, and obtains the second residual block.
[0330] As can be seen, according to this possible embodiment, the decoding side needs to perform up to eight kinds of multiplication operations when inverse quantizing the residual value in the first residual block.Compared with the prior art, this method greatly reduces the amount of calculation on the encoding side, that is, this method greatly saves the computing resources on the encoding side.
[0331] In a third possible form, when the decoding side determines based on the inverse quantization parameters of each pixel in the block to be decoded that the inverse quantization method of the first residual block and the quantization method described in the third possible form at S302 above are mutually inverse, the decoding side realizes an inverse quantization process for each residual value in the first residual block based on equation (4) to obtain the first residual block.
number
[0332] Here, for the explanation of the offset parameter "offset" and the displacement parameter "shift", please refer to the explanation of the third possible embodiment in S302, and duplicate explanation will be omitted here.
[0333] In this way, the decoding side can determine the displacement parameter of each pixel according to the QP of each pixel in the block to be decoded, and further determine the corresponding offset parameter.Then, the decoding side can realize the inverse quantization of the first residual block according to the equation (4) according to the displacement parameter and offset parameter of each pixel in the block to be decoded that are determined, and obtain the second residual block.
[0334] As can be seen, according to this possible embodiment, the decoding side does not need to perform multiplication operations when inverse quantizing the residual value in the first residual block.Compared with the prior art, in the coding scene where the requirement for quantization granularity is not high, this method greatly reduces the amount of calculation on the coding side, that is, this method greatly saves the computing resources of the coding side.
[0335] In addition, the inverse quantization method in some of the possible forms described above can be applied to a process in which the encoding side encodes an image (e.g., obtains a reconstruction block for predicting pixels in an image block), and can also be applied to a process in which the decoding side decodes image data, and the embodiments of the present application are not limited thereto.
[0336] S403, the decoding side reconstructs the block to be decoded based on the second residual block to obtain a reconstructed block.
[0337] Preferably, the decoding side can reconstruct the second residual block as it is, and obtain the reconstructed block of the block to be decoded. Specifically, the decoding side can reconstruct the block to be decoded as it is based on the second residual block and the predicted block of the block to be decoded, and obtain the reconstructed block of the block to be decoded. For example, the decoding side can obtain the reconstructed block of the block to be decoded by adding the second residual block and the predicted block of the block to be decoded.
[0338] Here, the prediction block of the block to be decoded can be obtained by the decoding side predicting the block to be decoded based on a prediction mode.Preferably, this prediction mode can be obtained by analyzing the code stream of the block to be decoded, for example, can be any prediction mode of the above embodiment 1, or this prediction mode can be any prediction mode of the prior art, and the embodiment of the present application is not limited thereto.In addition, the process of the decoding side predicting the prediction block of the block to be decoded is not described in detail here.
[0339] Preferably, the decoding side can predict each pixel in the block to be decoded according to the target prediction mode in a target prediction order corresponding to the target prediction mode. The decoding side reconstructs the block to be decoded based on the predicted value of each pixel and the second residual block to obtain a reconstructed block.
[0340] Preferably, the decoding side can first inversely transform the second residual block to reconstruct the residual value block of the block to be decoded. In this case, the second residual block is actually a residual coefficient block. Then, the decoding side can reconstruct the block to be decoded based on the reconstructed residual value block and the prediction block of the block to be decoded, and obtain the reconstructed block of the block to be decoded. For example, the decoding side can obtain the reconstructed block of the block to be decoded by adding the reconstructed residual value block and the prediction block of the block to be decoded.
[0341] Here, the description of the prediction block of the block to be decoded can refer to the above description, and the duplicated description will be omitted here. In addition, in the embodiment of the present application, the process of the decoding side performing the inverse transform process on the second residual block will not be described in detail.
[0342] Note that the image decoding method shown in Figure 9b corresponds to the image encoding method shown in Figure 9a, and based on the image decoding method described above in S401 to S403, an inverse quantization processing method that can save computational resources on the decoding side is used in the image decoding process. In other words, the efficiency of the inverse quantization processing process in this image decoding method is greatly improved, and therefore, the image decoding efficiency is greatly improved by this image decoding method.
[0343] In addition, in the embodiments of the present application, the specific mode for predicting the block to be decoded is not particularly limited, and for example, the block to be decoded can be predicted using the prediction mode described in Example 1 above, and of course, there is no limitation thereto.
[0344] In addition, in the embodiments of the present application, the method by which the decoding side decodes the code stream of the block to be decoded is not particularly limited. For example, decoding can be performed using a variable code length decoding method described in Example 3 below, and of course, there is no limitation thereto.
[0345] Next, possible implementations of step S401 will be described.
[0346] Preferably, the decoding side determines a target prediction mode for predicting pixels in the block to be decoded and an inverse quantization parameter for each pixel in the block to be decoded based on a code stream of the block to be decoded. The decoding side determines a residual scanning order corresponding to the target prediction mode based on the target prediction mode. The decoding side analyzes the code stream of the block to be decoded based on the residual scanning order to obtain a first residual block.
[0347] Here, when the target prediction mode is a first target prediction mode, the residual scanning order is a first scanning order, and when the target prediction mode is a second target prediction mode, the residual scanning order is a second scanning order, and the first scanning order and the second scanning order are different.
[0348] The first scanning order or the second scanning order is a type of residual scanning order, and the first scanning order or the second scanning order corresponds to the target prediction mode. For example, the first scanning order corresponds to a first target prediction mode, and the second scanning order corresponds to a second target prediction mode. Preferably, the residual scanning order may be the same as the target prediction order. The first scanning order and the second scanning order are used to represent two different scanning orders in different target prediction modes.
[0349] For example, when the decoding target block is a 16×2 size image block, when the first target prediction mode is the prediction mode shown in Table 1, the first scanning order may be the order shown in the preset trajectory shown in Figure 7a. When the second target prediction mode is the prediction mode shown in Table 2, the second scanning order may be the order shown in the preset trajectory shown in Figure 7b.
[0350] Also, for example, when the first target prediction mode is the prediction mode shown in Table 3-1 above, the first scanning order may be the order shown in the preset trajectory shown in Figure 7c-1. When the second target prediction mode is the prediction mode shown in Table 4-1 above, the second scanning order may be the order shown in the preset trajectory shown in Figure 7d-1.
[0351] As can be seen, for different prediction modes, the residual scanning order corresponding to the target prediction mode is different.
[0352] Preferably, in addition to the possible form of the above step S401, when determining a target prediction mode, the decoding side can analyze the code stream of the block to be decoded using a third scanning order in the target prediction mode for the block to be decoded that is a first size, and can analyze the code stream of the block to be decoded using a fourth scanning order in the target prediction mode for the block to be decoded that is a second size.
[0353] Here, the third scanning order and the fourth scanning order are different from each other, and the third scanning order and the fourth scanning order are types of residual scanning orders.
[0354] In addition, the residual scanning order indicated by the first scanning order may be the same as or different from the residual scanning order indicated by the third scanning order or the fourth scanning order. Similarly, the residual scanning order indicated by the second scanning order may be the same as or different from the residual scanning order indicated by the third scanning order or the fourth scanning order. The embodiment of the present application is not limited thereto.
[0355] Next, the above selectable implementation will be described by taking the first size as 8×1 and the second size as 8×2 as an example.
[0356] For example, when the target prediction mode is the prediction mode shown in Table 3-2 or the prediction mode shown in Table 5, when the block to be decoded is a first size, the residual scanning order may be a third scanning order such as the scanning order shown in Figure 7e, and when the block to be decoded is a second size, the residual scanning order may be a fourth scanning order such as the scanning order shown in Figure 7c-2. Here, the prediction modes shown in Table 3-2 and Table 5 can represent two prediction modes of the same target prediction mode with different sizes.
[0357] Also, for example, when the target prediction mode is the prediction mode shown in Table 4-2 or the prediction mode shown in Table 4-3, when the block to be decoded is a first size, the residual scanning order may be a third scanning order such as the scanning order shown in Figure 7d-3, and when the block to be decoded is a second size, the residual scanning order may be a fourth scanning order such as the scanning order shown in Figure 7d-2. Here, the prediction modes shown in Table 4-2 and Table 4-3 can represent two prediction modes of different sizes and the same target prediction mode.
[0358] Example 3 As shown in Figure 10a, which is a schematic flow chart of another image encoding method provided by an embodiment of the present application, the method shown in Figure 10a includes the following steps:
[0359] In step S501, the encoding side determines a residual block corresponding to a block to be encoded. Here, this residual block may be the original residual value block of the block to be encoded, or may be a residual coefficient block obtained by converting this original residual value block, or may be a quantized residual block obtained by the encoding side quantizing this residual coefficient block, and there is no limitation thereto.
[0360] Here, the original residual value block of the block to be coded is a residual block obtained by the coding side based on the original pixel values of the block to be coded and a predicted block of the block to be coded.
[0361] In addition, the process in which the encoding side predicts pixels in the block to be encoded to obtain a predicted block can be realized based on the method described in Example 1, and of course, the predicted block can be obtained based on any method for obtaining a predicted block of the block to be encoded in the prior art, and the embodiments of the present application are not limited thereto.
[0362] The residual coefficient block is obtained by performing a transform process on the original residual value block on the encoding side, and the embodiment of the present application does not specifically limit the process in which the encoding side performs the transform process on the original residual value block.
[0363] The process in which the encoding side quantizes the residual coefficient block to obtain a quantized residual block can be realized based on the method described in Example 2, and of course, can be realized based on any method for quantizing a residual block in the prior art, and the embodiment of the present application is not limited thereto.
[0364] For ease of explanation, the following embodiments of the present application will be described taking a residual coefficient block as an example, where the residual block is the current block to be coded.
[0365] S502: the encoding side encodes the residual block of the encoding target block using a variable code length encoding method to obtain a code stream of the encoding target block.
[0366] Preferably, the variable code length coding scheme may include a variable order exponential Columbus coding scheme. In this way, the coding side may first determine an attribute type of each pixel in the block to be coded. For a first value in the residual block of the block to be coded corresponding to a third pixel of the block to be coded, the coding side may determine a target order for coding the first value based on the preset policy and the attribute type of the third pixel. Then, the coding side may code the first value in the residual block of the block to be coded using an exponential Columbus coding algorithm of the target order. When the coding side codes each value in the residual block of the block to be coded, a coded code stream of the block to be coded can be obtained. Here, the coding side may preset the prediction policy to indicate the order used to code the residual values corresponding to pixels of different attribute types. Here, the third pixel represents at least one pixel in the block to be coded.
[0367] It should be understood that the encoding rules of exponential Columbus coding of different orders are different. Refer to Table 6, which shows the encoding rules (including code word structures and corresponding encoding ranges) of exponential Columbus coding when the order k takes different values. As shown in Table 6, X in the code word structure shown in Table 6 can be 0 or 1.
[0368] [Table 6]
[0369] In this way, for a first value corresponding to a third pixel of a residual block of a block to be coded, the coding side determines a target order for coding the first value based on a preset policy and an attribute type of the third pixel. Then, the coding side can determine a code word structure for coding the first value based on an exponential Columbus coding algorithm of the target order and the magnitude of the first value, and code the first value with the code word structure. Similarly, when the coding side codes each value in the residual block of the block to be coded, a coded code stream of the block to be coded is obtained.
[0370] For example, the encoding side has determined the target order for encoding the first value corresponding to the third pixel as 0 based on the preset policy and the attribute type of the third pixel. Assuming that the first value is 2, as shown in Table 6, if the first value belongs to the encoding range 1-2, the encoding side can determine the codeword structure for encoding the first value as 011 (i.e., the codeword structure corresponding to the encoding range 1-2 is 01X) based on the 0th order exponent Columbus encoding algorithm and the magnitude of the first value. This allows the encoding side to encode the first value with 011. Assuming that the first value is 7, as shown in Table 6, if the first value belongs to the encoding range 7-14, the encoding side can determine the codeword structure for encoding the first value as 00010000 (i.e., the codeword structure corresponding to the encoding range 7-14 is 0001XXXX) based on the 0th order exponent Columbus encoding algorithm and the magnitude of the first value. This allows the encoding side to encode the first value with 00010000. When the encoding side encodes each value in the residual block of the current block, an encoded codestream of the current block is obtained.
[0371] Preferably, the variable code length coding method can also include a preset order exponential Columbus coding method. Note that, the preset order can be a value preset by the coding side, for example, 0 or 1 (i.e., the value of K can be preset 0 or 1), and the embodiment of the present application is not limited thereto.
[0372] As can be seen from Table 6, if the encoding side specifies the order value (i.e., the K value) of the exponential Columbus encoding method in advance, it is also possible to realize variable code length encoding of the residual values in the residual block (or the residual coefficient values in the residual coefficient block).
[0373] It should be understood that after the encoding side encodes the residual block of the block to be encoded, it can determine a syntax element corresponding to the residual block, and for example, the syntax element includes an encoding code length (code length, CL) for encoding each value in the residual block.
[0374] Preferably, the encoding side uses the above-mentioned variable-order exponential Columbus encoding algorithm to encode the CL, so as to achieve the purpose of saving bits, and further to achieve the purpose of increasing the compression rate of image encoding while improving the encoding efficiency.
[0375] For example, for any value in the residual block of the block to be coded, the coding side can determine a target order for coding the CL based on the CL of that value, and then the coding side can code the CL using an exponential Columbus coding algorithm of the target order and append the coded data to the coded codestream of the block to be coded.
[0376] As can be seen, when the encoding side uses the variable-order exponential Columbus encoding algorithm to encode the residual block (or the CL of the residual value in the residual block) of the block to be encoded, it can adaptively encode the smaller residual value (or CL value) with fewer bits, so that the purpose of saving bits can be achieved. That is, the purpose of increasing the compression rate of image encoding and improving the encoding efficiency can be achieved at the same time.
[0377] Preferably, the encoding side can also use fixed length coding and truncated unary coding to encode the CL of each value in the residual block of the encoding target block. For example, for any value in the residual block of the encoding target block, the encoding side can encode the CL of the any value using fixed length coding or truncated unary coding.
[0378] Specifically, if any of the CL values is equal to or less than a threshold, the encoding side encodes the CL value by fixed-length coding using a preset number of bits, and adds the encoded data to the code stream of the block to be encoded. If any of the CL values is greater than the threshold, the encoding side encodes the CL value by truncated unary coding, and adds the encoded data to the code stream of the block to be encoded. Note that the embodiment of the present application does not limit the specific method of taking this threshold.
[0379] As an example, let us take the threshold value as 2. As shown in Table 7, Table 7 shows the codeword obtained by the encoder using 2-bit fixed-length coding for CL values less than or equal to 2, and Table 7 shows the codeword obtained by the encoder using truncated unary coding for CL values greater than 2. Here, if the maximum CL value is represented as CLmax, for CL values greater than 2, the codeword for CLmax contains CLmax-1 1s, the codeword for CLmax-1 contains CLmax-2 1s and 1 0, ..., the codeword for CLmax-j contains CLmax-j-1 1s and 1 0, where j is a positive integer.
[0380] [Table 7]
[0381] It should be understood that the encoding side can also use fixed-length coding and truncated unary coding to encode each value in the residual block of the block to be encoded, and specifically, reference can be made to the description of CL in which the encoding side uses fixed-length coding or truncated unary coding to encode each value in the residual block of the block to be encoded, and redundant description will be omitted here.
[0382] When the coding side uses fixed-length coding and truncated unary coding to code CL (or residual value), it can adaptively code smaller CL value (or residual value) with fewer bits, thus saving bits. That is, it can achieve the purpose of increasing the compression ratio of image coding and improving coding efficiency at the same time.
[0383] As shown in Figure 10b, which is a schematic flowchart of another image decoding method provided by an embodiment of the present application. The method shown in Figure 10b includes the following steps:
[0384] In step S601, the decoding side analyzes the code stream of the block to be decoded using a variable code length decoding method, and obtains CL of each value in the residual block corresponding to the block to be decoded.
[0385] Preferably, the above-mentioned variable code length decoding method can be a variable order exponential Columbus decoding method. The decoding side first analyzes the target order for decoding the code stream of the block to be decoded from the code stream, and then analyzes the code stream of the block to be decoded using the exponential Columbus decoding algorithm of the target order, and can obtain the CL of each value in the residual block of the block to be decoded.
[0386] Here, for the variable order exponential Columbus decoding method, please refer to the description of the variable order exponential Columbus coding method. Since the encoding process is understood to be the inverse operation of the decoding process, a redundant description will be omitted here.
[0387] Preferably, the above-mentioned variable code length decoding method can be a preset order exponential Columbus decoding method. In this case, the decoding side can use a preset order exponential Columbus decoding algorithm to analyze the code stream of the block to be decoded, and obtain the CL of each value in the residual block of the block to be decoded.
[0388] Preferably, when the number of bits of the CL for encoding any value in the residual block of the block to be decoded is a preset number, the decoding side can also analyze the code stream of the block to be decoded based on the fixed-length decoding policy to obtain the CL for encoding any value in the residual block of the block to be decoded. Furthermore, when the number of bits of the CL for encoding any value in the residual block of the block to be decoded is greater than a preset number, the decoding side can analyze the code stream of the block to be decoded based on the rules of truncated unary coding to obtain the CL for encoding any value. Here, for a specific description, the above-mentioned description of the encoding side encoding the CL based on fixed-length coding and truncated unary coding can be referred to. It is understood that the decoding process is an inverse operation of the encoding process, so that redundant description is omitted here.
[0389] S602: The decoding side determines a residual block of the block to be decoded based on the obtained CL.
[0390] After determining the CL of each value in the residual block of the block to be decoded, the encoding side determines the number of bits to encode each value in the residual block. In this way, the decoding side can determine the bit group corresponding to each pixel in the block to be decoded in the code stream of the block to be decoded based on the CL for encoding each value, and determine the target order for analyzing each bit group.
[0391] In one possible case, the decoding side can first determine the attribute type of each pixel in the block to be decoded after analyzing the CL of each value in the residual block of the block to be decoded. Then, for the first bit group corresponding to the third pixel in the block to be decoded, the decoding side can determine the target order for analyzing the first bit group based on the preset policy and the attribute type of the third pixel. In another possible case, when the preset order of the bit group corresponding to each pixel in the block to be decoded is preset in the decoding side, the decoding side determines the preset order of the bit group corresponding to each pixel in the block to be decoded as the target order of each bit group. For example, the attribute type of the pixel may include whether or not there is a symbol in the pixel, the number of bits of the pixel, the format information of the pixel, etc.
[0392] Then, the decoding side can use a target-order exponential Columbus decoding algorithm to analyze the bit groups corresponding to each pixel in the block to be decoded to obtain residual values for each pixel, thereby obtaining a residual block for the block to be decoded.
[0393] It is understood that the order in which the decoding side obtains the residual values in the residual block based on the analysis of the codestream of the block to be decoded is the same as the order in which the encoding side encodes the residual values in the residual block.
[0394] S603: the decoding side reconstructs the block to be decoded based on the residual block of the block to be decoded to obtain a reconstructed block.
[0395] Preferably, when the residual block of the block to be decoded is a residual coefficient block, the decoding end can sequentially perform inverse quantization and inverse transformation on the residual block of the block to be decoded to obtain a reconstructed residual value block of the block to be decoded.Then, the decoding side can reconstruct the block to be decoded based on the reconstructed residual value block to obtain a reconstructed block.For example, the decoding side can obtain a reconstructed block of the block to be decoded by adding the reconstructed residual value block and a prediction block of the block to be decoded.
[0396] Preferably, when the residual block of the block to be decoded is a residual value block, the decoding end can inverse quantize the residual block of the block to be decoded to obtain a reconstructed residual value block of the block to be decoded. Then, the decoding side can reconstruct the block to be decoded based on the reconstructed residual value block to obtain a reconstructed block. For example, the decoding side can obtain a reconstructed block of the block to be decoded by adding the reconstructed residual value block and a prediction block of the block to be decoded.
[0397] Preferably, the decoding side can also determine a target prediction mode for predicting pixels in the block to be decoded based on the code stream of the block to be decoded. The decoding side determines a target prediction order corresponding to the target prediction mode based on the target prediction mode. The decoding side predicts each pixel in the block to be decoded in a target prediction order according to the target prediction mode. The decoding end reconstructs the decoded block based on the predicted value of each pixel in the block to be decoded and the residual block to obtain a reconstructed block. Specifically, the details of any of the above-mentioned embodiments can be referred to the description of Example 1, and redundant description will be omitted here.
[0398] Here, the predicted block of the block to be decoded may be obtained by predicting the decoded block based on a prediction mode, and the prediction mode may be obtained by the decoding end analyzing the code stream of the block to be decoded.Preferably, the prediction mode may be any of the prediction modes in the first embodiment, or the prediction mode may be any of the prediction modes in the prior art, and the embodiment of the present application is not limited thereto.Note that the process of the decoding side predicting the predicted block of the block to be decoded is not described in detail here.
[0399] Here, the process of the decoding end inversely quantizing the residual block of the decoding block can inversely quantize the residual block according to the inverse quantization parameter of each pixel in the decoding target block and the inverse quantization preset array obtained by analyzing the code stream of the decoding target block. Specifically, it can be realized according to the method in the second embodiment, and of course, it can be obtained according to any method that can realize the inverse quantization of the residual block in the prior art, and the embodiment of the present application is not limited thereto.
[0400] In addition, since the image decoding method shown in Figure 10b corresponds to the image encoding method shown in Figure 10a, this method can achieve the goal of increasing the compression rate of image encoding while at the same time improving decoding efficiency.
[0401] In addition, the variable code length encoding / decoding method provided by Example 3 can also be applied to Examples 1 and 2, or to any scene that requires image encoding / decoding, and the embodiments of the present application are not limited thereto.
[0402] It is understood that in order to realize the functions according to the above embodiments, the encoding side / decoding side is equipped with a hardware structure and / or a software module for executing each function. Those skilled in the art should easily recognize that the means and method steps combining each example described in the embodiments disclosed in this application are realized in the form of hardware or a combination of hardware and computer software in this application. Depending on the specific application scene and design constraints related to the technical means, the functions are executed by driving the hardware or computer software.
[0403] A decoding device and an encoding device provided according to an embodiment of the present application will be described below.
[0404] In one example, any of the decoding devices provided by the embodiments of the present application may be the target device 12 or the decoder 122 in Fig. 1. In another example, any of the encoding devices provided below may be the source device 11 or the encoder 112 in Fig. 1. They will be described collectively here, and redundant description will be omitted below.
[0405] FIG. 11 is a schematic diagram of the structure of a decoding device 1100 provided by an embodiment of the present application, and any of the above-mentioned embodiments of the decoding method can be executed by the decoding device 1100. The decoding device 1100 includes an analysis means 1101, a determination means 1102, a prediction means 1103, and a reconstruction means 1104. Here, the analysis means 1101 is used to analyze a code stream of a block to be decoded to determine a target prediction mode for predicting pixels in the block to be decoded. The determination means 1102 is used to determine a target prediction order corresponding to the target prediction mode based on the target prediction mode. The prediction means 1103 is used to predict each pixel in the block to be decoded in a target prediction order corresponding to the target prediction mode according to the determined target prediction mode. The reconstruction means 1104 is used to reconstruct each pixel based on a predicted value of each pixel in the block to be decoded, and obtain a reconstructed block of the block to be decoded.
[0406] In one example, the analyzing means 1101 may be realized by the codestream analyzing means 301 of Fig. 5. The determining means 1102 and the predicting means 1103 are realized by the prediction processing means 304 of Fig. 5, and the reconstructing means 1104 is realized by the reconstructing means 305 of Fig. 5. The coded bitstream of Fig. 5 may be the codestream of the block to be decoded in the embodiment of the present application.
[0407] For more detailed explanations of the above analysis means 1101, decision means 1102, prediction means 1103, reconstruction means 1104, and more detailed explanations of their respective technical features, as well as explanations of beneficial effects, please refer to the corresponding method embodiments described above, and redundant explanations will be omitted here.
[0408] In one possible design form, specifically, when the prediction means 1103 predicts any pixel in the block to be decoded in the target prediction order, the pixel for predicting the any pixel has already been reconstructed.
[0409] In another possible design form, the prediction means 1103 is used to predict each pixel in the block to be decoded dot by dot along a direction indicated by the target prediction order according to the target prediction mode when the target prediction mode indicates that each pixel in the block to be decoded is predicted dot by dot in a target prediction order, where the target prediction order is a first target prediction mode when the target prediction mode is a first target prediction mode, and the target prediction order is a second prediction order when the target prediction mode is a second target prediction mode, and the first prediction order and the second prediction order are different.
[0410] In yet another possible design form, for a block to be decoded having a first size, the prediction means 1103 is specifically used to predict the decoded block in a target prediction mode in a third prediction order, and for a block to be decoded having a second size, the prediction means 1103 is specifically used to predict the decoded block in a target prediction mode in a fourth prediction order, where the third prediction order is different from the fourth prediction order.
[0411] In yet another possible design form, when the target prediction mode indicates to sequentially predict pixels of each sub-block in the block to be decoded as a sub-block unit having a preset size within the block to be decoded, the prediction means 1103 is specifically used to sequentially predict pixels within each sub-block in the block to be decoded along a direction indicated by the target prediction order in accordance with the target prediction mode.
[0412] In yet another possible design form, the target prediction mode includes a prediction mode for each sub-block in the block to be decoded, and for a first sub-block in the block to be decoded, if the first sub-block includes a first pixel and a second pixel, the prediction mode of the first sub-block is used to predict the first pixel and the second pixel in parallel based on reconstructed pixels surrounding the first sub-block.
[0413] In yet another possible design form, the reconstruction means 1104 includes an inverse quantization subunit and a reconstruction subunit, where the inverse quantization subunit is used to inverse quantize a first residual block of a block to be decoded obtained by analyzing a code stream of the block to be decoded according to an inverse quantization parameter of each pixel in the block to be decoded and an inverse quantization preset array obtained by analyzing a code stream of the block to be decoded to obtain a second residual block, and the reconstruction subunit is used to reconstruct each pixel according to a predicted value of each pixel and the second residual block to obtain a reconstructed block.
[0414] In yet another possible design form, the inverse quantization subunit is specifically used for analyzing the code stream of the block to be decoded using a variable code length decoding method to obtain an encoding code length CL for encoding each value of the residual block corresponding to the block to be decoded and a first residual block.
[0415] For detailed descriptions of the above other possible design forms, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and duplicate descriptions will be omitted here.
[0416] FIG. 12 is a schematic diagram of the structure of an encoding device 1200 provided by an embodiment of the present application, and any of the embodiments of the above encoding method can be implemented by this encoding device 1200. The encoding device 1200 includes a determining means 1201, a predicting means 1202, and an encoding means 1203. Here, the determining means 1201 is used to determine a target prediction mode of a block to be encoded and determine a target prediction order corresponding to the target prediction mode. The predicting means 1202 is used to predict each pixel in the block to be encoded in a target prediction order according to the target prediction mode. The determining means 1201 is also used to determine a residual block of the block to be encoded based on a predicted value of each pixel. The encoding means 1203 is used to code the residual block in a target prediction order to obtain a code stream of the block to be encoded.
[0417] In one example, the determining means 1201 and the predicting means 1202 can be realized by the predictive processing means 201 in Fig. 2. The determining means 1201 can be realized by the residual calculating means 202 in Fig. 2. The encoding means 1203 can be realized by the encoding means 205 in Fig. 2. The encoding target block in Fig. 2 may be the encoding target block in the embodiment of the present application.
[0418] For more detailed descriptions of the above-mentioned determination means 1201, prediction means 1202, and encoding means 1203, as well as more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the embodiments of the corresponding methods described above, and redundant descriptions will be omitted here.
[0419] FIG. 13 is a schematic diagram of the structure of a decoding device 1300 provided by an embodiment of the present application, and any of the above-mentioned embodiments of the decoding method can be implemented by the decoding device 1300. The decoding device 1300 includes an analyzing means 1301, an inverse quantizing means 1302, and a reconstructing means 1303. Here, the analyzing means 1301 is also used to analyze the code stream of a block to be decoded, and obtain an inverse quantization parameter of each pixel in the block to be decoded and a first residual block of the block to be decoded. The inverse quantizing means 1302 is also used to inverse quantize the first residual block according to the QP and the quantization preset array indicated by the inverse quantization parameter of each pixel, and obtain a second residual block. The reconstructing means 1303 is also used to reconstruct a decoded block according to the second residual block, and obtain a reconstructed block.
[0420] In one example, the analyzing means 1301 can be realized by the codestream analyzing means 301 in Fig. 5. The inverse quantizing means 1302 can be realized by the inverse quantizing means 302 in Fig. 5. The reconstructing means 1303 can be realized by the reconstructing means 305 in Fig. 5. The coded bitstream in Fig. 5 may be the codestream of the block to be decoded in the embodiment of the present application.
[0421] For more detailed descriptions of the above analysis means 1301, inverse quantization means 1302 and reconstruction means 1303, as well as more detailed descriptions of their respective technical features and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and redundant descriptions will be omitted here.
[0422] In one possible design form, the analyzing means 1301 is specifically used to determine a target prediction mode for predicting pixels in the block to be decoded and an inverse quantization parameter of each pixel in the block to be decoded based on the code stream of the block to be decoded, and to determine a residual scanning order corresponding to the target prediction mode based on the target prediction mode. Wherein, when the target prediction mode is a first target prediction mode, the residual scanning order is a first scanning order, and when the target prediction mode is a second target prediction mode, the residual scanning order is a second scanning order, which are different from the first scanning order and the second scanning order. The code stream of the block to be decoded is analyzed based on the residual scanning order to obtain a first residual block.
[0423] In another possible design form, for a block to be decoded that is a first size, the analysis means 1301 analyzes the code stream of the block to be decoded using a third scanning order in a target prediction mode, and for a block to be decoded that is a second size, the analysis means 1301 analyzes the code stream of the block to be decoded using a fourth scanning order in a target prediction mode, where the third scanning order and the fourth scanning order are different.
[0424] In another possible design form, in the inverse quantization preset sequence, the interval between two adjacent numbers is 1 in the 1st to nth numbers, the interval between two adjacent numbers is 2 in the n+1st to n+mth numbers, and the interval between two adjacent numbers is 2 in the n+k*m+1st to n+k*m+mth numbers. k+1 where n, m are integers greater than 1, and k is a positive integer.
[0425] In yet another possible design form, the inverse quantization means 1302 is specifically used to determine an amplification parameter corresponding to each pixel in the inverse quantization preset array based on the QP of each pixel, and perform an inverse quantization operation on the first residual block based on the amplification parameter corresponding to each pixel to obtain a second residual block.
[0426] In yet another possible design form, the inverse quantization means 1302 is specifically used to determine an amplification parameter and a displacement parameter corresponding to each pixel based on the QP of each pixel and the inverse quantization preset array, where the value of the amplification parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array, and the value of the displacement parameter corresponding to each pixel is the value of the logical AND of the QP of each pixel and 7 corresponding to the value in the inverse quantization preset array. 3 and performing an inverse quantization operation on the first residual block based on the amplification parameter and the displacement parameter corresponding to each pixel to obtain a second residual block.
[0427] In yet another possible design form, the reconstruction means 1303 is specifically used for inverse transforming the second residual block to reconstruct a residual value block of the block to be decoded, and reconstructing the decoded block based on the residual value block to obtain a reconstructed block.
[0428] In yet another possible design form, the reconstruction means 1303 is specifically used to predict each pixel in the block to be decoded in a target prediction order corresponding to the target prediction mode according to the target prediction mode, and to reconstruct the decoded block based on the predicted value of each pixel and the second residual block to obtain a reconstructed block.
[0429] In yet another possible design form, the analysis means 1301 is specifically used for analyzing the code stream of the block to be decoded using a variable code length decoding method to obtain an encoding code length CL for encoding each value in the residual block corresponding to the block to be encoded and a first residual block.
[0430] For detailed descriptions of the possible design forms, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and duplicate descriptions will be omitted here.
[0431] FIG. 14 is a schematic diagram of the structure of an encoding device 1400 provided by an embodiment of the present application, and any of the above-mentioned embodiments of the encoding method can be implemented by the encoding device 1400. The encoding device 1400 includes a determining means 1401, a quantizing means 1402, and an encoding means 1403. Here, the determining means 1401 is used for determining a second residual block of a block to be encoded and a quantization parameter QP of each pixel in the block to be encoded. The quantizing means 1402 is used for quantizing the second residual block according to the QP of each pixel and the quantization preset array to obtain a first residual block. The encoding means 1403 is used for encoding the first residual block to obtain a code stream of the block to be encoded.
[0432] In one example, the determining means 1401 can be realized by the residual calculation means 202 in Fig. 2, or the determining means 1401 can be realized by a combination of the residual calculation means 202 and the residual conversion means 203 in Fig. 2. The quantization means 1402 can be realized by the quantization means 204 in Fig. 2. The encoding means 1403 can be realized by the encoding means 205 in Fig. 2. The encoding target block in Fig. 2 may be the encoding target block in an embodiment of the present application.
[0433] For more detailed descriptions of the above-mentioned determining means 1401, quantizing means 1402, encoding means 1403, and more detailed descriptions of their respective technical features and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and redundant descriptions will be omitted here.
[0434] 15 is a schematic diagram of the structure of an encoding device 1500 provided by an embodiment of the present application, and any of the above-mentioned embodiments of the encoding method can be implemented by the encoding device 1500. The encoding device 1500 includes a determining means 1501 and an encoding means 1502. Here, the determining means 1501 is used for determining a residual block corresponding to a block to be encoded. The encoding means 1502 is used for encoding the residual block using a variable code length encoding scheme to obtain a code stream of the block to be encoded.
[0435] In one example, the determining means 1501 can be realized by the residual calculation means 202 in Fig. 2, or the determining means 1501 can be realized by a combination of the residual calculation means 202 and the residual conversion means 203 in Fig. 2, or the determining means 1501 can be realized by a combination of the residual calculation means 202, the residual conversion means 203, and the quantization means 204 in Fig. 2. The encoding means 1502 can be realized by the encoding means 205 in Fig. 2. The encoding target block in Fig. 2 may be the encoding target block in an embodiment of the present application.
[0436] For a more detailed description of the above-mentioned determining means 1501 and encoding means 1502, and a more detailed description of their respective technical features, and an explanation of the beneficial effects, etc., please refer to the corresponding method embodiment section above, and duplicate explanations will be omitted here.
[0437] FIG. 16 is a schematic diagram of the structure of a decoding device 1600 provided by an embodiment of the present application, and any of the above embodiments of the decoding method can be implemented by the decoding device 1600. The decoding device 1600 includes an analyzing means 1601, a determining means 1602, and a reconstructing means 1603. Here, the analyzing means 1601 is used to analyze the code stream of the block to be decoded using a variable code length decoding method, and obtain an encoding code length CL for encoding each value in the residual block corresponding to the block to be decoded. The determining means 1602 is used to determine the residual block of the block to be decoded according to the CL of each encoded value. The reconstructing means 1603 is used to reconstruct the decoded block according to the residual block of the block to be decoded, and obtain a reconstructed block.
[0438] In one example, the analyzing means 1601 can be realized by the code stream analyzing means 301 of Fig. 5. The determining means 1602 can be realized by the inverse quantizing means 302 of Fig. 5, or the determining means 1602 can be realized by a combination of the inverse quantizing means 302 and the residual inverse transform means 303 of Fig. 5. The reconstructing means 1603 can be realized by the reconstructing means 305 of Fig. 5. The coded bit stream of Fig. 5 may be the code stream of the block to be decoded in the embodiment of the present application.
[0439] For more detailed descriptions of the above analysis means 1601, determination means 1602, and reconstruction means 1603, as well as more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and redundant descriptions will be omitted here.
[0440] In one possible design form, when the variable code length decoding scheme includes a variable order or preset order exponential Columbus decoding scheme, the analysis means 1601 is specifically used for determining a target order for analyzing a CL for encoding each value in the residual block, and analyzing the code stream using an exponential Columbus decoding algorithm of the target order to obtain a CL for encoding each value in the residual block.
[0441] In another possible design form, the analysis means 1601 is specifically used for analyzing the code stream based on a fixed-length decoding policy to obtain a CL for encoding any value in the residual block if the number of bits of the CL for encoding any value in the residual block is a preset number, and for analyzing the code stream based on a truncated unary coding rule to obtain a CL for encoding any value in the residual block if the number of bits of the CL for encoding any value in the residual block is greater than the preset number.
[0442] In yet another possible design form, the determination means 1602 is specifically used to determine a group of bits corresponding to each pixel in the block to be decoded from the code stream based on a CL for encoding each value, determine an attribute type of each pixel in the block to be decoded, and for a first group of bits corresponding to a third pixel in the block to be decoded, determine a target order for analyzing the first group of bits based on a preset policy and the attribute type of the third pixel, and analyze the first group of bits using an exponential Columbus decoding algorithm of the target order to obtain the residual block.
[0443] In a further possible design form, the determination means 1602 is specifically used to determine a group of bits corresponding to each pixel in the block to be decoded from the code stream based on a CL for encoding each of the above values, and for a first group of bits corresponding to a third pixel in the block to be decoded, to analyze the first group of bits using an exponential Columbus decoding algorithm of a preset order to obtain the residual block.
[0444] In a further possible design form, the reconstruction means 1603 is specifically used for performing inverse quantization and inverse transformation on the residual block, or for inverse quantizing the residual block, to reconstruct a residual value block of the block to be decoded, and for reconstructing the block to be decoded based on the residual value block, to obtain the reconstructed block.
[0445] In a further possible design form, the reconstruction means 1603 is specifically used to determine a target prediction mode for predicting pixels in the block to be decoded based on the code stream of the block to be decoded, determine a target prediction order corresponding to the target prediction mode based on the target prediction mode, predict each pixel in the block to be decoded in the target prediction order according to the target prediction mode, reconstruct the block to be decoded based on the predicted value of each pixel in the block to be decoded and the residual block, and obtain a reconstructed block.
[0446] In a further possible design form, the reconstruction means 1603 is specifically used to inverse quantize the residual block based on the inverse quantization parameter of each pixel in the block to be decoded and the inverse quantization preset array obtained by analyzing the code stream of the block to be decoded.
[0447] For detailed descriptions of the possible design forms, more detailed descriptions of their respective technical features, and descriptions of beneficial effects, please refer to the corresponding method embodiments described above, and duplicate descriptions will be omitted here.
[0448] The present application further provides an electronic device for performing any of the above image encoding / decoding method embodiments. As shown in Fig. 17, Fig. 17 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application, which includes a processor 1701 and a communication interface 1702. The processor 1701 and the communication interface 1702 are coupled to each other. It is understood that the communication interface 1702 is a transceiver or an input / output interface.
[0449] In one example, the electronic device 1700 further includes a memory 1703, which is used to store instructions executed by the processor 1701, or input data required for the processor 1701 to execute the instructions, or data generated after the processor 1701 executes the instructions.
[0450] In the embodiment of the present application, the specific connection medium between the communication interface 1702, the processor 1701, and the memory 1703 is not limited. In the embodiment of the present application, the communication interface 1702, the processor 1701, and the memory 1703 are connected via a bus 1704 in FIG. 17, and the bus is shown by a thick line in FIG. 17, and the connection form between other components is only roughly described and is not limited. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of illustration, the bus is shown by a single thick line in the figure, but this does not mean that there is only one bus or only one type of bus.
[0451] The memory 1703 can be used to store software programs and modules, such as program instructions / modules corresponding to an image decoding method or an image encoding method provided by an embodiment of the present application. The processor 1701 executes various functional applications and data processing to realize any of the above image decoding methods or image encoding methods by executing the software programs and modules stored in the memory 1703. The communication interface 1702 can be used to communicate signaling or data with other devices. In the present application, the electronic device 1700 may include multiple communication interfaces 1702.
[0452] The processor in the embodiments of the present application may be a central processing unit (CPU), a neural processing unit (NPU), or a graphic processing unit (GPU), or may be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware, or a combination thereof. The general-purpose processor may be a microprocessor or a conventional processor.
[0453] The steps of the method in the embodiments of the present application may be implemented by hardware or may be implemented by a processor executing software instructions. The software instructions are configured by corresponding software blocks, which may be stored in a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known in the art. Exemplarily, the storage medium is coupled to the processor such that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may be a component of the processor. The processor and the storage medium may be present in an ASIC. Furthermore, the ASIC may be present in a network device or a terminal device. Of course, the processor and the storage medium may be present as separate components in the network device or the terminal device.
[0454] The present application further provides a computer-readable storage medium having stored thereon a computer program or instructions which, when executed by a processor, realises any of the above image encoding / decoding method embodiments.
[0455] The present application further provides an image encoding / decoding system, comprising an encoding side and a decoding side, the encoding side being used to perform any of the above image encoding methods, and the decoding side being used to perform a corresponding image encoding method.
[0456] The above embodiments may be realized in whole or in part by software, hardware, firmware, or any combination thereof. When realized in software, the whole or in part may be realized in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or a part of the processes or functions described in the embodiments of the present application are generated. 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 may be transmitted from a computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center via wire or wireless. The computer-readable storage medium may be any available medium accessible by a computer, or a data storage device such as a server, data center, or the like that aggregates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape, an optical medium, such as a digital video disc (DVD), or a semiconductor medium, such as a solid state disk (SSD).
[0457] In each embodiment of the present application, unless there is a specific explanation and logical conflict, the terms and / or descriptions between different embodiments are consistent and can refer to each other, and the technical features in different embodiments can be combined based on their inherent logical relationships to form a new embodiment.
[0458] It is understood that the various numerals in the embodiments of the present application are only for the convenience of explanation and are not intended to limit the scope of the embodiments of the present application. The magnitude of the sequence number of each process does not mean the order of execution, and the execution order of each process must be determined by its function and inherent logic. The above description is only a preferred embodiment of the present application and does not limit the present application. Any amendments, equivalent replacements, modifications, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. 1. An image decoding method, comprising: analyzing a codestream of a block to be decoded to determine a target prediction mode for predicting pixels in the block to be decoded; determining a target prediction order corresponding to the target prediction mode based on the target prediction mode; predicting each pixel in the current block in the target prediction order according to the target prediction mode; reconstructing each pixel based on the predicted value of each pixel to obtain a reconstructed block of the block to be decoded.
13. An image decoding method comprising:
2. When predicting any pixel in the block to be decoded in the target prediction order, a pixel for predicting the any pixel is already reconstructed.
2. The image decoding method according to claim 1, wherein the image decoding method comprises:
3. When the target prediction mode indicates that each pixel in the block to be decoded is predicted dot by dot in the target prediction order, predicting each pixel in the current block to be decoded in the target prediction order according to the target prediction mode, predicting, for each pixel in the block to be decoded, in a direction indicated by the target prediction order according to the target prediction mode, for each pixel in the block to be decoded, when the target prediction mode is a first target prediction mode, the target prediction order is a first prediction order, and when the target prediction mode is a second target prediction mode, the target prediction order is a second prediction order, and the first prediction order and the second prediction order are different from each other.
3. The image decoding method according to claim 2, wherein the image decoding method comprises:
4. For the block to be decoded having a first size, the target prediction mode predicts the block to be decoded in a third prediction order, and for the block to be decoded having a second size, the target prediction mode predicts the block to be decoded in a fourth prediction order, and the third prediction order and the fourth prediction order are different.
4. The image decoding method according to claim 3, wherein the image decoding method comprises:
5. When the target prediction mode indicates that pixels in each sub-block in the block to be decoded are predicted sequentially in units of sub-blocks of a preset size in the block to be decoded, predicting each pixel in the block to be decoded in the target prediction order according to the target prediction mode includes: and sequentially predicting pixels in each sub-block in the block to be decoded in accordance with the target prediction mode along a direction indicated by the target prediction order.
3. The image decoding method according to claim 2, wherein the image decoding method comprises:
6. The target prediction mode includes a prediction mode for each sub-block in the block to be decoded, and for a first sub-block in the block to be decoded, if the first sub-block includes a first pixel and a second pixel, the prediction mode of the first sub-block is used to predict the first pixel and the second pixel in parallel based on reconstructed pixels around the first sub-block.
6. The image decoding method according to claim 5,
7. Reconstructing each pixel based on a predicted value of each pixel to obtain a reconstructed block of the block to be decoded, based on an inverse quantization parameter and an inverse quantization preset array for each pixel in the block to be decoded obtained by analyzing the code stream of the block to be decoded, to obtain a second residual block; reconstructing each of the pixels based on the predicted value of each of the pixels and the second residual block to obtain the reconstructed block.
7. The image decoding method according to claim 1, wherein the first and second decoding steps are performed in a step of decoding the image.
8. Analyzing the code stream of the block to be decoded includes: analyzing the code stream of the block to be decoded using a variable code length decoding scheme to obtain a coding code length CL for coding each value in a residual block corresponding to the block to be decoded and a first residual block.
8. The image decoding method according to claim 7,
9. 1. An image encoding method, comprising: determining a target prediction mode for a block to be encoded and determining a target prediction order corresponding to the target prediction mode; predicting each pixel in the current block in the target prediction order according to the target prediction mode; determining a residual block of the current block based on the predicted value of each pixel; encoding the residual block in the target prediction order to obtain a codestream for the current block.
1. An image coding method comprising:
10. 1. An image decoding method, comprising: Analyzing a code stream of a block to be decoded to obtain an inverse quantization parameter for each pixel in the block to be decoded and a first residual block of the block to be decoded; Inverse quantizing the first residual block based on a quantization parameter QP indicated by the inverse quantization parameter of each pixel and an inverse quantization preset array to obtain a second residual block; reconstructing the block to be decoded based on the second residual block to obtain a reconstructed block.
13. An image decoding method comprising:
11. Analyzing the code stream of the block to be decoded and obtaining an inverse quantization parameter for each pixel in the block to be decoded and a first residual block of the block to be decoded includes: determining a target prediction mode for predicting pixels in a block to be decoded and an inverse quantization parameter for each pixel in the block to be decoded based on a code stream of the block to be decoded; determining a residual scanning order corresponding to the target prediction mode based on the target prediction mode, where if the target prediction mode is a first target prediction mode, the residual scanning order is a first scanning order, and if the target prediction mode is a second target prediction mode, the residual scanning order is a second scanning order, and the first scanning order and the second scanning order are different; analyzing a codestream of the block to be decoded based on the residual scan order to obtain the first residual block.
11. The image decoding method according to claim 10,
12. For the block to be decoded having a first size, a code stream of the block to be decoded is analyzed using a third scanning order in the target prediction mode, and for the block to be decoded having a second size, a code stream of the block to be decoded is analyzed using a fourth scanning order in the target prediction mode, and a code stream of the block to be decoded having a second size is analyzed using a fourth scanning order in the target prediction mode, and a code stream of the block to be decoded having a first size is analyzed using a third scanning order in the target prediction mode, and a code stream of the block to be decoded having a second size is analyzed using a fourth ...
12. The image decoding method according to claim 11,
13. 1. An image decoding method, comprising: analyzing a code stream of a block to be decoded using a variable code length decoding scheme to obtain a coding code length CL for coding each value in a residual block corresponding to the block to be decoded; determining a residual block based on a CL for encoding each of the values; reconstructing the block to be decoded based on the residual block to obtain a reconstructed block.
13. An image decoding method comprising:
14. The variable code length decoding method includes an exponential Columbus decoding method with a transformable order or a preset order; Analyzing a code stream of the block to be decoded using the variable code length decoding method and obtaining a coding code length CL for coding each value of a residual block corresponding to the block to be decoded, determining a target order for analyzing a CL for encoding each value in the residual block; parsing the codestream using an exponential Columbus decoding algorithm of the target order to obtain a CL for encoding each value in the residual block.
14. The image decoding method according to claim 13,
15. Analyzing a code stream of a block to be decoded using the variable code length decoding method and obtaining a coding code length CL for coding each value in a residual block corresponding to the block to be decoded, When the number of bits of a CL for encoding any value in the residual block is a preset number, analyzing the codestream based on a fixed length decoding policy to obtain a CL for encoding the any value; If the number of bits of a CL for encoding any value in the residual block is greater than a preset number, analyzing the codestream based on a truncated unary coding rule to obtain a CL for encoding the any value.
14. The image decoding method according to claim 13,
16. Determining the residual block based on a CL for encoding each of the values includes: determining a set of bits in the codestream corresponding to each pixel in the block to be decoded based on a CL for encoding each of the values; determining an attribute type of each pixel in the block to be decoded; determining a target order for analyzing a first group of bits corresponding to a third pixel in the block to be decoded based on a preset policy and an attribute type of the third pixel; parsing the first group of bits using an Exponential Columbus Decoding Algorithm of the target order to obtain the residual block.
14. The image decoding method according to claim 13,
17. Determining the residual block based on a CL for encoding each of the values includes: determining a set of bits in the codestream corresponding to each pixel in the block to be decoded based on a CL for encoding each of the values; and analyzing a first group of bits corresponding to a third pixel in the block to be decoded using an Exponential Columbus Decoding Algorithm of a preset order to obtain the residual block.
14. The image decoding method according to claim 13,
18. Reconstructing the current block based on the residual block to obtain a reconstructed block, reconstructing a residual value block of the block to be decoded by performing inverse quantization and inverse transformation on the residual block or by inverse quantizing the residual block; reconstructing the block to be decoded based on the residual value block to obtain the reconstructed block. The image decoding method according to any one of claims 13 to 17.
19. Reconstructing the current block based on the residual block to obtain a reconstructed block, determining a target prediction mode for predicting pixels in a block to be decoded based on a code stream of the block; determining a target prediction order corresponding to the target prediction mode based on the target prediction mode; predicting each pixel in the current block in the target prediction order according to the target prediction mode; reconstructing the block to be decoded based on the prediction value of each pixel in the block to be decoded and the residual block to obtain the reconstructed block.
20. The image decoding method according to claim 18,
20. quantizing the residual block and inverse quantizing the residual block based on an inverse quantization parameter of each pixel in the block to be decoded and an inverse quantization preset array obtained by analyzing a code stream of the block to be decoded.
20. The image decoding method according to claim 18,
21. An image decoding device comprising an analysis means, a determination means, a prediction means, and a reconstruction means, the analyzing means is used to analyze a code stream of a block to be decoded and determine a target prediction mode for predicting pixels in the block to be decoded; the determination means is used to determine a target prediction order corresponding to the target prediction mode based on the target prediction mode, the prediction means is used to predict each pixel in the current block in the target prediction order according to the target prediction mode; The reconstruction means is used to reconstruct each of the pixels based on a predicted value of each of the pixels to obtain a reconstructed block of the block to be decoded.
1. An image decoding device comprising:
22. An image decoding device, comprising: analysis means for analyzing a code stream of a block to be decoded and obtaining an inverse quantization parameter for each pixel in the block to be decoded and a first residual block of the block to be decoded; an inverse quantization means for inverse quantizing the first residual block based on a QP indicated by the inverse quantization parameter of each pixel and an inverse quantization preset array to obtain a second residual block; and a reconstruction means for reconstructing the block to be decoded based on the second residual block to obtain a reconstructed block.
1. An image decoding device comprising:
23. An image decoding device, comprising: analysis means for analyzing a code stream of a block to be decoded using a variable code length decoding method to obtain a coding code length CL for coding each value in a residual block corresponding to the block to be decoded; determining means for determining the residual block based on a CL for encoding each of the values; and a reconstruction means for reconstructing the block to be decoded based on the residual block to obtain a reconstructed block.
1. An image decoding device comprising:
24. An electronic device comprising a processor and a memory, the memory being adapted to store computer instructions, the processor being adapted to retrieve and execute the computer instructions from the memory so as to implement the method according to any one of claims 1 to 20. An electronic device comprising:
25. A computer readable storage medium having stored thereon a computer program or instructions which, when executed by a processor, implements the method of any one of claims 1 to 20. A computer-readable storage medium comprising:
Citation Information
Patent Citations
Decoding system, decoder and decoding circuit
JP1996130745A
Method and device for encoding video signal
JP1997200777A
Image encoding apparatus and image encoding program
JP2007300389A
Adaptive Coding of Prediction Errors in Hybrid Video Coding
JP2009522968A
Improving intra-prediction in HEVC lossless coding
JP2015515226A