A decoding and encoding method, device and equipment thereof

By selecting appropriate mode sets and adjusting reconstruction values ​​during encoding and decoding, the shallow encoding method is optimized, solving the problems of insufficient compression efficiency and compression ratio. It is suitable for scenarios with high real-time and parallel requirements, and achieves more efficient compression results.

CN116527918BActive Publication Date: 2024-10-29HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310503357.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-19
Publication Date
2024-10-29
Estimated Expiration
2042-01-19

AI Technical Summary

Technical Problem

Existing shallow coding techniques are insufficient in terms of compression efficiency and compression ratio, making it difficult to meet the needs of scenarios with high real-time requirements, small cache, and high parallelism requirements.

Method used

By selecting different sets of modes based on feature information during the encoding and decoding process, selecting the target mode from M or N candidate modes, and adjusting the reconstruction value, the encoding and decoding methods are optimized to remove redundant information.

Benefits of technology

It improves compression efficiency and compression ratio, is suitable for scenarios with high real-time requirements, small buffer size, and high parallelism requirements, and achieves subjective lossless hardware implementation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116527918B_ABST
    Figure CN116527918B_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; wherein the current image area includes an image block, or a plurality of continuous image blocks; if it is determined that the reconstruction value of the current image area needs to be adjusted, then obtaining the adjustment parameter corresponding to the current image area from the code stream corresponding to the current image area; and adjusting the reconstruction value of the current image area based on the adjustment parameter. The present application can improve the compression efficiency.
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 way to implement 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, there are problems such as low compression efficiency and low compression ratio. For example, normal coding technology can achieve a compression ratio of several hundred times, but shallow coding can only achieve a compression ratio of several times. Summary of the invention

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

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

[0006] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0007] The current block is decoded based on the target mode.

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

[0009] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0010] The current block is encoded based on the target mode.

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

[0012] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0013] 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;

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

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

[0016] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0017] 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;

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

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

[0020] a memory configured to store video data;

[0021] A decoder configured to implement:

[0022] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0023] decoding the current block based on the target mode;

[0024] or,

[0025] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0026] 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;

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

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

[0029] a memory configured to store video data;

[0030] An encoder configured to implement:

[0031] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0032] encoding the current block based on the target mode;

[0033] or,

[0034] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0035] 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;

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

[0037] 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;

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

[0039] 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;

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

[0041] 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 suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements. The purpose of improving compression efficiency is achieved by removing redundant information, thereby improving compression efficiency and compression ratio. The shallow coding method can achieve subjective losslessness and simple hardware implementation. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

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

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

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

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

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

[0050] 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".

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

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

[0053] 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.

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

[0055] 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.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] bilinear mode is bilinear interpolation mode, see Figure 1B As 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] 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 differences 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 coding mode information, motion information, residuals, etc. When selecting a mode, if the rate-distortion principle is used to make a comparison decision on the coding mode, the best coding performance can usually be guaranteed.

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

[0065] 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.

[0066] 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.

[0067] For example, see Figure 2A As 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.

[0068] 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.

[0069] 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 2BIn 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.

[0070] 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 an 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 is performed by the inter-frame prediction unit.

[0071] 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, by subtracting the pixel value of the prediction block from the pixel value of the image block pixel by pixel.

[0072] 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.

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

[0074] 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.

[0075] 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.

[0076] 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 called an inverse transform dequantized block or an inverse transform residual block.

[0077] 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.

[0078] 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, such as a deblocking filter, a sample-adaptive offset (SAO) filter or other filters, such as a bilateral filter, an 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.

[0079] 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.

[0080] 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 decoded encoding parameters to the prediction processing unit so that the prediction processing unit performs a prediction process according to the encoding parameters.

[0081] The function of the inverse quantization unit may be the same as that of the inverse quantization unit of the encoder, for inverse quantizing (ie, inverse quantizing) the quantized coefficients decoded by the decoding unit.

[0082] 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.

[0083] 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 may 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. 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.

[0084] 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.

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

[0086] 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.

[0087] Based on the encoder and 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 is provided for an embodiment of the present application. The coding and decoding implementation method includes process ① to process ⑤, and process ① to process ⑤ can be executed by the above-mentioned decoder and encoder.

[0088] Process ①: Divide a frame of image into one or more non-overlapping parallel coding units. The one or more parallel coding units have no dependencies and can be completely parallel / independently encoded and decoded, such as Figure 2D A parallel encoding unit 1 and a parallel encoding unit 2 are shown.

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

[0090] 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.

[0091] As a possible example, the independent coding unit may be a fixed 128×4. If the size of the parallel coding unit is 256×8, the parallel coding unit may 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 row is 2 128×4 + 1 32×4 independent coding units; the third row is 2 128×2 + 1 32×2 independent coding units. It is worth noting that the independent coding unit may 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 may only include one of the components. If the independent coding unit contains three components, the sizes of the three components may be exactly the same or different, which depends on the input format of the image.

[0092] 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.

[0093] 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.

[0094] The width of the coding unit is w_cu and the height is h_cu, so 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.

[0095] As a possible example, the coding unit may be a fixed 16x4. If the size of the independent coding unit is 64x4, the independent coding unit may be equally divided into 4 coding units; if the size of the independent coding unit is 72x4, the coding unit may be divided into: 4 16x4 + 1 8x4.

[0096] It is worth noting that the coding unit can include three components of brightness Y, chrominance Cb, and chrominance Cr (or three components of red R, green G, and blue B), or only one of them. If it includes three components, the sizes of the components can be exactly the same or different, which is related to the image input format.

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

[0098] Process ④: For the coding unit, it can be further divided into one or more non-overlapping prediction groups (Prediction Group, PG), PG can also be 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.

[0099] 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.

[0100] 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 coding method, exponential Golomb coding method, Golomb-Rice coding method, truncated unary code coding method, run-length coding method, direct encoding of the original residual value, etc.

[0101] For example, the encoder may directly encode the coefficients within the RB.

[0102] For another example, the encoder may also transform the residual block, such as DCT, DST, Hadamard transform, etc., and then encode the transformed coefficients.

[0103] As a possible example, when the RB is small, the encoder can 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 binary encoded. In some embodiments of the present application, the coefficient group (CG) and the quantization group (QG) can be the same.

[0104] 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 should be increased by 1, that is, M+1 bits are required to encode all residuals of the current RB block; if only one of the two boundary values ​​​​of -2^(M-1) and 2^(M-1) exists, a Trailing bit needs to be encoded to determine whether the boundary value is -2^(M-1) or 2^(M-1); if all residuals do not exist in either -2^(M-1) or 2^(M-1), there is no need to encode the Trailing bit.

[0105] In addition, for some special cases, the encoder can also directly encode the original value of the image instead of the residual value.

[0106] For example, the compression efficiency of shallow coding is directly related to the prediction mode. Since the prediction mode is not flexible enough and has low compression efficiency, when the shallow coding prediction method is adopted, there are problems such as low compression efficiency and low compression ratio. For example, normal coding technology can achieve a compression ratio of several hundred times, but shallow coding can only achieve a compression ratio of several times.

[0107] In response to the above problems, a better shallow coding method is proposed in the embodiment of the present application, which can improve the compression efficiency by removing redundant information, can make full use of the code stream capacity to adjust the pixel value, can be suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements, and can improve the compression efficiency and compression ratio.

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

[0109] 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:

[0110] Step 301: If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set. Wherein, N can be a positive integer greater than or equal to 2, M can be a positive integer greater than or equal to 1, and M can be less than N.

[0111] Exemplarily, the M candidate modes in the first mode set may be M intra-frame candidate modes, that is, the candidate modes in the first mode set are intra-frame candidate modes. For example, the M candidate modes may include but are not limited to at least one of the following modes: a DC mode based on residual skipping, a bilinear mode based on residual skipping, an angular prediction mode based on residual skipping, an IBC mode based on residual skipping, an ISC mode based on residual skipping, a Planar mode based on residual skipping, and a point-by-point prediction mode based on residual skipping. Of course, the above are just a few examples, and there is no limitation on the M candidate modes.

[0112] Exemplarily, the N candidate modes in the second mode set may be N intra-frame candidate modes, that is, the candidate modes in the second mode set are intra-frame candidate modes. For example, the N candidate modes may include but are not limited to at least two of the following modes: DC mode based on residual skip, DC mode based on non-residual skip, bilinear mode based on residual skip, bilinear mode based on non-residual skip, angle prediction mode based on residual skip, angle prediction mode based on non-residual skip, IBC mode based on residual skip, IBC mode based on non-residual skip, ISC mode based on residual skip, ISC mode based on non-residual skip, Planar mode based on residual skip, Planar mode based on non-residual skip, point-by-point prediction mode based on residual skip, point-by-point prediction mode based on non-residual skip.

[0113] Exemplarily, the N candidate modes in the second mode set may be N intra-frame candidate modes, that is, the candidate modes in the second mode set are intra-frame candidate modes. For example, the N candidate modes include but are not limited to at least two of the following modes: DC mode, bilinear mode, angle prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode.

