A decoding and encoding method, device and equipment thereof

By adjusting the reconstructed values ​​based on the feature information of the image region in the shallow coding method, the quantization error and color block problem caused by the large quantization step size of shallow coding are solved, the coding and decoding performance is improved, and subjective lossless coding effect is achieved.

CN116095307BActive Publication Date: 2024-10-25HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202210458047.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2024-10-25
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

Shallow coding methods, especially in flat regions, are prone to quantization errors and color block issues when using large quantization steps, leading to subjective loss.

Method used

By determining whether the reconstructed values ​​need to be adjusted based on the feature information of the image region during the encoding and decoding process, and obtaining the corresponding adjustment parameters for adjustment, quantization errors and color block problems can be reduced.

Benefits of technology

It improves encoding and decoding performance, reduces quantization errors, especially in flat areas, avoids subjective loss, and achieves subjectively lossless encoding effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116095307B_ABST
    Figure CN116095307B_ABST
Patent Text Reader

Abstract

The present application provides a decoding and encoding method, apparatus and device thereof, the decoding method comprising: determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area; if it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining the adjustment parameter corresponding to the current image area from the code stream corresponding to the current image area; adjusting the reconstruction value of the current image area based on the adjustment parameter. The present application can improve encoding performance and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of coding and decoding technology, and in particular to a decoding and coding method, device and equipment thereof. Background Art

[0002] In order to save space, video images are transmitted after being encoded. Complete video encoding can include prediction, transformation, quantization, entropy coding, filtering and other processes. For the prediction process, the prediction process can include intra-frame prediction and inter-frame prediction. Inter-frame prediction refers to the use of the correlation in the video time domain to use the pixels of the adjacent encoded images to predict the current pixel, so as to effectively remove the redundancy in the video time domain. Intra-frame prediction refers to the use of the correlation in the video space domain to use the pixels of the encoded blocks of the current frame image to predict the current pixel, so as to remove the redundancy in the video space domain.

[0003] Shallow coding is a method of implementing prediction technology. Shallow coding is a simple prediction method that is suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements. However, when using the shallow coding prediction method, a larger quantization step size often causes a larger quantization error, especially in flat areas. The overall deviation will cause color blocks, resulting in subjective loss. Summary of the invention

[0004] In view of this, the present application provides a decoding and encoding method, device and equipment thereof to improve encoding performance.

[0005] The present application provides a decoding method, which is applied to a decoding end, and the method includes:

[0006] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0007] If it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining an adjustment parameter corresponding to the current image area from a bitstream corresponding to the current image area;

[0008] The reconstruction value of the current image area is adjusted based on the adjustment parameter.

[0009] The present application provides an encoding method, which is applied to an encoding end, and the method includes:

[0010] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0011] If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, where the adjustment parameter is used to adjust the reconstruction value of the current image area;

[0012] The adjustment parameters corresponding to the current image area are encoded in a code stream corresponding to the current image area.

[0013] The present application provides a decoding device, the decoding device comprising:

[0014] a memory configured to store video data;

[0015] A decoder configured to implement:

[0016] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0017] If it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining an adjustment parameter corresponding to the current image area from a bitstream corresponding to the current image area;

[0018] The reconstruction value of the current image area is adjusted based on the adjustment parameter.

[0019] The present application provides a coding device, the coding device comprising:

[0020] a memory configured to store video data;

[0021] An encoder configured to implement:

[0022] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0023] If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, where the adjustment parameter is used to adjust the reconstruction value of the current image area;

[0024] The adjustment parameters corresponding to the current image area are encoded in a code stream corresponding to the current image area.

[0025] The present application provides a decoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;

[0026] The processor is used to execute machine executable instructions to implement the above decoding method.

[0027] The present application provides an encoding end device, comprising: a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;

[0028] The processor is used to execute machine executable instructions to implement the encoding method described in the claims above.

[0029] It can be seen from the above technical solutions that in the embodiment of the present application, a shallow coding method is proposed, which can be applicable to scenes with high real-time requirements, small cache, and high parallelism requirements. After obtaining the reconstruction value of the current image area, the reconstruction value of the current image area can also be adjusted, so that the reconstructed pixel can be closer to the original pixel, bringing about the improvement of encoding performance and decoding performance. For larger quantization step sizes, the quantization error is reduced, especially in flat areas, and the color block problem caused by the overall deviation is reduced, which can avoid subjective loss, that is, the shallow coding method can achieve subjective losslessness and simple hardware implementation. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1A-Figure 1C It is a schematic diagram of the working principle of the intra-frame prediction mode;

[0031] Figure 2A-2D is a schematic diagram of a shallowly coded video coding framework;

[0032] Figure 3 is a flowchart of an encoding method in one embodiment of the present application;

[0033] Figure 4 is a flowchart of a decoding method in one embodiment of the present application;

[0034] Figure 5A-5D is a schematic diagram of dividing image blocks in one implementation manner of the present application;

[0035] Figure 6A-6J is a schematic diagram of dividing image blocks in one implementation manner of the present application;

[0036] Fig. 7A is a hardware structure diagram of a decoding end device in one embodiment of the present application;

[0037] Figure 7B It is a hardware structure diagram of an encoding end device in one implementation of the present application. DETAILED DESCRIPTION

[0038] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than for limiting the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to any or all possible combinations of one or more associated listed items. It should be understood that, although the terms first, second, third, etc. may be used to describe various information in the embodiments of the present application, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information, depending on the context. In addition, the word "if" used can be interpreted as "at ... ", or "when ... ", or "in response to determination".

[0039] In the embodiments of the present application, a decoding and encoding method, apparatus and device thereof are proposed, which may involve the following concepts:

[0040] Intra prediction, inter prediction and IBC (intra block copy) prediction:

[0041] Intra-frame prediction refers to the use of the correlation in the video spatial domain to predict the coded blocks of the current block to remove the spatial redundancy of the video. Intra-frame prediction specifies multiple prediction modes, each of which corresponds to a texture direction (except DC mode). For example, if the image texture is arranged horizontally, the horizontal prediction mode can better predict the image information.

[0042] Inter-frame prediction refers to the use of adjacent coded image pixels to predict the pixels of the current image based on the correlation of the video time domain. Since the video sequence contains strong temporal correlation, it can effectively remove the temporal redundancy of the video. The inter-frame prediction part of the video coding standard uses block-based motion compensation technology. The main principle is to find a best matching block in the previously coded image for each pixel block of the current image. This process is called motion estimation (ME).

[0043] Intra Block Copy (IBC) means that the same frame reference is allowed, and the reference data of the current block comes from the same frame. Intra Block Copy can also be called Intra Block Copy. In the intra block copy technology, the block vector of the current block can be used to obtain the prediction value of the current block. For example, based on the characteristic that there are a large number of repeated textures in the same frame of the screen content, when the block vector is used to obtain the prediction value of the current block, the compression efficiency of the screen content sequence can be improved.

[0044] Prediction Signal: Prediction signal refers to the pixel value derived from the coded pixel. The residual is obtained by the difference between the original pixel and the predicted pixel, and then the residual transform quantization and coefficient encoding are performed. The prediction pixel between frames refers to the pixel value derived from the reference frame of the current block. Since the pixel position is discrete, interpolation operation is required to obtain the final prediction pixel. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two, and the higher the coding compression performance.

[0045] Intra-frame prediction mode: In intra-frame coding, the intra-frame prediction mode is used for motion compensation, that is, the intra-frame prediction mode is used to obtain the prediction value of the current block. The intra-frame prediction mode is a mode that only uses the reconstruction value and prediction value of the current frame for prediction. For example, the intra-frame prediction mode may include but is not limited to the DC mode, bilinear mode, angle prediction mode (such as horizontal angle prediction mode, vertical angle prediction mode, etc., there is no restriction on this angle prediction mode, it can be any angle, such as 33 angle modes or 67 angle modes), IBC mode, ISC mode, Planar mode, point-by-point prediction mode.

[0046] DC mode and angle prediction mode can be found in Figure 1A As shown in the figure, the DC mode is suitable for large flat areas, and the average value of the surrounding pixels of the current block is used as the prediction value of the current block. The angle prediction mode uses the value of the surrounding pixels of the current block pointed to by a certain angle as the prediction value of the current block. Figure 1A In the figure, a is a schematic diagram of the DC mode, where the average of the 16 reference pixels on the upper side of "D" is used as the predicted value of "D". b is a schematic diagram of angle prediction mode 1, indicating that the value of the reference pixel pointed to by the angle is used as the predicted value of the current block. c is a schematic diagram of angle prediction mode 2, d is a schematic diagram of angle prediction mode 3, e is a schematic diagram of angle prediction mode 4, f is a schematic diagram of angle prediction mode 6, and g is a schematic diagram of angle prediction mode 6.

[0047] bilinear mode is bilinear interpolation mode, see Figure 1BAs shown, the prediction process of the bilinear mode is as follows: first, the prediction value of the lower right corner C position is generated (the weighted average of the upper right corner reference pixel A and the lower left corner reference pixel B), then the prediction value of the right boundary AC position is generated (the weighted average of the prediction value of the upper right corner reference pixel A and the lower right corner C position), and then the prediction value of the lower boundary BC position is generated (the weighted average of the prediction value of the lower left corner reference pixel B and the lower right corner C position), and the prediction values ​​of the remaining other internal pixels are generated by the weighted average of the horizontal linear prediction and the vertical linear prediction. The prediction value generated by the horizontal linear prediction is the weighted average of the prediction value of the reference pixel L at the corresponding position on the left and the prediction value of the right boundary AC position; the prediction value generated by the vertical linear prediction is the weighted average of the prediction value of the reference pixel T at the corresponding position on the top and the prediction value of the lower boundary BC position.

[0048] Planar mode (or Plane mode) is suitable for areas where pixel values ​​change slowly. It uses two linear filters in the horizontal and vertical directions and takes the average of the two as the predicted value of the current block pixel. Planar mode is a gradient mode. Planar mode is an intra-frame prediction mode that uses reference pixels at different positions and different weight parameters to obtain the predicted value.

[0049] The IBC mode (Intra Block Copy) uses the decoded part of the current frame to perform a motion estimation-like method to obtain the prediction value of the current block. The ISC mode (Intra String Copy) arranges the pixels in the current block into several one-dimensional pixel groups in a certain scanning order (generally a horizontal raster scanning order or a vertical raster scanning order), and performs a motion estimation-like method on each pixel group to obtain the prediction value of the pixel group.

[0050] Point-by-point prediction mode, see Figure 1C As shown in FIG. 4 , it is a schematic diagram of four point-by-point prediction modes for a 16*2 pixel block. For example, there may be four point-by-point prediction modes for a 16*2 pixel block, and each point-by-point prediction mode uses a 16*2 entire block as a basic unit for prediction. Figure 1C In , ≡ is used to indicate that the predicted value of the current pixel is obtained by averaging the reconstructed values ​​of the left and right pixels; ||| is used to indicate that the predicted value of the current pixel is obtained by averaging the reconstructed values ​​of the upper and lower pixels; > is used to indicate that the reconstructed value of the left pixel is directly used as the predicted value of the current pixel; ∨ is used to indicate that the reconstructed value of the upper pixel is directly used as the predicted value of the current pixel. Figure 1C It can be seen that for point-by-point prediction mode 1, the prediction of Group 2 needs to rely on the reconstruction of Group 1, and for point-by-point prediction mode 2, the prediction of Group 1 needs to rely on the reconstruction of Group 2.

[0051] Rate-Distortion Optimized: There are two major indicators for evaluating coding efficiency: bit rate and PSNR (Peak Signal to Noise Ratio). The smaller the bit stream, the greater the compression rate, and the greater the PSNR, the better the quality of the reconstructed image. When selecting a mode, the discriminant formula is essentially a comprehensive evaluation of the two. For example, the cost corresponding to the mode: J(mode) = D + λ*R, where D represents Distortion, which can usually be measured using the SSE indicator. SSE refers to the mean square sum of the difference between the reconstructed image block and the source image. In order to achieve cost considerations, the SAD indicator can also be used. SAD refers to the sum of the absolute values ​​of the difference between the reconstructed image block and the source image; λ is the Lagrange multiplier, and R is the actual number of bits required for encoding the image block in this mode, including the sum of bits required for encoding mode information, motion information, residuals, etc. When selecting a mode, if the rate-distortion principle is used to make a comparison decision on the encoding mode, the best encoding performance can usually be guaranteed.

[0052] Code control: Control the stability of the bit rate, generally by adjusting the quantization step size to achieve the goal of bit rate stability.

[0053] Shallow coding: Shallow coding is a way to implement prediction technology. Shallow coding is a simple prediction method that is suitable for application scenarios with high real-time requirements, small cache, and high parallel requirements. Shallow coding has low compression efficiency and can use intra-frame prediction with a low compression ratio. In the implementation process of shallow coding, subjective losslessness and simple hardware implementation are generally required.

[0054] Shallow video coding framework: see Figure 2A , which is a video encoding framework of the encoding end, and the video encoding framework can be used to implement the encoding end processing flow of the embodiment of the present application, that is, to implement shallow encoding. Figure 2A Similarly, without repeating the details here, the video decoding framework can be used to implement the decoding end processing flow of the embodiment of the present application.

[0055] For example, see Figure 2AAs shown, the video encoding framework may include modules such as block division, prediction, transformation, quantization, code control, entropy encoder, inverse quantization, inverse transformation, and reconstruction. At the encoding end, the encoding end processing flow can be realized through the cooperation between these modules. In addition, the video decoding framework may include modules such as block division, prediction, transformation, quantization, code control, entropy decoder, inverse quantization, inverse transformation, and reconstruction. In this case, the code control module belonging to the encoding end may also act on the decoding end to save the encoding cost of the quantization parameter and control the prediction mode, etc.; or, the video decoding framework may include modules such as block division, prediction, transformation, quantization, entropy decoder, inverse quantization, inverse transformation, and reconstruction. In this case, there is no code control module. At the decoding end, the decoding end processing flow can be realized through the cooperation between these modules.

[0056] Exemplarily, in a shallow compression scenario, the code control technology is applied to a code control unit, and the code control unit is the scope of the code control, which means that the code control operation is performed on the code control unit. For example, the code control unit can be several image blocks, or the code control unit can be several pixel rows, or the code control unit can be the entire Slice, or the code control unit can be several pixel blocks inside a Slice, or the code control unit can be several pixel rows inside a Slice, etc. Of course, the above are just a few examples of code control units, and there is no limitation on this code control unit. On this basis, the pixel blocks in each code control unit can be predicted, transformed, quantized, and the like, and the mode selection of the prediction part is participated by the code control. After the pixel block is reconstructed, the reconstruction value adjustment operation can be performed.

[0057] The following is a brief introduction to the structure of the encoding and decoding ends. Figure 2B , a schematic block diagram of an example of an encoding end for implementing an embodiment of the present application is shown. Figure 2B In the embodiment, the encoding end includes a prediction processing unit, a residual calculation unit, a transform processing unit, a quantization unit, an encoding unit, an inverse quantization unit (also referred to as an inverse quantization unit), an inverse transform processing unit (also referred to as an inverse transform processing unit), a reconstruction unit (or referred to as a reconstruction unit), and a filter unit. In one example, the encoding end may further include a buffer and a decoded image buffer, wherein the buffer is used to cache the reconstructed image blocks output by the reconstruction unit, and the decoded image buffer is used to cache the filtered image blocks output by the filter unit.

[0058] The input of the encoding end (also called an encoder) is an image block of an image (which can be called an image to be encoded), and the image block can also be called a current block or a block to be encoded. The encoding end can also include a segmentation unit (not shown in the figure), which is used to segment the image to be encoded into multiple image blocks. The encoding end is used to encode block by block to complete the encoding of the image to be encoded, for example, to perform the encoding process on each image block. The prediction processing unit is used to receive or obtain an image block (the current image block to be encoded of the current image to be encoded, which can also be called a current block, and the image block can be understood as the true value of the image block) and reconstructed image data, and predict the current block based on the relevant data in the reconstructed image data to obtain a prediction block of the current block. In an example, the prediction processing unit can include an inter-frame prediction unit, an intra-frame prediction unit and a mode selection unit, and the mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode. If the intra-frame prediction mode is selected, the prediction process is performed by the intra-frame prediction unit, and if the inter-frame prediction mode is selected, the prediction process can be performed by the inter-frame prediction unit.

[0059] The residual calculation unit is used to calculate the residual between the real value of the image block and the prediction block of the image block to obtain the residual block. For example, the residual calculation unit can subtract the pixel value of the prediction block from the pixel value of the image block pixel by pixel.

[0060] The transform processing unit is used to perform a transform, such as discrete cosine transform (DCT) or discrete sine transform (DST), on the residual block to obtain a transform coefficient in the transform domain. The transform coefficient may also be referred to as a transform residual coefficient, which may represent the residual block in the transform domain.

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

[0062] The coding unit is used to encode the above-mentioned quantized residual coefficients, output the encoded image data (i.e., the encoding result of the current image block to be encoded) in the form of an encoded bit stream, and then transmit the encoded bit stream to the decoder, or store it, and then transmit it to the decoder or use it for retrieval. The coding unit can also be used to encode other syntax elements of the current image block, such as encoding the prediction mode into the bit stream, etc. The coding algorithm includes but is not limited to a variable length coding (VLC) algorithm, a context adaptive VLC (CAVLC) algorithm, an arithmetic coding algorithm, a context adaptive binary arithmetic coding (CABAC) algorithm, a syntax-based context-adaptive binary arithmetic coding (SBAC) algorithm, and a probability interval partitioning entropy (PIPE) algorithm.

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

[0064] The inverse transform processing unit is used to perform an inverse transform on the inverse quantized coefficients. It should be understood that the inverse transform is the reverse application of the transform processing unit. For example, the inverse transform may include an inverse discrete cosine transform (DCT) or an inverse discrete sine transform (DST) to obtain an inverse transform block in a pixel domain (or sample domain). The inverse transform block may also be referred to as an inverse transform dequantized block or an inverse transform residual block.

[0065] The reconstruction unit is used to add the inverse transform block (i.e., the inverse transform residual block) to the prediction block to obtain a reconstructed block in the sample domain. The reconstruction unit can be a summer, for example, adding the sample value (i.e., pixel value) of the residual block to the sample value of the prediction block. The reconstructed block output by the reconstruction unit can be subsequently used to predict other image blocks, for example, in an intra-frame prediction mode.

[0066] The filter unit (or simply "filter") is used to filter the reconstructed block to obtain a filtered block, so as to smoothly perform pixel conversion or improve image quality. The filter unit can be a loop filter unit, which is intended to represent one or more loop filters. For example, the filter unit can be a deblocking filter, a sample adaptive offset (sample-adaptive offset, SAO) filter or other filters, such as a bilateral filter, an adaptive loop filter (adaptive loop filter, ALF), or a sharpening or smoothing filter, or a collaborative filter. In an example, the filtered block output by the filter unit can be subsequently used to predict other image blocks, for example, in an inter-frame prediction mode, without limitation.

