Image decoding and coding method and device, equipment and storage medium
By obtaining the distinction information of feature channels and spatial point points, the inverse quantization accuracy parameters are constructed, and the problem of insufficient quantizer performance in the prior art is solved, the performance of image encoding and decoding is improved, and the better encoding effect is achieved.
Patent Information
- Application Number
- CN202411377070.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-01
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2043-03-01
AI Technical Summary
In the prior art, the performance of the quantizer is poor during image encoding and decoding, and the difference in the feature channels and textures of the image cannot be effectively considered, resulting in limited encoding performance.
By obtaining feature channel distinction information and spatial point distinction information, decode the image code stream, construct inverse quantization accuracy parameters of quantization residual value, perform inverse quantization and synthesis transformation, obtain reconstructed image blocks, and then according to the feature channel during encoding process and texture difference set the quantization parameters.
The performance of image encoding and decoding is improved, and through more refined quantization parameter settings, the quantization loss of important features is reduced and the encoding performance is improved.
Smart Images

Figure CN119110066A_ABST
Abstract
Description
[0001] This invention patent application is a divisional application of the Chinese invention patent application with application date of March 1, 2023, application number 202310209226.1, and name “Image decoding and encoding method, device, equipment and storage medium”. Technical Field
[0002] The present invention relates to the field of image processing technology, and in particular to an image decoding and encoding method, device, equipment and storage medium. Background Art
[0003] End-to-end image coding and decoding technology generally includes modules such as analysis transform network, synthesis transform network, context-based prediction, quantization, entropy coding, super coding network, and super-scale decoding network. Among them, quantization is a "many-to-one" mapping process, which will cause signal loss. Quantization acts on the residual and can change the value range of the signal, so that the encoder can give a good approximation of the original signal with a small number of symbols, thereby improving the compression rate. However, usually, the quantization module does not consider the differences in feature channels and image textures when performing quantization, which limits the quantization performance of the quantizer.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present invention is to provide an image decoding and encoding method, device, equipment and storage medium, aiming to solve the technical problem of poor performance of quantizers in image encoding and decoding processes in the prior art.
[0006] To achieve the above object, the present invention provides an image decoding method, the method comprising the following steps:
[0007] Acquire characteristic channel distinguishing information and / or spatial point distinguishing information, and decode the image code stream to obtain a quantized residual value;
[0008] Constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinguishing information and / or the spatial point distinguishing information;
[0009] For any quantized residual value, dequantize the quantized residual value based on the dequantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value;
[0010] The reconstructed residual value is subjected to a synthetic transformation to obtain a reconstructed image block.
[0011] In a possible implementation manner of the present application, the step of decoding the image code stream to obtain a quantized residual value includes:
[0012] Extracting coding profile parameters from the first image code stream;
[0013] Decoding the coded distribution parameters to obtain probability distribution parameters;
[0014] quantizing the probability distribution parameters to obtain distribution quantization parameters;
[0015] The second image code stream is decoded based on the distributed quantization parameter to obtain the quantized residual value.
[0016] In a possible implementation manner of the present application, the step of quantizing the probability distribution parameter to obtain a distribution quantization parameter includes:
[0017] Constructing a probability quantization parameter according to the characteristic channel distinguishing information and / or the spatial point distinguishing information;
[0018] The probability distribution parameter is quantized based on the probability quantization parameter to obtain a distribution quantization parameter.
[0019] In a possible implementation manner of the present application, the step of acquiring characteristic channel distinction information and / or spatial point distinction information includes:
[0020] The image code stream is decoded to obtain feature channel distinction information and / or space point distinction information.
[0021] In a possible implementation manner of the present application, the image code stream further includes a third image code stream, and the third image code stream is used to transmit distinguishing information;
[0022] The step of obtaining characteristic channel distinguishing information and / or spatial point distinguishing information comprises:
[0023] The third image code stream is decoded to obtain feature channel distinguishing information and / or space point distinguishing information.
[0024] In a possible implementation manner of the present application, the step of constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information includes:
[0025] Extracting the quantization step length corresponding to each type of feature channel from the feature channel distinction information;
[0026] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0027] In a possible implementation manner of the present application, the step of constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information includes:
[0028] Extracting the quantization step length corresponding to each type of spatial point from the spatial point distinction information;
[0029] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0030] In a possible implementation manner of the present application, the step of constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information includes:
[0031] Reading the various types of divided spatial points from the spatial point distinction information;
[0032] Reading the quantization step lengths corresponding to each type of characteristic channel in each type of spatial point from the characteristic channel distinction information;
[0033] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0034] In a possible implementation manner of the present application, the step of constructing, according to the quantization step size, inverse quantization precision parameters corresponding to each quantized residual value, respectively, includes:
[0035] Decode the image code stream to obtain probability distribution parameters;
[0036] Extracting parameter interval thresholds from the characteristic channel distinction information;
[0037] The inverse quantization precision parameters corresponding to each quantization residual value are constructed according to the probability distribution parameter, the quantization step size and the parameter interval threshold.
[0038] In a possible implementation manner of the present application, the step of constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information includes:
[0039] Extracting the image block information and parameter setting rules corresponding to each feature channel from the feature channel distinction information;
[0040] Decode the image code stream to obtain probability distribution parameters;
[0041] Calculate the distribution parameter mean corresponding to each image block information according to the probability distribution parameter;
[0042] Matching the distribution parameter mean with the parameter setting rule to obtain the quantization step corresponding to each image block information;
[0043] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0044] In a possible implementation manner of the present application, the step of constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information includes:
[0045] The feature channel distinction information is parsed, and for any quantized residual value, a segmented step size set corresponding to each type of feature channel is obtained, wherein the segmented step size set corresponding to one type of feature channel includes a plurality of different quantized step sizes;
[0046] Extracting the quantization step corresponding to the channel segment to which the quantized residual value belongs from the segment step set corresponding to one type of feature channel;
[0047] The inverse quantization precision parameters corresponding to the quantization residual values are constructed according to the quantization step size.
[0048] In addition, to achieve the above object, the present invention also provides an image encoding method, which comprises the following steps:
[0049] Perform analysis and transformation on the image block to be processed to obtain image features;
[0050] Performing residual calculation on the image features to obtain image residual values and probability distribution parameters;
[0051] Constructing quantization precision parameters corresponding to the residual values of each image according to the feature channel distinction information and / or the spatial point distinction information;
[0052] Quantizing the image residual value based on the quantization precision parameter to obtain a quantized residual value;
[0053] The probability distribution parameter and the quantized residual value are written into an image code stream.
[0054] In a possible implementation manner of the present application, the step of writing the probability distribution parameter and the quantized residual value into an image bitstream includes:
[0055] Writing the probability distribution parameters into the first image code stream;
[0056] Constructing distribution quantization parameters according to the probability distribution parameters;
[0057] The quantized residual value is written into a second image code stream based on the distributed quantization parameter.
[0058] In a possible implementation manner of the present application, the step of constructing a distribution quantization parameter according to the probability distribution parameter includes:
[0059] Constructing a probability quantization parameter according to the characteristic channel distinguishing information and / or the spatial point distinguishing information;
[0060] The probability distribution parameter is quantized based on the probability quantization parameter to obtain a distribution quantization parameter.
[0061] In a possible implementation manner of the present application, the image encoding method further includes:
[0062] The feature channel distinguishing information and / or the space point distinguishing information are written into the image code stream.
[0063] In a possible implementation manner of the present application, the image code stream further includes a third image code stream, and the third image code stream is used to transmit distinguishing information;
[0064] After the step of writing the quantized residual value into the second image code stream based on the distributed quantization parameter, the method further includes:
[0065] The feature channel distinguishing information and / or the space point distinguishing information are written into the third image code stream.
[0066] In a possible implementation manner of the present application, the step of constructing quantization precision parameters corresponding to each image residual value according to feature channel distinction information and / or spatial point distinction information includes:
[0067] Extract the quantization step size corresponding to each type of feature channel from the feature channel distinction information;
[0068] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0069] In a possible implementation manner of the present application, the step of constructing quantization precision parameters corresponding to each image residual value according to the quantization step size includes:
[0070] Extracting parameter interval thresholds from the characteristic channel distinction information;
[0071] The quantization precision parameters corresponding to the respective image residual values are constructed according to the probability distribution parameters, the parameter interval threshold and the quantization step size.
[0072] In a possible implementation manner of the present application, the step of constructing quantization precision parameters corresponding to each image residual value according to feature channel distinction information and / or spatial point distinction information includes:
[0073] The feature channel distinction information is parsed, and for any image residual value, a segmented step size set corresponding to each type of feature channel is obtained, wherein the segmented step size set corresponding to one type of feature channel includes a plurality of different quantization step sizes;
[0074] Extract the quantization step size corresponding to the channel segment to which the image residual value belongs from the segment step size set corresponding to one type of feature channel;
[0075] The quantization precision parameters corresponding to the image residual values are constructed according to the quantization step size.
[0076] In a possible implementation manner of the present application, the step of constructing quantization precision parameters corresponding to each image residual value according to feature channel distinction information and / or spatial point distinction information includes:
[0077] Extract the quantization step size corresponding to each type of spatial point from the spatial point distinction information;
[0078] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0079] In a possible implementation manner of the present application, the step of constructing quantization precision parameters corresponding to each image residual value according to feature channel distinction information and / or spatial point distinction information includes:
[0080] Read various types of divided spatial points from the spatial point distinction information;
[0081] Distinguish information from the feature channels and read the quantization step lengths corresponding to each feature channel in each spatial point;
[0082] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0083] In a possible implementation manner of the present application, the step of writing the probability distribution parameter and the quantized residual value into an image bitstream includes:
[0084] Perform image decoding according to the probability distribution parameter, the quantized residual value and the characteristic channel distinction information to obtain a reconstructed image block and an image bit rate;
[0085] Adjusting the characteristic channel distinguishing information and / or the spatial point distinguishing information according to the reconstructed image block and the image bit rate;
[0086] If the current adjustment round is greater than or equal to the preset adjustment round, the probability distribution parameter and the quantized residual value are written into the image code stream.
[0087] In a possible implementation manner of the present application, after the step of adjusting the characteristic channel distinction information and / or the spatial point distinction information according to the reconstructed image block and the image bit rate, the step further includes:
[0088] If the current adjustment round is less than the preset adjustment round, the method returns to the step of constructing the quantization precision parameters corresponding to each feature channel according to the feature channel distinction information.
[0089] In addition, to achieve the above object, the present invention further provides an image decoding device, the image decoding device comprising:
[0090] An entropy decoding module is used to obtain feature channel distinguishing information and / or spatial point distinguishing information, and decode the image code stream to obtain a quantized residual value;
[0091] A parameter construction module, used to construct an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information;
[0092] A dequantization module, configured to dequantize any quantized residual value based on the dequantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value;
[0093] The synthesis transformation module is used to perform synthesis transformation on the reconstructed residual value to obtain a reconstructed image block.
[0094] In addition, to achieve the above object, the present invention further provides an image encoding device, the image encoding device comprising:
[0095] An analysis and transformation module is used to perform analysis and transformation processing on the image block to be processed to obtain image features;
[0096] A residual calculation module, used to perform residual calculation on the image features to obtain image residual values and probability distribution parameters;
[0097] A parameter construction module, used to construct quantization precision parameters corresponding to each characteristic channel according to characteristic channel distinction information and / or spatial point distinction information;
[0098] A quantization module, used for performing quantization processing on the image residual value based on the quantization precision parameter to obtain a quantized residual value;
[0099] The entropy coding module is used to write the probability distribution parameter and the quantized residual value into the image code stream.
[0100] In addition, to achieve the above-mentioned purpose, the present invention also proposes a decoding device, which includes: a processor, a memory, and a decoding program stored in the memory and executable on the processor, and when the decoding program is executed by the processor, the image decoding method as described above is implemented.
[0101] In addition, to achieve the above-mentioned purpose, the present invention also proposes a coding device, which includes: a processor, a memory, and a coding program stored in the memory and executable on the processor, and when the coding program is executed by the processor, the image coding method as described above is implemented.
[0102] In addition, to achieve the above-mentioned object, the present invention further provides a computer-readable storage medium, on which an image decoding program and / or an image encoding program is stored;
[0103] The image decoding program implements the image decoding method described above when it is executed, or the image encoding program implements the image encoding method described above when it is executed.
[0104] The present invention obtains characteristic channel distinguishing information and / or spatial point distinguishing information, and decodes the image code stream to obtain quantized residual values; constructs inverse quantization precision parameters corresponding to each quantized residual value according to the characteristic channel distinguishing information and / or the spatial point distinguishing information; inversely quantizes the quantized residual value based on the inverse quantization precision parameter to obtain a reconstructed residual value; and performs a synthetic transformation on the reconstructed residual value to obtain a reconstructed image block. Since the corresponding inverse quantization parameters are constructed according to the characteristic channel distinguishing information and / or the spatial point distinguishing information for inverse quantization, different quantization parameters can also be set according to the difference in the characteristic channel and spatial point image texture during the encoding process, so that more important features bear a smaller quantization loss, thereby improving the encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0105] Figure 1 It is a schematic diagram of the structure of an electronic device in a hardware operating environment involved in an embodiment of the present invention;
[0106] Figure 2 A schematic diagram of a flow chart of a first embodiment of an image decoding method of the present invention;
[0107] Figure 3 A schematic diagram of an image encoding and decoding process according to an embodiment of the present invention;
[0108] Figure 4 A schematic diagram of a characteristic channel according to an embodiment of the present invention;
[0109] Figure 5 A two-dimensional schematic diagram of the average value of the probability distribution parameters of characteristic channels according to an embodiment of the present invention;
[0110] Figure 6 A schematic diagram of a flow chart of a second embodiment of an image decoding method according to the present invention;
[0111] Figure 7 A schematic diagram of a decoding process according to an embodiment of the present invention;
[0112] Figure 8 A schematic diagram of a flow chart of a third embodiment of an image decoding method according to the present invention;
[0113] Fig. 9 A schematic diagram of an identification matrix according to an embodiment of the present invention;
[0114] Fig.10 A schematic diagram of row and column division according to an embodiment of the present invention;
[0115] Fig.11 A schematic diagram of a flow chart of a fourth embodiment of an image decoding method according to the present invention;
[0116] Fig.12 A schematic diagram of spatial point classification according to an embodiment of the present invention;
[0117] Fig.13 It is a flowchart of a first embodiment of an image encoding method of the present invention;
[0118] Fig.14 A schematic diagram of an image encoding process according to an embodiment of the present invention;
[0119] Fig.15 A schematic diagram of a flow chart of a second embodiment of an image encoding method according to the present invention;
[0120] Fig.16 A schematic diagram of a flow chart of a third embodiment of an image encoding method according to the present invention;
[0121] Fig.17 This is a schematic diagram of the optimal threshold mode flag function process according to an embodiment of the present invention;
[0122] Fig.18 A parameter optimization flow chart of an embodiment of the present invention;
[0123] Fig.19 is a structural block diagram of a first embodiment of an image decoding device according to the present invention;
[0124] Fig. 20 FIG. 4 is a structural block diagram of the first embodiment of the image encoding device of the present invention.
[0125] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0126] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0127] Reference Figure 1 , Figure 1 The present invention is a schematic diagram of the structure of an encoding device or a decoding device in a hardware operating environment involved in an embodiment of the present invention.
[0128] like Figure 1As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0129] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0130] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and an image encoding program and / or an image decoding program.
[0131] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in an encoding device or a decoding device, and the electronic device calls the encoding program stored in the memory 1005 through the processor 1001 and executes the image encoding method provided by an embodiment of the present invention, or calls the image decoding program stored in the memory 1005 through the processor 1001 and executes the image decoding method provided by an embodiment of the present invention.
[0132] In some embodiments of the present application, the difference of feature channels is considered to improve the quantization accuracy to enhance the performance of the quantizer. For example, the feature channels are classified according to their differences, and feature channels of different importance have different quantization accuracy. Features can also be classified according to texture complexity differences, and feature areas of different texture complexity have different quantization accuracy. In the present application, all information used for feature channel classification belongs to the relevant information for distinguishing feature channels. The features classified by the above information will be quantized with different accuracy, that is, different quantization step sizes will be used, so that more important features will bear smaller quantization losses, making the prediction of the features to be encoded more accurate, and thus obtaining a better feature reconstruction value y_hat, and finally achieving the purpose of obtaining better encoding performance.
[0133] The embodiment of the present invention provides an image decoding method, referring to Figure 2 , Figure 2 The figure is a flowchart of a first embodiment of an image decoding method according to the present invention.
[0134] In this embodiment, the image decoding method includes the following steps S10-S40.
[0135] Step S10: Acquire characteristic channel distinguishing information and / or spatial point distinguishing information, and decode the image code stream to obtain a quantized residual value.
[0136] It should be noted that the executor of this embodiment may be a decoding device for decoding image data. The decoding device may be an electronic device such as a camera, a mobile terminal, a personal computer, a server, etc. Of course, it may also be other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the image decoding method of the present invention is described by taking a decoding device as an example.
[0137] Among them, since during the image encoding process, the encoding device generally decodes the encoded image code stream after the encoding is completed, and determines whether the parameters used in the encoding need to be adjusted according to the image quality of the decoded image, the executor of this embodiment can also be the encoding device.
[0138] In the embodiments of the present application, some technical terms that may be involved in the process of encoding or decoding an image include: quantization and dequantization (Quantization and Dequantization), scalar quantization (SQ, Scalar Quantization), entropy coding (Entropy Encoding), convolutional neural network (Convolutional Neural Network, CNN), feature channel (Feature Channel), etc., which are explained here.
[0139] Among them, quantization refers to the process of mapping the continuous value of the signal (or a large number of discrete values) into a finite number of discrete amplitudes, realizing a many-to-one mapping of the signal values. In video coding, after the residual signal is transformed, the transform coefficients often have a large dynamic range. Therefore, quantizing the transform coefficients can effectively reduce the signal value space and obtain better compression effects. At the same time, due to the many-to-one mapping mechanism, the quantization process will inevitably introduce distortion, which is the root cause of distortion in video coding.
[0140] Inverse quantization is the reverse process of quantization, which maps the quantized coefficients to a reconstructed signal in the input signal space. The reconstructed signal is an approximation of the input signal.
[0141] Scalar quantization is the most basic quantization method, which maps continuous signals (or signals with a large number of discrete values) into several discrete signals. Specifically, the input of scalar quantization is a one-dimensional scalar signal. It first divides the input signal space into a series of non-intersecting intervals, and selects a representative signal for each interval; then for each input signal, scalar quantization maps it to the representative signal of the interval in which it is located.
[0142] The simplest scalar quantization method is uniform scalar quantization, which divides the input signal space into equally spaced intervals, and the representative signal of each interval is the midpoint of the interval. The interval length is called the quantization step, the interval index is called the level, and the parameter that characterizes the quantization step is the quantization parameter (QP).
[0143] The optimal scalar quantizer is the Lloyd-Max quantizer, which takes into account the distribution of the input signal. The interval division is non-uniform, the representative signal of each interval is the probability centroid of the interval, and the boundary point between two adjacent intervals is the midpoint of the representative signals of the two intervals.
[0144] Entropy coding is a coding process that does not lose any information according to the entropy principle. Information entropy is the average amount of information in the source (a measure of uncertainty). Common entropy coding methods include Shannon coding, Huffman coding, and arithmetic coding.
[0145] Neural Network (NN):
[0146] The neural network mentioned here refers to artificial neural networks, not biological neural networks. A neural network is a computational model consisting of a large number of nodes (or neurons) connected to each other. In an artificial neural network, neuron processing units can represent different objects, such as features, letters, concepts, or some meaningful abstract patterns. The types of processing units in the network are divided into three categories: input units, output units, and hidden units. Input units receive signals and data from the outside world; output units realize the output of system processing results; hidden units are units between input and output units and cannot be observed from outside the system. The connection weights between neurons reflect the connection strength between units, and the representation and processing of information are reflected in the connection relationship of network processing units. Artificial neural networks are a non-programmed, brain-like information processing method. Its essence is to obtain a parallel and distributed information processing function through the transformation and dynamic behavior of the network, and imitate the information processing function of the human brain nervous system to varying degrees and levels. At present, in the field of video processing, commonly used neural networks include convolutional neural networks (CNN), recurrent neural networks (RNN), fully connected networks, etc.
[0147] Convolutional neural network is a feedforward neural network and one of the most representative network structures in deep learning technology. Its artificial neurons can respond to surrounding units within a certain coverage area and perform well in large image processing.
[0148] Generally, the basic structure of CNN includes two layers, one is the feature extraction layer (also called convolution layer), the input of each neuron is connected to the local receptive field of the previous layer, and the local feature is extracted. Once the local feature is extracted, the positional relationship between the local feature and other features is also determined; the second is the feature mapping layer (also called activation layer), each computing layer of the network is composed of multiple feature maps, each feature map is a plane, and the weights of all neurons on the plane are equal. The feature mapping structure can use Sigmoid function, ReLU function, Leaky-ReLU function, PReLU function, GDN function, etc. as the activation function of the convolutional network. In addition, since neurons on a mapping surface share weights, the number of free parameters of the network is reduced.
[0149] One of the advantages of CNN over traditional image processing algorithms is that it avoids the complex pre-processing of images (extracting artificial features, etc.), and can directly input the original image for end-to-end learning. One of the advantages of CNN over traditional neural networks is that traditional neural networks are all fully connected, that is, the neurons from the input layer to the hidden layer are all connected, which will result in a huge number of parameters, making network training time-consuming or even difficult to train, while CNN avoids this difficulty through methods such as local connection and weight sharing.
[0150] In a neural network, the input signal can obtain many feature maps after passing through the convolution layer. Each feature map is called a feature channel and contains a part of the information of the input signal.
[0151] It should be noted that the feature channel distinguishing information may be distinguishing information for dividing the feature channels of the image, and the feature channel distinguishing information may include rules for dividing the feature channels, and quantization precision parameters when quantizing the residual values corresponding to each type of feature channel after the division. The spatial point distinguishing information may be distinguishing information for classifying each point in the image, and the spatial point distinguishing information may include rules for dividing each spatial point in the image based on the image texture. If necessary, the spatial point distinguishing information may also include quantization precision parameters when quantizing the residual values corresponding to each type of spatial point after the division.
[0152] Among them, the feature channel or spatial point division rules can be set based on probability distribution parameters, or based on the mean value or variance of the probability distribution parameters. For example, the corresponding threshold is set to obtain multiple value intervals, and the feature channel is divided into multiple categories according to the value interval to which the corresponding probability distribution parameter belongs.
[0153] Step S20: constructing an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information.
[0154] It should be noted that constructing the inverse quantization precision parameters corresponding to each quantized residual value based on the characteristic channel distinction information and / or the spatial point distinction information can be to determine the characteristic channel category or spatial point category corresponding to each quantized residual value based on the characteristic channel distinction information and / or the spatial point information, thereby obtaining the inverse quantization precision parameters that should be used when performing inverse quantization processing on each quantized residual value.
[0155] Step S30: Dequantize the quantized residual value based on the dequantization precision parameter to obtain a reconstructed residual value.
[0156] It is understandable that after determining the inverse quantization precision parameter corresponding to each quantized residual value, the quantized residual value can be inversely processed according to the inverse quantization precision parameter, that is, inverse quantized, and the value obtained after processing is used as the reconstructed residual value.
[0157] Step S40: performing a synthesis transformation on the reconstructed residual value to obtain a reconstructed image block.
[0158] It should be noted that after obtaining the reconstructed residual value, the mean used to calculate the feature residual value can be obtained through context prediction. The reconstructed residual value can be reconstructed into image features through the mean. Thereafter, the image features can be reconstructed into image blocks through the synthetic transformation network, thereby obtaining the reconstructed image blocks.
[0159] It is understandable that if the encoding device divides the image data into only one image block for processing during encoding, the reconstructed image block obtained at this time is the reconstructed image data corresponding to the image data. If the encoding device divides the image data into multiple image blocks for processing during encoding, the reconstructed image block obtained at this time is only the reconstructed image data corresponding to a certain image block in the image data.
[0160] For ease of understanding, now combined Figure 3 , 4 and 5 are used to illustrate, but not to limit this solution. Figure 3 FIG. 2 is a schematic diagram of the image encoding and decoding process of this embodiment. Figure 3 As shown in the figure, the image coding and decoding process mainly involves analysis transformation network, synthesis transformation network, context-based prediction, quantization, entropy coding, super coding network, super-scale decoding network and other modules, among which:
[0161] Analysis transformation network: transforms image x into feature y in the feature domain (latent domain), so that all subsequent processes can be operated in the latent domain;
[0162] Super coding network: Input the probability distribution parameter σ of the residual r to obtain the super prior information z_hat, which will be written into the image bitstream biasstream#1, mainly transmitting the probability model parameter σ of the residual.
[0163] Context-based prediction module: The input of this module includes not only z_hat but also the decoded y_hat. The two are combined to obtain a more accurate mean mu, which is the predicted value of the original feature. The reconstructed residual value r_hat is added to obtain the reconstructed y_hat.
[0164] Super-scale decoding network: The output z_hat of the super-coding network is used as the input of the super-scale decoding network in another way to obtain the probability distribution parameter σ. After quantization, the distribution quantization parameter σ_hat is obtained. σ_hat will be used to obtain the quantized residual value r_q in conjunction with the second image bitstream (Bitstream#2).
[0165] Synthesis transformation module: The reconstructed latent domain feature y_hat is obtained and the reconstructed image is obtained through the synthesis transformation module.
[0166] Entropy coding: A lossless coding method based on the principle of information entropy, which converts a series of element symbols used to represent a video sequence (such as transform coefficients and mode information) into a binary code stream, removing the statistical redundancy of these video element symbols.
[0167] Quantization: A "many-to-one" mapping process will cause signal loss. Quantization acts on the residual r, which can change the value range of the signal, so that the encoder can give a good approximation of the original signal with a small number of symbols, thereby improving the compression rate. In addition, quantization also acts on σ to obtain σ_hat, which is to allow σ_hat to better estimate the probability distribution of the quantized residual r_q. Inverse quantization is the inverse process of quantization, in which the quantization accuracy parameters or inverse quantization accuracy parameters used in the quantization and inverse quantization processes are constructed based on feature channel distinction information and / or spatial point distinction information.
[0168] Figure 4 is a schematic diagram of the characteristic channel of this embodiment, Figure 5 This is a two-dimensional schematic diagram of the average value of the characteristic channel probability distribution parameter of this embodiment, as mentioned above Figure 3 As shown in the figure, after the image x is processed by the analysis transformation network, the feature y contains C feature channels. The number of C depends on the number of convolution kernels used by the analysis transformation network, such as Figure 4 As shown in the figure, each feature channel contains a different amount of information. Some feature channels contain more information, which is almost consistent with the input image, while some feature channels contain almost no information and are basically all noise. Therefore, using different precision quantization for different feature channels helps to obtain better coding performance.
[0169] In addition, averaging the σ of all feature channels can obtain a 2D image, such as Figure 5 As shown, in Figure 5 In the example, it can be determined that some areas have higher texture values, that is, these areas are more important. Allocating more codewords to the complex texture parts of the image helps improve the encoding performance.
[0170] This embodiment obtains the characteristic channel distinguishing information and / or the spatial point distinguishing information and decodes the image code stream to obtain the quantized residual value; constructs the inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinguishing information and / or the spatial point distinguishing information; dequantizes the quantized residual value based on the inverse quantization precision parameter to obtain the reconstructed residual value; and performs a synthetic transformation on the reconstructed residual value to obtain the reconstructed image block. Since the corresponding inverse quantization parameter is constructed according to the characteristic channel distinguishing information and / or the spatial point distinguishing information for dequantization, different quantization parameters can be set according to the difference in the characteristic channel and the spatial point image texture during the encoding process, so that more important features bear a smaller quantization loss, thereby improving the encoding and decoding performance.
[0171] refer to Figure 6 , Figure 6 The figure is a flowchart of a second embodiment of an image decoding method according to the present invention.
[0172] In this embodiment, the image code stream may include a first image code stream and a second image code stream, wherein the first image code stream is used to transmit decoding auxiliary information, and the second image code stream is used to transmit residual data.
[0173] Based on the above first embodiment, step S10 of the image decoding method of this embodiment includes steps S101 - S104 .
[0174] Step S101: Acquire characteristic channel distinguishing information and / or spatial point distinguishing information, and extract coding distribution parameters from the first image code stream.
[0175] It should be noted that extracting the coding distribution parameter from the first image code stream may be performing entropy decoding on the first image code stream and reading decoding auxiliary information included in the first image code stream, thereby obtaining the coding distribution parameter.
[0176] Step S102: Decode the coded distribution parameters to obtain probability distribution parameters.
[0177] It should be noted that decoding the coded distribution parameters to obtain the probability distribution parameters may be performed by decoding the read decoding auxiliary information through a super-scale decoding network to obtain the probability distribution parameters.
[0178] Step S103: quantizing the probability distribution parameters to obtain distribution quantization parameters.
[0179] It should be noted that when the encoding device writes the residual data into the second image code stream, it writes it based on the quantized probability distribution parameter encoding. Therefore, when decoding the second image code stream, it is also necessary to obtain the quantized probability distribution parameters for decoding. At this time, in order to ensure that the second image code stream can be decoded normally, the probability distribution parameters can be quantized in the same way as when the encoding device is encoding to obtain the distribution quantization parameters.
[0180] In a specific implementation process, in order to ensure that the obtained distribution quantization parameter is consistent with the one used when the encoding device is encoded, it is necessary to ensure that the parameter used when the probability distribution parameter is quantized is consistent with the parameter used when the encoding device is encoded. Step S103 in this embodiment may include:
[0181] Constructing a probability quantization parameter according to the characteristic channel distinguishing information and / or the spatial point distinguishing information;
[0182] The probability distribution parameter is quantized based on the probability quantization parameter to obtain a distribution quantization parameter.
[0183] It should be noted that constructing probability quantization parameters according to characteristic channel distinguishing information and / or spatial point distinguishing information may be parameters used when quantizing probability distribution parameters extracted from characteristic channel distinguishing information and / or spatial point distinguishing information.
[0184] In a possible implementation of this embodiment, in order to facilitate decoding by a decoding device, the encoding device may write the characteristic channel distinguishing information and / or spatial point distinguishing information used in the encoding process into the first image code stream or the second image code stream. At this time, obtaining the characteristic channel distinguishing information and / or spatial point distinguishing information may be decoding the first image code stream or the second image code stream to extract the characteristic channel distinguishing information and / or spatial point distinguishing information therefrom.
[0185] In a possible implementation of this embodiment, in order to avoid code stream confusion, the encoding device may also set a third image code stream, and transmit the characteristic channel distinguishing information and / or spatial point distinguishing information used in the encoding process through the third image code stream. At this time, obtaining the characteristic channel distinguishing information and / or spatial point distinguishing information can be decoding the third image code stream to extract the characteristic channel distinguishing information and / or spatial point distinguishing information.
[0186] Step S104: decoding the second image code stream based on the distributed quantization parameter to obtain a quantized residual value.
[0187] It should be noted that when the encoding device writes the quantized residual value into the second image code stream, it performs entropy encoding on the quantized residual value based on the quantized distributed quantization parameter. At this time, after obtaining the distributed quantization parameter, the second image code stream can be inversely operated according to the distributed quantization parameter, that is, entropy decoding, to obtain the quantized residual value.
[0188] For ease of understanding, now combined Figure 7 This is for illustration only, but not for limitation. Figure 7 Schematic diagram of the decoding process of this embodiment. Figure 7 As shown, the decoding end will receive at least two video code streams (a first video code stream Bitstream#1 and a second video code stream Bitstream#2), and may also receive a third video code stream Bitstream#3;
[0189] At this time, the decoding process includes: parsing the Bitstream#1 auxiliary bitstream to obtain a z_hat, through which the parameter σ of the probability distribution model of the residual can be obtained; obtaining relevant information for distinguishing feature channels or distinguishing texture areas (feature channel distinguishing information and / or spatial point distinguishing information), and using the information to classify feature channels or spatial points. Different categories of feature channels or different categories of spatial points have different quantization precisions. The relevant information for distinguishing feature channels can be transmitted from the encoding device to the decoding device through Bitstream#1 or Bitsstream#2, or can be transmitted through the new bitstream Bitsstream#3, or the relevant information can be written into the encoding and decoding device in advance without bitstream transmission; entropy decoding is performed from Bitstream#2, and the quantized residual r_q is obtained by combining σ with σ_hat obtained by quantization; the relevant information for distinguishing feature channels or spatial points will act on the inverse quantization of the quantized residual value r_q and make the quantized residual values r_q and σ corresponding to different categories of feature channels or different categories of spatial points have different quantization precisions.
[0190] refer to Figure 8 , Figure 8 FIG. 4 is a flow chart of a third embodiment of an image decoding method according to the present invention.
[0191] Based on the above first embodiment, step S20 of the image decoding method of this embodiment includes steps S201 - S202 .
[0192] Step S201: extracting the quantization step length corresponding to each type of feature channel from the feature channel distinction information.
[0193] It should be noted that when distinguishing feature channels, the feature channels can be divided into multiple categories, and different quantization steps can be assigned to feature channels of different categories. At this time, the feature channel distinction information will include the classification rules of the feature channels and the quantization steps corresponding to each type of feature channel.
[0194] Among them, the classification rules of the feature channels can be set in the following ways 1-4.
[0195] Method 1: Set according to the sequence number of the feature channel:
[0196] Set the corresponding quantization step size for each feature channel corresponding to the sequence number, and then classify the feature channels with the same quantization step size into one category. For example, assuming that the sequence number of the feature channel is 1-X, the feature channel quantization step size list can be: channel_list = [channel1, channel2, ..., channelX];
[0197] Furthermore, the same feature channel may also include components, such as brightness or chromaticity. In this case, the brightness or chromaticity can be further subdivided. For example: assuming that the brightness channel sequence is 1-X1 and the chromaticity channel sequence is 1-X2, the brightness channel quantization step list is: channel_listY=[channel1, chanenel2, ..., channelX1], and the chromaticity channel quantization step list is: channel_listUV=[channel1, chanenel2, ..., channelX2].
[0198] Method 2: Set the corresponding category based on the channel flag list;
[0199] A corresponding flag bit is set for the feature channel corresponding to each serial number, and the category of the feature channel corresponding to each serial number is identified by the flag bit.
[0200] For example: taking the brightness channel as an example, the serial number of the brightness channel is 1-128, and the flag list channel_listY = [flag0, flag1,,,, flag128], where the value of flag is the category corresponding to the brightness channel of the serial number. If there are only two categories, the value of flag is 0 and 1.
[0201] Method 3: Classify feature channels by setting thresholds:
[0202] The category of the corresponding feature channel is set by the threshold calculated from the probability distribution parameters such as the mean value or variance of the probability distribution parameter σ, the sum of the absolute values of the quantized residual values or the bit rate and other related thresholds calculated from the quantized residual r_q, for example: thr_list = [thr1, thr2, ..., thrX].
[0203] Method 4: Classify feature channels by the number of channels: Sort the channels using a list of related thresholds such as the mean value or variance of σ calculated from the distribution parameter σ, or the sum of the absolute values of the quantization residual r_q or the bit rate, and set multiple number thresholds (multiple number thresholds can be represented by a list, such as: num_list = [num1, num2, ..., numX], X is the list length, i.e., the number of number thresholds). Classify the channels according to the number threshold, for example, the first three are classified into one category, and the rest are classified into one category. Assuming that the channel number threshold can be set to 3 at this time, num_list = [3] can be set at this time.
[0204] Step S202: constructing inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step size.
[0205] It should be noted that after obtaining the quantization step size corresponding to each type of feature channel, the quantization step size and other parameters used to quantize each quantized residual value can be obtained according to the feature channel corresponding to each quantized residual value, thereby calculating the inverse quantization accuracy parameters required for inverse quantization of each quantized residual value.
[0206] For example, assuming that the feature channels are divided into X categories, the quantization step size corresponding to each type of feature channel in the feature channel distinction information can be represented by a list scale_list = [scale1, scale2, ..., scaleX], where X is the number of quantization steps. At this time, assuming that the quantization residual value corresponding to the j-th feature channel is r qj , the characteristic residual is r j , the reconstructed residual value obtained by dequantization is r_hat j , then the quantization process r qj =round(r j *scale j *scale i ), r_hat in the dequantization process j =r qj / (scale j *scale i ), where scale j is the quantization step size used when quantizing the feature residual corresponding to the j-th feature channel according to the newly added feature channel, scale i is the quantization step size used in the original scheme to quantize the feature residual corresponding to the j-th feature channel, scale i It can be set to 1, that is, the quantization step size of the original scheme can be retained or not. Similarly, in the following embodiments, you can choose whether to retain the quantization step size of the original scheme.
[0207] In the specific implementation process, different quantization step sizes may be further set for the same feature channel, such as dividing multiple value intervals by setting a threshold, and further set by the value interval to which the value calculated according to the probability distribution parameter belongs. Step S202 in this embodiment may include:
[0208] Decode the image code stream to obtain probability distribution parameters;
[0209] Extracting parameter interval thresholds from the characteristic channel distinction information;
[0210] The inverse quantization precision parameters corresponding to each quantization residual value are constructed according to the probability distribution parameter, the quantization step size and the parameter interval threshold.
[0211] It should be noted that when constructing the inverse quantization precision parameter corresponding to the quantization difference residual value, the characteristic channel category to which the quantization residual value belongs can be obtained first, and the quantization step and parameter interval threshold corresponding to this type of characteristic channel can be obtained, and multiple value intervals are divided according to the parameter interval threshold, and then the value interval to which the probability distribution parameter corresponding to the quantization residual value belongs is calculated (it can also be the value interval to which the mean value or variance of the probability distribution parameter belongs), and the corresponding quantization step is selected from the multiple quantization step corresponding to this type of characteristic channel according to the value interval, and then the corresponding inverse quantization precision parameter when the quantization residual value is inversely quantized is calculated according to the quantization step. Among them, the multiple quantization step corresponding to a type of characteristic channel respectively corresponds to the divided value intervals.
[0212] For example: assuming that the feature channel corresponding to the quantized residual value is of type i, the quantization step corresponding to this type of feature channel includes scale1, scale2, and scaleN, and the parameter interval thresholds include thr1, thr2, ..., and thrN, which are different thresholds (thr1, thr2, ..., and thrN are in descending order). Then, the value interval may include: (thr1, ∞), (thr2, thr1], ... (thrN, thrN-1], and each value interval corresponds to the quantization step one by one. At this time, if the probability distribution parameter σ corresponding to the quantized residual value is > thr1, then the corresponding quantization step is scale1. If the probability distribution parameter thr1≥σ> thr2 corresponding to the quantized residual value is scale2, and so on.
[0213] In the specific implementation process, the same type of feature channels may be classified again, for example, a type of feature channel may be divided into multiple segments, and each segment may correspond to a different quantization step size. In this case, step S20 in this embodiment may include:
[0214] Parsing the feature channel distinction information to obtain a set of segmented step sizes corresponding to each type of feature channel;
[0215] Extracting the quantization step size corresponding to each channel segment from the segment step size set;
[0216] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0217] It should be noted that after further dividing a type of feature channel, each type of feature channel may correspond to multiple different quantization step sizes, which can be saved in the form of a set. At this time, the feature channel distinction information can be parsed to obtain the segmentation step size set corresponding to each type of feature channel, and then the quantization step size corresponding to each channel segment can be extracted from the segmentation step size set. Among them, the segmentation division methods of different types of feature channels can be different or the same, and this embodiment does not limit this.
[0218] At this time, constructing the inverse quantization precision parameters corresponding to the quantized residual values according to the quantization step size can be to obtain the characteristic channel category corresponding to the quantized residual value, and determine the channel segment to which the quantized residual value belongs in this type of characteristic channel, and determine the quantization step size and other parameters used when calculating the quantized residual value according to the characteristic channel category and the channel segment, so as to calculate the inverse quantization precision parameters required for inverse quantization of the quantized residual value.
[0219] For example, taking the i-th feature channel as an example, the i-th feature channel can be divided into X segments. At this time, the segmentation step size set corresponding to the i-th feature channel can be expressed as: scale_list i =[scale i1 ...scale ij ...sscle iX ], where scaleij is the quantization step size of the jth segment in the i-th feature channel, and the value of j is [1, X].
[0220] In the specific implementation, the features in the same feature channel can also be divided into multiple categories, and the classification rules can be any of the following:
[0221] Rule 1, the list of relevant thresholds such as the mean value or variance of σ calculated by the distribution parameter σ, or the sum of the absolute values of the quantized residual r_q or the bit rate calculated by the quantized residual r_q, and the list length X, thr brightness and chrominance components can share one list, thr_list = [thr1, thr2, ..., thrX], or they can be passed separately.
[0222] Rule 2: Two-dimensional channel flag matrix, as shown in the diagram Figure 7 As shown, the luminance and chrominance components can be shared in one matrix or passed separately, similar to the channel flag list in Example 1. Different flags represent different categories.
[0223] Rule 3, row, column, oblique column number and list length, similar to channel number, as shown in the diagram Figure 7 shown.
[0224] Rule 4: Pass row, column, and diagonal column flags, similar to the channel flag list.
[0225] Rule 5: The row, column, and diagonal column number table num_list = [num1, num2, ..., numX] and the list length X are similar to the channel number list.
[0226] Rule 6: Row, column, and diagonal column flags are similar to channel flags.
[0227] Combined here Fig. 9 and10 To explain, Fig. 9 is a schematic diagram of the identification matrix of this embodiment, such as Fig. 9 As shown, the relevant data are divided into multiple categories, and the data corresponding to each category can correspond to different quantization steps. At this time, the relevant feature data in the channel can be classified and marked in a matrix manner, such as Fig. 9 As shown, 0 and 1 in the matrix respectively represent the classification labels of each relevant feature data in the same channel.
[0228] Fig.10 The row and column division diagram of this embodiment is shown in FIG. The specific row, column, and oblique column division can be as follows: Figure 8 As shown, from left to right, the relevant feature data in the channel can be divided into multiple rows, from top to bottom, the relevant feature data in the channel can be divided into multiple columns, and from lower left to upper right, the relevant feature data in the channel can be divided into multiple columns diagonally.
[0229] In a possible implementation of this example, each feature channel may be divided into blocks and different quantization steps may be set. In this case, step S20 in this embodiment may include:
[0230] Extracting the image block information and parameter setting rules corresponding to each feature channel from the feature channel distinction information;
[0231] Decode the image code stream to obtain probability distribution parameters;
[0232] Calculate the distribution parameter mean corresponding to each image block information according to the probability distribution parameter;
[0233] Matching the distribution parameter mean with the parameter setting rule to obtain the quantization step corresponding to each image block information;
[0234] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0235] It should be noted that each feature channel can be divided into blocks during encoding, and the block rules can be recorded in the feature channel distinction information. Thereafter, different quantization step sizes are set according to the different means of the probability distribution parameters corresponding to these blocks, wherein the size of the blocks can be freely set.
[0236] Extracting the image segmentation information and parameter setting rules corresponding to each feature channel from the feature channel distinguishing information may be extracting the parameter setting rules and the segmentation rules from the feature channel distinguishing information, determining the segmentation corresponding to each feature channel according to the segmentation rules, thereby obtaining the image segmentation information corresponding to each feature channel. The parameter setting rules include the quantization step corresponding to the mean values of different distribution parameters.
[0237] In actual use, calculating the mean value of the distribution parameters corresponding to each image block information according to the probability distribution parameters may be calculating the average value of the probability distribution parameters corresponding to each image block information, thereby obtaining the mean value of the distribution parameters.
[0238] During the implementation process, the distribution parameter mean is matched with the parameter setting rules, and the quantization step corresponding to each image block information is obtained by matching the distribution parameter mean with multiple value intervals included in the parameter setting rules, and using the quantization step corresponding to the value interval to which the distribution parameter mean belongs as the quantization step corresponding to the image block information.
[0239] It can be understood that after obtaining the quantization step corresponding to the image block information, the quantization step and other parameters used to calculate the quantized residual value can be determined according to the image block information to which the quantized residual value belongs, thereby calculating the inverse quantization accuracy parameters required for inverse quantization of the quantized residual value.
[0240] This embodiment constructs a probability quantization parameter according to the feature channel distinguishing information and / or the spatial point distinguishing information; and quantizes the probability distribution parameter based on the probability quantization parameter to obtain the distribution quantization parameter. Since the probability quantization parameter is constructed according to the feature channel distinguishing information and / or the spatial point distinguishing information, and the probability distribution parameter is quantized according to the probability quantization parameter to obtain the distribution quantization parameter, it is ensured that different quantization parameters can be set for the probability distribution parameter according to the difference in the feature channel and the spatial point image texture, and the performance of the encoding method of this embodiment is further improved.
[0241] refer to Fig.11 , Fig.11 FIG. 4 is a flow chart of a fourth embodiment of an image decoding method according to the present invention.
[0242] Based on the above first embodiment, the step S20 of the image decoding method of this embodiment includes steps S201 ′-S202 ′.
[0243] Step S201 ′: extracting the quantization step length corresponding to each type of spatial point from the spatial point distinction information.
[0244] It should be noted that when setting the quantization step size, the spatial points in the image can be divided into multiple categories according to the image texture, and different quantization step sizes can be set for spatial points of different categories. For example, according to the image texture, the spatial points in the image are divided into X categories, and the quantization step size of the j-th spatial point is scale_j, and the value range of j is [1, X].
[0245] Among them, when classifying spatial points, they can be distinguished according to the complexity of the image texture corresponding to the spatial points. For example, three complexity intervals are set, [0, F1], (F1, F2], (F2, ∞), and then the spatial points are divided into three categories according to the complexity interval to which the image texture complexity corresponding to the spatial points belongs.
[0246] Step S202 ′: constructing inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step size.
[0247] It can be understood that constructing the inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step corresponding to each type of spatial point can be based on the spatial point category corresponding to the quantized residual value, obtaining parameters such as the quantization step used when calculating the quantized residual value, thereby calculating the inverse quantization precision parameters required for inverse quantization of each quantized residual value.
[0248] It should be noted that each spatial point actually contains C (C is the number of feature channels) points. After dividing the spatial points into different categories, the multiple points contained in the spatial points can actually be further divided, so that different feature channels in a type of spatial points can correspond to different quantization steps. At this time, the spatial point distinction information and the feature channel distinction information can be used in conjunction. At this time, step S20 described in this embodiment may include:
[0249] Reading the various types of divided spatial points from the spatial point distinction information;
[0250] Reading the quantization step lengths corresponding to each type of characteristic channel in each type of spatial point from the characteristic channel distinction information;
[0251] The inverse quantization precision parameters corresponding to the quantized residual values are constructed according to the quantization step size.
[0252] It should be noted that, when the multiple points contained in each type of spatial point are further divided according to the different characteristic channels, the points of multiple different characteristic channels corresponding to one type of spatial point can correspond to different quantization step sizes. At this time, the multiple types of spatial points that can be divided can be read from the spatial point distinction information first, and then the quantization step sizes corresponding to each characteristic channel in each type of spatial point can be read.
[0253] For example: divide the spatial points into two categories, a and b. At this time, the feature channels contained in a and b are both 1-X. Then the quantization step corresponding to each feature channel in the a-category spatial point can be expressed as scale_lista=[scale1, scale2, ..., scaleX], and the quantization step corresponding to each feature channel in the b-category spatial point can be expressed as scale_listb=[scale1, scale2, ..., scaleX].
[0254] In a specific implementation, in order to facilitate the decoding device to clearly understand the specific quantization step setting method, a corresponding flag bit can also be set in the image code stream to determine how to obtain the quantization step size. For example: if the flag bit is set to 0, the quantization step size is determined based on the feature channel distinction information. If the flag bit is set to 1, the quantization step size is determined based on the spatial point distinction information. If the flag bit is set to 2, the quantization step size is determined based on the feature channel distinction information and the spatial point distinction information.
[0255] It should be noted that this embodiment only describes a method of using spatial point distinction information in conjunction with characteristic channel distinction information. Further division of multiple points contained in the spatial points can also utilize the implementation method for further division of characteristic channels provided in any of the above embodiments, and this embodiment does not impose any restrictions on this.
[0256] For ease of understanding, now combined Fig.12 This is for illustration only, but not for limitation. Fig.12 FIG. 1 is a schematic diagram of the spatial point classification of this embodiment. According to the image texture complexity corresponding to the spatial point, the spatial point can be divided into the first category, the second category and the third category (as shown by the arrows in the figure). The spatial points after the specific division are as follows: Fig.12 As shown ( Fig.12 The color depth of each point in the image is used to represent the complexity of the image texture. If the color depth is consistent, they belong to the same category, and the darker the color, the higher the complexity of the image texture).
[0257] In this embodiment, the quantization step corresponding to each type of spatial point is extracted from the spatial point differentiation information; and the inverse quantization precision parameters corresponding to each quantization residual value are constructed according to the quantization step. Since the inverse quantization precision parameters corresponding to each quantization residual value are constructed according to the quantization step corresponding to each type of spatial point, different quantization step sizes can be set for spatial points with different image textures, so that differential settings can be made according to the differences in image textures when performing quantization and inverse quantization.
[0258] The embodiment of the present invention provides an image encoding method, referring to Fig.13 , Fig.13 FIG. 4 is a flow chart of a first embodiment of an image encoding method according to the present invention.
[0259] In this embodiment, the image encoding method includes the following steps S100-S500:
[0260] Step S100: Analyze and transform the image block to be processed to obtain image features.
[0261] It should be noted that the executor of this embodiment may be an encoding device for encoding image data. The encoding device may be an electronic device such as a personal computer or a server, or other devices that can achieve the same or similar functions. This embodiment does not limit this. In this embodiment and the following embodiments, the image encoding method of the present invention is described by taking the encoding device as an example.
[0262] It should be noted that performing analysis and change processing on the image block to be processed to obtain the image feature may be performing analysis and change processing on the image block to be processed through an analysis transformation network to extract feature information, thereby obtaining the image feature.
[0263] Step S200: performing residual calculation on the image features to obtain image residual values and probability distribution parameters.
[0264] It should be noted that the residual calculation of the image features to obtain the image residual value and probability distribution parameters can be a prediction value generated by a context-based prediction module, and then the residual calculation is performed based on the image features and the prediction value to obtain the graphic residual value, and the image residual value is analyzed through a super coding network to obtain the probability distribution parameters.
[0265] Step S300: constructing quantization precision parameters corresponding to the residual values of each image according to the feature channel distinction information and / or the spatial point distinction information.
[0266] It should be noted that the feature channel distinguishing information may be distinguishing information for classifying the feature channels of the image, and the spatial point distinguishing information may be distinguishing information for classifying the points in the image. Both the feature channel distinguishing information and the spatial point distinguishing information may be pre-set by the manager of the encoding device according to actual needs.
[0267] It should be noted that the construction of each quantized residual value according to the characteristic channel distinguishing information and / or the spatial point distinguishing information may correspond to determining the characteristic channel category or the spatial point category corresponding to each image residual value according to the characteristic channel distinguishing information and / or the spatial point information, and reading the quantization precision parameters required for quantizing each image residual value from the characteristic channel distinguishing information and / or the spatial point distinguishing information according to the characteristic channel category or the spatial point category. Among them, the quantization precision parameters may be parameters such as the quantization step size that can limit the quantization precision.
[0268] Step S400: quantizing the image residual value based on the quantization precision parameter to obtain a quantized residual value.
[0269] It should be noted that the image residual value is quantized based on the quantization precision parameter to obtain the quantized residual value, which may be performed by quantizing the image residual value according to the quantization precision parameter and using the calculated value as the quantized residual value.
[0270] Step S500: writing the probability distribution parameter and the quantized residual value into an image bitstream.
[0271] It should be noted that writing the probability distribution parameters and the quantized residual values into the image code stream may be that the probability distribution parameters are processed by a super coding network and then written into the image code stream by entropy coding, and the quantized residual values are entropy encoded based on the quantized probability distribution parameters and written into the image code stream.
[0272] In a specific implementation, the image code stream may include a first image code stream and a second image code stream, the first image code stream is used to transmit decoding auxiliary information, and the second image code stream is used to transmit residual data. Then step S500 in this embodiment may include:
[0273] Writing the probability distribution parameters into the first image code stream;
[0274] Constructing distribution quantization parameters according to the probability distribution parameters;
[0275] The quantized residual value is written into the second image code stream based on the distributed quantization parameter.
[0276] It should be noted that writing the probability distribution parameter into the first image code stream may be processing the probability distribution parameter through a super coding network and then writing it into the first image code stream through entropy coding. Constructing the distribution quantization parameter according to the probability distribution parameter may be quantizing the probability distribution parameter to obtain the distribution quantization parameter. Writing the quantized residual value into the second image code stream based on the distribution quantization parameter may be entropy coding the quantized residual value based on the distribution quantization parameter and writing it into the second image code stream.
[0277] Among them, in order to ensure the performance of the quantizer, when the probability distribution parameters are quantized, the quantization parameters used can be constructed according to the characteristic channel distinction information and / or the spatial point distinction information. At this time, the step of constructing the distribution quantization parameters according to the probability distribution parameters in this embodiment may include:
[0278] Constructing a probability quantization parameter according to the characteristic channel distinguishing information and / or the spatial point distinguishing information;
[0279] The probability distribution parameter is quantized based on the probability quantization parameter to obtain a distribution quantization parameter.
[0280] It should be noted that, by constructing probabilistic quantization parameters based on feature channel distinction information and / or spatial point distinction information, different quantization parameters can be set according to the different feature channels or spatial points corresponding to the probability distribution parameters, so that the quantization can fully adapt to the differences in feature channels and the complexity of image textures, thereby ensuring the performance of the quantizer as much as possible.
[0281] In actual use, in order to ensure that the decoding device can normally decode the generated image code stream, the characteristic channel distinction information and / or the spatial point distinction information can also be encoded into the image code stream.
[0282] It can be understood that, since the parameters used for quantization are adjusted according to the characteristic channel distinguishing information and / or the spatial point distinguishing information during encoding, if the decoding device is to be able to decode normally, it is also necessary to obtain the characteristic channel distinguishing information and / or the spatial point distinguishing information. At this time, the characteristic channel distinguishing information and / or the spatial point distinguishing information are written into the first image code stream or the second image code stream, which can ensure that the decoding device can obtain the characteristic channel distinguishing information and / or the spatial point distinguishing information, thereby ensuring that the decoding device can decode normally.
[0283] In actual use, in order to avoid code stream data confusion or excessive complexity of the code stream, a third image code stream may be set to transmit the distinguishing information through the third image code stream. In this case, after the step of writing the quantized residual value into the second image code stream based on the distributed quantization parameter in this embodiment, the following step may be further included:
[0284] The feature channel distinguishing information and / or the space point distinguishing information are written into the third image code stream.
[0285] For ease of understanding, now combined Fig.14 This is for illustration only, but not for limitation. Fig.14 FIG. 1 is a schematic diagram of the image encoding process of this embodiment. Fig.14 As shown, the encoding device can write the quantized residual value into the second image code stream, write the encoding distribution parameter z_hat calculated by the probability distribution parameter σ into the first image code stream, and write the relevant information for distinguishing feature channels or spatial points (feature channel distinguishing information and / or the spatial point distinguishing information) into the first image code stream or the second image code stream, or into the third image code stream. If necessary, the relevant information for distinguishing feature channels or spatial points can be directly written into the encoding device in advance as a local parameter without the need for code stream transmission, and the encoding device end and the decoding device end can be kept consistent.
[0286] This embodiment obtains image features by analyzing and transforming the image blocks to be processed; performs residual calculation on the image features to obtain image residual values and probability distribution parameters; constructs quantization precision parameters corresponding to each image residual value based on feature channel distinction information and / or spatial point distinction information; performs quantization processing on the image residual values based on the quantization precision parameters to obtain quantized residual values; and writes the probability distribution parameters and the quantized residual values into the image code stream. Since different quantization parameters can also be set according to the differences in feature channel and spatial point image texture during the encoding process, more important features bear smaller quantization losses, thereby improving the encoding and decoding performance.
[0287] refer to Fig.15 , Fig.15 FIG. 4 is a flow chart of a second embodiment of an image encoding method according to the present invention.
[0288] Based on the first embodiment of the image encoding method described above, step S300 of the image encoding method of this embodiment includes steps S3001 - S3002 .
[0289] Step S3001: extracting the quantization step size corresponding to each type of feature channel from the feature channel distinction information.
[0290] It should be noted that when distinguishing feature channels, the feature channels can be divided into multiple categories, and different quantization steps can be assigned to feature channels of different categories. At this time, the feature channel distinction information will include the classification rules of the feature channels and the quantization steps corresponding to each type of feature channels. At this time, the quantization steps corresponding to each type of feature channels can be directly extracted from the feature channel distinction information.
[0291] Among them, the classification rule setting method of the feature channel is similar to the above setting method, which will not be repeated here.
[0292] Step S3002: constructing quantization precision parameters corresponding to each image residual value according to the quantization step size.
[0293] It can be understood that after determining the quantization step size corresponding to each type of feature channel, the quantization step size and other parameters when quantizing the image residual value can be determined according to the feature channel category corresponding to each image residual value, thereby determining the quantization accuracy parameters corresponding to each image residual value.
[0294] In a specific implementation, different quantization step sizes may be further set for the same feature channel, such as dividing multiple value intervals by setting a threshold, and further set by a probability distribution parameter or a value interval to which a value calculated according to the probability distribution parameter belongs. Step S3002 in this embodiment may include:
[0295] Extracting parameter interval thresholds from the characteristic channel distinction information;
[0296] The quantization precision parameters corresponding to the respective image residual values are constructed according to the probability distribution parameters, the parameter interval threshold and the quantization step size.
[0297] It should be noted that when constructing the quantization precision parameters corresponding to each feature channel according to the probability distribution parameters, parameter interval thresholds and quantization step sizes, we can first obtain the feature channel category to which the quantized residual value belongs, obtain the quantization step size and parameter interval threshold value corresponding to this type of feature channel, divide a plurality of value intervals according to the parameter interval threshold value, and then calculate the value interval to which the probability distribution parameter corresponding to the quantized residual value belongs (it can also be the value interval to which the mean value or variance of the probability distribution parameter belongs), and select the corresponding quantization step size from the plurality of quantization step sizes corresponding to this type of feature channel according to the value interval, thereby obtaining the quantization precision parameters corresponding to each image residual value.
[0298] In the specific implementation process, the same type of feature channels may be classified again, for example, a type of feature channel may be divided into multiple segments, and each segment may correspond to a different quantization step size. In this case, step S3002 of this embodiment may include:
[0299] Parsing the feature channel distinction information to obtain a set of segmented step sizes corresponding to each type of feature channel;
[0300] Extracting the quantization step size corresponding to each channel segment from the segment step size set;
[0301] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0302] It should be noted that after further dividing a type of feature channel, each type of feature channel may correspond to multiple different quantization step sizes, which can be saved in the form of a set. At this time, the feature channel distinction information can be parsed to obtain the segmentation step size set corresponding to each type of feature channel, and then the quantization step size corresponding to each channel segment can be extracted from the segmentation step size set. Among them, the segmentation division methods of different types of feature channels can be different or the same, and this embodiment does not limit this.
[0303] At this time, constructing the quantization precision parameters corresponding to each image residual value according to the quantization step size can be to obtain the feature channel category corresponding to the image residual value, and determine the channel segment to which the image residual value belongs in this type of feature channel, and determine the quantization step size and other parameters used for quantizing the image residual value according to the feature channel category and the channel segmentation, thereby obtaining the quantization precision parameters corresponding to each image residual value.
[0304] In a specific implementation, when setting the quantization step size, it can be set according to the image texture. In this case, step S3002 in this embodiment may include:
[0305] Extract the quantization step size corresponding to each type of spatial point from the spatial point distinction information;
[0306] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0307] It should be noted that when setting the quantization step size, the spatial points in the image can be divided into multiple categories according to the image texture, and different quantization step sizes can be set for spatial points of different categories. For example, according to the image texture, the spatial points in the image are divided into X categories, and the quantization step size of the j-th spatial point is scale_j, and the value range of j is [1, X].
[0308] Among them, when classifying spatial points, they can be distinguished according to the complexity of the image texture corresponding to the spatial points. For example, three complexity intervals are set, [0, F1], (F1, F2], (F2, ∞), and then the spatial points are divided into three categories according to the complexity interval to which the image texture complexity corresponding to the spatial points belongs.
[0309] It can be understood that constructing the quantization precision parameters corresponding to each image residual value according to the quantization step corresponding to each type of spatial point can be based on the spatial point category corresponding to the image residual value, and obtaining parameters such as the quantization step used when quantizing the image residual value, thereby obtaining the quantization precision parameters corresponding to each image residual value.
[0310] It should be noted that each spatial point actually contains C (C is the number of feature channels) points. After dividing the spatial points into different categories, the multiple points contained in the spatial points can actually be further divided, so that different feature channels in a type of spatial points can correspond to different quantization steps. At this time, the spatial point distinction information and the feature channel distinction information can be used in conjunction. At this time, step S3002 of this embodiment may include:
[0311] Read various types of divided spatial points from the spatial point distinction information;
[0312] Distinguish information from the feature channels and read the quantization step lengths corresponding to each feature channel in each spatial point;
[0313] The quantization precision parameters corresponding to the residual values of each image are constructed according to the quantization step size.
[0314] It should be noted that, when the multiple points contained in each type of spatial point are further divided according to the different characteristic channels, the points of multiple different characteristic channels corresponding to one type of spatial point can correspond to different quantization step sizes. At this time, the multiple types of spatial points that can be divided can be read from the spatial point distinction information first, and then the quantization step sizes corresponding to each characteristic channel in each type of spatial point can be read.
[0315] For example: divide the spatial points into two categories, a and b. At this time, the feature channels contained in a and b are both 1-X. Then the quantization step corresponding to each feature channel in the a-category spatial point can be expressed as scale_lista=[scale1, scale2, ..., scaleX], and the quantization step corresponding to each feature channel in the b-category spatial point can be expressed as scale_listb=[scale1, scale2, ..., scaleX].
[0316] In a specific implementation, in order to facilitate the encoding device to clarify the specific quantization step setting method, the corresponding flag bit can also be pre-set in the encoding device, and the flag bit is used to determine how to obtain the quantization step length. For example: if the flag bit is set to 0, the quantization step length is determined based on the characteristic channel distinction information. If the flag bit is set to 1, the quantization step length is determined based on the spatial point distinction information. If the flag bit is set to 2, the quantization step length is determined in combination with the characteristic channel distinction information and the spatial point distinction information.
[0317] It should be noted that this embodiment only describes a method of using spatial point distinction information in conjunction with characteristic channel distinction information. Further division of multiple points contained in the spatial points can also utilize the implementation method for further division of characteristic channels provided in any of the above embodiments, and this embodiment does not impose any restrictions on this.
[0318] refer to Fig.16 , Fig.16 FIG. 4 is a flow chart of a third embodiment of an image encoding method according to the present invention.
[0319] Based on the first embodiment of the image encoding method described above, step S500 of the image encoding method of this embodiment includes steps S5001-S5003.
[0320] Step S5001: performing image decoding according to the probability distribution parameters, the quantized residual value and the characteristic channel distinction information to obtain a reconstructed image block and an image bit rate.
[0321] It should be noted that, performing image decoding according to probability distribution parameters, quantization residual values and characteristic channel distinction information to obtain reconstructed image blocks and image bit rates can be performed according to the image decoding method provided in any of the above embodiments, performing image decoding according to probability distribution parameters, quantization residual values and characteristic channel distinction information to obtain reconstructed image blocks, and calculating the image bit rate according to the probability distribution parameters.
[0322] Step S5002: adjusting the characteristic channel distinction information and / or the spatial point distinction information according to the reconstructed image block and the image bit rate.
[0323] It should be noted that the encoding device can also optimize and adjust the parameters used in the encoding process. At this time, adjusting the characteristic channel distinction information according to the reconstructed image block and the image bit rate can be to optimize and adjust the quantization-related parameters in the characteristic channel distinction information and / or the spatial point distinction information according to the reconstructed image block and the image bit rate.
[0324] In a specific implementation, the manager of the encoding device can determine whether to perform parameter optimization adjustment by modifying the optimal threshold mode flag in the encoding device. If the optimal threshold mode flag value is 0, it means that parameter optimization adjustment is not performed; if the optimal threshold mode flag value is 1, it means that parameter optimization adjustment is performed.
[0325] For ease of understanding, now combined Fig.17 This is for illustration only, but not for limitation. Fig.17 This is a schematic diagram of the optimal threshold mode flag function process. Fig.17 As shown, the user of the encoding device can set the optimal threshold mode flag Flag_useRDAQ, and pass the set flag and the relevant thresholds or parameters for distinguishing the characteristic channels to the encoding device. The encoding device will then detect whether the optimal threshold mode flag value is 1. If it is 1, the parameter optimization adjustment will be turned on, and the input relevant thresholds or parameters will be used as the initial values. Then, multiple iterations will be performed, and the relevant thresholds or parameters for distinguishing the characteristic channels obtained after the iteration will be encoded, and the generated image code stream will be transmitted to the decoding device. If it is not 1, the encoding will be directly performed based on the relevant thresholds or parameters for distinguishing the characteristic channels passed in, and the encoded image code stream will be transmitted to the decoding device.
[0326] Step S5003: If the current adjustment round is greater than or equal to the preset adjustment round, the probability distribution parameter and the quantized residual value are written into the image code stream.
[0327] It should be noted that the preset adjustment round may be the number of times the characteristic channel distinguishing information is adjusted in advance, and the current adjustment round may be the number of times the characteristic channel distinguishing information has been adjusted.
[0328] It is understandable that if the current adjustment round is greater than or equal to the preset adjustment round, it means that the parameter optimization adjustment has been completed, and the probability distribution parameter and the quantization residual value can be written into the image code stream, and the image code stream is transmitted to the decoding device. Among them, the adjusted feature channel distinction information and / or spatial point distinction information can also be written into the image code stream.
[0329] If the current adjustment round is less than the preset adjustment round, it means that the parameter optimization adjustment has not been completed. Therefore, it is possible to return to the step of constructing the quantization precision parameters corresponding to each feature channel according to the feature channel distinction information.
[0330] For ease of understanding, now combined Fig.18 This is for illustration only, but not for limitation. Fig.18 is the parameter optimization flow chart of this embodiment, Fig.18 In the embodiment, the index representing the distortion D may be one or a combination of multiple indexes such as msssim, vif, fsim, nlpd, iw-ssim, vmaf, psnr_HVS, etc., X is the input related threshold or parameter for distinguishing feature channels, res_q is the quantized residual value, sigmma is the probability distribution parameter σ, step_X may be pre-set by the administrator of the encoding device according to actual needs, and satisfying the iteration number limit may be comparing the current adjustment round with the preset adjustment round. If the current adjustment round is greater than or equal to the preset adjustment round, it is determined that the iteration number limit is satisfied; if the current adjustment round is less than the preset adjustment round, it is determined that the iteration number limit is not satisfied.
[0331] This embodiment obtains a reconstructed image block and an image bit rate by decoding the image according to the probability distribution parameter, the quantized residual value and the characteristic channel distinguishing information; adjusts the characteristic channel distinguishing information and / or the spatial point distinguishing information according to the reconstructed image block and the image bit rate; if the current adjustment round is greater than or equal to the preset adjustment round, the probability distribution parameter and the quantized residual value are written into the image bit stream. Since the image is decoded and the characteristic channel distinguishing information and / or the spatial point distinguishing information are adjusted according to the reconstructed image block and the image bit rate, it is ensured that the parameters used in the final encoding are high-quality solutions, thereby further improving the image encoding performance.
[0332] In addition, an embodiment of the present invention also proposes a storage medium, on which an image encoding or image decoding program is stored. When the image encoding program is executed by a processor, the steps of the image encoding method described above are implemented; when the image decoding program is executed by a processor, the steps of the image decoding method described above are implemented.
[0333] Reference Fig.19 , Fig.19 This is a structural block diagram of the first embodiment of the image decoding device of the present invention.
[0334] like Fig.19 As shown, the image decoding device proposed in the embodiment of the present invention includes:
[0335] An entropy decoding module 10 is used to obtain characteristic channel distinguishing information and / or spatial point distinguishing information, and decode the image code stream to obtain a quantized residual value;
[0336] A parameter construction module 20, configured to construct an inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinction information and / or the spatial point distinction information;
[0337] A dequantization module 30, configured to dequantize the quantized residual value based on the dequantization precision parameter to obtain a reconstructed residual value;
[0338] The synthesis transformation module 40 is used to perform synthesis transformation on the reconstructed residual value to obtain a reconstructed image block.
[0339] For ease of understanding, here we combine the above Figure 3 This is for illustration, but not for limitation. In this embodiment, the entropy decoding module may perform the following steps: Figure 3 The entropy decoding process shown in FIG. 1 is performed by the parameter construction module and the inverse quantization module. Figure 3 The inverse quantization process shown in the figure, the synthetic transform module is performed through the synthetic transform network Figure 3 The synthesis transformation process in .
[0340] This embodiment obtains the characteristic channel distinguishing information and / or the spatial point distinguishing information and decodes the image code stream to obtain the quantized residual value; constructs the inverse quantization precision parameter corresponding to each quantized residual value according to the characteristic channel distinguishing information and / or the spatial point distinguishing information; dequantizes the quantized residual value based on the inverse quantization precision parameter to obtain the reconstructed residual value; and performs a synthetic transformation on the reconstructed residual value to obtain the reconstructed image block. Since the corresponding inverse quantization parameter is constructed according to the characteristic channel distinguishing information and / or the spatial point distinguishing information for dequantization, different quantization parameters can be set according to the difference in the characteristic channel and the spatial point image texture during the encoding process, so that more important features bear a smaller quantization loss, thereby improving the encoding and decoding performance.
[0341] In a possible implementation of this embodiment, the image code stream includes a first image code stream and a second image code stream, the first image code stream is used to transmit decoding auxiliary information, and the second image code stream is used to transmit residual data;
[0342] The entropy decoding module 10 is also used to extract coding distribution parameters from the first image code stream; decode the coding distribution parameters to obtain probability distribution parameters; quantize the probability distribution parameters to obtain distribution quantization parameters; and decode the second image code stream based on the distribution quantization parameters to obtain quantized residual values.
[0343] In a possible implementation of this embodiment, the entropy decoding module 10 is further used to construct a probability quantization parameter according to the feature channel distinction information and / or the spatial point distinction information; and quantize the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter.
[0344] In a possible implementation of this embodiment, the entropy decoding module 10 is further used to decode the first image code stream or the second image code stream to obtain feature channel distinction information and / or space point distinction information.
[0345] In a possible implementation manner of this embodiment, the image code stream further includes a third image code stream, and the third image code stream is used to transmit distinguishing information;
[0346] The entropy decoding module 10 is further used to decode the third image code stream to obtain feature channel distinction information and / or space point distinction information.
[0347] In a possible implementation of this embodiment, the parameter construction module 20 is further used to extract the quantization step corresponding to each type of feature channel from the feature channel distinction information; and construct the inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step.
[0348] In a possible implementation of this embodiment, the parameter construction module 20 is further used to extract the quantization step corresponding to each type of spatial point from the spatial point distinction information; and construct the inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step.
[0349] In a possible implementation of this embodiment, the parameter construction module 20 is also used to read the various types of divided spatial points from the spatial point distinction information; read the quantization step corresponding to each type of characteristic channel in each type of spatial point from the characteristic channel distinction information; and construct the inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step.
[0350] In a possible implementation of this embodiment, the parameter construction module 20 is also used to decode the image code stream to obtain probability distribution parameters; extract parameter interval thresholds from the feature channel distinction information; and construct inverse quantization precision parameters corresponding to each quantization residual value according to the probability distribution parameters, the quantization step size and the parameter interval threshold.
[0351] In a possible implementation of the present embodiment, the parameter construction module 20 is further used to extract the image block information and parameter setting rules corresponding to each feature channel from the feature channel distinction information; decode the image code stream to obtain probability distribution parameters; calculate the distribution parameter mean corresponding to each image block information according to the probability distribution parameters; match the distribution parameter mean with the parameter setting rules to obtain the quantization step corresponding to each image block information; and construct the inverse quantization precision parameters corresponding to each quantization residual value according to the quantization step.
[0352] In a possible implementation of this embodiment, the parameter construction module 20 is also used to parse the feature channel distinction information to obtain a set of segmented step sizes corresponding to each type of feature channel; extract the quantization step size corresponding to each channel segment from the segmented step size set; and construct inverse quantization precision parameters corresponding to each quantized residual value according to the quantization step size.
[0353] Reference Fig. 20 , Fig. 20 FIG. 4 is a structural block diagram of the first embodiment of the image encoding device of the present invention.
[0354] like Fig. 20 As shown, the image encoding device proposed in the embodiment of the present invention includes:
[0355] An analysis and transformation module 100 is used to perform analysis and transformation processing on the image block to be processed to obtain image features;
[0356] The residual calculation module 200 is used to perform residual calculation on the image features to obtain image residual values and probability distribution parameters;
[0357] A parameter construction module 300, for constructing quantization precision parameters corresponding to each characteristic channel according to characteristic channel distinction information and / or spatial point distinction information;
[0358] A quantization module 400, configured to perform quantization processing on the image residual value based on the quantization precision parameter to obtain a quantized residual value;
[0359] The entropy coding module 500 is used to write the probability distribution parameter and the quantized residual value into the image code stream.
[0360] For ease of understanding, here we combine the above Figure 3 This is for illustration, but not for limitation. In this embodiment, the analysis and transformation module may be implemented by analyzing the transformation network. Figure 3 The analysis and transformation process shown in FIG, the residual calculation module, the parameter construction module and the quantization module are executed as follows Figure 3 The quantization process shown in the figure, the entropy coding module performs the following Figure 3The entropy coding process in .
[0361] This embodiment obtains image features by analyzing and transforming the image blocks to be processed; performs residual calculation on the image features to obtain image residual values and probability distribution parameters; constructs quantization precision parameters corresponding to each image residual value based on feature channel distinction information and / or spatial point distinction information; performs quantization processing on the image residual values based on the quantization precision parameters to obtain quantized residual values; and writes the probability distribution parameters and the quantized residual values into the image code stream. Since different quantization parameters can also be set according to the differences in feature channel and spatial point image texture during the encoding process, more important features bear smaller quantization losses, thereby improving the encoding and decoding performance.
[0362] In a possible implementation of this embodiment, the image code stream includes a first image code stream and a second image code stream, the first image code stream is used to transmit decoding auxiliary information, and the second image code stream is used to transmit residual data;
[0363] The entropy coding module 500 is further used to write the probability distribution parameters into the first image code stream; construct distribution quantization parameters according to the probability distribution parameters; and write the quantization residual value into the second image code stream based on the distribution quantization parameters.
[0364] In a possible implementation of this embodiment, the entropy coding module 500 is further used to construct a probability quantization parameter according to the feature channel distinction information and / or the spatial point distinction information; and quantize the probability distribution parameter based on the probability quantization parameter to obtain a distribution quantization parameter.
[0365] In a possible implementation of this embodiment, the entropy coding module 500 is further used to write the feature channel distinguishing information and / or the space point distinguishing information into the first image code stream or the second image code stream.
[0366] In a possible implementation manner of this embodiment, the image code stream further includes a third image code stream, and the third image code stream is used to transmit distinguishing information;
[0367] The entropy coding module 500 is further used to write the feature channel distinguishing information and / or the space point distinguishing information into the third image code stream.
[0368] In a possible implementation of this embodiment, the parameter construction module 300 is further used to extract the quantization step corresponding to each type of feature channel from the feature channel distinction information; and construct the quantization precision parameters corresponding to each image residual value according to the quantization step.
[0369] In a possible implementation of this embodiment, the parameter construction module 300 is also used to extract a parameter interval threshold from the feature channel distinction information; and to construct quantization accuracy parameters corresponding to each image residual value according to the probability distribution parameter, the parameter interval threshold and the quantization step size.
[0370] In a possible implementation of this embodiment, the parameter construction module 300 is also used to parse the feature channel distinction information to obtain a set of segmented step sizes corresponding to each type of feature channel; extract the quantization step size corresponding to each channel segment from the segmented step size set; and construct quantization accuracy parameters corresponding to each image residual value according to the quantization step size.
[0371] In a possible implementation of this embodiment, the parameter construction module 300 is further used to extract the quantization step corresponding to each type of spatial point from the spatial point distinction information; and construct the quantization precision parameters corresponding to each image residual value according to the quantization step.
[0372] In a possible implementation of this embodiment, the parameter construction module 300 is also used to read the various types of divided spatial points from the spatial point distinction information; read the quantization step corresponding to each type of feature channel in each type of spatial point from the feature channel distinction information; and construct the quantization accuracy parameters corresponding to each image residual value according to the quantization step.
[0373] In a possible implementation of this embodiment, the entropy coding module 500 is further used to perform image decoding according to the probability distribution parameters, the quantized residual value and the characteristic channel distinction information to obtain a reconstructed image block and an image bit rate; adjust the characteristic channel distinction information and / or the spatial point distinction information according to the reconstructed image block and the image bit rate; if the current adjustment round is greater than or equal to the preset adjustment round, write the probability distribution parameters and the quantized residual value into the image code stream.
[0374] In a possible implementation of this embodiment, the entropy coding module 500 is further used to return to the step of constructing quantization precision parameters corresponding to each feature channel according to the feature channel distinction information if the current adjustment round is less than the preset adjustment round.
[0375] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0376] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0377] In addition, for technical details not fully described in this embodiment, reference may be made to the image encoding or image decoding method provided in any embodiment of the present invention, and will not be repeated here.
[0378] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0379] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0380] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, or by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0381] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. An image decoding method, characterized in that: The image decoding method comprises the following steps: Constructing the inverse quantization precision parameter corresponding to each quantized residual value according to the spatial point differentiation information; For any quantized residual value, the quantized residual value is dequantized based on the dequantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value.
2. The image decoding method according to claim 1, wherein: Before constructing the inverse quantization precision parameters corresponding to each quantized residual value according to the spatial point distinction information, it also includes: Decode the image code stream to obtain spatial point distinction information.
3. The image decoding method according to claim 1, wherein: The step of constructing the inverse quantization precision parameter corresponding to each quantized residual value according to the spatial point distinction information includes: Extracting the quantization step corresponding to each type of spatial point from the spatial point distinction information; The inverse quantization precision parameters corresponding to the respective quantized residual values are constructed according to the quantization step size.
4. The image decoding method according to claim 3, wherein: Different categories of spatial points correspond to different quantization steps.
5. An image coding method, characterized in that: The image encoding method comprises the following steps: Perform analysis and transformation on the image blocks to be processed to obtain image features; Performing residual calculation on the image features to obtain image residual values and probability distribution parameters; Construct the quantization accuracy parameters corresponding to the residual values of each image according to the spatial point differentiation information; quantizing the image residual value based on the quantization precision parameter to obtain a quantized residual value; The probability distribution parameter and the quantized residual value are written into an image code stream.
6. The image encoding method according to claim 5, wherein: The image encoding method further comprises: The spatial point distinction information is written into the image code stream.
7. The image encoding method according to claim 5, wherein: The step of constructing quantization precision parameters corresponding to the residual values of each image according to the spatial point distinction information includes: Extract the quantization step size corresponding to each type of spatial point from the spatial point distinction information; The quantization precision parameters corresponding to the respective image residual values are constructed according to the quantization step size.
8. The image decoding method according to claim 7, wherein: The image decoding method further includes: Divide the spatial points in the image into multiple categories according to the image texture; For each type of spatial point, determine the quantization step size of the spatial point; Different categories of spatial points correspond to different quantization steps.
9. An image decoding device, characterized in that: The image decoding device comprises: A parameter construction module is used to construct an inverse quantization precision parameter corresponding to each quantized residual value according to spatial point differentiation information; The inverse quantization module is used to inverse quantize any quantized residual value based on the inverse quantization precision parameter corresponding to the quantized residual value to obtain a reconstructed residual value.
10. An image coding device, characterized in that The image encoding device comprises: An analysis and transformation module is used to perform analysis and transformation on the image block to be processed to obtain image features; A residual calculation module, used to perform residual calculation on the image features to obtain image residual values and probability distribution parameters; A parameter construction module is used to construct the quantization accuracy parameters corresponding to each feature channel according to the spatial point distinction information; a quantization module, configured to perform quantization processing on the image residual value based on the quantization precision parameter to obtain a quantized residual value; The entropy coding module is used to write the probability distribution parameters and the quantized residual value into the image code stream.
11. A decoding device, characterized in that: The image decoding device includes: a processor, a memory, and a decoding program stored in the memory and executable on the processor, wherein the decoding program implements the image decoding method according to any one of claims 1 to 4 when executed by the processor.
12. A coding device, characterized in that The encoding device includes: a processor, a memory, and an encoding program stored in the memory and executable on the processor, wherein the encoding program implements the image encoding method according to any one of claims 5 to 8 when executed by the processor.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an image decoding program and / or an image encoding program; When the image decoding program is executed, the image decoding method according to any one of claims 1 to 4 is implemented, or, when the image encoding program is executed, the image encoding method according to any one of claims 5 to 8 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the image decoding method according to any one of claims 1 to 4 is implemented; or, when the image encoding program is executed, the image encoding method according to any one of claims 5 to 8 is implemented.
Citation Information
Patent Citations
Quantization adjustments for DC shift artifacts
CN101416511A
Encoding method and device, decoding method and device, electronic equipment and storage medium
CN111641832A
Quantization offset information determination method, image coding method and device and electronic equipment
CN111988611A
Video image coding and decoding method and related equipment
CN115118972A
Method and apparatus of adaptive quantization in video coding to improve 3D image quality
KR1020080053873A