[0114] In a possible implementation, the characteristic information corresponding to the current block may include but is not limited to: a current bit rate and / or a block position; the characteristic information corresponding to the current block satisfies a specific condition, which may include but is not limited to: if the current bit rate corresponding to the current block is greater than a preset bit rate value, then it is determined that the characteristic information satisfies the specific condition; or, if the block position corresponding to the current block is located at a non-specified position, then it is determined that the characteristic information satisfies the specific condition; or, if the current bit rate corresponding to the current block is greater than a preset bit rate value and the block position corresponding to the current block is located at a non-specified position, then it is determined that the characteristic information satisfies the specific condition.

[0115] Step 302: Encode the current block based on the target mode, and there is no restriction on the encoding process. For example, assuming that the DC mode based on residual skipping is selected as the target mode, the current block is encoded using this mode.

[0116] In a possible implementation, the mode flag information corresponding to the target mode may also be encoded in the code stream corresponding to the current block. When the target mode is selected from the N candidate modes of the second mode set, the mode flag information is the index information corresponding to the target mode in the second mode set. When the target mode is selected from the M candidate modes of the first mode set, the mode flag information is the index information corresponding to the target mode in the first mode set.

[0117] In another possible implementation, the mode flag information corresponding to the target mode may also be encoded in the code stream corresponding to the current block. When the target mode is selected from the N candidate modes of the second mode set, the mode flag information is the index information corresponding to the target mode in the second mode set. When the target mode is selected from the M candidate modes of the first mode set, the mode flag information may be the index information corresponding to the target mode in the second mode set; or, the mode flag information may be the index information corresponding to the target mode in the first mode set.

[0118] 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.

[0119] 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 suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements. The purpose of improving compression efficiency is achieved by removing redundant information, thereby improving compression efficiency and compression ratio. The shallow coding method can achieve subjective losslessness and simple hardware implementation.

[0120] 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:

[0121] Step 401: If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set. Wherein, N may be a positive integer greater than or equal to 2, M may be a positive integer greater than or equal to 1, and M may be less than N.

[0122] Exemplarily, the M candidate modes in the first mode set may be M intra-frame candidate modes, that is, the candidate modes in the first mode set are intra-frame candidate modes. For example, the M candidate modes may include but are not limited to at least one of the following modes: a DC mode based on residual skipping, a bilinear mode based on residual skipping, an angular prediction mode based on residual skipping, an IBC mode based on residual skipping, an ISC mode based on residual skipping, a Planar mode based on residual skipping, and a point-by-point prediction mode based on residual skipping. Of course, the above are just a few examples, and there is no limitation on the M candidate modes.

[0123] Exemplarily, the N candidate modes in the second mode set may be N intra-frame candidate modes, that is, the candidate modes in the second mode set may be intra-frame candidate modes. For example, the N candidate modes may include but are not limited to at least two of the following modes: DC mode based on residual skip, DC mode based on non-residual skip, bilinear mode based on residual skip, bilinear mode based on non-residual skip, angle prediction mode based on residual skip, angle prediction mode based on non-residual skip, IBC mode based on residual skip, IBC mode based on non-residual skip, ISC mode based on residual skip, ISC mode based on non-residual skip, Planar mode based on residual skip, Planar mode based on non-residual skip, point-by-point prediction mode based on residual skip, point-by-point prediction mode based on non-residual skip.

[0124] Exemplarily, the N candidate modes in the second mode set may be N intra-frame candidate modes, that is, the candidate modes in the second mode set are intra-frame candidate modes. For example, the N candidate modes include but are not limited to at least two of the following modes: DC mode, bilinear mode, angle prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode.

[0125] In a possible implementation, the characteristic information corresponding to the current block may include but is not limited to: a current bit rate and / or a block position; the characteristic information corresponding to the current block satisfies a specific condition, which may include but is not limited to: if the current bit rate corresponding to the current block is greater than a preset bit rate value, then it is determined that the characteristic information satisfies the specific condition; or, if the block position corresponding to the current block is located at a non-specified position, then it is determined that the characteristic information satisfies the specific condition; or, if the current bit rate corresponding to the current block is greater than a preset bit rate value and the block position corresponding to the current block is located at a non-specified position, then it is determined that the characteristic information satisfies the specific condition.

[0126] In a possible implementation, mode flag information corresponding to the target mode can also be obtained from the code stream corresponding to the current block, and the target mode can be selected from the M candidate modes of the first mode set based on the mode flag information, or the target mode can be selected from the N candidate modes of the second mode set based on the mode flag information.

[0127] For example, the mode flag information corresponding to the target mode can be decoded from the code stream corresponding to the current block, wherein when the characteristic information corresponding to the current block does not meet specific conditions, the mode flag information is the index information corresponding to the target mode in the second mode set. Therefore, the target mode is selected from the N candidate modes of the second mode set based on the mode flag information.

[0128] For another example, mode flag information corresponding to the target mode can be decoded from the code stream corresponding to the current block, wherein when the characteristic information corresponding to the current block meets specific conditions, the mode flag information is the index information corresponding to the target mode in the first mode set. Therefore, the target mode is selected from the M candidate modes of the first mode set based on the mode flag information.

[0129] For another example, mode flag information corresponding to the target mode can be decoded from the code stream corresponding to the current block, wherein, when the characteristic information corresponding to the current block meets specific conditions, the mode flag information can be the index information corresponding to the target mode in the first mode set, or can be the index information corresponding to the target mode in the second mode set. On this basis, if the mode flag information is the index information corresponding to the target mode in the second mode set, the target mode is selected from the N candidate modes of the second mode set based on the mode flag information; or, if the mode flag information is the index information corresponding to the target mode in the first mode set, the target mode is selected from the M candidate modes of the first mode set based on the mode flag information.

[0130] Step 402: Decode the current block based on the target mode, and there is no restriction on the decoding process. For example, assuming that the DC mode based on residual skipping is selected as the target mode, the current block is decoded using this mode.

[0131] 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 suitable for scenarios with high real-time requirements, small cache, and high parallelism requirements. The purpose of improving compression efficiency is achieved by removing redundant information, thereby improving compression efficiency and compression ratio. The shallow coding method can achieve subjective losslessness and simple hardware implementation.

[0132] Embodiment 3: In this embodiment, the target mode may be selected based on the coding control information, and the encoding end may support the selection of the target mode based on the coding control information, while the decoding end may not support the selection of the target mode based on the coding control information.

[0133] For the encoder, it is necessary to determine whether the feature information corresponding to the current block meets a specific condition. If so, the encoder selects a target mode from the M candidate modes of the first mode set, otherwise, the target mode is selected from the N candidate modes of the second mode set. N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N.

[0134] Exemplarily, the encoding end may also encode the mode flag information corresponding to the target mode in the code stream corresponding to the current block, and the mode flag information may be the index information corresponding to the target mode in the first mode set or the second mode set. For example, when the characteristic information corresponding to the current block does not meet specific conditions, the encoding end selects the target mode from the N candidate modes of the second mode set, and the mode flag information is the index information corresponding to the target mode in the second mode set. When the characteristic information corresponding to the current block meets specific conditions, the encoding end selects the target mode from the M candidate modes of the first mode set, and the mode flag information is the index information corresponding to the target mode in the second mode set. That is to say, although the target mode is selected from the first mode set, the index information is the index information corresponding to the target mode in the second mode set.

[0135] The index information corresponding to the target pattern in the second pattern set indicates the candidate pattern number of the target pattern in the second pattern set, so that the candidate pattern corresponding to the index information can be found from the second pattern set.

[0136] For the decoding end, the mode flag information corresponding to the target mode can be obtained from the bitstream corresponding to the current block, and the target mode can be selected from the N candidate modes of the second mode set based on the mode flag information. For example, for the encoding end, whether the feature information corresponding to the current block does not meet the specific conditions or the feature information corresponding to the current block meets the specific conditions, when the encoding end encodes the mode flag information in the bitstream, the mode flag information is the index information corresponding to the target mode in the second mode set. Therefore, the decoding end selects the target mode from the second mode set based on the mode flag information.

[0137] The index information corresponding to the target mode in the second mode set indicates the target mode is the candidate mode in the second mode set. Therefore, the decoding end can select the target mode from the second mode set based on the mode flag information.

[0138] Embodiment 4: In this embodiment, the target mode may be selected based on the coding information, and the encoding end may support the selection of the target mode based on the coding information, and the decoding end may also support the selection of the target mode based on the coding information.

[0139] For the encoder, it is necessary to determine whether the feature information corresponding to the current block meets a specific condition. If so, the encoder selects a target mode from the M candidate modes of the first mode set, otherwise, the target mode is selected from the N candidate modes of the second mode set. N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N.

[0140] Exemplarily, the encoding end may also encode mode flag information corresponding to the target mode in the code stream corresponding to the current block, and the mode flag information may be the index information corresponding to the target mode in the first mode set or the second mode set. For example, when the characteristic information corresponding to the current block does not meet specific conditions, the encoding end selects the target mode from the N candidate modes of the second mode set, and the mode flag information is the index information corresponding to the target mode in the second mode set. When the characteristic information corresponding to the current block meets specific conditions, the encoding end selects the target mode from the M candidate modes of the first mode set, and the mode flag information is the index information corresponding to the target mode in the first mode set.

[0141] The index information corresponding to the target pattern in the second pattern set indicates the candidate pattern number of the target pattern in the second pattern set, so that the candidate pattern corresponding to the index information can be found from the second pattern set.