[0067] See also Figure 2C , a schematic block diagram of an example of an encoding end (also referred to as a decoder) for implementing an embodiment of the present application is shown. The decoder is used to receive, for example, encoded image data (i.e., an encoded bit stream, for example, an encoded bit stream including an image block and associated syntax elements) encoded by an encoder to obtain a decoded image. The decoder includes a decoding unit, an inverse quantization unit, an inverse transform processing unit, a prediction processing unit, a reconstruction unit, and a filter unit. In some examples, the decoder may perform operations substantially similar to Figure 2B The decoding pass is the inverse of the encoding pass described by the encoder. In one example, the decoder may further include a buffer and a decoded image buffer, wherein the buffer is used to cache the reconstructed image blocks output by the reconstruction unit, and the decoded image buffer is used to cache the filtered image blocks output by the filter unit.

[0068] The decoding unit is used to decode the encoded image data to obtain quantized coefficients and / or decoded encoding parameters (for example, the decoded parameters may include any one or all of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters and / or other syntax elements). The decoding unit is also used to forward the above-mentioned decoded encoding parameters to the prediction processing unit so that the prediction processing unit performs a prediction process according to the encoding parameters. The function of the inverse quantization unit may be the same as that of the inverse quantization unit of the encoder, and is used to inverse quantize (i.e., inverse quantize) the quantized coefficients decoded by the decoding unit.

[0069] The function of the inverse transform processing unit may be the same as that of the inverse transform processing unit of the encoder, and the function of the reconstruction unit (e.g., the summer) may be the same as that of the reconstruction unit of the encoder, and is used to perform an inverse transform (e.g., an inverse DCT, an inverse integer transform, or a conceptually similar inverse transform process) on the above-mentioned quantized coefficients to obtain an inverse transform block (also referred to as an inverse transform residual block), which is the residual block of the current image block in the pixel domain.

[0070] A prediction processing unit is used to receive or obtain encoded image data (e.g., an encoded bit stream of a current image block) and reconstructed image data. The prediction processing unit can also receive or obtain prediction-related parameters and / or information about a selected prediction mode (i.e., decoded encoding parameters) from, for example, a decoding unit, and predict the current image block based on the relevant data in the reconstructed image data and the decoded encoding parameters to obtain a prediction block of the current image block.

[0071] In one example, the prediction processing unit may include an inter-frame prediction unit, an intra-frame prediction unit and a mode selection unit. The mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode. If the intra-frame prediction mode is selected, the prediction process is performed by the intra-frame prediction unit. If the inter-frame prediction mode is selected, the prediction process is performed by the inter-frame prediction unit.

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

[0073] The filter unit is used for filtering the reconstructed block to obtain a filtered block, where the filtered block is a decoded image block.

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

[0075] Based on the encoder and the decoder, the embodiment of the present application provides a possible encoding / decoding implementation method, such as Figure 2D As shown, Figure 2D A schematic diagram of a coding and decoding process provided in an embodiment of the present application, wherein the coding and decoding implementation method includes process ① to process ⑤, and process ① to process ⑤ can be performed by the above-mentioned decoder and encoder. Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. The one or more parallel coding units have no dependency relationship and can be completely parallel / independently coded and decoded, such as Figure 2D A parallel encoding unit 1 and a parallel encoding unit 2 are shown.

[0076] Process ②: For each parallel coding unit, it can be divided into one or more non-overlapping independent coding units. Each independent coding unit may not depend on each other, but may share some parallel coding unit header information. For example, the width of an independent coding unit is w_lcu and the height is h_lcu. If a parallel coding unit is divided into an independent coding unit, the size of the independent coding unit is exactly the same as the parallel coding unit; otherwise, the width of the independent coding unit should be greater than the height (unless it is an edge area).

[0077] Typically, the independent coding unit may be a fixed w_lcu×h_lcu, where w_lcu and h_lcu are both 2 to the power of N (N≥0), such as the size of the independent coding unit is 128×4, 64×4, 32×4, 16×4, 8×4, 32×2, 16×2 or 8×2.

[0078] As a possible example, the independent coding unit can be a fixed 128×4. If the size of the parallel coding unit is 256×8, the parallel coding unit can be equally divided into 4 independent coding units; if the size of the parallel coding unit is 288×10, the parallel coding unit is divided into: the first / second line is 2 128×4 + 1 32×4 independent coding units; the third line is 2 128×2 + 1 32×2 independent coding units. It is worth noting that the independent coding unit can include three components of brightness Y, chrominance Cb, and chrominance Cr, or three components of red (red, R), green (green, G), and blue (blue, B), or three components of brightness Y, chrominance Co, and chrominance Cg, or only one of them. If the independent coding unit contains three components, the sizes of the three components can be exactly the same or different, which is related to the input format of the image.

[0079] Process ③: Each independent coding unit can be further divided into one or more non-overlapping coding units. The coding units within the independent coding unit can be interdependent, such as multiple coding units can perform mutual reference pre-coding and decoding.

[0080] If the coding unit is the same size as the independent coding unit (i.e., the independent coding unit is divided into only one coding unit), its size can be all the sizes described in process ②. If the independent coding unit is divided into multiple non-overlapping coding units, the feasible division examples include: horizontal equal division (the height of the coding unit is the same as that of the independent coding unit, but the width is different, which can be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), vertical equal division (the width of the coding unit is the same as that of the independent coding unit, but the height is different, which can be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), horizontal and vertical equal division (quadtree division), etc., preferably horizontal equal division.

[0081] The width of the coding unit is w_cu and the height is h_cu, then its width should be greater than its height (unless it is an edge area). Usually, the coding unit can be a fixed w_cu x h_cu, where w_cu and h_cu are both 2N powers (N is greater than or equal to 0), such as 16x4, 8x4, 16x2, 8x2, 8x1, 4x1, etc. As a possible example, the coding unit can be a fixed 16x4. If the size of the independent coding unit is 64x4, the independent coding unit can be divided into 4 coding units; if the size of the independent coding unit is 72x4, the coding unit is divided into: 4 16x4 + 1 8x4. It is worth noting that the coding unit can include three components of brightness Y, chroma Cb, and chroma Cr (or three components of red R, green G, and blue B, or brightness Y, chroma Co, and chroma Cg), or it can only contain one of the components. If three components are included, the sizes of the components can be exactly the same or different, which is specifically related to the image input format.

[0082] It is worth noting that process ③ may be an optional step in the encoding and decoding method, and the encoder / decoder may encode / decode the residual coefficients (or residual values) of the independent coding units obtained in process ②.

[0083] Process ④: For the coding unit, it can be further divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG is also referred to as Group, each PG is encoded and decoded according to the selected prediction mode to obtain the prediction value of PG, which constitutes the prediction value of the entire coding unit, and the residual value of the coding unit is obtained based on the prediction value and the original value of the coding unit.

[0084] Process ⑤: Based on the residual values ​​of the coding units, the coding units are grouped to obtain one or more non-overlapping residual blocks (RBs). The residual coefficients of each RB are encoded and decoded according to the selected mode to form a residual coefficient stream. Specifically, it can be divided into two categories: transforming the residual coefficients and not transforming them.

[0085] Among them, the selected mode of the residual coefficient encoding and decoding method in process ⑤ may include, but is not limited to any of the following: semi-fixed length encoding method, exponential Golomb encoding method, Golomb-Rice encoding method, truncated unary code encoding method, run-length encoding method, direct encoding of original residual values, etc. For example, the encoder may directly encode the coefficients in the RB. For another example, the encoder may also transform the residual block, such as DCT, DST, Hadamard transform, etc., and then encode the transformed coefficients. As a possible example, when the RB is small, the encoder may directly quantize each coefficient in the RB and then perform binary encoding. If the RB is large, it can be further divided into multiple coefficient groups (coefficient groups, CG), and then each CG is uniformly quantized and then binarized. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) may be the same, and of course, the coefficient group and the quantization group may also be different.

[0086] The following is an exemplary explanation of the residual coefficient encoding part in a semi-fixed length coding method. First, the maximum value of the absolute value of the residual in an RB block is defined as the modified maximum value (modified maximum, mm). Secondly, the number of coding bits for the residual coefficient in the RB block is determined (the number of coding bits for the residual coefficient in the same RB block is consistent). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, then 2 bits are required to encode the residual coefficient 1, which is expressed as 01. If the CL of the current RB block is 7, it means encoding an 8-bit residual coefficient and a 1-bit sign bit. The determination of CL is to find the minimum M value that satisfies that all residuals of the current sub-block are within the range of [-2^(M-1), 2^(M-1)]. If both -2^(M-1) and 2^(M-1) exist, M increases by 1, that is, M+1 bits are needed to encode all the residuals of the current RB block; if only one of the two boundary values ​​-2^(M-1) and 2^(M-1) exists, a trailing bit is encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), there is no need to encode the trailing bit. For some special cases, the encoder can directly encode the original value of the image instead of the residual value.

[0087] For example, shallow coding is a way to implement prediction technology. Shallow coding is a simple prediction method, which is suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements. However, in the encoding process of shallow coding, a larger quantization step size often causes a larger quantization error, especially in flat areas. The overall deviation will cause color blocks, resulting in subjective loss.

[0088] In view of the above problems, a shallow coding filtering method is proposed in the embodiment of the present application, which can be applicable to scenes with high real-time requirements, small cache, and high parallelism requirements. After obtaining the reconstruction value of the current image area, the reconstruction value of the current image area can be adjusted, so that the reconstructed pixel can be closer to the original pixel, bringing about the improvement of encoding performance and decoding performance. For larger quantization step sizes, the quantization error is reduced, especially in flat areas, and the color block problem caused by the overall deviation is reduced, which can avoid subjective loss and improve subjective performance. In the encoding process of shallow coding, subjective losslessness can be achieved and the hardware implementation is simple.

[0089] The decoding method and encoding method in the embodiments of the present application are described in detail below in combination with several specific embodiments.

[0090] Example 1: In the present application, a coding method is proposed. Figure 3 FIG. 1 is a flow chart of the encoding method, which can be applied to an encoding end (also referred to as a video encoder), and may include:

[0091] Step 301: Determine whether it is necessary to adjust the reconstruction value of the current image region based on feature information corresponding to the current image region.

[0092] In a possible implementation, a display method may be used to determine whether the reconstruction value of the current image region needs to be adjusted. For the sake of distinction, the characteristic information involved in the display method is referred to as the first type of characteristic information.

[0093] For example, the first type of feature information corresponding to the current image area is obtained. If the first type of feature information corresponding to the current image area meets a specific condition, it is determined whether the reconstruction value of the current image area needs to be adjusted, and a mark bit corresponding to the adjustment control switch is encoded in the code stream corresponding to the current image area. The mark bit is used to indicate whether the reconstruction value of the current image area needs to be adjusted. If the first type of feature information corresponding to the current image area does not meet the specific condition, it is determined that the reconstruction value of the current image area does not need to be adjusted, and the mark bit corresponding to the adjustment control switch is not encoded in the code stream corresponding to the current image area.

[0094] Among them, when the first type of characteristic information meets specific conditions, if it is determined that the reconstruction value of the current image area needs to be adjusted, the mark bit corresponding to the adjustment control switch is encoded in the code stream corresponding to the current image area, and the mark bit is a first value, and the first value indicates that the reconstruction value of the current image area needs to be adjusted. If it is determined that the reconstruction value of the current image area does not need to be adjusted, the mark bit corresponding to the adjustment control switch is encoded in the code stream corresponding to the current image area, and the mark bit is a second value, and the second value indicates that the reconstruction value of the current image area does not need to be adjusted. Among them, the first value and the second value can be configured according to experience, and there is no restriction on this. For example, the first value is 1 and the second value is 0.

[0095] Regarding the process of "determining whether it is necessary to adjust the reconstruction value of the current image area", if the cost of starting the reconstruction value adjustment of the current image area is less than the cost of turning off the reconstruction value adjustment of the current image area, it is determined that the reconstruction value adjustment of the current image area is necessary; otherwise, it is determined that it is not necessary to adjust the reconstruction value of the current image area.

[0096] Exemplarily, the current image area may include one image block, or the current image area may include multiple continuous image blocks. The code stream corresponding to the current image area refers to: a code stream related to the current image area, that is, the code stream contains information for processing the current image area, and there is no restriction on the code stream corresponding to the current image area.

[0097] Exemplarily, the first type of feature information corresponding to the current image area may include but is not limited to at least one of the following: prediction mode; amount of data in the code stream buffer; quantization step size. Based on this, if the first type of feature information includes a prediction mode, when the prediction mode corresponding to the current image area is a specified prediction mode, it is determined that the prediction mode meets a specific condition; otherwise, it is determined that the prediction mode does not meet the specific condition. If the first type of feature information includes the amount of data in the code stream buffer, when the amount of data in the code stream buffer is within a preset data amount interval, it is determined that the amount of data in the code stream buffer meets the specific condition; otherwise, it is determined that the amount of data in the code stream buffer does not meet the specific condition. If the first type of feature information includes a quantization step size, when the quantization step size corresponding to the current image area is within a preset step size interval, it is determined that the quantization step size meets the specific condition; otherwise, it is determined that the quantization step size does not meet the specific condition.

[0098] If the first type of feature information includes the prediction mode and the amount of data in the code stream buffer, then only when the prediction mode satisfies a specific condition and the amount of data in the code stream buffer satisfies a specific condition, it is determined that the first type of feature information corresponding to the current image area satisfies the specific condition, otherwise, it is determined that the first type of feature information corresponding to the current image area does not satisfy the specific condition. Alternatively, if the first type of feature information includes the quantization step size and the amount of data in the code stream buffer, then only when the quantization step size satisfies a specific condition and the amount of data in the code stream buffer satisfies a specific condition, it is determined that the first type of feature information corresponding to the current image area satisfies the specific condition, otherwise, it is determined that the first type of feature information corresponding to the current image area does not satisfy the specific condition. Alternatively, if the first type of feature information includes the prediction mode and the quantization step size, then only when the prediction mode satisfies a specific condition and the quantization step size satisfies a specific condition, it is determined that the first type of feature information corresponding to the current image area satisfies the specific condition, otherwise, it is determined that the first type of feature information corresponding to the current image area does not satisfy the specific condition. Alternatively, if the first type of feature information includes a prediction mode, the amount of data in the bitstream buffer, and a quantization step size, then, when the prediction mode satisfies specific conditions, the amount of data in the bitstream buffer satisfies specific conditions, and the quantization step size satisfies specific conditions, it is determined that the first type of feature information corresponding to the current image area satisfies the specific conditions; otherwise, it is determined that the first type of feature information corresponding to the current image area does not satisfy the specific conditions.

[0099] Of course, the above are just a few examples of the first type of characteristic information, and this embodiment does not limit the first type of characteristic information.

[0100] In the above embodiment, the specified prediction mode can be a normal intra-frame prediction mode; wherein: the normal intra-frame prediction mode includes a DC mode; or, the normal intra-frame prediction mode includes a DC mode, a horizontal prediction mode and a vertical prediction mode; or, the normal intra-frame prediction mode includes a DC mode and an angular prediction mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode and a Planar mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode and a bilinear mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode, a Planar mode and a bilinear mode.

[0101] In another possible implementation, an implicit method may be used to determine whether the reconstruction value of the current image region needs to be adjusted. For the sake of distinction, the feature information involved in the implicit method is referred to as the second type of feature information.

[0102] For example, the second type of feature information corresponding to the current image area is obtained. If the second type of feature information corresponding to the current image area meets specific conditions, it is determined that the reconstruction value of the current image area needs to be adjusted. If the second type of feature information corresponding to the current image area does not meet the specific conditions, it is determined that the reconstruction value of the current image area does not need to be adjusted.

[0103] For the specific implementation of the implicit method, please refer to the subsequent embodiments, which will not be described here in detail.

[0104] Step 302: If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, wherein the adjustment parameter is used to adjust the reconstruction value of the current image area.

[0105] Step 303: Encode the adjustment parameters corresponding to the current image area in the code stream corresponding to the current image area.

[0106] Exemplarily, if the adjustment parameters corresponding to the current image region include multiple adjustment values, all the adjustment values ​​or part of the adjustment values ​​(ie, part of the multiple adjustment values) may be encoded in the bitstream corresponding to the current image region.

[0107] Among them, encoding all or part of the adjustment values ​​in the bitstream corresponding to the current image area may include but is not limited to: sorting the multiple adjustment values ​​according to the encoding order of the multiple adjustment values, and traversing each of the multiple adjustment values ​​in turn based on the sorting result; for the currently traversed adjustment value, if the current bit rate is less than the preset bit rate value after the adjustment value is encoded in the bitstream corresponding to the current image area, then encoding the adjustment value in the bitstream corresponding to the current image area, and continuing to traverse the next adjustment value of the adjustment value, and using the next adjustment value as the currently traversed adjustment value; otherwise, prohibiting the encoding of the adjustment value in the bitstream corresponding to the current image area, and stopping traversing the next adjustment value of the adjustment value.

[0108] Exemplarily, the current image area may correspond to multiple pixel groups, the adjustment parameters corresponding to the current image area may include multiple adjustment values, and the multiple adjustment values ​​may include adjustment values ​​corresponding to K pixel groups, and the K pixel groups may be all pixel groups or part of the pixel groups in the multiple pixel groups (i.e., all pixel groups).

[0109] On this basis, M adjustment values ​​corresponding to the K pixel groups may be encoded in the bitstream corresponding to the current image region, where M may be a positive integer, may be less than or equal to K, and the M adjustment values ​​may be determined based on the adjustment values ​​corresponding to the K pixel groups. Furthermore, adjustment value grouping indication information may also be encoded in the bitstream corresponding to the current image region, where the adjustment value grouping indication information is used to indicate a matching relationship between the M adjustment values ​​and the K pixel groups.

[0110] For example, if K pixel groups correspond to the same adjustment value, the adjustment value grouping indication information can be a first value, and the first value indicates that the K pixel groups correspond to the same adjustment value; if K pixel groups correspond to K adjustment values, the adjustment value grouping indication information can be a second value, and the second value indicates that the K pixel groups correspond to K adjustment values.

[0111] Exemplarily, if the K pixel groups are some of the pixel groups among the multiple pixel groups, the encoding end may also encode the pixel group indication information corresponding to the K pixel groups in the code stream corresponding to the current image area, indicating that the code stream corresponding to the current image area carries the adjustment value of the pixel group corresponding to the pixel group indication information. If the K pixel groups are all of the pixel groups among the multiple pixel groups, the encoding end may not encode the pixel group indication information corresponding to the pixel groups in the code stream corresponding to the current image area, indicating that the code stream corresponding to the current image area carries the adjustment values ​​of all pixel groups. In this case, it is not necessary to encode the pixel group indication information corresponding to the pixel groups in the code stream. Among them, if the K pixel groups are some of the pixel groups among the multiple pixel groups, the pixel group indication information is used to distinguish the pixel groups of the target category among all categories of pixel groups, that is, to distinguish the K pixel groups from all pixel groups.

