Decoding and encoding method, apparatus and device
By adjusting reconstruction values in video encoding based on feature information, the method addresses the issue of large quantization errors and color blocks in lightweight compression, enhancing both coding and decoding performance and achieving subjective losslessness.
Patent Information
- Application Number
- JP2024563448
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-04-27
- Filing Date
- 2023-04-26
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2043-04-26
AI Technical Summary
Existing lightweight compression methods for video encoding suffer from large quantization errors, especially in flat regions, leading to color blocks and subjective losses.
A method that determines whether reconstruction value adjustment is necessary for current image areas based on feature information, and adjusts the reconstruction values using parameters obtained from a bitstream, thereby reducing quantization errors and color blocking.
This approach improves coding and decoding performance by bringing reconstructed pixels closer to the original pixels, reducing quantization errors, and minimizing subjective losses, ultimately achieving subjective losslessness in lightweight compression.
Smart Images

Figure 2025514248000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the technical field of encoding and decoding, and in particular to a decoding and encoding method, apparatus and device thereof. [Background technology]
[0002] In order to achieve the purpose of saving space, video images are encoded before being transmitted, and the complete video encoding may include processes such as prediction, transformation, quantization, entropy encoding, filtering, etc. The prediction process may include intraframe prediction and interframe prediction, in which the interframe prediction is to use the pixels of nearby encoded images to predict the current pixel by utilizing the temporal correlation of the video, thereby achieving the purpose of effectively reducing the temporal redundancy of the video. The intraframe prediction is to use the pixels of the encoded blocks of the image of the current frame to predict the current pixel by utilizing the spatial correlation of the video, thereby achieving the purpose of reducing the spatial redundancy of the video.
[0003] Lightweight compression is an image coding method characterized by simple prediction. Lightweight compression is applied to scenes that require real-time performance, small cache, and parallelism. However, in the coding process using lightweight compression, large quantization errors often occur when the quantization step is large, and the overall deviation leads to color blocks and subjective loss, especially in flat areas. Summary of the Invention [Problem to be solved by the invention]
[0004] In view of this, the present invention provides a decoding and encoding method, apparatus and device thereof to improve the encoding performance. [Means for solving the problem]
[0005] The present invention provides a decoding method applied to the decoding side, which includes the steps of: determining whether or not reconstruction value adjustment is necessary for a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment is necessary for the current image region, obtaining adjustment parameters corresponding to the current image region from a bit stream corresponding to the current image region; and adjusting the reconstruction values of the current image region based on the adjustment parameters.
[0006] The present invention provides an encoding method applied to the encoding side, comprising the steps of: determining whether or not reconstruction value adjustment needs to be performed on a current image region based on feature information corresponding to the current image region; if it is determined that reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region, where the adjustment parameters are used to adjust the reconstruction values of the current image region; and encoding the adjustment parameters corresponding to the current image region into a bit stream corresponding to the current image region.
[0007] The present invention provides a decoding device including a memory configured to store video data and a decoder configured to perform the steps of: determining whether or not a reconstruction value adjustment needs to be performed on a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region from a bitstream corresponding to the current image region; and adjusting the reconstruction values of the current image region based on the adjustment parameters.
[0008] The present invention provides an encoding device including a memory configured to store video data and an encoder configured to perform the steps of: determining whether a reconstruction value adjustment needs to be performed for a current image region based on feature information corresponding to the current image region; if it is determined that a reconstruction value adjustment needs to be performed for the current image region, obtaining adjustment parameters corresponding to the current image region, the adjustment parameters being used to adjust the reconstruction values of the current image region; and encoding the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region.
[0009] The present invention provides a decoding device including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions executable by the processor, and the processor is used to execute the machine-executable instructions to implement the above-mentioned decoding method.
[0010] The present invention provides a coding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being used to execute the machine-executable instructions to implement the above coding method.
[0011] The present invention provides a machine-readable storage medium having stored thereon computer instructions which, when executed by at least one processor, perform the above-mentioned decoding or encoding methods.
[0012] As can be seen from the above technical solutions, the embodiments of the present invention provide a lightweight compression method applicable to scenes requiring real-time performance, small cache, and parallelism, and after obtaining the reconstruction value of the current image region, the reconstruction value of the current image region can also be adjusted, so that the reconstruction pixels are closer to the original pixels, thereby improving the encoding and decoding performance, reducing the quantization error when the quantization step is large, reducing the color block problem caused by the overall deviation, especially in flat areas, and reducing the subjective loss, that is, the lightweight compression method can achieve subjective losslessness and is easy to implement in hardware. [Brief description of the drawings]
[0013] [Figure 1A] FIG. 2 is a schematic diagram of the operating principle of the intra-frame prediction mode; [Figure 1B] FIG. 2 is a schematic diagram of the operating principle of the intra-frame prediction mode; [Figure 1C] FIG. 2 is a schematic diagram of the operating principle of the intra-frame prediction mode; [Figure 2A] 1 is a schematic diagram of a lightweight compression video coding framework. [Figure 2B] 1 is a schematic diagram of a lightweight compression video coding framework. [Figure 2C] 1 is a schematic diagram of a lightweight compression video coding framework. [Figure 2D] 1 is a schematic diagram of a lightweight compression video coding framework. [Diagram 3] 3 is a flowchart of an encoding method according to an embodiment of the present invention; [Figure 4] 4 is a flowchart of a decoding method according to an embodiment of the present invention; [Figure 5A] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 5B] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 5C] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 5D]FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6A] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6B] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6C] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6D] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6E] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6F] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6G] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6H] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6I] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 6J] FIG. 2 is a schematic diagram of image block division according to an embodiment of the present invention; [Figure 7A] FIG. 2 is a hardware structural diagram of a decoding device according to an embodiment of the present invention; [Figure 7B] FIG. 2 is a hardware structural diagram of an encoding device according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0014] The terms used in the embodiments of the present invention are merely for the purpose of describing a particular embodiment, and are not intended to limit the present invention. The singular forms "a," "the," and "the" used in the embodiments and claims of the present invention are intended to include the plural, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present invention is meant to include any or all possible combinations of one or more associated listed items. Although the embodiments of the present invention may use terms such as first, second, and third to describe various information, it should be understood that such information is not limited to these terms. These terms are used only to distinguish between information of the same type. For example, the first information may be referred to as the second information, and similarly, the second information may be referred to as the first information, depending on the context, without departing from the scope of the embodiments of the present invention. Also, the word "if..." used herein may be interpreted as "with...," "when...," or "in response to a determination."
[0015] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention provides a decoding and encoding method, apparatus and device thereof, which may relate to intra prediction, inter prediction and Intra Block Copy (IBC) prediction.
[0016] Intra prediction is to predict pixels of a current block using pixels of a coded block of a current image based on the spatial correlation of the video to achieve the reduction of spatial redundancy of the video. Intra prediction specifies multiple prediction modes, each prediction mode corresponds to one texture direction (except DC (Direct Current) mode), for example, when the texture of an image is horizontal, the horizontal prediction mode can predict the image information better.
[0017] Inter-frame prediction refers to predicting pixels of a current image using pixels of nearby encoded images based on the video temporal correlation since video sequences contain strong temporal correlation, and can effectively reduce the temporal redundancy of the video. All inter-frame prediction parts of video coding standards use block-based motion compensation technology, the main principle of which is to find one best matching block in the previous encoded image for each pixel block of the current image, and this process is called Motion Estimation (ME).
[0018] Intra-frame block copy means that the same frame is allowed to be referenced, and the reference data of the current block is obtained from the same frame. In the intra-frame block copy technique, the predicted value of the current block may be obtained by using the block vector of the current block. For example, based on the characteristic that there are many overlapping textures in the same frame in the screen content, the compression efficiency of the screen content sequence can be improved when the predicted value of the current block is obtained using the block vector.
[0019] A prediction pixel is a pixel value derived from an encoded / decoded pixel. The residual is obtained from the difference between the original pixel and the prediction pixel, and then the residual is transformed, quantized, and coded. An inter-frame prediction pixel is a pixel value derived from the reference frame of the current block. Since the pixel position is discrete, the final prediction pixel must be obtained by an interpolation operation. The closer the prediction pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two will be, and the higher the coding compression performance will be.
[0020] Intraframe prediction mode: In intraframe coding, motion compensation is performed using an intraframe prediction mode, i.e., a predicted value of a current block is obtained using an intraframe prediction mode, and the intraframe prediction mode is a mode that performs prediction using a reconstruction value and a predicted value of a current frame, etc. For example, the intraframe prediction mode includes, but is not limited to, a DC mode, a bilinear mode, an angle prediction mode (e.g., a horizontal angle prediction mode, a vertical angle prediction mode, etc., this angle prediction mode is not limited, and may be any angle, for example, a 33-angle mode, a 65-angle mode, etc.), an IBC mode, an ISC (Intra String Copy, Intraframe String Copy) mode, a Planar mode, a point-by-point prediction mode, etc.
[0021] The DC mode and the angle prediction mode may refer to FIG. 1A, where the DC mode is applicable to a large area flat region, and is a mode in which the average value of the surrounding pixels of the current block is used as the predicted value of the current block, and the angle prediction mode is a mode in which the value of the surrounding pixels of the current block pointed to by an angle is used as the predicted value of the current block. In FIG. 1A, a) is a schematic diagram of the DC mode, and the average value of the 16 reference pixels above "D" is used as the predicted value of "D". b) is a schematic diagram of the angle prediction mode 1, which represents 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 the angle prediction mode 2, d) is a schematic diagram of the angle prediction mode 3, e) is a schematic diagram of the angle prediction mode 4, f) is a schematic diagram of the angle prediction mode 5, and g) is a schematic diagram of the angle prediction mode 6.
[0022] The bilinear mode is a bilinear interpolation mode, and as shown in FIG. 1B, the prediction process of the bilinear mode is as follows: First, generate a predicted value at the lower right corner C position (weighted average of the upper right corner reference pixel A and the lower left corner reference pixel B), then generate a predicted value at the right boundary AC position (weighted average of the predicted values at the upper right corner reference pixel A and the lower right corner C position), then generate a predicted value at the lower boundary BC position (weighted average of the predicted values at the lower left corner reference pixel B and the lower right corner C position), and the predicted values of the remaining other internal pixel points (for example, the predicted value at the X position) are generated by the weighted average of the predicted value generated by the horizontal linear prediction and the predicted value generated by the vertical linear prediction. The predicted value generated by the horizontal linear prediction is the weighted average of the predicted value of the reference pixel L at the left corresponding position and the right boundary AC position, and the predicted value generated by the vertical linear prediction is the weighted average of the predicted value of the reference pixel T at the upper corresponding position and the lower boundary BC position.
[0023] Planar mode (or Plane mode) is applied to areas where pixel values change gradually, and uses two linear filters, horizontal and vertical, to predict the pixel value of the current block by averaging the pixels in the two directions. Planar mode is a gradation mode, and is an intra-frame prediction mode that obtains a predicted value using reference pixels at different positions and different weighting parameters.
[0024] In ISC mode, the pixels in the current block are arranged into multiple one-dimensional pixel groups in a certain scan order (usually horizontal raster scan order or vertical raster scan order), and a method such as motion estimation is performed on each pixel group to obtain a predicted value for the pixel group.
[0025] Point-by-point prediction modes are schematic diagrams of four kinds of point-by-point prediction modes of a 16*2 pixel block, as shown in FIG. 1C. Exemplarily, the point-by-point prediction modes of a 16*2 pixel block may include four kinds, and each kind of point-by-point prediction mode performs prediction using the entire 16*2 block as a basic unit. In FIG. 1C, ≡ represents obtaining a predicted value of a current pixel by averaging the reconstructed values of pixels on both sides, ||| represents obtaining a predicted value of a current pixel by averaging the reconstructed values of pixels on both sides, > represents directly using the reconstructed value of the left pixel as the predicted value of the current pixel, and ∨ represents directly using the reconstructed value of the upper pixel as the predicted value of the current pixel. As can be seen from FIG. 1C, for point-by-point prediction mode 1, the prediction of Group2 needs to depend on the reconstruction of Group1, and for point-by-point prediction mode 2, the prediction of Group1 needs to depend on the reconstruction of Group2.
[0026] Rate-Distortion Optimization (RDO) principle: There are two indices to evaluate the coding efficiency: rate and PSNR (Peak Signal to Noise Ratio). The smaller the bitstream, the higher the compression rate. The higher the PSNR, the better the quality of the reconstructed image. When selecting a mode, the discriminant is essentially a comprehensive evaluation of both. For example, the cost corresponding to a mode is: J(mode)=D+λ*R, where D represents distortion, and can usually be evaluated by the SSE (Sum of the Squared Errors) index, where SSE refers to the root mean square of the difference between the reconstructed image block and the source image. To consider the cost, the SAD index can be used, where SAD refers to the sum of the absolute value of the difference between the reconstructed image block and the source image, λ is the Lagrange multiplier, and R is the actual number of bits required to code the image block in the mode, including the sum of bits required to code mode information, motion information, residuals, etc. During mode selection, using a rate-distortion principle to compare coding modes can usually ensure optimal coding performance.
[0027] Rate control: Controlling the stability of the rate, typically by adjusting the quantization step to achieve the goal of stabilizing the rate.
[0028] Lightweight compression: Lightweight compression is an image coding method characterized by simple prediction. Lightweight compression is applied to scenes that require real-time performance, small cache, and parallelism. Lightweight compression has low compression efficiency, can use intraframe prediction, and has a low compression ratio (for example, generally less than 10 times). In the process of achieving lightweight compression, subjective losslessness is generally required, and hardware implementation is simple.
[0029] Light compression video coding framework: Figure 2A shows a schematic diagram of a video coding framework on the coding side, and the coding process of the embodiment of the present invention, i.e., light compression, may be realized by the video coding framework. The schematic diagram of the video decoding framework on the decoding side is similar to Figure 2A, so the description is omitted here, but the decoding process of the embodiment of the present invention may be realized by the video decoding framework.
[0030] Exemplarily, as shown in FIG. 2A, the video coding framework may include modules such as block division, prediction, transformation, quantization, rate control, entropy coder, inverse quantization, inverse transform, reconstruction, etc. At the coding side, the processing process of the coding side can be realized by the cooperation between these modules. In addition, the video decoding framework may include modules such as block division, prediction, transformation, quantization, rate control, entropy decoder, inverse quantization, inverse transform, reconstruction, etc., in which case, the rate control module belonging to the coding side may act on the decoding side to save the coding 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 transform, reconstruction, etc., in which case, there is no rate control module. At the decoding side, the processing process of the decoding side can be realized by the cooperation between these modules.
[0031] Illustratively, in a light compression scenario, the rate control technique is applied to one rate control unit, and the rate control unit is the action range of the rate control, which represents performing a rate control operation on the range corresponding to the rate control unit. For example, the rate control unit may be multiple image blocks, the rate control unit may be multiple pixel rows, the rate control unit may be the entire Slice, the rate control unit may be multiple pixel blocks inside the Slice, the rate control unit may be multiple pixel rows inside the Slice, etc. Of course, the above are only some examples of the rate control unit, and are not limited to this rate control unit. Based on this, operations such as prediction, transformation, quantization, etc. can be performed on the pixel blocks in each rate control unit, and the mode selection of the prediction part involves rate control, and after the reconstruction of the pixel block is completed, a reconstruction value adjustment operation can be performed.
[0032] The structure of the encoding side and the decoding side will be briefly described below. Figure 2B is a schematic block diagram of the encoding side for implementing an embodiment of the present invention. In Figure 2B, the encoding side may include a prediction processing unit, a residual calculation unit, a transform processing unit, a quantization unit, a coding processing unit, an inverse quantization unit, an inverse transform processing unit, a reconstruction unit, and a filter unit. In one example, the encoding side may further include a buffer and a decoded picture buffer (DPB), where the buffer is used to buffer the reconstructed image block output by the reconstruction unit, and the decoded picture buffer is used to buffer the filtered image block output by the filter unit.
[0033] The input of the encoding side (also called encoder) may be an image block of an image (also called image to be encoded), the image block is also called a current block or a block to be encoded, and the encoding side may further include a division unit (not shown) for dividing the image to be encoded into a plurality of image blocks. The encoding side may code the plurality of image blocks block by block to complete the encoding of the image to be encoded, for example, execute the encoding process for each image block. The prediction processing unit is used to receive or obtain an image block (which may be called a current image block to be encoded, a current block of the current image to be encoded, the image block may be understood as the true value of the image block) and reconstructed image data, and predict the current block based on related data in the reconstructed image data to obtain a prediction block of the current 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, and the mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode, and when the intra-frame prediction mode is selected, the prediction process may be performed by the intra-frame prediction unit, and when the inter-frame prediction mode is selected, the prediction process may be performed by the inter-frame prediction unit.
[0034] The residual calculation unit is used to calculate a residual between a true value of an image block and a predicted block of the image block to obtain a residual block, for example, the residual calculation unit may subtract, for each pixel, a pixel value of the predicted block from a pixel value of the image block.
[0035] The transform processing unit is used to perform a transform, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), on the residual block to obtain transform coefficients in a transform domain, where the transform coefficients may be called transform residual coefficients, and the transform residual coefficients may represent the residual block in the transform domain.
[0036] The quantization unit is used to quantize the transform coefficients by applying scalar quantization or vector quantization to obtain quantized transform coefficients, which may be referred to as quantized residual coefficients. The quantization process may reduce the bit depth for some or all of the transform coefficients. For example, during quantization, an n-bit transform coefficient may be truncated to an m-bit transform coefficient, where n is greater than m. The degree of quantization may be changed by adjusting a quantization parameter (QP). For example, in the case of scalar quantization, fine and coarse quantization may be achieved by applying different scales. A small quantization step corresponds to fine quantization, and a large quantization step corresponds to coarse quantization. The quantization parameter may indicate an appropriate quantization step.
[0037] The coding processing unit may code the quantized residual coefficients and some coding parameters, output the coded image data (i.e., the coding result of the current image block to be coded) and the coded coding parameters in the form of a coded bitstream, and transmit the coded bitstream to a decoder or store it for later transmission to a decoder or retrieval. The coding processing unit may also be used to code other syntax elements of the current image block, such as coding a prediction mode into the bitstream. The coding algorithms include, but are 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.
[0038] The inverse quantization unit is used to perform inverse quantization on the quantized residual coefficients to obtain inverse quantized coefficients, which is an inverse application of the quantization unit, e.g., may apply an inverse quantization scheme that corresponds to the quantization scheme applied by the quantization unit, based on or using the same quantization step as the quantization unit. The inverse quantized coefficients may be referred to as inverse quantized residual coefficients.
[0039] It should be understood that the inverse transform processing unit is used to perform an inverse transform on the inverse quantized coefficients, which is an inverse application of the transform processing unit. For example, the inverse transform may include an inverse discrete cosine transform (IDCT) or an inverse discrete sine transform (IDST) to obtain an inverse transform block in the pixel domain (also called the sample domain). The inverse transform block may be called an inverse transform inverse quantized block or an inverse transform residual block.
[0040] The reconstruction unit is used to add the inverse transformed block (i.e., the inverse transformed residual block) to the prediction block to obtain a reconstructed block in the sample domain, and the reconstruction unit may be an adder, for example, adding the sample values (i.e., pixel values) of the residual block and the sample values of the prediction block. The reconstructed block output by the reconstruction unit may later be used to predict other image blocks, such as in an intra-frame prediction mode.
[0041] The filter unit (or simply referred to as "filter") is used to filter the reconstructed block to obtain a filtered block, so as to smooth pixel transformation or improve image quality. The filter unit may be a loop filter unit intended to represent one or more loop filters, for example, the filter unit may be a deblocking filter, a sample-adaptive offset (SAO) filter, or other filters, such as a bilateral filter, an adaptive loop filter (ALF), a sharpening or smoothing filter, a collaborative filter, etc. In one example, the filtered block output by the filtering unit may be used later to predict other image blocks, such as used in an inter-frame prediction mode, without being limited thereto.
[0042] FIG. 2C is a schematic block diagram of a decoding side (also called a decoder) for implementing an embodiment of the present invention. The decoder is used, for example, to receive coded image data (i.e., coded bitstream, for example, including coded bitstream of image blocks and related syntax elements) coded by the 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 embodiments, the decoder may perform a decoding process that is approximately the reverse of the encoding process described for the encoder of FIG. 2B. In one example, the decoder may further include a buffer and a decoded image buffer, where the buffer is used to buffer the reconstructed image block output by the reconstruction unit, and the decoded image buffer is used to buffer the filtered image block output by the filter unit.
[0043] The decoding unit is used to perform decoding on the encoded image data to obtain quantized transform coefficients and / or decoded coding parameters (e.g., the coding parameters may include any one or more of inter-frame prediction parameters, intra-frame prediction parameters, filter parameters, and / or other syntax elements). The decoding unit is further used to forward the decoded coding parameters to a prediction processing unit, so that the prediction processing unit performs a prediction process based on the coding parameters. The function of the inverse quantization unit may be the same as that of the inverse quantization unit of the encoder, and is used to inverse quantize the quantized transform coefficients decoded by the decoding unit.
[0044] The functionality of the inverse transform processing unit may be the same as that of the inverse transform processing 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 transform coefficients to obtain an inverse transform block (also called an inverse transform residual block), which is the residual block of the current image block in the pixel domain.
[0045] The prediction processing unit is used to receive or obtain encoded image data (e.g., the encoded bitstream of the current image block) and reconstructed image data, and the prediction processing unit may further receive or obtain prediction-related parameters and / or information regarding the selected prediction mode (i.e., the decoded encoding parameters), for example from the decoding unit, and predict the current image block based on the associated data in the reconstructed image data and the decoded encoding parameters to obtain a prediction block of the current image block.
[0046] In one example, the prediction processing unit may include an inter-frame prediction unit, an intra-frame prediction unit, and a mode selection unit, where the mode selection unit is used to select an intra-frame prediction mode or an inter-frame prediction mode, and when the intra-frame prediction mode is selected, the prediction process is performed by the intra-frame prediction unit, and when the inter-frame prediction mode is selected, the prediction process is performed by the inter-frame prediction unit.
[0047] The functionality of the reconstruction unit (e.g., an adder) may be the same as that of the reconstruction unit of the encoder, which is used to add an inverse transform block (i.e., an inverse transform residual block) to a prediction block to obtain a reconstructed block in the sample domain, e.g., by adding sample values of the inverse transform residual block and sample values of the prediction block.
[0048] The filter unit is used for filtering the reconstructed block to obtain a filtered block, where the filtered block is the decoded image block.
[0049] In addition, in the encoder and decoder of the embodiment of the present invention, the processing result for a certain process may be further processed before being output to the next process. For example, after a process such as interpolation filtering, motion vector derivation, or filtering, further operations such as clip or shift are performed on the processing result of the corresponding process.
[0050] Based on the encoder and decoder, an embodiment of the present invention provides a possible implementation method of encoding / decoding, as shown in FIG. 2D, which is a schematic flowchart of the encoding / decoding provided by an embodiment of the present invention, the implementation method of the encoding and decoding includes processes (1) to (5) (in the figure, circle 1 corresponds to (1), circle 2 corresponds to (2)...), and processes (1) to (5) may be performed by the above-mentioned decoder and / or encoder. Process (1): Divide one frame of an image into one or more non-overlapping parallel encoding units, which are not dependent on each other and can be encoded and decoded completely in parallel and independently, such as parallel encoding unit 1 and parallel encoding unit 2 shown in FIG.
[0051] Process (2): For each parallel coding unit, it may be further 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 the independent coding unit is w_lcu and the height is h_lcu. If the parallel coding unit is divided into one 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 must be greater than the height (except for the edge region).
[0052] 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), for example, 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, etc.
[0053] As one 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 divided equally into four independent coding units, and if the size of the parallel coding unit is 288×10, the parallel coding unit may be divided into two 128×4+one 32×4 independent coding units in the first and second rows, and two 128×2+one 32×2 independent coding units in the third row. Note that the independent coding unit may include three components of luminance Y, chromaticity Cb, and chromaticity Cr, three components of red (R), green (G), and blue (B), or three components of luminance Y, chromaticity Co, and chromaticity Cg, or may include only one of these components. If the independent coding unit includes three components, the sizes of these three components may be completely the same or different, specifically related to the input format of the image.
[0054] Process (3): For each independent coding unit, it may be further divided into one or more non-overlapping coding units, and each coding unit within the independent coding unit may be dependent on each other, for example, multiple coding units may perform pre-coding / decoding by referencing each other.
[0055] When the size of the coding unit and the independent coding unit is the same (i.e., when the independent coding unit is divided into only one coding unit), the size may be any size described in process (2). When the independent coding unit is divided into multiple coding units that do not overlap each other, possible division examples include horizontal equal division (the height of the coding unit is the same as the independent coding unit, but the width is different, which may be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), vertical equal division (the width of the coding unit is the same as the independent coding unit, but the height is different, which may be 1 / 2, 1 / 4, 1 / 8, 1 / 16, etc.), horizontal and vertical equal division (quadtree division), etc., and horizontal equal division is preferred.
[0056] The width of the coding unit is w_cu and the height is h_cu, and the width must be greater than the height (except for edge regions). Usually, the coding unit may be a fixed w_cu×h_cu, where w_cu and h_cu are both 2 to the power of N (N is 0 or more), such as 16×4, 8×4, 16×2, 8×2, 8×1, 4×1, etc. As one possible example, the coding unit may be a fixed 16×4. If the size of the independent coding unit is 64×4, the independent coding unit may be divided equally into four coding units, and if the size of the independent coding unit is 72×4, it is divided into four 16×4+1 8×4 coding units. Note that the coding unit may include three components of luminance Y, chrominance Cb, and chrominance Cr (or three components of red R, green G, and blue B, or luminance Y, chrominance Co, and chrominance Cg), or may include only one of these components. If it contains three components, the sizes of these components may be exactly the same or different, specifically related to the input format of the image.
[0057] Note that process (3) may be an optional step in the encoding / decoding method, and the encoder / decoder may perform encoding / decoding on the residual coefficients (or residual values) of the independent coding units obtained in process (2).
[0058] Process (4): For the coding unit, it may be further divided into one or more non-overlapping prediction groups (PG), where PG may be abbreviated as Group, and each PG may be encoded and decoded according to a selected prediction mode, and a predicted value of the PG is obtained to form a predicted value of the entire coding unit, and a residual value of the coding unit may be obtained based on the predicted value and original value of the coding unit.
[0059] Process (5): According to the residual value of the coding unit, the coding unit is grouped, one or more non-overlapping residual blocks (RBs) are obtained, and the residual coefficients of each RB are coded and decoded according to the selected mode to form a residual coefficient stream. Specifically, the residual coefficients can be divided into those that perform transformation and those that do not perform transformation.
[0060] Here, the selected mode of the coding and decoding method of the residual coefficient in process (5) may include, but is not limited to, any of semi-fixed-length coding mode, exponential Golomb coding method, Golomb-Rice coding method, truncated unary coding method, run-length coding method, and a method of directly coding the original residual value. For example, the encoder may directly code the coefficients in the RB. In another example, the encoder may perform a transform such as DCT, DST, or Hadamard transform on the residual block, and then encode the transformed coefficients. As one possible example, when the RB is relatively small, the encoder may directly perform uniform quantization on each coefficient in the RB and then perform binary coding. When the RB is relatively large, it may be further divided into multiple coefficient groups (CGs), and uniform quantization may be performed on each CG and then perform binary coding. In some embodiments of the present invention, the coefficient group (CG) and the quantization group (QG) may be the same, but of course the coefficient group and the quantization group may be different.
[0061] Hereinafter, the coding of the residual coefficient in the semi-fixed length coding method will be described as an example. First, the maximum value of the residual absolute value in one RB block is defined as a modified maximum (mm). Next, the number of coding bits of the residual coefficient in the RB block is determined (the number of coding bits of the residual coefficient in the same RB block is the same). For example, if the critical limit (CL) of the current RB block is 2 and the current residual coefficient is 1, 2 bits are required to code the residual coefficient 1, which is represented as 01. If the CL of the current RB block is 7, this represents coding an 8-bit residual coefficient and a 1-bit code bit. The determination of CL is to find the minimum T value that satisfies that all the residuals of the current sub-block are within the range of [-2^(T-1), 2^(T-1)]. When two boundary values of -2^(T-1) and 2^(T-1) exist at the same time, T is increased by 1, that is, T+1 bits are required to code all the residuals of the current RB block, when only one of the two boundary values of -2^(T-1) and 2^(T-1) exists, one Trailing bit is coded to determine whether the boundary value is -2^(T-1) or 2^(T-1), when neither -2^(T-1) nor 2^(T-1) exists in all the residuals, there is no need to code the Trailing bit. In addition, for some special cases, the encoder may directly code the original value of the image instead of the residual value.
[0062] For example, lightweight compression is an image coding method characterized by simple prediction, and lightweight compression is applied to scenes that require real-time performance, small cache, and parallelism. However, in the coding process of lightweight compression, when the quantization step is large, large quantization errors often occur, and the overall deviation leads to color blocks, especially in flat areas, causing subjective loss.
[0063] In the present invention, subjective loss refers to the ability of the human eye to perceive the difference between the reconstructed image and the source image, and may be determined by alternating playback of the reconstructed image and the source image at a particular frequency (e.g., 8 Hz) at an appropriate observation distance.
[0064] In view of the above problems, the embodiment of the present invention provides a light-compression filtering method applicable to scenes requiring real-time performance, small cache, and parallelism, and after obtaining the reconstruction value of the current image region, the reconstruction value of the current image region can be adjusted, so that the reconstruction pixels are closer to the original pixels, leading to improved encoding and decoding performance. It can reduce the quantization error when the quantization step is large, reduce the color block problem caused by the overall deviation, especially in flat areas, reduce the subjective loss, and improve the subjective performance, and can achieve subjective lossless in the light-compression encoding process, and is easy to implement in hardware.
[0065] Hereinafter, the decoding method and the encoding method according to the embodiment of the present invention will be described in detail with reference to some specific embodiments.
[0066] Example 1: An embodiment of the present invention provides an encoding method, and FIG. 3 is a schematic flowchart of the encoding method, which may be applied to an encoding side (which may be called a video encoder) and may include the following steps:
[0067] In step 301, it is determined whether reconstruction value adjustment needs to be performed for the current image region based on the feature information corresponding to the current image region.
[0068] In one possible embodiment, an explicit method may be used to determine whether or not a reconstruction value adjustment needs to be made to the current image region, and for ease of distinction, the feature information related to the explicit method is referred to as the first type of feature information.
[0069] For example, a first type of feature information corresponding to a current image region may be obtained, and if the first type of feature information corresponding to the current image region satisfies a specific condition (e.g., a first specific condition), it may be determined whether or not a reconstruction value adjustment needs to be performed on the current image region, and based on the determination result, a flag bit corresponding to the adjustment control switch may be encoded into a bit stream corresponding to the current image region, the flag bit being used to indicate whether or not a reconstruction value adjustment needs to be performed on the current image region. If the first type of feature information corresponding to the current image region does not satisfy the specific condition, it may be determined that no reconstruction value adjustment needs to be performed on the current image region, and the flag bit corresponding to the adjustment control switch may not be encoded into a bit stream corresponding to the current image region.
[0070] Here, when the first type of feature information satisfies a specific condition, when it is determined that the reconstruction value adjustment needs to be performed on the current image region, a flag bit corresponding to the adjustment control switch is encoded in the bit stream corresponding to the current image region, the flag bit being a first value, the first value representing that the reconstruction value adjustment needs to be performed on the current image region. When it is determined that the reconstruction value adjustment does not need to be performed on the current image region, a flag bit corresponding to the adjustment control switch is encoded in the bit stream corresponding to the current image region, the flag bit being a second value, the second value representing that the reconstruction value adjustment does not need to be performed on the current image region. The first value and the second value may be set based on experience, and are not limited thereto, for example, the first value is 1 and the second value is 0.
[0071] For the process of "determining whether reconstruction value adjustment needs to be performed on the current image region", if the cost value of turning on reconstruction value adjustment for the current image region is less than the cost value of turning off reconstruction value adjustment for the current image region, it is determined that reconstruction value adjustment needs to be performed on the current image region; otherwise, it is determined that reconstruction value adjustment does not need to be performed on the current image region.
[0072] For example, the current image area may include one image block, or the current image area may include multiple consecutive image blocks. The bitstream corresponding to the current image area is the bitstream related to the current image area, i.e., the bitstream contains information for processing the current image area. There is no limitation on the bitstream corresponding to the current image area.
[0073] Exemplarily, the first type of feature information corresponding to the current image region may include, but is not limited to, at least one of a prediction mode, a data amount in a bitstream buffer, and a quantization step. Based on this, if the first type of feature information includes a prediction mode, when the prediction mode corresponding to the current image region is a specified prediction mode, the prediction mode is determined to satisfy a specific condition, otherwise the prediction mode is determined to not satisfy the specific condition. If the first type of feature information includes a data amount in a bitstream buffer, when the data amount in the bitstream buffer is within a predetermined data amount interval, the data amount in the bitstream buffer is determined to satisfy a specific condition, otherwise the data amount in the bitstream buffer is determined to not satisfy the specific condition. If the first type of feature information includes a quantization step, when the quantization step corresponding to the current image region is within a predetermined step interval, the quantization step is determined to satisfy a specific condition, otherwise the quantization step is determined to not satisfy the specific condition.
[0074] When the first type of feature information includes a prediction mode and a data amount in a bitstream buffer, the first type of feature information corresponding to the current image region is determined to satisfy the specific condition only if the prediction mode satisfies the specific condition and the data amount in the bitstream buffer also satisfies the specific condition, otherwise, the first type of feature information corresponding to the current image region is determined to not satisfy the specific condition. Or, when the first type of feature information includes a quantization step and a data amount in the bitstream buffer, the first type of feature information corresponding to the current image region is determined to satisfy the specific condition only if the quantization step satisfies the specific condition and the data amount in the bitstream buffer also satisfies the specific condition, otherwise, the first type of feature information corresponding to the current image region is determined to not satisfy the specific condition. Or, when the first type of feature information includes a prediction mode and a quantization step, the first type of feature information corresponding to the current image region is determined to satisfy the specific condition only if the prediction mode satisfies the specific condition and the quantization step also satisfies the specific condition, otherwise, the first type of feature information corresponding to the current image region is determined to not satisfy the specific condition. Alternatively, when the first type of feature information includes a prediction mode, an amount of data in the bitstream buffer, and a quantization step, the first type of feature information corresponding to the current image area is determined to satisfy the specific condition only if the prediction mode satisfies a specific condition, the amount of data in the bitstream buffer satisfies a specific condition, and the quantization step also satisfies a specific condition, and otherwise, the first type of feature information corresponding to the current image area is determined to not satisfy the specific condition.
[0075] Of course, the above are merely some examples of the first type of feature information, and the present embodiment does not limit the first type of feature information.
[0076] In the above embodiment, the specified prediction mode may be one or more of normal intra prediction modes, where the normal intra prediction mode includes DC mode, or the normal intra prediction mode includes DC mode, horizontal prediction mode, and vertical prediction mode, or the normal intra prediction mode includes DC mode and angular prediction mode, or the normal intra prediction mode includes DC mode, angular prediction mode, and planar mode, or the normal intra prediction mode includes DC mode, angular prediction mode, and bilinear mode, or the normal intra prediction mode includes DC mode, angular prediction mode, planar mode, and bilinear mode.
[0077] In another possible embodiment, an implicit method may be used to determine whether or not a reconstruction value adjustment needs to be made to the current image region, and for ease of distinction, the feature information related to the implicit method is referred to as the second type of feature information.
[0078] For example, a second type of feature information corresponding to the current image region is obtained, and if the second type of feature information corresponding to the current image region satisfies a specific condition (e.g., a second specific condition), it is determined that reconstruction value adjustment is necessary for the current image region, and if the second type of feature information corresponding to the current image region does not satisfy the specific condition, it is determined that reconstruction value adjustment is not necessary for the current image region.
[0079] The specific implementation of the implicit method can be seen in the subsequent embodiments, so the description is omitted here.
[0080] In step 302, if it is determined that a reconstruction value adjustment needs to be performed for the current image region, an adjustment parameter corresponding to the current image region is obtained, and the adjustment parameter is used to adjust the reconstruction value of the current image region.
[0081] In step 303, the adjustment parameters corresponding to the current image region are encoded into a bitstream corresponding to the current image region.
[0082] For example, when the adjustment parameters corresponding to the current image region include multiple adjustment values, all or some of the adjustment values (i.e., some of the multiple adjustment values) may be encoded into the bitstream corresponding to the current image region.
[0083] Here, encoding all or some of the adjustment values into the bitstream corresponding to the current image area includes, but is not limited to, sorting the adjustment values according to the encoding order of the adjustment values, sequentially traversing the adjustment values based on the sorting result, and for a currently traversed adjustment value, if the current rate is smaller than a predetermined rate value when the adjustment value is encoded into the bitstream corresponding to the current image area, encoding the adjustment value into the bitstream corresponding to the current image area, and then traversing the next adjustment value of the adjustment value, i.e., the next adjustment value is the currently traversed adjustment value; otherwise, prohibiting encoding the adjustment value into the bitstream corresponding to the current image area and stopping the traversal of the next adjustment value of the adjustment value.
[0084] For example, the current image region may correspond to a plurality of pixel groups, and the adjustment parameter corresponding to the current image region may include a plurality of adjustment values, and the plurality of adjustment values may include adjustment values corresponding to K pixel groups, and the K pixel groups may be all or a portion of the plurality of pixel groups (i.e., all pixel groups in the current image region).
[0085] Based on this, M adjustment values corresponding to the K pixel groups may be encoded into a bitstream corresponding to the current image area, where M may be a positive integer or may be less than or equal to K, and the M adjustment values may be determined based on the adjustment values corresponding to the K pixel groups. In addition, adjustment value grouping indication information may be encoded into the bitstream corresponding to the current image area, where the adjustment value grouping indication information is used to indicate a matching relationship between the M adjustment values and the K pixel groups.
[0086] For example, when K pixel groups correspond to the same adjustment value, the adjustment value grouping instruction information may be a fourth value, where the fourth value indicates that the K pixel groups correspond to the same adjustment value, and when K pixel groups correspond to K adjustment values, the adjustment value grouping instruction information may be a fifth value, where the fifth value indicates that the K pixel groups correspond to K adjustment values.
[0087] For example, when the K pixel groups are a part of the pixel groups, the encoding side may further encode pixel group indication information corresponding to the K pixel groups into the bit stream corresponding to the current image area, and the bit stream corresponding to the current image area includes the adjustment value of the pixel group corresponding to the pixel group indication information.When the K pixel groups are all pixel groups among the multiple pixel groups, the encoding side does not need to encode pixel group indication information corresponding to the pixel groups into the bit stream corresponding to the current image area, and the bit stream corresponding to the current image area includes the adjustment value of all pixel groups, and in this case, there is no need to encode pixel group indication information corresponding to the pixel groups into the bit stream.Here, when the K pixel groups are a part of the multiple pixel groups, the pixel group indication information is used to distinguish the pixel group of the target category from the pixel groups of all categories, that is, to distinguish the K pixel groups from all pixel groups.
[0088] Exemplarily, when the current image region corresponds to multiple channels, for each pixel group, the adjustment value corresponding to the pixel group may include adjustment values of multiple channels or a single channel corresponding to the pixel group, and the multiple channels or the single channel may include at least one of a Y channel, a U channel, a V channel, a Co channel, a Cg channel, an R channel, a G channel, a B channel, an alpha channel, an IR channel, a D channel, and a W channel. 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, and a B channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an alpha channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a D channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel. Here, in addition to the RGB color photosensitive channels, there may be an IR channel (infrared or near-infrared photosensitive channel), a D channel (a dark light channel through which mainly infrared or near-infrared light passes), and a W channel (a full-color photosensitive channel), and the channels are different for different sensors, for example, the sensor types may be RGB sensors, RGBIR sensors, RGBW sensors, RGBIRW sensors, RGBD sensors, RGBDW sensors, etc.
[0089] For example, the determination of the plurality of pixel groups corresponding to the current image region may include, but is not limited to, the following: determine the plurality of pixel groups corresponding to the current image region according to the pre-adjustment reconstruction value of each pixel point; determine the classification value of the pixel point according to the pre-adjustment reconstruction value of the pixel points around the pixel point, and determine the plurality of pixel groups corresponding to the current image region according to the classification value of each pixel point; determine the plurality of pixel groups corresponding to the current image region according to the pixel position of each pixel point; determine the plurality of pixel groups corresponding to the current image region according to the prediction mode of the current image region; or determine the plurality of pixel groups corresponding to the current image region according to the scanning order of the current image region. Of course, the above methods are merely examples and are not limited thereto.
[0090] Here, when determining multiple pixel groups corresponding to the current image region based on the prediction mode of the current image region, the number of pixel group divisions, filtering area, and division method may be determined based on the prediction mode of the current image region, and multiple pixel groups corresponding to the current image region may be determined based on the number of divisions, the filtering area, and the division method.
[0091] For example, if the prediction mode of the current image region is a horizontal prediction mode, the division number of the pixel group is determined to be a first division number, the filtering area of the pixel group is determined to be a first filtering area, and the division method is determined to be a first size specification; if the prediction mode of the current image region is not a horizontal prediction mode, the division number of the pixel group is determined to be a second division number, the filtering area of the pixel group is determined to be a second filtering area, and the division method is determined to be a second size specification.
[0092] For example, when the current image area is a 16*2 image block (i.e., one image block), when dividing a plurality of pixel groups according to a prediction mode, if the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area are divided into four pixel groups, each of which has a size of 8*1, or all pixel points of the current image area are divided into two pixel groups, each of which has a size of 16*1. If the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area are divided into four pixel groups, each of which has a size of 4*2.
[0093] For example, if the current image area is a 16*2 image block, regardless of the prediction mode of the current image area, all pixel points of the current image area may be directly divided into four pixel groups, and the size of each pixel group is 4*2.
[0094] In the above embodiment, the range of adjustment values may be determined based on the quantization step.
[0095] By way of example, the above execution order is merely an example for ease of description, and in actual application, the execution order between steps may be changed, and this execution order is not limited. In addition, in other embodiments, the steps of the corresponding method are not necessarily performed according to the order shown and described herein, and the method may include more or less steps than those described herein. In addition, a single step described in this specification may be decomposed and described as multiple steps in other embodiments, and multiple steps described in this specification may be combined and described as a single step in other embodiments.
[0096] As can be seen from the above technical solutions, the embodiments of the present invention provide a lightweight compression method applicable to scenes requiring real-time performance, small cache, and parallelism, and after obtaining the reconstruction value of the current image region, the reconstruction value of the current image region can also be adjusted, so that the reconstruction pixels are closer to the original pixels, thereby improving the encoding and decoding performance, reducing the quantization error when the quantization step is large, reducing the color block problem caused by the overall deviation, especially in flat areas, and reducing the subjective loss, that is, the lightweight compression method can achieve subjective losslessness and is easy to implement in hardware.
[0097] Example 2: An embodiment of the present invention provides a decoding method, and FIG. 4 is a schematic flowchart of the decoding method, which may be applied to a decoding side (which may be called a video decoder) and may include the following steps:
[0098] In step 401, it is determined whether reconstruction value adjustment needs to be performed for the current image region based on the feature information corresponding to the current image region.
[0099] In one possible embodiment, an explicit method may be used to determine whether or not a reconstruction value adjustment needs to be made to the current image region, and for ease of distinction, the feature information related to the explicit method is referred to as the first type of feature information.
[0100] For example, a first type of feature information corresponding to a current image region may be obtained, and if the first type of feature information corresponding to the current image region satisfies a specific condition (e.g., a first specific condition), a flag bit corresponding to an adjustment control switch may be obtained from a bit stream corresponding to the current image region, and whether or not reconstruction value adjustment is required for the current image region may be determined based on the flag bit. Here, if the flag bit is a first value, it may be determined that reconstruction value adjustment is required for the current image region, and if the flag bit is a second value, it may be determined that reconstruction value adjustment is not required for the current image region. Alternatively, if the first type of feature information corresponding to the current image region does not satisfy the specific condition, it may be directly determined that reconstruction value adjustment is not required for the current image region, and there is no need to obtain a flag bit corresponding to an adjustment control switch from a bit stream corresponding to the current image region.
[0101] For example, the current image area may include one image block, or the current image area may include multiple consecutive image blocks. The bitstream corresponding to the current image area is the bitstream related to the current image area, i.e., the bitstream contains information for processing the current image area. There is no limitation on the bitstream corresponding to the current image area.
[0102] Exemplarily, the first type of feature information corresponding to the current image region may include, but is not limited to, at least one of a prediction mode, a data amount in a bitstream buffer, and a quantization step. Based on this, if the first type of feature information includes a prediction mode, when the prediction mode corresponding to the current image region is a specified prediction mode, the prediction mode is determined to satisfy a specific condition, otherwise the prediction mode is determined to not satisfy the specific condition. If the first type of feature information includes a data amount in a bitstream buffer, when the data amount in the bitstream buffer is within a predetermined data amount interval, the data amount in the bitstream buffer is determined to satisfy a specific condition, otherwise the data amount in the bitstream buffer is determined to not satisfy the specific condition. If the first type of feature information includes a quantization step, when the quantization step corresponding to the current image region is within a predetermined step interval, the quantization step is determined to satisfy a specific condition, otherwise the quantization step is determined to not satisfy the specific condition.
[0103] In the above embodiments, the specified prediction mode may be one or more of normal intra-frame prediction modes, where the normal intra-frame prediction mode includes DC mode, or the normal intra-frame prediction mode includes DC mode, horizontal prediction mode, and vertical prediction mode, or the normal intra-frame prediction mode includes DC mode and angular prediction mode, or the normal intra-frame prediction mode includes DC mode, angular prediction mode, and planar mode, or the normal intra-frame prediction mode includes DC mode, angular prediction mode, and bilinear mode, or the normal intra-frame prediction mode includes DC mode, angular prediction mode, planar mode, and bilinear mode.
[0104] In another possible embodiment, an implicit method may be used to determine whether or not a reconstruction value adjustment needs to be made to the current image region, and for ease of distinction, the feature information related to the implicit method is referred to as the second type of feature information.
[0105] For example, a second type of feature information corresponding to the current image region is obtained, and if the second type of feature information corresponding to the current image region satisfies a specific condition (e.g., a second specific condition), it is determined that reconstruction value adjustment is necessary for the current image region, and if the second type of feature information corresponding to the current image region does not satisfy the specific condition, it is determined that reconstruction value adjustment is not necessary for the current image region.
[0106] The specific implementation of the implicit method can be seen in the subsequent embodiments, so the description is omitted here.
[0107] In step 402, if it is determined that a reconstruction value adjustment needs to be performed for the current image region, adjustment parameters corresponding to the current image region are obtained from the bitstream corresponding to the current image region, and the adjustment parameters are used to adjust the reconstruction values.
[0108] In step 403, the reconstruction values of the current image region are adjusted based on the adjustment parameters.
[0109] In one possible embodiment, the adjustment parameter corresponding to the current image region may include a plurality of adjustment values, the current image region may correspond to a plurality of pixel groups, the plurality of adjustment values may include adjustment values corresponding to K pixel groups, and the K pixel groups may be all or a portion of the plurality of pixel groups. Based on this, adjusting the reconstruction value of the current image region based on the adjustment parameter may include, but is not limited to, adjusting the reconstruction value of a pixel point in the K pixel groups based on the plurality of adjustment values, for example, K may be a positive integer equal to or greater than 1. Here, adjusting the reconstruction value of a pixel point in the K pixel groups based on the plurality of adjustment values may include, but is not limited to, for each pixel group among the K pixel groups, when the plurality of adjustment values include an adjustment value corresponding to the pixel group, adjusting the reconstruction value of each pixel point in the pixel group based on the adjustment value corresponding to the pixel group, to obtain an adjusted reconstruction value of each pixel point in the pixel group.
[0110] For example, if the K pixel groups are some of the multiple pixel groups, the decoding side may further obtain pixel group indication information corresponding to the K pixel groups from a bitstream corresponding to the current image area, select K pixel groups from all pixel groups based on the pixel group indication information, and associate multiple adjustment values with the K pixel groups. In this way, it is possible to adjust the reconstructed values of pixel points in the K pixel groups based on the multiple adjustment values, i.e., to adjust only the reconstructed values of pixel points in the K pixel groups.
[0111] Here, when the K pixel groups are a portion of a plurality of pixel groups, the pixel group indication information is used to distinguish the pixel group of the target category from the pixel groups of all categories, i.e., to distinguish the K pixel groups from all pixel groups.
[0112] Here, for each pixel group, the adjustment value corresponding to the pixel group may include adjustment values of a plurality of channels corresponding to the pixel group, and the plurality of channels may include at least one of 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. For example, the plurality of channels may include a Y channel, a U channel, and a V channel, or the plurality of channels may include an R channel, a G channel, and a B channel, or the plurality of channels may include an R channel, a G channel, and a B channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and an alpha channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and an IR channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and a W channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and an IR channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and a W channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and a D channel, or the plurality of channels may include an R channel, a G channel, and a B channel, and a W channel.
[0113] Exemplarily, adjustment value grouping indication information for indicating a mapping relationship between the adjustment value and the K pixel groups may be obtained from a bitstream corresponding to the current image area, and M adjustment values may be analyzed from the bitstream corresponding to the current image area based on the adjustment value grouping indication information, where M is a positive integer and M is less than or equal to K, and adjustment values corresponding to the K pixel groups may be determined based on the M adjustment values. For example, when the adjustment value grouping indication information is a fourth value, M is 1, in this case, the decoding side may determine that the K pixel groups correspond to one adjustment value, and when the adjustment value grouping indication information is a fifth value, M is K, in this case, the decoding side may determine that the K pixel groups correspond to the K adjustment values.
[0114] By way of example, if the current image region corresponds to multiple channels, parsing the M adjustment values from the bitstream corresponding to the current image region may include, for each channel, parsing one or more adjustment values corresponding to that channel from the bitstream corresponding to the current image region.
[0115] Exemplarily, the determination of the plurality of pixel groups corresponding to the current image region may include, but is not limited to, determining the plurality of pixel groups corresponding to the current image region according to the pre-adjustment reconstruction value of each pixel point, or determining the classification value of the pixel point according to the pre-adjustment reconstruction value of the pixel point surrounding the pixel point, and determining the plurality of pixel groups corresponding to the current image region according to the classification value of each pixel point, or determining the plurality of pixel groups corresponding to the current image region according to the pixel position of each pixel point, or determining the plurality of pixel groups corresponding to the current image region according to the prediction mode of the current image region, or determining the plurality of pixel groups corresponding to the current image region according to the scanning order of the current image region. Of course, the above manner is merely exemplary and is not limited thereto.
[0116] Here, when determining multiple pixel groups corresponding to the current image region based on the prediction mode of the current image region, the division number of the pixel group, the filtering area, and the division method may be determined based on the prediction mode of the current image region, and then the multiple pixel groups corresponding to the current image region are determined based on the division number, the filtering area, and the division method.
[0117] For example, determining the division number of the pixel group, the filtering area, and the partitioning method based on the prediction mode of the current image region may include, if the prediction mode of the current image region is a horizontal prediction mode, determining that the division number of the pixel group is a first division number, determining that the filtering area of the pixel group is a first filtering area, and determining that the partitioning method is a first size specification, and, if the prediction mode of the current image region is not the horizontal prediction mode, determining that the division number of the pixel group is a second division number, determining that the filtering area of the pixel group is a second filtering area, and determining that the partitioning method is a second size specification.
[0118] For example, when the current image area is a 16*2 image block (i.e., one image block), when dividing a plurality of pixel groups according to a prediction mode, if the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area are divided into four pixel groups, each of which has a size of 8*1, or all pixel points of the current image area are divided into two pixel groups, each of which has a size of 16*1. If the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area are divided into four pixel groups, each of which has a size of 4*2.
[0119] For example, if the current image area is a 16*2 image block, regardless of the prediction mode of the current image area, all pixel points of the current image area may be directly divided into four pixel groups, and the size of each pixel group is 4*2.
[0120] In the above embodiment, the range of adjustment values may be determined based on the quantization step.
[0121] As can be seen from the above technical solutions, the embodiments of the present invention provide a lightweight compression method applicable to scenes requiring real-time performance, small cache, and parallelism, and after obtaining the reconstruction value of the current image region, the reconstruction value of the current image region can also be adjusted, so that the reconstruction pixels are closer to the original pixels, thereby improving the encoding and decoding performance, reducing the quantization error when the quantization step is large, reducing the color block problem caused by the overall deviation, especially in flat areas, and reducing the subjective loss, that is, the lightweight compression method can achieve subjective losslessness and is easy to implement in hardware.
[0122] Example 3: For Example 1 and Example 2, it may be determined whether reconstruction value adjustment is required for the current image area. For example, for the encoding side, after encoding a bit stream of N encoding blocks (N≧1), the encoding side may take P encoding blocks (P≦N) among them as the current image area and determine whether reconstruction value adjustment is required for the current image area. For the decoding side, after analyzing a bit stream of N decoded blocks (N≧1), the decoding side may take P decoded blocks (corresponding to the P encoding blocks of the encoding side) among them as the current image area and determine whether reconstruction value adjustment is required for the current image area.
[0123] Exemplarily, it may be determined whether a prediction value adjustment needs to be performed for the current image region, i.e., the prediction value of the current image region may be adjusted according to the adjustment parameters corresponding to the current image region, and the prediction value adjustment process is similar to the reconstruction value adjustment process, and the description is omitted in this embodiment. Exemplarily, it may be determined whether a residual value adjustment needs to be performed for the current image region, i.e., the residual value of the current image region may be adjusted according to the adjustment parameters corresponding to the current image region, and the residual value adjustment process is similar to the reconstruction value adjustment process, and the description is omitted in this embodiment.
[0124] Exemplarily, the following scheme may be adopted to determine whether reconstruction value adjustment needs to be performed for the current image region.
[0125] Explicit syntax method: The encoding side encodes a flag bit corresponding to the adjustment control switch into the bitstream, and the decoding side analyzes the flag bit corresponding to the adjustment control switch from the bitstream and determines whether reconstruction value adjustment needs to be performed for the current image area based on the flag bit.
[0126] The implementation process of the explicit syntax method will be described below with reference to a specific application scenario. The process may include:
[0127] In step S11, the encoding side determines whether the first type of feature information corresponding to the current image region satisfies a first specific condition.
[0128] If not, step S12 may be executed; if yes, step S13 may be executed.
[0129] For example, the first type of feature information corresponding to the current image region may include, but is not limited to, at least one of prediction mode, data amount in the bitstream buffer, and quantization step. Of course, the above are only some examples of the first type of feature information, and are not limited thereto. Hereinafter, the prediction mode, data amount in the bitstream buffer, and quantization step will be described as examples.
[0130] Case 1: The first type of feature information may include a prediction mode. If the prediction mode corresponding to the current image region is a designated prediction mode, it may be determined that the first type of feature information satisfies a first specific condition, otherwise, if the prediction mode corresponding to the current image region is not the designated prediction mode, it may be determined that the first type of feature information does not satisfy the first specific condition.
[0131] Case 2: The first type of feature information may include an amount of data in a bitstream buffer. If the amount of data in the bitstream buffer is within a predetermined data amount interval, it may be determined that the first type of feature information satisfies a first specific condition; otherwise, if the amount of data in the bitstream buffer is not within the predetermined data amount interval, it may be determined that the first type of feature information does not satisfy the first specific condition.
[0132] For example, a predetermined data amount interval [a1, a2] may be set in advance, where a1 is used to represent the minimum value of the data amount and a2 is used to represent the maximum value of the data amount, and both a1 and a2 may be set based on experience, and there is no limitation thereon.
[0133] When the amount of data in the bitstream buffer is equal to or larger than a1 and equal to or smaller than a2, the amount of data in the bitstream buffer is within a predetermined data amount interval. When the amount of data in the bitstream buffer is smaller than a1, or larger than a2, the amount of data in the bitstream buffer is not within a predetermined data amount interval.
[0134] For example, when the amount of data in the bitstream buffer is within a predetermined data amount interval, i.e., when the amount of data in the bitstream buffer is less than or equal to a2, when performing a filtering process on the current image area (the encoding process shown in FIG. 1 is a filtering process), no overflow occurs after adding filtering parameters, i.e., the bitstream buffer does not exceed the buffer limit.
[0135] Case 3: The first type of feature information may include a quantization step. If the quantization step corresponding to the current image region is within a predetermined step interval, it may be determined that the first type of feature information satisfies the first specific condition; otherwise, if the quantization step corresponding to the current image region is not within the predetermined step interval, it may be determined that the first type of feature information does not satisfy the first specific condition.
[0136] For example, a predetermined step interval [b1, b2] may be set in advance, where b1 is used to represent the minimum step value and b2 is used to represent the maximum step value, and b1 and b2 may be set based on experience, and are not limited thereto. If the quantization step corresponding to the current image region is equal to or greater than b1 and equal to or less than b2, the quantization step corresponding to the current image region is within the predetermined step interval. If the quantization step corresponding to the current image region is smaller than b1, or if the quantization step corresponding to the current image region is larger than b2, the quantization step corresponding to the current image region is not within the predetermined step interval.
[0137] As an example, for case 3, it can be determined that the first type of feature information satisfies a first specific condition only when the quantization step satisfies a certain condition (i.e., falls within a specified step interval), and no adjustment is made to the quantization step that does not have a subjective effect within the specified step interval.
[0138] For example, when setting the value of b1, b1 may be set based on experience, and there is no limitation thereon. For example, b1 may be determined based on the input bit width of the current image region, and the larger the input bit width of the current image region, the larger the value of b1. For example, if the input bit width of the current image region is 8 bits, the value of b1 may be 16, if the input bit width of the current image region is 10 bits, the value of b1 may be 24, and if the input bit width of the current image region is 12 bits, the value of b1 may be 32. Of course, the above is merely an example of the relationship between the input bit width and the minimum value b1 of the step, and there is no limitation on the minimum value b1 of the step.
[0139] As described above, for the input bit widths of different current image regions, if the quantization parameter (QP) satisfies the following relationship, the quantization step is greater than or equal to b1, i.e., meets the minimum value requirement of a certain step interval: for 8 bits, QP≧16; for 10 bits, QP≧24; for 12 bits, QP≧32.
[0140] For example, when setting the value of b2, b2 may be set based on experience, and there is no limitation thereon. For example, b2 may be an infinity value, or b2 may be a fixed value, such as 48, 60, 76, etc.
[0141] Case 4: The first type of feature information may include a prediction mode and a data amount in a bitstream buffer. If the prediction mode corresponding to the current image region is a designated prediction mode and the data amount in the bitstream buffer is within a predetermined data amount interval, it may be determined that the first type of feature information satisfies the first specific condition; otherwise, if the prediction mode corresponding to the current image region is not the designated prediction mode and / or the data amount in the bitstream buffer is not within the predetermined data amount interval, it is determined that the first type of feature information does not satisfy the first specific condition.
[0142] Case 5: The first type of feature information may include a prediction mode and a quantization step. If the prediction mode corresponding to the current image region is a designated prediction mode and the quantization step corresponding to the current image region is within a predetermined step interval, it may be determined that the first type of feature information satisfies the first specific condition; otherwise, if the prediction mode corresponding to the current image region is not the designated prediction mode and / or the quantization step corresponding to the current image region is not within the predetermined step interval, it is determined that the first type of feature information does not satisfy the first specific condition.
[0143] Case 6: The first type of feature information may include a quantization step and a data amount in a bitstream buffer. If the quantization step corresponding to the current image area is within a predetermined step interval and the data amount in the bitstream buffer is within a predetermined data amount interval, determine that the first type of feature information satisfies the first specific condition; otherwise, if the quantization step corresponding to the current image area is not within the predetermined step interval and / or the data amount in the bitstream buffer is not within the predetermined data amount interval, determine that the first type of feature information does not satisfy the first specific condition.
[0144] Case 7: The first type of feature information may include a prediction mode, a data amount in a bitstream buffer, and a quantization step. If the prediction mode corresponding to the current image area is a designated prediction mode, and the data amount in the bitstream buffer is within a predetermined data amount interval, and the quantization step corresponding to the current image area is within a predetermined step interval, it is determined that the first type of feature information satisfies the first specific condition; otherwise, if the prediction mode corresponding to the current image area is not a designated prediction mode, and / or the data amount in the bitstream buffer is not within the predetermined data amount interval, and / or the quantization step corresponding to the current image area is not within the predetermined step interval, it is determined that the first type of feature information does not satisfy the first specific condition, that is, if any of them is not satisfied, it is determined that the first type of feature information does not satisfy the first specific condition.
[0145] Of course, the above cases are merely some examples of "determining whether or not a first type of feature information corresponding to a current image area satisfies a first specific condition", and this embodiment does not limit the determination process of "whether or not a first type of feature information satisfies a first specific condition".
[0146] For the above cases 1, 4, 5, and 7, in one possible embodiment, the designated prediction mode may be one or more of the normal intraframe prediction modes. In another possible embodiment, the designated prediction mode may be a point-by-point prediction mode. Of course, the normal intraframe prediction mode and the point-by-point prediction mode are merely examples and are not limiting in this respect.
[0147] For case 5 and case 7, for a given step interval, the given step interval may be set based on a specified prediction mode, for example, a minimum value of the given step interval may be set based on the specified prediction mode. For example, the normal intraframe prediction mode may correspond to the first minimum value of the given step interval, i.e., the value of b1 may be the first minimum value, and the point-by-point prediction mode may correspond to the second minimum value of the given step interval, i.e., the value of b1 may be the second minimum value. Here, the first minimum value may be greater than the second minimum value, and the first minimum value may be less than the second minimum value, and there is no limitation thereto, and the minimum value of the given step interval may be related to the specified prediction mode.
[0148] The normal intra-frame prediction mode may include a DC mode. Or, the normal intra-frame prediction mode may include a DC mode, a horizontal prediction mode, and a vertical prediction mode. Or, the normal intra-frame prediction mode may include a DC mode and an angle prediction mode (for example, a horizontal prediction mode, a vertical prediction mode, and another angle prediction mode). Or, the normal intra-frame prediction mode may include a DC mode, an angle prediction mode, and a planar mode. Or, the normal intra-frame prediction mode may include a DC mode, an angle prediction mode, and a bilinear mode. Or, the normal intra-frame prediction mode may include a DC mode, an angle prediction mode, a planar mode, and a bilinear mode. Of course, the above are merely examples of normal intra-frame prediction modes, and are not limited thereto. Based on each of the above normal intra-frame prediction modes, other types of intra-frame prediction modes may be normal intra-frame prediction modes.
[0149] In step S12, if the first type of feature information does not satisfy the first specific condition, the encoding side determines that there is no need to perform reconstruction value adjustment for the current image area, and does not encode the flag bit corresponding to the adjustment control switch into the bitstream corresponding to the current image area.
[0150] In step S13, if the first type of feature information satisfies a first specific condition, the encoding side determines whether or not a reconstruction value adjustment needs to be performed for the current image area, and encodes a flag bit corresponding to the adjustment control switch into a bitstream corresponding to the current image area.
[0151] Exemplarily, when the first type of feature information satisfies a first specific condition, the encoding side may determine whether or not reconstruction value adjustment is required for the current image region, and the determination method is not limited. For example, the encoding side calculates a cost value for turning on the reconstruction value adjustment for the current image region as a first cost value, and calculates a cost value for turning off the reconstruction value adjustment for the current image region as a second cost value. Based on this, if the first cost value is smaller than the second cost value, the encoding side determines that reconstruction value adjustment is required for the current image region, and otherwise, the encoding side determines that reconstruction value adjustment is not required for the current image region.
[0152] Exemplarily, the encoding side may determine whether or not a reconstruction value adjustment needs to be performed on the current image region, and then encode a flag bit corresponding to the adjustment control switch into a bit stream corresponding to the current image region. For example, if it is determined that a reconstruction value adjustment needs to be performed on the current image region, the flag bit may be a first value, and the first value represents that a reconstruction value adjustment needs to be performed on the current image region. If it is determined that a reconstruction value adjustment does not need to be performed on the current image region, the flag bit may be a second value, and the second value represents that a reconstruction value adjustment does not need to be performed on the current image region. Both the first value and the second value may be set based on experience, for example, the first value is 0 and the second value is 1, or the first value is 1 and the second value is 0.
[0153] In step S14, the decoding side determines whether the first type of feature information corresponding to the current image area satisfies a first specific condition.
[0154] If not, step S15 may be executed, and if yes, step S16 may be executed.
[0155] Illustratively, the implementation process of step S14 is similar to step S11, and the description is omitted here.
[0156] In step S15, if the first type of feature information does not satisfy the first specific condition, the decoding side determines that there is no need to perform reconstruction value adjustment for the current image area, and there is also no need to decode the flag bit corresponding to the adjustment control switch from the bitstream corresponding to the current image area.
[0157] In step S16, if the first type of feature information satisfies a first specific condition, the decoding side obtains a flag bit corresponding to the adjustment control switch from a bitstream corresponding to the current image region, and determines whether or not reconstruction value adjustment needs to be performed on the current image region based on the flag bit. Here, if the flag bit is a first value, the decoding side may determine that reconstruction value adjustment needs to be performed on the current image region, and if the flag bit is a second value, the decoding side may determine that reconstruction value adjustment does not need to be performed on the current image region.
[0158] As described above, both the encoding side and the decoding side may determine whether or not reconstruction value adjustment is required for the current image region, and the conclusion of this reconstruction value adjustment can be applied to the current image region. If reconstruction value adjustment is required for the current image region, the encoding side needs to adjust the reconstruction values of the N encoding blocks, and the decoding side needs to adjust the reconstruction values of the N decoded blocks. If reconstruction value adjustment is not required for the current image region, the encoding side does not need to adjust the reconstruction values of the N encoding blocks, and the decoding side does not need to adjust the reconstruction values of the N decoded blocks.
[0159] Example 4: For example 1 and example 2, it may determine whether reconstruction value adjustment is required for the current image area. For example, for the encoding side, after encoding a bit stream of N encoding blocks (N≧1), the encoding side may take the N encoding blocks as the current image area and determine whether reconstruction value adjustment is required for the current image area. For the decoding side, after analyzing a bit stream of N decoded blocks (N≧1), the decoding side may take the N decoded blocks (corresponding to the N encoding blocks of the encoding side) as the current image area and determine whether reconstruction value adjustment is required for the current image area.
[0160] Exemplarily, the following scheme may be adopted to determine whether reconstruction value adjustment needs to be performed for the current image region.
[0161] Implicit derivation method: The encoding side may implicitly derive whether or not reconstruction value adjustment needs to be performed for the current image region based on the second type of feature information corresponding to the current image region, and the decoding side may also implicitly derive whether or not reconstruction value adjustment needs to be performed for the current image region based on the second type of feature information corresponding to the current image region.
[0162] The implementation process of the implicit derivation method will be described below with reference to a specific application scenario. The process may include:
[0163] In step S21, the encoding side determines whether the second type of feature information corresponding to the current image region satisfies a second specific condition.
[0164] If not, step S22 may be executed; if yes, step S23 may be executed.
[0165] Exemplarily, the second type of feature information corresponding to the current image area may include, but is not limited to, at least one of rate control over-underflow indication information, quantization parameter, reconstructed pixel feature, and block position, the rate control over-underflow indication information may include, but is not limited to, a current rate, and the quantization parameter may include, but is not limited to, a quantization step. Here, the current rate is used to represent the average rate of all rate control units before the rate control unit in which the current image area is located, the block position is the block position of an image block in the current image area, for example, the block position of any image block in the current image area, and the block position is used to represent the position of the image block in the current frame. Of course, the current rate, the quantization parameter, the reconstructed pixel feature, and the block position are only some examples of the second type of feature information, and are not limited to this second type of feature information, and whether the second type of feature information satisfies a second specific condition may include, but is not limited to, the following:
[0166] Case I: The second type of feature information corresponding to the current image area may include a current rate corresponding to the current image area, where the current rate is rate control information, i.e., rate control over / underflow indication information, and if the current rate is smaller than the first rate value, it is determined that the second type of feature information satisfies a second specific condition; otherwise, it is determined that the second type of feature information does not satisfy the second specific condition.
[0167] By way of example, the first rate value may be a rate value set based on experience, and there may be no limitation on this first rate value, and a current rate being smaller than the first rate value may represent that the rate control information indicates that a resource pool (e.g., a bitstream buffer for storing a bitstream) is sufficient.
[0168] In one possible embodiment, a target upper limit rate may be preset, and if the current rate is close to the target upper limit rate, the rate control information indicates that the resource pool is normal; if the current rate is greater than the sum of the target upper limit rate and a predetermined threshold, the rate control information indicates that the resource pool is insufficient; if the current rate is less than the difference between the target upper limit rate and the predetermined threshold, the rate control information indicates that the resource pool is sufficient; and based on this, the difference between the target upper limit rate and the predetermined threshold may be set as the first rate value.
[0169] Case II: The second type of feature information corresponding to the current image area may include a block position corresponding to the current image area, and if the block position corresponding to the current image area is at a specified position, it is determined that the second type of feature information satisfies a second specific condition; otherwise, if the block position corresponding to the current image area is not at a specified position, it is determined that the second type of feature information does not satisfy the second specific condition.
[0170] For example, the designated location may be the last L image blocks (L may be a positive integer equal to or greater than 1) of the current rate control unit (i.e., the rate control unit in which the current image region is located), or the designated location may be the image block of the bottom row of the current rate control unit, etc. Based on this, if the block location belongs to the last L image blocks or the image block of the bottom row of the current rate control unit, it is determined that the block location is at the designated location, and otherwise it is determined that the block location is not at the designated location.
[0171] In another example, the specified position may be a slice boundary position in the current frame, and if the block position belongs to a slice boundary position in the current frame, it is determined that the block position is at the specified position, and otherwise, it is determined that the block position is not at the specified position.
[0172] In another example, the designated position may be the last L image blocks of the current rate control unit and a Slice boundary position in the current frame, and if the block position belongs to the last L image blocks of the current rate control unit or if the block position belongs to a Slice boundary position in the current frame, it is determined that the block position is in the designated position. If the block position does not belong to the last L image blocks of the current rate control unit and does not belong to a Slice boundary position in the current frame, it is determined that the block position is not in the designated position.
[0173] Of course, the above are merely some examples of the designated positions, and the present embodiment is not limited to these designated positions.
[0174] Case III: The second type of feature information corresponding to the current image region may include a quantization step corresponding to the current image region, and if the quantization step is greater than a step threshold, it is determined that the second type of feature information satisfies a second specific condition; otherwise, if the quantization step is less than or equal to the step threshold, it is determined that the second type of feature information does not satisfy the second specific condition.
[0175] Case IV: The second type of feature information corresponding to the current image area may include a current rate corresponding to the current image area and a block position corresponding to the current image area, and based on this, if the current rate is smaller than the first rate value and the block position is in a specified position, it is determined that the second type of feature information satisfies a second specific condition, and otherwise, it is determined that the second type of feature information does not satisfy the second specific condition.
[0176] Case V: The second type of feature information corresponding to the current image area may include a current rate corresponding to the current image area and a block position corresponding to the current image area, and if the current rate is smaller than the first rate value or the block position is in a specified position, it is determined that the second type of feature information satisfies a second specific condition, and otherwise it is determined that the second type of feature information does not satisfy the second specific condition.
[0177] Case VI: The second type of feature information corresponding to the current image region may include a current rate corresponding to the current image region and a quantization step corresponding to the current image region, and if the current rate is smaller than the first rate value and the quantization step is greater than a step threshold, it is determined that the second type of feature information satisfies a second specific condition, otherwise it is determined that the second type of feature information does not satisfy the second specific condition.
[0178] Case VII: The second type of feature information corresponding to the current image region may include a current rate corresponding to the current image region and a quantization step corresponding to the current image region, and if the current rate is smaller than the first rate value or the quantization step is greater than a step threshold, it is determined that the second type of feature information satisfies a second specific condition, and otherwise it is determined that the second type of feature information does not satisfy the second specific condition.
[0179] Case VIII: The second type of feature information corresponding to the current image area may include a block position corresponding to the current image area and a quantization step corresponding to the current image area, and based on this, if the block position is in a specified position and the quantization step is greater than a step threshold, it is determined that the second type of feature information satisfies a second specific condition, and otherwise, it is determined that the second type of feature information does not satisfy the second specific condition.
[0180] Case IX: The second type of feature information corresponding to the current image region may include a block position corresponding to the current image region and a quantization step corresponding to the current image region, and if the block position is in a specified position or the quantization step is greater than a step threshold, it is determined that the second type of feature information satisfies a second specific condition, and otherwise it is determined that the second type of feature information does not satisfy the second specific condition.
[0181] Case X: The second type of feature information corresponding to the current image area may include a current rate corresponding to the current image area, a block position corresponding to the current image area, and a quantization step corresponding to the current image area, and based on this, if the current rate is smaller than the first rate value, the block position is in a specified position, and the quantization step is greater than a step threshold, it may be determined that the second type of feature information satisfies a second specific condition, and otherwise it may be determined that the second type of feature information does not satisfy the second specific condition.
[0182] Case XI: The second type of feature information corresponding to the current image region may include a current rate corresponding to the current image region, a block position corresponding to the current image region, and a quantization step corresponding to the current image region, and based on this, if the current rate is smaller than the first rate value, or if the block position is in a specified position, or if the quantization step is larger than a step threshold, it may be determined that the second type of feature information satisfies a second specific condition, and otherwise, it may be determined that the second type of feature information does not satisfy the second specific condition.
[0183] Case XII: The second type of feature information corresponding to the current image region may include reconstructed pixel features corresponding to the current image region, and based on this, if the reconstructed pixel features indicate that the complexity of the current image region is simple, it may be determined that the second type of feature information satisfies a second specific condition, and otherwise, it may be determined that the second type of feature information does not satisfy the second specific condition.
[0184] 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 complexity of the current pixel region may be evaluated using a Sobel operator to obtain the complexity of the current image region, the reconstructed pixel values of the current image region may be transformed and the complexity of the current image region may be obtained based on the features of the transform domain, for example, the frequency domain, or the horizontal and vertical gradients of the current image region may be calculated and the complexity of the current image region may be obtained based on the horizontal and vertical gradients. Of course, the above are only some examples, and it is sufficient that the reconstructed pixel feature can be obtained and the reconstructed pixel feature can represent the complexity of the current image region.
[0185] The principle of reconstructed pixel features is similar to that of block location: for complex areas, more loss is usually not perceptible, but for simple areas, e.g., flat areas, even small losses are perceptible to the human eye.
[0186] Based on the above principle, when the reconstructed pixel feature represents that the complexity of the current image region is simple, the second type of feature information may be determined to satisfy a second specific condition, so as to represent that the reconstruction value of the current image region can be adjusted to reduce image loss. Exemplarily, the reconstructed pixel feature may be a complexity value, and when the complexity value is greater than a predetermined threshold, the reconstructed pixel feature may represent that the complexity of the current image region is complex, otherwise, the complexity of the current image region is simple. The embodiment of the present invention is not limited to representing the complexity of the current image region, for example, when the complexity value is less than a predetermined threshold, the reconstructed pixel feature may represent that the complexity of the current image region is simple, otherwise, the complexity of the current image region is complex.
[0187] Case XIII: the second type of feature information corresponding to the current image area may include reconstructed pixel features corresponding to the current image area, and based on this, the second type of feature information corresponding to the current image area further includes at least one of a current rate, a block position, and a quantization step. For convenience of description, the second type of feature information corresponding to the current image area further includes at least one of a current rate, a block position, and a quantization step. For convenience of description, the second type of feature information including the current rate, the block position, and the quantization step simultaneously is taken as an example. The implementation methods for other cases are similar. Based on this, if the current rate is smaller than the first rate value, the block position is at a specified position, the quantization step is greater than a step threshold, and the reconstructed pixel features indicate that the complexity of the current image area is simple, it may be determined that the second type of feature information satisfies a second specific condition; otherwise, it may be determined that the second type of feature information does not satisfy the second specific condition.
[0188] Case XIV: The second type of feature information corresponding to the current image area includes a reconstructed pixel feature corresponding to the current image area, and based on this, the second type of feature information corresponding to the current image area further includes at least one of a current rate, a block position, and a quantization step. For convenience of explanation, the second type of feature information corresponding to the current image area further includes at least one of a current rate, a block position, and a quantization step. For convenience of explanation, the second type of feature information includes the current rate, the block position, and the quantization step simultaneously. The implementation methods for other cases are similar. Based on this, if the current rate is smaller than the first rate value, or if the block position is at a specified position, or if the quantization step is greater than a step threshold, or if the reconstructed pixel feature indicates that the complexity of the current image area is simple, it may be determined that the second type of feature information satisfies a second specific condition; otherwise, it may be determined that the second type of feature information does not satisfy the second specific condition.
[0189] Of course, the above cases are merely some examples of "determining whether or not the second type of feature information corresponding to the current image area satisfies the second specific condition", and this embodiment does not limit the determination process of "whether or not the second type of feature information satisfies the second specific condition".
[0190] In step S22, the encoding side determines that no reconstruction value adjustment needs to be performed for the current image region.
[0191] In step S23, the encoding side determines that reconstruction value adjustment needs to be performed for the current image region.
[0192] In step S24, the decoding side determines whether the second type of feature information corresponding to the current image area satisfies a second specific condition.
[0193] If not, step S25 may be executed, and if yes, step S26 may be executed.
[0194] Illustratively, the implementation process of step S24 is similar to step S21, and the description is omitted here.
[0195] In step S25, the decoding side determines that no reconstruction value adjustment needs to be performed for the current image region.
[0196] In step S26, the decoding side determines that reconstruction value adjustment needs to be performed for the current image region.
[0197] Example 5: For example 1 and example 2, it may determine whether reconstruction value adjustment is required for the current image area. For example, for the encoding side, after encoding a bitstream of N encoding blocks (N≧1), the encoding side may take the N encoding blocks as the current image area and determine whether reconstruction value adjustment is required for the current image area. For the decoding side, after analyzing a bitstream of N decoded blocks (N≧1), the decoding side may take the N decoded blocks (corresponding to the N encoding blocks of the encoding side) as the current image area and determine whether reconstruction value adjustment is required for the current image area.
[0198] Exemplarily, the following scheme may be adopted to determine whether reconstruction value adjustment needs to be performed for the current image region.
[0199] This is a combination realization method, that is, an explicit syntax+implicit derivation realization method. For example, after the encoding side obtains the flag bit of the adjustment control switch corresponding to the current image region (see Example 3), if the flag bit of the adjustment control switch is the same as the flag bit of the adjustment control switch corresponding to the target image region (e.g., the image region immediately before the current image region, or a specified image region, or a default image region, etc.), the encoding side may not code the flag bit of the adjustment control switch in the bit stream corresponding to the current image region. When the decoding side finds that the flag bit of the adjustment control switch is not included in the bit stream corresponding to the current image region, it may determine whether to perform reconstruction value adjustment for the current image region by taking the flag bit of the adjustment control switch corresponding to the target image region as the flag bit of the adjustment control switch corresponding to the current image region. Or, after the encoding side obtains the flag bit of the adjustment control switch corresponding to the current image region, if the flag bit of the adjustment control switch is different from the flag bit of the adjustment control switch corresponding to the target image region, the encoding side may code the flag bit of the adjustment control switch in the bit stream corresponding to the current image region. The decoding side may analyze the flag bit of the adjustment control switch corresponding to the current image region from the bitstream, and determine whether to perform reconstruction value adjustment for the current image region based on the flag bit.
[0200] Example 6: Regarding Examples 1 to 5, after determining whether to perform reconstruction value adjustment on the current image region, if it is determined to perform reconstruction value adjustment on the current image region, an adjustment parameter corresponding to the current image region may be acquired. The adjustment parameter may be used to adjust the reconstruction value of the current image region, that is, to adjust the reconstruction values (or predicted values, or residual values, etc.) of N image blocks in the current image region. For example, for the encoding side, the current image region may include N encoding blocks, and the adjustment parameter may be used to adjust the reconstruction values of the N encoding blocks, and for the decoding side, the current image region may include N decoded blocks, and the adjustment parameter may be used to adjust the reconstruction values of the N decoded blocks.
[0201] For the encoding side, an adjustment parameter corresponding to the current image region may be determined according to the original value of the current image region and the reconstructed value of the current image region, which is used to adjust the reconstructed value of the current image region so that the reconstructed value after adjustment is close to the original value of the current image region, and the embodiment does not limit the acquisition process of the adjustment parameter.
[0202] Exemplarily, the adjustment parameter corresponding to the current image area may include a plurality of adjustment values, and the current image area may correspond to a plurality of pixel groups, that is, all pixel points of the current image area may be divided into a plurality of pixel groups, and based on this, the plurality of adjustment values may include adjustment values corresponding to K pixel groups, and the K pixel groups may be all or some of the pixel groups among the plurality of pixel groups. For example, all pixel points of the current image area may be divided into 32 pixel groups, and K pixel groups may be selected from the 32 pixel groups, for example, 4 pixel groups, 8 pixel groups, 16 pixel groups, 32 pixel groups, etc., and the value of K is not limited. Based on this, the encoding side obtains 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 values corresponding to each pixel group are used to adjust the reconstruction value of each pixel point in the pixel group. For example, if the K pixel groups are pixel group 1 and pixel group 2, the encoding side may obtain an adjustment value corresponding to pixel group 1 and an adjustment value corresponding to pixel group 2, where 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.
[0203] For each pixel group, the adjustment value corresponding to the pixel group may include adjustment values of multiple channels or a single channel 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, and a B channel, and an alpha channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and 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. The single channel may be any one of the above channels. Of course, the above are only a few examples.
[0204] In practical applications, two or more of the above channels may use the same adjustment value, for example, the U channel and the V channel may use the same adjustment value, or the R channel and the G channel may use the same adjustment value, and there is no limitation thereto.
[0205] 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, where Y channel adjustment value 1 is used to adjust the Y channel reconstruction value of each pixel point in pixel group 1, U channel adjustment value 1 is used to adjust the U channel reconstruction value of each pixel point in pixel group 1, and V channel adjustment value 1 is used to adjust the V channel reconstruction value of each pixel point 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, where Y channel adjustment value 2 is used to adjust the Y channel reconstruction value of each pixel point in pixel group 2, U channel adjustment value 2 is used to adjust the U channel reconstruction value of each pixel point in pixel group 2, and V channel adjustment value 2 is used to adjust the V channel reconstruction value of each pixel point in pixel group 2. When one pixel group corresponds to multiple channels, the adjustment values of each channel corresponding to the pixel group may all be different, may all be the same, or may be partially the same and partially different.
[0206] Exemplarily, after obtaining the adjustment parameters corresponding to the current image region, the encoding side may encode the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region, for example, the adjustment parameters may include adjustment values corresponding to K pixel groups, and thus may encode the adjustment values corresponding to the K pixel groups into a bitstream corresponding to the current image region.
[0207] For the decoding side, an adjustment parameter corresponding to the current image region may be obtained from the bitstream corresponding to the current image region, and the adjustment parameter is used to adjust the reconstruction value of the current image region, so that the reconstruction value after adjustment is close to the original value of the current image region. After obtaining the adjustment parameter, the reconstruction value of the current image region may be adjusted according to the adjustment parameter.
[0208] Exemplarily, the adjustment parameter corresponding to the current image region may include a plurality of adjustment values, and all pixel points of the current image region may be divided into a plurality of pixel groups, and based on this, the plurality of adjustment values may include adjustment values corresponding to K pixel groups, and the K pixel groups may be all or some of the pixel groups among the plurality of pixel groups. The decoding side may obtain adjustment parameters corresponding to K pixel groups from the bitstream, that is, the adjustment parameters may include adjustment values corresponding to K pixel groups. The decoding side 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, if the K pixel groups are pixel group 1 and pixel group 2, the decoding side may obtain an adjustment value corresponding to pixel group 1 and an adjustment value corresponding to pixel group 2, and the decoding side adjusts the reconstruction value of each pixel point in pixel group 1 based on the adjustment value corresponding to pixel group 1, and the decoding side adjusts the reconstruction value of each pixel point in pixel group 2 based on the adjustment value corresponding to pixel group 2.
[0209] For each pixel group, the adjustment value corresponding to the pixel group may include adjustment values of multiple channels or a single channel 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, and a B channel, and an alpha channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel, or the multiple channels may include an R channel, a G channel, and a B channel, and an IR channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a D channel, or the multiple channels may include an R channel, a G channel, and a B channel, and a W channel. The single channel may be any one of the above channels. Of course, the above are only some examples and are not limited thereto.
[0210] For example, take the adjustment value corresponding to a pixel group as an example, and include adjustment values of multiple channels corresponding to the pixel group. For each pixel group among K pixel groups, when the adjustment values obtained from the bit stream include an adjustment value corresponding to the pixel group, the decoding side adjusts the reconstruction value of each pixel point in the pixel group based on the adjustment value corresponding to the pixel group, and obtains the adjusted reconstruction value of each pixel point in the pixel group. For example, when the adjustment values obtained from the bit stream include a Y channel adjustment value 1, a U channel adjustment value 1, and a V channel adjustment value 1 corresponding to pixel group 1, the Y channel reconstruction value of each pixel point in pixel group 1 may be adjusted based on the Y channel adjustment value 1, the U channel reconstruction value of each pixel point in pixel group 1 may be adjusted based on the U channel adjustment value 1, and the V channel reconstruction value of each pixel point in pixel group 1 may be adjusted based on the V channel adjustment value 1. In another example, if the multiple adjustment values obtained from the bitstream include a Y channel adjustment value 1 corresponding to pixel group 1, but do not include a U channel adjustment value 1 and a V channel adjustment value 1 corresponding to pixel group 1, the decoding side may adjust the Y channel reconstruction value of each pixel point in pixel group 1 based on the Y channel adjustment value 1.
[0211] In one possible embodiment, when the K pixel groups are all pixel groups among a plurality of pixel groups (e.g., 32 pixel groups), the encoding side does not need to encode pixel group indication information corresponding to the K pixel groups in the bit stream corresponding to the current image area, and the decoding side also does not need to analyze the pixel group indication information corresponding to the K pixel groups from the bit stream corresponding to the current image area, and based on this, the decoding side can know that the adjustment parameters included in the bit stream are adjustment values for all pixel groups (e.g., 32 pixel groups).
[0212] When the K pixel groups are a part of all pixel groups, the encoding side may encode pixel group indication information corresponding to the K pixel groups into a bit stream corresponding to the current image area, and what is included in the bit stream represents the adjustment values of the K pixel groups corresponding to the pixel group indication information.The decoding side may analyze the pixel group indication information corresponding to the K pixel groups from the bit stream corresponding to the current image area, and know that the adjustment parameters included in the bit stream are the adjustment values of the K pixel groups corresponding to the pixel group indication information.
[0213] For example, the pixel group indication information includes index values of K pixel groups, each of which represents the ordinal number of a pixel group among all pixel groups, and for example, if the K pixel groups include pixel group 1, pixel group 2, pixel group 3, and pixel group 4, the pixel group indication information may include an index value of pixel group 1 (the index value is used to represent the ordinal number of pixel group 1 among all pixel groups), an index value of pixel group 2, an index value of pixel group 3, and an index value of pixel group 4. Obviously, when the K pixel groups are a part of a plurality of pixel groups, the pixel group indication information is used to distinguish a pixel group of a target category from pixel groups of all categories, i.e., to distinguish the K pixel groups from all pixel groups, and the pixel group indication information enables a classification function.
[0214] In another example, if the K pixel groups are consecutive pixel groups, the pixel group indication information may include index values of some of the K pixel groups, and the index values of the remaining pixel groups may be implicitly derived. For example, if the K pixel groups include pixel group 1, pixel group 2, pixel group 3, and pixel group 4, the pixel group indication information may only include the index value of pixel group 1, and since the K pixel groups are consecutive pixel groups, the index value of pixel group 2, the index value of pixel group 3, and the index value of pixel group 4 can be implicitly derived.
[0215] As described above, the index values of the K pixel groups may be indicated in an explicit manner, or the index values of some of the K pixel groups may be indicated in an explicit manner and the index values of the remaining pixel groups may be derived in an implicit manner. This embodiment is not limited to this, and it is sufficient that the decoding side can know the index values of the K pixel groups.
[0216] Exemplarily, the K pixel groups are some of all pixel groups, and the K pixel groups are K pixel groups at default positions, for example, the K pixel groups are fixed to the previous four 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 four pixel groups. In this case, the encoding side does not need to encode pixel group indication information corresponding to the K pixel groups in the bit stream corresponding to the current image area, and the decoding side also does not need to analyze the pixel group indication information corresponding to the K pixel groups from the bit stream corresponding to the current image area. Based on this, the decoding side knows that the adjustment parameters included in the bit stream are adjustment values of the K pixel groups at default positions, for example, the adjustment parameters are the adjustment values of the previous four 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 four pixel groups.
[0217] Example 7: For the encoding side, the adjustment parameter corresponding to the current image area includes an adjustment value corresponding to K pixel groups. The adjustment parameter may include a plurality of adjustment values, and when encoding the adjustment value corresponding to K pixel groups into a bit stream corresponding to the current image area, all or some of the adjustment values may be encoded into the bit stream corresponding to the current image area. For example, taking the adjustment value corresponding to a pixel group including an adjustment value of a single channel corresponding to the pixel group as an example, the K pixel groups are 12 pixel groups, and the adjustment values of four pixel groups among them are Y channel adjustment values, the adjustment values of four pixel groups are U channel adjustment values, and the adjustment values of four pixel groups are V channel adjustment values, the adjustment parameter corresponding to the current image area may include 12 adjustment values. The 12 adjustment values may be encoded into the bit stream corresponding to the current image area, or some of the adjustment values of the 12 adjustment values may be encoded into the bit stream corresponding to the current image area.
[0218] For the decoding side, when obtaining adjustment parameters from a bit stream corresponding to a current image area, if the encoding side has encoded all adjustment values corresponding to K pixel groups, the decoding side may obtain all adjustment values corresponding to K pixel groups from the bit stream corresponding to the current image area. If the encoding side has encoded some adjustment values corresponding to K pixel groups, the decoding side may obtain some adjustment values corresponding to K pixel groups from the bit stream corresponding to the current image area. For example, if the decoding side has obtained a Y channel adjustment value but has not obtained a U channel adjustment value and a V channel adjustment value, the decoding side adjusts the Y channel reconstruction value of each pixel point in the corresponding pixel group based only 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. Also, if the decoding side has not obtained an adjustment value of a pixel group among the K pixel groups, the decoding side does not adjust the reconstruction value of each pixel point in the pixel group.
[0219] In one possible embodiment, based on a plurality of adjustment values corresponding to K pixel groups, the encoding side encodes all or some of the adjustment values into a bitstream corresponding to the current image area, which may include, but is not limited to, the following steps:
[0220] In step S31, the adjustment values are sorted according to the coding order of the adjustment values.
[0221] For example, among 12 pixel groups (for example, pixel group 1 to pixel group 12), the adjustment values of four pixel groups are Y channel adjustment values, the adjustment values of four pixel groups are U channel adjustment values, and the adjustment values of four pixel groups are V channel adjustment values. The current image area corresponds to the 12 adjustment values, and the encoding order of the 12 adjustment values may be determined.
[0222] First, the coding order of each pixel group may be determined. For example, when dividing a plurality of pixel groups based on the reconstructed value of each pixel point, the coding order of each pixel group may be determined based on the value range of each pixel group, for example, sorting in ascending order of value range or in descending order of value range. Taking sorting in ascending order of 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 11 is the second largest, and the value range corresponding to pixel group 12 is the largest, i.e., the value ranges increase in order from pixel group 1 to pixel group 12, the coding order of each pixel group may be coding in order from pixel group 1 to pixel group 12.
[0223] In another example, when dividing a plurality of pixel groups based on the gradient value of each pixel point, the coding order of each pixel group may be determined based on the gradient value range of each pixel group (i.e., the gradient value result corresponding to each pixel group, for example, the range of the absolute value smaller than 10). For example, sorting may be performed in ascending order of gradient value range, or in descending order of gradient value range. Taking sorting in descending order of gradient value range as an example, 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 11 is the second largest, and the gradient value range corresponding to pixel group 12 is the largest, that is, the gradient values corresponding to pixel group 1 to pixel group 12 are in order of increasing gradient value, the coding order of each pixel group may be coding from pixel group 1 to pixel group 12 in order.
[0224] In another example, when dividing a plurality of pixel groups based on the pixel position of each pixel point, the coding order of each pixel group may be determined based on the block order corresponding to each pixel group. Taking sorting according to the front-to-back order of the block order as an example, if the sub-region corresponding to pixel group 1 is the first block of the current image region, the sub-region corresponding to pixel group 2 is the second block of the current image region, ..., the sub-region corresponding to pixel group 11 is the 11th block of the current image region, and the sub-region corresponding to pixel group 12 is the 12th block of the current image region, the coding order of each pixel group is to code pixel group 1 to pixel group 12 in order.
[0225] Of course, the above methods are merely some examples of determining the encoding order of each pixel group, and are not limiting.
[0226] The coding order of each channel may be determined, for example, the coding order of Y channel, U channel, and V channel may be determined, for example, the coding order is Y channel, U channel, and V channel, or Y channel, V channel, and U channel, or U channel, Y channel, and V channel, or U channel, V channel, and Y channel. Of course, the above methods are merely some examples of determining the coding order of each channel, and are not limited thereto, and the coding order of each channel may be arbitrarily planned.
[0227] When the adjustment value corresponding to a pixel group includes adjustment values of multiple channels corresponding to the pixel group, the encoding order of the multiple adjustment values may be determined based on the encoding order of each pixel group and the encoding order of each channel. For example, the encoding order of the multiple adjustment values may be determined by using the encoding order of the pixel group as the main and the encoding order of each channel as the auxiliary. For example, the K pixel groups are four pixel groups, each of which corresponds to adjustment values of three channels, and the encoding order of each pixel group is pixel group 1, pixel group 2, pixel group 3, pixel group 4 in this order, and the encoding order of each channel is Y channel, U channel, V channel in this order. In this case, the encoding order of the 12 adjustment values may be the Y channel adjustment value, U channel adjustment value, V channel adjustment value of pixel group 1, the Y channel adjustment value, U channel adjustment value, V channel adjustment value of pixel group 2, the Y channel adjustment value, U channel adjustment value, V channel adjustment value of pixel group 3, and the Y channel adjustment value, U channel adjustment value, V channel adjustment value of pixel group 4 in this order. In another example, the encoding order of the adjustment values may be determined by using the encoding order of each channel as the main order and the encoding order of the pixel group as the auxiliary order. The encoding order of the above 12 adjustment values may be in the order of the Y channel adjustment value of pixel group 1, the Y channel adjustment value of pixel group 2, the Y channel adjustment value of pixel group 3, the Y channel adjustment value of pixel group 4, the U channel adjustment value of pixel group 1, the U channel adjustment value of pixel group 2, the U channel adjustment value of pixel group 3, the U channel adjustment value of pixel group 4, the V channel adjustment value of pixel group 1, the V channel adjustment value of pixel group 2, the V channel adjustment value of pixel group 3, and the V channel adjustment value of pixel group 4. Of course, the above are only two examples of the encoding order of the adjustment values, and this embodiment is not limited to the encoding order of the adjustment values, and the encoding order of the adjustment values may be set arbitrarily.
[0228] In step S32, the adjustment values are sequentially traversed based on the sorting result.
[0229] For example, taking the K pixel groups as an example, namely, 4 pixel groups, when the pixel groups correspond to the adjustment values of a single channel, the first traverse traverses the adjustment value of pixel group 1, the second traverse traverses the adjustment value of pixel group 2, the third traverse traverses the adjustment value of pixel group 3, and the fourth traverse traverses the adjustment value of pixel group 4. When the pixel groups correspond to the adjustment values of multiple channels, the first traverse traverses the Y channel adjustment value of pixel group 1, the second traverse traverses the U channel adjustment value of pixel group 1, the third traverse traverses the V channel adjustment value of pixel group 1, the fourth traverse traverses the Y channel adjustment value of pixel group 2, the fifth traverse traverses the U channel adjustment value of pixel group 2, and so on. When the pixel groups correspond to the adjustment values of a single channel, the traversal may be performed according to the order of each channel, and the order of each channel is taken as Y channel, U channel, and V channel as an example, the first traversal traverses the adjustment values of the Y channel, the second traversal traverses the adjustment values of the U channel, and the third traversal traverses the adjustment values of the V channel. Each pixel group and each pixel channel may have other orders, and the above is merely an example of the traversal order, and the present invention is not limited thereto.
[0230] In step S33, when the adjustment value currently being traversed is encoded into the bitstream corresponding to the current image area, if the current rate is smaller than the second rate value, the adjustment value is encoded into the bitstream corresponding to the current image area, and the next adjustment value after the adjustment value is traversed, and the next adjustment value is set as the currently traversed adjustment value.
[0231] Exemplarily, the second rate value may be set based on experience, and is not limited thereto, and when the current rate is smaller than the second rate value, the rate control information indicates that the resource pool is sufficient. In one possible embodiment, one target upper limit rate may be set in advance, and when the current rate is close to the target upper limit rate, the rate control information indicates that the resource pool is normal, when the current rate is greater than the sum of the target upper limit rate and a predetermined threshold, the rate control information indicates that the resource pool is insufficient, and when the current rate is smaller than the difference between the target upper limit rate and the predetermined threshold, the rate control information indicates that the resource pool is sufficient. Based on this, the difference between the target upper limit rate and the predetermined threshold may be the second rate value. The second rate value may be the same as or different from the above first rate value.
[0232] In step S34, for the currently traversed adjustment value, when the adjustment value is encoded into the bitstream corresponding to the current image area, if the current rate is equal to or greater than the second rate value, encoding the adjustment value into the bitstream corresponding to the current image area may be prohibited, and the traversal of the next adjustment value of the adjustment value may be stopped, that is, the traversal process of multiple adjustment values is terminated.
[0233] As described above, in this embodiment, when the encoding side encodes a plurality of adjustment values corresponding to K pixel groups into a bit stream corresponding to a current image area, the encoding side may sequentially traverse a plurality of adjustment values. For the currently traversed adjustment value, if the current rate is smaller than the second rate value when the adjustment value is encoded into the bit stream, the adjustment value is encoded into the bit stream, and the next adjustment value of the adjustment value is subsequently traversed; if the current rate is equal to or greater than the second rate value, the adjustment value is not encoded into the bit stream, and the traversal of the next adjustment value of the adjustment value is stopped. In this way, when all adjustment values corresponding to K pixel groups have been traversed, or when the current rate is equal to or greater than the second rate value, the traversal of the adjustment values is stopped. Up to this point, all or some of the adjustment values corresponding to K pixel groups can be encoded into the bit stream corresponding to the current image area, and the process is not described here.
[0234] Example 8: In the process of transmitting the adjustment parameters, the state of the rate control is also updated at the same time, and if the rate control is still in an underflow state after encoding the adjustment parameters (less than 0, for example, when the current rate is less than the second rate value, it indicates that the rate control is still in an underflow state), continue to encode the adjustment parameters. Case 1: Transmit the adjustment parameters step by step in the form of channels such as Y channel, U channel, V channel, R channel, G channel, B channel, alpha channel (some channels may be shared, for example, U and V channels may be shared), and if the state of the rate control is underflow, encode the adjustment parameters in order (analyze in the case of the decoding side), and if the rate control is still underflow after transmission, continue to encode the next adjustment parameter (analyze in the case of the decoding side). Continue until the rate control does not underflow or until all the adjustment parameters are transmitted. Case 2: Transmit the adjustment parameters in the form of pixel groups (at least one pixel) in stages, i.e., transmit the adjustment parameters in stages according to a certain scanning order and grouping, for example, in the order of Y channel, U channel, and V channel, divide each channel into four groups (for example, four pixel groups) in the vertical direction, transmit the adjustment parameters for each group, and gradually update the rate control state. Exemplarily, the adjustment parameters represent adjusting a certain type or multiple types of reconstruction values in N coding blocks (i.e., current image area), and the certain type or multiple types of reconstruction values may be transmitted by syntax, or may be determined by a derivation method, for example, by encoding, consensus by the decoding side, derivation based on coded information (for example, mode information, reconstruction value information, etc.), etc.
[0235] Example 9: For example, in the coding side and the decoding side of Example 1 to Example 8, the current image area may correspond to multiple pixel groups, for example, all pixel points in the current image area are divided into multiple pixel groups, that is, all pixel points are classified. In this embodiment, the following method may be adopted to divide all pixel points in the current image area into multiple pixel groups.
[0236] Method 1: All pixel points in the current image area are divided into multiple pixel groups based on the pre-adjustment reconstruction value of each pixel point, that is, multiple pixel groups may be obtained by classifying based on the pre-adjustment reconstruction value of each pixel point (the reconstruction values for later grouping all refer to the pre-adjustment reconstruction value). For example, the value range of the reconstruction value may be equally divided into A pixel groups, and the pixel group may be determined based on the range in which the reconstruction value is located. For example, the reconstruction value (value range 0 to 255) with a bit width of 8 bits 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, respectively. If the reconstructed value of a pixel point is in the range 0 to 15, the pixel point is divided into the first pixel group; if the reconstructed value of a pixel point is in the range 16 to 31, the pixel point is divided into the second pixel group; if the reconstructed value of a pixel point is in the range 32 to 47, the pixel point is divided into the third pixel group; if the reconstructed value of a pixel point is in the range 48 to 63, the pixel point is divided into the fourth pixel group, ... if the reconstructed value of a pixel point is in the range 240 to 255, the pixel point is divided into the 16th pixel group.
[0237] Exemplarily, when all pixel points in the current image region are divided into a plurality of pixel groups based on the reconstruction value of each pixel point, the division may be performed for each channel. For example, taking the Y channel, U channel, and V channel as examples, if the Y channel reconstruction value of a pixel point is in the range 0 to 15, the Y channel reconstruction value of the pixel point may be divided into a first pixel group, and based on this, the Y channel reconstruction value of the pixel point may be adjusted based on the Y channel adjustment value corresponding to the first pixel group. If the U channel reconstruction value of a pixel point is in the range 16 to 31, the U channel reconstruction value of the pixel point may be divided into a second pixel group, and based on this, the U channel reconstruction value of the pixel point may be adjusted based on the U channel adjustment value corresponding to the second pixel group. If the V channel reconstruction value of a pixel point is in the range 16 to 31, the V channel reconstruction value of the pixel point may be divided into a second pixel group, and based on this, the V channel reconstruction value of the pixel point may be adjusted based on the V channel adjustment value corresponding to the second pixel group.
[0238] Method 2: A classification value of a pixel point is determined based on the pre-adjustment reconstruction values of the pixel points surrounding the pixel point (the reconstruction values for subsequent grouping all refer to the pre-adjustment reconstruction values), and all pixel points in the current image area are divided into multiple pixel groups based on the classification values of each pixel point. For example, classification may be performed based on the gradient value of each pixel point to obtain multiple pixel groups.
[0239] For example, a pixel point may be classified based on the reconstructed values of pixel points around the pixel point, for example, gradient information may be used to subtract the reconstructed value of the left adjacent pixel point of the pixel point from the reconstructed value of the upper adjacent pixel point of the pixel point to obtain the gradient value of the pixel point. Pixel points whose absolute values of gradient value results are in a certain range may be defined as the same category, for example, those whose absolute value is less than 10 may be classified as the first category, those whose absolute value is between 10 and 30 may be classified as the second category, and those whose absolute value is greater than 30 may be classified as the third category. Based on this, for a certain pixel point, if the absolute value of the gradient value of the pixel point is less than 10, the pixel point may be divided into the first pixel group, if the absolute value of the gradient value of the pixel point is between 10 and 30, the pixel point may be divided into the second pixel group, and if the absolute value of the gradient value of the pixel point is greater than 30, the pixel point may be divided into the third pixel group.
[0240] Method 3: Divide all pixel points in the current image area into multiple pixel groups according to the pixel position of each pixel point, that is, classify according to the pixel position of each pixel point to obtain multiple pixel groups. For example, classify according to pixel position, for example, divide the current image area of 16*2 evenly into four 4*2 sub-areas, and each 4*2 sub-area is a category. Based on this, for a pixel point, if the pixel point is in the first 4*2 sub-area, the pixel point may be divided into the first pixel group, if the pixel point is in the second 4*2 sub-area, the pixel point may be divided into the second pixel group, if the pixel point is in the third 4*2 sub-area, the pixel point may be divided into the third pixel group, and if the pixel point is in the fourth 4*2 sub-area, the pixel point may be divided into the fourth pixel group.
[0241] Method 4: Each pixel point may be divided into one pixel group, that is, each pixel point is one pixel group, different pixel points correspond to different pixel groups, and a pixel group may be understood as containing only one pixel point.
[0242] Of course, the above-mentioned methods are merely some examples of the division method, and the division method is not limited thereto.
[0243] Example 10: Regarding Example 1 to Example 8, for the encoding side and the decoding side, the current image area may correspond to a plurality of pixel groups, for example, all pixel points of the current image area are divided into a plurality of pixel groups, that is, all pixel points are classified. In this embodiment, the following method may be adopted to determine a plurality of pixel groups corresponding to the current image area. The plurality of pixel groups corresponding to the current image area are determined based on the prediction mode of the current image area, that is, the division of the pixel groups may be related to the prediction mode of the current image area. For example, the division attribute of the pixel group may be determined based on the prediction mode of the current image area, and the plurality of pixel groups corresponding to the current image area may be determined based on the division attribute.
[0244] Exemplarily, the division attribute may include at least one of the division number, filtering area, and division method. When the division attribute includes the division number, filtering area, and division method, the division number, filtering area, and division method of the pixel group are determined based on the prediction mode of the current image area, and the division number, filtering area, and division method are determined to correspond to the current image area. When the division attribute includes the division number and division method, the division number and division method of the pixel group are determined based on the prediction mode of the current image area, and the division number and division method are determined to correspond to the current image area. For other combinations of division attributes, their realization methods are also similar, and the description is omitted in this embodiment.
[0245] Here, the number of divisions is used to indicate how many pixel groups the current image area is to be divided into, the filtering area is used to indicate which part of the current image area is to be divided into multiple pixel groups, and the division method is used to indicate the size specifications of each pixel group.
[0246] Here, when the division attribute includes a filtering region, the filtering region may represent division of the entire region of the current image region into a plurality of pixel groups, or may represent division of a part of the current image region into a plurality of pixel groups. When the division attribute does not include a filtering region, the filtering region represents division of the entire region of the current image region into a plurality of pixel groups.
[0247] Exemplarily, the prediction mode of the current image region may be divided into a horizontal prediction mode and a non-horizontal prediction mode, and when the prediction mode of the current image region is a horizontal prediction mode, the division number of the pixel group may be determined to be a first division number, the filtering area of the pixel group may be determined to be a first filtering area, and the division method may be determined to be a first size specification, and when the prediction mode of the current image region is not a horizontal prediction mode, the division number of the pixel group may be determined to be a second division number, the filtering area of the pixel group may be determined to be a second filtering area, and the division method may be determined to be a second size specification. Or, when the prediction mode of the current image region is a horizontal prediction mode, the division number of the pixel group may be determined to be a first division number, and the division method may be determined to be a first size specification, and when the prediction mode of the current image region is not a horizontal prediction mode, the division number of the pixel group may be determined to be a second division number, and the division method may be determined to be a second size specification. In another example, the prediction mode of the current image region may be divided into a vertical prediction mode and a non-vertical prediction mode, and when the prediction mode of the current image region is a vertical prediction mode, the division number of the pixel group may be determined to be a third division number, the filtering area of the pixel group may be determined to be a third filtering area, and the division method may be determined to be a third size specification, and when the prediction mode of the current image region is not a vertical prediction mode, the division number of the pixel group may be determined to be a fourth division number, the filtering area of the pixel group may be determined to be a fourth filtering area, and the division method may be determined to be a fourth size specification. Or, when the prediction mode of the current image region is a vertical prediction mode, the division number of the pixel group may be determined to be a third division number, and the division method may be determined to be a third size specification, and when the prediction mode of the current image region is not a vertical prediction mode, the division number of the pixel group may be determined to be a fourth division number, and the division method may be determined to be a fourth size specification. Of course, the division method of the horizontal prediction mode and the non-horizontal prediction mode, and the division method of the vertical prediction mode and the non-vertical prediction mode are only two examples, and are not limited thereto.
[0248] For example, the prediction mode of the current image region may be divided into a first prediction mode and a non-first prediction mode, the first prediction mode corresponds to a first partition attribute (partition number, filtering region, and partition method), and the non-first prediction mode corresponds to a second partition attribute (partition number, filtering region, and partition method). In another example, the prediction mode of the current image region may be divided into a first prediction mode, a second prediction mode, and a non-first non-second prediction mode, the first prediction mode corresponds to a first partition attribute (partition number, filtering region, and partition method), the second prediction mode corresponds to a second partition attribute (partition number, filtering region, and partition method), and the non-first non-second prediction mode corresponds to a third partition attribute (partition number, filtering region, and partition method). In another example, the prediction mode of the current image region may be divided into a first prediction mode and a second prediction mode, where the first prediction mode corresponds to a first partitioning attribute (number of partitions, filtering region, and partitioning method), the second prediction mode corresponds to a second partitioning attribute (number of partitions, filtering region, and partitioning method), etc.
[0249] Of course, in practical applications, the prediction modes may be divided into more than one, and the present invention is not limited thereto.
[0250] For the sake of convenience, this embodiment takes as an example the prediction mode of current image area divided into horizontal prediction mode and non-horizontal prediction mode.When the prediction mode of current image area is horizontal prediction mode, determine the division number of pixel group to be a first division number, determine the filtering area of pixel group to be a first filtering area, and determine the division method to be a first size specification;When the prediction mode of current image area is not horizontal prediction mode, determine the division number of pixel group to be a second division number, determine the filtering area of pixel group to be a second filtering area, and determine the division method to be a second size specification.
[0251] Here, the first division number may be set based on experience, for example, 2, 4, 6, 8, 16, etc., and is not limited thereto. The first filtering area may be the entire area of the current image area, or a part of the current image area, and is not limited thereto. The first size specification may be set based on experience, and the first size specification may include a width and a height, and the width may be 2, 4, 6, 8, 12, 16, etc., and is not limited thereto, and the height may be 1, 2, 4, 6, 8, 12, 16, etc., and is not limited thereto. The second division number may be set based on experience, for example, 2, 4, 6, 8, 16, etc., and is not limited thereto. The second filtering area may be the entire area of the current image area, or a part of the current image area, and is not limited thereto. The second size specification may be set based on experience, and the second size specification may include a width and a height, where the width may be 2, 4, 6, 8, 12, 16, etc., and is not limited thereto, and the height may be 1, 2, 4, 6, 8, 12, 16, etc., and is not limited thereto.
[0252] For example, if the current image area is a 16*2 image block, when the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area may be divided into four pixel groups, and the size of each pixel group is 8*1. In this case, the first division number is 4, the first filtering area is the entire area of the current image area, and the first size specification is 8*1. As shown in FIG. 5A, the 16*2 image block is divided into four 8*1 pixel groups.
[0253] Alternatively, all pixel points in the current image area may be divided into two pixel groups, with the size of each pixel group being 16*1. In this case, the first division number is 2, the first filtering area is the entire area of the current image area, and the first size specification is 16*1. As shown in FIG. 5B, the 16*2 image block is divided into two 16*1 pixel groups.
[0254] Alternatively, all pixel points in the current image area may be divided into four pixel groups, and the size of each pixel group is 4*2. In this case, the first division number is 4, the first filtering area is the entire area of the current image area, and the first size specification is 4*2. As shown in FIG. 5C, the 16*2 image block is divided into four 4*2 pixel groups.
[0255] Or, all pixel points in the current image area may be divided into 8 pixel groups, and the size of each pixel group is 2*2. In this case, the first division number is 8, the first filtering area is the entire area of the current image area, and the first size specification is 2*2. As shown in FIG. 5D, the 16*2 image block is divided into 8 2*2 pixel groups.
[0256] Of course, the above are just some examples of division in horizontal prediction mode, and are not limiting in this respect.
[0257] In addition, when the current image area is a 16*2 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area can be divided into 4 pixel groups, and the size of each pixel group is 4*2. In this case, the second division number is 4, the second filtering area is the entire area of the current image area, and the second size specification is 4*2, and the 16*2 image block is divided into four 4*2 pixel groups, as shown in FIG. 5C.
[0258] Alternatively, all pixel points in the current image area may be divided into four pixel groups, with the size of each pixel group being 8*1, in which case the second division number is 4, the second filtering area is the entire area of the current image area, and the second size specification is 8*1, and the 16*2 image block is divided into four 8*1 pixel groups, as shown in FIG. 5A.
[0259] Alternatively, all pixel points in the current image area may be divided into two pixel groups, with the size of each pixel group being 16*1, in this case, the second division number is 2, the second filtering area is the entire area of the current image area, and the second size specification is 16*1, and the 16*2 image block is divided into two 16*1 pixel groups, as shown in FIG. 5B.
[0260] Or, all pixel points in the current image area may be divided into 8 pixel groups, and the size of each pixel group is 2*2. In this case, the second division number is 8, the second filtering area is the entire area of the current image area, and the second size specification is 2*2. As shown in FIG. 5D, the 16*2 image block is divided into 8 2*2 pixel groups.
[0261] Of course, the above are just some examples of division in non-horizontal prediction modes and are not limiting in this respect.
[0262] In another example, when the current image area is an 8*2 image block, when the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 4*2, in this case, the first division number is 2, the first filtering area is the entire area of the current image area, and the first size specification is 4*2. Or, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 8*1, in this case, the first division number is 2, the first filtering area is the entire area of the current image area, and the first size specification is 8*1. Or, all pixel points of the current image area may be divided into one pixel group, each pixel group having a size of 8*2, in this case, the first division number is 1, the first filtering area is the entire area of the current image area, and the first size specification is 8*2. Or, all pixel points of the current image area may be divided into 4 pixel groups, and the size of each pixel group is 2*2, in this case, the first division number is 4, the first filtering area is the entire area of the current image area, and the first size specification is 2*2. Of course, the above are only some examples of division in horizontal prediction mode, and are not limited thereto.
[0263] Also, when the current image area is an 8*2 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, the size of each pixel group is 4*2, in this case, the second division number is 2, the second filtering area is the entire area of the current image area, and the second size specification is 4*2. Or, all pixel points of the current image area may be divided into two pixel groups, the size of each pixel group is 8*1, in this case, the second division number is 2, the second filtering area is the entire area of the current image area, and the second size specification is 8*1. Or, all pixel points of the current image area may be divided into one pixel group, the size of each pixel group is 8*2, in this case, the second division number is 1, the second filtering area is the entire area of the current image area, and the second size specification is 8*2. Or, all pixel points of the current image area may be divided into 4 pixel groups, and the size of each pixel group is 2*2, in this case, the second division number is 4, the second filtering area is the entire area of the current image area, and the second size specification is 2*2. Of course, the above are only some examples of division in non-horizontal prediction mode, and are not limited thereto.
[0264] In another example, when the current image area is a 16*1 image block, when the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 8*1, in this case, the first division number is 2, the first filtering area is the entire area of the current image area, and the first size specification is 8*1. Or, all pixel points of the current image area may be divided into four pixel groups, each pixel group having a size of 4*1, in this case, the first division number is 4, the first filtering area is the entire area of the current image area, and the first size specification is 4*1. Or, all pixel points of the current image area may be divided into one pixel group, each pixel group having a size of 16*1, in this case, the first division number is 1, the first filtering area is the entire area of the current image area, and the first size specification is 16*1. Or, all pixel points of the current image area may be divided into 8 pixel groups, and the size of each pixel group is 2*1, in this case, the first division number is 8, the first filtering area is the entire area of the current image area, and the first size specification is 2*1. Of course, the above are only some examples of division in horizontal prediction mode, and are not limited thereto.
[0265] Also, when the current image area is a 16*1 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 8*1, in this case, the second division number is 2, the second filtering area is the entire area of the current image area, and the second size specification is 8*1. Or, all pixel points of the current image area may be divided into four pixel groups, each pixel group having a size of 4*1, in this case, the second division number is 4, the second filtering area is the entire area of the current image area, and the second size specification is 4*1. Or, all pixel points of the current image area may be divided into one pixel group, each pixel group having a size of 16*1, in this case, the second division number is 1, the second filtering area is the entire area of the current image area, and the second size specification is 16*1. Or, all pixel points of the current image area may be divided into 8 pixel groups, and the size of each pixel group is 2*1, in this case, the second division number is 8, the second filtering area is the entire area of the current image area, and the second size specification is 2*1. Of course, the above are only some examples of division in non-horizontal prediction mode, and are not limited thereto.
[0266] In another example, when the current image area is an 8*1 image block, when the prediction mode of the current image area is a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 4*1, in this case, the first division number is 2, the first filtering area is the entire area of the current image area, and the first size specification is 4*1. Or, all pixel points of the current image area may be divided into four pixel groups, each pixel group having a size of 2*1, in this case, the first division number is 4, the first filtering area is the entire area of the current image area, and the first size specification is 2*1. Or, all pixel points of the current image area may be divided into one pixel group, each pixel group having a size of 8*1, in this case, the first division number is 1, the first filtering area is the entire area of the current image area, and the first size specification is 8*1. Of course, the above are only some examples of division in the horizontal prediction mode, and are not limited thereto.
[0267] Also, when the current image area is an 8*1 image block, when the prediction mode of the current image area is not a horizontal prediction mode, all pixel points of the current image area may be divided into two pixel groups, each pixel group having a size of 4*1, in this case, the second division number is 2, the second filtering area is the entire area of the current image area, and the second size specification is 4*1. Or, all pixel points of the current image area may be divided into four pixel groups, each pixel group having a size of 2*1, in this case, the second division number is 4, the second filtering area is the entire area of the current image area, and the second size specification is 2*1. Or, all pixel points of the current image area may be divided into one pixel group, each pixel group having a size of 8*1, in this case, the second division number is 1, the second filtering area is the entire area of the current image area, and the second size specification is 8*1. Of course, the above are only some examples of division in non-horizontal prediction mode, and are not limited thereto.
[0268] In practical applications, if the size of the current image region is other sizes, such as 16*4 image blocks, 8*4 image blocks, 16*8 image blocks, etc., the division method is similar to the above method, and the description is omitted in this embodiment.
[0269] Example 11: Regarding Examples 1 to 8, for the encoding side and the decoding side, the current image area may correspond to a plurality of pixel groups, for example, all pixel points in the current image area are divided into a plurality of pixel groups, that is, all pixel points are classified. In this embodiment, the following method may be adopted to determine a plurality of pixel groups corresponding to the current image area. A default policy may be used to determine a plurality of pixel groups corresponding to the current image area. For example, a default policy may be used to determine a division attribute of a pixel group, and a plurality of pixel groups corresponding to the current image area may be determined based on the division attribute. Exemplarily, the division attribute may include at least one of a division number, a filtering area, and a division method, and when the division attribute includes the division number, the filtering area, and the division method, the division number, the filtering area, and the division method of the pixel group are determined, and a plurality of pixel groups corresponding to the current image area are determined based on the division number, the filtering area, and the division method. When the division attribute includes the division number and the division method, the division number and the division method of the pixel group are determined, and a plurality of pixel groups corresponding to the current image area are determined based on the division number and the division method. Here, the number of divisions is used to indicate how many pixel groups the current image area is to be divided into, the filtering area is used to indicate which part of the current image area is to be divided into multiple pixel groups, and the division method is used to indicate the size specifications of each pixel group.
[0270] In the above method, the number of divisions, the filtering area, and the division method may all be specified based on a default policy; for example, the number of divisions is specified as a first number of divisions, the filtering area is specified as a first filtering area, and the division method is specified as a first size specification, and in another example, the number of divisions is specified as a second number of divisions, the filtering area is specified as a second filtering area, and the division method is specified as a second size specification.
[0271] The number of divisions may be set based on experience, for example, 2, 4, 6, 8, 16, etc., and is not limited thereto. The filtering area may be the entire area of the current image area, or a part of the current image area, and is not limited thereto. The size specification corresponding to the division method may be set based on experience, and the size specification may include width and height, and the width may be 2, 4, 6, 8, 12, 16, etc., and is not limited thereto, and the height may be 1, 2, 4, 6, 8, 12, 16, etc., and is not limited thereto.
[0272] For example, if the current image area is a 16*2 image block, all pixel points in the current image area may be divided into 4 pixel groups, and the size of each pixel group is 8*1. Or, all pixel points in the current image area may be divided into 2 pixel groups, and the size of each pixel group is 16*1. Or, all pixel points in the current image area may be divided into 4 pixel groups, and the size of each pixel group is 4*2. Or, all pixel points in the current image area may be divided into 8 pixel groups, and the size of each pixel group is 2*2. Of course, the above are only some examples, and are not limited thereto.
[0273] In another example, if the current image area is an 8*2 image block, all pixel points in the current image area may be divided into two pixel groups, and the size of each pixel group is 4*2. Or, all pixel points in the current image area may be divided into two pixel groups, and the size of each pixel group is 8*1. Or, all pixel points in the current image area may be divided into one pixel group, and the size of each pixel group is 8*2. Or, all pixel points in the current image area may be divided into four pixel groups, and the size of each pixel group is 2*2. Of course, the above are only some examples, and are not limited thereto.
[0274] In another example, if the current image area is a 16*1 image block, all pixel points in the current image area may be divided into two pixel groups, and each pixel group has a size of 8*1. Or, all pixel points in the current image area may be divided into four pixel groups, and each pixel group has a size of 4*1. Or, all pixel points in the current image area may be divided into one pixel group, and each pixel group has a size of 16*1. Or, all pixel points in the current image area may be divided into eight pixel groups, and each pixel group has a size of 2*1. Of course, the above are only some examples, and are not limited thereto.
[0275] In another example, if the current image area is an 8*1 image block, all pixel points in the current image area may be divided into two pixel groups, and each pixel group has a size of 4*1; or all pixel points in the current image area may be divided into four pixel groups, and each pixel group has a size of 2*1; or all pixel points in the current image area may be divided into one pixel group, and each pixel group has a size of 8*1. Of course, the above are only some examples, and are not limited thereto.
[0276] In practical applications, if the size of the current image region is other sizes, such as 16*4 image blocks, 8*4 image blocks, 16*8 image blocks, etc., the division method is similar to the above method, and the description is omitted in this embodiment.
[0277] Example 12: Regarding Example 1 to Example 8, for the encoding side and the decoding side, the current image area may correspond to multiple pixel groups, for example, all pixel points of the current image area are divided into multiple pixel groups, that is, all pixel points are classified. In this embodiment, the following method may be adopted to determine multiple pixel groups corresponding to the current image area. The multiple pixel groups corresponding to the current image area are determined based on the scanning order of the current image area, that is, the division of the pixel groups may be related to the scanning order of the current image area. This method may be understood as using the scanning order of the current image area to rearrange all pixel points of the current image area in one dimension, and dividing the current image area into pixel groups.
[0278] Here, the scanning order of the current image area may be understood as the order of encoding the residual coefficients into a bit stream on the encoding side. Therefore, when determining a plurality of pixel groups corresponding to the current image area based on the scanning order of the current image area, the order of the plurality of pixel groups coincides with the order of encoding the residual coefficients into a bit stream, and the waiting time can be reduced when adjusting the reconstruction value of each pixel point in the pixel group, and the hardware processing performance of the encoding side can be improved. On the decoding side, it may be understood as the order of analyzing the residual coefficients from the bit stream. Therefore, when determining a plurality of pixel groups corresponding to the current image area based on the scanning order of the current image area, the order of the plurality of pixel groups coincides with the analysis order of the residual coefficients, and the waiting time can be reduced when adjusting the reconstruction value of each pixel point in the pixel group, and the hardware processing performance of the decoding side can be improved.
[0279] Exemplarily, the scanning order of the current image area may be a raster scanning order, such as a raster scanning order for the sub-blocks of the current image area and a raster scanning order for the current image area. Take the current image area as an example of a 16*2 image block, and FIG. 6A shows a raster scanning order for the sub-blocks of the current image area. In practical applications, the 16*2 image block may be divided into four 4*2 sub-blocks, and of course, the 16*2 image block may be divided into two 8*2 sub-blocks, or into sub-blocks of other sizes, and there is no limitation thereto. For four 4*2 sub-blocks, refer to the raster scanning order shown in FIG. 6A, and the current image area may be divided into four 4*2 pixel groups. Obviously, the raster scanning order is to first scan each pixel point of the first sub-block, then scan each pixel point of the second sub-block, then scan each pixel point of the third sub-block, and then scan each pixel point of the fourth sub-block. Thus, as shown in Figure 6B, each pixel point of the first sub-block may be divided into a first pixel group, each pixel point of the second sub-block may be divided into a second pixel group, each pixel point of the third sub-block may be divided into a third pixel group, and each pixel point of the fourth sub-block may be divided into a fourth pixel group. Similarly, as shown in Figure 6D, for the raster scan order shown in Figure 6C, the current image region may be divided into two 8*2 pixel groups.
[0280] Figure 6E shows the raster scanning order for the current image area (i.e., the entire current image area), and the current image area may be divided into four 8*1 pixel groups as shown in Figure 6F, or the current image area may be divided into two 16*1 pixel groups as shown in Figure 6G. The raster scanning order in Figure 6E is to first scan the 16 pixel points in the first row, and then scan the 16 pixel points in the second row, so the division method in Figure 6F or Figure 6G may be adopted.
[0281] For example, the scanning order of the current image area may be an interlaced scanning manner, and taking the current image area as an example of a 16*2 image block, FIG. 6H shows the scanning order for the current image area, that is, first scan the 1st pixel point of the 1st row, then scan the 1st pixel point of the 2nd row, then scan the 3rd pixel point of the 1st row, etc. For the scanning order shown in FIG. 6H, the current image area may be divided into four 4*2 pixel groups as shown in FIG. 6I, or the current image area may be divided into two 8*2 pixel groups as shown in FIG. 6J.
[0282] As shown in Figure 6I, one pixel group may be formed by the pixel points in the 1st, 3rd, 5th and 7th columns, one pixel group may be formed by the pixel points in the 2nd, 4th, 6th and 8th columns, one pixel group may be formed by the pixel points in the 9th, 11th, 13th and 15th columns, and one pixel group may be formed by the pixel points in the 10th, 12th, 14th and 16th columns. As shown in Figure 6H, one pixel group may be formed by the pixel points in the 1st, 3rd, 5th, 7th, 9th, 11th, 13th and 15th columns, and one pixel group may be formed by the pixel points in the 2nd, 4th, 6th, 8th, 10th, 12th, 14th and 16th columns.
[0283] Example 13: In Example 1 to Example 12, the encoding side and the decoding side may adjust the reconstruction value of the pixel point according to the adjustment value. The range of the adjustment value may be [-7,7], of course, the range of [-7,7] is only an example, and is not limited thereto, for example, the range of the adjustment value may be [-4,4], [-5,5], [-6,6], [-8,8], the range of the adjustment value may be [-4,6], [-6,5], [-6,8], [-8,4], obviously, the range of the adjustment value may be set arbitrarily.
[0284] In one possible embodiment, one may refer to Table 1 for binarization values in the range [-7,7]. [Table 1]
[0285] In one possible embodiment, the range of the adjustment value may be determined based on the quantization step, that is, the range of the adjustment value may be related to the quantization step. For example, if the quantization step is 8, the range of the adjustment value may be [-4, 4], because the maximum quantization error is 4, in this case, no adjustment value smaller than 4 or larger than 4 appears. Obviously, the binarization shown in Table 1 may be adjusted as shown in Table 2. Of course, in practical application, different ranges of the adjustment value may be set for different quantization steps, and this range is not limited. In another example, if the quantization step is 10, the range of the adjustment value may be [-5, 5], etc., and other cases are similar. [Table 2]
[0286] In another possible embodiment, different quantization steps may correspond to different ranges of adjustment values, and the number of values in the range of adjustment values may be the same, but two adjacent values may be far apart. For example, the range corresponding to quantization step A is [-3,3], where there are a total of seven values, for example, -3, -2, -1, 0, 1, 2, 3; the range corresponding to quantization step B (where quantization step B may be greater than quantization step A) is [-6,6], where there are only seven values, for example, -6, -4, -2, 0, 2, 4, 6; and the range corresponding to quantization step C (where quantization step C may be greater than quantization step B) is [-9,9], where there are only seven values, for example, -9, -6, -3, 0, 3, 6, 9.
[0287] Example 14: Considering hardware limitations, in one possible embodiment, the post-filtering reconstruction value of the current image region cannot be used to reference other image blocks in the same row, but can only be used to reference other image blocks in the next row. For other image blocks in the same row of the current image region, only the pre-filtering reconstruction value of the current image region can be referenced.
[0288] Example 15: In the examples 1 to 13, the bit stream transmitted from the encoding side to the decoding side must include the following.
[0289] 1. Adjustment parameters. The adjustment parameters may include multiple adjustment values, for example, for each channel, the adjustment parameters may include one adjustment value of the channel, or may include at least two adjustment values of the channel, and for convenience of description, one channel is taken as an example. Exemplarily, a current image region may correspond to multiple pixel groups, and the bit stream corresponding to the current image region only includes adjustment values corresponding to K pixel groups, and the K pixel groups are some pixel groups or all pixel groups of the multiple pixel groups.
[0290] Here, the bitstream corresponding to the current image area includes M adjustment values corresponding to K pixel groups, where M may be a positive integer and M may be less than or equal to K, i.e., M is greater than or equal to 1 and less than or equal to K.
[0291] For example, if K pixel groups correspond to the same adjustment value, e.g., adjustment value A, then the bitstream corresponding to the current image region may include only one adjustment value, i.e., adjustment value A, and therefore the M adjustment values are one adjustment value.
[0292] If the K pixel groups correspond to two adjustment values, for example, pixel group 1 and pixel group 2 correspond to adjustment value A, and pixel group 3 and pixel group 4 correspond to adjustment value B, then the bit stream corresponding to the current image region may include two adjustment values, i.e., adjustment value A and adjustment value B, and thus the M adjustment values are two adjustment values. Alternatively, the bit stream corresponding to the current image region may include four adjustment values, i.e., adjustment value A corresponding to pixel group 1, adjustment value A corresponding to pixel group 2, adjustment value B corresponding to pixel group 3, and adjustment value B corresponding to pixel group 4, and thus the M adjustment values are four adjustment values.
[0293] If K pixel groups correspond to K adjustment values, for example, pixel group 1 corresponds to adjustment value A, pixel group 2 corresponds to adjustment value B, pixel group 3 corresponds to adjustment value C, and pixel group 4 corresponds to adjustment value D, then the bitstream corresponding to the current image area may include four adjustment values, namely, adjustment value A, adjustment value B, adjustment value C, and adjustment value D, and therefore the M adjustment values are four adjustment values.
[0294] 2. Pixel group indication information. When the current image region corresponds to multiple pixel groups (for example, 32 pixel groups), the pixel group indication information may be used to indicate K pixel groups among all pixel groups, and the bit stream indicates that the adjustment value corresponding to the K pixel groups is included. Obviously, when the K pixel groups are all pixel groups, the bit stream does not need to include pixel group indication information, and the decoding side can know that the K pixel groups are all pixel groups (for example, 32 pixel groups). When the K pixel groups are some pixel groups among all pixel groups, the decoding side needs to know which pixel groups the K pixel groups are, and in this case, the following method may be adopted.
[0295] Explicit method: when the encoding side sends a bitstream corresponding to a current image area to the decoding side, the bitstream corresponding to the current image area includes pixel group indication information, which indicates that the bitstream includes adjustment values of the pixel groups corresponding to the pixel group indication information. The decoding side can analyze the pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image area, and know that the adjustment parameters included in the bitstream are the adjustment values of the K pixel groups corresponding to the pixel group indication information.
[0296] For example, the pixel group indication information may include index values of K pixel groups, and these index values indicate which pixel group a pixel group is among all the pixel groups. For example, if the K pixel groups include pixel group 1, pixel group 2, pixel group 3, and pixel group 4, the pixel group indication information may include an index value of pixel group 1, an index value of pixel group 2, an index value of pixel group 3, and an index value of pixel group 4.
[0297] In another example, if the K pixel groups are consecutive pixel groups, the pixel group indication information may include index values of some of the K pixel groups, and the index values of the remaining pixel groups may be implicitly derived. For example, if the K pixel groups include pixel group 1, pixel group 2, pixel group 3, and pixel group 4, the pixel group indication information may only include the index value of pixel group 1, and since the K pixel groups are consecutive pixel groups, the index value of pixel group 2, the index value of pixel group 3, and the index value of pixel group 4 can be implicitly derived.
[0298] Implicit method: for example, when the K pixel groups are some pixel groups among all pixel groups, and the K pixel groups are K pixel groups at a default position, for example, the K pixel groups are fixed to the previous four 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 4th pixel groups, the encoding side does not need to encode the pixel group indication information corresponding to the K pixel groups in the bit stream corresponding to the current image area, and the decoding side does not need to analyze the pixel group indication information corresponding to the K pixel groups from the bit stream corresponding to the current image area. Based on this, the decoding side can know that the adjustment parameters included in the bit stream are the adjustment values of the K pixel groups at the default position, for example, the adjustment parameters are the adjustment values of the previous four 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 4th pixel groups.
[0299] 3. Adjustment value grouping indication information: When a bitstream corresponding to a current image region includes M adjustment values corresponding to K pixel groups, the adjustment value grouping indication information is used to indicate a matching relationship between the M adjustment values and the K pixel groups.
[0300] In one possible embodiment, when the M adjustment values are only one adjustment value or K adjustment values, the adjustment value grouping indication information may be a flag bit, that is, the adjustment value grouping indication information only has a fourth value and a fifth value. In this case, when the K pixel groups correspond to the same adjustment value, for example, when the K pixel groups all correspond to the adjustment value A, the adjustment value grouping indication information may be a fourth value, and the fourth value indicates that the K pixel groups correspond to the same adjustment value. After analyzing the adjustment value grouping indication information from the bitstream, if the decoding side finds that the adjustment value grouping indication information is the fourth value, it may analyze only one adjustment value (for example, adjustment value A) from the bitstream and set this adjustment value as the adjustment value corresponding to the K pixel groups.
[0301] When K pixel groups correspond to K adjustment values, for example, when K pixel groups correspond to adjustment value A, adjustment value B, adjustment value C, and adjustment value D (or adjustment value A, adjustment value A, adjustment value B, and adjustment value B), the adjustment value grouping indication information may be a fifth value, and the fifth value indicates that K pixel groups correspond to K adjustment values. When the decoding side finds that the adjustment value grouping indication information is a fifth value after analyzing the adjustment value grouping indication information from the bit stream, it needs to analyze the K adjustment values from the bit stream, for example, sequentially analyzing adjustment value A, adjustment value B, adjustment value C, and adjustment value D (or sequentially analyzing adjustment value A, adjustment value A, adjustment value B, and adjustment value B). In this case, the first analyzed adjustment value A corresponds to the first pixel group (e.g., pixel group 1), the second analyzed adjustment value B corresponds to the second pixel group (e.g., pixel group 2), the third analyzed adjustment value C corresponds to the third pixel group (e.g., pixel group 3), and the fourth analyzed adjustment value D corresponds to the fourth pixel group (e.g., pixel group 4).
[0302] Illustratively, the above implementation process may be represented by the syntax table shown in Table 3. [Table 3]
[0303] In the above syntax table, same_offset_flag represents adjustment value grouping indication information, and when the value of same_offset_flag is the fourth value (e.g., 1), the decoding side needs to parse one adjustment value from the bitstream, and when the value of same_offset_flag is the fifth value (e.g., 0), the decoding side needs to sequentially parse K adjustment values from the bitstream.
[0304] In the syntax table shown in Table 3, same_offset_flag is a flag bit that determines whether it is a uniform compensation value. When same_offset_flag is the fourth value, it represents a uniform compensation value, that is, it is determined that K pixel groups correspond to the same adjustment value (the adjustment value in this specification is also referred to as a compensation value), and at this time, it is sufficient to analyze one adjustment value. When same_offset_flag is the fifth value, it represents a non-uniform compensation value, that is, it is determined that K pixel groups correspond to K adjustment values, and at this time, it is necessary to analyze K adjustment values.
[0305] In another possible embodiment, the adjustment value grouping indication information may have multiple values, where the M adjustment values can be one adjustment value, two adjustment values, . . . , K adjustment values.
[0306] In this case, when the K pixel groups correspond to the same adjustment value, the adjustment value grouping indication information may be a fourth value, and the fourth value represents that the K pixel groups correspond to the same adjustment value. Based on this, the decoding side can know that the K pixel groups correspond to the same adjustment value after knowing that the adjustment value grouping indication information is the fourth value.
[0307] When the K pixel groups correspond to two adjustment values, for example, the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value, the adjustment value grouping indication information may be a fifth value, which indicates that the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value. Based on this, after the decoding side knows that the adjustment value grouping indication information is the fifth value, it determines that the first pixel group and the second pixel group correspond to one adjustment value, and the third pixel group and the fourth pixel group correspond to another adjustment value.
[0308] When the K pixel groups correspond to two adjustment values, for example, the first pixel group and the fourth pixel group correspond to one adjustment value, and the second pixel group and the third pixel group correspond to another adjustment value, the adjustment value grouping indication information may be a third value. Based on this, after the decoding side knows that the adjustment value grouping indication information is the third value, it determines that the first pixel group and the fourth pixel group correspond to one adjustment value, and the second pixel group and the third pixel group correspond to the other adjustment value.
[0309] Similarly in other cases, each value of the adjustment value grouping indication information corresponds to a mapping relationship, and the mapping relationship can represent a matching relationship between M adjustment values and K pixel groups, and the correspondence relationship between the values of the adjustment value grouping indication information and the mapping relationship may be agreed upon by the encoding side and the decoding side, and there is no limitation thereon.
[0310] As described above, the adjustment value grouping indication information is used to indicate the matching relationship between the M adjustment values and the K pixel groups. In addition, the decoding side may analyze the adjustment value grouping indication information from the bitstream, and then analyze the M adjustment values from the bitstream corresponding to the current image area based on the adjustment value grouping indication information, and determine the adjustment values corresponding to the K pixel groups based on the M adjustment values, that is, determine the adjustment values corresponding to the K pixel groups based on the matching relationship between the M adjustment values and the K pixel groups.
[0311] For example, each of the above embodiments may be realized alone or in combination. For example, each of the embodiments 1 to 15 may be realized alone, and at least two of the embodiments 1 to 15 may be realized in combination.
[0312] By way of example, in each of the above embodiments, the content of the encoding side may be applied to the decoding side, i.e., may be processed in the same manner by the decoding side, and the content of the decoding side may be applied to the encoding side, i.e., may be processed in the same manner by the encoding side.
[0313] Example 16: Based on the same idea as the above method, an embodiment of the present invention further provides a decoding device, which is applied to a decoding side, and includes: a memory configured to store video data; and a decoder configured to implement the decoding method in the above Examples 1 to 15, i.e., the processing flow of the decoding side.
[0314] For example, in one possible embodiment, the decoder may include: determining whether a reconstruction value adjustment needs to be performed on the current image region based on feature information corresponding to the current image region; if it is determined that a reconstruction value adjustment needs to be performed on the current image region, obtaining an adjustment parameter corresponding to the current image region from a bitstream corresponding to the current image region; and adjusting a reconstruction value of the current image region based on the adjustment parameter.
[0315] Based on the same idea as the above method, an embodiment of the present invention further provides an encoding device, which is applied to an encoding side, and includes: a memory configured to store video data; and an encoder configured to implement the encoding method in the above embodiments 1 to 15, i.e., the processing flow of the encoding side.
[0316] For example, in one possible embodiment, the encoder may determining whether a reconstruction value adjustment needs to be performed on the current image region based on feature information corresponding to the current image region; if it is determined that a reconstruction value adjustment needs to be performed for the current image region, obtaining adjustment parameters corresponding to the current image region, the adjustment parameters being used to adjust the reconstruction values for the current image region; encoding the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region.
[0317] Based on the same idea as the above method, for a decoding device (also called a video decoder) provided by an embodiment of the present invention, from a hardware perspective, its hardware architecture schematic diagram may refer to Figure 7A. It includes a processor 711 and a machine-readable storage medium 712, in which machine-executable instructions executable by the processor 711 are stored, and the processor 711 is used to execute the machine-executable instructions to implement the decoding methods of the above embodiments 1 to 15 of the present invention.
[0318] Based on the same idea as the above method, for an encoding device (also called a video encoder) provided by an embodiment of the present invention, from a hardware perspective, its hardware architecture schematic diagram may refer to Fig. 7B, which includes a processor 721 and a machine-readable storage medium 722, in which machine-executable instructions executable by the processor 721 are stored, and the processor 721 is used to execute the machine-executable instructions to implement the encoding methods of the above embodiments 1 to 15 of the present invention.
[0319] Based on the same idea as the above method, an embodiment of the present invention further provides a machine-readable storage medium having stored thereon some computer instructions, which, when executed by a processor, can implement the methods disclosed in the above examples of the present invention, such as the decoding method or the encoding method in each of the above embodiments.
[0320] Based on the same idea as the above method, an embodiment of the present invention further provides a computer application program, which, when executed by a processor, can implement the decoding method or the encoding method disclosed in the above example of the present invention.
[0321] Based on the same idea as the above method, an embodiment of the present invention further provides a decoding device, which is applied to a decoding side, and includes: a decision module for determining whether reconstruction value adjustment needs to be performed on the current image region based on feature information corresponding to the current image region; an acquisition module for acquiring adjustment parameters corresponding to the current image region from a bitstream corresponding to the current image region when it is determined that reconstruction value adjustment needs to be performed on the current image region; and an adjustment module for adjusting the reconstruction values of the current image region based on the adjustment parameters.
[0322] Exemplarily, the feature information includes a first type of feature information, and when the determination module determines whether or not reconstruction value adjustment needs to be performed on the current image region based on the feature information corresponding to the current image region, specifically, if the first type of feature information corresponding to the current image region satisfies a first specific condition, a flag bit corresponding to an adjustment control switch is obtained from a bit stream corresponding to the current image region, and used to determine whether or not reconstruction value adjustment needs to be performed on the current image region based on the flag bit, and if the flag bit is a first value, it is determined that reconstruction value adjustment needs to be performed on the current image region, and if the flag bit is a second value, it is determined that reconstruction value adjustment does not need to be performed on the current image region.
[0323] Exemplarily, when determining whether reconstruction value adjustment needs to be performed on the current image region based on feature information corresponding to the current image region, the determination module is specifically used to determine that reconstruction value adjustment does not need to be performed on the current image region if a first type of feature information corresponding to the current image region does not satisfy a first specific condition.
[0324] Exemplarily, the feature information includes a second type of feature information, and when the determination module determines whether or not reconstruction value adjustment needs to be performed on the current image region based on the feature information corresponding to the current image region, the determination module is specifically used to determine that reconstruction value adjustment needs to be performed on the current image region if the second type of feature information corresponding to the current image region satisfies a second specific condition, and to determine that reconstruction value adjustment does not need to be performed on the current image region if the second type of feature information corresponding to the current image region does not satisfy the second specific condition.
[0325] Exemplarily, the adjustment parameters corresponding to the current image region include a plurality of adjustment values, the current image region corresponds to a plurality of pixel groups, the plurality of adjustment values include adjustment values corresponding to K pixel groups, the K pixel groups being all or some of the plurality of pixel groups, and when the adjustment module adjusts the reconstruction value of the current image region based on the adjustment parameters, specifically, for each pixel group among the K pixel groups, if the plurality of adjustment values includes an adjustment value corresponding to the pixel group, the adjustment module is used to adjust the reconstruction value of a pixel point in the pixel group based on the adjustment value corresponding to the pixel group.
[0326] Exemplarily, the acquisition module further acquires adjustment value grouping indication information from a bitstream corresponding to the current image area, where the adjustment value grouping indication information is used to indicate a mapping relationship between adjustment values and the K pixel groups, and analyzes M adjustment values from the bitstream corresponding to the current image area based on the adjustment value grouping indication information, where M is a positive integer and is less than or equal to K, and is used to determine adjustment values corresponding to the K pixel groups based on the M adjustment values.
[0327] Exemplarily, the determination module is further used to determine a plurality of pixel groups corresponding to the current image region based on an unadjusted reconstruction value of each pixel point, or a classification value of a pixel point based on unadjusted reconstruction values of pixel points surrounding the pixel point and a plurality of pixel groups corresponding to the current image region based on the classification value of each pixel point, or a method of determining a plurality of pixel groups corresponding to the current image region based on a pixel position of each pixel point, or a method of determining a plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region, or a method of determining a plurality of pixel groups corresponding to the current image region based on a scanning order of the current image region.
[0328] Exemplarily, the determination module is used to determine a plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region, specifically, to determine a division number, a filtering area, and a division method of the pixel group based on the prediction mode of the current image region, and to determine a plurality of pixel groups corresponding to the current image region based on the division number, the filtering area, and the division method. The determination module is used to determine a division number, a filtering area, and a division method of the pixel group based on a prediction mode of the current image region, specifically, when the prediction mode of the current image region is a horizontal prediction mode, determine a division number of the pixel group to be a first division number, determine a filtering area of the pixel group to be a first filtering area, and determine a division method to be a first size specification, and when the prediction mode of the current image region is not a horizontal prediction mode, determine a division number of the pixel group to be a second division number, determine a filtering area of the pixel group to be a second filtering area, and determine a division method to be a second size specification.
[0329] Based on the same idea as the above method, an embodiment of the present invention further provides an encoding apparatus, where the encoding apparatus is applied to an encoding side, and the encoding apparatus includes: a decision module for determining whether a reconstruction value adjustment needs to be performed on a current image region based on feature information corresponding to the current image region; an acquisition module for acquiring adjustment parameters corresponding to the current image region when it is determined that a reconstruction value adjustment needs to be performed on the current image region, where the adjustment parameters are used to adjust the reconstruction values of the current image region; and an encoding module for encoding the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region.
[0330] Exemplarily, the feature information includes a first type of feature information, and when the determination module determines whether reconstruction value adjustment needs to be performed on the current image region based on the feature information corresponding to the current image region, specifically, if the first type of feature information corresponding to the current image region satisfies a first specific condition, it determines whether reconstruction value adjustment needs to be performed on the current image region, and encodes a flag bit corresponding to an adjustment control switch into a bitstream corresponding to the current image region, the flag bit is used to indicate whether reconstruction value adjustment needs to be performed on the current image region, and is used to determine that reconstruction value adjustment is not needed for the current image region if the first type of feature information corresponding to the current image region does not satisfy a first specific condition.
[0331] Exemplarily, the current image region corresponds to a plurality of pixel groups, and the adjustment parameters corresponding to the current image region include a plurality of adjustment values, the plurality of adjustment values including adjustment values corresponding to K pixel groups, the K pixel groups being all or a portion of the plurality of pixel groups; when the encoding module encodes the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region, the encoding module is specifically used to encode M adjustment values corresponding to the K pixel groups into a bitstream corresponding to the current image region, where M is a positive integer and is less than or equal to K, where the M adjustment values are determined based on the adjustment values corresponding to the K pixel groups; and the encoding module is further used to encode adjustment value grouping indication information into the bitstream corresponding to the current image region, the adjustment value grouping indication information being used to indicate a matching relationship between the M adjustment values and the K pixel groups.
[0332] Exemplarily, the determination module is further used to determine a plurality of pixel groups corresponding to the current image region based on an unadjusted reconstruction value of each pixel point, or a classification value of a pixel point based on unadjusted reconstruction values of pixel points surrounding the pixel point and a plurality of pixel groups corresponding to the current image region based on the classification value of each pixel point, or a method of determining a plurality of pixel groups corresponding to the current image region based on a pixel position of each pixel point, or a method of determining a plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region, or a method of determining a plurality of pixel groups corresponding to the current image region based on a scanning order of the current image region.
[0333] Exemplarily, the determination module is used to determine a plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region, specifically, to determine a division number, a filtering area, and a division method of the pixel group based on the prediction mode of the current image region, and to determine a plurality of pixel groups corresponding to the current image region based on the division number, the filtering area, and the division method. The determination module is used to determine a division number, a filtering area, and a division method of the pixel group based on a prediction mode of the current image region, specifically, when the prediction mode of the current image region is a horizontal prediction mode, determine a division number of the pixel group to be a first division number, determine a filtering area of the pixel group to be a first filtering area, and determine a division method to be a first size specification, and when the prediction mode of the current image region is not a horizontal prediction mode, determine a division number of the pixel group to be a second division number, determine a filtering area of the pixel group to be a second filtering area, and determine a division method to be a second size specification.
[0334] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as a method, a system, or a computer program product. The present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware. The embodiments of the present invention may take the form of a computer program product embodied on one or more computer usable storage mediums (including, but not limited to, magnetic disk memories, CD-ROMs, optical memories, etc.) containing computer usable program code.
[0335] The above is merely an embodiment of the present invention, and is not intended to limit the present invention. Various modifications and changes can be made to the present invention by those skilled in the art. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are intended to be included in the scope of the claims of the present invention. [Explanation of symbols]
[0336] 711 Processor 712 Machine-readable storage medium 721 Processor 722 Machine-readable storage medium
Claims
1. A decoding method applied to a decoding side, comprising: determining whether a reconstruction value adjustment needs to be performed for a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region from a bitstream corresponding to the current image region; and adjusting a reconstruction value of the current image region based on the adjustment parameters. A decoding method comprising:
2. The feature information includes a first type of feature information, and the step of determining whether the reconstruction value adjustment needs to be performed on the current image region based on the feature information corresponding to the current image region includes: When the first type of feature information corresponding to the current image region satisfies a first specific condition, the method includes a step of obtaining a flag bit corresponding to an adjustment control switch from a bit stream corresponding to the current image region, and determining whether or not a reconstruction value adjustment needs to be performed on the current image region based on the flag bit, and when the flag bit is a first value, determining that the reconstruction value adjustment needs to be performed on the current image region, and when the flag bit is a second value, determining that the reconstruction value adjustment does not need to be performed on the current image region.
2. The method of claim 1 .
3. determining whether the reconstruction value adjustment needs to be performed on the current image region based on feature information corresponding to the current image region, determining that the reconstruction value adjustment is not required for the current image region when the first type of feature information corresponding to the current image region does not satisfy the first specific condition; 3. The method of claim 2 .
4. the first type of feature information includes at least one of a prediction mode, an amount of data in a bitstream buffer, and a quantization step; When the first type of feature information includes the prediction mode, if the prediction mode is a designated prediction mode, determining that the prediction mode satisfies the first specific condition, and otherwise determining that the prediction mode does not satisfy the first specific condition.
4. The method according to claim 2 or 3.
5. The specified prediction mode is a normal intraframe prediction mode.
5. The method of claim 4.
6. the adjustment parameter corresponding to the current image region includes a plurality of adjustment values, the current image region corresponds to a plurality of pixel groups, the plurality of adjustment values includes adjustment values corresponding to K pixel groups, the K pixel groups being all or a portion of the plurality of pixel groups; The step of adjusting the reconstruction value of the current image region based on the adjustment parameter includes: and for each pixel group among the K pixel groups, if the plurality of adjustment values includes an adjustment value corresponding to the pixel group, adjusting the reconstruction values of pixel points in the pixel group based on the adjustment value corresponding to the pixel group, where K is an integer greater than or equal to 1.
2. The method of claim 1 .
7. If the K pixel groups are a part of the plurality of pixel groups, obtaining pixel group indication information corresponding to the K pixel groups from the bitstream corresponding to the current image region; selecting the K pixel groups from all pixel groups based on the pixel group indication information; The pixel group indication information is used to distinguish a pixel group of a target category from pixel groups of all categories.
7. The method of claim 6.
8. The current image region corresponds to a plurality of pixel groups, determining the plurality of pixel groups corresponding to the current image region based on pixel positions of each of the pixel points of the current image region; or determining the plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region; 7. The method of claim 6.
9. Determining the plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region includes: determining a division number, a filtering region, and a division manner of a pixel group according to the prediction mode of the current image region; determining the plurality of pixel groups corresponding to the current image region based on the division number, the filtering region, and the division scheme; 9. The method of claim 8.
10. The step of determining a division number, a filtering region, and a division method of a pixel group based on the prediction mode of the current image region includes: When the prediction mode of the current image area is a horizontal prediction mode, determining that the division number of the pixel group is a first division number, determining that the filtering area of the pixel group is a first filtering area, and determining that the division scheme is a first size specification; If the prediction mode of the current image region is not the horizontal prediction mode, determining the division number of the pixel group to be a second division number, determining the filtering region of the pixel group to be a second filtering region, and determining the division scheme to be a second size specification.
10. The method of claim 9.
11. When the current image area is a 16*2 image block, the step of determining the plurality of pixel groups corresponding to the current image area according to a prediction mode of the current image area includes: If the prediction mode of the current image area is a horizontal prediction mode, dividing all the pixel points of the current image area into four pixel groups, each of which has a size of 8*1; If the prediction mode of the current image area is not a horizontal prediction mode, dividing all the pixel points of the current image area into four pixel groups, each of which has a size of 4*2.
10. The method according to claim 8 or 9.
12. An encoding method applied to the encoding side, comprising: determining whether a reconstruction value adjustment needs to be performed for a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region, the adjustment parameters being used to adjust the reconstruction values of the current image region; encoding the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region; 13. An encoding method comprising:
13. The feature information includes a first type of feature information, and the step of determining whether the reconstruction value adjustment needs to be performed on the current image region based on the feature information corresponding to the current image region includes: determining whether the reconstruction value adjustment needs to be performed on the current image region when the first type of feature information corresponding to the current image region satisfies a first specific condition, and encoding a flag bit corresponding to an adjustment control switch into the bitstream corresponding to the current image region, the flag bit being used to indicate whether the reconstruction value adjustment needs to be performed on the current image region; determining that the reconstruction value adjustment does not need to be performed on the current image region when the first type of feature information corresponding to the current image region does not satisfy the first specific condition; 13. The method of claim 12.
14. the first type of feature information includes at least one of a prediction mode, an amount of data in a bitstream buffer, and a quantization step; When the first type of feature information includes the prediction mode, if the prediction mode is a designated prediction mode, determining that the prediction mode satisfies the first specific condition, and otherwise determining that the prediction mode does not satisfy the first specific condition.
14. The method of claim 13.
15. The current image region corresponds to a plurality of pixel groups, and the adjustment parameters corresponding to the current image region include a plurality of adjustment values, the plurality of adjustment values include adjustment values corresponding to K pixel groups, and the K pixel groups are all or a portion of the plurality of pixel groups.
13. The method of claim 12.
16. The current image region corresponds to a plurality of pixel groups, determining the plurality of pixel groups corresponding to the current image region based on pixel positions of each pixel point of the current image region; or determining the plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region; 16. The method of claim 15 .
17. Determining the plurality of pixel groups corresponding to the current image region based on a prediction mode of the current image region includes: determining a division number, a filtering region, and a division manner of a pixel group according to the prediction mode of the current image region; determining the plurality of pixel groups corresponding to the current image region based on the division number, the filtering region, and the division scheme; 17. The method of claim 16.
18. The step of determining a division number, a filtering region, and a division method of a pixel group based on the prediction mode of the current image region includes: When the prediction mode of the current image area is a horizontal prediction mode, determining that the division number of the pixel group is a first division number, determining that the filtering area of the pixel group is a first filtering area, and determining that the division scheme is a first size specification; If the prediction mode of the current image region is not the horizontal prediction mode, determining the division number of the pixel group to be a second division number, determining the filtering region of the pixel group to be a second filtering region, and determining the division scheme to be a second size specification.
20. The method of claim 17 .
19. a memory configured to store video data; determining whether a reconstruction value adjustment needs to be performed for a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region from a bitstream corresponding to the current image region; adjusting a reconstruction value of the current image region based on the adjustment parameters. A decoding device comprising:
20. a memory configured to store video data; determining whether a reconstruction value adjustment needs to be performed for a current image region based on feature information corresponding to the current image region; if it is determined that the reconstruction value adjustment needs to be performed on the current image region, obtaining adjustment parameters corresponding to the current image region, the adjustment parameters being used to adjust the reconstruction values of the current image region; and encoding the adjustment parameters corresponding to the current image region into a bitstream corresponding to the current image region.
13. An encoding device comprising:
21. A decoding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions to perform the method of any one of claims 1 to 11.
13. A decoding device comprising:
22. A coding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions to perform the method of any one of claims 12 to 18.
13. An encoding device comprising:
23. A machine-readable storage medium having stored thereon computer instructions which, when executed by at least one processor, perform the method of any one of claims 1 to 11. A machine-readable storage medium comprising:
24. A machine-readable storage medium having stored thereon computer instructions, which, when executed by at least one processor, perform the method of any one of claims 12 to 18. A machine-readable storage medium comprising:
Citation Information
Patent Citations
Method and apparatus for in-loop artifact removal filtering
JP2010509842A
Image filter device, decoding apparatus, encoding apparatus, and data structure
WO2011158657A1