[0142] The index information corresponding to the target pattern in the first pattern set indicates the candidate pattern number of the target pattern in the first pattern set, so that the candidate pattern corresponding to the index information can be found in the first pattern set.

[0143] For the decoding end, the decoding end can obtain the mode flag information corresponding to the target mode from the code stream corresponding to the current block, and select the target mode from the M candidate modes of the first mode set based on the mode flag information, or, can select the target mode from the N candidate modes of the second mode set based on the mode flag information.

[0144] Exemplarily, the decoding end needs to determine whether the characteristic information corresponding to the current block meets specific conditions. If so, the decoding end can select the target mode from the M candidate modes of the first mode set based on the mode flag information. Otherwise, the decoding end can select the target mode from the N candidate modes of the second mode set based on the mode flag information.

[0145] For example, when the characteristic information corresponding to the current block does not meet a specific condition, the mode flag information is the index information corresponding to the target mode in the second mode set, so the decoding end selects the target mode from the second mode set based on the mode flag information. The index information corresponding to the target mode in the second mode set indicates the candidate mode of the target mode in the second mode set, so the target mode can be selected from the second mode set based on the mode flag information.

[0146] For another example, when the characteristic information corresponding to the current block meets a specific condition, the mode flag information is the index information corresponding to the target mode in the first mode set, so the decoding end selects the target mode from the first mode set based on the mode flag information. The index information corresponding to the target mode in the first mode set indicates the candidate mode of the target mode in the first mode set, so the target mode can be selected from the first mode set based on the mode flag information.

[0147] Embodiment 5: In this embodiment, the target mode can be selected based on the code control information. The encoding end supports the selection of the target mode based on the code control information. The decoding end may support the selection of the target mode based on the code control information, or may not support the selection of the target mode based on the code control information. The protocol will identify whether the decoding end supports or does not support the selection of the target mode based on the code control information.

[0148] For the encoder, it is necessary to determine whether the feature information corresponding to the current block meets a specific condition. If so, the encoder selects a target mode from the M candidate modes of the first mode set, otherwise, the target mode is selected from the N candidate modes of the second mode set. N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N.

[0149] Exemplarily, the encoder may also encode mode flag information corresponding to the target mode in the bitstream corresponding to the current block, and the mode flag information may be index information corresponding to the target mode in the first mode set or the second mode set. For example, when the feature information corresponding to the current block does not meet a specific condition, the encoder selects the target mode from the N candidate modes of the second mode set, and the mode flag information is the index information corresponding to the target mode in the second mode set.

[0150] When the characteristic information corresponding to the current block meets a specific condition, the encoding end selects a target mode from the M candidate modes of the first mode set. In this case, if the protocol identifier decoding end supports selecting a target mode based on the coding information, the mode flag information is the index information corresponding to the target mode in the first mode set. If the protocol identifier decoding end does not support selecting a target mode based on the coding information, the mode flag information is the index information corresponding to the target mode in the second mode set.

[0151] In summary, when selecting a target mode from the first mode set, the mode flag information may be the index information corresponding to the target mode in the first mode set, or may be the index information corresponding to the target mode in the second mode set.

[0152] For the decoding end, the mode flag information corresponding to the target mode can be obtained from the code stream corresponding to the current block, and the target mode can be selected from the M candidate modes of the first mode set based on the mode flag information, or the target mode can be selected from the N candidate modes of the second mode set based on the mode flag information. Exemplarily, it can be determined whether the characteristic information corresponding to the current block meets a specific condition. If so, the target mode is selected from the M candidate modes of the first mode set based on the mode flag information, or the target mode is selected from the N candidate modes of the second mode set based on the mode flag information. Otherwise, the target mode can be selected from the N candidate modes of the second mode set based on the mode flag information.

[0153] For example, when the feature information corresponding to the current block does not meet a specific condition, the mode flag information is the index information corresponding to the target mode in the second mode set. Therefore, the target mode is selected from the second mode set based on the mode flag information.

[0154] For another example, when the characteristic information corresponding to the current block meets specific conditions, if the protocol identifier decoding end supports selecting the target mode based on the code control information, the mode flag information is the index information corresponding to the target mode in the first mode set. Therefore, the decoding end selects the target mode from the M candidate modes of the first mode set based on the mode flag information.

[0155] For another example, when the characteristic information corresponding to the current block meets specific conditions, if the protocol identifier decoding end does not support the selection of the target mode based on the code control information, the mode flag information is the index information corresponding to the target mode in the second mode set. Therefore, the decoding end selects the target mode from the N candidate modes of the second mode set based on the mode flag information.

[0156] Embodiment 6: In Embodiments 1 to 5, it is related to whether the characteristic information corresponding to the current block meets specific conditions. The characteristic information may include but is not limited to the current bit rate and / or block position. 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 block is located, and the block position is used to indicate the position of the current block in the current frame. Of course, the current bit rate and / or block position are just a few examples of characteristic information, and this embodiment does not limit this characteristic information. In this case, whether the characteristic information corresponding to the current block meets specific conditions may include but is not limited to the following situations:

[0157] Case 1: The characteristic information corresponding to the current block includes current code control information, such as the current code rate corresponding to the current block. If the current code rate corresponding to the current block is greater than the preset code rate value, it is determined that the characteristic information meets the specific condition, otherwise, it is determined that the characteristic information does not meet the specific condition. Exemplarily, the preset code rate value may be a code rate value configured based on experience, and there is no restriction on this. When the current code rate is greater than the preset code rate value, it means that the code control information indicates that the resource pool is insufficient.

[0158] In a possible implementation, a target upper limit bit rate can be preconfigured. When the current bit rate is close to the target upper limit bit rate, it means 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 the preset threshold, it means 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 means that the code control information indicates that the resource pool is sufficient. On this basis, the sum of the target upper limit bit rate and the preset threshold can be used as the preset bit rate value. At this time, the target upper limit bit rate is generally greater than the target bit rate of the code control.

[0159] Case 2: the feature information corresponding to the current block includes the block position corresponding to the current block. If the block position corresponding to the current block is located at a non-specified position, it is determined that the feature information meets the specific condition; otherwise, it is determined that the feature information does not meet the specific condition.

[0160] 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 block is located), or the bottom row of image blocks, etc. On this basis, if the block position corresponding to the current block 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 corresponding to the current block is located at the designated position; if the block position corresponding to the current block does not belong to the last L image blocks and the bottom row of image blocks of the current code control unit, it is determined that the block position corresponding to the current block is located at a non-designated position.

[0161] For another example, the designated position may be a slice boundary position within the current frame. If the block position corresponding to the current block belongs to the slice boundary position within the current frame, then the block position corresponding to the current block is determined to be located at the designated position. If the block position corresponding to the current block does not belong to the slice boundary position within the current frame, then the block position corresponding to the current block is determined to be located at a non-designated position.

[0162] 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. On this basis, if the block position corresponding to the current block belongs to the last L image blocks of the current code control unit, or the block position corresponding to the current block belongs to the Slice boundary position within the current frame, then it is determined that the block position corresponding to the current block is located at the designated position. If the block position corresponding to the current block does not belong to the last L image blocks of the current code control unit, and the block position corresponding to the current block does not belong to the Slice boundary position within the current frame, then it is determined that the block position corresponding to the current block is located at a non-designated position.

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

[0164] Case 3: The characteristic information corresponding to the current block may include the current bit rate corresponding to the current block and the block position corresponding to the current block. If the current bit rate corresponding to the current block is greater than the preset bit rate value and the block position corresponding to the current block is located at a non-specified position, it is determined that the characteristic information meets the specific conditions; otherwise, it is determined that the characteristic information does not meet the specific conditions.

[0165] Case 4: The characteristic information corresponding to the current block may include the current bit rate corresponding to the current block and the block position corresponding to the current block. If the current bit rate corresponding to the current block is greater than the preset bit rate value, or the block position corresponding to the current block is located at a non-specified position, it is determined that the characteristic information meets the specific conditions; otherwise, it is determined that the characteristic information does not meet the specific conditions.

[0166] Embodiment 7: In Embodiments 1 to 5, involving a first mode set and a second mode set, the first mode set may include M candidate modes, and the M candidate modes in the first mode set may be M intra-frame candidate modes, and the second mode set may include N candidate modes, and the N candidate modes in the second mode set may be N intra-frame candidate modes. Exemplarily, N may be greater than or equal to 2, M may be greater than or equal to 1, and M may be less than N. Of course, in practical applications, the M candidate modes may also include inter-frame candidate modes, and there is no restriction on the M candidate modes. In addition, the N candidate modes may also include inter-frame candidate modes, and there is no restriction on the N candidate modes.

[0167] Exemplarily, the M candidate patterns in the first pattern set may be a subset of the N candidate patterns in the second pattern set, and the M candidate patterns in the first pattern set may not be a subset of the N candidate patterns in the second pattern set.

[0168] Exemplarily, when the code control information indicates that the resource pool is sufficient (such as the feature information does not meet specific conditions), the target mode can be selected from the N candidate modes of the second mode set. Since the N candidate modes are N intra-frame candidate modes, and the intra-frame prediction mode may include but is not limited to DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode, etc., the N candidate modes may include but are not limited to at least two of the following modes: DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode. Of course, the above are just a few examples of intra-frame prediction modes, and this embodiment does not limit this intra-frame prediction mode.