[0112] Exemplarily, when the current image area corresponds to multiple channels, for each pixel group, the adjustment value corresponding to the pixel group may include the adjustment values ​​of the multiple channels corresponding to the pixel group, and the multiple channels may include at least one of the following channels: Y channel, U channel, V channel, Co channel, Cg channel, R channel, G channel, B channel, alpha channel, IR channel, D channel, and W channel. For example, the multiple channels include the Y channel, U channel, and V channel, or the multiple channels include the R channel, G channel, and B channel, or the multiple channels include the R channel, G channel, B channel, and alpha channel, or the multiple channels may include the R channel, G channel, B channel, and IR channel, or the multiple channels include the R channel, G channel, B channel, and W channel, or the multiple channels include the R channel, G channel, B channel, IR channel, and W channel, or the multiple channels include the R channel, G channel, B channel, and D channel, or the multiple channels may include the R channel, G channel, B channel, D channel, and W channel. Among them, in addition to the RGB color photosensitivity channel, there may also be an IR channel (infrared or near-infrared photosensitivity channel), a D channel (dark light channel, mainly through infrared light or near-infrared light), and a W channel (full-color photosensitivity channel). There are different channels for different sensors. For example, the sensor type can be an RGB sensor, an RGBIR sensor, an RGBW sensor, an RGBIRW sensor, an RGBD sensor, an RGBDW sensor, and the like.

[0113] Exemplarily, the current image area corresponds to multiple pixel groups, which may include but are not limited to the following methods: determining the multiple pixel groups corresponding to the current image area according to the pre-adjustment reconstruction value of each pixel point; or determining the classification value of the pixel point based on the pre-adjustment reconstruction value of the surrounding pixels of the pixel point, and determining the multiple pixel groups corresponding to the current image area according to the classification value of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the pixel position of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area; or determining the multiple pixel groups corresponding to the current image area according to the scanning order of the current image area. Of course, the above methods are only examples and are not limited to this.

[0114] Among them, when determining the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area, the number of pixel group divisions, the filter area and the division method can be determined according to the prediction mode of the current image area; and the multiple pixel groups corresponding to the current image area are determined based on the number of divisions, the filter area and the division method.

[0115] Exemplarily, if the prediction mode of the current image area is a horizontal prediction mode, the number of divisions of the pixel group is determined to be the first number of divisions, the filtering area of ​​the pixel group is determined to be the first filtering area, and the division method is determined to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, the number of divisions of the pixel group is determined to be the second number of divisions, the filtering area of ​​the pixel group is determined to be the second filtering area, and the division method is determined to be the second size specification.

[0116] For example, if the current image area is a 16*2 image block (i.e., an image block), when dividing multiple pixel groups according to the prediction mode, if the prediction mode of the current image area is a horizontal prediction mode, all the pixels of the current image area are divided into 4 pixel groups, and the size of each pixel group is 8*1; or, all the pixels of the current image area are divided into 2 pixel groups, and the size of each pixel group is 16*1. If the prediction mode of the current image area is not a horizontal prediction mode, all the pixels of the current image area are divided into 4 pixel groups, and the size of each pixel group is 4*2.

[0117] For example, if the current image area is a 16*2 image block, then all pixels in the current image area may be directly divided into 4 pixel groups, each pixel group having a size of 4*2, without considering the prediction mode of the current image area.

[0118] In the above embodiment, the value range of the adjustment value may be determined based on the quantization step size.

[0119] Exemplarily, the above execution order is only for the convenience of describing the examples given. In practical applications, the execution order between the steps can also be changed, and there is no limitation on this execution order. Moreover, in other embodiments, the steps of the corresponding method are not necessarily executed in the order shown and described in this specification, and the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; multiple steps described in this specification may also be combined into a single step for description in other embodiments.

[0120] It can be seen from the above technical solutions that in the embodiment of the present application, a shallow coding method is proposed, which can be applicable to scenes with high real-time requirements, small cache, and high parallelism requirements. After obtaining the reconstruction value of the current image area, the reconstruction value of the current image area can also be adjusted, so that the reconstructed pixel can be closer to the original pixel, bringing about the improvement of encoding performance and decoding performance. For larger quantization step sizes, the quantization error is reduced, especially in flat areas, and the color block problem caused by the overall deviation is reduced, which can avoid subjective loss, that is, the shallow coding method can achieve subjective losslessness and simple hardware implementation.

[0121] Example 2: A decoding method is proposed in the embodiment of the present application, see Figure 4 As shown, it is a flowchart of the decoding method, which can be applied to a decoding end (also called a video decoder), and the method may include:

[0122] Step 401: Determine whether it is necessary to adjust the reconstruction value of the current image region based on feature information corresponding to the current image region.

[0123] In a possible implementation, a display method may be used to determine whether the reconstruction value of the current image region needs to be adjusted. For the sake of distinction, the characteristic information involved in the display method is referred to as the first type of characteristic information.

[0124] For example, the first type of characteristic information corresponding to the current image area can be obtained. If the first type of characteristic information corresponding to the current image area meets a specific condition, the mark bit corresponding to the adjustment control switch can be obtained from the code stream corresponding to the current image area, and based on the mark bit, it is determined whether the reconstruction value of the current image area needs to be adjusted. If the mark bit is a first value, it can be determined that the reconstruction value of the current image area needs to be adjusted; if the mark bit is a second value, it can be determined that the reconstruction value of the current image area does not need to be adjusted. Alternatively, if the first type of characteristic information corresponding to the current image area does not meet a specific condition, it can be directly determined that the reconstruction value of the current image area does not need to be adjusted, and it is not necessary to obtain the mark bit corresponding to the adjustment control switch from the code stream corresponding to the current image area.

[0125] Exemplarily, the current image area may include one image block, or the current image area may include multiple continuous image blocks. The code stream corresponding to the current image area refers to: a code stream related to the current image area, that is, the code stream contains information for processing the current image area, and there is no restriction on the code stream corresponding to the current image area.

[0126] Exemplarily, the first type of feature information corresponding to the current image area may include but is not limited to at least one of the following: prediction mode; amount of data in the code stream buffer; quantization step size. Based on this, if the first type of feature information includes a prediction mode, when the prediction mode corresponding to the current image area is a specified prediction mode, it is determined that the prediction mode meets a specific condition; otherwise, it is determined that the prediction mode does not meet the specific condition. If the first type of feature information includes the amount of data in the code stream buffer, when the amount of data in the code stream buffer is within a preset data amount interval, it is determined that the amount of data in the code stream buffer meets the specific condition; otherwise, it is determined that the amount of data in the code stream buffer does not meet the specific condition. If the first type of feature information includes a quantization step size, when the quantization step size corresponding to the current image area is within a preset step size interval, it is determined that the quantization step size meets the specific condition; otherwise, it is determined that the quantization step size does not meet the specific condition.

[0127] In the above embodiment, the specified prediction mode can be a normal intra-frame prediction mode; wherein: the normal intra-frame prediction mode includes a DC mode; or, the normal intra-frame prediction mode includes a DC mode, a horizontal prediction mode and a vertical prediction mode; or, the normal intra-frame prediction mode includes a DC mode and an angular prediction mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode and a Planar mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode and a bilinear mode; or, the normal intra-frame prediction mode includes a DC mode, an angular prediction mode, a Planar mode and a bilinear mode.

[0128] In another possible implementation, an implicit method may be used to determine whether the reconstruction value of the current image region needs to be adjusted. For the sake of distinction, the feature information involved in the implicit method is referred to as the second type of feature information.

[0129] For example, the second type of feature information corresponding to the current image area is obtained. If the second type of feature information corresponding to the current image area meets specific conditions, it is determined that the reconstruction value of the current image area needs to be adjusted. If the second type of feature information corresponding to the current image area does not meet the specific conditions, it is determined that the reconstruction value of the current image area does not need to be adjusted.

[0130] For the specific implementation of the implicit method, please refer to the subsequent embodiments, which will not be described here in detail.

[0131] Step 402: If it is determined that the reconstruction value of the current image area needs to be adjusted, an adjustment parameter corresponding to the current image area is obtained from the code stream corresponding to the current image area, and the adjustment parameter is used to adjust the reconstruction value.

[0132] Step 403: Adjust the reconstruction value of the current image area based on the adjustment parameter.

[0133] In a possible implementation, the adjustment parameter corresponding to the current image area may include multiple adjustment values, the current image area corresponds to multiple pixel groups, the multiple adjustment values ​​include adjustment values ​​corresponding to K pixel groups, and the K pixel groups are all pixel groups or part of the multiple pixel groups. On this basis, adjusting the reconstruction value of the current image area based on the adjustment parameter may include but is not limited to: adjusting the reconstruction values ​​of the pixels in the K pixel groups based on the multiple adjustment values, and illustratively, K may be a positive integer greater than or equal to 1. Among them, adjusting the reconstruction values ​​of the pixels in the K pixel groups based on the multiple adjustment values ​​may include but is not limited to the following methods: for each pixel group in the K pixel groups, if the multiple adjustment values ​​include the adjustment value corresponding to the pixel group, then adjusting the reconstruction value of each pixel in the pixel group based on the adjustment value corresponding to the pixel group to obtain the adjusted reconstruction value of each pixel in the pixel group.

[0134] Exemplarily, if the K pixel groups are some pixel groups among multiple pixel groups, the decoding end can also obtain pixel group indication information corresponding to the K pixel groups from the code stream corresponding to the current image area; based on the pixel group indication information, K pixel groups are selected from all pixel groups, and multiple adjustment values ​​are associated with the K pixel groups. In this way, the reconstructed values ​​of the pixel points in the K pixel groups can be adjusted based on the multiple adjustment values, that is, only the reconstructed values ​​of the K pixel groups are adjusted.

[0135] If the K pixel groups are part of the pixel groups in the plurality of pixel groups, the pixel group indication information is used to distinguish pixel groups of the target category from pixel groups of all categories, that is, to distinguish the K pixel groups from all pixel groups.

[0136] Among them, for each pixel group, the adjustment value corresponding to the pixel group may include adjustment values ​​of multiple channels corresponding to the pixel group, and the multiple channels may include at least one of the following channels: Y channel, U channel, V channel, R channel, G channel, B channel, alpha channel, IR channel, D channel, and W channel. For example, the multiple channels include Y channel, U channel, and V channel, or the multiple channels include R channel, G channel, and B channel, or the multiple channels include R channel, G channel, B channel, and alpha channel, or the multiple channels may include R channel, G channel, B channel, and IR channel, or the multiple channels may include R channel, G channel, B channel, and W channel, or the multiple channels may include R channel, G channel, B channel, IR channel, and W channel, or the multiple channels may include R channel, G channel, B channel, and D channel, or the multiple channels may include R channel, G channel, B channel, D channel, and W channel.

[0137] Exemplarily, adjustment value grouping indication information may also be obtained from the code stream corresponding to the current image area, and the adjustment value grouping indication information is used to indicate the mapping relationship between the adjustment value and the K pixel groups; based on the adjustment value grouping indication information, M adjustment values ​​are parsed from the code stream corresponding to the current image area, where M is a positive integer and M is less than or equal to K; and based on the M adjustment values, the adjustment values ​​corresponding to the K pixel groups are determined. For example, if the adjustment value grouping indication information is the first value, M is 1, in which case the decoding end determines that the K pixel groups correspond to one adjustment value; if the adjustment value grouping indication information is the second value, M is K, in which case the decoding end determines that the K pixel groups correspond to the K adjustment values.

[0138] Exemplarily, when the current image region corresponds to multiple channels, parsing the M adjustment values ​​from the bitstream corresponding to the current image region may include: for each channel, parsing the M adjustment values ​​corresponding to the channel from the bitstream corresponding to the current image region.

[0139] Exemplarily, the current image area corresponds to multiple pixel groups, which may include but are not limited to: determining the multiple pixel groups corresponding to the current image area according to the pre-adjustment reconstruction value of each pixel point; or determining the classification value of the pixel point based on the pre-adjustment reconstruction value of the surrounding pixels of the pixel point, and determining the multiple pixel groups corresponding to the current image area according to the classification value of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the pixel position of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area; or determining the multiple pixel groups corresponding to the current image area according to the scanning order of the current image area. Of course, the above methods are only examples and are not limited to this.

[0140] Among them, when determining the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area, the number of pixel group divisions, the filter area and the division method can be determined according to the prediction mode of the current image area; then, the multiple pixel groups corresponding to the current image area are determined based on the number of divisions, the filter area and the division method.

[0141] Exemplarily, determining the number of pixel group divisions, the filter area and the division method according to the prediction mode of the current image area may include: if the prediction mode of the current image area is a horizontal prediction mode, determining that the number of pixel group divisions is a first number of divisions, determining that the filter area of ​​the pixel group is a first filter area, and determining that the division method is a first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, determining that the number of pixel group divisions is a second number of divisions, determining that the filter area of ​​the pixel group is a second filter area, and determining that the division method is a second size specification.

[0142] For example, if the current image area is a 16*2 image block (i.e., an image block), when dividing multiple pixel groups according to the prediction mode, if the prediction mode of the current image area is a horizontal prediction mode, all the pixels of the current image area are divided into 4 pixel groups, and the size of each pixel group is 8*1; or, all the pixels of the current image area are divided into 2 pixel groups, and the size of each pixel group is 16*1. If the prediction mode of the current image area is not a horizontal prediction mode, all the pixels of the current image area are divided into 4 pixel groups, and the size of each pixel group is 4*2.

[0143] For example, if the current image area is a 16*2 image block, then all pixels in the current image area may be directly divided into 4 pixel groups, each pixel group having a size of 4*2, without considering the prediction mode of the current image area.

[0144] In the above embodiment, the value range of the adjustment value may be determined based on the quantization step size.

[0145] It can be seen from the above technical solutions that in the embodiment of the present application, a shallow coding method is proposed, which can be applicable to scenes with high real-time requirements, small cache, and high parallelism requirements. After obtaining the reconstruction value of the current image area, the reconstruction value of the current image area can also be adjusted, so that the reconstructed pixel can be closer to the original pixel, bringing about the improvement of encoding performance and decoding performance. For larger quantization step sizes, the quantization error is reduced, especially in flat areas, and the color block problem caused by the overall deviation is reduced, which can avoid subjective loss, that is, the shallow coding method can achieve subjective losslessness and simple hardware implementation.

[0146] Embodiment 3: For Embodiment 1 and Embodiment 2, it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For example, for the encoding end, after encoding the bitstream of N coding blocks (N≥1), the encoding end can record M of the coding blocks (M≤N) as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For the decoding end, after parsing the bitstream of N decoding blocks (N≥1), the decoding end can record M of the decoding blocks (corresponding to the M coding blocks of the encoding end) as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area.

[0147] Exemplarily, it can also be determined whether it is necessary to adjust the predicted value of the current image area, that is, the predicted value of the current image area can be adjusted based on the adjustment parameters corresponding to the current image area. The predicted value adjustment process is similar to the reconstruction value adjustment process, which will not be described in detail in this embodiment. Exemplarily, it can also be determined whether it is necessary to adjust the residual value of the current image area, that is, the residual value of the current image area can be adjusted based on the adjustment parameters corresponding to the current image area. The residual value adjustment process is similar to the reconstruction value adjustment process, which will not be described in detail in this embodiment.

[0148] Exemplarily, in order to determine whether it is necessary to adjust the reconstruction value of the current image area, the following method may be used:

[0149] Explicit syntax method: The encoder encodes the flag bit corresponding to the adjustment control switch in the bitstream, and the decoder parses the flag bit corresponding to the adjustment control switch from the bitstream, and determines whether the reconstruction value of the current image area needs to be adjusted based on the flag bit.

[0150] The following describes the implementation process of the explicit syntax method in combination with specific application scenarios. The process may include:

[0151] Step S11: The encoder determines whether the first type of feature information corresponding to the current image area meets a specific condition.

[0152] If no, step S12 may be executed, and if yes, step S13 may be executed.

[0153] Exemplarily, the first type of feature information corresponding to the current image region may include but is not limited to at least one of the following: prediction mode; amount of data in the bitstream buffer; quantization step size. Of course, the above are just a few examples of the first type of feature information, and there is no limitation to this. The following description will be made by taking the prediction mode, amount of data in the bitstream buffer, and quantization step size as examples.

[0154] Case 1: The first type of feature information includes a prediction mode. When the prediction mode corresponding to the current image region is a specified prediction mode, it can be determined that the first type of feature information meets the specific condition; otherwise, that is, when the prediction mode corresponding to the current image region is not the specified prediction mode, it can be determined that the first type of feature information does not meet the specific condition.

[0155] Case 2: The first type of characteristic information includes the amount of data in the code stream buffer. When the amount of data in the code stream buffer is within the preset data amount interval, it can be determined that the first type of characteristic information meets the specific condition; otherwise, that is, when the amount of data in the code stream buffer is not within the preset data amount interval, it can be determined that the first type of characteristic information does not meet the specific condition.

[0156] Exemplarily, a preset data volume interval [a1, a2] may be preconfigured, where a1 is used to represent the minimum data volume, and a2 is used to represent the maximum data volume. Both a1 and a2 may be configured based on experience, and there is no limitation to this.

[0157] If the amount of data in the code stream buffer is greater than or equal to a1, and the amount of data in the code stream buffer is less than or equal to a2, the amount of data in the code stream buffer is within the preset data amount range. If the amount of data in the code stream buffer is less than a1, or the amount of data in the code stream buffer is greater than a2, the amount of data in the code stream buffer is not within the preset data amount range.

[0158] Exemplarily, if the amount of data in the bitstream buffer is within a preset data amount range, that is, the amount of data in the bitstream buffer is less than or equal to a2, then after filtering the current image area (the encoding process shown in FIG1 is the filtering process), adding the filtering parameters will not trigger an overflow, that is, the bitstream buffer will not exceed the buffer limit.

[0159] Case 3: The first type of feature information includes a quantization step size. When the quantization step size corresponding to the current image area is within the preset step size interval, it can be determined that the first type of feature information meets the specific condition; otherwise, that is, when the quantization step size corresponding to the current image area is not within the preset step size interval, it can be determined that the first type of feature information does not meet the specific condition.

[0160] Exemplarily, a preset step size interval [b1, b2] may be preconfigured, where b1 is used to indicate the minimum step size, and b2 is used to indicate the maximum step size. Both b1 and b2 may be configured based on experience, and there is no restriction on this. If the quantization step size corresponding to the current image area is greater than or equal to b1, and the quantization step size corresponding to the current image area is less than or equal to b2, then the quantization step size corresponding to the current image area is within the preset step size interval. If the quantization step size corresponding to the current image area is less than b1, or the quantization step size corresponding to the current image area is greater than b2, then the quantization step size corresponding to the current image area is not within the preset step size interval.

[0161] Exemplarily, for situation 3, when the quantization step meets certain conditions (ie, a preset step interval), it is determined that the first type of feature information meets the specific conditions, and the preset step interval enables the quantization step that does not affect the subjective to be not adjusted.

[0162] Exemplarily, when configuring the value of b1, b1 can be configured based on experience, and there is no restriction on this. For example, b1 can be determined based on the input bit width of the current image area. The larger the input bit width of the current image area, the larger the value of b1. For example, when the input bit width of the current image area is 8 bits, the value of b1 is 16, when the input bit width of the current image area is 10 bits, the value of b1 is 24, and when the input bit width of the current image area is 12 bits, the value of b1 is 32. Of course, the above is only an example between the input bit width and the minimum step size b1, and there is no restriction on the minimum step size b1.

[0163] In summary, when the quantization step size (QP) satisfies the following relationship, the quantization step size is greater than or equal to b1, that is, it meets the minimum value requirement of the preset step size interval: for 8 bits, QP≥16; for 10 bits, QP≥24; for 12 bits, QP≥32.