[0169] In a possible implementation, during the prediction process, a residual skip mode or a non-residual skip mode may be used, the residual skip mode indicating that the residual value corresponding to the prediction value does not need to be encoded or decoded, and the non-residual skip mode indicating that the residual value corresponding to the prediction value needs to be encoded or decoded. Based on this, the intra-frame prediction mode may also be divided into an intra-frame prediction mode based on residual skip and an intra-frame prediction mode based on non-residual skip. Therefore, the N candidate modes may include but are not limited to at least two of the following modes: a DC mode based on residual skip, a DC mode based on non-residual skip, a bilinear mode based on residual skip, a bilinear mode based on non-residual skip, an angular prediction mode based on residual skip, an angular prediction mode based on non-residual skip, an IBC mode based on residual skip, an IBC mode based on non-residual skip, an ISC mode based on residual skip, an ISC mode based on non-residual skip, a Planar mode based on residual skip, a Planar mode based on non-residual skip, a point-by-point prediction mode based on residual skip, and a point-by-point prediction mode based on non-residual skip.

[0170] Among them, the DC mode based on residual skipping means: residual skipping is performed on the basis of adopting the DC mode, that is, the residual value corresponding to the prediction value does not need to be encoded or decoded; the DC mode based on non-residual skipping means: residual skipping is not performed on the basis of adopting the DC mode, that is, the residual value corresponding to the prediction value needs to be encoded or decoded; the bilinear mode based on residual skipping means: residual skipping is performed on the basis of adopting the bilinear mode; the bilinear mode based on non-residual skipping means: residual skipping is not performed on the basis of adopting the bilinear mode, and so on. The principles of other modes are similar.

[0171] Among them, if the N candidate modes include DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, and point-by-point prediction mode, when the encoder encodes the index information corresponding to the target mode in the second mode set in the bitstream, the index information can be an index value. For example, when the index value is 0, it represents the first candidate mode in the second mode set, that is, the DC mode. When the index value is 1, it represents the second candidate mode in the second mode set, and so on.

[0172] If the N candidate modes include a DC mode based on residual skipping, a DC mode based on non-residual skipping, a bilinear mode based on residual skipping, a bilinear mode based on non-residual skipping, an angle prediction mode based on residual skipping, an angle prediction mode based on non-residual skipping, an IBC mode based on residual skipping, an IBC mode based on non-residual skipping, an ISC mode based on residual skipping, an ISC mode based on non-residual skipping, a Planar mode based on residual skipping, a Planar mode based on non-residual skipping, a point-by-point prediction mode based on residual skipping, and a point-by-point prediction mode based on non-residual skipping, when the encoder encodes the index information corresponding to the target mode in the second mode set in the bitstream, the index information may be an index value, such as when the index value is 0, it indicates the first candidate mode in the second mode set, that is, the DC mode based on residual skipping; when the index value is 1, it indicates the second candidate mode in the second mode set, that is, the DC mode based on non-residual skipping; when the index value is 2, it indicates the third candidate mode in the second mode set, the bilinear mode based on residual skipping, and so on.

[0173] If the N candidate modes include a DC mode based on residual skipping, a DC mode based on non-residual skipping, a bilinear mode based on residual skipping, a bilinear mode based on non-residual skipping, an angular prediction mode based on residual skipping, an angular prediction mode based on non-residual skipping, an IBC mode based on residual skipping, an IBC mode based on non-residual skipping, an ISC mode based on residual skipping, an ISC mode based on non-residual skipping, a Planar mode based on residual skipping, a Planar mode based on non-residual skipping, a point-by-point prediction mode based on residual skipping, and a point-by-point prediction mode based on non-residual skipping, when the encoder encodes the index information corresponding to the target mode in the second mode set in the bitstream, the index information may be an index value and a residual skipping flag bit, and the residual skipping flag bit is used to indicate residual skipping or non-residual skipping.

[0174] For example, if the index value is 0 and the residual skip mark bit is the first value (such as 0, used to indicate residual skip), it indicates the first candidate mode in the second mode set, that is, the DC mode based on residual skip. If the index value is 0 and the residual skip mark bit is the second value (such as 1, used to indicate non-residual skip), it indicates the second candidate mode in the second mode set, that is, the DC mode based on non-residual skip. If the index value is 1 and the residual skip mark bit is the first value, it indicates the third candidate mode in the second mode set, that is, the bilinear mode based on residual skip, and so on.

[0175] To summarize, the index information corresponding to the target mode in the second mode set can be represented based on the index value and the residual skip mark bit, the index value represents the position of the intra-frame prediction mode, the positions of intra-frame prediction modes such as DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, and point-by-point prediction mode, and the residual skip mark bit represents residual skipping or non-residual skipping, that is, whether to adopt the intra-frame prediction mode of residual skipping or the intra-frame prediction mode of non-residual skipping.

[0176] The order of the candidate modes in the second mode set is not limited in this embodiment and can be configured arbitrarily.

[0177] Exemplarily, when the code control information indicates that the resource pool is insufficient (such as the feature information meets specific conditions), the target mode can be selected from the M candidate modes of the first mode set. Since the M candidate modes are M intra-frame candidate modes, and the intra-frame prediction mode may include but is not limited to DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode, etc., the M candidate modes may include but are not limited to at least one of the following modes: DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, point-by-point prediction mode. Of course, the above are just a few examples of intra-frame prediction modes, and this embodiment does not limit this intra-frame prediction mode.

[0178] In a possible implementation, the intra-frame prediction mode can also be divided into an intra-frame prediction mode based on residual skipping and an intra-frame prediction mode based on non-residual skipping. In this embodiment, when the code control information indicates that the resource pool is insufficient (such as the characteristic information meets specific conditions), the available mode can be limited to only the residual skipping mode. On this basis, the M candidate modes in the first mode set may include but are not limited to at least one of the following modes: a DC mode based on residual skipping, a bilinear mode based on residual skipping, an angular prediction mode based on residual skipping, an IBC mode based on residual skipping, an ISC mode based on residual skipping, a Planar mode based on residual skipping, and a point-by-point prediction mode based on residual skipping.

[0179] Among them, all candidate modes of the residual skip mode in the second mode set can be added to the first mode set, or some candidate modes of the residual skip mode in the second mode set can be added to the first mode set, or any intra-frame prediction mode of the residual skip mode can be added to the first mode set, and for each intra-frame prediction mode that has been added, the intra-frame prediction mode may be located in the second mode set or may not be located in the second mode set. Of course, the above methods only give several examples of constructing the first mode set, and this embodiment does not limit the first mode set.

[0180] Among them, the DC mode based on residual skipping, the bilinear mode based on residual skipping, the angle prediction mode based on residual skipping, the IBC mode based on residual skipping, the ISC mode based on residual skipping, the Planar mode based on residual skipping, and the point-by-point prediction mode based on residual skipping are just a few examples of candidate modes in the first mode set, and there is no limitation on the candidate modes in the first mode set. In one possible implementation, the candidate modes in the first mode set may have the following characteristics: when the candidate mode is used to encode the current block, it has the characteristics of low bit rate overhead, low bit rate loss, and low mode cost. Of course, the image quality may be sacrificed to a certain extent. In this embodiment, the mode with the above characteristics can be used as a candidate mode in the first mode set, that is, the mode is added to the first mode set.

[0181] Among them, if the M candidate modes include at least one of the DC mode, the bilinear mode, the angular prediction mode, the IBC mode, the ISC mode, the Planar mode, and the point-by-point prediction mode, then when the encoder encodes the index information corresponding to the target mode in the first mode set in the bitstream, the index information may be an index value (used to indicate the candidate mode number in the first mode set). If the M candidate modes include at least one of the DC mode based on residual skipping, the bilinear mode based on residual skipping, the angular prediction mode based on residual skipping, the IBC mode based on residual skipping, the ISC mode based on residual skipping, the Planar mode based on residual skipping, and the point-by-point prediction mode based on residual skipping, then when the encoder encodes the index information corresponding to the target mode in the first mode set in the bitstream, the index information may be an index value.

[0182] Therein, the order of the candidate modes in the first mode set is not limited in this embodiment and can be configured arbitrarily.

[0183] Embodiment 8: For the encoding end, the encoding end directly selects the target mode from the M candidate modes of the first mode set, that is, the encoding end does not need to determine whether the characteristic information corresponding to the current block meets the specific conditions. The encoding end can also encode the mode flag information corresponding to the target mode in the bitstream corresponding to the current block, and the mode flag information is the index information corresponding to the target mode in the first mode set. For the decoding end, the decoding end can obtain the mode flag information corresponding to the target mode from the bitstream corresponding to the current block, and select the target mode from the M candidate modes of the first mode set based on the mode flag information. In this embodiment, the decoding end does not need to determine whether the characteristic information corresponding to the current block meets the specific conditions. Among them, the M candidate modes in the first mode set can only be residual skip modes, such as at least one of the DC mode based on residual skip, the bilinear mode based on residual skip, the angular prediction mode based on residual skip, the IBC mode based on residual skip, the ISC mode based on residual skip, the Planar mode based on residual skip, and the point-by-point prediction mode based on residual skip.

[0184] Embodiment 9: On the basis of Embodiments 1 to 8, for the M candidate modes of the first mode set, only prediction modes with controllable mode costs may be included. Alternatively, prediction modes with controllable mode costs may be included, and on this basis, at least one of a DC mode based on residual skipping, a bilinear mode based on residual skipping, an angle prediction mode based on residual skipping, an IBC mode based on residual skipping, an ISC mode based on residual skipping, a Planar mode based on residual skipping, and a point-by-point prediction mode based on residual skipping may be included. Of course, the above are only examples and are not limited to this. In addition, for the N candidate modes of the second mode set, prediction modes with controllable mode costs may also be included, that is, on the basis of the modes given in the above embodiments, prediction modes with controllable mode costs in Embodiment 8 may also be included.

[0185] Among them, the prediction mode with controllable model cost is a prediction mode that can control the cost value. In this embodiment, two prediction modes with controllable model cost are given, which are respectively recorded as the first prediction mode with controllable model cost and the second prediction mode with controllable model cost. Of course, only two examples are given here, and there is no limitation on this in this embodiment.

[0186] Regarding the first prediction mode with controllable mode cost, the original value can be quantized and transmitted according to the code control state and the number of pixels to be compressed. For example, assuming that the code control has 80 bits remaining, taking 16*2 blocks as an example, the code rate of each pixel can be calculated, that is, 80 / (16*2)=2.5. In order to avoid overflow, it is rounded down to 2. For each original value, 2 bits are used to represent it, so as to determine its quantization step size. Of course, in practical applications, for each original value, a numerical value greater than 2 bits can also be used, such as 3 bits, 4 bits, etc. In this case, for the original value of the front pixel in the 16*2 block, 3 bits, 4 bits, etc. are used. After the occupation is about to exceed 80 bits, the original value of the remaining pixels is no longer quantized and transmitted.

[0187] For the encoder, the encoder can determine the quantization step size based on the code control state and the number of pixels to be compressed, and apply the quantization step size to the original value, and finally encode the quantization index value for each pixel. For the decoder, the decoder determines the quantization step size based on the code control state and the number of pixels to be compressed, and parses the quantization index value of each pixel's original value. For example, the decoder needs to decode this 2-bit information and then obtain the quantization index value of the pixel's original value.

[0188] Regarding the second prediction mode with controllable mode cost, the residual can be quantized and transmitted according to the code control state and the number of pixels to be compressed. The principle of the second prediction mode is similar to that of the first prediction mode, but the mode cost needs to be considered additionally. For example, assuming that the code control has 80 bits remaining and the mode cost is 10 bits, taking a 16*2 block as an example, the code rate of each pixel can be calculated, that is, (80-10) / (16*2)=2.18. In order to avoid overflow, it is rounded down to 2. For each residual, 2 bits are used to represent it, so as to determine its quantization step size. Of course, in practical applications, for each residual, a numerical value greater than 2 bits can also be used, such as 3 bits, 4 bits, etc. In this case, for the residual of the previous pixel in the 16*2 block, 3 bits, 4 bits, etc. are used. After occupying more than 80 bits, the residual is no longer quantized and transmitted for the remaining pixels.

[0189] For the encoder, the encoder can determine the quantization step size based on the code control state and the number of pixels to be compressed, and apply the quantization step size to the residual value, and finally encode the quantization index value of each pixel. For the decoder, the decoder determines the quantization step size based on the code control state and the number of pixels to be compressed, and parses the quantization index value of each pixel residual value. For example, the decoder needs to decode and obtain 2 bits of this information, and then obtain the quantization index value of the pixel residual value.

[0190] For the first prediction mode with controllable mode cost and the second prediction mode with controllable mode cost, if the current block contains multiple channels, they can be allocated according to a preset ratio. For example, for the three YUV channels, they can be allocated as 4:1:1. At this time, if there are 60 bits left, the Y channel occupies 40 bits and the UV channels each occupy 10 bits. The number of bits occupied by the UV channel can be updated after the Y channel is encoded. For example, taking the original value quantization method as an example, if the Y channel is an 8*2 block, 40 / (8x2)=2.5 is rounded down to 2. At this time, the Y channel only uses 2*8*2=32 bits, and the remaining 40-32=8 bits can be used for the subsequent UV channel.

[0191] Embodiment 10: In the embodiment of the present application, a coding method is proposed, see Figure 5 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:

[0192] Step 501: Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks.

[0193] In a possible implementation, 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 can be determined that the reconstruction value adjustment of the current image area is required; otherwise, it can be determined that the reconstruction value adjustment of the current image area is not required. In this case, the encoding end can also encode the mark bit corresponding to the adjustment control switch in the bitstream corresponding to the current image area; wherein, if the reconstruction value adjustment of the current image area is required, the mark bit is a first value, and the first value is used to indicate that the reconstruction value adjustment of the current image area is required. If the reconstruction value adjustment of the current image area is not required, the mark bit is a second value, and the second value is used to indicate that the reconstruction value adjustment of the current image area is not required.

[0194] In another possible implementation, if the feature information corresponding to the current image area meets a specific condition, it can be determined that the reconstruction value of the current image area needs to be adjusted; otherwise, it is determined that the reconstruction value of the current image area does not need to be adjusted. In this case, the feature information corresponding to the current image area may include, but is not limited to: at least one of the current bit rate, the block position of the image block in the current image area, the reconstructed pixel feature, and the quantization step size; the feature information corresponding to the current image area meets the specific condition, which may include, but is not limited to: if the current bit rate is less than the first bit rate value, it is determined that the feature information meets the specific condition; or, if the block position is located at a specified position, it is determined that the feature information meets the specific condition; or, if the quantization step size is greater than the step size threshold, it is determined that the feature information meets the specific condition; or, if the reconstructed pixel feature indicates that the complexity of the current image area is complex, it is determined that the feature information meets the specific condition; or, if the block position is located at a specified position and the quantization step size is greater than the step size threshold, it is determined that the feature information meets the specific condition.

[0195] Step 502: 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.

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

[0197] 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.

[0198] 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 second 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.

[0199] Among them, all the pixels in the current image area can be divided into multiple pixel groups, and the multiple adjustment values ​​can include adjustment values ​​corresponding to K pixel groups, and the K pixel groups can be all pixel groups or part of the pixel groups in the multiple pixel groups. For each pixel group, the adjustment value corresponding to the pixel group can include adjustment values ​​of multiple channels corresponding to the pixel group, and the multiple channels can 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 can include Y channel, U channel, and V channel, or the multiple channels can include R channel, G channel, and B channel, or the multiple channels can include R channel, G channel, B channel, and alpha channel, or the multiple channels can include R channel, G channel, B channel, and IR channel, or the multiple channels can include R channel, G channel, B channel, and W channel, or the multiple channels can include R channel, G channel, B channel, IR channel, and W channel, or the multiple channels can include R channel, G channel, B channel, and D channel, or the multiple channels can include R channel, G channel, B channel, and D channel.

[0200] 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.

[0201] Among them, all the pixels of the current image area are divided into multiple pixel groups, including but not limited to the following methods: all the pixels of the current image area are divided into multiple pixel groups according to the reconstruction value of each pixel; or, the classification value of the pixel is determined based on the reconstruction value of the surrounding pixels of the pixel, and all the pixels of the current image area are divided into multiple pixel groups according to the classification value of each pixel; or, all the pixels of the current image area are divided into multiple pixel groups according to the pixel position of each pixel. Of course, the above methods are just a few examples, and there is no limitation on this division method.

[0202] Among them, if the K pixel groups are some of the pixel groups among the multiple pixel groups, the encoder may further encode the index information corresponding to the K pixel groups in the code stream corresponding to the current image region, indicating that the code stream corresponding to the current image region carries the adjustment value of the pixel group corresponding to the index information. If the K pixel groups are all the pixel groups among the multiple pixel groups, the encoder may not encode the index information corresponding to the pixel group in the code stream corresponding to the current image region, indicating that the code stream corresponding to the current image region carries the adjustment values ​​of all pixel groups, and in this case, it is not necessary to encode the index information corresponding to the pixel group in the code stream.

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

[0204] Example 11: A decoding method is proposed in the embodiment of the present application, see Figure 6 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:

[0205] Step 601: Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks.

[0206] In a possible implementation, a flag bit corresponding to the adjustment control switch can be obtained from the bitstream corresponding to the current image area; if the flag bit is a first value, it is determined that the reconstruction value adjustment of the current image area is required. If the flag bit is a second value, it is determined that the reconstruction value adjustment of the current image area is not required.

[0207] In another possible implementation, if the feature information corresponding to the current image area meets a specific condition, it can be determined that the reconstruction value of the current image area needs to be adjusted; otherwise, it can be determined that the reconstruction value of the current image area does not need to be adjusted. In this case, the feature information corresponding to the current image area may include, but is not limited to: at least one of the current bit rate, the block position of the image block in the current image area, the reconstructed pixel feature, and the quantization step size; the feature information corresponding to the current image area meets the specific condition, which may include, but is not limited to: if the current bit rate is less than the first bit rate value, it is determined that the feature information meets the specific condition; or, if the block position is located at a specified position, it is determined that the feature information meets the specific condition; or, if the quantization step size is greater than the step size threshold, it is determined that the feature information meets the specific condition; or, if the reconstructed pixel feature indicates that the complexity of the current image area is complex, it is determined that the feature information meets the specific condition; or, if the block position is located at a specified position and the quantization step size is greater than the step size threshold, it is determined that the feature information meets the specific condition.