[0164] Exemplarily, when configuring the value of b2, b2 can be configured based on experience without any restriction. For example, b2 can be an infinite value, or b2 can be a fixed value, such as 48, 60, or 76.

[0165] Case 4: The first type of characteristic information includes the prediction mode and the amount of data in the code stream buffer. When the prediction mode corresponding to the current image area is the specified prediction mode, and the amount of data in the code stream buffer is within the preset data amount interval, it can be determined that the first type of characteristic information meets the specific conditions; otherwise, that is, the prediction mode corresponding to the current image area is not the specified prediction mode, and / or the amount of data in the code stream buffer is not within the preset data amount interval, it is determined that the first type of characteristic information does not meet the specific conditions.

[0166] Case 5: The first type of feature information includes a prediction mode and a quantization step size. When the prediction mode corresponding to the current image area is a specified prediction mode, and the quantization step size corresponding to the current image area is within a preset step size interval, it can be determined that the first type of feature information meets the specific condition; otherwise, that is, the prediction mode corresponding to the current image area is not the specified prediction mode, and / or the quantization step size corresponding to the current image area is not within the preset step size interval, it is determined that the first type of feature information does not meet the specific condition.

[0167] Case 6: The first type of characteristic information includes the quantization step size and the amount of data in the code stream buffer. When the quantization step size corresponding to the current image area is within the preset step size interval, and the amount of data in the code stream buffer is within the preset data amount interval, it is determined that the first type of characteristic information meets the specific condition; otherwise, that is, the quantization step size corresponding to the current image area is not within the preset step size interval, and / or the amount of data in the code stream buffer is not within the preset data amount interval, it is determined that the first type of characteristic information does not meet the specific condition.

[0168] Case 7: The first type of characteristic information includes the prediction mode, the amount of data in the code stream buffer, and the quantization step size. When the prediction mode corresponding to the current image area is the specified prediction mode, the amount of data in the code stream buffer is within the preset data amount interval, and the quantization step size corresponding to the current image area is within the preset step size interval, it is determined that the first type of characteristic information meets the specific condition; otherwise, that is, the prediction mode corresponding to the current image area is not the specified prediction mode, and / or the amount of data in the code stream buffer is not within the preset data amount interval, and / or the quantization step size corresponding to the current image area is not within the preset step size interval, it is determined that the first type of characteristic information does not meet the specific condition, that is, as long as one of them is not met, it is determined that the first type of characteristic information does not meet the specific condition.

[0169] Of course, the above-mentioned situations are just examples of “determining whether the first type of feature information corresponding to the current image area meets specific conditions”. This embodiment does not limit the determination process of “whether the first type of feature information meets specific conditions”.

[0170] For the above-mentioned cases 1, 4, 5 and 7, in one possible implementation, the specified prediction mode may be a normal intra-frame prediction mode. In another possible implementation, the specified prediction mode may also be a point-by-point prediction mode. Of course, the normal intra-frame prediction mode and the point-by-point prediction mode are only examples and are not limited thereto.

[0171] For cases 5 and 7, for the preset step length interval, the preset step length interval can also be set based on the specified prediction mode, such as setting the minimum value of the preset step length interval based on the specified prediction mode. For example, the ordinary intra-frame prediction mode corresponds to the first minimum value of the preset step length interval, that is, the value of b1 is the first minimum value, and the point-by-point prediction mode corresponds to the second minimum value of the preset step length interval, that is, the value of b1 is the second minimum value. Among them, the first minimum value can be greater than the second minimum value, and the first minimum value can also be less than the second minimum value, and there is no restriction on this. The minimum value of the preset step length interval is related to the specified prediction mode.

[0172] Ordinary intra-frame prediction modes may include DC mode. Alternatively, ordinary intra-frame prediction modes may include DC mode, horizontal prediction mode and vertical prediction mode. Alternatively, ordinary intra-frame prediction modes may include DC mode and angle prediction mode (such as horizontal prediction mode, vertical prediction mode and other angle prediction modes). Alternatively, ordinary intra-frame prediction modes may include DC mode, angle prediction mode and Planar mode. Alternatively, ordinary intra-frame prediction modes may include DC mode, angle prediction mode and bilinear mode. Alternatively, ordinary intra-frame prediction modes may include DC mode, angle prediction mode, Planar mode and bilinear mode. Of course, the above are only examples of ordinary intra-frame prediction modes, and there is no limitation to this. On the basis of each of the above ordinary intra-frame prediction modes, other types of intra-frame prediction modes may also be used as ordinary intra-frame prediction modes.

[0173] Step S12: If the first type of feature information does not meet the specific condition, the encoder determines that it is not necessary to adjust the reconstruction value of the current image area, and does not encode the mark bit corresponding to the adjustment control switch in the bitstream corresponding to the current image area.

[0174] Step S13: If the first type of characteristic information meets a specific condition, the encoding end determines whether it is necessary to adjust the reconstruction value of the current image area, and encodes a flag bit corresponding to the adjustment control switch in the bitstream corresponding to the current image area.

[0175] Exemplarily, if the first type of feature information meets certain conditions, the encoding end can determine whether it is necessary to adjust the reconstruction value of the current image area, and there is no restriction on the determination method. For example, the encoding end calculates the cost of starting the reconstruction value adjustment of the current image area, recorded as the first generation value, and calculates the cost of turning off the reconstruction value adjustment of the current image area, recorded as the second generation value. On this basis, if the first generation value is less than the second generation value, the encoding end determines that it is necessary to adjust the reconstruction value of the current image area; otherwise, the encoding end determines that it is not necessary to adjust the reconstruction value of the current image area.

[0176] Exemplarily, after determining whether it is necessary to adjust the reconstruction value of the current image area, the encoding end may encode the mark bit corresponding to the adjustment control switch in the code stream corresponding to the current image area. For example, if it is determined that the reconstruction value of the current image area needs to be adjusted, the mark bit may be a first value, and the first value indicates that the reconstruction value of the current image area needs to be adjusted. If it is determined that it is not necessary to adjust the reconstruction value of the current image area, the mark bit may be a second value, and the second value indicates that it is not necessary to adjust the reconstruction value of the current image area. Both the first value and the second value can be configured based on experience, such as the first value is 0 and the second value is 1, or the first value is 1 and the second value is 0.

[0177] Step S14: The decoding end determines whether the first type of feature information corresponding to the current image area meets a specific condition.

[0178] If no, step S15 may be executed, and if yes, step S16 may be executed.

[0179] Exemplarily, the implementation process of step S14 is similar to that of step S11, and will not be repeated here.

[0180] Step S15: If the first type of characteristic information does not meet the specific condition, the decoding end determines that it is not necessary to adjust the reconstruction value of the current image area, and it is not necessary to decode the mark bit corresponding to the adjustment control switch from the code stream corresponding to the current image area.

[0181] Step S16: If the first type of characteristic information meets a specific condition, the decoder obtains the flag bit corresponding to the adjustment control switch from the bitstream corresponding to the current image area, and determines whether the reconstruction value of the current image area needs to be adjusted based on the flag bit. If the flag bit is a first value, the decoder can determine that the reconstruction value of the current image area needs to be adjusted; if the flag bit is a second value, the decoder can determine that the reconstruction value of the current image area does not need to be adjusted.

[0182] In summary, both the encoder and the decoder can determine whether it is necessary to adjust the reconstruction value of the current image area, and the conclusion of the reconstruction value adjustment can be applied to the current image area. If it is necessary to adjust the reconstruction value of the current image area, the encoder needs to adjust the reconstruction values ​​of N coding blocks, and the decoder needs to adjust the reconstruction values ​​of N decoding blocks. If it is not necessary to adjust the reconstruction value of the current image area, the encoder does not need to adjust the reconstruction values ​​of N coding blocks, and the decoder does not need to adjust the reconstruction values ​​of N decoding blocks.

[0183] Embodiment 4: For Embodiment 1 and Embodiment 2, it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For example, for the encoding end, after encoding the bit stream of N coding blocks (N≥1), the encoding end can record the N coding blocks as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For the decoding end, after parsing the bit stream of N decoding blocks (N≥1), the decoding end can record the N decoding blocks (corresponding to the N coding blocks of the encoding end) as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area.

[0184] Exemplarily, in order to determine whether it is necessary to adjust the reconstruction value of the current image area, the following method may be used:

[0185] Implicit derivation method: The encoder can implicitly derive whether it is necessary to adjust the reconstruction value of the current image area based on the second type of feature information corresponding to the current image area. The decoder can also implicitly derive whether it is necessary to adjust the reconstruction value of the current image area based on the second type of feature information corresponding to the current image area.

[0186] The following describes the implementation process of the implicit derivation method in combination with specific application scenarios. The process may include:

[0187] Step S21: The encoder determines whether the second type of feature information corresponding to the current image area meets a specific condition.

[0188] If not, step S22 may be executed, and if so, step S23 may be executed.

[0189] Exemplarily, the second type of feature information corresponding to the current image area may include but is not limited to at least one of the overflow indication information of the code control, the quantization parameter, the reconstructed pixel feature, and the block position. The overflow indication information of the code control may include but is not limited to the current bit rate, and the quantization parameter may include but is not limited to the quantization step size. Among them, the current bit rate is used to indicate the average bit rate of all code control units before the code control unit where the current image area is located. The block position is the block position of the image block in the current image area, such as the block position of any image block in the current image area. The block position is used to indicate the position of the image block in the current frame. Of course, the current bit rate, quantization parameter, reconstructed pixel feature and block position are only a few examples of the second type of feature information, and there is no limitation on this second type of feature information. Whether the second type of feature information meets specific conditions may include but is not limited to:

[0190] Case 1: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area. The current bit rate is also the code control information, that is, the overflow and underflow indication information of the code control. If the current bit rate is less than the first bit rate value, it is determined that the second type of feature information meets the specific conditions. Otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0191] Exemplarily, the first code rate value may be a code rate value configured based on experience, and there is no restriction on the first code rate value. When the current code rate is less than the first code rate value, it may mean that the code control information indicates that the resource pool is sufficient.

[0192] In one possible implementation, a target upper limit bit rate may be pre-configured. When the current bit rate is close to the target upper limit bit rate, it indicates that the code control information indicates that the resource pool is normal. When the current bit rate is greater than the sum of the target upper limit bit rate and a preset threshold, it indicates that the code control information indicates that the resource pool is insufficient. When the current bit rate is less than the difference between the target upper limit bit rate and the preset threshold, it indicates that the code control information indicates that the resource pool is sufficient. On this basis, the difference between the target upper limit bit rate and the preset threshold may be used as the first bit rate value.

[0193] Case 2: The second type of feature information corresponding to the current image area includes the block position corresponding to the current image area. If the block position corresponding to the current image area is located at the specified position, it is determined that the second type of feature information meets the specific conditions. Otherwise, that is, the block position corresponding to the current image area is not located at the specified position, it is determined that the second type of feature information does not meet the specific conditions.

[0194] For example, the designated position may be the last L image blocks (L may be a positive integer greater than or equal to 1) of the current code control unit (i.e., the code control unit where the current image area is located), or the designated position may be the bottom row of image blocks of the current code control unit, etc. On this basis, if the block position belongs to the last L image blocks or the bottom row of image blocks of the current code control unit, it is determined that the block position is located at the designated position; otherwise, it is determined that the block position is not located at the designated position.

[0195] For another example, the designated position may be a slice boundary position within the current frame. If the block position belongs to a slice boundary position within the current frame, the block position is determined to be located at the designated position; otherwise, the block position is determined not to be located at the designated position.

[0196] For another example, the designated position may be the last L image blocks of the current code control unit and the Slice boundary position within the current frame. If the block position belongs to the last L image blocks of the current code control unit, or the block position belongs to the Slice boundary position within the current frame, then it is determined that the block position is located at the designated position. If the block position does not belong to the last L image blocks of the current code control unit, and the block position does not belong to the Slice boundary position within the current frame, then it is determined that the block position is not located at the designated position.

[0197] Of course, the above are just a few examples of designated positions, and this embodiment does not limit the designated positions.

[0198] Case 3: The second type of feature information corresponding to the current image area includes the quantization step size corresponding to the current image area. If the quantization step size is greater than the step size threshold, it is determined that the second type of feature information meets the specific conditions. Otherwise, that is, the quantization step size is not greater than the step size threshold, it is determined that the second type of feature information does not meet the specific conditions.

[0199] Case 4: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area and the block position corresponding to the current image area. On this basis, if the current bit rate is less than the first bit rate value and the block position is located at the specified position, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0200] Case 5: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area and the block position corresponding to the current image area. If the current bit rate is less than the first bit rate value, or the block position is located at the specified position, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0201] Case 6: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area and the quantization step size corresponding to the current image area. If the current bit rate is less than the first bit rate value and the quantization step size is greater than the step size threshold, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0202] Case 7: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area and the quantization step size corresponding to the current image area. If the current bit rate is less than the first bit rate value, or the quantization step size is greater than the step size threshold, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0203] Case 8: The second type of feature information corresponding to the current image area includes the block position corresponding to the current image area and the quantization step corresponding to the current image area. On this basis, if the block position is located at the specified position and the quantization step is greater than the step threshold, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0204] Case 9: The second type of feature information corresponding to the current image area includes the block position corresponding to the current image area and the quantization step corresponding to the current image area. If the block position is located at the specified position, or the quantization step is greater than the step threshold, it is determined that the second type of feature information meets the specific conditions; otherwise, it is determined that the second type of feature information does not meet the specific conditions.

[0205] Case 10: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area, the block position corresponding to the current image area, and the quantization step corresponding to the current image area. On this basis, if the current bit rate is less than the first bit rate value, and the block position is located at the specified position, and the quantization step is greater than the step threshold, then it can be determined that the second type of feature information meets the specific conditions; otherwise, it can be determined that the second type of feature information does not meet the specific conditions.

[0206] Case 11: The second type of feature information corresponding to the current image area includes the current bit rate corresponding to the current image area, the block position corresponding to the current image area, and the quantization step corresponding to the current image area. On this basis, if the current bit rate is less than the first bit rate value, or the block position is located at the specified position, or the quantization step is greater than the step threshold, it can be determined that the second type of feature information meets the specific conditions; otherwise, it can be determined that the second type of feature information does not meet the specific conditions.

[0207] Case 12: The second category feature information corresponding to the current image area includes the reconstructed pixel features corresponding to the current image area. On this basis, if the reconstructed pixel features indicate that the complexity of the current image area is complex, it can be determined that the second category feature information meets specific conditions; otherwise, it can be determined that the second category feature information does not meet the specific conditions.

[0208] Exemplarily, the reconstructed pixel feature may be the complexity (e.g., gradient) of the current image region calculated from the reconstructed pixels. For example, the Sobel operator may be used to evaluate the complexity of the current pixel region to obtain the complexity of the current image region. The reconstructed pixel values ​​of the current image region may also be transformed to obtain the complexity of the current image region based on the characteristics of the frequency domain. The horizontal and vertical gradients of the current image region may also be calculated to obtain the complexity of the current image region based on the horizontal and vertical gradients. Of course, the above are just a few examples, as long as the reconstructed pixel features can be obtained, and the reconstructed pixel features can represent the complexity of the current image region.

[0209] The principle of reconstructed pixel features is similar to that of block positions. Complex areas can often withstand more losses without being noticed, but for simple areas, such as flat areas, even small losses will be noticed by the human eye.

[0210] Based on the above principle, when the reconstructed pixel feature indicates that the complexity of the current image area is complex, it means that the reconstruction value of the current image area can be adjusted to reduce image loss. Therefore, it can be determined that the second type of feature information meets the specific conditions. Exemplarily, the reconstructed pixel feature can be a complexity value. When the complexity value is greater than a preset threshold, the reconstructed pixel feature indicates that the complexity of the current image area is complex.

[0211] Case 13: The second type of feature information corresponding to the current image area includes the reconstructed pixel features corresponding to the current image area. On this basis, the second type of feature information corresponding to the current image area also includes at least one of the current bit rate, block position and quantization step size. For the convenience of description, the current bit rate, block position and quantization step size are taken as an example. The implementation methods in other cases are similar. Based on this, if the current bit rate is less than the first bit rate value, and the block position is located at the specified position, and the quantization step size is greater than the step size threshold, and the reconstructed pixel features indicate that the complexity of the current image area is complex, then it can be determined that the second type of feature information meets specific conditions. Otherwise, it can be determined that the second type of feature information does not meet specific conditions.

[0212] Case 14: The second type of feature information corresponding to the current image area includes the reconstructed pixel features corresponding to the current image area. On this basis, the second type of feature information corresponding to the current image area also includes at least one of the current bit rate, block position and quantization step size. For the convenience of description, the current bit rate, block position and quantization step size are taken as an example. The implementation methods in other cases are similar. Based on this, if the current bit rate is less than the first bit rate value, or the block position is located at the specified position, or the quantization step size is greater than the step size threshold, or the reconstructed pixel features indicate that the complexity of the current image area is complex, then it can be determined that the second type of feature information meets the specific conditions. Otherwise, it can be determined that the second type of feature information does not meet the specific conditions.

[0213] Of course, the above-mentioned situations are just examples of “determining whether the second type of feature information corresponding to the current image area meets specific conditions”. This embodiment does not limit the determination process of “whether the second type of feature information meets specific conditions”.

[0214] Step S22: The encoder determines that it is not necessary to adjust the reconstruction value of the current image area.

[0215] Step S23: The encoder determines that the reconstruction value of the current image area needs to be adjusted.

[0216] Step S24: The decoding end determines whether the second type of feature information corresponding to the current image area meets a specific condition.

[0217] If not, step S25 may be executed, and if so, step S26 may be executed.

[0218] Exemplarily, the implementation process of step S24 is similar to that of step S21, and will not be repeated here.

[0219] Step S25: The decoding end determines that it is not necessary to adjust the reconstruction value of the current image area.

[0220] Step S26: The decoding end determines that the reconstruction value of the current image area needs to be adjusted.

[0221] Example 5: For Example 1 and Example 2, it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For example, for the encoding end, after encoding the bit stream of N coding blocks (N≥1), the encoding end can record the N coding blocks as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area. For the decoding end, after parsing the bit stream of N decoding blocks (N≥1), the decoding end can record the N decoding blocks (corresponding to the N coding blocks of the encoding end) as the current image area, and it can be determined whether it is necessary to adjust the reconstruction value of the current image area.

[0222] Exemplarily, in order to determine whether it is necessary to adjust the reconstruction value of the current image area, the following method may be used:

[0223] A combined implementation method, i.e., an implementation method of explicit syntax + implicit derivation. For example, after the encoder obtains the mark bit of the adjustment control switch corresponding to the current image area (see Example 3), if the mark bit of the adjustment control switch is the same as the mark bit of the adjustment control switch corresponding to the target image area (such as the previous image area of ​​the current image area, or a specified image area, or a default image area, etc.), the encoder does not encode the mark bit corresponding to the adjustment control switch in the code stream. When the decoder learns that the code stream does not carry the mark bit corresponding to the adjustment control switch, the mark bit of the adjustment control switch corresponding to the target image area can be used as the mark bit of the adjustment control switch corresponding to the current image area, and then determine whether to adjust the reconstruction value of the current image area. Alternatively, after the encoder obtains the mark bit of the adjustment control switch corresponding to the current image area, if the mark bit of the adjustment control switch is different from the mark bit of the adjustment control switch corresponding to the target image area, the encoder encodes the mark bit corresponding to the adjustment control switch in the code stream. The decoder parses the mark bit corresponding to the adjustment control switch from the code stream, and determines whether to adjust the reconstruction value of the current image area based on the mark bit.