[0208] Step 602: 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.

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

[0210] In a possible implementation, the adjustment parameter corresponding to the current image area may include multiple adjustment values, and all pixels in the current image area may be divided into multiple pixel groups, 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. 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 value of the pixel points 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.

[0211] The reconstruction values ​​of pixel points in K pixel groups are adjusted based on multiple adjustment values, including: for each pixel group in the K pixel groups, if the multiple adjustment values ​​include an adjustment value corresponding to the pixel group, the reconstruction value of each pixel point in the pixel group is adjusted based on the adjustment value corresponding to the pixel group to obtain an adjusted reconstruction value of each pixel point in the pixel group.

[0212] 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.

[0213] Among them, all the pixels of the current image area are divided into multiple pixel groups, including but not limited to the following methods: all the pixels of the current image area are divided into multiple pixel groups according to the reconstruction value of each pixel; or, the classification value of the pixel is determined based on the reconstruction value of the surrounding pixels of the pixel, and all the pixels of the current image area are divided into multiple pixel groups according to the classification value of each pixel; or, all the pixels of the current image area are divided into multiple pixel groups according to the pixel position of each pixel. Of course, the above methods are just a few examples, and there is no limitation on this division method.

[0214] In a possible implementation, if the K pixel groups are part of the pixel groups in a plurality of pixel groups, the decoding end may also obtain index information corresponding to the K pixel groups from the code stream corresponding to the current image area; based on the index information, K pixel groups are selected from all pixel groups, and a plurality of adjustment values ​​are associated with the K pixel groups. In this way, the reconstructed values ​​of the pixel points in the K pixel groups may be adjusted based on the plurality of adjustment values, that is, only the reconstructed values ​​of the K pixel groups are adjusted.

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

[0216] Example 12: For Example 10 and Example 11, 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 then 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 then it can be determined whether it is necessary to adjust the reconstruction value of the current image area.

[0217] 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.

[0218] 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:

[0219] Method 1: explicit syntax. For example, 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.

[0220] The encoder 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 encoder calculates the cost value of starting the reconstruction value adjustment of the current image area, recorded as the first generation value, and calculates the cost value of closing the reconstruction value adjustment of the current image area, recorded as the second generation value; if the first generation value is less than the second generation value, the encoder determines that the reconstruction value adjustment of the current image area is necessary; otherwise, the encoder determines that the reconstruction value adjustment of the current image area is not necessary.

[0221] 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 the reconstruction value of the current image area does not need to be adjusted, the mark bit may be a second value, and the second value indicates that the reconstruction value of the current image area does not need to be adjusted. Both the first value and the second value can be configured based on experience, such as the first value can be 0 and the second value can be 1, or the first value can be 1 and the second value can be 0, and there is no restriction on this.

[0222] The decoding end can obtain the mark bit corresponding to the adjustment control switch from the code stream corresponding to the current image area. If the mark bit is the first value, the decoding end determines that the reconstruction value of the current image area needs to be adjusted. If the mark bit is the second value, the decoding end determines that the reconstruction value of the current image area does not need to be adjusted.

[0223] 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 this conclusion 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 encoding 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 encoding blocks, and the decoder does not need to adjust the reconstruction values ​​of N decoding blocks.

[0224] Method 2: Implicit derivation, for example, the encoder implicitly derives whether the reconstruction value of the current image area needs to be adjusted based on the feature information corresponding to the current image area, and the decoder implicitly derives whether the reconstruction value of the current image area needs to be adjusted based on the feature information corresponding to the current image area. For example, if the feature information corresponding to the current image area meets a specific condition, it is determined that the reconstruction value of the current image area needs to be adjusted, otherwise, it is determined that the reconstruction value of the current image area does not need to be adjusted.

[0225] Exemplarily, the 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 just a few examples of feature information, and this feature information is not limited in this embodiment. Whether the feature information corresponding to the current image area meets specific conditions may include but is not limited to:

[0226] Case 1: The characteristic 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 characteristic information meets the specific condition, otherwise, it is determined that the characteristic information does not meet the specific condition. The first bit rate value may be a bit rate value configured based on experience, and there is no restriction on this. When the current bit rate is less than the first bit rate value, it means that the code control information indicates that the resource pool is sufficient.

[0227] 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.

[0228] Case 2: the feature information corresponding to the current image area includes a block position corresponding to the current image area. If the block position is located at a specified position, it is determined that the feature information meets a specific condition; otherwise, it is determined that the feature information does not meet the specific condition.

[0229] 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 bottom row of image blocks, 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.

[0230] 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.

[0231] 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.

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

[0233] Case 3: the 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 feature information meets the specific condition; otherwise, it is determined that the feature information does not meet the specific condition.

[0234] Case 4: The 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 feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0235] Case 5: The 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, or the block position is located at a specified position, it is determined that the feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0236] Case 6: The 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. On this basis, 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 feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0237] Case 7: The 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. On this basis, 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 feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0238] Case 8: The 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 feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0239] Case 9: The 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, or the quantization step is greater than the step threshold, it is determined that the feature information meets the specific conditions; otherwise, it is determined that the feature information does not meet the specific conditions.

[0240] Case 10: The 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 feature information meets the specific conditions; otherwise, it can be determined that the feature information does not meet the specific conditions.

[0241] Case 11: The 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 size 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 size is greater than the step size threshold, it can be determined that the feature information meets the specific conditions; otherwise, it can be determined that the feature information does not meet the specific conditions.

[0242] Case 12: The 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 feature information meets specific conditions; otherwise, it can be determined that the feature information does not meet the specific conditions.

[0243] 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.

[0244] 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.

[0245] 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, so it can be determined that the feature information meets specific conditions. Exemplarily, the reconstructed pixel feature can be a complexity value, and 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.

[0246] Case 13: The feature information corresponding to the current image area includes the reconstructed pixel features corresponding to the current image area. On this basis, the 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 feature indicates that the complexity of the current image area is complex, then it can be determined that the feature information meets the specific conditions. Otherwise, it can be determined that the feature information does not meet the specific conditions.

[0247] Case 14: The feature information corresponding to the current image area includes the reconstructed pixel features corresponding to the current image area. On this basis, the 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 feature indicates that the complexity of the current image area is complex, then it can be determined that the feature information meets the specific conditions. Otherwise, it can be determined that the feature information does not meet the specific conditions.

[0248] Method 3, combined implementation, that is, the 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, 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 mark bit corresponding to the adjustment control switch is not encoded 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. 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 mark bit corresponding to the adjustment control switch is encoded 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.

[0249] Of course, the above-mentioned methods 1 to 3 are just a few examples, and this embodiment does not limit them.

[0250] Embodiment 13: For Embodiments 10 to 12, 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 includes 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 includes N decoding blocks, and the adjustment parameter is used to adjust the reconstruction value of the N decoding blocks.

[0251] 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.

[0252] 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. 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, 12 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 may obtain 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.

[0253] 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, the multiple channels may include a Y channel, a U channel, and a V channel, or the multiple channels may include an R channel, a G channel, and a B channel, or the multiple channels may include an R channel, a G channel, a B channel, and an alpha channel, or the multiple channels may include an R channel, a G channel, a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, and a D channel, or the multiple channels may include an R channel, a G channel, a B channel, a D channel, and a W channel.

[0254] 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.

[0255] 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.

[0256] 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.

[0257] 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.

[0258] 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.

[0259] 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, the multiple channels may include a Y channel, a U channel, and a V channel, or the multiple channels may include an R channel, a G channel, and a B channel, or the multiple channels may include an R channel, a G channel, a B channel, and an alpha channel, or the multiple channels may include an R channel, a G channel, a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, an IR channel, and a W channel, or the multiple channels may include an R channel, a G channel, a B channel, and a D channel, or the multiple channels may include an R channel, a G channel, a B channel, a D channel, and a W channel.

[0260] 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.

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

[0262] In a possible implementation, if the K pixel groups are some of the pixel groups in all the pixel groups, the encoder may encode the index information corresponding to the K pixel groups in the bitstream corresponding to the current image region, indicating that the bitstream carries the adjustment value of the pixel group corresponding to the index information. The decoder may parse the index information corresponding to the K pixel groups from the bitstream corresponding to the current image region, and learn that the adjustment parameters carried in the bitstream are the adjustment values ​​corresponding to the K pixel groups corresponding to the index information.

[0263] For example, the index information may include index values ​​of K pixel groups, where the index value indicates the pixel group's nth pixel group 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 index information may include the index value of pixel group 1 (the index value is used to indicate the pixel group's nth pixel group 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 of the pixel groups among multiple pixel groups, the index 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, that is, the index information can realize the classification function.