[0224] Embodiment 6: For Embodiments 1 to 5, after determining whether to adjust the reconstruction value of the current image area, if it is determined to adjust the reconstruction value of the current image area, the adjustment parameter corresponding to the current image area can be obtained, and the adjustment parameter is used to adjust the reconstruction value of the current image area, that is, to adjust the reconstruction value (or prediction value, or residual value, etc.) of the N image blocks in the current image area. For example, for the encoding end, the current image area may include N encoding blocks, and the adjustment parameter is used to adjust the reconstruction value of the N encoding blocks. For the decoding end, the current image area may include N decoding blocks, and the adjustment parameter is used to adjust the reconstruction value of the N decoding blocks.

[0225] For the encoding end, the adjustment parameter corresponding to the current image area can be determined based on the original value of the current image area and the reconstructed value of the current image area. The adjustment parameter is used to adjust the reconstructed value of the current image area so that the adjusted reconstructed value is close to the original value of the current image area. This embodiment does not limit the process of obtaining this adjustment parameter.

[0226] Exemplarily, the adjustment parameters corresponding to the current image area may include multiple adjustment values, and the current image area may correspond to multiple pixel groups, that is, all pixels of the current image area are divided into multiple pixel groups, and on this basis, the multiple adjustment values ​​may include adjustment values ​​corresponding to K pixel groups, and the K pixel groups may be all pixel groups or part of the pixel groups in the multiple pixel groups. For example, all pixels of the current image area may be divided into 32 pixel groups, and K pixel groups may be selected from the 32 pixel groups, such as 4 pixel groups, 8 pixel groups, 16 pixel groups, 32 pixel groups, etc., and there is no restriction on the value of K. Based on this, the encoding end obtains the adjustment parameters corresponding to the K pixel groups, that is, the adjustment parameters may include adjustment values ​​corresponding to the K pixel groups, and the adjustment value corresponding to each pixel group is used to adjust the reconstructed value of each pixel point in the pixel group. For example, assuming that the K pixel groups are pixel group 1 and pixel group 2, the encoding end can obtain the adjustment value corresponding to pixel group 1 and the adjustment value corresponding to pixel group 2. The adjustment value corresponding to pixel group 1 is used to adjust the reconstructed value of each pixel point in pixel group 1, and the adjustment value corresponding to pixel group 2 is used to adjust the reconstructed value of each pixel point in pixel group 2.

[0227] For each pixel group, the adjustment value corresponding to the pixel group may include the adjustment values ​​of multiple channels corresponding to the pixel group, for example, multiple channels may include a Y channel, a U channel, and a V channel, or multiple channels may include an R channel, a G channel, and a B channel, or multiple channels may include an R channel, a G channel, a B channel, and an alpha channel, or multiple channels may include an R channel, a G channel, a B channel, and an IR channel, or multiple channels may include an R channel, a G channel, a B channel, and a W channel, or multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or multiple channels may include an R channel, a G channel, a B channel, and a D channel, or multiple channels may include an R channel, a G channel, a B channel, a D channel, and a W channel. Of course, the above are just a few examples.

[0228] In actual applications, channels can also use the same adjustment value. For example, the U channel and the V channel can use the same adjustment value, or the R channel and the G channel can use the same adjustment value. There is no restriction on this.

[0229] For example, the adjustment values ​​corresponding to pixel group 1 include Y channel adjustment value 1, U channel adjustment value 1, and V channel adjustment value 1. Y channel adjustment value 1 is used to adjust the Y channel reconstruction value of each pixel in pixel group 1, U channel adjustment value 1 is used to adjust the U channel reconstruction value of each pixel in pixel group 1, and V channel adjustment value 1 is used to adjust the V channel reconstruction value of each pixel in pixel group 1. The adjustment values ​​corresponding to pixel group 2 include Y channel adjustment value 2, U channel adjustment value 2, and V channel adjustment value 2. Y channel adjustment value 2 is used to adjust the Y channel reconstruction value of each pixel in pixel group 2, U channel adjustment value 2 is used to adjust the U channel reconstruction value of each pixel in pixel group 2, and V channel adjustment value 2 is used to adjust the V channel reconstruction value of each pixel in pixel group 2.

[0230] Exemplarily, after obtaining the adjustment parameter corresponding to the current image area, the encoding end may also encode the adjustment parameter corresponding to the current image area in the bitstream corresponding to the current image area. For example, the adjustment parameter may include adjustment values ​​corresponding to K pixel groups, and therefore, the adjustment values ​​corresponding to K pixel groups may be encoded in the bitstream corresponding to the current image area.

[0231] For the decoding end, the adjustment parameter corresponding to the current image area can be obtained from the bitstream corresponding to the current image area, and the adjustment parameter is used to adjust the reconstruction value of the current image area so that the adjusted reconstruction value is close to the original value of the current image area. After obtaining the adjustment parameter, the reconstruction value of the current image area can be adjusted based on the adjustment parameter.

[0232] Exemplarily, the adjustment parameters corresponding to the current image area may include multiple adjustment values, and all pixels of the current image area may be divided into multiple pixel groups. On this basis, the multiple adjustment values ​​may include adjustment values ​​corresponding to K pixel groups, and the K pixel groups may be all pixel groups or part of the pixel groups in the multiple pixel groups. The decoding end may obtain the adjustment parameters corresponding to the K pixel groups from the bitstream, that is, the adjustment parameters may include the adjustment values ​​corresponding to the K pixel groups. The decoding end may adjust the reconstruction value of each pixel point in the pixel group based on the adjustment value corresponding to the pixel group. For example, assuming that the K pixel groups are pixel group 1 and pixel group 2, the decoding end may obtain the adjustment value corresponding to pixel group 1 and the adjustment value corresponding to pixel group 2, and the decoding end may adjust the reconstruction value of each pixel point in pixel group 1 based on the adjustment value corresponding to pixel group 1, and the decoding end may adjust the reconstruction value of each pixel point in pixel group 2 based on the adjustment value corresponding to pixel group 2.

[0233] For each pixel group, the adjustment value corresponding to the pixel group may include the adjustment values ​​of multiple channels corresponding to the pixel group, for example, multiple channels may include a Y channel, a U channel, and a V channel, or multiple channels may include an R channel, a G channel, and a B channel, or multiple channels may include an R channel, a G channel, a B channel, and an alpha channel, or multiple channels may include an R channel, a G channel, a B channel, and an IR channel, or multiple channels may include an R channel, a G channel, a B channel, and a W channel, or multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or multiple channels may include an R channel, a G channel, a B channel, and a D channel, or multiple channels may include an R channel, a G channel, a B channel, a D channel, and a W channel. Of course, the above are just a few examples and are not limited to this.

[0234] Exemplarily, for each pixel group in the K pixel groups, if the multiple adjustment values ​​obtained from the code stream include the adjustment value corresponding to the pixel group, the decoder adjusts the reconstruction value of each pixel point in the pixel group based on the adjustment value corresponding to the pixel group to obtain the adjusted reconstruction value of each pixel point in the pixel group. For example, if the multiple adjustment values ​​obtained from the code stream include the Y channel adjustment value 1, the U channel adjustment value 1, and the V channel adjustment value 1 corresponding to the pixel group 1, the Y channel reconstruction value of each pixel point in the pixel group 1 can be adjusted based on the Y channel adjustment value 1, the U channel reconstruction value of each pixel point in the pixel group 1 can be adjusted based on the U channel adjustment value 1, and the V channel reconstruction value of each pixel point in the pixel group 1 can be adjusted based on the V channel adjustment value 1. For another example, if the multiple adjustment values ​​obtained from the code stream only include the Y channel adjustment value 1 corresponding to the pixel group 1, but do not include the U channel adjustment value and the V channel adjustment value corresponding to the pixel group 1, the decoder can adjust the Y channel reconstruction value of each pixel point in the pixel group 1 based on the Y channel adjustment value 1.

[0235] In a possible implementation, if the K pixel groups are all the pixel groups in all pixel groups (such as 32 pixel groups), the encoder may not encode the pixel group indication information corresponding to the K pixel groups in the bitstream corresponding to the current image area, and the decoder does not need to parse the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area. On this basis, the decoder learns that the adjustment parameters carried in the bitstream are the adjustment values ​​of all pixel groups (such as 32 pixel groups).

[0236] If the K pixel groups are part of all pixel groups, the encoder can encode the pixel group indication information corresponding to the K pixel groups in the bitstream corresponding to the current image area, indicating that the bitstream carries the adjustment value of the pixel group corresponding to the pixel group indication information. The decoder can parse the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area, and learn that the adjustment parameters carried in the bitstream are the adjustment values ​​corresponding to the K pixel groups corresponding to the pixel group indication information.

[0237] For example, the pixel group indication information includes index values ​​of K pixel groups, and the index value indicates which pixel group the pixel group is among all pixel groups. For example, if the K pixel groups are pixel group 1, pixel group 2, pixel group 3 and pixel group 4, the pixel group indication information includes the index value of pixel group 1 (the index value is used to indicate which pixel group pixel group 1 is among all pixel groups), the index value of pixel group 2, the index value of pixel group 3 and the index value of pixel group 4. Obviously, if the K pixel groups are some pixel groups among multiple pixel groups, the pixel group indication information is used to distinguish pixel groups of the target category among all categories of pixel groups, that is, to distinguish K pixel groups from all pixel groups, and the pixel group indication information can realize the classification function.

[0238] For another example, assuming that the K pixel groups are continuous pixel groups, the pixel group indication information includes index values ​​of some pixel groups in the K pixel groups, and the index values ​​of the remaining pixel groups can be implicitly derived. Taking the K pixel groups as pixel group 1, pixel group 2, pixel group 3 and pixel group 4 as an example, the pixel group indication information only includes the index value of pixel group 1. Since the K pixel groups are continuous pixel groups, the index value of pixel group 2, the index value of pixel group 3 and the index value of pixel group 4 are implicitly derived.

[0239] To summarize, the index values ​​of the K pixel groups may be indicated in a displayed manner, or the index values ​​of some of the K pixel groups may be indicated in a displayed manner, and the index values ​​of the remaining pixel groups may be derived implicitly. This is not limited in the present embodiment as long as the decoding end can obtain the index values ​​of the K pixel groups.

[0240] Exemplarily, if the K pixel groups are some pixel groups among all pixel groups, and the K pixel groups are K pixel groups in default positions, such as the K pixel groups are fixed to the first 4 pixel groups, or the K pixel groups are fixed to the 1st, 3rd, 5th, and 7th pixel groups, or the K pixel groups are fixed to the last 4 pixel groups, then the encoder may not encode the pixel group indication information corresponding to the K pixel groups in the bitstream corresponding to the current image area, and the decoder does not need to parse the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area. On this basis, the decoder learns that the adjustment parameters carried in the bitstream are the adjustment values ​​of the K pixel groups in the default positions, for example, the adjustment parameters are the adjustment values ​​of the first 4 pixel groups, or the adjustment parameters are the adjustment values ​​of the 1st, 3rd, 5th, and 7th pixel groups, or the adjustment parameters are the adjustment values ​​of the last 4 pixel groups.

[0241] Embodiment 7: For the encoding end, the adjustment parameters corresponding to the current image area include adjustment values ​​corresponding to K pixel groups, that is, the adjustment parameters include multiple adjustment values. When encoding the adjustment values ​​corresponding to K pixel groups in the bitstream corresponding to the current image area, all or part of the adjustment values ​​can be encoded in the bitstream corresponding to the current image area. For example, assuming that the K pixel groups are 4 pixel groups, each pixel group includes a Y channel adjustment value, a U channel adjustment value, and a V channel adjustment value, then the adjustment parameters corresponding to the current image area include 12 adjustment values, and the 12 adjustment values ​​can be encoded in the bitstream corresponding to the current image area, or part of the 12 adjustment values ​​can be encoded in the bitstream corresponding to the current image area.

[0242] For the decoding end, when obtaining adjustment parameters from the code stream corresponding to the current image area, if the encoding end encodes all adjustment values ​​corresponding to K pixel groups, the decoding end can obtain all adjustment values ​​corresponding to K pixel groups from the code stream corresponding to the current image area, and if the encoding end encodes part of the adjustment values ​​corresponding to K pixel groups, the decoding end can obtain part of the adjustment values ​​corresponding to K pixel groups from the code stream corresponding to the current image area. For example, if the decoding end obtains the Y channel adjustment value corresponding to the pixel group, but does not obtain the U channel adjustment value and the V channel adjustment value corresponding to the pixel group, the decoding end only adjusts the Y channel reconstruction value of each pixel point in the pixel group based on the Y channel adjustment value, and does not adjust the U channel reconstruction value and the V channel reconstruction value of each pixel point in the pixel group. In addition, if the decoding end does not obtain the adjustment value of a certain pixel group among the K pixel groups, the decoding end will no longer adjust the reconstruction value of each pixel point in the pixel group.

[0243] In a possible implementation, based on the multiple adjustment values ​​corresponding to the K pixel groups, the encoder encodes all or part of the adjustment values ​​in the bitstream corresponding to the current image region, which may include but is not limited to the following steps:

[0244] Step S31 : sorting the multiple adjustment values ​​according to their coding order.

[0245] Taking 4 pixel groups (such as pixel group 1-pixel group 4), each pixel group includes Y channel adjustment value, U channel adjustment value and V channel adjustment value as an example, the current image area corresponds to 12 adjustment values, and the encoding order of the 12 adjustment values ​​can be determined.

[0246] First, the encoding order of each pixel group can be determined. For example, when multiple pixel groups are divided according to the reconstructed value of each pixel point, the encoding order of each pixel group is determined according to the value range of each pixel group, such as sorting in order from small to large value range, or sorting in order from large to small value range. Taking sorting in order from small to large value range as an example, assuming that the value range corresponding to pixel group 1 is the smallest, the value range corresponding to pixel group 2 is the second smallest, the value range corresponding to pixel group 3 is the third smallest, and the value range corresponding to pixel group 4 is the largest, then the encoding order of each pixel group is pixel group 1, pixel group 2, pixel group 3 and pixel group 4.

[0247] For another example, when multiple pixel groups are divided according to the gradient value of each pixel point, the encoding order of each pixel group is determined according to the gradient value range of each pixel group (that is, the gradient value result corresponding to each pixel group, such as the above-mentioned absolute value range below 10), such as sorting in order from small to large in the gradient value range, or sorting in order from large to small in the gradient value range. Taking sorting in order from small to large in the gradient value range as an example, assuming that the gradient value range corresponding to pixel group 1 is the smallest, the gradient value range corresponding to pixel group 2 is the second smallest, the gradient value range corresponding to pixel group 3 is the third smallest, and the gradient value range corresponding to pixel group 4 is the largest, then the encoding order of the pixel groups is pixel group 1, pixel group 2, pixel group 3 and pixel group 4.

[0248] For another example, when multiple pixel groups are divided according to the pixel position of each pixel point, the encoding order of each pixel group is determined according to the block order corresponding to each pixel group, such as sorting in order from front to back according to the block order. Assuming that the sub-region corresponding to pixel group 1 is the first block of the current image area, the sub-region corresponding to pixel group 2 is the second block of the current image area, the sub-region corresponding to pixel group 3 is the third block of the current image area, and the sub-region corresponding to pixel group 4 is the fourth block of the current image area, then the encoding order of each pixel group is pixel group 1, pixel group 2, pixel group 3 and pixel group 4.

[0249] Of course, the above methods are just a few examples of determining the encoding order of each pixel group and are not limited to this.

[0250] Then, determine the coding order of each channel, such as determining the coding order between the Y channel, the U channel and the V channel, such as the coding order is: Y channel, U channel, V channel; or, Y channel, V channel, U channel; or, U channel, Y channel, V channel; or, U channel, V channel, Y channel. Of course, the above methods are just a few examples of determining the coding order of each channel, and there is no limitation to this, and the coding order of each channel can be arbitrarily planned.

[0251] Then, based on the coding order of each pixel group and the coding order of each channel, the coding order of multiple adjustment values ​​is determined. For example, the coding order of multiple adjustment values ​​can be determined mainly based on the coding order of the pixel group and supplemented by the coding order of each channel. For example, the coding order of each pixel group is pixel group 1, pixel group 2, pixel group 3 and pixel group 4, and the coding order of each channel is Y channel, U channel, and V channel. Then, the coding order of the 12 adjustment values ​​is: Y channel adjustment value, U channel adjustment value and V channel adjustment value of pixel group 1, Y channel adjustment value, U channel adjustment value and V channel adjustment value of pixel group 2, Y channel adjustment value, U channel adjustment value and V channel adjustment value of pixel group 3, and Y channel adjustment value, U channel adjustment value and V channel adjustment value of pixel group 4. For another example, the coding order of the multiple adjustment values ​​can be determined mainly based on the coding order of each channel and supplemented by the coding order of the pixel group. Then the coding order of the 12 adjustment values ​​is: Y channel adjustment value of pixel group 1, Y channel adjustment value of pixel group 2, Y channel adjustment value of pixel group 3, Y channel adjustment value of pixel group 4, U channel adjustment value of pixel group 1, U channel adjustment value of pixel group 2, U channel adjustment value of pixel group 3, U channel adjustment value of pixel group 4, V channel adjustment value of pixel group 1, V channel adjustment value of pixel group 2, V channel adjustment value of pixel group 3, V channel adjustment value of pixel group 4. Of course, the above are only two examples of the coding order of the multiple adjustment values. This embodiment does not limit the coding order of the multiple adjustment values, and the coding order of the multiple adjustment values ​​can be arbitrarily configured.

[0252] Step S32: traverse each adjustment value in the multiple adjustment values ​​in sequence based on the sorting result.

[0253] For example, during the first traversal, the Y channel adjustment value of pixel group 1 is traversed, during the second traversal, the U channel adjustment value of pixel group 1 is traversed, during the third traversal, the V channel adjustment value of pixel group 1 is traversed, during the fourth traversal, the Y channel adjustment value of pixel group 2 is traversed, during the fifth traversal, the U channel adjustment value of pixel group 2 is traversed, and so on.

[0254] Step S33: for the currently traversed adjustment value, if the current bit rate is less than the second bit rate value after the adjustment value is encoded in the bit stream corresponding to the current image area, the adjustment value is encoded in the bit stream corresponding to the current image area, and the next adjustment value of the adjustment value is continuously traversed, and the next adjustment value is used as the currently traversed adjustment value.

[0255] Exemplarily, the second code rate value may be configured based on experience, and there is no restriction on this. When the current code rate is less than the second code rate value, it indicates that the code control information indicates that the resource pool is sufficient. In a possible implementation, a target upper limit code rate may be pre-configured. When the current code rate is close to the target upper limit code rate, it indicates that the code control information indicates that the resource pool is normal. When the current code rate is greater than the sum of the target upper limit code rate and a preset threshold, it indicates that the code control information indicates that the resource pool is insufficient. When the current code rate is less than the difference between the target upper limit code rate and the preset threshold, it indicates that the code control information indicates that the resource pool is sufficient. On this basis, the difference between the target upper limit code rate and the preset threshold may be used as the second code rate value. The second code rate value may be the same as or different from the above-mentioned first code rate value.

[0256] Step S34: for the currently traversed adjustment value, if the current bit rate is not less than the second bit rate value after the adjustment value is encoded in the bit stream corresponding to the current image area, it is possible to prohibit encoding the adjustment value in the bit stream corresponding to the current image area, and stop traversing the next adjustment value of the adjustment value, that is, end the traversal process of multiple adjustment values.

[0257] In summary, in this embodiment, when the encoder encodes multiple adjustment values ​​corresponding to K pixel groups in the bitstream corresponding to the current image area, each adjustment value in the multiple adjustment values ​​can be traversed in sequence. For the currently traversed adjustment value, if the current bit rate is less than the second bit rate value after the adjustment value is encoded in the bitstream, the adjustment value is encoded in the bitstream, and the next adjustment value of the adjustment value is traversed. If the current bit rate is not less than the second bit rate value, the adjustment value is not encoded in the bitstream, and the traversal of the next adjustment value of the adjustment value is stopped, and so on, until all the adjustment values ​​corresponding to the K pixel groups have been traversed, or the current bit rate is not less than the second bit rate value, and the traversal of the adjustment values ​​is stopped. So far, all or part of the adjustment values ​​corresponding to the K pixel groups can be encoded in the bitstream corresponding to the current image area, and this process is not described in detail.

[0258] Embodiment 8: In the process of transferring adjustment parameters, the state of code control will also be updated synchronously. After encoding the adjustment parameters, if the code control is still in the underflow state (less than 0, such as when the current code rate is less than the second code rate value, it means that the code control is still in the underflow state), the encoding of the adjustment parameters will continue. Case 1: The adjustment parameters are gradually transferred in the form of channels, i.e., Y channel, U channel, V channel, R channel, G channel, B channel, alpha channel (part of the channels can also be shared, such as UV channel sharing), etc. If the code control state is underflow, the adjustment parameters are encoded in sequence (the decoding end is parsed). After the transfer, if the code control is still underflowing, the next adjustment parameter is continuously encoded (the decoding end is parsed), and so on, until the code control does not overflow or all the adjustment parameters are transferred. Case 2: The adjustment parameters are gradually transferred in the form of pixel groups (at least one pixel), that is, the adjustment parameters are transferred one by one according to a certain scanning order and grouping. For example, according to the Y channel first, then the U channel, and then the V channel, each channel is divided into four groups in the vertical direction (i.e., 4 pixel groups), and then the adjustment parameters are transferred group by group, and the code control state is gradually updated. Exemplarily, the adjustment parameters express the adjustment of one or more categories of reconstruction values ​​in N coding blocks (i.e., the current image area). One or more categories of reconstruction values ​​can be transmitted through syntax or determined by export, for example: unified agreement on the codec end; exported based on the encoded information (such as mode information, reconstruction value information, etc.).

[0259] Embodiment 9: With respect to Embodiments 1 to 8, for the encoding end and the decoding end, the current image area may correspond to multiple pixel groups, such as dividing all pixel points in the current image area into multiple pixel groups, that is, classifying all pixel points. In this embodiment, all pixel points in the current image area may be divided into multiple pixel groups in the following manner:

[0260] Method 1: All pixels in the current image area are divided into multiple pixel groups according to the reconstruction value before adjustment of each pixel, that is, the reconstruction value before adjustment of each pixel (the reconstruction value used for grouping later refers to the reconstruction value before adjustment) can be classified to obtain multiple pixel groups. For example, the value range of the reconstruction value can be evenly divided into A pixel groups, and the pixel group is determined according to the range of the reconstruction value. For example, the 8-bit reconstruction value (value range 0 to 255) is divided into 16 pixel groups, and the ranges of the 16 pixel groups are 0 to 15, 16 to 31, 32 to 47, 48 to 63, ..., 240 to 255. If the reconstructed value of the pixel point is in the range of 0 to 15, the pixel point is divided into the first pixel group; if the reconstructed value of the pixel point is in the range of 16 to 31, the pixel point is divided into the second pixel group; if the reconstructed value of the pixel point is in the range of 32 to 47, the pixel point is divided into the third pixel group; if the reconstructed value of the pixel point is in the range of 48 to 63, the pixel point is divided into the fourth pixel group, and so on. If the reconstructed value of the pixel point is in the range of 240 to 255, the pixel point is divided into the 16th pixel group.

[0261] Exemplarily, when all pixels in the current image area are divided into multiple pixel groups according to the reconstruction value of each pixel, the division can also be performed channel by channel. For example, taking the Y channel, U channel, and V channel as an example, if the Y channel reconstruction value of the pixel is in the range of 0 to 15, the Y channel reconstruction value of the pixel is divided into the first pixel group, based on which the Y channel reconstruction value of the pixel can be adjusted based on the Y channel adjustment value corresponding to the first pixel group. If the U channel reconstruction value of the pixel is in the range of 16 to 31, the U channel reconstruction value of the pixel is divided into the second pixel group, based on which the U channel reconstruction value of the pixel can be adjusted based on the U channel adjustment value corresponding to the second pixel group. If the V channel reconstruction value of the pixel is in the range of 16 to 31, the V channel reconstruction value of the pixel is divided into the second pixel group, based on which the V channel reconstruction value of the pixel can be adjusted based on the V channel adjustment value corresponding to the second pixel group.

[0262] Method 2: Determine the classification value of the pixel based on the pre-adjustment reconstruction values ​​of the pixel's surrounding pixels (the reconstruction values ​​used for grouping later all refer to the pre-adjustment reconstruction values), and divide all pixels in the current image area into multiple pixel groups according to the classification values ​​of each pixel. That is, classification can be performed based on the gradient values ​​of each pixel to obtain multiple pixel groups.

[0263] For example, the pixel can be classified according to the reconstruction values ​​of the surrounding pixels. For example, by using gradient information, the reconstruction value of the upper adjacent pixel of the pixel is subtracted from the reconstruction value of the left adjacent pixel of the pixel to obtain the gradient value of the pixel. The pixels whose gradient value results are in a certain range can be defined as the same category, such as the first category for the absolute value below 10, the second category for the absolute value between 10 and 30, and the third category for the absolute value greater than 30. On this basis, for a certain pixel, if the absolute value of the gradient value of the pixel is below 10, the pixel is divided into the first pixel group, if the absolute value of the gradient value of the pixel is between 10 and 30, the pixel is divided into the second pixel group, and if the absolute value of the gradient value of the pixel is greater than 30, the pixel is divided into the third pixel group.

[0264] Method 3: Divide all pixels of the current image area into multiple pixel groups according to the pixel position of each pixel, that is, classify according to the pixel position of each pixel to obtain multiple pixel groups. For example, classification can be performed according to the pixel position, such as dividing the 16*2 current image area into four 4*2 sub-areas, and each 4*2 sub-area is divided into one category. On this basis, for a certain pixel, if the pixel is in the first 4*2 sub-area, the pixel can be divided into the first pixel group, if the pixel is in the second 4*2 sub-area, the pixel can be divided into the second pixel group, if the pixel is in the third 4*2 sub-area, the pixel can be divided into the third pixel group, and if the pixel is in the fourth 4*2 sub-area, the pixel can be divided into the fourth pixel group.

[0265] Method 4: Each pixel point can be divided into a pixel group, that is, each pixel point is a pixel group, and different pixels points correspond to different pixel groups. It can be understood that a pixel group includes one pixel point.

[0266] Of course, the above methods are just a few examples of division methods, and there is no limitation on this division method.

[0267] Embodiment 10: With respect to Embodiments 1 to 8, for the encoding end and the decoding end, the current image area may correspond to multiple pixel groups. For example, all pixel points in the current image area are divided into multiple pixel groups, that is, all pixel points are classified. In this embodiment, the multiple pixel groups corresponding to the current image area may be determined in the following manner: the multiple pixel groups corresponding to the current image area are determined according to the prediction mode of the current image area. In other words, the division of the pixel groups may be related to the prediction mode of the current image area. For example, the division attribute of the pixel group may be determined according to the prediction mode of the current image area, and the multiple pixel groups corresponding to the current image area may be determined based on the division attribute.

[0268] Exemplarily, the division attribute may include at least one of the number of divisions, the filter area, and the division method. If the division attribute includes the number of divisions, the filter area, and the division method, the number of divisions, the filter area, and the division method of the pixel group are determined according to the prediction mode of the current image area, and the multiple pixel groups corresponding to the current image area are determined based on the number of divisions, the filter area, and the division method. If the division attribute includes the number of divisions and the division method, the number of divisions and the division method of the pixel group are determined according to the prediction mode of the current image area, and the multiple pixel groups corresponding to the current image area are determined based on the number of divisions and the division method. Regarding the combination of other division attributes, the implementation method is similar and will not be repeated in this embodiment.

[0269] The number of divisions is used to indicate how many pixel groups the current image area is divided into, the filtering area is used to indicate which part of the current image area is divided into multiple pixel groups, and the division method is used to indicate the size specification of each pixel group.

[0270] Wherein, if the division attribute includes a filter area, the filter area is used to indicate that the entire area of ​​the current image area is divided into a plurality of pixel groups, and may also indicate that a part of the current image area is divided into a plurality of pixel groups. If the division attribute does not include a filter area, it indicates that the entire area of ​​the current image area is divided into a plurality of pixel groups.

[0271] Exemplarily, the prediction mode of the current image area can be divided into a horizontal prediction mode and a non-horizontal prediction mode. If the prediction mode of the current image area is a horizontal prediction mode, the number of pixel group divisions is determined to be the first number of divisions, the filtering area of ​​the pixel group is determined to be the first filtering area, and the division method is determined to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, the number of pixel group divisions is determined to be the second number of divisions, the filtering area of ​​the pixel group is determined to be the second filtering area, and the division method is determined to be the second size specification. Alternatively, if the prediction mode of the current image area is a horizontal prediction mode, the number of pixel group divisions is determined to be the first number of divisions, and the division method is determined to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, the number of pixel group divisions is determined to be the second number of divisions, and the division method is determined to be the second size specification. For another example, the prediction mode of the current image area can be distinguished into a vertical prediction mode and a non-vertical prediction mode. If the prediction mode of the current image area is a vertical prediction mode, the number of pixel group divisions is determined to be the third number of divisions, the filtering area of ​​the pixel group is determined to be the third filtering area, and the division method is determined to be the third size specification; if the prediction mode of the current image area is not a vertical prediction mode, the number of pixel group divisions is determined to be the fourth number of divisions, the filtering area of ​​the pixel group is determined to be the fourth filtering area, and the division method is determined to be the fourth size specification. Alternatively, if the prediction mode of the current image area is a vertical prediction mode, the number of pixel group divisions is determined to be the third number of divisions, and the division method is determined to be the third size specification; if the prediction mode of the current image area is not a vertical prediction mode, the number of pixel group divisions is determined to be the fourth number of divisions, and the division method is determined to be the fourth size specification. Of course, the method of distinguishing between horizontal prediction mode and non-horizontal prediction mode, and the method of distinguishing between vertical prediction mode and non-vertical prediction mode are just two examples, and there is no limitation to this.

[0272] For example, the prediction mode of the current image area can be divided into a first prediction mode and a non-first prediction mode, the first prediction mode corresponds to the first division attribute (number of divisions, filter area and division method), and the non-first prediction mode corresponds to the second division attribute (number of divisions, filter area and division method). For another example, the prediction mode of the current image area can be divided into a first prediction mode, a second prediction mode, and a non-first and non-second prediction mode, the first prediction mode corresponds to the first division attribute (number of divisions, filter area and division method), the second prediction mode corresponds to the second division attribute (number of divisions, filter area and division method), and the non-first and non-second prediction mode corresponds to the second division attribute (number of divisions, filter area and division method). For another example, the prediction mode of the current image area can be divided into a first prediction mode and a second prediction mode, the first prediction mode corresponds to the first division attribute (number of divisions, filter area and division method), the second prediction mode corresponds to the second division attribute (number of divisions, filter area and division method), and so on.

[0273] Of course, in practical applications, it can also be divided into more prediction modes, and there is no limitation to this.

[0274] For the convenience of description, in this embodiment, taking the example of distinguishing the prediction mode of the current image area into a horizontal prediction mode and a non-horizontal prediction mode, if the prediction mode of the current image area is a horizontal prediction mode, the number of divisions of the pixel group is determined to be the first number of divisions, the filtering area of ​​the pixel group is determined to be the first filtering area, and the division method is determined to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, the number of divisions of the pixel group is determined to be the second number of divisions, the filtering area of ​​the pixel group is determined to be the second filtering area, and the division method is determined to be the second size specification.

[0275] Among them, regarding the first number of divisions, it can be configured according to experience, such as 2, 4, 6, 8, 16, etc., without limitation. Regarding the first filtering area, it can be the entire area of ​​the current image area, or it can be a partial area of ​​the current image area, without limitation. Regarding the first size specification, it can be configured according to experience, and the first size specification can include width and height. The width can be 2, 4, 6, 8, 12, 16, etc., without limitation, and the height can be 1, 2, 4, 6, 8, 12, 16, etc., without limitation. In addition, regarding the second number of divisions, it can be configured according to experience, such as 2, 4, 6, 8, 16, etc., without limitation. Regarding the second filtering area, it can be the entire area of ​​the current image area, or it can be a partial area of ​​the current image area, without limitation. Regarding the second size specification, it can be configured based on experience. The second size specification can include width and height. The width can be 2, 4, 6, 8, 12, 16, etc., and there is no restriction on this. The height can be 1, 2, 4, 6, 8, 12, 16, etc., and there is no restriction on this.

[0276] For example, if the current image area is a 16*2 image block, when the prediction mode of the current image area is the horizontal prediction mode, all pixels of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 8*1; in this case, the first number of divisions is 4, the first filtering area is the entire area of ​​the current image area, and the first size specification is 8*1, see Figure 5A As shown, the 16*2 image block is divided into four 8*1 pixel groups.

[0277] Alternatively, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 16*1; in this case, the first number of divisions is 2, the first filtering area is the entire area of ​​the current image area, and the first size specification is 16*1, see Figure 5B As shown, the 16*2 image block is divided into two 16*1 pixel groups.

[0278] Alternatively, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*2; in this case, the first number of divisions is 4, the first filtering area is the entire area of ​​the current image area, and the first size specification is 4*2, see Figure 5C As shown, the 16*2 image block is divided into four 4*2 pixel groups.

[0279] Alternatively, all pixels in the current image area can be divided into 8 pixel groups, and the size of each pixel group is 2*2; in this case, the first number of divisions is 8, the first filtering area is the entire area of ​​the current image area, and the first size specification is 2*2, see Figure 5DAs shown, the 16*2 image block is divided into 8 2*2 pixel groups.

[0280] Of course, the above are just a few examples of division in the horizontal prediction mode, and there is no limitation to this.

[0281] In addition, if the current image area is a 16*2 image block, when the prediction mode of the current image area is not the horizontal prediction mode, all pixels of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*2. In this case, the first number of divisions is 4, the first filtering area is the entire area of ​​the current image area, and the first size specification is 4*2, see Figure 5C As shown, the 16*2 image block is divided into four 4*2 pixel groups.

[0282] Alternatively, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 8*1; in this case, the first number of divisions is 4, the first filtering area is the entire area of ​​the current image area, and the first size specification is 8*1, see Figure 5A As shown, the 16*2 image block is divided into four 8*1 pixel groups.

[0283] Alternatively, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 16*1; in this case, the first number of divisions is 2, the first filtering area is the entire area of ​​the current image area, and the first size specification is 16*1, see Figure 5B As shown, the 16*2 image block is divided into two 16*1 pixel groups.

[0284] Alternatively, all pixels in the current image area can be divided into 8 pixel groups, and the size of each pixel group is 2*2; in this case, the first number of divisions is 8, the first filtering area is the entire area of ​​the current image area, and the first size specification is 2*2, see Figure 5D As shown, the 16*2 image block is divided into 8 2*2 pixel groups.

[0285] Of course, the above are just a few examples of division in non-horizontal prediction mode, and there is no limitation to this.

[0286] For another example, if the current image area is an 8*2 image block, when the prediction mode of the current image area is the horizontal prediction mode, all the pixels of the current image area can be divided into 2 pixel groups, and the size of each pixel group is 4*2; in this case, the first division number is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*2. Alternatively, all the pixels of the current image area can be divided into 2 pixel groups, and the size of each pixel group is 8*1; in this case, the first division number is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Alternatively, all the pixels of the current image area can be divided into 1 pixel group, and the size of each pixel group is 8*2; in this case, the first division number is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*2. Alternatively, all the pixels of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 2*2; in this case, the first division number is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*2. Of course, the above are just a few examples of division in the horizontal prediction mode, and there is no limitation to this.

[0287] In addition, if the current image area is an 8*2 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixels of the current image area can be divided into 2 pixel groups, each pixel group has a size of 4*2; in this case, the first number of divisions is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*2. Alternatively, all pixels of the current image area can be divided into 2 pixel groups, each pixel group has a size of 8*1; in this case, the first number of divisions is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Alternatively, all pixels of the current image area can be divided into 1 pixel group, each pixel group has a size of 8*2; in this case, the first number of divisions is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*2. Alternatively, all pixels of the current image area can be divided into 4 pixel groups, each pixel group has a size of 2*2; in this case, the first number of divisions is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*2. Of course, the above are just a few examples of division in non-horizontal prediction mode, and there is no limitation to this.

[0288] For another example, if the current image area is a 16*1 image block, when the prediction mode of the current image area is the horizontal prediction mode, all the pixels of the current image area can be divided into 2 pixel groups, and the size of each pixel group is 8*1; in this case, the first number of divisions is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Alternatively, all the pixels of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*1; in this case, the first number of divisions is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*1. Alternatively, all the pixels of the current image area can be divided into 1 pixel group, and the size of each pixel group is 16*1; in this case, the first number of divisions is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 16*1. Alternatively, all the pixels of the current image area can be divided into 8 pixel groups, and the size of each pixel group is 2*1; in this case, the first number of divisions is 8, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*1. Of course, the above are just a few examples of division in the horizontal prediction mode, and there is no limitation to this.

[0289] In addition, if the current image area is a 16*1 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixels of the current image area can be divided into 2 pixel groups, each pixel group has a size of 8*1; in this case, the first number of divisions is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Alternatively, all pixels of the current image area can be divided into 4 pixel groups, each pixel group has a size of 4*1; in this case, the first number of divisions is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*1. Alternatively, all pixels of the current image area can be divided into 1 pixel group, each pixel group has a size of 16*1; in this case, the first number of divisions is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 16*1. Alternatively, all pixels of the current image area can be divided into 8 pixel groups, each pixel group has a size of 2*1; in this case, the first number of divisions is 8, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*1. Of course, the above are just a few examples of division in non-horizontal prediction mode, and there is no limitation to this.