[0264] For another example, assuming that the K pixel groups are continuous pixel groups, the index information may include index values ​​of some pixel groups in the K pixel groups, and the index values ​​of the remaining pixel groups may 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 index information may only include the index value of pixel group 1. Since the K pixel groups are continuous pixel groups, the index values ​​of pixel group 2, pixel group 3, and pixel group 4 may be implicitly derived.

[0265] 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.

[0266] In a possible implementation, 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 index 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 index 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.

[0267] Embodiment 14: For the encoding end and the decoding end, all pixels in the current image area may be divided into a plurality of pixel groups, that is, all pixels are classified. In this embodiment, all pixels in the current image area may be divided into a plurality of pixel groups in the following manner:

[0268] Method 1: All pixels in the current image area are divided into multiple pixel groups according to the reconstruction value of each pixel, that is, the reconstruction value of each pixel can be classified to obtain multiple pixel groups. For example, the 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 (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.

[0269] 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.

[0270] Method 2: Determine the classification value of the pixel based on the reconstruction value of the surrounding pixels of the pixel, and divide all the pixels in the current image area into multiple pixel groups according to the classification value of each pixel, that is, classify according to the gradient value of each pixel to obtain multiple pixel groups. For example, the pixel can be classified according to the reconstruction value of the surrounding pixels of the pixel, such as using the gradient information to subtract the reconstruction value of the upper adjacent pixel of the pixel from the reconstruction value of the left adjacent pixel of the pixel to obtain the gradient value of the pixel, and the pixels whose gradient value results are in a certain range can be defined as the same category, such as the absolute value below 10 is the first category, the absolute value between 10 and 30 is the second category, and the absolute value greater than 30 is the third category. 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 above 30, the pixel is divided into the third pixel group.

[0271] 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.

[0272] 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.

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

[0274] Embodiment 15: 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. 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.

[0275] 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.

[0276] 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:

[0277] Step S11 , sorting the multiple adjustment values ​​according to their coding order.

[0278] Taking 4 pixel groups (such as pixel group 1-pixel group 4), each pixel group includes a Y channel adjustment value, a U channel adjustment value and a 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.

[0279] 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.

[0280] 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.

[0281] 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.

[0282] 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.

[0283] 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.

[0284] 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.

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

[0286] 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.

[0287] Step S13: 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.

[0288] Exemplarily, the second code rate value may be a code rate value 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.

[0289] Step S14: 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.

[0290] 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.

[0291] Embodiment 16: In the process of transmitting the adjustment parameters, the state of the 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 transmitted step by step 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 transmission, 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 transmitted. Case 2: The adjustment parameters are transmitted step by step in the form of pixel groups (at least one pixel), that is, the adjustment parameters are transmitted 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 transmitted group by group, and the code control state is gradually updated.

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

[0293] Exemplarily, the above embodiments can be implemented separately or in combination. For example, each embodiment in Embodiment 1 to Embodiment 9 can be implemented separately, and at least two embodiments in Embodiment 1 to Embodiment 9 can be implemented in combination. Each embodiment in Embodiment 10 to Embodiment 16 can be implemented separately, and at least two embodiments in Embodiment 10 to Embodiment 16 can be implemented in combination. For another example, at least one embodiment in Embodiment 1 to Embodiment 9 can also be implemented in combination with at least one embodiment in Embodiment 10 to Embodiment 16. Of course, the above are just a few examples of combinations.

[0294] 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.

[0295] Example 17: 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 16, that is, the processing flow of the decoding end.

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

[0297] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0298] decoding the current block based on the target mode;

[0299] or,

[0300] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0301] 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;

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

[0303] Based on the same application concept as the above method, an encoding device is also proposed in an embodiment of the present application. The encoding device is applied to an 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 16, that is, the processing flow of the encoding end.

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

[0305] If the feature information corresponding to the current block meets a specific condition, a target mode is selected from the M candidate modes of the first mode set; otherwise, a target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N;

[0306] encoding the current block based on the target mode;

[0307] or,

[0308] Determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks;

[0309] 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;

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

[0311] 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. 7A As shown. It includes: a processor 711 and a machine-readable storage medium 712, wherein: 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 disclosed in the above embodiments 1-16 of this application.

[0312] 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, wherein: 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 disclosed in the above embodiments 1-16 of this application.

[0313] 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.

[0314] 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.

[0315] 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 the decoding end, and the decoding device includes: a selection module, which is used to select a target mode from the M candidate modes of the first mode set if the feature information corresponding to the current block meets specific conditions; otherwise, the target mode is selected from the N candidate modes of the second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N; a decoding module, which is used to decode the current block based on the target mode.

[0316] In a possible implementation manner, the N candidate modes are N intra-frame candidate modes, and the M candidate modes are M intra-frame candidate modes.

[0317] In a possible implementation manner, the N candidate modes include at least two of the following modes: a DC mode based on residual skipping, a DC mode based on non-residual skipping, a bilinear mode based on residual skipping, a bilinear mode based on non-residual skipping, an angular prediction mode based on residual skipping, an angular prediction mode based on non-residual skipping, an IBC mode based on residual skipping, an IBC mode based on non-residual skipping, an ISC mode based on residual skipping, an ISC mode based on non-residual skipping, a Planar mode based on residual skipping, a Planar mode based on non-residual skipping, a point-by-point prediction mode based on residual skipping, and a point-by-point prediction mode based on non-residual skipping; or,

[0318] The N candidate modes include at least two of the following modes: DC mode, bilinear mode, angular prediction mode, IBC mode, ISC mode, Planar mode, and point-by-point prediction mode.

[0319] In a possible implementation, the M candidate modes include at least one of the following modes: a DC mode based on residual skipping, a bilinear mode based on residual skipping, an angular prediction mode based on residual skipping, an IBC mode based on residual skipping, an ISC mode based on residual skipping, a Planar mode based on residual skipping, and a point-by-point prediction mode based on residual skipping.

[0320] In a possible implementation manner, the characteristic information corresponding to the current block includes a current bit rate and / or a block position;

[0321] The characteristic information corresponding to the current block satisfies specific conditions, including:

[0322] If the current bit rate corresponding to the current block is greater than the preset bit rate value, it is determined that the characteristic information meets the specific condition; or, if the block position corresponding to the current block is located at a non-specified position, it is determined that the characteristic information meets the specific condition; or, if the current bit rate corresponding to the current block is greater than the preset bit rate value and the block position corresponding to the current block is located at a non-specified position, it is determined that the characteristic information meets the specific condition.

[0323] In a possible implementation, the selection module is specifically used to select the target mode from the N candidate modes of the second mode set by: decoding the mode flag information corresponding to the target mode from the code stream corresponding to the current block; wherein, when the feature information corresponding to the current block does not meet specific conditions, the mode flag information is the index information corresponding to the target mode in the second mode set; and selecting the target mode from the N candidate modes of the second mode set based on the mode flag information.

[0324] In a possible implementation, when the selection module selects the target mode from the M candidate modes of the first mode set, it is specifically used to: decode the mode flag information corresponding to the target mode from the code stream corresponding to the current block; wherein, when the characteristic information corresponding to the current block meets a specific condition, the mode flag information is the index information corresponding to the target mode in the first mode set; and select the target mode from the M candidate modes of the first mode set based on the mode flag information.

[0325] In a possible implementation, the decoding module is also used to: if the characteristic information corresponding to the current block meets specific conditions, decode the mode flag information corresponding to the target mode from the code stream corresponding to the current block; if the mode flag information is the index information corresponding to the target mode in the second mode set, select the target mode from the N candidate modes of the second mode set based on the mode flag information; if the mode flag information is the index information corresponding to the target mode in the first mode set, select the target mode from the M candidate modes of the first mode set based on the mode flag information.

[0326] 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 the encoding end, and the encoding device includes: a selection module, which is used to select a target mode from M candidate modes of a first mode set if the feature information corresponding to the current block meets specific conditions; otherwise, the target mode is selected from N candidate modes of a second mode set; wherein N is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M is less than N; an encoding module, which is used to encode the current block based on the target mode.

[0327] In a possible implementation, the encoding module is also used to encode mode flag information corresponding to the target mode in the code stream corresponding to the current block; wherein, when selecting the target mode from N candidate modes of the second mode set, the mode flag information is the index information corresponding to the target mode in the second mode set.

[0328] In a possible implementation, when selecting a target mode from M candidate modes in the first mode set, the mode flag information is index information corresponding to the target mode in the first mode set.

[0329] In one possible implementation, when selecting a target mode from M candidate modes of a first mode set, the mode flag information is the index information corresponding to the target mode in the second mode set; or, the mode flag information is the index information corresponding to the target mode in the first mode set.

[0330] 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, used to determine whether it is necessary to adjust the reconstruction value of the current image area; wherein the current image area includes an image block, or multiple consecutive image blocks; an acquisition module, 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; a processing module, used to adjust the reconstruction value of the current image area based on the adjustment parameter.

[0331] In a possible implementation, when the determination module determines whether it is necessary to adjust the reconstruction value of the current image area, it is specifically used to: obtain a mark bit corresponding to the adjustment control switch from the code stream corresponding to the current image area; 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.

[0332] In a possible implementation, the determination module determines whether it is necessary to adjust the reconstruction value of the current image area by: if the feature information corresponding to the current image area meets a specific condition, determining that it is necessary to adjust the reconstruction value of the current image area; otherwise, determining that it is not necessary to adjust the reconstruction value of the current image area.