[0290] For another example, if the current image area is an 8*1 image block, when the prediction mode of the current image area is the horizontal prediction mode, all the pixels of the current image area can be divided into 2 pixel groups, and the size of each pixel group is 4*1; in this case, the first division number is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*1. Alternatively, all the pixels of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 2*1; in this case, the first division number is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*1. Alternatively, all the pixels of the current image area can be divided into 1 pixel group, and the size of each pixel group is 8*1; in this case, the first division number is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Of course, the above are just a few examples of division in the horizontal prediction mode, and there is no limitation to this.

[0291] In addition, if the current image area is an 8*1 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixels of the current image area can be divided into 2 pixel groups, each pixel group has a size of 4*1; in this case, the first number of divisions is 2, the first filter area is the entire area of ​​the current image area, and the first size specification is 4*1. Alternatively, all pixels of the current image area can be divided into 4 pixel groups, each pixel group has a size of 2*1; in this case, the first number of divisions is 4, the first filter area is the entire area of ​​the current image area, and the first size specification is 2*1. Alternatively, all pixels of the current image area can be divided into 1 pixel group, each pixel group has a size of 8*1; in this case, the first number of divisions is 1, the first filter area is the entire area of ​​the current image area, and the first size specification is 8*1. Of course, the above are just a few examples of division in a non-horizontal prediction mode, and there is no limitation to this.

[0292] In practical applications, when the size of the current image area is other sizes, such as 16*4 image blocks, 8*4 image blocks, 16*8 image blocks, etc., the division method is similar to the above method and will not be repeated in this embodiment.

[0293] Embodiment 11: With respect to Embodiments 1 to 8, for the encoding end and the decoding end, the current image area may correspond to multiple pixel groups. For example, all the pixels in the current image area are divided into multiple pixel groups, that is, all the pixels are classified. In this embodiment, the following method may be used to determine the multiple pixel groups corresponding to the current image area: the default strategy is used to determine the multiple pixel groups corresponding to the current image area. For example, the default strategy may be used to determine the division attribute of the pixel group, and the multiple pixel groups corresponding to the current image area are determined based on the division attribute. Exemplarily, the division attribute may include at least one of the number of divisions, the filtering area, and the division method. If the division attribute includes the number of divisions, the filtering area, and the division method, the number of divisions, the filtering area, and the division method of the pixel group are determined, and the multiple pixel groups corresponding to the current image area are determined based on the number of divisions, the filtering area, and the division method. If the division attribute includes the number of divisions and the division method, the number of divisions and the division method of the pixel group are determined, and the multiple pixel groups corresponding to the current image area are determined based on the number of divisions and the division method. The number of divisions is used to indicate how many pixel groups the current image area is divided into, the filtering area is used to indicate which part of the current image area is divided into multiple pixel groups, and the division method is used to indicate the size specification of each pixel group.

[0294] In the above method, the number of divisions, the filtering area and the division method can all be specified based on the default strategy, such as specifying that the number of divisions is the first number of divisions, the filtering area is the first filtering area, and the division method is the first size specification. For example, the number of divisions is the second number of divisions, the filtering area is the second filtering area, and the division method is the second size specification.

[0295] The number of divisions can be configured based on experience, such as 2, 4, 6, 8, 16, etc., without limitation. The filter area can be the entire area of ​​the current image area, or a part of the current image area, without limitation. The size specification can be configured based on experience, and the size specification can include width and height. The width can be 2, 4, 6, 8, 12, 16, etc., without limitation, and the height can be 1, 2, 4, 6, 8, 12, 16, etc., without limitation.

[0296] For example, if the current image area is a 16*2 image block, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 8*1. Alternatively, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 16*1. Alternatively, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*2. Alternatively, all pixels in the current image area can be divided into 8 pixel groups, and the size of each pixel group is 2*2. Of course, the above are just a few examples and there is no limitation to this.

[0297] For another example, if the current image area is an 8*2 image block, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 4*2. Alternatively, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 8*1. Alternatively, all pixels in the current image area can be divided into 1 pixel group, and the size of each pixel group is 8*2. Alternatively, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 2*2. Of course, the above are just a few examples and are not limited to this.

[0298] For another example, if the current image area is a 16*1 image block, all pixels in the current image area can be divided into 2 pixel groups, and the size of each pixel group is 8*1. Alternatively, all pixels in the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*1. Alternatively, all pixels in the current image area can be divided into 1 pixel group, and the size of each pixel group is 16*1. Alternatively, all pixels in the current image area can be divided into 8 pixel groups, and the size of each pixel group is 2*1. Of course, the above are just a few examples and are not limited to this.

[0299] For another example, if the current image area is an 8*1 image block, all pixels in the current image area may be divided into 2 pixel groups, each of which has a size of 4*1. Alternatively, all pixels in the current image area may be divided into 4 pixel groups, each of which has a size of 2*1. Alternatively, all pixels in the current image area may be divided into 1 pixel group, each of which has a size of 8*1. Of course, the above are just a few examples and are not intended to be limiting.

[0300] In practical applications, when the size of the current image area is other sizes, such as 16*4 image blocks, 8*4 image blocks, 16*8 image blocks, etc., the division method is similar to the above method and will not be repeated in this embodiment.

[0301] Embodiment 12: With respect to Embodiments 1 to 8, for the encoding end and the decoding end, the current image area may correspond to multiple pixel groups. For example, all pixel points in the current image area are divided into multiple pixel groups, that is, all pixel points are classified. In this embodiment, the multiple pixel groups corresponding to the current image area may be determined in the following manner: the multiple pixel groups corresponding to the current image area are determined according to the scanning order of the current image area. That is, the division of the pixel groups may be related to the scanning order of the current image area. This method may be understood as: using the scanning order of the current image area, all pixel points in the current image area are rearranged into one dimension, and then the current image area is divided into pixel groups.

[0302] Among them, the scanning order of the current image area can be understood as the order in which the residual coefficients are encoded into the bitstream at the encoding end. Therefore, when the multiple pixel groups corresponding to the current image area are determined according to the scanning order of the current image area, the order of the multiple pixel groups is consistent with the order in which the residual coefficients are encoded into the bitstream. When the reconstruction value of each pixel point in the pixel group is adjusted, the waiting time can be reduced, thereby improving the hardware processing performance of the encoding end. At the decoding end, it can be understood as the order in which the residual coefficients are parsed from the bitstream. Therefore, when the multiple pixel groups corresponding to the current image area are determined according to the scanning order of the current image area, the order of the multiple pixel groups is consistent with the parsing order of the residual coefficients. When the reconstruction value of each pixel point in the pixel group is adjusted, the waiting time can be reduced, thereby improving the hardware processing performance of the decoding end.

[0303] For example, the scanning order of the current image area may be a raster scanning order, such as a raster scanning order for a sub-block of the current image area and a raster scanning order for the current image area. Fig. 6A As shown in FIG. 1 , it is the raster scanning order of the sub-blocks in the current image area. In practical applications, a 16*2 image block can be divided into four 4*2 sub-blocks. Of course, a 16*2 image block can also be divided into two 8*2 sub-blocks, or into sub-blocks of other sizes. There is no limitation on this. Fig. 6A The raster scanning order shown can divide the current image area into 4 4*2 pixel groups. Obviously, the raster scanning order is to first scan the pixels of the first sub-block, then scan the pixels of the second sub-block, then scan the pixels of the third sub-block, and then scan the pixels of the fourth sub-block. Therefore, the pixels of the first sub-block can be divided into the first pixel group, the pixels of the second sub-block can be divided into the second pixel group, the pixels of the third sub-block can be divided into the third pixel group, and the pixels of the fourth sub-block can be divided into the fourth pixel group. See Figure 6B Similarly, for Figure 6C The raster scanning order shown can divide the current image area into two 8*2 pixel groups, see Fig.6D shown.

[0304] See also Fig. 6E As shown, it is the raster scanning order for the current image area (that is, the entire current image area), and the current image area can be divided into four 8*1 pixel groups, see Fig. 6F As shown, the current image area can also be divided into two 16*1 pixel groups, see Figure 6GObviously, the raster scanning order is to scan the 16 pixels in the first row first, and then scan the 16 pixels in the second row. Therefore, Fig. 6F or Figure 6G The division method.

[0305] For example, the scanning order of the current image area may be an interlaced scanning mode. For example, the current image area is a 16*2 image block. Figure 6H As shown in FIG. 1 , this is the scanning order for the current image area, that is, first scanning the first pixel of the first row, then scanning the first pixel of the second row, then scanning the third pixel of the first row, and so on. Figure 6H The scanning order shown can divide the current image area into four 4*2 pixel groups, see Fig.6I Alternatively, the current image area is divided into two 8*2 pixel groups, see Figure 6J shown.

[0306] See also Fig.6I As shown, the pixels in the 1st, 3rd, 5th and 7th columns can be grouped into a pixel group, the pixels in the 2nd, 4th, 6th and 8th columns can be grouped into a pixel group, the pixels in the 9th, 11th, 13th and 15th columns can be grouped into a pixel group, and the pixels in the 10th, 12th, 14th and 16th columns can be grouped into a pixel group. Figure 6H As shown, the pixels in the 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th columns can be grouped into one pixel group, and the pixels in the 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th columns can be grouped into one pixel group.

[0307] Example 13: For Example 1 to Example 12, for the encoding end and the decoding end, the reconstructed value of the pixel point can be adjusted based on the adjustment value. The value range of the adjustment value can be [-7, 7]. Of course, the value range of [-7, 7] is just an example and is not limited to this. For example, the value range of the adjustment value can be [-4, 4], [-5, 5], [-6, 6], [-8, 8]. The value range of the adjustment value can also be [-4, 6], [-6, 5], [-6, 8], [-8, 4]. Obviously, the value range of the adjustment value can be set arbitrarily.

[0308] In a possible implementation manner, the binary values ​​of the value range of [-7, 7] can be seen in Table 1.

[0309] Table 1

[0310]

[0311] In a possible implementation, the range of the adjustment value can also be determined based on the quantization step size, that is, the range of the adjustment value is related to the quantization step size. For example, when the quantization step size is 8, the maximum quantization error is 4, then the range of the adjustment value can be [-4, 4]. In this case, adjustment values ​​less than -4 or greater than 4 will not appear. Obviously, the binarization shown in Table 1 can be adjusted, as shown in Table 2. Of course, in practical applications, different ranges of adjustment values ​​can be configured for different quantizations, and there is no restriction on this range of values. For another example, when the quantization step size is 10, the range of the adjustment value can be [-5, 5], and so on.

[0312] Table 2

[0313]

[0314] In another possible implementation, different quantization step sizes may correspond to different ranges of adjustment values, and the number of values ​​within the range of adjustment values ​​is the same, except that there is a value interval between two adjacent values. For example, the range of values ​​corresponding to quantization step size A is [-3, 3], and there are 7 values ​​in total, such as -3, -2, -1, 0, 1, 2, 3, and the range of values ​​corresponding to quantization step size B (quantization step size B may be greater than quantization step size A) is [-6, 6], but there are only 7 values, such as -6, -4, -2, 0, 2, 4, 6, and the range of values ​​corresponding to quantization step size C (quantization step size C may be greater than quantization step size B) is [-9, 9], but there are only 7 values, such as -9, -6, -3, 0, 3, 6, 9, and so on.

[0315] Embodiment 14: Due to hardware limitations, in a possible implementation or, the reconstructed value after filtering of the current image area cannot be used as a reference for other image blocks in the same row, but can only be used as a reference for other image blocks in the next row. For other image blocks in the same row of the current image area, only the reconstructed value before filtering of the current image area can be referenced.

[0316] Embodiment 15: For Embodiment 1 to Embodiment 13, the bitstream sent by the encoder to the decoder needs to carry the following content:

[0317] 1. Adjustment parameters. The adjustment parameters may include multiple adjustment values. For example, for each channel, the adjustment parameters may include one adjustment value for the channel, or may include at least two adjustment values ​​for the channel. For the convenience of description, one channel is taken as an example. Exemplarily, the current image area may correspond to multiple pixel groups, and the code stream corresponding to the current image area only includes adjustment values ​​corresponding to K pixel groups, and the K pixel groups are part of or all of the multiple pixel groups.

[0318] Assuming that the code stream corresponding to the current image area includes M adjustment values ​​corresponding to K pixel groups, M may be a positive integer, and M may be less than or equal to K, that is, M is greater than or equal to 1 and less than or equal to K.

[0319] For example, if K pixel groups correspond to the same adjustment value, such as adjustment value A, the code stream corresponding to the current image region includes only one adjustment value, namely, adjustment value A. Therefore, M adjustment values ​​are just one adjustment value.

[0320] If K pixel groups correspond to two adjustment values, such as pixel group 1 and pixel group 2 correspond to adjustment value A, and pixel group 3 and pixel group 4 correspond to adjustment value B, then the code stream corresponding to the current image area may include 2 adjustment values, namely adjustment value A and adjustment value B, so M adjustment values ​​are 2 adjustment values. Alternatively, the code stream corresponding to the current image area may include 4 adjustment values, namely adjustment value A corresponding to pixel group 1, adjustment value A corresponding to pixel group 2, adjustment value B corresponding to pixel group 3, and adjustment value B corresponding to pixel group 4, so M adjustment values ​​are 4 adjustment values.

[0321] If K pixel groups correspond to K adjustment values, such as pixel group 1 corresponds to adjustment value A, pixel group 2 corresponds to adjustment value B, pixel group 3 corresponds to adjustment value C, and pixel group 4 corresponds to adjustment value D, then the code stream corresponding to the current image area may include 4 adjustment values, namely adjustment value A, adjustment value B, adjustment value C and adjustment value D. Therefore, M adjustment values ​​are 4 adjustment values.

[0322] 2. Pixel group indication information. When the current image area corresponds to multiple pixel groups (such as 32 pixel groups), the pixel group indication information is used to indicate K pixel groups among all pixel groups, indicating that the code stream carries the adjustment values ​​corresponding to these K pixel groups. Obviously, if K pixel groups are all pixel groups, then the code stream does not need to carry pixel group indication information, and the decoding end knows that K pixel groups are all pixel groups (such as 32 pixel groups). If K pixel groups are part of all pixel groups, then the decoding end needs to know which pixel groups the K pixel groups are. At this time, the following method can be used:

[0323] Display mode: When the encoder sends the bitstream corresponding to the current image area to the decoder, the bitstream corresponding to the current image area carries pixel group indication information, indicating that the bitstream carries the adjustment value of the pixel group corresponding to the pixel group indication information. The decoder can parse the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area, and learn that the adjustment parameters carried in the bitstream are the adjustment values ​​corresponding to the K pixel groups corresponding to the pixel group indication information.

[0324] For example, the pixel group indication information includes index values ​​of K pixel groups, and these index values ​​indicate the nth pixel group of all pixel groups. Taking the K pixel groups as pixel group 1, pixel group 2, pixel group 3 and pixel group 4 as an example, the pixel group indication information includes the index value of pixel group 1, the index value of pixel group 2, the index value of pixel group 3 and the index value of pixel group 4.

[0325] For another example, assuming that the K pixel groups are continuous pixel groups, the pixel group indication information includes index values ​​of some pixel groups in the K pixel groups, and the index values ​​of the remaining pixel groups can be implicitly derived. Taking the K pixel groups as pixel group 1, pixel group 2, pixel group 3 and pixel group 4 as an example, the pixel group indication information only includes the index value of pixel group 1. Since the K pixel groups are continuous pixel groups, the index value of pixel group 2, the index value of pixel group 3 and the index value of pixel group 4 are implicitly derived.

[0326] Implicit method: If the K pixel groups are part of all pixel groups, and the K pixel groups are K pixel groups in the default position, such as the K pixel groups are fixed to the first 4 pixel groups, or the K pixel groups are fixed to the 1st, 3rd, 5th, and 7th pixel groups, or the K pixel groups are fixed to the last 4 pixel groups, then the encoder may not encode the pixel group indication information corresponding to the K pixel groups in the bitstream corresponding to the current image area, and the decoder does not need to parse the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area. On this basis, the decoder learns that the adjustment parameters carried in the bitstream are the adjustment values ​​of the K pixel groups in the default position, for example, the adjustment parameters are the adjustment values ​​of the first 4 pixel groups, or the adjustment parameters are the adjustment values ​​of the 1st, 3rd, 5th, and 7th pixel groups, or the adjustment parameters are the adjustment values ​​of the last 4 pixel groups.

[0327] 3. Adjustment value grouping indication information: When the code stream corresponding to the current image area carries M adjustment values ​​corresponding to K pixel groups, the adjustment value grouping indication information is used to indicate the matching relationship between the M adjustment values ​​and the K pixel groups.

[0328] In a possible implementation, if the M adjustment values ​​are only 1 adjustment value or K adjustment values, the adjustment value grouping indication information may be a flag bit, that is, the adjustment value grouping indication information only has a first value and a second value. In this case, if the K pixel groups correspond to the same adjustment value, such as the K pixel groups all correspond to the adjustment value A, then the adjustment value grouping indication information is the first value, and the first value indicates that the K pixel groups correspond to the same adjustment value. After the decoding end parses the adjustment value grouping indication information from the bitstream, if it is known that the adjustment value grouping indication information is the first value, it can only parse one adjustment value (such as adjustment value A) from the bitstream, and this adjustment value is used as the adjustment value corresponding to the K pixel groups.

[0329] If K pixel groups correspond to K adjustment values, such as K pixel groups correspond to adjustment value A, adjustment value B, adjustment value C and adjustment value D in sequence (or correspond to adjustment value A, adjustment value A, adjustment value B and adjustment value B in sequence), then the adjustment value grouping indication information is the second value, and the second value indicates that K pixel groups correspond to K adjustment values. After the decoding end parses the adjustment value grouping indication information from the bitstream, if it is learned that the adjustment value grouping indication information is the second value, it is necessary to parse K adjustment values ​​from the bitstream, such as parse out adjustment value A, adjustment value B, adjustment value C and adjustment value D in sequence (or parse out adjustment value A, adjustment value A, adjustment value B and adjustment value B in sequence). Obviously, the first parsed adjustment value A corresponds to the first pixel group 1, the second parsed adjustment value B corresponds to the first pixel group 2, the third parsed adjustment value C corresponds to the first pixel group 3, and the fourth parsed adjustment value D corresponds to the fourth pixel group 4.

[0330] Exemplarily, the above implementation process can be represented by the syntax table shown in Table 3.

[0331] Table 3

[0332]

[0333] In the above syntax table, same_offset_flag represents the adjustment value grouping indication information. If the value of same_offset_flag is the first value (such as 1), the decoding end needs to parse out an adjustment value from the bit stream. If the value of same_offset_flag is the second value (such as 0), the decoding end needs to parse out K adjustment values ​​from the bit stream in sequence.

[0334] For the syntax table shown in Table 3, same_offset_flag is a flag bit that determines whether to turn on compensation. If same_offset_flag is the first value, compensation is turned on, and it is determined that K pixel groups correspond to the same adjustment value (the adjustment value in this article can also be called compensation value). At this time, only one adjustment value needs to be parsed. If same_offset_flag is the second value, compensation is not turned on, and it is determined that K pixel groups correspond to K adjustment values. At this time, K adjustment values ​​need to be parsed.

[0335] In another possible implementation, if the M adjustment values ​​may be 1 adjustment value, 2 adjustment values, ..., K adjustment values, then the adjustment value grouping indication information may be a plurality of values. In this case,