[0333] In a possible implementation, the feature information corresponding to the current image area includes at least one of a current bit rate, a block position of an image block in the current image area, a reconstructed pixel feature and a quantization step size; the feature information corresponding to the current image area satisfies a specific condition, including: if the current bit rate is less than a first bit rate value, determining that the feature information satisfies the specific condition; or, if the block position is located at a specified position, determining that the feature information satisfies the specific condition; or, if the quantization step size is greater than a step size threshold, determining that the feature information satisfies the specific condition; or, if the reconstructed pixel feature indicates that the complexity of the current image area is complex, determining that the feature information satisfies the specific condition; or, if the block position is located at a specified position and the quantization step size is greater than a step size threshold, determining that the feature information satisfies the specific condition.

[0334] In a possible implementation, the adjustment parameters corresponding to the current image area include multiple adjustment values, all pixel points of the current image area are divided into multiple pixel groups, 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 processing module adjusts the reconstruction value of the current image area based on the adjustment parameters, it is specifically used to: adjust the reconstruction value of the pixel points in the K pixel groups based on the multiple adjustment values.

[0335] In a possible implementation, when the processing module adjusts the reconstruction values ​​of the pixel points in the K pixel groups based on the multiple adjustment values, it is specifically used to: for each pixel group in the K pixel groups, if the multiple adjustment values ​​include an adjustment value corresponding to the pixel group, then based on the adjustment value corresponding to the pixel group, adjust the reconstruction value of each pixel point in the pixel group to obtain the adjusted reconstruction value of each pixel point in the pixel group.

[0336] In a possible implementation manner, the adjustment value corresponding to the pixel group includes adjustment values ​​of multiple channels corresponding to the pixel group.

[0337] In a possible implementation, the plurality of channels include at least one of the following channels: a Y channel, a U channel, a V channel, an R channel, a G channel, a B channel, an alpha channel, an IR channel, a D channel, and a W channel.

[0338] In a possible implementation, the processing module is also used to divide all pixel points of the current image area into multiple pixel groups, specifically for: dividing all pixel points of the current image area into multiple pixel groups according to the reconstruction value of each pixel point; or, determining the classification value of the pixel point based on the reconstruction value of the surrounding pixel points, and dividing all pixel points of the current image area into multiple pixel groups according to the classification value of each pixel point; or, dividing all pixel points of the current image area into multiple pixel groups according to the pixel position of each pixel point.

[0339] In a possible implementation, if the K pixel groups are some pixel groups among the multiple pixel groups, the acquisition module is further used to obtain index information corresponding to the K pixel groups from the code stream corresponding to the current image area; and select the K pixel groups from all pixel groups based on the index information; wherein the index information is used to distinguish pixel groups of a target category among all categories of pixel groups.

[0340] 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 the 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; wherein the current image area includes an image block, or multiple continuous image blocks; 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 the code stream corresponding to the current image area.

[0341] In a possible implementation, the encoding module is also used to encode a mark bit corresponding to the adjustment control switch in the code stream corresponding to the current image area; wherein, if the reconstruction value of the current image area needs to be adjusted, the mark bit is a first value; if the reconstruction value of the current image area does not need to be adjusted, the mark bit is a second value.

[0342] In a possible implementation, the determination module determines whether it is necessary to adjust the reconstruction value of the current image area by: if the feature information corresponding to the current image area meets a specific condition, determining that it is necessary to adjust the reconstruction value of the current image area; otherwise, determining that it is not necessary to adjust the reconstruction value of the current image area.

[0343] In a possible implementation, the encoding module is specifically used to encode the adjustment parameters corresponding to the current image area in the code stream corresponding to the current image area, if the adjustment parameters corresponding to the current image area include multiple adjustment values, then all or part of the adjustment values ​​are encoded in the code stream corresponding to the current image area.

[0344] In a possible implementation manner, when encoding all or part of the adjustment values ​​in the bitstream corresponding to the current image region, the encoding module is specifically configured to: sort the multiple adjustment values ​​according to the encoding order of the multiple adjustment values; traverse each of the multiple adjustment values ​​in sequence based on the sorting result; 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 corresponding to the current image region, encode the adjustment value in the bitstream corresponding to the current image region, and continue to traverse the next adjustment value of the adjustment value; otherwise, prohibit encoding the adjustment value in the bitstream corresponding to the current image region, and stop traversing the next adjustment value of the adjustment value.

[0345] 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.

[0346] 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, characterized in that: Applied to a decoding end, the method comprises: Obtaining a mark bit corresponding to the adjustment control switch from a code stream corresponding to a current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks; If the flag bit corresponding to the adjustment control switch is a first value, obtaining the adjustment parameter corresponding to the current image area from the bitstream corresponding to the current image area; Adjusting the reconstruction value of the current image area based on the adjustment parameter; The adjustment parameter corresponding to the current image area includes a plurality of adjustment values, all pixels in the current image area are divided into a plurality of pixel groups according to the pixel position of each pixel point, and 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: The reconstructed values ​​of the pixels in the K pixel groups are adjusted based on the multiple adjustment values.

2. The method according to claim 1, characterized in that The adjusting the reconstructed values ​​of the pixels in the K pixel groups based on the multiple adjustment values ​​includes: Adjusting the Y channel reconstruction values ​​of the pixels in the K pixel groups based on the multiple Y channel adjustment values; and / or, Adjusting the U channel reconstruction values ​​of the pixels in the K pixel groups based on the multiple U channel adjustment values; and / or, The V channel reconstruction values ​​of the pixels in the K pixel groups are adjusted based on the multiple V channel adjustment values.

3. The method according to claim 1, characterized in that The step of dividing all pixel points in the current image area into a plurality of pixel groups according to the pixel position of each pixel point comprises: If the size of the current image area is 16*2, the 16*2 current image area is equally divided into four 4*2 sub-areas, all pixels in each 4*2 sub-area are divided into the same pixel group, and pixels in different 4*2 sub-areas are divided into different pixel groups.

4. The method according to claim 1, characterized in that: If the K pixel groups are part of the multiple pixel groups, the method further includes: obtaining index information corresponding to the K pixel groups from the code stream corresponding to the current image area; selecting the K pixel groups from all pixel groups based on the index information; wherein the index information is used to distinguish pixel groups of a target category among all categories of pixel groups.

5. A coding method, characterized in that: Applied to the encoding end, the method includes: If it is necessary to adjust the reconstruction value of the current image area, and the current image area includes an image block, or a plurality of continuous image blocks, a flag bit corresponding to the adjustment control switch is encoded in a bitstream corresponding to the current image area, and the flag bit is a first value; Acquire an adjustment parameter corresponding to the current image area, where the adjustment parameter is used to adjust a reconstruction value of the current image area, and encode the adjustment parameter corresponding to the current image area in a bitstream corresponding to the current image area; The adjustment parameter corresponding to the current image area includes a plurality of adjustment values, all pixels in the current image area are divided into a plurality of pixel groups according to the pixel position of each pixel point, and 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 adjustment parameters are used to adjust the reconstruction values ​​of the current image area, including: the multiple adjustment values ​​are used to adjust the reconstruction values ​​of the pixel points in the K pixel groups.

6. A decoding device, characterized in that: The decoding device comprises: A determination module, used to obtain a mark bit corresponding to the adjustment control switch from a code stream corresponding to a current image area; wherein the current image area includes an image block, or a plurality of continuous image blocks; an acquisition module, configured to acquire, if the flag bit corresponding to the adjustment control switch is a first value, an adjustment parameter corresponding to the current image area from a bit stream corresponding to the current image area; A processing module, configured to adjust the reconstruction value of the current image area based on the adjustment parameter; The adjustment parameter corresponding to the current image area includes a plurality of adjustment values, all pixels in the current image area are divided into a plurality of pixel groups according to the pixel position of each pixel point, and 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; When the processing module adjusts the reconstruction value of the current image area based on the adjustment parameter, it is specifically used to: The reconstructed values ​​of the pixels in the K pixel groups are adjusted based on the multiple adjustment values.

7. A coding device, characterized in that: The encoding device comprises: an encoding module, configured to, if it is necessary to adjust the reconstruction value of a current image region, the current image region including an image block or a plurality of consecutive image blocks, encode a flag bit corresponding to the adjustment control switch in a bit stream corresponding to the current image region, and the flag bit is a first value; An acquisition module, used for acquiring adjustment parameters corresponding to the current image area, wherein the adjustment parameters are used for adjusting the reconstruction values ​​of the current image area; The encoding module is further used to encode the adjustment parameters corresponding to the current image area in the code stream corresponding to the current image area; The adjustment parameter corresponding to the current image area includes a plurality of adjustment values, all pixels in the current image area are divided into a plurality of pixel groups according to the pixel position of each pixel point, and 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 adjustment parameters are used to adjust the reconstruction values ​​of the current image area, including: the multiple adjustment values ​​are used to adjust the reconstruction values ​​of the pixel points in the K pixel groups.

8. A decoding device, 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-4.

9. A coding end device, 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 claim 5.

Citation Information

Patent Citations

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

    CN107852493A

  • Methods and devices for coding and decoding a data stream representative of at least one image

    CN110710204A