[0336] If the K pixel groups correspond to the same adjustment value, then the adjustment value grouping indication information is the first value, and the first value indicates that the K pixel groups correspond to the same adjustment value. On this basis, after the decoding end learns that the adjustment value grouping indication information is the first value, it can learn that the K pixel groups correspond to the same adjustment value.

[0337] If the K pixel groups correspond to two adjustment values, such as the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value, then the adjustment value grouping indication information is the second value, and the second value indicates that the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value. On this basis, after the decoding end learns that the adjustment value grouping indication information is the second value, it determines that the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value.

[0338] If K pixel groups correspond to two adjustment values, such as the first pixel group and the fourth pixel group correspond to one adjustment value, and the second pixel group and the third pixel group correspond to another adjustment value, then the adjustment value grouping indication information is the third value. On this basis, after the decoding end learns that the adjustment value grouping indication information is the third value, it determines that the first pixel group and the fourth pixel group correspond to one adjustment value, and the second pixel group and the third pixel group correspond to another adjustment value.

[0339] By analogy, it is obvious that each value of the adjustment value group indication information corresponds to a mapping relationship, which represents the matching relationship between M adjustment values ​​and K pixel groups. The correspondence between the value of the adjustment value group indication information and the mapping relationship can be agreed upon at the encoding and decoding ends, and there is no restriction on this.

[0340] In summary, the adjustment value grouping indication information is used to indicate the matching relationship between the M adjustment values ​​and the K pixel groups, and after the decoding end parses the adjustment value grouping indication information from the bitstream, it can parse the M adjustment values ​​from the bitstream corresponding to the current image area based on the adjustment value grouping indication information, and determine the adjustment values ​​corresponding to the K pixel groups based on the M adjustment values, that is, based on the matching relationship between the M adjustment values ​​and the K pixel groups, determine the adjustment values ​​corresponding to the K pixel groups.

[0341] Illustratively, the above-mentioned embodiments can be implemented individually or in combination. For example, each embodiment in Embodiment 1 to Embodiment 15 can be implemented individually, and at least two embodiments in Embodiment 1 to Embodiment 15 can be implemented in combination.

[0342] Illustratively, in the above embodiments, the content of the encoding end can also be applied to the decoding end, that is, the decoding end can be processed in the same way, and the content of the decoding end can also be applied to the encoding end, that is, the encoding end can be processed in the same way.

[0343] Example 16: Based on the same application concept as the above method, a decoding device is also proposed in the embodiment of the present application. The decoding device is applied to the decoding end, and the decoding device includes: a memory, which is configured to store video data; a decoder, which is configured to implement the decoding method in the above-mentioned embodiment 1-embodiment 15, that is, the processing flow of the decoding end.

[0344] For example, in one possible implementation, the decoder is configured to implement:

[0345] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0346] If it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining an adjustment parameter corresponding to the current image area from a bitstream corresponding to the current image area;

[0347] The reconstruction value of the current image area is adjusted based on the adjustment parameter.

[0348] Based on the same application concept as the above method, an encoding device is also proposed in the embodiment of the present application. The encoding device is applied to the encoding end, and the encoding device includes: a memory, which is configured to store video data; an encoder, which is configured to implement the encoding method in the above embodiments 1 to 15, that is, the processing flow of the encoding end.

[0349] For example, in one possible implementation, the encoder is configured to implement:

[0350] Determining whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area;

[0351] If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, where the adjustment parameter is used to adjust the reconstruction value of the current image area;

[0352] The adjustment parameters corresponding to the current image area are encoded in a code stream corresponding to the current image area.

[0353] Based on the same application concept as the above method, the decoding end device (also referred to as a video decoder) provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be specifically referred to as Fig. 7AAs shown. It includes: a processor 711 and a machine-readable storage medium 712, the machine-readable storage medium 712 stores machine-executable instructions that can be executed by the processor 711; the processor 711 is used to execute the machine-executable instructions to implement the decoding method of the above embodiments 1-15 of the present application.

[0354] Based on the same application concept as the above method, the encoding end device (also referred to as a video encoder) provided in the embodiment of the present application, from the hardware level, its hardware architecture diagram can be specifically referred to as Figure 7B As shown. It includes: a processor 721 and a machine-readable storage medium 722, the machine-readable storage medium 722 stores machine-executable instructions that can be executed by the processor 721; the processor 721 is used to execute the machine-executable instructions to implement the encoding method of the above-mentioned embodiments 1-15 of the present application.

[0355] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented, such as the decoding method or encoding method in the above embodiments.

[0356] Based on the same application concept as the above method, an embodiment of the present application also provides a computer application, which, when executed by a processor, can implement the decoding method or encoding method disclosed in the above example of the present application.

[0357] Based on the same application concept as the above method, a decoding device is also proposed in an embodiment of the present application, and the decoding device is applied to a decoding end, and the decoding device includes: a determination module, which is used to determine whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area; an acquisition module, which is used to obtain the adjustment parameters corresponding to the current image area from the code stream corresponding to the current image area if it is determined that the reconstruction value of the current image area needs to be adjusted; an adjustment module, which is used to adjust the reconstruction value of the current image area based on the adjustment parameter.

[0358] Exemplarily, the characteristic information includes a first type of characteristic information, and the determination module is specifically used to determine whether it is necessary to adjust the reconstruction value of the current image area based on the characteristic information corresponding to the current image area: if the first type of characteristic information corresponding to the current image area meets a specific condition, then obtain a mark bit corresponding to the adjustment control switch from the code stream corresponding to the current image area, and determine whether it is necessary to adjust the reconstruction value of the current image area based on the mark bit; wherein, if the mark bit is a first value, it is determined that it is necessary to adjust the reconstruction value of the current image area; if the mark bit is a second value, it is determined that it is not necessary to adjust the reconstruction value of the current image area.

[0359] Exemplarily, when the determination module determines whether it is necessary to adjust the reconstruction value of the current image area based on the feature information corresponding to the current image area, it is specifically used to: if the first type of feature information corresponding to the current image area does not meet specific conditions, determine that it is not necessary to adjust the reconstruction value of the current image area.

[0360] Exemplarily, the characteristic information includes second-category characteristic information, and the determination module determines whether it is necessary to adjust the reconstruction value of the current image area based on the characteristic information corresponding to the current image area, and is specifically used to: if the second-category characteristic information corresponding to the current image area meets specific conditions, determine that it is necessary to adjust the reconstruction value of the current image area; if the second-category characteristic information corresponding to the current image area does not meet the specific conditions, determine that it is not necessary to adjust the reconstruction value of the current image area.

[0361] Exemplarily, the adjustment parameters corresponding to the current image area include multiple adjustment values, the current image area corresponds to multiple pixel groups, and the multiple adjustment values ​​include adjustment values ​​corresponding to K pixel groups, where the K pixel groups are all or part of the multiple pixel groups; when the adjustment module adjusts the reconstructed value of the current image area based on the adjustment parameters, it is specifically used to: for each pixel group in the K pixel groups, if the multiple adjustment values ​​include the adjustment value corresponding to the pixel group, adjust the reconstructed value of the pixel points in the pixel group based on the adjustment value corresponding to the pixel group.

[0362] Exemplarily, the acquisition module is further used to obtain adjustment value grouping indication information from the code stream corresponding to the current image area; the adjustment value grouping indication information is used to indicate a mapping relationship between the adjustment value and the K pixel groups; based on the adjustment value grouping indication information, M adjustment values ​​are parsed from the code stream corresponding to the current image area, where M is a positive integer and is less than or equal to K; and adjustment values ​​corresponding to the K pixel groups are determined based on the M adjustment values.

[0363] Exemplarily, the determination module is also used to determine the multiple pixel groups corresponding to the current image area by adopting a determination method: determining the multiple pixel groups corresponding to the current image area according to the pre-adjustment reconstruction value of each pixel point; or determining the classification value of the pixel point based on the pre-adjustment reconstruction value of the surrounding pixels of the pixel point, and determining the multiple pixel groups corresponding to the current image area according to the classification value of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the pixel position of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area; or determining the multiple pixel groups corresponding to the current image area according to the scanning order of the current image area.

[0364] Exemplarily, when the determination module determines the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area, it is specifically used to: determine the number of pixel group divisions, the filter area and the division method according to the prediction mode of the current image area; determine the multiple pixel groups corresponding to the current image area based on the number of divisions, the filter area and the division method. When the determination module determines the number of pixel group divisions, the filter area and the division method according to the prediction mode of the current image area, it is specifically used to: if the prediction mode of the current image area is a horizontal prediction mode, determine the number of pixel group divisions to be the first number of divisions, determine the filter area of ​​the pixel group to be the first filter area, and determine the division method to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, determine the number of pixel group divisions to be the second number of divisions, determine the filter area of ​​the pixel group to be the second filter area, and determine the division method to be the second size specification.

[0365] Based on the same application concept as the above method, an encoding device is also proposed in an embodiment of the present application, and the encoding device is applied to an encoding end, and the encoding device includes: a determination module, used to determine whether it is necessary to adjust the reconstruction value of the current image area based on feature information corresponding to the current image area; an acquisition module, used to obtain adjustment parameters corresponding to the current image area if it is determined that the reconstruction value of the current image area needs to be adjusted, and the adjustment parameters are used to adjust the reconstruction value of the current image area; an encoding module, used to encode the adjustment parameters corresponding to the current image area in a code stream corresponding to the current image area.

[0366] Exemplarily, the characteristic information includes a first category of characteristic information, and the determination module determines whether it is necessary to adjust the reconstruction value of the current image area based on the characteristic information corresponding to the current image area, and is specifically used to: if the first category of characteristic information corresponding to the current image area meets specific conditions, determine whether it is necessary to adjust the reconstruction value of the current image area, and encode a mark bit corresponding to the adjustment control switch in the code stream corresponding to the current image area; wherein the mark bit is used to indicate whether it is necessary to adjust the reconstruction value of the current image area; if the first category of characteristic information corresponding to the current image area does not meet the specific conditions, determine that it is not necessary to adjust the reconstruction value of the current image area.

[0367] Exemplarily, the current image area corresponds to multiple pixel groups, and the adjustment parameters corresponding to the current image area include multiple adjustment values, and the multiple adjustment values ​​include adjustment values ​​corresponding to K pixel groups, and the K pixel groups are all pixel groups or part of the multiple pixel groups; when the encoding module encodes the adjustment parameters corresponding to the current image area in the code stream corresponding to the current image area, it is specifically used to: encode M adjustment values ​​corresponding to the K pixel groups in the code stream corresponding to the current image area, M is a positive integer, and M is less than or equal to K; wherein the M adjustment values ​​are determined based on the adjustment values ​​corresponding to the K pixel groups; the encoding module is also used to encode adjustment value grouping indication information in the code stream corresponding to the current image area, and the adjustment value grouping indication information is used to indicate the matching relationship between the M adjustment values ​​and the K pixel groups.

[0368] Exemplarily, the determination module is also used to determine the multiple pixel groups corresponding to the current image area in the following manner: determining the multiple pixel groups corresponding to the current image area according to the pre-adjustment reconstruction value of each pixel point; or determining the classification value of the pixel point based on the pre-adjustment reconstruction value of the surrounding pixels of the pixel point, and determining the multiple pixel groups corresponding to the current image area according to the classification value of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to the pixel position of each pixel point; or determining the multiple pixel groups corresponding to the current image area according to a prediction mode of the current image area; or determining the multiple pixel groups corresponding to the current image area according to a scanning order of the current image area.

[0369] Exemplarily, when the determination module determines the multiple pixel groups corresponding to the current image area according to the prediction mode of the current image area, it is specifically used to: determine the number of pixel group divisions, the filter area and the division method according to the prediction mode of the current image area; determine the multiple pixel groups corresponding to the current image area based on the number of divisions, the filter area and the division method. When the determination module determines the number of pixel group divisions, the filter area and the division method according to the prediction mode of the current image area, it is specifically used to: if the prediction mode of the current image area is a horizontal prediction mode, determine the number of pixel group divisions to be the first number of divisions, determine the filter area of ​​the pixel group to be the first filter area, and determine the division method to be the first size specification; if the prediction mode of the current image area is not a horizontal prediction mode, determine the number of pixel group divisions to be the second number of divisions, determine the filter area of ​​the pixel group to be the second filter area, and determine the division method to be the second size specification.

[0370] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. The present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. The embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0371] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A decoding method, It is characterized in that Applied to a decoding end, the method comprises: Determining whether to allow the reconstruction value adjustment of the current image area based on feature information corresponding to the current image area; wherein the feature information corresponding to the current image area includes a prediction mode; wherein when the prediction mode is a normal intra-frame prediction mode, determining to allow the reconstruction value adjustment of the current image area; If it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining an adjustment parameter corresponding to the current image area from a bitstream corresponding to the current image area; The reconstruction value of the current image area is adjusted based on the adjustment parameter.

2. The method according to claim 1, It is characterized in that The adjustment parameters corresponding to the current image area include a plurality of adjustment values, the current image area corresponds to a plurality of pixel groups, the plurality of adjustment values ​​include adjustment values ​​corresponding to K pixel groups, and the K pixel groups are all or part of the pixel groups in the plurality of pixel groups; The adjusting the reconstruction value of the current image area based on the adjustment parameter includes: For each pixel group in the K pixel groups, if the multiple adjustment values ​​include an adjustment value corresponding to the pixel group, the reconstructed values ​​of the pixels in the pixel group are adjusted based on the adjustment value corresponding to the pixel group.

3. The method according to claim 2, It is characterized in that If the K pixel groups are part of the plurality of pixel groups, the method further includes: acquiring pixel group indication information corresponding to the K pixel groups from a bitstream corresponding to the current image area; and selecting the K pixel groups from all pixel groups based on the pixel group indication information; The pixel group indication information is used to distinguish pixel groups of a target category among pixel groups of all categories.

4. The method according to claim 2, It is characterized in that The current image area corresponds to a plurality of pixel groups including: Determine a plurality of pixel groups corresponding to the current image area according to the pixel position of each pixel point; or A plurality of pixel groups corresponding to the current image area are determined according to a prediction mode of the current image area.

5. The method according to claim 4, It is characterized in that The step of determining a plurality of pixel groups corresponding to the current image area according to the prediction mode of the current image area comprises: Determine the number of pixel group divisions, the filtering area, and the division method according to the prediction mode of the current image area; A plurality of pixel groups corresponding to the current image area are determined based on the number of divisions, the filtering area, and the division method.

6. The method according to claim 5, It is characterized in that If the current image area is a 16*2 image block, determining the number of pixel group divisions, the filtering area, and the division method according to the prediction mode of the current image area includes: If the prediction mode of the current image area is not a horizontal prediction mode, then the number of pixel group divisions is determined to be the second number of divisions, the filtering area of ​​the pixel group is determined to be the second filtering area, and the division method is determined to be the second size specification; wherein the second number of divisions is 4, and the second size specification is 4*2.

7. A coding method, It is characterized in that Applied to the encoding end, the method includes: Determining whether to allow the reconstruction value adjustment of the current image area based on feature information corresponding to the current image area; wherein the feature information corresponding to the current image area includes a prediction mode; wherein when the prediction mode is a normal intra-frame prediction mode, determining to allow the reconstruction value adjustment of the current image area; If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, where the adjustment parameter is used to adjust the reconstruction value of the current image area; The adjustment parameters corresponding to the current image area are encoded in a code stream corresponding to the current image area.

8. The method according to claim 7, It is characterized in that The current image area corresponds to a plurality of pixel groups, the adjustment parameters corresponding to the current image area include a plurality of adjustment values, the plurality of adjustment values ​​include adjustment values ​​corresponding to K pixel groups, and the K pixel groups are all or part of the pixel groups in the plurality of pixel groups; The encoding of the adjustment parameters corresponding to the current image area in the bitstream corresponding to the current image area includes: Encoding M adjustment values ​​corresponding to the K pixel groups in a bitstream corresponding to the current image area, where M is a positive integer and M is less than or equal to K; wherein the M adjustment values ​​are determined based on the adjustment values ​​corresponding to the K pixel groups; The method further includes: encoding adjustment value grouping indication information in a code stream corresponding to the current image area, wherein the adjustment value grouping indication information is used to indicate a matching relationship between the M adjustment values ​​and the K pixel groups.

9. The method according to claim 8, It is characterized in that The current image area corresponds to a plurality of pixel groups including: Determine a plurality of pixel groups corresponding to the current image area according to the pixel position of each pixel point; or A plurality of pixel groups corresponding to the current image area are determined according to a prediction mode of the current image area.

10. The method according to claim 9, It is characterized in that The step of determining a plurality of pixel groups corresponding to the current image area according to the prediction mode of the current image area comprises: Determine the number of pixel group divisions, the filtering area, and the division method according to the prediction mode of the current image area; A plurality of pixel groups corresponding to the current image area are determined based on the number of divisions, the filtering area, and the division method.

11. The method according to claim 10, It is characterized in that If the current image area is a 16*2 image block, determining the number of pixel group divisions, the filtering area, and the division method according to the prediction mode of the current image area includes: If the prediction mode of the current image area is not a horizontal prediction mode, then the number of pixel group divisions is determined to be the second number of divisions, the filtering area of ​​the pixel group is determined to be the second filtering area, and the division method is determined to be the second size specification; wherein the second number of divisions is 4, and the second size specification is 4*2.

12. A decoding device, It is characterized in that The decoding device comprises: a memory configured to store video data; A decoder configured to implement: Determining whether to allow the reconstruction value adjustment of the current image area based on feature information corresponding to the current image area; wherein the feature information corresponding to the current image area includes a prediction mode; wherein when the prediction mode is a normal intra-frame prediction mode, determining to allow the reconstruction value adjustment of the current image area; If it is determined that the reconstruction value of the current image area needs to be adjusted, obtaining an adjustment parameter corresponding to the current image area from a bitstream corresponding to the current image area; The reconstruction value of the current image area is adjusted based on the adjustment parameter.

13. An encoding device, It is characterized in that The encoding device comprises: a memory configured to store video data; An encoder configured to implement: Determining whether to allow the reconstruction value adjustment of the current image area based on feature information corresponding to the current image area; wherein the feature information corresponding to the current image area includes a prediction mode; wherein when the prediction mode is a normal intra-frame prediction mode, determining to allow the reconstruction value adjustment of the current image area; If it is determined that the reconstruction value of the current image area needs to be adjusted, then an adjustment parameter corresponding to the current image area is obtained, where the adjustment parameter is used to adjust the reconstruction value of the current image area; The adjustment parameters corresponding to the current image area are encoded in a code stream corresponding to the current image area.

14. A decoding terminal device, It is characterized in that include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is used to execute machine executable instructions to implement the method steps described in any one of claims 1-6.

15. A coding terminal device, It is characterized in that include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; The processor is used to execute machine executable instructions to implement the method steps described in any one of claims 7-11.

Citation Information

Patent Citations

  • Image encoding method and device for sample value compensation and image decoding method and device for sample value compensation

    CN107852493A

  • Coding and decoding method and device and equipment thereof

    CN112449181A

  • Decoding and coding method, device and equipment

    CN116095309A

  • Decoding and coding method, device and equipment

    CN116527918A

  • Encoding method, decoding method, and related devices

    WO2022037300A1